11/*
22@license
33
4- dhtmlxGantt v.7.1.11 Standard
4+ dhtmlxGantt v.7.1.12 Standard
55
66This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
77
@@ -7530,6 +7530,13 @@ module.exports = function (gantt) {
75307530 modifiedDate.setTime(modifiedDate.getTime() + 60 * 60 * 1000 * (24 - modifiedDate.getHours()));
75317531 }
75327532
7533+ var worktimeCalculation = inc > 1;
7534+
7535+ if (worktimeCalculation && getHoursCondition) {
7536+ // try to shift the modified Date to 00:00
7537+ modifiedDate.setHours(0);
7538+ }
7539+
75337540 return modifiedDate;
75347541 },
75357542 add: function add(date, inc, mode) {
@@ -8699,7 +8706,8 @@ module.exports = function (gantt) {
86998706 };
87008707
87018708 var getDefaultTaskDate = function getDefaultTaskDate(item, parent_id) {
8702- var parent = parent_id && parent_id != gantt.config.root_id ? gantt.getTask(parent_id) : false,
8709+ var parentExists = parent_id && parent_id != gantt.config.root_id && gantt.isTaskExists(parent_id);
8710+ var parent = parentExists ? gantt.getTask(parent_id) : false,
87038711 startDate = null;
87048712
87058713 if (parent) {
@@ -12830,11 +12838,12 @@ var createDatastoreFacade = function createDatastoreFacade() {
1283012838 store.select(id); // GS-730. Split task is not included in the tree,
1283112839 // so the datastore renderer will think that the task is not visible
1283212840
12833- if (oldSelectId && store.pull[oldSelectId].$split_subtask) {
12841+ if (oldSelectId && store.pull[oldSelectId].$split_subtask && oldSelectId != id ) {
1283412842 this.refreshTask(oldSelectId);
1283512843 }
1283612844
12837- if (store.pull[id].$split_subtask) {
12845+ if (store.pull[id].$split_subtask && oldSelectId != id) {
12846+ // GS-1850. Do not repaint split task after double click
1283812847 this.refreshTask(id);
1283912848 }
1284012849 }
@@ -12896,7 +12905,13 @@ var createLinksStoreFacade = function createLinksStoreFacade() {
1289612905 return this.$data.linksStore.exists(id);
1289712906 },
1289812907 addLink: function addLink(link) {
12899- return this.$data.linksStore.addItem(link);
12908+ var newLink = this.$data.linksStore.addItem(link); // GS-1222. Update fullOrder otherwise the link won't appear after render
12909+
12910+ if (this.$data.linksStore.isSilent()) {
12911+ this.$data.linksStore.fullOrder.push(newLink);
12912+ }
12913+
12914+ return newLink;
1290012915 },
1290112916 updateLink: function updateLink(id, data) {
1290212917 if (!utils.defined(data)) data = this.getLink(id);
@@ -13135,7 +13150,7 @@ function createLayoutFacade() {
1313513150 } else {
1313613151 var grid = getGrid(gantt);
1313713152
13138- if (grid || !grid.$config.hidden) {
13153+ if (grid && !grid.$config.hidden) {
1313913154 return grid;
1314013155 } else {
1314113156 return null;
@@ -13156,6 +13171,11 @@ function createLayoutFacade() {
1315613171 baseCell = getGrid(gantt);
1315713172 } else {
1315813173 baseCell = getBaseCell(gantt);
13174+ } // GS-1827. If there is no grid and timeline, there is no scrollbar for them
13175+
13176+
13177+ if (!baseCell) {
13178+ return null;
1315913179 }
1316013180
1316113181 var verticalScrollbar = getAttachedScrollbar(gantt, baseCell, "scrollY");
@@ -13165,7 +13185,7 @@ function createLayoutFacade() {
1316513185 function getHorizontalScrollbar(gantt) {
1316613186 var baseCell = getBaseCell(gantt);
1316713187
13168- if (baseCell.id == "grid") {
13188+ if (!baseCell || baseCell.id == "grid") {
1316913189 return null; // if the timeline is not displayed, do not return the scrollbar
1317013190 }
1317113191
@@ -20252,11 +20272,53 @@ var Layout = function (_super) {
2025220272 }
2025320273
2025420274 var autosize = this._getAutosizeMode(this.$config.autosize);
20275+ /* // possible to rollback set content size when autisize is disabled, not sure if need to
20276+ contentViews.forEach(function(view){
20277+ const parent = view.$parent;
20278+ if(!autosize.x){
20279+ if(parent.$config.$originalWidthStored){
20280+ parent.$config.$originalWidthStored = false;
20281+ parent.$config.width = parent.$config.$originalWidth;
20282+ parent.$config.$originalWidth = undefined;
20283+ }
20284+ }
20285+
20286+ if(!autosize.y){
20287+ if(parent.$config.$originalHeightStored){
20288+ parent.$config.$originalHeightStored = false;
20289+ parent.$config.height = parent.$config.$originalHeight;
20290+ parent.$config.$originalHeight = undefined;
20291+ }
20292+ }
20293+ });*/
20294+
2025520295
2025620296 var scrollChanged = this._resizeScrollbars(autosize, scrollbars);
2025720297
2025820298 if (this.$config.autosize) {
2025920299 this.autosize(this.$config.autosize);
20300+ contentViews.forEach(function (view) {
20301+ var parent = view.$parent;
20302+ var sizes = parent.getContentSize(autosize);
20303+
20304+ if (autosize.x) {
20305+ if (!parent.$config.$originalWidthStored) {
20306+ parent.$config.$originalWidthStored = true;
20307+ parent.$config.$originalWidth = parent.$config.width;
20308+ }
20309+
20310+ parent.$config.width = sizes.width;
20311+ }
20312+
20313+ if (autosize.y) {
20314+ if (!parent.$config.$originalHeightStored) {
20315+ parent.$config.$originalHeightStored = true;
20316+ parent.$config.$originalHeight = parent.$config.height;
20317+ }
20318+
20319+ parent.$config.height = sizes.height;
20320+ }
20321+ });
2026020322 scrollChanged = true;
2026120323 }
2026220324
@@ -22738,6 +22800,11 @@ module.exports = function (gantt) {
2273822800 lightboxDiv.firstChild.style.cursor = "pointer";
2273922801
2274022802 gantt._init_dnd_events();
22803+ } // GS-1428: If there is lightbox node, we need to remove it from the DOM
22804+
22805+
22806+ if (this._lightbox) {
22807+ this.resetLightbox();
2274122808 }
2274222809
2274322810 document.body.insertBefore(lightboxDiv, document.body.firstChild);
@@ -33201,7 +33268,13 @@ CalendarWorkTimeStrategy.prototype = {
3320133268 return timestamp;
3320233269 },
3320333270 _checkIfWorkingUnit: function _checkIfWorkingUnit(date, unit) {
33204- if (!this["_is_work_" + unit]) return true;
33271+ // GS-596: If unit is larger than day or has a custom logic
33272+ if (!this["_is_work_" + unit]) {
33273+ var from = this.$gantt.date["".concat(unit, "_start")](new Date(date));
33274+ var to = this.$gantt.date.add(from, 1, unit);
33275+ return this.hasDuration(from, to);
33276+ }
33277+
3320533278 return this["_is_work_" + unit](date);
3320633279 },
3320733280 //checkings for particular time units
@@ -33913,23 +33986,23 @@ CalendarWorkTimeStrategy.prototype = {
3391333986 _addInterval: function _addInterval(start, duration, unit, step, stopAction) {
3391433987 var added = 0;
3391533988 var current = start;
33916- var previous = new Date(current.valueOf() - 1);
33917- var timezoneDifferenceWithPrevious = current.getTimezoneOffset() - previous.getTimezoneOffset();
33989+ var dstShift = false;
3391833990
3391933991 while (added < duration && !(stopAction && stopAction(current))) {
33920- var next = this._nextDate(current, unit, step);
33992+ var next = this._nextDate(current, unit, step); // GS-1501. Correct hours after DST change
3392133993
33922- if (timezoneDifferenceWithPrevious < 0 && step > 0) {
33923- // the step parameter is for backward scheduling and startDate calcuation
33924- next.setTime(next.getTime() + 60 * 1000 * timezoneDifferenceWithPrevious);
33925- timezoneDifferenceWithPrevious = false;
33926- }
3392733994
33928- var timezoneDifference = next.getTimezoneOffset() - current.getTimezoneOffset();
33995+ if (unit == "day") {
33996+ dstShift = dstShift || !current.getHours() && next.getHours();
3392933997
33930- if (timezoneDifference < 0 && step > 0 && unit != "day") {
33931- // the step parameter is for backward scheduling and startDate calcuation
33932- next.setTime(next.getTime() + 60 * 1000 * timezoneDifference);
33998+ if (dstShift) {
33999+ next.setHours(0);
34000+
34001+ if (next.getHours()) {// the day when the timezone is changed, try to correct hours next time
34002+ } else {
34003+ dstShift = false;
34004+ }
34005+ }
3393334006 }
3393434007
3393534008 var dateValue = new Date(next.valueOf() + 1);
@@ -33940,7 +34013,7 @@ CalendarWorkTimeStrategy.prototype = {
3394034013
3394134014 var workTimeCheck = this._isWorkTime(dateValue, unit);
3394234015
33943- if (workTimeCheck) {
34016+ if (workTimeCheck && !dstShift ) {
3394434017 added++;
3394534018 }
3394634019
@@ -38276,6 +38349,19 @@ module.exports = function (gantt) {
3827638349 var multiSelect = gantt.config.multiselect;
3827738350
3827838351 var singleSelection = function () {
38352+ // GS-719: If the multiselect extension is added we still need a way
38353+ // to open the inline editors after clicking on the cells in the grid
38354+ var controller = gantt.ext.inlineEditors;
38355+ var state = controller.getState();
38356+ var cell = controller.locateCell(e.target);
38357+
38358+ if (gantt.config.inline_editors_multiselect_open && cell && controller.getEditorConfig(cell.columnName)) {
38359+ if (controller.isVisible() && state.id == cell.id && state.columnName == cell.columnName) {// do nothing if editor is already active in this cell
38360+ } else {
38361+ controller.startEdit(cell.id, cell.columnName);
38362+ }
38363+ }
38364+
3827938365 this.setFirstSelected(target_ev);
3828038366
3828138367 if (!this.isSelected(target_ev)) {
@@ -40050,7 +40136,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
4005040136
4005140137function DHXGantt() {
4005240138 this.constants = __webpack_require__(/*! ../constants */ "./sources/constants/index.js");
40053- this.version = "7.1.11 ";
40139+ this.version = "7.1.12 ";
4005440140 this.license = "gpl";
4005540141 this.templates = {};
4005640142 this.ext = {};
0 commit comments