@syncfusion/ej2-gantt 20.4.53 → 21.1.35

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 (95) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +1 -1
  3. package/dist/ej2-gantt.min.js +2 -2
  4. package/dist/ej2-gantt.umd.min.js +2 -2
  5. package/dist/ej2-gantt.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-gantt.es2015.js +1104 -450
  7. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  8. package/dist/es6/ej2-gantt.es5.js +1084 -430
  9. package/dist/es6/ej2-gantt.es5.js.map +1 -1
  10. package/dist/global/ej2-gantt.min.js +2 -2
  11. package/dist/global/ej2-gantt.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/package.json +20 -20
  14. package/src/gantt/actions/cell-edit.js +8 -6
  15. package/src/gantt/actions/chart-scroll.d.ts +1 -0
  16. package/src/gantt/actions/chart-scroll.js +15 -4
  17. package/src/gantt/actions/connector-line-edit.js +39 -28
  18. package/src/gantt/actions/context-menu.js +5 -5
  19. package/src/gantt/actions/critical-path.js +10 -8
  20. package/src/gantt/actions/dependency.js +28 -12
  21. package/src/gantt/actions/dialog-edit.js +41 -21
  22. package/src/gantt/actions/edit.js +56 -55
  23. package/src/gantt/actions/filter.d.ts +2 -1
  24. package/src/gantt/actions/filter.js +88 -2
  25. package/src/gantt/actions/keyboard.js +0 -1
  26. package/src/gantt/actions/pdf-export.d.ts +3 -1
  27. package/src/gantt/actions/pdf-export.js +12 -6
  28. package/src/gantt/actions/rowdragdrop.js +2 -2
  29. package/src/gantt/actions/selection.js +5 -2
  30. package/src/gantt/actions/taskbar-edit.d.ts +5 -0
  31. package/src/gantt/actions/taskbar-edit.js +114 -10
  32. package/src/gantt/base/date-processor.js +78 -52
  33. package/src/gantt/base/gantt-chart.js +20 -4
  34. package/src/gantt/base/gantt-model.d.ts +43 -0
  35. package/src/gantt/base/gantt.d.ts +39 -1
  36. package/src/gantt/base/gantt.js +79 -33
  37. package/src/gantt/base/interface.d.ts +2 -0
  38. package/src/gantt/base/task-processor.js +133 -98
  39. package/src/gantt/base/tree-grid.js +31 -1
  40. package/src/gantt/base/utils.js +1 -1
  41. package/src/gantt/export/export-helper.js +6 -0
  42. package/src/gantt/renderer/chart-rows.d.ts +2 -0
  43. package/src/gantt/renderer/chart-rows.js +156 -24
  44. package/src/gantt/renderer/connector-line.js +50 -20
  45. package/src/gantt/renderer/edit-tooltip.js +0 -3
  46. package/src/gantt/renderer/event-marker.js +4 -1
  47. package/src/gantt/renderer/nonworking-day.js +4 -1
  48. package/src/gantt/renderer/timeline.js +3 -3
  49. package/src/gantt/renderer/tooltip.js +101 -33
  50. package/styles/bootstrap-dark.css +33 -10
  51. package/styles/bootstrap.css +31 -10
  52. package/styles/bootstrap4.css +28 -7
  53. package/styles/bootstrap5-dark.css +30 -9
  54. package/styles/bootstrap5.css +30 -9
  55. package/styles/fabric-dark.css +28 -7
  56. package/styles/fabric.css +28 -7
  57. package/styles/fluent-dark.css +56 -29
  58. package/styles/fluent.css +56 -29
  59. package/styles/gantt/_bootstrap-dark-definition.scss +5 -4
  60. package/styles/gantt/_bootstrap-definition.scss +5 -4
  61. package/styles/gantt/_bootstrap4-definition.scss +3 -2
  62. package/styles/gantt/_bootstrap5-definition.scss +15 -14
  63. package/styles/gantt/_fabric-dark-definition.scss +3 -2
  64. package/styles/gantt/_fabric-definition.scss +3 -2
  65. package/styles/gantt/_fluent-definition.scss +18 -17
  66. package/styles/gantt/_fusionnew-definition.scss +5 -4
  67. package/styles/gantt/_highcontrast-definition.scss +3 -2
  68. package/styles/gantt/_highcontrast-light-definition.scss +3 -2
  69. package/styles/gantt/_layout.scss +45 -13
  70. package/styles/gantt/_material-dark-definition.scss +3 -2
  71. package/styles/gantt/_material-definition.scss +3 -2
  72. package/styles/gantt/_tailwind-definition.scss +9 -8
  73. package/styles/gantt/_theme.scss +25 -6
  74. package/styles/gantt/bootstrap-dark.css +33 -10
  75. package/styles/gantt/bootstrap.css +31 -10
  76. package/styles/gantt/bootstrap4.css +28 -7
  77. package/styles/gantt/bootstrap5-dark.css +30 -9
  78. package/styles/gantt/bootstrap5.css +30 -9
  79. package/styles/gantt/fabric-dark.css +28 -7
  80. package/styles/gantt/fabric.css +28 -7
  81. package/styles/gantt/fluent-dark.css +56 -29
  82. package/styles/gantt/fluent.css +56 -29
  83. package/styles/gantt/highcontrast-light.css +28 -9
  84. package/styles/gantt/highcontrast.css +28 -7
  85. package/styles/gantt/material-dark.css +31 -14
  86. package/styles/gantt/material.css +28 -7
  87. package/styles/gantt/tailwind-dark.css +28 -7
  88. package/styles/gantt/tailwind.css +28 -7
  89. package/styles/highcontrast-light.css +28 -9
  90. package/styles/highcontrast.css +28 -7
  91. package/styles/material-dark.css +31 -14
  92. package/styles/material.css +28 -7
  93. package/styles/tailwind-dark.css +28 -7
  94. package/styles/tailwind.css +28 -7
  95. package/styles/gantt/_material3-definition.scss +0 -218
