@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,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 20.2.49
3
+ * version : 20.3.47
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-gantt@*",
3
- "_id": "@syncfusion/ej2-gantt@20.2.46",
3
+ "_id": "@syncfusion/ej2-gantt@20.6.13",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-aGXXWkPX90LO9UIWv7jrXAgVHVBHVSx82HYWYWu+4OXSh5KxmCAmhmwc40Dvem3YA1eDpChCOWdl5QaMhWo9nA==",
5
+ "_integrity": "sha512-kdZk1adl1XJlxz+IuDQCFGD4Cmd+rlfqUOfVr1pwEsBfuaaa9C1tZmDysXPDkn2AiVyZ64EWDPgQOw/ZnQl27A==",
6
6
  "_location": "/@syncfusion/ej2-gantt",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,8 +23,8 @@
23
23
  "/@syncfusion/ej2-react-gantt",
24
24
  "/@syncfusion/ej2-vue-gantt"
25
25
  ],
26
- "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-gantt/-/ej2-gantt-20.2.46.tgz",
27
- "_shasum": "2634a07edea76e02c4da292cec2922216ca23d37",
26
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-gantt/-/ej2-gantt-20.6.13.tgz",
27
+ "_shasum": "70beb11e362a1f86c917e363fd8a653bd1409437",
28
28
  "_spec": "@syncfusion/ej2-gantt@*",
29
29
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
30
30
  "author": {
@@ -35,24 +35,24 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~20.2.48",
39
- "@syncfusion/ej2-buttons": "~20.2.46",
40
- "@syncfusion/ej2-calendars": "~20.2.46",
41
- "@syncfusion/ej2-data": "~20.2.45",
42
- "@syncfusion/ej2-dropdowns": "~20.2.48",
43
- "@syncfusion/ej2-grids": "~20.2.49",
44
- "@syncfusion/ej2-inputs": "~20.2.48",
45
- "@syncfusion/ej2-layouts": "~20.2.46",
46
- "@syncfusion/ej2-lists": "~20.2.46",
47
- "@syncfusion/ej2-navigations": "~20.2.49",
48
- "@syncfusion/ej2-popups": "~20.2.49",
49
- "@syncfusion/ej2-richtexteditor": "~20.2.49",
50
- "@syncfusion/ej2-treegrid": "~20.2.49"
38
+ "@syncfusion/ej2-base": "~20.3.47",
39
+ "@syncfusion/ej2-buttons": "~20.3.47",
40
+ "@syncfusion/ej2-calendars": "~20.3.47",
41
+ "@syncfusion/ej2-data": "~20.3.47",
42
+ "@syncfusion/ej2-dropdowns": "~20.3.47",
43
+ "@syncfusion/ej2-grids": "~20.3.47",
44
+ "@syncfusion/ej2-inputs": "~20.3.47",
45
+ "@syncfusion/ej2-layouts": "~20.3.47",
46
+ "@syncfusion/ej2-lists": "~20.3.47",
47
+ "@syncfusion/ej2-navigations": "~20.3.47",
48
+ "@syncfusion/ej2-popups": "~20.3.47",
49
+ "@syncfusion/ej2-richtexteditor": "~20.3.47",
50
+ "@syncfusion/ej2-treegrid": "~20.3.47"
51
51
  },
52
52
  "deprecated": false,
53
53
  "description": "Essential JS 2 Gantt Component",
54
54
  "devDependencies": {},
55
- "es2015": "./dist/es6/ej2-gantt.es2015.js",
55
+ "es2015": "./dist/es6/ej2-gantt.es5.js",
56
56
  "homepage": "https://github.com/syncfusion/ej2-gantt#readme",
57
57
  "keywords": [
58
58
  "ej2",
@@ -75,6 +75,6 @@
75
75
  "url": "git+https://github.com/syncfusion/ej2-gantt.git"
76
76
  },
77
77
  "typings": "index.d.ts",
