devexpress-gantt 4.0.16 → 4.0.19

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.16
4
- * Build date: Tue Apr 12 2022
3
+ * Version: 4.0.19
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.0.16
4
- * Build date: Tue Apr 12 2022
3
+ * Version: 4.0.19
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
@@ -18683,7 +18683,7 @@ var TaskRender = (function () {
18683
18683
  return;
18684
18684
  var taskTextElement = RenderElementUtils_1.RenderElementUtils.create(taskTextInfo, index, parent);
18685
18685
  var text = this.getTaskText(index);
18686
- if (this.taskTitlePosition === Enums_1.TaskTitlePosition.Outside) {
18686
+ if (this.taskTitlePosition === Enums_1.TaskTitlePosition.Outside && taskTextInfo.size.width > 0) {
18687
18687
  var style = getComputedStyle(taskTextElement);
18688
18688
  var avaliableTextWidth = taskTextInfo.size.width - dom_1.DomUtils.pxToInt(style.paddingLeft);
18689
18689
  if (avaliableTextWidth >= this.minTextWidth) {
@@ -19836,18 +19836,7 @@ var ValidationController = (function () {
19836
19836
  }
19837
19837
  };
19838
19838
  ValidationController.prototype.canCreateDependency = function (predecessorId, successorId) {
19839
- if (!predecessorId || !successorId || predecessorId === successorId)
19840
- return false;
19841
- var model = this.viewModel;
19842
- if (model.dependencies.items.some(function (d) { return (d.predecessorId === predecessorId && d.successorId === successorId) || (d.predecessorId === successorId && d.successorId === predecessorId); }))
19843
- return false;
19844
- if (this._parentAutoCalc && this.isValidateDependenciesRequired) {
19845
- if (model.checkParent(predecessorId, successorId))
19846
- return false;
19847
- if (model.checkParent(successorId, predecessorId))
19848
- return false;
19849
- }
19850
- return true;
19839
+ return this.viewModel.canCreateDependency(predecessorId, successorId);
19851
19840
  };
19852
19841
  return ValidationController;
19853
19842
  }());
@@ -20177,11 +20166,26 @@ var ViewVisualModel = (function () {
20177
20166
  task.internalId = hash[id];
20178
20167
  }
20179
20168
  };
20169
+ ViewVisualModel.prototype.canCreateDependency = function (predecessorId, successorId) {
20170
+ if (!predecessorId || !successorId || predecessorId === successorId)
20171
+ return false;
20172
+ var hasLink = false;
20173
+ if (this.enableDependencyValidation) {
20174
+ var hash = this.getDependentTasksHash();
20175
+ if (this.parentAutoCalc)
20176
+ hasLink = this.checkTasksInterdependence(predecessorId, successorId, hash) || this.checkParent(predecessorId, successorId) || this.checkParent(successorId, predecessorId);
20177
+ else
20178
+ hasLink = this.checkDependencyChain([predecessorId], [successorId], hash, []);
20179
+ }
20180
+ return !hasLink;
20181
+ };
20182
+ ViewVisualModel.prototype.checkParent = function (childId, parentId) {
20183
+ return this.getTaskTreeLine(childId).indexOf(parentId) > -1;
20184
+ };
20180
20185
  ViewVisualModel.prototype.getTaskTreeLine = function (taskId) {
20181
- var result = [];
20186
+ var result = [taskId];
20182
20187
  var item = this.findItem(taskId);
20183
20188
  if (item) {
20184
- result.push(taskId);
20185
20189
  item = item.parent;
20186
20190
  while (item === null || item === void 0 ? void 0 : item.task) {
20187
20191
  result.push(item === null || item === void 0 ? void 0 : item.task.internalId);
@@ -20190,8 +20194,65 @@ var ViewVisualModel = (function () {
20190
20194
  }
20191
20195
  return result;
20192
20196
  };
20193
- ViewVisualModel.prototype.checkParent = function (childId, parentId) {
20194
- return this.getTaskTreeLine(childId).indexOf(parentId) > -1;
20197
+ ViewVisualModel.prototype.getDependentTasksHash = function () {
20198
+ var result = {};
20199
+ this.dependencies.items.forEach(function (d) {
20200
+ var _a, _b;
20201
+ var id1 = d.predecessorId;
20202
+ var id2 = d.successorId;
20203
+ (_a = result[id1]) !== null && _a !== void 0 ? _a : (result[id1] = []);
20204
+ if (result[id1].indexOf(id2) < 0)
20205
+ result[id1].push(id2);
20206
+ (_b = result[id2]) !== null && _b !== void 0 ? _b : (result[id2] = []);
20207
+ if (result[id2].indexOf(id1) < 0)
20208
+ result[id2].push(id1);
20209
+ });
20210
+ return result;
20211
+ };
20212
+ ViewVisualModel.prototype.checkTasksInterdependence = function (id1, id2, depHash) {
20213
+ var treeLine1 = this.getTaskTreeLine(id1).reverse();
20214
+ var treeLine2 = this.getTaskTreeLine(id2).reverse();
20215
+ var group1Root;
20216
+ var group2Root;
20217
+ for (var i = 0; i < treeLine1.length - 1; i++) {
20218
+ var id = treeLine1[i];
20219
+ var index = treeLine2.indexOf(id);
20220
+ if (index > -1) {
20221
+ group1Root = treeLine1[i + 1];
20222
+ group2Root = treeLine2[index + 1];
20223
+ }
20224
+ }
20225
+ if (!group1Root && !group2Root) {
20226
+ group1Root = treeLine1[0];
20227
+ group2Root = treeLine2[0];
20228
+ }
20229
+ return this.checkDependencyChain(this.getBranchIds(group1Root), this.getBranchIds(group2Root), depHash, []);
20230
+ };
20231
+ ViewVisualModel.prototype.checkDependencyChain = function (group1, group2, depHash, checked) {
20232
+ if (group1.some(function (id) { return group2.indexOf(id) > -1; }))
20233
+ return true;
20234
+ checked.push.apply(checked, group1);
20235
+ for (var i = 0; i < group1.length; i++) {
20236
+ var id1 = group1[i];
20237
+ var dependent = depHash[id1];
20238
+ if (dependent && this.checkDependencyChain(dependent.filter(function (id) { return checked.indexOf(id) === -1; }), group2, depHash, checked))
20239
+ return true;
20240
+ }
20241
+ return false;
20242
+ };
20243
+ ViewVisualModel.prototype.getBranchIds = function (id) {
20244
+ var _this = this;
20245
+ var result = [id];
20246
+ var item = this.findItem(id);
20247
+ var children = item === null || item === void 0 ? void 0 : item.children;
20248
+ if (children)
20249
+ children.forEach(function (vi) {
20250
+ var _a;
20251
+ var key = (_a = vi.task) === null || _a === void 0 ? void 0 : _a.internalId;
20252
+ if (key)
20253
+ result = result.concat(_this.getBranchIds(key));
20254
+ });
20255
+ return result;
20195
20256
  };
20196
20257
  ViewVisualModel.prototype.getTasksExpandedState = function () {
20197
20258
  var items = this.tasks.items;
@@ -20247,6 +20308,15 @@ var ViewVisualModel = (function () {
20247
20308
  var item = this.findItem(id);
20248
20309
  return item && item.children.length > 0;
20249
20310
  };
20311
+ Object.defineProperty(ViewVisualModel.prototype, "enableDependencyValidation", {
20312
+ get: function () {
20313
+ var _a;
20314
+ var settings = this.owner && this.owner.settings;
20315
+ return (_a = settings === null || settings === void 0 ? void 0 : settings.validation) === null || _a === void 0 ? void 0 : _a.validateDependencies;
20316
+ },
20317
+ enumerable: false,
20318
+ configurable: true
20319
+ });
20250
20320
  Object.defineProperty(ViewVisualModel.prototype, "parentAutoCalc", {
20251
20321
  get: function () {
20252
20322
  var settings = this.owner && this.owner.settings;
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * DevExpress Gantt (dx-gantt.min)
3
- * Version: 4.0.16
4
- * Build date: Tue Apr 12 2022
3
+ * Version: 4.0.19
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