@@ -42,6 +42,10 @@ var TaskbarEdit = /** @class */ (function (_super) {
42
42
  _this.elementOffsetWidth = 0;
43
43
  _this.elementOffsetHeight = 0;
44
44
  _this.segmentIndex = -1;
45
+ _this.currentItemTop = 0;
46
+ _this.currentItemPrevTop = 0;
47
+ _this.topValue = 0;
48
+ _this.draggedRecordMarginTop = 0;
45
49
  _this.parent = ganttObj;
46
50
  _this.initPublicProp();
47
51
  _this.wireEvents();
@@ -284,7 +288,9 @@ var TaskbarEdit = /** @class */ (function (_super) {
284
288
  if (!isNullOrUndefined(parentRecord) && !parentRecord.expanded) {
285
289
  this.prevZIndex = (this.taskBarEditElement).style.zIndex;
286
290
  (this.taskBarEditElement).style.zIndex = '1000';
287
- addClass([this.taskBarEditElement.querySelector('.e-gantt-child-taskbar')], 'e-collapsed-taskbar-drag');
291
+ if (this.taskBarEditElement.querySelector('.e-gantt-child-taskbar')) {
292
+ addClass([this.taskBarEditElement.querySelector('.e-gantt-child-taskbar')], 'e-collapsed-taskbar-drag');
293
+ }
288
294
  }
289
295
  }
290
296
  }
@@ -448,9 +454,20 @@ var TaskbarEdit = /** @class */ (function (_super) {
448
454
  this.parent.ganttChartModule.scrollObject.previousScroll.left;
449
455
  }
450
456
  this.tooltipPositionX = this.mouseDownX;
451
- this.mouseDownY = e.pageY - containerPosition.top +
457
+ this.mouseDownY = this.dragMoveY = e.pageY - containerPosition.top +
452
458
  this.parent.ganttChartModule.scrollObject.previousScroll.top;
453
459
  }
460
+ if (this.parent.viewType == "ResourceView" && this.parent.allowTaskbarDragAndDrop) {
461
+ var toolbarHeight = 0;
462
+ if (!isNullOrUndefined(this.parent.toolbarModule) && !isNullOrUndefined(this.parent.toolbarModule.element)) {
463
+ toolbarHeight = this.parent.toolbarModule.element.offsetHeight;
464
+ }
465
+ this.topValue = this.parent.getOffsetRect(event.target).top - this.parent.getOffsetRect(this.parent.element).top -
466
+ parseInt((closest(event.target, '.e-taskbar-main-container'))['style'].marginTop) -
467
+ this.parent.element.getElementsByClassName('e-timeline-header-container')[0]['offsetHeight'] -
468
+ toolbarHeight + document.getElementsByClassName('e-chart-scroll-container e-content')[0].scrollTop;
469
+ this.currentItemPrevTop = this.currentItemTop = this.topValue;
470
+ }
454
471
  if (this.taskBarEditAction === 'ConnectorPointLeftDrag' || this.taskBarEditAction === 'ConnectorPointRightDrag') {
455
472
  this.fromPredecessorText = this.taskBarEditAction === 'ConnectorPointLeftDrag' ? 'start' : 'finish';
456
473
  this.parent.connectorLineModule.tooltipTable.innerHTML = this.parent.connectorLineModule.getConnectorLineTooltipInnerTd(this.taskBarEditRecord.ganttProperties.taskName, this.fromPredecessorText, '', '');
@@ -582,6 +599,22 @@ var TaskbarEdit = /** @class */ (function (_super) {
582
599
  this.drawFalseLine();
583
600
  }
584
601
  }
602
+ if (this.parent.viewType == 'ResourceView' && this.parent.allowTaskbarDragAndDrop) {
603
+ if (this.dragMoveY > this.mouseMoveY) {
604
+ this.mouseMoveY = this.dragMoveY - this.mouseMoveY;
605
+ this.currentItemTop = this.currentItemTop - this.mouseMoveY;
606
+ }
607
+ else {
608
+ this.mouseMoveY -= this.dragMoveY;
609
+ this.currentItemTop = this.currentItemTop + this.mouseMoveY;
610
+ }
611
+ var containerPosition = this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);
612
+ this.dragMoveY = e.pageY - containerPosition.top + this.parent.ganttChartModule.scrollObject.previousScroll.top;
613
+ this.topValue = this.currentItemTop;
614
+ this.currentItemPrevTop = (this.currentItemPrevTop === 0 ||
615
+ this.topValue == this.currentItemTop) ? this.topValue :
616
+ this.currentItemPrevTop;
617
+ }
585
618
  this.setItemPosition();
586
619
  this.updateEditedItem();
587
620
  this.editTooltip.updateTooltip(this.segmentIndex);
@@ -661,12 +694,12 @@ var TaskbarEdit = /** @class */ (function (_super) {
661
694
  this.timerCount = this.parent.ganttChartModule.scrollObject.previousScroll.left;
662
695
  this.startScrollTimer('left');
663
696
  }
664
- else if (isConnectorLineEdit && ((mouseY + 80) >
697
+ else if (((mouseY + 80) >
665
698
  containerPosition.top + this.parent.ganttChartModule.chartBodyContainer.offsetHeight)) {
666
699
  this.timerCount = this.parent.ganttChartModule.scrollObject.previousScroll.top;
667
700
  this.startScrollTimer('bottom');
668
701
  }
669
- else if (isConnectorLineEdit && ((mouseY - 20) < containerPosition.top)) {
702
+ else if (((mouseY - 20) < containerPosition.top)) {
670
703
  this.timerCount = this.parent.ganttChartModule.scrollObject.previousScroll.top;
671
704
  this.startScrollTimer('top');
672
705
  }
@@ -1452,6 +1485,11 @@ var TaskbarEdit = /** @class */ (function (_super) {
1452
1485
  taskBarMainContainer.style.width = (width) + 'px';
1453
1486
  leftLabelContainer.style.width = (item.left) + 'px';
1454
1487
  taskBarMainContainer.style.setProperty(position, (item.left) + 'px');
1488
+ if (this.parent.viewType === 'ResourceView' && this.parent.allowTaskbarDragAndDrop && this.parent.rowDragAndDropModule &&
1489
+ (this.taskBarEditAction === 'ChildDrag' || this.taskBarEditAction === 'MilestoneDrag')) {
1490
+ taskBarMainContainer.style.setProperty('top', (this.topValue) + 'px');
1491
+ taskBarMainContainer.style.zIndex = '4';
1492
+ }
1455
1493
  if (this.taskBarEditAction === 'LeftResizing' && this.segmentIndex === 0) {
1456
1494
  var parent_1 = this.taskBarEditElement.parentElement;
1457
1495
  var segmentedTasks = parent_1.getElementsByClassName('e-segmented-taskbar');
@@ -1564,7 +1602,8 @@ var TaskbarEdit = /** @class */ (function (_super) {
1564
1602
  this.previousMouseMove = null;
1565
1603
  this.editTooltip.showHideTaskbarEditTooltip(false, this.segmentIndex);
1566
1604
  if (this.taskBarEditAction && this.isMouseDragged) {
1567
- if (!this.dragMouseLeave && this.taskBarEditedAction) {
1605
+ if ((!this.dragMouseLeave && this.taskBarEditedAction) || (this.parent.viewType === 'ResourceView' &&
1606
+ this.parent.allowTaskbarDragAndDrop)) {
1568
1607
  this.taskBarEditedAction(e);
1569
1608
  this.isMouseDragged = false;
1570
1609
  }
@@ -1673,6 +1712,65 @@ var TaskbarEdit = /** @class */ (function (_super) {
1673
1712
  var args = extend({}, arg);
1674
1713
  var ganttRecord = args.data;
1675
1714
  var taskData = ganttRecord.ganttProperties;
1715
+ var draggedRecIndex = this.parent.currentViewData.indexOf(ganttRecord);
1716
+ if ((args.taskBarEditAction === 'MilestoneDrag' || args.taskBarEditAction === 'ChildDrag') && this.parent.viewType === "ResourceView"
1717
+ && this.parent.allowTaskbarDragAndDrop && this.dragMoveY > 0) {
1718
+ if (this.parent.rowDragAndDropModule) {
1719
+ var flatRecordCol = this.parent.currentViewData;
1720
+ if (flatRecordCol[this.taskBarEditRecord.parentItem.index] && ((this.parent.editedRecords.indexOf(flatRecordCol[this.taskBarEditRecord.parentItem.index]) === -1))) {
1721
+ this.parent.editedRecords.push(flatRecordCol[this.taskBarEditRecord.parentItem.index]);
1722
+ }
1723
+ var ganttrec = void 0;
1724
+ var resHeight = 0;
1725
+ var rowCount = 0;
1726
+ var childIndex_1;
1727
+ var droppedRecord = void 0;
1728
+ var treeGridrows = this.parent.treeGrid.getRows().length;
1729
+ for (var i = 0; i < treeGridrows; i++) {
1730
+ if (resHeight < this.dragMoveY && this.parent.getRowByIndex(i).style.display !== 'none') {
1731
+ rowCount = i;
1732
+ resHeight = resHeight + parseInt(this.parent.getRowByIndex(i).style.height);
1733
+ if (!flatRecordCol[i].parentItem) {
1734
+ ganttrec = flatRecordCol[i];
1735
+ }
1736
+ else {
1737
+ ganttrec = this.parent.getRecordByID(flatRecordCol[i].parentItem.taskId);
1738
+ }
1739
+ }
1740
+ }
1741
+ var draggedRecordtaskbar = this.parent.getRowByIndex(draggedRecIndex).getElementsByClassName('e-taskbar-main-container');
1742
+ var taskbarContainer = this.parent.getRowByIndex(rowCount).getElementsByClassName('e-taskbar-main-container');
1743
+ for (var j = 0; j < taskbarContainer.length; j++) {
1744
+ if (taskbarContainer[j]['offsetTop'] < this.dragMoveY && draggedRecordtaskbar[0].getAttribute('rowuniqueid') !==
1745
+ taskbarContainer[j].getAttribute('rowuniqueid')) {
1746
+ this.draggedRecordMarginTop = taskbarContainer[j]['style'].marginTop;
1747
+ childIndex_1 = taskbarContainer[j].getAttribute('rowuniqueid');
1748
+ }
1749
+ }
1750
+ if (childIndex_1) {
1751
+ droppedRecord = this.parent.currentViewData.filter(function (data) {
1752
+ if (data['rowUniqueID'] === childIndex_1) {
1753
+ return data;
1754
+ }
1755
+ else {
1756
+ return null;
1757
+ }
1758
+ });
1759
+ }
1760
+ if (droppedRecord) {
1761
+ var droppedRecordIndex = this.parent.currentViewData.indexOf(droppedRecord[0]);
1762
+ var position = (droppedRecord[0].hasChildRecords || (!droppedRecord[0].parentItem &&
1763
+ droppedRecord[0].childRecords.length == 0)) ? 'child' : 'below';
1764
+ if (this.parent.rowDragAndDropModule) {
1765
+ this.parent.rowDragAndDropModule.reorderRows([draggedRecIndex], droppedRecordIndex, position);
1766
+ }
1767
+ this.dragMoveY = 0;
1768
+ }
1769
+ }
1770
+ if (this.parent.viewType === 'ResourceView' && this.parent.showOverAllocation) {
1771
+ this.parent.ganttChartModule.renderOverAllocationContainer();
1772
+ }
1773
+ }
1676
1774
  if (args.taskBarEditAction === 'ProgressResizing') {
1677
1775
  if (args.previousData.progress !== taskData.progress) {
1678
1776
  this.parent.setRecordValue('progress', this.getProgressPercent(taskData.width, taskData.progressWidth), taskData, true);
@@ -1864,14 +1962,20 @@ var TaskbarEdit = /** @class */ (function (_super) {
1864
1962
  }
1865
1963
  if ((this.parent.virtualScrollModule && this.parent.enableVirtualization &&
1866
1964
  !this.elementOffsetLeft) || !this.parent.enableVirtualization) {
1867
- if (this.taskBarEditElement.children[0].classList.contains('e-manualparent-main-container')) {
1868
- this.elementOffsetLeft = this.taskBarEditElement.children[0]['offsetLeft'] + this.taskBarEditElement.offsetLeft;
1869
- this.elementOffsetTop = ((this.taskBarEditElement.offsetTop - 5) + this.taskBarEditElement.children[0]['offsetTop']) + scrollTop;
1870
- }
1871
- else {
1965
+ if (!this.parent.allowParentDependency) {
1872
1966
  this.elementOffsetLeft = this.taskBarEditElement.offsetLeft;
1873
1967
  this.elementOffsetTop = this.taskBarEditElement.offsetTop + scrollTop;
1874
1968
  }
1969
+ else {
1970
+ if (this.taskBarEditElement.children[0].classList.contains('e-manualparent-main-container')) {
1971
+ this.elementOffsetLeft = this.taskBarEditElement.children[0]['offsetLeft'] + this.taskBarEditElement.offsetLeft;
1972
+ this.elementOffsetTop = ((this.taskBarEditElement.offsetTop - 5) + this.taskBarEditElement.children[0]['offsetTop']) + scrollTop;
1973
+ }
1974
+ else {
1975
+ this.elementOffsetLeft = this.taskBarEditElement.offsetLeft;
1976
+ this.elementOffsetTop = this.taskBarEditElement.offsetTop + scrollTop;
1977
+ }
1978
+ }
1875
1979
  this.elementOffsetWidth = this.taskBarEditElement.offsetWidth;
1876
1980
  this.elementOffsetHeight = this.taskBarEditElement.offsetHeight;
1877
1981
  }
@@ -57,32 +57,37 @@ var DateProcessor = /** @class */ (function () {
57
57
  }
58
58
  }
59
59
  var tStartDate;
60
- do {
61
- tStartDate = new Date(cloneStartDate.getTime());
62
- var holidayLength = this.parent.totalHolidayDates.length;
63
- // check holidays and weekends
64
- if (this.isValidateNonWorkDays(ganttProp)) {
65
- var startTime = (!validateAsMilestone || isLoad) ? this.parent.defaultStartTime : this.parent.defaultEndTime;
66
- if (!this.parent.includeWeekend) {
67
- var tempDate = new Date(cloneStartDate.getTime());
68
- cloneStartDate = this.getNextWorkingDay(cloneStartDate);
69
- if (tempDate.getTime() !== cloneStartDate.getTime()) {
70
- this.setTime(startTime, cloneStartDate);
60
+ if (this.parent.autoCalculateDateScheduling) {
61
+ do {
62
+ tStartDate = new Date(cloneStartDate.getTime());
63
+ var holidayLength = this.parent.totalHolidayDates.length;
64
+ // check holidays and weekends
65
+ if (this.isValidateNonWorkDays(ganttProp)) {
66
+ var startTime = (!validateAsMilestone || isLoad) ? this.parent.defaultStartTime : this.parent.defaultEndTime;
67
+ if (!this.parent.includeWeekend) {
68
+ var tempDate = new Date(cloneStartDate.getTime());
69
+ cloneStartDate = this.getNextWorkingDay(cloneStartDate);
70
+ if (tempDate.getTime() !== cloneStartDate.getTime()) {
71
+ this.setTime(startTime, cloneStartDate);
72
+ }
71
73
  }
72
- }
73
- for (var count = 0; count < holidayLength; count++) {
74
- var holidayFrom = this.getDateFromFormat(new Date(this.parent.totalHolidayDates[count]));
75
- var holidayTo = new Date(holidayFrom.getTime());
76
- holidayFrom.setHours(0, 0, 0, 0);
77
- holidayTo.setHours(23, 59, 59, 59);
78
- if (cloneStartDate.getTime() >= holidayFrom.getTime() && cloneStartDate.getTime() < holidayTo.getTime()) {
79
- cloneStartDate.setDate(cloneStartDate.getDate() + 1);
80
- this.setTime(startTime, cloneStartDate);
74
+ for (var count = 0; count < holidayLength; count++) {
75
+ var holidayFrom = this.getDateFromFormat(new Date(this.parent.totalHolidayDates[count]));
76
+ var holidayTo = new Date(holidayFrom.getTime());
77
+ holidayFrom.setHours(0, 0, 0, 0);
78
+ holidayTo.setHours(23, 59, 59, 59);
79
+ if (cloneStartDate.getTime() >= holidayFrom.getTime() && cloneStartDate.getTime() < holidayTo.getTime()) {
80
+ cloneStartDate.setDate(cloneStartDate.getDate() + 1);
81
+ this.setTime(startTime, cloneStartDate);
82
+ }
81
83
  }
82
84
  }
83
- }
84
- } while (tStartDate.getTime() !== cloneStartDate.getTime());
85
- return new Date(cloneStartDate.getTime());
85
+ } while (tStartDate.getTime() !== cloneStartDate.getTime());
86
+ return new Date(cloneStartDate.getTime());
87
+ }
88
+ else {
89
+ return new Date(cloneStartDate.getTime());
90
+ }
86
91
  };
87
92
  /**
88
93
  * To update given date value to valid end date
@@ -117,36 +122,44 @@ var DateProcessor = /** @class */ (function () {
117
122
  }
118
123
  }
119
124
  var tempCheckDate;
120
- do {
121
- tempCheckDate = new Date(cloneEndDate.getTime());
122
- var holidayLength = this.parent.totalHolidayDates.length;
123
- if (this.isValidateNonWorkDays(ganttProp)) {
124
- if (!this.parent.includeWeekend) {
125
- var tempDate = new Date(cloneEndDate.getTime());
126
- cloneEndDate = this.getPreviousWorkingDay(cloneEndDate);
127
- if (tempDate.getTime() !== cloneEndDate.getTime()) {
128
- this.setTime(this.parent.defaultEndTime, cloneEndDate);
129
- }
130
- }
131
- for (var count = 0; count < holidayLength; count++) {
132
- var holidayFrom = this.getDateFromFormat(new Date(this.parent.totalHolidayDates[count]));
133
- var holidayTo = new Date(holidayFrom.getTime());
134
- var tempHoliday = new Date(cloneEndDate.getTime());
135
- tempHoliday.setMinutes(cloneEndDate.getMilliseconds() - 2);
136
- holidayFrom.setHours(0, 0, 0, 0);
137
- holidayTo.setHours(23, 59, 59, 59);
138
- if (cloneEndDate.getTime() >= holidayFrom.getTime() && cloneEndDate.getTime() < holidayTo.getTime() ||
139
- tempHoliday.getTime() >= holidayFrom.getTime() && tempHoliday.getTime() < holidayTo.getTime()) {
140
- cloneEndDate.setDate(cloneEndDate.getDate() - 1);
141
- if (!(cloneEndDate.getTime() === holidayFrom.getTime() && this.parent.defaultEndTime === 86400 &&
142
- this.getSecondsInDecimal(cloneEndDate) === 0)) {
125
+ if (this.parent.autoCalculateDateScheduling) {
126
+ do {
127
+ tempCheckDate = new Date(cloneEndDate.getTime());
128
+ var holidayLength = this.parent.totalHolidayDates.length;
129
+ if (this.isValidateNonWorkDays(ganttProp)) {
130
+ if (!this.parent.includeWeekend) {
131
+ var tempDate = new Date(cloneEndDate.getTime());
132
+ cloneEndDate = this.getPreviousWorkingDay(cloneEndDate);
133
+ if (tempDate.getTime() !== cloneEndDate.getTime()) {
143
134
  this.setTime(this.parent.defaultEndTime, cloneEndDate);
144
135
  }
145
136
  }
137
+ for (var count = 0; count < holidayLength; count++) {
138
+ var holidayFrom = this.getDateFromFormat(new Date(this.parent.totalHolidayDates[count]));
139
+ var holidayTo = new Date(holidayFrom.getTime());
140
+ var tempHoliday = new Date(cloneEndDate.getTime());
141
+ tempHoliday.setMinutes(cloneEndDate.getMilliseconds() - 2);
142
+ holidayFrom.setHours(0, 0, 0, 0);
143
+ holidayTo.setHours(23, 59, 59, 59);
144
+ if (cloneEndDate.getTime() >= holidayFrom.getTime() && cloneEndDate.getTime() < holidayTo.getTime() ||
145
+ tempHoliday.getTime() >= holidayFrom.getTime() && tempHoliday.getTime() < holidayTo.getTime()) {
146
+ cloneEndDate.setDate(cloneEndDate.getDate() - 1);
147
+ if (!(cloneEndDate.getTime() === holidayFrom.getTime() && this.parent.defaultEndTime === 86400 &&
148
+ this.getSecondsInDecimal(cloneEndDate) === 0)) {
149
+ this.setTime(this.parent.defaultEndTime, cloneEndDate);
150
+ }
151
+ }
152
+ }
146
153
  }
154
+ } while (tempCheckDate.getTime() !== cloneEndDate.getTime());
155
+ return new Date(cloneEndDate.getTime());
156
+ }
157
+ else {
158
+ if (!isNullOrUndefined(cloneEndDate)) {
159
+ this.setTime(this.parent.defaultEndTime, cloneEndDate);
147
160
  }
148
- } while (tempCheckDate.getTime() !== cloneEndDate.getTime());
149
- return new Date(cloneEndDate.getTime());
161
+ return new Date(cloneEndDate.getTime());
162
+ }
150
163
  };
151
164
  /**
152
165
  * To validate the baseline start date
@@ -261,6 +274,13 @@ var DateProcessor = /** @class */ (function () {
261
274
  }
262
275
  this.parent.setRecordValue('endDate', tempEndDate, ganttProp, true);
263
276
  }
277
+ else {
278
+ tempEndDate = ganttData[this.parent.taskFields.endDate];
279
+ if (!isNullOrUndefined(tempEndDate)) {
280
+ this.setTime(this.parent.defaultEndTime, tempEndDate);
281
+ }
282
+ this.parent.setRecordValue('endDate', tempEndDate, ganttProp, true);
283
+ }
264
284
  if (this.parent.taskFields.endDate) {
265
285
  this.parent.dataOperation.updateMappingData(ganttData, 'endDate');
266
286
  }
@@ -327,9 +347,9 @@ var DateProcessor = /** @class */ (function () {
327
347
  */
328
348
  DateProcessor.prototype.getNonworkingTime = function (sDate, eDate, isAutoSchedule, isCheckTimeZone) {
329
349
  isCheckTimeZone = isNullOrUndefined(isCheckTimeZone) ? true : isCheckTimeZone;
330
- var weekendCount = !this.parent.includeWeekend && isAutoSchedule ? this.getWeekendCount(sDate, eDate) : 0;
350
+ var weekendCount = (!this.parent.includeWeekend && this.parent.autoCalculateDateScheduling) && isAutoSchedule ? this.getWeekendCount(sDate, eDate) : 0;
331
351
  var totalHours = this.getNumberOfSeconds(sDate, eDate, isCheckTimeZone);
332
- var holidaysCount = isAutoSchedule ? this.getHolidaysCount(sDate, eDate) : 0;
352
+ var holidaysCount = isAutoSchedule && this.parent.autoCalculateDateScheduling ? this.getHolidaysCount(sDate, eDate) : 0;
333
353
  var totWorkDays = (totalHours - (weekendCount * 86400) - (holidaysCount * 86400)) / 86400; // working days between two dates
334
354
  var nonWorkHours = this.getNonWorkingSecondsOnDate(sDate, eDate, isAutoSchedule);
335
355
  var totalNonWorkTime = (totWorkDays * (86400 - this.parent.secondsPerDay)) +
@@ -521,6 +541,9 @@ var DateProcessor = /** @class */ (function () {
521
541
  if (!isNullOrUndefined(data.ganttProperties.startDate))
522
542
  sDate = data.ganttProperties.startDate;
523
543
  }
544
+ else {
545
+ sDate = _this.getProjectStartDate(ganttProp);
546
+ }
524
547
  });
525
548
  }
526
549
  else {
@@ -799,6 +822,9 @@ var DateProcessor = /** @class */ (function () {
799
822
  /*Check given date is on holidays*/
800
823
  DateProcessor.prototype.isOnHolidayOrWeekEnd = function (date, checkWeekEnd) {
801
824
  checkWeekEnd = !isNullOrUndefined(checkWeekEnd) ? checkWeekEnd : this.parent.includeWeekend;
825
+ if (!this.parent.autoCalculateDateScheduling) {
826
+ checkWeekEnd = true;
827
+ }
802
828
  if (!checkWeekEnd && this.parent.nonWorkingDayIndex.indexOf(date.getDay()) !== -1) {
803
829
  return true;
804
830
  }
@@ -828,8 +854,8 @@ var DateProcessor = /** @class */ (function () {
828
854
  var startRangeIndex = -1;
829
855
  var endRangeIndex = -1;
830
856
  var totNonWrkSecs = 0;
831
- var startOnHoliday = isAutoSchedule ? this.isOnHolidayOrWeekEnd(startDate, null) : false;
832
- var endOnHoliday = isAutoSchedule ? this.isOnHolidayOrWeekEnd(endDate, null) : false;
857
+ var startOnHoliday = isAutoSchedule && this.parent.autoCalculateDateScheduling ? this.isOnHolidayOrWeekEnd(startDate, null) : false;
858
+ var endOnHoliday = isAutoSchedule && this.parent.autoCalculateDateScheduling ? this.isOnHolidayOrWeekEnd(endDate, null) : false;
833
859
  for (var i = 0; i < this.parent.nonWorkingTimeRanges.length; i++) {
834
860
  var val = this.parent.nonWorkingTimeRanges[i];
835
861
  if (sHour >= val.from && sHour <= val.to) {
@@ -101,9 +101,11 @@ var GanttChart = /** @class */ (function () {
101
101
  }
102
102
  else {
103
103
  if (this.parent.viewType === 'ProjectView') {
104
- this.parent.chartRowsModule.ganttChartTableBody.children[i].children[0].children[1].children[1].setAttribute('tabindex', '-1');
104
+ if (!isNullOrUndefined(this.parent.chartRowsModule.ganttChartTableBody.children[parseInt(i.toString(), 10)].children[0].children[1].children[1])) {
105
+ this.parent.chartRowsModule.ganttChartTableBody.children[i].children[0].children[1].children[1].setAttribute('tabindex', '-1');
106
+ }
105
107
  }
106
- else if (this.parent.chartRowsModule.ganttChartTableBody.children[i].children[0].children[1].children[0]) {
108
+ else if (this.parent.chartRowsModule.ganttChartTableBody.children[parseInt(i.toString(), 10)].children[0].children[1].children[0]) {
107
109
  this.parent.chartRowsModule.ganttChartTableBody.children[i].children[0].children[1].children[0].setAttribute('tabindex', '-1');
108
110
  }
109
111
  }
@@ -156,7 +158,14 @@ var GanttChart = /** @class */ (function () {
156
158
  Math.floor((this.parent.rowHeight - this.parent.chartRowsModule.taskBarHeight));
157
159
  };
158
160
  GanttChart.prototype.renderRange = function (rangeCollection, currentRecord) {
159
- var topValue = this.getTopValue(currentRecord);
161
+ var topValue = 0;
162
+ var rowIndex = this.parent.currentViewData.indexOf(currentRecord);
163
+ if (!this.parent.allowTaskbarOverlap && this.parent.enableMultiTaskbar) {
164
+ topValue = !currentRecord.expanded ? this.parent.getRowByIndex(rowIndex).offsetTop : this.parent.getRowByIndex(rowIndex).offsetTop + this.parent.rowHeight;
165
+ }
166
+ else {
167
+ topValue = this.getTopValue(currentRecord);
168
+ }
160
169
  var sameIDElement = this.rangeViewContainer.querySelector('.' + 'rangeContainer' + currentRecord.ganttProperties.rowUniqueID);
161
170
  if (sameIDElement) {
162
171
  sameIDElement.remove();
@@ -169,7 +178,14 @@ var GanttChart = /** @class */ (function () {
169
178
  return;
170
179
  }
171
180
  for (var i = 0; i < rangeCollection.length; i++) {
172
- var height = this.getRangeHeight(currentRecord);
181
+ var height = void 0;
182
+ if (!this.parent.allowTaskbarOverlap && !currentRecord.expanded && this.parent.enableMultiTaskbar) {
183
+ height = parseInt(this.parent.chartRowsModule.ganttChartTableBody.childNodes[rowIndex].style.height) -
184
+ (this.parent.rowHeight - this.parent.chartRowsModule.taskBarHeight);
185
+ }
186
+ else {
187
+ height = this.getRangeHeight(currentRecord);
188
+ }
173
189
  var leftDiv = createElement('div', {
174
190
  className: cls.rangeChildContainer + ' ' + 'e-leftarc', styles: (this.parent.enableRtl ? 'right:' : 'left:') +
175
191
  ((this.parent.enableRtl ? rangeCollection[i].left + rangeCollection[i].width - 5 : rangeCollection[i].left) + "px;\n top: " + Math.floor((this.parent.rowHeight - this.parent.chartRowsModule.taskBarHeight) / 2) + "px;\n height: " + (height + 1) + "px; border-right: 0px")
@@ -21,6 +21,21 @@ export interface GanttModel extends ComponentModel{
21
21
  */
22
22
  enableImmutableMode?: boolean;
23
23
 
24
+ /**
25
+ * Specifies whether to allow dependency connection support for parent records.
26
+ *
27
+ * @default true
28
+ */
29
+ allowParentDependency?: boolean;
30
+
31
+ /**
32
+ * Specifies whether to display or remove the untrusted HTML values in the TreeGrid component.
33
+      * If `enableHtmlSanitizer` set to true, then it will sanitize any suspected untrusted strings and scripts before rendering them.
34
+ *
35
+ * @default false
36
+ */
37
+ enableHtmlSanitizer?: boolean;
38
+
24
39
  /**
25
40
  * If `disableHtmlEncode` is set to true, it encodes the HTML of the header and content cells.
26
41
  *
@@ -42,6 +57,20 @@ export interface GanttModel extends ComponentModel{
42
57
  */
43
58
  enableVirtualMaskRow?: boolean;
44
59
 
60
+ /**
61
+ * Specifies whether to update offset value on a task for all the predecessor edit actions.
62
+ *
63
+ * @default true
64
+ */
65
+ UpdateOffsetOnTaskbarEdit?: boolean;
66
+
67
+ /**
68
+ * Specifies whether to auto calculate start and end-date based on various factors such as working time, holidays, weekends, and predecessors.
69
+ *
70
+ * @default true
71
+ */
72
+ autoCalculateDateScheduling?: boolean;
73
+
45
74
  /**
46
75
  * Enables or disables the focusing the task bar on click action.
47
76
  *
@@ -168,6 +197,20 @@ export interface GanttModel extends ComponentModel{
168
197
  */
169
198
  renderBaseline?: boolean;
170
199
 
200
+ /**
201
+ * Defines whether to enable or disable taskbar drag and drop.
202
+ *
203
+ * @default false
204
+ */
205
+ allowTaskbarDragAndDrop?: boolean;
206
+
207
+ /**
208
+ * Defines whether taskbar to get overlapped or not.
209
+ *
210
+ * @default true
211
+ */
212
+ allowTaskbarOverlap?: boolean;
213
+
171
214
  /**
172
215
  * Configures the grid lines in tree grid and gantt chart.
173
216
  *
@@ -316,6 +316,19 @@ export declare class Gantt extends Component<HTMLElement> implements INotifyProp
316
316
  * @default false
317
317
  */
318
318
  enableImmutableMode: boolean;
319
+ /**
320
+ * Specifies whether to allow dependency connection support for parent records.
321
+ *
322
+ * @default true
323
+ */
324
+ allowParentDependency: boolean;
325
+ /**
326
+ * Specifies whether to display or remove the untrusted HTML values in the TreeGrid component.
327
+ * If `enableHtmlSanitizer` set to true, then it will sanitize any suspected untrusted strings and scripts before rendering them.
328
+ *
329
+ * @default false
330
+ */
331
+ enableHtmlSanitizer: boolean;
319
332
  /**
320
333
  * If `disableHtmlEncode` is set to true, it encodes the HTML of the header and content cells.
321
334
  *
@@ -334,6 +347,18 @@ export declare class Gantt extends Component<HTMLElement> implements INotifyProp
334
347
  * @default true
335
348
  */
336
349
  enableVirtualMaskRow: boolean;
350
+ /**
351
+ * Specifies whether to update offset value on a task for all the predecessor edit actions.
352
+ *
353
+ * @default true
354
+ */
355
+ UpdateOffsetOnTaskbarEdit: boolean;
356
+ /**
357
+ * Specifies whether to auto calculate start and end-date based on various factors such as working time, holidays, weekends, and predecessors.
358
+ *
359
+ * @default true
360
+ */
361
+ autoCalculateDateScheduling: boolean;
337
362
  /**
338
363
  * Enables or disables the focusing the task bar on click action.
339
364
  *
@@ -444,6 +469,18 @@ export declare class Gantt extends Component<HTMLElement> implements INotifyProp
444
469
  * @default false
445
470
  */
446
471
  renderBaseline: boolean;
472
+ /**
473
+ * Defines whether to enable or disable taskbar drag and drop.
474
+ *
475
+ * @default false
476
+ */
477
+ allowTaskbarDragAndDrop: boolean;
478
+ /**
479
+ * Defines whether taskbar to get overlapped or not.
480
+ *
481
+ * @default true
482
+ */
483
+ allowTaskbarOverlap: boolean;
447
484
  /**
448
485
  * Configures the grid lines in tree grid and gantt chart.
449
486
  *
@@ -1639,9 +1676,10 @@ export declare class Gantt extends Component<HTMLElement> implements INotifyProp
1639
1676
  * @param {PdfExportProperties} pdfExportProperties - Defines the export properties of the Gantt.
1640
1677
  * @param {isMultipleExport} isMultipleExport - Define to enable multiple export.
1641
1678
  * @param {pdfDoc} pdfDoc - Defined the Pdf Document if multiple export is enabled.
1679
+ * @param {boolean} isBlob - If the 'isBlob' parameter is set to true, the method returns PDF data as a blob instead of exporting it as a down-loadable PDF file. The default value is false.
1642
1680
  * @returns {Promise<any>} .
1643
1681
  */
1644
- pdfExport(pdfExportProperties?: PdfExportProperties, isMultipleExport?: boolean, pdfDoc?: Object): Promise<Object>;
1682
+ pdfExport(pdfExportProperties?: PdfExportProperties, isMultipleExport?: boolean, pdfDoc?: Object, isBlob?: boolean): Promise<Object>;
1645
1683
  /**
1646
1684
  * Clears the filtered columns in Gantt.
1647
1685
  *