@syncfusion/ej2-gantt 20.1.58 → 20.2.36

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 (105) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/ej2-gantt.umd.min.js +2 -2
  3. package/dist/ej2-gantt.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-gantt.es2015.js +1100 -74
  5. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  6. package/dist/es6/ej2-gantt.es5.js +1099 -71
  7. package/dist/es6/ej2-gantt.es5.js.map +1 -1
  8. package/dist/global/ej2-gantt.min.js +2 -2
  9. package/dist/global/ej2-gantt.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +18 -18
  12. package/src/gantt/actions/actions.d.ts +1 -0
  13. package/src/gantt/actions/actions.js +1 -0
  14. package/src/gantt/actions/cell-edit.js +5 -3
  15. package/src/gantt/actions/connector-line-edit.js +20 -6
  16. package/src/gantt/actions/context-menu.js +3 -4
  17. package/src/gantt/actions/critical-path.d.ts +26 -0
  18. package/src/gantt/actions/critical-path.js +735 -0
  19. package/src/gantt/actions/dependency.js +3 -0
  20. package/src/gantt/actions/dialog-edit.js +1 -1
  21. package/src/gantt/actions/edit.js +29 -3
  22. package/src/gantt/actions/filter.js +1 -1
  23. package/src/gantt/actions/keyboard.js +2 -2
  24. package/src/gantt/actions/selection.js +3 -0
  25. package/src/gantt/actions/taskbar-edit.js +6 -4
  26. package/src/gantt/actions/toolbar.js +22 -4
  27. package/src/gantt/base/css-constants.d.ts +12 -0
  28. package/src/gantt/base/css-constants.js +12 -0
  29. package/src/gantt/base/date-processor.d.ts +1 -1
  30. package/src/gantt/base/date-processor.js +8 -2
  31. package/src/gantt/base/enum.d.ts +3 -1
  32. package/src/gantt/base/gantt-chart.js +6 -2
  33. package/src/gantt/base/gantt-model.d.ts +8 -1
  34. package/src/gantt/base/gantt.d.ts +32 -1
  35. package/src/gantt/base/gantt.js +133 -5
  36. package/src/gantt/base/interface.d.ts +16 -0
  37. package/src/gantt/base/splitter.js +4 -0
  38. package/src/gantt/base/task-processor.js +19 -6
  39. package/src/gantt/base/tree-grid.js +1 -1
  40. package/src/gantt/export/export-helper.js +19 -6
  41. package/src/gantt/export/pdf-base/pdf-style/gantt-theme.js +16 -0
  42. package/src/gantt/renderer/chart-rows.js +16 -5
  43. package/src/gantt/renderer/nonworking-day.js +5 -2
  44. package/src/gantt/renderer/timeline.js +35 -14
  45. package/src/global.js +1 -1
  46. package/styles/bootstrap-dark.css +272 -14
  47. package/styles/bootstrap.css +271 -14
  48. package/styles/bootstrap4.css +273 -12
  49. package/styles/bootstrap5-dark.css +272 -15
  50. package/styles/bootstrap5.css +272 -15
  51. package/styles/fabric-dark.css +270 -12
  52. package/styles/fabric.css +276 -18
  53. package/styles/fluent-dark.css +272 -14
  54. package/styles/fluent.css +272 -14
  55. package/styles/gantt/_bootstrap-dark-definition.scss +59 -16
  56. package/styles/gantt/_bootstrap-definition.scss +57 -14
  57. package/styles/gantt/_bootstrap4-definition.scss +65 -21
  58. package/styles/gantt/_bootstrap5-definition.scss +55 -12
  59. package/styles/gantt/_fabric-dark-definition.scss +58 -15
  60. package/styles/gantt/_fabric-definition.scss +58 -15
  61. package/styles/gantt/_fluent-definition.scss +53 -10
  62. package/styles/gantt/_fusionnew-definition.scss +212 -0
  63. package/styles/gantt/_highcontrast-definition.scss +57 -14
  64. package/styles/gantt/_highcontrast-light-definition.scss +55 -12
  65. package/styles/gantt/_layout.scss +293 -7
  66. package/styles/gantt/_material-dark-definition.scss +60 -16
  67. package/styles/gantt/_material-definition.scss +65 -21
  68. package/styles/gantt/_material3-definition.scss +213 -0
  69. package/styles/gantt/_tailwind-definition.scss +52 -8
  70. package/styles/gantt/_theme.scss +56 -1
  71. package/styles/gantt/bootstrap-dark.css +272 -14
  72. package/styles/gantt/bootstrap.css +271 -14
  73. package/styles/gantt/bootstrap4.css +273 -12
  74. package/styles/gantt/bootstrap5-dark.css +272 -15
  75. package/styles/gantt/bootstrap5.css +272 -15
  76. package/styles/gantt/fabric-dark.css +270 -12
  77. package/styles/gantt/fabric.css +276 -18
  78. package/styles/gantt/fluent-dark.css +272 -14
  79. package/styles/gantt/fluent.css +272 -14
  80. package/styles/gantt/highcontrast-light.css +260 -13
  81. package/styles/gantt/highcontrast.css +271 -13
  82. package/styles/gantt/icons/_bootstrap-dark.scss +12 -1
  83. package/styles/gantt/icons/_bootstrap.scss +12 -1
  84. package/styles/gantt/icons/_bootstrap4.scss +12 -1
  85. package/styles/gantt/icons/_bootstrap5.scss +12 -0
  86. package/styles/gantt/icons/_fabric-dark.scss +12 -0
  87. package/styles/gantt/icons/_fabric.scss +12 -0
  88. package/styles/gantt/icons/_fluent.scss +12 -0
  89. package/styles/gantt/icons/_fusionnew.scss +120 -0
  90. package/styles/gantt/icons/_highcontrast.scss +12 -0
  91. package/styles/gantt/icons/_material-dark.scss +12 -0
  92. package/styles/gantt/icons/_material.scss +12 -0
  93. package/styles/gantt/icons/_material3.scss +124 -0
  94. package/styles/gantt/icons/_tailwind-dark.scss +12 -0
  95. package/styles/gantt/icons/_tailwind.scss +12 -0
  96. package/styles/gantt/material-dark.css +277 -12
  97. package/styles/gantt/material.css +279 -14
  98. package/styles/gantt/tailwind-dark.css +279 -15
  99. package/styles/gantt/tailwind.css +276 -12
  100. package/styles/highcontrast-light.css +260 -13
  101. package/styles/highcontrast.css +271 -13
  102. package/styles/material-dark.css +277 -12
  103. package/styles/material.css +279 -14
  104. package/styles/tailwind-dark.css +279 -15
  105. package/styles/tailwind.css +276 -12
