@syncfusion/ej2-gantt 21.2.6 → 21.2.9
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 +35 -0
- 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 +181 -80
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +176 -75
- 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 +16 -16
- package/src/gantt/actions/context-menu.js +1 -1
- package/src/gantt/actions/dependency.js +9 -0
- package/src/gantt/actions/edit.d.ts +1 -0
- package/src/gantt/actions/edit.js +14 -3
- package/src/gantt/actions/pdf-export.js +1 -1
- package/src/gantt/actions/taskbar-edit.js +5 -2
- package/src/gantt/base/date-processor.js +1 -1
- package/src/gantt/base/gantt-chart.js +14 -3
- package/src/gantt/base/task-processor.js +51 -20
- package/src/gantt/base/tree-grid.js +2 -2
- package/src/gantt/export/export-helper.js +3 -0
- package/src/gantt/export/pdf-connector-line.d.ts +4 -3
- package/src/gantt/export/pdf-connector-line.js +22 -11
- package/src/gantt/export/pdf-gantt.d.ts +2 -1
- package/src/gantt/export/pdf-gantt.js +4 -4
- package/src/gantt/renderer/chart-rows.d.ts +1 -0
- package/src/gantt/renderer/chart-rows.js +46 -26
- package/src/gantt/renderer/timeline.js +4 -2
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 21.2.
|
|
3
|
+
* version : 21.2.9
|
|
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@21.2.
|
|
3
|
+
"_id": "@syncfusion/ej2-gantt@21.2.8",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-rJtH1w7dOjvnIkO1TroHfHAOhzDMc3E815amBKZeiz/7/lUDROTFMh/RzxT80h+fUJFrXpxDwJnCG5jUvyBnkA==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-gantt",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"/@syncfusion/ej2-react-gantt",
|
|
24
24
|
"/@syncfusion/ej2-vue-gantt"
|
|
25
25
|
],
|
|
26
|
-
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-gantt/-/ej2-gantt-21.2.
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-gantt/-/ej2-gantt-21.2.8.tgz",
|
|
27
|
+
"_shasum": "479c2b0b201b74789fbb77715bc1302d27ef2d09",
|
|
28
28
|
"_spec": "@syncfusion/ej2-gantt@*",
|
|
29
29
|
"_where": "/jenkins/workspace/elease-automation_release_21.1.1/packages/included",
|
|
30
30
|
"author": {
|
|
@@ -35,20 +35,20 @@
|
|
|
35
35
|
},
|
|
36
36
|
"bundleDependencies": false,
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@syncfusion/ej2-base": "~21.2.
|
|
38
|
+
"@syncfusion/ej2-base": "~21.2.9",
|
|
39
39
|
"@syncfusion/ej2-buttons": "~21.2.6",
|
|
40
|
-
"@syncfusion/ej2-calendars": "~21.2.
|
|
41
|
-
"@syncfusion/ej2-data": "~21.2.
|
|
42
|
-
"@syncfusion/ej2-dropdowns": "~21.2.
|
|
43
|
-
"@syncfusion/ej2-grids": "~21.2.
|
|
44
|
-
"@syncfusion/ej2-inputs": "~21.2.
|
|
45
|
-
"@syncfusion/ej2-layouts": "~21.2.
|
|
46
|
-
"@syncfusion/ej2-lists": "~21.2.
|
|
47
|
-
"@syncfusion/ej2-navigations": "~21.2.
|
|
40
|
+
"@syncfusion/ej2-calendars": "~21.2.9",
|
|
41
|
+
"@syncfusion/ej2-data": "~21.2.9",
|
|
42
|
+
"@syncfusion/ej2-dropdowns": "~21.2.8",
|
|
43
|
+
"@syncfusion/ej2-grids": "~21.2.9",
|
|
44
|
+
"@syncfusion/ej2-inputs": "~21.2.9",
|
|
45
|
+
"@syncfusion/ej2-layouts": "~21.2.9",
|
|
46
|
+
"@syncfusion/ej2-lists": "~21.2.9",
|
|
47
|
+
"@syncfusion/ej2-navigations": "~21.2.9",
|
|
48
48
|
"@syncfusion/ej2-notifications": "~21.2.3",
|
|
49
49
|
"@syncfusion/ej2-popups": "~21.2.4",
|
|
50
|
-
"@syncfusion/ej2-richtexteditor": "~21.2.
|
|
51
|
-
"@syncfusion/ej2-treegrid": "~21.2.
|
|
50
|
+
"@syncfusion/ej2-richtexteditor": "~21.2.9",
|
|
51
|
+
"@syncfusion/ej2-treegrid": "~21.2.9"
|
|
52
52
|
},
|
|
53
53
|
"deprecated": false,
|
|
54
54
|
"description": "Essential JS 2 Gantt Component",
|
|
@@ -73,6 +73,6 @@
|
|
|
73
73
|
"url": "git+https://github.com/syncfusion/ej2-gantt.git"
|
|
74
74
|
},
|
|
75
75
|
"typings": "index.d.ts",
|
|
76
|
-
"version": "21.2.
|
|
76
|
+
"version": "21.2.9",
|
|
77
77
|
"sideEffects": false
|
|
78
78
|
}
|
|
@@ -291,7 +291,7 @@ var ContextMenu = /** @class */ (function () {
|
|
|
291
291
|
this.parent.ganttChartModule.targetElement;
|
|
292
292
|
// Closed edited cell before opening context menu
|
|
293
293
|
// eslint-disable-next-line
|
|
294
|
-
if (!isNullOrUndefined(this.parent.editModule) && this.parent.editModule.cellEditModule && this.parent.editModule.cellEditModule.isCellEdit && target.parentElement.classList.contains('e-row')) {
|
|
294
|
+
if (!isNullOrUndefined(this.parent.editModule) && this.parent.editModule.cellEditModule && this.parent.editModule.cellEditModule.isCellEdit && target.parentElement.classList.contains('e-row') || target.parentElement.classList.contains('e-treecolumn-container')) {
|
|
295
295
|
this.parent.treeGrid.closeEdit();
|
|
296
296
|
}
|
|
297
297
|
if (!isNullOrUndefined(args.element) && args.element.id === this.parent.element.id + '_contextmenu') {
|
|
@@ -387,6 +387,15 @@ var Dependency = /** @class */ (function () {
|
|
|
387
387
|
for (var count = 0; count < totLength; count++) {
|
|
388
388
|
if (flatData[count].ganttProperties.predecessorsName) {
|
|
389
389
|
this.validatePredecessorDates(flatData[count]);
|
|
390
|
+
var predecessorCollection = flatData[count].ganttProperties.predecessor;
|
|
391
|
+
if (predecessorCollection && predecessorCollection.length > 1) {
|
|
392
|
+
for (var i = 0; i < predecessorCollection.length; i++) {
|
|
393
|
+
var validateRecord = this.parent.getRecordByID(predecessorCollection[i].to);
|
|
394
|
+
if (validateRecord) {
|
|
395
|
+
this.validatePredecessorDates(validateRecord);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}
|
|
390
399
|
if (flatData[count].hasChildRecords && this.parent.editModule && !this.parent.allowUnscheduledTasks
|
|
391
400
|
&& this.parent.allowParentDependency) {
|
|
392
401
|
this.parent.editModule['updateChildItems'](flatData[count]);
|
|
@@ -17,6 +17,7 @@ var Edit = /** @class */ (function () {
|
|
|
17
17
|
this.isFromDeleteMethod = false;
|
|
18
18
|
this.targetedRecords = [];
|
|
19
19
|
this.isNewRecordAdded = false;
|
|
20
|
+
this.isValidatedEditedRecord = false;
|
|
20
21
|
/** @hidden */
|
|
21
22
|
this.updateParentRecords = [];
|
|
22
23
|
/** @hidden */
|
|
@@ -671,8 +672,9 @@ var Edit = /** @class */ (function () {
|
|
|
671
672
|
(isNullOrUndefined(taskData.startDate) && !isNullOrUndefined(prevStart)) ||
|
|
672
673
|
(isNullOrUndefined(taskData.endDate) && !isNullOrUndefined(prevEnd)) ||
|
|
673
674
|
(prevStart && prevStart.getTime() !== taskData.startDate.getTime())
|
|
674
|
-
|
|
675
|
-
|| (!isNullOrUndefined(prevDuration) && prevDuration !== taskData.duration
|
|
675
|
+
|| (prevEnd && prevEnd.getTime() !== taskData.endDate.getTime())
|
|
676
|
+
|| (!isNullOrUndefined(prevDuration) && prevDuration !== taskData.duration)
|
|
677
|
+
|| (!isNullOrUndefined(prevDuration) && prevDuration === taskData.duration &&
|
|
676
678
|
prevDurationUnit !== taskData.durationUnit)) {
|
|
677
679
|
isMoved = true;
|
|
678
680
|
}
|
|
@@ -785,6 +787,11 @@ var Edit = /** @class */ (function () {
|
|
|
785
787
|
this.parent.connectorLineEditModule.openValidationDialog(validateObject);
|
|
786
788
|
}
|
|
787
789
|
else {
|
|
790
|
+
if (this.parent.editModule && this.parent.editModule.dialogModule &&
|
|
791
|
+
this.parent.editModule.dialogModule['isEdit'] && this.predecessorUpdated) {
|
|
792
|
+
this.isValidatedEditedRecord = true;
|
|
793
|
+
this.parent.predecessorModule.validatePredecessor(args.data, [], '');
|
|
794
|
+
}
|
|
788
795
|
this.parent.connectorLineEditModule.applyPredecessorOption();
|
|
789
796
|
}
|
|
790
797
|
}
|
|
@@ -848,7 +855,10 @@ var Edit = /** @class */ (function () {
|
|
|
848
855
|
if (this.taskbarMoved) {
|
|
849
856
|
this.parent.editedTaskBarItem = ganttRecord;
|
|
850
857
|
}
|
|
851
|
-
this.
|
|
858
|
+
if (!this.isValidatedEditedRecord) {
|
|
859
|
+
this.parent.predecessorModule.validatePredecessor(ganttRecord, [], '');
|
|
860
|
+
}
|
|
861
|
+
this.isValidatedEditedRecord = false;
|
|
852
862
|
this.parent.predecessorModule.isValidatedParentTaskID = '';
|
|
853
863
|
}
|
|
854
864
|
if (this.parent.allowParentDependency && ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
|
|
@@ -2883,6 +2893,7 @@ var Edit = /** @class */ (function () {
|
|
|
2883
2893
|
var args = {};
|
|
2884
2894
|
args = this.constructTaskAddedEventArgs(cAddedRecord_1, this.parent.editedRecords, 'beforeAdd');
|
|
2885
2895
|
this.parent.trigger('actionBegin', args, function (args) {
|
|
2896
|
+
_this.parent.previousRecords = {};
|
|
2886
2897
|
if (!isNullOrUndefined(_this.parent.loadingIndicator) && _this.parent.loadingIndicator.indicatorType === "Shimmer") {
|
|
2887
2898
|
_this.parent.showMaskRow();
|
|
2888
2899
|
}
|
|
@@ -115,7 +115,7 @@ var PdfExport = /** @class */ (function () {
|
|
|
115
115
|
var format = new PdfTreeGridLayoutFormat();
|
|
116
116
|
format.break = PdfLayoutBreakType.FitElement;
|
|
117
117
|
var layouter = _this.gantt.drawGrid(pdfPage, 0, 0, format);
|
|
118
|
-
_this.gantt.drawChart(layouter);
|
|
118
|
+
_this.gantt.drawChart(layouter, pdfExportProperties);
|
|
119
119
|
if (!isMultipleExport) {
|
|
120
120
|
if (!_this.isBlob) {
|
|
121
121
|
// save the PDF
|
|
@@ -1651,7 +1651,8 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1651
1651
|
this.dependencyCancel = true;
|
|
1652
1652
|
}
|
|
1653
1653
|
if ((this.taskBarEditAction === 'ConnectorPointLeftDrag' ||
|
|
1654
|
-
this.taskBarEditAction === 'ConnectorPointRightDrag') && this.drawPredecessor
|
|
1654
|
+
this.taskBarEditAction === 'ConnectorPointRightDrag') && this.drawPredecessor && (!this.connectorSecondRecord.hasChildRecords ||
|
|
1655
|
+
this.connectorSecondRecord.hasChildRecords && this.parent.allowParentDependency)) {
|
|
1655
1656
|
this.parent.connectorLineEditModule.updatePredecessor(this.connectorSecondRecord, this.finalPredecessor);
|
|
1656
1657
|
if (this.parent.UpdateOffsetOnTaskbarEdit) {
|
|
1657
1658
|
this.parent.connectorLineEditModule['calculateOffset'](this.connectorSecondRecord);
|
|
@@ -1984,7 +1985,9 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1984
1985
|
}
|
|
1985
1986
|
this.showHideTaskBarEditingElements(element, this.highlightedSecondElement, true);
|
|
1986
1987
|
}
|
|
1987
|
-
if (isNullOrUndefined(this.connectorSecondAction) && !isNullOrUndefined(this.connectorSecondElement)
|
|
1988
|
+
if (isNullOrUndefined(this.connectorSecondAction) && !isNullOrUndefined(this.connectorSecondElement) &&
|
|
1989
|
+
(!this.connectorSecondRecord.hasChildRecords || this.connectorSecondRecord.hasChildRecords &&
|
|
1990
|
+
this.parent.allowParentDependency)) {
|
|
1988
1991
|
this.editTooltip.showHideTaskbarEditTooltip(false, this.segmentIndex);
|
|
1989
1992
|
removeClass([this.connectorSecondElement.querySelector('.' + cls.connectorPointLeft)], [cls.connectorPointAllowBlock]);
|
|
1990
1993
|
removeClass([this.connectorSecondElement.querySelector('.' + cls.connectorPointRight)], [cls.connectorPointAllowBlock]);
|
|
@@ -185,7 +185,7 @@ var DateProcessor = /** @class */ (function () {
|
|
|
185
185
|
else if (hour > this.parent.defaultStartTime && hour < this.parent.defaultEndTime) {
|
|
186
186
|
for (var i = 0; i < this.parent.workingTimeRanges.length; i++) {
|
|
187
187
|
var value = this.parent.workingTimeRanges[i];
|
|
188
|
-
if (hour
|
|
188
|
+
if (hour > value.to && (this.parent.workingTimeRanges[i + 1] &&
|
|
189
189
|
hour < this.parent.workingTimeRanges[i + 1].from)) {
|
|
190
190
|
this.setTime(this.parent.workingTimeRanges[i + 1].from, cloneDate);
|
|
191
191
|
break;
|
|
@@ -274,7 +274,7 @@ var GanttChart = /** @class */ (function () {
|
|
|
274
274
|
GanttChart.prototype.setVirtualHeight = function () {
|
|
275
275
|
if (this.parent.virtualScrollModule && this.parent.enableVirtualization) {
|
|
276
276
|
var wrapper = getValue('virtualTrack', this.parent.ganttChartModule.virtualRender);
|
|
277
|
-
wrapper.style.height = this.parent.treeGrid.element.getElementsByClassName('e-
|
|
277
|
+
wrapper.style.height = this.parent.treeGrid.element.getElementsByClassName('e-virtualtrack')[0].style.height;
|
|
278
278
|
var wrapper1 = getValue('wrapper', this.parent.ganttChartModule.virtualRender);
|
|
279
279
|
var treegridVirtualHeight = this.parent.treeGrid.element.getElementsByClassName('e-virtualtable')[0].style.transform;
|
|
280
280
|
wrapper1.style.transform = treegridVirtualHeight;
|
|
@@ -965,7 +965,13 @@ var GanttChart = /** @class */ (function () {
|
|
|
965
965
|
* @private
|
|
966
966
|
*/
|
|
967
967
|
GanttChart.prototype.getRecordByTaskBar = function (target) {
|
|
968
|
-
var item
|
|
968
|
+
var item;
|
|
969
|
+
if (this.parent.enableVirtualization && this.parent.enableMultiTaskbar) {
|
|
970
|
+
item = this.parent.flatData[this.getIndexByTaskBar(target)];
|
|
971
|
+
}
|
|
972
|
+
else {
|
|
973
|
+
item = this.parent.currentViewData[this.getIndexByTaskBar(target)];
|
|
974
|
+
}
|
|
969
975
|
return item;
|
|
970
976
|
};
|
|
971
977
|
/**
|
|
@@ -1323,7 +1329,12 @@ var GanttChart = /** @class */ (function () {
|
|
|
1323
1329
|
else {
|
|
1324
1330
|
var id = row.getAttribute('rowUniqueId');
|
|
1325
1331
|
var record = this.parent.getRecordByID(id);
|
|
1326
|
-
|
|
1332
|
+
if (this.parent.enableVirtualization && this.parent.enableMultiTaskbar) {
|
|
1333
|
+
recordIndex = this.parent.flatData.indexOf(record);
|
|
1334
|
+
}
|
|
1335
|
+
else {
|
|
1336
|
+
recordIndex = this.parent.currentViewData.indexOf(record);
|
|
1337
|
+
}
|
|
1327
1338
|
}
|
|
1328
1339
|
return recordIndex;
|
|
1329
1340
|
};
|
|
@@ -354,7 +354,7 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
354
354
|
(this.parent.taskMode === 'Manual') ? false :
|
|
355
355
|
data[taskSettings.manual] === true ? false : true;
|
|
356
356
|
this.parent.setRecordValue('ganttProperties', ganttProperties, ganttData);
|
|
357
|
-
if (!isNullOrUndefined(data[taskSettings.id])) {
|
|
357
|
+
if (!isNullOrUndefined(data[taskSettings.id]) && (!((this.parent.viewType === "ResourceView" && level == 0))) || data[taskSettings.name] === "Unassigned Task") {
|
|
358
358
|
id = data[taskSettings.id];
|
|
359
359
|
name = data[taskSettings.name];
|
|
360
360
|
this.addTaskData(ganttData, data, isLoad);
|
|
@@ -509,29 +509,53 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
509
509
|
startDate = this.checkStartDate(startDate, data.ganttProperties, false);
|
|
510
510
|
if (!isNullOrUndefined(duration)) {
|
|
511
511
|
endDate = this.getEndDate(startDate, duration, data.ganttProperties.durationUnit, data.ganttProperties, false);
|
|
512
|
+
if (taskSettings.duration) {
|
|
513
|
+
remainingDuration = data.ganttProperties.duration - sumOfDuration;
|
|
514
|
+
if (remainingDuration <= 0) {
|
|
515
|
+
continue;
|
|
516
|
+
}
|
|
517
|
+
duration = i === segments.length - 1 ? remainingDuration : remainingDuration > 0 &&
|
|
518
|
+
duration > remainingDuration ? remainingDuration : duration;
|
|
519
|
+
endDate = this.getEndDate(startDate, duration, data.ganttProperties.durationUnit, data.ganttProperties, false);
|
|
520
|
+
}
|
|
521
|
+
else if (!taskSettings.duration && taskSettings.endDate) {
|
|
522
|
+
endDate = (!isNullOrUndefined(data.ganttProperties.endDate)) && endDate.getTime() >
|
|
523
|
+
data.ganttProperties.endDate.getTime() && i !== segments.length - 1 ? endDate : data.ganttProperties.endDate;
|
|
524
|
+
duration = this.getDuration(startDate, endDate, data.ganttProperties.durationUnit, data.ganttProperties.isAutoSchedule, data.ganttProperties.isMilestone);
|
|
525
|
+
if (ganttSegments.length > 0 && endDate.getTime() < startDate.getTime()
|
|
526
|
+
&& endDate.getTime() <= data.ganttProperties.endDate.getTime()) {
|
|
527
|
+
ganttSegments[i - 1].duration = this.getDuration(ganttSegments[i - 1].startDate, data.ganttProperties.endDate, data.ganttProperties.durationUnit, data.ganttProperties.isAutoSchedule, data.ganttProperties.isMilestone);
|
|
528
|
+
continue;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
512
531
|
}
|
|
513
532
|
else {
|
|
514
533
|
endDate = this.getDateFromFormat(endDate);
|
|
534
|
+
if (endDate && (isNullOrUndefined(duration) || String(duration) === '')) {
|
|
535
|
+
if (endDate.getHours() === 0 && this.parent.defaultEndTime !== 86400) {
|
|
536
|
+
this.setTime(this.parent.defaultEndTime, endDate);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
515
539
|
endDate = this.checkEndDate(endDate, data.ganttProperties, false);
|
|
516
540
|
duration = this.getDuration(startDate, endDate, data.ganttProperties.durationUnit, data.ganttProperties.isAutoSchedule, data.ganttProperties.isMilestone);
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
541
|
+
if (taskSettings.duration) {
|
|
542
|
+
remainingDuration = data.ganttProperties.duration - sumOfDuration - 1;
|
|
543
|
+
if (remainingDuration <= 0) {
|
|
544
|
+
continue;
|
|
545
|
+
}
|
|
546
|
+
duration = i === segments.length - 1 ? remainingDuration : remainingDuration > 0 &&
|
|
547
|
+
duration > remainingDuration ? remainingDuration : duration;
|
|
548
|
+
endDate = this.getEndDate(startDate, duration, data.ganttProperties.durationUnit, data.ganttProperties, false);
|
|
522
549
|
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
&& endDate.getTime() <= data.ganttProperties.endDate.getTime()) {
|
|
533
|
-
ganttSegments[i - 1].duration = this.getDuration(ganttSegments[i - 1].startDate, data.ganttProperties.endDate, data.ganttProperties.durationUnit, data.ganttProperties.isAutoSchedule, data.ganttProperties.isMilestone);
|
|
534
|
-
continue;
|
|
550
|
+
else if (!taskSettings.duration && taskSettings.endDate) {
|
|
551
|
+
endDate = (!isNullOrUndefined(data.ganttProperties.endDate)) && endDate.getTime() >
|
|
552
|
+
data.ganttProperties.endDate.getTime() && i !== segments.length - 1 ? endDate : data.ganttProperties.endDate;
|
|
553
|
+
duration = this.getDuration(startDate, endDate, data.ganttProperties.durationUnit, data.ganttProperties.isAutoSchedule, data.ganttProperties.isMilestone);
|
|
554
|
+
if (ganttSegments.length > 0 && endDate.getTime() < startDate.getTime()
|
|
555
|
+
&& endDate.getTime() <= data.ganttProperties.endDate.getTime()) {
|
|
556
|
+
ganttSegments[i - 1].duration = this.getDuration(ganttSegments[i - 1].startDate, data.ganttProperties.endDate, data.ganttProperties.durationUnit, data.ganttProperties.isAutoSchedule, data.ganttProperties.isMilestone);
|
|
557
|
+
continue;
|
|
558
|
+
}
|
|
535
559
|
}
|
|
536
560
|
}
|
|
537
561
|
segment = {};
|
|
@@ -773,7 +797,7 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
773
797
|
startDate = this.getDateFromFormat(data[taskSettings.startDate], true);
|
|
774
798
|
endDate = this.getDateFromFormat(data[taskSettings.endDate], true);
|
|
775
799
|
}
|
|
776
|
-
var segments = taskSettings.segments ? (data[taskSettings.segments] ||
|
|
800
|
+
var segments = taskSettings.segments && (!isNullOrUndefined(data[taskSettings.segments]) || !isNullOrUndefined(ganttData.taskData)) ? (data[taskSettings.segments] ||
|
|
777
801
|
ganttData.taskData[taskSettings.segments]) : null;
|
|
778
802
|
var isMileStone = taskSettings.milestone ? data[taskSettings.milestone] ? true : false : false;
|
|
779
803
|
var durationMapping = data[taskSettings.durationUnit] ? data[taskSettings.durationUnit] : '';
|
|
@@ -1600,6 +1624,9 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
1600
1624
|
return resourceIdCollection;
|
|
1601
1625
|
}
|
|
1602
1626
|
resourceIdCollection = data[this.parent.taskFields.resourceInfo];
|
|
1627
|
+
if (resourceIdCollection != "" && typeof resourceIdCollection == "string") {
|
|
1628
|
+
resourceIdCollection = resourceIdCollection.split(',');
|
|
1629
|
+
}
|
|
1603
1630
|
var resourceData;
|
|
1604
1631
|
if (!isNullOrUndefined(this.parent.editModule) && !isNullOrUndefined(this.parent.editModule.dialogModule)
|
|
1605
1632
|
&& this.parent.editModule.dialogModule.isAddNewResource) {
|
|
@@ -1609,6 +1636,7 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
1609
1636
|
resourceData = this.parent.resources;
|
|
1610
1637
|
}
|
|
1611
1638
|
var resourceIDMapping = this.parent.resourceFields.id;
|
|
1639
|
+
var resourceNameMapping = this.parent.resourceFields.name;
|
|
1612
1640
|
var resourceUnitMapping = this.parent.resourceFields.unit;
|
|
1613
1641
|
var resourceGroup = this.parent.resourceFields.group;
|
|
1614
1642
|
var resources = [];
|
|
@@ -1619,7 +1647,7 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
1619
1647
|
return true;
|
|
1620
1648
|
}
|
|
1621
1649
|
else {
|
|
1622
|
-
return (resourceIdCollection[count] === resourceInfo[resourceIDMapping]);
|
|
1650
|
+
return (resourceIdCollection[count] === resourceInfo[resourceIDMapping]) || (resourceIdCollection[count] === resourceInfo[resourceNameMapping]);
|
|
1623
1651
|
}
|
|
1624
1652
|
});
|
|
1625
1653
|
var ganttDataResource = extend({}, resource[0]);
|
|
@@ -2361,6 +2389,9 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
2361
2389
|
}
|
|
2362
2390
|
}
|
|
2363
2391
|
this.parent.setRecordValue('isMilestone', milestone, parentProp, true);
|
|
2392
|
+
if (!isNullOrUndefined(this.parent.taskFields.milestone)) {
|
|
2393
|
+
this.updateMappingData(parentData, 'milestone');
|
|
2394
|
+
}
|
|
2364
2395
|
if (parentProp.isAutoSchedule) {
|
|
2365
2396
|
this.calculateDuration(parentData);
|
|
2366
2397
|
}
|
|
@@ -456,7 +456,7 @@ var GanttTreeGrid = /** @class */ (function () {
|
|
|
456
456
|
this.parent.columnByField = {};
|
|
457
457
|
this.parent.customColumns = [];
|
|
458
458
|
var tasksMapping = ['id', 'name', 'startDate', 'endDate', 'duration', 'dependency',
|
|
459
|
-
'progress', 'baselineStartDate', 'baselineEndDate', 'resourceInfo', 'notes', 'work', 'manual', 'type'];
|
|
459
|
+
'progress', 'baselineStartDate', 'baselineEndDate', 'resourceInfo', 'notes', 'work', 'manual', 'type', 'milestone'];
|
|
460
460
|
var _loop_1 = function (i) {
|
|
461
461
|
var column = {};
|
|
462
462
|
if (typeof ganttObj.columns[i] === 'string') {
|
|
@@ -803,7 +803,7 @@ var GanttTreeGrid = /** @class */ (function () {
|
|
|
803
803
|
}
|
|
804
804
|
}; // eslint-disable-next-line
|
|
805
805
|
GanttTreeGrid.prototype.durationValueAccessor = function (field, data, column) {
|
|
806
|
-
var ganttProp = data.ganttProperties;
|
|
806
|
+
var ganttProp = (!isNullOrUndefined(data)) ? data.ganttProperties : null;
|
|
807
807
|
if (!isNullOrUndefined(ganttProp)) {
|
|
808
808
|
return this.parent.dataOperation.getDurationString(ganttProp.duration, ganttProp.durationUnit);
|
|
809
809
|
}
|
|
@@ -469,6 +469,9 @@ var ExportHelper = /** @class */ (function () {
|
|
|
469
469
|
footer.graphics.drawRectangle(pen, footerBrush, 0, 0, pdfDoc.pageSettings.width, 35);
|
|
470
470
|
/* eslint-disable-next-line */
|
|
471
471
|
var font = new PdfStandardFont(this.ganttStyle.fontFamily, this.ganttStyle.footer.fontSize, this.ganttStyle.footer.fontStyle);
|
|
472
|
+
if (this.ganttStyle.font) {
|
|
473
|
+
font = this.ganttStyle.font;
|
|
474
|
+
}
|
|
472
475
|
var brush = new PdfSolidBrush(this.ganttStyle.footer.fontColor);
|
|
473
476
|
var pageNumber = new PdfPageNumberField(font);
|
|
474
477
|
var count = new PdfPageCountField(font, brush);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PdfColor } from '@syncfusion/ej2-pdf-export';
|
|
2
|
-
import { IGanttStyle } from './../base/interface';
|
|
2
|
+
import { IGanttStyle, PdfExportProperties } from './../base/interface';
|
|
3
3
|
import { Gantt } from './../base/gantt';
|
|
4
4
|
import { PdfGantt } from './pdf-gantt';
|
|
5
5
|
/**
|
|
@@ -21,13 +21,14 @@ export declare class PdfGanttPredecessor {
|
|
|
21
21
|
pdfGantt?: PdfGantt;
|
|
22
22
|
parent?: Gantt;
|
|
23
23
|
ganttStyle: IGanttStyle;
|
|
24
|
+
pdfExportProperties: PdfExportProperties;
|
|
24
25
|
/**
|
|
25
26
|
* @returns {PdfGanttPredecessor} .
|
|
26
27
|
* @hidden
|
|
27
28
|
*/
|
|
28
29
|
add(): PdfGanttPredecessor;
|
|
29
30
|
constructor(parent?: Gantt, pdfGantt?: PdfGantt);
|
|
30
|
-
findindex(num: number): number;
|
|
31
|
+
findindex(num: number, pdfExportProperties: PdfExportProperties): number;
|
|
31
32
|
/**
|
|
32
33
|
* Calculate the predecesor line point and draw the predecessor
|
|
33
34
|
*
|
|
@@ -35,7 +36,7 @@ export declare class PdfGanttPredecessor {
|
|
|
35
36
|
* @returns {void}
|
|
36
37
|
* @private
|
|
37
38
|
*/
|
|
38
|
-
drawPredecessor(pdfGantt: PdfGantt): void;
|
|
39
|
+
drawPredecessor(pdfGantt: PdfGantt, pdfExportProperties: PdfExportProperties): void;
|
|
39
40
|
/**
|
|
40
41
|
* Method to draw the predecessor lines with calculated connector points
|
|
41
42
|
*
|
|
@@ -27,11 +27,22 @@ var PdfGanttPredecessor = /** @class */ (function () {
|
|
|
27
27
|
PdfGanttPredecessor.prototype.add = function () {
|
|
28
28
|
return new PdfGanttPredecessor(this.parent);
|
|
29
29
|
};
|
|
30
|
-
PdfGanttPredecessor.prototype.findindex = function (num) {
|
|
30
|
+
PdfGanttPredecessor.prototype.findindex = function (num, pdfExportProperties) {
|
|
31
31
|
var dataindex;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
if (pdfExportProperties.exportType === 'CurrentViewData') {
|
|
33
|
+
this.parent.currentViewData.map(function (data, index) {
|
|
34
|
+
if (data.index == num) {
|
|
35
|
+
dataindex = index;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
this.parent.flatData.map(function (data, index) {
|
|
41
|
+
if (data.index == num) {
|
|
42
|
+
dataindex = index;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
35
46
|
return dataindex;
|
|
36
47
|
};
|
|
37
48
|
/**
|
|
@@ -41,11 +52,11 @@ var PdfGanttPredecessor = /** @class */ (function () {
|
|
|
41
52
|
* @returns {void}
|
|
42
53
|
* @private
|
|
43
54
|
*/
|
|
44
|
-
PdfGanttPredecessor.prototype.drawPredecessor = function (pdfGantt) {
|
|
55
|
+
PdfGanttPredecessor.prototype.drawPredecessor = function (pdfGantt, pdfExportProperties) {
|
|
45
56
|
this.pdfGantt = pdfGantt;
|
|
46
57
|
var pages = pdfGantt.result.page.section.getPages();
|
|
47
|
-
var parentTask = pdfGantt.taskbarCollection[this.findindex(this.parentIndex)];
|
|
48
|
-
var childTask = pdfGantt.taskbarCollection[this.findindex(this.childIndex)];
|
|
58
|
+
var parentTask = pdfGantt.taskbarCollection[this.findindex(this.parentIndex, pdfExportProperties)];
|
|
59
|
+
var childTask = pdfGantt.taskbarCollection[this.findindex(this.childIndex, pdfExportProperties)];
|
|
49
60
|
var startPage = new PdfPage();
|
|
50
61
|
var endPage = new PdfPage();
|
|
51
62
|
var predecessorType = '';
|
|
@@ -55,7 +66,7 @@ var PdfGanttPredecessor = /** @class */ (function () {
|
|
|
55
66
|
var childY = 0;
|
|
56
67
|
switch (this.type) {
|
|
57
68
|
case 'FS':
|
|
58
|
-
if (childTask.startPage > -1 && parentTask.endPage > -1) {
|
|
69
|
+
if ((!isNullOrUndefined(childTask) && childTask.startPage > -1) && (!isNullOrUndefined(parentTask) && parentTask.endPage > -1)) {
|
|
59
70
|
startPage = pages[parentTask.endPage];
|
|
60
71
|
endPage = pages[childTask.startPage];
|
|
61
72
|
parentPageData = pdfGantt.pdfPageDetail[parentTask.endPage - pdfGantt.chartPageIndex];
|
|
@@ -82,7 +93,7 @@ var PdfGanttPredecessor = /** @class */ (function () {
|
|
|
82
93
|
}
|
|
83
94
|
break;
|
|
84
95
|
case 'SF':
|
|
85
|
-
if (childTask.endPage > -1 && parentTask.startPage > -1) {
|
|
96
|
+
if ((!isNullOrUndefined(childTask) && childTask.endPage > -1) && (!isNullOrUndefined(parentTask) && parentTask.startPage > -1)) {
|
|
86
97
|
startPage = pages[parentTask.startPage];
|
|
87
98
|
endPage = pages[childTask.endPage];
|
|
88
99
|
parentPageData = pdfGantt.pdfPageDetail[parentTask.endPage - pdfGantt.chartPageIndex];
|
|
@@ -109,7 +120,7 @@ var PdfGanttPredecessor = /** @class */ (function () {
|
|
|
109
120
|
}
|
|
110
121
|
break;
|
|
111
122
|
case 'FF':
|
|
112
|
-
if (childTask.endPage > -1 && parentTask.endPage > -1) {
|
|
123
|
+
if ((!isNullOrUndefined(childTask) && childTask.endPage > -1) && (!isNullOrUndefined(parentTask) && parentTask.endPage > -1)) {
|
|
113
124
|
startPage = pages[parentTask.endPage];
|
|
114
125
|
endPage = pages[childTask.endPage];
|
|
115
126
|
parentPageData = pdfGantt.pdfPageDetail[parentTask.endPage - pdfGantt.chartPageIndex];
|
|
@@ -136,7 +147,7 @@ var PdfGanttPredecessor = /** @class */ (function () {
|
|
|
136
147
|
}
|
|
137
148
|
break;
|
|
138
149
|
case 'SS':
|
|
139
|
-
if (childTask.startPage > -1 && parentTask.startPage > -1) {
|
|
150
|
+
if ((!isNullOrUndefined(childTask) && childTask.startPage > -1) && (!isNullOrUndefined(parentTask) && parentTask.startPage > -1)) {
|
|
140
151
|
startPage = pages[parentTask.startPage];
|
|
141
152
|
endPage = pages[childTask.startPage];
|
|
142
153
|
parentPageData = pdfGantt.pdfPageDetail[parentTask.startPage - pdfGantt.chartPageIndex];
|
|
@@ -3,6 +3,7 @@ import { PageDetail } from '../base/interface';
|
|
|
3
3
|
import { PdfLayoutResult, PdfColor } from '@syncfusion/ej2-pdf-export';
|
|
4
4
|
import { Gantt } from '../base/gantt';
|
|
5
5
|
import { PdfTreeGrid } from './pdf-treegrid';
|
|
6
|
+
import { PdfExportProperties } from '../base/interface';
|
|
6
7
|
import { PdfTimeline } from './pdf-timeline';
|
|
7
8
|
import { PdfGanttPredecessor } from './pdf-connector-line';
|
|
8
9
|
/**
|
|
@@ -28,7 +29,7 @@ export declare class PdfGantt extends PdfTreeGrid {
|
|
|
28
29
|
parent: Gantt;
|
|
29
30
|
constructor(parent: Gantt);
|
|
30
31
|
readonly taskbar: PdfGanttTaskbarCollection;
|
|
31
|
-
drawChart(result: PdfLayoutResult): void;
|
|
32
|
+
drawChart(result: PdfLayoutResult, pdfExportProperties: PdfExportProperties): void;
|
|
32
33
|
private calculateRange;
|
|
33
34
|
private drawPageBorder;
|
|
34
35
|
private drawGantttChart;
|
|
@@ -56,12 +56,12 @@ var PdfGantt = /** @class */ (function (_super) {
|
|
|
56
56
|
enumerable: true,
|
|
57
57
|
configurable: true
|
|
58
58
|
});
|
|
59
|
-
PdfGantt.prototype.drawChart = function (result) {
|
|
59
|
+
PdfGantt.prototype.drawChart = function (result, pdfExportProperties) {
|
|
60
60
|
this.result = result;
|
|
61
61
|
this.totalPages = this.result.page.section.count;
|
|
62
62
|
this.perColumnPages = this.totalPages / this.layouter.columnRanges.length;
|
|
63
63
|
this.calculateRange();
|
|
64
|
-
this.drawGantttChart();
|
|
64
|
+
this.drawGantttChart(pdfExportProperties);
|
|
65
65
|
this.drawPageBorder();
|
|
66
66
|
};
|
|
67
67
|
//Calcualte the header range for each pdf page based on schedule start and end date.
|
|
@@ -210,7 +210,7 @@ var PdfGantt = /** @class */ (function (_super) {
|
|
|
210
210
|
}
|
|
211
211
|
};
|
|
212
212
|
//Draw the gantt chart side
|
|
213
|
-
PdfGantt.prototype.drawGantttChart = function () {
|
|
213
|
+
PdfGantt.prototype.drawGantttChart = function (pdfExportProperties) {
|
|
214
214
|
var _this = this;
|
|
215
215
|
var taskbarPoint = this.startPoint;
|
|
216
216
|
var pagePoint = new PointF();
|
|
@@ -286,7 +286,7 @@ var PdfGantt = /** @class */ (function (_super) {
|
|
|
286
286
|
// Draw predecessor line.
|
|
287
287
|
for (var i = 0; i < this.predecessorCollection.length; i++) {
|
|
288
288
|
var predecessor = this.predecessorCollection[i];
|
|
289
|
-
predecessor.drawPredecessor(this);
|
|
289
|
+
predecessor.drawPredecessor(this, pdfExportProperties);
|
|
290
290
|
}
|
|
291
291
|
};
|
|
292
292
|
return PdfGantt;
|
|
@@ -279,6 +279,7 @@ export declare class ChartRows extends DateProcessor {
|
|
|
279
279
|
* @private
|
|
280
280
|
*/
|
|
281
281
|
refreshRow(index: number, isValidateRange?: boolean): void;
|
|
282
|
+
private updateResourceTaskbarElement;
|
|
282
283
|
private getResourceParent;
|
|
283
284
|
/**
|
|
284
285
|
* To refresh all edited records
|