78
- "version": "20.2.49",
78
+ "version": "20.3.47",
79
79
  "sideEffects": false
80
80
  }
@@ -50,8 +50,7 @@ var CellEdit = /** @class */ (function () {
50
50
  }
51
51
  if (data.hasChildRecords && ((field === taskSettings.endDate && ((!isNullOrUndefined(data['isManual']) &&
52
52
  data['isManual'] === false) || this.parent.taskMode === 'Auto')) || field === taskSettings.duration
53
- || field === taskSettings.dependency || field === taskSettings.progress
54
- || field === taskSettings.work || field === 'taskType')) {
53
+ || field === taskSettings.progress || field === taskSettings.work || field === 'taskType')) {
55
54
  args.cancel = true;
56
55
  }
57
56
  else {
@@ -77,6 +77,8 @@ export declare class ConnectorLineEdit {
77
77
  refreshEditedRecordConnectorLine(editedRecord: IGanttData[]): void;
78
78
  private idFromPredecessor;
79
79
  private predecessorValidation;
80
+ getRootParent(rec: IGanttData): IGanttData;
81
+ validateParentPredecessor(fromRecord: IGanttData, toRecord: IGanttData): boolean;
80
82
  /**
81
83
  * To validate predecessor relations
82
84
  *
@@ -143,8 +143,7 @@ var ConnectorLineEdit = /** @class */ (function () {
143
143
  this.parent.connectorLineModule.removeConnectorLineById('parent' + predecessor[from] + 'child' + predecessor[to]);
144
144
  parentGanttRecord = this.parent.connectorLineModule.getRecordByID(predecessor[from]);
145
145
  childGanttRecord = this.parent.connectorLineModule.getRecordByID(predecessor[to]);
146
- if ((parentGanttRecord && parentGanttRecord.expanded === true) ||
147
- (childGanttRecord && childGanttRecord.expanded === true)) {
146
+ if (parentGanttRecord || childGanttRecord) {
148
147
  connectorObj =
149
148
  this.parent.predecessorModule.updateConnectorLineObject(parentGanttRecord, childGanttRecord, predecessor);
150
149
  if (!isNullOrUndefined(connectorObj)) {
@@ -183,14 +182,38 @@ var ConnectorLineEdit = /** @class */ (function () {
183
182
  ConnectorLineEdit.prototype.idFromPredecessor = function (pre) {
184
183
  var preArray = pre.split(',');
185
184
  var preIdArray = [];
185
+ var values;
186
+ var offsetValue;
187
+ var match = [];
186
188
  for (var j = 0; j < preArray.length; j++) {
187
189
  var strArray = [];
188
- for (var i = 0; i < preArray[j].length; i++) {
189
- if (!isNullOrUndefined(preArray[j].charAt(i)) && parseInt(preArray[j].charAt(i), 10).toString() !== 'NaN') {
190
- strArray.push(preArray[j].charAt(i));
190
+ values = preArray[j].split('+');
191
+ offsetValue = '+';
192
+ if (preArray[j].indexOf('-') >= 0) {
193
+ values = preArray[j].split('-');
194
+ offsetValue = '-';
195
+ }
196
+ if (!isNullOrUndefined(values[0])) {
197
+ var ids = this.parent.viewType === 'ResourceView' ? this.parent.getTaskIds() : this.parent.ids;
198
+ if (ids.indexOf(values[0]) === -1) {
199
+ if (values[0].indexOf(" ") != -1) {
200
+ match = values[0].split(" ");
201
+ if (match.length === 1) {
202
+ match = values[0].match(/(\d+|[A-z]+)/g);
203
+ }
204
+ strArray.push(match[0]);
205
+ }
206
+ else {
207
+ if (values[0].length === 1 || values[0].length === 2) {
208
+ strArray.push(values[0]);
209
+ }
210
+ else {
211
+ strArray.push(values[0].slice(0, -2));
212
+ }
213
+ }
191
214
  }
192
215
  else {
193
- break;
216
+ strArray.push(values[0]);
194
217
  }
195
218
  }
196
219
  preIdArray.push((strArray.join('')));
@@ -248,6 +271,75 @@ var ConnectorLineEdit = /** @class */ (function () {
248
271
  }
249
272
  return true;
250
273
  };
274
+ // Get the root parent of the record
275
+ ConnectorLineEdit.prototype.getRootParent = function (rec) {
276
+ var parentRec = rec;
277
+ if (rec.parentItem) {
278
+ parentRec = this.parent.flatData.filter(function (item) {
279
+ return item.uniqueID == rec.parentUniqueID;
280
+ })[0];
281
+ if (parentRec.parentItem) {
282
+ parentRec = this.getRootParent(parentRec);
283
+ }
284
+ return parentRec;
285
+ }
286
+ return parentRec;
287
+ };
288
+ // To check whether the predecessor drawn is valid for parent task
289
+ ConnectorLineEdit.prototype.validateParentPredecessor = function (fromRecord, toRecord) {
290
+ if (toRecord.hasChildRecords && !fromRecord.hasChildRecords) {
291
+ if (fromRecord.parentUniqueID === toRecord.uniqueID) {
292
+ return false;
293
+ }
294
+ else {
295
+ do {
296
+ if (fromRecord.parentItem) {
297
+ fromRecord = this.parent.flatData[this.parent.ids.indexOf(fromRecord.parentItem.taskId)];
298
+ if (fromRecord.uniqueID === toRecord.uniqueID) {
299
+ return false;
300
+ }
301
+ }
302
+ } while (fromRecord.parentItem);
303
+ }
304
+ }
305
+ else if (!toRecord.hasChildRecords && fromRecord.hasChildRecords) {
306
+ if (toRecord.parentUniqueID === fromRecord.uniqueID) {
307
+ return false;
308
+ }
309
+ else {
310
+ do {
311
+ if (toRecord.parentItem) {
312
+ toRecord = this.parent.flatData[this.parent.ids.indexOf(toRecord.parentItem.taskId)];
313
+ if (toRecord.uniqueID === fromRecord.uniqueID) {
314
+ return false;
315
+ }
316
+ }
317
+ } while (toRecord.parentItem);
318
+ }
319
+ }
320
+ else if (toRecord.hasChildRecords && fromRecord.hasChildRecords) {
321
+ if (toRecord.parentItem && fromRecord.parentItem) {
322
+ if (fromRecord.parentUniqueID === toRecord.uniqueID || fromRecord.uniqueID === toRecord.parentUniqueID) {
323
+ return false;
324
+ }
325
+ }
326
+ else {
327
+ if (!toRecord.parentItem && fromRecord.parentItem) {
328
+ var fromRootParent = this.parent.connectorLineEditModule.getRootParent(fromRecord);
329
+ if (fromRootParent.uniqueID === toRecord.uniqueID) {
330
+ return false;
331
+ }
332
+ }
333
+ else if (toRecord.parentItem && !fromRecord.parentItem) {
334
+ var toRootParent = this.parent.connectorLineEditModule.getRootParent(toRecord);
335
+ if (toRootParent.uniqueID === fromRecord.uniqueID) {
336
+ return false;
337
+ }
338
+ }
339
+ }
340
+ }
341
+ return true;
342
+ };
251
343
  /**
252
344
  * To validate predecessor relations
253
345
  *
@@ -265,10 +357,12 @@ var ConnectorLineEdit = /** @class */ (function () {
265
357
  if (!isNullOrUndefined(predecessorString) && predecessorString.length > 0) {
266
358
  predecessorIdArray = this.idFromPredecessor(predecessorString);
267
359
  var _loop_2 = function (count) {
268
- //Check edited item has parent item in predecessor collection
269
- var checkParent = this_2.checkParentRelation(ganttRecord, predecessorIdArray);
270
- if (!checkParent) {
271
- return { value: false };
360
+ if (parseInt(predecessorIdArray[predecessorIdArray.length - 1]) !== ganttRecord[this_2.parent.taskFields.id]) {
361
+ var num = this_2.parent.ids.indexOf(predecessorIdArray[predecessorIdArray.length - 1]);
362
+ var fromRecord = this_2.parent.currentViewData[num];
363
+ if (fromRecord && ganttRecord) {
364
+ flag = this_2.validateParentPredecessor(fromRecord, ganttRecord);
365
+ }
272
366
  }
273
367
  // Check if predecessor exist more then one
274
368
  var tempIdArray = predecessorIdArray.slice(0);
@@ -100,7 +100,12 @@ var ContextMenu = /** @class */ (function () {
100
100
  }
101
101
  switch (this.item) {
102
102
  case 'TaskInformation':
103
- this.parent.openEditDialog(Number(this.rowData.ganttProperties.rowUniqueID));
103
+ if (isNaN(Number(this.rowData.ganttProperties.rowUniqueID))) {
104
+ this.parent.openEditDialog(this.rowData.ganttProperties.rowUniqueID);
105
+ }
106
+ else {
107
+ this.parent.openEditDialog(Number(this.rowData.ganttProperties.rowUniqueID));
108
+ }
104
109
  break;
105
110
  case 'Above':
106
111
  case 'Below':
@@ -11,7 +11,7 @@ export declare class CriticalPath {
11
11
  constructor(parent: Gantt);
12
12
  getCriticalTasks(): IGanttData[];
13
13
  showCriticalPath(isCritical: boolean): void;
14
- slackCalculation(fromDataObject: object[], collection: object[], collectionTaskId: number[], checkEndDate: Date, flatRecords: IGanttData[], modelRecordIds: string[]): void;
14
+ slackCalculation(fromDataObject: object[], collection: object[], collectionTaskId: any, checkEndDate: Date, flatRecords: IGanttData[], modelRecordIds: string[]): void;
15
15
  private getSlackDuration;
16
16
  private finalCriticalPath;
17
17
  criticalConnectorLine(criticalPathIds: number[], collection: object[], condition: boolean, collectionTaskId: number[]): void;
@@ -13,13 +13,13 @@ var CriticalPath = /** @class */ (function () {
13
13
  CriticalPath.prototype.showCriticalPath = function (isCritical) {
14
14
  var modelIds = this.parent.ids;
15
15
  var totalRecords = this.parent.flatData;
16
- if (isCritical && this.parent.flatData.length > 0 && !this.parent.enableMultiTaskbar) {
16
+ if (isCritical && this.parent.flatData.length > 0) {
17
17
  this.parent.enableCriticalPath = true;
18
18
  var parentRecords = this.parent.treeGrid.parentData;
19
19
  var checkEndDateTaskid = void 0;
20
20
  var checkEndDate = parentRecords[0].ganttProperties.endDate;
21
21
  var dateDifference = 0;
22
- var checkBeyondEnddate = [];
22
+ var checkBeyondEnddate_1 = [];
23
23
  var totalPredecessorsCollection = [];
24
24
  var totalPredecessorsCollectionId = [];
25
25
  var predecessorIndex = 0;
@@ -58,12 +58,12 @@ var CriticalPath = /** @class */ (function () {
58
58
  totalRecords[j].slack = dateDifference + ' ' + totalRecords[j].ganttProperties.durationUnit;
59
59
  totalRecords[j].ganttProperties.slack = dateDifference + ' ' + totalRecords[j].ganttProperties.durationUnit;
60
60
  if (totalRecords[j].ganttProperties.endDate >= checkEndDate) {
61
- checkBeyondEnddate.push(parseInt(totalRecords[j].ganttProperties.taskId, 10));
61
+ checkBeyondEnddate_1.push(totalRecords[j].ganttProperties.taskId);
62
62
  }
63
63
  if (totalRecords[j].ganttProperties.predecessor) {
64
64
  if (totalRecords[j].ganttProperties.predecessor.length !== 0) {
65
65
  totalPredecessorsCollection.push(totalRecords[j]);
66
- totalPredecessorsCollectionId.push(parseInt(totalRecords[j].ganttProperties.taskId, 10));
66
+ totalPredecessorsCollectionId.push((totalRecords[j].ganttProperties.taskId));
67
67
  }
68
68
  }
69
69
  }
@@ -72,25 +72,36 @@ var CriticalPath = /** @class */ (function () {
72
72
  this.resourceCollectionIds[i] = this.parent.taskIds[i].slice(1);
73
73
  }
74
74
  }
75
- // seperate the predecessor connected taskes from the individual taskes that ends on total project end date
76
- for (var k = 0; k < checkBeyondEnddate.length; k++) {
77
- if (totalPredecessorsCollectionId.indexOf(checkBeyondEnddate[k]) === -1) {
78
- if (this.parent.viewType === 'ProjectView') {
79
- predecessorIndex = modelIds.indexOf(checkBeyondEnddate[k].toString());
75
+ var _loop_1 = function (k) {
76
+ if (totalPredecessorsCollectionId.indexOf(checkBeyondEnddate_1[k]) === -1) {
77
+ if (this_1.parent.viewType === 'ProjectView') {
78
+ predecessorIndex = modelIds.indexOf(checkBeyondEnddate_1[k].toString());
80
79
  }
81
80
  else {
82
- predecessorIndex = this.resourceCollectionIds.indexOf(checkBeyondEnddate[k].toString());
81
+ var currentRecords = this_1.parent.currentViewData.filter(function (data) {
82
+ return parseInt(data.ganttProperties.taskId) == checkBeyondEnddate_1[k];
83
+ });
84
+ for (var i = 0; i < currentRecords.length; i++) {
85
+ if (!currentRecords[i].hasChildRecords && currentRecords[i].ganttProperties.endDate >= this_1.maxEndDate) {
86
+ predecessorIndex = currentRecords[i].index;
87
+ }
88
+ }
83
89
  }
84
90
  if (totalRecords[predecessorIndex].ganttProperties.progress < 100) {
85
91
  totalRecords[predecessorIndex].isCritical = true;
86
92
  totalRecords[predecessorIndex].ganttProperties.isCritical = true;
87
93
  }
88
94
  totalRecords[predecessorIndex]['slack'] = 0 + ' ' + totalRecords[predecessorIndex].ganttProperties.durationUnit;
89
- taskBeyondEnddate.push(checkBeyondEnddate[k]);
95
+ taskBeyondEnddate.push(checkBeyondEnddate_1[k]);
90
96
  }
91
97
  else {
92
- predecessorTaskBeyondEnddate.push(checkBeyondEnddate[k]);
98
+ predecessorTaskBeyondEnddate.push(checkBeyondEnddate_1[k]);
93
99
  }
100
+ };
101
+ var this_1 = this;
102
+ // seperate the predecessor connected taskes from the individual taskes that ends on total project end date
103
+ for (var k = 0; k < checkBeyondEnddate_1.length; k++) {
104
+ _loop_1(k);
94
105
  }
95
106
  var predecessorLength = totalPredecessorsCollection.length;
96
107
  var endTask = [];
@@ -100,12 +111,22 @@ var CriticalPath = /** @class */ (function () {
100
111
  var from = -1;
101
112
  var toPredecessor = -1;
102
113
  var fromPredecessor = -1;
114
+ var tempTaskId = void 0;
103
115
  var currentIndex = x;
104
116
  var predecessor = totalPredecessorsCollection[x].ganttProperties.predecessor;
105
117
  var individualPredecessorLength = totalPredecessorsCollection[x].ganttProperties.predecessor.length;
106
- var taskid = (parseInt(totalPredecessorsCollection[x].ganttProperties.taskId, 10));
118
+ var taskid = ((totalPredecessorsCollection[x].ganttProperties.taskId));
107
119
  for (var y = 0; y < individualPredecessorLength; y++) {
108
- if (parseInt(predecessor[y].from, 10) === taskid) {
120
+ if (!isNaN(Number(predecessor[y].from)) && typeof (taskid) != "string") {
121
+ tempTaskId = parseInt((predecessor[y].from), 10);
122
+ }
123
+ else if (!isNaN(Number(predecessor[y].from)) && typeof (taskid) === "string") {
124
+ tempTaskId = predecessor[y].from;
125
+ }
126
+ else {
127
+ tempTaskId = predecessor[y].from;
128
+ }
129
+ if (tempTaskId === taskid) {
109
130
  if (to === -1) {
110
131
  if (!predecessor[y].offset) {
111
132
  to = predecessor[y].to;
@@ -127,7 +148,16 @@ var CriticalPath = /** @class */ (function () {
127
148
  }
128
149
  }
129
150
  }
130
- if (parseInt(predecessor[y].to, 10) === taskid) {
151
+ if (!isNaN(Number(predecessor[y].to)) && typeof (taskid) != "string") {
152
+ tempTaskId = parseInt((predecessor[y].to), 10);
153
+ }
154
+ else if (!isNaN(Number(predecessor[y].to)) && typeof (taskid) === "string") {
155
+ tempTaskId = predecessor[y].to;
156
+ }
157
+ else {
158
+ tempTaskId = predecessor[y].to;
159
+ }
160
+ if (tempTaskId === taskid) {
131
161
  if (from === -1) {
132
162
  if (!predecessor[y].offset) {
133
163
  from = predecessor[y].from;
@@ -196,7 +226,7 @@ var CriticalPath = /** @class */ (function () {
196
226
  this.detailPredecessorCollection = collection;
197
227
  this.predecessorCollectionTaskIds = collectionTaskId;
198
228
  }
199
- if (isCritical === false && this.parent.flatData.length > 0 && !this.parent.enableMultiTaskbar) {
229
+ if (isCritical === false && this.parent.flatData.length > 0) {
200
230
  var pathIndex = void 0;
201
231
  this.parent.enableCriticalPath = false;
202
232
  for (var z = 0; z < this.criticalPathCollection.length; z++) {
@@ -212,6 +242,8 @@ var CriticalPath = /** @class */ (function () {
212
242
  CriticalPath.prototype.slackCalculation = function (fromDataObject, collection, collectionTaskId, checkEndDate, flatRecords, modelRecordIds) {
213
243
  var fromDateArray = fromDataObject[0]['fromdata'].split(',');
214
244
  var fromDataPredecessor = fromDataObject[0]['fromDataPredecessor'].split(',');
245
+ collectionTaskId = collectionTaskId.toString();
246
+ collectionTaskId = collectionTaskId.split(',');
215
247
  var fromDateArray1 = [];
216
248
  var fromTaskIdIndex;
217
249
  var indexFromTaskId;
@@ -223,8 +255,8 @@ var CriticalPath = /** @class */ (function () {
223
255
  var ffslack;
224
256
  for (var i = 0; i < fromDateArray.length; i++) {
225
257
  fromDateArray1 = fromDateArray[i].split(':');
226
- fromTaskIdIndex = collectionTaskId.indexOf(parseInt(fromDateArray1[0], 10));
227
- totaskId = collectionTaskId.indexOf(parseInt(fromDataObject[0]['todateID'], 10));
258
+ fromTaskIdIndex = collectionTaskId.indexOf((fromDateArray1[0].toString()));
259
+ totaskId = collectionTaskId.indexOf((fromDataObject[0]['todateID'].toString()));
228
260
  if (this.parent.viewType === 'ProjectView') {
229
261
  indexFromTaskId = modelRecordIds.indexOf(fromDateArray1[0].toString());
230
262
  indexToTaskId = modelRecordIds.indexOf(fromDataObject[0]['todateID'].toString());
@@ -569,6 +601,7 @@ var CriticalPath = /** @class */ (function () {
569
601
  CriticalPath.prototype.finalCriticalPath = function (collection, taskBeyondEnddate, flatRecords, modelRecordIds, checkEndDate) {
570
602
  var criticalPathIds = [];
571
603
  var index;
604
+ var predecessorFrom;
572
605
  for (var x = collection.length - 1; x >= 0; x--) {
573
606
  if (this.parent.viewType === 'ProjectView') {
574
607
  index = modelRecordIds.indexOf(collection[x]['taskid'].toString());
@@ -612,7 +645,13 @@ var CriticalPath = /** @class */ (function () {
612
645
  /* eslint-disable-next-line */
613
646
  dateDifference = this.parent.dataOperation.getDuration(currentData.endDate, flatRecords[toID].ganttProperties.endDate, currentData.durationUnit, currentData.isAutoSchedule, currentData.isMilestone);
614
647
  }
615
- if (parseInt(predecessorLength[i].from, 10) === flatRecords[index][this.parent.taskFields.id] &&
648
+ if (typeof (flatRecords[index][this.parent.taskFields.id]) === 'number') {
649
+ predecessorFrom = parseInt(predecessorLength[i].from, 10);
650
+ }
651
+ else {
652
+ predecessorFrom = predecessorLength[i].from;
653
+ }
654
+ if (predecessorFrom === flatRecords[index][this.parent.taskFields.id] &&
616
655
  flatRecords[toID].slack === noSlackValue && dateDifference <= 0) {
617
656
  flatRecords[index].slack = noSlackValue;
618
657
  flatRecords[index].ganttProperties.slack = noSlackValue;
@@ -647,26 +686,47 @@ var CriticalPath = /** @class */ (function () {
647
686
  CriticalPath.prototype.criticalConnectorLine = function (criticalPathIds, collection, condition, collectionTaskId) {
648
687
  var ganttChartElement = this.parent.ganttChartModule.chartElement;
649
688
  this.parent.removeCriticalPathStyles();
650
- for (var i = 0; i < criticalPathIds.length; i++) {
651
- var criticalData = void 0;
652
- if (this.parent.viewType === 'ProjectView') {
653
- criticalData = this.parent.flatData[this.parent.ids.indexOf(criticalPathIds[i].toString())];
689
+ var _loop_2 = function (i) {
690
+ var criticalData;
691
+ if (this_2.parent.viewType === 'ProjectView') {
692
+ criticalData = this_2.parent.currentViewData[this_2.parent.ids.indexOf(criticalPathIds[i].toString())];
654
693
  }
655
694
  else {
656
- criticalData = this.parent.flatData[this.resourceCollectionIds.indexOf(criticalPathIds[i].toString())];
695
+ var currentRecords = this_2.parent.currentViewData.filter(function (data) {
696
+ return (data.ganttProperties.taskId).toString() == criticalPathIds[i].toString();
697
+ });
698
+ for (var i_1 = 0; i_1 < currentRecords.length; i_1++) {
699
+ if (currentRecords[i_1].ganttProperties.isCritical || currentRecords[i_1].ganttProperties.endDate >= this_2.maxEndDate) {
700
+ criticalData = currentRecords[i_1];
701
+ }
702
+ }
657
703
  }
658
- var index = this.parent.currentViewData.indexOf(criticalData);
659
- var element = this.parent.getRowByIndex(index);
704
+ var index = this_2.parent.currentViewData.indexOf(criticalData);
705
+ var element = this_2.parent.getRowByIndex(index);
660
706
  var taskClass = void 0;
661
- var columnFields = this.parent.taskFields;
707
+ var columnFields = this_2.parent.taskFields;
708
+ if (criticalData.parentItem) {
709
+ var parentRecord = this_2.parent.currentViewData.filter(function (data) {
710
+ return criticalData.parentItem.uniqueID == data.uniqueID;
711
+ });
712
+ var parentIndex = this_2.parent.currentViewData.indexOf(parentRecord[0]);
713
+ var parentElement = this_2.parent.getRowByIndex(parentIndex);
714
+ var parentTaskbarElement = parentElement.querySelectorAll('.e-taskbar-main-container');
715
+ for (var i_2 = 0; i_2 < parentTaskbarElement.length; i_2++) {
716
+ if (parentTaskbarElement[i_2].getAttribute('rowuniqueid') == criticalData['rowUniqueID']) {
717
+ addClass(parentTaskbarElement[i_2].querySelectorAll('.e-gantt-child-taskbar-inner-div'), cls.criticalChildTaskBarInnerDiv);
718
+ }
719
+ }
720
+ }
662
721
  /* eslint-disable-next-line */
663
- if (this.parent.allowUnscheduledTasks && !criticalData[columnFields.startDate] && !criticalData[columnFields.endDate] && criticalData[columnFields.duration]) {
722
+ if (this_2.parent.allowUnscheduledTasks && !criticalData[columnFields.startDate] && !criticalData[columnFields.endDate] && criticalData[columnFields.duration]) {
664
723
  taskClass = cls.criticalUnscheduledTask;
665
724
  }
666
725
  else {
667
726
  taskClass = cls.criticalChildProgressBarInnerDiv;
668
727
  }
669
- if (element) {
728
+ if (element && (this_2.parent.viewType === 'ProjectView' || (this_2.parent.viewType === 'ResourceView' &&
729
+ !criticalData.hasChildRecords))) {
670
730
  if (element.getElementsByClassName('e-milestone-top')[0]) {
671
731
  addClass(element.querySelectorAll('.e-milestone-top'), cls.criticalMilestoneTop);
672
732
  }
@@ -680,19 +740,34 @@ var CriticalPath = /** @class */ (function () {
680
740
  addClass(element.querySelectorAll('.e-gantt-child-progressbar-inner-div'), taskClass);
681
741
  }
682
742
  }
743
+ };
744
+ var this_2 = this;
745
+ for (var i = 0; i < criticalPathIds.length; i++) {
746
+ _loop_2(i);
683
747
  }
684
748
  if (collection.length !== 0) {
685
749
  var index = 0;
686
750
  var currentdata = void 0;
687
751
  var checking = [];
688
752
  var checkint = void 0;
753
+ var values = void 0;
754
+ var offsetValue = void 0;
689
755
  for (var i = 0; i < this.criticalPathCollection.length; i++) {
690
756
  index = collectionTaskId.indexOf(this.criticalPathCollection[i]);
691
757
  currentdata = collection[index];
692
758
  if (index !== -1 && currentdata['to']) {
693
759
  checking = currentdata['to'].split(',');
694
760
  for (var j = 0; j < checking.length; j++) {
695
- checkint = parseInt(checking[j], 10);
761
+ values = checking[j].split('+');
762
+ offsetValue = '+';
763
+ if (checking[j].indexOf('-') >= 0) {
764
+ values = checking[j].split('-');
765
+ offsetValue = '-';
766
+ }
767
+ checkint = (values[0].replace(":", ""));
768
+ if (typeof (criticalPathIds[j]) === "number") {
769
+ checkint = parseInt(values[0], 10);
770
+ }
696
771
  if (criticalPathIds.indexOf(checkint) !== -1) {
697
772
  var lineElement = this.parent.element.querySelectorAll('#ConnectorLineparent' +
698
773
  currentdata['taskid'] + 'child' + checkint);
@@ -8,6 +8,7 @@ export declare class Dependency {
8
8
  private dateValidateModule;
9
9
  private parentRecord;
10
10
  private parentIds;
11
+ private parentPredecessors;
11
12
  constructor(gantt: Gantt);
12
13
  /**
13
14
  * Method to populate predecessor collections in records
@@ -79,6 +80,7 @@ export declare class Dependency {
79
80
  * @private
80
81
  */
81
82
  updatedRecordsDateByPredecessor(): void;
83
+ updateParentPredecessor(): void;
82
84
  /**
83
85
  * To validate task date values with dependency
84
86
  *