devexpress-gantt 3.1.25 → 3.1.26

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: 3.1.25
4
- * Build date: Thu Oct 21 2021
3
+ * Version: 3.1.26
4
+ * Build date: Tue Oct 26 2021
5
5
  *
6
6
  * Copyright (c) 2012 - 2021 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: 3.1.25
4
- * Build date: Thu Oct 21 2021
3
+ * Version: 3.1.26
4
+ * Build date: Tue Oct 26 2021
5
5
  *
6
6
  * Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
7
7
  * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs
@@ -5145,7 +5145,8 @@ var GanttView = (function () {
5145
5145
  getGanttSettings: function () { return _this.settings; },
5146
5146
  getViewModel: function () { return _this.viewModel; },
5147
5147
  getCommandManager: function () { return _this.commandManager; },
5148
- getModelManipulator: function () { return _this.modelManipulator; }
5148
+ getModelManipulator: function () { return _this.modelManipulator; },
5149
+ getValidationController: function () { return _this.validationController; }
5149
5150
  });
5150
5151
  this.taskEditController = new TaskEditController_1.TaskEditController(taskEditSettings);
5151
5152
  };
@@ -5596,7 +5597,7 @@ var GanttView = (function () {
5596
5597
  var successorId = String(data.successorId);
5597
5598
  var successor = this.getTaskByPublicId(successorId);
5598
5599
  var type = data.type;
5599
- if (predecessor && successor)
5600
+ if (predecessor && successor && this.validationController.canCreateDependency(predecessorId, successorId))
5600
5601
  this.commandManager.createDependencyCommand.execute(predecessor.internalId, successor.internalId, type);
5601
5602
  };
5602
5603
  GanttView.prototype.deleteDependency = function (key) {
@@ -6687,6 +6688,13 @@ var TaskEditController = (function () {
6687
6688
  enumerable: false,
6688
6689
  configurable: true
6689
6690
  });
6691
+ Object.defineProperty(TaskEditController.prototype, "validationController", {
6692
+ get: function () {
6693
+ return this.settings.getValidationController();
6694
+ },
6695
+ enumerable: false,
6696
+ configurable: true
6697
+ });
6690
6698
  TaskEditController.prototype.raiseTaskMoving = function (task, newStart, newEnd, callback) {
6691
6699
  return this.settings.getModelManipulator().dispatcher.raiseTaskMoving(task, newStart, newEnd, callback);
6692
6700
  };
@@ -6803,10 +6811,9 @@ var TaskEditController = (function () {
6803
6811
  this.wrapInfo.position.x--;
6804
6812
  };
6805
6813
  TaskEditController.prototype.isAllowedToConnectTasks = function (taskIndex) {
6806
- var isAnotherTask = this.successorIndex !== taskIndex && this.taskIndex !== taskIndex;
6814
+ var _a;
6807
6815
  var successorViewItem = this.viewModel.items[taskIndex];
6808
- var isChild = this.viewItem.children.some(function (c) { return c.task.internalId === successorViewItem.task.internalId; });
6809
- return isAnotherTask && !isChild;
6816
+ return this.validationController.canCreateDependency(this.taskId, (_a = successorViewItem.task) === null || _a === void 0 ? void 0 : _a.internalId);
6810
6817
  };
6811
6818
  TaskEditController.prototype.showDependencySuccessor = function (taskIndex) {
6812
6819
  if (this.isAllowedToConnectTasks(taskIndex)) {
@@ -19274,6 +19281,8 @@ var TaskEditSettings = (function (_super) {
19274
19281
  result.formatDate = settings.formatDate;
19275
19282
  if ((0, common_1.isDefined)(settings.getModelManipulator))
19276
19283
  result.getModelManipulator = settings.getModelManipulator;
19284
+ if ((0, common_1.isDefined)(settings.getValidationController))
19285
+ result.getValidationController = settings.getValidationController;
19277
19286
  }
19278
19287
  return result;
19279
19288
  };
@@ -19624,6 +19633,20 @@ var ValidationController = (function () {
19624
19633
  this.updateOwnerInAutoParentMode();
19625
19634
  }
19626
19635
  };
19636
+ ValidationController.prototype.canCreateDependency = function (predecessorId, successorId) {
19637
+ if (!predecessorId || !successorId || predecessorId === successorId)
19638
+ return false;
19639
+ var model = this.viewModel;
19640
+ if (model.dependencies.items.some(function (d) { return (d.predecessorId === predecessorId && d.successorId === successorId) || (d.predecessorId === successorId && d.successorId === predecessorId); }))
19641
+ return false;
19642
+ if (this._parentAutoCalc && this.isValidateDependenciesRequired) {
19643
+ if (model.checkParent(predecessorId, successorId))
19644
+ return false;
19645
+ if (model.checkParent(successorId, predecessorId))
19646
+ return false;
19647
+ }
19648
+ return true;
19649
+ };
19627
19650
  return ValidationController;
19628
19651
  }());
19629
19652
  exports.ValidationController = ValidationController;
@@ -19952,6 +19975,22 @@ var ViewVisualModel = (function () {
19952
19975
  task.internalId = hash[id];
19953
19976
  }
19954
19977
  };
19978
+ ViewVisualModel.prototype.getTaskTreeLine = function (taskId) {
19979
+ var result = [];
19980
+ var item = this.findItem(taskId);
19981
+ if (item) {
19982
+ result.push(taskId);
19983
+ item = item.parent;
19984
+ while (item === null || item === void 0 ? void 0 : item.task) {
19985
+ result.push(item === null || item === void 0 ? void 0 : item.task.internalId);
19986
+ item = item.parent;
19987
+ }
19988
+ }
19989
+ return result;
19990
+ };
19991
+ ViewVisualModel.prototype.checkParent = function (childId, parentId) {
19992
+ return this.getTaskTreeLine(childId).indexOf(parentId) > -1;
19993
+ };
19955
19994
  ViewVisualModel.prototype.getTasksExpandedState = function () {
19956
19995
  var items = this.tasks.items;
19957
19996
  var state = {};
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * DevExpress Gantt (dx-gantt.min)
3
- * Version: 3.1.25
4
- * Build date: Thu Oct 21 2021
3
+ * Version: 3.1.26
4
+ * Build date: Tue Oct 26 2021
5
5
  *
6
6
  * Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
7
7
  * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs