@syncfusion/ej2-gantt 22.2.12 → 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 +180 -164
- 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 +846 -242
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +884 -264
- 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/critical-path.d.ts +2 -0
- package/src/gantt/actions/critical-path.js +79 -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.js +15 -8
- 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 +1 -1
- 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 +73 -11
- 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 +75 -25
- 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 +150 -3
- 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 +3 -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 -3
- 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 +2 -1
- package/src/gantt/renderer/timeline.js +16 -9
- package/src/gantt/renderer/tooltip.js +5 -5
- 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
|
@@ -510,7 +510,7 @@ class DateProcessor {
|
|
|
510
510
|
}
|
|
511
511
|
else {
|
|
512
512
|
if ((!isNullOrUndefined(this.parent.taskFields.milestone)) && (!isNullOrUndefined(ganttProperties.startDate)) && !isNullOrUndefined(ganttProperties.endDate) &&
|
|
513
|
-
(ganttProperties.startDate).getTime() === (ganttProperties.endDate).getTime() &&
|
|
513
|
+
(ganttProperties.startDate).getTime() === (ganttProperties.endDate).getTime() && (ganttData.taskData[this.parent.taskFields.milestone] === false)) {
|
|
514
514
|
tDuration = 1;
|
|
515
515
|
}
|
|
516
516
|
else {
|
|
@@ -1632,7 +1632,9 @@ class TaskProcessor extends DateProcessor {
|
|
|
1632
1632
|
dataManager.executeQuery(queryManager).then((e) => {
|
|
1633
1633
|
this.dataArray = e.result;
|
|
1634
1634
|
this.processTimeline();
|
|
1635
|
-
this.
|
|
1635
|
+
if (this.parent.loadChildOnDemand || (!this.parent.loadChildOnDemand && !(this.parent.taskFields.hasChildMapping))) {
|
|
1636
|
+
this.cloneDataSource();
|
|
1637
|
+
}
|
|
1636
1638
|
this.parent.renderGantt(isChange);
|
|
1637
1639
|
}).catch((e) => {
|
|
1638
1640
|
// Trigger action failure event
|
|
@@ -1671,6 +1673,9 @@ class TaskProcessor extends DateProcessor {
|
|
|
1671
1673
|
const data = [];
|
|
1672
1674
|
for (let i = 0; i < this.dataArray.length; i++) {
|
|
1673
1675
|
const tempData = this.dataArray[i];
|
|
1676
|
+
if (tempData['parentItem']) {
|
|
1677
|
+
delete tempData['parentItem'];
|
|
1678
|
+
}
|
|
1674
1679
|
data.push(extend({}, {}, tempData, true));
|
|
1675
1680
|
if (!isNullOrUndefined(tempData[taskIdMapping])) {
|
|
1676
1681
|
this.taskIds.push(tempData[taskIdMapping].toString());
|
|
@@ -1680,7 +1685,12 @@ class TaskProcessor extends DateProcessor {
|
|
|
1680
1685
|
this.parent.setProperties({ taskFields: { child: 'Children' } }, true);
|
|
1681
1686
|
}
|
|
1682
1687
|
this.constructDataSource(data);
|
|
1683
|
-
|
|
1688
|
+
if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping && this.hierarchyData.length === 0) {
|
|
1689
|
+
hierarchicalData = this.dataArray;
|
|
1690
|
+
}
|
|
1691
|
+
else {
|
|
1692
|
+
hierarchicalData = this.hierarchyData;
|
|
1693
|
+
}
|
|
1684
1694
|
}
|
|
1685
1695
|
else {
|
|
1686
1696
|
hierarchicalData = this.dataArray;
|
|
@@ -1889,7 +1899,12 @@ class TaskProcessor extends DateProcessor {
|
|
|
1889
1899
|
if (!isNullOrUndefined(data[taskSettings.id])) {
|
|
1890
1900
|
id = data[taskSettings.id];
|
|
1891
1901
|
name = data[taskSettings.name];
|
|
1892
|
-
this.
|
|
1902
|
+
if (!this.parent.loadChildOnDemand && taskSettings.hasChildMapping && data['taskData']) {
|
|
1903
|
+
ganttData['taskData'] = data['taskData'];
|
|
1904
|
+
}
|
|
1905
|
+
else {
|
|
1906
|
+
this.addTaskData(ganttData, data, isLoad);
|
|
1907
|
+
}
|
|
1893
1908
|
}
|
|
1894
1909
|
else if (!isNullOrUndefined(data[resourceFields.id])) {
|
|
1895
1910
|
id = data[resourceFields.id];
|
|
@@ -1927,6 +1942,9 @@ class TaskProcessor extends DateProcessor {
|
|
|
1927
1942
|
this.parent.setRecordValue('notes', notes, ganttProperties, true);
|
|
1928
1943
|
this.parent.setRecordValue('cssClass', data[taskSettings.cssClass], ganttProperties, true);
|
|
1929
1944
|
this.parent.setRecordValue('parentItem', this.getCloneParent(parentItem), ganttData);
|
|
1945
|
+
if (!this.parent.loadChildOnDemand && taskSettings.hasChildMapping && this.parent.currentViewData.length > 0) {
|
|
1946
|
+
this.parent.setRecordValue('parentItem', ganttData.parentItem, this.parent.currentViewData[this.taskIds.indexOf(data[taskSettings.id].toString())]);
|
|
1947
|
+
}
|
|
1930
1948
|
const parentUniqId = ganttData.parentItem ? ganttData.parentItem.uniqueID : null;
|
|
1931
1949
|
this.parent.setRecordValue('parentUniqueID', parentUniqId, ganttData);
|
|
1932
1950
|
if (this.parent.viewType === 'ResourceView' && !isNullOrUndefined(taskSettings.parentID)
|
|
@@ -1934,7 +1952,12 @@ class TaskProcessor extends DateProcessor {
|
|
|
1934
1952
|
this.parent.setRecordValue('parentId', ganttData.parentItem.taskId, ganttProperties, true);
|
|
1935
1953
|
}
|
|
1936
1954
|
this.parent.setRecordValue('level', level, ganttData);
|
|
1937
|
-
|
|
1955
|
+
if (!this.parent.loadChildOnDemand && taskSettings.hasChildMapping && data['uniqueID']) {
|
|
1956
|
+
this.parent.setRecordValue('uniqueID', data['uniqueID'], ganttData);
|
|
1957
|
+
}
|
|
1958
|
+
else {
|
|
1959
|
+
this.parent.setRecordValue('uniqueID', getUid(this.parent.element.id + '_data_'), ganttData);
|
|
1960
|
+
}
|
|
1938
1961
|
this.parent.setRecordValue('uniqueID', ganttData.uniqueID, ganttProperties, true);
|
|
1939
1962
|
this.parent.setRecordValue('childRecords', [], ganttData);
|
|
1940
1963
|
if (this.parent.dataSource instanceof Object && isCountRequired(this.parent) &&
|
|
@@ -1949,7 +1972,12 @@ class TaskProcessor extends DateProcessor {
|
|
|
1949
1972
|
}
|
|
1950
1973
|
}
|
|
1951
1974
|
else {
|
|
1952
|
-
this.parent.
|
|
1975
|
+
if (!this.parent.loadChildOnDemand && taskSettings.hasChildMapping && ganttData.taskData[taskSettings.hasChildMapping]) {
|
|
1976
|
+
this.parent.setRecordValue('hasChildRecords', true, ganttData);
|
|
1977
|
+
}
|
|
1978
|
+
else {
|
|
1979
|
+
this.parent.setRecordValue('hasChildRecords', false, ganttData);
|
|
1980
|
+
}
|
|
1953
1981
|
}
|
|
1954
1982
|
if (ganttData.hasChildRecords) {
|
|
1955
1983
|
this.parent.setRecordValue('autoStartDate', ganttData.ganttProperties.startDate, ganttProperties);
|
|
@@ -2560,7 +2588,12 @@ class TaskProcessor extends DateProcessor {
|
|
|
2560
2588
|
}
|
|
2561
2589
|
else {
|
|
2562
2590
|
this.updateDurationValue(duration, ganttProperties);
|
|
2563
|
-
this.
|
|
2591
|
+
if (this.parent.autoCalculateDateScheduling) {
|
|
2592
|
+
this.calculateEndDate(ganttData);
|
|
2593
|
+
}
|
|
2594
|
+
else {
|
|
2595
|
+
this.parent.setRecordValue('endDate', endDate, ganttProperties, true);
|
|
2596
|
+
}
|
|
2564
2597
|
}
|
|
2565
2598
|
}
|
|
2566
2599
|
/**
|
|
@@ -3338,7 +3371,7 @@ class TaskProcessor extends DateProcessor {
|
|
|
3338
3371
|
*/
|
|
3339
3372
|
updateDurationValue(duration, ganttProperties) {
|
|
3340
3373
|
const tempDuration = this.getDurationValue(duration);
|
|
3341
|
-
if (!isNaN(getValue('duration', tempDuration))) {
|
|
3374
|
+
if (!isNaN(getValue('duration', tempDuration)) && !(this.parent.viewType === "ResourceView" && tempDuration["duration"] === 0)) {
|
|
3342
3375
|
this.parent.setRecordValue('duration', getValue('duration', tempDuration), ganttProperties, true);
|
|
3343
3376
|
}
|
|
3344
3377
|
if (!isNullOrUndefined(getValue('durationUnit', tempDuration))) {
|
|
@@ -3722,7 +3755,14 @@ class TaskProcessor extends DateProcessor {
|
|
|
3722
3755
|
* @private
|
|
3723
3756
|
*/
|
|
3724
3757
|
reUpdateGanttDataPosition() {
|
|
3725
|
-
|
|
3758
|
+
let flatData;
|
|
3759
|
+
if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps &&
|
|
3760
|
+
this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
3761
|
+
flatData = this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData'];
|
|
3762
|
+
}
|
|
3763
|
+
else {
|
|
3764
|
+
flatData = this.parent.flatData;
|
|
3765
|
+
}
|
|
3726
3766
|
const length = flatData.length;
|
|
3727
3767
|
for (let i = 0; i < length; i++) {
|
|
3728
3768
|
const data = flatData[i];
|
|
@@ -3868,7 +3908,12 @@ class TaskProcessor extends DateProcessor {
|
|
|
3868
3908
|
let childCompletedWorks = 0;
|
|
3869
3909
|
let childData;
|
|
3870
3910
|
for (let count = 0; count < childLength; count++) {
|
|
3871
|
-
|
|
3911
|
+
if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
3912
|
+
childData = this.parent.currentViewData.filter(item => item.ganttProperties.taskId === childRecords[count][this.parent.taskFields.id])[0];
|
|
3913
|
+
}
|
|
3914
|
+
else {
|
|
3915
|
+
childData = childRecords[count];
|
|
3916
|
+
}
|
|
3872
3917
|
if (this.parent.isOnDelete && childData.isDelete) {
|
|
3873
3918
|
if (childLength === 1 && this.parent.viewType === 'ProjectView') {
|
|
3874
3919
|
deleteUpdate = true;
|
|
@@ -4399,6 +4444,7 @@ class GanttChart {
|
|
|
4399
4444
|
constructor(parent) {
|
|
4400
4445
|
this.isExpandCollapseFromChart = false;
|
|
4401
4446
|
this.isExpandAll = false;
|
|
4447
|
+
this.isCollapseAll = false;
|
|
4402
4448
|
this.isGanttElement = false;
|
|
4403
4449
|
this.parent = parent;
|
|
4404
4450
|
this.chartTimelineContainer = null;
|
|
@@ -4748,6 +4794,42 @@ class GanttChart {
|
|
|
4748
4794
|
if (this.parent.editSettings.allowTaskbarEditing) {
|
|
4749
4795
|
this.parent.notify('chartMouseUp', e);
|
|
4750
4796
|
}
|
|
4797
|
+
if (!this.parent.editSettings.allowEditing) {
|
|
4798
|
+
let isTaskbarEdited = false;
|
|
4799
|
+
if (this.parent.editSettings.allowTaskbarEditing &&
|
|
4800
|
+
getValue('editModule.taskbarEditModule.isMouseDragged', this.parent) &&
|
|
4801
|
+
getValue('editModule.taskbarEditModule.taskBarEditAction', this.parent)) {
|
|
4802
|
+
isTaskbarEdited = true;
|
|
4803
|
+
}
|
|
4804
|
+
if (!isTaskbarEdited) {
|
|
4805
|
+
/** Expand/collapse action */
|
|
4806
|
+
const target = e.target;
|
|
4807
|
+
const isOnTaskbarElement = e.target.classList.contains(taskBarMainContainer)
|
|
4808
|
+
|| closest(e.target, '.' + taskBarMainContainer);
|
|
4809
|
+
if (closest(target, '.e-gantt-parent-taskbar') && !this.parent.editSettings.allowEditing) {
|
|
4810
|
+
this.chartExpandCollapseRequest(e);
|
|
4811
|
+
}
|
|
4812
|
+
else if (!isOnTaskbarElement && this.parent.autoFocusTasks) {
|
|
4813
|
+
this.scrollToTarget(e); /** Scroll to task */
|
|
4814
|
+
}
|
|
4815
|
+
}
|
|
4816
|
+
}
|
|
4817
|
+
if (e.type === "touchend") {
|
|
4818
|
+
var resizeCheck = this.parent.ganttChartModule.chartBodyContainer.querySelector('.e-taskbar-resize-div');
|
|
4819
|
+
if (!isNullOrUndefined(resizeCheck)) {
|
|
4820
|
+
resizeCheck.remove();
|
|
4821
|
+
}
|
|
4822
|
+
var Check = this.parent.ganttChartModule.chartBodyContainer.querySelector('.e-clone-taskbar');
|
|
4823
|
+
if (!isNullOrUndefined(Check)) {
|
|
4824
|
+
var clonetbody = Check.parentElement;
|
|
4825
|
+
var cloneTable = clonetbody.parentElement;
|
|
4826
|
+
cloneTable.remove();
|
|
4827
|
+
}
|
|
4828
|
+
var falseline = this.parent.ganttChartModule.chartBodyContainer.querySelector('.e-gantt-false-line');
|
|
4829
|
+
if (!isNullOrUndefined(falseline)) {
|
|
4830
|
+
this.parent.editModule.taskbarEditModule.removeFalseLine(true);
|
|
4831
|
+
}
|
|
4832
|
+
}
|
|
4751
4833
|
}
|
|
4752
4834
|
/**
|
|
4753
4835
|
*
|
|
@@ -5141,10 +5223,23 @@ class GanttChart {
|
|
|
5141
5223
|
if ((isNullOrUndefined(args['gridRow']) && this.parent.enableVirtualization) || isNullOrUndefined(args['chartRow'])) {
|
|
5142
5224
|
return;
|
|
5143
5225
|
}
|
|
5144
|
-
|
|
5226
|
+
let record;
|
|
5227
|
+
if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
5228
|
+
record = this.parent.currentViewData.filter(item => item.ganttProperties[this.parent.taskFields.id] === args['data'][this.parent.taskFields.id])[0];
|
|
5229
|
+
}
|
|
5230
|
+
else {
|
|
5231
|
+
record = getValue('data', args);
|
|
5232
|
+
}
|
|
5145
5233
|
if (this.isExpandCollapseFromChart) {
|
|
5146
5234
|
this.expandCollapseChartRows('collapse', getValue('chartRow', args), record, null);
|
|
5147
|
-
this.parent.
|
|
5235
|
+
const idField = this.parent.taskFields.id;
|
|
5236
|
+
if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
5237
|
+
const gridRec = this.parent.treeGrid.getCurrentViewRecords().filter(function (item) { return item[idField] == args['data'][idField]; })[0];
|
|
5238
|
+
this.parent.treeGrid.collapseRow(getValue('gridRow', args), gridRec);
|
|
5239
|
+
}
|
|
5240
|
+
else {
|
|
5241
|
+
this.parent.treeGrid.collapseRow(getValue('gridRow', args), record);
|
|
5242
|
+
}
|
|
5148
5243
|
this.isExpandCollapseFromChart = false;
|
|
5149
5244
|
}
|
|
5150
5245
|
else {
|
|
@@ -5191,10 +5286,23 @@ class GanttChart {
|
|
|
5191
5286
|
if ((isNullOrUndefined(args['gridRow']) && this.parent.enableVirtualization) || isNullOrUndefined(args['chartRow'])) {
|
|
5192
5287
|
return;
|
|
5193
5288
|
}
|
|
5194
|
-
|
|
5289
|
+
let record;
|
|
5290
|
+
if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
5291
|
+
record = this.parent.currentViewData.filter(item => item.ganttProperties.taskId == args['data'][this.parent.taskFields.id])[0];
|
|
5292
|
+
}
|
|
5293
|
+
else {
|
|
5294
|
+
record = getValue('data', args);
|
|
5295
|
+
}
|
|
5195
5296
|
if (this.isExpandCollapseFromChart) {
|
|
5196
5297
|
this.expandCollapseChartRows('expand', getValue('chartRow', args), record, null);
|
|
5197
|
-
this.parent.
|
|
5298
|
+
const idField = this.parent.taskFields.id;
|
|
5299
|
+
if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
5300
|
+
const gridRec = this.parent.treeGrid.getCurrentViewRecords().filter(function (item) { return item[idField] == args['data'][idField]; })[0];
|
|
5301
|
+
this.parent.treeGrid.expandRow(getValue('gridRow', args), gridRec);
|
|
5302
|
+
}
|
|
5303
|
+
else {
|
|
5304
|
+
this.parent.treeGrid.expandRow(getValue('gridRow', args), record);
|
|
5305
|
+
}
|
|
5198
5306
|
this.isExpandCollapseFromChart = false;
|
|
5199
5307
|
}
|
|
5200
5308
|
else {
|
|
@@ -5293,9 +5401,11 @@ class GanttChart {
|
|
|
5293
5401
|
this.parent.treeGrid.expandAll();
|
|
5294
5402
|
}
|
|
5295
5403
|
else {
|
|
5404
|
+
this.isCollapseAll = true;
|
|
5296
5405
|
this.parent.treeGrid.collapseAll();
|
|
5297
5406
|
}
|
|
5298
5407
|
this.isExpandAll = false;
|
|
5408
|
+
this.isCollapseAll = false;
|
|
5299
5409
|
}
|
|
5300
5410
|
/**
|
|
5301
5411
|
* Public method to expand particular level of rows.
|
|
@@ -5778,7 +5888,7 @@ class GanttChart {
|
|
|
5778
5888
|
childElement = element;
|
|
5779
5889
|
}
|
|
5780
5890
|
}
|
|
5781
|
-
if (element.classList.contains('e-right-label-temp-container') || element.classList.contains('e-left-label-temp-container') || element.classList.contains('e-indicator-span')) {
|
|
5891
|
+
if (element.classList.contains('e-right-label-temp-container') || element.classList.contains('e-left-label-temp-container') || element.classList.contains('e-indicator-span') || element.classList.contains("e-timeline-header-container")) {
|
|
5782
5892
|
if (focus === 'add') {
|
|
5783
5893
|
element.setAttribute('tabIndex', '0');
|
|
5784
5894
|
addClass([element], 'e-active-container');
|
|
@@ -5842,7 +5952,13 @@ class GanttChart {
|
|
|
5842
5952
|
recordIndex = this.parent.flatData.indexOf(record);
|
|
5843
5953
|
}
|
|
5844
5954
|
else {
|
|
5845
|
-
|
|
5955
|
+
if (this.parent.pdfExportModule && this.parent.pdfExportModule.helper.exportProps && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings &&
|
|
5956
|
+
this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth && this.parent.pdfExportModule.isPdfExport) {
|
|
5957
|
+
recordIndex = this.parent.ids.indexOf(record.ganttProperties.taskId.toString());
|
|
5958
|
+
}
|
|
5959
|
+
else {
|
|
5960
|
+
recordIndex = this.parent.currentViewData.indexOf(record);
|
|
5961
|
+
}
|
|
5846
5962
|
}
|
|
5847
5963
|
}
|
|
5848
5964
|
return recordIndex;
|
|
@@ -5917,7 +6033,9 @@ class Timeline {
|
|
|
5917
6033
|
*/
|
|
5918
6034
|
refreshTimelineByTimeSpan() {
|
|
5919
6035
|
this.validateTimelineProp();
|
|
5920
|
-
this.parent.
|
|
6036
|
+
if (!this.parent.pdfExportModule || (this.parent.pdfExportModule && !this.parent.pdfExportModule.isPdfExport) || (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps && !this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth)) {
|
|
6037
|
+
this.parent.ganttChartModule.chartTimelineContainer.innerHTML = '';
|
|
6038
|
+
}
|
|
5921
6039
|
this.createTimelineSeries();
|
|
5922
6040
|
}
|
|
5923
6041
|
/**
|
|
@@ -6231,7 +6349,10 @@ class Timeline {
|
|
|
6231
6349
|
this.customTimelineSettings.topTier.format = this.validateFormat(this.topTier, this.customTimelineSettings.topTier.format);
|
|
6232
6350
|
this.customTimelineSettings.weekStartDay = this.customTimelineSettings.weekStartDay >= 0 &&
|
|
6233
6351
|
this.customTimelineSettings.weekStartDay <= 6 ? this.customTimelineSettings.weekStartDay : 0;
|
|
6234
|
-
this.
|
|
6352
|
+
if (!(this.parent.pdfExportModule && this.parent.pdfExportModule.helper.exportProps &&
|
|
6353
|
+
this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth)) {
|
|
6354
|
+
this.checkCurrentZoomingLevel();
|
|
6355
|
+
}
|
|
6235
6356
|
}
|
|
6236
6357
|
/**
|
|
6237
6358
|
* To find the current zooming level of the Gantt control.
|
|
@@ -6476,13 +6597,15 @@ class Timeline {
|
|
|
6476
6597
|
table = createElement('table', { className: timelineHeaderTableContainer, styles: 'display: block;' });
|
|
6477
6598
|
thead = createElement('thead', { className: timelineHeaderTableBody, styles: 'display:block; border-collapse:collapse' });
|
|
6478
6599
|
tr = createElement('tr', { innerHTML: this.createTimelineTemplate(tier) });
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6600
|
+
if (!this.parent.pdfExportModule || (this.parent.pdfExportModule && !this.parent.pdfExportModule.isPdfExport) || (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps && !this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth)) {
|
|
6601
|
+
td = createElement('th');
|
|
6602
|
+
div = createElement('div', { styles: 'width: 20px' });
|
|
6603
|
+
td.appendChild(div);
|
|
6604
|
+
tr.appendChild(td);
|
|
6605
|
+
thead.appendChild(tr);
|
|
6606
|
+
table.appendChild(thead);
|
|
6607
|
+
this.parent.ganttChartModule.chartTimelineContainer.appendChild(table);
|
|
6608
|
+
}
|
|
6486
6609
|
tier = 'bottomTier';
|
|
6487
6610
|
tr = null;
|
|
6488
6611
|
}
|
|
@@ -7520,6 +7643,11 @@ class GanttTreeGrid {
|
|
|
7520
7643
|
this.wireEvents();
|
|
7521
7644
|
}
|
|
7522
7645
|
composeProperties() {
|
|
7646
|
+
this.parent.treeGrid.hasChildMapping = this.parent.taskFields.hasChildMapping;
|
|
7647
|
+
this.parent.treeGrid.loadChildOnDemand = this.parent.loadChildOnDemand;
|
|
7648
|
+
this.parent.treeGrid['isFromGantt'] = true;
|
|
7649
|
+
this.parent.treeGrid.parentIdMapping = this.parent.taskFields.parentID;
|
|
7650
|
+
this.parent.treeGrid.idMapping = this.parent.taskFields.id;
|
|
7523
7651
|
this.parent.treeGrid.showColumnMenu = this.parent.showColumnMenu;
|
|
7524
7652
|
this.parent.treeGrid.enableCollapseAll = this.parent.collapseAllParentTasks;
|
|
7525
7653
|
this.parent.treeGrid.columnMenuItems = this.parent.columnMenuItems;
|
|
@@ -7536,8 +7664,14 @@ class GanttTreeGrid {
|
|
|
7536
7664
|
this.parent.treeGrid.dataSource = { result: this.parent.flatData, count: count };
|
|
7537
7665
|
}
|
|
7538
7666
|
else {
|
|
7539
|
-
this.parent.treeGrid.hasChildMapping
|
|
7540
|
-
|
|
7667
|
+
if (!this.parent.treeGrid.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
7668
|
+
this.parent.autoCalculateDateScheduling = false;
|
|
7669
|
+
this.parent.treeGrid.dataSource = this.parent.dataSource;
|
|
7670
|
+
}
|
|
7671
|
+
else {
|
|
7672
|
+
this.parent.treeGrid.hasChildMapping = null;
|
|
7673
|
+
this.parent.treeGrid.dataSource = this.parent.flatData;
|
|
7674
|
+
}
|
|
7541
7675
|
}
|
|
7542
7676
|
this.parent.treeGrid.expandStateMapping = this.parent.taskFields.expandState;
|
|
7543
7677
|
const isGantt = 'isGantt';
|
|
@@ -7698,7 +7832,7 @@ class GanttTreeGrid {
|
|
|
7698
7832
|
collapsedArgs = this.createExpandCollapseArgs(args, null);
|
|
7699
7833
|
this.parent.ganttChartModule.collapsedGanttRow(collapsedArgs);
|
|
7700
7834
|
}
|
|
7701
|
-
if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && collapsedArgs['gridRow']) {
|
|
7835
|
+
if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && !this.parent.ganttChartModule.isCollapseAll && collapsedArgs['gridRow']) {
|
|
7702
7836
|
collapsedArgs['gridRow'].style.height = collapsedArgs['chartRow'].style.height;
|
|
7703
7837
|
this.parent.contentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
|
|
7704
7838
|
this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
|
|
@@ -7728,7 +7862,7 @@ class GanttTreeGrid {
|
|
|
7728
7862
|
expandedArgs = this.createExpandCollapseArgs(args, null);
|
|
7729
7863
|
this.parent.ganttChartModule.expandedGanttRow(expandedArgs);
|
|
7730
7864
|
}
|
|
7731
|
-
if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && args['row']) {
|
|
7865
|
+
if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && !this.parent.ganttChartModule.isExpandAll && args['row']) {
|
|
7732
7866
|
args['row'].style.height = this.parent.rowHeight + 'px';
|
|
7733
7867
|
this.parent.contentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
|
|
7734
7868
|
this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
|
|
@@ -8292,6 +8426,9 @@ class GanttTreeGrid {
|
|
|
8292
8426
|
if (!isNullOrUndefined(ganttProp)) {
|
|
8293
8427
|
return this.parent.dataOperation.getDurationString(ganttProp.duration, ganttProp.durationUnit);
|
|
8294
8428
|
}
|
|
8429
|
+
else if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
8430
|
+
return this.parent.dataOperation.getDurationString(parseInt(data[this.parent.taskFields.duration]), this.parent.durationUnit);
|
|
8431
|
+
}
|
|
8295
8432
|
return '';
|
|
8296
8433
|
} // eslint-disable-next-line
|
|
8297
8434
|
resourceValueAccessor(field, data, column) {
|
|
@@ -8328,12 +8465,7 @@ class GanttTreeGrid {
|
|
|
8328
8465
|
}
|
|
8329
8466
|
updateScrollTop(args) {
|
|
8330
8467
|
let newScrollTop;
|
|
8331
|
-
|
|
8332
|
-
newScrollTop = getValue('top', args) - document.getElementsByClassName('e-chart-scroll-container e-content')[0]['offsetHeight'];
|
|
8333
|
-
}
|
|
8334
|
-
else {
|
|
8335
|
-
newScrollTop = getValue('top', args);
|
|
8336
|
-
}
|
|
8468
|
+
newScrollTop = getValue('top', args);
|
|
8337
8469
|
this.treeGridElement.querySelector('.e-content').scrollTop = newScrollTop;
|
|
8338
8470
|
this.previousScroll.top = this.treeGridElement.querySelector('.e-content').scrollTop;
|
|
8339
8471
|
}
|
|
@@ -8645,6 +8777,9 @@ __decorate$12([
|
|
|
8645
8777
|
__decorate$12([
|
|
8646
8778
|
Property(null)
|
|
8647
8779
|
], TaskFields.prototype, "parentID", void 0);
|
|
8780
|
+
__decorate$12([
|
|
8781
|
+
Property(null)
|
|
8782
|
+
], TaskFields.prototype, "hasChildMapping", void 0);
|
|
8648
8783
|
__decorate$12([
|
|
8649
8784
|
Property(null)
|
|
8650
8785
|
], TaskFields.prototype, "startDate", void 0);
|
|
@@ -9144,16 +9279,16 @@ class ChartRows extends DateProcessor {
|
|
|
9144
9279
|
return splitTasks;
|
|
9145
9280
|
}
|
|
9146
9281
|
getSplitTaskbarLeftResizerNode() {
|
|
9147
|
-
const lResizerLeft =
|
|
9282
|
+
const lResizerLeft = (!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? 5 : -2;
|
|
9148
9283
|
const template = '<div class="' + taskBarLeftResizer + ' ' + icon + '"' +
|
|
9149
|
-
' style="' + (this.parent.enableRtl ? 'right:' : 'left:') + lResizerLeft + 'px;height:' + (this.taskBarHeight) + 'px;"></div>';
|
|
9284
|
+
' style="' + (this.parent.enableRtl ? 'right:' : 'left:') + lResizerLeft + 'px;height:' + (this.taskBarHeight) + 'px;z-index:1"></div>';
|
|
9150
9285
|
return template;
|
|
9151
9286
|
}
|
|
9152
9287
|
getSplitTaskbarRightResizerNode(segment) {
|
|
9153
|
-
const rResizerLeft =
|
|
9288
|
+
const rResizerLeft = (!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? -17 : -10;
|
|
9154
9289
|
const template = '<div class="' + taskBarRightResizer + ' ' + icon + '"' +
|
|
9155
9290
|
' style="' + (this.parent.enableRtl ? 'right:' : 'left:') + (segment.width + rResizerLeft) + 'px;' +
|
|
9156
|
-
'height:' + (this.taskBarHeight) + 'px;"></div>';
|
|
9291
|
+
'height:' + (this.taskBarHeight) + 'px;z-index:1"></div>';
|
|
9157
9292
|
return template;
|
|
9158
9293
|
}
|
|
9159
9294
|
getSplitProgressResizerNode(segment) {
|
|
@@ -9478,7 +9613,7 @@ class ChartRows extends DateProcessor {
|
|
|
9478
9613
|
}
|
|
9479
9614
|
else {
|
|
9480
9615
|
const template = '<div class="' + traceMilestone + '" style="width:' + ((this.parent.renderBaseline ? this.taskBarHeight : this.taskBarHeight - 6)) + 'px;height:' +
|
|
9481
|
-
((this.parent.renderBaseline ? this.taskBarHeight : this.taskBarHeight - 6)) + 'px;position:absolute;transform: rotate(45deg);
|
|
9616
|
+
((this.parent.renderBaseline ? this.taskBarHeight : this.taskBarHeight - 6)) + 'px;position:absolute;transform: rotate(45deg);left:' + 1 + 'px;"> </div>';
|
|
9482
9617
|
milestoneNode = this.createDivElement(template);
|
|
9483
9618
|
}
|
|
9484
9619
|
return milestoneNode;
|
|
@@ -9856,16 +9991,16 @@ class ChartRows extends DateProcessor {
|
|
|
9856
9991
|
return this.createDivElement(template);
|
|
9857
9992
|
}
|
|
9858
9993
|
childTaskbarLeftResizer() {
|
|
9859
|
-
const lResizerLeft =
|
|
9994
|
+
const lResizerLeft = (!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? 5 : -2;
|
|
9860
9995
|
const template = '<div class="' + taskBarLeftResizer + ' ' + icon + '"' +
|
|
9861
|
-
'style="' + (this.parent.enableRtl ? 'right:' : 'left:') + lResizerLeft + 'px;height:' + (this.taskBarHeight) + 'px;"></div>';
|
|
9996
|
+
'style="' + (this.parent.enableRtl ? 'right:' : 'left:') + lResizerLeft + 'px;height:' + (this.taskBarHeight) + 'px;z-index:1"></div>';
|
|
9862
9997
|
return this.createDivElement(template);
|
|
9863
9998
|
}
|
|
9864
9999
|
childTaskbarRightResizer() {
|
|
9865
|
-
const rResizerLeft =
|
|
10000
|
+
const rResizerLeft = (!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? -17 : -10;
|
|
9866
10001
|
const template = '<div class="' + taskBarRightResizer + ' ' + icon + '"' +
|
|
9867
10002
|
'style="' + (this.parent.enableRtl ? 'right:' : 'left:') + (this.templateData.ganttProperties.width + rResizerLeft) + 'px;' +
|
|
9868
|
-
'height:' + (this.taskBarHeight) + 'px;"></div>';
|
|
10003
|
+
'height:' + (this.taskBarHeight) + 'px;z-index:1"></div>';
|
|
9869
10004
|
return this.createDivElement(template);
|
|
9870
10005
|
}
|
|
9871
10006
|
childTaskbarProgressResizer() {
|
|
@@ -9879,8 +10014,10 @@ class ChartRows extends DateProcessor {
|
|
|
9879
10014
|
}
|
|
9880
10015
|
getLeftPointNode() {
|
|
9881
10016
|
const data = this.templateData;
|
|
9882
|
-
|
|
9883
|
-
|
|
10017
|
+
let left = (!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? 12 : 0;
|
|
10018
|
+
let mileStoneLeftValue = (!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? 6 : 3;
|
|
10019
|
+
const pointerLeft = -(3 + this.connectorPointWidth + left);
|
|
10020
|
+
const mileStoneLeft = -(this.connectorPointWidth + 4 + mileStoneLeftValue);
|
|
9884
10021
|
const pointerTop = Math.floor(this.milesStoneRadius - (this.connectorPointWidth / 2));
|
|
9885
10022
|
let marginTop;
|
|
9886
10023
|
if ((!this.templateData.ganttProperties.isAutoSchedule && this.templateData.hasChildRecords) && this.parent.allowParentDependency) {
|
|
@@ -9899,7 +10036,8 @@ class ChartRows extends DateProcessor {
|
|
|
9899
10036
|
}
|
|
9900
10037
|
getRightPointNode() {
|
|
9901
10038
|
const data = this.templateData;
|
|
9902
|
-
|
|
10039
|
+
let right = (!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? -12 : 0;
|
|
10040
|
+
const pointerRight = -(3 + right);
|
|
9903
10041
|
const pointerTop = Math.floor(this.milesStoneRadius - (this.connectorPointWidth / 2));
|
|
9904
10042
|
let marginTop;
|
|
9905
10043
|
if ((!this.templateData.ganttProperties.isAutoSchedule && this.templateData.hasChildRecords) && this.parent.allowParentDependency) {
|
|
@@ -9909,7 +10047,7 @@ class ChartRows extends DateProcessor {
|
|
|
9909
10047
|
marginTop = 'margin-top:' + this.connectorPointMargin + 'px';
|
|
9910
10048
|
}
|
|
9911
10049
|
const template = '<div class="' + rightConnectorPointOuterDiv + '" style="' +
|
|
9912
|
-
((data.ganttProperties.isMilestone) ? ('left:' + (this.milestoneHeight - 2) + 'px;margin-top:' +
|
|
10050
|
+
((data.ganttProperties.isMilestone) ? ('left:' + ((!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? (this.milestoneHeight + 5) : this.milestoneHeight - 2) + 'px;margin-top:' +
|
|
9913
10051
|
pointerTop + 'px;') : ('left:' + (data.ganttProperties.width + pointerRight) + 'px;' + marginTop + ';')) + '">' +
|
|
9914
10052
|
'<div class="' + connectorPointRight + ' ' + this.parent.getUnscheduledTaskClass(data.ganttProperties) +
|
|
9915
10053
|
'" style="width:' + this.connectorPointWidth + 'px;height:' + this.connectorPointWidth + 'px;">' +
|
|
@@ -10082,7 +10220,7 @@ class ChartRows extends DateProcessor {
|
|
|
10082
10220
|
* @private
|
|
10083
10221
|
*/
|
|
10084
10222
|
initChartHelperPrivateVariable() {
|
|
10085
|
-
let taskbarHeightValue = this.parent.renderBaseline ? 0.45 : 0.62;
|
|
10223
|
+
let taskbarHeightValue = this.parent.renderBaseline ? 0.45 : ((!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? 0.7 : 0.62);
|
|
10086
10224
|
let taskBarMarginTopValue = this.parent.renderBaseline ? 4 : 2;
|
|
10087
10225
|
let milestoneHeightValue = this.parent.renderBaseline ? 1.13 : 0.82;
|
|
10088
10226
|
this.baselineColor = !isNullOrUndefined(this.parent.baselineColor) &&
|
|
@@ -10104,8 +10242,8 @@ class ChartRows extends DateProcessor {
|
|
|
10104
10242
|
this.milestoneMarginTop = Math.floor((this.parent.rowHeight - this.milestoneHeight) / 2);
|
|
10105
10243
|
this.milesStoneRadius = Math.floor((this.milestoneHeight) / 2);
|
|
10106
10244
|
this.baselineTop = -(Math.floor((this.parent.rowHeight - (this.taskBarHeight + this.taskBarMarginTop))) - 4);
|
|
10107
|
-
this.connectorPointWidth = this.parent.isAdaptive ? Math.round(this.taskBarHeight / 2) :
|
|
10108
|
-
this.connectorPointMargin = Math.floor((this.taskBarHeight / 2) - (this.connectorPointWidth / 2))
|
|
10245
|
+
this.connectorPointWidth = this.parent.isAdaptive ? Math.round(this.taskBarHeight / 2) : 8;
|
|
10246
|
+
this.connectorPointMargin = Math.floor((this.taskBarHeight / 2) - (this.connectorPointWidth / 2));
|
|
10109
10247
|
}
|
|
10110
10248
|
/**
|
|
10111
10249
|
* Function used to refresh Gantt rows.
|
|
@@ -10393,8 +10531,20 @@ class ChartRows extends DateProcessor {
|
|
|
10393
10531
|
const dataSource = this.parent.treeGrid.getCurrentViewRecords();
|
|
10394
10532
|
const visualData = this.parent.virtualScrollModule && this.parent.enableVirtualization ?
|
|
10395
10533
|
getValue('virtualScrollModule.visualData', this.parent.treeGrid) : dataSource;
|
|
10396
|
-
|
|
10397
|
-
|
|
10534
|
+
let index;
|
|
10535
|
+
if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
10536
|
+
let gridData = this.parent.treeGrid.grid.contentModule['rows'];
|
|
10537
|
+
const data = gridData.filter((x) => {
|
|
10538
|
+
if (x['data'][this.parent.taskFields.id] === tempTemplateData.ganttProperties.taskId) {
|
|
10539
|
+
return x;
|
|
10540
|
+
}
|
|
10541
|
+
})[0];
|
|
10542
|
+
tRow.setAttribute('aria-rowindex', data['index'].toString());
|
|
10543
|
+
}
|
|
10544
|
+
else {
|
|
10545
|
+
index = visualData.indexOf(tempTemplateData);
|
|
10546
|
+
tRow.setAttribute('aria-rowindex', index.toString());
|
|
10547
|
+
}
|
|
10398
10548
|
}
|
|
10399
10549
|
/**
|
|
10400
10550
|
* To trigger query taskbar info event.
|
|
@@ -10769,8 +10919,11 @@ class ChartRows extends DateProcessor {
|
|
|
10769
10919
|
this.triggerQueryTaskbarInfoByIndex(tr, data);
|
|
10770
10920
|
}
|
|
10771
10921
|
const dataId = this.parent.viewType === 'ProjectView' ? data.ganttProperties.taskId : data.ganttProperties.rowUniqueID;
|
|
10772
|
-
this.parent.
|
|
10773
|
-
|
|
10922
|
+
if (!this.parent.ganttChartModule.isExpandAll && !this.parent.ganttChartModule.isCollapseAll) {
|
|
10923
|
+
this.parent.treeGrid.grid.setRowData(dataId, data);
|
|
10924
|
+
}
|
|
10925
|
+
if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && !data.expanded && this.parent.enableMultiTaskbar && !this.parent.allowTaskbarOverlap &&
|
|
10926
|
+
!this.parent.ganttChartModule.isCollapseAll && !this.parent.ganttChartModule.isExpandAll) {
|
|
10774
10927
|
this.updateDragDropRecords(selectedItem, tr);
|
|
10775
10928
|
}
|
|
10776
10929
|
if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && this.parent.showOverAllocation && !this.parent.allowTaskbarOverlap) {
|
|
@@ -10963,6 +11116,7 @@ class Dependency {
|
|
|
10963
11116
|
this.parentRecord = [];
|
|
10964
11117
|
this.parentIds = [];
|
|
10965
11118
|
this.parentPredecessors = [];
|
|
11119
|
+
this.validatedParentIds = [];
|
|
10966
11120
|
this.parent = gantt;
|
|
10967
11121
|
this.dateValidateModule = this.parent.dateValidationModule;
|
|
10968
11122
|
}
|
|
@@ -11576,14 +11730,32 @@ class Dependency {
|
|
|
11576
11730
|
* @private
|
|
11577
11731
|
*/
|
|
11578
11732
|
createConnectorLinesCollection(records) {
|
|
11579
|
-
|
|
11733
|
+
let ganttRecords = records ? records : this.parent.currentViewData;
|
|
11734
|
+
if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings &&
|
|
11735
|
+
this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth && this.parent.pdfExportModule.isPdfExport) {
|
|
11736
|
+
ganttRecords = this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneCurrentViewData'];
|
|
11737
|
+
}
|
|
11580
11738
|
const recordLength = ganttRecords.length;
|
|
11581
11739
|
let count;
|
|
11582
11740
|
let ganttRecord;
|
|
11583
11741
|
let predecessorsCollection;
|
|
11584
|
-
this.parent.
|
|
11585
|
-
this.parent.
|
|
11742
|
+
if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings &&
|
|
11743
|
+
this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth && this.parent.pdfExportModule.isPdfExport) {
|
|
11744
|
+
this.parent.connectorLineModule.expandedRecords = this.parent.virtualScrollModule && this.parent.enableVirtualization ?
|
|
11745
|
+
this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData'] : this.parent.getExpandedRecords(this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData']);
|
|
11746
|
+
}
|
|
11747
|
+
else {
|
|
11748
|
+
this.parent.connectorLineModule.expandedRecords = this.parent.virtualScrollModule && this.parent.enableVirtualization ?
|
|
11749
|
+
this.parent.updatedRecords : this.parent.getExpandedRecords(this.parent.updatedRecords);
|
|
11750
|
+
}
|
|
11586
11751
|
for (count = 0; count < recordLength; count++) {
|
|
11752
|
+
if (this.parent.editModule && this.parent.editModule.deletedTaskDetails.length > 0) {
|
|
11753
|
+
if (ganttRecords[count].parentItem) {
|
|
11754
|
+
const parentItem = this.parent.getRecordByID(ganttRecords[count].parentItem.taskId.toString());
|
|
11755
|
+
this.parent.setRecordValue('parentItem', this.parent.dataOperation.getCloneParent(parentItem), ganttRecords[count]);
|
|
11756
|
+
}
|
|
11757
|
+
ganttRecords[count].index = count;
|
|
11758
|
+
}
|
|
11587
11759
|
ganttRecord = ganttRecords[count];
|
|
11588
11760
|
predecessorsCollection = ganttRecord.ganttProperties.predecessor;
|
|
11589
11761
|
if (predecessorsCollection) {
|
|
@@ -11731,36 +11903,35 @@ class Dependency {
|
|
|
11731
11903
|
this.validatePredecessor(record, undefined, 'successor');
|
|
11732
11904
|
}
|
|
11733
11905
|
}
|
|
11734
|
-
if (record && record.
|
|
11735
|
-
|
|
11736
|
-
|
|
11737
|
-
|
|
11738
|
-
|
|
11739
|
-
|
|
11740
|
-
|
|
11741
|
-
|
|
11742
|
-
|
|
11743
|
-
|
|
11744
|
-
|
|
11745
|
-
|
|
11746
|
-
|
|
11747
|
-
|
|
11906
|
+
if (record && !record.hasChildRecords && record.parentItem && this.validatedParentIds.indexOf(record.parentItem.taskId) == -1) {
|
|
11907
|
+
this.validatedParentIds.push(record.parentItem.taskId);
|
|
11908
|
+
}
|
|
11909
|
+
|
|
11910
|
+
let validUpdate = true;
|
|
11911
|
+
if (record && record.hasChildRecords && this.validatedParentIds.indexOf(record.ganttProperties.taskId.toString()) !== -1) {
|
|
11912
|
+
validUpdate = false;
|
|
11913
|
+
}
|
|
11914
|
+
if (validUpdate) {
|
|
11915
|
+
if (record && record.ganttProperties.taskId !== this.isValidatedParentTaskID && ganttProp) {
|
|
11916
|
+
if ((taskBarModule.taskBarEditAction !== 'ParentDrag' && taskBarModule.taskBarEditAction !== 'ChildDrag')) {
|
|
11917
|
+
if (!ganttProp.hasChildRecords && record.hasChildRecords) {
|
|
11918
|
+
this.parent.editModule['updateChildItems'](record);
|
|
11919
|
+
this.isValidatedParentTaskID = record.ganttProperties.taskId;
|
|
11920
|
+
}
|
|
11921
|
+
}
|
|
11922
|
+
else if ((!record.hasChildRecords && taskBarModule.taskBarEditAction == 'ChildDrag') ||
|
|
11923
|
+
(record.hasChildRecords && taskBarModule.taskBarEditAction == 'ParentDrag')) {
|
|
11748
11924
|
this.parent.editModule['updateChildItems'](record);
|
|
11749
11925
|
this.isValidatedParentTaskID = record.ganttProperties.taskId;
|
|
11750
11926
|
}
|
|
11927
|
+
if (!ganttProp.hasChildRecords) {
|
|
11928
|
+
this.parent.dataOperation.updateParentItems(record, true);
|
|
11929
|
+
}
|
|
11751
11930
|
}
|
|
11752
|
-
else if (
|
|
11753
|
-
(validUpdate && taskBarModule.taskBarEditAction == 'ParentDrag')) {
|
|
11931
|
+
else if (record && record.hasChildRecords && !ganttProp) {
|
|
11754
11932
|
this.parent.editModule['updateChildItems'](record);
|
|
11755
|
-
this.isValidatedParentTaskID = record.ganttProperties.taskId;
|
|
11756
|
-
}
|
|
11757
|
-
if (!ganttProp.hasChildRecords) {
|
|
11758
|
-
this.parent.dataOperation.updateParentItems(record, true);
|
|
11759
11933
|
}
|
|
11760
11934
|
}
|
|
11761
|
-
else if (record && record.hasChildRecords && !ganttProp) {
|
|
11762
|
-
this.parent.editModule['updateChildItems'](record);
|
|
11763
|
-
}
|
|
11764
11935
|
}
|
|
11765
11936
|
}
|
|
11766
11937
|
/**
|
|
@@ -11841,7 +12012,7 @@ class ConnectorLine {
|
|
|
11841
12012
|
}
|
|
11842
12013
|
getTaskbarMidpoint(isMilestone) {
|
|
11843
12014
|
return Math.floor(isMilestone ?
|
|
11844
|
-
(this.parent.chartRowsModule.milestoneMarginTop + (this.parent.chartRowsModule.milestoneHeight / 2))
|
|
12015
|
+
(this.parent.chartRowsModule.milestoneMarginTop + (this.parent.chartRowsModule.milestoneHeight / 2)) :
|
|
11845
12016
|
(this.parent.chartRowsModule.taskBarMarginTop + (this.parent.chartRowsModule.taskBarHeight / 2))) + 1;
|
|
11846
12017
|
}
|
|
11847
12018
|
/**
|
|
@@ -11855,14 +12026,45 @@ class ConnectorLine {
|
|
|
11855
12026
|
*/
|
|
11856
12027
|
createConnectorLineObject(parentGanttData, childGanttData, predecessor) {
|
|
11857
12028
|
const connectorObj = {};
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
12029
|
+
let updatedRecords;
|
|
12030
|
+
if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps &&
|
|
12031
|
+
this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
12032
|
+
updatedRecords = this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport ?
|
|
12033
|
+
this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData'] : this.expandedRecords;
|
|
12034
|
+
}
|
|
12035
|
+
else {
|
|
12036
|
+
updatedRecords = this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport ?
|
|
12037
|
+
this.parent.flatData : this.expandedRecords;
|
|
12038
|
+
}
|
|
12039
|
+
let parentIndex;
|
|
12040
|
+
let childIndex;
|
|
12041
|
+
if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps &&
|
|
12042
|
+
this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
12043
|
+
let parentData = this.parent.flatData.filter((data) => {
|
|
12044
|
+
return data.ganttProperties.taskId.toString() == parentGanttData.ganttProperties.taskId.toString();
|
|
12045
|
+
})[0];
|
|
12046
|
+
let childData = this.parent.flatData.filter((data) => {
|
|
12047
|
+
return data.ganttProperties.taskId.toString() == childGanttData.ganttProperties.taskId.toString();
|
|
12048
|
+
})[0];
|
|
12049
|
+
parentIndex = parentData.index;
|
|
12050
|
+
childIndex = childData.index;
|
|
12051
|
+
}
|
|
12052
|
+
else {
|
|
12053
|
+
parentIndex = updatedRecords.indexOf(parentGanttData);
|
|
12054
|
+
childIndex = updatedRecords.indexOf(childGanttData);
|
|
12055
|
+
}
|
|
11862
12056
|
const parentGanttRecord = parentGanttData.ganttProperties;
|
|
11863
12057
|
const childGanttRecord = childGanttData.ganttProperties;
|
|
11864
|
-
|
|
11865
|
-
|
|
12058
|
+
let currentData;
|
|
12059
|
+
if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps &&
|
|
12060
|
+
this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
12061
|
+
currentData = this.parent.virtualScrollModule && this.parent.enableVirtualization ?
|
|
12062
|
+
this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData'] : this.parent.getExpandedRecords(this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData']);
|
|
12063
|
+
}
|
|
12064
|
+
else {
|
|
12065
|
+
currentData = this.parent.virtualScrollModule && this.parent.enableVirtualization ?
|
|
12066
|
+
this.parent.currentViewData : this.parent.getExpandedRecords(this.parent.currentViewData);
|
|
12067
|
+
}
|
|
11866
12068
|
connectorObj.parentIndexInCurrentView = currentData.indexOf(parentGanttData);
|
|
11867
12069
|
connectorObj.childIndexInCurrentView = currentData.indexOf(childGanttData);
|
|
11868
12070
|
const isVirtualScroll = this.parent.virtualScrollModule && this.parent.enableVirtualization;
|
|
@@ -12647,8 +12849,17 @@ class ConnectorLine {
|
|
|
12647
12849
|
if (isNullOrUndefined(id)) {
|
|
12648
12850
|
return null;
|
|
12649
12851
|
}
|
|
12650
|
-
|
|
12651
|
-
this.parent.
|
|
12852
|
+
if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps &&
|
|
12853
|
+
this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
12854
|
+
let a = this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData'].filter((data) => {
|
|
12855
|
+
return data.ganttProperties.taskId.toString() === id.toString();
|
|
12856
|
+
})[0];
|
|
12857
|
+
return a;
|
|
12858
|
+
}
|
|
12859
|
+
else {
|
|
12860
|
+
return this.parent.viewType === 'ResourceView' ? this.parent.flatData[this.parent.getTaskIds().indexOf('T' + id.toString())] :
|
|
12861
|
+
this.parent.flatData[this.parent.ids.indexOf(id.toString())];
|
|
12862
|
+
}
|
|
12652
12863
|
}
|
|
12653
12864
|
/**
|
|
12654
12865
|
* Method to remove connector line from DOM
|
|
@@ -12974,8 +13185,8 @@ class Tooltip$1 {
|
|
|
12974
13185
|
if (taskbarTemplateNode) {
|
|
12975
13186
|
append(taskbarTemplateNode, tooltipTemplate);
|
|
12976
13187
|
}
|
|
12977
|
-
argsData.content = this.toolTipObj.content = taskbarTemplateNode ? tooltipTemplate :
|
|
12978
|
-
parent.tooltipModule.getTooltipContent((data.ganttProperties.isMilestone ? 'milestone' : 'taskbar'), data, parent, args);
|
|
13188
|
+
argsData.content = this.toolTipObj.content = taskbarTemplateNode ? tooltipTemplate : data ?
|
|
13189
|
+
parent.tooltipModule.getTooltipContent((data.ganttProperties.isMilestone ? 'milestone' : 'taskbar'), data, parent, args) : "";
|
|
12979
13190
|
}
|
|
12980
13191
|
else if (args.target.classList.contains('e-baseline-bar') ||
|
|
12981
13192
|
args.target.classList.contains('e-baseline-gantt-milestone')) {
|
|
@@ -12987,8 +13198,8 @@ class Tooltip$1 {
|
|
|
12987
13198
|
if (baseLineTemplateNode) {
|
|
12988
13199
|
append(baseLineTemplateNode, baselineTemplate);
|
|
12989
13200
|
}
|
|
12990
|
-
argsData.content = this.toolTipObj.content = baseLineTemplateNode ? baselineTemplate :
|
|
12991
|
-
parent.tooltipModule.getTooltipContent((data.ganttProperties.isMilestone ? 'milestone' : 'baseline'), data, parent, args);
|
|
13201
|
+
argsData.content = this.toolTipObj.content = baseLineTemplateNode ? baselineTemplate : data ?
|
|
13202
|
+
parent.tooltipModule.getTooltipContent((data.ganttProperties.isMilestone ? 'milestone' : 'baseline'), data, parent, args) : "";
|
|
12992
13203
|
}
|
|
12993
13204
|
else if (args.target.classList.contains('e-event-markers')) {
|
|
12994
13205
|
argsData.content = this.toolTipObj.content = parent.tooltipModule.getTooltipContent('marker', data, parent, args);
|
|
@@ -13055,7 +13266,7 @@ class Tooltip$1 {
|
|
|
13055
13266
|
// eslint-disable-next-line
|
|
13056
13267
|
tooltipCloseHandler(args) {
|
|
13057
13268
|
this.tooltipMouseEvent = null;
|
|
13058
|
-
if (!this.parent.isAdaptive) {
|
|
13269
|
+
if (!this.parent.isAdaptive && !isNullOrUndefined(this.currentTarget)) {
|
|
13059
13270
|
EventHandler.remove(this.currentTarget, 'mousemove', this.mouseMoveHandler);
|
|
13060
13271
|
}
|
|
13061
13272
|
this.currentTarget = null;
|
|
@@ -14035,6 +14246,7 @@ let Gantt = class Gantt extends Component {
|
|
|
14035
14246
|
createSpinner({ target: this.element }, this.createElement);
|
|
14036
14247
|
this.trigger('load', {});
|
|
14037
14248
|
this.element.classList.add(root);
|
|
14249
|
+
this.rowHeight = (!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? (this.rowHeight === 36) ? 46 : this.rowHeight : this.rowHeight;
|
|
14038
14250
|
if (this.isAdaptive) {
|
|
14039
14251
|
this.element.classList.add(adaptive);
|
|
14040
14252
|
}
|
|
@@ -14578,6 +14790,37 @@ let Gantt = class Gantt extends Component {
|
|
|
14578
14790
|
}
|
|
14579
14791
|
updateCurrentViewData() {
|
|
14580
14792
|
this.currentViewData = this.treeGrid.getCurrentViewRecords().slice();
|
|
14793
|
+
if (!this.loadChildOnDemand && this.taskFields.hasChildMapping && this.currentViewData.length > 0) {
|
|
14794
|
+
this.autoCalculateDateScheduling = false;
|
|
14795
|
+
this.flatData = [];
|
|
14796
|
+
this.dataOperation.taskIds = [];
|
|
14797
|
+
this.ids = [];
|
|
14798
|
+
this.dataOperation.recordIndex = 0;
|
|
14799
|
+
this.dataOperation.dataArray = this.currentViewData;
|
|
14800
|
+
this.dataOperation.cloneDataSource();
|
|
14801
|
+
if (this.predecessorModule && this.taskFields.dependency) {
|
|
14802
|
+
this.predecessorModule['parentIds'] = [];
|
|
14803
|
+
this.predecessorModule['parentRecord'] = [];
|
|
14804
|
+
this.predecessorModule.updatePredecessors();
|
|
14805
|
+
}
|
|
14806
|
+
let gridData = this.treeGrid.grid.contentModule['rows'];
|
|
14807
|
+
const data = gridData.filter((x) => {
|
|
14808
|
+
if (x['data'][this.taskFields.id] === this.flatData[0].ganttProperties.taskId) {
|
|
14809
|
+
return x;
|
|
14810
|
+
}
|
|
14811
|
+
})[0];
|
|
14812
|
+
let index = data['index'];
|
|
14813
|
+
for (let i = 0; i < this.flatData.length; i++) {
|
|
14814
|
+
this.flatData[i].index = index;
|
|
14815
|
+
index++;
|
|
14816
|
+
}
|
|
14817
|
+
this.currentViewData = this.flatData;
|
|
14818
|
+
this.treeGrid.grid.currentViewData = this.flatData;
|
|
14819
|
+
if (!isNullOrUndefined(this.treeGrid['virtualScrollModule'])) {
|
|
14820
|
+
this.treeGrid['virtualScrollModule'].visualData = this.flatData;
|
|
14821
|
+
this.updatedRecords = this.flatData;
|
|
14822
|
+
}
|
|
14823
|
+
}
|
|
14581
14824
|
}
|
|
14582
14825
|
/**
|
|
14583
14826
|
* @param {IGanttData} records -Defines the delete record collections.
|
|
@@ -14597,7 +14840,7 @@ let Gantt = class Gantt extends Component {
|
|
|
14597
14840
|
* @private
|
|
14598
14841
|
*/
|
|
14599
14842
|
updateContentHeight(args) {
|
|
14600
|
-
if (!this.allowTaskbarOverlap && this.viewType === 'ResourceView' && !this.isLoad) {
|
|
14843
|
+
if ((!this.allowTaskbarOverlap && !this.ganttChartModule.isCollapseAll && !this.ganttChartModule.isExpandAll) && this.viewType === 'ResourceView' && !this.isLoad) {
|
|
14601
14844
|
return;
|
|
14602
14845
|
}
|
|
14603
14846
|
else {
|
|
@@ -14961,6 +15204,9 @@ let Gantt = class Gantt extends Component {
|
|
|
14961
15204
|
else {
|
|
14962
15205
|
this.getCurrentRecords(args);
|
|
14963
15206
|
}
|
|
15207
|
+
if (!this.loadChildOnDemand && this.taskFields.hasChildMapping) {
|
|
15208
|
+
this.updateContentHeight();
|
|
15209
|
+
}
|
|
14964
15210
|
if (this.enableCriticalPath && this.criticalPathModule) {
|
|
14965
15211
|
this.criticalPathModule.showCriticalPath(this.enableCriticalPath);
|
|
14966
15212
|
}
|
|
@@ -14976,6 +15222,9 @@ let Gantt = class Gantt extends Component {
|
|
|
14976
15222
|
}
|
|
14977
15223
|
this.initialChartRowElements = this.ganttChartModule.getChartRows();
|
|
14978
15224
|
this.isLoad = false;
|
|
15225
|
+
if (!this.loadChildOnDemand && this.taskFields.hasChildMapping) {
|
|
15226
|
+
this.autoCalculateDateScheduling = true;
|
|
15227
|
+
}
|
|
14979
15228
|
this.trigger('dataBound', args);
|
|
14980
15229
|
}
|
|
14981
15230
|
/**
|
|
@@ -15239,7 +15488,14 @@ let Gantt = class Gantt extends Component {
|
|
|
15239
15488
|
if (prop === 'locale') {
|
|
15240
15489
|
this.isLocaleChanged = true;
|
|
15241
15490
|
}
|
|
15242
|
-
|
|
15491
|
+
if (prop === 'taskFields') {
|
|
15492
|
+
if (!isNullOrUndefined(newProp.taskFields.child)) {
|
|
15493
|
+
return;
|
|
15494
|
+
}
|
|
15495
|
+
}
|
|
15496
|
+
if (prop !== 'allowTaskbarDragAndDrop') {
|
|
15497
|
+
isRefresh = true;
|
|
15498
|
+
}
|
|
15243
15499
|
break;
|
|
15244
15500
|
case 'validateManualTasksOnLinking':
|
|
15245
15501
|
this.validateManualTasksOnLinking = newProp.validateManualTasksOnLinking;
|
|
@@ -15919,6 +16175,9 @@ let Gantt = class Gantt extends Component {
|
|
|
15919
16175
|
* @returns {Promise<any>} .
|
|
15920
16176
|
*/
|
|
15921
16177
|
pdfExport(pdfExportProperties, isMultipleExport, pdfDoc, isBlob) {
|
|
16178
|
+
if (pdfExportProperties && pdfExportProperties.fitToWidthSettings && pdfExportProperties.fitToWidthSettings.isFitToWidth) {
|
|
16179
|
+
pdfExportProperties.pageOrientation == 'Landscape';
|
|
16180
|
+
}
|
|
15922
16181
|
return this.pdfExportModule ? this.pdfExportModule.export(pdfExportProperties, isMultipleExport, pdfDoc, isBlob)
|
|
15923
16182
|
: null;
|
|
15924
16183
|
}
|
|
@@ -16007,14 +16266,17 @@ let Gantt = class Gantt extends Component {
|
|
|
16007
16266
|
this.isTimelineRoundOff = isTimelineRoundOff;
|
|
16008
16267
|
this.timelineModule.refreshTimelineByTimeSpan();
|
|
16009
16268
|
this.dataOperation.reUpdateGanttDataPosition();
|
|
16010
|
-
this.
|
|
16011
|
-
|
|
16012
|
-
|
|
16013
|
-
|
|
16014
|
-
this.ganttChartModule.
|
|
16015
|
-
|
|
16016
|
-
|
|
16017
|
-
|
|
16269
|
+
if (!this.pdfExportModule || (this.pdfExportModule && !this.pdfExportModule.isPdfExport) || (this.pdfExportModule && this.pdfExportModule.isPdfExport && this.pdfExportModule.helper.exportProps &&
|
|
16270
|
+
this.pdfExportModule.helper.exportProps.fitToWidthSettings && !this.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth)) {
|
|
16271
|
+
this.timelineModule.updateChartByNewTimeline();
|
|
16272
|
+
this.ganttChartModule.chartBodyContent.style.width = formatUnit(this.timelineModule.totalTimelineWidth);
|
|
16273
|
+
this.ganttChartModule.updateLastRowBottomWidth();
|
|
16274
|
+
if (this.taskFields.dependency) {
|
|
16275
|
+
this.ganttChartModule.reRenderConnectorLines();
|
|
16276
|
+
}
|
|
16277
|
+
if (isFrom !== 'beforeAdd') {
|
|
16278
|
+
this.notify('selectRowByIndex', {});
|
|
16279
|
+
}
|
|
16018
16280
|
}
|
|
16019
16281
|
}
|
|
16020
16282
|
/**
|
|
@@ -16593,7 +16855,13 @@ let Gantt = class Gantt extends Component {
|
|
|
16593
16855
|
*/
|
|
16594
16856
|
getRowByID(id) {
|
|
16595
16857
|
const record = this.getRecordByID(id.toString());
|
|
16596
|
-
|
|
16858
|
+
let index;
|
|
16859
|
+
if (!this.loadChildOnDemand && this.taskFields.hasChildMapping) {
|
|
16860
|
+
index = this.updatedRecords.map(item => item[this.taskFields.id]).indexOf(record.ganttProperties.taskId);
|
|
16861
|
+
}
|
|
16862
|
+
else {
|
|
16863
|
+
index = this.updatedRecords.indexOf(record);
|
|
16864
|
+
}
|
|
16597
16865
|
if (index !== -1) {
|
|
16598
16866
|
return this.getRowByIndex(index);
|
|
16599
16867
|
}
|
|
@@ -17054,6 +17322,9 @@ __decorate([
|
|
|
17054
17322
|
__decorate([
|
|
17055
17323
|
Property(true)
|
|
17056
17324
|
], Gantt.prototype, "enableVirtualMaskRow", void 0);
|
|
17325
|
+
__decorate([
|
|
17326
|
+
Property(false)
|
|
17327
|
+
], Gantt.prototype, "loadChildOnDemand", void 0);
|
|
17057
17328
|
__decorate([
|
|
17058
17329
|
Property(true)
|
|
17059
17330
|
], Gantt.prototype, "UpdateOffsetOnTaskbarEdit", void 0);
|
|
@@ -17557,7 +17828,7 @@ class CellEdit {
|
|
|
17557
17828
|
args.cancel = true;
|
|
17558
17829
|
return;
|
|
17559
17830
|
}
|
|
17560
|
-
if (data.hasChildRecords && ((field === taskSettings.endDate && ((!isNullOrUndefined(data['isManual']) &&
|
|
17831
|
+
if (data.hasChildRecords && !this.parent.allowParentDependency && ((field === taskSettings.endDate && ((!isNullOrUndefined(data['isManual']) &&
|
|
17561
17832
|
data['isManual'] === false) || this.parent.taskMode === 'Auto')) || field === taskSettings.duration
|
|
17562
17833
|
|| field === taskSettings.dependency || field === taskSettings.progress || field === taskSettings.work || field === 'taskType')) {
|
|
17563
17834
|
if ((field === taskSettings.dependency && !this.parent.allowParentDependency) || field !== taskSettings.dependency) {
|
|
@@ -17856,6 +18127,9 @@ class CellEdit {
|
|
|
17856
18127
|
* @returns {void} .
|
|
17857
18128
|
*/
|
|
17858
18129
|
durationEdited(args) {
|
|
18130
|
+
if (parseInt(args.data[this.parent.taskFields.duration]) < 0) {
|
|
18131
|
+
args.data[this.parent.taskFields.duration] = 0;
|
|
18132
|
+
}
|
|
17859
18133
|
const ganttProb = args.data.ganttProperties;
|
|
17860
18134
|
const durationString = args.data[this.parent.taskFields.duration];
|
|
17861
18135
|
this.parent.dataOperation.updateDurationValue(durationString, ganttProb);
|
|
@@ -18123,6 +18397,7 @@ class EditTooltip {
|
|
|
18123
18397
|
* @returns {void} .
|
|
18124
18398
|
*/
|
|
18125
18399
|
updateTooltipPosition(args) {
|
|
18400
|
+
args.element.style.visibility = 'visible';
|
|
18126
18401
|
const parentWithZoomStyle = this.parent.element.closest('[style*="zoom"]');
|
|
18127
18402
|
if (isNullOrUndefined(parentWithZoomStyle)) {
|
|
18128
18403
|
const containerPosition = this.parent.getOffsetRect(this.parent.chartPane);
|
|
@@ -18132,8 +18407,8 @@ class EditTooltip {
|
|
|
18132
18407
|
tooltipPositionX += leftEnd - (tooltipPositionX + args.element.offsetWidth);
|
|
18133
18408
|
}
|
|
18134
18409
|
args.element.style.left = tooltipPositionX + 'px';
|
|
18410
|
+
args.element.style.visibility = 'visible';
|
|
18135
18411
|
}
|
|
18136
|
-
args.element.style.visibility = 'visible';
|
|
18137
18412
|
}
|
|
18138
18413
|
/**
|
|
18139
18414
|
* To show/hide taskbar edit tooltip.
|
|
@@ -18364,13 +18639,10 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18364
18639
|
mouseDownHandler(e) {
|
|
18365
18640
|
if (this.parent.editSettings.allowTaskbarEditing && !this.parent.readOnly) {
|
|
18366
18641
|
this.canDrag = false;
|
|
18367
|
-
if (this.
|
|
18642
|
+
if (this.taskBarEditElement) {
|
|
18368
18643
|
const targetElement = this.getElementByPosition(e);
|
|
18369
18644
|
const element = parentsUntil$1(targetElement, taskBarMainContainer);
|
|
18370
|
-
if (element && element.innerHTML === this.taskBarEditElement.innerHTML
|
|
18371
|
-
!(targetElement.classList.contains(connectorPointLeft) ||
|
|
18372
|
-
targetElement.classList.contains(connectorPointRight)) &&
|
|
18373
|
-
!this.tapPointOnFocus) {
|
|
18645
|
+
if ((element && element.innerHTML === this.taskBarEditElement.innerHTML || this.taskBarEditElement.classList.contains("e-segmented-taskbar") || this.taskBarEditElement.classList.contains("collpse-parent-border"))) {
|
|
18374
18646
|
this.updateTaskBarEditElement(e);
|
|
18375
18647
|
this.canDrag = true;
|
|
18376
18648
|
e.preventDefault();
|
|
@@ -18393,7 +18665,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18393
18665
|
}
|
|
18394
18666
|
return;
|
|
18395
18667
|
}
|
|
18396
|
-
if (this.tapPointOnFocus && element && element.innerHTML !== this.taskBarEditElement.innerHTML) {
|
|
18668
|
+
if (this.tapPointOnFocus && !isNullOrUndefined(this.taskBarEditElement) && element && element.innerHTML !== this.taskBarEditElement.innerHTML) {
|
|
18397
18669
|
this.connectorSecondRecord = this.parent.ganttChartModule.getRecordByTaskBar(element);
|
|
18398
18670
|
this.connectorSecondAction = 'ConnectorPointLeftDrag';
|
|
18399
18671
|
this.connectorSecondElement = element;
|
|
@@ -18404,8 +18676,16 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18404
18676
|
this.showHideActivePredecessors(false);
|
|
18405
18677
|
this.initPublicProp();
|
|
18406
18678
|
}
|
|
18407
|
-
else if (targetElement.classList.contains(connectorPointLeftHover)
|
|
18408
|
-
|
|
18679
|
+
else if (targetElement.classList.contains(connectorPointLeftHover)) {
|
|
18680
|
+
this.canDrag = false;
|
|
18681
|
+
this.multipleSelectionEnabled();
|
|
18682
|
+
this.showHideTaskBarEditingElements(targetElement, this.taskBarEditElement);
|
|
18683
|
+
this.tapPointOnFocus = true;
|
|
18684
|
+
this.taskBarEditAction = 'ConnectorPointLeftDrag';
|
|
18685
|
+
this.connectorSecondRecord = this.taskBarEditRecord;
|
|
18686
|
+
this.taskBarEditingAction(e, false);
|
|
18687
|
+
}
|
|
18688
|
+
else if (targetElement.classList.contains(connectorPointRightHover)) {
|
|
18409
18689
|
this.canDrag = false;
|
|
18410
18690
|
this.multipleSelectionEnabled();
|
|
18411
18691
|
this.showHideTaskBarEditingElements(targetElement, this.taskBarEditElement);
|
|
@@ -18535,7 +18815,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18535
18815
|
}
|
|
18536
18816
|
}
|
|
18537
18817
|
if (this.parent.editSettings.allowTaskbarEditing && element) {
|
|
18538
|
-
this.showHideTaskBarEditingElements(element, this.
|
|
18818
|
+
this.showHideTaskBarEditingElements(element, this.editElement);
|
|
18539
18819
|
this.editElement = element;
|
|
18540
18820
|
this.realTaskbarElement = this.editElement;
|
|
18541
18821
|
const index = this.editElement.getAttribute('data-segment-index');
|
|
@@ -18616,7 +18896,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18616
18896
|
else {
|
|
18617
18897
|
if (this.parent.isAdaptive) {
|
|
18618
18898
|
if (this.taskBarEditElement) {
|
|
18619
|
-
this.showHideTaskBarEditingElements(element, this.
|
|
18899
|
+
this.showHideTaskBarEditingElements(element, this.editElement);
|
|
18620
18900
|
}
|
|
18621
18901
|
this.initPublicProp();
|
|
18622
18902
|
}
|
|
@@ -18676,8 +18956,12 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18676
18956
|
&& isShowConnectorPoints) {
|
|
18677
18957
|
const connectorElement = !isNullOrUndefined(element.querySelector('.' + connectorPointLeft)) ?
|
|
18678
18958
|
element : element.parentElement;
|
|
18679
|
-
|
|
18680
|
-
|
|
18959
|
+
if (!isNullOrUndefined(connectorElement.querySelector('.' + connectorPointLeft))) {
|
|
18960
|
+
addClass([connectorElement.querySelector('.' + connectorPointLeft)], [connectorPointLeftHover]);
|
|
18961
|
+
}
|
|
18962
|
+
if (!isNullOrUndefined(connectorElement.querySelector('.' + connectorPointRight))) {
|
|
18963
|
+
addClass([connectorElement.querySelector('.' + connectorPointRight)], [connectorPointRightHover]);
|
|
18964
|
+
}
|
|
18681
18965
|
}
|
|
18682
18966
|
}
|
|
18683
18967
|
else if (!fadeConnectorLine) {
|
|
@@ -18804,7 +19088,8 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18804
19088
|
const item = this.taskBarEditRecord.ganttProperties;
|
|
18805
19089
|
this.previousItem = this.parent.timelineModule.extendFunction(item, this.previousItemProperty);
|
|
18806
19090
|
if (this.taskBarEditAction !== 'ConnectorPointLeftDrag' &&
|
|
18807
|
-
this.taskBarEditAction !== 'ConnectorPointRightDrag'
|
|
19091
|
+
this.taskBarEditAction !== 'ConnectorPointRightDrag' &&
|
|
19092
|
+
!(this.parent.viewType == 'ResourceView' && this.taskBarEditAction == 'ParentDrag')) {
|
|
18808
19093
|
this.editTooltip.showHideTaskbarEditTooltip(true, this.segmentIndex);
|
|
18809
19094
|
}
|
|
18810
19095
|
this.taskBarEditElement.setAttribute('aria-grabbed', 'true');
|
|
@@ -18841,6 +19126,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18841
19126
|
this.dragMouseLeave = false;
|
|
18842
19127
|
this.isMouseDragCheck();
|
|
18843
19128
|
if (this.isMouseDragged && this.taskBarEditAction) {
|
|
19129
|
+
event.preventDefault();
|
|
18844
19130
|
if (!isNullOrUndefined(this.taskbarElement) && !isNullOrUndefined(this.editElement) && (this.taskBarEditAction !== "ConnectorPointRightDrag" && this.taskBarEditAction !== "ConnectorPointLeftDrag") && !(this.parent.viewType === 'ResourceView' && this.currentData.hasChildRecords)) {
|
|
18845
19131
|
var currentElement = this.editElement.parentElement;
|
|
18846
19132
|
currentElement.style.setProperty("position", "absolute");
|
|
@@ -18929,9 +19215,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18929
19215
|
this.taskBarEditAction === 'ConnectorPointRightDrag') {
|
|
18930
19216
|
this.updateConnectorLineSecondProperties(e);
|
|
18931
19217
|
this.triggerDependencyEvent(e);
|
|
18932
|
-
|
|
18933
|
-
this.drawFalseLine();
|
|
18934
|
-
}
|
|
19218
|
+
this.drawFalseLine();
|
|
18935
19219
|
}
|
|
18936
19220
|
if (this.parent.viewType == 'ResourceView' && this.parent.allowTaskbarDragAndDrop) {
|
|
18937
19221
|
if (this.dragMoveY > this.mouseMoveY) {
|
|
@@ -18943,7 +19227,12 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18943
19227
|
this.currentItemTop = this.currentItemTop + this.mouseMoveY;
|
|
18944
19228
|
}
|
|
18945
19229
|
const containerPosition = this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);
|
|
18946
|
-
this.
|
|
19230
|
+
if (this.parent.isAdaptive || e.touches) {
|
|
19231
|
+
this.dragMoveY = e.touches[0].pageY - containerPosition.top + this.parent.ganttChartModule.scrollObject.previousScroll.top;
|
|
19232
|
+
}
|
|
19233
|
+
else {
|
|
19234
|
+
this.dragMoveY = e.pageY - containerPosition.top + this.parent.ganttChartModule.scrollObject.previousScroll.top;
|
|
19235
|
+
}
|
|
18947
19236
|
this.topValue = this.currentItemTop;
|
|
18948
19237
|
this.currentItemPrevTop = (this.currentItemPrevTop === 0 ||
|
|
18949
19238
|
this.topValue == this.currentItemTop) ? this.topValue :
|
|
@@ -19329,6 +19618,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
19329
19618
|
if (this.segmentIndex === 0) {
|
|
19330
19619
|
this.parent.setRecordValue('width', item.width - differenceWidth, item, true);
|
|
19331
19620
|
this.parent.setRecordValue('left', item.left + differenceWidth, item, true);
|
|
19621
|
+
segment.width = segment.width - differenceWidth;
|
|
19332
19622
|
for (let i = 1; i < item.segments.length; i++) {
|
|
19333
19623
|
const segment = segments[i];
|
|
19334
19624
|
segment.left = segment.left - differenceWidth;
|
|
@@ -19809,6 +20099,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
19809
20099
|
const traceParentTaskBar$$1 = this.taskBarEditElement.querySelector('.' + traceParentTaskBar);
|
|
19810
20100
|
const traceParentProgressBar$$1 = this.taskBarEditElement.querySelector('.' + traceParentProgressBar);
|
|
19811
20101
|
const traceConnectorPointRight = this.taskBarEditElement.querySelector('.' + rightConnectorPointOuterDiv);
|
|
20102
|
+
const segmentConnectorPointRight = taskBarMainContainer$$1.querySelector('.' + rightConnectorPointOuterDiv);
|
|
19812
20103
|
const manualParentTaskbar = this.taskBarEditElement;
|
|
19813
20104
|
const manualTaskbar = this.taskBarEditElement.querySelector('.' + manualParentTaskBar);
|
|
19814
20105
|
const manualParentRight = this.taskBarEditElement.querySelector('.' + manualParentRightResizer);
|
|
@@ -19835,6 +20126,9 @@ class TaskbarEdit extends DateProcessor {
|
|
|
19835
20126
|
}
|
|
19836
20127
|
taskBarMainContainer$$1.style.setProperty(position, (item.left) + 'px');
|
|
19837
20128
|
taskBarMainContainer$$1.style.width = (width) + 'px';
|
|
20129
|
+
if (segmentedTaskBarContainer && segmentConnectorPointRight) {
|
|
20130
|
+
segmentConnectorPointRight.style.left = (this.parent.isAdaptive ? (width + 10) : (width + 2)) + 'px';
|
|
20131
|
+
}
|
|
19838
20132
|
if (this.parent.viewType === 'ResourceView' && this.parent.allowTaskbarDragAndDrop && this.parent.rowDragAndDropModule &&
|
|
19839
20133
|
(this.taskBarEditAction === 'ChildDrag' || this.taskBarEditAction === 'MilestoneDrag')) {
|
|
19840
20134
|
taskBarMainContainer$$1.style.setProperty('top', (this.topValue) + 'px');
|
|
@@ -19951,9 +20245,9 @@ class TaskbarEdit extends DateProcessor {
|
|
|
19951
20245
|
}
|
|
19952
20246
|
if (segmentedTaskBarContainer) {
|
|
19953
20247
|
taskBarRightResizer$$1.style.setProperty(position, rightResizer + 'px');
|
|
19954
|
-
traceChildProgressBar$$1.style.width = (segment.
|
|
20248
|
+
traceChildProgressBar$$1.style.width = (segment.width) + 'px';
|
|
19955
20249
|
if (!isNullOrUndefined(childProgressResizer$$1)) {
|
|
19956
|
-
childProgressResizer$$1.style.setProperty(position, segment.
|
|
20250
|
+
childProgressResizer$$1.style.setProperty(position, segment.width - 10 + 'px');
|
|
19957
20251
|
}
|
|
19958
20252
|
}
|
|
19959
20253
|
}
|
|
@@ -20023,9 +20317,6 @@ class TaskbarEdit extends DateProcessor {
|
|
|
20023
20317
|
this.taskBarEditAction === 'ConnectorPointRightDrag') && this.drawPredecessor && (!this.connectorSecondRecord.hasChildRecords ||
|
|
20024
20318
|
this.connectorSecondRecord.hasChildRecords && this.parent.allowParentDependency)) {
|
|
20025
20319
|
this.parent.connectorLineEditModule.updatePredecessor(this.connectorSecondRecord, this.finalPredecessor);
|
|
20026
|
-
if (this.parent.UpdateOffsetOnTaskbarEdit) {
|
|
20027
|
-
this.parent.connectorLineEditModule['calculateOffset'](this.connectorSecondRecord);
|
|
20028
|
-
}
|
|
20029
20320
|
}
|
|
20030
20321
|
else {
|
|
20031
20322
|
if (x1 !== x2 || (Math.abs(y1 - resMouseY) >= (this.parent.rowHeight - this.parent.taskbarHeight) / 2)) {
|
|
@@ -20315,6 +20606,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
20315
20606
|
updateConnectorLineSecondProperties(e) {
|
|
20316
20607
|
const target = this.getElementByPosition(e);
|
|
20317
20608
|
const element = parentsUntil$1(target, taskBarMainContainer);
|
|
20609
|
+
const isBigger = document.body.className.includes("e-bigger");
|
|
20318
20610
|
this.connectorSecondAction = null;
|
|
20319
20611
|
let scrollTop = 0;
|
|
20320
20612
|
if (parentsUntil$1(target, connectorPointLeft)) {
|
|
@@ -20337,20 +20629,20 @@ class TaskbarEdit extends DateProcessor {
|
|
|
20337
20629
|
if ((this.parent.virtualScrollModule && this.parent.enableVirtualization &&
|
|
20338
20630
|
!this.elementOffsetLeft) || !this.parent.enableVirtualization) {
|
|
20339
20631
|
if (!this.parent.allowParentDependency) {
|
|
20340
|
-
this.elementOffsetLeft = this.realTaskbarElement.offsetLeft;
|
|
20632
|
+
this.elementOffsetLeft = this.realTaskbarElement.offsetLeft - ((isBigger) ? 10 : 0);
|
|
20341
20633
|
this.elementOffsetTop = this.realTaskbarElement.parentElement.offsetTop + this.realTaskbarElement.offsetHeight / 3 + scrollTop;
|
|
20342
20634
|
}
|
|
20343
20635
|
else {
|
|
20344
20636
|
if (this.taskBarEditElement.children[0].classList.contains('e-manualparent-main-container')) {
|
|
20345
|
-
this.elementOffsetLeft = this.realTaskbarElement.children[0]['offsetLeft'] + this.realTaskbarElement.offsetLeft;
|
|
20637
|
+
this.elementOffsetLeft = this.realTaskbarElement.children[0]['offsetLeft'] + this.realTaskbarElement.offsetLeft - ((isBigger) ? 10 : 0);
|
|
20346
20638
|
this.elementOffsetTop = ((this.realTaskbarElement.parentElement.offsetTop + this.realTaskbarElement.offsetHeight / 3 - 5) + this.taskBarEditElement.children[0]['offsetTop']) + scrollTop;
|
|
20347
20639
|
}
|
|
20348
20640
|
else {
|
|
20349
|
-
this.elementOffsetLeft = this.realTaskbarElement.offsetLeft;
|
|
20641
|
+
this.elementOffsetLeft = this.realTaskbarElement.offsetLeft - ((isBigger) ? 10 : 0);
|
|
20350
20642
|
this.elementOffsetTop = this.realTaskbarElement.parentElement.offsetTop + this.realTaskbarElement.offsetHeight / 3 + scrollTop;
|
|
20351
20643
|
}
|
|
20352
20644
|
}
|
|
20353
|
-
this.elementOffsetWidth = this.realTaskbarElement.offsetWidth;
|
|
20645
|
+
this.elementOffsetWidth = this.realTaskbarElement.offsetWidth + ((isBigger) ? 20 : 0);
|
|
20354
20646
|
this.elementOffsetHeight = this.realTaskbarElement.offsetHeight;
|
|
20355
20647
|
}
|
|
20356
20648
|
this.showHideTaskBarEditingElements(element, this.highlightedSecondElement, true);
|
|
@@ -20458,18 +20750,16 @@ class TaskbarEdit extends DateProcessor {
|
|
|
20458
20750
|
// Get XY coordinates for touch and non-touch device
|
|
20459
20751
|
getCoordinate(event) {
|
|
20460
20752
|
const coordinates = {};
|
|
20461
|
-
|
|
20753
|
+
const e = event;
|
|
20754
|
+
coordinates.pageX = e.pageX;
|
|
20755
|
+
coordinates.pageY = e.pageY;
|
|
20756
|
+
if (event && event.type !== 'click') {
|
|
20462
20757
|
const e = event;
|
|
20463
20758
|
if (e.type === 'touchmove' || e.type === 'touchstart' || e.type === 'touchend') {
|
|
20464
20759
|
coordinates.pageX = e.changedTouches[0].pageX;
|
|
20465
20760
|
coordinates.pageY = e.changedTouches[0].pageY;
|
|
20466
20761
|
}
|
|
20467
20762
|
}
|
|
20468
|
-
else if (event) {
|
|
20469
|
-
const e = event;
|
|
20470
|
-
coordinates.pageX = e.pageX;
|
|
20471
|
-
coordinates.pageY = e.pageY;
|
|
20472
|
-
}
|
|
20473
20763
|
return coordinates;
|
|
20474
20764
|
}
|
|
20475
20765
|
// Get current target element by mouse position
|
|
@@ -21417,7 +21707,7 @@ class DialogEdit {
|
|
|
21417
21707
|
if (!isNullOrUndefined(tasks.endDate) && tasks.endDate !== colName) {
|
|
21418
21708
|
this.updateScheduleFields(dialog, ganttProp, 'endDate');
|
|
21419
21709
|
}
|
|
21420
|
-
if (!isNullOrUndefined(tasks.duration) && tasks.duration !== colName) {
|
|
21710
|
+
if (!isNullOrUndefined(tasks.duration) && tasks.duration !== colName || ganttProp.duration >= 0) {
|
|
21421
21711
|
this.updateScheduleFields(dialog, ganttProp, 'duration');
|
|
21422
21712
|
}
|
|
21423
21713
|
if (!isNullOrUndefined(tasks.work) && tasks.work !== colName) {
|
|
@@ -21575,17 +21865,33 @@ class DialogEdit {
|
|
|
21575
21865
|
const ganttProp = currentData.ganttProperties;
|
|
21576
21866
|
const taskSettings = ganttObj.taskFields;
|
|
21577
21867
|
if (taskSettings.duration === columnName) {
|
|
21578
|
-
if (!isNullOrUndefined(value) && value !== '') {
|
|
21868
|
+
if (!isNullOrUndefined(value) && value !== '' && parseInt(value) >= 0) {
|
|
21579
21869
|
ganttObj.dataOperation.updateDurationValue(value, ganttProp);
|
|
21580
21870
|
this.parent.setRecordValue(taskSettings.duration, value, currentData);
|
|
21581
21871
|
this.parent.setRecordValue('taskData.' + taskSettings.duration, ganttProp.duration, currentData);
|
|
21872
|
+
this.validateDuration(currentData);
|
|
21582
21873
|
}
|
|
21583
21874
|
else {
|
|
21584
21875
|
if (ganttObj.allowUnscheduledTasks) {
|
|
21585
|
-
|
|
21876
|
+
if ((ganttProp.startDate && ganttProp.endDate && ganttProp.startDate.getTime() > ganttProp.endDate.getTime()) || value.indexOf('-') !== -1) {
|
|
21877
|
+
this.parent.setRecordValue('duration', 0, ganttProp, true);
|
|
21878
|
+
if (ganttProp.endDate) {
|
|
21879
|
+
this.parent.setRecordValue('startDate', ganttProp.endDate, ganttProp, true);
|
|
21880
|
+
}
|
|
21881
|
+
}
|
|
21882
|
+
else {
|
|
21883
|
+
if (value === "") {
|
|
21884
|
+
this.parent.setRecordValue('duration', null, ganttProp, true);
|
|
21885
|
+
if (ganttProp.endDate) {
|
|
21886
|
+
this.parent.setRecordValue('endDate', null, ganttProp, true);
|
|
21887
|
+
}
|
|
21888
|
+
}
|
|
21889
|
+
else {
|
|
21890
|
+
this.parent.setRecordValue('duration', ganttProp.duration, ganttProp, true);
|
|
21891
|
+
}
|
|
21892
|
+
}
|
|
21586
21893
|
}
|
|
21587
21894
|
}
|
|
21588
|
-
this.validateDuration(currentData);
|
|
21589
21895
|
this.parent.editModule.updateResourceRelatedFields(currentData, 'duration');
|
|
21590
21896
|
}
|
|
21591
21897
|
if (taskSettings.startDate === columnName) {
|
|
@@ -21593,13 +21899,15 @@ class DialogEdit {
|
|
|
21593
21899
|
let startDate = this.parent.dateValidationModule.getDateFromFormat(value);
|
|
21594
21900
|
startDate = this.parent.dateValidationModule.checkStartDate(startDate, ganttProp);
|
|
21595
21901
|
this.parent.setRecordValue('startDate', startDate, ganttProp, true);
|
|
21902
|
+
this.validateStartDate(currentData);
|
|
21596
21903
|
}
|
|
21597
21904
|
else {
|
|
21598
21905
|
if (ganttObj.allowUnscheduledTasks && !(currentData.hasChildRecords)) {
|
|
21599
21906
|
this.parent.setRecordValue('startDate', null, ganttProp, true);
|
|
21907
|
+
this.parent.setRecordValue('duration', null, ganttProp, true);
|
|
21908
|
+
this.parent.setRecordValue('isMilestone', false, ganttProp, true);
|
|
21600
21909
|
}
|
|
21601
21910
|
}
|
|
21602
|
-
this.validateStartDate(currentData);
|
|
21603
21911
|
}
|
|
21604
21912
|
if (taskSettings.endDate === columnName) {
|
|
21605
21913
|
if (value !== '') {
|
|
@@ -21614,13 +21922,15 @@ class DialogEdit {
|
|
|
21614
21922
|
if (isNullOrUndefined(ganttProp.startDate) || endDate.getTime() > (ganttProp.startDate).getTime()) {
|
|
21615
21923
|
this.parent.setRecordValue('endDate', endDate, ganttProp, true);
|
|
21616
21924
|
}
|
|
21925
|
+
this.validateEndDate(currentData);
|
|
21617
21926
|
}
|
|
21618
21927
|
else {
|
|
21619
21928
|
if (ganttObj.allowUnscheduledTasks) {
|
|
21620
21929
|
this.parent.setRecordValue('endDate', null, ganttProp, true);
|
|
21930
|
+
this.parent.setRecordValue('duration', null, ganttProp, true);
|
|
21931
|
+
this.parent.setRecordValue('isMilestone', false, ganttProp, true);
|
|
21621
21932
|
}
|
|
21622
21933
|
}
|
|
21623
|
-
this.validateEndDate(currentData);
|
|
21624
21934
|
}
|
|
21625
21935
|
if (taskSettings.work === columnName) {
|
|
21626
21936
|
if (!isNullOrUndefined(value) && value !== '') {
|
|
@@ -22022,7 +22332,7 @@ class DialogEdit {
|
|
|
22022
22332
|
let eDate = getValue('endDate', selectedItem);
|
|
22023
22333
|
let duration = getValue('duration', selectedItem);
|
|
22024
22334
|
const startDate = !isNullOrUndefined(gridData) && gridData.length > 0 ?
|
|
22025
|
-
!isNullOrUndefined(taskFields.endDate) ? new Date(getValue('endDate', gridData[0]).getTime()) :
|
|
22335
|
+
(!isNullOrUndefined(taskFields.endDate) && !isNullOrUndefined(gridData[0].endDate)) ? new Date(getValue('endDate', gridData[0]).getTime()) :
|
|
22026
22336
|
new Date(getValue('startDate', gridData[0]).getTime()) :
|
|
22027
22337
|
!isNullOrUndefined(this.beforeOpenArgs.rowData.ganttProperties.startDate) &&
|
|
22028
22338
|
new Date(this.beforeOpenArgs.rowData.ganttProperties.startDate.getTime());
|
|
@@ -24682,10 +24992,11 @@ class Edit$2 {
|
|
|
24682
24992
|
this.parent.predecessorModule.isValidatedParentTaskID = '';
|
|
24683
24993
|
}
|
|
24684
24994
|
if (this.parent.allowParentDependency && ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
|
|
24685
|
-
(args.action === "DrawConnectorLine")
|
|
24995
|
+
(args.action === "DrawConnectorLine")) {
|
|
24686
24996
|
this.updateChildItems(ganttRecord);
|
|
24687
24997
|
}
|
|
24688
24998
|
this.updateParentItemOnEditing();
|
|
24999
|
+
this.parent.dataOperation.updateParentItems(ganttRecord, true);
|
|
24689
25000
|
}
|
|
24690
25001
|
/** Update parent up-to zeroth level */
|
|
24691
25002
|
if (ganttRecord.parentItem) {
|
|
@@ -24698,6 +25009,10 @@ class Edit$2 {
|
|
|
24698
25009
|
this.updateParentItemOnEditing();
|
|
24699
25010
|
}
|
|
24700
25011
|
}
|
|
25012
|
+
if (this.parent.UpdateOffsetOnTaskbarEdit && this.parent.connectorLineEditModule && args.data) {
|
|
25013
|
+
this.parent.connectorLineEditModule['calculateOffset'](args.data);
|
|
25014
|
+
}
|
|
25015
|
+
this.parent.predecessorModule['validatedParentIds'] = [];
|
|
24701
25016
|
this.initiateSaveAction(args);
|
|
24702
25017
|
}
|
|
24703
25018
|
updateParentItemOnEditing() {
|
|
@@ -24717,7 +25032,7 @@ class Edit$2 {
|
|
|
24717
25032
|
*/
|
|
24718
25033
|
updateParentChildRecord(data) {
|
|
24719
25034
|
const ganttRecord = data;
|
|
24720
|
-
if (ganttRecord.hasChildRecords && this.taskbarMoved && this.parent.taskMode === 'Auto' && (!isNullOrUndefined(this.parent.editModule.cellEditModule) && !this.parent.editModule.cellEditModule.isResourceCellEdited)) {
|
|
25035
|
+
if (ganttRecord.hasChildRecords && this.taskbarMoved && (ganttRecord[this.parent.taskFields.manual] === false || this.parent.taskMode === 'Auto') && (!isNullOrUndefined(this.parent.editModule.cellEditModule) && !this.parent.editModule.cellEditModule.isResourceCellEdited)) {
|
|
24721
25036
|
this.updateChildItems(ganttRecord);
|
|
24722
25037
|
}
|
|
24723
25038
|
if (!isNullOrUndefined(this.parent.editModule.cellEditModule)) {
|
|
@@ -25192,6 +25507,11 @@ class Edit$2 {
|
|
|
25192
25507
|
this.updateScheduleDatesOnEditing(args);
|
|
25193
25508
|
}
|
|
25194
25509
|
}
|
|
25510
|
+
if (this.parent.enableCriticalPath) {
|
|
25511
|
+
let criticalModule = this.parent.criticalPathModule;
|
|
25512
|
+
criticalModule.showCriticalPath(true);
|
|
25513
|
+
criticalModule.criticalConnectorLine(criticalModule.criticalPathCollection, criticalModule.detailPredecessorCollection, true, criticalModule.predecessorCollectionTaskIds);
|
|
25514
|
+
}
|
|
25195
25515
|
if (!this.parent.editSettings.allowTaskbarEditing || (this.parent.editSettings.allowTaskbarEditing &&
|
|
25196
25516
|
!this.taskbarEditModule.dependencyCancel)) {
|
|
25197
25517
|
eventArgs.requestType = 'save';
|
|
@@ -25205,11 +25525,6 @@ class Edit$2 {
|
|
|
25205
25525
|
eventArgs.taskBarEditAction = args.taskBarEditAction;
|
|
25206
25526
|
}
|
|
25207
25527
|
this.endEditAction(args);
|
|
25208
|
-
if (this.parent.enableCriticalPath) {
|
|
25209
|
-
let criticalModule = this.parent.criticalPathModule;
|
|
25210
|
-
criticalModule.showCriticalPath(true);
|
|
25211
|
-
criticalModule.criticalConnectorLine(criticalModule.criticalPathCollection, criticalModule.detailPredecessorCollection, true, criticalModule.predecessorCollectionTaskIds);
|
|
25212
|
-
}
|
|
25213
25528
|
this.parent.trigger('actionComplete', eventArgs);
|
|
25214
25529
|
if (!isNullOrUndefined(this.parent.loadingIndicator) && this.parent.loadingIndicator.indicatorType === "Shimmer") {
|
|
25215
25530
|
this.parent.hideMaskRow();
|
|
@@ -25395,7 +25710,9 @@ class Edit$2 {
|
|
|
25395
25710
|
if (!this.parent.taskFields.parentID) {
|
|
25396
25711
|
const deleteRecordIDs = [];
|
|
25397
25712
|
deleteRecordIDs.push(deletedRow.ganttProperties.rowUniqueID.toString());
|
|
25398
|
-
this.parent.
|
|
25713
|
+
if (this.parent.viewType === 'ProjectView') {
|
|
25714
|
+
this.parent.editModule.removeFromDataSource(deleteRecordIDs);
|
|
25715
|
+
}
|
|
25399
25716
|
}
|
|
25400
25717
|
const flatRecordIndex = this.parent.flatData.indexOf(deletedRow);
|
|
25401
25718
|
if (gObj.taskFields.parentID) {
|
|
@@ -28512,7 +28829,20 @@ class Selection$1 {
|
|
|
28512
28829
|
* @returns {Object[]} .
|
|
28513
28830
|
*/
|
|
28514
28831
|
getSelectedRecords() {
|
|
28515
|
-
|
|
28832
|
+
if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
28833
|
+
let selectedRows = [];
|
|
28834
|
+
let selectedIndexes = this.parent.selectionModule.getSelectedRowIndexes();
|
|
28835
|
+
for (let i = 0; i < selectedIndexes.length; i++) {
|
|
28836
|
+
const rec = this.parent.currentViewData.filter((data) => {
|
|
28837
|
+
return data.index == selectedIndexes[i];
|
|
28838
|
+
})[0];
|
|
28839
|
+
selectedRows.push(rec);
|
|
28840
|
+
}
|
|
28841
|
+
return selectedRows;
|
|
28842
|
+
}
|
|
28843
|
+
else {
|
|
28844
|
+
return this.parent.treeGrid.getSelectedRecords();
|
|
28845
|
+
}
|
|
28516
28846
|
}
|
|
28517
28847
|
/**
|
|
28518
28848
|
* Get the selected records for cell selection.
|
|
@@ -29166,7 +29496,15 @@ class Toolbar$3 {
|
|
|
29166
29496
|
let disableItems = [];
|
|
29167
29497
|
const edit = gObj.editSettings;
|
|
29168
29498
|
const gID = this.id;
|
|
29169
|
-
|
|
29499
|
+
let ind = gObj.selectedRowIndex;
|
|
29500
|
+
if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
29501
|
+
for (let i = 0; i < gObj.updatedRecords.length; i++) {
|
|
29502
|
+
if (gObj.updatedRecords[i].index === ind) {
|
|
29503
|
+
ind = i;
|
|
29504
|
+
break;
|
|
29505
|
+
}
|
|
29506
|
+
}
|
|
29507
|
+
}
|
|
29170
29508
|
let previousGanttRecord;
|
|
29171
29509
|
const isSelected = gObj.selectionModule ? gObj.selectionModule.selectedRowIndexes.length === 1 ||
|
|
29172
29510
|
gObj.selectionModule.getSelectedRowCellIndexes().length === 1 ? true : false : false;
|
|
@@ -29696,6 +30034,7 @@ class DayMarkers {
|
|
|
29696
30034
|
/** @hidden */
|
|
29697
30035
|
class CriticalPath {
|
|
29698
30036
|
constructor(parent) {
|
|
30037
|
+
this.validatedids = [];
|
|
29699
30038
|
this.resourceCollectionIds = [];
|
|
29700
30039
|
this.criticalTasks = [];
|
|
29701
30040
|
this.parent = parent;
|
|
@@ -29722,6 +30061,7 @@ class CriticalPath {
|
|
|
29722
30061
|
const collectionTaskId = [];
|
|
29723
30062
|
const fromDataObject = [];
|
|
29724
30063
|
let criticalPathIds = [];
|
|
30064
|
+
this.criticalTasks = [];
|
|
29725
30065
|
/* eslint-disable-next-line */
|
|
29726
30066
|
if (parentRecords[0].ganttProperties.autoEndDate > parentRecords[0].ganttProperties.endDate && !parentRecords[0].ganttProperties.isAutoSchedule) {
|
|
29727
30067
|
checkEndDate = parentRecords[0].ganttProperties.autoEndDate;
|
|
@@ -29914,6 +30254,7 @@ class CriticalPath {
|
|
|
29914
30254
|
this.slackCalculation(fromDataObject, collection, collectionTaskId, checkEndDate, totalRecords, modelIds);
|
|
29915
30255
|
}
|
|
29916
30256
|
criticalPathIds = this.finalCriticalPath(collection, taskBeyondEnddate, totalRecords, modelIds, checkEndDate);
|
|
30257
|
+
this.validatedids = [];
|
|
29917
30258
|
this.criticalPathCollection = criticalPathIds;
|
|
29918
30259
|
this.detailPredecessorCollection = collection;
|
|
29919
30260
|
this.predecessorCollectionTaskIds = collectionTaskId;
|
|
@@ -30293,73 +30634,69 @@ class CriticalPath {
|
|
|
30293
30634
|
return this.parent.dataOperation.getDuration(startDate, endDate, durationUnit, record.ganttProperties.isAutoSchedule, true);
|
|
30294
30635
|
}
|
|
30295
30636
|
}
|
|
30296
|
-
|
|
30297
|
-
|
|
30298
|
-
|
|
30299
|
-
|
|
30300
|
-
|
|
30301
|
-
|
|
30302
|
-
|
|
30303
|
-
|
|
30304
|
-
|
|
30305
|
-
|
|
30306
|
-
|
|
30307
|
-
|
|
30308
|
-
|
|
30309
|
-
|
|
30310
|
-
|
|
30311
|
-
|
|
30312
|
-
|
|
30313
|
-
|
|
30314
|
-
for (let f = i.length - 1; f >= 0; f--) {
|
|
30315
|
-
if (this.parent.viewType === 'ProjectView') {
|
|
30316
|
-
const q = modelRecordIds.indexOf(i[parseInt(f.toString(), 10)]['from']);
|
|
30317
|
-
for (let k = 0; k < indexes.length; k++) {
|
|
30318
|
-
const item = indexes[parseInt(j.toString(), 10)];
|
|
30319
|
-
if (item !== q) {
|
|
30320
|
-
indexes.push(q);
|
|
30321
|
-
}
|
|
30322
|
-
break;
|
|
30323
|
-
}
|
|
30637
|
+
updateCriticalTasks(record, criticalPathIds) {
|
|
30638
|
+
for (let i = 0; i < record.ganttProperties.predecessor.length; i++) {
|
|
30639
|
+
let fromRecord;
|
|
30640
|
+
if (this.parent.viewType === 'ProjectView') {
|
|
30641
|
+
fromRecord = this.parent.getRecordByID(record.ganttProperties.predecessor[i].from);
|
|
30642
|
+
}
|
|
30643
|
+
else {
|
|
30644
|
+
let resourceIndex = this.resourceCollectionIds.indexOf(record.ganttProperties.predecessor[i].from.toString());
|
|
30645
|
+
fromRecord = this.parent.flatData[resourceIndex];
|
|
30646
|
+
}
|
|
30647
|
+
let durationDiff;
|
|
30648
|
+
if (record.ganttProperties.endDate.getTime() >= this.maxEndDate.getTime()) {
|
|
30649
|
+
record.ganttProperties.slack = record.slack = 0 + ' ' + record.ganttProperties.durationUnit;
|
|
30650
|
+
if (record.ganttProperties.progress < 100) {
|
|
30651
|
+
record.isCritical = true;
|
|
30652
|
+
record.ganttProperties.isCritical = true;
|
|
30653
|
+
if (criticalPathIds.indexOf(parseInt(record.ganttProperties.taskId)) == -1) {
|
|
30654
|
+
criticalPathIds.push(parseInt(record.ganttProperties.taskId));
|
|
30324
30655
|
}
|
|
30325
|
-
|
|
30326
|
-
|
|
30327
|
-
|
|
30328
|
-
|
|
30329
|
-
|
|
30330
|
-
|
|
30331
|
-
|
|
30332
|
-
|
|
30333
|
-
|
|
30656
|
+
}
|
|
30657
|
+
}
|
|
30658
|
+
if (fromRecord) {
|
|
30659
|
+
if (record.ganttProperties.predecessor[i].type == 'FS') {
|
|
30660
|
+
durationDiff = this.parent.dataOperation.getDuration(fromRecord.ganttProperties.endDate, record.ganttProperties.startDate, fromRecord.ganttProperties.durationUnit, fromRecord.ganttProperties.isAutoSchedule, true);
|
|
30661
|
+
}
|
|
30662
|
+
else if (record.ganttProperties.predecessor[i].type == 'SS') {
|
|
30663
|
+
durationDiff = this.parent.dataOperation.getDuration(fromRecord.ganttProperties.startDate, record.ganttProperties.startDate, fromRecord.ganttProperties.durationUnit, fromRecord.ganttProperties.isAutoSchedule, true);
|
|
30664
|
+
}
|
|
30665
|
+
else if (record.ganttProperties.predecessor[i].type == 'FF') {
|
|
30666
|
+
durationDiff = this.parent.dataOperation.getDuration(fromRecord.ganttProperties.endDate, record.ganttProperties.endDate, fromRecord.ganttProperties.durationUnit, fromRecord.ganttProperties.isAutoSchedule, true);
|
|
30667
|
+
}
|
|
30668
|
+
else if (record.ganttProperties.predecessor[i].type == 'SF') {
|
|
30669
|
+
durationDiff = this.parent.dataOperation.getDuration(record.ganttProperties.endDate, fromRecord.ganttProperties.startDate, fromRecord.ganttProperties.durationUnit, fromRecord.ganttProperties.isAutoSchedule, true);
|
|
30670
|
+
}
|
|
30671
|
+
if (durationDiff == 0 && this.validatedids.indexOf(parseInt(fromRecord.ganttProperties.taskId)) == -1 && fromRecord.ganttProperties.taskId != record.ganttProperties.taskId) {
|
|
30672
|
+
fromRecord.ganttProperties.slack = record.ganttProperties.slack;
|
|
30673
|
+
fromRecord.slack = record.slack;
|
|
30674
|
+
fromRecord.isCritical = record.ganttProperties.isCritical;
|
|
30675
|
+
fromRecord.ganttProperties.isCritical = record.ganttProperties.isCritical;
|
|
30676
|
+
if (criticalPathIds.indexOf(parseInt(fromRecord.ganttProperties.taskId)) == -1 && fromRecord.ganttProperties.isCritical && fromRecord.ganttProperties.progress < 100) {
|
|
30677
|
+
this.validatedids.push(parseInt(fromRecord.ganttProperties.taskId));
|
|
30678
|
+
criticalPathIds.push(parseInt(fromRecord.ganttProperties.taskId));
|
|
30679
|
+
}
|
|
30680
|
+
if (fromRecord.ganttProperties.predecessorsName) {
|
|
30681
|
+
this.updateCriticalTasks(fromRecord, criticalPathIds);
|
|
30334
30682
|
}
|
|
30335
30683
|
}
|
|
30336
30684
|
}
|
|
30337
30685
|
}
|
|
30338
|
-
|
|
30686
|
+
}
|
|
30687
|
+
/* eslint-disable-next-line */
|
|
30688
|
+
finalCriticalPath(collection, taskBeyondEnddate, flatRecords, modelRecordIds, checkEndDate) {
|
|
30689
|
+
let criticalPathIds = [];
|
|
30690
|
+
let index;
|
|
30691
|
+
let predecessorFrom;
|
|
30692
|
+
for (let x = collection.length - 1; x >= 0; x--) {
|
|
30339
30693
|
if (this.parent.viewType === 'ProjectView') {
|
|
30340
|
-
index = modelRecordIds.indexOf(
|
|
30694
|
+
index = modelRecordIds.indexOf(collection[x]['taskid'].toString());
|
|
30341
30695
|
}
|
|
30342
30696
|
else {
|
|
30343
|
-
index = this.resourceCollectionIds.indexOf(
|
|
30697
|
+
index = this.resourceCollectionIds.indexOf(collection[x]['taskid'].toString());
|
|
30344
30698
|
}
|
|
30345
30699
|
const predecessorLength = flatRecords[index].ganttProperties.predecessor;
|
|
30346
|
-
if (isNullOrUndefined(predecessorLength)) {
|
|
30347
|
-
if (taskBeyondEnddate.length > 0) {
|
|
30348
|
-
for (let i = 0; i < taskBeyondEnddate.length; i++) {
|
|
30349
|
-
if (this.parent.viewType === 'ProjectView') {
|
|
30350
|
-
index = modelRecordIds.indexOf(taskBeyondEnddate[i].toString());
|
|
30351
|
-
}
|
|
30352
|
-
else {
|
|
30353
|
-
index = this.resourceCollectionIds.indexOf(taskBeyondEnddate[i].toString());
|
|
30354
|
-
}
|
|
30355
|
-
if (index !== -1 && flatRecords[index].ganttProperties.progress < 100) {
|
|
30356
|
-
this.criticalTasks.push(flatRecords[index]);
|
|
30357
|
-
criticalPathIds = criticalPathIds.concat(taskBeyondEnddate[i]);
|
|
30358
|
-
}
|
|
30359
|
-
}
|
|
30360
|
-
}
|
|
30361
|
-
break;
|
|
30362
|
-
}
|
|
30363
30700
|
const noSlackValue = 0 + ' ' + flatRecords[index].ganttProperties.durationUnit;
|
|
30364
30701
|
for (let i = predecessorLength.length - 1; i >= 0; i--) {
|
|
30365
30702
|
let toID;
|
|
@@ -30372,6 +30709,7 @@ class CriticalPath {
|
|
|
30372
30709
|
let dateDifference;
|
|
30373
30710
|
const currentData = flatRecords[index].ganttProperties;
|
|
30374
30711
|
if (predecessorLength[i].type === 'FS') {
|
|
30712
|
+
/* eslint-disable-next-line */
|
|
30375
30713
|
if (predecessorLength[i].to != currentData.taskId.toString() || this.parent.viewType === 'ResourceView') {
|
|
30376
30714
|
/* eslint-disable-next-line */
|
|
30377
30715
|
dateDifference = this.parent.dataOperation.getDuration(currentData.endDate, flatRecords[toID].ganttProperties.startDate, currentData.durationUnit, currentData.isAutoSchedule, currentData.isMilestone);
|
|
@@ -30423,8 +30761,28 @@ class CriticalPath {
|
|
|
30423
30761
|
flatRecords[index].isCritical = true;
|
|
30424
30762
|
flatRecords[index].ganttProperties.isCritical = true;
|
|
30425
30763
|
this.criticalTasks.push(flatRecords[index]);
|
|
30426
|
-
|
|
30427
|
-
|
|
30764
|
+
if (criticalPathIds.indexOf(collection[x]['taskid']) === -1) {
|
|
30765
|
+
criticalPathIds.push(collection[x]['taskid']);
|
|
30766
|
+
}
|
|
30767
|
+
}
|
|
30768
|
+
}
|
|
30769
|
+
if (flatRecords[index].ganttProperties.predecessor.length > 0) {
|
|
30770
|
+
this.updateCriticalTasks(flatRecords[index], criticalPathIds);
|
|
30771
|
+
}
|
|
30772
|
+
}
|
|
30773
|
+
if (taskBeyondEnddate.length > 0) {
|
|
30774
|
+
for (let i = 0; i < taskBeyondEnddate.length; i++) {
|
|
30775
|
+
if (this.parent.viewType === 'ProjectView') {
|
|
30776
|
+
index = modelRecordIds.indexOf(taskBeyondEnddate[i].toString());
|
|
30777
|
+
}
|
|
30778
|
+
else {
|
|
30779
|
+
index = this.resourceCollectionIds.indexOf(taskBeyondEnddate[i].toString());
|
|
30780
|
+
}
|
|
30781
|
+
if (index !== -1 && flatRecords[index].ganttProperties.progress < 100) {
|
|
30782
|
+
this.criticalTasks.push(flatRecords[index]);
|
|
30783
|
+
if (criticalPathIds.indexOf(taskBeyondEnddate[i]) === -1) {
|
|
30784
|
+
criticalPathIds = criticalPathIds.concat(taskBeyondEnddate[i]);
|
|
30785
|
+
}
|
|
30428
30786
|
}
|
|
30429
30787
|
}
|
|
30430
30788
|
}
|
|
@@ -30469,7 +30827,7 @@ class CriticalPath {
|
|
|
30469
30827
|
}
|
|
30470
30828
|
}
|
|
30471
30829
|
/* eslint-disable-next-line */
|
|
30472
|
-
if (this.parent.allowUnscheduledTasks && !criticalData[columnFields.startDate] && !criticalData[columnFields.endDate] && criticalData[columnFields.duration]) {
|
|
30830
|
+
if (this.parent.allowUnscheduledTasks && criticalData && !criticalData[columnFields.startDate] && !criticalData[columnFields.endDate] && criticalData[columnFields.duration]) {
|
|
30473
30831
|
taskClass = criticalUnscheduledTask;
|
|
30474
30832
|
}
|
|
30475
30833
|
else {
|
|
@@ -31516,8 +31874,16 @@ class RowDD$1 {
|
|
|
31516
31874
|
const dragElement = this.parent.element.querySelector('.e-ganttdrag');
|
|
31517
31875
|
const ganttTop = this.parent.element.getClientRects()[0].top;
|
|
31518
31876
|
const ganttLeft = this.parent.element.getClientRects()[0].left;
|
|
31519
|
-
|
|
31520
|
-
|
|
31877
|
+
let left;
|
|
31878
|
+
let top;
|
|
31879
|
+
if (this.parent.isAdaptive) {
|
|
31880
|
+
left = args.originalEvent.event.touches[0].clientX - ganttLeft;
|
|
31881
|
+
top = args.originalEvent.event.touches[0].clientY - ganttTop;
|
|
31882
|
+
}
|
|
31883
|
+
else {
|
|
31884
|
+
left = getValue('event', args.originalEvent).clientX - ganttLeft;
|
|
31885
|
+
top = getValue('event', args.originalEvent).clientY - ganttTop;
|
|
31886
|
+
}
|
|
31521
31887
|
dragElement.style.left = left + 20 + 'px';
|
|
31522
31888
|
dragElement.style.top = top + 20 + 'px';
|
|
31523
31889
|
this.parent.trigger('rowDrag', args);
|
|
@@ -32370,6 +32736,8 @@ class PdfGanttTheme {
|
|
|
32370
32736
|
ganttStyle.taskbar.progressColor = new PdfColor(33, 82, 125);
|
|
32371
32737
|
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
32372
32738
|
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
32739
|
+
ganttStyle.taskbar.baselineColor = new PdfColor(240, 173, 78);
|
|
32740
|
+
ganttStyle.taskbar.baselineBorderColor = new PdfColor(240, 173, 78);
|
|
32373
32741
|
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
32374
32742
|
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
32375
32743
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(119, 119, 119);
|
|
@@ -32390,6 +32758,8 @@ class PdfGanttTheme {
|
|
|
32390
32758
|
ganttStyle.taskbar.progressColor = new PdfColor(0, 86, 179);
|
|
32391
32759
|
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
32392
32760
|
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
32761
|
+
ganttStyle.taskbar.baselineColor = new PdfColor(255, 193, 7);
|
|
32762
|
+
ganttStyle.taskbar.baselineBorderColor = new PdfColor(255, 193, 7);
|
|
32393
32763
|
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
32394
32764
|
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
32395
32765
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(108, 117, 125);
|
|
@@ -32412,6 +32782,8 @@ class PdfGanttTheme {
|
|
|
32412
32782
|
ganttStyle.taskbar.progressColor = new PdfColor(0, 91, 163);
|
|
32413
32783
|
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
32414
32784
|
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
32785
|
+
ganttStyle.taskbar.baselineColor = new PdfColor(216, 59, 1);
|
|
32786
|
+
ganttStyle.taskbar.baselineBorderColor = new PdfColor(216, 59, 1);
|
|
32415
32787
|
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
32416
32788
|
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
32417
32789
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(118, 118, 118);
|
|
@@ -32432,6 +32804,8 @@ class PdfGanttTheme {
|
|
|
32432
32804
|
ganttStyle.taskbar.progressColor = new PdfColor(63, 81, 181);
|
|
32433
32805
|
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
32434
32806
|
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
32807
|
+
ganttStyle.taskbar.baselineColor = new PdfColor(193, 87, 0);
|
|
32808
|
+
ganttStyle.taskbar.baselineBorderColor = new PdfColor(193, 87, 0);
|
|
32435
32809
|
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
32436
32810
|
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
32437
32811
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(132, 132, 132);
|
|
@@ -32926,7 +33300,7 @@ class PdfTreeGridLayouter extends ElementLayouter {
|
|
|
32926
33300
|
let startColumn = 0;
|
|
32927
33301
|
let endColumn = 0;
|
|
32928
33302
|
let cellWidths = 0;
|
|
32929
|
-
const availableWidth = this.currentGraphics.clientSize.width - this.currentBounds.x;
|
|
33303
|
+
const availableWidth = pointToPixel(this.currentGraphics.clientSize.width) - this.currentBounds.x;
|
|
32930
33304
|
for (let i = 0; i < this.treegrid.columns.count; i++) {
|
|
32931
33305
|
cellWidths += this.treegrid.columns.getColumn(i).width;
|
|
32932
33306
|
if (cellWidths >= availableWidth) {
|
|
@@ -33154,6 +33528,7 @@ class PdfTreeGridLayouter extends ElementLayouter {
|
|
|
33154
33528
|
let size = new SizeF(column.width, height);
|
|
33155
33529
|
if (cell.columnSpan > 1) {
|
|
33156
33530
|
size = new SizeF(cell.width, height);
|
|
33531
|
+
i += cell.columnSpan;
|
|
33157
33532
|
}
|
|
33158
33533
|
if (!this.checkIfDefaultFormat(column.format) && this.checkIfDefaultFormat(cell.style.format)) {
|
|
33159
33534
|
cell.style.format = column.format;
|
|
@@ -33506,12 +33881,15 @@ class PdfTreeGrid extends PdfLayoutElement {
|
|
|
33506
33881
|
colSpan = cell.columnSpan;
|
|
33507
33882
|
currentCellIndex = j;
|
|
33508
33883
|
cell.isCellMergeStart = true;
|
|
33884
|
+
let totalColumnWidth = this.columns.columns[currentCellIndex].width;
|
|
33509
33885
|
//Set Column merges.
|
|
33510
33886
|
while (colSpan > 1) {
|
|
33511
33887
|
currentCellIndex++;
|
|
33512
33888
|
row.cells.getCell(currentCellIndex).isCellMergeContinue = true;
|
|
33513
33889
|
colSpan--;
|
|
33890
|
+
totalColumnWidth += this.columns.columns[currentCellIndex].width;
|
|
33514
33891
|
}
|
|
33892
|
+
cell.width = totalColumnWidth;
|
|
33515
33893
|
}
|
|
33516
33894
|
else if (cell.columnSpan === 1 && cell.rowSpan > 1) {
|
|
33517
33895
|
rowSpan = cell.rowSpan;
|
|
@@ -33576,15 +33954,12 @@ class PdfTreeGrid extends PdfLayoutElement {
|
|
|
33576
33954
|
colSpan = cell.columnSpan;
|
|
33577
33955
|
currentCellIndex = j;
|
|
33578
33956
|
cell.isCellMergeStart = true;
|
|
33579
|
-
let totalColumnWidth = this.columns.columns[currentCellIndex].width;
|
|
33580
33957
|
//set Column merges.
|
|
33581
33958
|
while (colSpan > 1) {
|
|
33582
33959
|
currentCellIndex++;
|
|
33583
33960
|
row.cells.getCell(currentCellIndex).isCellMergeContinue = true;
|
|
33584
33961
|
colSpan--;
|
|
33585
|
-
totalColumnWidth += this.columns.columns[currentCellIndex].width;
|
|
33586
33962
|
}
|
|
33587
|
-
cell.width = totalColumnWidth;
|
|
33588
33963
|
}
|
|
33589
33964
|
else if (cell.columnSpan === 1 && cell.rowSpan > 1) {
|
|
33590
33965
|
rowSpan = cell.rowSpan;
|
|
@@ -33787,11 +34162,11 @@ class PdfTreeGridCell {
|
|
|
33787
34162
|
if (this.finishedDrawingCell) {
|
|
33788
34163
|
temp = (this.remainingString === '') ? this.remainingString : this.value;
|
|
33789
34164
|
/* eslint-disable-next-line */
|
|
33790
|
-
graphics.drawString(temp, font, textPen, textBrush, (innerLayoutArea.x + leftAdjustment), innerLayoutArea.y, (innerLayoutArea.width - leftAdjustment - padding), (innerLayoutArea.height - padding), this.style.format);
|
|
34165
|
+
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);
|
|
33791
34166
|
}
|
|
33792
34167
|
else {
|
|
33793
34168
|
/* eslint-disable-next-line */
|
|
33794
|
-
graphics.drawString(this.remainingString, font, textPen, textBrush, (innerLayoutArea.x + leftAdjustment), innerLayoutArea.y, this.style.format);
|
|
34169
|
+
graphics.drawString(this.remainingString, font, textPen, textBrush, (innerLayoutArea.x + leftAdjustment), this.isHeaderCell ? innerLayoutArea.y - 16 : innerLayoutArea.y, this.style.format);
|
|
33795
34170
|
}
|
|
33796
34171
|
result = graphics.stringLayoutResult;
|
|
33797
34172
|
}
|
|
@@ -34427,8 +34802,99 @@ class PdfTreeGridColumnCollection {
|
|
|
34427
34802
|
*/
|
|
34428
34803
|
class ExportHelper {
|
|
34429
34804
|
constructor(parent) {
|
|
34805
|
+
this.totalColumnWidth = 0;
|
|
34806
|
+
this.beforeSinglePageExport = {};
|
|
34807
|
+
this.baselineHeight = 8;
|
|
34430
34808
|
this.parent = parent;
|
|
34431
34809
|
}
|
|
34810
|
+
processToFit() {
|
|
34811
|
+
this.beforeSinglePageExport['zoomingProjectStartDate'] = this.parent.zoomingProjectStartDate;
|
|
34812
|
+
this.beforeSinglePageExport['zoomingProjectEndDate'] = this.parent.zoomingProjectEndDate;
|
|
34813
|
+
this.beforeSinglePageExport['cloneProjectStartDate'] = this.parent.cloneProjectStartDate;
|
|
34814
|
+
this.beforeSinglePageExport['cloneProjectEndDate'] = this.parent.cloneProjectEndDate;
|
|
34815
|
+
this.beforeSinglePageExport['customTimelineSettings'] = extend({}, this.parent.timelineModule.customTimelineSettings, null, true);
|
|
34816
|
+
this.beforeSinglePageExport['isTimelineRoundOff'] = this.parent.isTimelineRoundOff;
|
|
34817
|
+
this.beforeSinglePageExport['topTier'] = this.parent.timelineModule.topTier;
|
|
34818
|
+
this.beforeSinglePageExport['topTierCellWidth'] = this.parent.timelineModule.topTierCellWidth;
|
|
34819
|
+
this.beforeSinglePageExport['topTierCollection'] = this.parent.timelineModule.topTierCollection;
|
|
34820
|
+
this.beforeSinglePageExport['bottomTier'] = this.parent.timelineModule.bottomTier;
|
|
34821
|
+
this.beforeSinglePageExport['bottomTierCellWidth'] = this.parent.timelineModule.bottomTierCellWidth;
|
|
34822
|
+
this.beforeSinglePageExport['bottomTierCollection'] = this.parent.timelineModule.bottomTierCollection;
|
|
34823
|
+
this.beforeSinglePageExport['totalTimelineWidth'] = this.parent.timelineModule.totalTimelineWidth;
|
|
34824
|
+
this.beforeSinglePageExport['timelineStartDate'] = this.parent.timelineModule.timelineStartDate;
|
|
34825
|
+
this.beforeSinglePageExport['timelineEndDate'] = this.parent.timelineModule.timelineEndDate;
|
|
34826
|
+
this.beforeSinglePageExport['timelineRoundOffEndDate'] = this.parent.timelineModule.timelineRoundOffEndDate;
|
|
34827
|
+
this.beforeSinglePageExport['perDayWidth'] = this.parent.perDayWidth;
|
|
34828
|
+
this.beforeSinglePageExport['updatedConnectorLineCollection'] = extend([], this.parent.updatedConnectorLineCollection, null, true);
|
|
34829
|
+
this.parent.timelineModule.isZoomToFit = true;
|
|
34830
|
+
this.parent.timelineModule.isZooming = false;
|
|
34831
|
+
if (!this.parent.zoomingProjectStartDate) {
|
|
34832
|
+
this.parent.zoomingProjectStartDate = this.parent.cloneProjectStartDate;
|
|
34833
|
+
this.parent.zoomingProjectEndDate = this.parent.cloneProjectEndDate;
|
|
34834
|
+
}
|
|
34835
|
+
if (this.parent.zoomingProjectStartDate > this.parent.cloneProjectStartDate) {
|
|
34836
|
+
this.parent.cloneProjectStartDate = new Date(this.parent.allowUnscheduledTasks ? this.parent.zoomingProjectStartDate : this.parent.cloneProjectStartDate);
|
|
34837
|
+
}
|
|
34838
|
+
this.parent.dataOperation.calculateProjectDates();
|
|
34839
|
+
const timeDifference = (this.parent.cloneProjectEndDate.getTime() - this.parent.cloneProjectStartDate.getTime());
|
|
34840
|
+
const totalDays = (timeDifference / (1000 * 3600 * 24));
|
|
34841
|
+
let chartsideWidth;
|
|
34842
|
+
let gridWidth;
|
|
34843
|
+
if (this.exportProps.fitToWidthSettings.gridWidth) {
|
|
34844
|
+
gridWidth = parseInt(this.exportProps.fitToWidthSettings.gridWidth.split('%')[0]);
|
|
34845
|
+
}
|
|
34846
|
+
if (this.exportProps.fitToWidthSettings.chartWidth) {
|
|
34847
|
+
chartsideWidth = parseInt(this.exportProps.fitToWidthSettings.chartWidth.split('%')[0]);
|
|
34848
|
+
}
|
|
34849
|
+
else {
|
|
34850
|
+
if (this.exportProps.fitToWidthSettings.gridWidth) {
|
|
34851
|
+
chartsideWidth = 100 - gridWidth;
|
|
34852
|
+
}
|
|
34853
|
+
else {
|
|
34854
|
+
chartsideWidth = 70;
|
|
34855
|
+
}
|
|
34856
|
+
}
|
|
34857
|
+
const pdfwidth = (this.parent.pdfExportModule['pdfPageDimensions'].width * chartsideWidth) / 100;
|
|
34858
|
+
const chartWidth = pdfwidth;
|
|
34859
|
+
const perDayWidth = chartWidth / totalDays;
|
|
34860
|
+
let zoomingLevel;
|
|
34861
|
+
let firstValue;
|
|
34862
|
+
let secondValue;
|
|
34863
|
+
const zoomingCollections = [...this.parent.zoomingLevels];
|
|
34864
|
+
const sortedCollectons = zoomingCollections.sort((a, b) => (!a.perDayWidth && !b.perDayWidth ? 0 : (a.perDayWidth < b.perDayWidth) ? 1 : -1));
|
|
34865
|
+
if (perDayWidth === 0) { // return when the Gantt chart is not in viewable state.
|
|
34866
|
+
return;
|
|
34867
|
+
}
|
|
34868
|
+
for (let i = 0; i < sortedCollectons.length; i++) {
|
|
34869
|
+
firstValue = sortedCollectons[i];
|
|
34870
|
+
if (i === sortedCollectons.length - 1) {
|
|
34871
|
+
zoomingLevel = sortedCollectons[i];
|
|
34872
|
+
break;
|
|
34873
|
+
}
|
|
34874
|
+
else {
|
|
34875
|
+
secondValue = sortedCollectons[i + 1];
|
|
34876
|
+
}
|
|
34877
|
+
if (perDayWidth >= firstValue.perDayWidth) {
|
|
34878
|
+
zoomingLevel = sortedCollectons[i];
|
|
34879
|
+
break;
|
|
34880
|
+
}
|
|
34881
|
+
if (perDayWidth < firstValue.perDayWidth && perDayWidth > secondValue.perDayWidth) {
|
|
34882
|
+
zoomingLevel = sortedCollectons[i + 1];
|
|
34883
|
+
break;
|
|
34884
|
+
}
|
|
34885
|
+
}
|
|
34886
|
+
const newTimeline = extend({}, {}, zoomingLevel, true);
|
|
34887
|
+
this.parent.timelineModule['roundOffDateToZoom'](this.parent.cloneProjectStartDate, true, perDayWidth, newTimeline.bottomTier.unit, zoomingLevel);
|
|
34888
|
+
this.parent.timelineModule['roundOffDateToZoom'](this.parent.cloneProjectEndDate, false, perDayWidth, newTimeline.bottomTier.unit, zoomingLevel);
|
|
34889
|
+
const numberOfCells = this.parent.timelineModule['calculateNumberOfTimelineCells'](newTimeline);
|
|
34890
|
+
const scrollHeight = this.parent.pdfExportModule['pdfPageDimensions'].height; //17 is horizontal scrollbar width
|
|
34891
|
+
const contentHeight = this.parent.pdfExportModule['pdfPageDimensions'].height;
|
|
34892
|
+
const emptySpace = contentHeight <= scrollHeight ? 0 : 17;
|
|
34893
|
+
newTimeline.timelineUnitSize = Math.abs((chartWidth - emptySpace)) / numberOfCells;
|
|
34894
|
+
this.parent.timelineModule['changeTimelineSettings'](newTimeline);
|
|
34895
|
+
this.parent.timelineModule.isZoomToFit = false;
|
|
34896
|
+
this.parent.timelineModule.isZooming = false;
|
|
34897
|
+
}
|
|
34432
34898
|
/**
|
|
34433
34899
|
* @param {IGanttData[]} data .
|
|
34434
34900
|
* @param {PdfGantt} gantt .
|
|
@@ -34450,11 +34916,16 @@ class ExportHelper {
|
|
|
34450
34916
|
this.gantt.style.cellPadding.right = 0;
|
|
34451
34917
|
this.ganttStyle = this.gantt.ganttStyle;
|
|
34452
34918
|
this.gantt.borderColor = this.ganttStyle.chartGridLineColor;
|
|
34919
|
+
this.parent.pdfExportModule.isPdfExport = true;
|
|
34920
|
+
if (this.exportProps.fitToWidthSettings && this.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
34921
|
+
this.processToFit();
|
|
34922
|
+
}
|
|
34453
34923
|
this.processHeaderContent();
|
|
34454
34924
|
this.processGanttContent();
|
|
34455
34925
|
this.processTimeline();
|
|
34456
34926
|
this.processTaskbar();
|
|
34457
34927
|
this.processPredecessor();
|
|
34928
|
+
this.parent.pdfExportModule.isPdfExport = false;
|
|
34458
34929
|
}
|
|
34459
34930
|
processHeaderContent() {
|
|
34460
34931
|
this.rowIndex++;
|
|
@@ -34508,7 +34979,9 @@ class ExportHelper {
|
|
|
34508
34979
|
this.renderEmptyGantt();
|
|
34509
34980
|
}
|
|
34510
34981
|
else {
|
|
34511
|
-
|
|
34982
|
+
let flatData;
|
|
34983
|
+
flatData = this.flatData;
|
|
34984
|
+
flatData.forEach((data) => {
|
|
34512
34985
|
this.row = this.gantt.rows.addRow();
|
|
34513
34986
|
if (data.hasChildRecords) {
|
|
34514
34987
|
this.gantt.rows.getRow(this.rowIndex).isParentRow = true;
|
|
@@ -34517,6 +34990,9 @@ class ExportHelper {
|
|
|
34517
34990
|
else {
|
|
34518
34991
|
this.processRecordRow(data);
|
|
34519
34992
|
}
|
|
34993
|
+
if (this.exportProps.fitToWidthSettings && this.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
34994
|
+
this.row.height = 33.33;
|
|
34995
|
+
}
|
|
34520
34996
|
this.rowIndex++;
|
|
34521
34997
|
});
|
|
34522
34998
|
}
|
|
@@ -34567,7 +35043,7 @@ class ExportHelper {
|
|
|
34567
35043
|
else {
|
|
34568
35044
|
predecessor.connectorLineColor = this.ganttStyle.connectorLineColor;
|
|
34569
35045
|
}
|
|
34570
|
-
|
|
35046
|
+
this.ganttStyle.connectorLineColor = predecessor.connectorLineColor;
|
|
34571
35047
|
this.gantt.predecessorCollection.push(predecessor);
|
|
34572
35048
|
});
|
|
34573
35049
|
this.parent.pdfExportModule.isPdfExport = false;
|
|
@@ -34630,7 +35106,9 @@ class ExportHelper {
|
|
|
34630
35106
|
* @returns {void} .
|
|
34631
35107
|
*/
|
|
34632
35108
|
processTaskbar() {
|
|
34633
|
-
|
|
35109
|
+
let flatData;
|
|
35110
|
+
flatData = this.flatData;
|
|
35111
|
+
flatData.forEach((data) => {
|
|
34634
35112
|
const taskbar = this.gantt.taskbar.add();
|
|
34635
35113
|
const ganttProp = data.ganttProperties;
|
|
34636
35114
|
taskbar.left = ganttProp.left;
|
|
@@ -34661,7 +35139,22 @@ class ExportHelper {
|
|
|
34661
35139
|
taskbar.startDate = ganttProp.startDate;
|
|
34662
35140
|
taskbar.endDate = ganttProp.endDate;
|
|
34663
35141
|
taskbar.height = this.parent.chartRowsModule.taskBarHeight;
|
|
35142
|
+
if (this.parent.renderBaseline) {
|
|
35143
|
+
let height;
|
|
35144
|
+
if ((taskbar.height + this.baselineHeight) <= this.parent.rowHeight) {
|
|
35145
|
+
height = taskbar.height;
|
|
35146
|
+
}
|
|
35147
|
+
else {
|
|
35148
|
+
height = taskbar.height - (this.baselineHeight + 1);
|
|
35149
|
+
}
|
|
35150
|
+
taskbar.height = height;
|
|
35151
|
+
}
|
|
35152
|
+
taskbar.baselineTop = this.parent.chartRowsModule.baselineTop;
|
|
34664
35153
|
taskbar.isMilestone = ganttProp.isMilestone;
|
|
35154
|
+
taskbar.baselineStartDate = ganttProp.baselineStartDate;
|
|
35155
|
+
taskbar.baselineEndDate = ganttProp.baselineEndDate;
|
|
35156
|
+
taskbar.baselineLeft = ganttProp.baselineLeft;
|
|
35157
|
+
taskbar.baselineWidth = ganttProp.baselineWidth;
|
|
34665
35158
|
taskbar.milestoneColor = new PdfColor(this.ganttStyle.taskbar.milestoneColor);
|
|
34666
35159
|
taskbar.isParentTask = data.hasChildRecords;
|
|
34667
35160
|
if (ganttProp.isMilestone) {
|
|
@@ -34692,6 +35185,7 @@ class ExportHelper {
|
|
|
34692
35185
|
taskbar.taskColor = new PdfColor(this.ganttStyle.taskbar.criticalTaskColor);
|
|
34693
35186
|
taskbar.progressColor = new PdfColor(this.ganttStyle.taskbar.criticalProgressColor);
|
|
34694
35187
|
taskbar.taskBorderColor = new PdfColor(this.ganttStyle.taskbar.criticalTaskBorderColor);
|
|
35188
|
+
taskbar.milestoneColor = new PdfColor(this.ganttStyle.taskbar.criticalTaskColor);
|
|
34695
35189
|
}
|
|
34696
35190
|
else {
|
|
34697
35191
|
taskbar.taskColor = new PdfColor(this.ganttStyle.taskbar.taskColor);
|
|
@@ -34699,6 +35193,8 @@ class ExportHelper {
|
|
|
34699
35193
|
taskbar.taskBorderColor = new PdfColor(this.ganttStyle.taskbar.taskBorderColor);
|
|
34700
35194
|
}
|
|
34701
35195
|
}
|
|
35196
|
+
taskbar.baselineColor = new PdfColor(this.ganttStyle.taskbar.baselineColor);
|
|
35197
|
+
taskbar.baselineBorderColor = new PdfColor(this.ganttStyle.taskbar.baselineBorderColor);
|
|
34702
35198
|
taskbar.gridLineColor = new PdfColor(this.ganttStyle.chartGridLineColor);
|
|
34703
35199
|
this.gantt.taskbarCollection.push(taskbar);
|
|
34704
35200
|
const taskStyle = {};
|
|
@@ -34707,6 +35203,8 @@ class ExportHelper {
|
|
|
34707
35203
|
taskStyle.taskBorderColor = taskbar.taskBorderColor;
|
|
34708
35204
|
taskStyle.progressColor = taskbar.progressColor;
|
|
34709
35205
|
taskStyle.milestoneColor = taskbar.milestoneColor;
|
|
35206
|
+
taskStyle.baselineColor = taskbar.baselineColor;
|
|
35207
|
+
taskStyle.baselineBorderColor = taskbar.baselineBorderColor;
|
|
34710
35208
|
const args = {
|
|
34711
35209
|
taskbar: taskStyle,
|
|
34712
35210
|
data: data
|
|
@@ -34718,6 +35216,8 @@ class ExportHelper {
|
|
|
34718
35216
|
taskbar.taskBorderColor = args.taskbar.taskBorderColor;
|
|
34719
35217
|
taskbar.progressColor = args.taskbar.progressColor;
|
|
34720
35218
|
taskbar.milestoneColor = args.taskbar.milestoneColor;
|
|
35219
|
+
taskbar.baselineColor = args.taskbar.baselineColor;
|
|
35220
|
+
taskbar.baselineBorderColor = args.taskbar.baselineBorderColor;
|
|
34721
35221
|
}
|
|
34722
35222
|
});
|
|
34723
35223
|
}
|
|
@@ -34865,6 +35365,26 @@ class ExportHelper {
|
|
|
34865
35365
|
const widths = [];
|
|
34866
35366
|
const treeColumnIndex = 0;
|
|
34867
35367
|
const tWidth = (this.pdfDoc.pageSettings.width - 82);
|
|
35368
|
+
if (this.exportProps && this.exportProps.fitToWidthSettings && this.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
35369
|
+
let gridWidth;
|
|
35370
|
+
if (this.exportProps.fitToWidthSettings.gridWidth) {
|
|
35371
|
+
gridWidth = parseInt(this.exportProps.fitToWidthSettings.gridWidth.split('%')[0]);
|
|
35372
|
+
}
|
|
35373
|
+
else {
|
|
35374
|
+
if (this.exportProps.fitToWidthSettings.chartWidth) {
|
|
35375
|
+
let chartWidth = parseInt(this.exportProps.fitToWidthSettings.chartWidth.split('%')[0]);
|
|
35376
|
+
gridWidth = 100 - chartWidth;
|
|
35377
|
+
}
|
|
35378
|
+
else {
|
|
35379
|
+
gridWidth = 30;
|
|
35380
|
+
}
|
|
35381
|
+
}
|
|
35382
|
+
const pdfwidth = (this.parent.pdfExportModule['pdfPageDimensions'].width * gridWidth) / 100;
|
|
35383
|
+
const perColumnWidth = pdfwidth / this.gantt.columns.columns.length;
|
|
35384
|
+
for (let i = 0; i < this.gantt.columns.columns.length; i++) {
|
|
35385
|
+
this.gantt.columns.getColumn(i).width = perColumnWidth;
|
|
35386
|
+
}
|
|
35387
|
+
}
|
|
34868
35388
|
if (this.totalColumnWidth > (this.pdfDoc.pageSettings.width - 82)) {
|
|
34869
35389
|
this.gantt.style.allowHorizontalOverflow = true;
|
|
34870
35390
|
}
|
|
@@ -34979,6 +35499,8 @@ class ExportValueFormatter {
|
|
|
34979
35499
|
*/
|
|
34980
35500
|
class PdfGanttTaskbarCollection {
|
|
34981
35501
|
constructor(parent) {
|
|
35502
|
+
/** Defines the task baselineHeight . */
|
|
35503
|
+
this.baselineHeight = 8;
|
|
34982
35504
|
/**
|
|
34983
35505
|
* @private
|
|
34984
35506
|
*/
|
|
@@ -35025,6 +35547,7 @@ class PdfGanttTaskbarCollection {
|
|
|
35025
35547
|
//code for while current pdf page is exceed
|
|
35026
35548
|
if (yPoint > pageSize.height) {
|
|
35027
35549
|
page = this.GetNextPage(page);
|
|
35550
|
+
page['contentWidth'] = pointToPixel(detail.endPoint - detail.startPoint);
|
|
35028
35551
|
taskGraphics = page.graphics;
|
|
35029
35552
|
startPoint.y = 0;
|
|
35030
35553
|
if (this.parent.pdfExportModule.gantt.enableHeader) {
|
|
@@ -35032,6 +35555,11 @@ class PdfGanttTaskbarCollection {
|
|
|
35032
35555
|
startPoint.y = pixelToPoint(this.parent.timelineModule.isSingleTier ? 45 : 60);
|
|
35033
35556
|
}
|
|
35034
35557
|
isNextPage = true;
|
|
35558
|
+
const graphics = page.graphics;
|
|
35559
|
+
const pen = new PdfPen(new PdfColor(206, 206, 206));
|
|
35560
|
+
if (page['contentWidth'] && (this.parent.gridLines == "Both" || this.parent.gridLines == "Horizontal")) {
|
|
35561
|
+
graphics.drawRectangle(pen, startPoint.x, startPoint.y, page['contentWidth'] + 0.5, rowHeight);
|
|
35562
|
+
}
|
|
35035
35563
|
}
|
|
35036
35564
|
this.drawLeftLabel(page, startPoint, detail, cumulativeWidth);
|
|
35037
35565
|
//Draw Taskbar
|
|
@@ -35055,9 +35583,13 @@ class PdfGanttTaskbarCollection {
|
|
|
35055
35583
|
if (!taskbar.isMilestone) {
|
|
35056
35584
|
const taskbarPen = new PdfPen(taskbar.taskBorderColor);
|
|
35057
35585
|
const taskBrush = new PdfSolidBrush(taskbar.taskColor);
|
|
35586
|
+
const baselinePen = new PdfPen(taskbar.baselineBorderColor);
|
|
35587
|
+
const baselineBrush = new PdfSolidBrush(taskbar.baselineColor);
|
|
35058
35588
|
const progressPen = new PdfPen(taskbar.progressColor);
|
|
35059
35589
|
const progressBrush = new PdfSolidBrush(taskbar.progressColor);
|
|
35060
|
-
const
|
|
35590
|
+
const adjustHeightforTaskbar = pixelToPoint((this.parent.rowHeight - this.height) / 2.0);
|
|
35591
|
+
var adjustHeightforBaseline = pixelToPoint((this.parent.rowHeight - this.height) / 4.5);
|
|
35592
|
+
const adjustHeight = this.parent.renderBaseline ? adjustHeightforBaseline : adjustHeightforTaskbar;
|
|
35061
35593
|
pageIndex = page.section.indexOf(page);
|
|
35062
35594
|
const startDate = isNullOrUndefined(this.unscheduleStarteDate) ? this.startDate : this.unscheduleStarteDate;
|
|
35063
35595
|
const endDate = isNullOrUndefined(this.unscheduleEndDate) ? this.endDate : this.unscheduleEndDate;
|
|
@@ -35071,6 +35603,9 @@ class PdfGanttTaskbarCollection {
|
|
|
35071
35603
|
this.drawUnscheduledTask(taskGraphics, startPoint, cumulativeWidth, adjustHeight);
|
|
35072
35604
|
}
|
|
35073
35605
|
else {
|
|
35606
|
+
if (this.parent.renderBaseline && taskbar.baselineStartDate && taskbar.baselineEndDate) {
|
|
35607
|
+
taskGraphics.drawRectangle(baselinePen, baselineBrush, startPoint.x + pixelToPoint(taskbar.baselineLeft - cumulativeWidth) + 0.5, startPoint.y + adjustHeight + pixelToPoint(taskbar.height + 3), pixelToPoint(this.baselineWidth), pixelToPoint(this.baselineHeight));
|
|
35608
|
+
}
|
|
35074
35609
|
taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth) + 0.5, startPoint.y + adjustHeight, pixelToPoint(taskbar.width), pixelToPoint(taskbar.height));
|
|
35075
35610
|
if (this.isScheduledTask) {
|
|
35076
35611
|
taskGraphics.drawRectangle(progressPen, progressBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth) + 0.5, startPoint.y + adjustHeight, pixelToPoint(taskbar.progressWidth), pixelToPoint(taskbar.height));
|
|
@@ -35102,6 +35637,9 @@ class PdfGanttTaskbarCollection {
|
|
|
35102
35637
|
this.drawUnscheduledTask(taskGraphics, startPoint, cumulativeWidth, adjustHeight);
|
|
35103
35638
|
}
|
|
35104
35639
|
else {
|
|
35640
|
+
if (this.parent.renderBaseline && taskbar.baselineStartDate && taskbar.baselineEndDate) {
|
|
35641
|
+
taskGraphics.drawRectangle(baselinePen, baselineBrush, startPoint.x + pixelToPoint(taskbar.baselineLeft - cumulativeWidth) + 0.5, startPoint.y + adjustHeight + pixelToPoint(taskbar.height + 3), pixelToPoint(this.baselineWidth), pixelToPoint(this.baselineHeight));
|
|
35642
|
+
}
|
|
35105
35643
|
taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth) + 0.5, startPoint.y + adjustHeight, pixelToPoint(renderWidth), pixelToPoint(taskbar.height));
|
|
35106
35644
|
taskbar.width = taskbar.width - renderWidth;
|
|
35107
35645
|
if (this.isScheduledTask) {
|
|
@@ -35133,6 +35671,9 @@ class PdfGanttTaskbarCollection {
|
|
|
35133
35671
|
this.taskStartPoint = Object.assign({}, startPoint);
|
|
35134
35672
|
this.isStartPoint = true;
|
|
35135
35673
|
}
|
|
35674
|
+
if (this.parent.renderBaseline && taskbar.baselineStartDate && taskbar.baselineEndDate) {
|
|
35675
|
+
taskGraphics.drawRectangle(baselinePen, baselineBrush, startPoint.x + pixelToPoint(taskbar.baselineLeft - cumulativeWidth) + 0.5, startPoint.y + adjustHeight + pixelToPoint(taskbar.height + 3), pixelToPoint(this.baselineWidth), pixelToPoint(this.baselineHeight));
|
|
35676
|
+
}
|
|
35136
35677
|
taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(taskbar.left + 0.5), startPoint.y + adjustHeight, pixelToPoint(taskbar.width), pixelToPoint(taskbar.height));
|
|
35137
35678
|
if (this.isScheduledTask) {
|
|
35138
35679
|
taskGraphics.drawRectangle(progressPen, progressBrush, startPoint.x + pixelToPoint(taskbar.left + 0.5), startPoint.y + adjustHeight, pixelToPoint(taskbar.progressWidth), pixelToPoint(taskbar.height));
|
|
@@ -35154,6 +35695,9 @@ class PdfGanttTaskbarCollection {
|
|
|
35154
35695
|
this.taskStartPoint = Object.assign({}, startPoint);
|
|
35155
35696
|
this.isStartPoint = true;
|
|
35156
35697
|
}
|
|
35698
|
+
if (this.parent.renderBaseline && taskbar.baselineStartDate && taskbar.baselineEndDate) {
|
|
35699
|
+
taskGraphics.drawRectangle(baselinePen, baselineBrush, startPoint.x + pixelToPoint(taskbar.baselineLeft - cumulativeWidth) + 0.5, startPoint.y + adjustHeight + pixelToPoint(taskbar.height + 3), pixelToPoint(this.baselineWidth), pixelToPoint(this.baselineHeight));
|
|
35700
|
+
}
|
|
35157
35701
|
taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(taskbar.left) + 0.5, startPoint.y + adjustHeight, pixelToPoint(detail.totalWidth), pixelToPoint(taskbar.height));
|
|
35158
35702
|
if (this.isScheduledTask) {
|
|
35159
35703
|
let progressBoundsWidth = 0;
|
|
@@ -35179,6 +35723,9 @@ class PdfGanttTaskbarCollection {
|
|
|
35179
35723
|
}
|
|
35180
35724
|
else {
|
|
35181
35725
|
this.drawMilestone(page, startPoint, detail, cumulativeWidth);
|
|
35726
|
+
if (this.parent.renderBaseline && taskbar.baselineStartDate && taskbar.baselineEndDate) {
|
|
35727
|
+
this.drawMilestone(page, startPoint, detail, cumulativeWidth);
|
|
35728
|
+
}
|
|
35182
35729
|
}
|
|
35183
35730
|
this.drawRightLabel(page, startPoint, detail, cumulativeWidth);
|
|
35184
35731
|
return isNextPage;
|
|
@@ -35337,13 +35884,20 @@ class PdfGanttTaskbarCollection {
|
|
|
35337
35884
|
const pageIndex = page.section.indexOf(page);
|
|
35338
35885
|
this.taskStartPoint = Object.assign({}, startPoint);
|
|
35339
35886
|
const milestonePen = new PdfPen(this.milestoneColor);
|
|
35340
|
-
const
|
|
35887
|
+
const adjustHeightforBaselineMilesone = pixelToPoint(((this.parent.rowHeight - this.height) / 3.0));
|
|
35888
|
+
const adjustHeightforMilesone = pixelToPoint(((this.parent.rowHeight - this.height) / 2.0));
|
|
35889
|
+
const adjustHeight = this.parent.renderBaseline ? adjustHeightforBaselineMilesone : adjustHeightforMilesone;
|
|
35341
35890
|
const milestoneBrush = new PdfSolidBrush(this.milestoneColor);
|
|
35891
|
+
const baselinePen = new PdfPen(this.baselineBorderColor);
|
|
35892
|
+
const baselineBrush = new PdfSolidBrush(this.baselineColor);
|
|
35342
35893
|
taskGraphics.save(); //saving graphics state
|
|
35343
|
-
const height = Math.floor(this.parent.chartRowsModule.taskBarHeight * 0.
|
|
35894
|
+
const height = Math.floor(this.parent.chartRowsModule.taskBarHeight * 0.8);
|
|
35344
35895
|
/* eslint-disable-next-line */
|
|
35345
35896
|
taskGraphics.translateTransform(startPoint.x + pixelToPoint(this.left - cumulativeWidth), startPoint.y + adjustHeight - (this.parent.chartRowsModule.taskBarHeight * 0.7) / 2);
|
|
35346
35897
|
taskGraphics.rotateTransform(45); //apply rotation
|
|
35898
|
+
if (this.parent.renderBaseline && this.baselineStartDate && this.baselineEndDate) {
|
|
35899
|
+
taskGraphics.drawRectangle(baselinePen, baselineBrush, 2, 2, pixelToPoint(height), pixelToPoint(height));
|
|
35900
|
+
}
|
|
35347
35901
|
taskGraphics.drawRectangle(milestonePen, milestoneBrush, 0, 0, pixelToPoint(height), pixelToPoint(height));
|
|
35348
35902
|
taskGraphics.restore(); //restoring graphics state
|
|
35349
35903
|
this.endPage = this.startPage = pageIndex;
|
|
@@ -35373,7 +35927,7 @@ class PdfTimeline {
|
|
|
35373
35927
|
* @returns {void}
|
|
35374
35928
|
*/
|
|
35375
35929
|
drawTimeline(page, startPoint, detail) {
|
|
35376
|
-
let remainWidth = Math.floor(detail.totalWidth);
|
|
35930
|
+
let remainWidth = pointToPixel(Math.floor(detail.totalWidth));
|
|
35377
35931
|
let renderWidth = 0;
|
|
35378
35932
|
this.topTierPoint.x = startPoint.x;
|
|
35379
35933
|
this.topTierPoint.y = startPoint.y;
|
|
@@ -35401,7 +35955,7 @@ class PdfTimeline {
|
|
|
35401
35955
|
//Primary header Event Arguments
|
|
35402
35956
|
/* eslint-disable-next-line */
|
|
35403
35957
|
this.triggerQueryTimelinecell(page, this.topTierPoint.x, this.topTierPoint.y, this.topTierHeight, renderWidth, pHeader.value, true);
|
|
35404
|
-
this.topTierPoint.x +=
|
|
35958
|
+
this.topTierPoint.x += renderWidth;
|
|
35405
35959
|
remainWidth -= renderWidth;
|
|
35406
35960
|
if (isCompleted) {
|
|
35407
35961
|
this.topTierIndex++;
|
|
@@ -35427,7 +35981,7 @@ class PdfTimeline {
|
|
|
35427
35981
|
//Secondary header Event Arguments
|
|
35428
35982
|
/* eslint-disable-next-line */
|
|
35429
35983
|
this.triggerQueryTimelinecell(page, this.bottomTierPoint.x, this.bottomTierPoint.y, this.bottomTierHeight, width, secondHeader.value, false);
|
|
35430
|
-
this.bottomTierPoint.x = this.bottomTierPoint.x +
|
|
35984
|
+
this.bottomTierPoint.x = this.bottomTierPoint.x + width;
|
|
35431
35985
|
remainWidth -= width;
|
|
35432
35986
|
secondHeader.completedWidth = width;
|
|
35433
35987
|
if (isCompleted) {
|
|
@@ -35458,7 +36012,7 @@ class PdfTimeline {
|
|
|
35458
36012
|
//Primary header Event Arguments
|
|
35459
36013
|
/* eslint-disable-next-line */
|
|
35460
36014
|
this.triggerQueryTimelinecell(page, this.topTierPoint.x, this.topTierPoint.y, this.topTierHeight, pHeader.completedWidth, pHeader.value, true);
|
|
35461
|
-
this.topTierPoint.x +=
|
|
36015
|
+
this.topTierPoint.x += pHeader.completedWidth;
|
|
35462
36016
|
}
|
|
35463
36017
|
}
|
|
35464
36018
|
}
|
|
@@ -35471,7 +36025,7 @@ class PdfTimeline {
|
|
|
35471
36025
|
//Secondary header Event Arguments
|
|
35472
36026
|
/* eslint-disable-next-line */
|
|
35473
36027
|
this.triggerQueryTimelinecell(page, this.bottomTierPoint.x, this.bottomTierPoint.y, this.bottomTierHeight, secondHeader.width, secondHeader.value, false);
|
|
35474
|
-
this.bottomTierPoint.x = this.bottomTierPoint.x +
|
|
36028
|
+
this.bottomTierPoint.x = this.bottomTierPoint.x + secondHeader.width;
|
|
35475
36029
|
}
|
|
35476
36030
|
}
|
|
35477
36031
|
}
|
|
@@ -35518,7 +36072,10 @@ class PdfTimeline {
|
|
|
35518
36072
|
const e = eventArgs.timelineCell;
|
|
35519
36073
|
const rectPen = new PdfPen(eventArgs.timelineCell.borderColor);
|
|
35520
36074
|
const rectBrush = new PdfSolidBrush(eventArgs.timelineCell.backgroundColor);
|
|
35521
|
-
graphics.drawRectangle(rectPen, rectBrush, x, y,
|
|
36075
|
+
graphics.drawRectangle(rectPen, rectBrush, x, y, width, pixelToPoint(height));
|
|
36076
|
+
if (!isTopTier && (this.parent.gridLines == "Both" || this.parent.gridLines == "Vertical")) {
|
|
36077
|
+
graphics.drawRectangle(rectPen, rectBrush, x, y + pixelToPoint(height), width, page.getClientSize().height);
|
|
36078
|
+
}
|
|
35522
36079
|
let font = new PdfStandardFont(ganttStyle.fontFamily, e.fontSize, e.fontStyle);
|
|
35523
36080
|
if (ganttStyle.font) {
|
|
35524
36081
|
font = ganttStyle.font;
|
|
@@ -35527,7 +36084,13 @@ class PdfTimeline {
|
|
|
35527
36084
|
const pLeft = ganttStyle.timeline.padding ? eventArgs.timelineCell.padding.left : 0;
|
|
35528
36085
|
const pTop = ganttStyle.timeline.padding ? eventArgs.timelineCell.padding.top : 0;
|
|
35529
36086
|
/* eslint-disable-next-line */
|
|
35530
|
-
|
|
36087
|
+
if (isTopTier) {
|
|
36088
|
+
x = x + pLeft + 4;
|
|
36089
|
+
}
|
|
36090
|
+
else {
|
|
36091
|
+
x = x + pLeft;
|
|
36092
|
+
}
|
|
36093
|
+
graphics.drawString(eventArgs.value, font, null, textBrush, x, y + pTop, pixelToPoint(width), pixelToPoint(height), e.format);
|
|
35531
36094
|
}
|
|
35532
36095
|
}
|
|
35533
36096
|
|
|
@@ -35682,7 +36245,9 @@ class PdfGanttPredecessor {
|
|
|
35682
36245
|
}
|
|
35683
36246
|
break;
|
|
35684
36247
|
}
|
|
35685
|
-
|
|
36248
|
+
const midPointforTaskbar = Math.round((this.parent.rowHeight - 1) / 2.0);
|
|
36249
|
+
const midPointforBaseline = Math.round((this.parent.rowHeight - 10) / 2.0);
|
|
36250
|
+
let midPoint = this.parent.renderBaseline ? midPointforBaseline : midPointforTaskbar;
|
|
35686
36251
|
midPoint = pixelToPoint(midPoint);
|
|
35687
36252
|
/* eslint-disable-next-line */
|
|
35688
36253
|
let point1, point2, point3, point4, point5, point6;
|
|
@@ -36145,6 +36710,7 @@ class PdfGantt extends PdfTreeGrid {
|
|
|
36145
36710
|
let pageData;
|
|
36146
36711
|
this.headerDetails.forEach((detail, index) => {
|
|
36147
36712
|
const page = this.result.page.section.getPages()[this.startPageIndex];
|
|
36713
|
+
page['contentWidth'] = pointToPixel(this.headerDetails[index].endPoint - this.headerDetails[index].startPoint);
|
|
36148
36714
|
this.chartHeader.drawTimeline(page, this.startPoint, detail);
|
|
36149
36715
|
taskbarPoint.y = taskbarPoint.y + pixelToPoint(this.parent.timelineModule.isSingleTier ? 45 : 60); // headerHeight
|
|
36150
36716
|
pageStartX = taskbarPoint.x;
|
|
@@ -36155,6 +36721,11 @@ class PdfGantt extends PdfTreeGrid {
|
|
|
36155
36721
|
const task = this.taskbarCollection[i];
|
|
36156
36722
|
const rowHeight = this.rows.getRow(i + 1).height;
|
|
36157
36723
|
const pdfPage = this.result.page.section.getPages()[this.startPageIndex];
|
|
36724
|
+
const graphics = pdfPage.graphics;
|
|
36725
|
+
const pen = new PdfPen(new PdfColor(206, 206, 206));
|
|
36726
|
+
if (page['contentWidth'] && (this.parent.gridLines == "Both" || this.parent.gridLines == "Horizontal")) {
|
|
36727
|
+
graphics.drawRectangle(pen, pageStartX, taskbarPoint.y, page['contentWidth'] + 0.5, rowHeight);
|
|
36728
|
+
}
|
|
36158
36729
|
/* eslint-disable-next-line */
|
|
36159
36730
|
const isNextPage = task.drawTaskbar(pdfPage, taskbarPoint, detail, cumulativeWidth, rowHeight, this.taskbarCollection[i]);
|
|
36160
36731
|
if (isNextPage) {
|
|
@@ -36286,11 +36857,23 @@ class PdfExport {
|
|
|
36286
36857
|
if (isNullOrUndefined(pdfExportProperties)) {
|
|
36287
36858
|
pdfExportProperties = {};
|
|
36288
36859
|
}
|
|
36289
|
-
if (pdfExportProperties.
|
|
36290
|
-
|
|
36860
|
+
if (pdfExportProperties.fitToWidthSettings && pdfExportProperties.fitToWidthSettings.isFitToWidth) {
|
|
36861
|
+
if (pdfExportProperties.exportType === 'CurrentViewData') {
|
|
36862
|
+
this.helper.beforeSinglePageExport['cloneFlatData'] = extend([], this.parent.currentViewData, null, true);
|
|
36863
|
+
}
|
|
36864
|
+
else {
|
|
36865
|
+
this.helper.beforeSinglePageExport['cloneFlatData'] = extend([], this.parent.flatData, null, true);
|
|
36866
|
+
}
|
|
36867
|
+
this.helper.beforeSinglePageExport['cloneCurrentViewData'] = extend([], this.parent.currentViewData, null, true);
|
|
36868
|
+
data = this.helper.beforeSinglePageExport['cloneFlatData'];
|
|
36291
36869
|
}
|
|
36292
36870
|
else {
|
|
36293
|
-
|
|
36871
|
+
if (pdfExportProperties.exportType === 'CurrentViewData') {
|
|
36872
|
+
data = this.parent.currentViewData;
|
|
36873
|
+
}
|
|
36874
|
+
else {
|
|
36875
|
+
data = this.parent.flatData;
|
|
36876
|
+
}
|
|
36294
36877
|
}
|
|
36295
36878
|
this.initGantt();
|
|
36296
36879
|
if (!isNullOrUndefined(pdfDoc)) {
|
|
@@ -36314,6 +36897,7 @@ class PdfExport {
|
|
|
36314
36897
|
const section = this.pdfDocument.sections.add();
|
|
36315
36898
|
this.processSectionExportProperties(section, pdfExportProperties);
|
|
36316
36899
|
const pdfPage = section.pages.add();
|
|
36900
|
+
this.pdfPageDimensions = pdfPage.getClientSize();
|
|
36317
36901
|
/* eslint-disable-next-line */
|
|
36318
36902
|
return new Promise((resolve, reject) => {
|
|
36319
36903
|
this.helper.processGridExport(data, this.gantt, pdfExportProperties);
|
|
@@ -36324,6 +36908,26 @@ class PdfExport {
|
|
|
36324
36908
|
format.break = PdfLayoutBreakType.FitElement;
|
|
36325
36909
|
const layouter = this.gantt.drawGrid(pdfPage, 0, 0, format);
|
|
36326
36910
|
this.gantt.drawChart(layouter);
|
|
36911
|
+
if (this.helper.exportProps && this.helper.exportProps.fitToWidthSettings && this.helper.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
36912
|
+
this.parent.zoomingProjectStartDate = this.helper.beforeSinglePageExport['zoomingProjectStartDate'];
|
|
36913
|
+
this.parent.zoomingProjectEndDate = this.helper.beforeSinglePageExport['zoomingProjectEndDate'];
|
|
36914
|
+
this.parent.cloneProjectStartDate = this.helper.beforeSinglePageExport['cloneProjectStartDate'];
|
|
36915
|
+
this.parent.cloneProjectEndDate = this.helper.beforeSinglePageExport['cloneProjectEndDate'];
|
|
36916
|
+
this.parent.timelineModule.customTimelineSettings = this.helper.beforeSinglePageExport['customTimelineSettings'];
|
|
36917
|
+
this.parent.isTimelineRoundOff = this.helper.beforeSinglePageExport['isTimelineRoundOff'];
|
|
36918
|
+
this.parent.timelineModule.topTier = this.helper.beforeSinglePageExport['topTier'];
|
|
36919
|
+
this.parent.timelineModule.topTierCellWidth = this.helper.beforeSinglePageExport['topTierCellWidth'];
|
|
36920
|
+
this.parent.timelineModule.topTierCollection = this.helper.beforeSinglePageExport['topTierCollection'];
|
|
36921
|
+
this.parent.timelineModule.bottomTier = this.helper.beforeSinglePageExport['bottomTier'];
|
|
36922
|
+
this.parent.timelineModule.bottomTierCellWidth = this.helper.beforeSinglePageExport['bottomTierCellWidth'];
|
|
36923
|
+
this.parent.timelineModule.bottomTierCollection = this.helper.beforeSinglePageExport['bottomTierCollection'];
|
|
36924
|
+
this.parent.timelineModule.totalTimelineWidth = this.helper.beforeSinglePageExport['totalTimelineWidth'];
|
|
36925
|
+
this.parent.timelineModule.timelineStartDate = this.helper.beforeSinglePageExport['timelineStartDate'];
|
|
36926
|
+
this.parent.timelineModule.timelineEndDate = this.helper.beforeSinglePageExport['timelineEndDate'];
|
|
36927
|
+
this.parent.timelineModule.timelineRoundOffEndDate = this.helper.beforeSinglePageExport['timelineRoundOffEndDate'];
|
|
36928
|
+
this.parent.perDayWidth = this.helper.beforeSinglePageExport['perDayWidth'];
|
|
36929
|
+
this.parent.updatedConnectorLineCollection = this.helper.beforeSinglePageExport['updatedConnectorLineCollection'];
|
|
36930
|
+
}
|
|
36327
36931
|
if (!isMultipleExport) {
|
|
36328
36932
|
if (!this.isBlob) {
|
|
36329
36933
|
// save the PDF
|