@syncfusion/ej2-gantt 20.2.50 → 20.3.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/ej2-gantt.min.js +10 -0
  3. package/dist/ej2-gantt.umd.min.js +2 -2
  4. package/dist/ej2-gantt.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-gantt.es2015.js +940 -338
  6. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  7. package/dist/es6/ej2-gantt.es5.js +970 -357
  8. package/dist/es6/ej2-gantt.es5.js.map +1 -1
  9. package/dist/global/ej2-gantt.min.js +2 -2
  10. package/dist/global/ej2-gantt.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +19 -19
  13. package/src/gantt/actions/cell-edit.js +1 -2
  14. package/src/gantt/actions/connector-line-edit.d.ts +2 -0
  15. package/src/gantt/actions/connector-line-edit.js +104 -10
  16. package/src/gantt/actions/context-menu.js +6 -1
  17. package/src/gantt/actions/critical-path.d.ts +1 -1
  18. package/src/gantt/actions/critical-path.js +105 -30
  19. package/src/gantt/actions/dependency.d.ts +2 -0
  20. package/src/gantt/actions/dependency.js +68 -12
  21. package/src/gantt/actions/dialog-edit.d.ts +3 -0
  22. package/src/gantt/actions/dialog-edit.js +116 -14
  23. package/src/gantt/actions/edit.js +69 -10
  24. package/src/gantt/actions/filter.d.ts +3 -0
  25. package/src/gantt/actions/filter.js +30 -6
  26. package/src/gantt/actions/keyboard.js +1 -1
  27. package/src/gantt/actions/rowdragdrop.js +68 -8
  28. package/src/gantt/actions/taskbar-edit.js +15 -3
  29. package/src/gantt/base/enum.d.ts +3 -1
  30. package/src/gantt/base/gantt-chart.js +8 -6
  31. package/src/gantt/base/gantt.d.ts +6 -6
  32. package/src/gantt/base/gantt.js +10 -3
  33. package/src/gantt/base/interface.d.ts +4 -0
  34. package/src/gantt/base/splitter.d.ts +2 -2
  35. package/src/gantt/base/splitter.js +6 -7
  36. package/src/gantt/base/task-processor.js +13 -7
  37. package/src/gantt/base/tree-grid.js +21 -2
  38. package/src/gantt/export/pdf-connector-line.js +187 -185
  39. package/src/gantt/models/edit-settings-model.d.ts +2 -2
  40. package/src/gantt/models/edit-settings.d.ts +2 -2
  41. package/src/gantt/models/filter-settings-model.d.ts +1 -1
  42. package/src/gantt/models/filter-settings.d.ts +1 -1
  43. package/src/gantt/renderer/chart-rows.d.ts +1 -0
  44. package/src/gantt/renderer/chart-rows.js +47 -16
  45. package/src/gantt/renderer/connector-line.js +101 -33
  46. package/src/gantt/renderer/event-marker.js +1 -1
  47. package/src/gantt/renderer/nonworking-day.js +0 -1
  48. package/src/gantt/renderer/tooltip.js +2 -1
  49. package/styles/bootstrap-dark.css +115 -62
  50. package/styles/bootstrap.css +115 -62
  51. package/styles/bootstrap4.css +115 -62
  52. package/styles/bootstrap5-dark.css +119 -63
  53. package/styles/bootstrap5.css +119 -63
  54. package/styles/fabric-dark.css +115 -62
  55. package/styles/fabric.css +115 -62
  56. package/styles/fluent-dark.css +126 -66
  57. package/styles/fluent.css +124 -64
  58. package/styles/gantt/_all.scss +1 -1
  59. package/styles/gantt/_bootstrap-dark-definition.scss +4 -1
  60. package/styles/gantt/_bootstrap-definition.scss +4 -1
  61. package/styles/gantt/_bootstrap4-definition.scss +4 -1
  62. package/styles/gantt/_bootstrap5-definition.scss +4 -2
  63. package/styles/gantt/_fabric-dark-definition.scss +4 -1
  64. package/styles/gantt/_fabric-definition.scss +4 -1
  65. package/styles/gantt/_fluent-definition.scss +6 -4
  66. package/styles/gantt/_fusionnew-definition.scss +12 -10
  67. package/styles/gantt/_highcontrast-definition.scss +4 -1
  68. package/styles/gantt/_highcontrast-light-definition.scss +4 -1
  69. package/styles/gantt/_layout.scss +143 -51
  70. package/styles/gantt/_material-dark-definition.scss +4 -1
  71. package/styles/gantt/_material-definition.scss +4 -1
  72. package/styles/gantt/_material3-definition.scss +13 -11
  73. package/styles/gantt/_tailwind-definition.scss +4 -2
  74. package/styles/gantt/_theme.scss +29 -29
  75. package/styles/gantt/bootstrap-dark.css +115 -62
  76. package/styles/gantt/bootstrap.css +115 -62
  77. package/styles/gantt/bootstrap4.css +115 -62
  78. package/styles/gantt/bootstrap5-dark.css +119 -63
  79. package/styles/gantt/bootstrap5.css +119 -63
  80. package/styles/gantt/fabric-dark.css +115 -62
  81. package/styles/gantt/fabric.css +115 -62
  82. package/styles/gantt/fluent-dark.css +126 -66
  83. package/styles/gantt/fluent.css +124 -64
  84. package/styles/gantt/highcontrast-light.css +120 -62
  85. package/styles/gantt/highcontrast.css +120 -62
  86. package/styles/gantt/material-dark.css +120 -65
  87. package/styles/gantt/material.css +118 -65
  88. package/styles/gantt/tailwind-dark.css +117 -64
  89. package/styles/gantt/tailwind.css +117 -64
  90. package/styles/highcontrast-light.css +120 -62
  91. package/styles/highcontrast.css +120 -62
  92. package/styles/material-dark.css +120 -65
  93. package/styles/material.css +118 -65
  94. package/styles/tailwind-dark.css +117 -64
  95. package/styles/tailwind.css +117 -64
