@syncfusion/ej2-gantt 20.4.53 → 21.1.35
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.
- package/CHANGELOG.md +27 -0
- package/README.md +1 -1
- package/dist/ej2-gantt.min.js +2 -2
- package/dist/ej2-gantt.umd.min.js +2 -2
- package/dist/ej2-gantt.umd.min.js.map +1 -1
- package/dist/es6/ej2-gantt.es2015.js +1104 -450
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +1084 -430
- package/dist/es6/ej2-gantt.es5.js.map +1 -1
- package/dist/global/ej2-gantt.min.js +2 -2
- package/dist/global/ej2-gantt.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +20 -20
- package/src/gantt/actions/cell-edit.js +8 -6
- package/src/gantt/actions/chart-scroll.d.ts +1 -0
- package/src/gantt/actions/chart-scroll.js +15 -4
- package/src/gantt/actions/connector-line-edit.js +39 -28
- package/src/gantt/actions/context-menu.js +5 -5
- package/src/gantt/actions/critical-path.js +10 -8
- package/src/gantt/actions/dependency.js +28 -12
- package/src/gantt/actions/dialog-edit.js +41 -21
- package/src/gantt/actions/edit.js +56 -55
- package/src/gantt/actions/filter.d.ts +2 -1
- package/src/gantt/actions/filter.js +88 -2
- package/src/gantt/actions/keyboard.js +0 -1
- package/src/gantt/actions/pdf-export.d.ts +3 -1
- package/src/gantt/actions/pdf-export.js +12 -6
- package/src/gantt/actions/rowdragdrop.js +2 -2
- package/src/gantt/actions/selection.js +5 -2
- package/src/gantt/actions/taskbar-edit.d.ts +5 -0
- package/src/gantt/actions/taskbar-edit.js +114 -10
- package/src/gantt/base/date-processor.js +78 -52
- package/src/gantt/base/gantt-chart.js +20 -4
- package/src/gantt/base/gantt-model.d.ts +43 -0
- package/src/gantt/base/gantt.d.ts +39 -1
- package/src/gantt/base/gantt.js +79 -33
- package/src/gantt/base/interface.d.ts +2 -0
- package/src/gantt/base/task-processor.js +133 -98
- package/src/gantt/base/tree-grid.js +31 -1
- package/src/gantt/base/utils.js +1 -1
- package/src/gantt/export/export-helper.js +6 -0
- package/src/gantt/renderer/chart-rows.d.ts +2 -0
- package/src/gantt/renderer/chart-rows.js +156 -24
- package/src/gantt/renderer/connector-line.js +50 -20
- package/src/gantt/renderer/edit-tooltip.js +0 -3
- package/src/gantt/renderer/event-marker.js +4 -1
- package/src/gantt/renderer/nonworking-day.js +4 -1
- package/src/gantt/renderer/timeline.js +3 -3
- package/src/gantt/renderer/tooltip.js +101 -33
- package/styles/bootstrap-dark.css +33 -10
- package/styles/bootstrap.css +31 -10
- package/styles/bootstrap4.css +28 -7
- package/styles/bootstrap5-dark.css +30 -9
- package/styles/bootstrap5.css +30 -9
- package/styles/fabric-dark.css +28 -7
- package/styles/fabric.css +28 -7
- package/styles/fluent-dark.css +56 -29
- package/styles/fluent.css +56 -29
- package/styles/gantt/_bootstrap-dark-definition.scss +5 -4
- package/styles/gantt/_bootstrap-definition.scss +5 -4
- package/styles/gantt/_bootstrap4-definition.scss +3 -2
- package/styles/gantt/_bootstrap5-definition.scss +15 -14
- package/styles/gantt/_fabric-dark-definition.scss +3 -2
- package/styles/gantt/_fabric-definition.scss +3 -2
- package/styles/gantt/_fluent-definition.scss +18 -17
- package/styles/gantt/_fusionnew-definition.scss +5 -4
- package/styles/gantt/_highcontrast-definition.scss +3 -2
- package/styles/gantt/_highcontrast-light-definition.scss +3 -2
- package/styles/gantt/_layout.scss +45 -13
- package/styles/gantt/_material-dark-definition.scss +3 -2
- package/styles/gantt/_material-definition.scss +3 -2
- package/styles/gantt/_tailwind-definition.scss +9 -8
- package/styles/gantt/_theme.scss +25 -6
- package/styles/gantt/bootstrap-dark.css +33 -10
- package/styles/gantt/bootstrap.css +31 -10
- package/styles/gantt/bootstrap4.css +28 -7
- package/styles/gantt/bootstrap5-dark.css +30 -9
- package/styles/gantt/bootstrap5.css +30 -9
- package/styles/gantt/fabric-dark.css +28 -7
- package/styles/gantt/fabric.css +28 -7
- package/styles/gantt/fluent-dark.css +56 -29
- package/styles/gantt/fluent.css +56 -29
- package/styles/gantt/highcontrast-light.css +28 -9
- package/styles/gantt/highcontrast.css +28 -7
- package/styles/gantt/material-dark.css +31 -14
- package/styles/gantt/material.css +28 -7
- package/styles/gantt/tailwind-dark.css +28 -7
- package/styles/gantt/tailwind.css +28 -7
- package/styles/highcontrast-light.css +28 -9
- package/styles/highcontrast.css +28 -7
- package/styles/material-dark.css +31 -14
- package/styles/material.css +28 -7
- package/styles/tailwind-dark.css +28 -7
- package/styles/tailwind.css +28 -7
- package/styles/gantt/_material3-definition.scss +0 -218
package/src/gantt/base/gantt.js
CHANGED
|
@@ -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.
|
|
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.
|
|
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.
|
|
872
|
-
|
|
873
|
-
this.contentHeight = length_1 * this.rowHeight;
|
|
881
|
+
if (!this.allowTaskbarOverlap && this.viewType === 'ResourceView' && !this.isLoad) {
|
|
882
|
+
return;
|
|
874
883
|
}
|
|
875
884
|
else {
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -1491,6 +1505,11 @@ var Gantt = /** @class */ (function (_super) {
|
|
|
1491
1505
|
case 'enableRtl':
|
|
1492
1506
|
case 'readOnly':
|
|
1493
1507
|
case 'viewType':
|
|
1508
|
+
case 'taskFields':
|
|
1509
|
+
case 'dayWorkingTime':
|
|
1510
|
+
case 'allowTaskbarDragAndDrop':
|
|
1511
|
+
case 'allowTaskbarOverlap':
|
|
1512
|
+
case 'allowParentDependency':
|
|
1494
1513
|
if (prop === 'locale') {
|
|
1495
1514
|
this.isLocaleChanged = true;
|
|
1496
1515
|
}
|
|
@@ -1505,6 +1524,9 @@ var Gantt = /** @class */ (function (_super) {
|
|
|
1505
1524
|
}
|
|
1506
1525
|
}
|
|
1507
1526
|
if (isRefresh) {
|
|
1527
|
+
if (this.isLoad && this.contentMaskTable) {
|
|
1528
|
+
this.contentMaskTable = null;
|
|
1529
|
+
}
|
|
1508
1530
|
this.refresh();
|
|
1509
1531
|
}
|
|
1510
1532
|
};
|
|
@@ -1632,7 +1654,7 @@ var Gantt = /** @class */ (function (_super) {
|
|
|
1632
1654
|
args: [this]
|
|
1633
1655
|
});
|
|
1634
1656
|
}
|
|
1635
|
-
if (this.allowRowDragAndDrop) {
|
|
1657
|
+
if (this.allowRowDragAndDrop || this.allowTaskbarDragAndDrop) {
|
|
1636
1658
|
modules.push({
|
|
1637
1659
|
member: 'rowDragAndDrop',
|
|
1638
1660
|
args: [this]
|
|
@@ -2167,10 +2189,11 @@ var Gantt = /** @class */ (function (_super) {
|
|
|
2167
2189
|
* @param {PdfExportProperties} pdfExportProperties - Defines the export properties of the Gantt.
|
|
2168
2190
|
* @param {isMultipleExport} isMultipleExport - Define to enable multiple export.
|
|
2169
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.
|
|
2170
2193
|
* @returns {Promise<any>} .
|
|
2171
2194
|
*/
|
|
2172
|
-
Gantt.prototype.pdfExport = function (pdfExportProperties, isMultipleExport, pdfDoc) {
|
|
2173
|
-
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)
|
|
2174
2197
|
: null;
|
|
2175
2198
|
};
|
|
2176
2199
|
/**
|
|
@@ -2202,7 +2225,7 @@ var Gantt = /** @class */ (function (_super) {
|
|
|
2202
2225
|
* @private
|
|
2203
2226
|
*/
|
|
2204
2227
|
Gantt.prototype.renderWorkingDayCell = function (args) {
|
|
2205
|
-
var includeWeekend = this.taskMode !== 'Auto' ? true : this.includeWeekend ? true : false;
|
|
2228
|
+
var includeWeekend = this.taskMode !== 'Auto' ? true : (this.includeWeekend || !this.autoCalculateDateScheduling) ? true : false;
|
|
2206
2229
|
var nonWorkingDays = !includeWeekend ? this.nonWorkingDayIndex : [];
|
|
2207
2230
|
var holidays = this.totalHolidayDates;
|
|
2208
2231
|
if (nonWorkingDays.length > 0 && nonWorkingDays.indexOf(args.date.getDay()) !== -1) {
|
|
@@ -2212,7 +2235,12 @@ var Gantt = /** @class */ (function (_super) {
|
|
|
2212
2235
|
var tempDate = new Date(args.date.getTime());
|
|
2213
2236
|
tempDate.setHours(0, 0, 0);
|
|
2214
2237
|
if (holidays.indexOf(tempDate.getTime()) !== -1) {
|
|
2215
|
-
|
|
2238
|
+
if (!this.autoCalculateDateScheduling) {
|
|
2239
|
+
args.isDisabled = false;
|
|
2240
|
+
}
|
|
2241
|
+
else {
|
|
2242
|
+
args.isDisabled = true;
|
|
2243
|
+
}
|
|
2216
2244
|
}
|
|
2217
2245
|
}
|
|
2218
2246
|
};
|
|
@@ -2329,8 +2357,8 @@ var Gantt = /** @class */ (function (_super) {
|
|
|
2329
2357
|
var id = ganttData.rowUniqueID;
|
|
2330
2358
|
var task = this.getRecordByID(id);
|
|
2331
2359
|
var isValid = false;
|
|
2332
|
-
if (isNullOrUndefined(value) || (!isNullOrUndefined(value) && !isNullOrUndefined(ganttData[field]) && (value instanceof Date ? value.getTime() !==
|
|
2333
|
-
ganttData[field].getTime() : ganttData[field] !== value))) {
|
|
2360
|
+
if (isNullOrUndefined(value) || (!isNullOrUndefined(value) && !isNullOrUndefined(ganttData["" + field]) && (value instanceof Date ? value.getTime() !==
|
|
2361
|
+
ganttData["" + field].getTime() : ganttData["" + field] !== value))) {
|
|
2334
2362
|
isValid = true;
|
|
2335
2363
|
}
|
|
2336
2364
|
if (task && ((this.editedRecords.indexOf(task) === -1 && isValid) || this.editedRecords.length === 0)) {
|
|
@@ -3277,6 +3305,12 @@ var Gantt = /** @class */ (function (_super) {
|
|
|
3277
3305
|
__decorate([
|
|
3278
3306
|
Property(false)
|
|
3279
3307
|
], Gantt.prototype, "enableImmutableMode", void 0);
|
|
3308
|
+
__decorate([
|
|
3309
|
+
Property(true)
|
|
3310
|
+
], Gantt.prototype, "allowParentDependency", void 0);
|
|
3311
|
+
__decorate([
|
|
3312
|
+
Property(false)
|
|
3313
|
+
], Gantt.prototype, "enableHtmlSanitizer", void 0);
|
|
3280
3314
|
__decorate([
|
|
3281
3315
|
Property(true)
|
|
3282
3316
|
], Gantt.prototype, "disableHtmlEncode", void 0);
|
|
@@ -3286,6 +3320,12 @@ var Gantt = /** @class */ (function (_super) {
|
|
|
3286
3320
|
__decorate([
|
|
3287
3321
|
Property(true)
|
|
3288
3322
|
], Gantt.prototype, "enableVirtualMaskRow", void 0);
|
|
3323
|
+
__decorate([
|
|
3324
|
+
Property(true)
|
|
3325
|
+
], Gantt.prototype, "UpdateOffsetOnTaskbarEdit", void 0);
|
|
3326
|
+
__decorate([
|
|
3327
|
+
Property(true)
|
|
3328
|
+
], Gantt.prototype, "autoCalculateDateScheduling", void 0);
|
|
3289
3329
|
__decorate([
|
|
3290
3330
|
Property(true)
|
|
3291
3331
|
], Gantt.prototype, "autoFocusTasks", void 0);
|
|
@@ -3334,6 +3374,12 @@ var Gantt = /** @class */ (function (_super) {
|
|
|
3334
3374
|
__decorate([
|
|
3335
3375
|
Property(false)
|
|
3336
3376
|
], Gantt.prototype, "renderBaseline", void 0);
|
|
3377
|
+
__decorate([
|
|
3378
|
+
Property(false)
|
|
3379
|
+
], Gantt.prototype, "allowTaskbarDragAndDrop", void 0);
|
|
3380
|
+
__decorate([
|
|
3381
|
+
Property(true)
|
|
3382
|
+
], Gantt.prototype, "allowTaskbarOverlap", void 0);
|
|
3337
3383
|
__decorate([
|
|
3338
3384
|
Property('Horizontal')
|
|
3339
3385
|
], 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
|
|
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()
|
|
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.
|
|
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);
|
|
@@ -2210,7 +2231,7 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
2210
2231
|
}
|
|
2211
2232
|
if (childGanttRecord.hasChildRecords) {
|
|
2212
2233
|
setValue('totalProgress', childGanttRecord.ganttProperties.totalProgress, progressValues);
|
|
2213
|
-
setValue('totalDuration', childGanttRecord.ganttProperties.totalDuration, progressValues);
|
|
2234
|
+
setValue('totalDuration', childGanttRecord.ganttProperties.totalDuration ? childGanttRecord.ganttProperties.totalDuration : 0, progressValues);
|
|
2214
2235
|
}
|
|
2215
2236
|
else {
|
|
2216
2237
|
setValue('totalProgress', childGanttRecord.ganttProperties.progress * durationInDay, progressValues);
|
|
@@ -2238,107 +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 (
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
ganttProp.
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
if (
|
|
2259
|
-
|
|
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
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
totalProgress += getValue('totalProgress', progressValues);
|
|
2286
|
-
if (childData[this.parent.taskFields.duration] < 1) {
|
|
2287
|
-
if (typeof (getValue('totalDuration', progressValues)) != 'object') {
|
|
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) {
|
|
2288
2309
|
totalDuration += getValue('totalDuration', progressValues);
|
|
2289
2310
|
totalDuration = Number(totalDuration.toFixed(4));
|
|
2290
2311
|
}
|
|
2312
|
+
else {
|
|
2313
|
+
totalDuration += getValue('totalDuration', progressValues);
|
|
2314
|
+
}
|
|
2291
2315
|
}
|
|
2292
2316
|
else {
|
|
2293
|
-
|
|
2317
|
+
milestoneCount++;
|
|
2294
2318
|
}
|
|
2319
|
+
childCompletedWorks += childData.ganttProperties.work;
|
|
2295
2320
|
}
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
this.
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
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);
|
|
2337
2369
|
}
|
|
2338
|
-
this.updateWidthLeft(parentData);
|
|
2339
|
-
this.updateTaskData(parentData);
|
|
2340
2370
|
}
|
|
2341
2371
|
}
|
|
2372
|
+
else {
|
|
2373
|
+
parentData.ganttProperties.endDate = parentData.taskData[this.parent.taskFields.endDate];
|
|
2374
|
+
}
|
|
2342
2375
|
if (deleteUpdate && parentData.childRecords.length === 1 && parentData.ganttProperties.duration === 0) {
|
|
2343
2376
|
this.parent.setRecordValue('isMilestone', true, parentData.ganttProperties, true);
|
|
2344
2377
|
this.updateWidthLeft(parentData);
|
|
@@ -2346,7 +2379,9 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
2346
2379
|
}
|
|
2347
2380
|
var parentItem = this.parent.getParentTask(parentData.parentItem);
|
|
2348
2381
|
if (parentItem) {
|
|
2349
|
-
this.
|
|
2382
|
+
if (this.parent.autoCalculateDateScheduling || this.parent.viewType === "ResourceView") {
|
|
2383
|
+
this.updateParentItems(parentItem);
|
|
2384
|
+
}
|
|
2350
2385
|
}
|
|
2351
2386
|
deleteUpdate = false;
|
|
2352
2387
|
};
|