@syncfusion/ej2-gantt 21.2.9 → 22.1.34

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 (99) hide show
  1. package/.eslintrc.json +1 -0
  2. package/CHANGELOG.md +23 -0
  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 +751 -715
  7. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  8. package/dist/es6/ej2-gantt.es5.js +790 -755
  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 +19 -18
  14. package/src/gantt/actions/connector-line-edit.js +21 -26
  15. package/src/gantt/actions/context-menu.js +2 -2
  16. package/src/gantt/actions/critical-path.js +4 -9
  17. package/src/gantt/actions/day-markers.js +4 -1
  18. package/src/gantt/actions/edit.js +9 -6
  19. package/src/gantt/actions/pdf-export.js +1 -1
  20. package/src/gantt/actions/taskbar-edit.d.ts +6 -0
  21. package/src/gantt/actions/taskbar-edit.js +120 -45
  22. package/src/gantt/base/css-constants.d.ts +5 -10
  23. package/src/gantt/base/css-constants.js +5 -10
  24. package/src/gantt/base/date-processor.js +10 -20
  25. package/src/gantt/base/enum.d.ts +215 -231
  26. package/src/gantt/base/gantt-chart.js +112 -5
  27. package/src/gantt/base/gantt-model.d.ts +6 -3
  28. package/src/gantt/base/gantt.d.ts +7 -3
  29. package/src/gantt/base/gantt.js +17 -13
  30. package/src/gantt/base/interface.d.ts +36 -1
  31. package/src/gantt/base/task-processor.js +21 -18
  32. package/src/gantt/base/tree-grid.js +1 -1
  33. package/src/gantt/export/export-helper.js +1 -0
  34. package/src/gantt/export/pdf-connector-line.d.ts +4 -4
  35. package/src/gantt/export/pdf-connector-line.js +11 -22
  36. package/src/gantt/export/pdf-gantt.d.ts +1 -2
  37. package/src/gantt/export/pdf-gantt.js +4 -4
  38. package/src/gantt/models/column.d.ts +8 -4
  39. package/src/gantt/models/edit-settings-model.d.ts +1 -0
  40. package/src/gantt/models/edit-settings.d.ts +1 -0
  41. package/src/gantt/models/filter-settings-model.d.ts +3 -0
  42. package/src/gantt/models/filter-settings.d.ts +3 -0
  43. package/src/gantt/models/search-settings-model.d.ts +1 -0
  44. package/src/gantt/models/search-settings.d.ts +1 -0
  45. package/src/gantt/models/sort-settings-model.d.ts +1 -0
  46. package/src/gantt/models/sort-settings.d.ts +1 -0
  47. package/src/gantt/models/tooltip-settings-model.d.ts +8 -4
  48. package/src/gantt/models/tooltip-settings.d.ts +8 -4
  49. package/src/gantt/renderer/chart-rows.d.ts +1 -1
  50. package/src/gantt/renderer/chart-rows.js +27 -65
  51. package/src/gantt/renderer/connector-line.d.ts +23 -0
  52. package/src/gantt/renderer/connector-line.js +287 -384
  53. package/src/gantt/renderer/edit-tooltip.js +4 -4
  54. package/src/gantt/renderer/nonworking-day.js +2 -2
  55. package/src/gantt/renderer/tooltip.d.ts +3 -3
  56. package/src/gantt/renderer/tooltip.js +103 -76
  57. package/styles/bootstrap-dark.css +27 -47
  58. package/styles/bootstrap.css +29 -49
  59. package/styles/bootstrap4.css +29 -49
  60. package/styles/bootstrap5-dark.css +27 -47
  61. package/styles/bootstrap5.css +27 -47
  62. package/styles/fabric-dark.css +27 -47
  63. package/styles/fabric.css +27 -47
  64. package/styles/fluent-dark.css +28 -47
  65. package/styles/fluent.css +28 -47
  66. package/styles/gantt/_layout.scss +53 -7
  67. package/styles/gantt/_material3-dark-definition.scss +1 -0
  68. package/styles/gantt/_material3-definition.scss +220 -0
  69. package/styles/gantt/_theme.scss +53 -53
  70. package/styles/gantt/bootstrap-dark.css +27 -47
  71. package/styles/gantt/bootstrap.css +29 -49
  72. package/styles/gantt/bootstrap4.css +29 -49
  73. package/styles/gantt/bootstrap5-dark.css +27 -47
  74. package/styles/gantt/bootstrap5.css +27 -47
  75. package/styles/gantt/fabric-dark.css +27 -47
  76. package/styles/gantt/fabric.css +27 -47
  77. package/styles/gantt/fluent-dark.css +28 -47
  78. package/styles/gantt/fluent.css +28 -47
  79. package/styles/gantt/highcontrast-light.css +27 -47
  80. package/styles/gantt/highcontrast.css +27 -47
  81. package/styles/gantt/icons/_material3-dark.scss +1 -0
  82. package/styles/gantt/material-dark.css +27 -47
  83. package/styles/gantt/material.css +27 -47
  84. package/styles/gantt/material3-dark.css +2184 -0
  85. package/styles/gantt/material3-dark.scss +23 -0
  86. package/styles/gantt/material3.css +2240 -0
  87. package/styles/gantt/material3.scss +23 -0
  88. package/styles/gantt/tailwind-dark.css +27 -47
  89. package/styles/gantt/tailwind.css +27 -47
  90. package/styles/highcontrast-light.css +27 -47
  91. package/styles/highcontrast.css +27 -47
  92. package/styles/material-dark.css +27 -47
  93. package/styles/material.css +27 -47
  94. package/styles/material3-dark.css +2184 -0
  95. package/styles/material3-dark.scss +3 -0
  96. package/styles/material3.css +2240 -0
  97. package/styles/material3.scss +3 -0
  98. package/styles/tailwind-dark.css +27 -47
  99. package/styles/tailwind.css +27 -47
