@syncfusion/ej2-gantt 20.4.53 → 21.1.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +1 -1
  3. package/dist/ej2-gantt.min.js +2 -2
  4. package/dist/ej2-gantt.umd.min.js +2 -2
  5. package/dist/ej2-gantt.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-gantt.es2015.js +1104 -450
  7. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  8. package/dist/es6/ej2-gantt.es5.js +1084 -430
  9. package/dist/es6/ej2-gantt.es5.js.map +1 -1
  10. package/dist/global/ej2-gantt.min.js +2 -2
  11. package/dist/global/ej2-gantt.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/package.json +20 -20
  14. package/src/gantt/actions/cell-edit.js +8 -6
  15. package/src/gantt/actions/chart-scroll.d.ts +1 -0
  16. package/src/gantt/actions/chart-scroll.js +15 -4
  17. package/src/gantt/actions/connector-line-edit.js +39 -28
  18. package/src/gantt/actions/context-menu.js +5 -5
  19. package/src/gantt/actions/critical-path.js +10 -8
  20. package/src/gantt/actions/dependency.js +28 -12
  21. package/src/gantt/actions/dialog-edit.js +41 -21
  22. package/src/gantt/actions/edit.js +56 -55
  23. package/src/gantt/actions/filter.d.ts +2 -1
  24. package/src/gantt/actions/filter.js +88 -2
  25. package/src/gantt/actions/keyboard.js +0 -1
  26. package/src/gantt/actions/pdf-export.d.ts +3 -1
  27. package/src/gantt/actions/pdf-export.js +12 -6
  28. package/src/gantt/actions/rowdragdrop.js +2 -2
  29. package/src/gantt/actions/selection.js +5 -2
  30. package/src/gantt/actions/taskbar-edit.d.ts +5 -0
  31. package/src/gantt/actions/taskbar-edit.js +114 -10
  32. package/src/gantt/base/date-processor.js +78 -52
  33. package/src/gantt/base/gantt-chart.js +20 -4
  34. package/src/gantt/base/gantt-model.d.ts +43 -0
  35. package/src/gantt/base/gantt.d.ts +39 -1
  36. package/src/gantt/base/gantt.js +79 -33
  37. package/src/gantt/base/interface.d.ts +2 -0
  38. package/src/gantt/base/task-processor.js +133 -98
  39. package/src/gantt/base/tree-grid.js +31 -1
  40. package/src/gantt/base/utils.js +1 -1
  41. package/src/gantt/export/export-helper.js +6 -0
  42. package/src/gantt/renderer/chart-rows.d.ts +2 -0
  43. package/src/gantt/renderer/chart-rows.js +156 -24
  44. package/src/gantt/renderer/connector-line.js +50 -20
  45. package/src/gantt/renderer/edit-tooltip.js +0 -3
  46. package/src/gantt/renderer/event-marker.js +4 -1
  47. package/src/gantt/renderer/nonworking-day.js +4 -1
  48. package/src/gantt/renderer/timeline.js +3 -3
  49. package/src/gantt/renderer/tooltip.js +101 -33
  50. package/styles/bootstrap-dark.css +33 -10
  51. package/styles/bootstrap.css +31 -10
  52. package/styles/bootstrap4.css +28 -7
  53. package/styles/bootstrap5-dark.css +30 -9
  54. package/styles/bootstrap5.css +30 -9
  55. package/styles/fabric-dark.css +28 -7
  56. package/styles/fabric.css +28 -7
  57. package/styles/fluent-dark.css +56 -29
  58. package/styles/fluent.css +56 -29
  59. package/styles/gantt/_bootstrap-dark-definition.scss +5 -4
  60. package/styles/gantt/_bootstrap-definition.scss +5 -4
  61. package/styles/gantt/_bootstrap4-definition.scss +3 -2
  62. package/styles/gantt/_bootstrap5-definition.scss +15 -14
  63. package/styles/gantt/_fabric-dark-definition.scss +3 -2
  64. package/styles/gantt/_fabric-definition.scss +3 -2
  65. package/styles/gantt/_fluent-definition.scss +18 -17
  66. package/styles/gantt/_fusionnew-definition.scss +5 -4
  67. package/styles/gantt/_highcontrast-definition.scss +3 -2
  68. package/styles/gantt/_highcontrast-light-definition.scss +3 -2
  69. package/styles/gantt/_layout.scss +45 -13
  70. package/styles/gantt/_material-dark-definition.scss +3 -2
  71. package/styles/gantt/_material-definition.scss +3 -2
  72. package/styles/gantt/_tailwind-definition.scss +9 -8
  73. package/styles/gantt/_theme.scss +25 -6
  74. package/styles/gantt/bootstrap-dark.css +33 -10
  75. package/styles/gantt/bootstrap.css +31 -10
  76. package/styles/gantt/bootstrap4.css +28 -7
  77. package/styles/gantt/bootstrap5-dark.css +30 -9
  78. package/styles/gantt/bootstrap5.css +30 -9
  79. package/styles/gantt/fabric-dark.css +28 -7
  80. package/styles/gantt/fabric.css +28 -7
  81. package/styles/gantt/fluent-dark.css +56 -29
  82. package/styles/gantt/fluent.css +56 -29
  83. package/styles/gantt/highcontrast-light.css +28 -9
  84. package/styles/gantt/highcontrast.css +28 -7
  85. package/styles/gantt/material-dark.css +31 -14
  86. package/styles/gantt/material.css +28 -7
  87. package/styles/gantt/tailwind-dark.css +28 -7
  88. package/styles/gantt/tailwind.css +28 -7
  89. package/styles/highcontrast-light.css +28 -9
  90. package/styles/highcontrast.css +28 -7
  91. package/styles/material-dark.css +31 -14
  92. package/styles/material.css +28 -7
  93. package/styles/tailwind-dark.css +28 -7
  94. package/styles/tailwind.css +28 -7
  95. package/styles/gantt/_material3-definition.scss +0 -218
