@syncfusion/ej2-gantt 23.1.39 → 23.1.42

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 (57) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/ej2-gantt.min.js +2 -2
  3. package/dist/ej2-gantt.umd.min.js +2 -2
  4. package/dist/ej2-gantt.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-gantt.es2015.js +176 -128
  6. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  7. package/dist/es6/ej2-gantt.es5.js +176 -128
  8. package/dist/es6/ej2-gantt.es5.js.map +1 -1
  9. package/dist/global/ej2-gantt.min.js +2 -2
  10. package/dist/global/ej2-gantt.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +15 -15
  13. package/src/gantt/actions/chart-scroll.js +6 -1
  14. package/src/gantt/actions/critical-path.js +10 -5
  15. package/src/gantt/actions/edit.js +12 -2
  16. package/src/gantt/actions/rowdragdrop.js +6 -6
  17. package/src/gantt/actions/taskbar-edit.d.ts +4 -1
  18. package/src/gantt/actions/taskbar-edit.js +65 -80
  19. package/src/gantt/base/gantt-chart.js +35 -18
  20. package/src/gantt/export/export-helper.js +11 -11
  21. package/src/gantt/renderer/chart-rows.js +26 -5
  22. package/src/gantt/renderer/connector-line.js +6 -1
  23. package/styles/bootstrap-dark.css +1 -1
  24. package/styles/bootstrap.css +1 -1
  25. package/styles/bootstrap4.css +33 -3
  26. package/styles/bootstrap5-dark.css +1 -1
  27. package/styles/bootstrap5.css +1 -1
  28. package/styles/fabric-dark.css +1 -1
  29. package/styles/fabric.css +1 -1
  30. package/styles/fluent-dark.css +1 -1
  31. package/styles/fluent.css +1 -1
  32. package/styles/gantt/_layout.scss +1 -1
  33. package/styles/gantt/bootstrap-dark.css +1 -1
  34. package/styles/gantt/bootstrap.css +1 -1
  35. package/styles/gantt/bootstrap4.css +33 -3
  36. package/styles/gantt/bootstrap5-dark.css +1 -1
  37. package/styles/gantt/bootstrap5.css +1 -1
  38. package/styles/gantt/fabric-dark.css +1 -1
  39. package/styles/gantt/fabric.css +1 -1
  40. package/styles/gantt/fluent-dark.css +1 -1
  41. package/styles/gantt/fluent.css +1 -1
  42. package/styles/gantt/highcontrast-light.css +1 -1
  43. package/styles/gantt/highcontrast.css +1 -1
  44. package/styles/gantt/material-dark.css +1 -1
  45. package/styles/gantt/material.css +1 -1
  46. package/styles/gantt/material3-dark.css +1 -1
  47. package/styles/gantt/material3.css +1 -1
  48. package/styles/gantt/tailwind-dark.css +1 -1
  49. package/styles/gantt/tailwind.css +1 -1
  50. package/styles/highcontrast-light.css +1 -1
  51. package/styles/highcontrast.css +1 -1
  52. package/styles/material-dark.css +1 -1
  53. package/styles/material.css +1 -1
  54. package/styles/material3-dark.css +1 -1
  55. package/styles/material3.css +1 -1
  56. package/styles/tailwind-dark.css +1 -1
  57. package/styles/tailwind.css +1 -1
