@syncfusion/ej2-gantt 19.4.56 → 20.1.50

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 (82) hide show
  1. package/CHANGELOG.md +31 -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 +230 -83
  5. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  6. package/dist/es6/ej2-gantt.es5.js +248 -91
  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/cell-edit.js +2 -1
  13. package/src/gantt/actions/dialog-edit.js +11 -1
  14. package/src/gantt/actions/edit.js +11 -2
  15. package/src/gantt/actions/filter.js +4 -2
  16. package/src/gantt/actions/rowdragdrop.js +41 -17
  17. package/src/gantt/base/date-processor.js +0 -1
  18. package/src/gantt/base/gantt-chart.js +10 -5
  19. package/src/gantt/base/gantt.d.ts +2 -0
  20. package/src/gantt/base/gantt.js +3 -2
  21. package/src/gantt/base/splitter.js +1 -0
  22. package/src/gantt/base/tree-grid.js +3 -1
  23. package/src/gantt/renderer/chart-rows.js +80 -32
  24. package/src/gantt/renderer/connector-line.js +22 -18
  25. package/src/gantt/renderer/event-marker.js +1 -0
  26. package/src/gantt/renderer/nonworking-day.js +13 -6
  27. package/src/gantt/renderer/timeline.d.ts +1 -0
  28. package/src/gantt/renderer/timeline.js +37 -1
  29. package/src/gantt/renderer/tooltip.js +10 -3
  30. package/styles/bootstrap-dark.css +37 -10
  31. package/styles/bootstrap.css +37 -10
  32. package/styles/bootstrap4.css +37 -10
  33. package/styles/bootstrap5-dark.css +53 -19
  34. package/styles/bootstrap5.css +53 -19
  35. package/styles/fabric-dark.css +34 -7
  36. package/styles/fabric.css +37 -10
  37. package/styles/fluent-dark.css +1942 -0
  38. package/styles/fluent-dark.scss +1 -0
  39. package/styles/fluent.css +1942 -0
  40. package/styles/fluent.scss +1 -0
  41. package/styles/gantt/_bootstrap-dark-definition.scss +10 -2
  42. package/styles/gantt/_bootstrap-definition.scss +11 -3
  43. package/styles/gantt/_bootstrap4-definition.scss +10 -2
  44. package/styles/gantt/_bootstrap5-definition.scss +17 -9
  45. package/styles/gantt/_fabric-dark-definition.scss +8 -0
  46. package/styles/gantt/_fabric-definition.scss +10 -2
  47. package/styles/gantt/_fluent-dark-definition.scss +1 -0
  48. package/styles/gantt/_fluent-definition.scss +21 -13
  49. package/styles/gantt/_highcontrast-definition.scss +9 -1
  50. package/styles/gantt/_highcontrast-light-definition.scss +9 -1
  51. package/styles/gantt/_layout.scss +53 -2
  52. package/styles/gantt/_material-dark-definition.scss +9 -1
  53. package/styles/gantt/_material-definition.scss +10 -2
  54. package/styles/gantt/_tailwind-definition.scss +13 -5
  55. package/styles/gantt/_theme.scss +2 -5
  56. package/styles/gantt/bootstrap-dark.css +37 -10
  57. package/styles/gantt/bootstrap.css +37 -10
  58. package/styles/gantt/bootstrap4.css +37 -10
  59. package/styles/gantt/bootstrap5-dark.css +53 -19
  60. package/styles/gantt/bootstrap5.css +53 -19
  61. package/styles/gantt/fabric-dark.css +34 -7
  62. package/styles/gantt/fabric.css +37 -10
  63. package/styles/gantt/fluent-dark.css +1942 -0
  64. package/styles/gantt/fluent-dark.scss +22 -0
  65. package/styles/gantt/fluent.css +1942 -0
  66. package/styles/gantt/fluent.scss +22 -0
  67. package/styles/gantt/highcontrast-light.css +34 -7
  68. package/styles/gantt/highcontrast.css +34 -7
  69. package/styles/gantt/icons/_fluent-dark.scss +1 -0
  70. package/styles/gantt/icons/_fluent.scss +1 -1
  71. package/styles/gantt/icons/_tailwind-dark.scss +28 -29
  72. package/styles/gantt/icons/_tailwind.scss +26 -27
  73. package/styles/gantt/material-dark.css +37 -10
  74. package/styles/gantt/material.css +37 -10
  75. package/styles/gantt/tailwind-dark.css +70 -99
  76. package/styles/gantt/tailwind.css +70 -99
  77. package/styles/highcontrast-light.css +34 -7
  78. package/styles/highcontrast.css +34 -7
  79. package/styles/material-dark.css +37 -10
  80. package/styles/material.css +37 -10
  81. package/styles/tailwind-dark.css +70 -99
  82. package/styles/tailwind.css +70 -99
@@ -483,7 +483,6 @@ class DateProcessor {
483
483
  tDuration = this.parent.editModule.taskbarEditModule.sumOfDuration(ganttProperties.segments);
484
484
  }