@@ -1,7 +1,7 @@
1
1
  import { TreeGrid, Filter as TreeGridFilter } from '@syncfusion/ej2-treegrid';
2
2
  import { filterAfterOpen } from '@syncfusion/ej2-grids';
3
3
  import { getActualProperties, getCustomDateFormat } from '@syncfusion/ej2-grids';
4
- import { getValue, isNullOrUndefined, remove, createElement, addClass, closest } from '@syncfusion/ej2-base';
4
+ import { getValue, isNullOrUndefined, remove, createElement, addClass, closest, EventHandler } from '@syncfusion/ej2-base';
5
5
  import { TextBox } from '@syncfusion/ej2-inputs';
6
6
  import { DatePicker, DateTimePicker } from '@syncfusion/ej2-calendars';
7
7
  /**
@@ -45,10 +45,13 @@ var Filter = /** @class */ (function () {
45
45
  this.parent.on('actionComplete', this.actionComplete, this);
46
46
  this.parent.on('columnMenuOpen', this.columnMenuOpen, this);
47
47
  };
48
+ Filter.prototype.wireEvents = function (a) {
49
+ EventHandler.add(document.getElementById(a), 'click', this.mouseClickHandler, this);
50
+ };
48
51
  Filter.prototype.initiateFiltering = function (column) {
49
52
  var treeColumn = this.parent.getColumnByField(column.field, this.parent.treeGridModule.treeGridColumns);
50
53
  column.allowFiltering = column.allowFiltering === false ? false : true;
51
- if (column.allowFiltering && this.parent.filterSettings.type === 'Menu' && !column.filter) {
54
+ if (column.allowFiltering && (this.parent.filterSettings.type === 'Menu' || this.parent.filterSettings.type === 'Excel') && !column.filter) {
52
55
  column.filter = { ui: this.getCustomFilterUi(column) };
53
56
  }
54
57
  if (treeColumn) {
@@ -78,6 +81,14 @@ var Filter = /** @class */ (function () {
78
81
  }
79
82
  return filterUI;
80
83
  };
84
+ Filter.prototype.mouseClickHandler = function (e) {
85
+ if (closest(e.target, ".e-excelfilter")) {
86
+ this.parent.treeGrid.grid.notify("click", e);
87
+ }
88
+ };
89
+ Filter.prototype.unWireEvents = function () {
90
+ EventHandler.remove(this.parent.element, 'click', this.mouseClickHandler);
91
+ };
81
92
  Filter.prototype.getDatePickerFilter = function (columnName) {
82
93
  var _this = this;
83
94
  var parent = this.parent;
@@ -199,6 +210,15 @@ var Filter = /** @class */ (function () {
199
210
  }
200
211
  };
201
212
  Filter.prototype.actionComplete = function (args) {
213
+ if (!isNullOrUndefined(args['filterModel'])) {
214
+ if (!isNullOrUndefined(args['filterModel']['dialogObj'])) {
215
+ if (!isNullOrUndefined(args['filterModel']['dialogObj']['element'])) {
216
+ if (this.parent.filterSettings.type === 'Excel') {
217
+ this.wireEvents(args['filterModel']['dialogObj']['element'].id);
218
+ }
219
+ }
220
+ }
221
+ }
202
222
  if (args.requestType === filterAfterOpen) {
203
223
  if (this.parent.treeGrid.filterSettings.type === 'Menu') {
204
224
  this.filterMenuElement = getValue('filterModel.dlgObj.element', args);
@@ -216,12 +236,15 @@ var Filter = /** @class */ (function () {
216
236
  if ((args.columnName === predecessor && isNullOrUndefined(getValue(predecessor, filterValues)))
217
237
  || (args.columnName === resource && isNullOrUndefined(getValue(resource, filterValues)))) {
218
238
  var element = this.filterMenuElement.querySelector('.e-dropdownlist');
219
- var instanceObj = getValue('ej2_instances[0]', element);
220
- instanceObj.index = 2;
221
- instanceObj.dataBind();
239
+ var instanceObj = void 0;
240
+ if (!isNullOrUndefined(element)) {
241
+ instanceObj = getValue('ej2_instances[0]', element);
242
+ instanceObj.index = 2;
243
+ instanceObj.dataBind();
244
+ }
222
245
  }
223
246
  else if (args.columnName === taskID && isNullOrUndefined(getValue(taskID, filterValues)) && this.parent.treeGrid.filterSettings.type === 'Menu') {
224
- var element = this.filterMenuElement.querySelector('.e-numerictextbox');
247
+ var element = this.filterMenuElement.querySelector('.e-flmenu-input');
225
248
  var instanceObj = getValue('ej2_instances[0]', element);
226
249
  if (!isNullOrUndefined(instanceObj) && isNullOrUndefined(this.parent.columnByField[args.columnName].format)) {
227
250
  instanceObj.format = 'n';
@@ -252,6 +275,7 @@ var Filter = /** @class */ (function () {
252
275
  */
253
276
  Filter.prototype.destroy = function () {
254
277
  this.removeEventListener();
278
+ this.unWireEvents();
255
279
  };
256
280
  return Filter;
257
281
  }());
@@ -248,7 +248,7 @@ var FocusModule = /** @class */ (function () {
248
248
  if (ganttObj.selectionSettings.mode !== 'Cell' && ganttObj.selectedRowIndex !== -1) {
249
249
  var selectedItem = ganttObj.currentViewData[ganttObj.selectedRowIndex];
250
250
  var focusedRowIndex = this.parent.ganttChartModule.focusedRowIndex;
251
- var selectingRowIndex = focusedRowIndex > -1 ? focusedRowIndex : expandedRecords.indexOf(selectedItem);
251
+ var selectingRowIndex = expandedRecords.indexOf(selectedItem);
252
252
  var currentSelectingRecord = e.action === 'downArrow' ? expandedRecords[selectingRowIndex + 1] :
253
253
  expandedRecords[selectingRowIndex - 1];
254
254
  ganttObj.selectionModule.selectRow(ganttObj.currentViewData.indexOf(currentSelectingRecord), false, true);
@@ -119,7 +119,7 @@ var RowDD = /** @class */ (function () {
119
119
  };
120
120
  RowDD.prototype.rowDragStartHelper = function (args) {
121
121
  this.parent.trigger('rowDragStartHelper', args);
122
- if (this.parent.readOnly || this.parent.filterSettings.columns.length > 0) {
122
+ if (this.parent.readOnly) {
123
123
  args.cancel = true;
124
124
  }
125
125
  if (this.parent.viewType === 'ResourceView' && getValue('level', args.data[0]) === 0) {
@@ -255,7 +255,7 @@ var RowDD = /** @class */ (function () {
255
255
  var uniqueTaskID_1 = this_1.parent.taskFields.id;
256
256
  if (draggedRecord.index < droppedRecord.index) {
257
257
  startIndex = draggedRecord.index;
258
- var _loop_2 = function (i_1) {
258
+ var _loop_3 = function (i_1) {
259
259
  var currentData = this_1.parent.currentViewData.filter(function (e) {
260
260
  return e[uniqueTaskID_1] === ganttData_1[i_1][uniqueTaskID_1];
261
261
  })[0];
@@ -265,14 +265,14 @@ var RowDD = /** @class */ (function () {
265
265
  }
266
266
  };
267
267
  for (var i_1 = 0; i_1 < ganttData_1.length; i_1++) {
268
- var state_2 = _loop_2(i_1);
268
+ var state_2 = _loop_3(i_1);
269
269
  if (state_2 === "break")
270
270
  break;
271
271
  }
272
272
  }
273
273
  else {
274
274
  startIndex = droppedRecord.index;
275
- var _loop_3 = function (i_2) {
275
+ var _loop_4 = function (i_2) {
276
276
  var currentData = this_1.parent.currentViewData.filter(function (e) {
277
277
  return e[uniqueTaskID_1] === ganttData_1[i_2][uniqueTaskID_1];
278
278
  })[0];
@@ -282,12 +282,12 @@ var RowDD = /** @class */ (function () {
282
282
  }
283
283
  };
284
284
  for (var i_2 = 0; i_2 < ganttData_1.length; i_2++) {
285
- var state_3 = _loop_3(i_2);
285
+ var state_3 = _loop_4(i_2);
286
286
  if (state_3 === "break")
287
287
  break;
288
288
  }
289
289
  }
290
- var _loop_4 = function (i_3) {
290
+ var _loop_5 = function (i_3) {
291
291
  if (!isNullOrUndefined(data_1[i_3])) {
292
292
  data_1[i_3].index = i_3;
293
293
  if (!isNullOrUndefined(data_1[i_3].parentItem)) {
@@ -299,7 +299,7 @@ var RowDD = /** @class */ (function () {
299
299
  }
300
300
  };
301
301
  for (var i_3 = startIndex; i_3 <= endIndex; i_3++) {
302
- _loop_4(i_3);
302
+ _loop_5(i_3);
303
303
  }
304
304
  }
305
305
  gObj.rowDragAndDropModule.refreshDataSource();
@@ -360,6 +360,66 @@ var RowDD = /** @class */ (function () {
360
360
  this.updateSharedResourceTask();
361
361
  }
362
362
  }
363
+ if (this.parent.taskFields.dependency) {
364
+ var isValidPredecessor = true;
365
+ var draggedParent = void 0;
366
+ var toParent_1;
367
+ if (draggedRecord.parentItem) {
368
+ draggedParent = this.parent.currentViewData[this.parent.ids.indexOf(draggedRecord.parentItem.taskId)];
369
+ }
370
+ else {
371
+ draggedParent = draggedRecord;
372
+ }
373
+ if (droppedRecord.parentItem) {
374
+ toParent_1 = this.parent.currentViewData[this.parent.ids.indexOf(droppedRecord.parentItem.taskId)];
375
+ }
376
+ else {
377
+ toParent_1 = droppedRecord;
378
+ }
379
+ var validateRecords = void 0;
380
+ if (toParent_1.uniqueID === draggedParent.uniqueID || (draggedParent.parentItem &&
381
+ toParent_1.uniqueID == this.parent.currentViewData[this.parent.ids.indexOf(draggedParent.parentItem.taskId)].uniqueID)) {
382
+ validateRecords = this.parent.currentViewData.filter(function (data) {
383
+ if ((data.ganttProperties.predecessor && data.ganttProperties.predecessor.length > 0)) {
384
+ for (var i = 0; i < data.ganttProperties.predecessor.length; i++) {
385
+ return (parseInt(data.ganttProperties.predecessor[i].to) === parseInt(toParent_1.ganttProperties.taskId) ||
386
+ parseInt(data.ganttProperties.predecessor[i].from) === parseInt(toParent_1.ganttProperties.taskId));
387
+ }
388
+ }
389
+ return null;
390
+ });
391
+ var predName = [];
392
+ for (var i = 0; i < validateRecords.length; i++) {
393
+ predName = [];
394
+ if (validateRecords[i].ganttProperties.predecessor) {
395
+ for (var k = 0; k < validateRecords[i].ganttProperties.predecessor.length; k++) {
396
+ if (parseInt(validateRecords[i].ganttProperties.taskId) !==
397
+ parseInt(validateRecords[i].ganttProperties.predecessor[k].from)) {
398
+ predName.push(validateRecords[i].ganttProperties.predecessor[k].from);
399
+ }
400
+ else {
401
+ predName.push(validateRecords[i].ganttProperties.predecessor[k].to);
402
+ }
403
+ }
404
+ }
405
+ var _loop_2 = function (j) {
406
+ var name_1 = predName[j].replace(/\D/g, '');
407
+ var toRec = this_2.parent.currentViewData.filter(function (data) {
408
+ return parseInt(data.ganttProperties.taskId) == parseInt(name_1);
409
+ });
410
+ isValidPredecessor = this_2.parent.connectorLineEditModule.validateParentPredecessor(validateRecords[i], toRec[0]);
411
+ if (!isValidPredecessor) {
412
+ this_2.parent.dataOperation['resetDependency'](validateRecords[i]);
413
+ this_2.parent.dataOperation['resetDependency'](toRec[0]);
414
+ }
415
+ };
416
+ var this_2 = this;
417
+ for (var j = 0; j < predName.length; j++) {
418
+ _loop_2(j);
419
+ }
420
+ }
421
+ }
422
+ }
363
423
  // method to update the edited parent records
364
424
  for (var j = 0; j < this.updateParentRecords.length; j++) {
365
425
  this.parent.dataOperation.updateParentItems(this.updateParentRecords[j]);
@@ -740,7 +800,7 @@ var RowDD = /** @class */ (function () {
740
800
  }
741
801
  var idx = void 0;
742
802
  var ganttData = dataSource.length > 0 && this.parent.viewType !== 'ResourceView' ?
743
- dataSource : this.parent.updatedRecords;
803
+ dataSource : this.parent.flatData;
744
804
  for (var i = 0; i < ganttData.length; i++) {
745
805
  if (this.parent.viewType === 'ResourceView') {
746
806
  if (ganttData[i].ganttProperties.rowUniqueID === deletedRow.ganttProperties.rowUniqueID) {
@@ -102,6 +102,9 @@ var TaskbarEdit = /** @class */ (function (_super) {
102
102
  }
103
103
  };
104
104
  TaskbarEdit.prototype.mouseClickHandler = function (e) {
105
+ if (!this.parent.editSettings.allowTaskbarEditing) {
106
+ return;
107
+ }
105
108
  var targetElement = this.getElementByPosition(e);
106
109
  var element = parentsUntil(targetElement, cls.taskBarMainContainer);
107
110
  if (this.parent.selectionModule && this.parent.selectionModule.enableSelectMultiTouch) {
@@ -634,10 +637,13 @@ var TaskbarEdit = /** @class */ (function (_super) {
634
637
  var _this = this;
635
638
  this.stopScrollTimer();
636
639
  this.scrollTimer = window.setInterval(function () {
637
- if (direction === 'right' || direction === 'bottom') {
640
+ if (direction === 'right') {
638
641
  _this.timerCount = (_this.timerCount + 1) >= _this.parent.timelineModule.totalTimelineWidth ?
639
642
  _this.parent.timelineModule.totalTimelineWidth : (_this.timerCount + 1);
640
643
  }
644
+ else if (direction === 'bottom') {
645
+ _this.timerCount = _this.timerCount + 1;
646
+ }
641
647
  else {
642
648
  _this.timerCount = (_this.timerCount - 1) < 0 ? 0 : (_this.timerCount - 1);
643
649
  }
@@ -1745,8 +1751,14 @@ var TaskbarEdit = /** @class */ (function (_super) {
1745
1751
  }
1746
1752
  if ((this.parent.virtualScrollModule && this.parent.enableVirtualization &&
1747
1753
  !this.elementOffsetLeft) || !this.parent.enableVirtualization) {
1748
- this.elementOffsetLeft = this.taskBarEditElement.offsetLeft;
1749
- this.elementOffsetTop = this.taskBarEditElement.offsetTop + scrollTop;
1754
+ if (this.taskBarEditElement.children[0].classList.contains('e-manualparent-main-container')) {
1755
+ this.elementOffsetLeft = this.taskBarEditElement.children[0]['offsetLeft'] + this.taskBarEditElement.offsetLeft;
1756
+ this.elementOffsetTop = ((this.taskBarEditElement.offsetTop - 5) + this.taskBarEditElement.children[0]['offsetTop']) + scrollTop;
1757
+ }
1758
+ else {
1759
+ this.elementOffsetLeft = this.taskBarEditElement.offsetLeft;
1760
+ this.elementOffsetTop = this.taskBarEditElement.offsetTop + scrollTop;
1761
+ }
1750
1762
  this.elementOffsetWidth = this.taskBarEditElement.offsetWidth;
1751
1763
  this.elementOffsetHeight = this.taskBarEditElement.offsetHeight;
1752
1764
  }
@@ -128,7 +128,9 @@ export declare type DialogFieldType =
128
128
  */
129
129
  export declare type FilterType =
130
130
  /** Defines filter type as menu */
131
- 'Menu';
131
+ 'Menu' |
132
+ /** Specifies the filtersetting type as excel */
133
+ 'Excel';
132
134
  /**
133
135
  * To define hierarchy mode on filter action
134
136
  */
@@ -175,7 +175,7 @@ var GanttChart = /** @class */ (function () {
175
175
  GanttChart.prototype.renderTimelineContainer = function () {
176
176
  this.chartTimelineContainer =
177
177
  createElement('div', { className: cls.timelineHeaderContainer });
178
- this.chartTimelineContainer.setAttribute("role", "TimelineHeader");
178
+ this.chartTimelineContainer.setAttribute("role", "presentation");
179
179
  this.chartElement.appendChild(this.chartTimelineContainer);
180
180
  };
181
181
  /**
@@ -301,12 +301,10 @@ var GanttChart = /** @class */ (function () {
301
301
  }
302
302
  };
303
303
  GanttChart.prototype.ganttChartMouseClick = function (e) {
304
- if (this.parent.editSettings.allowTaskbarEditing) {
305
- if (this.parent.autoFocusTasks) {
306
- this.scrollToTarget(e); /** Scroll to task */
307
- }
308
- this.parent.notify('chartMouseClick', e);
304
+ if (this.parent.autoFocusTasks) {
305
+ this.scrollToTarget(e); /** Scroll to task */
309
306
  }
307
+ this.parent.notify('chartMouseClick', e);
310
308
  };
311
309
  GanttChart.prototype.ganttChartMouseUp = function (e) {
312
310
  if (this.parent.editSettings.allowTaskbarEditing) {
@@ -640,6 +638,10 @@ var GanttChart = /** @class */ (function () {
640
638
  this.parent.updatedConnectorLineCollection = [];
641
639
  this.parent.predecessorModule.createConnectorLinesCollection();
642
640
  this.parent.connectorLineModule.renderConnectorLines(this.parent.updatedConnectorLineCollection);
641
+ if (this.parent.enableCriticalPath && this.parent.criticalPathModule) {
642
+ var criticalModule = this.parent.criticalPathModule;
643
+ criticalModule.criticalConnectorLine(criticalModule.criticalPathCollection, criticalModule.detailPredecessorCollection, true, criticalModule.predecessorCollectionTaskIds);
644
+ }
643
645
  };
644
646
  /**
645
647
  * To collapse gantt rows
@@ -1733,7 +1733,7 @@ export declare class Gantt extends Component<HTMLElement> implements INotifyProp
1733
1733
  * @returns {void} .
1734
1734
  * @public
1735
1735
  */
1736
- expandByID(id: number): void;
1736
+ expandByID(id: number | string): void;
1737
1737
  /**
1738
1738
  * Collapse the record by index value.
1739
1739
  *
@@ -1749,7 +1749,7 @@ export declare class Gantt extends Component<HTMLElement> implements INotifyProp
1749
1749
  * @returns {void} .
1750
1750
  * @public
1751
1751
  */
1752
- collapseByID(id: number): void;
1752
+ collapseByID(id: number | string): void;
1753
1753
  /**
1754
1754
  * Method to add record.
1755
1755
  *
@@ -1860,7 +1860,7 @@ export declare class Gantt extends Component<HTMLElement> implements INotifyProp
1860
1860
  * @returns {void} .
1861
1861
  * @public
1862
1862
  */
1863
- addPredecessor(id: number, predecessorString: string): void;
1863
+ addPredecessor(id: number | string, predecessorString: string): void;
1864
1864
  /**
1865
1865
  * To remove dependency from task.
1866
1866
  *
@@ -1868,7 +1868,7 @@ export declare class Gantt extends Component<HTMLElement> implements INotifyProp
1868
1868
  * @returns {void} .
1869
1869
  * @public
1870
1870
  */
1871
- removePredecessor(id: number): void;
1871
+ removePredecessor(id: number | string): void;
1872
1872
  /**
1873
1873
  * To modify current dependency values of Task by task id.
1874
1874
  *
@@ -1877,7 +1877,7 @@ export declare class Gantt extends Component<HTMLElement> implements INotifyProp
1877
1877
  * @returns {void} .
1878
1878
  * @public
1879
1879
  */
1880
- updatePredecessor(id: number, predecessorString: string): void;
1880
+ updatePredecessor(id: number | string, predecessorString: string): void;
1881
1881
  /**
1882
1882
  * Method to open Add dialog.
1883
1883
  *
@@ -1892,7 +1892,7 @@ export declare class Gantt extends Component<HTMLElement> implements INotifyProp
1892
1892
  * @returns {void} .
1893
1893
  * @public
1894
1894
  */
1895
- openEditDialog(taskId?: number): void;
1895
+ openEditDialog(taskId?: number | string): void;
1896
1896
  /**
1897
1897
  * Changes the TreeGrid column positions by field names.
1898
1898
  *
@@ -391,6 +391,7 @@ var Gantt = /** @class */ (function (_super) {
391
391
  if (this.enableValidation) {
392
392
  this.dataOperation.updateGanttData();
393
393
  }
394
+ this.predecessorModule.updateParentPredecessor();
394
395
  if (this.dataSource instanceof Object && isCountRequired(this)) {
395
396
  var count = getValue('count', this.dataSource);
396
397
  this.treeGrid.dataSource = { result: this.flatData, count: count };
@@ -403,6 +404,7 @@ var Gantt = /** @class */ (function (_super) {
403
404
  if (this.enableValidation) {
404
405
  this.dataOperation.updateGanttData();
405
406
  }
407
+ this.predecessorModule.updateParentPredecessor();
406
408
  this.treeGridPane.classList.remove('e-temp-content');
407
409
  remove(this.treeGridPane.querySelector('.e-gantt-temp-header'));
408
410
  this.notify('dataReady', {});
@@ -714,7 +716,7 @@ var Gantt = /** @class */ (function (_super) {
714
716
  {
715
717
  topTier: { unit: 'Hour', format: 'ddd MMM, h a', count: 1 },
716
718
  bottomTier: { unit: 'Minutes', format: 'mm', count: 30 }, timelineUnitSize: 66, level: 22,
717
- timelineViewMode: 'Hour', weekStartDay: _WeekStartDay, updateTimescaleView: true, weekendBackground: null, showTooltip: true
719
+ timelineViewMode: 'Hour', weekStartDay: 0, updateTimescaleView: true, weekendBackground: null, showTooltip: true
718
720
  },
719
721
  {
720
722
  topTier: { unit: 'Hour', format: 'ddd MMM, h a', count: 1 },
@@ -2055,7 +2057,7 @@ var Gantt = /** @class */ (function (_super) {
2055
2057
  Gantt.prototype.setSplitterPosition = function (value, type) {
2056
2058
  var tempSplitterSettings = {};
2057
2059
  tempSplitterSettings[type] = value;
2058
- var splitterPosition = this.splitterModule.calculateSplitterPosition(tempSplitterSettings, true);
2060
+ var splitterPosition = this.splitterModule.calculateSplitterPosition(tempSplitterSettings);
2059
2061
  var pane1 = this.splitterModule.splitterObject.element.querySelectorAll('.e-pane')[0];
2060
2062
  var pane2 = this.splitterModule.splitterObject.element.querySelectorAll('.e-pane')[1];
2061
2063
  this.splitterModule.splitterPreviousPositionGrid = pane1.scrollWidth + 1 + 'px';
@@ -2137,7 +2139,10 @@ var Gantt = /** @class */ (function (_super) {
2137
2139
  if (this.viewType === 'ResourceView') {
2138
2140
  this.editModule.addRowPosition = rowPosition;
2139
2141
  this.editModule.addRowIndex = rowIndex;
2140
- var resources = data[this.taskFields.resourceInfo];
2142
+ var resources = void 0;
2143
+ if (!isNullOrUndefined(data)) {
2144
+ resources = data[this.taskFields.resourceInfo];
2145
+ }
2141
2146
  var id = void 0;
2142
2147
  var parentTask = void 0;
2143
2148
  if (!isNullOrUndefined(resources) && resources.length) {
@@ -2635,6 +2640,7 @@ var Gantt = /** @class */ (function (_super) {
2635
2640
  */
2636
2641
  Gantt.prototype.showColumn = function (keys, showBy) {
2637
2642
  this.treeGrid.showColumns(keys, showBy);
2643
+ this.updateTreeColumns();
2638
2644
  };
2639
2645
  /**
2640
2646
  * Hides a column by column name.
@@ -2646,6 +2652,7 @@ var Gantt = /** @class */ (function (_super) {
2646
2652
  */
2647
2653
  Gantt.prototype.hideColumn = function (keys, hideBy) {
2648
2654
  this.treeGrid.hideColumns(keys, hideBy);
2655
+ this.updateTreeColumns();
2649
2656
  };
2650
2657
  /**
2651
2658
  * To set scroll top for chart scroll container.
@@ -37,6 +37,10 @@ export interface IGanttData {
37
37
  parentItem?: IParent;
38
38
  /** Defines the parent unique id of task. */
39
39
  parentUniqueID?: string;
40
+ /**
41
+ * Specifies the checkbox state of a record
42
+ */
43
+ checkboxState?: string;
40
44
  /** Defines the data which specified in data source.
41
45
  *
42
46
  * @isGenericType true
@@ -17,11 +17,11 @@ export declare class Splitter {
17
17
  renderSplitter(): void;
18
18
  /**
19
19
  * @param {SplitterSettingsModel} splitter .
20
- * @param {boolean} isDynamic .
20
+
21
21
  * @returns {string} .
22
22
  * @private
23
23
  */
24
- calculateSplitterPosition(splitter: SplitterSettingsModel, isDynamic?: boolean): string;
24
+ calculateSplitterPosition(splitter: SplitterSettingsModel): string;
25
25
  /**
26
26
  * @param {string} position .
27
27
  * @returns {string} .
@@ -74,11 +74,11 @@ var Splitter = /** @class */ (function () {
74
74
  };
75
75
  /**
76
76
  * @param {SplitterSettingsModel} splitter .
77
- * @param {boolean} isDynamic .
77
+
78
78
  * @returns {string} .
79
79
  * @private
80
80
  */
81
- Splitter.prototype.calculateSplitterPosition = function (splitter, isDynamic) {
81
+ Splitter.prototype.calculateSplitterPosition = function (splitter) {
82
82
  if (!isNullOrUndefined(this.splitterObject) && this.parent.enablePersistence) {
83
83
  return this.splitterObject.paneSettings[0].size;
84
84
  }
@@ -94,8 +94,7 @@ var Splitter = /** @class */ (function () {
94
94
  }
95
95
  else if (!isNullOrUndefined(splitter.columnIndex) && splitter.columnIndex >= 0) {
96
96
  if ((splitter.columnIndex * 150) < this.parent.ganttWidth || !this.parent.element.classList.contains('e-device')) {
97
- return isDynamic ? this.getSpliterPositionInPercentage(this.getTotalColumnWidthByIndex(splitter.columnIndex).toString() + 'px') :
98
- this.getSpliterPositionInPercentage((splitter.columnIndex * 150) + 'px');
97
+ return this.getSpliterPositionInPercentage(this.getTotalColumnWidthByIndex(splitter.columnIndex).toString() + 'px');
99
98
  }
100
99
  else {
101
100
  return this.getSpliterPositionInPercentage((splitter.columnIndex * 130) + 'px');
@@ -131,10 +130,10 @@ var Splitter = /** @class */ (function () {
131
130
  */
132
131
  Splitter.prototype.getTotalColumnWidthByIndex = function (index) {
133
132
  var width = 0;
134
- var tr = this.parent.treeGrid.element.querySelectorAll('.e-headercell');
133
+ var tr = this.parent.ganttColumns;
135
134
  index = tr.length > index ? index : tr.length;
136
135
  for (var column = 0; column < index; column++) {
137
- width = width + tr[column].offsetWidth;
136
+ width = width + parseInt(tr[column].width);
138
137
  }
139
138
  return width;
140
139
  };
@@ -145,7 +144,7 @@ var Splitter = /** @class */ (function () {
145
144
  Splitter.prototype.updateSplitterPosition = function () {
146
145
  this.splitterObject.separatorSize = this.parent.splitterSettings.separatorSize >= 4 ?
147
146
  this.parent.splitterSettings.separatorSize : 4;
148
- var splitterPosition = this.calculateSplitterPosition(this.parent.splitterSettings, true);
147
+ var splitterPosition = this.calculateSplitterPosition(this.parent.splitterSettings);
149
148
  this.splitterObject.paneSettings[0].min = this.getSpliterPositionInPercentage(this.parent.splitterSettings.minimum);
150
149
  this.splitterObject.dataBind();
151
150
  this.splitterObject.paneSettings[0].size = splitterPosition;
@@ -223,7 +223,9 @@ var TaskProcessor = /** @class */ (function (_super) {
223
223
  };
224
224
  TaskProcessor.prototype.calculateSharedTaskUniqueIds = function () {
225
225
  var _loop_2 = function (i) {
226
- var value = this_2.parent.getTaskIds()[i].match(/(\d+|[A-z]+)/g);
226
+ var value = [];
227
+ value[0] = this_2.parent.getTaskIds()[i][0];
228
+ value[1] = this_2.parent.getTaskIds()[i].slice(1);
227
229
  if (value[0] !== 'R') {
228
230
  var sharedRecords_1 = [];
229
231
  var ids_1 = [];
@@ -290,7 +292,6 @@ var TaskProcessor = /** @class */ (function (_super) {
290
292
  this_3.parent.setRecordValue('autoDuration', this_3.calculateAutoDuration(parentProp), parentProp, true);
291
293
  this_3.updateAutoWidthLeft(parentData);
292
294
  }
293
- this_3.resetDependency(parentData);
294
295
  this_3.updateWidthLeft(parentData);
295
296
  this_3.updateTaskData(parentData);
296
297
  }
@@ -315,7 +316,8 @@ var TaskProcessor = /** @class */ (function (_super) {
315
316
  var length = columns.length;
316
317
  if (length) {
317
318
  for (var i = 0; i < length; i++) {
318
- if (ganttRecord[columns[i].field] === undefined) {
319
+ var fieldName = ganttRecord[columns[i].field];
320
+ if (fieldName === undefined) {
319
321
  this.parent.setRecordValue(columns[i].field, data[columns[i].field], ganttRecord);
320
322
  }
321
323
  }
@@ -364,6 +366,7 @@ var TaskProcessor = /** @class */ (function (_super) {
364
366
  this.parent.setRecordValue('parentId', data[taskSettings.parentID], ganttProperties, true);
365
367
  }
366
368
  this.addCustomFieldValue(data, ganttData);
369
+ ganttData.checkboxState = 'uncheck';
367
370
  this.parent.setRecordValue('isAutoSchedule', autoSchedule, ganttProperties, true);
368
371
  this.parent.setRecordValue('resourceInfo', this.setResourceInfo(data), ganttProperties, true);
369
372
  this.parent.setRecordValue('isMilestone', false, ganttProperties, true);
@@ -406,7 +409,6 @@ var TaskProcessor = /** @class */ (function (_super) {
406
409
  if (!isNullOrUndefined(data[taskSettings.child]) && data[taskSettings.child].length > 0) {
407
410
  this.parent.setRecordValue('hasChildRecords', true, ganttData);
408
411
  this.parent.setRecordValue('isMilestone', false, ganttProperties, true);
409
- this.resetDependency(ganttData);
410
412
  }
411
413
  else {
412
414
  this.parent.setRecordValue('hasChildRecords', false, ganttData);
@@ -449,6 +451,9 @@ var TaskProcessor = /** @class */ (function (_super) {
449
451
  }
450
452
  else {
451
453
  var uniqueId = ganttData.uniqueID.replace(this.parent.element.id + '_data_', '');
454
+ if (this.parent.viewType === 'ResourceView' && typeof (ganttData.ganttProperties.taskId) === "string") {
455
+ uniqueId = ganttProperties.taskId.toString();
456
+ }
452
457
  this.parent.setRecordValue('rowUniqueID', uniqueId, ganttData);
453
458
  this.parent.setRecordValue('rowUniqueID', uniqueId, ganttProperties, true);
454
459
  this.parent.setRecordValue('sharedTaskUniqueIds', [], ganttProperties, true);
@@ -1568,10 +1573,12 @@ var TaskProcessor = /** @class */ (function (_super) {
1568
1573
  TaskProcessor.prototype.updateResourceName = function (data) {
1569
1574
  var resourceInfo = data.ganttProperties.resourceInfo;
1570
1575
  var resourceName = [];
1576
+ var taskMapping = this.parent.taskFields;
1571
1577
  if (resourceInfo) {
1578
+ var resourceLength = resourceInfo.length;
1572
1579
  var taskResources = extend([], [], data.taskData[this.parent.taskFields.resourceInfo], true);
1573
1580
  this.parent.setRecordValue('taskData.' + this.parent.taskFields.resourceInfo, [], data);
1574
- for (var i = 0; i < resourceInfo.length; i++) {
1581
+ for (var i = 0; i < resourceLength; i++) {
1575
1582
  var resource = resourceInfo[i];
1576
1583
  var resName = resource[this.parent.resourceFields.name];
1577
1584
  var resourceUnit = resource[this.parent.resourceFields.unit];
@@ -1580,7 +1587,7 @@ var TaskProcessor = /** @class */ (function (_super) {
1580
1587
  }
1581
1588
  resourceName.push(resName);
1582
1589
  if (data.taskData) {
1583
- var mapping = this.parent.taskFields.resourceInfo;
1590
+ var mapping = taskMapping.resourceInfo;
1584
1591
  // eslint-disable-next-line
1585
1592
  if (typeof (taskResources[i] === 'object')) {
1586
1593
  data.taskData[mapping].push(taskResources[i]);
@@ -2260,7 +2267,6 @@ var TaskProcessor = /** @class */ (function (_super) {
2260
2267
  this.parent.setRecordValue('autoDuration', this.calculateAutoDuration(parentProp), parentProp, true);
2261
2268
  this.updateAutoWidthLeft(parentData);
2262
2269
  }
2263
- this.resetDependency(parentData);
2264
2270
  this.updateWidthLeft(parentData);
2265
2271
  this.updateTaskData(parentData);
2266
2272
  }
@@ -587,11 +587,30 @@ var GanttTreeGrid = /** @class */ (function () {
587
587
  */
588
588
  GanttTreeGrid.prototype.composeIDColumn = function (column) {
589
589
  var isProjectView = this.parent.viewType === 'ProjectView';
590
+ var lengthDataSource = this.parent.dataSource['length'];
591
+ var taskIDName;
590
592
  column.isPrimaryKey = isProjectView ? true : false;
591
593
  column.headerText = column.headerText ? column.headerText : this.parent.localeObj.getConstant('id');
592
594
  column.width = column.width ? column.width : 100;
593
- column.allowEditing = column.allowEditing ? column.allowEditing : false;
594
- column.editType = column.editType ? column.editType : 'numericedit';
595
+ for (var i = 0; i < lengthDataSource; i++) {
596
+ if (!isNullOrUndefined(this.parent.dataSource[i][this.parent.taskFields.id])) {
597
+ taskIDName = this.parent.dataSource[i][this.parent.taskFields.id];
598
+ break;
599
+ }
600
+ }
601
+ if (typeof (taskIDName) === "string") {
602
+ if (this.parent.viewType === 'ResourceView') {
603
+ column.allowEditing = column.allowEditing ? column.allowEditing : false;
604
+ }
605
+ else {
606
+ column.allowEditing = column.allowEditing ? column.allowEditing : true;
607
+ }
608
+ column.editType = column.editType ? column.editType : 'stringedit';
609
+ }
610
+ else {
611
+ column.allowEditing = column.allowEditing ? column.allowEditing : false;
612
+ column.editType = column.editType ? column.editType : 'numericedit';
613
+ }
595
614
  column.valueAccessor = isProjectView ? null : this.idValueAccessor.bind(this);
596
615
  };
597
616
  GanttTreeGrid.prototype.composeUniqueIDColumn = function (column) {