@syncfusion/ej2-gantt 20.4.42 → 20.4.48

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.
Files changed (49) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/ej2-gantt.min.js +2 -2
  3. package/dist/ej2-gantt.umd.min.js +2 -2
  4. package/dist/ej2-gantt.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-gantt.es2015.js +24 -4
  6. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  7. package/dist/es6/ej2-gantt.es5.js +40 -20
  8. package/dist/es6/ej2-gantt.es5.js.map +1 -1
  9. package/dist/global/ej2-gantt.min.js +2 -2
  10. package/dist/global/ej2-gantt.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +19 -19
  13. package/src/gantt/actions/dependency.js +9 -1
  14. package/src/gantt/actions/edit.js +1 -1
  15. package/src/gantt/actions/rowdragdrop.js +25 -16
  16. package/src/gantt/actions/toolbar.js +3 -0
  17. package/src/gantt/base/date-processor.js +1 -1
  18. package/src/gantt/renderer/timeline.js +1 -1
  19. package/styles/bootstrap-dark.css +1 -1
  20. package/styles/bootstrap.css +1 -1
  21. package/styles/bootstrap4.css +1 -1
  22. package/styles/bootstrap5-dark.css +1 -1
  23. package/styles/bootstrap5.css +1 -1
  24. package/styles/fabric-dark.css +1 -1
  25. package/styles/fabric.css +1 -1
  26. package/styles/fluent-dark.css +1 -1
  27. package/styles/fluent.css +1 -1
  28. package/styles/gantt/_theme.scss +1 -1
  29. package/styles/gantt/bootstrap-dark.css +1 -1
  30. package/styles/gantt/bootstrap.css +1 -1
  31. package/styles/gantt/bootstrap4.css +1 -1
  32. package/styles/gantt/bootstrap5-dark.css +1 -1
  33. package/styles/gantt/bootstrap5.css +1 -1
  34. package/styles/gantt/fabric-dark.css +1 -1
  35. package/styles/gantt/fabric.css +1 -1
  36. package/styles/gantt/fluent-dark.css +1 -1
  37. package/styles/gantt/fluent.css +1 -1
  38. package/styles/gantt/highcontrast-light.css +1 -1
  39. package/styles/gantt/highcontrast.css +1 -1
  40. package/styles/gantt/material-dark.css +1 -1
  41. package/styles/gantt/material.css +1 -1
  42. package/styles/gantt/tailwind-dark.css +1 -1
  43. package/styles/gantt/tailwind.css +1 -1
  44. package/styles/highcontrast-light.css +1 -1
  45. package/styles/highcontrast.css +1 -1
  46. package/styles/material-dark.css +1 -1
  47. package/styles/material.css +1 -1
  48. package/styles/tailwind-dark.css +1 -1
  49. package/styles/tailwind.css +1 -1
