@syncfusion/ej2-gantt 20.4.54 → 21.1.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +1 -1
  3. package/dist/ej2-gantt.min.js +2 -2
  4. package/dist/ej2-gantt.umd.min.js +2 -2
  5. package/dist/ej2-gantt.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-gantt.es2015.js +1094 -421
  7. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  8. package/dist/es6/ej2-gantt.es5.js +1072 -399
  9. package/dist/es6/ej2-gantt.es5.js.map +1 -1
  10. package/dist/global/ej2-gantt.min.js +2 -2
  11. package/dist/global/ej2-gantt.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/package.json +20 -20
  14. package/src/gantt/actions/cell-edit.js +8 -6
  15. package/src/gantt/actions/chart-scroll.d.ts +1 -0
  16. package/src/gantt/actions/chart-scroll.js +15 -4
  17. package/src/gantt/actions/connector-line-edit.js +39 -28
  18. package/src/gantt/actions/context-menu.js +5 -5
  19. package/src/gantt/actions/dependency.js +28 -12
  20. package/src/gantt/actions/dialog-edit.js +41 -21
  21. package/src/gantt/actions/edit.js +51 -30
  22. package/src/gantt/actions/filter.d.ts +2 -1
  23. package/src/gantt/actions/filter.js +88 -2
  24. package/src/gantt/actions/keyboard.js +0 -1
  25. package/src/gantt/actions/pdf-export.d.ts +3 -1
  26. package/src/gantt/actions/pdf-export.js +12 -6
  27. package/src/gantt/actions/rowdragdrop.js +2 -2
  28. package/src/gantt/actions/selection.js +5 -2
  29. package/src/gantt/actions/taskbar-edit.d.ts +5 -0
  30. package/src/gantt/actions/taskbar-edit.js +114 -10
  31. package/src/gantt/base/date-processor.js +78 -52
  32. package/src/gantt/base/gantt-chart.js +20 -4
  33. package/src/gantt/base/gantt-model.d.ts +43 -0
  34. package/src/gantt/base/gantt.d.ts +39 -1
  35. package/src/gantt/base/gantt.js +84 -34
  36. package/src/gantt/base/interface.d.ts +2 -0
  37. package/src/gantt/base/task-processor.js +135 -98
  38. package/src/gantt/base/tree-grid.js +31 -1
  39. package/src/gantt/base/utils.js +1 -1
  40. package/src/gantt/export/pdf-gantt.js +1 -1
  41. package/src/gantt/export/pdf-taskbar.js +1 -0
  42. package/src/gantt/renderer/chart-rows.d.ts +2 -0
  43. package/src/gantt/renderer/chart-rows.js +156 -24
  44. package/src/gantt/renderer/connector-line.js +50 -20
  45. package/src/gantt/renderer/edit-tooltip.js +0 -3
  46. package/src/gantt/renderer/event-marker.js +4 -1
  47. package/src/gantt/renderer/nonworking-day.js +4 -1
  48. package/src/gantt/renderer/timeline.js +3 -3
  49. package/src/gantt/renderer/tooltip.js +101 -33
  50. package/styles/bootstrap-dark.css +33 -10
  51. package/styles/bootstrap.css +31 -10
  52. package/styles/bootstrap4.css +28 -7
  53. package/styles/bootstrap5-dark.css +30 -9
  54. package/styles/bootstrap5.css +30 -9
  55. package/styles/fabric-dark.css +28 -7
  56. package/styles/fabric.css +28 -7
  57. package/styles/fluent-dark.css +56 -29
  58. package/styles/fluent.css +56 -29
  59. package/styles/gantt/_bootstrap-dark-definition.scss +5 -4
  60. package/styles/gantt/_bootstrap-definition.scss +5 -4
  61. package/styles/gantt/_bootstrap4-definition.scss +3 -2
  62. package/styles/gantt/_bootstrap5-definition.scss +15 -14
  63. package/styles/gantt/_fabric-dark-definition.scss +3 -2
  64. package/styles/gantt/_fabric-definition.scss +3 -2
  65. package/styles/gantt/_fluent-definition.scss +18 -17
  66. package/styles/gantt/_fusionnew-definition.scss +5 -4
  67. package/styles/gantt/_highcontrast-definition.scss +3 -2
  68. package/styles/gantt/_highcontrast-light-definition.scss +3 -2
  69. package/styles/gantt/_layout.scss +45 -13
  70. package/styles/gantt/_material-dark-definition.scss +3 -2
  71. package/styles/gantt/_material-definition.scss +3 -2
  72. package/styles/gantt/_tailwind-definition.scss +9 -8
  73. package/styles/gantt/_theme.scss +25 -6
  74. package/styles/gantt/bootstrap-dark.css +33 -10
  75. package/styles/gantt/bootstrap.css +31 -10
  76. package/styles/gantt/bootstrap4.css +28 -7
  77. package/styles/gantt/bootstrap5-dark.css +30 -9
  78. package/styles/gantt/bootstrap5.css +30 -9
  79. package/styles/gantt/fabric-dark.css +28 -7
  80. package/styles/gantt/fabric.css +28 -7
  81. package/styles/gantt/fluent-dark.css +56 -29
  82. package/styles/gantt/fluent.css +56 -29
  83. package/styles/gantt/highcontrast-light.css +28 -9
  84. package/styles/gantt/highcontrast.css +28 -7
  85. package/styles/gantt/material-dark.css +31 -14
  86. package/styles/gantt/material.css +28 -7
  87. package/styles/gantt/tailwind-dark.css +28 -7
  88. package/styles/gantt/tailwind.css +28 -7
  89. package/styles/highcontrast-light.css +28 -9
  90. package/styles/highcontrast.css +28 -7
  91. package/styles/material-dark.css +31 -14
  92. package/styles/material.css +28 -7
  93. package/styles/tailwind-dark.css +28 -7
  94. package/styles/tailwind.css +28 -7
  95. package/styles/gantt/_material3-definition.scss +0 -218
