11/*
22@license
33
4- dhtmlxGantt v.7.0.1 Standard
4+ dhtmlxGantt v.7.0.2 Standard
55
66This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
77
@@ -6871,7 +6871,7 @@ module.exports = function(gantt) {
68716871Object.defineProperty(exports, "__esModule", { value: true });
68726872var dateToStr = function (format, utc, gantt) {
68736873 return function (date) {
6874- format.replace(/%[a-zA-Z]/g, function (a) {
6874+ return format.replace(/%[a-zA-Z]/g, function (a) {
68756875 switch (a) {
68766876 case "%d": return utc ? gantt.date.to_fixed(date.getUTCDate()) : gantt.date.to_fixed(date.getDate());
68776877 case "%m": return utc ? gantt.date.to_fixed((date.getUTCMonth() + 1)) : gantt.date.to_fixed((date.getMonth() + 1));
@@ -8530,7 +8530,7 @@ var DataProcessor = /** @class */ (function () {
85308530 }
85318531 if (this.callEvent("onRowMark", [id, state, mode, invalid])) {
85328532 // default logic
8533- str = this.styles[state ? mode : "clear"] + str;
8533+ str = this.styles[state ? mode : "clear"] + " " + str;
85348534 this.$gantt[this._methods[0]](id, str);
85358535 if (invalid && invalid.details) {
85368536 str += this.styles[invalid + "_cell"];
@@ -9134,7 +9134,7 @@ var DataProcessor = /** @class */ (function () {
91349134 if (actionPromise) {
91359135 // neither promise nor {tid: newId} response object
91369136 if (!actionPromise.then &&
9137- (actionPromise.id === undefined && actionPromise.tid === undefined)) {
9137+ (actionPromise.id === undefined && actionPromise.tid === undefined && actionPromise.action === undefined )) {
91389138 throw new Error("Incorrect router return value. A Promise or a response object is expected");
91399139 }
91409140 if (actionPromise.then) {
@@ -14127,8 +14127,8 @@ function create(gantt){
1412714127 right += cols[i].width;
1412814128 } else {
1412914129 left += cols[i].width;
14130- }
14131-
14130+ }
14131+
1413214132 }
1413314133 if (config.rtl) {
1413414134 return {
@@ -14145,7 +14145,7 @@ function create(gantt){
1414514145 width: width
1414614146 };
1414714147 }
14148-
14148+
1414914149 }
1415014150
1415114151 function findVisibleIndex(grid, columnName) {
@@ -14271,7 +14271,7 @@ function create(gantt){
1427114271 this.callEvent("onEditStart", [editorState]);
1427214272 },
1427314273 isVisible: function(){
14274- return !!(this._editor && domHelpers.isChildOf(this._placeholder, document.body ));
14274+ return !!(this._editor && domHelpers.isChildOf(this._placeholder, gantt.$root ));
1427514275 },
1427614276 show: function (itemId, columnName) {
1427714277 if (this.isVisible()) {
@@ -31001,12 +31001,14 @@ exports.default = gantt;
3100131001
3100231002Object.defineProperty(exports, "__esModule", { value: true });
3100331003var EventsManager = /** @class */ (function () {
31004- function EventsManager() {
31004+ function EventsManager(gantt ) {
3100531005 this._mouseDown = false;
31006+ this._gantt = gantt;
3100631007 this._domEvents = gantt._createDomEventScope();
3100731008 }
3100831009 EventsManager.prototype.attach = function (selectedRegion, useKey) {
3100931010 var _this = this;
31011+ var gantt = this._gantt;
3101031012 var _target = selectedRegion.getViewPort();
3101131013 this._originPosition = window.getComputedStyle(_target).display;
3101231014 this._restoreOriginPosition = function () {
@@ -31077,6 +31079,7 @@ var EventsManager = /** @class */ (function () {
3107731079 });
3107831080 };
3107931081 EventsManager.prototype.detach = function () {
31082+ var gantt = this._gantt;
3108031083 this._domEvents.detachAll();
3108131084 if (this._restoreOriginPosition) {
3108231085 this._restoreOriginPosition();
@@ -31143,7 +31146,7 @@ function default_1(gantt) {
3114331146 callback: undefined,
3114431147 singleRow: false
3114531148 };
31146- var eventsManager = new eventsManager_1.EventsManager();
31149+ var eventsManager = new eventsManager_1.EventsManager(gantt );
3114731150 gantt.ext.clickDrag = eventsManager;
3114831151 gantt.attachEvent("onGanttReady", function () {
3114931152 var config = __assign({ viewPort: gantt.$task_data }, defaultConfig);
@@ -31156,7 +31159,7 @@ function default_1(gantt) {
3115631159 config.useRequestAnimationFrame = clickDrag.useRequestAnimationFrame === undefined ?
3115731160 defaultConfig.useRequestAnimationFrame : clickDrag.useRequestAnimationFrame;
3115831161 config.singleRow = clickDrag.singleRow === undefined ? defaultConfig.singleRow : clickDrag.singleRow;
31159- var selectedRegion = new selectedRegion_1.SelectedRegion(config);
31162+ var selectedRegion = new selectedRegion_1.SelectedRegion(config, gantt );
3116031163 gantt.ext.clickDrag.attach(selectedRegion, clickDrag.useKey);
3116131164 }
3116231165 });
@@ -31189,9 +31192,10 @@ function _countSize(start, end) {
3118931192 return -result;
3119031193}
3119131194var SelectedRegion = /** @class */ (function () {
31192- function SelectedRegion(config) {
31195+ function SelectedRegion(config, gantt ) {
3119331196 var _this = this;
3119431197 this._el = document.createElement("div");
31198+ this._gantt = gantt;
3119531199 this._viewPort = config.viewPort;
3119631200 this._el.classList.add(config.className);
3119731201 if (typeof config.callback === "function") {
@@ -31213,6 +31217,7 @@ var SelectedRegion = /** @class */ (function () {
3121331217 this._useRequestAnimationFrame = config.useRequestAnimationFrame;
3121431218 }
3121531219 SelectedRegion.prototype.setStyles = function () {
31220+ var gantt = this._gantt;
3121631221 if (this._singleRow) {
3121731222 var height = gantt.config.row_height;
3121831223 this._el.style.height = height + "px";
@@ -31264,11 +31269,13 @@ var SelectedRegion = /** @class */ (function () {
3126431269 return this._viewPort;
3126531270 };
3126631271 SelectedRegion.prototype.setStart = function (startPoint) {
31272+ var gantt = this._gantt;
3126731273 this._startPoint = startPoint;
3126831274 this._startDate = gantt.dateFromPos(this._startPoint.relative.left);
3126931275 this._viewPort.callEvent("onBeforeDrag", [this._startPoint]);
3127031276 };
3127131277 SelectedRegion.prototype.setEnd = function (endPoint) {
31278+ var gantt = this._gantt;
3127231279 this._endPoint = endPoint;
3127331280 if (this._singleRow) {
3127431281 var height = gantt.config.row_height;
@@ -31294,6 +31301,7 @@ var SelectedRegion = /** @class */ (function () {
3129431301 };
3129531302 SelectedRegion.prototype.dragEnd = function (endPoint) {
3129631303 var _a;
31304+ var gantt = this._gantt;
3129731305 if (endPoint.relative.left < 0) {
3129831306 endPoint.relative.left = 0;
3129931307 }
@@ -31314,6 +31322,7 @@ var SelectedRegion = /** @class */ (function () {
3131431322 return this._singleRow;
3131531323 };
3131631324 SelectedRegion.prototype._getTasksByTop = function (start, end) {
31325+ var gantt = this._gantt;
3131731326 var startValue = start;
3131831327 var endValue = end;
3131931328 if (start > end) {
@@ -31350,7 +31359,7 @@ exports.SelectedRegion = SelectedRegion;
3135031359
3135131360Object.defineProperty(exports, "__esModule", { value: true });
3135231361var EventsManager = /** @class */ (function () {
31353- function EventsManager() {
31362+ function EventsManager(gantt ) {
3135431363 var _this = this;
3135531364 this._mouseDown = false;
3135631365 this._calculateDirectionVector = function () {
@@ -31385,6 +31394,7 @@ var EventsManager = /** @class */ (function () {
3138531394 _this._timeline.$task.classList.remove("gantt_timeline_move_available");
3138631395 };
3138731396 this._getScrollPosition = function (timeline) {
31397+ var gantt = _this._gantt;
3138831398 return {
3138931399 x: gantt.$ui.getView(timeline.$config.scrollX).getScrollState().position,
3139031400 y: gantt.$ui.getView(timeline.$config.scrollY).getScrollState().position
@@ -31409,12 +31419,14 @@ var EventsManager = /** @class */ (function () {
3140931419 return result;
3141031420 };
3141131421 this._setScrollPosition = function (timeline, coords) {
31422+ var gantt = _this._gantt;
3141231423 requestAnimationFrame(function () {
3141331424 gantt.$ui.getView(timeline.$config.scrollX).scroll(coords.x);
3141431425 gantt.$ui.getView(timeline.$config.scrollY).scroll(coords.y);
3141531426 });
3141631427 };
3141731428 this._stopDrag = function (event) {
31429+ var gantt = _this._gantt;
3141831430 _this._trace = [];
3141931431 gantt.$root.classList.remove("gantt_noselect");
3142031432 if (_this._originalReadonly !== undefined) {
@@ -31432,6 +31444,7 @@ var EventsManager = /** @class */ (function () {
3143231444 _this._mouseDown = false;
3143331445 };
3143431446 this._startDrag = function (event) {
31447+ var gantt = _this._gantt;
3143531448 _this._originAutoscroll = gantt.config.autoscroll;
3143631449 gantt.config.autoscroll = false;
3143731450 gantt.$root.classList.add("gantt_noselect");
@@ -31444,18 +31457,20 @@ var EventsManager = /** @class */ (function () {
3144431457 _this._startPoint = { x: event.clientX, y: event.clientY };
3144531458 _this._trace.push(_this._startPoint);
3144631459 };
31460+ this._gantt = gantt;
3144731461 this._domEvents = gantt._createDomEventScope();
3144831462 this._trace = [];
3144931463 }
31450- EventsManager.create = function () {
31451- return new EventsManager();
31464+ EventsManager.create = function (gantt ) {
31465+ return new EventsManager(gantt );
3145231466 };
3145331467 EventsManager.prototype.destructor = function () {
3145431468 this._domEvents.detachAll();
3145531469 };
3145631470 EventsManager.prototype.attach = function (timeline) {
3145731471 var _this = this;
3145831472 this._timeline = timeline;
31473+ var gantt = this._gantt;
3145931474 this._domEvents.attach(timeline.$task, "mousedown", function (event) {
3146031475 if (!gantt.config.drag_timeline) {
3146131476 return;
@@ -31554,7 +31569,7 @@ function default_1(gantt) {
3155431569 gantt.ext = {};
3155531570 }
3155631571 gantt.ext.dragTimeline = {
31557- create: function () { return eventsManager_1.EventsManager.create(); }
31572+ create: function () { return eventsManager_1.EventsManager.create(gantt ); }
3155831573 };
3155931574 gantt.config.drag_timeline = {
3156031575 enabled: true
@@ -35496,7 +35511,7 @@ exports.Undo = Undo;
3549635511
3549735512function DHXGantt(){
3549835513 this.constants = __webpack_require__(/*! ../constants */ "./sources/constants/index.js");
35499- this.version = "7.0.1 ";
35514+ this.version = "7.0.2 ";
3550035515 this.license = "gpl";
3550135516 this.templates = {};
3550235517 this.ext = {};
0 commit comments