devexpress-gantt 4.0.14 → 4.0.17

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.14
4
- * Build date: Tue Apr 05 2022
3
+ * Version: 4.0.17
4
+ * Build date: Mon Apr 18 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.14
4
- * Build date: Tue Apr 05 2022
3
+ * Version: 4.0.17
4
+ * Build date: Mon Apr 18 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
@@ -2920,6 +2920,8 @@ var GridLayoutCalculator = (function () {
2920
2920
  result.size.width = width;
2921
2921
  if (width > 0)
2922
2922
  result.margins.left = -width;
2923
+ else
2924
+ result.additionalInfo["hidden"] = true;
2923
2925
  }
2924
2926
  }
2925
2927
  return result;
@@ -3154,7 +3156,7 @@ var GridLayoutCalculator = (function () {
3154
3156
  var topTaskRightCenter = this.getTaskRightCenter(topTaskPoint, topTaskIndex);
3155
3157
  var isBottomMilestone = this.getTask(bottomTaskIndex).isMilestone();
3156
3158
  var bottomTaskTopCenter = this.getTaskTopCenter(bottomTaskPoint, bottomTaskIndex);
3157
- var endPointIndent = shiftEndPointToRight ? this.getTaskWidth(bottomTaskIndex) - this.minLineLength : this.minLineLength;
3159
+ var endPointIndent = this.getHorizontalIndentFromTaskEdge(bottomTaskIndex, shiftEndPointToRight);
3158
3160
  result.push(new point_1.Point(Math.floor(topTaskRightCenter.x), Math.floor(topTaskRightCenter.y)));
3159
3161
  result.push(new point_1.Point(Math.floor(isBottomMilestone ? bottomTaskTopCenter.x : bottomTaskPoint.x + endPointIndent), Math.floor(result[0].y)));
3160
3162
  result.push(new point_1.Point(Math.floor(result[1].x), Math.floor(bottomTaskTopCenter.y)));
@@ -3199,7 +3201,7 @@ var GridLayoutCalculator = (function () {
3199
3201
  var topTaskBottomCenter = this.getTaskBottomCenter(topTaskPoint, topTaskIndex);
3200
3202
  var isTopMilestone = this.getTask(topTaskIndex).isMilestone();
3201
3203
  var bottomTaskRightCenter = this.getTaskRightCenter(bottomTaskPoint, bottomTaskIndex);
3202
- var startPointIndent = shiftStartPointToRight ? this.getTaskWidth(topTaskIndex) - this.minLineLength : this.minLineLength;
3204
+ var startPointIndent = this.getHorizontalIndentFromTaskEdge(topTaskIndex, shiftStartPointToRight);
3203
3205
  result.push(new point_1.Point(Math.floor(isTopMilestone ? topTaskBottomCenter.x : topTaskPoint.x + startPointIndent), Math.floor(topTaskBottomCenter.y)));
3204
3206
  result.push(new point_1.Point(Math.floor(result[0].x), Math.floor(bottomTaskRightCenter.y)));
3205
3207
  result.push(new point_1.Point(Math.floor(bottomTaskRightCenter.x), Math.floor(bottomTaskRightCenter.y)));
@@ -3212,7 +3214,7 @@ var GridLayoutCalculator = (function () {
3212
3214
  var topTaskBottomCenter = this.getTaskBottomCenter(topTaskPoint, topTaskIndex);
3213
3215
  var isTopMilestone = this.getTask(topTaskIndex).isMilestone();
3214
3216
  var bottomTaskLeftCenter = this.getTaskLeftCenter(bottomTaskPoint, bottomTaskIndex);
3215
- var startPointIndent = shiftStartPointToRight ? this.getTaskWidth(topTaskIndex) - this.minLineLength : this.minLineLength;
3217
+ var startPointIndent = this.getHorizontalIndentFromTaskEdge(topTaskIndex, shiftStartPointToRight);
3216
3218
  result.push(new point_1.Point(Math.floor(isTopMilestone ? topTaskBottomCenter.x : topTaskPoint.x + startPointIndent), Math.floor(topTaskBottomCenter.y)));
3217
3219
  result.push(new point_1.Point(Math.floor(result[0].x), Math.floor(bottomTaskLeftCenter.y)));
3218
3220
  result.push(new point_1.Point(Math.floor(bottomTaskLeftCenter.x), Math.floor(bottomTaskLeftCenter.y)));
@@ -3225,7 +3227,7 @@ var GridLayoutCalculator = (function () {
3225
3227
  var topTaskLeftCenter = this.getTaskLeftCenter(topTaskPoint, topTaskIndex);
3226
3228
  var bottomTaskTopCenter = this.getTaskTopCenter(bottomTaskPoint, bottomTaskIndex);
3227
3229
  var isBottomMilestone = this.getTask(bottomTaskIndex).isMilestone();
3228
- var endPointIndent = shiftEndPointToRight ? this.getTaskWidth(bottomTaskIndex) - this.minLineLength : this.minLineLength;
3230
+ var endPointIndent = this.getHorizontalIndentFromTaskEdge(bottomTaskIndex, shiftEndPointToRight);
3229
3231
  result.push(new point_1.Point(Math.floor(topTaskLeftCenter.x), Math.floor(topTaskLeftCenter.y)));
3230
3232
  result.push(new point_1.Point(Math.floor(isBottomMilestone ? bottomTaskTopCenter.x : bottomTaskPoint.x + endPointIndent), Math.floor(result[0].y)));
3231
3233
  result.push(new point_1.Point(Math.floor(result[1].x), Math.floor(bottomTaskTopCenter.y)));
@@ -3289,6 +3291,12 @@ var GridLayoutCalculator = (function () {
3289
3291
  var isMilestone = viewItem.task.isMilestone() && !viewItem.isCustom;
3290
3292
  return isMilestone ? this.getTaskHeight(index) * (Math.sqrt(2) - 1) / 2 : 0;
3291
3293
  };
3294
+ GridLayoutCalculator.prototype.getHorizontalIndentFromTaskEdge = function (index, shiftToRight) {
3295
+ if (shiftToRight === void 0) { shiftToRight = false; }
3296
+ var taskWidth = this.getTaskWidth(index);
3297
+ var indentFromEdge = this.minLineLength < taskWidth / 3 ? this.minLineLength : 0.2 * taskWidth;
3298
+ return shiftToRight ? taskWidth - indentFromEdge : indentFromEdge;
3299
+ };
3292
3300
  GridLayoutCalculator.prototype.getRenderedRowColumnIndices = function (scrollPos, isVertical) {
3293
3301
  var visibleAreaSizeValue = isVertical ? this.visibleTaskAreaSize.height : this.visibleTaskAreaSize.width;
3294
3302
  var firstVisibleIndex = isVertical ? this.getFirstVisibleGridCellIndex(scrollPos, this.tickSize.height) : this.getFirstScaleVisibleIndex(scrollPos);
@@ -5265,7 +5273,7 @@ var TaskEditController = (function () {
5265
5273
  this.baseElement.className = this.baseElement.className + " milestone";
5266
5274
  else {
5267
5275
  if (!this.isTaskUpdateAllowed())
5268
- this.baseElement.className = this.baseElement.className + " hide-updating";
5276
+ this.baseElement.className = this.baseElement.className + " " + TaskEditController.CLASSNAMES.TASK_EDIT_HIDE_UPDATING;
5269
5277
  if (this.viewItem.isCustom)
5270
5278
  this.baseElement.classList.add(TaskEditController.CLASSNAMES.TASK_EDIT_BOX_CUSTOM);
5271
5279
  }
@@ -5619,7 +5627,8 @@ var TaskEditController = (function () {
5619
5627
  TASK_EDIT_FRAME_SUCCESSOR: "dx-gantt-task-edit-frame-successor",
5620
5628
  TASK_EDIT_SUCCESSOR_DEPENDENCY_RIGTH: "dx-gantt-task-edit-successor-dependency-r",
5621
5629
  TASK_EDIT_SUCCESSOR_DEPENDENCY_LEFT: "dx-gantt-task-edit-successor-dependency-l",
5622
- TASK_EDIT_TOUCH: "dx-gantt-edit-touch"
5630
+ TASK_EDIT_TOUCH: "dx-gantt-edit-touch",
5631
+ TASK_EDIT_HIDE_UPDATING: "hide-updating"
5623
5632
  };
5624
5633
  return TaskEditController;
5625
5634
  }());
@@ -16053,8 +16062,13 @@ var RenderHelper = (function () {
16053
16062
  };
16054
16063
  RenderHelper.prototype.createTaskArea = function (parent) {
16055
16064
  this._taskArea = this._taskAreaRender.createTaskArea();
16065
+ this._taskArea.setAttribute("task-edit-enabled", this.isTaskUpdateAllowed().toString());
16056
16066
  parent.appendChild(this._taskArea);
16057
16067
  };
16068
+ RenderHelper.prototype.isTaskUpdateAllowed = function () {
16069
+ var settings = this.ganttViewSettings.editing;
16070
+ return settings.enabled && settings.allowTaskUpdate;
16071
+ };
16058
16072
  RenderHelper.prototype.setSizeForTaskArea = function () {
16059
16073
  var width = this.getTaskAreaWidth();
16060
16074
  var height = this.getTaskAreaHeight();
@@ -17202,7 +17216,7 @@ var TaskAreaStateController = (function () {
17202
17216
  this._pointers = {};
17203
17217
  this._listener = listener;
17204
17218
  this._listener.setHandler(TaskAreaStateEventNames_1.TaskAreaStateEventNames.STATE_EXIT, function () { _this.switchToDefaultState(); });
17205
- this._listener.setHandler(TaskAreaStateEventNames_1.TaskAreaStateEventNames.GET_POINTERS_INFO, function () { return _this.getPointersInfo(); });
17219
+ this._listener.setHandler(TaskAreaStateEventNames_1.TaskAreaStateEventNames.GET_POINTERS_INFO, function (args) { return _this.getPointersInfo(args.triggerEvent); });
17206
17220
  this._taskArea = taskArea;
17207
17221
  this._cellSize = cellSize;
17208
17222
  this.switchToDefaultState();
@@ -17334,7 +17348,10 @@ var TaskAreaStateController = (function () {
17334
17348
  this.switchState(TaskAreaScrollState_1.TaskAreaScrollState);
17335
17349
  break;
17336
17350
  case Enums_1.TaskAreaEventSource.TaskEdit_Frame:
17337
- this.switchState(TaskMoveState_1.TaskMoveState);
17351
+ if (!this.isTaskUpdateDisabled())
17352
+ this.switchState(TaskMoveState_1.TaskMoveState);
17353
+ else
17354
+ this.switchState(TaskAreaScrollState_1.TaskAreaScrollState);
17338
17355
  break;
17339
17356
  case Enums_1.TaskAreaEventSource.TaskEdit_Progress:
17340
17357
  case Enums_1.TaskAreaEventSource.TaskEdit_Start:
@@ -17356,13 +17373,16 @@ var TaskAreaStateController = (function () {
17356
17373
  TaskAreaStateController.prototype.checkEventInTaskEditFrameArea = function (evt) {
17357
17374
  var _a, _b;
17358
17375
  var frame = this.getTaskEditFrameElement();
17359
- if (!frame)
17376
+ if (this.isTaskUpdateDisabled() || !frame)
17360
17377
  return false;
17361
17378
  var eventX = (evt === null || evt === void 0 ? void 0 : evt.clientX) || ((_a = evt === null || evt === void 0 ? void 0 : evt.touches[0]) === null || _a === void 0 ? void 0 : _a.clientX);
17362
17379
  var eventY = (evt === null || evt === void 0 ? void 0 : evt.clientY) || ((_b = evt === null || evt === void 0 ? void 0 : evt.touches[0]) === null || _b === void 0 ? void 0 : _b.clientY);
17363
17380
  var rect = frame.getBoundingClientRect();
17364
17381
  return eventX >= rect.left && eventX <= rect.left + rect.width && eventY >= rect.top && eventY <= rect.top + rect.height;
17365
17382
  };
17383
+ TaskAreaStateController.prototype.isTaskUpdateDisabled = function () {
17384
+ return this._taskArea.getAttribute("task-edit-enabled") === "false";
17385
+ };
17366
17386
  TaskAreaStateController.prototype.isInTaskArea = function (evt) {
17367
17387
  return dom_1.DomUtils.isItParent(this._taskArea, evt_1.EvtUtils.getEventSource(evt));
17368
17388
  };
@@ -17373,7 +17393,8 @@ var TaskAreaStateController = (function () {
17373
17393
  var key = evt.pointerId;
17374
17394
  this._pointers[key] = {
17375
17395
  pageX: evt.pageX,
17376
- pageY: evt.pageY
17396
+ pageY: evt.pageY,
17397
+ pointerType: evt.pointerType
17377
17398
  };
17378
17399
  };
17379
17400
  TaskAreaStateController.prototype._clearPointerInfo = function (evt) {
@@ -17383,13 +17404,18 @@ var TaskAreaStateController = (function () {
17383
17404
  TaskAreaStateController.prototype.isTouchEvent = function (evt) { return TaskAreaDomHelper_1.TaskAreaDomHelper.isTouchEvent(evt); };
17384
17405
  TaskAreaStateController.prototype.isPointerEvent = function (evt) { return TaskAreaDomHelper_1.TaskAreaDomHelper.isPointerEvent(evt); };
17385
17406
  TaskAreaStateController.prototype._getActivePointersCount = function (evt) {
17407
+ var _this = this;
17386
17408
  if (this.isTouchEvent(evt))
17387
17409
  return evt.touches.length;
17388
- return Object.keys(this._pointers).length;
17410
+ return Object.keys(this._pointers).filter(function (p) { return _this._pointers[p].pointerType === evt.pointerType; }).length;
17389
17411
  };
17390
- TaskAreaStateController.prototype.getPointersInfo = function () {
17412
+ TaskAreaStateController.prototype.getPointersInfo = function (evt) {
17391
17413
  var _this = this;
17392
- return Object.keys(this._pointers).map(function (k) { return _this._pointers[k]; });
17414
+ var pointerType = evt === null || evt === void 0 ? void 0 : evt.pointerType;
17415
+ var pointers = Object.keys(this._pointers).map(function (k) { return _this._pointers[k]; });
17416
+ if (pointerType)
17417
+ pointers = pointers.filter(function (p) { return p.pointerType === pointerType; });
17418
+ return pointers;
17393
17419
  };
17394
17420
  TaskAreaStateController.prototype._canStartDrag = function (evt) {
17395
17421
  if (this._getActivePointersCount(evt) > 1)
@@ -18653,11 +18679,11 @@ var TaskRender = (function () {
18653
18679
  var _a;
18654
18680
  var _b;
18655
18681
  var taskTextInfo = this.gridLayoutCalculator.getTaskTextElementInfo(index, this.taskTitlePosition === Enums_1.TaskTitlePosition.Inside);
18656
- if (taskTextInfo.size.width === 0 && this.taskTitlePosition === Enums_1.TaskTitlePosition.Outside)
18682
+ if (taskTextInfo.additionalInfo["hidden"])
18657
18683
  return;
18658
18684
  var taskTextElement = RenderElementUtils_1.RenderElementUtils.create(taskTextInfo, index, parent);
18659
18685
  var text = this.getTaskText(index);
18660
- if (this.taskTitlePosition === Enums_1.TaskTitlePosition.Outside) {
18686
+ if (this.taskTitlePosition === Enums_1.TaskTitlePosition.Outside && taskTextInfo.size.width > 0) {
18661
18687
  var style = getComputedStyle(taskTextElement);
18662
18688
  var avaliableTextWidth = taskTextInfo.size.width - dom_1.DomUtils.pxToInt(style.paddingLeft);
18663
18689
  if (avaliableTextWidth >= this.minTextWidth) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * DevExpress Gantt (dx-gantt.min)
3
- * Version: 4.0.14
4
- * Build date: Tue Apr 05 2022
3
+ * Version: 4.0.17
4
+ * Build date: Mon Apr 18 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