@@ -391,7 +391,7 @@ var DateProcessor = /** @__PURE__ @class */ (function () {
391
391
  * @returns {Date} .
392
392
  * @private
393
393
  */
394
- DateProcessor.prototype.checkBaselineEndDate = function (date) {
394
+ DateProcessor.prototype.checkBaselineEndDate = function (date, ganttProp) {
395
395
  if (isNullOrUndefined(date)) {
396
396
  return null;
397
397
  }
@@ -401,7 +401,7 @@ var DateProcessor = /** @__PURE__ @class */ (function () {
401
401
  if (hour > this.parent.defaultEndTime) {
402
402
  this.setTime(this.parent.defaultEndTime, cloneDate);
403
403
  }
404
- else if (hour <= this.parent.defaultStartTime) {
404
+ else if (hour <= this.parent.defaultStartTime && !ganttProp.isMilestone) {
405
405
  cloneDate.setDate(cloneDate.getDate() - 1);
406
406
  this.setTime(this.parent.defaultEndTime, cloneDate);
407
407
  }
@@ -1390,6 +1390,12 @@ var DateProcessor = /** @__PURE__ @class */ (function () {
1390
1390
  */
1391
1391
  DateProcessor.prototype.calculateProjectDates = function (editArgs) {
1392
1392
  var _this = this;
1393
+ if (this.parent.isLoad && this.parent.enablePersistence &&
1394
+ this.parent.cloneProjectStartDate && this.parent.cloneProjectEndDate) {
1395
+ this.parent.cloneProjectStartDate = this.getDateFromFormat(this.parent.cloneProjectStartDate);
1396
+ this.parent.cloneProjectEndDate = this.getDateFromFormat(this.parent.cloneProjectEndDate);
1397
+ return;
1398
+ }
1393
1399
  var sDate = typeof this.parent.projectStartDate === 'string' ?
1394
1400
  new Date(this.parent.projectStartDate) : this.parent.projectStartDate;
1395
1401
  var eDate = typeof this.parent.projectEndDate === 'string' ?
@@ -1602,10 +1608,11 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
1602
1608
  var mappingData = new DataManager(dataSource).executeLocal(new Query()
1603
1609
  .group(this.parent.taskFields.parentID));
1604
1610
  var rootData = [];
1611
+ var index;
1605
1612
  for (var i = 0; i < mappingData.length; i++) {
1606
1613
  var groupData = mappingData[i];
1607
1614
  if (!isNullOrUndefined(groupData.key)) {
1608
- var index = this.taskIds.indexOf(groupData.key.toString());
1615
+ index = this.taskIds.indexOf(groupData.key.toString());
1609
1616
  if (index > -1) {
1610
1617
  if (!isNullOrUndefined(groupData.key)) {
1611
1618
  dataSource[index][this.parent.taskFields.child] = groupData.items;
@@ -1613,7 +1620,9 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
1613
1620
  }
1614
1621
  }
1615
1622
  }
1616
- rootData.push.apply(rootData, groupData.items); // eslint-disable-line
1623
+ if (index !== -1) {
1624
+ rootData.push.apply(rootData, groupData.items); // eslint-disable-line
1625
+ }
1617
1626
  }
1618
1627
  this.hierarchyData = this.dataReorder(dataSource, rootData);
1619
1628
  };
@@ -1874,7 +1883,11 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
1874
1883
  if (baselineEndDate && baselineEndDate.getHours() === 0 && this.parent.defaultEndTime !== 86400) {
1875
1884
  this.setTime(this.parent.defaultEndTime, baselineEndDate);
1876
1885
  }
1877
- this.parent.setRecordValue('baselineEndDate', this.checkBaselineEndDate(baselineEndDate), ganttProperties, true);
1886
+ if ((ganttProperties.baselineStartDate && baselineEndDate &&
1887
+ (ganttProperties.baselineStartDate.getTime() > baselineEndDate.getTime())) || ganttProperties.isMilestone) {
1888
+ baselineEndDate = ganttProperties.baselineStartDate;
1889
+ }
1890
+ this.parent.setRecordValue('baselineEndDate', this.checkBaselineEndDate(baselineEndDate, ganttProperties), ganttProperties, true);
1878
1891
  this.parent.setRecordValue('progress', progress, ganttProperties, true);
1879
1892
  this.parent.setRecordValue('totalProgress', progress, ganttProperties, true);
1880
1893
  this.parent.setRecordValue('predecessorsName', predecessors, ganttProperties, true);
@@ -1895,7 +1908,6 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
1895
1908
  !isNullOrUndefined(taskSettings.child)) {
1896
1909
  this.parent.setRecordValue(taskSettings.child, [], ganttData);
1897
1910
  }
1898
- this.parent.setRecordValue('baselineEndDate', this.checkBaselineEndDate(baselineEndDate), ganttProperties, true);
1899
1911
  if (!isNullOrUndefined(data[taskSettings.child]) && data[taskSettings.child].length > 0) {
1900
1912
  this.parent.setRecordValue('hasChildRecords', true, ganttData);
1901
1913
  this.parent.setRecordValue('isMilestone', false, ganttProperties, true);
@@ -2108,6 +2120,13 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
2108
2120
  work = parseFloat(work.toFixed(2));
2109
2121
  }
2110
2122
  }
2123
+ if (ganttData.childRecords.length > 0 && this.parent.isOnEdit) {
2124
+ var childCompletedWorks = 0;
2125
+ for (var i = 0; i < ganttData.childRecords.length; i++) {
2126
+ childCompletedWorks += ganttData.childRecords[i].ganttProperties.work;
2127
+ }
2128
+ work += childCompletedWorks;
2129
+ }
2111
2130
  this.parent.setRecordValue('work', work, ganttData.ganttProperties, true);
2112
2131
  if (!isNullOrUndefined(this.parent.taskFields.work)) {
2113
2132
  this.parent.dataOperation.updateMappingData(ganttData, 'work');
@@ -2604,7 +2623,7 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
2604
2623
  TaskProcessor.prototype.calculateBaselineWidth = function (ganttProperties) {
2605
2624
  var baselineStartDate = this.getDateFromFormat(ganttProperties.baselineStartDate);
2606
2625
  var baselineEndDate = this.getDateFromFormat(ganttProperties.baselineEndDate);
2607
- if (baselineStartDate && baselineEndDate) {
2626
+ if (baselineStartDate && baselineEndDate && (baselineStartDate.getTime() !== baselineEndDate.getTime())) {
2608
2627
  return (this.getTaskWidth(baselineStartDate, baselineEndDate));
2609
2628
  }
2610
2629
  else {
@@ -3732,7 +3751,7 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
3732
3751
  }
3733
3752
  this.updateWorkWithDuration(parentData);
3734
3753
  var parentWork = parentProp.work;
3735
- parentWork += childCompletedWorks;
3754
+ parentWork = this.parent.isOnEdit ? parentWork : (parentWork + childCompletedWorks);
3736
3755
  this.parent.setRecordValue('work', parentWork, parentProp, true);
3737
3756
  this.parent.setRecordValue('taskType', 'FixedDuration', parentProp, true);
3738
3757
  if (!isNullOrUndefined(this.parent.taskFields.type)) {
@@ -3804,8 +3823,12 @@ var parentProgressBarInnerDiv = 'e-gantt-parent-progressbar-inner-div';
3804
3823
  var taskLabel = 'e-task-label';
3805
3824
  var childTaskBarInnerDiv = 'e-gantt-child-taskbar-inner-div';
3806
3825
  var childProgressBarInnerDiv = 'e-gantt-child-progressbar-inner-div';
3826
+ var criticalChildTaskBarInnerDiv = 'e-gantt-child-critical-taskbar-inner-div';
3827
+ var criticalChildProgressBarInnerDiv = 'e-gantt-child-critical-progressbar-inner-div';
3807
3828
  var milestoneTop = 'e-milestone-top';
3808
3829
  var milestoneBottom = 'e-milestone-bottom';
3830
+ var criticalMilestoneTop = 'e-critical-milestone-top';
3831
+ var criticalMilestoneBottom = 'e-critical-milestone-bottom';
3809
3832
  var baselineBar = 'e-baseline-bar';
3810
3833
  var baselineMilestoneContainer = 'e-baseline-gantt-milestone-container';
3811
3834
  var baselineMilestoneDiv = 'e-baseline-gantt-milestone';
@@ -3841,6 +3864,7 @@ var traceManualUnscheduledTask = 'e-gantt-unscheduled-manualtask';
3841
3864
  var traceParentTaskBar = 'e-gantt-parent-taskbar';
3842
3865
  var traceParentProgressBar = 'e-gantt-parent-progressbar';
3843
3866
  var traceUnscheduledTask = 'e-gantt-unscheduled-task';
3867
+ var criticalUnscheduledTask = 'e-gantt-critical-unscheduled-taskbar';
3844
3868
  var taskIndicatorDiv = 'e-indicator-span';
3845
3869
  var leftResizeGripper = 'e-left-resize-gripper';
3846
3870
  var rightResizeGripper = 'e-right-resize-gripper';
@@ -3868,13 +3892,19 @@ var unscheduledMilestoneBottom = 'e-unscheduled-milestone-bottom';
3868
3892
  var dependencyViewContainer = 'e-gantt-dependency-view-container';
3869
3893
  var connectorLineContainer = 'e-connector-line-container';
3870
3894
  var connectorLine = 'e-line';
3895
+ var criticalConnectorLine = 'e-criticalconnector-line';
3896
+ var criticalConnectorLineRightArrow = 'e-criticalconnector-line-right-arrow';
3897
+ var criticalConnectorLineLeftArrow = 'e-criticalconnector-line-left-arrow';
3871
3898
  var connectorLineRightArrow = 'e-connector-line-right-arrow';
3872
3899
  var connectorLineLeftArrow = 'e-connector-line-left-arrow';
3873
3900
  var connectorLineZIndex = 'e-connector-line-z-index';
3874
3901
  var connectorLineHover = 'e-connector-line-hover';
3902
+ var criticalConnectorLineHover = 'e-critical-connector-line-hover';
3875
3903
  var connectorLineHoverZIndex = 'e-connector-line-hover-z-index';
3876
3904
  var connectorLineRightArrowHover = 'e-connector-line-right-arrow-hover';
3877
3905
  var connectorLineLeftArrowHover = 'e-connector-line-left-arrow-hover';
3906
+ var criticalConnectorLineRightArrowHover = 'e-critical-connector-line-right-arrow-hover';
3907
+ var criticalConnectorLineLeftArrowHover = 'e-critical-connector-line-left-arrow-hover';
3878
3908
 
3879
3909
  var connectorPointLeft = 'e-connectorpoint-left';
3880
3910
  var connectorPointRight = 'e-connectorpoint-right';
@@ -3901,6 +3931,7 @@ var editIcon = 'e-edit';
3901
3931
  var indentIcon = 'e-indent';
3902
3932
  var outdentIcon = 'e-outdent';
3903
3933
  var addIcon = 'e-add';
3934
+
3904
3935
  var addAboveIcon = 'e-add-above';
3905
3936
  var addBelowIcon = 'e-add-below';
3906
3937
  //Predecessor touch mode
@@ -4206,6 +4237,10 @@ var GanttChart = /** @__PURE__ @class */ (function () {
4206
4237
  this.parent.predecessorModule.createConnectorLinesCollection();
4207
4238
  }
4208
4239
  this.parent.connectorLineModule.renderConnectorLines(this.parent.updatedConnectorLineCollection);
4240
+ if (this.parent.enableCriticalPath) {
4241
+ var crtiticalModule = this.parent.criticalPathModule;
4242
+ this.parent.criticalPathModule.criticalConnectorLine(crtiticalModule.criticalPathCollection, crtiticalModule.detailPredecessorCollection, this.parent.enableCriticalPath, crtiticalModule.predecessorCollectionTaskIds);
4243
+ }
4209
4244
  if (this.parent.viewType === 'ResourceView' && this.parent.showOverAllocation) {
4210
4245
  this.renderOverAllocationContainer();
4211
4246
  }
@@ -5081,7 +5116,7 @@ var GanttChart = /** @__PURE__ @class */ (function () {
5081
5116
  this.parent.treeGrid.grid.notify('key-pressed', e);
5082
5117
  }
5083
5118
  }
5084
- if (!isInEditedState) {
5119
+ if (!isNullOrUndefined(isInEditedState) && !this.parent.editModule.cellEditModule.isCellEdit) {
5085
5120
  if (nextElement) {
5086
5121
  if ($target.classList.contains('e-rowcell')) {
5087
5122
  this.manageFocus($target, 'remove', false);
@@ -5089,7 +5124,7 @@ var GanttChart = /** @__PURE__ @class */ (function () {
5089
5124
  else {
5090
5125
  this.manageFocus($target, 'remove', true);
5091
5126
  }
5092
- if (nextElement.classList.contains('e-rowcell') && $target.nextElementSibling) {
5127
+ if ((nextElement.classList.contains('e-rowcell') && $target.nextElementSibling) || $target.classList.contains('e-right-label-container')) {
5093
5128
  if (!$target.classList.contains('e-rowcell')) {
5094
5129
  this.parent.treeGrid.grid.notify('key-pressed', e);
5095
5130
  var fmodule = getValue('focusModule', this.parent.treeGrid.grid);
@@ -5382,6 +5417,9 @@ var Timeline = /** @__PURE__ @class */ (function () {
5382
5417
  this.totalTimelineWidth = 0;
5383
5418
  this.customTimelineSettings = null;
5384
5419
  this.parent.isTimelineRoundOff = this.isZoomToFit ? false : isNullOrUndefined(this.parent.projectStartDate) ? true : false;
5420
+ if (this.parent.enablePersistence) {
5421
+ this.parent.timelineSettings = this.parent.currentZoomingLevel;
5422
+ }
5385
5423
  };
5386
5424
  /**
5387
5425
  * To render timeline header series.
@@ -5509,6 +5547,10 @@ var Timeline = /** @__PURE__ @class */ (function () {
5509
5547
  this.parent.isTimelineRoundOff = this.isZoomToFit ? false : isNullOrUndefined(this.parent.projectStartDate) ? true : false;
5510
5548
  this.processTimelineUnit();
5511
5549
  this.parent.updateProjectDates(this.parent.cloneProjectStartDate, this.parent.cloneProjectEndDate, this.parent.isTimelineRoundOff);
5550
+ var criticalModule = this.parent.criticalPathModule;
5551
+ if (this.parent.enableCriticalPath && criticalModule) {
5552
+ criticalModule.criticalConnectorLine(criticalModule.criticalPathCollection, criticalModule.detailPredecessorCollection, true, criticalModule.predecessorCollectionTaskIds);
5553
+ }
5512
5554
  if (this.isZooming || this.isZoomToFit) {
5513
5555
  var args = {
5514
5556
  requestType: this.isZoomIn ? 'AfterZoomIn' : this.isZoomToFit ? 'AfterZoomToProject' : 'AfterZoomOut',
@@ -5531,6 +5573,9 @@ var Timeline = /** @__PURE__ @class */ (function () {
5531
5573
  this.parent.zoomingProjectEndDate = this.parent.cloneProjectEndDate;
5532
5574
  }
5533
5575
  this.parent.dataOperation.calculateProjectDates();
5576
+ if (this.parent.zoomingProjectStartDate > this.parent.cloneProjectStartDate) {
5577
+ this.parent.cloneProjectStartDate = new Date(this.parent.allowUnscheduledTasks ? this.parent.zoomingProjectStartDate : this.parent.cloneProjectStartDate);
5578
+ }
5534
5579
  var timeDifference = (this.parent.cloneProjectEndDate.getTime() - this.parent.cloneProjectStartDate.getTime());
5535
5580
  var totalDays = (timeDifference / (1000 * 3600 * 24));
5536
5581
  var chartWidth = this.parent.ganttChartModule.chartElement.offsetWidth;
@@ -6169,7 +6214,7 @@ var Timeline = /** @__PURE__ @class */ (function () {
6169
6214
  parentTr = this.getHeaterTemplateString(new Date(startDate.toString()), mode, tier, false, count, timelineCell, isFirstCell);
6170
6215
  scheduleDateCollection.push(new Date(startDate.toString()));
6171
6216
  if (isFirstCell) {
6172
- newTime = this.calculateQuarterEndDate(startDate).getTime();
6217
+ newTime = this.calculateQuarterEndDate(startDate, count).getTime();
6173
6218
  }
6174
6219
  else {
6175
6220
  increment = this.getIncrement(startDate, count, mode);
@@ -6325,19 +6370,29 @@ var Timeline = /** @__PURE__ @class */ (function () {
6325
6370
  mode === 'Hour' || mode === 'Minutes') &&
6326
6371
  this.parent.nonWorkingDayIndex.indexOf(day.getDay()) !== -1;
6327
6372
  };
6328
- Timeline.prototype.calculateQuarterEndDate = function (date) {
6373
+ Timeline.prototype.calculateQuarterEndDate = function (date, count) {
6329
6374
  var month = date.getMonth();
6330
- if (month >= 0 && month <= 2) {
6331
- return new Date(date.getFullYear(), 3, 1);
6332
- }
6333
- else if (month >= 3 && month <= 5) {
6334
- return new Date(date.getFullYear(), 6, 1);
6335
- }
6336
- else if (month >= 6 && month <= 8) {
6337
- return new Date(date.getFullYear(), 9, 1);
6375
+ if (count === 3) {
6376
+ if (month >= 0 && month <= 2) {
6377
+ return new Date(date.getFullYear(), 3, 1);
6378
+ }
6379
+ else if (month >= 3 && month <= 5) {
6380
+ return new Date(date.getFullYear(), 6, 1);
6381
+ }
6382
+ else if (month >= 6 && month <= 8) {
6383
+ return new Date(date.getFullYear(), 9, 1);
6384
+ }
6385
+ else {
6386
+ return new Date(date.getFullYear() + 1, 0, 1);
6387
+ }
6338
6388
  }
6339
6389
  else {
6340
- return new Date(date.getFullYear() + 1, 0, 1);
6390
+ if (month >= 0 && month <= 5) {
6391
+ return new Date(date.getFullYear(), 6, 1);
6392
+ }
6393
+ else {
6394
+ return new Date(date.getFullYear() + 1, 0, 1);
6395
+ }
6341
6396
  }
6342
6397
  };
6343
6398
  /**
@@ -6368,7 +6423,7 @@ var Timeline = /** @__PURE__ @class */ (function () {
6368
6423
  this.customFormat(scheduleWeeks, format, tier, mode, formatter);
6369
6424
  thWidth = (this.getIncrement(scheduleWeeks, count, mode) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth;
6370
6425
  var cellWidth = thWidth;
6371
- thWidth = isLast || isFirstCell ? isLast ? this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.timelineRoundOffEndDate) : this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.calculateQuarterEndDate(scheduleWeeks))
6426
+ thWidth = isLast || isFirstCell ? isLast ? this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.timelineRoundOffEndDate) : this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.calculateQuarterEndDate(scheduleWeeks, count))
6372
6427
  : thWidth;
6373
6428
  var isWeekendCell = this.isWeekendHeaderCell(mode, tier, scheduleWeeks);
6374
6429
  var textClassName = tier === 'topTier' ? ' e-gantt-top-cell-text' : '';
@@ -6718,8 +6773,9 @@ var Timeline = /** @__PURE__ @class */ (function () {
6718
6773
  if (type === 'prevTimeSpan' && isFrom === 'publicMethod') {
6719
6774
  this.parent.ganttChartModule.updateScrollLeft(0);
6720
6775
  }
6721
- else if (type === 'nextTimeSpan' && isFrom === 'publicMethod') {
6722
- this.parent.ganttChartModule.updateScrollLeft(this.parent.timelineModule.totalTimelineWidth);
6776
+ else if ((type === 'nextTimeSpan' && isFrom === 'publicMethod') || (type === 'nextTimeSpan' && isFrom === 'TaskbarEditing')) {
6777
+ var currentScrollLeft = document.getElementsByClassName('e-chart-scroll-container e-content')[0].scrollLeft;
6778
+ this.parent.element.querySelector('.e-timeline-header-container').scrollLeft = currentScrollLeft;
6723
6779
  }
6724
6780
  this.parent.timelineModule.timeSpanActionEvent('actionComplete', type, isFrom);
6725
6781
  }
@@ -6958,7 +7014,7 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
6958
7014
  var scrollWidth = this.getScrollbarWidth();
6959
7015
  var isMobile = /Android|Mac|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
6960
7016
  if (scrollWidth !== 0) {
6961
- content.style.cssText += 'width: calc(100% + ' + (scrollWidth + 1) + 'px);';
7017
+ content.style.cssText += 'width: calc(100% + ' + (scrollWidth + 1) + 'px);'; //actual scrollbar width 17 px but here scrollbar width set to 16px hence adding increment of 1
6962
7018
  }
6963
7019
  else {
6964
7020
  content.classList.add('e-gantt-scroll-padding');
@@ -8449,7 +8505,8 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
8449
8505
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
8450
8506
  }
8451
8507
  if (labelString.indexOf('null') === -1) {
8452
- if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate' && !this.isTemplate(this.parent.labelSettings.taskLabel)) {
8508
+ if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate' &&
8509
+ !this.isTemplate(this.parent.labelSettings.taskLabel)) {
8453
8510
  labelString = '';
8454
8511
  }
8455
8512
  if (isNaN(parseInt(labelString))) {
@@ -8499,7 +8556,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
8499
8556
  progressDiv[0].querySelectorAll('.e-task-label')[0].children[0])
8500
8557
  progressDiv[0].querySelectorAll('.e-task-label')[0].children[0].remove();
8501
8558
  if (progressDiv[0].querySelectorAll('.e-task-label')[0].textContent == '' &&
8502
- childLabel && !childLabel['elementRef'] && tempDiv.innerHTML != '')
8559
+ childLabel && !childLabel['elementRef'] && tempDiv.innerHTML !== '')
8503
8560
  progressDiv[0].querySelectorAll('.e-task-label')[0].textContent = childLabel;
8504
8561
  }
8505
8562
  if (!isNullOrUndefined(taskbarInnerDiv) && taskbarInnerDiv.length > 0) {
@@ -8517,6 +8574,13 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
8517
8574
  var splitTasks = '';
8518
8575
  for (var i = 0; i < data.ganttProperties.segments.length; i++) {
8519
8576
  var segment = data.ganttProperties.segments[i];
8577
+ var progressBarVisible = void 0;
8578
+ if (!segment.showProgress) {
8579
+ progressBarVisible = 'hidden';
8580
+ }
8581
+ else {
8582
+ progressBarVisible = 'initial';
8583
+ }
8520
8584
  var segmentPosition = (i === 0) ? 'e-segment-first' : (i === data.ganttProperties.segments.length - 1)
8521
8585
  ? 'e-segment-last' : 'e-segment-inprogress';
8522
8586
  splitTasks += (
@@ -8524,7 +8588,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
8524
8588
  '<div class="' + childTaskBarInnerDiv + ' ' + segmentPosition + ' ' + traceChildTaskBar + ' ' +
8525
8589
  ' e-segmented-taskbar' +
8526
8590
  '"style="width:' + segment.width + 'px;position: absolute; left:' + segment.left + 'px;height:' +
8527
- (this.taskBarHeight) + 'px; overflow: initial;" data-segment-index = "' + i + '" aria-label = "' +
8591
+ (this.taskBarHeight) + 'px; overflow:' + progressBarVisible + ';" data-segment-index = "' + i + '" aria-label = "' +
8528
8592
  this.generateSpiltTaskAriaLabel(segment, data.ganttProperties) + '"> ' +
8529
8593
  this.getSplitTaskbarLeftResizerNode() +
8530
8594
  //split progress bar
@@ -8646,6 +8710,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
8646
8710
  this.parent.dataOperation.updateMappingData(mergeData, 'segments');
8647
8711
  if (segments.length === 1) {
8648
8712
  this.parent.setRecordValue('endDate', endDate, mergeData.ganttProperties, true);
8713
+ this.parent.setRecordValue('EndDate', endDate, mergeData, true);
8649
8714
  this.parent.setRecordValue('segments', null, mergeData.ganttProperties, true);
8650
8715
  this.parent.dataOperation.updateMappingData(mergeData, 'segments');
8651
8716
  }
@@ -8814,6 +8879,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
8814
8879
  else {
8815
8880
  startDate = new Date(splitDate.getTime());
8816
8881
  startDate.setDate(startDate.getDate() + 1 + increment);
8882
+ this.setTime(this.parent.defaultStartTime, startDate);
8817
8883
  startDate = this.parent.dataOperation.checkStartDate(startDate, ganttProp, false);
8818
8884
  segmentEndDate = new Date(endDate.getTime());
8819
8885
  segmentEndDate.setDate(segmentEndDate.getDate() + 1);
@@ -9087,7 +9153,8 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9087
9153
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
9088
9154
  }
9089
9155
  if (labelString.indexOf('null') === -1) {
9090
- if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate' && !this.isTemplate(this.parent.labelSettings.taskLabel)) {
9156
+ if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate' &&
9157
+ !this.isTemplate(this.parent.labelSettings.taskLabel)) {
9091
9158
  labelString = '';
9092
9159
  }
9093
9160
  if (isNaN(parseInt(labelString))) {
@@ -9116,7 +9183,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9116
9183
  progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].children[0])
9117
9184
  progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].children[0].remove();
9118
9185
  if (progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent == '' &&
9119
- parentLabel && !parentLabel['elementRef'] && div.innerHTML != '')
9186
+ parentLabel && !parentLabel['elementRef'] && div.innerHTML !== '')
9120
9187
  progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent = parentLabel;
9121
9188
  }
9122
9189
  var milestoneTemplate = '<div class="' + parentMilestone + '" style="position:absolute;">' +
@@ -10672,6 +10739,9 @@ var Dependency = /** @__PURE__ @class */ (function () {
10672
10739
  Dependency.prototype.updateConnectorLineObject = function (parentGanttRecord, childGanttRecord, predecessor) {
10673
10740
  var connectorObj = this.parent.connectorLineModule.createConnectorLineObject(parentGanttRecord, childGanttRecord, predecessor);
10674
10741
  if (connectorObj) {
10742
+ if (childGanttRecord.isCritical && parentGanttRecord.isCritical) {
10743
+ connectorObj.isCritical = true;
10744
+ }
10675
10745
  if ((this.parent.connectorLineIds.length > 0 && this.parent.connectorLineIds.indexOf(connectorObj.connectorLineId) === -1) ||
10676
10746
  this.parent.connectorLineIds.length === 0) {
10677
10747
  this.parent.updatedConnectorLineCollection.push(connectorObj);
@@ -11746,6 +11816,7 @@ var Splitter$1 = /** @__PURE__ @class */ (function () {
11746
11816
  this.splitterObject = new Splitter({
11747
11817
  height: null,
11748
11818
  width: this.parent.ganttWidth.toString(),
11819
+ enablePersistence: this.parent.enablePersistence,
11749
11820
  separatorSize: this.parent.splitterSettings.separatorSize,
11750
11821
  paneSettings: [
11751
11822
  {
@@ -11797,6 +11868,9 @@ var Splitter$1 = /** @__PURE__ @class */ (function () {
11797
11868
  * @private
11798
11869
  */
11799
11870
  Splitter$$1.prototype.calculateSplitterPosition = function (splitter$$1, isDynamic) {
11871
+ if (!isNullOrUndefined(this.splitterObject) && this.parent.enablePersistence) {
11872
+ return this.splitterObject.paneSettings[0].size;
11873
+ }
11800
11874
  if (splitter$$1.view === 'Grid') {
11801
11875
  return '100%';
11802
11876
  }
@@ -12495,8 +12569,8 @@ var FocusModule = /** @__PURE__ @class */ (function () {
12495
12569
  break;
12496
12570
  }
12497
12571
  case 'delete':
12498
- if (ganttObj.selectionModule && ganttObj.editModule && (!ganttObj.editModule.dialogModule.dialogObj ||
12499
- (ganttObj.editModule.dialogModule.dialogObj &&
12572
+ if (ganttObj.selectionModule && ganttObj.editModule && ganttObj.editModule.dialogModule &&
12573
+ (!ganttObj.editModule.dialogModule.dialogObj || (ganttObj.editModule.dialogModule.dialogObj &&
12500
12574
  !ganttObj.editModule.dialogModule.dialogObj.visible)) && (!ganttObj.editSettings.allowTaskbarEditing
12501
12575
  || (ganttObj.editSettings.allowTaskbarEditing && !ganttObj.editModule.taskbarEditModule.touchEdit))) {
12502
12576
  if ((ganttObj.selectionSettings.mode !== 'Cell' && ganttObj.selectionModule.selectedRowIndexes.length)
@@ -12698,6 +12772,7 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
12698
12772
  * @private
12699
12773
  */
12700
12774
  _this.isEdit = false;
12775
+ setValue('mergePersistData', _this.mergePersistGanttData, _this);
12701
12776
  return _this;
12702
12777
  }
12703
12778
  /**
@@ -12768,8 +12843,10 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
12768
12843
  this.dataOperation.getNonWorkingDayIndex();
12769
12844
  this.columnMapping = {};
12770
12845
  this.controlId = this.element.id;
12771
- this.cloneProjectStartDate = null;
12772
- this.cloneProjectEndDate = null;
12846
+ this.cloneProjectStartDate = this.enablePersistence && this.cloneProjectStartDate ?
12847
+ this.cloneProjectStartDate : null;
12848
+ this.cloneProjectEndDate = this.enablePersistence && this.cloneProjectEndDate ?
12849
+ this.cloneProjectEndDate : null;
12773
12850
  this.totalHolidayDates = this.dataOperation.getHolidayDates();
12774
12851
  this.ganttChartModule = new GanttChart(this);
12775
12852
  this.timelineModule = new Timeline(this);
@@ -13036,6 +13113,10 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
13036
13113
  this.updateRowHeightInConnectorLine(this.updatedConnectorLineCollection);
13037
13114
  this.connectorLineModule.renderConnectorLines(this.updatedConnectorLineCollection);
13038
13115
  }
13116
+ if (this.enableCriticalPath) {
13117
+ var criticalModule = this.criticalPathModule;
13118
+ this.criticalPathModule.criticalConnectorLine(criticalModule.criticalPathCollection, criticalModule.detailPredecessorCollection, true, criticalModule.predecessorCollectionTaskIds);
13119
+ }
13039
13120
  }
13040
13121
  };
13041
13122
  Gantt.prototype.keyActionHandler = function (e) {
@@ -13367,6 +13448,39 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
13367
13448
  var value = this.dateValidationModule.getWorkString(work, workUnit);
13368
13449
  return value;
13369
13450
  };
13451
+ Gantt.prototype.updateTreeColumns = function () {
13452
+ var temp;
13453
+ var field;
13454
+ var gridColumns = this.treeGrid.grid.getColumns();
13455
+ if (this.treeColumnIndex !== -1 && this.columns[this.treeColumnIndex] &&
13456
+ !isNullOrUndefined(this.columns[this.treeColumnIndex]['template'])) {
13457
+ temp = this.columns[this.treeColumnIndex]['template'];
13458
+ field = this.columns[this.treeColumnIndex]['field'];
13459
+ }
13460
+ var gridColumn;
13461
+ for (var i = 0; i < gridColumns.length; i++) {
13462
+ gridColumn = {};
13463
+ for (var j = 0; j < this.columns.length; j++) {
13464
+ if (this.columns[j]['field'] == gridColumns[i].field) {
13465
+ for (var _i = 0, _a = Object.keys(this.columns[j]); _i < _a.length; _i++) {
13466
+ var prop = _a[_i];
13467
+ if (!isUndefined(this.columns[j][prop])) {
13468
+ gridColumn[prop] = gridColumns[i][prop];
13469
+ }
13470
+ gridColumn.visible = gridColumns[i].visible;
13471
+ gridColumn.width = gridColumns[i].width;
13472
+ }
13473
+ this.columns[j] = (gridColumn);
13474
+ if (this.columns[j]['type'] !== 'checkbox' && (!isNullOrUndefined(temp) && temp !== '')) {
13475
+ this.columns[j]['template'] = temp;
13476
+ }
13477
+ }
13478
+ }
13479
+ }
13480
+ if (this.columns.length > 0) {
13481
+ this.treeGrid.setProperties({ columns: this.columns }, true);
13482
+ }
13483
+ };
13370
13484
  /**
13371
13485
  *
13372
13486
  * @param {object} args .
@@ -13387,6 +13501,9 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
13387
13501
  this.splitterElement.style.height = '100%';
13388
13502
  }
13389
13503
  if (this.isLoad) {
13504
+ if (this.enablePersistence) {
13505
+ this.updateTreeColumns();
13506
+ }
13390
13507
  this.updateCurrentViewData();
13391
13508
  if (!this.enableVirtualization) {
13392
13509
  this.updateContentHeight();
@@ -13416,7 +13533,14 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
13416
13533
  else {
13417
13534
  this.getCurrentRecords(args);
13418
13535
  }
13536
+ if (this.enableCriticalPath && this.criticalPathModule) {
13537
+ this.criticalPathModule.showCriticalPath(this.enableCriticalPath);
13538
+ }
13419
13539
  this.notify('recordsUpdated', {});
13540
+ if (this.enableCriticalPath && this.criticalPathModule) {
13541
+ var criticalModule = this.criticalPathModule;
13542
+ this.criticalPathModule.criticalConnectorLine(criticalModule.criticalPathCollection, criticalModule.detailPredecessorCollection, true, criticalModule.predecessorCollectionTaskIds);
13543
+ }
13420
13544
  this.initialChartRowElements = this.ganttChartModule.getChartRows();
13421
13545
  this.isLoad = false;
13422
13546
  this.trigger('dataBound', args);
@@ -13505,6 +13629,7 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
13505
13629
  }
13506
13630
  break;
13507
13631
  case 'timezone':
13632
+ case 'enableCriticalPath':
13508
13633
  this.dataOperation.checkDataBinding(true);
13509
13634
  break;
13510
13635
  case 'filterSettings':
@@ -13672,15 +13797,42 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
13672
13797
  }
13673
13798
  };
13674
13799
  /**
13675
- * Get the properties to be maintained in the persisted state.
13800
+ * Returns the properties to be maintained in persisted state.
13676
13801
  *
13677
13802
  * @returns {string} .
13678
13803
  * @private
13679
13804
  */
13680
13805
  Gantt.prototype.getPersistData = function () {
13681
- var keyEntity = ['allowSelection'];
13806
+ var keyEntity = ['sortSettings',
13807
+ 'filterSettings', 'columns', 'searchSettings', 'selectedRowIndex', 'treeColumnIndex', 'currentZoomingLevel', 'cloneProjectStartDate', 'cloneProjectEndDate'];
13808
+ var ignoreOnPersist = {
13809
+ filterSettings: ['type', 'mode', 'showFilterBarStatus', 'immediateModeDelay', 'ignoreAccent', 'hierarchyMode'],
13810
+ searchSettings: ['fields', 'operator', 'ignoreCase'],
13811
+ sortSettings: [], columns: [], selectedRowIndex: []
13812
+ };
13813
+ var ignoreOnColumn = ['filter', 'edit', 'filterBarTemplate', 'headerTemplate', 'template',
13814
+ 'commandTemplate', 'commands', 'dataSource'];
13815
+ for (var i = 0; i < keyEntity.length; i++) {
13816
+ var currentObject = this[keyEntity[i]];
13817
+ for (var k = 0, val = ignoreOnPersist[keyEntity[i]]; (!isNullOrUndefined(val) && k < val.length); k++) {
13818
+ var objVal = val[k];
13819
+ delete currentObject[objVal];
13820
+ }
13821
+ }
13822
+ this.ignoreInArrays(ignoreOnColumn, this.columns);
13682
13823
  return this.addOnPersist(keyEntity);
13683
13824
  };
13825
+ Gantt.prototype.ignoreInArrays = function (ignoreOnColumn, columns) {
13826
+ for (var i = 0; i < columns.length; i++) {
13827
+ this.ignoreInColumn(ignoreOnColumn, columns[i]);
13828
+ }
13829
+ };
13830
+ Gantt.prototype.ignoreInColumn = function (ignoreOnColumn, column) {
13831
+ for (var i = 0; i < ignoreOnColumn.length; i++) {
13832
+ delete column[ignoreOnColumn[i]];
13833
+ column.filter = {};
13834
+ }
13835
+ };
13684
13836
  /**
13685
13837
  * @returns {void} .
13686
13838
  * @private
@@ -13763,6 +13915,12 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
13763
13915
  args: [this]
13764
13916
  });
13765
13917
  }
13918
+ if (this.enableCriticalPath) {
13919
+ modules.push({
13920
+ member: 'criticalPath',
13921
+ args: [this]
13922
+ });
13923
+ }
13766
13924
  if (this.allowResizing) {
13767
13925
  modules.push({
13768
13926
  member: 'resize',
@@ -13840,6 +13998,17 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
13840
13998
  this.sortModule.sortColumn(columnName, direction, isMultiSort);
13841
13999
  }
13842
14000
  };
14001
+ Gantt.prototype.mergePersistGanttData = function () {
14002
+ if (!this.treeGrid) {
14003
+ this.treeGrid = new TreeGrid();
14004
+ }
14005
+ var persist1 = 'mergePersistGridData';
14006
+ this.treeGrid.grid[persist1].apply(this);
14007
+ };
14008
+ Gantt.prototype.mergeColumns = function (storedColumn, columns) {
14009
+ var persist2 = 'mergeColumns';
14010
+ this.treeGrid.grid[persist2].apply(this, [storedColumn, columns]);
14011
+ };
13843
14012
  /**
13844
14013
  * Clears all the sorted columns of the Gantt.
13845
14014
  *
@@ -13917,7 +14086,7 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
13917
14086
  */
13918
14087
  Gantt.prototype.updateGridLineContainerHeight = function () {
13919
14088
  if (this.chartVerticalLineContainer) {
13920
- this.chartVerticalLineContainer.style.height = formatUnit(this.contentHeight);
14089
+ this.chartVerticalLineContainer.style.height = formatUnit(this.getContentHeight());
13921
14090
  }
13922
14091
  };
13923
14092
  /**
@@ -14021,6 +14190,7 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
14021
14190
  progress: 'Progress',
14022
14191
  dependency: 'Dependency',
14023
14192
  notes: 'Notes',
14193
+ criticalPath: 'Critical Path',
14024
14194
  baselineStartDate: 'Baseline Start Date',
14025
14195
  baselineEndDate: 'Baseline End Date',
14026
14196
  taskMode: 'Task Mode',
@@ -14718,6 +14888,34 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
14718
14888
  this.editModule.outdent();
14719
14889
  }
14720
14890
  };
14891
+ /**
14892
+ * To render the critical path tasks in Gantt.
14893
+ *
14894
+ * @returns {void} .
14895
+ * @param {boolean} isCritical- whether to render critical path or not .
14896
+ * @public
14897
+ */
14898
+ Gantt.prototype.showCriticalPath = function (isCritical) {
14899
+ if (this.criticalPathModule) {
14900
+ this.criticalPathModule.showCriticalPath(isCritical);
14901
+ var criticalModule = this.criticalPathModule;
14902
+ this.criticalPathModule.criticalConnectorLine(criticalModule.criticalPathCollection, criticalModule.detailPredecessorCollection, true, criticalModule.predecessorCollectionTaskIds);
14903
+ }
14904
+ };
14905
+ /**
14906
+ * To get all the critical tasks in Gantt.
14907
+ *
14908
+ * @returns {IGanttData[]} .
14909
+ * @public
14910
+ */
14911
+ Gantt.prototype.getCriticalTasks = function () {
14912
+ if (!isNullOrUndefined(this.criticalPathModule) && this.enableCriticalPath) {
14913
+ return this.criticalPathModule.getCriticalTasks();
14914
+ }
14915
+ else {
14916
+ return null;
14917
+ }
14918
+ };
14721
14919
  /**
14722
14920
  * To perform Zoom in action on Gantt timeline.
14723
14921
  *
@@ -15529,6 +15727,9 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
15529
15727
  __decorate([
15530
15728
  Property(false)
15531
15729
  ], Gantt.prototype, "enableContextMenu", void 0);
15730
+ __decorate([
15731
+ Property(false)
15732
+ ], Gantt.prototype, "enableCriticalPath", void 0);
15532
15733
  __decorate([
15533
15734
  Property()
15534
15735
  ], Gantt.prototype, "contextMenuItems", void 0);
@@ -15829,7 +16030,7 @@ var CellEdit = /** @__PURE__ @class */ (function () {
15829
16030
  return;
15830
16031
  }
15831
16032
  if (data.hasChildRecords && ((field === taskSettings.endDate && ((!isNullOrUndefined(data['isManual']) &&
15832
- data['isManual'] == false) || this.parent.taskMode == 'Auto')) || field === taskSettings.duration
16033
+ data['isManual'] === false) || this.parent.taskMode === 'Auto')) || field === taskSettings.duration
15833
16034
  || field === taskSettings.dependency || field === taskSettings.progress
15834
16035
  || field === taskSettings.work || field === 'taskType')) {
15835
16036
  args.cancel = true;
@@ -16018,7 +16219,7 @@ var CellEdit = /** @__PURE__ @class */ (function () {
16018
16219
  var ganttProb = args.data.ganttProperties;
16019
16220
  var currentValue = args.data[this.parent.taskFields.startDate];
16020
16221
  currentValue = currentValue ? new Date(currentValue.getTime()) : null;
16021
- currentValue = this.parent.dateValidationModule.checkStartDate(currentValue);
16222
+ currentValue = this.parent.dateValidationModule.checkStartDate(currentValue, ganttData.ganttProperties, ganttData.ganttProperties.isMilestone);
16022
16223
  if (isNullOrUndefined(currentValue)) {
16023
16224
  if (!ganttData.hasChildRecords) {
16024
16225
  this.parent.setRecordValue('startDate', null, ganttProb, true);
@@ -16143,7 +16344,9 @@ var CellEdit = /** @__PURE__ @class */ (function () {
16143
16344
  var currentDuration = ganttProb.duration;
16144
16345
  if (isNullOrUndefined(currentDuration)) {
16145
16346
  this.parent.setRecordValue('isMilestone', false, ganttProb, true);
16146
- this.parent.setRecordValue('endDate', null, ganttProb, true);
16347
+ if (args.data[this.parent.taskFields.duration] != null) {
16348
+ this.parent.setRecordValue('endDate', null, ganttProb, true);
16349
+ }
16147
16350
  }
16148
16351
  else {
16149
16352
  if (isNullOrUndefined(startDate) && !isNullOrUndefined(endDate)) {
@@ -16896,9 +17099,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
16896
17099
  addClass([element], [activeParentTask]);
16897
17100
  }
16898
17101
  }
16899
- if (isShowProgressResizer) {
16900
- addClass(this.parent.ganttChartModule.scrollElement.querySelectorAll('.' + connectorLineContainer), [connectorLineZIndex]);
16901
- }
17102
+ addClass(this.parent.ganttChartModule.scrollElement.querySelectorAll('.' + connectorLineContainer), [connectorLineZIndex]);
16902
17103
  if (!isNullOrUndefined(this.parent.taskFields.dependency)
16903
17104
  && (element.querySelector('.' + connectorPointLeft)
16904
17105
  || element.parentElement.querySelector('.' + connectorPointLeft))
@@ -17162,7 +17363,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
17162
17363
  this.timerCount = this.parent.ganttChartModule.scrollObject.previousScroll.left;
17163
17364
  this.startScrollTimer('left');
17164
17365
  }
17165
- else if (isConnectorLineEdit && ((mouseY + 20) >
17366
+ else if (isConnectorLineEdit && ((mouseY + 80) >
17166
17367
  containerPosition.top + this.parent.ganttChartModule.chartBodyContainer.offsetHeight)) {
17167
17368
  this.timerCount = this.parent.ganttChartModule.scrollObject.previousScroll.top;
17168
17369
  this.startScrollTimer('bottom');
@@ -18040,6 +18241,10 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
18040
18241
  else {
18041
18242
  this.parent.isOnEdit = false;
18042
18243
  this.cancelTaskbarEditActionInMouseLeave();
18244
+ if (this.parent.enableCriticalPath && this.parent.criticalPathModule) {
18245
+ var criticalModule = this.parent.criticalPathModule;
18246
+ criticalModule.criticalConnectorLine(criticalModule.criticalPathCollection, criticalModule.detailPredecessorCollection, true, criticalModule.predecessorCollectionTaskIds);
18247
+ }
18043
18248
  }
18044
18249
  }
18045
18250
  if (this.parent.viewType === 'ResourceView' && this.parent.enableMultiTaskbar && !isNullOrUndefined(this.taskBarEditElement)) {
@@ -19353,7 +19558,7 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
19353
19558
  }
19354
19559
  else if (isScheduledTask(ganttProp) || !isNullOrUndefined(ganttProp.startDate)) {
19355
19560
  if (ganttData.ganttProperties.isMilestone && ganttData.ganttProperties.duration !== 0) {
19356
- this.parent.dateValidationModule.calculateStartDate(ganttData);
19561
+ this.parent.dateValidationModule.checkStartDate(ganttProp.startDate);
19357
19562
  }
19358
19563
  this.parent.dateValidationModule.calculateEndDate(ganttData);
19359
19564
  }
@@ -20717,9 +20922,16 @@ var ConnectorLineEdit = /** @__PURE__ @class */ (function () {
20717
20922
  ConnectorLineEdit.prototype.addHighlight = function (element) {
20718
20923
  this.connectorLineElement = element;
20719
20924
  addClass([element], [connectorLineHoverZIndex]);
20720
- addClass(element.querySelectorAll('.' + connectorLine), [connectorLineHover]);
20721
- addClass(element.querySelectorAll('.' + connectorLineRightArrow), [connectorLineRightArrowHover]);
20722
- addClass(element.querySelectorAll('.' + connectorLineLeftArrow), [connectorLineLeftArrowHover]);
20925
+ if (element.querySelectorAll('.' + connectorLine)[0].classList.contains('e-criticalconnector-line')) {
20926
+ addClass(element.querySelectorAll('.' + connectorLine), [criticalConnectorLineHover]);
20927
+ addClass(element.querySelectorAll('.' + connectorLineRightArrow), [criticalConnectorLineRightArrowHover]);
20928
+ addClass(element.querySelectorAll('.' + connectorLineLeftArrow), [criticalConnectorLineLeftArrowHover]);
20929
+ }
20930
+ else {
20931
+ addClass(element.querySelectorAll('.' + connectorLine), [connectorLineHover]);
20932
+ addClass(element.querySelectorAll('.' + connectorLineRightArrow), [connectorLineRightArrowHover]);
20933
+ addClass(element.querySelectorAll('.' + connectorLineLeftArrow), [connectorLineLeftArrowHover]);
20934
+ }
20723
20935
  };
20724
20936
  /**
20725
20937
  * To remove connector line highlight class.
@@ -20730,9 +20942,16 @@ var ConnectorLineEdit = /** @__PURE__ @class */ (function () {
20730
20942
  ConnectorLineEdit.prototype.removeHighlight = function () {
20731
20943
  if (!isNullOrUndefined(this.connectorLineElement)) {
20732
20944
  removeClass([this.connectorLineElement], [connectorLineHoverZIndex]);
20733
- removeClass(this.connectorLineElement.querySelectorAll('.' + connectorLine), [connectorLineHover]);
20734
- removeClass(this.connectorLineElement.querySelectorAll('.' + connectorLineRightArrow), [connectorLineRightArrowHover]);
20735
- removeClass(this.connectorLineElement.querySelectorAll('.' + connectorLineLeftArrow), [connectorLineLeftArrowHover]);
20945
+ if (this.connectorLineElement.querySelectorAll('.' + connectorLine)[0].classList.contains(criticalConnectorLineHover)) {
20946
+ removeClass(this.connectorLineElement.querySelectorAll('.' + connectorLine), [criticalConnectorLineHover]);
20947
+ removeClass(this.connectorLineElement.querySelectorAll('.' + connectorLineRightArrow), [criticalConnectorLineRightArrowHover]);
20948
+ removeClass(this.connectorLineElement.querySelectorAll('.' + connectorLineLeftArrow), [criticalConnectorLineLeftArrowHover]);
20949
+ }
20950
+ else {
20951
+ removeClass(this.connectorLineElement.querySelectorAll('.' + connectorLine), [connectorLineHover]);
20952
+ removeClass(this.connectorLineElement.querySelectorAll('.' + connectorLineRightArrow), [connectorLineRightArrowHover]);
20953
+ removeClass(this.connectorLineElement.querySelectorAll('.' + connectorLineLeftArrow), [connectorLineLeftArrowHover]);
20954
+ }
20736
20955
  this.connectorLineElement = null;
20737
20956
  }
20738
20957
  };
@@ -21940,6 +22159,9 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
21940
22159
  }
21941
22160
  if ((key === tasks.baselineStartDate || key === tasks.baselineEndDate) &&
21942
22161
  (ganttData.ganttProperties.baselineStartDate && ganttData.ganttProperties.baselineEndDate)) {
22162
+ ganttObj.setRecordValue('baselineStartDate', ganttObj.dataOperation.checkBaselineStartDate(ganttData.ganttProperties.baselineStartDate), ganttData.ganttProperties, true);
22163
+ ganttObj.dataOperation.setTime(this.parent.defaultEndTime, ganttData.ganttProperties.baselineEndDate);
22164
+ ganttObj.setRecordValue('baselineEndDate', ganttObj.dataOperation.checkBaselineEndDate(ganttData.ganttProperties.baselineEndDate), ganttData.ganttProperties, true);
21943
22165
  ganttObj.setRecordValue('baselineLeft', ganttObj.dataOperation.calculateBaselineLeft(ganttData.ganttProperties), ganttData.ganttProperties, true);
21944
22166
  ganttObj.setRecordValue('baselineWidth', ganttObj.dataOperation.calculateBaselineWidth(ganttData.ganttProperties), ganttData.ganttProperties, true);
21945
22167
  }
@@ -22702,6 +22924,11 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
22702
22924
  eventArgs.taskBarEditAction = args.taskBarEditAction;
22703
22925
  }
22704
22926
  this.endEditAction(args);
22927
+ if (this.parent.enableCriticalPath) {
22928
+ var criticalModule = this.parent.criticalPathModule;
22929
+ criticalModule.showCriticalPath(true);
22930
+ criticalModule.criticalConnectorLine(criticalModule.criticalPathCollection, criticalModule.detailPredecessorCollection, true, criticalModule.predecessorCollectionTaskIds);
22931
+ }
22705
22932
  this.parent.trigger('actionComplete', eventArgs);
22706
22933
  }
22707
22934
  else {
@@ -23036,6 +23263,8 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23036
23263
  }
23037
23264
  else {
23038
23265
  this.deleteSelectedItems();
23266
+ var focusingElement = this.parent.element.querySelector('.e-treegrid');
23267
+ focusingElement.focus();
23039
23268
  }
23040
23269
  }
23041
23270
  };
@@ -23906,7 +24135,17 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23906
24135
  this.refreshRecordInImmutableMode();
23907
24136
  }
23908
24137
  };
23909
- Edit$$1.prototype.refreshRecordInImmutableMode = function () {
24138
+ Edit$$1.prototype.refreshRecordInImmutableMode = function (data, dragged) {
24139
+ if (!dragged && !isNullOrUndefined(data)) {
24140
+ for (var i = data[0].index + 1; i < this.parent.currentViewData.length; i++) {
24141
+ if (data[0].level < this.parent.currentViewData[i].level) {
24142
+ this.parent.modifiedRecords.push(this.parent.currentViewData[i]);
24143
+ }
24144
+ else {
24145
+ break;
24146
+ }
24147
+ }
24148
+ }
23910
24149
  var _loop_1 = function (i) {
23911
24150
  var originalData = this_1.parent.modifiedRecords[i];
23912
24151
  var treeIndex = this_1.parent.allowRowDragAndDrop ? 1 : 0;
@@ -24073,7 +24312,13 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24073
24312
  var insertCrud = data_2.insert(updatedData_2[addedRecords], null, query_2);
24074
24313
  insertCrud.then(function (e) {
24075
24314
  var changedRecords = 'changedRecords';
24076
- var addedRecords = e[0];
24315
+ var addedRecords;
24316
+ if (!isNullOrUndefined(e[0])) {
24317
+ addedRecords = e[0];
24318
+ }
24319
+ else {
24320
+ addedRecords = updatedData_2['addedRecords'][0];
24321
+ }
24077
24322
  /* tslint:disable-next-line */
24078
24323
  var updateCrud = data_2.update(_this.parent.taskFields.id, updatedData_2[changedRecords], null, query_2);
24079
24324
  updateCrud.then(function () {
@@ -24620,7 +24865,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24620
24865
  this.parent.treeGrid.parentData = [];
24621
24866
  this.parent.treeGrid.refresh();
24622
24867
  if (this.parent.enableImmutableMode) {
24623
- this.refreshRecordInImmutableMode();
24868
+ this.refreshRecordInImmutableMode(args.data, isDrag);
24624
24869
  }
24625
24870
  if (isDrag) {
24626
24871
  args.requestType = 'rowDropped';
@@ -25240,7 +25485,7 @@ var Filter$1 = /** @__PURE__ @class */ (function () {
25240
25485
  var ganttElement = closest(element, '#' + this.parent.element.id)
25241
25486
  || element.querySelector('#' + this.parent.element.id);
25242
25487
  if ((!(this.filterMenuElement.contains(element)) && !isNullOrUndefined(ganttElement)) || (!(this.filterMenuElement.contains(element)) && (isNullOrUndefined(datePickerElement))
25243
- && (isNullOrUndefined(dateTimePickerElement)) && ((element.nodeName === 'DIV') || (element.nodeName === 'HTML')))) {
25488
+ && (isNullOrUndefined(dateTimePickerElement)) && ((element.nodeName === 'DIV') || (element.nodeName === 'HTML') || (element.nodeName === 'SPAN') || (element.nodeName === 'BUTTON')))) {
25244
25489
  remove(this.filterMenuElement);
25245
25490
  this.parent.treeGrid.grid.notify('filter-menu-close', { isOpen: false });
25246
25491
  this.filterMenuElement = null;
@@ -25893,6 +26138,9 @@ var Selection$1 = /** @__PURE__ @class */ (function () {
25893
26138
  this.popUpClickHandler(e);
25894
26139
  if (this.parent.selectionSettings.mode !== 'Cell' && isSelected) {
25895
26140
  if (closest(e.target, 'tr.e-chart-row')) {
26141
+ if (this.parent.enableVirtualization) {
26142
+ this.parent.treeGrid.grid.selectionModule.isInteracted = true;
26143
+ }
25896
26144
  this.highlightSelectedRows(e, true);
25897
26145
  }
25898
26146
  else {
@@ -25952,7 +26200,7 @@ var Toolbar$3 = /** @__PURE__ @class */ (function () {
25952
26200
  this.predefinedItems = {};
25953
26201
  this.items = ['Add', 'Edit', 'Update', 'Delete', 'Cancel', 'ExpandAll', 'CollapseAll', 'Search',
25954
26202
  'PrevTimeSpan', 'NextTimeSpan', 'ZoomIn', 'ZoomOut', 'ZoomToFit', 'ExcelExport',
25955
- 'CsvExport', 'PdfExport', 'Indent', 'Outdent'];
26203
+ 'CsvExport', 'PdfExport', 'Indent', 'Outdent', 'CriticalPath'];
25956
26204
  this.parent = parent;
25957
26205
  this.id = this.parent.element.id;
25958
26206
  this.parent.on('ui-toolbarupdate', this.propertyChanged, this);
@@ -25976,11 +26224,19 @@ var Toolbar$3 = /** @__PURE__ @class */ (function () {
25976
26224
  }
25977
26225
  var preItems = ['Add', 'Edit', 'Update', 'Delete', 'Cancel', 'ExpandAll', 'CollapseAll',
25978
26226
  'PrevTimeSpan', 'NextTimeSpan', 'ZoomIn', 'ZoomOut', 'ZoomToFit', 'ExcelExport', 'CsvExport',
25979
- 'PdfExport', 'Indent', 'Outdent'];
26227
+ 'PdfExport', 'Indent', 'Outdent', 'CriticalPath'];
25980
26228
  for (var _i = 0, preItems_1 = preItems; _i < preItems_1.length; _i++) {
25981
26229
  var item = preItems_1[_i];
25982
- var itemStr = item.toLowerCase();
25983
- var localeName = item[0].toLowerCase() + item.slice(1);
26230
+ var itemStr = void 0;
26231
+ var localeName = void 0;
26232
+ if (item === 'CriticalPath') {
26233
+ itemStr = "critical-path";
26234
+ localeName = "criticalPath";
26235
+ }
26236
+ else {
26237
+ itemStr = item.toLowerCase();
26238
+ localeName = item[0].toLowerCase() + item.slice(1);
26239
+ }
25984
26240
  this.predefinedItems[item] = {
25985
26241
  id: this.parent.element.id + '_' + itemStr, prefixIcon: 'e-' + itemStr,
25986
26242
  text: this.parent.isAdaptive ? '' : this.parent.localeObj.getConstant(localeName),
@@ -26184,6 +26440,14 @@ var Toolbar$3 = /** @__PURE__ @class */ (function () {
26184
26440
  gObj.indent();
26185
26441
  }
26186
26442
  break;
26443
+ case gID + '_critical-path':
26444
+ if (gObj.enableCriticalPath) {
26445
+ gObj.enableCriticalPath = false;
26446
+ }
26447
+ else {
26448
+ gObj.enableCriticalPath = true;
26449
+ }
26450
+ break;
26187
26451
  case gID + '_outdent':
26188
26452
  if (gObj.editModule && gObj.selectionModule.getSelectedRecords().length) {
26189
26453
  gObj.outdent();
@@ -26363,6 +26627,8 @@ var Toolbar$3 = /** @__PURE__ @class */ (function () {
26363
26627
  disableItems.push(gID + '_edit');
26364
26628
  disableItems.push(gID + '_update');
26365
26629
  disableItems.push(gID + '_cancel');
26630
+ disableItems.push(gID + '_indent');
26631
+ disableItems.push(gID + '_outdent');
26366
26632
  }
26367
26633
  for (var e = 0; e < enableItems.length; e++) {
26368
26634
  var index = void 0;
@@ -26482,8 +26748,9 @@ var NonWorkingDay = /** @__PURE__ @class */ (function () {
26482
26748
  var toDate;
26483
26749
  var container = createElement('div');
26484
26750
  var height = this.parent.contentHeight;
26751
+ // eslint-disable-next-line
26485
26752
  var toolbarHeight = 0;
26486
- if (!isNullOrUndefined(this.parent.toolbarModule)) {
26753
+ if (!isNullOrUndefined(this.parent.toolbarModule) && !isNullOrUndefined(this.parent.toolbarModule.element)) {
26487
26754
  toolbarHeight = this.parent.toolbarModule.element.offsetHeight;
26488
26755
  }
26489
26756
  var viewportHeight = this.parent.ganttHeight - toolbarHeight - this.parent.ganttChartModule.chartTimelineContainer.offsetHeight;
@@ -26588,6 +26855,7 @@ var NonWorkingDay = /** @__PURE__ @class */ (function () {
26588
26855
  };
26589
26856
  NonWorkingDay.prototype.updateHolidayLabelHeight = function () {
26590
26857
  var height = this.parent.getContentHeight();
26858
+ // eslint-disable-next-line
26591
26859
  var toolbarHeight = 0;
26592
26860
  if (!isNullOrUndefined(this.parent.toolbarModule) && !isNullOrUndefined(this.parent.toolbarModule.element)) {
26593
26861
  toolbarHeight = this.parent.toolbarModule.element.offsetHeight;
@@ -26792,6 +27060,738 @@ var DayMarkers = /** @__PURE__ @class */ (function () {
26792
27060
  return DayMarkers;
26793
27061
  }());
26794
27062
 
27063
+ var CriticalPath = /** @__PURE__ @class */ (function () {
27064
+ function CriticalPath(parent) {
27065
+ this.resourceCollectionIds = [];
27066
+ this.criticalTasks = [];
27067
+ this.parent = parent;
27068
+ }
27069
+ CriticalPath.prototype.getCriticalTasks = function () {
27070
+ return this.criticalTasks;
27071
+ };
27072
+ CriticalPath.prototype.showCriticalPath = function (isCritical) {
27073
+ var modelIds = this.parent.ids;
27074
+ var totalRecords = this.parent.flatData;
27075
+ if (isCritical && this.parent.flatData.length > 0 && !this.parent.enableMultiTaskbar) {
27076
+ this.parent.enableCriticalPath = true;
27077
+ var parentRecords = this.parent.treeGrid.parentData;
27078
+ var checkEndDateTaskid = void 0;
27079
+ var checkEndDate = parentRecords[0].ganttProperties.endDate;
27080
+ var dateDifference = 0;
27081
+ var checkBeyondEnddate = [];
27082
+ var totalPredecessorsCollection = [];
27083
+ var totalPredecessorsCollectionId = [];
27084
+ var predecessorIndex = 0;
27085
+ var taskBeyondEnddate = [];
27086
+ var predecessorTaskBeyondEnddate = [];
27087
+ var collection = [];
27088
+ var collectionTaskId = [];
27089
+ var fromDataObject = [];
27090
+ var criticalPathIds = [];
27091
+ /* eslint-disable-next-line */
27092
+ if (parentRecords[0].ganttProperties.autoEndDate > parentRecords[0].ganttProperties.endDate && !parentRecords[0].ganttProperties.isAutoSchedule) {
27093
+ checkEndDate = parentRecords[0].ganttProperties.autoEndDate;
27094
+ }
27095
+ checkEndDateTaskid = parentRecords[0].ganttProperties.taskId;
27096
+ // Find the total project endDate
27097
+ for (var i = 1; i < parentRecords.length; i++) {
27098
+ if (parentRecords[i].ganttProperties.endDate >= checkEndDate) {
27099
+ checkEndDate = parentRecords[i].ganttProperties.endDate;
27100
+ checkEndDateTaskid = parentRecords[i].ganttProperties.taskId;
27101
+ }
27102
+ if (!parentRecords[i].ganttProperties.isAutoSchedule) {
27103
+ if (parentRecords[i].ganttProperties.autoEndDate >= checkEndDate) {
27104
+ checkEndDate = parentRecords[i].ganttProperties.autoEndDate;
27105
+ checkEndDateTaskid = parentRecords[i].ganttProperties.taskId;
27106
+ }
27107
+ }
27108
+ }
27109
+ this.maxEndDate = checkEndDate;
27110
+ // find the tasks that ends on total project end date that stored in checkBeyondEnddate
27111
+ // find the tasks with predecessor that stored in totalPredecessorsCollectionId.
27112
+ for (var j = 0; j < totalRecords.length; j++) {
27113
+ totalRecords[j].isCritical = false;
27114
+ totalRecords[j].ganttProperties.isCritical = false;
27115
+ /* eslint-disable-next-line */
27116
+ dateDifference = this.parent.dataOperation.getDuration(totalRecords[j].ganttProperties.endDate, checkEndDate, totalRecords[j].ganttProperties.durationUnit, totalRecords[j].ganttProperties.isAutoSchedule, totalRecords[j].ganttProperties.isMilestone);
27117
+ totalRecords[j].slack = dateDifference + ' ' + totalRecords[j].ganttProperties.durationUnit;
27118
+ totalRecords[j].ganttProperties.slack = dateDifference + ' ' + totalRecords[j].ganttProperties.durationUnit;
27119
+ if (totalRecords[j].ganttProperties.endDate >= checkEndDate) {
27120
+ checkBeyondEnddate.push(parseInt(totalRecords[j].ganttProperties.taskId, 10));
27121
+ }
27122
+ if (totalRecords[j].ganttProperties.predecessor) {
27123
+ if (totalRecords[j].ganttProperties.predecessor.length !== 0) {
27124
+ totalPredecessorsCollection.push(totalRecords[j]);
27125
+ totalPredecessorsCollectionId.push(parseInt(totalRecords[j].ganttProperties.taskId, 10));
27126
+ }
27127
+ }
27128
+ }
27129
+ if (this.parent.viewType === 'ResourceView') {
27130
+ for (var i = 0; i < this.parent.taskIds.length; i++) {
27131
+ this.resourceCollectionIds[i] = this.parent.taskIds[i].slice(1);
27132
+ }
27133
+ }
27134
+ // seperate the predecessor connected taskes from the individual taskes that ends on total project end date
27135
+ for (var k = 0; k < checkBeyondEnddate.length; k++) {
27136
+ if (totalPredecessorsCollectionId.indexOf(checkBeyondEnddate[k]) === -1) {
27137
+ if (this.parent.viewType === 'ProjectView') {
27138
+ predecessorIndex = modelIds.indexOf(checkBeyondEnddate[k].toString());
27139
+ }
27140
+ else {
27141
+ predecessorIndex = this.resourceCollectionIds.indexOf(checkBeyondEnddate[k].toString());
27142
+ }
27143
+ if (totalRecords[predecessorIndex].ganttProperties.progress < 100) {
27144
+ totalRecords[predecessorIndex].isCritical = true;
27145
+ totalRecords[predecessorIndex].ganttProperties.isCritical = true;
27146
+ }
27147
+ totalRecords[predecessorIndex]['slack'] = 0 + ' ' + totalRecords[predecessorIndex].ganttProperties.durationUnit;
27148
+ taskBeyondEnddate.push(checkBeyondEnddate[k]);
27149
+ }
27150
+ else {
27151
+ predecessorTaskBeyondEnddate.push(checkBeyondEnddate[k]);
27152
+ }
27153
+ }
27154
+ var predecessorLength = totalPredecessorsCollection.length;
27155
+ var endTask = [];
27156
+ // find the detail collection of predecessor for each taskes that stored in collection.
27157
+ for (var x = 0; x < predecessorLength; x++) {
27158
+ var to = -1;
27159
+ var from = -1;
27160
+ var toPredecessor = -1;
27161
+ var fromPredecessor = -1;
27162
+ var currentIndex = x;
27163
+ var predecessor = totalPredecessorsCollection[x].ganttProperties.predecessor;
27164
+ var individualPredecessorLength = totalPredecessorsCollection[x].ganttProperties.predecessor.length;
27165
+ var taskid = (parseInt(totalPredecessorsCollection[x].ganttProperties.taskId, 10));
27166
+ for (var y = 0; y < individualPredecessorLength; y++) {
27167
+ if (parseInt(predecessor[y].from, 10) === taskid) {
27168
+ if (to === -1) {
27169
+ if (!predecessor[y].offset) {
27170
+ to = predecessor[y].to;
27171
+ toPredecessor = predecessor[y].type;
27172
+ }
27173
+ else {
27174
+ to = predecessor[y].to + ':' + predecessor[y].offset + predecessor[y].offsetUnit;
27175
+ toPredecessor = predecessor[y].type;
27176
+ }
27177
+ }
27178
+ else {
27179
+ if (!predecessor[y].offset) {
27180
+ to = to + ',' + predecessor[y].to;
27181
+ toPredecessor = toPredecessor + ',' + predecessor[y].type;
27182
+ }
27183
+ else {
27184
+ to = to + ',' + predecessor[y].to + ':' + predecessor[y].offset + predecessor[y].offsetUnit;
27185
+ toPredecessor = toPredecessor + ',' + predecessor[y].type;
27186
+ }
27187
+ }
27188
+ }
27189
+ if (parseInt(predecessor[y].to, 10) === taskid) {
27190
+ if (from === -1) {
27191
+ if (!predecessor[y].offset) {
27192
+ from = predecessor[y].from;
27193
+ fromPredecessor = predecessor[y].type;
27194
+ }
27195
+ else {
27196
+ from = predecessor[y].from + ':' + predecessor[y].offset + predecessor[y].offsetUnit;
27197
+ fromPredecessor = predecessor[y].type;
27198
+ }
27199
+ }
27200
+ else {
27201
+ if (!predecessor[y].offset) {
27202
+ from = from + ',' + predecessor[y].from;
27203
+ fromPredecessor = fromPredecessor + ',' + predecessor[y].type;
27204
+ }
27205
+ else {
27206
+ from = from + ',' + predecessor[y].from + ':' + predecessor[y].offset + predecessor[y].offsetUnit;
27207
+ fromPredecessor = fromPredecessor + ',' + predecessor[y].type;
27208
+ }
27209
+ }
27210
+ }
27211
+ }
27212
+ if (from === -1) {
27213
+ from = null;
27214
+ fromPredecessor = null;
27215
+ }
27216
+ if (to === -1) {
27217
+ to = null;
27218
+ toPredecessor = null;
27219
+ }
27220
+ /* eslint-disable-next-line */
27221
+ collection.push({ from: from, fromPredecessor: fromPredecessor, taskid: taskid, to: to, toPredecessor: toPredecessor, currentIndex: currentIndex, slack: null, enddate: null });
27222
+ collectionTaskId.push(taskid);
27223
+ }
27224
+ var collectionLength = collection.length;
27225
+ var indexEnddate = 0;
27226
+ var num = void 0;
27227
+ // find the predecessors connected taskes that does not contains any successor.
27228
+ for (var z = 0; z < collectionLength; z++) {
27229
+ if (!collection[z]['to']) {
27230
+ num = collection[z]['taskid'];
27231
+ if (this.parent.viewType === 'ProjectView') {
27232
+ indexEnddate = modelIds.indexOf(num.toString());
27233
+ }
27234
+ else {
27235
+ indexEnddate = this.resourceCollectionIds.indexOf(num.toString());
27236
+ }
27237
+ var flatData = totalRecords[indexEnddate].ganttProperties;
27238
+ /* eslint-disable-next-line */
27239
+ dateDifference = this.parent.dataOperation.getDuration(flatData.endDate, checkEndDate, 'minute', flatData.isAutoSchedule, flatData.isMilestone);
27240
+ collection[z]['slack'] = dateDifference;
27241
+ collection[z]['fs'] = -1;
27242
+ collection[z]['enddate'] = flatData.endDate;
27243
+ endTask.push({
27244
+ fromdata: collection[z]['from'], todateID: collection[z]['taskid'],
27245
+ fromDataPredecessor: collection[z]['fromPredecessor']
27246
+ });
27247
+ }
27248
+ }
27249
+ for (var k = 0; k < endTask.length; k++) {
27250
+ fromDataObject.push(endTask[k]);
27251
+ this.slackCalculation(fromDataObject, collection, collectionTaskId, checkEndDate, totalRecords, modelIds);
27252
+ }
27253
+ criticalPathIds = this.finalCriticalPath(collection, taskBeyondEnddate, totalRecords, modelIds, checkEndDate);
27254
+ this.criticalPathCollection = criticalPathIds;
27255
+ this.detailPredecessorCollection = collection;
27256
+ this.predecessorCollectionTaskIds = collectionTaskId;
27257
+ }
27258
+ if (isCritical === false && this.parent.flatData.length > 0 && !this.parent.enableMultiTaskbar) {
27259
+ var pathIndex = void 0;
27260
+ this.parent.enableCriticalPath = false;
27261
+ for (var z = 0; z < this.criticalPathCollection.length; z++) {
27262
+ pathIndex = modelIds.indexOf(this.criticalPathCollection[z].toString());
27263
+ totalRecords[pathIndex].isCritical = false;
27264
+ }
27265
+ this.criticalPathCollection = [];
27266
+ this.detailPredecessorCollection = [];
27267
+ this.predecessorCollectionTaskIds = [];
27268
+ }
27269
+ };
27270
+ /* eslint-disable-next-line */
27271
+ CriticalPath.prototype.slackCalculation = function (fromDataObject, collection, collectionTaskId, checkEndDate, flatRecords, modelRecordIds) {
27272
+ var fromDateArray = fromDataObject[0]['fromdata'].split(',');
27273
+ var fromDataPredecessor = fromDataObject[0]['fromDataPredecessor'].split(',');
27274
+ var fromDateArray1 = [];
27275
+ var fromTaskIdIndex;
27276
+ var indexFromTaskId;
27277
+ var indexToTaskId;
27278
+ var totaskId;
27279
+ var dateDifference;
27280
+ var prevTaskEnddate;
27281
+ var offsetInMillSec;
27282
+ var ffslack;
27283
+ for (var i = 0; i < fromDateArray.length; i++) {
27284
+ fromDateArray1 = fromDateArray[i].split(':');
27285
+ fromTaskIdIndex = collectionTaskId.indexOf(parseInt(fromDateArray1[0], 10));
27286
+ totaskId = collectionTaskId.indexOf(parseInt(fromDataObject[0]['todateID'], 10));
27287
+ if (this.parent.viewType === 'ProjectView') {
27288
+ indexFromTaskId = modelRecordIds.indexOf(fromDateArray1[0].toString());
27289
+ indexToTaskId = modelRecordIds.indexOf(fromDataObject[0]['todateID'].toString());
27290
+ }
27291
+ else {
27292
+ indexFromTaskId = this.resourceCollectionIds.indexOf(fromDateArray1[0].toString());
27293
+ indexToTaskId = this.resourceCollectionIds.indexOf(fromDataObject[0]['todateID'].toString());
27294
+ }
27295
+ var fromIdFlatData = flatRecords[indexFromTaskId].ganttProperties;
27296
+ var toIdFlatData = flatRecords[indexToTaskId].ganttProperties;
27297
+ if (fromDateArray1.length > 1) {
27298
+ if (fromDateArray1[1].indexOf('hour') !== -1) {
27299
+ offsetInMillSec = parseFloat(fromDateArray1[1]) * 60;
27300
+ }
27301
+ else if (fromDateArray1[1].indexOf('day') !== -1) {
27302
+ offsetInMillSec = parseFloat(fromDateArray1[1]) * (this.parent.secondsPerDay / 3600) * 60;
27303
+ }
27304
+ else {
27305
+ offsetInMillSec = parseFloat(fromDateArray1[1]);
27306
+ }
27307
+ }
27308
+ // calculate slack value for the task contains predecessor connection in "finish to start".
27309
+ if (fromDataPredecessor[i] === 'FS') {
27310
+ if (fromIdFlatData.endDate > toIdFlatData.startDate) {
27311
+ /* eslint-disable-next-line */
27312
+ dateDifference = -(this.parent.dataOperation.getDuration(toIdFlatData.startDate, fromIdFlatData.endDate, 'minute', fromIdFlatData.isAutoSchedule, fromIdFlatData.isMilestone));
27313
+ }
27314
+ else {
27315
+ /* eslint-disable-next-line */
27316
+ dateDifference = this.parent.dataOperation.getDuration(fromIdFlatData.endDate, toIdFlatData.startDate, 'minute', fromIdFlatData.isAutoSchedule, fromIdFlatData.isMilestone);
27317
+ }
27318
+ // execute if the slack value is not set initially.
27319
+ if (isNullOrUndefined(collection[fromTaskIdIndex]['slack'])) {
27320
+ // execute if the offset value is not given.
27321
+ if (fromDateArray1.length <= 1) {
27322
+ if (collection[totaskId]['slack'] + dateDifference < 0) {
27323
+ collection[fromTaskIdIndex]['slack'] = 0;
27324
+ }
27325
+ else {
27326
+ collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
27327
+ }
27328
+ }
27329
+ }
27330
+ // execute if the current calculated slack value is less than the previous slack value.
27331
+ else if (collection[fromTaskIdIndex]['slack'] > dateDifference && collection[fromTaskIdIndex]['slack'] !== 0) {
27332
+ // execute if the offset value is not given.
27333
+ if (fromDateArray1.length <= 1) {
27334
+ if (collection[totaskId]['slack'] + dateDifference < 0) {
27335
+ collection[fromTaskIdIndex]['slack'] = 0;
27336
+ }
27337
+ else {
27338
+ collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
27339
+ }
27340
+ }
27341
+ }
27342
+ // execute if the offset value is given.
27343
+ if (fromDateArray1.length > 1) {
27344
+ collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
27345
+ collection[fromTaskIdIndex]['slack'] = collection[fromTaskIdIndex]['slack'] - (offsetInMillSec);
27346
+ if (collection[fromTaskIdIndex]['slack'] < 0) {
27347
+ collection[fromTaskIdIndex]['slack'] = 0;
27348
+ }
27349
+ }
27350
+ collection[fromTaskIdIndex]['fs'] = 1;
27351
+ collection[fromTaskIdIndex]['fsslack'] = collection[fromTaskIdIndex]['slack'];
27352
+ collection[fromTaskIdIndex]['enddate'] = fromIdFlatData.startDate;
27353
+ if (fromIdFlatData.endDate >= checkEndDate && fromIdFlatData.endDate <= checkEndDate) {
27354
+ collection[fromTaskIdIndex]['slack'] = 0;
27355
+ }
27356
+ }
27357
+ // calculate slack value for the task contains predecessor connection in "start to start".
27358
+ if (fromDataPredecessor[i] === 'SS') {
27359
+ // It execute if the task is in auto mode.
27360
+ if (fromIdFlatData.isAutoSchedule) {
27361
+ if (fromIdFlatData.startDate > toIdFlatData.startDate) {
27362
+ /* eslint-disable-next-line */
27363
+ dateDifference = -(this.parent.dataOperation.getDuration(toIdFlatData.endDate, fromIdFlatData.startDate, 'minute', fromIdFlatData.isAutoSchedule, fromIdFlatData.isMilestone));
27364
+ }
27365
+ else {
27366
+ /* eslint-disable-next-line */
27367
+ dateDifference = this.parent.dataOperation.getDuration(fromIdFlatData.startDate, toIdFlatData.startDate, 'minute', fromIdFlatData.isAutoSchedule, fromIdFlatData.isMilestone);
27368
+ }
27369
+ // It execute while the slack value is not set to the corresponding task.
27370
+ if (isNullOrUndefined(collection[fromTaskIdIndex]['slack'])) {
27371
+ if (fromDateArray1.length <= 1) {
27372
+ if (collection[totaskId]['slack'] + dateDifference < 0) {
27373
+ collection[fromTaskIdIndex]['slack'] = 0;
27374
+ }
27375
+ else {
27376
+ collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
27377
+ }
27378
+ }
27379
+ }
27380
+ //It execute while already the slack value is set and it is higher than the datedifference.
27381
+ else if (collection[fromTaskIdIndex]['slack'] > dateDifference && collection[fromTaskIdIndex]['slack'] !== 0) {
27382
+ if (fromDateArray1.length <= 1) {
27383
+ if (collection[totaskId]['slack'] + dateDifference < 0) {
27384
+ collection[fromTaskIdIndex]['slack'] = 0;
27385
+ }
27386
+ else {
27387
+ collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
27388
+ }
27389
+ }
27390
+ }
27391
+ // execute if the offset value is given.
27392
+ if (fromDateArray1.length > 1) {
27393
+ collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
27394
+ collection[fromTaskIdIndex]['slack'] = collection[fromTaskIdIndex]['slack'] - (offsetInMillSec);
27395
+ if (collection[fromTaskIdIndex]['slack'] < 0) {
27396
+ collection[fromTaskIdIndex]['slack'] = 0;
27397
+ }
27398
+ }
27399
+ collection[fromTaskIdIndex]['fs'] = 1;
27400
+ collection[fromTaskIdIndex]['fsslack'] = collection[fromTaskIdIndex]['slack'];
27401
+ collection[fromTaskIdIndex]['enddate'] = fromIdFlatData.startDate;
27402
+ }
27403
+ // It execute if the task is in not an auto mode task.
27404
+ else if (!fromIdFlatData.isAutoSchedule) {
27405
+ dateDifference = this.getSlackDuration(fromIdFlatData.endDate, checkEndDate, 'minute', flatRecords[indexFromTaskId]);
27406
+ if (isNullOrUndefined(collection[fromTaskIdIndex]['slack'])) {
27407
+ collection[fromTaskIdIndex]['slack'] = dateDifference;
27408
+ }
27409
+ else if (collection[fromTaskIdIndex]['slack'] > dateDifference && collection[fromTaskIdIndex]['slack'] !== 0) {
27410
+ collection[fromTaskIdIndex]['slack'] = dateDifference;
27411
+ }
27412
+ }
27413
+ if (fromIdFlatData.endDate >= checkEndDate && fromIdFlatData.endDate <= checkEndDate) {
27414
+ collection[fromTaskIdIndex]['slack'] = 0;
27415
+ }
27416
+ }
27417
+ // calculate slack value for the task contains predecessor connection in "finish to finish".
27418
+ if (fromDataPredecessor[i] === 'FF') {
27419
+ // execute if the previous task is from finish to start or finish to finish state.
27420
+ if (collection[totaskId]['fs'] === 1 || collection[totaskId]['ff'] === 1 || collection[totaskId]['fs'] === -1) {
27421
+ if (collection[totaskId]['fs'] === 1 || collection[totaskId]['ff'] === 1) {
27422
+ prevTaskEnddate = toIdFlatData.endDate;
27423
+ ffslack = collection[totaskId]['slack'];
27424
+ }
27425
+ if (collection[totaskId]['fs'] === -1) {
27426
+ prevTaskEnddate = collection[totaskId]['enddate'];
27427
+ ffslack = collection[totaskId]['slack'];
27428
+ }
27429
+ if (prevTaskEnddate > fromIdFlatData.endDate) {
27430
+ dateDifference = -(this.getSlackDuration(fromIdFlatData.endDate, prevTaskEnddate, 'minute', flatRecords[indexFromTaskId]));
27431
+ }
27432
+ else {
27433
+ dateDifference = this.getSlackDuration(prevTaskEnddate, fromIdFlatData.endDate, 'minute', flatRecords[indexFromTaskId]);
27434
+ }
27435
+ // set the slack value if the slack value is not set initially.
27436
+ if (isNullOrUndefined(collection[fromTaskIdIndex]['slack'])) {
27437
+ // execute if the offset value is not given.
27438
+ if (fromDateArray1.length <= 1) {
27439
+ if (ffslack - dateDifference < 0) {
27440
+ collection[fromTaskIdIndex]['slack'] = 0;
27441
+ }
27442
+ else {
27443
+ collection[fromTaskIdIndex]['slack'] = ffslack - dateDifference;
27444
+ }
27445
+ }
27446
+ }
27447
+ // overright the slack value if the current calculated slack value is less than the previous slack value.
27448
+ else if (collection[fromTaskIdIndex]['slack'] > dateDifference && collection[fromTaskIdIndex]['slack'] !== 0) {
27449
+ // execute if the offset value is not given.
27450
+ if (fromDateArray1.length <= 1) {
27451
+ if (ffslack - dateDifference < 0) {
27452
+ collection[fromTaskIdIndex]['slack'] = 0;
27453
+ }
27454
+ else {
27455
+ collection[fromTaskIdIndex]['slack'] = ffslack - dateDifference;
27456
+ }
27457
+ }
27458
+ }
27459
+ // execute if the offset value is given.
27460
+ if (fromDateArray1.length > 1) {
27461
+ collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] - dateDifference;
27462
+ collection[fromTaskIdIndex]['slack'] = collection[fromTaskIdIndex]['slack'] - (offsetInMillSec);
27463
+ if (collection[fromTaskIdIndex]['slack'] < 0) {
27464
+ collection[fromTaskIdIndex]['slack'] = 0;
27465
+ }
27466
+ }
27467
+ collection[fromTaskIdIndex]['ff'] = 1;
27468
+ collection[fromTaskIdIndex]['enddate'] = prevTaskEnddate;
27469
+ collection[fromTaskIdIndex]['fsslack'] = ffslack;
27470
+ }
27471
+ if (fromIdFlatData.endDate >= checkEndDate && fromIdFlatData.endDate <= checkEndDate) {
27472
+ collection[fromTaskIdIndex]['slack'] = 0;
27473
+ }
27474
+ }
27475
+ // calculate slack value for the task contains predecessor connection in "start to finish".
27476
+ if (fromDataPredecessor[i] === 'SF') {
27477
+ //It execute if the task is an auto mode task.
27478
+ if (fromIdFlatData.isAutoSchedule) {
27479
+ //execute if the slack value is not set initially.
27480
+ if (isNullOrUndefined(collection[fromTaskIdIndex]['slack'])) {
27481
+ // execute if the offset value is not given.
27482
+ if (fromDateArray1.length <= 1) {
27483
+ // execute if the previous task does no has sucessor.
27484
+ if (isNullOrUndefined(collection[totaskId]['to'])) {
27485
+ dateDifference = this.getSlackDuration(fromIdFlatData.endDate, checkEndDate, 'minute', flatRecords[indexFromTaskId]);
27486
+ collection[fromTaskIdIndex]['slack'] = dateDifference;
27487
+ }
27488
+ // execute if the previous task has sucessor.
27489
+ else if (!isNullOrUndefined(collection[totaskId]['to'])) {
27490
+ if (toIdFlatData.endDate > fromIdFlatData.startDate) {
27491
+ /* eslint-disable-next-line */
27492
+ dateDifference = -(this.parent.dataOperation.getDuration(fromIdFlatData.startDate, toIdFlatData.endDate, 'minute', fromIdFlatData.isAutoSchedule, fromIdFlatData.isMilestone));
27493
+ }
27494
+ else {
27495
+ dateDifference = this.getSlackDuration(toIdFlatData.endDate, fromIdFlatData.startDate, 'minute', flatRecords[indexFromTaskId]);
27496
+ }
27497
+ if (collection[totaskId]['slack'] + dateDifference < 0) {
27498
+ collection[fromTaskIdIndex]['slack'] = 0;
27499
+ }
27500
+ else {
27501
+ collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
27502
+ }
27503
+ }
27504
+ }
27505
+ // execute if the offset value is given.
27506
+ else if (fromDateArray1.length > 1) {
27507
+ if (toIdFlatData.endDate >= fromIdFlatData.endDate) {
27508
+ if (fromIdFlatData.startDate > toIdFlatData.endDate) {
27509
+ /* eslint-disable-next-line */
27510
+ dateDifference = -(this.getSlackDuration(toIdFlatData.endDate, fromIdFlatData.startDate, 'minute', flatRecords[indexFromTaskId]));
27511
+ }
27512
+ else {
27513
+ /* eslint-disable-next-line */
27514
+ dateDifference = this.parent.dataOperation.getDuration(fromIdFlatData.startDate, toIdFlatData.endDate, 'minute', fromIdFlatData.isAutoSchedule, fromIdFlatData.isMilestone);
27515
+ }
27516
+ }
27517
+ else {
27518
+ dateDifference = this.getSlackDuration(fromIdFlatData.endDate, checkEndDate, 'minute', flatRecords[indexFromTaskId]);
27519
+ }
27520
+ collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
27521
+ collection[fromTaskIdIndex]['slack'] = collection[fromTaskIdIndex]['slack'] - (offsetInMillSec);
27522
+ if (collection[fromTaskIdIndex]['slack'] < 0) {
27523
+ collection[fromTaskIdIndex]['slack'] = 0;
27524
+ }
27525
+ }
27526
+ collection[fromTaskIdIndex]['fs'] = 1;
27527
+ collection[fromTaskIdIndex]['fsslack'] = collection[fromTaskIdIndex]['slack'];
27528
+ collection[fromTaskIdIndex]['enddate'] = fromIdFlatData.startDate;
27529
+ }
27530
+ else {
27531
+ if (fromDateArray1.length <= 1) {
27532
+ if (isNullOrUndefined(collection[totaskId]['to'])) {
27533
+ /* eslint-disable-next-line */
27534
+ dateDifference = this.getSlackDuration(fromIdFlatData.endDate, checkEndDate, 'minute', flatRecords[indexFromTaskId]);
27535
+ }
27536
+ else if (!isNullOrUndefined(collection[totaskId]['to'])) {
27537
+ if (toIdFlatData.endDate > fromIdFlatData.startDate) {
27538
+ // eslint-disable-next-line
27539
+ dateDifference = -(this.parent.dataOperation.getDuration(fromIdFlatData.startDate, toIdFlatData.endDate, 'minute', fromIdFlatData.isAutoSchedule, fromIdFlatData.isMilestone));
27540
+ }
27541
+ else {
27542
+ dateDifference = this.getSlackDuration(toIdFlatData.endDate, fromIdFlatData.startDate, 'minute', flatRecords[indexFromTaskId]);
27543
+ }
27544
+ }
27545
+ // execute if the current calculated slack value is less than the previous slack value.
27546
+ if (collection[fromTaskIdIndex]['slack'] > dateDifference && collection[fromTaskIdIndex]['slack'] !== 0) {
27547
+ if (isNullOrUndefined(collection[totaskId]['to'])) {
27548
+ collection[fromTaskIdIndex]['slack'] = dateDifference;
27549
+ }
27550
+ else if (!isNullOrUndefined(collection[totaskId]['to'])) {
27551
+ if (collection[totaskId]['slack'] + dateDifference < 0) {
27552
+ collection[fromTaskIdIndex]['slack'] = 0;
27553
+ }
27554
+ else {
27555
+ collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
27556
+ }
27557
+ }
27558
+ }
27559
+ }
27560
+ else if (fromDateArray1.length > 1) {
27561
+ if (toIdFlatData.endDate > fromIdFlatData.endDate) {
27562
+ if (fromIdFlatData.startDate > toIdFlatData.endDate) {
27563
+ /* eslint-disable-next-line */
27564
+ dateDifference = -(this.getSlackDuration(toIdFlatData.endDate, fromIdFlatData.startDate, 'minute', flatRecords[indexFromTaskId]));
27565
+ }
27566
+ else {
27567
+ // eslint-disable-next-line
27568
+ dateDifference = this.parent.dataOperation.getDuration(fromIdFlatData.startDate, toIdFlatData.endDate, 'minute', fromIdFlatData.isAutoSchedule, fromIdFlatData.isMilestone);
27569
+ }
27570
+ }
27571
+ else {
27572
+ /* eslint-disable-next-line */
27573
+ dateDifference = this.getSlackDuration(fromIdFlatData.endDate, checkEndDate, 'minute', flatRecords[indexFromTaskId]);
27574
+ }
27575
+ // execute if the current calculated slack value is less than the previous slack value.
27576
+ if (collection[fromTaskIdIndex]['slack'] > dateDifference && collection[fromTaskIdIndex]['slack'] !== 0) {
27577
+ collection[fromTaskIdIndex]['slack'] = collection[totaskId]['slack'] + dateDifference;
27578
+ collection[fromTaskIdIndex]['slack'] = collection[fromTaskIdIndex]['slack'] - (offsetInMillSec);
27579
+ if (collection[fromTaskIdIndex]['slack'] < 0) {
27580
+ collection[fromTaskIdIndex]['slack'] = 0;
27581
+ }
27582
+ }
27583
+ }
27584
+ collection[fromTaskIdIndex]['fs'] = 1;
27585
+ collection[fromTaskIdIndex]['fsslack'] = collection[fromTaskIdIndex]['slack'];
27586
+ collection[fromTaskIdIndex]['enddate'] = fromIdFlatData.startDate;
27587
+ }
27588
+ }
27589
+ //It execute if the task is an auto mode task.
27590
+ else if (!fromIdFlatData.isAutoSchedule) {
27591
+ dateDifference = this.getSlackDuration(fromIdFlatData.endDate, checkEndDate, 'minute', flatRecords[indexFromTaskId]);
27592
+ if (isNullOrUndefined(collection[fromTaskIdIndex]['slack'])) {
27593
+ collection[fromTaskIdIndex]['slack'] = dateDifference;
27594
+ }
27595
+ else if (collection[fromTaskIdIndex]['slack'] > dateDifference && collection[fromTaskIdIndex]['slack'] !== 0) {
27596
+ collection[fromTaskIdIndex]['slack'] = dateDifference;
27597
+ }
27598
+ }
27599
+ if (fromIdFlatData.endDate >= checkEndDate && fromIdFlatData.endDate <= checkEndDate) {
27600
+ collection[fromTaskIdIndex]['slack'] = 0;
27601
+ }
27602
+ }
27603
+ if (collection[fromTaskIdIndex]['from']) {
27604
+ fromDataObject.push({
27605
+ fromdata: collection[fromTaskIdIndex]['from'], todateID: collection[fromTaskIdIndex]['taskid'],
27606
+ fromDataPredecessor: collection[fromTaskIdIndex]['fromPredecessor']
27607
+ });
27608
+ }
27609
+ }
27610
+ if (fromDataObject) {
27611
+ fromDataObject.splice(0, 1);
27612
+ if (fromDataObject.length > 0) {
27613
+ this.slackCalculation(fromDataObject, collection, collectionTaskId, checkEndDate, flatRecords, modelRecordIds);
27614
+ }
27615
+ }
27616
+ };
27617
+ CriticalPath.prototype.getSlackDuration = function (sDate, eDate, durationUnit, record) {
27618
+ var startDate = this.parent.dateValidationModule.checkStartDate(new Date(sDate));
27619
+ var endDate = this.parent.dateValidationModule.checkEndDate(new Date(eDate));
27620
+ if (this.parent.dataOperation['getTimeDifference'](startDate, endDate, true) <= 0) {
27621
+ return 0;
27622
+ }
27623
+ else {
27624
+ return this.parent.dataOperation.getDuration(startDate, endDate, durationUnit, record.ganttProperties.isAutoSchedule, true);
27625
+ }
27626
+ };
27627
+ /* eslint-disable-next-line */
27628
+ CriticalPath.prototype.finalCriticalPath = function (collection, taskBeyondEnddate, flatRecords, modelRecordIds, checkEndDate) {
27629
+ var criticalPathIds = [];
27630
+ var index;
27631
+ for (var x = collection.length - 1; x >= 0; x--) {
27632
+ if (this.parent.viewType === 'ProjectView') {
27633
+ index = modelRecordIds.indexOf(collection[x]['taskid'].toString());
27634
+ }
27635
+ else {
27636
+ index = this.resourceCollectionIds.indexOf(collection[x]['taskid'].toString());
27637
+ }
27638
+ var predecessorLength = flatRecords[index].ganttProperties.predecessor;
27639
+ var noSlackValue = 0 + ' ' + flatRecords[index].ganttProperties.durationUnit;
27640
+ for (var i = 0; i < predecessorLength.length; i++) {
27641
+ var toID = void 0;
27642
+ if (this.parent.viewType === 'ProjectView') {
27643
+ toID = this.parent.ids.indexOf(predecessorLength[i].to);
27644
+ }
27645
+ else {
27646
+ toID = this.resourceCollectionIds.indexOf(predecessorLength[i].to);
27647
+ }
27648
+ var dateDifference = void 0;
27649
+ var currentData = flatRecords[index].ganttProperties;
27650
+ if (predecessorLength[i].type === 'FS') {
27651
+ /* eslint-disable-next-line */
27652
+ dateDifference = this.parent.dataOperation.getDuration(currentData.endDate, flatRecords[toID].ganttProperties.startDate, currentData.durationUnit, currentData.isAutoSchedule, currentData.isMilestone);
27653
+ if (dateDifference === 0 && index !== toID && flatRecords[index].slack !== noSlackValue) {
27654
+ flatRecords[index].slack = flatRecords[toID].slack;
27655
+ flatRecords[index].ganttProperties.slack = flatRecords[toID].slack;
27656
+ }
27657
+ else if (dateDifference !== 0 && index !== toID && flatRecords[toID].isCritical) {
27658
+ flatRecords[index].slack = dateDifference + ' ' + flatRecords[index].ganttProperties.durationUnit;
27659
+ flatRecords[index].ganttProperties.slack = dateDifference + ' ' + flatRecords[index].ganttProperties.durationUnit;
27660
+ }
27661
+ }
27662
+ else if (predecessorLength[i].type === 'SF') {
27663
+ /* eslint-disable-next-line */
27664
+ dateDifference = this.parent.dataOperation.getDuration(currentData.startDate, flatRecords[toID].ganttProperties.endDate, currentData.durationUnit, currentData.isAutoSchedule, currentData.isMilestone);
27665
+ }
27666
+ else if (predecessorLength[i].type === 'SS') {
27667
+ /* eslint-disable-next-line */
27668
+ dateDifference = this.parent.dataOperation.getDuration(currentData.startDate, flatRecords[toID].ganttProperties.startDate, currentData.durationUnit, currentData.isAutoSchedule, currentData.isMilestone);
27669
+ }
27670
+ else {
27671
+ /* eslint-disable-next-line */
27672
+ dateDifference = this.parent.dataOperation.getDuration(currentData.endDate, flatRecords[toID].ganttProperties.endDate, currentData.durationUnit, currentData.isAutoSchedule, currentData.isMilestone);
27673
+ }
27674
+ if (parseInt(predecessorLength[i].from, 10) === flatRecords[index][this.parent.taskFields.id] &&
27675
+ flatRecords[toID].slack === noSlackValue && dateDifference <= 0) {
27676
+ flatRecords[index].slack = noSlackValue;
27677
+ flatRecords[index].ganttProperties.slack = noSlackValue;
27678
+ }
27679
+ }
27680
+ if (flatRecords[index].slack === noSlackValue) {
27681
+ if (flatRecords[index].ganttProperties.progress < 100) {
27682
+ flatRecords[index].isCritical = true;
27683
+ flatRecords[index].ganttProperties.isCritical = true;
27684
+ this.criticalTasks.push(flatRecords[index]);
27685
+ criticalPathIds.push(collection[x]['taskid']);
27686
+ }
27687
+ }
27688
+ }
27689
+ if (taskBeyondEnddate.length > 0) {
27690
+ for (var i = 0; i < taskBeyondEnddate.length; i++) {
27691
+ if (this.parent.viewType === 'ProjectView') {
27692
+ index = modelRecordIds.indexOf(taskBeyondEnddate[i].toString());
27693
+ }
27694
+ else {
27695
+ index = this.resourceCollectionIds.indexOf(taskBeyondEnddate[i].toString());
27696
+ }
27697
+ if (index !== -1 && flatRecords[index].ganttProperties.progress < 100) {
27698
+ this.criticalTasks.push(flatRecords[index]);
27699
+ criticalPathIds = criticalPathIds.concat(taskBeyondEnddate[i]);
27700
+ }
27701
+ }
27702
+ }
27703
+ return criticalPathIds;
27704
+ };
27705
+ /* eslint-disable-next-line */
27706
+ CriticalPath.prototype.criticalConnectorLine = function (criticalPathIds, collection, condition, collectionTaskId) {
27707
+ var ganttChartElement = this.parent.ganttChartModule.chartElement;
27708
+ removeClass(ganttChartElement.querySelectorAll('.e-gantt-child-taskbar-inner-div'), criticalChildTaskBarInnerDiv);
27709
+ removeClass(ganttChartElement.querySelectorAll('.e-gantt-child-progressbar-inner-div'), criticalChildProgressBarInnerDiv);
27710
+ removeClass(ganttChartElement.querySelectorAll('.e-milestone-top'), criticalMilestoneTop);
27711
+ removeClass(ganttChartElement.querySelectorAll('.e-milestone-bottom'), criticalMilestoneBottom);
27712
+ for (var i = 0; i < criticalPathIds.length; i++) {
27713
+ var criticalData = void 0;
27714
+ if (this.parent.viewType === 'ProjectView') {
27715
+ criticalData = this.parent.flatData[this.parent.ids.indexOf(criticalPathIds[i].toString())];
27716
+ }
27717
+ else {
27718
+ criticalData = this.parent.flatData[this.resourceCollectionIds.indexOf(criticalPathIds[i].toString())];
27719
+ }
27720
+ var index = this.parent.currentViewData.indexOf(criticalData);
27721
+ var element = this.parent.getRowByIndex(index);
27722
+ var taskClass = void 0;
27723
+ var columnFields = this.parent.taskFields;
27724
+ /* eslint-disable-next-line */
27725
+ if (this.parent.allowUnscheduledTasks && !criticalData[columnFields.startDate] && !criticalData[columnFields.endDate] && criticalData[columnFields.duration]) {
27726
+ taskClass = criticalUnscheduledTask;
27727
+ }
27728
+ else {
27729
+ taskClass = criticalChildProgressBarInnerDiv;
27730
+ }
27731
+ if (element) {
27732
+ if (element.getElementsByClassName('e-milestone-top')[0]) {
27733
+ addClass(element.querySelectorAll('.e-milestone-top'), criticalMilestoneTop);
27734
+ }
27735
+ if (element.getElementsByClassName('e-milestone-bottom')[0]) {
27736
+ addClass(element.querySelectorAll('.e-milestone-bottom'), criticalMilestoneBottom);
27737
+ }
27738
+ if (element.getElementsByClassName('e-gantt-child-taskbar-inner-div').length > 0) {
27739
+ addClass(element.querySelectorAll('.e-gantt-child-taskbar-inner-div'), criticalChildTaskBarInnerDiv);
27740
+ }
27741
+ if (element.getElementsByClassName('e-gantt-child-progressbar-inner-div').length > 0) {
27742
+ addClass(element.querySelectorAll('.e-gantt-child-progressbar-inner-div'), taskClass);
27743
+ }
27744
+ }
27745
+ }
27746
+ removeClass(this.parent.element.querySelectorAll('.e-line'), criticalConnectorLine);
27747
+ removeClass(this.parent.element.querySelectorAll('.e-connector-line-right-arrow'), criticalConnectorLineRightArrow);
27748
+ removeClass(this.parent.element.querySelectorAll('.e-connector-line-left-arrow'), criticalConnectorLineLeftArrow);
27749
+ if (collection.length !== 0) {
27750
+ var index = 0;
27751
+ var currentdata = void 0;
27752
+ var checking = [];
27753
+ var checkint = void 0;
27754
+ for (var i = 0; i < this.criticalPathCollection.length; i++) {
27755
+ index = collectionTaskId.indexOf(this.criticalPathCollection[i]);
27756
+ currentdata = collection[index];
27757
+ if (index !== -1 && currentdata['to']) {
27758
+ checking = currentdata['to'].split(',');
27759
+ for (var j = 0; j < checking.length; j++) {
27760
+ checkint = parseInt(checking[j], 10);
27761
+ if (criticalPathIds.indexOf(checkint) !== -1) {
27762
+ var lineElement = this.parent.element.querySelectorAll('#ConnectorLineparent' +
27763
+ currentdata['taskid'] + 'child' + checkint);
27764
+ if (lineElement.length > 0) {
27765
+ addClass(this.parent.element.querySelectorAll('#ConnectorLineparent' + currentdata['taskid'] + 'child' +
27766
+ checkint)[0].querySelectorAll('.e-line'), criticalConnectorLine);
27767
+ addClass(this.parent.element.querySelectorAll('#ConnectorLineparent' + currentdata['taskid'] + 'child' +
27768
+ checkint)[0].querySelectorAll('.e-connector-line-right-arrow'), criticalConnectorLineRightArrow);
27769
+ addClass(this.parent.element.querySelectorAll('#ConnectorLineparent' + currentdata['taskid'] + 'child' +
27770
+ checkint)[0].querySelectorAll('.e-connector-line-left-arrow'), criticalConnectorLineLeftArrow);
27771
+ }
27772
+ }
27773
+ }
27774
+ }
27775
+ }
27776
+ }
27777
+ };
27778
+ CriticalPath.prototype.getModuleName = function () {
27779
+ return 'criticalPath';
27780
+ };
27781
+ /**
27782
+ * Destroys the Critical Path of Gantt.
27783
+ *
27784
+ * @returns {void} .
27785
+ * @private
27786
+ */
27787
+ CriticalPath.prototype.destroy = function () {
27788
+ if (!this.parent.enableCriticalPath && this.parent.criticalPathModule) {
27789
+ this.parent.criticalPathModule = undefined;
27790
+ }
27791
+ };
27792
+ return CriticalPath;
27793
+ }());
27794
+
26795
27795
  // eslint-disable-next-line
26796
27796
  /**
26797
27797
  * The ContextMenu module is used to handle the context menu items & sub-menu items.
@@ -27023,9 +28023,8 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
27023
28023
  ContextMenu$$1.prototype.getClickedDate = function (element) {
27024
28024
  // context menu click position
27025
28025
  var ganttElementPosition = this.parent.getOffsetRect(this.parent.element);
27026
- var ganttLeft = ganttElementPosition.left - this.parent.element.offsetLeft;
27027
28026
  // task left position
27028
- var pageLeft = ganttLeft + this.parent.ganttChartModule.chartElement.offsetLeft +
28027
+ var pageLeft = ganttElementPosition.left + this.parent.ganttChartModule.chartElement.offsetLeft +
27029
28028
  this.rowData.ganttProperties.left - this.parent.ganttChartModule.scrollElement.scrollLeft;
27030
28029
  // difference from task start date to current click position.
27031
28030
  var currentTaskDifference = this.clickedPosition - pageLeft;
@@ -27213,7 +28212,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
27213
28212
  break;
27214
28213
  case 'Indent':
27215
28214
  {
27216
- if (!this.parent.allowSelection) {
28215
+ if (!this.parent.allowSelection || !this.parent.editModule || !this.parent.editSettings) {
27217
28216
  this.hideItems.push(item.text);
27218
28217
  }
27219
28218
  else {
@@ -27230,7 +28229,7 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
27230
28229
  }
27231
28230
  case 'Outdent':
27232
28231
  {
27233
- if (!this.parent.allowSelection) {
28232
+ if (!this.parent.allowSelection || !this.parent.editModule || !this.parent.editSettings) {
27234
28233
  this.hideItems.push(item.text);
27235
28234
  }
27236
28235
  else {
@@ -28494,6 +29493,10 @@ var PdfGanttTheme = /** @__PURE__ @class */ (function () {
28494
29493
  //chart side theme
28495
29494
  ganttStyle.taskbar.taskColor = new PdfColor(49, 122, 185);
28496
29495
  ganttStyle.taskbar.progressColor = new PdfColor(33, 82, 125);
29496
+ ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
29497
+ ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
29498
+ ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
29499
+ ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
28497
29500
  ganttStyle.taskbar.parentTaskColor = new PdfColor(119, 119, 119);
28498
29501
  ganttStyle.taskbar.parentProgressColor = new PdfColor(85, 85, 85);
28499
29502
  ganttStyle.taskbar.taskBorderColor = new PdfColor(33, 82, 125);
@@ -28510,6 +29513,10 @@ var PdfGanttTheme = /** @__PURE__ @class */ (function () {
28510
29513
  //chart side theme
28511
29514
  ganttStyle.taskbar.taskColor = new PdfColor(0, 123, 255);
28512
29515
  ganttStyle.taskbar.progressColor = new PdfColor(0, 86, 179);
29516
+ ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
29517
+ ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
29518
+ ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
29519
+ ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
28513
29520
  ganttStyle.taskbar.parentTaskColor = new PdfColor(108, 117, 125);
28514
29521
  ganttStyle.taskbar.parentProgressColor = new PdfColor(73, 80, 87);
28515
29522
  ganttStyle.taskbar.taskBorderColor = new PdfColor(0, 86, 179);
@@ -28528,6 +29535,10 @@ var PdfGanttTheme = /** @__PURE__ @class */ (function () {
28528
29535
  //chart side theme
28529
29536
  ganttStyle.taskbar.taskColor = new PdfColor(0, 120, 214);
28530
29537
  ganttStyle.taskbar.progressColor = new PdfColor(0, 91, 163);
29538
+ ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
29539
+ ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
29540
+ ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
29541
+ ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
28531
29542
  ganttStyle.taskbar.parentTaskColor = new PdfColor(118, 118, 118);
28532
29543
  ganttStyle.taskbar.parentProgressColor = new PdfColor(80, 80, 80);
28533
29544
  ganttStyle.taskbar.taskBorderColor = new PdfColor(0, 91, 163);
@@ -28544,6 +29555,10 @@ var PdfGanttTheme = /** @__PURE__ @class */ (function () {
28544
29555
  //chart side theme
28545
29556
  ganttStyle.taskbar.taskColor = new PdfColor(88, 105, 197);
28546
29557
  ganttStyle.taskbar.progressColor = new PdfColor(63, 81, 181);
29558
+ ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
29559
+ ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
29560
+ ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
29561
+ ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
28547
29562
  ganttStyle.taskbar.parentTaskColor = new PdfColor(132, 132, 132);
28548
29563
  ganttStyle.taskbar.parentProgressColor = new PdfColor(97, 97, 97);
28549
29564
  ganttStyle.taskbar.taskBorderColor = new PdfColor(63, 81, 181);
@@ -30859,6 +31874,12 @@ var ExportHelper = /** @__PURE__ @class */ (function () {
30859
31874
  predecessor.milestoneParent = data.milestoneParent;
30860
31875
  predecessor.milestoneChild = data.milestoneChild;
30861
31876
  predecessor.lineWidth = _this.parent.connectorLineWidth > 5 ? pixelToPoint(5) : pixelToPoint(_this.parent.connectorLineWidth);
31877
+ if (data.isCritical) {
31878
+ predecessor.connectorLineColor = _this.ganttStyle.criticalConnectorLineColor;
31879
+ }
31880
+ else {
31881
+ predecessor.connectorLineColor = _this.ganttStyle.connectorLineColor;
31882
+ }
30862
31883
  predecessor.connectorLineColor = _this.ganttStyle.connectorLineColor;
30863
31884
  _this.gantt.predecessorCollection.push(predecessor);
30864
31885
  });
@@ -30982,9 +32003,16 @@ var ExportHelper = /** @__PURE__ @class */ (function () {
30982
32003
  taskbar.progressColor = new PdfColor(_this.ganttStyle.taskbar.parentProgressColor);
30983
32004
  }
30984
32005
  else {
30985
- taskbar.taskColor = new PdfColor(_this.ganttStyle.taskbar.taskColor);
30986
- taskbar.taskBorderColor = new PdfColor(_this.ganttStyle.taskbar.taskBorderColor);
30987
- taskbar.progressColor = new PdfColor(_this.ganttStyle.taskbar.progressColor);
32006
+ if (data.isCritical) {
32007
+ taskbar.taskColor = new PdfColor(_this.ganttStyle.taskbar.criticalTaskColor);
32008
+ taskbar.progressColor = new PdfColor(_this.ganttStyle.taskbar.criticalProgressColor);
32009
+ taskbar.taskBorderColor = new PdfColor(_this.ganttStyle.taskbar.criticalTaskBorderColor);
32010
+ }
32011
+ else {
32012
+ taskbar.taskColor = new PdfColor(_this.ganttStyle.taskbar.taskColor);
32013
+ taskbar.progressColor = new PdfColor(_this.ganttStyle.taskbar.progressColor);
32014
+ taskbar.taskBorderColor = new PdfColor(_this.ganttStyle.taskbar.taskBorderColor);
32015
+ }
30988
32016
  }
30989
32017
  taskbar.gridLineColor = new PdfColor(_this.ganttStyle.chartGridLineColor);
30990
32018
  _this.gantt.taskbarCollection.push(taskbar);
@@ -31211,13 +32239,13 @@ var ExportValueFormatter = /** @__PURE__ @class */ (function () {
31211
32239
  if (typeof args.column.format === 'string') {
31212
32240
  var format = void 0;
31213
32241
  if (args.column.type === 'date') {
31214
- format = { type: 'date', skeleton: args.column.format };
32242
+ format = { type: 'date', format: args.column.format };
31215
32243
  }
31216
32244
  else if (args.column.type === 'time') {
31217
- format = { type: 'time', skeleton: args.column.format };
32245
+ format = { type: 'time', format: args.column.format };
31218
32246
  }
31219
32247
  else {
31220
- format = { type: 'dateTime', skeleton: args.column.format };
32248
+ format = { type: 'dateTime', format: args.column.format };
31221
32249
  }
31222
32250
  return this.returnFormattedValue(args, format);
31223
32251
  }
@@ -32795,5 +33823,5 @@ var VirtualScroll$1 = /** @__PURE__ @class */ (function () {
32795
33823
  * Gantt index file
32796
33824
  */
32797
33825
 
32798
- export { Gantt, PdfHorizontalOverflowType, parentsUntil$1 as parentsUntil, isScheduledTask, isCountRequired, getSwapKey, isRemoteData, getTaskData, updateDates, formatString, getIndex, pixelToPoint, pointToPixel, getUid$1 as getUid, load, rowDataBound, queryCellInfo, toolbarClick, keyPressed, Edit$2 as Edit, Reorder$1 as Reorder, Resize$1 as Resize, Filter$1 as Filter, Sort$1 as Sort, Dependency, Selection$1 as Selection, Toolbar$3 as Toolbar, DayMarkers, ContextMenu$2 as ContextMenu, ExcelExport$1 as ExcelExport, ColumnMenu$1 as ColumnMenu, RowDD$1 as RowDD, PdfExport, VirtualScroll$1 as VirtualScroll, Column, DayWorkingTime, AddDialogFieldSettings, EditDialogFieldSettings, EditSettings, EventMarker, FilterSettings, SearchSettings, Holiday, LabelSettings, SelectionSettings, SplitterSettings, TaskFields, TimelineTierSettings, TimelineSettings, TooltipSettings, SortDescriptor, SortSettings, ResourceFields };
33826
+ export { Gantt, PdfHorizontalOverflowType, parentsUntil$1 as parentsUntil, isScheduledTask, isCountRequired, getSwapKey, isRemoteData, getTaskData, updateDates, formatString, getIndex, pixelToPoint, pointToPixel, getUid$1 as getUid, load, rowDataBound, queryCellInfo, toolbarClick, keyPressed, Edit$2 as Edit, Reorder$1 as Reorder, Resize$1 as Resize, Filter$1 as Filter, Sort$1 as Sort, Dependency, Selection$1 as Selection, Toolbar$3 as Toolbar, DayMarkers, CriticalPath, ContextMenu$2 as ContextMenu, ExcelExport$1 as ExcelExport, ColumnMenu$1 as ColumnMenu, RowDD$1 as RowDD, PdfExport, VirtualScroll$1 as VirtualScroll, Column, DayWorkingTime, AddDialogFieldSettings, EditDialogFieldSettings, EditSettings, EventMarker, FilterSettings, SearchSettings, Holiday, LabelSettings, SelectionSettings, SplitterSettings, TaskFields, TimelineTierSettings, TimelineSettings, TooltipSettings, SortDescriptor, SortSettings, ResourceFields };
32799
33827
  //# sourceMappingURL=ej2-gantt.es5.js.map