@syncfusion/ej2-gantt 22.2.11 → 23.1.36

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 (127) hide show
  1. package/CHANGELOG.md +195 -163
  2. package/dist/ej2-gantt.min.js +2 -2
  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 +1003 -292
  6. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  7. package/dist/es6/ej2-gantt.es5.js +1040 -313
  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 +21 -21
  13. package/src/gantt/actions/cell-edit.js +4 -1
  14. package/src/gantt/actions/context-menu.js +4 -1
  15. package/src/gantt/actions/critical-path.d.ts +2 -0
  16. package/src/gantt/actions/critical-path.js +81 -59
  17. package/src/gantt/actions/dependency.d.ts +1 -0
  18. package/src/gantt/actions/dependency.js +43 -25
  19. package/src/gantt/actions/dialog-edit.js +27 -7
  20. package/src/gantt/actions/edit.d.ts +12 -1
  21. package/src/gantt/actions/edit.js +91 -10
  22. package/src/gantt/actions/filter.js +3 -0
  23. package/src/gantt/actions/pdf-export.d.ts +4 -1
  24. package/src/gantt/actions/pdf-export.js +36 -3
  25. package/src/gantt/actions/rowdragdrop.js +10 -2
  26. package/src/gantt/actions/selection.js +22 -5
  27. package/src/gantt/actions/taskbar-edit.js +51 -36
  28. package/src/gantt/actions/toolbar.js +8 -0
  29. package/src/gantt/base/date-processor.js +3 -3
  30. package/src/gantt/base/gantt-chart.d.ts +1 -0
  31. package/src/gantt/base/gantt-chart.js +79 -6
  32. package/src/gantt/base/gantt-model.d.ts +7 -0
  33. package/src/gantt/base/gantt.d.ts +6 -0
  34. package/src/gantt/base/gantt.js +83 -13
  35. package/src/gantt/base/interface.d.ts +14 -0
  36. package/src/gantt/base/task-processor.d.ts +4 -4
  37. package/src/gantt/base/task-processor.js +86 -36
  38. package/src/gantt/base/tree-grid.js +19 -10
  39. package/src/gantt/export/export-helper.d.ts +5 -1
  40. package/src/gantt/export/export-helper.js +152 -4
  41. package/src/gantt/export/pdf-base/pdf-grid-table.js +2 -2
  42. package/src/gantt/export/pdf-base/pdf-style/gantt-theme.js +8 -0
  43. package/src/gantt/export/pdf-base/treegrid-layouter.js +6 -1
  44. package/src/gantt/export/pdf-connector-line.js +3 -1
  45. package/src/gantt/export/pdf-gantt.js +6 -0
  46. package/src/gantt/export/pdf-taskbar.d.ts +13 -0
  47. package/src/gantt/export/pdf-taskbar.js +39 -5
  48. package/src/gantt/export/pdf-timeline.js +17 -8
  49. package/src/gantt/export/pdf-treegrid.js +3 -0
  50. package/src/gantt/models/task-fields-model.d.ts +7 -0
  51. package/src/gantt/models/task-fields.d.ts +6 -0
  52. package/src/gantt/models/task-fields.js +3 -0
  53. package/src/gantt/renderer/chart-rows.d.ts +1 -1
  54. package/src/gantt/renderer/chart-rows.js +39 -20
  55. package/src/gantt/renderer/connector-line.js +49 -9
  56. package/src/gantt/renderer/edit-tooltip.js +11 -7
  57. package/src/gantt/renderer/timeline.js +19 -9
  58. package/src/gantt/renderer/tooltip.js +37 -33
  59. package/styles/bootstrap-dark.css +44 -100
  60. package/styles/bootstrap.css +44 -100
  61. package/styles/bootstrap4.css +44 -100
  62. package/styles/bootstrap5-dark.css +44 -100
  63. package/styles/bootstrap5.css +44 -100
  64. package/styles/fabric-dark.css +44 -100
  65. package/styles/fabric.css +44 -100
  66. package/styles/fluent-dark.css +44 -100
  67. package/styles/fluent.css +44 -100
  68. package/styles/gantt/_layout.scss +44 -31
  69. package/styles/gantt/_theme.scss +104 -98
  70. package/styles/gantt/bootstrap-dark.css +44 -100
  71. package/styles/gantt/bootstrap-dark.scss +1 -1
  72. package/styles/gantt/bootstrap.css +44 -100
  73. package/styles/gantt/bootstrap.scss +1 -1
  74. package/styles/gantt/bootstrap4.css +44 -100
  75. package/styles/gantt/bootstrap4.scss +1 -1
  76. package/styles/gantt/bootstrap5-dark.css +44 -100
  77. package/styles/gantt/bootstrap5-dark.scss +1 -1
  78. package/styles/gantt/bootstrap5.css +44 -100
  79. package/styles/gantt/bootstrap5.scss +1 -1
  80. package/styles/gantt/fabric-dark.css +44 -100
  81. package/styles/gantt/fabric-dark.scss +1 -1
  82. package/styles/gantt/fabric.css +44 -100
  83. package/styles/gantt/fabric.scss +1 -1
  84. package/styles/gantt/fluent-dark.css +44 -100
  85. package/styles/gantt/fluent-dark.scss +1 -1
  86. package/styles/gantt/fluent.css +44 -100
  87. package/styles/gantt/fluent.scss +1 -1
  88. package/styles/gantt/highcontrast-light.css +40 -100
  89. package/styles/gantt/highcontrast-light.scss +1 -1
  90. package/styles/gantt/highcontrast.css +44 -100
  91. package/styles/gantt/highcontrast.scss +1 -1
  92. package/styles/gantt/icons/_bootstrap-dark.scss +4 -0
  93. package/styles/gantt/icons/_bootstrap.scss +4 -0
  94. package/styles/gantt/icons/_bootstrap4.scss +4 -0
  95. package/styles/gantt/icons/_bootstrap5.scss +4 -0
  96. package/styles/gantt/icons/_fabric-dark.scss +4 -0
  97. package/styles/gantt/icons/_fabric.scss +4 -0
  98. package/styles/gantt/icons/_fluent.scss +4 -0
  99. package/styles/gantt/icons/_fusionnew.scss +4 -0
  100. package/styles/gantt/icons/_highcontrast.scss +4 -0
  101. package/styles/gantt/icons/_material-dark.scss +4 -0
  102. package/styles/gantt/icons/_material.scss +4 -0
  103. package/styles/gantt/icons/_material3.scss +4 -0
  104. package/styles/gantt/icons/_tailwind-dark.scss +4 -0
  105. package/styles/gantt/icons/_tailwind.scss +4 -0
  106. package/styles/gantt/material-dark.css +44 -101
  107. package/styles/gantt/material-dark.scss +1 -1
  108. package/styles/gantt/material.css +44 -101
  109. package/styles/gantt/material.scss +1 -1
  110. package/styles/gantt/material3-dark.css +45 -102
  111. package/styles/gantt/material3-dark.scss +1 -1
  112. package/styles/gantt/material3.css +45 -102
  113. package/styles/gantt/material3.scss +1 -1
  114. package/styles/gantt/tailwind-dark.css +44 -101
  115. package/styles/gantt/tailwind-dark.scss +1 -1
  116. package/styles/gantt/tailwind.css +44 -101
  117. package/styles/gantt/tailwind.scss +1 -1
  118. package/styles/highcontrast-light.css +40 -100
  119. package/styles/highcontrast.css +44 -100
  120. package/styles/material-dark.css +44 -101
  121. package/styles/material.css +44 -101
  122. package/styles/material3-dark.css +45 -102
  123. package/styles/material3-dark.scss +1 -1
  124. package/styles/material3.css +45 -102
  125. package/styles/material3.scss +1 -1
  126. package/styles/tailwind-dark.css +44 -101
  127. package/styles/tailwind.css +44 -101
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 22.2.11
3
+ * version : 23.1.36
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@22.2.10",
3
+ "_id": "@syncfusion/ej2-gantt@22.1.67",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-OWQ3upCLGYSsF4wYB0QsSoQeluIk7sjLl13HEb3lTEd3Q5LfasrlDBkdDaoo3P6xzR3lOhZoroCDylkdVah5CA==",
5
+ "_integrity": "sha512-ETYYajrjdtEfBEH0tJhOz5lKp2YvFsltIa69yOe1znQIsIjAwOyLC2v12WFIB112iB9kAdA+7UQ6fqphH9C5qQ==",
6
6
  "_location": "/@syncfusion/ej2-gantt",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,10 +23,10 @@
