devexpress-gantt 4.0.2 → 4.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dx-gantt.css CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * DevExpress Gantt (dx-gantt)
3
- * Version: 4.0.2
4
- * Build date: Mon Jan 10 2022
3
+ * Version: 4.0.6
4
+ * Build date: Wed Feb 02 2022
5
5
  *
6
6
  * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
7
7
  * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs
package/dist/dx-gantt.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * DevExpress Gantt (dx-gantt)
3
- * Version: 4.0.2
4
- * Build date: Mon Jan 10 2022
3
+ * Version: 4.0.6
4
+ * Build date: Wed Feb 02 2022
5
5
  *
6
6
  * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
7
7
  * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs
@@ -1796,6 +1796,7 @@ var TaskAreaStateEventNames = (function () {
1796
1796
  TaskAreaStateEventNames.TASK_AREA_ZOOM_IN = "taskAreaZoomIn";
1797
1797
  TaskAreaStateEventNames.TASK_AREA_ZOOM_OUT = "taskAreaZoomOut";
1798
1798
  TaskAreaStateEventNames.CONTEXTMENU_SHOW = "contextMenuShow";
1799
+ TaskAreaStateEventNames.CONTEXTMENU_HIDE = "contextMenuHide";
1799
1800
  TaskAreaStateEventNames.DEPENDENCY_SELECTION = "dependencySelection";
1800
1801
  TaskAreaStateEventNames.STATE_EXIT = "stateExit";
1801
1802
  TaskAreaStateEventNames.TASK_SELECTION = "taskSelection";
@@ -2894,7 +2895,8 @@ var GridLayoutCalculator = (function () {
2894
2895
  return new size_1.Size(width, 0);
2895
2896
  };
2896
2897
  GridLayoutCalculator.prototype.getTaskProgressWidth = function (index) {
2897
- return this.getTaskWidth(index) * this.getTask(index).progress / 100;
2898
+ var progress = Math.max(Math.min(this.getTask(index).progress, 100), 0);
2899
+ return this.getTaskWidth(index) * progress / 100;
2898
2900
  };
2899
2901
  GridLayoutCalculator.prototype.getTaskTextElementInfo = function (index, isInsideText) {
2900
2902
  var result = new GridElementInfo_1.GridElementInfo();
@@ -3073,7 +3075,10 @@ var GridLayoutCalculator = (function () {
3073
3075
  return this.getWidthByDateRange(this.range.start, date);
3074
3076
  };
3075
3077
  GridLayoutCalculator.prototype.getWidthByDateRange = function (start, end) {
3076
- return Math.max(DateUtils_1.DateUtils.getRangeTickCount(start, end, this.viewType) * this.tickSize.width, 0);
3078
+ return Math.max(this.getDistanceBetweenDates(start, end), 0);
3079
+ };
3080
+ GridLayoutCalculator.prototype.getDistanceBetweenDates = function (start, end) {
3081
+ return DateUtils_1.DateUtils.getRangeTickCount(start, end, this.viewType) * this.tickSize.width;
3077
3082
  };
3078
3083
  GridLayoutCalculator.prototype.getDateByPos = function (position) {
3079
3084
  if (this.viewType === Enums_1.ViewType.Months || this.viewType === Enums_1.ViewType.Quarter)
@@ -5090,6 +5095,10 @@ var GanttPdfExportProps = (function () {
5090
5095
  this.pageSize = new size_1.Size(width, height);
5091
5096
  }
5092
5097
  }
5098
+ else if ((0, common_1.isDefined)(source.pageSize)) {
5099
+ var size = source.pageSize;
5100
+ this.pageSize = size instanceof size_1.Size ? size.clone() : new size_1.Size(size.width, size.height);
5101
+ }
5093
5102
  if ((0, common_1.isDefined)(source.exportMode))
5094
5103
  this.exportMode = this.getEnumValue(ExportMode, source.exportMode);
5095
5104
  if ((0, common_1.isDefined)(source.dateRange)) {
@@ -5232,8 +5241,7 @@ var TaskEditController = (function () {
5232
5241
  enumerable: false,
5233
5242
  configurable: true
5234
5243
  });
5235
- TaskEditController.prototype.show = function (taskIndex, delay) {
5236
- if (delay === void 0) { delay = 0; }
5244
+ TaskEditController.prototype.show = function (taskIndex) {
5237
5245
  if (this.isEditingInProgress || this.disableTaskEditBox)
5238
5246
  return;
5239
5247
  this.taskIndex = taskIndex;
@@ -5246,11 +5254,10 @@ var TaskEditController = (function () {
5246
5254
  else {
5247
5255
  if (!this.isTaskUpdateAllowed())
5248
5256
  this.baseElement.className = this.baseElement.className + " hide-updating";
5249
- if (this.viewItem.isCustom) {
5257
+ if (this.viewItem.isCustom)
5250
5258
  this.baseElement.classList.add(TaskEditController.CLASSNAMES.TASK_EDIT_BOX_CUSTOM);
5251
- delay = this.showInfoDelay;
5252
- }
5253
5259
  }
5260
+ var delay = this.settings.getGanttSettings().editing.taskHoverDelay || 0;
5254
5261
  this.taskDateRange = new DateRange_1.DateRange(this.task.start, this.task.end);
5255
5262
  this.displayTaskEditBox(delay);
5256
5263
  this.displayProgressEdit();
@@ -5668,8 +5675,6 @@ var GanttView = (function () {
5668
5675
  this.initTaskEditController();
5669
5676
  this.history = new History_1.History(this._getHistoryListener());
5670
5677
  this.initFullScreenModeHelper();
5671
- this.onWindowResizelHandler = this.onBrowserWindowResize.bind(this);
5672
- window.addEventListener("resize", this.onWindowResizelHandler);
5673
5678
  this.updateView();
5674
5679
  this._scrollTimeOut = setTimeout(function () {
5675
5680
  _this.scrollLeftByViewType();
@@ -5773,6 +5778,10 @@ var GanttView = (function () {
5773
5778
  GanttView.prototype.showPopupMenu = function (info) {
5774
5779
  this.ganttOwner.showPopupMenu(info);
5775
5780
  };
5781
+ GanttView.prototype.hidePopupMenu = function () {
5782
+ if (this.ganttOwner.hidePopupMenu)
5783
+ this.ganttOwner.hidePopupMenu();
5784
+ };
5776
5785
  GanttView.prototype.collapseAll = function () {
5777
5786
  this.ganttOwner.collapseAll();
5778
5787
  };
@@ -6045,7 +6054,6 @@ var GanttView = (function () {
6045
6054
  GanttView.prototype.cleanMarkup = function () {
6046
6055
  this.renderHelper.taskAreaManagerDetachEvents();
6047
6056
  this.taskEditController.detachEvents();
6048
- window.removeEventListener("resize", this.onWindowResizelHandler);
6049
6057
  this.clearStripLinesUpdater();
6050
6058
  this.renderHelper.reset();
6051
6059
  clearTimeout(this._scrollTimeOut);
@@ -6232,6 +6240,12 @@ var GanttView = (function () {
6232
6240
  else
6233
6241
  this.resetAndUpdate();
6234
6242
  };
6243
+ GanttView.prototype.onBrowserWindowResize = function () {
6244
+ if (this.fullScreenModeHelper.isInFullScreenMode)
6245
+ this.fullScreenModeHelper.adjustControlInFullScreenMode();
6246
+ else
6247
+ this.adjustOwnerControl();
6248
+ };
6235
6249
  GanttView.prototype.setTaskValue = function (id, fieldName, newValue) {
6236
6250
  var manager = this.commandManager;
6237
6251
  var task = this.getTaskByPublicId(id);
@@ -6303,12 +6317,6 @@ var GanttView = (function () {
6303
6317
  if (owner.adjustControl)
6304
6318
  owner.adjustControl();
6305
6319
  };
6306
- GanttView.prototype.onBrowserWindowResize = function () {
6307
- if (this.fullScreenModeHelper.isInFullScreenMode)
6308
- this.fullScreenModeHelper.adjustControlInFullScreenMode();
6309
- else
6310
- this.adjustOwnerControl();
6311
- };
6312
6320
  GanttView.prototype.applySettings = function (settings, preventViewUpdate) {
6313
6321
  if (preventViewUpdate === void 0) { preventViewUpdate = false; }
6314
6322
  var ganttSettings = Settings_1.Settings.parse(settings);
@@ -12433,7 +12441,7 @@ var TaskAreaExportHelper = (function () {
12433
12441
  Object.defineProperty(TaskAreaExportHelper.prototype, "customRangeLeftOffset", {
12434
12442
  get: function () {
12435
12443
  var _a;
12436
- (_a = this._customRangeLeftOffset) !== null && _a !== void 0 ? _a : (this._customRangeLeftOffset = Math.max(this.layoutCalculator.getWidthByDateRange(this.startDate, this.ownerStartDate), 0));
12444
+ (_a = this._customRangeLeftOffset) !== null && _a !== void 0 ? _a : (this._customRangeLeftOffset = this.layoutCalculator.getDistanceBetweenDates(this.startDate, this.ownerStartDate));
12437
12445
  return this._customRangeLeftOffset;
12438
12446
  },
12439
12447
  enumerable: false,
@@ -12780,7 +12788,7 @@ var TaskAreaExportHelper = (function () {
12780
12788
  get: function () {
12781
12789
  var _this = this;
12782
12790
  var _a;
12783
- (_a = this._connectorLines) !== null && _a !== void 0 ? _a : (this._connectorLines = this._owner.renderHelper.renderedConnectorLines.filter(function (l) { return _this.isLineVisible(l); }));
12791
+ (_a = this._connectorLines) !== null && _a !== void 0 ? _a : (this._connectorLines = this._owner.renderHelper.allConnectorLines.filter(function (l) { return _this.isLineVisible(l); }));
12784
12792
  return this._connectorLines;
12785
12793
  },
12786
12794
  enumerable: false,
@@ -12913,7 +12921,7 @@ var TaskAreaExportHelper = (function () {
12913
12921
  });
12914
12922
  Object.defineProperty(TaskAreaExportHelper.prototype, "hasCustomRangeOutOfRender", {
12915
12923
  get: function () {
12916
- return this.startDate.getTime() < this.ownerStartDate.getTime() || this.endDate.getTime() > this.ownerEndDate.getTime();
12924
+ return this.startDate.getTime() !== this.ownerStartDate.getTime() || this.endDate.getTime() !== this.ownerEndDate.getTime();
12917
12925
  },
12918
12926
  enumerable: false,
12919
12927
  configurable: true
@@ -15926,6 +15934,14 @@ var RenderHelper = (function () {
15926
15934
  enumerable: false,
15927
15935
  configurable: true
15928
15936
  });
15937
+ Object.defineProperty(RenderHelper.prototype, "allConnectorLines", {
15938
+ get: function () {
15939
+ var lines = this.gridLayoutCalculator.tileToDependencyMap.reduce(function (acc, tile) { return acc = acc.concat(tile); }, []);
15940
+ return lines;
15941
+ },
15942
+ enumerable: false,
15943
+ configurable: true
15944
+ });
15929
15945
  Object.defineProperty(RenderHelper.prototype, "resourcesElements", {
15930
15946
  get: function () {
15931
15947
  return this._resourceRender.resourcesElements;
@@ -17601,7 +17617,10 @@ var TaskAreaDefaultState = (function (_super) {
17601
17617
  function TaskAreaDefaultState() {
17602
17618
  return _super !== null && _super.apply(this, arguments) || this;
17603
17619
  }
17604
- TaskAreaDefaultState.prototype.finish = function () { this.clearTimers(); };
17620
+ TaskAreaDefaultState.prototype.finish = function () {
17621
+ this.clearTimers();
17622
+ this.raiseEvent(TaskAreaStateEventNames_1.TaskAreaStateEventNames.CONTEXTMENU_HIDE);
17623
+ };
17605
17624
  TaskAreaDefaultState.prototype.onMouseDownInternal = function (evt) { this.onPointerDownBase(evt); };
17606
17625
  TaskAreaDefaultState.prototype.onDocumentPointerDownInternal = function (evt) { this.onPointerDownBase(evt); };
17607
17626
  TaskAreaDefaultState.prototype.onDocumentPointerUpInternal = function (evt) { this.onPointerUpBase(evt); };
@@ -17617,7 +17636,11 @@ var TaskAreaDefaultState = (function (_super) {
17617
17636
  if (isMouse)
17618
17637
  this.changeSelectionOnTouchDown(evt);
17619
17638
  else {
17620
- setTimeout(function () { return _this.changeSelectionOnTouchDown(evt); }, 0);
17639
+ setTimeout(function () {
17640
+ if (!TaskAreaDomHelper_1.TaskAreaDomHelper.isMousePointer(evt))
17641
+ _this.raiseEvent(TaskAreaStateEventNames_1.TaskAreaStateEventNames.CONTEXTMENU_HIDE, evt);
17642
+ _this.changeSelectionOnTouchDown(evt);
17643
+ }, 0);
17621
17644
  clearTimeout(this._contextMenuTimer);
17622
17645
  this._contextMenuTimer = setTimeout(function () { return _this.showContextMenuOnTouchDown(evt); }, TaskAreaDefaultState.defaultContextMenuTimeout);
17623
17646
  }
@@ -17632,6 +17655,8 @@ var TaskAreaDefaultState = (function (_super) {
17632
17655
  if (!this._lastEmulatedClickTime) {
17633
17656
  var clickCanceled = !this.raiseEvent(TaskAreaStateEventNames_1.TaskAreaStateEventNames.TASK_AREA_CLICK, evt, rowIndex);
17634
17657
  clearTimeout(this._dblClickClearTimer);
17658
+ if (TaskAreaDomHelper_1.TaskAreaDomHelper.isMousePointer(evt))
17659
+ this.raiseEvent(TaskAreaStateEventNames_1.TaskAreaStateEventNames.CONTEXTMENU_HIDE, evt);
17635
17660
  if (!clickCanceled) {
17636
17661
  this._lastEmulatedClickTime = now;
17637
17662
  this._dblClickClearTimer = setTimeout(function () { delete _this._lastEmulatedClickTime; }, TaskAreaDefaultState.defaultDblClickClearTimeout);
@@ -19219,6 +19244,7 @@ var EditingSettings = (function () {
19219
19244
  this.allowResourceInsert = true;
19220
19245
  this.allowResourceUpdate = true;
19221
19246
  this.allowTaskResourceUpdate = true;
19247
+ this.taskHoverDelay = 0;
19222
19248
  }
19223
19249
  EditingSettings.parse = function (settings) {
19224
19250
  var result = new EditingSettings();
@@ -19243,6 +19269,8 @@ var EditingSettings = (function () {
19243
19269
  result.allowResourceUpdate = settings.allowResourceUpdate;
19244
19270
  if ((0, common_1.isDefined)(settings.allowTaskResourceUpdate))
19245
19271
  result.allowTaskResourceUpdate = settings.allowTaskResourceUpdate;
19272
+ if ((0, common_1.isDefined)(settings.taskHoverDelay))
19273
+ result.taskHoverDelay = settings.taskHoverDelay;
19246
19274
  }
19247
19275
  return result;
19248
19276
  };
@@ -21218,6 +21246,7 @@ var TaskAreaEventsListener = (function () {
21218
21246
  handlers[TaskAreaStateEventNames_1.TaskAreaStateEventNames.TASK_AREA_ZOOM_IN] = this.taskAreaZoomInHandler.bind(this);
21219
21247
  handlers[TaskAreaStateEventNames_1.TaskAreaStateEventNames.TASK_AREA_ZOOM_OUT] = this.taskAreaZoomOutHandler.bind(this);
21220
21248
  handlers[TaskAreaStateEventNames_1.TaskAreaStateEventNames.CONTEXTMENU_SHOW] = this.taskAreaContextMenuShowHandler.bind(this);
21249
+ handlers[TaskAreaStateEventNames_1.TaskAreaStateEventNames.CONTEXTMENU_HIDE] = this.taskAreaContextMenuHideHandler.bind(this);
21221
21250
  handlers[TaskAreaStateEventNames_1.TaskAreaStateEventNames.TASK_SELECTION] = this.taskSelectionHandler.bind(this);
21222
21251
  handlers[TaskAreaStateEventNames_1.TaskAreaStateEventNames.DEPENDENCY_SELECTION] = this.dependencySelectionHandler.bind(this);
21223
21252
  handlers[TaskAreaStateEventNames_1.TaskAreaStateEventNames.TASK_EDIT_START] = this.taskEditStartHandler.bind(this);
@@ -21252,6 +21281,9 @@ var TaskAreaEventsListener = (function () {
21252
21281
  TaskAreaEventsListener.prototype.taskAreaContextMenuShowHandler = function (args) {
21253
21282
  this._owner.onTaskAreaContextMenu(args.rowIndex, args.triggerEvent, args.info["type"]);
21254
21283
  };
21284
+ TaskAreaEventsListener.prototype.taskAreaContextMenuHideHandler = function () {
21285
+ this._owner.hidePopupMenu();
21286
+ };
21255
21287
  TaskAreaEventsListener.prototype.taskAreaScrollHandler = function (args) {
21256
21288
  this._owner.updateView();
21257
21289
  };
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * DevExpress Gantt (dx-gantt.min)
3
- * Version: 4.0.2
4
- * Build date: Mon Jan 10 2022
3
+ * Version: 4.0.6
4
+ * Build date: Wed Feb 02 2022
5
5
  *
6
6
  * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
7
7
  * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs