Skip to content

Commit a4f0c0b

Browse files
committed
[update] version 7.1.3
1 parent b0c3eab commit a4f0c0b

12 files changed

+148
-39
lines changed

codebase/dhtmlxgantt.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Type definitions for dhtmlxGantt 7.1.2
1+
// Type definitions for dhtmlxGantt 7.1.3
22
// Project: https://dhtmlx.com/docs/products/dhtmlxGantt
33

44
type GanttCallback = (...args: any[]) => any;

codebase/dhtmlxgantt.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codebase/dhtmlxgantt.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codebase/sources/dhtmlxgantt.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
@license
33
4-
dhtmlxGantt v.7.1.2 Standard
4+
dhtmlxGantt v.7.1.3 Standard
55
66
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
77

codebase/sources/dhtmlxgantt.js

+135-26
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
@license
33

4-
dhtmlxGantt v.7.1.2 Standard
4+
dhtmlxGantt v.7.1.3 Standard
55

66
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
77

@@ -6675,9 +6675,9 @@ exports.clearImmediate = typeof self !== "undefined" && self.clearImmediate || t
66756675
/***/ }),
66766676

66776677
/***/ "./node_modules/webpack/buildin/global.js":
6678-
/*!************************************************!*\
6679-
!*** ./node_modules/webpack/buildin/global.js ***!
6680-
\************************************************/
6678+
/*!***********************************!*\
6679+
!*** (webpack)/buildin/global.js ***!
6680+
\***********************************/
66816681
/*! no static exports found */
66826682
/***/ (function(module, exports) {
66836683

@@ -21032,8 +21032,20 @@ var ScrollbarCell = function (_super) {
2103221032
}
2103321033

2103421034
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;
2103721049
var horizontalScrollModifier = this.$gantt.config.horizontal_scroll_key;
2103821050

2103921051
if (horizontalScrollModifier !== false) {
@@ -27797,7 +27809,11 @@ function createHelper(view) {
2779727809
var globalRowHeight = this._getRowHeight();
2779827810

2779927811
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+
}
2780127817

2780227818
if (item.row_height && item.row_height !== globalRowHeight) {
2780327819
canUseSimpleCalc = false;
@@ -32613,18 +32629,28 @@ var LargerUnitsCache = __webpack_require__(/*! ./work_unit_cache */ "./sources/c
3261332629

3261432630
var utils = __webpack_require__(/*! ../../../utils/utils */ "./sources/utils/utils.js");
3261532631

32632+
var DateDurationCache = __webpack_require__(/*! ./work_unit_cache/date_duration_cache */ "./sources/core/worktime/strategy/work_unit_cache/date_duration_cache.ts").DateDurationCache;
32633+
3261632634
function CalendarWorkTimeStrategy(gantt, argumentsHelper) {
3261732635
this.argumentsHelper = argumentsHelper;
3261832636
this.$gantt = gantt;
3261932637
this._workingUnitsCache = createCacheObject();
3262032638
this._largeUnitsCache = new LargerUnitsCache(this);
32639+
this._dateDurationCache = new DateDurationCache();
3262132640
this._worktime = null;
3262232641
this._cached_timestamps = {};
3262332642
this._cached_timestamps_count = 0;
3262432643
}
3262532644

3262632645
CalendarWorkTimeStrategy.prototype = {
3262732646
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+
},
3262832654
// cache previously calculated worktime
3262932655
_getUnitOrder: function _getUnitOrder(unit) {
3263032656
for (var i = 0, len = this.units.length; i < len; i++) {
@@ -32942,9 +32968,7 @@ CalendarWorkTimeStrategy.prototype = {
3294232968

3294332969
this._parseSettings();
3294432970

32945-
this._workingUnitsCache.clear();
32946-
32947-
this._largeUnitsCache.clear();
32971+
this._clearCaches();
3294832972
},
3294932973
_parseSettings: function _parseSettings() {
3295032974
var settings = this.getConfig();
@@ -33015,9 +33039,7 @@ CalendarWorkTimeStrategy.prototype = {
3301533039
// this.$gantt.assert(false, "Invalid calendar settings, no worktime available");
3301633040
this._setConfig(JSON.parse(backup));
3301733041

33018-
this._workingUnitsCache.clear();
33019-
33020-
this._largeUnitsCache.clear();
33042+
this._clearCaches();
3302133043

3302233044
return false;
3302333045
}
@@ -33237,9 +33259,7 @@ CalendarWorkTimeStrategy.prototype = {
3323733259

3323833260
this._parseSettings();
3323933261

33240-
this._workingUnitsCache.clear();
33241-
33242-
this._largeUnitsCache.clear();
33262+
this._clearCaches();
3324333263
}, this));
3324433264
},
3324533265
unsetWorkTime: function unsetWorkTime(settings) {
@@ -33255,9 +33275,7 @@ CalendarWorkTimeStrategy.prototype = {
3325533275
} // Clear work units cache
3325633276

3325733277

33258-
this._workingUnitsCache.clear();
33259-
33260-
this._largeUnitsCache.clear();
33278+
this._clearCaches();
3326133279
}, this));
3326233280
},
3326333281
_isWorkTime: function _isWorkTime(date, unit) {
@@ -33293,9 +33311,13 @@ CalendarWorkTimeStrategy.prototype = {
3329333311

3329433312
if (!config.unit) {
3329533313
return false;
33296-
}
33314+
} //return this._calculateDuration(config.start_date, config.end_date, config.unit, config.step);
33315+
3329733316

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+
});
3329933321
},
3330033322
_calculateDuration: function _calculateDuration(from, to, unit, step) {
3330133323
var res = 0;
@@ -33350,11 +33372,13 @@ CalendarWorkTimeStrategy.prototype = {
3335033372
step = config.step;
3335133373
if (!unit) return false;
3335233374
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;
3335633377

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+
});
3335833382
},
3335933383
_calculateEndDate: function _calculateEndDate(from, duration, unit, step) {
3336033384
if (!unit) return false;
@@ -34298,6 +34322,91 @@ WorkTimeCalendarMerger.prototype = {
3429834322
};
3429934323
module.exports = WorkTimeCalendarMerger;
3430034324

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+
3430134410
/***/ }),
3430234411