23
23
  "/@syncfusion/ej2-react-gantt",
24
24
  "/@syncfusion/ej2-vue-gantt"
25
25
  ],
26
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-gantt/-/ej2-gantt-22.2.10.tgz",
27
- "_shasum": "8b0fe3189bee207e9cc43e3712fb1b503c0be83f",
26
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-gantt/-/ej2-gantt-22.1.67.tgz",
27
+ "_shasum": "2d8e8c4b09651dce94995b21015d014e2083ebd6",
28
28
  "_spec": "@syncfusion/ej2-gantt@*",
29
- "_where": "/jenkins/workspace/elease-automation_release_21.1.1/packages/included",
29
+ "_where": "/jenkins/workspace/elease-automation_release_23.1.1/packages/included",
30
30
  "author": {
31
31
  "name": "Syncfusion Inc."
32
32
  },
@@ -35,21 +35,21 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~22.2.10",
39
- "@syncfusion/ej2-buttons": "~22.2.9",
40
- "@syncfusion/ej2-calendars": "~22.2.11",
41
- "@syncfusion/ej2-data": "~22.2.5",
42
- "@syncfusion/ej2-dropdowns": "~22.2.11",
43
- "@syncfusion/ej2-grids": "~22.2.11",
44
- "@syncfusion/ej2-inputs": "~22.2.9",
45
- "@syncfusion/ej2-layouts": "~22.2.9",
46
- "@syncfusion/ej2-lists": "~22.2.11",
47
- "@syncfusion/ej2-navigations": "~22.2.11",
48
- "@syncfusion/ej2-notifications": "~22.2.5",
49
- "@syncfusion/ej2-popups": "~22.2.11",
50
- "@syncfusion/ej2-richtexteditor": "~22.2.10",
51
- "@syncfusion/ej2-svg-base": "~22.2.8",
52
- "@syncfusion/ej2-treegrid": "~22.2.9"
38
+ "@syncfusion/ej2-base": "~23.1.36",
39
+ "@syncfusion/ej2-buttons": "~23.1.36",
40
+ "@syncfusion/ej2-calendars": "~23.1.36",
41
+ "@syncfusion/ej2-data": "~23.1.36",
42
+ "@syncfusion/ej2-dropdowns": "~23.1.36",
43
+ "@syncfusion/ej2-grids": "~23.1.36",
44
+ "@syncfusion/ej2-inputs": "~23.1.36",
45
+ "@syncfusion/ej2-layouts": "~23.1.36",
46
+ "@syncfusion/ej2-lists": "~23.1.36",
47
+ "@syncfusion/ej2-navigations": "~23.1.36",
48
+ "@syncfusion/ej2-notifications": "~23.1.36",
49
+ "@syncfusion/ej2-popups": "~23.1.36",
50
+ "@syncfusion/ej2-richtexteditor": "~23.1.36",
51
+ "@syncfusion/ej2-svg-base": "~23.1.36",
52
+ "@syncfusion/ej2-treegrid": "~23.1.36"
53
53
  },