@@ -333,6 +333,12 @@ var Gantt = /** @class */ (function (_super) {
333
333
  this.treeGrid.isReact = true;
334
334
  this.treeGrid.grid.isReact = true;
335
335
  }
336
+ if (this.isVue) {
337
+ this.treeGrid.isVue = true;
338
+ this.treeGrid.grid.isVue = true;
339
+ this.treeGrid.vueInstance = this.vueInstance;
340
+ this.treeGrid.grid.vueInstance = this.vueInstance;
341
+ }
336
342
  createSpinner({ target: this.element }, this.createElement);
337
343
  this.trigger('load', {});
338
344
  this.element.classList.add(cls.root);
@@ -358,13 +364,13 @@ var Gantt = /** @class */ (function (_super) {
358
364
  };
359
365
  Gantt.prototype.hideMaskRow = function () {
360
366
  var isTablePresent = this.element.querySelectorAll('.e-masked-table').length;
361
- if (!isNullOrUndefined(this.contentMaskTable) && isTablePresent != 0) {
367
+ if (!isNullOrUndefined(this.contentMaskTable) && (isTablePresent != 0 || this.contentMaskTable)) {
362
368
  var maskTable = this.contentMaskTable;
363
369
  remove(maskTable);
364
370
  this.contentMaskTable = null;
365
371
  }
366
372
  isTablePresent = this.element.querySelectorAll('.e-masked-table').length;
367
- if (!isNullOrUndefined(this.headerMaskTable) && isTablePresent != 0) {
373
+ if (!isNullOrUndefined(this.headerMaskTable) && (isTablePresent != 0 || this.headerMaskTable)) {
368
374
  var maskTable = this.headerMaskTable;
369
375
  remove(maskTable);
370
376
  this.headerMaskTable = null;
@@ -377,8 +383,8 @@ var Gantt = /** @class */ (function (_super) {
377
383
  }
378
384
  if (this.element.querySelectorAll('.' + cls.timelineHeaderTableContainer).length != 0) {
379
385
  for (var i = 0; i < this.singleTier; i++) {
380
- if (!isNullOrUndefined(this.element.querySelectorAll('.' + cls.timelineHeaderTableContainer)[i])) {
381
- this.element.querySelectorAll('.' + cls.timelineHeaderTableContainer)[i]['style'].visibility = "visible";
386
+ if (!isNullOrUndefined(this.element.querySelectorAll('.' + cls.timelineHeaderTableContainer)[parseInt(i.toString(), 10)])) {
387
+ this.element.querySelectorAll('.' + cls.timelineHeaderTableContainer)[parseInt(i.toString(), 10)]['style'].visibility = "visible";
382
388
  }
383
389
  }
384
390
  }
@@ -400,7 +406,7 @@ var Gantt = /** @class */ (function (_super) {
400
406
  if (this.element.querySelectorAll('.' + cls.timelineHeaderTableContainer).length != 0) {
401
407
  this.singleTier = this.timelineModule.isSingleTier ? 1 : 2;
402
408
  for (var i = 0; i < this.singleTier; i++) {
403
- this.element.querySelectorAll('.' + cls.timelineHeaderTableContainer)[i]['style'].visibility = "hidden";
409
+ this.element.querySelectorAll('.' + cls.timelineHeaderTableContainer)[parseInt(i.toString(), 10)]['style'].visibility = "hidden";
404
410
  }
405
411
  }
406
412
  if (this.singleTier === 0) {
@@ -519,7 +525,7 @@ var Gantt = /** @class */ (function (_super) {
519
525
  }
520
526
  this.topBottomHeader = 0;
521
527
  for (var i = 0; i < row.length; i++) {
522
- tbody.appendChild(this.applyTimelineMaskRow(row[i]));
528
+ tbody.appendChild(this.applyTimelineMaskRow(row[parseInt(i.toString(), 10)]));
523
529
  this.topBottomHeader = this.topBottomHeader + 1;
524
530
  }
525
531
  table.appendChild(tbody);
@@ -533,11 +539,11 @@ var Gantt = /** @class */ (function (_super) {
533
539
  maskRow.appendChild(this.createElement('td', { className: 'e-timeline-masked-top-header-cell' }));
534
540
  maskRow.appendChild(this.createElement('td', { className: 'e-timeline-masked-top-header-cell' }));
535
541
  for (var i = 0; i < maskRow.childNodes.length - 1; i++) {
536
- maskRow.childNodes[i]['style']['width'] = 166 + 'px';
542
+ maskRow.childNodes[parseInt(i.toString(), 10)]['style']['width'] = 166 + 'px';
537
543
  }
538
544
  var maskCells = [].slice.call(maskRow.childNodes);
539
545
  for (var i = 0; i < maskCells.length; i++) {
540
- var maskCell = maskCells[i];
546
+ var maskCell = maskCells[parseInt(i.toString(), 10)];
541
547
  switch (this.topBottomHeader) {
542
548
  case 0:
543
549
  if (this.enableRtl) {
@@ -554,7 +560,7 @@ var Gantt = /** @class */ (function (_super) {
554
560
  maskCell.appendChild(this.createElement('td', { className: 'e-timeline-masked-top-header-cell' }));
555
561
  var innerMaskCells = [].slice.call(maskCell.childNodes);
556
562
  for (var i_1 = 0; i_1 < innerMaskCells.length; i_1++) {
557
- var htmlInner = innerMaskCells[i_1];
563
+ var htmlInner = innerMaskCells[parseInt(i_1.toString(), 10)];
558
564
  if (i_1 === 0) {
559
565
  if (this.enableRtl) {
560
566
  htmlInner.innerHTML = '<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave e-innerHTML"></span>';
@@ -606,7 +612,7 @@ var Gantt = /** @class */ (function (_super) {
606
612
  else if (this.columnLoop === 4) {
607
613
  this.columnLoop = 1;
608
614
  }
609
- tbody.appendChild(this.applyMaskRow(row[j]));
615
+ tbody.appendChild(this.applyMaskRow(row[parseInt(j.toString(), 10)]));
610
616
  }
611
617
  table.appendChild(tbody);
612
618
  table.style.width = 100 + '%';
@@ -627,7 +633,7 @@ var Gantt = /** @class */ (function (_super) {
627
633
  }
628
634
  var maskCells = [].slice.call(maskRow.childNodes);
629
635
  for (var i = 0; i < maskCells.length; i++) {
630
- var maskCell = maskCells[i];
636
+ var maskCell = maskCells[parseInt(i.toString(), 10)];
631
637
  switch (this.columnLoop) {
632
638
  case 1:
633
639
  if (i === 0) {
@@ -725,7 +731,7 @@ var Gantt = /** @class */ (function (_super) {
725
731
  this.predecessorModule['parentIds'] = [];
726
732
  this.predecessorModule['parentRecord'] = [];
727
733
  this.predecessorModule.updatePredecessors();
728
- if (this.isInPredecessorValidation && this.enableValidation) {
734
+ if (this.isInPredecessorValidation && this.enableValidation && this.autoCalculateDateScheduling) {
729
735
  this.predecessorModule.updatedRecordsDateByPredecessor();
730
736
  }
731
737
  }
@@ -738,7 +744,9 @@ var Gantt = /** @class */ (function (_super) {
738
744
  if (this.enableValidation) {
739
745
  this.dataOperation.updateGanttData();
740
746
  }
741
- this.predecessorModule.updateParentPredecessor();
747
+ if (this.allowParentDependency) {
748
+ this.predecessorModule.updateParentPredecessor();
749
+ }
742
750
  if (this.dataSource instanceof Object && isCountRequired(this)) {
743
751
  var count = getValue('count', this.dataSource);
744
752
  this.treeGrid.dataSource = { result: this.flatData, count: count };
@@ -751,7 +759,9 @@ var Gantt = /** @class */ (function (_super) {
751
759
  if (this.enableValidation) {
752
760
  this.dataOperation.updateGanttData();
753
761
  }
754
- this.predecessorModule.updateParentPredecessor();
762
+ if (this.allowParentDependency) {
763
+ this.predecessorModule.updateParentPredecessor();
764
+ }
755
765
  this.treeGridPane.classList.remove('e-temp-content');
756
766
  remove(this.treeGridPane.querySelector('.e-gantt-temp-header'));
757
767
  this.notify('dataReady', {});
@@ -868,22 +878,27 @@ var Gantt = /** @class */ (function (_super) {
868
878
  * @private
869
879
  */
870
880
  Gantt.prototype.updateContentHeight = function (args) {
871
- if (this.virtualScrollModule && this.enableVirtualization && !isNullOrUndefined(args)) {
872
- var length_1 = getValue('result.length', args);
873
- this.contentHeight = length_1 * this.rowHeight;
881
+ if (!this.allowTaskbarOverlap && this.viewType === 'ResourceView' && !this.isLoad) {
882
+ return;
874
883
  }
875
884
  else {
876
- var expandedRecords = this.virtualScrollModule && this.enableVirtualization ?
877
- this.currentViewData : this.getExpandedRecords(this.currentViewData);
878
- var height = void 0;
879
- var chartRow = !isNullOrUndefined(this.ganttChartModule.getChartRows()) ? this.ganttChartModule.getChartRows()[0] : null;
880
- if (!isNullOrUndefined(chartRow) && chartRow.getBoundingClientRect().height > 0) {
881
- height = chartRow.getBoundingClientRect().height;
885
+ if (this.virtualScrollModule && this.enableVirtualization && !isNullOrUndefined(args)) {
886
+ var length_1 = getValue('result.length', args);
887
+ this.contentHeight = length_1 * this.rowHeight;
882
888
  }
883
889
  else {
884
- height = this.rowHeight;
890
+ var expandedRecords = this.virtualScrollModule && this.enableVirtualization ?
891
+ this.currentViewData : this.getExpandedRecords(this.currentViewData);
892
+ var height = void 0;
893
+ var chartRow = !isNullOrUndefined(this.ganttChartModule.getChartRows()) ? this.ganttChartModule.getChartRows()[0] : null;
894
+ if (!isNullOrUndefined(chartRow) && chartRow.getBoundingClientRect().height > 0) {
895
+ height = chartRow.getBoundingClientRect().height;
896
+ }
897
+ else {
898
+ height = this.rowHeight;
899
+ }
900
+ this.contentHeight = expandedRecords.length * height;
885
901
  }
886
- this.contentHeight = expandedRecords.length * height;
887
902
  }
888
903
  };
889
904
  /**
@@ -1399,7 +1414,6 @@ var Gantt = /** @class */ (function (_super) {
1399
1414
  this.chartRowsModule.refreshGanttRows();
1400
1415
  break;
1401
1416
  case 'includeWeekend':
1402
- case 'dayWorkingTime':
1403
1417
  case 'allowUnscheduledTasks':
1404
1418
  case 'holidays':
1405
1419
  this.isLoad = true;
@@ -1492,6 +1506,10 @@ var Gantt = /** @class */ (function (_super) {
1492
1506
  case 'readOnly':
1493
1507
  case 'viewType':
1494
1508
  case 'taskFields':
1509
+ case 'dayWorkingTime':
1510
+ case 'allowTaskbarDragAndDrop':
1511
+ case 'allowTaskbarOverlap':
1512
+ case 'allowParentDependency':
1495
1513
  if (prop === 'locale') {
1496
1514
  this.isLocaleChanged = true;
1497
1515
  }
@@ -1506,6 +1524,9 @@ var Gantt = /** @class */ (function (_super) {
1506
1524
  }
1507
1525
  }
1508
1526
  if (isRefresh) {
1527
+ if (this.isLoad && this.contentMaskTable) {
1528
+ this.contentMaskTable = null;
1529
+ }
1509
1530
  this.refresh();
1510
1531
  }
1511
1532
  };
@@ -1633,7 +1654,7 @@ var Gantt = /** @class */ (function (_super) {
1633
1654
  args: [this]
1634
1655
  });
1635
1656
  }
1636
- if (this.allowRowDragAndDrop) {
1657
+ if (this.allowRowDragAndDrop || this.allowTaskbarDragAndDrop) {
1637
1658
  modules.push({
1638
1659
  member: 'rowDragAndDrop',
1639
1660
  args: [this]
@@ -2168,10 +2189,11 @@ var Gantt = /** @class */ (function (_super) {
2168
2189
  * @param {PdfExportProperties} pdfExportProperties - Defines the export properties of the Gantt.
2169
2190
  * @param {isMultipleExport} isMultipleExport - Define to enable multiple export.
2170
2191
  * @param {pdfDoc} pdfDoc - Defined the Pdf Document if multiple export is enabled.
2192
+ * @param {boolean} isBlob - If the 'isBlob' parameter is set to true, the method returns PDF data as a blob instead of exporting it as a down-loadable PDF file. The default value is false.
2171
2193
  * @returns {Promise<any>} .
2172
2194
  */
2173
- Gantt.prototype.pdfExport = function (pdfExportProperties, isMultipleExport, pdfDoc) {
2174
- return this.pdfExportModule ? this.pdfExportModule.export(pdfExportProperties, isMultipleExport, pdfDoc)
2195
+ Gantt.prototype.pdfExport = function (pdfExportProperties, isMultipleExport, pdfDoc, isBlob) {
2196
+ return this.pdfExportModule ? this.pdfExportModule.export(pdfExportProperties, isMultipleExport, pdfDoc, isBlob)
2175
2197
  : null;
2176
2198
  };
2177
2199
  /**
@@ -2203,7 +2225,7 @@ var Gantt = /** @class */ (function (_super) {
2203
2225
  * @private
2204
2226
  */
2205
2227
  Gantt.prototype.renderWorkingDayCell = function (args) {
2206
- var includeWeekend = this.taskMode !== 'Auto' ? true : this.includeWeekend ? true : false;
2228
+ var includeWeekend = this.taskMode !== 'Auto' ? true : (this.includeWeekend || !this.autoCalculateDateScheduling) ? true : false;
2207
2229
  var nonWorkingDays = !includeWeekend ? this.nonWorkingDayIndex : [];
2208
2230
  var holidays = this.totalHolidayDates;
2209
2231
  if (nonWorkingDays.length > 0 && nonWorkingDays.indexOf(args.date.getDay()) !== -1) {
@@ -2213,7 +2235,12 @@ var Gantt = /** @class */ (function (_super) {
2213
2235
  var tempDate = new Date(args.date.getTime());
2214
2236
  tempDate.setHours(0, 0, 0);
2215
2237
  if (holidays.indexOf(tempDate.getTime()) !== -1) {
2216
- args.isDisabled = true;
2238
+ if (!this.autoCalculateDateScheduling) {
2239
+ args.isDisabled = false;
2240
+ }
2241
+ else {
2242
+ args.isDisabled = true;
2243
+ }
2217
2244
  }
2218
2245
  }
2219
2246
  };
@@ -2330,12 +2357,17 @@ var Gantt = /** @class */ (function (_super) {
2330
2357
  var id = ganttData.rowUniqueID;
2331
2358
  var task = this.getRecordByID(id);
2332
2359
  var isValid = false;
2333
- if (isNullOrUndefined(value) || (!isNullOrUndefined(value) && !isNullOrUndefined(ganttData[field]) && (value instanceof Date ? value.getTime() !==
2334
- ganttData[field].getTime() : ganttData[field] !== value))) {
2360
+ if (isNullOrUndefined(value) || (!isNullOrUndefined(value) && !isNullOrUndefined(record["" + field]) && (value instanceof Date ? value.getTime() !==
2361
+ record["" + field].getTime() : record["" + field] !== value))) {
2335
2362
  isValid = true;
2336
2363
  }
2337
2364
  if (task && ((this.editedRecords.indexOf(task) === -1 && isValid) || this.editedRecords.length === 0)) {
2338
- this.editedRecords.push(task);
2365
+ if (this.editModule['draggedRecord'] && this.editModule['draggedRecord'].ganttProperties.taskId === ganttData.taskId) {
2366
+ this.editedRecords.splice(0, 0, task);
2367
+ }
2368
+ else {
2369
+ this.editedRecords.push(task);
2370
+ }
2339
2371
  if (this.enableImmutableMode) {
2340
2372
  this.modifiedRecords.push(task);
2341
2373
  }
@@ -3278,6 +3310,12 @@ var Gantt = /** @class */ (function (_super) {
3278
3310
  __decorate([
3279
3311
  Property(false)
3280
3312
  ], Gantt.prototype, "enableImmutableMode", void 0);
3313
+ __decorate([
3314
+ Property(true)
3315
+ ], Gantt.prototype, "allowParentDependency", void 0);
3316
+ __decorate([
3317
+ Property(false)
3318
+ ], Gantt.prototype, "enableHtmlSanitizer", void 0);
3281
3319
  __decorate([
3282
3320
  Property(true)
3283
3321
  ], Gantt.prototype, "disableHtmlEncode", void 0);
@@ -3287,6 +3325,12 @@ var Gantt = /** @class */ (function (_super) {
3287
3325
  __decorate([
3288
3326
  Property(true)
3289
3327
  ], Gantt.prototype, "enableVirtualMaskRow", void 0);
3328
+ __decorate([
3329
+ Property(true)
3330
+ ], Gantt.prototype, "UpdateOffsetOnTaskbarEdit", void 0);
3331
+ __decorate([
3332
+ Property(true)
3333
+ ], Gantt.prototype, "autoCalculateDateScheduling", void 0);
3290
3334
  __decorate([
3291
3335
  Property(true)
3292
3336
  ], Gantt.prototype, "autoFocusTasks", void 0);
@@ -3335,6 +3379,12 @@ var Gantt = /** @class */ (function (_super) {
3335
3379
  __decorate([
3336
3380
  Property(false)
3337
3381
  ], Gantt.prototype, "renderBaseline", void 0);
3382
+ __decorate([
3383
+ Property(false)
3384
+ ], Gantt.prototype, "allowTaskbarDragAndDrop", void 0);
3385
+ __decorate([
3386
+ Property(true)
3387
+ ], Gantt.prototype, "allowTaskbarOverlap", void 0);
3338
3388
  __decorate([
3339
3389
  Property('Horizontal')
3340
3390
  ], Gantt.prototype, "gridLines", void 0);
@@ -146,6 +146,8 @@ export interface ITaskData {
146
146
  workTimelineRanges?: IWorkTimelineRanges[];
147
147
  /** Defines overlap index. */
148
148
  eOverlapIndex?: number;
149
+ /** Defines whether overlapped with other taskbar or not. */
150
+ eOverlapped?: boolean;
149
151
  /** Defines task segments. */
150
152
  segments?: ITaskSegment[];
151
153
  /**
@@ -172,7 +172,7 @@ var TaskProcessor = /** @class */ (function (_super) {
172
172
  TaskProcessor.prototype.constructResourceViewDataSource = function (resources, data, unassignedTasks) {
173
173
  var _loop_1 = function (i) {
174
174
  var tempData = data[i];
175
- child = this_1.parent.taskFields.child != null ? this_1.parent.taskFields.child : 'Children';
175
+ var child = this_1.parent.taskFields.child != null ? this_1.parent.taskFields.child : 'Children';
176
176
  var resourceData = tempData && tempData[this_1.parent.taskFields.resourceInfo];
177
177
  var resourceIdMapping = this_1.parent.resourceFields.id;
178
178
  if ((!tempData[child] || tempData[child].length === 0) && resourceData && resourceData.length) {
@@ -199,7 +199,7 @@ var TaskProcessor = /** @class */ (function (_super) {
199
199
  this_1.constructResourceViewDataSource(resources, tempData[this_1.parent.taskFields.child], unassignedTasks);
200
200
  }
201
201
  };
202
- var this_1 = this, child;
202
+ var this_1 = this;
203
203
  for (var i = 0; i < data.length; i++) {
204
204
  _loop_1(i);
205
205
  }
@@ -258,7 +258,7 @@ var TaskProcessor = /** @class */ (function (_super) {
258
258
  }
259
259
  }
260
260
  var ganttData = this_3.createRecord(tempData, level, parentItem, true);
261
- if (!this_3.parent.enableValidation) {
261
+ if (!this_3.parent.enableValidation || !this_3.parent.autoCalculateDateScheduling) {
262
262
  this_3.updateTaskLeftWidth(ganttData);
263
263
  }
264
264
  ganttData.index = this_3.recordIndex++;
@@ -292,6 +292,9 @@ var TaskProcessor = /** @class */ (function (_super) {
292
292
  this_3.parent.setRecordValue('autoDuration', this_3.calculateAutoDuration(parentProp), parentProp, true);
293
293
  this_3.updateAutoWidthLeft(parentData);
294
294
  }
295
+ if (!this_3.parent.allowParentDependency) {
296
+ this_3.resetDependency(parentData);
297
+ }
295
298
  this_3.updateWidthLeft(parentData);
296
299
  this_3.updateTaskData(parentData);
297
300
  }
@@ -408,6 +411,9 @@ var TaskProcessor = /** @class */ (function (_super) {
408
411
  if (!isNullOrUndefined(data[taskSettings.child]) && data[taskSettings.child].length > 0) {
409
412
  this.parent.setRecordValue('hasChildRecords', true, ganttData);
410
413
  this.parent.setRecordValue('isMilestone', false, ganttProperties, true);
414
+ if (!this.parent.allowParentDependency) {
415
+ this.resetDependency(ganttData);
416
+ }
411
417
  }
412
418
  else {
413
419
  this.parent.setRecordValue('hasChildRecords', false, ganttData);
@@ -808,6 +814,16 @@ var TaskProcessor = /** @class */ (function (_super) {
808
814
  }
809
815
  }
810
816
  }
817
+ if (!this.parent.autoCalculateDateScheduling) {
818
+ if (!isNullOrUndefined(ganttData.ganttProperties.startDate)) {
819
+ ganttData[this.parent.taskFields.startDate] = ganttData.ganttProperties.startDate;
820
+ ganttData.taskData[this.parent.taskFields.startDate] = ganttData.ganttProperties.startDate;
821
+ }
822
+ if (!isNullOrUndefined(ganttData.ganttProperties.endDate)) {
823
+ ganttData[this.parent.taskFields.endDate] = ganttData.ganttProperties.endDate;
824
+ ganttData.taskData[this.parent.taskFields.endDate] = ganttData.ganttProperties.endDate;
825
+ }
826
+ }
811
827
  if (!isNullOrUndefined(segments)) {
812
828
  this.parent.setRecordValue('segments', this.setSegmentsInfo(ganttData, true), ganttProperties, true);
813
829
  }
@@ -1802,7 +1818,7 @@ var TaskProcessor = /** @class */ (function (_super) {
1802
1818
  var rangeObj_1 = {};
1803
1819
  if (this._isInStartDateRange(cStartDate, tStartDate, tEndDate) || this._isInEndDateRange(cEndDate, tStartDate, tEndDate)) {
1804
1820
  if ((tStartDate.getTime() > cStartDate.getTime() && tStartDate.getTime() < cEndDate.getTime()
1805
- && tEndDate.getTime() > cStartDate.getTime() && tEndDate.getTime() > cEndDate.getTime())
1821
+ && tEndDate.getTime() > cStartDate.getTime() && tEndDate.getTime() >= cEndDate.getTime())
1806
1822
  || (cStartDate.getTime() === tStartDate.getTime() && cEndDate.getTime() <= tEndDate.getTime())) {
1807
1823
  rangeObj_1.from = tStartDate;
1808
1824
  rangeObj_1.to = cEndDate;
@@ -2083,7 +2099,7 @@ var TaskProcessor = /** @class */ (function (_super) {
2083
2099
  */
2084
2100
  TaskProcessor.prototype.updateTaskLeftWidth = function (data) {
2085
2101
  var task = data.ganttProperties;
2086
- if (!data.hasChildRecords) {
2102
+ if (!data.hasChildRecords || !this.parent.autoCalculateDateScheduling) {
2087
2103
  this.updateWidthLeft(data);
2088
2104
  }
2089
2105
  this.parent.setRecordValue('baselineLeft', this.calculateBaselineLeft(task), task, true);
@@ -2095,7 +2111,12 @@ var TaskProcessor = /** @class */ (function (_super) {
2095
2111
  childData = parentItem.childRecords;
2096
2112
  }
2097
2113
  if (parentItem && childData.indexOf(data) === childData.length - 1 && !data.hasChildRecords && this.parent.enableValidation) {
2098
- this.updateParentItems(parentItem);
2114
+ if (this.parent.autoCalculateDateScheduling || this.parent.viewType === "ResourceView") {
2115
+ this.updateParentItems(parentItem);
2116
+ }
2117
+ if (!this.parent.autoCalculateDateScheduling) {
2118
+ this.updateWidthLeft(parentItem);
2119
+ }
2099
2120
  }
2100
2121
  else if (parentItem && !this.parent.enableValidation) {
2101
2122
  this.updateWidthLeft(parentItem);
@@ -2238,105 +2259,119 @@ var TaskProcessor = /** @class */ (function (_super) {
2238
2259
  var parentData = isParent ? cloneParent : this.parent.getParentTask(cloneParent);
2239
2260
  var deleteUpdate = false;
2240
2261
  var ganttProp = parentData.ganttProperties;
2241
- if (parentData.childRecords.length > 0) {
2242
- var previousStartDate = ganttProp.isAutoSchedule ? ganttProp.startDate : ganttProp.autoStartDate;
2243
- var previousEndDate = ganttProp.isAutoSchedule ? ganttProp.endDate :
2244
- ganttProp.autoEndDate;
2245
- var childRecords = parentData.childRecords;
2246
- var childLength = childRecords.length;
2247
- var totalDuration = 0;
2248
- var progressValues = {};
2249
- var minStartDate = null;
2250
- var maxEndDate = null;
2251
- var milestoneCount = 0;
2252
- var totalProgress = 0;
2253
- var childCompletedWorks = 0;
2254
- var childData = void 0;
2255
- for (var count = 0; count < childLength; count++) {
2256
- childData = childRecords[count];
2257
- if (this.parent.isOnDelete && childData.isDelete) {
2258
- if (childLength === 1 && this.parent.viewType === 'ProjectView') {
2259
- deleteUpdate = true;
2262
+ if (this.parent.autoCalculateDateScheduling || this.parent.viewType === "ResourceView") {
2263
+ if (parentData.childRecords.length > 0) {
2264
+ var previousStartDate = ganttProp.isAutoSchedule ? ganttProp.startDate : ganttProp.autoStartDate;
2265
+ var previousEndDate = ganttProp.isAutoSchedule ? ganttProp.endDate :
2266
+ ganttProp.autoEndDate;
2267
+ var childRecords = parentData.childRecords;
2268
+ var childLength = childRecords.length;
2269
+ var totalDuration = 0;
2270
+ var progressValues = {};
2271
+ var minStartDate = null;
2272
+ var maxEndDate = null;
2273
+ var milestoneCount = 0;
2274
+ var totalProgress = 0;
2275
+ var childCompletedWorks = 0;
2276
+ var childData = void 0;
2277
+ for (var count = 0; count < childLength; count++) {
2278
+ childData = childRecords[count];
2279
+ if (this.parent.isOnDelete && childData.isDelete) {
2280
+ if (childLength === 1 && this.parent.viewType === 'ProjectView') {
2281
+ deleteUpdate = true;
2282
+ }
2283
+ continue;
2260
2284
  }
2261
- continue;
2262
- }
2263
- var startDate = this.getValidStartDate(childData.ganttProperties);
2264
- if (parentData.hasChildRecords && !ganttProp.isAutoSchedule && !isNullOrUndefined(childData.ganttProperties.autoStartDate)) {
2265
- startDate = childData.ganttProperties.autoStartDate;
2266
- }
2267
- var endDate = this.getValidEndDate(childData.ganttProperties);
2268
- if (parentData.hasChildRecords && !ganttProp.isAutoSchedule && !isNullOrUndefined(childData.ganttProperties.autoEndDate)) {
2269
- endDate = childData.ganttProperties.autoEndDate;
2270
- }
2271
- if (isNullOrUndefined(minStartDate)) {
2272
- minStartDate = this.getDateFromFormat(startDate);
2273
- }
2274
- if (isNullOrUndefined(maxEndDate)) {
2275
- maxEndDate = this.getDateFromFormat(endDate);
2276
- }
2277
- if (!isNullOrUndefined(endDate) && this.compareDates(endDate, maxEndDate) === 1) {
2278
- maxEndDate = this.getDateFromFormat(endDate);
2279
- }
2280
- if (!isNullOrUndefined(startDate) && this.compareDates(startDate, minStartDate) === -1) {
2281
- minStartDate = this.getDateFromFormat(startDate);
2282
- }
2283
- if (!childData.ganttProperties.isMilestone && isScheduledTask(childData.ganttProperties)) {
2284
- progressValues = this.getParentProgress(childData);
2285
- totalProgress += getValue('totalProgress', progressValues);
2286
- if (childData[this.parent.taskFields.duration] < 1) {
2287
- totalDuration += getValue('totalDuration', progressValues);
2288
- totalDuration = Number(totalDuration.toFixed(4));
2285
+ var startDate = this.getValidStartDate(childData.ganttProperties);
2286
+ if (parentData.hasChildRecords && !ganttProp.isAutoSchedule && !isNullOrUndefined(childData.ganttProperties.autoStartDate)) {
2287
+ startDate = childData.ganttProperties.autoStartDate;
2288
+ }
2289
+ var endDate = this.getValidEndDate(childData.ganttProperties);
2290
+ if (parentData.hasChildRecords && !ganttProp.isAutoSchedule && !isNullOrUndefined(childData.ganttProperties.autoEndDate)) {
2291
+ endDate = childData.ganttProperties.autoEndDate;
2292
+ }
2293
+ if (isNullOrUndefined(minStartDate)) {
2294
+ minStartDate = this.getDateFromFormat(startDate);
2295
+ }
2296
+ if (isNullOrUndefined(maxEndDate)) {
2297
+ maxEndDate = this.getDateFromFormat(endDate);
2298
+ }
2299
+ if (!isNullOrUndefined(endDate) && this.compareDates(endDate, maxEndDate) === 1) {
2300
+ maxEndDate = this.getDateFromFormat(endDate);
2301
+ }
2302
+ if (!isNullOrUndefined(startDate) && this.compareDates(startDate, minStartDate) === -1) {
2303
+ minStartDate = this.getDateFromFormat(startDate);
2304
+ }
2305
+ if (!childData.ganttProperties.isMilestone && isScheduledTask(childData.ganttProperties)) {
2306
+ progressValues = this.getParentProgress(childData);
2307
+ totalProgress += getValue('totalProgress', progressValues);
2308
+ if (childData[this.parent.taskFields.duration] < 1) {
2309
+ totalDuration += getValue('totalDuration', progressValues);
2310
+ totalDuration = Number(totalDuration.toFixed(4));
2311
+ }
2312
+ else {
2313
+ totalDuration += getValue('totalDuration', progressValues);
2314
+ }
2289
2315
  }
2290
2316
  else {
2291
- totalDuration += getValue('totalDuration', progressValues);
2317
+ milestoneCount++;
2292
2318
  }
2319
+ childCompletedWorks += childData.ganttProperties.work;
2293
2320
  }
2294
- else {
2295
- milestoneCount++;
2296
- }
2297
- childCompletedWorks += childData.ganttProperties.work;
2298
- }
2299
- if (!deleteUpdate) {
2300
- if (this.compareDates(previousStartDate, minStartDate) !== 0) {
2301
- this.parent.setRecordValue(ganttProp.isAutoSchedule ? 'startDate' : 'autoStartDate', minStartDate, parentData.ganttProperties, true);
2302
- }
2303
- if (this.compareDates(previousEndDate, maxEndDate) !== 0) {
2304
- this.parent.setRecordValue(ganttProp.isAutoSchedule ? 'endDate' : 'autoEndDate', maxEndDate, parentData.ganttProperties, true);
2305
- }
2306
- var taskCount = void 0;
2307
- if (this.parent.isOnDelete && childData.isDelete) {
2308
- taskCount = childLength - milestoneCount - 1;
2309
- }
2310
- else {
2311
- taskCount = childLength - milestoneCount;
2312
- }
2313
- var parentProgress = (taskCount > 0 && totalDuration > 0) ? (totalProgress / totalDuration) : 0;
2314
- var parentProp = parentData.ganttProperties;
2315
- var milestone = (taskCount === 0) && minStartDate && maxEndDate &&
2316
- minStartDate.getTime() === maxEndDate.getTime() ? true : false;
2317
- this.parent.setRecordValue('isMilestone', milestone, parentProp, true);
2318
- if (parentProp.isAutoSchedule) {
2319
- this.calculateDuration(parentData);
2320
- }
2321
- this.updateWorkWithDuration(parentData);
2322
- var parentWork = parentProp.work;
2323
- parentWork = this.parent.isOnEdit ? parentWork : (parentWork + childCompletedWorks);
2324
- this.parent.setRecordValue('work', parentWork, parentProp, true);
2325
- this.parent.setRecordValue('taskType', 'FixedDuration', parentProp, true);
2326
- if (!isNullOrUndefined(this.parent.taskFields.type)) {
2327
- this.updateMappingData(parentData, 'type');
2328
- }
2329
- this.parent.setRecordValue('progress', Math.floor(parentProgress), parentProp, true);
2330
- this.parent.setRecordValue('totalProgress', totalProgress, parentProp, true);
2331
- this.parent.setRecordValue('totalDuration', totalDuration, parentProp, true);
2332
- if (!parentProp.isAutoSchedule) {
2333
- this.parent.setRecordValue('autoDuration', this.calculateAutoDuration(parentProp), parentProp, true);
2334
- this.updateAutoWidthLeft(parentData);
2321
+ if (!deleteUpdate) {
2322
+ var taskCount = void 0;
2323
+ if (this.parent.isOnDelete && childData.isDelete) {
2324
+ taskCount = childLength - milestoneCount - 1;
2325
+ }
2326
+ else {
2327
+ taskCount = childLength - milestoneCount;
2328
+ }
2329
+ var parentProgress = (taskCount > 0 && totalDuration > 0) ? (totalProgress / totalDuration) : 0;
2330
+ var parentProp = parentData.ganttProperties;
2331
+ var milestone = (taskCount === 0) && minStartDate && maxEndDate &&
2332
+ minStartDate.getTime() === maxEndDate.getTime() ? true : false;
2333
+ if (this.compareDates(previousStartDate, minStartDate) !== 0) {
2334
+ this.parent.setRecordValue(ganttProp.isAutoSchedule ? 'startDate' : 'autoStartDate', minStartDate, parentData.ganttProperties, true);
2335
+ if ((((!isNullOrUndefined(ganttProp.autoDuration)) ? ganttProp.autoDuration === 0 : ganttProp.duration === 0)) && parentData['isManual'] && milestone) {
2336
+ this.parent.setRecordValue('startDate', minStartDate, parentData.ganttProperties, true);
2337
+ }
2338
+ }
2339
+ if (this.compareDates(previousEndDate, maxEndDate) !== 0) {
2340
+ this.parent.setRecordValue(ganttProp.isAutoSchedule ? 'endDate' : 'autoEndDate', maxEndDate, parentData.ganttProperties, true);
2341
+ if ((((!isNullOrUndefined(ganttProp.autoDuration)) ? ganttProp.autoDuration === 0 : ganttProp.duration === 0)) && parentData['isManual'] && milestone) {
2342
+ this.parent.setRecordValue('endDate', maxEndDate, parentData.ganttProperties, true);
2343
+ }
2344
+ }
2345
+ this.parent.setRecordValue('isMilestone', milestone, parentProp, true);
2346
+ if (parentProp.isAutoSchedule) {
2347
+ this.calculateDuration(parentData);
2348
+ }
2349
+ this.updateWorkWithDuration(parentData);
2350
+ var parentWork = parentProp.work;
2351
+ parentWork = this.parent.isOnEdit ? parentWork : (parentWork + childCompletedWorks);
2352
+ this.parent.setRecordValue('work', parentWork, parentProp, true);
2353
+ this.parent.setRecordValue('taskType', 'FixedDuration', parentProp, true);
2354
+ if (!isNullOrUndefined(this.parent.taskFields.type)) {
2355
+ this.updateMappingData(parentData, 'type');
2356
+ }
2357
+ this.parent.setRecordValue('progress', Math.floor(parentProgress), parentProp, true);
2358
+ this.parent.setRecordValue('totalProgress', totalProgress, parentProp, true);
2359
+ this.parent.setRecordValue('totalDuration', totalDuration, parentProp, true);
2360
+ if (!parentProp.isAutoSchedule) {
2361
+ this.parent.setRecordValue('autoDuration', this.calculateAutoDuration(parentProp), parentProp, true);
2362
+ this.updateAutoWidthLeft(parentData);
2363
+ }
2364
+ if (!this.parent.allowParentDependency) {
2365
+ this.resetDependency(parentData);
2366
+ }
2367
+ this.updateWidthLeft(parentData);
2368
+ this.updateTaskData(parentData);
2335
2369
  }
2336
- this.updateWidthLeft(parentData);
2337
- this.updateTaskData(parentData);
2338
2370
  }
2339
2371
  }
2372
+ else {
2373
+ parentData.ganttProperties.endDate = parentData.taskData[this.parent.taskFields.endDate];
2374
+ }
2340
2375
  if (deleteUpdate && parentData.childRecords.length === 1 && parentData.ganttProperties.duration === 0) {
2341
2376
  this.parent.setRecordValue('isMilestone', true, parentData.ganttProperties, true);
2342
2377
  this.updateWidthLeft(parentData);
@@ -2344,7 +2379,9 @@ var TaskProcessor = /** @class */ (function (_super) {
2344
2379
  }
2345
2380
  var parentItem = this.parent.getParentTask(parentData.parentItem);
2346
2381
  if (parentItem) {
2347
- this.updateParentItems(parentItem);
2382
+ if (this.parent.autoCalculateDateScheduling || this.parent.viewType === "ResourceView") {
2383
+ this.updateParentItems(parentItem);
2384
+ }
2348
2385
  }
2349
2386
  deleteUpdate = false;
2350
2387
  };