3430334412
/***/ "./sources/core/worktime/strategy/work_unit_cache/index.ts":
@@ -39367,7 +39476,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3936739476

3936839477
function DHXGantt() {
3936939478
this.constants = __webpack_require__(/*! ../constants */ "./sources/constants/index.js");
39370-
this.version = "7.1.2";
39479+
this.version = "7.1.3";
3937139480
this.license = "gpl";
3937239481
this.templates = {};
3937339482
this.ext = {};

codebase/sources/skins/dhtmlxgantt_broadway.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
@license
33
4-
dhtmlxGantt v.7.1.2 Standard
4+
dhtmlxGantt v.7.1.3 Standard
55
66
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
77

codebase/sources/skins/dhtmlxgantt_contrast_black.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
@license
33
4-
dhtmlxGantt v.7.1.2 Standard
4+
dhtmlxGantt v.7.1.3 Standard
55
66
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
77

codebase/sources/skins/dhtmlxgantt_contrast_white.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
@license
33
4-
dhtmlxGantt v.7.1.2 Standard
4+
dhtmlxGantt v.7.1.3 Standard
55
66
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
77

codebase/sources/skins/dhtmlxgantt_material.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
@license
33
4-
dhtmlxGantt v.7.1.2 Standard
4+
dhtmlxGantt v.7.1.3 Standard
55
66
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
77

codebase/sources/skins/dhtmlxgantt_meadow.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
@license
33
4-
dhtmlxGantt v.7.1.2 Standard
4+
dhtmlxGantt v.7.1.3 Standard
55
66
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
77

codebase/sources/skins/dhtmlxgantt_skyblue.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
@license
33
4-
dhtmlxGantt v.7.1.2 Standard
4+
dhtmlxGantt v.7.1.3 Standard
55
66
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
77

codebase/sources/skins/dhtmlxgantt_terrace.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
@license
33
4-
dhtmlxGantt v.7.1.2 Standard
4+
dhtmlxGantt v.7.1.3 Standard
55
66
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
77

0 commit comments

Comments
 (0)