@syncfusion/ej2-gantt 20.2.49 → 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 (96) hide show
  1. package/CHANGELOG.md +20 -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 +970 -379
  6. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  7. package/dist/es6/ej2-gantt.es5.js +1019 -413
  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 +130 -15
  23. package/src/gantt/actions/edit.js +101 -26
  24. package/src/gantt/actions/filter.d.ts +3 -1
  25. package/src/gantt/actions/filter.js +32 -44
  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/actions/toolbar.js +1 -1
  30. package/src/gantt/base/enum.d.ts +3 -1
  31. package/src/gantt/base/gantt-chart.js +8 -6
  32. package/src/gantt/base/gantt.d.ts +6 -6
  33. package/src/gantt/base/gantt.js +10 -3
  34. package/src/gantt/base/interface.d.ts +4 -0
  35. package/src/gantt/base/splitter.d.ts +2 -2
  36. package/src/gantt/base/splitter.js +6 -7
  37. package/src/gantt/base/task-processor.js +13 -7
  38. package/src/gantt/base/tree-grid.js +21 -2
  39. package/src/gantt/export/pdf-connector-line.js +187 -185
  40. package/src/gantt/models/edit-settings-model.d.ts +2 -2
  41. package/src/gantt/models/edit-settings.d.ts +2 -2
  42. package/src/gantt/models/filter-settings-model.d.ts +1 -1
  43. package/src/gantt/models/filter-settings.d.ts +1 -1
  44. package/src/gantt/renderer/chart-rows.d.ts +1 -0
  45. package/src/gantt/renderer/chart-rows.js +47 -16
  46. package/src/gantt/renderer/connector-line.js +101 -33
  47. package/src/gantt/renderer/event-marker.js +1 -1
  48. package/src/gantt/renderer/nonworking-day.js +0 -1
  49. package/src/gantt/renderer/tooltip.js +2 -1
  50. package/styles/bootstrap-dark.css +115 -62
  51. package/styles/bootstrap.css +115 -62
  52. package/styles/bootstrap4.css +115 -62
  53. package/styles/bootstrap5-dark.css +119 -63
  54. package/styles/bootstrap5.css +119 -63
  55. package/styles/fabric-dark.css +115 -62
  56. package/styles/fabric.css +115 -62
  57. package/styles/fluent-dark.css +126 -66
  58. package/styles/fluent.css +124 -64
  59. package/styles/gantt/_all.scss +1 -1
  60. package/styles/gantt/_bootstrap-dark-definition.scss +4 -1
  61. package/styles/gantt/_bootstrap-definition.scss +4 -1
  62. package/styles/gantt/_bootstrap4-definition.scss +4 -1
  63. package/styles/gantt/_bootstrap5-definition.scss +4 -2
  64. package/styles/gantt/_fabric-dark-definition.scss +4 -1
  65. package/styles/gantt/_fabric-definition.scss +4 -1
  66. package/styles/gantt/_fluent-definition.scss +6 -4
  67. package/styles/gantt/_fusionnew-definition.scss +12 -10
  68. package/styles/gantt/_highcontrast-definition.scss +4 -1
  69. package/styles/gantt/_highcontrast-light-definition.scss +4 -1
  70. package/styles/gantt/_layout.scss +143 -51
  71. package/styles/gantt/_material-dark-definition.scss +4 -1
  72. package/styles/gantt/_material-definition.scss +4 -1
  73. package/styles/gantt/_material3-definition.scss +13 -11
  74. package/styles/gantt/_tailwind-definition.scss +4 -2
  75. package/styles/gantt/_theme.scss +29 -29
  76. package/styles/gantt/bootstrap-dark.css +115 -62
  77. package/styles/gantt/bootstrap.css +115 -62
  78. package/styles/gantt/bootstrap4.css +115 -62
  79. package/styles/gantt/bootstrap5-dark.css +119 -63
  80. package/styles/gantt/bootstrap5.css +119 -63
  81. package/styles/gantt/fabric-dark.css +115 -62
  82. package/styles/gantt/fabric.css +115 -62
  83. package/styles/gantt/fluent-dark.css +126 -66
  84. package/styles/gantt/fluent.css +124 -64
  85. package/styles/gantt/highcontrast-light.css +120 -62
  86. package/styles/gantt/highcontrast.css +120 -62
  87. package/styles/gantt/material-dark.css +120 -65
  88. package/styles/gantt/material.css +118 -65
  89. package/styles/gantt/tailwind-dark.css +117 -64
  90. package/styles/gantt/tailwind.css +117 -64
  91. package/styles/highcontrast-light.css +120 -62
  92. package/styles/highcontrast.css +120 -62
  93. package/styles/material-dark.css +120 -65
  94. package/styles/material.css +118 -65
  95. package/styles/tailwind-dark.css +117 -64
  96. package/styles/tailwind.css +117 -64