@@ -402,7 +402,7 @@ var DateProcessor = /** @__PURE__ @class */ (function () {
402
402
  if (hour > this.parent.defaultEndTime) {
403
403
  this.setTime(this.parent.defaultEndTime, cloneDate);
404
404
  }
405
- else if (hour <= this.parent.defaultStartTime && !isNullOrUndefined(ganttProp) && !ganttProp.isMilestone) {
405
+ else if (hour < this.parent.defaultStartTime && !isNullOrUndefined(ganttProp) && !ganttProp.isMilestone) {
406
406
  cloneDate.setDate(cloneDate.getDate() - 1);
407
407
  this.setTime(this.parent.defaultEndTime, cloneDate);
408
408
  }
@@ -6181,7 +6181,7 @@ var Timeline = /** @__PURE__ @class */ (function () {
6181
6181
  break;
6182
6182
  case 'Month':
6183
6183
  difference = Math.round((timeDifference / (1000 * 3600 * 24)) / 28);
6184
- tierCount = tierCount <= difference ? tierCount : difference > 0 ? difference : 1;
6184
+ tierCount = tierCount <= difference ? tierCount : difference > 0 ? (difference + 1) : 1;
6185
6185
  if (this.topTier !== 'None' && tier === 'bottomTier') {
6186
6186
  tierCount = this.validateBottomTierCount(mode, tierCount);
6187
6187
  }
@@ -11348,6 +11348,14 @@ var Dependency = /** @__PURE__ @class */ (function () {
11348
11348
  }
11349
11349
  }
11350
11350
  if (record && record.ganttProperties.taskId !== this.isValidatedParentTaskID && ganttProp) {
11351
+ var validUpdate = false;
11352
+ var predecessorNames = ganttProp.ganttProperties.predecessorsName ?
11353
+ ganttProp.ganttProperties.predecessorsName.split(',').length : ganttProp.ganttProperties.predecessorsName;
11354
+ var predecessorLength = ganttProp.ganttProperties.predecessor ?
11355
+ ganttProp.ganttProperties.predecessor.length : ganttProp.ganttProperties.predecessor;
11356
+ if ((predecessorLength && predecessorNames !== predecessorLength)) {
11357
+ validUpdate = true;
11358
+ }
11351
11359
  if ((taskBarModule.taskBarEditAction !== 'ParentDrag' && taskBarModule.taskBarEditAction !== 'ChildDrag')) {
11352
11360
  if (!ganttProp.hasChildRecords && record.hasChildRecords) {
11353
11361
  this.parent.editModule['updateChildItems'](record);
@@ -11355,7 +11363,7 @@ var Dependency = /** @__PURE__ @class */ (function () {
11355
11363
  }
11356
11364
  }
11357
11365
  else if ((record.hasChildRecords && taskBarModule.taskBarEditAction == 'ChildDrag') ||
11358
- (!ganttProp.ganttProperties.predecessorsName && taskBarModule.taskBarEditAction == 'ParentDrag')) {
11366
+ (validUpdate && taskBarModule.taskBarEditAction == 'ParentDrag')) {
11359
11367
  this.parent.editModule['updateChildItems'](record);
11360
11368
  this.isValidatedParentTaskID = record.ganttProperties.taskId;
11361
11369
  }
@@ -23906,7 +23914,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23906
23914
  }
23907
23915
  this.parent.predecessorModule.isValidatedParentTaskID = '';
23908
23916
  /** validating predecessor for current edited records */
23909
- if (ganttRecord.ganttProperties.predecessor) {
23917
+ if (ganttRecord.ganttProperties.predecessorsName) {
23910
23918
  this.parent.isMileStoneEdited = ganttRecord.ganttProperties.isMilestone;
23911
23919
  if (this.taskbarMoved) {
23912
23920
  this.parent.editedTaskBarItem = ganttRecord;
@@ -28220,6 +28228,9 @@ var Toolbar$3 = /** @__PURE__ @class */ (function () {
28220
28228
  * @private
28221
28229
  */
28222
28230
  Toolbar$$1.prototype.zoomToFit = function () {
28231
+ if (this.parent.timelineModule.isZoomIn) {
28232
+ this.parent.timelineModule.isZoomIn = false;
28233
+ }
28223
28234
  this.parent.timelineModule.processZoomToFit();
28224
28235
  this.parent.ganttChartModule.updateScrollLeft(0);
28225
28236
  };
@@ -30658,6 +30669,15 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
30658
30669
  delete droppedRecord.taskData[this_1.parent.taskFields.segments];
30659
30670
  }
30660
30671
  }
30672
+ if (this_1.treeGridData.length != 0) {
30673
+ for (var i_1 = 0; i_1 < this_1.treeGridData.length; i_1++) {
30674
+ this_1.treeGridData[parseInt(i_1.toString(), 10)].index = i_1;
30675
+ if (!isNullOrUndefined(this_1.treeGridData[parseInt(i_1.toString(), 10)].parentItem)) {
30676
+ var updatedParent = getValue('uniqueIDCollection.' + this_1.treeGridData[parseInt(i_1.toString(), 10)].parentUniqueID, this_1.parent.treeGrid);
30677
+ this_1.treeGridData[parseInt(i_1.toString(), 10)].parentItem.index = updatedParent.index;
30678
+ }
30679
+ }
30680
+ }
30661
30681
  // eslint-disable-next-line
30662
30682
  if (!isNullOrUndefined(draggedRecord.parentItem && this_1.updateParentRecords.indexOf(draggedRecord.parentItem) !== -1)) {
30663
30683
  this_1.updateParentRecords.push(draggedRecord.parentItem);
@@ -30671,51 +30691,51 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
30671
30691
  var uniqueTaskID_1 = this_1.parent.taskFields.id;
30672
30692
  if (draggedRecord.index < droppedRecord.index) {
30673
30693
  startIndex = draggedRecord.index;
30674
- var _loop_3 = function (i_1) {
30694
+ var _loop_3 = function (i_2) {
30675
30695
  var currentData = this_1.parent.currentViewData.filter(function (e) {
30676
- return e[uniqueTaskID_1] === ganttData_1[i_1][uniqueTaskID_1];
30696
+ return e[uniqueTaskID_1] === ganttData_1[i_2][uniqueTaskID_1];
30677
30697
  })[0];
30678
30698
  if (currentData && currentData.index > droppedRecord.index) {
30679
30699
  endIndex = currentData.index;
30680
30700
  return "break";
30681
30701
  }
30682
30702
  };
30683
- for (var i_1 = 0; i_1 < ganttData_1.length; i_1++) {
30684
- var state_2 = _loop_3(i_1);
30703
+ for (var i_2 = 0; i_2 < ganttData_1.length; i_2++) {
30704
+ var state_2 = _loop_3(i_2);
30685
30705
  if (state_2 === "break")
30686
30706
  break;
30687
30707
  }
30688
30708
  }
30689
30709
  else {
30690
30710
  startIndex = droppedRecord.index;
30691
- var _loop_4 = function (i_2) {
30711
+ var _loop_4 = function (i_3) {
30692
30712
  var currentData = this_1.parent.currentViewData.filter(function (e) {
30693
- return e[uniqueTaskID_1] === ganttData_1[i_2][uniqueTaskID_1];
30713
+ return e[uniqueTaskID_1] === ganttData_1[i_3][uniqueTaskID_1];
30694
30714
  })[0];
30695
30715
  if (currentData && currentData.index > draggedRecord.index) {
30696
30716
  endIndex = currentData.index;
30697
30717
  return "break";
30698
30718
  }
30699
30719
  };
30700
- for (var i_2 = 0; i_2 < ganttData_1.length; i_2++) {
30701
- var state_3 = _loop_4(i_2);
30720
+ for (var i_3 = 0; i_3 < ganttData_1.length; i_3++) {
30721
+ var state_3 = _loop_4(i_3);
30702
30722
  if (state_3 === "break")
30703
30723
  break;
30704
30724
  }
30705
30725
  }
30706
- var _loop_5 = function (i_3) {
30707
- if (!isNullOrUndefined(data_1[i_3])) {
30708
- data_1[i_3].index = i_3;
30709
- if (!isNullOrUndefined(data_1[i_3].parentItem)) {
30726
+ var _loop_5 = function (i_4) {
30727
+ if (!isNullOrUndefined(data_1[i_4])) {
30728
+ data_1[i_4].index = i_4;
30729
+ if (!isNullOrUndefined(data_1[i_4].parentItem)) {
30710
30730
  var updatedParent = data_1.filter(function (e) {
30711
- return e.uniqueID === data_1[i_3].parentUniqueID;
30731
+ return e.uniqueID === data_1[i_4].parentUniqueID;
30712
30732
  })[0];
30713
- data_1[i_3].parentItem.index = updatedParent.index;
30733
+ data_1[i_4].parentItem.index = updatedParent.index;
30714
30734
  }
30715
30735
  }
30716
30736
  };
30717
- for (var i_3 = startIndex; i_3 <= endIndex; i_3++) {
30718
- _loop_5(i_3);
30737
+ for (var i_4 = startIndex; i_4 <= endIndex; i_4++) {
30738
+ _loop_5(i_4);
30719
30739
  }
30720
30740
  }
30721
30741
  gObj.rowDragAndDropModule.refreshDataSource();