devexpress-gantt 4.1.21 → 4.1.24

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.1.21
4
- * Build date: Thu Apr 14 2022
3
+ * Version: 4.1.24
4
+ * Build date: Thu Apr 21 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.1.21
4
- * Build date: Thu Apr 14 2022
3
+ * Version: 4.1.24
4
+ * Build date: Thu Apr 21 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
@@ -17988,7 +17988,7 @@ var TaskRender = (function () {
17988
17988
  return;
17989
17989
  var taskTextElement = RenderElementUtils_1.RenderElementUtils.create(taskTextInfo, index, parent);
17990
17990
  var text = this.getTaskText(index);
17991
- if (this.taskTitlePosition === Enums_1.TaskTitlePosition.Outside) {
17991
+ if (this.taskTitlePosition === Enums_1.TaskTitlePosition.Outside && taskTextInfo.size.width > 0) {
17992
17992
  var style = getComputedStyle(taskTextElement);
17993
17993
  var avaliableTextWidth = taskTextInfo.size.width - dom_1.DomUtils.pxToInt(style.paddingLeft);
17994
17994
  if (avaliableTextWidth >= this.minTextWidth) {
@@ -19133,18 +19133,7 @@ var ValidationController = (function () {
19133
19133
  }
19134
19134
  };
19135
19135
  ValidationController.prototype.canCreateDependency = function (predecessorId, successorId) {
19136
- if (!predecessorId || !successorId || predecessorId === successorId)
19137
- return false;
19138
- var model = this.viewModel;
19139
- if (model.dependencies.items.some(function (d) { return (d.predecessorId === predecessorId && d.successorId === successorId) || (d.predecessorId === successorId && d.successorId === predecessorId); }))
19140
- return false;
19141
- if (this._parentAutoCalc && this.isValidateDependenciesRequired) {
19142
- if (model.checkParent(predecessorId, successorId))
19143
- return false;
19144
- if (model.checkParent(successorId, predecessorId))
19145
- return false;
19146
- }
19147
- return true;
19136
+ return this.viewModel.canCreateDependency(predecessorId, successorId);
19148
19137
  };
19149
19138
  return ValidationController;
19150
19139
  }());
@@ -19474,11 +19463,26 @@ var ViewVisualModel = (function () {
19474
19463
  task.internalId = hash[id];
19475
19464
  }
19476
19465
  };
19466
+ ViewVisualModel.prototype.canCreateDependency = function (predecessorId, successorId) {
19467
+ if (!predecessorId || !successorId || predecessorId === successorId)
19468
+ return false;
19469
+ var hasLink = false;
19470
+ if (this.enableDependencyValidation) {
19471
+ var hash = this.getDependentTasksHash();
19472
+ if (this.parentAutoCalc)
19473
+ hasLink = this.checkTasksInterdependence(predecessorId, successorId, hash) || this.checkParent(predecessorId, successorId) || this.checkParent(successorId, predecessorId);
19474
+ else
19475
+ hasLink = this.checkDependencyChain([predecessorId], [successorId], hash, []);
19476
+ }
19477
+ return !hasLink;
19478
+ };
19479
+ ViewVisualModel.prototype.checkParent = function (childId, parentId) {
19480
+ return this.getTaskTreeLine(childId).indexOf(parentId) > -1;
19481
+ };
19477
19482
  ViewVisualModel.prototype.getTaskTreeLine = function (taskId) {
19478
- var result = [];
19483
+ var result = [taskId];
19479
19484
  var item = this.findItem(taskId);
19480
19485
  if (item) {
19481
- result.push(taskId);
19482
19486
  item = item.parent;
19483
19487
  while (item === null || item === void 0 ? void 0 : item.task) {
19484
19488
  result.push(item === null || item === void 0 ? void 0 : item.task.internalId);
@@ -19487,8 +19491,65 @@ var ViewVisualModel = (function () {
19487
19491
  }
19488
19492
  return result;
19489
19493
  };
19490
- ViewVisualModel.prototype.checkParent = function (childId, parentId) {
19491
- return this.getTaskTreeLine(childId).indexOf(parentId) > -1;
19494
+ ViewVisualModel.prototype.getDependentTasksHash = function () {
19495
+ var result = {};
19496
+ this.dependencies.items.forEach(function (d) {
19497
+ var _a, _b;
19498
+ var id1 = d.predecessorId;
19499
+ var id2 = d.successorId;
19500
+ (_a = result[id1]) !== null && _a !== void 0 ? _a : (result[id1] = []);
19501
+ if (result[id1].indexOf(id2) < 0)
19502
+ result[id1].push(id2);
19503
+ (_b = result[id2]) !== null && _b !== void 0 ? _b : (result[id2] = []);
19504
+ if (result[id2].indexOf(id1) < 0)
19505
+ result[id2].push(id1);
19506
+ });
19507
+ return result;
19508
+ };
19509
+ ViewVisualModel.prototype.checkTasksInterdependence = function (id1, id2, depHash) {
19510
+ var treeLine1 = this.getTaskTreeLine(id1).reverse();
19511
+ var treeLine2 = this.getTaskTreeLine(id2).reverse();
19512
+ var group1Root;
19513
+ var group2Root;
19514
+ for (var i = 0; i < treeLine1.length - 1; i++) {
19515
+ var id = treeLine1[i];
19516
+ var index = treeLine2.indexOf(id);
19517
+ if (index > -1) {
19518
+ group1Root = treeLine1[i + 1];
19519
+ group2Root = treeLine2[index + 1];
19520
+ }
19521
+ }
19522
+ if (!group1Root && !group2Root) {
19523
+ group1Root = treeLine1[0];
19524
+ group2Root = treeLine2[0];
19525
+ }
19526
+ return this.checkDependencyChain(this.getBranchIds(group1Root), this.getBranchIds(group2Root), depHash, []);
19527
+ };
19528
+ ViewVisualModel.prototype.checkDependencyChain = function (group1, group2, depHash, checked) {
19529
+ if (group1.some(function (id) { return group2.indexOf(id) > -1; }))
19530
+ return true;
19531
+ checked.push.apply(checked, group1);
19532
+ for (var i = 0; i < group1.length; i++) {
19533
+ var id1 = group1[i];
19534
+ var dependent = depHash[id1];
19535
+ if (dependent && this.checkDependencyChain(dependent.filter(function (id) { return checked.indexOf(id) === -1; }), group2, depHash, checked))
19536
+ return true;
19537
+ }
19538
+ return false;
19539
+ };
19540
+ ViewVisualModel.prototype.getBranchIds = function (id) {
19541
+ var _this = this;
19542
+ var result = [id];
19543
+ var item = this.findItem(id);
19544
+ var children = item === null || item === void 0 ? void 0 : item.children;
19545
+ if (children)
19546
+ children.forEach(function (vi) {
19547
+ var _a;
19548
+ var key = (_a = vi.task) === null || _a === void 0 ? void 0 : _a.internalId;
19549
+ if (key)
19550
+ result = result.concat(_this.getBranchIds(key));
19551
+ });
19552
+ return result;
19492
19553
  };
19493
19554
  ViewVisualModel.prototype.getTasksExpandedState = function () {
19494
19555
  var items = this.tasks.items;
@@ -19544,6 +19605,15 @@ var ViewVisualModel = (function () {
19544
19605
  var item = this.findItem(id);
19545
19606
  return item && item.children.length > 0;
19546
19607
  };
19608
+ Object.defineProperty(ViewVisualModel.prototype, "enableDependencyValidation", {
19609
+ get: function () {
19610
+ var _a;
19611
+ var settings = this.owner && this.owner.settings;
19612
+ return (_a = settings === null || settings === void 0 ? void 0 : settings.validation) === null || _a === void 0 ? void 0 : _a.validateDependencies;
19613
+ },
19614
+ enumerable: false,
19615
+ configurable: true
19616
+ });
19547
19617
  Object.defineProperty(ViewVisualModel.prototype, "parentAutoCalc", {
19548
19618
  get: function () {
19549
19619
  var settings = this.owner && this.owner.settings;
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * DevExpress Gantt (dx-gantt.min)
3
- * Version: 4.1.21
4
- * Build date: Thu Apr 14 2022
3
+ * Version: 4.1.24
4
+ * Build date: Thu Apr 21 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