@@ -437,6 +437,16 @@ var GanttChart = /** @class */ (function () {
437
437
  if (this.parent.isDestroyed || e.which === 3) {
438
438
  return;
439
439
  }
440
+ var resizeCheck = this.parent.ganttChartModule.chartBodyContainer.querySelector('.e-taskbar-resize-div');
441
+ if (!isNullOrUndefined(resizeCheck)) {
442
+ resizeCheck.remove();
443
+ }
444
+ var Check = this.parent.ganttChartModule.chartBodyContainer.querySelector('.e-clone-taskbar');
445
+ if (!isNullOrUndefined(Check)) {
446
+ var clonetbody = Check.parentElement;
447
+ var cloneTable = clonetbody.parentElement;
448
+ cloneTable.remove();
449
+ }
440
450
  var isTaskbarEdited = false;
441
451
  if (this.parent.editSettings.allowTaskbarEditing &&
442
452
  getValue('editModule.taskbarEditModule.isMouseDragged', this.parent) &&
@@ -998,6 +1008,71 @@ var GanttChart = /** @class */ (function () {
998
1008
  $target.closest('.e-chart-row') ? $target.closest('.e-chart-row').rowIndex : -1;
999
1009
  var isTab = (e.action === 'tab') ? true : false;
1000
1010
  var nextElement = this.getNextElement($target, isTab, isInEditedState);
1011
+ if (nextElement && $target.classList.contains('e-headercell')) {
1012
+ var colIndex = parseInt(nextElement.getAttribute('data-colindex'));
1013
+ if (e.action === 'shiftTab') {
1014
+ while (colIndex != -1 && !this.parent.treeGrid.columns[colIndex]['visible']) {
1015
+ colIndex = colIndex - 1;
1016
+ }
1017
+ if (colIndex != -1) {
1018
+ nextElement = document.getElementsByClassName('e-columnheader')[0].childNodes[colIndex];
1019
+ }
1020
+ else {
1021
+ var toolbarItems = document.getElementsByClassName('e-toolbar-item');
1022
+ for (var i = toolbarItems.length - 1; i > 0; i--) {
1023
+ if (!document.getElementsByClassName('e-toolbar-item')[i].classList.contains('e-hidden')) {
1024
+ nextElement = document.getElementsByClassName('e-toolbar-item')[i];
1025
+ break;
1026
+ }
1027
+ }
1028
+ }
1029
+ }
1030
+ else {
1031
+ while (!this.parent.treeGrid.columns[colIndex]['visible']) {
1032
+ colIndex = colIndex + 1;
1033
+ }
1034
+ nextElement = document.getElementsByClassName('e-columnheader')[0].childNodes[colIndex];
1035
+ }
1036
+ }
1037
+ if (!nextElement && e.action === 'shiftTab' && $target.classList.contains('e-headercell')) {
1038
+ var toolbarItems = document.getElementsByClassName('e-toolbar-item');
1039
+ for (var i = toolbarItems.length - 1; i > 0; i--) {
1040
+ if (!document.getElementsByClassName('e-toolbar-item')[i].classList.contains('e-hidden')) {
1041
+ nextElement = document.getElementsByClassName('e-toolbar-item')[i];
1042
+ break;
1043
+ }
1044
+ }
1045
+ }
1046
+ if ($target.classList.contains('e-treegrid') && !nextElement) {
1047
+ for (var i = 0; i < this.parent.treeGrid.columns.length; i++) {
1048
+ if (this.parent.treeGrid.columns[i]['visible']) {
1049
+ nextElement = document.getElementsByClassName('e-columnheader')[0].childNodes[i];
1050
+ break;
1051
+ }
1052
+ }
1053
+ }
1054
+ if (!nextElement && $target.classList.contains('e-headercell')) {
1055
+ nextElement = document.getElementsByClassName('e-timeline-header-container')[0];
1056
+ }
1057
+ if (e.action !== 'shiftTab' && $target.classList.contains('e-timeline-header-container')) {
1058
+ for (var i = 0; i < this.parent.treeGrid.columns.length; i++) {
1059
+ if (this.parent.treeGrid.columns[i]['visible']) {
1060
+ nextElement = document.getElementsByClassName('e-row')[0].childNodes[i];
1061
+ break;
1062
+ }
1063
+ }
1064
+ }
1065
+ if (e.action === 'shiftTab' && !nextElement) {
1066
+ nextElement = document.getElementsByClassName('e-timeline-header-container')[0];
1067
+ }
1068
+ if (e.action === 'shiftTab' && $target.classList.contains('e-timeline-header-container')) {
1069
+ for (var i = this.parent.treeGrid.columns.length - 1; i > 0; i--) {
1070
+ if (this.parent.treeGrid.columns[i]['visible']) {
1071
+ nextElement = document.getElementsByClassName('e-columnheader')[0].childNodes[i];
1072
+ break;
1073
+ }
1074
+ }
1075
+ }
1001
1076
  this.tempNextElement = nextElement;
1002
1077
  if (!isNullOrUndefined(nextElement) && !isNullOrUndefined(nextElement['cellIndex'])) {
1003
1078
  if (this.parent.allowRowDragAndDrop) {
@@ -1021,7 +1096,7 @@ var GanttChart = /** @class */ (function () {
1021
1096
  }
1022
1097
  if (typeof nextElement !== 'string') {
1023
1098
  if ($target.classList.contains('e-rowcell') || $target.closest('.e-chart-row-cell') ||
1024
- $target.classList.contains('e-headercell') || $target.closest('.e-segmented-taskbar')) {
1099
+ $target.classList.contains('e-headercell') || $target.closest('.e-segmented-taskbar') || $target.classList.contains('e-timeline-header-container')) {
1025
1100
  e.preventDefault();
1026
1101
  }
1027
1102
  if (isTab && $target.classList.contains('e-rowdragdrop')) {
@@ -1057,11 +1132,21 @@ var GanttChart = /** @class */ (function () {
1057
1132
  }
1058
1133
  }
1059
1134
  else {
1060
- this.parent.treeGrid.grid.notify('key-pressed', e);
1135
+ if (!nextElement || nextElement && !nextElement.classList.contains('e-headercell')) {
1136
+ if ($target.classList.contains('e-headercell')) {
1137
+ this.manageFocus($target, 'remove', false);
1138
+ }
1139
+ if (!nextElement || $target.classList.contains('e-editedbatchcell')) {
1140
+ this.parent.treeGrid.grid.notify('key-pressed', e);
1141
+ }
1142
+ }
1061
1143
  }
1062
1144
  }
1063
1145
  else {
1064
- this.parent.treeGrid.grid.notify('key-pressed', e);
1146
+ if (!nextElement.classList.contains('e-headercell') && !nextElement.classList.contains('e-rowcell')
1147
+ && !nextElement.classList.contains('e-toolbar-item')) {
1148
+ this.parent.treeGrid.grid.notify('key-pressed', e);
1149
+ }
1065
1150
  }
1066
1151
  }
1067
1152
  if (!(this.parent.editModule && this.parent.editModule.cellEditModule
@@ -1073,7 +1158,8 @@ var GanttChart = /** @class */ (function () {
1073
1158
  else {
1074
1159
  this.manageFocus($target, 'remove', true);
1075
1160
  }
1076
- if ((nextElement.classList.contains('e-rowcell') && $target.nextElementSibling) || $target.classList.contains('e-right-label-container')) {
1161
+ if ((nextElement.classList.contains('e-rowcell') && $target.nextElementSibling && !$target.classList.contains('e-timeline-header-container'))
1162
+ || $target.classList.contains('e-right-label-container')) {
1077
1163
  if (!$target.classList.contains('e-rowcell')) {
1078
1164
  this.parent.treeGrid.grid.notify('key-pressed', e);
1079
1165
  var fmodule = getValue('focusModule', this.parent.treeGrid.grid);
@@ -1085,7 +1171,17 @@ var GanttChart = /** @class */ (function () {
1085
1171
  this.manageFocus(nextElement, 'add', false);
1086
1172
  }
1087
1173
  else {
1088
- this.manageFocus(nextElement, 'add', true);
1174
+ if (nextElement && (nextElement.classList.contains('e-toolbar-item') || nextElement.classList.contains('e-headercell')
1175
+ || nextElement.classList.contains("e-rowcell"))) {
1176
+ this.manageFocus($target, 'remove', false);
1177
+ this.manageFocus(nextElement, 'add', false);
1178
+ if ($target.classList.contains('e-treegrid')) {
1179
+ e.preventDefault();
1180
+ }
1181
+ }
1182
+ else {
1183
+ this.manageFocus(nextElement, 'add', true);
1184
+ }
1089
1185
  }
1090
1186
  this.parent.focusModule.setActiveElement(nextElement);
1091
1187
  }
@@ -1172,6 +1268,17 @@ var GanttChart = /** @class */ (function () {
1172
1268
  var childElement_1 = this.getChildElement(rowElement, isTab);
1173
1269
  return childElement_1;
1174
1270
  }
1271
+ nextElement = $target;
1272
+ if (nextElement && nextElement.parentElement.classList.contains('e-toolbar-item') && this.parent.toolbarModule) {
1273
+ while (nextElement && nextElement.parentElement.classList.contains('e-toolbar-item') && nextElement.parentElement.nextElementSibling.classList.contains('e-toolbar-item')) {
1274
+ if (nextElement.parentElement.nextElementSibling.classList.contains('e-hidden')) {
1275
+ nextElement = nextElement.parentElement.nextElementSibling.childNodes[0];
1276
+ }
1277
+ else {
1278
+ return nextElement.parentElement.nextElementSibling;
1279
+ }
1280
+ }
1281
+ }
1175
1282
  }
1176
1283
  return null;
1177
1284
  };
@@ -228,22 +228,25 @@ export interface GanttModel extends ComponentModel{
228
228
  * The task bar template that renders customized child task bars from the given template.
229
229
  *
230
230
  * @default null
231
+ * @aspType string
231
232
  */
232
- taskbarTemplate?: string;
233
+ taskbarTemplate?: string | Function;
233
234
 
234
235
  /**
235
236
  * The parent task bar template that renders customized parent task bars from the given template.
236
237
  *
237
238
  * @default null
239
+ * @aspType string
238
240
  */
239
- parentTaskbarTemplate?: string;
241
+ parentTaskbarTemplate?: string | Function;
240
242
 
241
243
  /**
242
244
  * The milestone template that renders customized milestone task from the given template.
243
245
  *
244
246
  * @default null
247
+ * @aspType string
245
248
  */
246
- milestoneTemplate?: string;
249
+ milestoneTemplate?: string | Function;
247
250
 
248
251
  /**
249
252
  * Defines the baseline bar color.
@@ -497,20 +497,23 @@ export declare class Gantt extends Component<HTMLElement> implements INotifyProp
497
497
  * The task bar template that renders customized child task bars from the given template.
498
498
  *
499
499
  * @default null
500
+ * @aspType string
500
501
  */
501
- taskbarTemplate: string;
502
+ taskbarTemplate: string | Function;
502
503
  /**
503
504
  * The parent task bar template that renders customized parent task bars from the given template.
504
505
  *
505
506
  * @default null
507
+ * @aspType string
506
508
  */
507
- parentTaskbarTemplate: string;
509
+ parentTaskbarTemplate: string | Function;
508
510
  /**
509
511
  * The milestone template that renders customized milestone task from the given template.
510
512
  *
511
513
  * @default null
514
+ * @aspType string
512
515
  */
513
- milestoneTemplate: string;
516
+ milestoneTemplate: string | Function;
514
517
  /**
515
518
  * Defines the baseline bar color.
516
519
  *
@@ -1387,6 +1390,7 @@ export declare class Gantt extends Component<HTMLElement> implements INotifyProp
1387
1390
  renderGantt(isChange?: boolean): void;
1388
1391
  removeCriticalPathStyles(): void;
1389
1392
  private wireEvents;
1393
+ private keyDownHandler;
1390
1394
  /**
1391
1395
  * Method trigger while user perform window resize.
1392
1396
  *
@@ -780,19 +780,17 @@ var Gantt = /** @class */ (function (_super) {
780
780
  this.notify('initPredessorDialog', {});
781
781
  }
782
782
  this.splitterModule.updateSplitterPosition();
783
- if (this.gridLines === 'Vertical' || this.gridLines === 'Both') {
784
- this.renderChartVerticalLines();
785
- }
783
+ // if (this.gridLines === 'Vertical' || this.gridLines === 'Both') {
784
+ // this.renderChartVerticalLines();
785
+ // }
786
786
  };
787
787
  Gantt.prototype.removeCriticalPathStyles = function () {
788
788
  var ganttChartElement = this.ganttChartModule.chartElement;
789
789
  removeClass(ganttChartElement.querySelectorAll('.e-gantt-child-taskbar-inner-div'), cls.criticalChildTaskBarInnerDiv);
790
790
  removeClass(ganttChartElement.querySelectorAll('.e-gantt-child-progressbar-inner-div'), cls.criticalChildProgressBarInnerDiv);
791
- removeClass(ganttChartElement.querySelectorAll('.e-milestone-top'), cls.criticalMilestoneTop);
792
- removeClass(ganttChartElement.querySelectorAll('.e-milestone-bottom'), cls.criticalMilestoneBottom);
793
- removeClass(this.element.querySelectorAll('.e-line'), cls.criticalConnectorLine);
794
- removeClass(this.element.querySelectorAll('.e-connector-line-right-arrow'), cls.criticalConnectorLineRightArrow);
795
- removeClass(this.element.querySelectorAll('.e-connector-line-left-arrow'), cls.criticalConnectorLineLeftArrow);
791
+ removeClass(ganttChartElement.querySelectorAll('.e-critical-milestone'), cls.criticalMilestone);
792
+ removeClass(this.element.querySelectorAll('.e-connector-line'), cls.criticalConnectorLineSVG);
793
+ removeClass(this.element.querySelectorAll('.e-connector-line-arrow'), cls.criticalConnectorArrowSVG);
796
794
  };
797
795
  Gantt.prototype.wireEvents = function () {
798
796
  if (this.allowKeyboard) {
@@ -804,6 +802,15 @@ var Gantt = /** @class */ (function (_super) {
804
802
  }
805
803
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
806
804
  EventHandler.add(window, 'resize', this.windowResize, this);
805
+ EventHandler.add(document.body, 'keydown', this.keyDownHandler, this);
806
+ };
807
+ Gantt.prototype.keyDownHandler = function (e) {
808
+ if (e.altKey) {
809
+ if (e.keyCode === 74) { //alt j
810
+ this.ganttChartModule.manageFocus(this.treeGrid.element.childNodes[1], 'remove', false);
811
+ this.ganttChartModule.manageFocus(this.element, 'add', false);
812
+ }
813
+ }
807
814
  };
808
815
  /**
809
816
  * Method trigger while user perform window resize.
@@ -1907,9 +1914,9 @@ var Gantt = /** @class */ (function (_super) {
1907
1914
  if (!this.element.contains(this.chartVerticalLineContainer)) {
1908
1915
  this.chartVerticalLineContainer = createElement('div', {
1909
1916
  id: this.element.id + 'line-container',
1910
- styles: 'position:absolute;height:100%;z-index:1'
1917
+ styles: 'position:absolute;height:100%;'
1911
1918
  });
1912
- this.ganttChartModule.chartBodyContent.appendChild(this.chartVerticalLineContainer);
1919
+ this.ganttChartModule.chartBodyContent.insertBefore(this.chartVerticalLineContainer, this.ganttChartModule.chartBodyContent.lastChild);
1913
1920
  }
1914
1921
  this.chartVerticalLineContainer.innerHTML = '';
1915
1922
  var headerTable = this.element.getElementsByClassName('e-timeline-header-table-container')[1];
@@ -2298,9 +2305,6 @@ var Gantt = /** @class */ (function (_super) {
2298
2305
  this.timelineModule.updateChartByNewTimeline();
2299
2306
  this.ganttChartModule.chartBodyContent.style.width = formatUnit(this.timelineModule.totalTimelineWidth);
2300
2307
  this.ganttChartModule.updateLastRowBottomWidth();
2301
- if (this.gridLines === 'Vertical' || this.gridLines === 'Both') {
2302
- this.renderChartVerticalLines();
2303
- }
2304
2308
  if (this.taskFields.dependency) {
2305
2309
  this.ganttChartModule.reRenderConnectorLines();
2306
2310
  }
@@ -198,13 +198,21 @@ export interface IWorkTimelineRanges {
198
198
  to?: Date;
199
199
  }
200
200
  export interface IGanttColumn {
201
+ /** Defines column name */
201
202
  field?: string;
203
+ /** Defines header text of column */
202
204
  headerText?: string;
205
+ /** Defines edit type of column */
203
206
  editType?: string;
207
+ /** Defines mapping name of column */
204
208
  mappingName?: string;
209
+ /** Defines whether editing is enabled or not */
205
210
  allowEditing: boolean;
211
+ /** Defines width of column */
206
212
  width: number;
213
+ /** Defines format of column */
207
214
  format: string;
215
+ /** Defines whether column is visible or not */
208
216
  visible: boolean;
209
217
  }
210
218
  export interface IIndicator {
@@ -218,10 +226,15 @@ export interface IIndicator {
218
226
  tooltip?: string;
219
227
  }
220
228
  export interface IWorkingTimeRange {
229
+ /** Defines the from date. */
221
230
  from?: number;
231
+ /** Defines the to date. */
222
232
  to?: number;
233
+ /** Defines whether it is working day or not. */
223
234
  isWorking?: boolean;
235
+ /** Defines the color to render. */
224
236
  color?: string;
237
+ /** Defines the interval between from and to dates. */
225
238
  interval?: number;
226
239
  }
227
240
  export interface IQueryTaskbarInfoEventArgs {
@@ -285,9 +298,13 @@ export interface IKeyPressedEventArgs {
285
298
  keyEvent?: Event;
286
299
  }
287
300
  export interface ITaskDeletedEventArgs {
301
+ /** Defines the deleted records */
288
302
  deletedRecordCollection?: IGanttData[];
303
+ /** Defines the updated records */
289
304
  updatedRecordCollection?: IGanttData[];
305
+ /** Defines the event is cancel-able or not. */
290
306
  cancel?: boolean;
307
+ /** Defines the event action. */
291
308
  action?: string;
292
309
  }
293
310
  export interface IDependencyEditData {
@@ -310,11 +327,17 @@ export interface IPredecessor {
310
327
  isDrawn?: boolean;
311
328
  }
312
329
  export interface IValidateArgs {
330
+ /** Defines the gantt data. */
313
331
  data?: IGanttData;
332
+ /** Defines the record index. */
314
333
  recordIndex?: number;
334
+ /** Defines the request type */
315
335
  requestType?: string;
336
+ /** Defines whether to cancel the action or not */
316
337
  cancel?: boolean;
338
+ /** Defines the validation mode. */
317
339
  validateMode?: IValidateMode;
340
+ /** Defines the edited arguments. */
318
341
  editEventArgs?: object;
319
342
  }
320
343
  export interface ITimeSpanEventArgs {
@@ -337,12 +360,19 @@ export interface IValidateMode {
337
360
  preserveLinkWithEditing?: boolean;
338
361
  }
339
362
  export interface IActionBeginEventArgs {
363
+ /** Defines the action type. */
340
364
  requestType?: string;
365
+ /** Defines the gantt record. */
341
366
  data?: IGanttData | IGanttData[];
367
+ /** Defines the modified records. */
342
368
  modifiedRecords?: IGanttData[];
369
+ /** Defines the modified task data. */
343
370
  modifiedTaskData?: object[] | object;
371
+ /** Defines the event is cancel-able or not. */
344
372
  cancel?: boolean;
373
+ /** Defines the taskbar edit action. */
345
374
  taskBarEditAction?: string;
375
+ /** Defines the event action. */
346
376
  action?: string;
347
377
  /** Defines the target element. */
348
378
  target?: Element;
@@ -369,6 +399,10 @@ export interface IConnectorLineObject {
369
399
  parentIndexInCurrentView?: number;
370
400
  childIndexInCurrentView?: number;
371
401
  isCritical?: boolean;
402
+ parentEndPoint?: number;
403
+ childEndPoint?: number;
404
+ isManualChild?: boolean;
405
+ isManualParent?: boolean;
372
406
  }
373
407
  export interface ISplitterResizedEventArgs {
374
408
  /** Defines the element. */
@@ -412,7 +446,7 @@ export interface BeforeTooltipRenderEventArgs {
412
446
  /** Defines the original event arguments of tooltip control. */
413
447
  args?: TooltipEventArgs;
414
448
  /** Defines the content. */
415
- content?: string | Element;
449
+ content?: string | Element | Function;
416
450
  /** Cancel the tooltip */
417
451
  cancel?: boolean;
418
452
  }
@@ -527,6 +561,7 @@ export interface ZoomTimelineSettings {
527
561
  bottomTier?: TimelineTierSettingsModel;
528
562
  /** Defines timeline unit size. */
529
563
  timelineUnitSize?: number;
564
+ /** Defines the week start day. */
530
565
  weekStartDay?: number;
531
566
  /** Defines weekend background color. */
532
567
  weekendBackground?: string;
@@ -354,7 +354,7 @@ var TaskProcessor = /** @class */ (function (_super) {
354
354
  (this.parent.taskMode === 'Manual') ? false :
355
355
  data[taskSettings.manual] === true ? false : true;
356
356
  this.parent.setRecordValue('ganttProperties', ganttProperties, ganttData);
357
- if (!isNullOrUndefined(data[taskSettings.id]) && (!((this.parent.viewType === "ResourceView" && level == 0))) || data[taskSettings.name] === "Unassigned Task") {
357
+ if (!isNullOrUndefined(data[taskSettings.id])) {
358
358
  id = data[taskSettings.id];
359
359
  name = data[taskSettings.name];
360
360
  this.addTaskData(ganttData, data, isLoad);
@@ -797,7 +797,7 @@ var TaskProcessor = /** @class */ (function (_super) {
797
797
  startDate = this.getDateFromFormat(data[taskSettings.startDate], true);
798
798
  endDate = this.getDateFromFormat(data[taskSettings.endDate], true);
799
799
  }
800
- var segments = taskSettings.segments && (!isNullOrUndefined(data[taskSettings.segments]) || !isNullOrUndefined(ganttData.taskData)) ? (data[taskSettings.segments] ||
800
+ var segments = taskSettings.segments ? (data[taskSettings.segments] ||
801
801
  ganttData.taskData[taskSettings.segments]) : null;
802
802
  var isMileStone = taskSettings.milestone ? data[taskSettings.milestone] ? true : false : false;
803
803
  var durationMapping = data[taskSettings.durationUnit] ? data[taskSettings.durationUnit] : '';
@@ -1419,7 +1419,7 @@ var TaskProcessor = /** @class */ (function (_super) {
1419
1419
  var data_1 = [];
1420
1420
  var _loop_4 = function (k) {
1421
1421
  resourceData.filter(function (resourceInfo) {
1422
- if (resourceInfo[resourceSettings.id] === preTaskResources[k][resourceSettings.id]) {
1422
+ if (resourceInfo[resourceSettings.id] === preTaskResources[k][resourceSettings.id] && data_1.indexOf(preTaskResources[k]) === -1) {
1423
1423
  data_1.push(preTaskResources[k]);
1424
1424
  }
1425
1425
  });
@@ -1506,15 +1506,17 @@ var TaskProcessor = /** @class */ (function (_super) {
1506
1506
  else {
1507
1507
  hierarchicalData = this.parent.dataSource;
1508
1508
  }
1509
- hierarchicalData.map(function (record) {
1510
- if (task.ganttProperties.taskId === record[_this.parent.taskFields.id]) {
1511
- if (!isNullOrUndefined(_this.parent.taskFields.startDate)) {
1512
- task[_this.parent.taskFields.startDate] = record[_this.parent.taskFields.startDate];
1513
- }
1514
- if (!isNullOrUndefined(_this.parent.taskFields.endDate)) {
1515
- task[_this.parent.taskFields.endDate] = record[_this.parent.taskFields.endDate];
1509
+ this.parent.flatData.map(function (data) {
1510
+ hierarchicalData.map(function (record) {
1511
+ if (data.ganttProperties.taskId === record[_this.parent.taskFields.id]) {
1512
+ if (!isNullOrUndefined(_this.parent.taskFields.startDate)) {
1513
+ task[_this.parent.taskFields.endDate] = record[_this.parent.taskFields.endDate];
1514
+ }
1515
+ if (!isNullOrUndefined(_this.parent.taskFields.endDate)) {
1516
+ task[_this.parent.taskFields.endDate] = record[_this.parent.taskFields.endDate];
1517
+ }
1516
1518
  }
1517
- }
1519
+ });
1518
1520
  });
1519
1521
  };
1520
1522
  TaskProcessor.prototype.getWorkInHour = function (work, workUnit) {
@@ -1624,9 +1626,6 @@ var TaskProcessor = /** @class */ (function (_super) {
1624
1626
  return resourceIdCollection;
1625
1627
  }
1626
1628
  resourceIdCollection = data[this.parent.taskFields.resourceInfo];
1627
- if (resourceIdCollection != "" && typeof resourceIdCollection == "string") {
1628
- resourceIdCollection = resourceIdCollection.split(',');
1629
- }
1630
1629
  var resourceData;
1631
1630
  if (!isNullOrUndefined(this.parent.editModule) && !isNullOrUndefined(this.parent.editModule.dialogModule)
1632
1631
  && this.parent.editModule.dialogModule.isAddNewResource) {
@@ -1636,7 +1635,6 @@ var TaskProcessor = /** @class */ (function (_super) {
1636
1635
  resourceData = this.parent.resources;
1637
1636
  }
1638
1637
  var resourceIDMapping = this.parent.resourceFields.id;
1639
- var resourceNameMapping = this.parent.resourceFields.name;
1640
1638
  var resourceUnitMapping = this.parent.resourceFields.unit;
1641
1639
  var resourceGroup = this.parent.resourceFields.group;
1642
1640
  var resources = [];
@@ -1647,7 +1645,7 @@ var TaskProcessor = /** @class */ (function (_super) {
1647
1645
  return true;
1648
1646
  }
1649
1647
  else {
1650
- return (resourceIdCollection[count] === resourceInfo[resourceIDMapping]) || (resourceIdCollection[count] === resourceInfo[resourceNameMapping]);
1648
+ return (resourceIdCollection[count] === resourceInfo[resourceIDMapping]);
1651
1649
  }
1652
1650
  });
1653
1651
  var ganttDataResource = extend({}, resource[0]);
@@ -1704,7 +1702,9 @@ var TaskProcessor = /** @class */ (function (_super) {
1704
1702
  if (resourceUnit !== 100) {
1705
1703
  resName += '[' + resourceUnit + '%' + ']';
1706
1704
  }
1707
- resourceName.push(resName);
1705
+ if (!isNullOrUndefined(resName)) {
1706
+ resourceName.push(resName);
1707
+ }
1708
1708
  if (data.taskData) {
1709
1709
  var mapping = taskMapping.resourceInfo;
1710
1710
  // eslint-disable-next-line
@@ -2206,7 +2206,8 @@ var TaskProcessor = /** @class */ (function (_super) {
2206
2206
  if (!isNullOrUndefined(ganttRecord.segments) && ganttRecord.segments.length > 0) {
2207
2207
  var segments = ganttRecord.segments;
2208
2208
  var fixedWidth = true;
2209
- var totalTaskWidth = this.splitTasksDuration(segments) * this.parent.perDayWidth;
2209
+ var totalTaskWidth = this.splitTasksDuration(segments) * ((this.parent.timelineModule.bottomTier === "Hour" || this.parent.timelineModule.bottomTier === "Minutes") ? this.parent.timelineSettings.timelineUnitSize : this.parent.perDayWidth);
2210
+ ;
2210
2211
  var totalProgressWidth = this.parent.dataOperation.getProgressWidth(totalTaskWidth, ganttRecord.progress);
2211
2212
  for (var i = 0; i < segments.length; i++) {
2212
2213
  var segment = segments[i];
@@ -2254,6 +2255,8 @@ var TaskProcessor = /** @class */ (function (_super) {
2254
2255
  var ganttRecord = data.ganttProperties;
2255
2256
  this.parent.setRecordValue('autoWidth', this.calculateWidth(data, true), ganttRecord, true);
2256
2257
  this.parent.setRecordValue('autoLeft', this.calculateLeft(ganttRecord, true), ganttRecord, true);
2258
+ this.parent.setRecordValue('progressWidth', this.parent.dataOperation.getProgressWidth((ganttRecord.isAutoSchedule ||
2259
+ !data.hasChildRecords ? ganttRecord.width : ganttRecord.autoWidth), ganttRecord.progress), ganttRecord, true);
2257
2260
  };
2258
2261
  /**
2259
2262
  * To calculate parent progress value
@@ -803,7 +803,7 @@ var GanttTreeGrid = /** @class */ (function () {
803
803
  }
804
804
  }; // eslint-disable-next-line
805
805
  GanttTreeGrid.prototype.durationValueAccessor = function (field, data, column) {
806
- var ganttProp = (!isNullOrUndefined(data)) ? data.ganttProperties : null;
806
+ var ganttProp = data.ganttProperties;
807
807
  if (!isNullOrUndefined(ganttProp)) {
808
808
  return this.parent.dataOperation.getDurationString(ganttProp.duration, ganttProp.durationUnit);
809
809
  }
@@ -148,6 +148,7 @@ var ExportHelper = /** @class */ (function () {
148
148
  predecessor.type = data.type;
149
149
  predecessor.milestoneParent = data.milestoneParent;
150
150
  predecessor.milestoneChild = data.milestoneChild;
151
+ predecessor.parentEndPoint = data.parentEndPoint;
151
152
  predecessor.lineWidth = _this.parent.connectorLineWidth > 5 ? pixelToPoint(5) : pixelToPoint(_this.parent.connectorLineWidth);
152
153
  if (data.isCritical) {
153
154
  predecessor.connectorLineColor = _this.ganttStyle.criticalConnectorLineColor;
@@ -1,5 +1,5 @@
1
1
  import { PdfColor } from '@syncfusion/ej2-pdf-export';
2
- import { IGanttStyle, PdfExportProperties } from './../base/interface';
2
+ import { IGanttStyle } from './../base/interface';
3
3
  import { Gantt } from './../base/gantt';
4
4
  import { PdfGantt } from './pdf-gantt';
5
5
  /**
@@ -20,15 +20,15 @@ export declare class PdfGanttPredecessor {
20
20
  connectorLineColor?: PdfColor;
21
21
  pdfGantt?: PdfGantt;
22
22
  parent?: Gantt;
23
+ parentEndPoint: number;
23
24
  ganttStyle: IGanttStyle;
24
- pdfExportProperties: PdfExportProperties;
25
25
  /**
26
26
  * @returns {PdfGanttPredecessor} .
27
27
  * @hidden
28
28
  */
29
29
  add(): PdfGanttPredecessor;
30
30
  constructor(parent?: Gantt, pdfGantt?: PdfGantt);
31
- findindex(num: number, pdfExportProperties: PdfExportProperties): number;
31
+ findindex(num: number): number;
32
32
  /**
33
33
  * Calculate the predecesor line point and draw the predecessor
34
34
  *
@@ -36,7 +36,7 @@ export declare class PdfGanttPredecessor {
36
36
  * @returns {void}
37
37
  * @private
38
38
  */
39
- drawPredecessor(pdfGantt: PdfGantt, pdfExportProperties: PdfExportProperties): void;
39
+ drawPredecessor(pdfGantt: PdfGantt): void;
40
40
  /**
41
41
  * Method to draw the predecessor lines with calculated connector points
42
42
  *
@@ -27,22 +27,11 @@ var PdfGanttPredecessor = /** @class */ (function () {
27
27
  PdfGanttPredecessor.prototype.add = function () {
28
28
  return new PdfGanttPredecessor(this.parent);
29
29
  };
30
- PdfGanttPredecessor.prototype.findindex = function (num, pdfExportProperties) {
30
+ PdfGanttPredecessor.prototype.findindex = function (num) {
31
31
  var dataindex;
32
- if (pdfExportProperties.exportType === 'CurrentViewData') {
33
- this.parent.currentViewData.map(function (data, index) {
34
- if (data.index == num) {
35
- dataindex = index;
36
- }
37
- });
38
- }
39
- else {
40
- this.parent.flatData.map(function (data, index) {
41
- if (data.index == num) {
42
- dataindex = index;
43
- }
44
- });
45
- }
32
+ this.parent.currentViewData.map(function (data, index) { if (data.index == num) {
33
+ dataindex = index;
34
+ } });
46
35
  return dataindex;
47
36
  };
48
37
  /**
@@ -52,11 +41,11 @@ var PdfGanttPredecessor = /** @class */ (function () {
52
41
  * @returns {void}
53
42
  * @private
54
43
  */
55
- PdfGanttPredecessor.prototype.drawPredecessor = function (pdfGantt, pdfExportProperties) {
44
+ PdfGanttPredecessor.prototype.drawPredecessor = function (pdfGantt) {
56
45
  this.pdfGantt = pdfGantt;
57
46
  var pages = pdfGantt.result.page.section.getPages();
58
- var parentTask = pdfGantt.taskbarCollection[this.findindex(this.parentIndex, pdfExportProperties)];
59
- var childTask = pdfGantt.taskbarCollection[this.findindex(this.childIndex, pdfExportProperties)];
47
+ var parentTask = pdfGantt.taskbarCollection[this.findindex(this.parentIndex)];
48
+ var childTask = pdfGantt.taskbarCollection[this.findindex(this.childIndex)];
60
49
  var startPage = new PdfPage();
61
50
  var endPage = new PdfPage();
62
51
  var predecessorType = '';
@@ -66,7 +55,7 @@ var PdfGanttPredecessor = /** @class */ (function () {
66
55
  var childY = 0;
67
56
  switch (this.type) {
68
57
  case 'FS':
69
- if ((!isNullOrUndefined(childTask) && childTask.startPage > -1) && (!isNullOrUndefined(parentTask) && parentTask.endPage > -1)) {
58
+ if (childTask.startPage > -1 && parentTask.endPage > -1) {
70
59
  startPage = pages[parentTask.endPage];
71
60
  endPage = pages[childTask.startPage];
72
61
  parentPageData = pdfGantt.pdfPageDetail[parentTask.endPage - pdfGantt.chartPageIndex];
@@ -93,7 +82,7 @@ var PdfGanttPredecessor = /** @class */ (function () {
93
82
  }
94
83
  break;
95
84
  case 'SF':
96
- if ((!isNullOrUndefined(childTask) && childTask.endPage > -1) && (!isNullOrUndefined(parentTask) && parentTask.startPage > -1)) {
85
+ if (childTask.endPage > -1 && parentTask.startPage > -1) {
97
86
  startPage = pages[parentTask.startPage];
98
87
  endPage = pages[childTask.endPage];
99
88
  parentPageData = pdfGantt.pdfPageDetail[parentTask.endPage - pdfGantt.chartPageIndex];
@@ -120,7 +109,7 @@ var PdfGanttPredecessor = /** @class */ (function () {
120
109
  }
121
110
  break;
122
111
  case 'FF':
123
- if ((!isNullOrUndefined(childTask) && childTask.endPage > -1) && (!isNullOrUndefined(parentTask) && parentTask.endPage > -1)) {
112
+ if (childTask.endPage > -1 && parentTask.endPage > -1) {
124
113
  startPage = pages[parentTask.endPage];
125
114
  endPage = pages[childTask.endPage];
126
115
  parentPageData = pdfGantt.pdfPageDetail[parentTask.endPage - pdfGantt.chartPageIndex];
@@ -147,7 +136,7 @@ var PdfGanttPredecessor = /** @class */ (function () {
147
136
  }
148
137
  break;
149
138
  case 'SS':
150
- if ((!isNullOrUndefined(childTask) && childTask.startPage > -1) && (!isNullOrUndefined(parentTask) && parentTask.startPage > -1)) {
139
+ if (childTask.startPage > -1 && parentTask.startPage > -1) {
151
140
  startPage = pages[parentTask.startPage];
152
141
  endPage = pages[childTask.startPage];
153
142
  parentPageData = pdfGantt.pdfPageDetail[parentTask.startPage - pdfGantt.chartPageIndex];