@@ -1,5 +1,5 @@
1
1
  import { TreeGrid } from '@syncfusion/ej2-treegrid';
2
- import { createElement, isNullOrUndefined, getValue, extend, EventHandler, deleteObject } from '@syncfusion/ej2-base';
2
+ import { createElement, isNullOrUndefined, getValue, extend, EventHandler, deleteObject, remove } from '@syncfusion/ej2-base';
3
3
  import { setValue } from '@syncfusion/ej2-base';
4
4
  import { Deferred, Query } from '@syncfusion/ej2-data';
5
5
  import { Column as GanttColumn } from '../models/column';
@@ -26,6 +26,15 @@ var GanttTreeGrid = /** @class */ (function () {
26
26
  this.columnMenuOpen = function (args) {
27
27
  _this.parent.notify('columnMenuOpen', args);
28
28
  _this.parent.trigger('columnMenuOpen', args);
29
+ document.querySelector(".e-colmenu").addEventListener('mousemove', function (event) {
30
+ var filPopOptions = document.querySelector(".e-filter-popup");
31
+ var filOptions = document.querySelector(".e-filter-item");
32
+ if (!isNullOrUndefined(filPopOptions)) {
33
+ if (!filOptions.classList.contains('e-focused')) {
34
+ remove(_this.parent.filterModule.filterMenuElement);
35
+ }
36
+ }
37
+ });
29
38
  };
30
39
  this.columnMenuClick = function (args) {
31
40
  _this.parent.trigger('columnMenuClick', args);
@@ -57,6 +66,7 @@ var GanttTreeGrid = /** @class */ (function () {
57
66
  this.parent.treeGrid = new TreeGrid();
58
67
  this.parent.treeGrid.allowSelection = false;
59
68
  this.parent.treeGrid.allowKeyboard = this.parent.allowKeyboard;
69
+ this.parent.treeGrid['${enableHtmlSanitizer}'] = this.parent.enableHtmlSanitizer;
60
70
  this.parent.treeGrid.enableImmutableMode = this.parent.enableImmutableMode;
61
71
  this.treeGridColumns = [];
62
72
  if (!this.parent.isLocaleChanged && this.parent.isLoad) {
@@ -247,6 +257,12 @@ var GanttTreeGrid = /** @class */ (function () {
247
257
  if (!this.parent.ganttChartModule.isExpandCollapseFromChart && !this.parent.isExpandCollapseLevelMethod) {
248
258
  var collapsedArgs = this.createExpandCollapseArgs(args);
249
259
  this.parent.ganttChartModule.collapsedGanttRow(collapsedArgs);
260
+ if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && collapsedArgs['gridRow']) {
261
+ collapsedArgs['gridRow'].style.height = collapsedArgs['chartRow'].style.height;
262
+ this.parent.contentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
263
+ this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
264
+ document.getElementsByClassName('e-chart-rows-container')[0]['style'].height = this.parent.contentHeight + 'px';
265
+ }
250
266
  }
251
267
  if (!isNullOrUndefined(this.parent.loadingIndicator) && this.parent.loadingIndicator.indicatorType === "Shimmer") {
252
268
  this.parent.hideMaskRow();
@@ -260,6 +276,12 @@ var GanttTreeGrid = /** @class */ (function () {
260
276
  if (!args['data'].length) {
261
277
  var expandedArgs = this.createExpandCollapseArgs(args);
262
278
  this.parent.ganttChartModule.expandedGanttRow(expandedArgs);
279
+ if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && args['row']) {
280
+ args['row'].style.height = this.parent.rowHeight + 'px';
281
+ this.parent.contentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
282
+ this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
283
+ document.getElementsByClassName('e-chart-rows-container')[0]['style'].height = this.parent.contentHeight + 'px';
284
+ }
263
285
  }
264
286
  }
265
287
  if (!isNullOrUndefined(this.parent.loadingIndicator) && this.parent.loadingIndicator.indicatorType === "Shimmer") {
@@ -352,6 +374,14 @@ var GanttTreeGrid = /** @class */ (function () {
352
374
  this.parent.addDeleteRecord = false;
353
375
  }
354
376
  this.parent.trigger('actionComplete', updatedArgs);
377
+ if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && this.parent.showOverAllocation) {
378
+ for (var i = 0; i < this.parent.currentViewData.length; i++) {
379
+ if (this.parent.currentViewData[i].hasChildRecords && !this.parent.currentViewData[i].expanded) {
380
+ this.parent.chartRowsModule.updateDragDropRecords(this.parent.currentViewData[i]);
381
+ }
382
+ }
383
+ this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData);
384
+ }
355
385
  if (!isNullOrUndefined(this.parent.loadingIndicator) && this.parent.loadingIndicator.indicatorType === "Shimmer") {
356
386
  this.parent.hideMaskRow();
357
387
  }
@@ -139,7 +139,7 @@ export function updateDates(record, parent) {
139
139
  export function formatString(str, args) {
140
140
  var regx;
141
141
  for (var i = 0; i < args.length; i++) {
142
- // eslint-disable-next-line detect-non-literal-regexp
142
+ // eslint-disable-next-line security/detect-non-literal-regexp
143
143
  regx = new RegExp('\\{' + (i) + '\\}', 'gm');
144
144
  str = str.replace(regx, args[i].toString());
145
145
  }
@@ -437,6 +437,12 @@ var ExportHelper = /** @class */ (function () {
437
437
  cell.style.padding.bottom = padding - style.fontSize;
438
438
  cell.style.padding.left = 10;
439
439
  cell.style.padding.right = 10;
440
+ if (style.padding) {
441
+ cell.style.padding = style.padding;
442
+ }
443
+ if (style.borders) {
444
+ cell.style.borders = style.borders;
445
+ }
440
446
  };
441
447
  /**
442
448
  * @param {PdfDocument} pdfDoc .
@@ -268,6 +268,8 @@ export declare class ChartRows extends DateProcessor {
268
268
  * @private
269
269
  */
270
270
  templateCompiler(template: string): Function;
271
+ updateOverlapped(): void;
272
+ updateDragDropRecords(data: IGanttData, tr?: Node): void;
271
273
  /**
272
274
  * To refresh edited TR
273
275
  *
@@ -11,7 +11,7 @@ var __extends = (this && this.__extends) || (function () {
11
11
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
12
  };
13
13
  })();
14
- import { createElement, isNullOrUndefined, extend, compile, getValue, setValue } from '@syncfusion/ej2-base';
14
+ import { createElement, isNullOrUndefined, extend, compile, getValue, setValue, SanitizeHtmlHelper } from '@syncfusion/ej2-base';
15
15
  import { formatUnit, addClass } from '@syncfusion/ej2-base';
16
16
  import { isScheduledTask } from '../base/utils';
17
17
  import { DataManager, Query } from '@syncfusion/ej2-data';
@@ -178,8 +178,12 @@ var ChartRows = /** @class */ (function (_super) {
178
178
  }
179
179
  }
180
180
  else {
181
- labelString = this.getTaskLabel(this.parent.labelSettings.taskLabel);
181
+ var field = this.parent.labelSettings.taskLabel;
182
+ labelString = this.getTaskLabel(field);
182
183
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
184
+ if (this.parent.enableHtmlSanitizer && typeof (labelString) === 'string') {
185
+ labelString = SanitizeHtmlHelper.sanitize(labelString);
186
+ }
183
187
  }
184
188
  if (labelString.indexOf('null') === -1) {
185
189
  if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate' &&
@@ -191,7 +195,7 @@ var ChartRows = /** @class */ (function (_super) {
191
195
  (this.taskBarHeight - 1) + 'px; text-align:' + (this.parent.enableRtl ? 'right;' : 'left;') +
192
196
  'display:' + 'inline-block;' +
193
197
  'width:' + (data.ganttProperties.width - 10) + 'px; height:' +
194
- this.taskBarHeight + 'px;">' + labelString + '</span>';
198
+ this.taskBarHeight + 'px;"></span>';
195
199
  }
196
200
  else {
197
201
  taskLabel = '<span class="' + cls.taskLabel + '" style="line-height:' +
@@ -199,7 +203,7 @@ var ChartRows = /** @class */ (function (_super) {
199
203
  (this.parent.enableRtl ? 'right;' : 'left;')) : '') +
200
204
  +(this.parent.viewType === 'ResourceView' ? 'display:inline-flex;' : '') +
201
205
  +(this.parent.viewType === 'ResourceView' ? (data.ganttProperties.width - 10) : '') + 'px; height:' +
202
- this.taskBarHeight + 'px;">' + labelString + '</span>';
206
+ this.taskBarHeight + 'px;"></span>';
203
207
  }
204
208
  }
205
209
  var template = !isNullOrUndefined(data.ganttProperties.segments) && data.ganttProperties.segments.length > 0 ?
@@ -225,6 +229,7 @@ var ChartRows = /** @class */ (function (_super) {
225
229
  data.ganttProperties.segments.length === 0))) {
226
230
  if (template !== '' && !isNullOrUndefined(progressDiv) && progressDiv.length > 0) {
227
231
  var templateElement = this.createDivElement(template)[0];
232
+ templateElement.innerText = labelString;
228
233
  var childLabel = this.parent.labelSettings.taskLabel;
229
234
  if (childLabel && childLabel['elementRef'])
230
235
  templateElement.appendChild(tempDiv);
@@ -707,6 +712,11 @@ var ChartRows = /** @class */ (function (_super) {
707
712
  if (labelString) {
708
713
  labelString = labelString === 'isCustomTemplate' ? field : labelString;
709
714
  leftLabelTemplateNode = this.getLableText(labelString, cls.leftLabelInnerDiv);
715
+ if (this.parent.enableHtmlSanitizer && typeof (labelString) === 'string') {
716
+ labelString = SanitizeHtmlHelper.sanitize(labelString);
717
+ labelString = labelString === 'isCustomTemplate' ? field : labelString;
718
+ leftLabelTemplateNode = this.getLableText(labelString, cls.leftLabelInnerDiv);
719
+ }
710
720
  }
711
721
  }
712
722
  if (leftLabelTemplateNode && leftLabelTemplateNode.length > 0) {
@@ -757,6 +767,11 @@ var ChartRows = /** @class */ (function (_super) {
757
767
  if (labelString) {
758
768
  labelString = labelString === 'isCustomTemplate' ? field : labelString;
759
769
  rightLabelTemplateNode = this.getLableText(labelString, cls.rightLabelInnerDiv);
770
+ if (this.parent.enableHtmlSanitizer && typeof (labelString) === 'string') {
771
+ labelString = SanitizeHtmlHelper.sanitize(labelString);
772
+ labelString = labelString === 'isCustomTemplate' ? field : labelString;
773
+ rightLabelTemplateNode = this.getLableText(labelString, cls.rightLabelInnerDiv);
774
+ }
760
775
  }
761
776
  }
762
777
  if (rightLabelTemplateNode && rightLabelTemplateNode.length > 0) {
@@ -808,7 +823,7 @@ var ChartRows = /** @class */ (function (_super) {
808
823
  '<div class="' + cls.manualParentMilestoneBottom + '" style="top:' +
809
824
  (this.milesStoneRadius) + 'px;border-right-width:' + this.milesStoneRadius + 'px; border-left-width:' +
810
825
  this.milesStoneRadius + 'px; border-top-width:' + this.milesStoneRadius + 'px;"></div></div>';
811
- return this.createDivElement(data.ganttProperties.width === 0 ? milestoneTemplate : template);
826
+ return this.createDivElement(data.ganttProperties.width === 0 ? milestoneTemplate : !data.ganttProperties.isMilestone ? template : null);
812
827
  };
813
828
  /**
814
829
  * To get parent taskbar node.
@@ -852,6 +867,9 @@ var ChartRows = /** @class */ (function (_super) {
852
867
  else {
853
868
  labelString = this.getTaskLabel(this.parent.labelSettings.taskLabel);
854
869
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
870
+ if (this.parent.enableHtmlSanitizer && typeof (labelString) === 'string') {
871
+ labelString = SanitizeHtmlHelper.sanitize(labelString);
872
+ }
855
873
  }
856
874
  if (labelString.indexOf('null') === -1) {
857
875
  if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate' &&
@@ -864,7 +882,7 @@ var ChartRows = /** @class */ (function (_super) {
864
882
  'px; text-align:' + (this.parent.enableRtl ? 'right;' : 'left;') +
865
883
  'display:' + 'inline-block;' +
866
884
  'width:' + (data.ganttProperties.width - 10) + 'px; height:' +
867
- this.taskBarHeight + 'px;">' + labelString + '</span>';
885
+ this.taskBarHeight + 'px;"></span>';
868
886
  }
869
887
  else {
870
888
  labelDiv = '<span class="' +
@@ -874,9 +892,10 @@ var ChartRows = /** @class */ (function (_super) {
874
892
  (this.parent.viewType === 'ResourceView' ? 'width:' + (data.ganttProperties.width - 10) : '') + 'px; height:' +
875
893
  (this.taskBarHeight - 1) + 'px;' + (this.parent.viewType === 'ResourceView' ? 'display: inline-flex;' : '') +
876
894
  (this.parent.viewType === 'ResourceView' ? 'width:' + (data.ganttProperties.width - 10) : '') + 'px; height:' +
877
- this.taskBarHeight + 'px;">' + labelString + '</span>';
895
+ this.taskBarHeight + 'px;"></span>';
878
896
  }
879
897
  var labelElement = this.createDivElement(labelDiv)[0];
898
+ labelElement.innerText = labelString;
880
899
  var parentLabel = this.parent.labelSettings.taskLabel;
881
900
  if (parentLabel && parentLabel['elementRef'])
882
901
  labelElement.appendChild(div);
@@ -1043,7 +1062,7 @@ var ChartRows = /** @class */ (function (_super) {
1043
1062
  var mileStoneLeft = -(this.connectorPointWidth + 2);
1044
1063
  var pointerTop = Math.floor(this.milesStoneRadius - (this.connectorPointWidth / 2));
1045
1064
  var marginTop;
1046
- if ((!this.templateData.ganttProperties.isAutoSchedule && this.templateData.hasChildRecords)) {
1065
+ if ((!this.templateData.ganttProperties.isAutoSchedule && this.templateData.hasChildRecords) && this.parent.allowParentDependency) {
1047
1066
  marginTop = '';
1048
1067
  }
1049
1068
  else {
@@ -1062,7 +1081,7 @@ var ChartRows = /** @class */ (function (_super) {
1062
1081
  var pointerRight = this.parent.isAdaptive ? 10 : -2;
1063
1082
  var pointerTop = Math.floor(this.milesStoneRadius - (this.connectorPointWidth / 2));
1064
1083
  var marginTop;
1065
- if ((!this.templateData.ganttProperties.isAutoSchedule && this.templateData.hasChildRecords)) {
1084
+ if ((!this.templateData.ganttProperties.isAutoSchedule && this.templateData.hasChildRecords) && this.parent.allowParentDependency) {
1066
1085
  marginTop = '';
1067
1086
  }
1068
1087
  else {
@@ -1351,6 +1370,9 @@ var ChartRows = /** @class */ (function (_super) {
1351
1370
  this.parent.renderTemplates();
1352
1371
  this.triggerQueryTaskbarInfo();
1353
1372
  this.parent.modifiedRecords = [];
1373
+ if (this.parent.viewType == 'ResourceView' && this.parent.showOverAllocation) {
1374
+ this.updateOverlapped();
1375
+ }
1354
1376
  if (collapsedResourceRecord.length) {
1355
1377
  for (var j = 0; j < collapsedResourceRecord.length; j++) {
1356
1378
  if (collapsedResourceRecord[j].hasChildRecords) {
@@ -1377,22 +1399,37 @@ var ChartRows = /** @class */ (function (_super) {
1377
1399
  var taskbarContainerNode = this.taskbarContainer();
1378
1400
  taskbarContainerNode[0].setAttribute('aria-label', this.generateAriaLabel(this.templateData));
1379
1401
  taskbarContainerNode[0].setAttribute('rowUniqueId', this.templateData.ganttProperties.rowUniqueID);
1380
- var connectorLineLeftNode = this.getLeftPointNode();
1381
- if ((this.templateData.ganttProperties.isAutoSchedule && this.parent.viewType === 'ProjectView') || !this.templateData.hasChildRecords) {
1382
- taskbarContainerNode[0].appendChild([].slice.call(connectorLineLeftNode)[0]);
1402
+ var connectorLineLeftNode;
1403
+ if (!this.templateData.hasChildRecords && !this.parent.allowParentDependency) {
1404
+ var connectorLineLeftNode_1 = this.getLeftPointNode();
1405
+ taskbarContainerNode[0].appendChild([].slice.call(connectorLineLeftNode_1)[0]);
1406
+ }
1407
+ else if (this.parent.allowParentDependency) {
1408
+ connectorLineLeftNode = this.getLeftPointNode();
1409
+ if ((this.templateData.ganttProperties.isAutoSchedule && this.parent.viewType === 'ProjectView') || !this.templateData.hasChildRecords) {
1410
+ taskbarContainerNode[0].appendChild([].slice.call(connectorLineLeftNode)[0]);
1411
+ }
1383
1412
  }
1384
1413
  if (this.templateData.hasChildRecords) {
1385
1414
  var parentTaskbarTemplateNode = this.getParentTaskbarNode(i, taskbarContainerNode);
1415
+ var milestoneTemplateNode = this.getMilestoneNode(i, taskbarContainerNode);
1386
1416
  if (!this.templateData.ganttProperties.isAutoSchedule) {
1387
1417
  var manualTaskbar = this.getManualTaskbar();
1388
- manualTaskbar[0].appendChild([].slice.call(connectorLineLeftNode)[0]);
1389
- var connectorLineRightNode = this.getRightPointNode();
1390
- manualTaskbar[0].appendChild([].slice.call(connectorLineRightNode)[0]);
1391
- taskbarContainerNode[0].appendChild([].slice.call(manualTaskbar)[0]);
1418
+ if (!isNullOrUndefined(manualTaskbar[0])) {
1419
+ if (this.parent.allowParentDependency) {
1420
+ manualTaskbar[0].appendChild([].slice.call(connectorLineLeftNode)[0]);
1421
+ var connectorLineRightNode_1 = this.getRightPointNode();
1422
+ manualTaskbar[0].appendChild([].slice.call(connectorLineRightNode_1)[0]);
1423
+ }
1424
+ taskbarContainerNode[0].appendChild([].slice.call(manualTaskbar)[0]);
1425
+ }
1392
1426
  }
1393
1427
  if (parentTaskbarTemplateNode && parentTaskbarTemplateNode.length > 0) {
1394
1428
  taskbarContainerNode[0].appendChild([].slice.call(parentTaskbarTemplateNode)[0]);
1395
1429
  }
1430
+ else if (milestoneTemplateNode && milestoneTemplateNode.length > 0) {
1431
+ taskbarContainerNode[0].appendChild([].slice.call(milestoneTemplateNode)[0]);
1432
+ }
1396
1433
  if (this.parent.renderBaseline && this.templateData.ganttProperties.baselineStartDate &&
1397
1434
  this.templateData.ganttProperties.baselineEndDate) {
1398
1435
  taskBaselineTemplateNode = ((this.templateData.ganttProperties.baselineStartDate.getTime() === this.templateData.ganttProperties.baselineEndDate.getTime()) || ((!isNullOrUndefined(this.templateData.ganttProperties.baselineStartDate) && !isNullOrUndefined(this.templateData.ganttProperties.startDate) && (this.templateData.ganttProperties.baselineStartDate.getTime() === this.templateData.ganttProperties.startDate.getTime()))
@@ -1462,8 +1499,13 @@ var ChartRows = /** @class */ (function (_super) {
1462
1499
  ? this.getMilestoneBaselineNode() : this.getTaskBaselineNode();
1463
1500
  }
1464
1501
  }
1465
- if ((this.templateData.ganttProperties.isAutoSchedule && this.parent.viewType === 'ProjectView') || !this.templateData.hasChildRecords) {
1466
- var connectorLineRightNode = this.getRightPointNode();
1502
+ var connectorLineRightNode;
1503
+ if (this.parent.allowParentDependency && ((this.templateData.ganttProperties.isAutoSchedule && this.parent.viewType === 'ProjectView') || !this.templateData.hasChildRecords)) {
1504
+ connectorLineRightNode = this.getRightPointNode();
1505
+ taskbarContainerNode[0].appendChild([].slice.call(connectorLineRightNode)[0]);
1506
+ }
1507
+ else if (!this.parent.allowParentDependency) {
1508
+ connectorLineRightNode = this.getRightPointNode();
1467
1509
  taskbarContainerNode[0].appendChild([].slice.call(connectorLineRightNode)[0]);
1468
1510
  }
1469
1511
  var rightLabelNode = this.getRightLabelNode(i);
@@ -1484,6 +1526,10 @@ var ChartRows = /** @class */ (function (_super) {
1484
1526
  else {
1485
1527
  var text = createElement('Text');
1486
1528
  text.innerHTML = indicators[indicatorIndex].name;
1529
+ if (this.parent.enableHtmlSanitizer && typeof (indicators[indicatorIndex].name) === 'string') {
1530
+ indicators[indicatorIndex].name = SanitizeHtmlHelper.sanitize(indicators[indicatorIndex].name);
1531
+ text.innerText = indicators[indicatorIndex].name;
1532
+ }
1487
1533
  taskIndicatorTextNode = text.childNodes;
1488
1534
  }
1489
1535
  taskIndicatorNode[0].appendChild([].slice.call(taskIndicatorTextNode)[0]);
@@ -1577,7 +1623,7 @@ var ChartRows = /** @class */ (function (_super) {
1577
1623
  getComputedStyle(trElement.querySelector(classCollections[1])).borderBottomColor :
1578
1624
  (trElement.querySelector('.' + cls.baselineBar) ? getComputedStyle(trElement.querySelector('.' + cls.baselineBar)).backgroundColor : null);
1579
1625
  }
1580
- else {
1626
+ else if (taskbarElement) {
1581
1627
  var childTask = taskbarElement.querySelector(classCollections[0]);
1582
1628
  var progressTask = taskbarElement.querySelector(classCollections[1]);
1583
1629
  args.taskbarBgColor = isNullOrUndefined(childTask) ? null : taskbarElement.classList.contains(cls.traceChildTaskBar) ?
@@ -1656,7 +1702,7 @@ var ChartRows = /** @class */ (function (_super) {
1656
1702
  trElement.querySelector('.' + cls.baselineBar).style.backgroundColor = args.baselineColor;
1657
1703
  }
1658
1704
  }
1659
- else {
1705
+ else if (taskbarElement) {
1660
1706
  if (taskbarElement.querySelector(classCollections[0]) &&
1661
1707
  getComputedStyle(taskbarElement.querySelector(classCollections[0])).backgroundColor !== args.taskbarBgColor) {
1662
1708
  taskbarElement.querySelector(classCollections[0]).style.backgroundColor = args.taskbarBgColor;
@@ -1758,6 +1804,78 @@ var ChartRows = /** @class */ (function (_super) {
1758
1804
  }
1759
1805
  return null;
1760
1806
  };
1807
+ // to update the eOverlapped property
1808
+ ChartRows.prototype.updateOverlapped = function () {
1809
+ for (var k = 0; k < this.parent.treeGrid.parentData.length; k++) {
1810
+ var childRecords = this.parent.treeGrid.parentData[k].childRecords;
1811
+ for (var i = 0; i < childRecords.length; i++) {
1812
+ if (childRecords[i + 1]) {
1813
+ childRecords[i].ganttProperties.eOverlapped = undefined;
1814
+ }
1815
+ for (var j = i + 1; j < childRecords.length; j++) {
1816
+ childRecords[j].ganttProperties.eOverlapped = undefined;
1817
+ if (childRecords[i].ganttProperties.startDate.getTime() < childRecords[j].ganttProperties.endDate.getTime() &&
1818
+ childRecords[i].ganttProperties.endDate.getTime() > childRecords[j].ganttProperties.startDate.getTime()) {
1819
+ childRecords[j].ganttProperties.eOverlapped = true;
1820
+ childRecords[i].ganttProperties.eOverlapped = true;
1821
+ }
1822
+ else {
1823
+ if (isNullOrUndefined(childRecords[j].ganttProperties.eOverlapped)) {
1824
+ childRecords[j].ganttProperties.eOverlapped = false;
1825
+ }
1826
+ if (isNullOrUndefined(childRecords[i].ganttProperties.eOverlapped)) {
1827
+ childRecords[i].ganttProperties.eOverlapped = false;
1828
+ }
1829
+ }
1830
+ }
1831
+ }
1832
+ }
1833
+ };
1834
+ // To update the row height when allow overallocation set to false
1835
+ ChartRows.prototype.updateDragDropRecords = function (data, tr) {
1836
+ var childRecords = data.childRecords;
1837
+ var rowIndex = this.parent.currentViewData.indexOf(data);
1838
+ var treeGridContentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
1839
+ this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
1840
+ if (!tr) {
1841
+ tr = this.ganttChartTableBody.childNodes[rowIndex];
1842
+ }
1843
+ tr['style'].height = this.parent.treeGrid.getRowByIndex(rowIndex)['style'].height = this.parent.rowHeight + 'px';
1844
+ this.parent.contentHeight = treeGridContentHeight;
1845
+ var rowIDs = [];
1846
+ var rowCounts = 0;
1847
+ if (data) {
1848
+ for (var i = 0; i < childRecords.length; i++) {
1849
+ for (var j = i + 1; j < childRecords.length; j++) {
1850
+ var taskbarContainer = tr.getElementsByClassName('e-taskbar-main-container');
1851
+ for (var k = 0; k < taskbarContainer.length; k++) {
1852
+ if (childRecords[i].ganttProperties.startDate.getTime() < childRecords[j].ganttProperties.endDate.getTime() &&
1853
+ childRecords[i].ganttProperties.endDate.getTime() > childRecords[j].ganttProperties.startDate.getTime()) {
1854
+ if (taskbarContainer[k].getAttribute('rowuniqueid') === childRecords[j]['rowUniqueID'] &&
1855
+ rowIDs.indexOf(childRecords[j]['rowUniqueID']) == -1) {
1856
+ rowIDs.push(childRecords[j]['rowUniqueID']);
1857
+ rowCounts++;
1858
+ tr.children[0]['style'].verticalAlign = 'baseline';
1859
+ tr.getElementsByClassName('e-taskbar-main-container')[k]['style'].marginTop = (rowCounts * this.parent.rowHeight) + this.taskBarMarginTop + 'px';
1860
+ tr['style'].height = this.parent.treeGrid.getRowByIndex(rowIndex)['style'].height = parseInt(tr['style'].height) + this.parent.rowHeight + 'px';
1861
+ }
1862
+ }
1863
+ else {
1864
+ if (taskbarContainer[k].getAttribute('rowuniqueid') === childRecords[j]['rowUniqueID'] &&
1865
+ rowIDs.indexOf(childRecords[j]['rowUniqueID']) == -1 && this.parent.rowDragAndDropModule &&
1866
+ this.parent.rowDragAndDropModule['draggedRecord'] && taskbarContainer[k].getAttribute('rowuniqueid') ===
1867
+ this.parent.rowDragAndDropModule['draggedRecord']['rowUniqueID'] && this.parent.rowDragAndDropModule['draggedRecord']['rowUniqueID'] === childRecords[j]['rowUniqueID']) {
1868
+ tr.getElementsByClassName('e-taskbar-main-container')[k]['style'].marginTop =
1869
+ this.parent.editModule.taskbarEditModule.draggedRecordMarginTop;
1870
+ }
1871
+ }
1872
+ }
1873
+ }
1874
+ }
1875
+ this.parent.contentHeight = treeGridContentHeight;
1876
+ document.getElementsByClassName('e-chart-rows-container')[0]['style'].height = this.parent.contentHeight + 'px';
1877
+ }
1878
+ };
1761
1879
  /**
1762
1880
  * To refresh edited TR
1763
1881
  *
@@ -1771,14 +1889,22 @@ var ChartRows = /** @class */ (function (_super) {
1771
1889
  var selectedItem = this.parent.currentViewData[index];
1772
1890
  if (index !== -1 && selectedItem) {
1773
1891
  var data = selectedItem;
1892
+ if (!this.parent.allowTaskbarOverlap && this.parent.viewType === 'ResourceView' && data.expanded) {
1893
+ tr['style'].height = this.parent.treeGrid.getRowByIndex(index)['style'].height = this.parent.rowHeight + 'px';
1894
+ }
1774
1895
  if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && !data.expanded && this.parent.enableMultiTaskbar) {
1775
1896
  tr.replaceChild(this.getResourceParent(data).childNodes[0], tr.childNodes[0]);
1776
1897
  }
1777
1898
  else {
1778
- tr.replaceChild(this.getGanttChartRow(index, data).childNodes[0], tr.childNodes[0]);
1899
+ if (this.parent.viewType === 'ResourceView' && this.parent.allowTaskbarDragAndDrop && !data.expanded) {
1900
+ tr.replaceWith(this.getGanttChartRow(index, data));
1901
+ }
1902
+ else {
1903
+ tr.replaceChild(this.getGanttChartRow(index, data).childNodes[0], tr.childNodes[0]);
1904
+ }
1779
1905
  }
1780
1906
  this.parent.renderTemplates();
1781
- if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && this.parent.showOverAllocation) {
1907
+ if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && this.parent.showOverAllocation && this.parent.allowTaskbarOverlap) {
1782
1908
  if (isValidateRange) {
1783
1909
  this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData);
1784
1910
  }
@@ -1800,6 +1926,12 @@ var ChartRows = /** @class */ (function (_super) {
1800
1926
  }
1801
1927
  var dataId = this.parent.viewType === 'ProjectView' ? data.ganttProperties.taskId : data.ganttProperties.rowUniqueID;
1802
1928
  this.parent.treeGrid.grid.setRowData(dataId, data);
1929
+ if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && !data.expanded && this.parent.enableMultiTaskbar && !this.parent.allowTaskbarOverlap) {
1930
+ this.updateDragDropRecords(selectedItem, tr);
1931
+ }
1932
+ if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && this.parent.showOverAllocation && !this.parent.allowTaskbarOverlap) {
1933
+ this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData);
1934
+ }
1803
1935
  var nextEditableElement = this.parent.ganttChartModule.tempNextElement;
1804
1936
  if (this.parent.ganttChartModule.isEditableElement && nextEditableElement) {
1805
1937
  this.parent.treeGrid.grid.focusModule.focus();
@@ -1813,7 +1945,7 @@ var ChartRows = /** @class */ (function (_super) {
1813
1945
  ChartRows.prototype.getResourceParent = function (record) {
1814
1946
  var chartRows = this.parent.ganttChartModule.getChartRows();
1815
1947
  //Below code is for rendering taskbartemplate in resource view with multi taskbar
1816
- if (this.parent.initialChartRowElements) {
1948
+ if (this.parent.initialChartRowElements && (!this.parent.allowTaskbarDragAndDrop && this.parent.allowTaskbarOverlap)) {
1817
1949
  for (var j = 0; j < this.parent.initialChartRowElements.length; j++) {
1818
1950
  if (!isNullOrUndefined(chartRows[j])) {
1819
1951
  if (!isNullOrUndefined(chartRows[j].childNodes[0].childNodes[1].childNodes[2]) &&
@@ -1841,7 +1973,7 @@ var ChartRows = /** @class */ (function (_super) {
1841
1973
  var id = chartRows[i].querySelector('.' + cls.taskBarMainContainer).getAttribute('rowUniqueId');
1842
1974
  var ganttData = this.parent.getRecordByID(id);
1843
1975
  var zIndex = "";
1844
- if (ganttData && ganttData.ganttProperties.eOverlapIndex) {
1976
+ if (ganttData && !isNullOrUndefined(ganttData.ganttProperties.eOverlapIndex)) {
1845
1977
  zIndex = (ganttData.ganttProperties.eOverlapIndex).toString();
1846
1978
  }
1847
1979
  var cloneChildElement = cloneElement.cloneNode(true);