54
54
  "deprecated": false,
55
55
  "description": "Essential JS 2 Gantt Component",
@@ -74,6 +74,6 @@
74
74
  "url": "git+https://github.com/syncfusion/ej2-gantt.git"
75
75
  },
76
76
  "typings": "index.d.ts",
77
- "version": "22.2.11",
77
+ "version": "23.1.36",
78
78
  "sideEffects": false
79
79
  }
@@ -48,7 +48,7 @@ var CellEdit = /** @class */ (function () {
48
48
  args.cancel = true;
49
49
  return;
50
50
  }
51
- if (data.hasChildRecords && ((field === taskSettings.endDate && ((!isNullOrUndefined(data['isManual']) &&
51
+ if (data.hasChildRecords && !this.parent.allowParentDependency && ((field === taskSettings.endDate && ((!isNullOrUndefined(data['isManual']) &&
52
52
  data['isManual'] === false) || this.parent.taskMode === 'Auto')) || field === taskSettings.duration
53
53
  || field === taskSettings.dependency || field === taskSettings.progress || field === taskSettings.work || field === 'taskType')) {
54
54
  if ((field === taskSettings.dependency && !this.parent.allowParentDependency) || field !== taskSettings.dependency) {
@@ -347,6 +347,9 @@ var CellEdit = /** @class */ (function () {
347
347
  * @returns {void} .
348
348
  */
349
349
  CellEdit.prototype.durationEdited = function (args) {
350
+ if (parseInt(args.data[this.parent.taskFields.duration]) < 0) {
351
+ args.data[this.parent.taskFields.duration] = 0;
352
+ }
350
353
  var ganttProb = args.data.ganttProperties;
351
354
  var durationString = args.data[this.parent.taskFields.duration];
352
355
  this.parent.dataOperation.updateDurationValue(durationString, ganttProb);
@@ -165,7 +165,7 @@ var ContextMenu = /** @class */ (function () {
165
165
  taskfields = this.parent.taskFields;
166
166
  if (!isNullOrUndefined(taskfields.duration)) {
167
167
  var ganttProp = this.rowData.ganttProperties;
168
- data[taskfields.duration] = '1 ' + ganttProp.durationUnit;
168
+ data[taskfields.duration] = data[taskfields.duration] <= 0 ? 1 : data[taskfields.duration];
169
169
  }
170
170
  else {
171
171
  data[taskfields.startDate] = new Date(this.rowData.taskData[taskfields.startDate]);
@@ -178,6 +178,9 @@ var ContextMenu = /** @class */ (function () {
178
178
  data[taskfields.milestone] = false;
179
179
  }
180
180
  }
181
+ if (data[taskfields.startDate]) {
182
+ this.parent.setRecordValue(taskfields.startDate, this.rowData.ganttProperties.startDate, data, true);
183
+ }
181
184
  this.parent.updateRecordByID(data);
182
185
  }
183
186
  break;
@@ -3,6 +3,7 @@ import { IGanttData } from '../base/interface';
3
3
  /** @hidden */
4
4
  export declare class CriticalPath {
5
5
  private parent;
6
+ private validatedids;
6
7
  detailPredecessorCollection: object[];
7
8
  criticalPathCollection: number[];
8
9
  resourceCollectionIds: string[];
@@ -14,6 +15,7 @@ export declare class CriticalPath {
14
15
  showCriticalPath(isCritical: boolean): void;
15
16
  slackCalculation(fromDataObject: object[], collection: object[], collectionTaskId: any, checkEndDate: Date, flatRecords: IGanttData[], modelRecordIds: string[]): void;
16
17
  private getSlackDuration;
18
+ private updateCriticalTasks;
17
19
  private finalCriticalPath;
18
20
  criticalConnectorLine(criticalPathIds: number[], collection: object[], condition: boolean, collectionTaskId: number[]): void;
19
21
  getModuleName(): string;
@@ -4,6 +4,7 @@ import * as cls from '../base/css-constants';
4
4
  /** @hidden */
5
5
  var CriticalPath = /** @class */ (function () {
6
6
  function CriticalPath(parent) {
7
+ this.validatedids = [];
7
8
  this.resourceCollectionIds = [];
8
9
  this.criticalTasks = [];
9
10
  this.parent = parent;
@@ -30,6 +31,7 @@ var CriticalPath = /** @class */ (function () {
30
31
  var collectionTaskId = [];
31
32
  var fromDataObject = [];
32
33
  var criticalPathIds = [];
34
+ this.criticalTasks = [];
33
35
  /* eslint-disable-next-line */
34
36
  if (parentRecords[0].ganttProperties.autoEndDate > parentRecords[0].ganttProperties.endDate && !parentRecords[0].ganttProperties.isAutoSchedule) {
35
37
  checkEndDate = parentRecords[0].ganttProperties.autoEndDate;
@@ -226,6 +228,7 @@ var CriticalPath = /** @class */ (function () {
226
228
  this.slackCalculation(fromDataObject, collection, collectionTaskId, checkEndDate, totalRecords, modelIds);
227
229
  }
228
230
  criticalPathIds = this.finalCriticalPath(collection, taskBeyondEnddate, totalRecords, modelIds, checkEndDate);
231
+ this.validatedids = [];
229
232
  this.criticalPathCollection = criticalPathIds;
230
233
  this.detailPredecessorCollection = collection;
231
234
  this.predecessorCollectionTaskIds = collectionTaskId;
@@ -605,73 +608,69 @@ var CriticalPath = /** @class */ (function () {
605
608
  return this.parent.dataOperation.getDuration(startDate, endDate, durationUnit, record.ganttProperties.isAutoSchedule, true);
606
609
  }
607
610
  };
608
- /* eslint-disable-next-line */
609
- CriticalPath.prototype.finalCriticalPath = function (collection, taskBeyondEnddate, flatRecords, modelRecordIds, checkEndDate) {
610
- var criticalPathIds = [];
611
- var index;
612
- var predecessorFrom;
613
- var slackindexes = [];
614
- var indexes = [];
615
- for (var z = flatRecords.length - 1; z >= 0; z--) {
616
- if (flatRecords[parseInt(z.toString(), 10)].slack === '0 day') {
617
- var index1 = flatRecords[parseInt(z.toString(), 10)].index;
618
- slackindexes.push(index1);
611
+ CriticalPath.prototype.updateCriticalTasks = function (record, criticalPathIds) {
612
+ for (var i = 0; i < record.ganttProperties.predecessor.length; i++) {
613
+ var fromRecord = void 0;
614
+ if (this.parent.viewType === 'ProjectView') {
615
+ fromRecord = this.parent.getRecordByID(record.ganttProperties.predecessor[i].from);
619
616
  }
620
- }
621
- var num = 0;
622
- indexes.push(slackindexes[parseInt(num.toString(), 10)]);
623
- for (var j = 0; j < indexes.length; j++) {
624
- var i = flatRecords[indexes[parseInt(j.toString(), 10)]].ganttProperties.predecessor;
625
- if (!isNullOrUndefined(i)) {
626
- for (var f = i.length - 1; f >= 0; f--) {
627
- if (this.parent.viewType === 'ProjectView') {
628
- var q = modelRecordIds.indexOf(i[parseInt(f.toString(), 10)]['from']);
629
- for (var k = 0; k < indexes.length; k++) {
630
- var item = indexes[parseInt(j.toString(), 10)];
631
- if (item !== q) {
632
- indexes.push(q);
633
- }
634
- break;
635
- }
617
+ else {
618
+ var resourceIndex = this.resourceCollectionIds.indexOf(record.ganttProperties.predecessor[i].from.toString());
619
+ fromRecord = this.parent.flatData[resourceIndex];
620
+ }
621
+ var durationDiff = void 0;
622
+ if (record.ganttProperties.endDate.getTime() >= this.maxEndDate.getTime()) {
623
+ record.ganttProperties.slack = record.slack = 0 + ' ' + record.ganttProperties.durationUnit;
624
+ if (record.ganttProperties.progress < 100) {
625
+ record.isCritical = true;
626
+ record.ganttProperties.isCritical = true;
627
+ if (criticalPathIds.indexOf(parseInt(record.ganttProperties.taskId)) == -1) {
628
+ criticalPathIds.push(parseInt(record.ganttProperties.taskId));
636
629
  }
637
- else {
638
- var q = this.resourceCollectionIds.indexOf(i[parseInt(f.toString(), 10)]['from']);
639
- for (var k = 0; k < indexes.length; k++) {
640
- var item = indexes[parseInt(j.toString(), 10)];
641
- if (item !== q) {
642
- indexes.push(q);
643
- }
644
- break;
645
- }
630
+ }
631
+ }
632
+ if (fromRecord) {
633
+ if (record.ganttProperties.predecessor[i].type == 'FS') {
634
+ durationDiff = this.parent.dataOperation.getDuration(fromRecord.ganttProperties.endDate, record.ganttProperties.startDate, fromRecord.ganttProperties.durationUnit, fromRecord.ganttProperties.isAutoSchedule, true);
635
+ }
636
+ else if (record.ganttProperties.predecessor[i].type == 'SS') {
637
+ durationDiff = this.parent.dataOperation.getDuration(fromRecord.ganttProperties.startDate, record.ganttProperties.startDate, fromRecord.ganttProperties.durationUnit, fromRecord.ganttProperties.isAutoSchedule, true);
638
+ }
639
+ else if (record.ganttProperties.predecessor[i].type == 'FF') {
640
+ durationDiff = this.parent.dataOperation.getDuration(fromRecord.ganttProperties.endDate, record.ganttProperties.endDate, fromRecord.ganttProperties.durationUnit, fromRecord.ganttProperties.isAutoSchedule, true);
641
+ }
642
+ else if (record.ganttProperties.predecessor[i].type == 'SF') {
643
+ durationDiff = this.parent.dataOperation.getDuration(record.ganttProperties.endDate, fromRecord.ganttProperties.startDate, fromRecord.ganttProperties.durationUnit, fromRecord.ganttProperties.isAutoSchedule, true);
644
+ }
645
+ if (durationDiff == 0 && this.validatedids.indexOf(parseInt(fromRecord.ganttProperties.taskId)) == -1 && fromRecord.ganttProperties.taskId != record.ganttProperties.taskId) {
646
+ fromRecord.ganttProperties.slack = record.ganttProperties.slack;
647
+ fromRecord.slack = record.slack;
648
+ fromRecord.isCritical = record.ganttProperties.isCritical;
649
+ fromRecord.ganttProperties.isCritical = record.ganttProperties.isCritical;
650
+ if (criticalPathIds.indexOf(parseInt(fromRecord.ganttProperties.taskId)) == -1 && fromRecord.ganttProperties.isCritical && fromRecord.ganttProperties.progress < 100) {
651
+ this.validatedids.push(parseInt(fromRecord.ganttProperties.taskId));
652
+ criticalPathIds.push(parseInt(fromRecord.ganttProperties.taskId));
653
+ }
654
+ if (fromRecord.ganttProperties.predecessorsName) {
655
+ this.updateCriticalTasks(fromRecord, criticalPathIds);
646
656
  }
647
657
  }
648
658
  }
649
659
  }
650
- for (var x = 0; x < indexes.length; x++) {
660
+ };
661
+ /* eslint-disable-next-line */
662
+ CriticalPath.prototype.finalCriticalPath = function (collection, taskBeyondEnddate, flatRecords, modelRecordIds, checkEndDate) {
663
+ var criticalPathIds = [];
664
+ var index;
665
+ var predecessorFrom;
666
+ for (var x = collection.length - 1; x >= 0; x--) {
651
667
  if (this.parent.viewType === 'ProjectView') {
652
- index = modelRecordIds.indexOf(flatRecords[indexes[parseInt(x.toString(), 10)]]['ganttProperties']['taskId'].toString());
668
+ index = modelRecordIds.indexOf(collection[x]['taskid'].toString());
653
669
  }
654
670
  else {
655
- index = this.resourceCollectionIds.indexOf(flatRecords[indexes[parseInt(x.toString(), 10)]]['TaskID'].toString());
671
+ index = this.resourceCollectionIds.indexOf(collection[x]['taskid'].toString());
656
672
  }
657
673
  var predecessorLength = flatRecords[index].ganttProperties.predecessor;
658
- if (isNullOrUndefined(predecessorLength)) {
659
- if (taskBeyondEnddate.length > 0) {
660
- for (var i = 0; i < taskBeyondEnddate.length; i++) {
661
- if (this.parent.viewType === 'ProjectView') {
662
- index = modelRecordIds.indexOf(taskBeyondEnddate[i].toString());
663
- }
664
- else {
665
- index = this.resourceCollectionIds.indexOf(taskBeyondEnddate[i].toString());
666
- }
667
- if (index !== -1 && flatRecords[index].ganttProperties.progress < 100) {
668
- this.criticalTasks.push(flatRecords[index]);
669
- criticalPathIds = criticalPathIds.concat(taskBeyondEnddate[i]);
670
- }
671
- }
672
- }
673
- break;
674
- }
675
674
  var noSlackValue = 0 + ' ' + flatRecords[index].ganttProperties.durationUnit;
676
675
  for (var i = predecessorLength.length - 1; i >= 0; i--) {
677
676
  var toID = void 0;
@@ -684,6 +683,7 @@ var CriticalPath = /** @class */ (function () {
684
683
  var dateDifference = void 0;
685
684
  var currentData = flatRecords[index].ganttProperties;
686
685
  if (predecessorLength[i].type === 'FS') {
686
+ /* eslint-disable-next-line */
687
687
  if (predecessorLength[i].to != currentData.taskId.toString() || this.parent.viewType === 'ResourceView') {
688
688
  /* eslint-disable-next-line */
689
689
  dateDifference = this.parent.dataOperation.getDuration(currentData.endDate, flatRecords[toID].ganttProperties.startDate, currentData.durationUnit, currentData.isAutoSchedule, currentData.isMilestone);
@@ -735,8 +735,28 @@ var CriticalPath = /** @class */ (function () {
735
735
  flatRecords[index].isCritical = true;
736
736
  flatRecords[index].ganttProperties.isCritical = true;
737
737
  this.criticalTasks.push(flatRecords[index]);
738
- var num_1 = flatRecords[parseInt(index.toString(), 10)]['ganttProperties']['taskId'];
739
- criticalPathIds.push(num_1);
738
+ if (criticalPathIds.indexOf(collection[x]['taskid']) === -1) {
739
+ criticalPathIds.push(collection[x]['taskid']);
740
+ }
741
+ }
742
+ }
743
+ if (flatRecords[index].ganttProperties.predecessor.length > 0) {
744
+ this.updateCriticalTasks(flatRecords[index], criticalPathIds);
745
+ }
746
+ }
747
+ if (taskBeyondEnddate.length > 0) {
748
+ for (var i = 0; i < taskBeyondEnddate.length; i++) {
749
+ if (this.parent.viewType === 'ProjectView') {
750
+ index = modelRecordIds.indexOf(taskBeyondEnddate[i].toString());
751
+ }
752
+ else {
753
+ index = this.resourceCollectionIds.indexOf(taskBeyondEnddate[i].toString());
754
+ }
755
+ if (index !== -1 && flatRecords[index].ganttProperties.progress < 100) {
756
+ this.criticalTasks.push(flatRecords[index]);
757
+ if (criticalPathIds.indexOf(taskBeyondEnddate[i]) === -1) {
758
+ criticalPathIds = criticalPathIds.concat(taskBeyondEnddate[i]);
759
+ }
740
760
  }
741
761
  }
742
762
  }
@@ -781,7 +801,7 @@ var CriticalPath = /** @class */ (function () {
781
801
  }
782
802
  }
783
803
  /* eslint-disable-next-line */
784
- if (this_2.parent.allowUnscheduledTasks && !criticalData[columnFields.startDate] && !criticalData[columnFields.endDate] && criticalData[columnFields.duration]) {
804
+ if (this_2.parent.allowUnscheduledTasks && criticalData && !criticalData[columnFields.startDate] && !criticalData[columnFields.endDate] && criticalData[columnFields.duration]) {
785
805
  taskClass = cls.criticalUnscheduledTask;
786
806
  }
787
807
  else {
@@ -794,6 +814,8 @@ var CriticalPath = /** @class */ (function () {
794
814
  }
795
815
  if (element.getElementsByClassName('e-gantt-child-taskbar-inner-div').length > 0) {
796
816
  addClass(element.querySelectorAll('.e-gantt-child-taskbar-inner-div'), cls.criticalChildTaskBarInnerDiv);
817
+ var innerDivs = document.querySelector('.e-gantt-child-taskbar-inner-div');
818
+ innerDivs.style.outlineColor = "";
797
819
  }
798
820
  if (element.getElementsByClassName('e-gantt-child-progressbar-inner-div').length > 0) {
799
821
  addClass(element.querySelectorAll('.e-gantt-child-progressbar-inner-div'), taskClass);
@@ -9,6 +9,7 @@ export declare class Dependency {
9
9
  private parentRecord;
10
10
  private parentIds;
11
11
  private parentPredecessors;
12
+ private validatedParentIds;
12
13
  isValidatedParentTaskID: string;
13
14
  constructor(gantt: Gantt);
14
15
  /**
@@ -5,6 +5,7 @@ var Dependency = /** @class */ (function () {
5
5
  this.parentRecord = [];
6
6
  this.parentIds = [];
7
7
  this.parentPredecessors = [];
8
+ this.validatedParentIds = [];
8
9
  this.parent = gantt;
9
10
  this.dateValidateModule = this.parent.dateValidationModule;
10
11
  }
@@ -622,13 +623,31 @@ var Dependency = /** @class */ (function () {
622
623
  */
623
624
  Dependency.prototype.createConnectorLinesCollection = function (records) {
624
625
  var ganttRecords = records ? records : this.parent.currentViewData;
626
+ if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings &&
627
+ this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth && this.parent.pdfExportModule.isPdfExport) {
628
+ ganttRecords = this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneCurrentViewData'];
629
+ }
625
630
  var recordLength = ganttRecords.length;
626
631
  var count;
627
632
  var ganttRecord;
628
633
  var predecessorsCollection;
629
- this.parent.connectorLineModule.expandedRecords = this.parent.virtualScrollModule && this.parent.enableVirtualization ?
630
- this.parent.updatedRecords : this.parent.getExpandedRecords(this.parent.updatedRecords);
634
+ if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings &&
635
+ this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth && this.parent.pdfExportModule.isPdfExport) {
636
+ this.parent.connectorLineModule.expandedRecords = this.parent.virtualScrollModule && this.parent.enableVirtualization ?
637
+ this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData'] : this.parent.getExpandedRecords(this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData']);
638
+ }
639
+ else {
640
+ this.parent.connectorLineModule.expandedRecords = this.parent.virtualScrollModule && this.parent.enableVirtualization ?
641
+ this.parent.updatedRecords : this.parent.getExpandedRecords(this.parent.updatedRecords);
642
+ }
631
643
  for (count = 0; count < recordLength; count++) {
644
+ if (this.parent.editModule && this.parent.editModule.deletedTaskDetails.length > 0) {
645
+ if (ganttRecords[count].parentItem) {
646
+ var parentItem = this.parent.getRecordByID(ganttRecords[count].parentItem.taskId.toString());
647
+ this.parent.setRecordValue('parentItem', this.parent.dataOperation.getCloneParent(parentItem), ganttRecords[count]);
648
+ }
649
+ ganttRecords[count].index = count;
650
+ }
632
651
  ganttRecord = ganttRecords[count];
633
652
  predecessorsCollection = ganttRecord.ganttProperties.predecessor;
634
653
  if (predecessorsCollection) {
@@ -776,36 +795,35 @@ var Dependency = /** @class */ (function () {
776
795
  this.validatePredecessor(record, undefined, 'successor');
777
796
  }
778
797
  }
779
- if (record && record.ganttProperties.taskId !== this.isValidatedParentTaskID && ganttProp) {
780
- var validUpdate = false;
781
- var predecessorNames = ganttProp.ganttProperties.predecessorsName ?
782
- ganttProp.ganttProperties.predecessorsName.split(',').length : ganttProp.ganttProperties.predecessorsName;
783
- var predecessorLength = ganttProp.ganttProperties.predecessor ?
784
- ganttProp.ganttProperties.predecessor.length : ganttProp.ganttProperties.predecessor;
785
- if ((predecessorLength && predecessorNames !== predecessorLength)) {
786
- validUpdate = true;
787
- }
788
- else if (record.hasChildRecords && record.ganttProperties.predecessor.length > 0 && ganttProp.hasChildRecords && !ganttProp.ganttProperties.predecessor) {
789
- validUpdate = true;
790
- }
791
- if ((taskBarModule.taskBarEditAction !== 'ParentDrag' && taskBarModule.taskBarEditAction !== 'ChildDrag')) {
792
- if (!ganttProp.hasChildRecords && record.hasChildRecords) {
798
+ if (record && !record.hasChildRecords && record.parentItem && this.validatedParentIds.indexOf(record.parentItem.taskId) == -1) {
799
+ this.validatedParentIds.push(record.parentItem.taskId);
800
+ }
801
+ ;
802
+ var validUpdate = true;
803
+ if (record && record.hasChildRecords && this.validatedParentIds.indexOf(record.ganttProperties.taskId.toString()) !== -1) {
804
+ validUpdate = false;
805
+ }
806
+ if (validUpdate) {
807
+ if (record && record.ganttProperties.taskId !== this.isValidatedParentTaskID && ganttProp) {
808
+ if ((taskBarModule.taskBarEditAction !== 'ParentDrag' && taskBarModule.taskBarEditAction !== 'ChildDrag')) {
809
+ if (!ganttProp.hasChildRecords && record.hasChildRecords) {
810
+ this.parent.editModule['updateChildItems'](record);
811
+ this.isValidatedParentTaskID = record.ganttProperties.taskId;
812
+ }
813
+ }
814
+ else if ((!record.hasChildRecords && taskBarModule.taskBarEditAction == 'ChildDrag') ||
815
+ (record.hasChildRecords && taskBarModule.taskBarEditAction == 'ParentDrag')) {
793
816
  this.parent.editModule['updateChildItems'](record);
794
817
  this.isValidatedParentTaskID = record.ganttProperties.taskId;
795
818
  }
819
+ if (!ganttProp.hasChildRecords) {
820
+ this.parent.dataOperation.updateParentItems(record, true);
821
+ }
796
822
  }
797
- else if ((record.hasChildRecords && taskBarModule.taskBarEditAction == 'ChildDrag') ||
798
- (validUpdate && taskBarModule.taskBarEditAction == 'ParentDrag')) {
823
+ else if (record && record.hasChildRecords && !ganttProp) {
799
824
  this.parent.editModule['updateChildItems'](record);
800
- this.isValidatedParentTaskID = record.ganttProperties.taskId;
801
- }
802
- if (!ganttProp.hasChildRecords) {
803
- this.parent.dataOperation.updateParentItems(record, true);
804
825
  }
805
826
  }
806
- else if (record && record.hasChildRecords && !ganttProp) {
807
- this.parent.editModule['updateChildItems'](record);
808
- }
809
827
  }
810
828
  };
811
829
  /**
@@ -924,7 +924,7 @@ var DialogEdit = /** @class */ (function () {
924
924
  if (!isNullOrUndefined(tasks.endDate) && tasks.endDate !== colName) {
925
925
  this.updateScheduleFields(dialog, ganttProp, 'endDate');
926
926
  }
927
- if (!isNullOrUndefined(tasks.duration) && tasks.duration !== colName) {
927
+ if (!isNullOrUndefined(tasks.duration) && tasks.duration !== colName || ganttProp.duration >= 0) {
928
928
  this.updateScheduleFields(dialog, ganttProp, 'duration');
929
929
  }
930
930
  if (!isNullOrUndefined(tasks.work) && tasks.work !== colName) {
@@ -1082,17 +1082,33 @@ var DialogEdit = /** @class */ (function () {
1082
1082
  var ganttProp = currentData.ganttProperties;
1083
1083
  var taskSettings = ganttObj.taskFields;
1084
1084
  if (taskSettings.duration === columnName) {
1085
- if (!isNullOrUndefined(value) && value !== '') {
1085
+ if (!isNullOrUndefined(value) && value !== '' && parseInt(value) >= 0) {
1086
1086
  ganttObj.dataOperation.updateDurationValue(value, ganttProp);
1087
1087
  this.parent.setRecordValue(taskSettings.duration, value, currentData);
1088
1088
  this.parent.setRecordValue('taskData.' + taskSettings.duration, ganttProp.duration, currentData);
1089
+ this.validateDuration(currentData);
1089
1090
  }
1090
1091
  else {
1091
1092
  if (ganttObj.allowUnscheduledTasks) {
1092
- this.parent.setRecordValue('duration', null, ganttProp, true);
1093
+ if ((ganttProp.startDate && ganttProp.endDate && ganttProp.startDate.getTime() > ganttProp.endDate.getTime()) || value.indexOf('-') !== -1) {
1094
+ this.parent.setRecordValue('duration', 0, ganttProp, true);
1095
+ if (ganttProp.endDate) {
1096
+ this.parent.setRecordValue('startDate', ganttProp.endDate, ganttProp, true);
1097
+ }
1098
+ }
1099
+ else {
1100
+ if (value === "") {
1101
+ this.parent.setRecordValue('duration', null, ganttProp, true);
1102
+ if (ganttProp.endDate) {
1103
+ this.parent.setRecordValue('endDate', null, ganttProp, true);
1104
+ }
1105
+ }
1106
+ else {
1107
+ this.parent.setRecordValue('duration', ganttProp.duration, ganttProp, true);
1108
+ }
1109
+ }
1093
1110
  }
1094
1111
  }
1095
- this.validateDuration(currentData);
1096
1112
  this.parent.editModule.updateResourceRelatedFields(currentData, 'duration');
1097
1113
  }
1098
1114
  if (taskSettings.startDate === columnName) {
@@ -1100,13 +1116,15 @@ var DialogEdit = /** @class */ (function () {
1100
1116
  var startDate = this.parent.dateValidationModule.getDateFromFormat(value);
1101
1117
  startDate = this.parent.dateValidationModule.checkStartDate(startDate, ganttProp);
1102
1118
  this.parent.setRecordValue('startDate', startDate, ganttProp, true);
1119
+ this.validateStartDate(currentData);
1103
1120
  }
1104
1121
  else {
1105
1122
  if (ganttObj.allowUnscheduledTasks && !(currentData.hasChildRecords)) {
1106
1123
  this.parent.setRecordValue('startDate', null, ganttProp, true);
1124
+ this.parent.setRecordValue('duration', null, ganttProp, true);
1125
+ this.parent.setRecordValue('isMilestone', false, ganttProp, true);
1107
1126
  }
1108
1127
  }
1109
- this.validateStartDate(currentData);
1110
1128
  }
1111
1129
  if (taskSettings.endDate === columnName) {
1112
1130
  if (value !== '') {
@@ -1121,13 +1139,15 @@ var DialogEdit = /** @class */ (function () {
1121
1139
  if (isNullOrUndefined(ganttProp.startDate) || endDate.getTime() > (ganttProp.startDate).getTime()) {
1122
1140
  this.parent.setRecordValue('endDate', endDate, ganttProp, true);
1123
1141
  }
1142
+ this.validateEndDate(currentData);
1124
1143
  }
1125
1144
  else {
1126
1145
  if (ganttObj.allowUnscheduledTasks) {
1127
1146
  this.parent.setRecordValue('endDate', null, ganttProp, true);
1147
+ this.parent.setRecordValue('duration', null, ganttProp, true);
1148
+ this.parent.setRecordValue('isMilestone', false, ganttProp, true);
1128
1149
  }
1129
1150
  }
1130
- this.validateEndDate(currentData);
1131
1151
  }
1132
1152
  if (taskSettings.work === columnName) {
1133
1153
  if (!isNullOrUndefined(value) && value !== '') {
@@ -1534,7 +1554,7 @@ var DialogEdit = /** @class */ (function () {
1534
1554
  var eDate = getValue('endDate', selectedItem);
1535
1555
  var duration = getValue('duration', selectedItem);
1536
1556
  var startDate_1 = !isNullOrUndefined(gridData) && gridData.length > 0 ?
1537
- !isNullOrUndefined(taskFields.endDate) ? new Date(getValue('endDate', gridData[0]).getTime()) :
1557
+ (!isNullOrUndefined(taskFields.endDate) && !isNullOrUndefined(gridData[0].endDate)) ? new Date(getValue('endDate', gridData[0]).getTime()) :
1538
1558
  new Date(getValue('startDate', gridData[0]).getTime()) :
1539
1559
  !isNullOrUndefined(this.beforeOpenArgs.rowData.ganttProperties.startDate) &&
1540
1560
  new Date(this.beforeOpenArgs.rowData.ganttProperties.startDate.getTime());
@@ -1,6 +1,6 @@
1
1
  import { Gantt } from '../base/gantt';
2
2
  import { IGanttData, ITaskbarEditedEventArgs, IParent } from '../base/interface';
3
- import { RowDropEventArgs } from '../base/interface';
3
+ import { ITaskAddedEventArgs, RowDropEventArgs } from '../base/interface';
4
4
  import { RowPosition } from '../base/enum';
5
5
  import { CellEdit } from './cell-edit';
6
6
  import { TaskbarEdit } from './taskbar-edit';
@@ -450,6 +450,17 @@ export declare class Edit {
450
450
  * @private
451
451
  */
452
452
  private addDataInRealDataSource;
453
+ /**
454
+ * Method to update the values to client side from server side.
455
+ *
456
+ * @param {Object} e - Defines the new modified data from the server.
457
+ * @param {ITaskAddedEventArgs} args - Defines the client side data.
458
+ * @returns {void} .
459
+ */
460
+ updateClientDataFromServer(e: {
461
+ addedRecords: Object[];
462
+ changedRecords: Object[];
463
+ }, args: ITaskAddedEventArgs): void;
453
464
  /**
454
465
  * Method to add new record.
455
466
  *