485
485
  else {
486
- // eslint-disable-next-line
487
486
  if (!isNullOrUndefined(ganttProperties.startDate) && !isNullOrUndefined(ganttProperties.endDate) &&
488
487
  (ganttProperties.startDate).getTime() === (ganttProperties.endDate).getTime() && !isNullOrUndefined(ganttData.taskData[this.parent.taskFields.milestone])) {
489
488
  tDuration = 1;
@@ -4082,6 +4081,7 @@ class GanttChart {
4082
4081
  this.chartTimelineContainer = null;
4083
4082
  this.rangeViewContainer =
4084
4083
  createElement('div', { className: rangeContainer });
4084
+ this.rangeViewContainer.setAttribute("role", "RangeContainer");
4085
4085
  this.virtualRender = new VirtualContentRenderer(this.parent);
4086
4086
  this.addEventListener();
4087
4087
  }
@@ -4240,6 +4240,7 @@ class GanttChart {
4240
4240
  renderTimelineContainer() {
4241
4241
  this.chartTimelineContainer =
4242
4242
  createElement('div', { className: timelineHeaderContainer });
4243
+ this.chartTimelineContainer.setAttribute("role", "TimelineHeader");
4243
4244
  this.chartElement.appendChild(this.chartTimelineContainer);
4244
4245
  }
4245
4246
  /**
@@ -4280,7 +4281,7 @@ class GanttChart {
4280
4281
  const emptydivHeight = 36;
4281
4282
  const emptyHeight = this.parent.contentHeight === 0 ? this.parent.flatData.length > 1 ? emptydivHeight : 0 : this.parent.contentHeight;
4282
4283
  let contentElement = this.parent.element.getElementsByClassName('e-chart-scroll-container e-content')[0];
4283
- if (emptyHeight >= contentElement['offsetHeight']) {
4284
+ if (emptyHeight >= contentElement['offsetHeight'] || this.parent.height === 'auto') {
4284
4285
  this.chartBodyContent.style.height = formatUnit(emptyHeight);
4285
4286
  }
4286
4287
  else {
@@ -4291,8 +4292,7 @@ class GanttChart {
4291
4292
  else {
4292
4293
  this.chartBodyContent.style.height = contentElement['offsetHeight'] + 'px';
4293
4294
  }
4294
- }
4295
- //let element: HTMLElement = this.chartTimelineContainer.querySelector('.' + cls.timelineHeaderTableContainer);
4295
+ } //let element: HTMLElement = this.chartTimelineContainer.querySelector('.' + cls.timelineHeaderTableContainer);
4296
4296
  this.chartBodyContent.style.width = formatUnit(this.parent.timelineModule.totalTimelineWidth);
4297
4297
  this.setVirtualHeight();
4298
4298
  this.parent.notify('updateHeight', {});
@@ -4470,7 +4470,7 @@ class GanttChart {
4470
4470
  const target = e.target;
4471
4471
  const isOnTaskbarElement = e.target.classList.contains(taskBarMainContainer)
4472
4472
  || closest(e.target, '.' + taskBarMainContainer);
4473
- if (closest(target, '.e-gantt-parent-taskbar')) {
4473
+ if (closest(target, '.e-gantt-parent-taskbar') && !this.parent.editSettings.allowEditing) {
4474
4474
  this.chartExpandCollapseRequest(e);
4475
4475
  }
4476
4476
  else if (!isOnTaskbarElement && this.parent.autoFocusTasks) {
@@ -4992,6 +4992,10 @@ class GanttChart {
4992
4992
  $target.classList.contains('e-headercell') || $target.closest('.e-segmented-taskbar')) {
4993
4993
  e.preventDefault();
4994
4994
  }
4995
+ if (isTab && $target.classList.contains('e-rowdragdrop')) {
4996
+ this.parent.treeGrid.grid.notify('key-pressed', e);
4997
+ return;
4998
+ }
4995
4999
  if ($target.classList.contains('e-rowcell') && (nextElement && nextElement.classList.contains('e-rowcell')) ||
4996
5000
  $target.classList.contains('e-headercell')) { // eslint-disable-line
4997
5001
  if (isTab) {
@@ -5034,7 +5038,7 @@ class GanttChart {
5034
5038
  else {
5035
5039
  this.manageFocus($target, 'remove', true);
5036
5040
  }
5037
- if (nextElement.classList.contains('e-rowcell')) {
5041
+ if (nextElement.classList.contains('e-rowcell') && $target.nextElementSibling) {
5038
5042
  if (!$target.classList.contains('e-rowcell')) {
5039
5043
  this.parent.treeGrid.grid.notify('key-pressed', e);
5040
5044
  const fmodule = getValue('focusModule', this.parent.treeGrid.grid);
@@ -6113,6 +6117,40 @@ class Timeline {
6113
6117
  } while ((startDate < endDate));
6114
6118
  return parentTh;
6115
6119
  }
6120
+ updateTimelineAfterZooming(endDate, resized) {
6121
+ let timeDiff;
6122
+ let perDayWidth;
6123
+ let totWidth;
6124
+ let contentElement = document.getElementsByClassName('e-chart-scroll-container e-content')[0];
6125
+ if (!isNullOrUndefined(contentElement)) {
6126
+ let contentWidth = contentElement['offsetWidth'];
6127
+ let contentHeight = contentElement['offsetHeight'];
6128
+ let scrollHeight = document.getElementsByClassName('e-chart-rows-container')[0]['offsetHeight'];
6129
+ timeDiff = Math.abs(this.timelineStartDate.getTime() - endDate.getTime());
6130
+ timeDiff = timeDiff / (1000 * 3600 * 24);
6131
+ if (this.bottomTier === 'None') {
6132
+ perDayWidth = this.getPerDayWidth(this.customTimelineSettings.timelineUnitSize, this.customTimelineSettings.topTier.count, this.topTier);
6133
+ }
6134
+ else {
6135
+ perDayWidth = this.getPerDayWidth(this.customTimelineSettings.timelineUnitSize, this.customTimelineSettings.bottomTier.count, this.bottomTier);
6136
+ }
6137
+ if (contentHeight < scrollHeight) {
6138
+ totWidth = (perDayWidth * timeDiff) + 17;
6139
+ }
6140
+ else {
6141
+ totWidth = (perDayWidth * timeDiff);
6142
+ }
6143
+ if (contentWidth >= totWidth) {
6144
+ let widthDiff = contentWidth - totWidth;
6145
+ widthDiff = Math.round(widthDiff / perDayWidth);
6146
+ endDate.setDate(endDate.getDate() + widthDiff);
6147
+ this.parent.timelineModule.timelineEndDate = endDate;
6148
+ if (resized) {
6149
+ this.parent.updateProjectDates(this.timelineStartDate, this.timelineEndDate, this.parent.isTimelineRoundOff);
6150
+ }
6151
+ }
6152
+ }
6153
+ }
6116
6154
  getTimelineRoundOffEndDate(date) {
6117
6155
  const tierMode = this.topTier === 'None' ? this.bottomTier : this.topTier;
6118
6156
  const endDate = new Date(date.toString());
@@ -6127,6 +6165,9 @@ class Timeline {
6127
6165
  endDate.setHours(24, 0, 0, 0);
6128
6166
  }
6129
6167
  }
6168
+ if (this.isZooming || this.parent.isLoad) {
6169
+ this.updateTimelineAfterZooming(endDate, false);
6170
+ }
6130
6171
  return endDate;
6131
6172
  }
6132
6173
  /**
@@ -6196,7 +6237,6 @@ class Timeline {
6196
6237
  }
6197
6238
  return increment;
6198
6239
  }
6199
- ;
6200
6240
  /**
6201
6241
  * Method to find header cell was weekend or not
6202
6242
  *
@@ -6775,6 +6815,8 @@ class GanttTreeGrid {
6775
6815
  renderTreeGrid() {
6776
6816
  this.composeProperties();
6777
6817
  this.bindEvents();
6818
+ const root = 'root';
6819
+ this.parent.treeGrid[root] = this.parent[root] ? this.parent[root] : this.parent;
6778
6820
  this.parent.treeGrid.appendTo(this.treeGridElement);
6779
6821
  this.wireEvents();
6780
6822
  }
@@ -6838,7 +6880,7 @@ class GanttTreeGrid {
6838
6880
  const scrollWidth = this.getScrollbarWidth();
6839
6881
  const isMobile = /Android|Mac|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
6840
6882
  if (scrollWidth !== 0) {
6841
- content.style.cssText += 'width: calc(100% + ' + scrollWidth + 'px);';
6883
+ content.style.cssText += 'width: calc(100% + ' + (scrollWidth + 1) + 'px);';
6842
6884
  }
6843
6885
  else {
6844
6886
  content.classList.add('e-gantt-scroll-padding');
@@ -7864,7 +7906,7 @@ class ChartRows extends DateProcessor {
7864
7906
  this.milestoneHeight = 0;
7865
7907
  this.milesStoneRadius = 0;
7866
7908
  this.baselineTop = 0;
7867
- this.baselineHeight = 3;
7909
+ this.baselineHeight = 8;
7868
7910
  this.touchLeftConnectorpoint = '';
7869
7911
  this.touchRightConnectorpoint = '';
7870
7912
  this.dropSplit = false;
@@ -7946,7 +7988,7 @@ class ChartRows extends DateProcessor {
7946
7988
  * @private
7947
7989
  */
7948
7990
  getIndicatorNode(indicator) {
7949
- const templateString = '<label class="' + label + ' ' + taskIndicatorDiv + '" style="line-height:'
7991
+ const templateString = '<label class="' + label + ' ' + taskIndicatorDiv + '" role="LabelIndicator" style="line-height:'
7950
7992
  + (this.parent.rowHeight) + 'px;' +
7951
7993
  'left:' + this.getIndicatorleft(indicator.date) + 'px;"><i class="' + indicator.iconClass + '"></i> </label>';
7952
7994
  return this.createDivElement(templateString);
@@ -7997,10 +8039,10 @@ class ChartRows extends DateProcessor {
7997
8039
  'border-bottom-right-radius:' + this.getBorderRadius(data.ganttProperties) + 'px;">' +
7998
8040
  '</div>');
7999
8041
  }
8042
+ let tempDiv = createElement('div');
8000
8043
  if (this.taskLabelTemplateFunction && !isNullOrUndefined(progressDiv) && progressDiv.length > 0) {
8001
8044
  const taskLabelTemplateNode = this.taskLabelTemplateFunction(extend({ index: i }, data), this.parent, 'TaskLabelTemplate', this.getTemplateID('TaskLabelTemplate'), false, undefined, progressDiv[0]);
8002
8045
  if (taskLabelTemplateNode && taskLabelTemplateNode.length > 0) {
8003
- const tempDiv = createElement('div');
8004
8046
  tempDiv.appendChild(taskLabelTemplateNode[0]);
8005
8047
  labelString = tempDiv.innerHTML;
8006
8048
  }
@@ -8010,6 +8052,9 @@ class ChartRows extends DateProcessor {
8010
8052
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
8011
8053
  }
8012
8054
  if (labelString !== 'null') {
8055
+ if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate') {
8056
+ labelString = '';
8057
+ }
8013
8058
  if (isNaN(parseInt(labelString))) {
8014
8059
  taskLabel$$1 = '<span class="' + taskLabel + '" style="line-height:' +
8015
8060
  (this.taskBarHeight - 1) + 'px; text-align: left;' +
@@ -8019,9 +8064,9 @@ class ChartRows extends DateProcessor {
8019
8064
  }
8020
8065
  else {
8021
8066
  taskLabel$$1 = '<span class="' + taskLabel + '" style="line-height:' +
8022
- (this.taskBarHeight - 1) + 'px; text-align:' + (this.parent.viewType === 'ResourceView' ? 'left;' : ';') +
8023
- 'display:' + (this.parent.viewType === 'ResourceView' ? 'inline-flex;' : ';') +
8024
- 'width:' + (this.parent.viewType === 'ResourceView' ? (data.ganttProperties.width - 10) : '') + 'px; height:' +
8067
+ (this.taskBarHeight - 1) + 'px;' + (this.parent.viewType === 'ResourceView' ? 'text-align: left;' : '') +
8068
+ +(this.parent.viewType === 'ResourceView' ? 'display:inline-flex;' : '') +
8069
+ +(this.parent.viewType === 'ResourceView' ? (data.ganttProperties.width - 10) : '') + 'px; height:' +
8025
8070
  this.taskBarHeight + 'px;">' + labelString + '</span>';
8026
8071
  }
8027
8072
  }
@@ -8047,7 +8092,16 @@ class ChartRows extends DateProcessor {
8047
8092
  (isNullOrUndefined(data.ganttProperties.segments) || (!isNullOrUndefined(data.ganttProperties.segments) &&
8048
8093
  data.ganttProperties.segments.length === 0))) {
8049
8094
  if (template !== '' && !isNullOrUndefined(progressDiv) && progressDiv.length > 0) {
8050
- progressDiv[0].appendChild([].slice.call(this.createDivElement(template))[0]);
8095
+ let templateElement = this.createDivElement(template)[0];
8096
+ templateElement.appendChild(tempDiv);
8097
+ progressDiv[0].appendChild(templateElement);
8098
+ let childLabel = this.parent.labelSettings.taskLabel;
8099
+ if (progressDiv[0].querySelectorAll('.e-task-label')[0].textContent !== '' &&
8100
+ !this.isTemplate(childLabel))
8101
+ progressDiv[0].querySelectorAll('.e-task-label')[0].children[0].remove();
8102
+ if (progressDiv[0].querySelectorAll('.e-task-label')[0].textContent == '' &&
8103
+ childLabel && !childLabel['elementRef'])
8104
+ progressDiv[0].querySelectorAll('.e-task-label')[0].textContent = childLabel;
8051
8105
  }
8052
8106
  if (!isNullOrUndefined(taskbarInnerDiv) && taskbarInnerDiv.length > 0) {
8053
8107
  taskbarInnerDiv[0].appendChild([].slice.call(progressDiv)[0]);
@@ -8438,7 +8492,7 @@ class ChartRows extends DateProcessor {
8438
8492
  */
8439
8493
  getTaskBaselineNode() {
8440
8494
  const data = this.templateData;
8441
- const template = '<div class="' + baselineBar + ' ' + '" style="margin-top:' + this.baselineTop +
8495
+ const template = '<div class="' + baselineBar + ' ' + '" role="BaselineBar" style="margin-top:' + this.baselineTop +
8442
8496
  'px;left:' + data.ganttProperties.baselineLeft + 'px;' +
8443
8497
  'width:' + data.ganttProperties.baselineWidth + 'px;height:' +
8444
8498
  this.baselineHeight + 'px;' + (this.baselineColor ? 'background-color: ' + this.baselineColor + ';' : '') + '"></div>';
@@ -8452,9 +8506,10 @@ class ChartRows extends DateProcessor {
8452
8506
  */
8453
8507
  getMilestoneBaselineNode() {
8454
8508
  const data = this.templateData;
8509
+ let baselineMilestoneHeight = this.parent.renderBaseline ? 5 : 2;
8455
8510
  const template = '<div class="' + baselineMilestoneContainer + ' ' + '" style="' +
8456
8511
  'left:' + (data.ganttProperties.baselineLeft - this.milesStoneRadius) + 'px;' +
8457
- 'margin-top:' + (-Math.floor(this.parent.rowHeight - this.milestoneMarginTop) + 2) +
8512
+ 'margin-top:' + (-Math.floor(this.parent.rowHeight - this.milestoneMarginTop) + baselineMilestoneHeight) +
8458
8513
  'px">' + '<div class="' + baselineMilestoneDiv + '">' + '<div class="' + baselineMilestoneDiv +
8459
8514
  ' ' + baselineMilestoneTop + '" ' +
8460
8515
  'style="top:' + (-this.milestoneHeight) + 'px;border-right:' + this.milesStoneRadius +
@@ -8482,7 +8537,9 @@ class ChartRows extends DateProcessor {
8482
8537
  */
8483
8538
  getLeftLabelNode(i) {
8484
8539
  const leftLabelNode = this.leftLabelContainer();
8485
- leftLabelNode[0].setAttribute('aria-label', this.generateTaskLabelAriaLabel('left'));
8540
+ if (this.generateTaskLabelAriaLabel('left') !== "") {
8541
+ leftLabelNode[0].setAttribute('aria-label', this.generateTaskLabelAriaLabel('left'));
8542
+ }
8486
8543
  let leftLabelTemplateNode = null;
8487
8544
  if (this.leftTaskLabelTemplateFunction) {
8488
8545
  leftLabelTemplateNode = this.leftTaskLabelTemplateFunction(extend({ index: i }, this.templateData), this.parent, 'LeftLabelTemplate', this.getTemplateID('LeftLabelTemplate'), false, undefined, leftLabelNode[0], this.parent.treeGrid['root']);
@@ -8504,9 +8561,10 @@ class ChartRows extends DateProcessor {
8504
8561
  return leftLabelNode;
8505
8562
  }
8506
8563
  getLableText(labelString, labelDiv) {
8564
+ let leftLabelHeight = this.parent.renderBaseline ? ((this.parent.rowHeight - this.taskBarHeight) / 2) : this.taskBarMarginTop;
8507
8565
  const templateString = createElement('div', {
8508
8566
  className: labelDiv, styles: 'height:' + (this.taskBarHeight) + 'px;' +
8509
- 'margin-top:' + this.taskBarMarginTop + 'px;'
8567
+ 'margin-top:' + leftLabelHeight + 'px;'
8510
8568
  });
8511
8569
  const spanElem = createElement('span', { className: label });
8512
8570
  const property = this.parent.disableHtmlEncode ? 'textContent' : 'innerHTML';
@@ -8525,7 +8583,9 @@ class ChartRows extends DateProcessor {
8525
8583
  */
8526
8584
  getRightLabelNode(i) {
8527
8585
  const rightLabelNode = this.rightLabelContainer();
8528
- rightLabelNode[0].setAttribute('aria-label', this.generateTaskLabelAriaLabel('right'));
8586
+ if (this.generateTaskLabelAriaLabel('right') !== "") {
8587
+ rightLabelNode[0].setAttribute('aria-label', this.generateTaskLabelAriaLabel('right'));
8588
+ }
8529
8589
  let rightLabelTemplateNode = null;
8530
8590
  if (this.rightTaskLabelTemplateFunction) {
8531
8591
  rightLabelTemplateNode = this.rightTaskLabelTemplateFunction(extend({ index: i }, this.templateData), this.parent, 'RightLabelTemplate', this.getTemplateID('RightLabelTemplate'), false, undefined, rightLabelNode[0], this.parent.treeGrid['root']);
@@ -8615,10 +8675,10 @@ class ChartRows extends DateProcessor {
8615
8675
  'width:' + data.ganttProperties.progressWidth + 'px;' +
8616
8676
  'border-top-right-radius:' + this.getBorderRadius(data) + 'px;' +
8617
8677
  'border-bottom-right-radius:' + this.getBorderRadius(data) + 'px;height:100%;"></div>');
8678
+ let div = createElement('div');
8618
8679
  if (this.taskLabelTemplateFunction) {
8619
8680
  const parentTaskLabelNode = this.taskLabelTemplateFunction(extend({ index: i }, data), this.parent, 'TaskLabelTemplate', this.getTemplateID('TaskLabelTemplate'), false, undefined, progressBarInnerDiv[0]);
8620
8681
  if (parentTaskLabelNode && parentTaskLabelNode.length > 0) {
8621
- const div = createElement('div');
8622
8682
  div.appendChild(parentTaskLabelNode[0]);
8623
8683
  labelString = div.innerHTML;
8624
8684
  }
@@ -8628,21 +8688,35 @@ class ChartRows extends DateProcessor {
8628
8688
  labelString = labelString === 'isCustomTemplate' ? this.parent.labelSettings.taskLabel : labelString;
8629
8689
  }
8630
8690
  if (labelString !== 'null') {
8691
+ if (this.getTaskLabel(this.parent.labelSettings.taskLabel) === 'isCustomTemplate') {
8692
+ labelString = '';
8693
+ }
8631
8694
  if (isNaN(parseInt(labelString))) {
8632
- labelDiv = this.createDivElement('<span class="' + taskLabel + '" style="line-height:' +
8695
+ labelDiv = '<span class="' + taskLabel + '" style="line-height:' +
8633
8696
  (this.taskBarHeight - 1) + 'px; text-align: left;' +
8634
8697
  'display:' + 'inline-block;' +
8635
8698
  'width:' + (data.ganttProperties.width - 10) + 'px; height:' +
8636
- this.taskBarHeight + 'px;">' + labelString + '</span>');
8699
+ this.taskBarHeight + 'px;">' + labelString + '</span>';
8637
8700
  }
8638
8701
  else {
8639
- labelDiv = this.createDivElement('<span class="' +
8702
+ labelDiv = '<span class="' +
8640
8703
  taskLabel + '" style="line-height:' +
8641
- (this.taskBarHeight - 1) + 'px; display:' + (this.parent.viewType === 'ResourceView' ? 'inline-flex;' : ';') + 'width:' +
8642
- (this.parent.viewType === 'ResourceView' ? (data.ganttProperties.width - 10) : ';') + 'px; height:' +
8643
- this.taskBarHeight + 'px;">' + labelString + '</span>');
8704
+ (this.taskBarHeight - 1) + 'px;' + (this.parent.viewType === 'ResourceView' ? 'display:inline-flex;' : '') +
8705
+ (this.parent.viewType === 'ResourceView' ? 'width:' + (data.ganttProperties.width - 10) : '') + 'px; height:' +
8706
+ (this.taskBarHeight - 1) + 'px;' + (this.parent.viewType === 'ResourceView' ? 'display: inline-flex;' : '') +
8707
+ (this.parent.viewType === 'ResourceView' ? 'width:' + (data.ganttProperties.width - 10) : '') + 'px; height:' +
8708
+ this.taskBarHeight + 'px;">' + labelString + '</span>';
8644
8709
  }
8645
- progressBarInnerDiv[0].appendChild([].slice.call(labelDiv)[0]);
8710
+ let labelElement = this.createDivElement(labelDiv)[0];
8711
+ labelElement.appendChild(div);
8712
+ progressBarInnerDiv[0].appendChild(labelElement);
8713
+ let parentLabel = this.parent.labelSettings.taskLabel;
8714
+ if (progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent !== '' &&
8715
+ !this.isTemplate(parentLabel))
8716
+ progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].children[0].remove();
8717
+ if (progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent == '' &&
8718
+ parentLabel && !parentLabel['elementRef'])
8719
+ progressBarInnerDiv[0].querySelectorAll('.e-task-label')[0].textContent = parentLabel;
8646
8720
  }
8647
8721
  const milestoneTemplate = '<div class="' + parentMilestone + '" style="position:absolute;">' +
8648
8722
  '<div class="' + parentMilestoneTop + '" style="border-right-width:' +
@@ -8668,10 +8742,10 @@ class ChartRows extends DateProcessor {
8668
8742
  const className = (this.parent.gridLines === 'Horizontal' || this.parent.gridLines === 'Both') ?
8669
8743
  'e-chart-row-border' : '';
8670
8744
  table.innerHTML = '<tr class="' + this.getRowClassName(this.templateData) + ' ' + chartRow + '"' +
8671
- 'style="display:' + this.getExpandDisplayProp(this.templateData) + ';height:' +
8745
+ 'role="ChartRow" style="display:' + this.getExpandDisplayProp(this.templateData) + ';height:' +
8672
8746
  this.parent.rowHeight + 'px;">' +
8673
8747
  '<td class="' + chartRowCell + ' ' + className
8674
- + '" style="width:' + this.parent.timelineModule.totalTimelineWidth + 'px;"></td></tr>';
8748
+ + '" role="ChartCell" style="width:' + this.parent.timelineModule.totalTimelineWidth + 'px;"></td></tr>';
8675
8749
  return table.childNodes;
8676
8750
  }
8677
8751
  /**
@@ -8736,7 +8810,7 @@ class ChartRows extends DateProcessor {
8736
8810
  }
8737
8811
  leftLabelContainer() {
8738
8812
  const template = '<div class="' + ((this.leftTaskLabelTemplateFunction) ? leftLabelTempContainer :
8739
- leftLabelContainer) + ' ' + '" tabindex="-1" style="height:' +
8813
+ leftLabelContainer) + ' ' + '" tabindex="-1" role="LeftLabel" style="height:' +
8740
8814
  (this.parent.rowHeight - 2) + 'px;width:' + this.taskNameWidth(this.templateData) + '"></div>';
8741
8815
  return this.createDivElement(template);
8742
8816
  }
@@ -8748,7 +8822,7 @@ class ChartRows extends DateProcessor {
8748
8822
  const template = '<div class="' + taskBarMainContainer + ' ' +
8749
8823
  this.parent.getUnscheduledTaskClass(data.ganttProperties) + ' ' +
8750
8824
  ((data.ganttProperties.cssClass) ? data.ganttProperties.cssClass : '') + '" ' +
8751
- ' tabindex="-1" style="' + ((data.ganttProperties.isMilestone && !manualParent) ?
8825
+ ' tabindex="-1" role="TaskBar" style="' + ((data.ganttProperties.isMilestone && !manualParent) ?
8752
8826
  ('width:' + this.milestoneHeight + 'px;height:' +
8753
8827
  this.milestoneHeight + 'px;margin-top:' + this.milestoneMarginTop + 'px;left:' + (data.ganttProperties.left -
8754
8828
  (this.milestoneHeight / 2)) + 'px;') : ('width:' + data.ganttProperties.width +
@@ -8759,26 +8833,26 @@ class ChartRows extends DateProcessor {
8759
8833
  }
8760
8834
  rightLabelContainer() {
8761
8835
  const template = '<div class="' + ((this.rightTaskLabelTemplateFunction) ? rightLabelTempContainer :
8762
- rightLabelContainer) + '" ' + ' tabindex="-1" style="left:' + this.getRightLabelLeft(this.templateData) + 'px;height:'
8836
+ rightLabelContainer) + '" ' + ' tabindex="-1" role="RightLabel" style="left:' + this.getRightLabelLeft(this.templateData) + 'px; height:'
8763
8837
  + (this.parent.rowHeight - 2) + 'px;"></div>';
8764
8838
  return this.createDivElement(template);
8765
8839
  }
8766
8840
  childTaskbarLeftResizer() {
8767
8841
  const lResizerLeft = -(this.parent.isAdaptive ? 12 : 2);
8768
8842
  const template = '<div class="' + taskBarLeftResizer + ' ' + icon + '"' +
8769
- ' style="left:' + lResizerLeft + 'px;height:' + (this.taskBarHeight) + 'px;"></div>';
8843
+ ' role="LeftResizer" style="left:' + lResizerLeft + 'px;height:' + (this.taskBarHeight) + 'px;"></div>';
8770
8844
  return this.createDivElement(template);
8771
8845
  }
8772
8846
  childTaskbarRightResizer() {
8773
8847
  const rResizerLeft = this.parent.isAdaptive ? -2 : -10;
8774
8848
  const template = '<div class="' + taskBarRightResizer + ' ' + icon + '"' +
8775
- ' style="left:' + (this.templateData.ganttProperties.width + rResizerLeft) + 'px;' +
8849
+ ' role="RightResizer" style="left:' + (this.templateData.ganttProperties.width + rResizerLeft) + 'px;' +
8776
8850
  'height:' + (this.taskBarHeight) + 'px;"></div>';
8777
8851
  return this.createDivElement(template);
8778
8852
  }
8779
8853
  childTaskbarProgressResizer() {
8780
8854
  const template = '<div class="' + childProgressResizer + '"' +
8781
- ' style="left:' + (this.templateData.ganttProperties.progressWidth - 6) + 'px;margin-top:' +
8855
+ ' role="ProgressResizer" style="left:' + (this.templateData.ganttProperties.progressWidth - 6) + 'px;margin-top:' +
8782
8856
  (this.taskBarHeight - 4) + 'px;"><div class="' + progressBarHandler + '"' +
8783
8857
  '><div class="' + progressHandlerElement + '"></div>' +
8784
8858
  '<div class="' + progressBarHandlerAfter + '"></div></div>';
@@ -8976,10 +9050,13 @@ class ChartRows extends DateProcessor {
8976
9050
  * @private
8977
9051
  */
8978
9052
  initChartHelperPrivateVariable() {
9053
+ let taskbarHeightValue = this.parent.renderBaseline ? 0.45 : 0.62;
9054
+ let taskBarMarginTopValue = this.parent.renderBaseline ? 4 : 2;
9055
+ let milestoneHeightValue = this.parent.renderBaseline ? 1.13 : 0.82;
8979
9056
  this.baselineColor = !isNullOrUndefined(this.parent.baselineColor) &&
8980
9057
  this.parent.baselineColor !== '' ? this.parent.baselineColor : null;
8981
9058
  this.taskBarHeight = isNullOrUndefined(this.parent.taskbarHeight) || this.parent.taskbarHeight >= this.parent.rowHeight ?
8982
- Math.floor(this.parent.rowHeight * 0.62) : this.parent.taskbarHeight; // 0.62 -- Standard Ratio.
9059
+ Math.floor(this.parent.rowHeight * taskbarHeightValue) : this.parent.taskbarHeight; // 0.62 -- Standard Ratio.
8983
9060
  if (this.parent.renderBaseline) {
8984
9061
  let height;
8985
9062
  if ((this.taskBarHeight + this.baselineHeight) <= this.parent.rowHeight) {
@@ -8990,11 +9067,11 @@ class ChartRows extends DateProcessor {
8990
9067
  }
8991
9068
  this.taskBarHeight = height;
8992
9069
  }
8993
- this.milestoneHeight = Math.floor(this.taskBarHeight * 0.82); // 0.82 -- Standard Ratio.
8994
- this.taskBarMarginTop = Math.floor((this.parent.rowHeight - this.taskBarHeight) / 2);
9070
+ this.milestoneHeight = Math.floor(this.taskBarHeight * milestoneHeightValue); // 0.82 -- Standard Ratio.
9071
+ this.taskBarMarginTop = Math.floor((this.parent.rowHeight - this.taskBarHeight) / taskBarMarginTopValue);
8995
9072
  this.milestoneMarginTop = Math.floor((this.parent.rowHeight - this.milestoneHeight) / 2);
8996
9073
  this.milesStoneRadius = Math.floor((this.milestoneHeight) / 2);
8997
- this.baselineTop = -(Math.floor((this.parent.rowHeight - (this.taskBarHeight + this.taskBarMarginTop))) - 1);
9074
+ this.baselineTop = -(Math.floor((this.parent.rowHeight - (this.taskBarHeight + this.taskBarMarginTop))) - 4);
8998
9075
  this.connectorPointWidth = this.parent.isAdaptive ? Math.round(this.taskBarHeight / 2) : 8;
8999
9076
  this.connectorPointMargin = Math.floor((this.taskBarHeight / 2) - (this.connectorPointWidth / 2));
9000
9077
  }
@@ -9188,6 +9265,7 @@ class ChartRows extends DateProcessor {
9188
9265
  const indicators = this.templateData.ganttProperties.indicators;
9189
9266
  for (let indicatorIndex = 0; indicatorIndex < indicators.length; indicatorIndex++) {
9190
9267
  taskIndicatorNode = this.getIndicatorNode(indicators[indicatorIndex]);
9268
+ taskIndicatorNode[0].setAttribute('aria-label', indicators[indicatorIndex].name);
9191
9269
  if (indicators[indicatorIndex].name.indexOf('$') > -1 || indicators[indicatorIndex].name.indexOf('#') > -1) {
9192
9270
  taskIndicatorTextFunction = this.templateCompiler(indicators[indicatorIndex].name);
9193
9271
  taskIndicatorTextNode = taskIndicatorTextFunction(extend({ index: i }, this.templateData), this.parent, 'indicatorLabelText');
@@ -9465,6 +9543,18 @@ class ChartRows extends DateProcessor {
9465
9543
  }
9466
9544
  getResourceParent(record) {
9467
9545
  const chartRows = this.parent.ganttChartModule.getChartRows();
9546
+ //Below code is for rendering taskbartemplate in resource view with multi taskbar
9547
+ if (this.parent.initialChartRowElements) {
9548
+ for (let j = 0; j <= this.parent.initialChartRowElements.length; j++) {
9549
+ if (!isNullOrUndefined(chartRows[j])) {
9550
+ if (!isNullOrUndefined(chartRows[j].childNodes[0].childNodes[1].childNodes[2]) &&
9551
+ !isNullOrUndefined(this.parent.initialChartRowElements[j].childNodes[0].childNodes[1].childNodes[2])) {
9552
+ // eslint-disable-next-line
9553
+ chartRows[j].childNodes[0].childNodes[1].childNodes[2]['innerHTML'] = this.parent.initialChartRowElements[j].childNodes[0].childNodes[1].childNodes[2]['innerHTML'];
9554
+ }
9555
+ }
9556
+ }
9557
+ }
9468
9558
  this.templateData = record;
9469
9559
  const parentTrNode = this.getTableTrNode();
9470
9560
  const leftLabelNode = this.leftLabelContainer();
@@ -10406,7 +10496,7 @@ class ConnectorLine {
10406
10496
  for (let i = 0; i < childNodes.length; i++) {
10407
10497
  const innerChild = childNodes[i].childNodes;
10408
10498
  for (let j = 0; j < innerChild.length; j++) {
10409
- const ariaString = this.parent.connectorLineModule.generateAriaLabel(ariaConnector[i]);
10499
+ const ariaString = 'Connector Line ' + this.parent.connectorLineModule.generateAriaLabel(ariaConnector[i]);
10410
10500
  innerChild[j].setAttribute('aria-label', ariaString);
10411
10501
  }
10412
10502
  }
@@ -10663,7 +10753,11 @@ class ConnectorLine {
10663
10753
  let connectorContainer = '';
10664
10754
  const isVirtual = this.parent.virtualScrollModule && this.parent.enableVirtualization;
10665
10755
  const connectorLine$$1 = this.getPosition(data, this.getParentPosition(data), height);
10666
- const heightValue = isVirtual ? connectorLine$$1.height : height;
10756
+ let isMilestoneValue = 0;
10757
+ if (this.parent.renderBaseline) {
10758
+ isMilestoneValue = (data.milestoneParent && data.milestoneChild) ? 0 : data.milestoneParent ? -5 : data.milestoneChild ? 5 : 0;
10759
+ }
10760
+ const heightValue = isVirtual ? connectorLine$$1.height : (height + isMilestoneValue);
10667
10761
  if (this.getParentPosition(data)) {
10668
10762
  connectorContainer = '<div id="ConnectorLine' + data.connectorLineId + '" style="background-color:black">';
10669
10763
  let div = '<div class="' + connectorLineContainer +
@@ -10691,7 +10785,7 @@ class ConnectorLine {
10691
10785
  this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
10692
10786
  if (this.getParentPosition(data) === 'FSType1') {
10693
10787
  div = div + 'left:' + (data.parentLeft + data.parentWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
10694
- ((data.parentIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1))) + 'px;' +
10788
+ ((data.parentIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
10695
10789
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FSType1">';
10696
10790
  div = div + eLine;
10697
10791
  div = div + 'left:' + (isMilestoneParent ? -1 : 0) + 'px;width:' + (isMilestoneParent ?
@@ -10712,7 +10806,7 @@ class ConnectorLine {
10712
10806
  }
10713
10807
  if (this.getParentPosition(data) === 'FSType2') {
10714
10808
  div = div + 'left:' + data.parentLeft + 'px;top:' + (isVirtual ? connectorLine$$1.top : ((data.parentIndex * data.rowHeight) +
10715
- this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1))) + 'px;' +
10809
+ this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
10716
10810
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FSType2">';
10717
10811
  div = div + eLine;
10718
10812
  div = div + 'left:' + (isMilestoneParent ? data.parentWidth - 1 : data.parentWidth) + 'px;width:' +
@@ -10743,7 +10837,7 @@ class ConnectorLine {
10743
10837
  }
10744
10838
  if (this.getParentPosition(data) === 'FSType3') {
10745
10839
  div = div + 'left:' + (data.childLeft - 20) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
10746
- ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1))) + 'px;' +
10840
+ ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
10747
10841
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FSType3">';
10748
10842
  div = div + rightArrow;
10749
10843
  div = div + 'left:10px;' + this.getBorderStyles('left', 10) +
@@ -10773,7 +10867,7 @@ class ConnectorLine {
10773
10867
  }
10774
10868
  if (this.getParentPosition(data) === 'FSType4') {
10775
10869
  div = div + 'left:' + (data.parentLeft + data.parentWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
10776
- ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1))) + 'px;' +
10870
+ ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
10777
10871
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FSType4">';
10778
10872
  div = div + rightArrow;
10779
10873
  div = div + 'left:' + (data.childLeft - (data.parentLeft + data.parentWidth + 10)) + 'px;' +
@@ -10799,7 +10893,7 @@ class ConnectorLine {
10799
10893
  }
10800
10894
  if (this.getParentPosition(data) === 'SSType4') {
10801
10895
  div = div + 'left:' + (data.parentLeft - 10) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
10802
- ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1))) + 'px;' +
10896
+ ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
10803
10897
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SSType4">';
10804
10898
  div = div + rightArrow;
10805
10899
  div = div + 'left:' + (data.childLeft - data.parentLeft) + 'px;' + duplicateStingTwo;
@@ -10812,7 +10906,7 @@ class ConnectorLine {
10812
10906
  }
10813
10907
  if (this.getParentPosition(data) === 'SSType3') {
10814
10908
  div = div + 'left:' + (data.childLeft - 20) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
10815
- ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1))) + 'px;' +
10909
+ ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
10816
10910
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SSType3">';
10817
10911
  div = div + rightArrow;
10818
10912
  div = div + 'left:10px;' + duplicateStingTwo;
@@ -10825,7 +10919,7 @@ class ConnectorLine {
10825
10919
  }
10826
10920
  if (this.getParentPosition(data) === 'SSType2') {
10827
10921
  div = div + 'left:' + setInnerElementLeftSSType2 + 'px;top:' + (isVirtual ? connectorLine$$1.top :
10828
- ((data.parentIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1))) + 'px;' +
10922
+ ((data.parentIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
10829
10923
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SSType2">';
10830
10924
  div = div + eLine;
10831
10925
  div = div + 'width:' + (setInnerChildWidthSSType2 + 1) + 'px;' +
@@ -10846,7 +10940,7 @@ class ConnectorLine {
10846
10940
  if (this.getParentPosition(data) === 'SSType1') {
10847
10941
  div = div + 'left:' + (data.childLeft - 20) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
10848
10942
  ((data.parentIndex * data.rowHeight) +
10849
- this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1))) + 'px;' +
10943
+ this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
10850
10944
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SSType1">';
10851
10945
  div = div + eLine;
10852
10946
  div = div + 'width:' + (data.parentLeft - data.childLeft + 21) + 'px;' +
@@ -10863,7 +10957,7 @@ class ConnectorLine {
10863
10957
  }
10864
10958
  if (this.getParentPosition(data) === 'FFType1') {
10865
10959
  div = div + 'left:' + (data.childLeft + data.childWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
10866
- ((data.parentIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1))) + 'px;' +
10960
+ ((data.parentIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
10867
10961
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FFType1">';
10868
10962
  div = div + eLine;
10869
10963
  div = div + 'left:' + (isMilestoneParent ? (((data.parentLeft + data.parentWidth) -
@@ -10887,7 +10981,7 @@ class ConnectorLine {
10887
10981
  }
10888
10982
  if (this.getParentPosition(data) === 'FFType2') {
10889
10983
  div = div + 'left:' + (data.parentLeft + data.parentWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
10890
- ((data.parentIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1))) + 'px;' +
10984
+ ((data.parentIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
10891
10985
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FFType2">';
10892
10986
  div = div + eLine;
10893
10987
  div = div + (isMilestoneParent ? 'left:-1px;' : '') + 'width:' +
@@ -10913,7 +11007,7 @@ class ConnectorLine {
10913
11007
  }
10914
11008
  if (this.getParentPosition(data) === 'FFType3') {
10915
11009
  div = div + 'left:' + (data.childLeft + data.childWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
10916
- ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1))) + 'px;' +
11010
+ ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
10917
11011
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FFType3">';
10918
11012
  div = div + duplicateStingOne;
10919
11013
  div = div + eLine;
@@ -10936,7 +11030,7 @@ class ConnectorLine {
10936
11030
  }
10937
11031
  if (this.getParentPosition(data) === 'FFType4') {
10938
11032
  div = div + 'left:' + (data.parentLeft + data.parentWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
10939
- ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1))) + 'px;' +
11033
+ ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
10940
11034
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="FFType4">';
10941
11035
  div = div + leftArrow;
10942
11036
  div = div + ('left:' + ((data.childLeft + data.childWidth) -
@@ -10965,7 +11059,7 @@ class ConnectorLine {
10965
11059
  }
10966
11060
  if (this.getParentPosition(data) === 'SFType4') {
10967
11061
  div = div + 'left:' + (data.parentLeft - 10) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
10968
- ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1))) + 'px;width:1px;' +
11062
+ ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;width:1px;' +
10969
11063
  'height:' + heightValue + 'px;position:absolute" data-connectortype="SFType4">';
10970
11064
  div = div + duplicateStingFour + 'top:' + (-5 - this.lineStroke + (this.lineStroke - 1)) + 'px;' +
10971
11065
  'border-bottom-width:' + (5 + this.lineStroke) +
@@ -10993,7 +11087,7 @@ class ConnectorLine {
10993
11087
  }
10994
11088
  if (this.getParentPosition(data) === 'SFType3') {
10995
11089
  div = div + 'left:' + (data.childLeft + data.childWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
10996
- ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1))) + 'px;' +
11090
+ ((data.childIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
10997
11091
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SFType3">';
10998
11092
  div = div + duplicateStingOne;
10999
11093
  div = div + eLine;
@@ -11011,7 +11105,7 @@ class ConnectorLine {
11011
11105
  }
11012
11106
  if (this.getParentPosition(data) === 'SFType1') {
11013
11107
  div = div + 'left:' + (data.parentLeft - 10) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11014
- ((data.parentIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1))) + 'px;' +
11108
+ ((data.parentIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestone) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11015
11109
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SFType1">';
11016
11110
  div = div + eLine;
11017
11111
  div = div + 'width:11px;' + this.getBorderStyles('top', this.lineStroke) + 'position:relative;"></div>';
@@ -11036,7 +11130,7 @@ class ConnectorLine {
11036
11130
  }
11037
11131
  if (this.getParentPosition(data) === 'SFType2') {
11038
11132
  div = div + 'left:' + (data.childLeft + data.childWidth) + 'px;top:' + (isVirtual ? connectorLine$$1.top :
11039
- ((data.parentIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1))) + 'px;' +
11133
+ ((data.parentIndex * data.rowHeight) + this.getTaskbarMidpoint(isMilestoneParent) - (this.lineStroke - 1) - isMilestoneValue)) + 'px;' +
11040
11134
  'width:1px;height:' + heightValue + 'px;position:absolute" data-connectortype="SFType2">';
11041
11135
  div = div + eLine;
11042
11136
  div = div + 'left:' + (((data.parentLeft) - (data.childLeft + data.childWidth)) - 10) +
@@ -11278,6 +11372,7 @@ class Splitter$1 {
11278
11372
  this.splitterObject.paneSettings[1].size = null;
11279
11373
  this.splitterObject.paneSettings[1].size = this.getSpliterPositionInPercentage(this.splitterPreviousPositionChart);
11280
11374
  }
11375
+ this.parent.timelineModule.updateTimelineAfterZooming(this.parent.timelineModule.timelineEndDate, true);
11281
11376
  callBackPromise.resolve(splitterResizedArgs);
11282
11377
  });
11283
11378
  return callBackPromise;
@@ -11559,6 +11654,7 @@ class Tooltip$1 {
11559
11654
  * @returns {void} .
11560
11655
  */
11561
11656
  updateTooltipPosition(args) {
11657
+ args.element.style.visibility = 'visible';
11562
11658
  if (isNullOrUndefined(this.tooltipMouseEvent) || args.target.classList.contains('e-notes-info')) {
11563
11659
  return;
11564
11660
  }
@@ -11588,7 +11684,6 @@ class Tooltip$1 {
11588
11684
  tooltipPositionY = tooltipPositionY + 10;
11589
11685
  }
11590
11686
  args.element.style.top = tooltipPositionY + 'px';
11591
- args.element.style.visibility = 'visible';
11592
11687
  }
11593
11688
  /**
11594
11689
  * Method to get mouse pointor position
@@ -11630,9 +11725,16 @@ class Tooltip$1 {
11630
11725
  switch (elementType) {
11631
11726
  case 'milestone':
11632
11727
  {
11633
- const sDate = !isNullOrUndefined(data.startDate) ? '<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td>' +
11728
+ let milestoneStartDate;
11729
+ if (args.target.className.includes('e-baseline-gantt-milestone') && !isNullOrUndefined(data.baselineStartDate)) {
11730
+ milestoneStartDate = data.baselineStartDate;
11731
+ }
11732
+ else if (!isNullOrUndefined(data.startDate)) {
11733
+ milestoneStartDate = data.startDate;
11734
+ }
11735
+ const sDate = !isNullOrUndefined(milestoneStartDate) ? '<tr><td class = "e-gantt-tooltip-label"> Date</td><td>:</td>' +
11634
11736
  '<td class = "e-gantt-tooltip-value">' +
11635
- this.parent.getFormatedDate(data.startDate, this.parent.getDateFormat()) + '</td></tr>' : '';
11737
+ this.parent.getFormatedDate(milestoneStartDate, this.parent.getDateFormat()) + '</td></tr>' : '';
11636
11738
  content$$1 = '<table class = "e-gantt-tooltiptable"><tbody>' +
11637
11739
  taskName + sDate + '</tbody></table>';
11638
11740
  break;
@@ -12850,7 +12952,7 @@ let Gantt = class Gantt extends Component {
12850
12952
  gridHeight = 'calc(100% - ' + timelineContainer + 'px)';
12851
12953
  // eslint-disable-next-line
12852
12954
  this.element.getElementsByClassName('e-chart-scroll-container e-content')[0]['style'].height = 'calc(100% - ' + timelineContainer + 'px)';
12853
- if (!isNullOrUndefined(this.toolbarModule)) {
12955
+ if (!isNullOrUndefined(this.toolbarModule) && !isNullOrUndefined(this.toolbarModule.element)) {
12854
12956
  this.splitterElement.style.height = 'calc(100% - ' + this.toolbarModule.element.offsetHeight + 'px)';
12855
12957
  }
12856
12958
  else {
@@ -12887,6 +12989,7 @@ let Gantt = class Gantt extends Component {
12887
12989
  this.getCurrentRecords(args);
12888
12990
  }
12889
12991
  this.notify('recordsUpdated', {});
12992
+ this.initialChartRowElements = this.ganttChartModule.getChartRows();
12890
12993
  this.isLoad = false;
12891
12994
  this.trigger('dataBound', args);
12892
12995
  }
@@ -13385,7 +13488,7 @@ let Gantt = class Gantt extends Component {
13385
13488
  */
13386
13489
  updateGridLineContainerHeight() {
13387
13490
  if (this.chartVerticalLineContainer) {
13388
- this.chartVerticalLineContainer.style.height = formatUnit(this.getContentHeight());
13491
+ this.chartVerticalLineContainer.style.height = formatUnit(this.contentHeight);
13389
13492
  }
13390
13493
  }
13391
13494
  /**
@@ -15293,7 +15396,8 @@ class CellEdit {
15293
15396
  args.cancel = true;
15294
15397
  return;
15295
15398
  }
15296
- if (data.hasChildRecords && (field === taskSettings.endDate || field === taskSettings.duration
15399
+ if (data.hasChildRecords && ((field === taskSettings.endDate && ((!isNullOrUndefined(data['isManual']) &&
15400
+ data['isManual'] == false) || this.parent.taskMode == 'Auto')) || field === taskSettings.duration
15297
15401
  || field === taskSettings.dependency || field === taskSettings.progress
15298
15402
  || field === taskSettings.work || field === 'taskType')) {
15299
15403
  args.cancel = true;
@@ -18225,6 +18329,13 @@ class DialogEdit {
18225
18329
  dialogModel.target = document.body;
18226
18330
  dialogModel.close = this.dialogClose.bind(this);
18227
18331
  dialogModel.closeOnEscape = true;
18332
+ dialogModel.beforeClose = function (args) {
18333
+ if (args.closedBy == "escape") {
18334
+ if (args.event.name == "key-pressed" && args.event.target.nodeName == 'INPUT') {
18335
+ args.cancel = true;
18336
+ }
18337
+ }
18338
+ };
18228
18339
  dialogModel.open = (args) => {
18229
18340
  const dialogElement = getValue('element', args);
18230
18341
  const generalTabElement = dialogElement.querySelector('#' + this.parent.element.id + 'GeneralTabContainer');
@@ -18509,6 +18620,8 @@ class DialogEdit {
18509
18620
  }
18510
18621
  else if (id === ganttObj.element.id + 'NotesTabContainer') {
18511
18622
  document.getElementById(id).ej2_instances[0].refresh();
18623
+ let notesTabElement = document.querySelector('#' + this.parent.element.id + 'NotesTabContainer');
18624
+ notesTabElement.style.overflow = 'scroll';
18512
18625
  }
18513
18626
  else if (id === ganttObj.element.id + 'SegmentsTabContainer') {
18514
18627
  if (isNullOrUndefined(this.beforeOpenArgs.rowData.ganttProperties.startDate)) {
@@ -19389,7 +19502,8 @@ class DialogEdit {
19389
19502
  disabled = true;
19390
19503
  }
19391
19504
  if (this.editedRecord.hasChildRecords) {
19392
- if (column.field === this.parent.taskFields.endDate || column.field === this.parent.taskFields.duration ||
19505
+ if ((column.field === this.parent.taskFields.endDate && ((!isNullOrUndefined(this.editedRecord['isManual']) &&
19506
+ this.editedRecord['isManual'] == false) || this.parent.taskMode == 'Auto')) || column.field === this.parent.taskFields.duration ||
19393
19507
  column.field === this.parent.taskFields.progress || column.field === this.parent.taskFields.work ||
19394
19508
  column.field === 'taskType') {
19395
19509
  disabled = true;
@@ -23191,14 +23305,20 @@ class Edit$2 {
23191
23305
  }
23192
23306
  else {
23193
23307
  childIndex = parentItem.childRecords.length;
23194
- } /*Child collection update*/
23308
+ }
23309
+ /*Child collection update*/
23195
23310
  parentItem.childRecords.splice(childIndex, 0, record);
23196
23311
  if ((this.parent.dataSource instanceof DataManager &&
23197
23312
  isNullOrUndefined(parentItem.taskData[this.parent.taskFields.parentID])) ||
23198
23313
  !isNullOrUndefined(this.parent.dataSource)) {
23199
23314
  const child = this.parent.taskFields.child;
23200
23315
  if (parentItem.taskData[child] && parentItem.taskData[child].length > 0) {
23201
- parentItem.taskData[child].splice(childIndex, 0, record.taskData);
23316
+ if (rowPosition === 'Above' || rowPosition === 'Below') {
23317
+ parentItem.taskData[child].splice(childIndex, 0, record.taskData);
23318
+ }
23319
+ else {
23320
+ parentItem.taskData[child].push(record.taskData);
23321
+ }
23202
23322
  }
23203
23323
  else {
23204
23324
  parentItem.taskData[child] = [];
@@ -23654,6 +23774,9 @@ class Edit$2 {
23654
23774
  }
23655
23775
  this.addSuccess(args);
23656
23776
  args = this.constructTaskAddedEventArgs(cAddedRecord, args.modifiedRecords, 'add');
23777
+ if (this.dialogModule.isAddNewResource && !this.parent.isEdit && this.parent.taskFields.work) {
23778
+ this.parent.dataOperation.updateWorkWithDuration(cAddedRecord[0]);
23779
+ }
23657
23780
  this.parent.trigger('actionComplete', args);
23658
23781
  if (this.dialogModule.dialog && !this.dialogModule.dialogObj.isDestroyed) {
23659
23782
  this.dialogModule.dialogObj.hide();
@@ -24570,11 +24693,13 @@ class Filter$1 {
24570
24693
  // ...
24571
24694
  }
24572
24695
  closeFilterOnContextClick(element) {
24696
+ let datePickerElement = document.querySelector('body > div.e-datepicker');
24697
+ let dateTimePickerElement = document.querySelector('body > div.e-datetimepicker');
24573
24698
  if (this.filterMenuElement && document.body.contains(this.filterMenuElement)) {
24574
24699
  const ganttElement = closest(element, '#' + this.parent.element.id)
24575
24700
  || element.querySelector('#' + this.parent.element.id);
24576
- if ((!(this.filterMenuElement.contains(element)) && !isNullOrUndefined(ganttElement)) || element.nodeName === 'HTML'
24577
- || ((element.nodeName === 'DIV') && (!element.classList.contains('e-day')))) {
24701
+ if ((!(this.filterMenuElement.contains(element)) && !isNullOrUndefined(ganttElement)) || (!(this.filterMenuElement.contains(element)) && (isNullOrUndefined(datePickerElement))
24702
+ && (isNullOrUndefined(dateTimePickerElement)) && ((element.nodeName === 'DIV') || (element.nodeName === 'HTML')))) {
24578
24703
  remove(this.filterMenuElement);
24579
24704
  this.parent.treeGrid.grid.notify('filter-menu-close', { isOpen: false });
24580
24705
  this.filterMenuElement = null;
@@ -25763,6 +25888,7 @@ class NonWorkingDay {
25763
25888
  this.nonworkingContainer = createElement('div', {
25764
25889
  className: nonworkingContainer
25765
25890
  });
25891
+ this.nonworkingContainer.setAttribute("role", "NonWorkingDays");
25766
25892
  this.parent.ganttChartModule.chartBodyContent.appendChild(this.nonworkingContainer);
25767
25893
  }
25768
25894
  }
@@ -25800,8 +25926,11 @@ class NonWorkingDay {
25800
25926
  let toDate;
25801
25927
  const container = createElement('div');
25802
25928
  const height = this.parent.contentHeight;
25803
- const scrollElement = this.parent.ganttChartModule.scrollElement;
25804
- const viewportHeight = parseInt(scrollElement.style.height, 10);
25929
+ let toolbarHeight = 0;
25930
+ if (!isNullOrUndefined(this.parent.toolbarModule)) {
25931
+ toolbarHeight = this.parent.toolbarModule.element.offsetHeight;
25932
+ }
25933
+ const viewportHeight = this.parent.ganttHeight - toolbarHeight - this.parent.ganttChartModule.chartTimelineContainer.offsetHeight;
25805
25934
  for (let i = 0; i < this.parent.holidays.length; i++) {
25806
25935
  if (this.parent.holidays[i].from && this.parent.holidays[i].to) {
25807
25936
  fromDate = this.parent.dateValidationModule.getDateFromFormat(this.parent.holidays[i].from);
@@ -25894,9 +26023,12 @@ class NonWorkingDay {
25894
26023
  return container;
25895
26024
  }
25896
26025
  updateHolidayLabelHeight() {
25897
- const height = this.parent.contentHeight;
25898
- const scrollElement = this.parent.ganttChartModule.scrollElement;
25899
- const viewportHeight = parseInt(scrollElement.style.height, 10);
26026
+ const height = this.parent.getContentHeight();
26027
+ let toolbarHeight = 0;
26028
+ if (!isNullOrUndefined(this.parent.toolbarModule) && !isNullOrUndefined(this.parent.toolbarModule.element)) {
26029
+ toolbarHeight = this.parent.toolbarModule.element.offsetHeight;
26030
+ }
26031
+ const viewportHeight = this.parent.ganttHeight - toolbarHeight - this.parent.ganttChartModule.chartTimelineContainer.offsetHeight;
25900
26032
  const top = (viewportHeight < height) ? viewportHeight / 2 : height / 2;
25901
26033
  const labels = this.holidayContainer.querySelectorAll('.' + holidayLabel);
25902
26034
  for (let i = 0; i < labels.length; i++) {
@@ -25952,6 +26084,7 @@ class EventMarker$1 {
25952
26084
  this.eventMarkersContainer = createElement('div', {
25953
26085
  className: eventMarkersContainer
25954
26086
  });
26087
+ this.eventMarkersContainer.setAttribute("role", "EventMarker");
25955
26088
  this.parent.ganttChartModule.chartBodyContent.appendChild(this.eventMarkersContainer);
25956
26089
  }
25957
26090
  this.eventMarkersContainer.innerHTML = '';
@@ -27022,10 +27155,12 @@ class RowDD$1 {
27022
27155
  }
27023
27156
  }
27024
27157
  if (!args.cancel) {
27025
- args.cancel = true;
27026
27158
  args.requestType = 'beforeDrop';
27027
27159
  this.parent.trigger('actionBegin', args);
27028
- this.dropRows(args, true); // method to update the data collections based on drop action
27160
+ if (!args.cancel) {
27161
+ this.dropRows(args, true); // method to update the data collections based on drop action
27162
+ args.cancel = true;
27163
+ }
27029
27164
  }
27030
27165
  }
27031
27166
  dropRows(args, isByMethod) {
@@ -27122,19 +27257,31 @@ class RowDD$1 {
27122
27257
  let data = gObj.flatData;
27123
27258
  let startIndex;
27124
27259
  let endIndex;
27260
+ let ganttData = this.parent.dataSource;
27261
+ let uniqueTaskID = this.parent.taskFields.id;
27125
27262
  if (draggedRecord.index < droppedRecord.index) {
27126
27263
  startIndex = draggedRecord.index;
27127
- endIndex = droppedRecord.index;
27264
+ for (let i = 0; i < ganttData.length; i++) {
27265
+ let currentData = this.parent.currentViewData.filter(function (e) {
27266
+ return e[uniqueTaskID] === ganttData[i][uniqueTaskID];
27267
+ })[0];
27268
+ if (currentData.index > droppedRecord.index) {
27269
+ endIndex = currentData.index;
27270
+ break;
27271
+ }
27272
+ }
27128
27273
  }
27129
27274
  else {
27130
27275
  startIndex = droppedRecord.index;
27131
- let rootChildRecord = draggedRecord;
27132
- if (rootChildRecord.childRecords.length > 0) {
27133
- do {
27134
- rootChildRecord = rootChildRecord.childRecords[rootChildRecord.childRecords.length - 1];
27135
- } while (rootChildRecord.childRecords.length > 0);
27276
+ for (let i = 0; i < ganttData.length; i++) {
27277
+ let currentData = this.parent.currentViewData.filter(function (e) {
27278
+ return e[uniqueTaskID] === ganttData[i][uniqueTaskID];
27279
+ })[0];
27280
+ if (currentData.index > draggedRecord.index) {
27281
+ endIndex = currentData.index;
27282
+ break;
27283
+ }
27136
27284
  }
27137
- endIndex = rootChildRecord.index;
27138
27285
  }
27139
27286
  for (let i = startIndex; i <= endIndex; i++) {
27140
27287
  if (!isNullOrUndefined(data[i])) {