1
1
/*
2
2
@license
3
3
4
- dhtmlxGantt v.7.0.1 Standard
4
+ dhtmlxGantt v.7.0.2 Standard
5
5
6
6
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
7
7
@@ -6871,7 +6871,7 @@ module.exports = function(gantt) {
6871
6871
Object.defineProperty(exports, "__esModule", { value: true });
6872
6872
var dateToStr = function (format, utc, gantt) {
6873
6873
return function (date) {
6874
- format.replace(/%[a-zA-Z]/g, function (a) {
6874
+ return format.replace(/%[a-zA-Z]/g, function (a) {
6875
6875
switch (a) {
6876
6876
case "%d": return utc ? gantt.date.to_fixed(date.getUTCDate()) : gantt.date.to_fixed(date.getDate());
6877
6877
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 () {
8530
8530
}
8531
8531
if (this.callEvent("onRowMark", [id, state, mode, invalid])) {
8532
8532
// default logic
8533
- str = this.styles[state ? mode : "clear"] + str;
8533
+ str = this.styles[state ? mode : "clear"] + " " + str;
8534
8534
this.$gantt[this._methods[0]](id, str);
8535
8535
if (invalid && invalid.details) {
8536
8536
str += this.styles[invalid + "_cell"];
@@ -9134,7 +9134,7 @@ var DataProcessor = /** @class */ (function () {
9134
9134
if (actionPromise) {
9135
9135
// neither promise nor {tid: newId} response object
9136
9136
if (!actionPromise.then &&
9137
- (actionPromise.id === undefined && actionPromise.tid === undefined)) {
9137
+ (actionPromise.id === undefined && actionPromise.tid === undefined && actionPromise.action === undefined )) {
9138
9138
throw new Error("Incorrect router return value. A Promise or a response object is expected");
9139
9139
}
9140
9140
if (actionPromise.then) {
@@ -14127,8 +14127,8 @@ function create(gantt){
14127
14127
right += cols[i].width;
14128
14128
} else {
14129
14129
left += cols[i].width;
14130
- }
14131
-
14130
+ }
14131
+
14132
14132
}
14133
14133
if (config.rtl) {
14134
14134
return {
@@ -14145,7 +14145,7 @@ function create(gantt){
14145
14145
width: width
14146
14146
};
14147
14147
}
14148
-
14148
+
14149
14149
}
14150
14150
14151
14151
function findVisibleIndex(grid, columnName) {
@@ -14271,7 +14271,7 @@ function create(gantt){
14271
14271
this.callEvent("onEditStart", [editorState]);
14272
14272
},
14273
14273
isVisible: function(){
14274
- return !!(this._editor && domHelpers.isChildOf(this._placeholder, document.body ));
14274
+ return !!(this._editor && domHelpers.isChildOf(this._placeholder, gantt.$root ));
14275
14275
},
14276
14276
show: function (itemId, columnName) {
14277
14277
if (this.isVisible()) {
@@ -31001,12 +31001,14 @@ exports.default = gantt;
31001
31001
31002
31002
Object.defineProperty(exports, "__esModule", { value: true });
31003
31003
var EventsManager = /** @class */ (function () {
31004
- function EventsManager() {
31004
+ function EventsManager(gantt ) {
31005
31005
this._mouseDown = false;
31006
+ this._gantt = gantt;
31006
31007
this._domEvents = gantt._createDomEventScope();
31007
31008
}
31008
31009
EventsManager.prototype.attach = function (selectedRegion, useKey) {
31009
31010
var _this = this;
31011
+ var gantt = this._gantt;
31010
31012
var _target = selectedRegion.getViewPort();
31011
31013
this._originPosition = window.getComputedStyle(_target).display;
31012
31014
this._restoreOriginPosition = function () {
@@ -31077,6 +31079,7 @@ var EventsManager = /** @class */ (function () {
31077
31079
});
31078
31080
};
31079
31081
EventsManager.prototype.detach = function () {
31082
+ var gantt = this._gantt;
31080
31083
this._domEvents.detachAll();
31081
31084
if (this._restoreOriginPosition) {
31082
31085
this._restoreOriginPosition();
@@ -31143,7 +31146,7 @@ function default_1(gantt) {
31143
31146
callback: undefined,
31144
31147
singleRow: false
31145
31148
};
31146
- var eventsManager = new eventsManager_1.EventsManager();
31149
+ var eventsManager = new eventsManager_1.EventsManager(gantt );
31147
31150
gantt.ext.clickDrag = eventsManager;
31148
31151
gantt.attachEvent("onGanttReady", function () {
31149
31152
var config = __assign({ viewPort: gantt.$task_data }, defaultConfig);
@@ -31156,7 +31159,7 @@ function default_1(gantt) {
31156
31159
config.useRequestAnimationFrame = clickDrag.useRequestAnimationFrame === undefined ?
31157
31160
defaultConfig.useRequestAnimationFrame : clickDrag.useRequestAnimationFrame;
31158
31161
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 );
31160
31163
gantt.ext.clickDrag.attach(selectedRegion, clickDrag.useKey);
31161
31164
}
31162
31165
});
@@ -31189,9 +31192,10 @@ function _countSize(start, end) {
31189
31192
return -result;
31190
31193
}
31191
31194
var SelectedRegion = /** @class */ (function () {
31192
- function SelectedRegion(config) {
31195
+ function SelectedRegion(config, gantt ) {
31193
31196
var _this = this;
31194
31197
this._el = document.createElement("div");
31198
+ this._gantt = gantt;
31195
31199
this._viewPort = config.viewPort;
31196
31200
this._el.classList.add(config.className);
31197
31201
if (typeof config.callback === "function") {
@@ -31213,6 +31217,7 @@ var SelectedRegion = /** @class */ (function () {
31213
31217
this._useRequestAnimationFrame = config.useRequestAnimationFrame;
31214
31218
}
31215
31219
SelectedRegion.prototype.setStyles = function () {
31220
+ var gantt = this._gantt;
31216
31221
if (this._singleRow) {
31217
31222
var height = gantt.config.row_height;
31218
31223
this._el.style.height = height + "px";
@@ -31264,11 +31269,13 @@ var SelectedRegion = /** @class */ (function () {
31264
31269
return this._viewPort;
31265
31270
};
31266
31271
SelectedRegion.prototype.setStart = function (startPoint) {
31272
+ var gantt = this._gantt;
31267
31273
this._startPoint = startPoint;
31268
31274
this._startDate = gantt.dateFromPos(this._startPoint.relative.left);
31269
31275
this._viewPort.callEvent("onBeforeDrag", [this._startPoint]);
31270
31276
};
31271
31277
SelectedRegion.prototype.setEnd = function (endPoint) {
31278
+ var gantt = this._gantt;
31272
31279
this._endPoint = endPoint;
31273
31280
if (this._singleRow) {
31274
31281
var height = gantt.config.row_height;
@@ -31294,6 +31301,7 @@ var SelectedRegion = /** @class */ (function () {
31294
31301
};
31295
31302
SelectedRegion.prototype.dragEnd = function (endPoint) {
31296
31303
var _a;
31304
+ var gantt = this._gantt;
31297
31305
if (endPoint.relative.left < 0) {
31298
31306
endPoint.relative.left = 0;
31299
31307
}
@@ -31314,6 +31322,7 @@ var SelectedRegion = /** @class */ (function () {
31314
31322
return this._singleRow;
31315
31323
};
31316
31324
SelectedRegion.prototype._getTasksByTop = function (start, end) {
31325
+ var gantt = this._gantt;
31317
31326
var startValue = start;
31318
31327
var endValue = end;
31319
31328
if (start > end) {
@@ -31350,7 +31359,7 @@ exports.SelectedRegion = SelectedRegion;
31350
31359
31351
31360
Object.defineProperty(exports, "__esModule", { value: true });
31352
31361
var EventsManager = /** @class */ (function () {
31353
- function EventsManager() {
31362
+ function EventsManager(gantt ) {
31354
31363
var _this = this;
31355
31364
this._mouseDown = false;
31356
31365
this._calculateDirectionVector = function () {
@@ -31385,6 +31394,7 @@ var EventsManager = /** @class */ (function () {
31385
31394
_this._timeline.$task.classList.remove("gantt_timeline_move_available");
31386
31395
};
31387
31396
this._getScrollPosition = function (timeline) {
31397
+ var gantt = _this._gantt;
31388
31398
return {
31389
31399
x: gantt.$ui.getView(timeline.$config.scrollX).getScrollState().position,
31390
31400
y: gantt.$ui.getView(timeline.$config.scrollY).getScrollState().position
@@ -31409,12 +31419,14 @@ var EventsManager = /** @class */ (function () {
31409
31419
return result;
31410
31420
};
31411
31421
this._setScrollPosition = function (timeline, coords) {
31422
+ var gantt = _this._gantt;
31412
31423
requestAnimationFrame(function () {
31413
31424
gantt.$ui.getView(timeline.$config.scrollX).scroll(coords.x);
31414
31425
gantt.$ui.getView(timeline.$config.scrollY).scroll(coords.y);
31415
31426
});
31416
31427
};
31417
31428
this._stopDrag = function (event) {
31429
+ var gantt = _this._gantt;
31418
31430
_this._trace = [];
31419
31431
gantt.$root.classList.remove("gantt_noselect");
31420
31432
if (_this._originalReadonly !== undefined) {
@@ -31432,6 +31444,7 @@ var EventsManager = /** @class */ (function () {
31432
31444
_this._mouseDown = false;
31433
31445
};
31434
31446
this._startDrag = function (event) {
31447
+ var gantt = _this._gantt;
31435
31448
_this._originAutoscroll = gantt.config.autoscroll;
31436
31449
gantt.config.autoscroll = false;
31437
31450
gantt.$root.classList.add("gantt_noselect");
@@ -31444,18 +31457,20 @@ var EventsManager = /** @class */ (function () {
31444
31457
_this._startPoint = { x: event.clientX, y: event.clientY };
31445
31458
_this._trace.push(_this._startPoint);
31446
31459
};
31460
+ this._gantt = gantt;
31447
31461
this._domEvents = gantt._createDomEventScope();
31448
31462
this._trace = [];
31449
31463
}
31450
- EventsManager.create = function () {
31451
- return new EventsManager();
31464
+ EventsManager.create = function (gantt ) {
31465
+ return new EventsManager(gantt );
31452
31466
};
31453
31467
EventsManager.prototype.destructor = function () {
31454
31468
this._domEvents.detachAll();
31455
31469
};
31456
31470
EventsManager.prototype.attach = function (timeline) {
31457
31471
var _this = this;
31458
31472
this._timeline = timeline;
31473
+ var gantt = this._gantt;
31459
31474
this._domEvents.attach(timeline.$task, "mousedown", function (event) {
31460
31475
if (!gantt.config.drag_timeline) {
31461
31476
return;
@@ -31554,7 +31569,7 @@ function default_1(gantt) {
31554
31569
gantt.ext = {};
31555
31570
}
31556
31571
gantt.ext.dragTimeline = {
31557
- create: function () { return eventsManager_1.EventsManager.create(); }
31572
+ create: function () { return eventsManager_1.EventsManager.create(gantt ); }
31558
31573
};
31559
31574
gantt.config.drag_timeline = {
31560
31575
enabled: true
@@ -35496,7 +35511,7 @@ exports.Undo = Undo;
35496
35511
35497
35512
function DHXGantt(){
35498
35513
this.constants = __webpack_require__(/*! ../constants */ "./sources/constants/index.js");
35499
- this.version = "7.0.1 ";
35514
+ this.version = "7.0.2 ";
35500
35515
this.license = "gpl";
35501
35516
this.templates = {};
35502
35517
this.ext = {};
0 commit comments