1
1
/*
2
2
@license
3
3
4
- dhtmlxGantt v.7.1.2 Standard
4
+ dhtmlxGantt v.7.1.3 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
@@ -6675,9 +6675,9 @@ exports.clearImmediate = typeof self !== "undefined" && self.clearImmediate || t
6675
6675
/***/ }),
6676
6676
6677
6677
/***/ "./node_modules/webpack/buildin/global.js":
6678
- /*!************************************************ !*\
6679
- !*** ./node_modules/ webpack/buildin/global.js ***!
6680
- \************************************************ /
6678
+ /*!***********************************!*\
6679
+ !*** ( webpack) /buildin/global.js ***!
6680
+ \***********************************/
6681
6681
/*! no static exports found */
6682
6682
/***/ (function(module, exports) {
6683
6683
@@ -21032,8 +21032,20 @@ var ScrollbarCell = function (_super) {
21032
21032
}
21033
21033
21034
21034
var ff = env.isFF;
21035
- var wx = ff ? e.deltaX * -20 * wheelSpeed.x : e.wheelDeltaX * 2 * wheelSpeed.x;
21036
- var wy = ff ? e.deltaY * -40 * wheelSpeed.y : e.wheelDelta * wheelSpeed.y;
21035
+ var deltaX = ff ? e.deltaX : e.wheelDeltaX;
21036
+ var deltaY = ff ? e.deltaY : e.wheelDelta;
21037
+ var multiplier = -20;
21038
+
21039
+ if (ff) {
21040
+ if (e.deltaMode !== 0) {
21041
+ multiplier = -40;
21042
+ } else {
21043
+ multiplier = -10;
21044
+ }
21045
+ }
21046
+
21047
+ var wx = ff ? deltaX * multiplier * wheelSpeed.x : deltaX * 2 * wheelSpeed.x;
21048
+ var wy = ff ? deltaY * multiplier * wheelSpeed.y : deltaY * wheelSpeed.y;
21037
21049
var horizontalScrollModifier = this.$gantt.config.horizontal_scroll_key;
21038
21050
21039
21051
if (horizontalScrollModifier !== false) {
@@ -27797,7 +27809,11 @@ function createHelper(view) {
27797
27809
var globalRowHeight = this._getRowHeight();
27798
27810
27799
27811
for (var i = 0; i < store.fullOrder.length; i++) {
27800
- var item = store.getItem(store.fullOrder[i]);
27812
+ var item = store.getItem(store.fullOrder[i]); // GS-1491: ignore the task when it is filtered:
27813
+
27814
+ if (!item) {
27815
+ continue;
27816
+ }
27801
27817
27802
27818
if (item.row_height && item.row_height !== globalRowHeight) {
27803
27819
canUseSimpleCalc = false;
@@ -32613,18 +32629,28 @@ var LargerUnitsCache = __webpack_require__(/*! ./work_unit_cache */ "./sources/c
32613
32629
32614
32630
var utils = __webpack_require__(/*! ../../../utils/utils */ "./sources/utils/utils.js");
32615
32631
32632
+ var DateDurationCache = __webpack_require__(/*! ./work_unit_cache/date_duration_cache */ "./sources/core/worktime/strategy/work_unit_cache/date_duration_cache.ts").DateDurationCache;
32633
+
32616
32634
function CalendarWorkTimeStrategy(gantt, argumentsHelper) {
32617
32635
this.argumentsHelper = argumentsHelper;
32618
32636
this.$gantt = gantt;
32619
32637
this._workingUnitsCache = createCacheObject();
32620
32638
this._largeUnitsCache = new LargerUnitsCache(this);
32639
+ this._dateDurationCache = new DateDurationCache();
32621
32640
this._worktime = null;
32622
32641
this._cached_timestamps = {};
32623
32642
this._cached_timestamps_count = 0;
32624
32643
}
32625
32644
32626
32645
CalendarWorkTimeStrategy.prototype = {
32627
32646
units: ["year", "month", "week", "day", "hour", "minute"],
32647
+ _clearCaches: function _clearCaches() {
32648
+ this._workingUnitsCache.clear();
32649
+
32650
+ this._largeUnitsCache.clear();
32651
+
32652
+ this._dateDurationCache.clear();
32653
+ },
32628
32654
// cache previously calculated worktime
32629
32655
_getUnitOrder: function _getUnitOrder(unit) {
32630
32656
for (var i = 0, len = this.units.length; i < len; i++) {
@@ -32942,9 +32968,7 @@ CalendarWorkTimeStrategy.prototype = {
32942
32968
32943
32969
this._parseSettings();
32944
32970
32945
- this._workingUnitsCache.clear();
32946
-
32947
- this._largeUnitsCache.clear();
32971
+ this._clearCaches();
32948
32972
},
32949
32973
_parseSettings: function _parseSettings() {
32950
32974
var settings = this.getConfig();
@@ -33015,9 +33039,7 @@ CalendarWorkTimeStrategy.prototype = {
33015
33039
// this.$gantt.assert(false, "Invalid calendar settings, no worktime available");
33016
33040
this._setConfig(JSON.parse(backup));
33017
33041
33018
- this._workingUnitsCache.clear();
33019
-
33020
- this._largeUnitsCache.clear();
33042
+ this._clearCaches();
33021
33043
33022
33044
return false;
33023
33045
}
@@ -33237,9 +33259,7 @@ CalendarWorkTimeStrategy.prototype = {
33237
33259
33238
33260
this._parseSettings();
33239
33261
33240
- this._workingUnitsCache.clear();
33241
-
33242
- this._largeUnitsCache.clear();
33262
+ this._clearCaches();
33243
33263
}, this));
33244
33264
},
33245
33265
unsetWorkTime: function unsetWorkTime(settings) {
@@ -33255,9 +33275,7 @@ CalendarWorkTimeStrategy.prototype = {
33255
33275
} // Clear work units cache
33256
33276
33257
33277
33258
- this._workingUnitsCache.clear();
33259
-
33260
- this._largeUnitsCache.clear();
33278
+ this._clearCaches();
33261
33279
}, this));
33262
33280
},
33263
33281
_isWorkTime: function _isWorkTime(date, unit) {
@@ -33293,9 +33311,13 @@ CalendarWorkTimeStrategy.prototype = {
33293
33311
33294
33312
if (!config.unit) {
33295
33313
return false;
33296
- }
33314
+ } //return this._calculateDuration(config.start_date, config.end_date, config.unit, config.step);
33315
+
33297
33316
33298
- return this._calculateDuration(config.start_date, config.end_date, config.unit, config.step);
33317
+ var self = this;
33318
+ return this._dateDurationCache.getDuration(config.start_date, config.end_date, config.unit, config.step, function () {
33319
+ return self._calculateDuration(config.start_date, config.end_date, config.unit, config.step);
33320
+ });
33299
33321
},
33300
33322
_calculateDuration: function _calculateDuration(from, to, unit, step) {
33301
33323
var res = 0;
@@ -33350,11 +33372,13 @@ CalendarWorkTimeStrategy.prototype = {
33350
33372
step = config.step;
33351
33373
if (!unit) return false;
33352
33374
var mult = config.duration >= 0 ? 1 : -1;
33353
- duration = Math.abs(duration * 1);
33354
-
33355
- var endDate = this._calculateEndDate(from, duration, unit, step * mult);
33375
+ duration = Math.abs(duration * 1); // var endDate = this._calculateEndDate(from, duration, unit, step * mult);
33376
+ // return endDate;
33356
33377
33357
- return endDate;
33378
+ var self = this;
33379
+ return this._dateDurationCache.getEndDate(from, duration, unit, step * mult, function () {
33380
+ return self._calculateEndDate(from, duration, unit, step * mult);
33381
+ });
33358
33382
},
33359
33383
_calculateEndDate: function _calculateEndDate(from, duration, unit, step) {
33360
33384
if (!unit) return false;
@@ -34298,6 +34322,91 @@ WorkTimeCalendarMerger.prototype = {
34298
34322
};
34299
34323
module.exports = WorkTimeCalendarMerger;
34300
34324
34325
+ /***/ }),
34326
+
34327
+ /***/ "./sources/core/worktime/strategy/work_unit_cache/date_duration_cache.ts":
34328
+ /*!*******************************************************************************!*\
34329
+ !*** ./sources/core/worktime/strategy/work_unit_cache/date_duration_cache.ts ***!
34330
+ \*******************************************************************************/
34331
+ /*! no static exports found */
34332
+ /***/ (function(module, exports, __webpack_require__) {
34333
+
34334
+ "use strict";
34335
+
34336
+ Object.defineProperty(exports, "__esModule", { value: true });
34337
+ var DateDurationCache = /** @class */ (function () {
34338
+ function DateDurationCache() {
34339
+ this.clear();
34340
+ }
34341
+ DateDurationCache.prototype._getCacheObject = function (startDate, unit, step) {
34342
+ var cache = this._cache;
34343
+ if (!cache[unit]) {
34344
+ cache[unit] = [];
34345
+ }
34346
+ var unitCache = cache[unit];
34347
+ if (!unitCache) {
34348
+ unitCache = cache[unit] = {};
34349
+ }
34350
+ var stepCache = unitCache[step];
34351
+ if (!stepCache) {
34352
+ stepCache = unitCache[step] = {};
34353
+ }
34354
+ var year = startDate.getFullYear();
34355
+ var yearCache = stepCache[year];
34356
+ if (!yearCache) {
34357
+ yearCache = stepCache[year] = { durations: {}, endDates: {} };
34358
+ }
34359
+ return yearCache;
34360
+ };
34361
+ DateDurationCache.prototype._endDateCacheKey = function (startDate, duration) {
34362
+ return String(startDate) + "-" + String(duration);
34363
+ };
34364
+ DateDurationCache.prototype._durationCacheKey = function (startDate, endDate) {
34365
+ return String(startDate) + "-" + String(endDate);
34366
+ };
34367
+ DateDurationCache.prototype.getEndDate = function (startDate, duration, unit, step, compute) {
34368
+ var cache = this._getCacheObject(startDate, unit, step);
34369
+ var startDateTimestamp = startDate.valueOf();
34370
+ var key = this._endDateCacheKey(startDateTimestamp, duration);
34371
+ var endDate;
34372
+ if (cache.endDates[key] === undefined) {
34373
+ var result = compute();
34374
+ var resultTimestamp = result.valueOf();
34375
+ cache.endDates[key] = resultTimestamp;
34376
+ cache.durations[this._durationCacheKey(startDateTimestamp, resultTimestamp)] = duration;
34377
+ endDate = result;
34378
+ }
34379
+ else {
34380
+ endDate = new Date(cache.endDates[key]);
34381
+ }
34382
+ return endDate;
34383
+ };
34384
+ DateDurationCache.prototype.getDuration = function (startDate, endDate, unit, step, compute) {
34385
+ var cache = this._getCacheObject(startDate, unit, step);
34386
+ var startDateTimestamp = startDate.valueOf();
34387
+ var endDateTimestamp = endDate.valueOf();
34388
+ var key = this._durationCacheKey(startDateTimestamp, endDateTimestamp);
34389
+ var duration;
34390
+ if (cache.durations[key] === undefined) {
34391
+ var result = compute();
34392
+ cache.durations[key] = result.valueOf();
34393
+ // can't populate end date due to logic of end date calculation, current unit tests capture it
34394
+ // cache.endDates[this._endDateCacheKey(startDateTimestamp, result)] = endDateTimestamp;
34395
+ duration = result;
34396
+ }
34397
+ else {
34398
+ duration = cache.durations[key];
34399
+ }
34400
+ return duration;
34401
+ };
34402
+ DateDurationCache.prototype.clear = function () {
34403
+ this._cache = {};
34404
+ };
34405
+ return DateDurationCache;
34406
+ }());
34407
+ exports.DateDurationCache = DateDurationCache;
34408
+
34409
+
34301
34410
/***/ }),
34302
34411
34303
34412
/***/ "./sources/core/worktime/strategy/work_unit_cache/index.ts":
@@ -39367,7 +39476,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
39367
39476
39368
39477
function DHXGantt() {
39369
39478
this.constants = __webpack_require__(/*! ../constants */ "./sources/constants/index.js");
39370
- this.version = "7.1.2 ";
39479
+ this.version = "7.1.3 ";
39371
39480
this.license = "gpl";
39372
39481
this.templates = {};
39373
39482
this.ext = {};
0 commit comments