@@ -1,5 +1,5 @@
1
1
  import { isNullOrUndefined, isUndefined, extend, setValue, getValue, deleteObject, createElement } from '@syncfusion/ej2-base';
2
- import { DataManager, DataUtil, Query, ODataAdaptor, WebApiAdaptor } from '@syncfusion/ej2-data';
2
+ import { DataManager, Query, ODataAdaptor, WebApiAdaptor } from '@syncfusion/ej2-data';
3
3
  import { getUid } from '@syncfusion/ej2-grids';
4
4
  import { getSwapKey, isScheduledTask, getTaskData, isRemoteData, getIndex, isCountRequired, updateDates } from '../base/utils';
5
5
  import { CellEdit } from './cell-edit';
@@ -497,7 +497,7 @@ var Edit = /** @class */ (function () {
497
497
  this.parent.dataOperation.updateMappingData(ganttData, 'duration');
498
498
  this.parent.dataOperation.updateMappingData(ganttData, 'endDate');
499
499
  }
500
- else if (key === 'taskType') {
500
+ else if (key === tasks.type) {
501
501
  ganttObj.setRecordValue('taskType', data[key], ganttData.ganttProperties, true);
502
502
  //this.parent.dataOperation.updateMappingData(ganttData, 'taskType');
503
503
  }
@@ -806,6 +806,10 @@ var Edit = /** @class */ (function () {
806
806
  }
807
807
  this.parent.predecessorModule.validatePredecessor(ganttRecord, [], '');
808
808
  }
809
+ if (ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
810
+ (args.action === "DrawConnectorLine" || args.action === "DialogEditing")) {
811
+ this.updateChildItems(ganttRecord);
812
+ }
809
813
  this.updateParentItemOnEditing();
810
814
  }
811
815
  /** Update parent up-to zeroth level */
@@ -1263,9 +1267,16 @@ var Edit = /** @class */ (function () {
1263
1267
  }
1264
1268
  for (var index = 0; index < currentLength; index++) {
1265
1269
  var recordIndex = [];
1266
- var resourceID = parseInt(currentResource[index][this.parent.resourceFields.id], 10);
1270
+ var resourceID = parseInt(currentResource[index][this.parent.resourceFields.id], 10).toString();
1271
+ if (resourceID === "NaN") {
1272
+ resourceID = currentResource[index][this.parent.resourceFields.id];
1273
+ }
1267
1274
  for (var i = 0; i < prevResource.length; i++) {
1268
- if (parseInt(prevResource[i][this.parent.resourceFields.id], 10) === resourceID) {
1275
+ var prevResourceID = parseInt(prevResource[i][this.parent.resourceFields.id], 10).toString();
1276
+ if (prevResourceID === "NaN") {
1277
+ prevResourceID = prevResource[i][this.parent.resourceFields.id];
1278
+ }
1279
+ if (prevResourceID === resourceID) {
1269
1280
  recordIndex.push(i);
1270
1281
  break;
1271
1282
  }
@@ -1277,7 +1288,11 @@ var Edit = /** @class */ (function () {
1277
1288
  }
1278
1289
  }
1279
1290
  else {
1280
- prevResource.splice(parseInt(recordIndex[0].toString(), 10), 1);
1291
+ var record1 = parseInt(recordIndex[0].toString(), 10);
1292
+ if (record1.toString() === "NaN") {
1293
+ record1 = recordIndex[0].toString();
1294
+ }
1295
+ prevResource.splice(record1, 1);
1281
1296
  }
1282
1297
  }
1283
1298
  var prevLength = prevResource ? prevResource.length : 0;
@@ -1589,14 +1604,26 @@ var Edit = /** @class */ (function () {
1589
1604
  */
1590
1605
  Edit.prototype.deleteResourceRecords = function (selectedRecords) {
1591
1606
  var deleteRecords = [];
1592
- for (var i = 0; i < selectedRecords.length; i++) {
1607
+ var _loop_1 = function (i) {
1593
1608
  if (selectedRecords[i].parentItem) {
1594
1609
  var data = selectedRecords[i];
1595
1610
  var ids = data.ganttProperties.sharedTaskUniqueIds;
1596
1611
  for (var j = 0; j < ids.length; j++) {
1597
- deleteRecords.push(this.parent.flatData[this.parent.ids.indexOf(ids[j].toString())]);
1612
+ deleteRecords.push(this_1.parent.flatData[this_1.parent.ids.indexOf(ids[j].toString())]);
1598
1613
  }
1614
+ deleteRecords.push(this_1.parent.flatData[this_1.parent.ids.indexOf(data.ganttProperties.rowUniqueID)]);
1615
+ }
1616
+ else {
1617
+ var resourceParent = this_1.parent.flatData.filter(function (data) {
1618
+ return (parseInt(data.ganttProperties.taskId) == parseInt(selectedRecords[i].ganttProperties.taskId) &&
1619
+ data.hasChildRecords);
1620
+ })[0];
1621
+ deleteRecords.push(resourceParent);
1599
1622
  }
1623
+ };
1624
+ var this_1 = this;
1625
+ for (var i = 0; i < selectedRecords.length; i++) {
1626
+ _loop_1(i);
1600
1627
  }
1601
1628
  this.deleteRow(deleteRecords);
1602
1629
  };
@@ -2043,6 +2070,14 @@ var Edit = /** @class */ (function () {
2043
2070
  eventArgs.modifiedTaskData = getTaskData(args.updatedRecordCollection, null, null, this.parent);
2044
2071
  setValue('action', args.action, eventArgs);
2045
2072
  this.parent.isOnDelete = false;
2073
+ if (this.parent.viewType === 'ResourceView') {
2074
+ var updateUnAssignedResources = eventArgs.data.filter(function (data) {
2075
+ return !data.hasChildRecords;
2076
+ });
2077
+ for (var i = 0; i < updateUnAssignedResources.length; i++) {
2078
+ this.checkWithUnassignedTask(updateUnAssignedResources[i]);
2079
+ }
2080
+ }
2046
2081
  this.parent.trigger('actionComplete', eventArgs);
2047
2082
  this.deletedTaskDetails = [];
2048
2083
  this.parent.initiateEditAction(false);
@@ -2054,12 +2089,34 @@ var Edit = /** @class */ (function () {
2054
2089
  * @private
2055
2090
  */
2056
2091
  Edit.prototype.getNewTaskId = function () {
2057
- var maxId = DataUtil.aggregates.max(this.parent.flatData, this.parent.taskFields.id);
2058
- if (!isNullOrUndefined(maxId)) {
2059
- return parseInt(maxId.toString(), 10) + 1;
2092
+ var ids = this.parent.viewType === 'ResourceView' ? this.parent.getTaskIds() : this.parent.ids;
2093
+ var maxId = ids.length;
2094
+ var newTaskId = maxId + 1;
2095
+ if (this.parent.viewType === 'ResourceView') {
2096
+ if (ids.indexOf('T' + newTaskId) !== -1 || ids.indexOf('R' + newTaskId) !== -1) {
2097
+ newTaskId = newTaskId + 1;
2098
+ if (ids.indexOf('T' + newTaskId) !== -1 || ids.indexOf('R' + newTaskId) !== -1) {
2099
+ do {
2100
+ newTaskId = newTaskId + 1;
2101
+ } while (ids.indexOf('T' + newTaskId) !== -1 || ids.indexOf('R' + newTaskId) !== -1);
2102
+ }
2103
+ }
2104
+ }
2105
+ else {
2106
+ if (ids.indexOf(newTaskId.toString()) != -1) {
2107
+ newTaskId = newTaskId + 1;
2108
+ if (ids.indexOf(newTaskId.toString()) != -1) {
2109
+ do {
2110
+ newTaskId = newTaskId + 1;
2111
+ } while (ids.indexOf(newTaskId.toString()) != -1);
2112
+ }
2113
+ }
2114
+ }
2115
+ if (this.parent.columnByField[this.parent.taskFields.id].editType === "stringedit") {
2116
+ return newTaskId = newTaskId.toString();
2060
2117
  }
2061
2118
  else {
2062
- return 1;
2119
+ return newTaskId;
2063
2120
  }
2064
2121
  };
2065
2122
  /**
@@ -2072,6 +2129,7 @@ var Edit = /** @class */ (function () {
2072
2129
  Edit.prototype.prepareNewlyAddedData = function (obj, rowPosition) {
2073
2130
  var taskModel = this.parent.taskFields;
2074
2131
  var id;
2132
+ var newTaskIDmd;
2075
2133
  var ids = this.parent.ids;
2076
2134
  /*Validate Task Id of data*/
2077
2135
  if (obj[taskModel.id]) {
@@ -2079,7 +2137,13 @@ var Edit = /** @class */ (function () {
2079
2137
  obj[taskModel.id] = null;
2080
2138
  }
2081
2139
  else {
2082
- obj[taskModel.id] = isNullOrUndefined(obj[taskModel.id]) ? null : parseInt(obj[taskModel.id], 10);
2140
+ if (typeof (obj[taskModel.id]) === "string") {
2141
+ newTaskIDmd = obj[taskModel.id];
2142
+ }
2143
+ else {
2144
+ newTaskIDmd = parseInt(obj[taskModel.id], 10);
2145
+ }
2146
+ obj[taskModel.id] = isNullOrUndefined(newTaskIDmd) ? null : newTaskIDmd;
2083
2147
  }
2084
2148
  }
2085
2149
  if (!obj[taskModel.id]) {
@@ -2319,7 +2383,7 @@ var Edit = /** @class */ (function () {
2319
2383
  recordIndex = currentItemIndex + dataChildCount + 1;
2320
2384
  //Expand Add record's parent item for project view
2321
2385
  if (!this.addRowSelectedItem.expanded && !this.parent.enableMultiTaskbar) {
2322
- this.parent.expandByID(Number(this.addRowSelectedItem.ganttProperties.rowUniqueID));
2386
+ this.parent.expandByID(this.addRowSelectedItem.ganttProperties.rowUniqueID);
2323
2387
  }
2324
2388
  updatedCollectionIndex = currentViewData.indexOf(this.addRowSelectedItem) +
2325
2389
  this.getVisibleChildRecordCount(this.addRowSelectedItem, 0, currentViewData) + 1;
@@ -2359,6 +2423,10 @@ var Edit = /** @class */ (function () {
2359
2423
  /* Record collection update */
2360
2424
  flatRecords.splice(recordIndex, 0, record);
2361
2425
  currentViewData.splice(updatedCollectionIndex, 0, record);
2426
+ if (this.parent.viewType === 'ResourceView' && typeof (record.ganttProperties.taskId) === "number") {
2427
+ var taskString = record.ganttProperties.taskId;
2428
+ ids.push(taskString.toString());
2429
+ }
2362
2430
  ids.splice(recordIndex, 0, record.ganttProperties.rowUniqueID.toString());
2363
2431
  if (this.parent.viewType === 'ResourceView') {
2364
2432
  var taskId = record.level === 0 ? 'R' + record.ganttProperties.taskId : 'T' + record.ganttProperties.taskId;
@@ -2460,27 +2528,27 @@ var Edit = /** @class */ (function () {
2460
2528
  }
2461
2529
  }
2462
2530
  }
2463
- var _loop_1 = function (i) {
2464
- var originalData = this_1.parent.modifiedRecords[i];
2465
- var treeIndex = this_1.parent.allowRowDragAndDrop ? 1 : 0;
2466
- var uniqueTaskID = this_1.parent.taskFields.id;
2467
- originalIndex = this_1.parent.currentViewData.findIndex(function (data) {
2531
+ var _loop_2 = function (i) {
2532
+ var originalData = this_2.parent.modifiedRecords[i];
2533
+ var treeIndex = this_2.parent.allowRowDragAndDrop ? 1 : 0;
2534
+ var uniqueTaskID = this_2.parent.taskFields.id;
2535
+ originalIndex = this_2.parent.currentViewData.findIndex(function (data) {
2468
2536
  return (data[uniqueTaskID] == originalData[uniqueTaskID]);
2469
2537
  });
2470
- if (this_1.parent.treeGrid.getRows()[originalIndex]) {
2471
- this_1.parent.treeGrid.renderModule.cellRender({
2472
- data: originalData, cell: this_1.parent.treeGrid.getRows()[originalIndex].cells[this_1.parent.treeColumnIndex + treeIndex],
2473
- column: this_1.parent.treeGrid.grid.getColumns()[this_1.parent.treeColumnIndex],
2538
+ if (this_2.parent.treeGrid.getRows()[originalIndex]) {
2539
+ this_2.parent.treeGrid.renderModule.cellRender({
2540
+ data: originalData, cell: this_2.parent.treeGrid.getRows()[originalIndex].cells[this_2.parent.treeColumnIndex + treeIndex],
2541
+ column: this_2.parent.treeGrid.grid.getColumns()[this_2.parent.treeColumnIndex],
2474
2542
  requestType: 'rowDragAndDrop'
2475
2543
  });
2476
- this_1.parent.treeGrid.renderModule.RowModifier({
2477
- data: originalData, row: this_1.parent.treeGrid.getRows()[originalIndex], rowHeight: this_1.parent.rowHeight
2544
+ this_2.parent.treeGrid.renderModule.RowModifier({
2545
+ data: originalData, row: this_2.parent.treeGrid.getRows()[originalIndex], rowHeight: this_2.parent.rowHeight
2478
2546
  });
2479
2547
  }
2480
2548
  };
2481
- var this_1 = this, originalIndex;
2549
+ var this_2 = this, originalIndex;
2482
2550
  for (var i = 0; i < this.parent.modifiedRecords.length; i++) {
2483
- _loop_1(i);
2551
+ _loop_2(i);
2484
2552
  }
2485
2553
  };
2486
2554
  /**
@@ -2567,6 +2635,7 @@ var Edit = /** @class */ (function () {
2567
2635
  */
2568
2636
  Edit.prototype.addRecord = function (data, rowPosition, rowIndex) {
2569
2637
  var _this = this;
2638
+ var tempTaskID = this.parent.taskFields.id;
2570
2639
  if (this.parent.editModule && this.parent.editSettings.allowAdding) {
2571
2640
  this.parent.isDynamicData = true;
2572
2641
  var cAddedRecord_1 = [];
@@ -2588,6 +2657,12 @@ var Edit = /** @class */ (function () {
2588
2657
  args = this.constructTaskAddedEventArgs(cAddedRecord_1, this.parent.editedRecords, 'beforeAdd');
2589
2658
  this.parent.showSpinner();
2590
2659
  this.parent.trigger('actionBegin', args, function (args) {
2660
+ if (!isNullOrUndefined(args.data[tempTaskID])) {
2661
+ if (args.data[tempTaskID] != args.data['ganttProperties']['taskId']) {
2662
+ args.data['ganttProperties']['taskId'] = args.data[tempTaskID];
2663
+ args.newTaskData[tempTaskID] = args.data[tempTaskID];
2664
+ }
2665
+ }
2591
2666
  if (!args.cancel) {
2592
2667
  if (isRemoteData(_this.parent.dataSource)) {
2593
2668
  var data_2 = _this.parent.dataSource;
@@ -15,6 +15,7 @@ export declare class Filter {
15
15
  private updateCustomFilters;
16
16
  private updateModel;
17
17
  private addEventListener;
18
+ private wireEvents;
18
19
  private initiateFiltering;
19
20
  /**
20
21
  * To get filter menu UI
@@ -23,6 +24,8 @@ export declare class Filter {
23
24
  * @returns {IFilterMUI} .
24
25
  */
25
26
  private getCustomFilterUi;
27
+ private mouseClickHandler;
28
+ private unWireEvents;
26
29
  private getDatePickerFilter;
27
30
  private getDateTimePickerFilter;
28
31
  private getDurationFilter;
@@ -36,7 +39,6 @@ export declare class Filter {
36
39
  private actionBegin;
37
40
  closeFilterOnContextClick(element: Element): void;
38
41
  private actionComplete;
39
- private setPosition;
40
42
  private updateFilterMenuPosition;
41
43
  private removeEventListener;
42
44
  /**
@@ -1,7 +1,7 @@
1
1
  import { TreeGrid, Filter as TreeGridFilter } from '@syncfusion/ej2-treegrid';
2
- import { filterAfterOpen, getFilterMenuPostion } from '@syncfusion/ej2-grids';
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';
@@ -229,45 +252,9 @@ var Filter = /** @class */ (function () {
229
252
  }
230
253
  }
231
254
  };
232
- Filter.prototype.setPosition = function (li, ul) {
233
- var gridPos = this.parent.element.getBoundingClientRect();
234
- var liPos = li.getBoundingClientRect();
235
- var left = liPos.right + window.scrollX;
236
- var top = liPos.top + window.scrollY;
237
- if (gridPos.right < (left + ul.offsetWidth)) {
238
- if ((liPos.left - ul.offsetWidth) > gridPos.left) {
239
- left = (liPos.left - ul.offsetWidth);
240
- }
241
- else {
242
- left -= (left + ul.offsetWidth) - gridPos.right;
243
- }
244
- }
245
- ul.style.top = top + 'px';
246
- ul.style.left = left + 'px';
247
- };
248
255
  Filter.prototype.updateFilterMenuPosition = function (element, args) {
249
256
  addClass([element], 'e-gantt');
250
- document.querySelector('#' + this.parent.controlId).appendChild(element);
251
- var targetElement;
252
- if (this.parent.showColumnMenu) {
253
- targetElement = document.querySelector('#treeGrid' + this.parent.controlId + '_gridcontrol_colmenu_Filter');
254
- element.style.zIndex = targetElement.parentElement.style.zIndex;
255
- if (this.parent.treeGrid.filterSettings.type === 'Menu') {
256
- this.setPosition(targetElement, getValue('filterModel.dlgObj.element', args));
257
- }
258
- else {
259
- this.setPosition(targetElement, getValue('filterModel.dialogObj.element', args));
260
- }
261
- }
262
- else {
263
- targetElement = this.parent.treeGrid.grid.getColumnHeaderByField(args.columnName).querySelector('.e-filtermenudiv');
264
- if (this.parent.treeGrid.filterSettings.type === 'Menu') {
265
- getFilterMenuPostion(targetElement, getValue('filterModel.dlgObj', args));
266
- }
267
- else {
268
- getFilterMenuPostion(targetElement, getValue('filterModel.dialogObj', args));
269
- }
270
- }
257
+ document.querySelector('#' + this.parent.treeGrid.grid.element.id).appendChild(element);
271
258
  if (this.parent.treeGrid.filterSettings.type === 'Menu') {
272
259
  element.querySelector('.e-valid-input').focus();
273
260
  }
@@ -288,6 +275,7 @@ var Filter = /** @class */ (function () {
288
275
  */
289
276
  Filter.prototype.destroy = function () {
290
277
  this.removeEventListener();
278
+ this.unWireEvents();
291
279
  };
292
280
  return Filter;
293
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
  }
@@ -405,7 +405,7 @@ var Toolbar = /** @class */ (function () {
405
405
  var isDeleteSelected = gObj.selectionModule ? gObj.selectionModule.selectedRowIndexes.length > 0 ||
406
406
  gObj.selectionModule.getSelectedRowCellIndexes().length > 0 ? true : false : false;
407
407
  // eslint-disable-next-line
408
- edit.allowDeleting && isResouceParent && hasData && isDeleteSelected && !touchEdit ?
408
+ edit.allowDeleting && hasData && isDeleteSelected && !touchEdit ?
409
409
  enableItems.push(gID + '_delete') : disableItems.push(gID + '_delete');
410
410
  if (gObj.editSettings.mode === 'Auto' && !isNullOrUndefined(gObj.editModule.cellEditModule)
411
411
  && gObj.editModule.cellEditModule.isCellEdit) {
@@ -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