@@ -4329,7 +4329,12 @@ var ChartScroll = /** @__PURE__ @class */ (function () {
4329
4329
  for (var i = 0; i < parent.currentViewData.length; i++) {
4330
4330
  var tr = parent.chartRowsModule.ganttChartTableBody.childNodes[i];
4331
4331
  if (tr['style'].display !== 'none' && parent.currentViewData[i].hasChildRecords && !parent.currentViewData[i].expanded) {
4332
- parent.treeGrid.getRowByIndex(i)['style'].height = tr['style'].height;
4332
+ if (parent.ganttChartModule.isExpandAll || parent.ganttChartModule.isCollapseAll) {
4333
+ parent.treeGrid.getRowByIndex(i)['style'].height = tr['style'].height;
4334
+ }
4335
+ else {
4336
+ parent.treeGrid.getRows()[i]['style'].height = tr['style'].height;
4337
+ }
4333
4338
  }
4334
4339
  }
4335
4340
  parent.contentHeight = parent.enableRtl ? parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
@@ -4830,8 +4835,14 @@ var GanttChart = /** @__PURE__ @class */ (function () {
4830
4835
  this.parent.notify('chartMouseDown', e);
4831
4836
  this.parent.element.tabIndex = 0;
4832
4837
  }
4833
- if (this.parent.editSettings.allowEditing && this.parent.treeGrid.element.getElementsByClassName('e-editedbatchcell').length > 0) {
4834
- this.parent.treeGrid.endEdit();
4838
+ var isTaskbarEdited = false;
4839
+ if (this.parent.editSettings.allowTaskbarEditing && this.parent.element.querySelector('.e-left-resize-gripper')) {
4840
+ isTaskbarEdited = true;
4841
+ }
4842
+ if (!isTaskbarEdited) {
4843
+ if (this.parent.editSettings.allowEditing && this.parent.treeGrid.element.getElementsByClassName('e-editedbatchcell').length > 0) {
4844
+ this.parent.treeGrid.endEdit();
4845
+ }
4835
4846
  }
4836
4847
  };
4837
4848
  GanttChart.prototype.ganttChartMouseClick = function (e) {
@@ -4841,6 +4852,22 @@ var GanttChart = /** @__PURE__ @class */ (function () {
4841
4852
  this.parent.notify('chartMouseClick', e);
4842
4853
  };
4843
4854
  GanttChart.prototype.ganttChartMouseUp = function (e) {
4855
+ if (e.type === "touchend") {
4856
+ var resizeCheck = this.parent.ganttChartModule.chartBodyContainer.querySelector('.e-taskbar-resize-div');
4857
+ if (!isNullOrUndefined(resizeCheck)) {
4858
+ resizeCheck.remove();
4859
+ }
4860
+ var Check = this.parent.ganttChartModule.chartBodyContainer.querySelector('.e-clone-taskbar') || this.parent.chartPane.querySelector('.e-clone-taskbar');
4861
+ if (!isNullOrUndefined(Check)) {
4862
+ var clonetbody = Check.parentElement;
4863
+ var cloneTable = clonetbody.parentElement;
4864
+ cloneTable.remove();
4865
+ }
4866
+ var falseline = this.parent.ganttChartModule.chartBodyContainer.querySelector('.e-gantt-false-line');
4867
+ if (!isNullOrUndefined(falseline)) {
4868
+ this.parent.editModule.taskbarEditModule.removeFalseLine(true);
4869
+ }
4870
+ }
4844
4871
  if (this.parent.editSettings.allowTaskbarEditing) {
4845
4872
  this.parent.notify('chartMouseUp', e);
4846
4873
  }
@@ -4864,22 +4891,6 @@ var GanttChart = /** @__PURE__ @class */ (function () {
4864
4891
  }
4865
4892
  }
4866
4893
  }
4867
- if (e.type === "touchend") {
4868
- var resizeCheck = this.parent.ganttChartModule.chartBodyContainer.querySelector('.e-taskbar-resize-div');
4869
- if (!isNullOrUndefined(resizeCheck)) {
4870
- resizeCheck.remove();
4871
- }
4872
- var Check = this.parent.ganttChartModule.chartBodyContainer.querySelector('.e-clone-taskbar');
4873
- if (!isNullOrUndefined(Check)) {
4874
- var clonetbody = Check.parentElement;
4875
- var cloneTable = clonetbody.parentElement;
4876
- cloneTable.remove();
4877
- }
4878
- var falseline = this.parent.ganttChartModule.chartBodyContainer.querySelector('.e-gantt-false-line');
4879
- if (!isNullOrUndefined(falseline)) {
4880
- this.parent.editModule.taskbarEditModule.removeFalseLine(true);
4881
- }
4882
- }
4883
4894
  };
4884
4895
  /**
4885
4896
  *
@@ -4933,6 +4944,9 @@ var GanttChart = /** @__PURE__ @class */ (function () {
4933
4944
  if (!isNullOrUndefined(resizeCheck)) {
4934
4945
  resizeCheck.remove();
4935
4946
  }
4947
+ if (this.parent.allowTaskbarDragAndDrop && this.parent.editModule && this.parent.editModule.taskbarEditModule) {
4948
+ this.parent.editModule.taskbarEditModule['previousLeftValue'] = 0;
4949
+ }
4936
4950
  if (this.parent.allowRowDragAndDrop) {
4937
4951
  var ganttDragElemet = this.parent.element.querySelector('.e-ganttdrag');
4938
4952
  if (ganttDragElemet) {
@@ -5079,6 +5093,14 @@ var GanttChart = /** @__PURE__ @class */ (function () {
5079
5093
  if (this.parent.allowFiltering && this.parent.filterModule) {
5080
5094
  this.parent.filterModule.closeFilterOnContextClick(e.srcElement);
5081
5095
  }
5096
+ if (this.parent.allowTaskbarDragAndDrop) {
5097
+ var Check = this.parent.chartPane.querySelector('.e-clone-taskbar');
5098
+ if (!isNullOrUndefined(Check)) {
5099
+ var clonetbody = Check.parentElement;
5100
+ var cloneTable = clonetbody.parentElement;
5101
+ cloneTable.remove();
5102
+ }
5103
+ }
5082
5104
  };
5083
5105
  /**
5084
5106
  * Method to trigger while perform mouse move on Gantt.
@@ -11244,7 +11266,12 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
11244
11266
  if (!tr) {
11245
11267
  tr = this.ganttChartTableBody.childNodes[rowIndex];
11246
11268
  }
11247
- tr['style'].height = this.parent.treeGrid.getRowByIndex(rowIndex)['style'].height = this.parent.rowHeight + 'px';
11269
+ if (this.parent.ganttChartModule.isExpandAll || this.parent.ganttChartModule.isCollapseAll) {
11270
+ tr['style'].height = this.parent.treeGrid.getRowByIndex(rowIndex)['style'].height = this.parent.rowHeight + 'px';
11271
+ }
11272
+ else {
11273
+ tr['style'].height = this.parent.treeGrid.getRows()[rowIndex]['style'].height = this.parent.rowHeight + 'px';
11274
+ }
11248
11275
  this.parent.contentHeight = treeGridContentHeight;
11249
11276
  var rowIDs = [];
11250
11277
  var rowCounts = 0;
@@ -11261,7 +11288,12 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
11261
11288
  rowCounts++;
11262
11289
  tr.children[0]['style'].verticalAlign = 'baseline';
11263
11290
  tr.getElementsByClassName('e-taskbar-main-container')[k]['style'].marginTop = (rowCounts * this.parent.rowHeight) + this.taskBarMarginTop + 'px';
11264
- tr['style'].height = this.parent.treeGrid.getRowByIndex(rowIndex)['style'].height = parseInt(tr['style'].height) + this.parent.rowHeight + 'px';
11291
+ if (this.parent.ganttChartModule.isExpandAll || this.parent.ganttChartModule.isCollapseAll) {
11292
+ tr['style'].height = this.parent.treeGrid.getRowByIndex(rowIndex)['style'].height = parseInt(tr['style'].height) + this.parent.rowHeight + 'px';
11293
+ }
11294
+ else {
11295
+ tr['style'].height = this.parent.treeGrid.getRows()[rowIndex]['style'].height = parseInt(tr['style'].height) + this.parent.rowHeight + 'px';
11296
+ }
11265
11297
  }
11266
11298
  }
11267
11299
  else {
@@ -11294,7 +11326,12 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
11294
11326
  if (index !== -1 && selectedItem) {
11295
11327
  var data = selectedItem;
11296
11328
  if (!this.parent.allowTaskbarOverlap && this.parent.viewType === 'ResourceView' && data.expanded) {
11297
- tr['style'].height = this.parent.treeGrid.getRowByIndex(index)['style'].height = this.parent.rowHeight + 'px';
11329
+ if (this.parent.ganttChartModule.isExpandAll || this.parent.ganttChartModule.isCollapseAll) {
11330
+ tr['style'].height = this.parent.treeGrid.getRowByIndex(index)['style'].height = this.parent.rowHeight + 'px';
11331
+ }
11332
+ else {
11333
+ tr['style'].height = this.parent.treeGrid.getRows()[index]['style'].height = this.parent.rowHeight + 'px';
11334
+ }
11298
11335
  }
11299
11336
  if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && !data.expanded && this.parent.enableMultiTaskbar) {
11300
11337
  tr.replaceChild(this.getResourceParent(data).childNodes[0], tr.childNodes[0]);
@@ -11355,8 +11392,14 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
11355
11392
  addClass([cloneElement], 'collpse-parent-border');
11356
11393
  var id = tRow.querySelector('.' + taskBarMainContainer).getAttribute('rowUniqueId');
11357
11394
  var ganttData = this.parent.getRecordByID(id);
11358
- var mainTaskbar = (cloneElement.querySelector('.e-gantt-child-taskbar'));
11359
- if (this.parent.queryTaskbarInfo) {
11395
+ if (!(isNullOrUndefined(ganttData)) && ganttData.ganttProperties.segments && ganttData.ganttProperties.segments.length > 0) {
11396
+ var segmentedTasks = cloneElement.getElementsByClassName('e-segmented-taskbar');
11397
+ for (var i = 0; i < segmentedTasks.length; i++) {
11398
+ this.triggerQueryTaskbarInfoByIndex(segmentedTasks[i], ganttData);
11399
+ }
11400
+ }
11401
+ else if (this.parent.queryTaskbarInfo) {
11402
+ var mainTaskbar = (cloneElement.querySelector('.e-gantt-child-taskbar'));
11360
11403
  this.triggerQueryTaskbarInfoByIndex(mainTaskbar, ganttData);
11361
11404
  }
11362
11405
  var zIndex = "";
@@ -12880,7 +12923,9 @@ var ConnectorLine = /** @__PURE__ @class */ (function () {
12880
12923
  }
12881
12924
  }
12882
12925
  }
12883
- heightValue = Math.abs(parentOverlapTopValue - childOverlapTopValue);
12926
+ if (!this.parent.enableVirtualization) {
12927
+ heightValue = Math.abs(parentOverlapTopValue - childOverlapTopValue);
12928
+ }
12884
12929
  }
12885
12930
  if (this.parent.currentViewData[data.parentIndex] && this.parent.currentViewData[data.childIndex] && this.parent.allowParentDependency) {
12886
12931
  var fromRecordIsParent = this.parent.currentViewData[data.parentIndex].hasChildRecords;
@@ -12971,6 +13016,9 @@ var ConnectorLine = /** @__PURE__ @class */ (function () {
12971
13016
  d: this.arrowPath,
12972
13017
  class: connectorLineArrow
12973
13018
  });
13019
+ var outlineColor = (this.lineColor) && !(this.parent.enableCriticalPath) ? this.lineColor : '';
13020
+ this.connectorPath.setAttribute('style', "stroke: " + outlineColor);
13021
+ this.arrowlinePath.setAttribute('style', "fill: " + outlineColor);
12974
13022
  // Append the path element to the group element
12975
13023
  this.groupObject.appendChild(this.connectorPath);
12976
13024
  this.groupObject.appendChild(this.arrowlinePath);
@@ -19108,6 +19156,8 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
19108
19156
  __extends$20(TaskbarEdit, _super);
19109
19157
  function TaskbarEdit(ganttObj) {
19110
19158
  var _this = _super.call(this, ganttObj) || this;
19159
+ _this.leftValue = 0;
19160
+ _this.previousLeftValue = 0;
19111
19161
  _this.isMouseDragged = false;
19112
19162
  _this.dependencyCancel = false;
19113
19163
  _this.editElement = null;
@@ -19119,7 +19169,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
19119
19169
  _this.currentItemTop = 0;
19120
19170
  _this.currentItemPrevTop = 0;
19121
19171
  _this.topValue = 0;
19122
- _this.draggedRecordMarginTop = 0;
19172
+ _this.draggedRecordMarginTop = '0px';
19123
19173
  _this.parent = ganttObj;
19124
19174
  _this.initPublicProp();
19125
19175
  _this.wireEvents();
@@ -19590,17 +19640,6 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
19590
19640
  this.mouseDownY = this.dragMoveY = e.pageY - containerPosition.top +
19591
19641
  this.parent.ganttChartModule.scrollObject.previousScroll.top;
19592
19642
  }
19593
- if (this.parent.viewType == "ResourceView" && this.parent.allowTaskbarDragAndDrop) {
19594
- var toolbarHeight = 0;
19595
- if (!isNullOrUndefined(this.parent.toolbarModule) && !isNullOrUndefined(this.parent.toolbarModule.element)) {
19596
- toolbarHeight = this.parent.toolbarModule.element.offsetHeight;
19597
- }
19598
- this.topValue = this.parent.getOffsetRect(event.target).top - this.parent.getOffsetRect(this.parent.element).top -
19599
- parseInt((closest(event.target, '.e-taskbar-main-container'))['style'].marginTop) -
19600
- this.parent.element.getElementsByClassName('e-timeline-header-container')[0]['offsetHeight'] -
19601
- toolbarHeight + document.getElementsByClassName('e-chart-scroll-container e-content')[0].scrollTop;
19602
- this.currentItemPrevTop = this.currentItemTop = this.topValue;
19603
- }
19604
19643
  if (this.taskBarEditAction === 'ConnectorPointLeftDrag' || this.taskBarEditAction === 'ConnectorPointRightDrag') {
19605
19644
  this.fromPredecessorText = this.taskBarEditAction === 'ConnectorPointLeftDrag' ? 'start' : 'finish';
19606
19645
  this.parent.connectorLineModule.tooltipTable.innerHTML = this.parent.connectorLineModule.getConnectorLineTooltipInnerTd(this.taskBarEditRecord.ganttProperties.taskName, this.fromPredecessorText, '', '');
@@ -19664,7 +19703,12 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
19664
19703
  currentElement.parentElement.appendChild(this.taskbarElement);
19665
19704
  }
19666
19705
  else {
19667
- currentElement.appendChild(this.taskbarElement);
19706
+ if (this.parent.allowTaskbarDragAndDrop && this.taskBarEditAction !== 'LeftResizing' && this.taskBarEditAction !== 'RightResizing' && this.taskBarEditAction !== 'ProgressResizing') {
19707
+ this.parent.chartPane.getElementsByClassName('e-gantt-chart')[0].appendChild(this.taskbarElement);
19708
+ }
19709
+ else {
19710
+ currentElement.appendChild(this.taskbarElement);
19711
+ }
19668
19712
  }
19669
19713
  if (this.taskBarEditAction !== 'ProgressResizing') {
19670
19714
  var rootElement = this.parent.ganttChartModule.chartBodyContainer.querySelectorAll(".e-chart-rows-container");
@@ -19747,26 +19791,40 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
19747
19791
  this.triggerDependencyEvent(e);
19748
19792
  this.drawFalseLine();
19749
19793
  }
19750
- if (this.parent.viewType == 'ResourceView' && this.parent.allowTaskbarDragAndDrop) {
19751
- if (this.dragMoveY > this.mouseMoveY) {
19752
- this.mouseMoveY = this.dragMoveY - this.mouseMoveY;
19753
- this.currentItemTop = this.currentItemTop - this.mouseMoveY;
19754
- }
19755
- else {
19756
- this.mouseMoveY -= this.dragMoveY;
19757
- this.currentItemTop = this.currentItemTop + this.mouseMoveY;
19758
- }
19759
- var containerPosition = this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);
19760
- if (this.parent.isAdaptive || e.touches) {
19761
- this.dragMoveY = e.touches[0].pageY - containerPosition.top + this.parent.ganttChartModule.scrollObject.previousScroll.top;
19794
+ if (this.parent.viewType == 'ResourceView' && this.parent.allowTaskbarDragAndDrop && this.taskBarEditAction !== 'LeftResizing' && this.taskBarEditAction !== 'RightResizing' && this.taskBarEditAction !== 'ProgressResizing') {
19795
+ var parentClientRect = this.parent.getOffsetRect(this.parent.chartPane);
19796
+ var coordinates = this.getCoordinate(e);
19797
+ var position = { top: coordinates.pageY, left: coordinates.pageX };
19798
+ var pos = { left: Math.abs(position.left - parentClientRect.left), top: position.top - parentClientRect.top };
19799
+ var parentRecord = this.parent.getRecordByID(this.taskBarEditRecord.parentItem.taskId);
19800
+ if (!this.parent.allowTaskbarOverlap && this.taskBarEditRecord.parentItem && !parentRecord.expanded) {
19801
+ var reduceHeight = 0;
19802
+ if (parseInt(this.editElement['style'].marginTop) > this.parent.rowHeight) {
19803
+ for (var i = 0; i < parentRecord.childRecords.length; i++) {
19804
+ if (parentRecord.childRecords[i].ganttProperties.taskId !== this.taskBarEditRecord.ganttProperties.taskId) {
19805
+ reduceHeight = reduceHeight + this.parent.rowHeight;
19806
+ }
19807
+ else {
19808
+ break;
19809
+ }
19810
+ }
19811
+ pos.top = pos.top - reduceHeight;
19812
+ }
19762
19813
  }
19763
- else {
19764
- this.dragMoveY = e.pageY - containerPosition.top + this.parent.ganttChartModule.scrollObject.previousScroll.top;
19814
+ this.topValue = pos.top;
19815
+ this.leftValue = pos.left - (e.pageX - this.parent.getOffsetRect(this.taskBarEditElement).left) + (this.previousLeftValue !== 0 ? e.pageX - this.previousLeftValue : 0);
19816
+ if (this.previousLeftValue == 0) {
19817
+ if (!this.parent.enableRtl) {
19818
+ this.leftValue = this.leftValue - this.parent.ganttChartModule.scrollObject.previousScroll.left + 4;
19819
+ }
19820
+ else {
19821
+ this.leftValue = this.leftValue + Math.abs(this.parent.ganttChartModule.scrollObject.previousScroll.left) + 4;
19822
+ }
19765
19823
  }
19766
- this.topValue = this.currentItemTop;
19767
- this.currentItemPrevTop = (this.currentItemPrevTop === 0 ||
19768
- this.topValue == this.currentItemTop) ? this.topValue :
19769
- this.currentItemPrevTop;
19824
+ this.previousLeftValue = e.pageX;
19825
+ }
19826
+ else {
19827
+ this.leftValue = this.taskBarEditRecord.ganttProperties.left;
19770
19828
  }
19771
19829
  this.setItemPosition();
19772
19830
  this.updateEditedItem();
@@ -20655,7 +20713,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
20655
20713
  }
20656
20714
  }
20657
20715
  }
20658
- taskBarMainContainer$$1.style.setProperty(position, (item.left) + 'px');
20716
+ taskBarMainContainer$$1.style.setProperty(position, (this.parent.allowTaskbarDragAndDrop ? this.leftValue : (item.left)) + 'px');
20659
20717
  taskBarMainContainer$$1.style.width = (width) + 'px';
20660
20718
  if (segmentedTaskBarContainer && segmentConnectorPointRight) {
20661
20719
  segmentConnectorPointRight.style.left = (this.parent.isAdaptive ? (width + 10) : (width + 2)) + 'px';
@@ -20675,7 +20733,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
20675
20733
  segmentElement.style.width = (segment_4.width) + 'px';
20676
20734
  if (i === 0) {
20677
20735
  resizeLine.style.width = (segment_4.width) + "px";
20678
- resizeLine.style.left = (segment_4.left + item.left) + "px";
20736
+ resizeLine.style.setProperty(position, (segment_4.left + item.left) + 'px');
20679
20737
  }
20680
20738
  if (this.parent.enableRtl) {
20681
20739
  segmentElement.style.right = (segment_4.left) + 'px';
@@ -20687,7 +20745,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
20687
20745
  }
20688
20746
  if (this.taskBarEditAction === 'ChildDrag' && this.segmentIndex === 0) {
20689
20747
  resizeLine.style.width = (width) + "px";
20690
- resizeLine.style.left = (item.left) + "px";
20748
+ resizeLine.style.setProperty(position, item.left + 'px');
20691
20749
  taskBarMainContainer$$1.style.setProperty("opacity", '.75');
20692
20750
  }
20693
20751
  }
@@ -20701,7 +20759,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
20701
20759
  }
20702
20760
  if (this.taskBarEditAction === 'MilestoneDrag' || item.isMilestone) {
20703
20761
  taskBarMainContainer$$1.style.setProperty(position, (item.left - (width / 2)) + 'px');
20704
- resizeLine.style.left = (item.left - (width / 2)) + 'px';
20762
+ resizeLine.style.setProperty(position, (item.left - (width / 2)) + 'px');
20705
20763
  resizeLine.style.width = (width) + "px";
20706
20764
  }
20707
20765
  else if (this.taskBarEditAction === 'ProgressResizing') {
@@ -20736,7 +20794,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
20736
20794
  }
20737
20795
  }
20738
20796
  else if (this.taskBarEditAction === 'ParentDrag') {
20739
- resizeLine.style.left = (item.left) + 'px';
20797
+ resizeLine.style.setProperty(position, item.left + 'px');
20740
20798
  resizeLine.style.width = (width) + "px";
20741
20799
  resizeLine.style.width = (item.width) + 'px';
20742
20800
  if (!isNullOrUndefined(traceParentTaskBar$$1)) {
@@ -20749,13 +20807,13 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
20749
20807
  }
20750
20808
  else if (this.taskBarEditAction === 'ParentResizing') {
20751
20809
  resizeLine.style.width = (item.width) + 'px';
20752
- resizeLine.style.left = item.left + 'px';
20810
+ resizeLine.style.setProperty(position, item.left + 'px');
20753
20811
  manualParentTaskbar.style.width = manualTaskbar.style.width = (item.width) + 'px';
20754
20812
  manualParentRight.style.setProperty(position, item.width - manualParentLeft.offsetLeft + 'px');
20755
20813
  }
20756
20814
  else if (this.taskBarEditAction === 'ManualParentDrag') {
20757
20815
  resizeLine.style.width = (item.width) + 'px';
20758
- resizeLine.style.left = item.left + 'px';
20816
+ resizeLine.style.setProperty(position, item.left + 'px');
20759
20817
  manualParentTaskbar.style.setProperty(position, item.left - item.autoLeft + 'px');
20760
20818
  }
20761
20819
  else {
@@ -20763,8 +20821,8 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
20763
20821
  traceChildTaskBar$$1.style.width = (item.width) + 'px';
20764
20822
  traceChildTaskBar$$1.style.left = (item.left) + 'px';
20765
20823
  this.taskBarEditElement.style.width = (item.width) + 'px';
20766
- this.taskBarEditElement.style.left = (item.left) + "px";
20767
- resizeLine.style.left = (item.left) + 'px';
20824
+ this.taskBarEditElement.style.left = ((this.parent.allowTaskbarDragAndDrop ? this.leftValue : (item.left))) + "px";
20825
+ resizeLine.style.setProperty(position, item.left + 'px');
20768
20826
  resizeLine.style.width = (item.width) + "px";
20769
20827
  }
20770
20828
  if (!isNullOrUndefined(traceChildProgressBar$$1)) {
@@ -20798,6 +20856,13 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
20798
20856
  if (this.taskBarEditAction && this.isMouseDragged) {
20799
20857
  if ((!this.dragMouseLeave && this.taskBarEditedAction) || (this.parent.viewType === 'ResourceView' &&
20800
20858
  this.parent.allowTaskbarDragAndDrop)) {
20859
+ if (e.type === 'touchmove' || e.type === 'touchstart' || e.type === 'touchend') {
20860
+ var coordinates = this.getCoordinate(e);
20861
+ this['droppedTarget'] = document.elementFromPoint(coordinates.pageX, coordinates.pageY);
20862
+ }
20863
+ else {
20864
+ this['droppedTarget'] = document.elementFromPoint(e.x, e.y);
20865
+ }
20801
20866
  this.taskBarEditedAction(e);
20802
20867
  this.isMouseDragged = false;
20803
20868
  }
@@ -20908,7 +20973,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
20908
20973
  var args = extend({}, arg);
20909
20974
  var ganttRecord = args.data;
20910
20975
  var taskData = ganttRecord.ganttProperties;
20911
- var draggedRecIndex = this.parent.currentViewData.indexOf(ganttRecord);
20976
+ var draggedRecIndex = this.parent.flatData.indexOf(ganttRecord);
20912
20977
  if ((args.taskBarEditAction === 'MilestoneDrag' || args.taskBarEditAction === 'ChildDrag') && this.parent.viewType === "ResourceView"
20913
20978
  && this.parent.allowTaskbarDragAndDrop && this.dragMoveY > 0) {
20914
20979
  if (this.parent.rowDragAndDropModule) {
@@ -20916,45 +20981,13 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
20916
20981
  if (flatRecordCol[this.taskBarEditRecord.parentItem.index] && ((this.parent.editedRecords.indexOf(flatRecordCol[this.taskBarEditRecord.parentItem.index]) === -1))) {
20917
20982
  this.parent.editedRecords.push(flatRecordCol[this.taskBarEditRecord.parentItem.index]);
20918
20983
  }
20919
- var ganttrec = void 0;
20920
- var resHeight = 0;
20921
- var rowCount = 0;
20922
- var childIndex_1;
20923
- var droppedRecord = void 0;
20924
- var treeGridrows = this.parent.treeGrid.getRows().length;
20925
- for (var i = 0; i < treeGridrows; i++) {
20926
- if (resHeight < this.dragMoveY && this.parent.getRowByIndex(i).style.display !== 'none') {
20927
- rowCount = i;
20928
- resHeight = resHeight + parseInt(this.parent.getRowByIndex(i).style.height);
20929
- if (!flatRecordCol[i].parentItem) {
20930
- ganttrec = flatRecordCol[i];
20931
- }
20932
- else {
20933
- ganttrec = this.parent.getRecordByID(flatRecordCol[i].parentItem.taskId);
20934
- }
20935
- }
20936
- }
20937
- var draggedRecordtaskbar = this.parent.getRowByIndex(draggedRecIndex).getElementsByClassName('e-taskbar-main-container');
20938
- var taskbarContainer = this.parent.getRowByIndex(rowCount).getElementsByClassName('e-taskbar-main-container');
20939
- for (var j = 0; j < taskbarContainer.length; j++) {
20940
- if (taskbarContainer[j]['offsetTop'] < this.dragMoveY && draggedRecordtaskbar[0].getAttribute('rowuniqueid') !==
20941
- taskbarContainer[j].getAttribute('rowuniqueid')) {
20942
- this.draggedRecordMarginTop = taskbarContainer[j]['style'].marginTop;
20943
- childIndex_1 = taskbarContainer[j].getAttribute('rowuniqueid');
20944
- }
20945
- }
20946
- if (childIndex_1) {
20947
- droppedRecord = this.parent.currentViewData.filter(function (data) {
20948
- if (data['rowUniqueID'] === childIndex_1) {
20949
- return data;
20950
- }
20951
- else {
20952
- return null;
20953
- }
20954
- });
20955
- }
20956
- if (droppedRecord) {
20957
- var droppedRecordIndex = this.parent.currentViewData.indexOf(droppedRecord[0]);
20984
+ var droppedRecord = [];
20985
+ this.draggedRecordMarginTop = this.taskBarEditElement.style.marginTop;
20986
+ var row = closest(this.droppedTarget, 'tr.' + chartRow);
20987
+ var recordIndex = parseInt(row.getAttribute('aria-rowindex'));
20988
+ droppedRecord.push(this.parent.flatData[recordIndex]);
20989
+ if (droppedRecord.length > 0) {
20990
+ var droppedRecordIndex = this.parent.flatData.indexOf(droppedRecord[0]);
20958
20991
  var position = (droppedRecord[0].hasChildRecords || (!droppedRecord[0].parentItem &&
20959
20992
  droppedRecord[0].childRecords.length == 0)) ? 'child' : 'below';
20960
20993
  if (this.parent.rowDragAndDropModule) {
@@ -25237,6 +25270,13 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
25237
25270
  if (ganttData.ganttProperties.baselineEndDate && ganttData.ganttProperties.baselineEndDate.getHours() === 0 && this.parent.defaultEndTime !== 86400) {
25238
25271
  ganttObj.dataOperation.setTime(this.parent.defaultEndTime, ganttData.ganttProperties.baselineEndDate);
25239
25272
  }
25273
+ if ((ganttData.ganttProperties.baselineStartDate && ganttData.ganttProperties.baselineEndDate &&
25274
+ (ganttData.ganttProperties.baselineStartDate.getTime() > ganttData.ganttProperties.baselineEndDate.getTime())) ||
25275
+ ((!isNullOrUndefined(ganttData.ganttProperties.baselineStartDate) && !isNullOrUndefined(ganttData.ganttProperties.startDate) && (ganttData.ganttProperties.baselineStartDate.getTime() === ganttData.ganttProperties.startDate.getTime()))
25276
+ && (!isNullOrUndefined(ganttData.ganttProperties.baselineEndDate) && !isNullOrUndefined(ganttData.ganttProperties.endDate) && (ganttData.ganttProperties.baselineEndDate.toLocaleDateString() === ganttData.ganttProperties.endDate.toLocaleDateString())) &&
25277
+ ganttData.ganttProperties.isMilestone)) {
25278
+ ganttData.ganttProperties.baselineEndDate = ganttData.ganttProperties.baselineStartDate;
25279
+ }
25240
25280
  ganttObj.setRecordValue('baselineEndDate', ganttObj.dataOperation.checkBaselineEndDate(ganttData.ganttProperties.baselineEndDate), ganttData.ganttProperties, true);
25241
25281
  ganttObj.setRecordValue('baselineLeft', ganttObj.dataOperation.calculateBaselineLeft(ganttData.ganttProperties), ganttData.ganttProperties, true);
25242
25282
  ganttObj.setRecordValue('baselineWidth', ganttObj.dataOperation.calculateBaselineWidth(ganttData.ganttProperties), ganttData.ganttProperties, true);
@@ -26024,7 +26064,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
26024
26064
  this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['endDate'] = rec[this.parent.taskFields.endDate];
26025
26065
  }
26026
26066
  if (this.parent.taskFields.duration !== null) {
26027
- this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['duration'] = parseInt(rec[this.parent.taskFields.duration]);
26067
+ this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['duration'] = parseFloat(rec[this.parent.taskFields.duration]);
26028
26068
  }
26029
26069
  if (this.parent.taskFields.durationUnit !== null) {
26030
26070
  this.parent.editedRecords[parseInt(i.toString(), 10)].ganttProperties['durationUnit'] = rec[this.parent.taskFields.durationUnit];
@@ -26113,6 +26153,9 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
26113
26153
  this.parent.editModule.dialogModule.previousResource = [];
26114
26154
  }
26115
26155
  if (!this.isTreeGridRefresh) {
26156
+ if (this.parent.editSettings.allowEditing && this.parent.treeGrid.element.getElementsByClassName('e-editedbatchcell').length > 0) {
26157
+ this.parent.treeGrid.endEdit();
26158
+ }
26116
26159
  this.parent.chartRowsModule.refreshRecords(this.parent.editedRecords);
26117
26160
  if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && this.parent.showOverAllocation) {
26118
26161
  this.parent.contentHeight = this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
@@ -27650,7 +27693,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
27650
27693
  args.data.ganttProperties['endDate'] = serverReturnedValue[this.parent.taskFields.endDate];
27651
27694
  }
27652
27695
  if (this.parent.taskFields.duration !== null) {
27653
- args.data.ganttProperties['duration'] = parseInt(serverReturnedValue[this.parent.taskFields.duration]);
27696
+ args.data.ganttProperties['duration'] = parseFloat(serverReturnedValue[this.parent.taskFields.duration]);
27654
27697
  }
27655
27698
  if (this.parent.taskFields.durationUnit !== null) {
27656
27699
  args.data.ganttProperties['durationUnit'] = serverReturnedValue[this.parent.taskFields.durationUnit];
@@ -31324,8 +31367,8 @@ var CriticalPath = /** @__PURE__ @class */ (function () {
31324
31367
  if (record.ganttProperties.progress < 100) {
31325
31368
  record.isCritical = true;
31326
31369
  record.ganttProperties.isCritical = true;
31327
- if (criticalPathIds.indexOf(parseInt(record.ganttProperties.taskId)) == -1) {
31328
- criticalPathIds.push(parseInt(record.ganttProperties.taskId));
31370
+ if (criticalPathIds.indexOf(record.ganttProperties.taskId) == -1) {
31371
+ criticalPathIds.push(record.ganttProperties.taskId);
31329
31372
  }
31330
31373
  }
31331
31374
  }
@@ -31347,9 +31390,12 @@ var CriticalPath = /** @__PURE__ @class */ (function () {
31347
31390
  fromRecord.slack = record.slack;
31348
31391
  fromRecord.isCritical = record.ganttProperties.isCritical;
31349
31392
  fromRecord.ganttProperties.isCritical = record.ganttProperties.isCritical;
31350
- if (criticalPathIds.indexOf(parseInt(fromRecord.ganttProperties.taskId)) == -1 && fromRecord.ganttProperties.isCritical && fromRecord.ganttProperties.progress < 100) {
31393
+ if (criticalPathIds.indexOf(fromRecord.ganttProperties.taskId) === -1 && fromRecord.ganttProperties.isCritical && fromRecord.ganttProperties.progress < 100) {
31394
+ criticalPathIds.push(fromRecord.ganttProperties.taskId);
31351
31395
  this.validatedids.push(parseInt(fromRecord.ganttProperties.taskId));
31352
- criticalPathIds.push(parseInt(fromRecord.ganttProperties.taskId));
31396
+ if (this.criticalTasks.indexOf(fromRecord) === -1) {
31397
+ this.criticalTasks.push(fromRecord);
31398
+ }
31353
31399
  }
31354
31400
  if (fromRecord.ganttProperties.predecessorsName) {
31355
31401
  this.updateCriticalTasks(fromRecord, criticalPathIds);
@@ -31434,7 +31480,9 @@ var CriticalPath = /** @__PURE__ @class */ (function () {
31434
31480
  if (flatRecords[index].ganttProperties.progress < 100) {
31435
31481
  flatRecords[index].isCritical = true;
31436
31482
  flatRecords[index].ganttProperties.isCritical = true;
31437
- this.criticalTasks.push(flatRecords[index]);
31483
+ if (this.criticalTasks.indexOf(flatRecords[index]) == -1) {
31484
+ this.criticalTasks.push(flatRecords[index]);
31485
+ }
31438
31486
  if (criticalPathIds.indexOf(collection[x]['taskid']) === -1) {
31439
31487
  criticalPathIds.push(collection[x]['taskid']);
31440
31488
  }
@@ -32918,12 +32966,12 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
32918
32966
  RowDD$$1.prototype.deleteSharedResourceTask = function () {
32919
32967
  for (var i = 0; i < this.parent.getTaskIds().length; i++) {
32920
32968
  if (this.parent.getTaskIds()[i] === 'T' + this.draggedRecord.ganttProperties.taskId) {
32921
- if (this.parent.getTaskByUniqueID(this.parent.currentViewData[i].parentItem.uniqueID).ganttProperties.taskName !== 'Unassigned Task') {
32922
- this.removeRecords(this.parent.currentViewData[i]);
32969
+ if (this.parent.getTaskByUniqueID(this.parent.flatData[i].parentItem.uniqueID).ganttProperties.taskName !== 'Unassigned Task') {
32970
+ this.removeRecords(this.parent.flatData[i]);
32923
32971
  }
32924
32972
  /* eslint-disable-next-line */
32925
- if (!isNullOrUndefined(this.parent.currentViewData[i].parentItem && this.updateParentRecords.indexOf(this.parent.currentViewData[i].parentItem) !== -1)) {
32926
- this.updateParentRecords.push(this.parent.currentViewData[i].parentItem);
32973
+ if (!isNullOrUndefined(this.parent.flatData[i].parentItem && this.updateParentRecords.indexOf(this.parent.flatData[i].parentItem) !== -1)) {
32974
+ this.updateParentRecords.push(this.parent.flatData[i].parentItem);
32927
32975
  }
32928
32976
  }
32929
32977
  }
@@ -32947,7 +32995,7 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
32947
32995
  this.parent.editModule.updateGanttProperties(this.draggedRecord, this.parent.flatData[i]);
32948
32996
  this.parent.dataOperation.updateTaskData(this.parent.flatData[i]);
32949
32997
  /* eslint-disable-next-line */
32950
- if (!isNullOrUndefined(this.parent.flatData[i].parentItem && this.updateParentRecords.indexOf(this.parent.currentViewData[i].parentItem) !== -1)) {
32998
+ if (!isNullOrUndefined(this.parent.flatData[i].parentItem && this.updateParentRecords.indexOf(this.parent.flatData[i].parentItem) !== -1)) {
32951
32999
  this.updateParentRecords.push(this.parent.flatData[i].parentItem);
32952
33000
  }
32953
33001
  }
@@ -33378,7 +33426,7 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
33378
33426
  }
33379
33427
  var data = [];
33380
33428
  for (var i = 0; i < fromIndexes.length; i++) {
33381
- data[i] = this.parent.updatedRecords[fromIndexes[i]];
33429
+ data[i] = this.parent.flatData[fromIndexes[i]];
33382
33430
  }
33383
33431
  var isByMethod = true;
33384
33432
  var args = {
@@ -35955,10 +36003,10 @@ var ExportHelper = /** @__PURE__ @class */ (function () {
35955
36003
  this.parent.predecessorModule.createConnectorLinesCollection();
35956
36004
  this.parent.updatedConnectorLineCollection.forEach(function (data) {
35957
36005
  var predecessor = _this.gantt.predecessor.add();
35958
- predecessor.parentLeft = data.parentLeft;
35959
- predecessor.childLeft = data.childLeft;
35960
- predecessor.parentWidth = data.parentWidth;
35961
- predecessor.childWidth = data.childWidth;
36006
+ predecessor.parentLeft = pointToPixel(data.parentLeft);
36007
+ predecessor.childLeft = pointToPixel(data.childLeft);
36008
+ predecessor.parentWidth = pointToPixel(data.parentWidth);
36009
+ predecessor.childWidth = pointToPixel(data.childWidth);
35962
36010
  predecessor.parentIndex = data.parentIndex;
35963
36011
  predecessor.childIndex = data.childIndex;
35964
36012
  predecessor.rowHeight = data.rowHeight;
@@ -36043,8 +36091,8 @@ var ExportHelper = /** @__PURE__ @class */ (function () {
36043
36091
  flatData.forEach(function (data) {
36044
36092
  var taskbar = _this.gantt.taskbar.add();
36045
36093
  var ganttProp = data.ganttProperties;
36046
- taskbar.left = ganttProp.left;
36047
- taskbar.width = ganttProp.width;
36094
+ taskbar.left = pointToPixel(ganttProp.left);
36095
+ taskbar.width = pointToPixel(ganttProp.width);
36048
36096
  if (taskbar.left < 0) {
36049
36097
  taskbar.width = taskbar.width + taskbar.left;
36050
36098
  taskbar.left = 0;
@@ -36085,8 +36133,8 @@ var ExportHelper = /** @__PURE__ @class */ (function () {
36085
36133
  taskbar.isMilestone = ganttProp.isMilestone;
36086
36134
  taskbar.baselineStartDate = ganttProp.baselineStartDate;
36087
36135
  taskbar.baselineEndDate = ganttProp.baselineEndDate;
36088
- taskbar.baselineLeft = ganttProp.baselineLeft;
36089
- taskbar.baselineWidth = ganttProp.baselineWidth;
36136
+ taskbar.baselineLeft = pointToPixel(ganttProp.baselineLeft);
36137
+ taskbar.baselineWidth = pointToPixel(ganttProp.baselineWidth);
36090
36138
  taskbar.milestoneColor = new PdfColor(_this.ganttStyle.taskbar.milestoneColor);
36091
36139
  taskbar.isParentTask = data.hasChildRecords;
36092
36140
  if (ganttProp.isMilestone) {
@@ -36102,9 +36150,9 @@ var ExportHelper = /** @__PURE__ @class */ (function () {
36102
36150
  taskbar.taskLabel = data[_this.parent.labelSettings.taskLabel].toString();
36103
36151
  }
36104
36152
  var reduceLeft = ganttProp.isMilestone ? Math.floor(_this.parent.chartRowsModule.taskBarHeight / 2) + 33 : 33; // 33 indicates default timeline cell width
36105
- taskbar.rightTaskLabel.left = ganttProp.left + ganttProp.width + reduceLeft; // right label left value
36153
+ taskbar.rightTaskLabel.left = pointToPixel(ganttProp.left) + pointToPixel(ganttProp.width) + reduceLeft; // right label left value
36106
36154
  taskbar.fontFamily = _this.ganttStyle.fontFamily;
36107
- taskbar.progressWidth = ganttProp.progressWidth;
36155
+ taskbar.progressWidth = pointToPixel(ganttProp.progressWidth);
36108
36156
  taskbar.labelColor = new PdfColor(_this.ganttStyle.label.fontColor);
36109
36157
  taskbar.progressFontColor = new PdfColor(_this.ganttStyle.taskbar.progressFontColor);
36110
36158
  if (taskbar.isParentTask) {