11/*
22@license
33
4- dhtmlxGantt v.8.0.3 Standard
4+ dhtmlxGantt v.8.0.4 Standard
55
66This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
77
@@ -10558,6 +10558,7 @@ var DataProcessorEvents = /** @class */ (function () {
1055810558 methods.delete.call(gantt, id);
1055910559 }
1056010560 });
10561+ this.handleResourceCRUD(dp, gantt);
1056110562 this.handleResourceAssignmentCRUD(dp, gantt);
1056210563 };
1056310564 DataProcessorEvents.prototype.clientSideDelete = function (id, dp, gantt) {
@@ -21062,6 +21063,7 @@ var Layout = function (_super) {
2106221063 var scrollChanged = false;
2106321064 var visibleScrollbars = [],
2106421065 hiddenScrollbars = [];
21066+ var scrollbarsToHide = [];
2106521067
2106621068 function showScrollbar(scrollbar) {
2106721069 scrollbar.$parent.show();
@@ -21083,7 +21085,8 @@ var Layout = function (_super) {
2108321085 if (autosize[scrollbar.$config.scroll]) {
2108421086 hideScrollbar(scrollbar);
2108521087 } else if (scrollbar.shouldHide()) {
21086- hideScrollbar(scrollbar);
21088+ //hideScrollbar(scrollbar);
21089+ scrollbarsToHide.push(scrollbar);
2108721090 } else if (scrollbar.shouldShow()) {
2108821091 showScrollbar(scrollbar);
2108921092 } else {
@@ -21101,7 +21104,14 @@ var Layout = function (_super) {
2110121104 if (visibleScrollbars[i].$config.group) {
2110221105 visibleGroups[visibleScrollbars[i].$config.group] = true;
2110321106 }
21104- }
21107+ } // GS-2220
21108+
21109+
21110+ scrollbarsToHide.forEach(function (scrollbar) {
21111+ if (!(scrollbar.$config.group && visibleGroups[scrollbar.$config.group])) {
21112+ hideScrollbar(scrollbar);
21113+ }
21114+ });
2110521115
2110621116 for (var i = 0; i < hiddenScrollbars.length; i++) {
2110721117 scrollbar = hiddenScrollbars[i];
@@ -35694,48 +35704,56 @@ CalendarWorkTimeStrategy.prototype = {
3569435704
3569535705 var isWorkHour = false;
3569635706 var workInterval = null;
35707+ var prevInterval = null;
3569735708
3569835709 for (var i = daySchedule.length - 1; i >= 0; i--) {
3569935710 if (daySchedule[i].start < timestamp - 1 && daySchedule[i].end >= timestamp - 1) {
3570035711 isWorkHour = true;
3570135712 workInterval = daySchedule[i];
35713+ prevInterval = daySchedule[i - 1];
3570235714 break;
3570335715 }
3570435716 }
3570535717
3570635718 if (isWorkHour) {
35719+ // we're at the end of worktime interval and subtracting more than the duration of the interval
35720+ // -> subtract the duration of the interval and move to the start of the interval (we're moving from end)
3570735721 if (timestamp === workInterval.end && left >= workInterval.durationMinutes) {
3570835722 added += workInterval.durationMinutes;
3570935723 start = this.$gantt.date.add(start, -workInterval.durationMinutes, "minute");
35710- } else if (!minutePrecision && left <= timestamp / 60 - workInterval.startMinute) {
35711- added += left;
35712- start = this.$gantt.date.add(start, -left, "minute");
35713- } else if (minutePrecision) {
35714- // GS-2129. If the working time is set in minutes, we accumulate the working time in minutes from right to left
35715- var previousHour = this._getClosestWorkTime(this._nextDate(start, "hour", step), "hour");
35716-
35717- var _minutesInHour = this._getMinutesPerHour(previousHour);
35724+ } // worktime is set in whole hours (no intervals like 9:15-10:00)
35725+ // the amount we need to subtract lies inside the interval
35726+ else if (!minutePrecision && left <= timestamp / 60 - workInterval.startMinute) {
35727+ added += left;
35728+ start = this.$gantt.date.add(start, -left, "minute");
35729+ } else if (minutePrecision) {
35730+ // GS-2129. If the working time is set in minutes, we accumulate the working time in minutes from right to left
35731+ // duration we need to subtract lies completely inside the work interval
35732+ if (left <= timestamp / 60 - workInterval.startMinute) {
35733+ added += left;
35734+ start = this.$gantt.date.add(start, -left, "minute");
35735+ } else {
35736+ // we need to go trough multiple work intervals to subtract needed time
35737+ added += timestamp / 60 - workInterval.startMinute;
3571835738
35719- if (left < _minutesInHour && _minutesInHour <= 60) {
35720- _minutesInHour = left;
35721- start = this.$gantt.date.add(start, -_minutesInHour, "minute");
35739+ if (prevInterval) {
35740+ start = new Date(start.getFullYear(), start.getMonth(), start.getDate(), 0, 0, prevInterval.end);
35741+ } else {
35742+ start = this.$gantt.date.day_start(start);
35743+ }
35744+ }
3572235745 } else {
35723- start = previousHour;
35724- }
35746+ var minutesInHour = this._getMinutesPerHour(start);
3572535747
35726- added += _minutesInHour;
35727- } else {
35728- var minutesInHour = this._getMinutesPerHour(start);
35729-
35730- if (minutesInHour <= left) {
35731- added += minutesInHour;
35732- start = this._nextDate(start, "hour", step);
35733- } else {
35734- addedInterval = this._subtractMinutesUntilHourStart(start, left);
35735- added += addedInterval.added;
35736- start = addedInterval.end;
35748+ if (minutesInHour <= left) {
35749+ added += minutesInHour;
35750+ start = this._nextDate(start, "hour", step);
35751+ } else {
35752+ addedInterval = this._subtractMinutesUntilHourStart(start, left);
35753+ added += addedInterval.added;
35754+ start = addedInterval.end;
35755+ }
3573735756 }
35738- }
3573935757 } else {
3574035758 if (start.getHours() === 0 && start.getMinutes() === 0 && start.getSeconds() === 0) {
3574135759 var prev = this._getClosestWorkTimePast(start, "hour");
@@ -40955,10 +40973,20 @@ function default_1(gantt) {
4095540973 undo: function () { return _undo.undo(); },
4095640974 redo: function () { return _undo.redo(); },
4095740975 getUndoStack: function () { return _undo.getUndoStack(); },
40976+ setUndoStack: function (stack) { return _undo.setUndoStack(stack); },
4095840977 getRedoStack: function () { return _undo.getRedoStack(); },
40978+ setRedoStack: function (stack) { return _undo.setRedoStack(stack); },
4095940979 clearUndoStack: function () { return _undo.clearUndoStack(); },
4096040980 clearRedoStack: function () { return _undo.clearRedoStack(); },
40961- saveState: function (id, type) { return monitor.store(id, type, true); }
40981+ saveState: function (id, type) { return monitor.store(id, type, true); },
40982+ getInitialState: function (id, type) {
40983+ if (type === gantt.config.undo_types.link) {
40984+ return monitor.getInitialLink(id);
40985+ }
40986+ else {
40987+ return monitor.getInitialTask(id);
40988+ }
40989+ }
4096240990 };
4096340991 gantt.undo = gantt.ext.undo.undo;
4096440992 gantt.redo = gantt.ext.undo.redo;
@@ -41475,9 +41503,15 @@ var Undo = /** @class */ (function () {
4147541503 Undo.prototype.getUndoStack = function () {
4147641504 return this._undoStack;
4147741505 };
41506+ Undo.prototype.setUndoStack = function (stack) {
41507+ this._undoStack = stack;
41508+ };
4147841509 Undo.prototype.getRedoStack = function () {
4147941510 return this._redoStack;
4148041511 };
41512+ Undo.prototype.setRedoStack = function (stack) {
41513+ this._redoStack = stack;
41514+ };
4148141515 Undo.prototype.clearUndoStack = function () {
4148241516 this._undoStack = [];
4148341517 };
@@ -41654,7 +41688,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
4165441688
4165541689function DHXGantt() {
4165641690 this.constants = __webpack_require__(/*! ../constants */ "./sources/constants/index.js");
41657- this.version = "8.0.3 ";
41691+ this.version = "8.0.4 ";
4165841692 this.license = "gpl";
4165941693 this.templates = {};
4166041694 this.ext = {};
0 commit comments