@syncfusion/ej2-gantt 22.2.11 → 23.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +195 -163
- 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 +1003 -292
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +1040 -313
- 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 +21 -21
- package/src/gantt/actions/cell-edit.js +4 -1
- package/src/gantt/actions/context-menu.js +4 -1
- package/src/gantt/actions/critical-path.d.ts +2 -0
- package/src/gantt/actions/critical-path.js +81 -59
- package/src/gantt/actions/dependency.d.ts +1 -0
- package/src/gantt/actions/dependency.js +43 -25
- package/src/gantt/actions/dialog-edit.js +27 -7
- package/src/gantt/actions/edit.d.ts +12 -1
- package/src/gantt/actions/edit.js +91 -10
- package/src/gantt/actions/filter.js +3 -0
- package/src/gantt/actions/pdf-export.d.ts +4 -1
- package/src/gantt/actions/pdf-export.js +36 -3
- package/src/gantt/actions/rowdragdrop.js +10 -2
- package/src/gantt/actions/selection.js +22 -5
- package/src/gantt/actions/taskbar-edit.js +51 -36
- package/src/gantt/actions/toolbar.js +8 -0
- package/src/gantt/base/date-processor.js +3 -3
- package/src/gantt/base/gantt-chart.d.ts +1 -0
- package/src/gantt/base/gantt-chart.js +79 -6
- package/src/gantt/base/gantt-model.d.ts +7 -0
- package/src/gantt/base/gantt.d.ts +6 -0
- package/src/gantt/base/gantt.js +83 -13
- package/src/gantt/base/interface.d.ts +14 -0
- package/src/gantt/base/task-processor.d.ts +4 -4
- package/src/gantt/base/task-processor.js +86 -36
- package/src/gantt/base/tree-grid.js +19 -10
- package/src/gantt/export/export-helper.d.ts +5 -1
- package/src/gantt/export/export-helper.js +152 -4
- package/src/gantt/export/pdf-base/pdf-grid-table.js +2 -2
- package/src/gantt/export/pdf-base/pdf-style/gantt-theme.js +8 -0
- package/src/gantt/export/pdf-base/treegrid-layouter.js +6 -1
- package/src/gantt/export/pdf-connector-line.js +3 -1
- package/src/gantt/export/pdf-gantt.js +6 -0
- package/src/gantt/export/pdf-taskbar.d.ts +13 -0
- package/src/gantt/export/pdf-taskbar.js +39 -5
- package/src/gantt/export/pdf-timeline.js +17 -8
- package/src/gantt/export/pdf-treegrid.js +3 -0
- package/src/gantt/models/task-fields-model.d.ts +7 -0
- package/src/gantt/models/task-fields.d.ts +6 -0
- package/src/gantt/models/task-fields.js +3 -0
- package/src/gantt/renderer/chart-rows.d.ts +1 -1
- package/src/gantt/renderer/chart-rows.js +39 -20
- package/src/gantt/renderer/connector-line.js +49 -9
- package/src/gantt/renderer/edit-tooltip.js +11 -7
- package/src/gantt/renderer/timeline.js +19 -9
- package/src/gantt/renderer/tooltip.js +37 -33
- package/styles/bootstrap-dark.css +44 -100
- package/styles/bootstrap.css +44 -100
- package/styles/bootstrap4.css +44 -100
- package/styles/bootstrap5-dark.css +44 -100
- package/styles/bootstrap5.css +44 -100
- package/styles/fabric-dark.css +44 -100
- package/styles/fabric.css +44 -100
- package/styles/fluent-dark.css +44 -100
- package/styles/fluent.css +44 -100
- package/styles/gantt/_layout.scss +44 -31
- package/styles/gantt/_theme.scss +104 -98
- package/styles/gantt/bootstrap-dark.css +44 -100
- package/styles/gantt/bootstrap-dark.scss +1 -1
- package/styles/gantt/bootstrap.css +44 -100
- package/styles/gantt/bootstrap.scss +1 -1
- package/styles/gantt/bootstrap4.css +44 -100
- package/styles/gantt/bootstrap4.scss +1 -1
- package/styles/gantt/bootstrap5-dark.css +44 -100
- package/styles/gantt/bootstrap5-dark.scss +1 -1
- package/styles/gantt/bootstrap5.css +44 -100
- package/styles/gantt/bootstrap5.scss +1 -1
- package/styles/gantt/fabric-dark.css +44 -100
- package/styles/gantt/fabric-dark.scss +1 -1
- package/styles/gantt/fabric.css +44 -100
- package/styles/gantt/fabric.scss +1 -1
- package/styles/gantt/fluent-dark.css +44 -100
- package/styles/gantt/fluent-dark.scss +1 -1
- package/styles/gantt/fluent.css +44 -100
- package/styles/gantt/fluent.scss +1 -1
- package/styles/gantt/highcontrast-light.css +40 -100
- package/styles/gantt/highcontrast-light.scss +1 -1
- package/styles/gantt/highcontrast.css +44 -100
- package/styles/gantt/highcontrast.scss +1 -1
- package/styles/gantt/icons/_bootstrap-dark.scss +4 -0
- package/styles/gantt/icons/_bootstrap.scss +4 -0
- package/styles/gantt/icons/_bootstrap4.scss +4 -0
- package/styles/gantt/icons/_bootstrap5.scss +4 -0
- package/styles/gantt/icons/_fabric-dark.scss +4 -0
- package/styles/gantt/icons/_fabric.scss +4 -0
- package/styles/gantt/icons/_fluent.scss +4 -0
- package/styles/gantt/icons/_fusionnew.scss +4 -0
- package/styles/gantt/icons/_highcontrast.scss +4 -0
- package/styles/gantt/icons/_material-dark.scss +4 -0
- package/styles/gantt/icons/_material.scss +4 -0
- package/styles/gantt/icons/_material3.scss +4 -0
- package/styles/gantt/icons/_tailwind-dark.scss +4 -0
- package/styles/gantt/icons/_tailwind.scss +4 -0
- package/styles/gantt/material-dark.css +44 -101
- package/styles/gantt/material-dark.scss +1 -1
- package/styles/gantt/material.css +44 -101
- package/styles/gantt/material.scss +1 -1
- package/styles/gantt/material3-dark.css +45 -102
- package/styles/gantt/material3-dark.scss +1 -1
- package/styles/gantt/material3.css +45 -102
- package/styles/gantt/material3.scss +1 -1
- package/styles/gantt/tailwind-dark.css +44 -101
- package/styles/gantt/tailwind-dark.scss +1 -1
- package/styles/gantt/tailwind.css +44 -101
- package/styles/gantt/tailwind.scss +1 -1
- package/styles/highcontrast-light.css +40 -100
- package/styles/highcontrast.css +44 -100
- package/styles/material-dark.css +44 -101
- package/styles/material.css +44 -101
- package/styles/material3-dark.css +45 -102
- package/styles/material3-dark.scss +1 -1
- package/styles/material3.css +45 -102
- package/styles/material3.scss +1 -1
- package/styles/tailwind-dark.css +44 -101
- package/styles/tailwind.css +44 -101
|
@@ -87,7 +87,9 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
87
87
|
dataManager.executeQuery(queryManager).then(function (e) {
|
|
88
88
|
_this.dataArray = e.result;
|
|
89
89
|
_this.processTimeline();
|
|
90
|
-
_this.
|
|
90
|
+
if (_this.parent.loadChildOnDemand || (!_this.parent.loadChildOnDemand && !(_this.parent.taskFields.hasChildMapping))) {
|
|
91
|
+
_this.cloneDataSource();
|
|
92
|
+
}
|
|
91
93
|
_this.parent.renderGantt(isChange);
|
|
92
94
|
}).catch(function (e) {
|
|
93
95
|
// Trigger action failure event
|
|
@@ -126,6 +128,9 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
126
128
|
var data = [];
|
|
127
129
|
for (var i = 0; i < this.dataArray.length; i++) {
|
|
128
130
|
var tempData = this.dataArray[i];
|
|
131
|
+
if (tempData['parentItem']) {
|
|
132
|
+
delete tempData['parentItem'];
|
|
133
|
+
}
|
|
129
134
|
data.push(extend({}, {}, tempData, true));
|
|
130
135
|
if (!isNullOrUndefined(tempData[taskIdMapping])) {
|
|
131
136
|
this.taskIds.push(tempData[taskIdMapping].toString());
|
|
@@ -135,7 +140,12 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
135
140
|
this.parent.setProperties({ taskFields: { child: 'Children' } }, true);
|
|
136
141
|
}
|
|
137
142
|
this.constructDataSource(data);
|
|
138
|
-
|
|
143
|
+
if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping && this.hierarchyData.length === 0) {
|
|
144
|
+
hierarchicalData = this.dataArray;
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
hierarchicalData = this.hierarchyData;
|
|
148
|
+
}
|
|
139
149
|
}
|
|
140
150
|
else {
|
|
141
151
|
hierarchicalData = this.dataArray;
|
|
@@ -357,7 +367,12 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
357
367
|
if (!isNullOrUndefined(data[taskSettings.id])) {
|
|
358
368
|
id = data[taskSettings.id];
|
|
359
369
|
name = data[taskSettings.name];
|
|
360
|
-
this.
|
|
370
|
+
if (!this.parent.loadChildOnDemand && taskSettings.hasChildMapping && data['taskData']) {
|
|
371
|
+
ganttData['taskData'] = data['taskData'];
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
this.addTaskData(ganttData, data, isLoad);
|
|
375
|
+
}
|
|
361
376
|
}
|
|
362
377
|
else if (!isNullOrUndefined(data[resourceFields.id])) {
|
|
363
378
|
id = data[resourceFields.id];
|
|
@@ -395,6 +410,9 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
395
410
|
this.parent.setRecordValue('notes', notes, ganttProperties, true);
|
|
396
411
|
this.parent.setRecordValue('cssClass', data[taskSettings.cssClass], ganttProperties, true);
|
|
397
412
|
this.parent.setRecordValue('parentItem', this.getCloneParent(parentItem), ganttData);
|
|
413
|
+
if (!this.parent.loadChildOnDemand && taskSettings.hasChildMapping && this.parent.currentViewData.length > 0) {
|
|
414
|
+
this.parent.setRecordValue('parentItem', ganttData.parentItem, this.parent.currentViewData[this.taskIds.indexOf(data[taskSettings.id].toString())]);
|
|
415
|
+
}
|
|
398
416
|
var parentUniqId = ganttData.parentItem ? ganttData.parentItem.uniqueID : null;
|
|
399
417
|
this.parent.setRecordValue('parentUniqueID', parentUniqId, ganttData);
|
|
400
418
|
if (this.parent.viewType === 'ResourceView' && !isNullOrUndefined(taskSettings.parentID)
|
|
@@ -402,7 +420,12 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
402
420
|
this.parent.setRecordValue('parentId', ganttData.parentItem.taskId, ganttProperties, true);
|
|
403
421
|
}
|
|
404
422
|
this.parent.setRecordValue('level', level, ganttData);
|
|
405
|
-
|
|
423
|
+
if (!this.parent.loadChildOnDemand && taskSettings.hasChildMapping && data['uniqueID']) {
|
|
424
|
+
this.parent.setRecordValue('uniqueID', data['uniqueID'], ganttData);
|
|
425
|
+
}
|
|
426
|
+
else {
|
|
427
|
+
this.parent.setRecordValue('uniqueID', getUid(this.parent.element.id + '_data_'), ganttData);
|
|
428
|
+
}
|
|
406
429
|
this.parent.setRecordValue('uniqueID', ganttData.uniqueID, ganttProperties, true);
|
|
407
430
|
this.parent.setRecordValue('childRecords', [], ganttData);
|
|
408
431
|
if (this.parent.dataSource instanceof Object && isCountRequired(this.parent) &&
|
|
@@ -417,7 +440,12 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
417
440
|
}
|
|
418
441
|
}
|
|
419
442
|
else {
|
|
420
|
-
this.parent.
|
|
443
|
+
if (!this.parent.loadChildOnDemand && taskSettings.hasChildMapping && ganttData.taskData[taskSettings.hasChildMapping]) {
|
|
444
|
+
this.parent.setRecordValue('hasChildRecords', true, ganttData);
|
|
445
|
+
}
|
|
446
|
+
else {
|
|
447
|
+
this.parent.setRecordValue('hasChildRecords', false, ganttData);
|
|
448
|
+
}
|
|
421
449
|
}
|
|
422
450
|
if (ganttData.hasChildRecords) {
|
|
423
451
|
this.parent.setRecordValue('autoStartDate', ganttData.ganttProperties.startDate, ganttProperties);
|
|
@@ -1030,7 +1058,12 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
1030
1058
|
}
|
|
1031
1059
|
else {
|
|
1032
1060
|
this.updateDurationValue(duration, ganttProperties);
|
|
1033
|
-
this.
|
|
1061
|
+
if (this.parent.autoCalculateDateScheduling) {
|
|
1062
|
+
this.calculateEndDate(ganttData);
|
|
1063
|
+
}
|
|
1064
|
+
else {
|
|
1065
|
+
this.parent.setRecordValue('endDate', endDate, ganttProperties, true);
|
|
1066
|
+
}
|
|
1034
1067
|
}
|
|
1035
1068
|
};
|
|
1036
1069
|
/**
|
|
@@ -1528,17 +1561,15 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
1528
1561
|
else {
|
|
1529
1562
|
hierarchicalData = this.parent.dataSource;
|
|
1530
1563
|
}
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
if (
|
|
1534
|
-
|
|
1535
|
-
task[_this.parent.taskFields.endDate] = record[_this.parent.taskFields.endDate];
|
|
1536
|
-
}
|
|
1537
|
-
if (!isNullOrUndefined(_this.parent.taskFields.endDate)) {
|
|
1538
|
-
task[_this.parent.taskFields.endDate] = record[_this.parent.taskFields.endDate];
|
|
1539
|
-
}
|
|
1564
|
+
hierarchicalData.map(function (record) {
|
|
1565
|
+
if (task.ganttProperties.taskId === record[_this.parent.taskFields.id]) {
|
|
1566
|
+
if (!isNullOrUndefined(_this.parent.taskFields.startDate)) {
|
|
1567
|
+
task[_this.parent.taskFields.startDate] = record[_this.parent.taskFields.startDate];
|
|
1540
1568
|
}
|
|
1541
|
-
|
|
1569
|
+
if (!isNullOrUndefined(_this.parent.taskFields.endDate)) {
|
|
1570
|
+
task[_this.parent.taskFields.endDate] = record[_this.parent.taskFields.endDate];
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1542
1573
|
});
|
|
1543
1574
|
};
|
|
1544
1575
|
TaskProcessor.prototype.getWorkInHour = function (work, workUnit) {
|
|
@@ -1580,7 +1611,9 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
1580
1611
|
this.setRecordDate(ganttData, ganttProperties.endDate, dataMapping.endDate);
|
|
1581
1612
|
}
|
|
1582
1613
|
if (dataMapping.duration) {
|
|
1583
|
-
|
|
1614
|
+
if (!isNullOrUndefined(dataMapping.milestone) && !ganttData.taskData[dataMapping.milestone]) {
|
|
1615
|
+
this.setRecordDuration(ganttData, dataMapping.duration);
|
|
1616
|
+
}
|
|
1584
1617
|
}
|
|
1585
1618
|
if (dataMapping.durationUnit) {
|
|
1586
1619
|
data[dataMapping.durationUnit] = ganttProperties.durationUnit;
|
|
@@ -1815,7 +1848,7 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
1815
1848
|
*/
|
|
1816
1849
|
TaskProcessor.prototype.updateDurationValue = function (duration, ganttProperties) {
|
|
1817
1850
|
var tempDuration = this.getDurationValue(duration);
|
|
1818
|
-
if (!isNaN(getValue('duration', tempDuration))) {
|
|
1851
|
+
if (!isNaN(getValue('duration', tempDuration)) && !(this.parent.viewType === "ResourceView" && tempDuration["duration"] === 0)) {
|
|
1819
1852
|
this.parent.setRecordValue('duration', getValue('duration', tempDuration), ganttProperties, true);
|
|
1820
1853
|
}
|
|
1821
1854
|
if (!isNullOrUndefined(getValue('durationUnit', tempDuration))) {
|
|
@@ -2200,7 +2233,14 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
2200
2233
|
* @private
|
|
2201
2234
|
*/
|
|
2202
2235
|
TaskProcessor.prototype.reUpdateGanttDataPosition = function () {
|
|
2203
|
-
var flatData
|
|
2236
|
+
var flatData;
|
|
2237
|
+
if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps &&
|
|
2238
|
+
this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
2239
|
+
flatData = this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData'];
|
|
2240
|
+
}
|
|
2241
|
+
else {
|
|
2242
|
+
flatData = this.parent.flatData;
|
|
2243
|
+
}
|
|
2204
2244
|
var length = flatData.length;
|
|
2205
2245
|
for (var i = 0; i < length; i++) {
|
|
2206
2246
|
var data = flatData[i];
|
|
@@ -2327,6 +2367,7 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
2327
2367
|
* @private
|
|
2328
2368
|
*/
|
|
2329
2369
|
TaskProcessor.prototype.updateParentItems = function (cloneParent, isParent) {
|
|
2370
|
+
var _this = this;
|
|
2330
2371
|
var parentData = isParent ? cloneParent : this.parent.getParentTask(cloneParent);
|
|
2331
2372
|
var deleteUpdate = false;
|
|
2332
2373
|
var ganttProp = parentData.ganttProperties;
|
|
@@ -2335,8 +2376,8 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
2335
2376
|
var previousStartDate = ganttProp.isAutoSchedule ? ganttProp.startDate : ganttProp.autoStartDate;
|
|
2336
2377
|
var previousEndDate = ganttProp.isAutoSchedule ? ganttProp.endDate :
|
|
2337
2378
|
ganttProp.autoEndDate;
|
|
2338
|
-
var
|
|
2339
|
-
var childLength =
|
|
2379
|
+
var childRecords_1 = parentData.childRecords;
|
|
2380
|
+
var childLength = childRecords_1.length;
|
|
2340
2381
|
var totalDuration = 0;
|
|
2341
2382
|
var progressValues = {};
|
|
2342
2383
|
var minStartDate = null;
|
|
@@ -2345,38 +2386,43 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
2345
2386
|
var totalProgress = 0;
|
|
2346
2387
|
var childCompletedWorks = 0;
|
|
2347
2388
|
var childData = void 0;
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2389
|
+
var _loop_6 = function (count) {
|
|
2390
|
+
if (!this_4.parent.loadChildOnDemand && this_4.parent.taskFields.hasChildMapping) {
|
|
2391
|
+
childData = this_4.parent.currentViewData.filter(function (item) { return item.ganttProperties.taskId === childRecords_1[count][_this.parent.taskFields.id]; })[0];
|
|
2392
|
+
}
|
|
2393
|
+
else {
|
|
2394
|
+
childData = childRecords_1[count];
|
|
2395
|
+
}
|
|
2396
|
+
if (this_4.parent.isOnDelete && childData.isDelete) {
|
|
2397
|
+
if (childLength === 1 && this_4.parent.viewType === 'ProjectView') {
|
|
2352
2398
|
deleteUpdate = true;
|
|
2353
2399
|
}
|
|
2354
|
-
continue;
|
|
2400
|
+
return "continue";
|
|
2355
2401
|
}
|
|
2356
|
-
var startDate =
|
|
2402
|
+
var startDate = this_4.getValidStartDate(childData.ganttProperties);
|
|
2357
2403
|
if (parentData.hasChildRecords && !ganttProp.isAutoSchedule && !isNullOrUndefined(childData.ganttProperties.autoStartDate)) {
|
|
2358
2404
|
startDate = childData.ganttProperties.autoStartDate;
|
|
2359
2405
|
}
|
|
2360
|
-
var endDate =
|
|
2406
|
+
var endDate = this_4.getValidEndDate(childData.ganttProperties);
|
|
2361
2407
|
if (parentData.hasChildRecords && !ganttProp.isAutoSchedule && !isNullOrUndefined(childData.ganttProperties.autoEndDate)) {
|
|
2362
2408
|
endDate = childData.ganttProperties.autoEndDate;
|
|
2363
2409
|
}
|
|
2364
2410
|
if (isNullOrUndefined(minStartDate)) {
|
|
2365
|
-
minStartDate =
|
|
2411
|
+
minStartDate = this_4.getDateFromFormat(startDate);
|
|
2366
2412
|
}
|
|
2367
2413
|
if (isNullOrUndefined(maxEndDate)) {
|
|
2368
|
-
maxEndDate =
|
|
2414
|
+
maxEndDate = this_4.getDateFromFormat(endDate);
|
|
2369
2415
|
}
|
|
2370
|
-
if (!isNullOrUndefined(endDate) &&
|
|
2371
|
-
maxEndDate =
|
|
2416
|
+
if (!isNullOrUndefined(endDate) && this_4.compareDates(endDate, maxEndDate) === 1) {
|
|
2417
|
+
maxEndDate = this_4.getDateFromFormat(endDate);
|
|
2372
2418
|
}
|
|
2373
|
-
if (!isNullOrUndefined(startDate) &&
|
|
2374
|
-
minStartDate =
|
|
2419
|
+
if (!isNullOrUndefined(startDate) && this_4.compareDates(startDate, minStartDate) === -1) {
|
|
2420
|
+
minStartDate = this_4.getDateFromFormat(startDate);
|
|
2375
2421
|
}
|
|
2376
2422
|
if (!childData.ganttProperties.isMilestone && isScheduledTask(childData.ganttProperties)) {
|
|
2377
|
-
progressValues =
|
|
2423
|
+
progressValues = this_4.getParentProgress(childData);
|
|
2378
2424
|
totalProgress += getValue('totalProgress', progressValues);
|
|
2379
|
-
if (childData[
|
|
2425
|
+
if (childData[this_4.parent.taskFields.duration] < 1) {
|
|
2380
2426
|
totalDuration += getValue('totalDuration', progressValues);
|
|
2381
2427
|
totalDuration = Number(totalDuration.toFixed(4));
|
|
2382
2428
|
}
|
|
@@ -2388,6 +2434,10 @@ var TaskProcessor = /** @class */ (function (_super) {
|
|
|
2388
2434
|
milestoneCount++;
|
|
2389
2435
|
}
|
|
2390
2436
|
childCompletedWorks += childData.ganttProperties.work;
|
|
2437
|
+
};
|
|
2438
|
+
var this_4 = this;
|
|
2439
|
+
for (var count = 0; count < childLength; count++) {
|
|
2440
|
+
_loop_6(count);
|
|
2391
2441
|
}
|
|
2392
2442
|
if (!deleteUpdate) {
|
|
2393
2443
|
var taskCount = void 0;
|
|
@@ -117,6 +117,11 @@ var GanttTreeGrid = /** @class */ (function () {
|
|
|
117
117
|
this.wireEvents();
|
|
118
118
|
};
|
|
119
119
|
GanttTreeGrid.prototype.composeProperties = function () {
|
|
120
|
+
this.parent.treeGrid.hasChildMapping = this.parent.taskFields.hasChildMapping;
|
|
121
|
+
this.parent.treeGrid.loadChildOnDemand = this.parent.loadChildOnDemand;
|
|
122
|
+
this.parent.treeGrid['isFromGantt'] = true;
|
|
123
|
+
this.parent.treeGrid.parentIdMapping = this.parent.taskFields.parentID;
|
|
124
|
+
this.parent.treeGrid.idMapping = this.parent.taskFields.id;
|
|
120
125
|
this.parent.treeGrid.showColumnMenu = this.parent.showColumnMenu;
|
|
121
126
|
this.parent.treeGrid.enableCollapseAll = this.parent.collapseAllParentTasks;
|
|
122
127
|
this.parent.treeGrid.columnMenuItems = this.parent.columnMenuItems;
|
|
@@ -133,8 +138,14 @@ var GanttTreeGrid = /** @class */ (function () {
|
|
|
133
138
|
this.parent.treeGrid.dataSource = { result: this.parent.flatData, count: count };
|
|
134
139
|
}
|
|
135
140
|
else {
|
|
136
|
-
this.parent.treeGrid.hasChildMapping
|
|
137
|
-
|
|
141
|
+
if (!this.parent.treeGrid.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
142
|
+
this.parent.autoCalculateDateScheduling = false;
|
|
143
|
+
this.parent.treeGrid.dataSource = this.parent.dataSource;
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
this.parent.treeGrid.hasChildMapping = null;
|
|
147
|
+
this.parent.treeGrid.dataSource = this.parent.flatData;
|
|
148
|
+
}
|
|
138
149
|
}
|
|
139
150
|
this.parent.treeGrid.expandStateMapping = this.parent.taskFields.expandState;
|
|
140
151
|
var isGantt = 'isGantt';
|
|
@@ -295,7 +306,7 @@ var GanttTreeGrid = /** @class */ (function () {
|
|
|
295
306
|
collapsedArgs = this.createExpandCollapseArgs(args, null);
|
|
296
307
|
this.parent.ganttChartModule.collapsedGanttRow(collapsedArgs);
|
|
297
308
|
}
|
|
298
|
-
if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && collapsedArgs['gridRow']) {
|
|
309
|
+
if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && !this.parent.ganttChartModule.isCollapseAll && collapsedArgs['gridRow']) {
|
|
299
310
|
collapsedArgs['gridRow'].style.height = collapsedArgs['chartRow'].style.height;
|
|
300
311
|
this.parent.contentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
|
|
301
312
|
this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
|
|
@@ -325,7 +336,7 @@ var GanttTreeGrid = /** @class */ (function () {
|
|
|
325
336
|
expandedArgs = this.createExpandCollapseArgs(args, null);
|
|
326
337
|
this.parent.ganttChartModule.expandedGanttRow(expandedArgs);
|
|
327
338
|
}
|
|
328
|
-
if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && args['row']) {
|
|
339
|
+
if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && !this.parent.ganttChartModule.isExpandAll && args['row']) {
|
|
329
340
|
args['row'].style.height = this.parent.rowHeight + 'px';
|
|
330
341
|
this.parent.contentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
|
|
331
342
|
this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
|
|
@@ -895,6 +906,9 @@ var GanttTreeGrid = /** @class */ (function () {
|
|
|
895
906
|
if (!isNullOrUndefined(ganttProp)) {
|
|
896
907
|
return this.parent.dataOperation.getDurationString(ganttProp.duration, ganttProp.durationUnit);
|
|
897
908
|
}
|
|
909
|
+
else if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
910
|
+
return this.parent.dataOperation.getDurationString(parseInt(data[this.parent.taskFields.duration]), this.parent.durationUnit);
|
|
911
|
+
}
|
|
898
912
|
return '';
|
|
899
913
|
}; // eslint-disable-next-line
|
|
900
914
|
GanttTreeGrid.prototype.resourceValueAccessor = function (field, data, column) {
|
|
@@ -931,12 +945,7 @@ var GanttTreeGrid = /** @class */ (function () {
|
|
|
931
945
|
};
|
|
932
946
|
GanttTreeGrid.prototype.updateScrollTop = function (args) {
|
|
933
947
|
var newScrollTop;
|
|
934
|
-
|
|
935
|
-
newScrollTop = getValue('top', args) - document.getElementsByClassName('e-chart-scroll-container e-content')[0]['offsetHeight'];
|
|
936
|
-
}
|
|
937
|
-
else {
|
|
938
|
-
newScrollTop = getValue('top', args);
|
|
939
|
-
}
|
|
948
|
+
newScrollTop = getValue('top', args);
|
|
940
949
|
this.treeGridElement.querySelector('.e-content').scrollTop = newScrollTop;
|
|
941
950
|
this.previousScroll.top = this.treeGridElement.querySelector('.e-content').scrollTop;
|
|
942
951
|
};
|
|
@@ -9,7 +9,7 @@ import { Gantt } from './../base/gantt';
|
|
|
9
9
|
export declare class ExportHelper {
|
|
10
10
|
private parent;
|
|
11
11
|
private flatData;
|
|
12
|
-
|
|
12
|
+
exportProps: PdfExportProperties;
|
|
13
13
|
private gantt;
|
|
14
14
|
private rowIndex;
|
|
15
15
|
private colIndex;
|
|
@@ -19,7 +19,11 @@ export declare class ExportHelper {
|
|
|
19
19
|
private pdfDoc;
|
|
20
20
|
private exportValueFormatter;
|
|
21
21
|
private totalColumnWidth;
|
|
22
|
+
beforeSinglePageExport: Object;
|
|
23
|
+
baselineHeight: number;
|
|
24
|
+
baselineTop: number;
|
|
22
25
|
constructor(parent: Gantt);
|
|
26
|
+
processToFit(): void;
|
|
23
27
|
/**
|
|
24
28
|
* @param {IGanttData[]} data .
|
|
25
29
|
* @param {PdfGantt} gantt .
|
|
@@ -13,8 +13,101 @@ import { pixelToPoint, isScheduledTask } from '../base/utils';
|
|
|
13
13
|
*/
|
|
14
14
|
var ExportHelper = /** @class */ (function () {
|
|
15
15
|
function ExportHelper(parent) {
|
|
16
|
+
this.totalColumnWidth = 0;
|
|
17
|
+
this.beforeSinglePageExport = {};
|
|
18
|
+
this.baselineHeight = 8;
|
|
16
19
|
this.parent = parent;
|
|
17
20
|
}
|
|
21
|
+
ExportHelper.prototype.processToFit = function () {
|
|
22
|
+
this.beforeSinglePageExport['zoomingProjectStartDate'] = this.parent.zoomingProjectStartDate;
|
|
23
|
+
this.beforeSinglePageExport['zoomingProjectEndDate'] = this.parent.zoomingProjectEndDate;
|
|
24
|
+
this.beforeSinglePageExport['cloneProjectStartDate'] = this.parent.cloneProjectStartDate;
|
|
25
|
+
this.beforeSinglePageExport['cloneProjectEndDate'] = this.parent.cloneProjectEndDate;
|
|
26
|
+
this.beforeSinglePageExport['customTimelineSettings'] = extend({}, this.parent.timelineModule.customTimelineSettings, null, true);
|
|
27
|
+
this.beforeSinglePageExport['isTimelineRoundOff'] = this.parent.isTimelineRoundOff;
|
|
28
|
+
this.beforeSinglePageExport['topTier'] = this.parent.timelineModule.topTier;
|
|
29
|
+
this.beforeSinglePageExport['topTierCellWidth'] = this.parent.timelineModule.topTierCellWidth;
|
|
30
|
+
this.beforeSinglePageExport['topTierCollection'] = this.parent.timelineModule.topTierCollection;
|
|
31
|
+
this.beforeSinglePageExport['bottomTier'] = this.parent.timelineModule.bottomTier;
|
|
32
|
+
this.beforeSinglePageExport['bottomTierCellWidth'] = this.parent.timelineModule.bottomTierCellWidth;
|
|
33
|
+
this.beforeSinglePageExport['bottomTierCollection'] = this.parent.timelineModule.bottomTierCollection;
|
|
34
|
+
this.beforeSinglePageExport['totalTimelineWidth'] = this.parent.timelineModule.totalTimelineWidth;
|
|
35
|
+
this.beforeSinglePageExport['timelineStartDate'] = this.parent.timelineModule.timelineStartDate;
|
|
36
|
+
this.beforeSinglePageExport['timelineEndDate'] = this.parent.timelineModule.timelineEndDate;
|
|
37
|
+
this.beforeSinglePageExport['timelineRoundOffEndDate'] = this.parent.timelineModule.timelineRoundOffEndDate;
|
|
38
|
+
this.beforeSinglePageExport['perDayWidth'] = this.parent.perDayWidth;
|
|
39
|
+
this.beforeSinglePageExport['updatedConnectorLineCollection'] = extend([], this.parent.updatedConnectorLineCollection, null, true);
|
|
40
|
+
this.parent.timelineModule.isZoomToFit = true;
|
|
41
|
+
this.parent.timelineModule.isZooming = false;
|
|
42
|
+
if (!this.parent.zoomingProjectStartDate) {
|
|
43
|
+
this.parent.zoomingProjectStartDate = this.parent.cloneProjectStartDate;
|
|
44
|
+
this.parent.zoomingProjectEndDate = this.parent.cloneProjectEndDate;
|
|
45
|
+
}
|
|
46
|
+
if (this.parent.zoomingProjectStartDate > this.parent.cloneProjectStartDate) {
|
|
47
|
+
this.parent.cloneProjectStartDate = new Date(this.parent.allowUnscheduledTasks ? this.parent.zoomingProjectStartDate : this.parent.cloneProjectStartDate);
|
|
48
|
+
}
|
|
49
|
+
this.parent.dataOperation.calculateProjectDates();
|
|
50
|
+
var timeDifference = (this.parent.cloneProjectEndDate.getTime() - this.parent.cloneProjectStartDate.getTime());
|
|
51
|
+
var totalDays = (timeDifference / (1000 * 3600 * 24));
|
|
52
|
+
var chartsideWidth;
|
|
53
|
+
var gridWidth;
|
|
54
|
+
if (this.exportProps.fitToWidthSettings.gridWidth) {
|
|
55
|
+
gridWidth = parseInt(this.exportProps.fitToWidthSettings.gridWidth.split('%')[0]);
|
|
56
|
+
}
|
|
57
|
+
if (this.exportProps.fitToWidthSettings.chartWidth) {
|
|
58
|
+
chartsideWidth = parseInt(this.exportProps.fitToWidthSettings.chartWidth.split('%')[0]);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
if (this.exportProps.fitToWidthSettings.gridWidth) {
|
|
62
|
+
chartsideWidth = 100 - gridWidth;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
chartsideWidth = 70;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
var pdfwidth = (this.parent.pdfExportModule['pdfPageDimensions'].width * chartsideWidth) / 100;
|
|
69
|
+
var chartWidth = pdfwidth;
|
|
70
|
+
var perDayWidth = chartWidth / totalDays;
|
|
71
|
+
var zoomingLevel;
|
|
72
|
+
var firstValue;
|
|
73
|
+
var secondValue;
|
|
74
|
+
var zoomingCollections = this.parent.zoomingLevels.slice();
|
|
75
|
+
var sortedCollectons = zoomingCollections.sort(function (a, b) {
|
|
76
|
+
return (!a.perDayWidth && !b.perDayWidth ? 0 : (a.perDayWidth < b.perDayWidth) ? 1 : -1);
|
|
77
|
+
});
|
|
78
|
+
if (perDayWidth === 0) { // return when the Gantt chart is not in viewable state.
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
for (var i = 0; i < sortedCollectons.length; i++) {
|
|
82
|
+
firstValue = sortedCollectons[i];
|
|
83
|
+
if (i === sortedCollectons.length - 1) {
|
|
84
|
+
zoomingLevel = sortedCollectons[i];
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
secondValue = sortedCollectons[i + 1];
|
|
89
|
+
}
|
|
90
|
+
if (perDayWidth >= firstValue.perDayWidth) {
|
|
91
|
+
zoomingLevel = sortedCollectons[i];
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
if (perDayWidth < firstValue.perDayWidth && perDayWidth > secondValue.perDayWidth) {
|
|
95
|
+
zoomingLevel = sortedCollectons[i + 1];
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
var newTimeline = extend({}, {}, zoomingLevel, true);
|
|
100
|
+
this.parent.timelineModule['roundOffDateToZoom'](this.parent.cloneProjectStartDate, true, perDayWidth, newTimeline.bottomTier.unit, zoomingLevel);
|
|
101
|
+
this.parent.timelineModule['roundOffDateToZoom'](this.parent.cloneProjectEndDate, false, perDayWidth, newTimeline.bottomTier.unit, zoomingLevel);
|
|
102
|
+
var numberOfCells = this.parent.timelineModule['calculateNumberOfTimelineCells'](newTimeline);
|
|
103
|
+
var scrollHeight = this.parent.pdfExportModule['pdfPageDimensions'].height; //17 is horizontal scrollbar width
|
|
104
|
+
var contentHeight = this.parent.pdfExportModule['pdfPageDimensions'].height;
|
|
105
|
+
var emptySpace = contentHeight <= scrollHeight ? 0 : 17;
|
|
106
|
+
newTimeline.timelineUnitSize = Math.abs((chartWidth - emptySpace)) / numberOfCells;
|
|
107
|
+
this.parent.timelineModule['changeTimelineSettings'](newTimeline);
|
|
108
|
+
this.parent.timelineModule.isZoomToFit = false;
|
|
109
|
+
this.parent.timelineModule.isZooming = false;
|
|
110
|
+
};
|
|
18
111
|
/**
|
|
19
112
|
* @param {IGanttData[]} data .
|
|
20
113
|
* @param {PdfGantt} gantt .
|
|
@@ -36,11 +129,16 @@ var ExportHelper = /** @class */ (function () {
|
|
|
36
129
|
this.gantt.style.cellPadding.right = 0;
|
|
37
130
|
this.ganttStyle = this.gantt.ganttStyle;
|
|
38
131
|
this.gantt.borderColor = this.ganttStyle.chartGridLineColor;
|
|
132
|
+
this.parent.pdfExportModule.isPdfExport = true;
|
|
133
|
+
if (this.exportProps.fitToWidthSettings && this.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
134
|
+
this.processToFit();
|
|
135
|
+
}
|
|
39
136
|
this.processHeaderContent();
|
|
40
137
|
this.processGanttContent();
|
|
41
138
|
this.processTimeline();
|
|
42
139
|
this.processTaskbar();
|
|
43
140
|
this.processPredecessor();
|
|
141
|
+
this.parent.pdfExportModule.isPdfExport = false;
|
|
44
142
|
};
|
|
45
143
|
ExportHelper.prototype.processHeaderContent = function () {
|
|
46
144
|
var _this = this;
|
|
@@ -96,7 +194,9 @@ var ExportHelper = /** @class */ (function () {
|
|
|
96
194
|
this.renderEmptyGantt();
|
|
97
195
|
}
|
|
98
196
|
else {
|
|
99
|
-
|
|
197
|
+
var flatData = void 0;
|
|
198
|
+
flatData = this.flatData;
|
|
199
|
+
flatData.forEach(function (data) {
|
|
100
200
|
_this.row = _this.gantt.rows.addRow();
|
|
101
201
|
if (data.hasChildRecords) {
|
|
102
202
|
_this.gantt.rows.getRow(_this.rowIndex).isParentRow = true;
|
|
@@ -105,6 +205,9 @@ var ExportHelper = /** @class */ (function () {
|
|
|
105
205
|
else {
|
|
106
206
|
_this.processRecordRow(data);
|
|
107
207
|
}
|
|
208
|
+
if (_this.exportProps.fitToWidthSettings && _this.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
209
|
+
_this.row.height = 33.33;
|
|
210
|
+
}
|
|
108
211
|
_this.rowIndex++;
|
|
109
212
|
});
|
|
110
213
|
}
|
|
@@ -156,7 +259,7 @@ var ExportHelper = /** @class */ (function () {
|
|
|
156
259
|
else {
|
|
157
260
|
predecessor.connectorLineColor = _this.ganttStyle.connectorLineColor;
|
|
158
261
|
}
|
|
159
|
-
|
|
262
|
+
_this.ganttStyle.connectorLineColor = predecessor.connectorLineColor;
|
|
160
263
|
_this.gantt.predecessorCollection.push(predecessor);
|
|
161
264
|
});
|
|
162
265
|
this.parent.pdfExportModule.isPdfExport = false;
|
|
@@ -221,7 +324,9 @@ var ExportHelper = /** @class */ (function () {
|
|
|
221
324
|
*/
|
|
222
325
|
ExportHelper.prototype.processTaskbar = function () {
|
|
223
326
|
var _this = this;
|
|
224
|
-
|
|
327
|
+
var flatData;
|
|
328
|
+
flatData = this.flatData;
|
|
329
|
+
flatData.forEach(function (data) {
|
|
225
330
|
var taskbar = _this.gantt.taskbar.add();
|
|
226
331
|
var ganttProp = data.ganttProperties;
|
|
227
332
|
taskbar.left = ganttProp.left;
|
|
@@ -252,7 +357,22 @@ var ExportHelper = /** @class */ (function () {
|
|
|
252
357
|
taskbar.startDate = ganttProp.startDate;
|
|
253
358
|
taskbar.endDate = ganttProp.endDate;
|
|
254
359
|
taskbar.height = _this.parent.chartRowsModule.taskBarHeight;
|
|
360
|
+
if (_this.parent.renderBaseline) {
|
|
361
|
+
var height = void 0;
|
|
362
|
+
if ((taskbar.height + _this.baselineHeight) <= _this.parent.rowHeight) {
|
|
363
|
+
height = taskbar.height;
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
height = taskbar.height - (_this.baselineHeight + 1);
|
|
367
|
+
}
|
|
368
|
+
taskbar.height = height;
|
|
369
|
+
}
|
|
370
|
+
taskbar.baselineTop = _this.parent.chartRowsModule.baselineTop;
|
|
255
371
|
taskbar.isMilestone = ganttProp.isMilestone;
|
|
372
|
+
taskbar.baselineStartDate = ganttProp.baselineStartDate;
|
|
373
|
+
taskbar.baselineEndDate = ganttProp.baselineEndDate;
|
|
374
|
+
taskbar.baselineLeft = ganttProp.baselineLeft;
|
|
375
|
+
taskbar.baselineWidth = ganttProp.baselineWidth;
|
|
256
376
|
taskbar.milestoneColor = new PdfColor(_this.ganttStyle.taskbar.milestoneColor);
|
|
257
377
|
taskbar.isParentTask = data.hasChildRecords;
|
|
258
378
|
if (ganttProp.isMilestone) {
|
|
@@ -283,6 +403,7 @@ var ExportHelper = /** @class */ (function () {
|
|
|
283
403
|
taskbar.taskColor = new PdfColor(_this.ganttStyle.taskbar.criticalTaskColor);
|
|
284
404
|
taskbar.progressColor = new PdfColor(_this.ganttStyle.taskbar.criticalProgressColor);
|
|
285
405
|
taskbar.taskBorderColor = new PdfColor(_this.ganttStyle.taskbar.criticalTaskBorderColor);
|
|
406
|
+
taskbar.milestoneColor = new PdfColor(_this.ganttStyle.taskbar.criticalTaskColor);
|
|
286
407
|
}
|
|
287
408
|
else {
|
|
288
409
|
taskbar.taskColor = new PdfColor(_this.ganttStyle.taskbar.taskColor);
|
|
@@ -290,6 +411,8 @@ var ExportHelper = /** @class */ (function () {
|
|
|
290
411
|
taskbar.taskBorderColor = new PdfColor(_this.ganttStyle.taskbar.taskBorderColor);
|
|
291
412
|
}
|
|
292
413
|
}
|
|
414
|
+
taskbar.baselineColor = new PdfColor(_this.ganttStyle.taskbar.baselineColor);
|
|
415
|
+
taskbar.baselineBorderColor = new PdfColor(_this.ganttStyle.taskbar.baselineBorderColor);
|
|
293
416
|
taskbar.gridLineColor = new PdfColor(_this.ganttStyle.chartGridLineColor);
|
|
294
417
|
_this.gantt.taskbarCollection.push(taskbar);
|
|
295
418
|
var taskStyle = {};
|
|
@@ -298,6 +421,8 @@ var ExportHelper = /** @class */ (function () {
|
|
|
298
421
|
taskStyle.taskBorderColor = taskbar.taskBorderColor;
|
|
299
422
|
taskStyle.progressColor = taskbar.progressColor;
|
|
300
423
|
taskStyle.milestoneColor = taskbar.milestoneColor;
|
|
424
|
+
taskStyle.baselineColor = taskbar.baselineColor;
|
|
425
|
+
taskStyle.baselineBorderColor = taskbar.baselineBorderColor;
|
|
301
426
|
var args = {
|
|
302
427
|
taskbar: taskStyle,
|
|
303
428
|
data: data
|
|
@@ -309,6 +434,8 @@ var ExportHelper = /** @class */ (function () {
|
|
|
309
434
|
taskbar.taskBorderColor = args.taskbar.taskBorderColor;
|
|
310
435
|
taskbar.progressColor = args.taskbar.progressColor;
|
|
311
436
|
taskbar.milestoneColor = args.taskbar.milestoneColor;
|
|
437
|
+
taskbar.baselineColor = args.taskbar.baselineColor;
|
|
438
|
+
taskbar.baselineBorderColor = args.taskbar.baselineBorderColor;
|
|
312
439
|
}
|
|
313
440
|
});
|
|
314
441
|
};
|
|
@@ -410,7 +537,8 @@ var ExportHelper = /** @class */ (function () {
|
|
|
410
537
|
row.height = pixelToPoint(this.parent.rowHeight);
|
|
411
538
|
this.copyStyles(this.ganttStyle.columnHeader, row.cells.getCell(0), row.isParentRow);
|
|
412
539
|
var count = this.columns.length;
|
|
413
|
-
|
|
540
|
+
row.cells.getCell(0).value = this.parent.localeObj.getConstant('emptyRecord');
|
|
541
|
+
this.mergeCells(1, 0, count);
|
|
414
542
|
};
|
|
415
543
|
ExportHelper.prototype.mergeCells = function (rowIndex, colIndex, lastColIndex) {
|
|
416
544
|
this.gantt.rows.getRow(rowIndex).cells.getCell(colIndex).columnSpan = lastColIndex;
|
|
@@ -455,6 +583,26 @@ var ExportHelper = /** @class */ (function () {
|
|
|
455
583
|
var widths = [];
|
|
456
584
|
var treeColumnIndex = 0;
|
|
457
585
|
var tWidth = (this.pdfDoc.pageSettings.width - 82);
|
|
586
|
+
if (this.exportProps && this.exportProps.fitToWidthSettings && this.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
587
|
+
var gridWidth = void 0;
|
|
588
|
+
if (this.exportProps.fitToWidthSettings.gridWidth) {
|
|
589
|
+
gridWidth = parseInt(this.exportProps.fitToWidthSettings.gridWidth.split('%')[0]);
|
|
590
|
+
}
|
|
591
|
+
else {
|
|
592
|
+
if (this.exportProps.fitToWidthSettings.chartWidth) {
|
|
593
|
+
var chartWidth = parseInt(this.exportProps.fitToWidthSettings.chartWidth.split('%')[0]);
|
|
594
|
+
gridWidth = 100 - chartWidth;
|
|
595
|
+
}
|
|
596
|
+
else {
|
|
597
|
+
gridWidth = 30;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
var pdfwidth = (this.parent.pdfExportModule['pdfPageDimensions'].width * gridWidth) / 100;
|
|
601
|
+
var perColumnWidth = pdfwidth / this.gantt.columns.columns.length;
|
|
602
|
+
for (var i = 0; i < this.gantt.columns.columns.length; i++) {
|
|
603
|
+
this.gantt.columns.getColumn(i).width = perColumnWidth;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
458
606
|
if (this.totalColumnWidth > (this.pdfDoc.pageSettings.width - 82)) {
|
|
459
607
|
this.gantt.style.allowHorizontalOverflow = true;
|
|
460
608
|
}
|
|
@@ -196,11 +196,11 @@ var PdfTreeGridCell = /** @class */ (function () {
|
|
|
196
196
|
if (this.finishedDrawingCell) {
|
|
197
197
|
temp = (this.remainingString === '') ? this.remainingString : this.value;
|
|
198
198
|
/* eslint-disable-next-line */
|
|
199
|
-
graphics.drawString(temp, font, textPen, textBrush, (innerLayoutArea.x + leftAdjustment), innerLayoutArea.y, (innerLayoutArea.width - leftAdjustment - padding), (innerLayoutArea.height - padding), this.style.format);
|
|
199
|
+
graphics.drawString(temp, font, textPen, textBrush, (innerLayoutArea.x + leftAdjustment), this.isHeaderCell ? innerLayoutArea.y - 16 : innerLayoutArea.y, (innerLayoutArea.width - leftAdjustment - padding), (innerLayoutArea.height - padding), this.style.format);
|
|
200
200
|
}
|
|
201
201
|
else {
|
|
202
202
|
/* eslint-disable-next-line */
|
|
203
|
-
graphics.drawString(this.remainingString, font, textPen, textBrush, (innerLayoutArea.x + leftAdjustment), innerLayoutArea.y, this.style.format);
|
|
203
|
+
graphics.drawString(this.remainingString, font, textPen, textBrush, (innerLayoutArea.x + leftAdjustment), this.isHeaderCell ? innerLayoutArea.y - 16 : innerLayoutArea.y, this.style.format);
|
|
204
204
|
}
|
|
205
205
|
result = graphics.stringLayoutResult;
|
|
206
206
|
}
|
|
@@ -55,6 +55,8 @@ var PdfGanttTheme = /** @class */ (function () {
|
|
|
55
55
|
ganttStyle.taskbar.progressColor = new PdfColor(33, 82, 125);
|
|
56
56
|
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
57
57
|
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
58
|
+
ganttStyle.taskbar.baselineColor = new PdfColor(240, 173, 78);
|
|
59
|
+
ganttStyle.taskbar.baselineBorderColor = new PdfColor(240, 173, 78);
|
|
58
60
|
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
59
61
|
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
60
62
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(119, 119, 119);
|
|
@@ -75,6 +77,8 @@ var PdfGanttTheme = /** @class */ (function () {
|
|
|
75
77
|
ganttStyle.taskbar.progressColor = new PdfColor(0, 86, 179);
|
|
76
78
|
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
77
79
|
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
80
|
+
ganttStyle.taskbar.baselineColor = new PdfColor(255, 193, 7);
|
|
81
|
+
ganttStyle.taskbar.baselineBorderColor = new PdfColor(255, 193, 7);
|
|
78
82
|
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
79
83
|
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
80
84
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(108, 117, 125);
|
|
@@ -97,6 +101,8 @@ var PdfGanttTheme = /** @class */ (function () {
|
|
|
97
101
|
ganttStyle.taskbar.progressColor = new PdfColor(0, 91, 163);
|
|
98
102
|
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
99
103
|
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
104
|
+
ganttStyle.taskbar.baselineColor = new PdfColor(216, 59, 1);
|
|
105
|
+
ganttStyle.taskbar.baselineBorderColor = new PdfColor(216, 59, 1);
|
|
100
106
|
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
101
107
|
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
102
108
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(118, 118, 118);
|
|
@@ -117,6 +123,8 @@ var PdfGanttTheme = /** @class */ (function () {
|
|
|
117
123
|
ganttStyle.taskbar.progressColor = new PdfColor(63, 81, 181);
|
|
118
124
|
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
119
125
|
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
126
|
+
ganttStyle.taskbar.baselineColor = new PdfColor(193, 87, 0);
|
|
127
|
+
ganttStyle.taskbar.baselineBorderColor = new PdfColor(193, 87, 0);
|
|
120
128
|
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
121
129
|
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
122
130
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(132, 132, 132);
|