@syncfusion/ej2-gantt 22.2.12 → 23.1.38
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 +197 -164
- package/dist/ej2-gantt.min.js +3 -3
- package/dist/ej2-gantt.umd.min.js +3 -3
- package/dist/ej2-gantt.umd.min.js.map +1 -1
- package/dist/es6/ej2-gantt.es2015.js +973 -280
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +1011 -302
- package/dist/es6/ej2-gantt.es5.js.map +1 -1
- package/dist/global/ej2-gantt.min.js +3 -3
- package/dist/global/ej2-gantt.min.js.map +1 -1
- package/dist/global/index.d.ts +2 -2
- package/package.json +21 -21
- package/src/gantt/actions/cell-edit.js +4 -1
- package/src/gantt/actions/connector-line-edit.js +48 -6
- package/src/gantt/actions/critical-path.d.ts +2 -0
- package/src/gantt/actions/critical-path.js +79 -61
- package/src/gantt/actions/dependency.d.ts +1 -0
- package/src/gantt/actions/dependency.js +92 -31
- package/src/gantt/actions/dialog-edit.js +28 -8
- package/src/gantt/actions/edit.js +18 -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 +58 -38
- 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 +85 -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 +78 -16
- package/src/gantt/base/interface.d.ts +14 -0
- package/src/gantt/base/splitter.js +1 -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 +44 -34
- package/src/gantt/renderer/connector-line.js +52 -11
- 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;
|
|
@@ -4034,7 +4079,7 @@ const chartRowCell = 'e-chart-row-cell';
|
|
|
4034
4079
|
const chartRow = 'e-chart-row';
|
|
4035
4080
|
const rowExpand = 'e-row-expand';
|
|
4036
4081
|
const rowCollapse = 'e-row-collapse';
|
|
4037
|
-
|
|
4082
|
+
|
|
4038
4083
|
const taskBarLeftResizer = 'e-taskbar-left-resizer';
|
|
4039
4084
|
const taskBarRightResizer = 'e-taskbar-right-resizer';
|
|
4040
4085
|
const childProgressResizer = 'e-child-progress-resizer';
|
|
@@ -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,17 @@ class GanttChart {
|
|
|
5293
5401
|
this.parent.treeGrid.expandAll();
|
|
5294
5402
|
}
|
|
5295
5403
|
else {
|
|
5404
|
+
this.isCollapseAll = true;
|
|
5296
5405
|
this.parent.treeGrid.collapseAll();
|
|
5406
|
+
if (this.isCollapseAll && !this.parent.allowTaskbarOverlap && this.parent.viewType === 'ResourceView') {
|
|
5407
|
+
let treeGridContentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
|
|
5408
|
+
this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
|
|
5409
|
+
this.parent.contentHeight = treeGridContentHeight;
|
|
5410
|
+
document.getElementsByClassName('e-chart-rows-container')[0]['style'].height = this.parent.contentHeight + 'px';
|
|
5411
|
+
}
|
|
5297
5412
|
}
|
|
5298
5413
|
this.isExpandAll = false;
|
|
5414
|
+
this.isCollapseAll = false;
|
|
5299
5415
|
}
|
|
5300
5416
|
/**
|
|
5301
5417
|
* Public method to expand particular level of rows.
|
|
@@ -5778,7 +5894,7 @@ class GanttChart {
|
|
|
5778
5894
|
childElement = element;
|
|
5779
5895
|
}
|
|
5780
5896
|
}
|
|
5781
|
-
if (element.classList.contains('e-right-label-temp-container') || element.classList.contains('e-left-label-temp-container') || element.classList.contains('e-indicator-span')) {
|
|
5897
|
+
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
5898
|
if (focus === 'add') {
|
|
5783
5899
|
element.setAttribute('tabIndex', '0');
|
|
5784
5900
|
addClass([element], 'e-active-container');
|
|
@@ -5842,7 +5958,13 @@ class GanttChart {
|
|
|
5842
5958
|
recordIndex = this.parent.flatData.indexOf(record);
|
|
5843
5959
|
}
|
|
5844
5960
|
else {
|
|
5845
|
-
|
|
5961
|
+
if (this.parent.pdfExportModule && this.parent.pdfExportModule.helper.exportProps && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings &&
|
|
5962
|
+
this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth && this.parent.pdfExportModule.isPdfExport) {
|
|
5963
|
+
recordIndex = this.parent.ids.indexOf(record.ganttProperties.taskId.toString());
|
|
5964
|
+
}
|
|
5965
|
+
else {
|
|
5966
|
+
recordIndex = this.parent.currentViewData.indexOf(record);
|
|
5967
|
+
}
|
|
5846
5968
|
}
|
|
5847
5969
|
}
|
|
5848
5970
|
return recordIndex;
|
|
@@ -5917,7 +6039,9 @@ class Timeline {
|
|
|
5917
6039
|
*/
|
|
5918
6040
|
refreshTimelineByTimeSpan() {
|
|
5919
6041
|
this.validateTimelineProp();
|
|
5920
|
-
this.parent.
|
|
6042
|
+
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)) {
|
|
6043
|
+
this.parent.ganttChartModule.chartTimelineContainer.innerHTML = '';
|
|
6044
|
+
}
|
|
5921
6045
|
this.createTimelineSeries();
|
|
5922
6046
|
}
|
|
5923
6047
|
/**
|
|
@@ -6231,7 +6355,10 @@ class Timeline {
|
|
|
6231
6355
|
this.customTimelineSettings.topTier.format = this.validateFormat(this.topTier, this.customTimelineSettings.topTier.format);
|
|
6232
6356
|
this.customTimelineSettings.weekStartDay = this.customTimelineSettings.weekStartDay >= 0 &&
|
|
6233
6357
|
this.customTimelineSettings.weekStartDay <= 6 ? this.customTimelineSettings.weekStartDay : 0;
|
|
6234
|
-
this.
|
|
6358
|
+
if (!(this.parent.pdfExportModule && this.parent.pdfExportModule.helper.exportProps &&
|
|
6359
|
+
this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth)) {
|
|
6360
|
+
this.checkCurrentZoomingLevel();
|
|
6361
|
+
}
|
|
6235
6362
|
}
|
|
6236
6363
|
/**
|
|
6237
6364
|
* To find the current zooming level of the Gantt control.
|
|
@@ -6476,13 +6603,15 @@ class Timeline {
|
|
|
6476
6603
|
table = createElement('table', { className: timelineHeaderTableContainer, styles: 'display: block;' });
|
|
6477
6604
|
thead = createElement('thead', { className: timelineHeaderTableBody, styles: 'display:block; border-collapse:collapse' });
|
|
6478
6605
|
tr = createElement('tr', { innerHTML: this.createTimelineTemplate(tier) });
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6606
|
+
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)) {
|
|
6607
|
+
td = createElement('th');
|
|
6608
|
+
div = createElement('div', { styles: 'width: 20px' });
|
|
6609
|
+
td.appendChild(div);
|
|
6610
|
+
tr.appendChild(td);
|
|
6611
|
+
thead.appendChild(tr);
|
|
6612
|
+
table.appendChild(thead);
|
|
6613
|
+
this.parent.ganttChartModule.chartTimelineContainer.appendChild(table);
|
|
6614
|
+
}
|
|
6486
6615
|
tier = 'bottomTier';
|
|
6487
6616
|
tr = null;
|
|
6488
6617
|
}
|
|
@@ -7520,6 +7649,11 @@ class GanttTreeGrid {
|
|
|
7520
7649
|
this.wireEvents();
|
|
7521
7650
|
}
|
|
7522
7651
|
composeProperties() {
|
|
7652
|
+
this.parent.treeGrid.hasChildMapping = this.parent.taskFields.hasChildMapping;
|
|
7653
|
+
this.parent.treeGrid.loadChildOnDemand = this.parent.loadChildOnDemand;
|
|
7654
|
+
this.parent.treeGrid['isFromGantt'] = true;
|
|
7655
|
+
this.parent.treeGrid.parentIdMapping = this.parent.taskFields.parentID;
|
|
7656
|
+
this.parent.treeGrid.idMapping = this.parent.taskFields.id;
|
|
7523
7657
|
this.parent.treeGrid.showColumnMenu = this.parent.showColumnMenu;
|
|
7524
7658
|
this.parent.treeGrid.enableCollapseAll = this.parent.collapseAllParentTasks;
|
|
7525
7659
|
this.parent.treeGrid.columnMenuItems = this.parent.columnMenuItems;
|
|
@@ -7536,8 +7670,14 @@ class GanttTreeGrid {
|
|
|
7536
7670
|
this.parent.treeGrid.dataSource = { result: this.parent.flatData, count: count };
|
|
7537
7671
|
}
|
|
7538
7672
|
else {
|
|
7539
|
-
this.parent.treeGrid.hasChildMapping
|
|
7540
|
-
|
|
7673
|
+
if (!this.parent.treeGrid.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
7674
|
+
this.parent.autoCalculateDateScheduling = false;
|
|
7675
|
+
this.parent.treeGrid.dataSource = this.parent.dataSource;
|
|
7676
|
+
}
|
|
7677
|
+
else {
|
|
7678
|
+
this.parent.treeGrid.hasChildMapping = null;
|
|
7679
|
+
this.parent.treeGrid.dataSource = this.parent.flatData;
|
|
7680
|
+
}
|
|
7541
7681
|
}
|
|
7542
7682
|
this.parent.treeGrid.expandStateMapping = this.parent.taskFields.expandState;
|
|
7543
7683
|
const isGantt = 'isGantt';
|
|
@@ -7698,7 +7838,7 @@ class GanttTreeGrid {
|
|
|
7698
7838
|
collapsedArgs = this.createExpandCollapseArgs(args, null);
|
|
7699
7839
|
this.parent.ganttChartModule.collapsedGanttRow(collapsedArgs);
|
|
7700
7840
|
}
|
|
7701
|
-
if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && collapsedArgs['gridRow']) {
|
|
7841
|
+
if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && !this.parent.ganttChartModule.isCollapseAll && collapsedArgs['gridRow']) {
|
|
7702
7842
|
collapsedArgs['gridRow'].style.height = collapsedArgs['chartRow'].style.height;
|
|
7703
7843
|
this.parent.contentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
|
|
7704
7844
|
this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
|
|
@@ -7728,7 +7868,7 @@ class GanttTreeGrid {
|
|
|
7728
7868
|
expandedArgs = this.createExpandCollapseArgs(args, null);
|
|
7729
7869
|
this.parent.ganttChartModule.expandedGanttRow(expandedArgs);
|
|
7730
7870
|
}
|
|
7731
|
-
if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && args['row']) {
|
|
7871
|
+
if (this.parent.viewType === 'ResourceView' && !this.parent.allowTaskbarOverlap && !this.parent.ganttChartModule.isExpandAll && args['row']) {
|
|
7732
7872
|
args['row'].style.height = this.parent.rowHeight + 'px';
|
|
7733
7873
|
this.parent.contentHeight = this.parent.enableRtl ? this.parent['element'].getElementsByClassName('e-content')[2].children[0]['offsetHeight'] :
|
|
7734
7874
|
this.parent['element'].getElementsByClassName('e-content')[0].children[0]['offsetHeight'];
|
|
@@ -8292,6 +8432,9 @@ class GanttTreeGrid {
|
|
|
8292
8432
|
if (!isNullOrUndefined(ganttProp)) {
|
|
8293
8433
|
return this.parent.dataOperation.getDurationString(ganttProp.duration, ganttProp.durationUnit);
|
|
8294
8434
|
}
|
|
8435
|
+
else if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
8436
|
+
return this.parent.dataOperation.getDurationString(parseInt(data[this.parent.taskFields.duration]), this.parent.durationUnit);
|
|
8437
|
+
}
|
|
8295
8438
|
return '';
|
|
8296
8439
|
} // eslint-disable-next-line
|
|
8297
8440
|
resourceValueAccessor(field, data, column) {
|
|
@@ -8328,12 +8471,7 @@ class GanttTreeGrid {
|
|
|
8328
8471
|
}
|
|
8329
8472
|
updateScrollTop(args) {
|
|
8330
8473
|
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
|
-
}
|
|
8474
|
+
newScrollTop = getValue('top', args);
|
|
8337
8475
|
this.treeGridElement.querySelector('.e-content').scrollTop = newScrollTop;
|
|
8338
8476
|
this.previousScroll.top = this.treeGridElement.querySelector('.e-content').scrollTop;
|
|
8339
8477
|
}
|
|
@@ -8645,6 +8783,9 @@ __decorate$12([
|
|
|
8645
8783
|
__decorate$12([
|
|
8646
8784
|
Property(null)
|
|
8647
8785
|
], TaskFields.prototype, "parentID", void 0);
|
|
8786
|
+
__decorate$12([
|
|
8787
|
+
Property(null)
|
|
8788
|
+
], TaskFields.prototype, "hasChildMapping", void 0);
|
|
8648
8789
|
__decorate$12([
|
|
8649
8790
|
Property(null)
|
|
8650
8791
|
], TaskFields.prototype, "startDate", void 0);
|
|
@@ -9144,16 +9285,16 @@ class ChartRows extends DateProcessor {
|
|
|
9144
9285
|
return splitTasks;
|
|
9145
9286
|
}
|
|
9146
9287
|
getSplitTaskbarLeftResizerNode() {
|
|
9147
|
-
const lResizerLeft =
|
|
9288
|
+
const lResizerLeft = (!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? 5 : -2;
|
|
9148
9289
|
const template = '<div class="' + taskBarLeftResizer + ' ' + icon + '"' +
|
|
9149
|
-
' style="' + (this.parent.enableRtl ? 'right:' : 'left:') + lResizerLeft + 'px;height:' + (this.taskBarHeight) + 'px;"></div>';
|
|
9290
|
+
' style="' + (this.parent.enableRtl ? 'right:' : 'left:') + lResizerLeft + 'px;height:' + (this.taskBarHeight) + 'px;z-index:1"></div>';
|
|
9150
9291
|
return template;
|
|
9151
9292
|
}
|
|
9152
9293
|
getSplitTaskbarRightResizerNode(segment) {
|
|
9153
|
-
const rResizerLeft =
|
|
9294
|
+
const rResizerLeft = (!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? -17 : -10;
|
|
9154
9295
|
const template = '<div class="' + taskBarRightResizer + ' ' + icon + '"' +
|
|
9155
9296
|
' style="' + (this.parent.enableRtl ? 'right:' : 'left:') + (segment.width + rResizerLeft) + 'px;' +
|
|
9156
|
-
'height:' + (this.taskBarHeight) + 'px;"></div>';
|
|
9297
|
+
'height:' + (this.taskBarHeight) + 'px;z-index:1"></div>';
|
|
9157
9298
|
return template;
|
|
9158
9299
|
}
|
|
9159
9300
|
getSplitProgressResizerNode(segment) {
|
|
@@ -9478,7 +9619,7 @@ class ChartRows extends DateProcessor {
|
|
|
9478
9619
|
}
|
|
9479
9620
|
else {
|
|
9480
9621
|
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);
|
|
9622
|
+
((this.parent.renderBaseline ? this.taskBarHeight : this.taskBarHeight - 6)) + 'px;position:absolute;transform: rotate(45deg);left:' + 1 + 'px;"> </div>';
|
|
9482
9623
|
milestoneNode = this.createDivElement(template);
|
|
9483
9624
|
}
|
|
9484
9625
|
return milestoneNode;
|
|
@@ -9508,7 +9649,7 @@ class ChartRows extends DateProcessor {
|
|
|
9508
9649
|
let baselineMilestoneHeight = this.parent.renderBaseline ? 5 : 2;
|
|
9509
9650
|
const template = '<div class="' + baselineMilestoneContainer + '" style="width:' + ((this.parent.renderBaseline ? this.taskBarHeight : this.taskBarHeight - 10)) + 'px;height:' +
|
|
9510
9651
|
((this.parent.renderBaseline ? this.taskBarHeight : this.taskBarHeight - 10)) + 'px;position:absolute;transform:rotate(45deg);' + (this.parent.enableRtl ? 'right:' : 'left:') + (this.parent.enableRtl ? (data.ganttProperties.left -
|
|
9511
|
-
(this.milestoneHeight / 2) + 3) : (data.ganttProperties.
|
|
9652
|
+
(this.milestoneHeight / 2) + 3) : (data.ganttProperties.baselineLeft - (this.milestoneHeight / 2) + 1)) + 'px;' + (this.baselineColor ? 'background-color: ' + this.baselineColor + ';' : '') + 'margin-top:' + ((-Math.floor(this.parent.rowHeight - this.milestoneMarginTop) + baselineMilestoneHeight) + 2) + 'px"> </div>';
|
|
9512
9653
|
return this.createDivElement(template);
|
|
9513
9654
|
}
|
|
9514
9655
|
/**
|
|
@@ -9856,16 +9997,16 @@ class ChartRows extends DateProcessor {
|
|
|
9856
9997
|
return this.createDivElement(template);
|
|
9857
9998
|
}
|
|
9858
9999
|
childTaskbarLeftResizer() {
|
|
9859
|
-
const lResizerLeft =
|
|
10000
|
+
const lResizerLeft = (!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? 5 : -2;
|
|
9860
10001
|
const template = '<div class="' + taskBarLeftResizer + ' ' + icon + '"' +
|
|
9861
|
-
'style="' + (this.parent.enableRtl ? 'right:' : 'left:') + lResizerLeft + 'px;height:' + (this.taskBarHeight) + 'px;"></div>';
|
|
10002
|
+
'style="' + (this.parent.enableRtl ? 'right:' : 'left:') + lResizerLeft + 'px;height:' + (this.taskBarHeight) + 'px;z-index:1"></div>';
|
|
9862
10003
|
return this.createDivElement(template);
|
|
9863
10004
|
}
|
|
9864
10005
|
childTaskbarRightResizer() {
|
|
9865
|
-
const rResizerLeft =
|
|
10006
|
+
const rResizerLeft = (!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? -17 : -10;
|
|
9866
10007
|
const template = '<div class="' + taskBarRightResizer + ' ' + icon + '"' +
|
|
9867
10008
|
'style="' + (this.parent.enableRtl ? 'right:' : 'left:') + (this.templateData.ganttProperties.width + rResizerLeft) + 'px;' +
|
|
9868
|
-
'height:' + (this.taskBarHeight) + 'px;"></div>';
|
|
10009
|
+
'height:' + (this.taskBarHeight) + 'px;z-index:1"></div>';
|
|
9869
10010
|
return this.createDivElement(template);
|
|
9870
10011
|
}
|
|
9871
10012
|
childTaskbarProgressResizer() {
|
|
@@ -9879,8 +10020,10 @@ class ChartRows extends DateProcessor {
|
|
|
9879
10020
|
}
|
|
9880
10021
|
getLeftPointNode() {
|
|
9881
10022
|
const data = this.templateData;
|
|
9882
|
-
|
|
9883
|
-
|
|
10023
|
+
let left = (!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? 12 : 0;
|
|
10024
|
+
let mileStoneLeftValue = (!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? 6 : 3;
|
|
10025
|
+
const pointerLeft = -(3 + this.connectorPointWidth + left);
|
|
10026
|
+
const mileStoneLeft = -(this.connectorPointWidth + 4 + mileStoneLeftValue);
|
|
9884
10027
|
const pointerTop = Math.floor(this.milesStoneRadius - (this.connectorPointWidth / 2));
|
|
9885
10028
|
let marginTop;
|
|
9886
10029
|
if ((!this.templateData.ganttProperties.isAutoSchedule && this.templateData.hasChildRecords) && this.parent.allowParentDependency) {
|
|
@@ -9899,7 +10042,8 @@ class ChartRows extends DateProcessor {
|
|
|
9899
10042
|
}
|
|
9900
10043
|
getRightPointNode() {
|
|
9901
10044
|
const data = this.templateData;
|
|
9902
|
-
|
|
10045
|
+
let right = (!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? -12 : 0;
|
|
10046
|
+
const pointerRight = -(3 + right);
|
|
9903
10047
|
const pointerTop = Math.floor(this.milesStoneRadius - (this.connectorPointWidth / 2));
|
|
9904
10048
|
let marginTop;
|
|
9905
10049
|
if ((!this.templateData.ganttProperties.isAutoSchedule && this.templateData.hasChildRecords) && this.parent.allowParentDependency) {
|
|
@@ -9909,7 +10053,7 @@ class ChartRows extends DateProcessor {
|
|
|
9909
10053
|
marginTop = 'margin-top:' + this.connectorPointMargin + 'px';
|
|
9910
10054
|
}
|
|
9911
10055
|
const template = '<div class="' + rightConnectorPointOuterDiv + '" style="' +
|
|
9912
|
-
((data.ganttProperties.isMilestone) ? ('left:' + (this.milestoneHeight - 2) + 'px;margin-top:' +
|
|
10056
|
+
((data.ganttProperties.isMilestone) ? ('left:' + ((!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? (this.milestoneHeight + 5) : this.milestoneHeight - 2) + 'px;margin-top:' +
|
|
9913
10057
|
pointerTop + 'px;') : ('left:' + (data.ganttProperties.width + pointerRight) + 'px;' + marginTop + ';')) + '">' +
|
|
9914
10058
|
'<div class="' + connectorPointRight + ' ' + this.parent.getUnscheduledTaskClass(data.ganttProperties) +
|
|
9915
10059
|
'" style="width:' + this.connectorPointWidth + 'px;height:' + this.connectorPointWidth + 'px;">' +
|
|
@@ -10082,7 +10226,7 @@ class ChartRows extends DateProcessor {
|
|
|
10082
10226
|
* @private
|
|
10083
10227
|
*/
|
|
10084
10228
|
initChartHelperPrivateVariable() {
|
|
10085
|
-
let taskbarHeightValue = this.parent.renderBaseline ? 0.45 : 0.62;
|
|
10229
|
+
let taskbarHeightValue = this.parent.renderBaseline ? 0.45 : ((!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? 0.7 : 0.62);
|
|
10086
10230
|
let taskBarMarginTopValue = this.parent.renderBaseline ? 4 : 2;
|
|
10087
10231
|
let milestoneHeightValue = this.parent.renderBaseline ? 1.13 : 0.82;
|
|
10088
10232
|
this.baselineColor = !isNullOrUndefined(this.parent.baselineColor) &&
|
|
@@ -10104,8 +10248,8 @@ class ChartRows extends DateProcessor {
|
|
|
10104
10248
|
this.milestoneMarginTop = Math.floor((this.parent.rowHeight - this.milestoneHeight) / 2);
|
|
10105
10249
|
this.milesStoneRadius = Math.floor((this.milestoneHeight) / 2);
|
|
10106
10250
|
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))
|
|
10251
|
+
this.connectorPointWidth = this.parent.isAdaptive ? Math.round(this.taskBarHeight / 2) : 8;
|
|
10252
|
+
this.connectorPointMargin = Math.floor((this.taskBarHeight / 2) - (this.connectorPointWidth / 2));
|
|
10109
10253
|
}
|
|
10110
10254
|
/**
|
|
10111
10255
|
* Function used to refresh Gantt rows.
|
|
@@ -10393,8 +10537,20 @@ class ChartRows extends DateProcessor {
|
|
|
10393
10537
|
const dataSource = this.parent.treeGrid.getCurrentViewRecords();
|
|
10394
10538
|
const visualData = this.parent.virtualScrollModule && this.parent.enableVirtualization ?
|
|
10395
10539
|
getValue('virtualScrollModule.visualData', this.parent.treeGrid) : dataSource;
|
|
10396
|
-
|
|
10397
|
-
|
|
10540
|
+
let index;
|
|
10541
|
+
if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
10542
|
+
let gridData = this.parent.treeGrid.grid.contentModule['rows'];
|
|
10543
|
+
const data = gridData.filter((x) => {
|
|
10544
|
+
if (x['data'][this.parent.taskFields.id] === tempTemplateData.ganttProperties.taskId) {
|
|
10545
|
+
return x;
|
|
10546
|
+
}
|
|
10547
|
+
})[0];
|
|
10548
|
+
tRow.setAttribute('aria-rowindex', data['index'].toString());
|
|
10549
|
+
}
|
|
10550
|
+
else {
|
|
10551
|
+
index = visualData.indexOf(tempTemplateData);
|
|
10552
|
+
tRow.setAttribute('aria-rowindex', index.toString());
|
|
10553
|
+
}
|
|
10398
10554
|
}
|
|
10399
10555
|
/**
|
|
10400
10556
|
* To trigger query taskbar info event.
|
|
@@ -10465,7 +10621,7 @@ class ChartRows extends DateProcessor {
|
|
|
10465
10621
|
getComputedStyle(taskbarElement.querySelector(classCollections[0])).backgroundColor;
|
|
10466
10622
|
args.taskbarBorderColor = isNullOrUndefined(childTask) ? null : taskbarElement.classList.contains(traceChildTaskBar) ?
|
|
10467
10623
|
getComputedStyle(taskbarElement).backgroundColor :
|
|
10468
|
-
getComputedStyle(taskbarElement.querySelector(classCollections[0])).
|
|
10624
|
+
getComputedStyle(taskbarElement.querySelector(classCollections[0])).outlineColor;
|
|
10469
10625
|
args.progressBarBgColor = isNullOrUndefined(progressTask) ? null :
|
|
10470
10626
|
taskbarElement.classList.contains(traceChildProgressBar) ?
|
|
10471
10627
|
getComputedStyle(taskbarElement).backgroundColor :
|
|
@@ -10514,7 +10670,7 @@ class ChartRows extends DateProcessor {
|
|
|
10514
10670
|
*/
|
|
10515
10671
|
updateQueryTaskbarInfoArgs(args, rowElement, taskBarElement) {
|
|
10516
10672
|
const trElement = args.rowElement;
|
|
10517
|
-
const taskbarElement = args.taskbarElement;
|
|
10673
|
+
const taskbarElement = this.parent.enableVirtualization ? args.rowElement : args.taskbarElement;
|
|
10518
10674
|
const classCollections = this.getClassName(args);
|
|
10519
10675
|
let segmentRowElement;
|
|
10520
10676
|
if (args.data.ganttProperties.segments && args.data.ganttProperties.segments.length > 0) {
|
|
@@ -10535,18 +10691,6 @@ class ChartRows extends DateProcessor {
|
|
|
10535
10691
|
}
|
|
10536
10692
|
}
|
|
10537
10693
|
else if (taskbarElement) {
|
|
10538
|
-
if (taskbarElement && this.parent.enableVirtualization && !args.data.expanded) {
|
|
10539
|
-
const childElement = trElement.querySelector('.' + collapseParent);
|
|
10540
|
-
if (childElement) {
|
|
10541
|
-
for (let i = 0; i < childElement.childNodes.length; i++) {
|
|
10542
|
-
const taskbar = childElement.childNodes[i];
|
|
10543
|
-
const mainTaskbar = taskbar.querySelector('.' + traceChildTaskBar);
|
|
10544
|
-
if (mainTaskbar) {
|
|
10545
|
-
mainTaskbar.style.backgroundColor = args.taskbarBgColor;
|
|
10546
|
-
}
|
|
10547
|
-
}
|
|
10548
|
-
}
|
|
10549
|
-
}
|
|
10550
10694
|
if (taskbarElement.querySelector(classCollections[0]) &&
|
|
10551
10695
|
getComputedStyle(taskbarElement.querySelector(classCollections[0])).backgroundColor !== args.taskbarBgColor) {
|
|
10552
10696
|
taskbarElement.querySelector(classCollections[0]).style.backgroundColor = args.taskbarBgColor;
|
|
@@ -10769,7 +10913,9 @@ class ChartRows extends DateProcessor {
|
|
|
10769
10913
|
this.triggerQueryTaskbarInfoByIndex(tr, data);
|
|
10770
10914
|
}
|
|
10771
10915
|
const dataId = this.parent.viewType === 'ProjectView' ? data.ganttProperties.taskId : data.ganttProperties.rowUniqueID;
|
|
10772
|
-
this.parent.
|
|
10916
|
+
if (!this.parent.ganttChartModule.isExpandAll && !this.parent.ganttChartModule.isCollapseAll) {
|
|
10917
|
+
this.parent.treeGrid.grid.setRowData(dataId, data);
|
|
10918
|
+
}
|
|
10773
10919
|
if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && !data.expanded && this.parent.enableMultiTaskbar && !this.parent.allowTaskbarOverlap) {
|
|
10774
10920
|
this.updateDragDropRecords(selectedItem, tr);
|
|
10775
10921
|
}
|
|
@@ -10793,6 +10939,10 @@ class ChartRows extends DateProcessor {
|
|
|
10793
10939
|
addClass([cloneElement], 'collpse-parent-border');
|
|
10794
10940
|
const id = tRow.querySelector('.' + taskBarMainContainer).getAttribute('rowUniqueId');
|
|
10795
10941
|
const ganttData = this.parent.getRecordByID(id);
|
|
10942
|
+
const mainTaskbar = (cloneElement.querySelector('.e-gantt-child-taskbar'));
|
|
10943
|
+
if (this.parent.queryTaskbarInfo) {
|
|
10944
|
+
this.triggerQueryTaskbarInfoByIndex(mainTaskbar, ganttData);
|
|
10945
|
+
}
|
|
10796
10946
|
let zIndex = "";
|
|
10797
10947
|
if (ganttData && !isNullOrUndefined(ganttData.ganttProperties.eOverlapIndex)) {
|
|
10798
10948
|
zIndex = (ganttData.ganttProperties.eOverlapIndex).toString();
|
|
@@ -10963,6 +11113,7 @@ class Dependency {
|
|
|
10963
11113
|
this.parentRecord = [];
|
|
10964
11114
|
this.parentIds = [];
|
|
10965
11115
|
this.parentPredecessors = [];
|
|
11116
|
+
this.validatedParentIds = [];
|
|
10966
11117
|
this.parent = gantt;
|
|
10967
11118
|
this.dateValidateModule = this.parent.dateValidationModule;
|
|
10968
11119
|
}
|
|
@@ -11079,15 +11230,58 @@ class Dependency {
|
|
|
11079
11230
|
const predecessor = predecessorValue.toString();
|
|
11080
11231
|
const collection = [];
|
|
11081
11232
|
let match;
|
|
11082
|
-
let values;
|
|
11233
|
+
let values = [];
|
|
11083
11234
|
let offsetValue;
|
|
11084
11235
|
let predecessorText;
|
|
11085
11236
|
predecessor.split(',').forEach((el) => {
|
|
11086
|
-
|
|
11087
|
-
|
|
11088
|
-
|
|
11089
|
-
|
|
11090
|
-
|
|
11237
|
+
let isGUId = false;
|
|
11238
|
+
var regex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
|
|
11239
|
+
let elSplit = el.split('-');
|
|
11240
|
+
let id;
|
|
11241
|
+
if (elSplit.length === 6) {
|
|
11242
|
+
elSplit[4] = elSplit[4] + '-' + elSplit[5];
|
|
11243
|
+
elSplit.pop();
|
|
11244
|
+
}
|
|
11245
|
+
if (elSplit.length === 5 && elSplit[4].length > 12) {
|
|
11246
|
+
id = el.substring(0, 36);
|
|
11247
|
+
if (regex.test(id)) {
|
|
11248
|
+
isGUId = true;
|
|
11249
|
+
}
|
|
11250
|
+
}
|
|
11251
|
+
if (isGUId) {
|
|
11252
|
+
let split;
|
|
11253
|
+
split = elSplit[4].split('+');
|
|
11254
|
+
let spliceLength;
|
|
11255
|
+
|
|
11256
|
+
if (split.length === 1) {
|
|
11257
|
+
values[0] = el;
|
|
11258
|
+
}
|
|
11259
|
+
else {
|
|
11260
|
+
spliceLength = split[1].length;
|
|
11261
|
+
values[0] = el.slice(0, -(spliceLength + 1));
|
|
11262
|
+
values[1] = split[1];
|
|
11263
|
+
}
|
|
11264
|
+
offsetValue = '+';
|
|
11265
|
+
if (elSplit[4].indexOf('-') >= 0) {
|
|
11266
|
+
split = elSplit[4].split('-');
|
|
11267
|
+
if (split.length === 1) {
|
|
11268
|
+
values[0] = el;
|
|
11269
|
+
}
|
|
11270
|
+
else {
|
|
11271
|
+
spliceLength = split[1].length;
|
|
11272
|
+
values[0] = el.slice(0, -(spliceLength + 1));
|
|
11273
|
+
values[1] = split[1];
|
|
11274
|
+
}
|
|
11275
|
+
offsetValue = '-';
|
|
11276
|
+
}
|
|
11277
|
+
}
|
|
11278
|
+
else {
|
|
11279
|
+
values = el.split('+');
|
|
11280
|
+
offsetValue = '+';
|
|
11281
|
+
if (el.indexOf('-') >= 0) {
|
|
11282
|
+
values = el.split('-');
|
|
11283
|
+
offsetValue = '-';
|
|
11284
|
+
}
|
|
11091
11285
|
}
|
|
11092
11286
|
match = [];
|
|
11093
11287
|
const ids = this.parent.viewType === 'ResourceView' ? this.parent.getTaskIds() : this.parent.ids;
|
|
@@ -11576,14 +11770,32 @@ class Dependency {
|
|
|
11576
11770
|
* @private
|
|
11577
11771
|
*/
|
|
11578
11772
|
createConnectorLinesCollection(records) {
|
|
11579
|
-
|
|
11773
|
+
let ganttRecords = records ? records : this.parent.currentViewData;
|
|
11774
|
+
if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings &&
|
|
11775
|
+
this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth && this.parent.pdfExportModule.isPdfExport) {
|
|
11776
|
+
ganttRecords = this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneCurrentViewData'];
|
|
11777
|
+
}
|
|
11580
11778
|
const recordLength = ganttRecords.length;
|
|
11581
11779
|
let count;
|
|
11582
11780
|
let ganttRecord;
|
|
11583
11781
|
let predecessorsCollection;
|
|
11584
|
-
this.parent.
|
|
11585
|
-
this.parent.
|
|
11782
|
+
if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings &&
|
|
11783
|
+
this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth && this.parent.pdfExportModule.isPdfExport) {
|
|
11784
|
+
this.parent.connectorLineModule.expandedRecords = this.parent.virtualScrollModule && this.parent.enableVirtualization ?
|
|
11785
|
+
this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData'] : this.parent.getExpandedRecords(this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData']);
|
|
11786
|
+
}
|
|
11787
|
+
else {
|
|
11788
|
+
this.parent.connectorLineModule.expandedRecords = this.parent.virtualScrollModule && this.parent.enableVirtualization ?
|
|
11789
|
+
this.parent.updatedRecords : this.parent.getExpandedRecords(this.parent.updatedRecords);
|
|
11790
|
+
}
|
|
11586
11791
|
for (count = 0; count < recordLength; count++) {
|
|
11792
|
+
if (this.parent.editModule && this.parent.editModule.deletedTaskDetails.length > 0) {
|
|
11793
|
+
if (ganttRecords[count].parentItem) {
|
|
11794
|
+
const parentItem = this.parent.getRecordByID(ganttRecords[count].parentItem.taskId.toString());
|
|
11795
|
+
this.parent.setRecordValue('parentItem', this.parent.dataOperation.getCloneParent(parentItem), ganttRecords[count]);
|
|
11796
|
+
}
|
|
11797
|
+
ganttRecords[count].index = count;
|
|
11798
|
+
}
|
|
11587
11799
|
ganttRecord = ganttRecords[count];
|
|
11588
11800
|
predecessorsCollection = ganttRecord.ganttProperties.predecessor;
|
|
11589
11801
|
if (predecessorsCollection) {
|
|
@@ -11731,35 +11943,34 @@ class Dependency {
|
|
|
11731
11943
|
this.validatePredecessor(record, undefined, 'successor');
|
|
11732
11944
|
}
|
|
11733
11945
|
}
|
|
11734
|
-
if (record && record.
|
|
11735
|
-
|
|
11736
|
-
|
|
11737
|
-
|
|
11738
|
-
|
|
11739
|
-
|
|
11740
|
-
|
|
11741
|
-
|
|
11742
|
-
|
|
11743
|
-
|
|
11744
|
-
|
|
11745
|
-
|
|
11746
|
-
|
|
11747
|
-
|
|
11946
|
+
if (record && !record.hasChildRecords && record.parentItem && this.validatedParentIds.indexOf(record.parentItem.taskId) == -1) {
|
|
11947
|
+
this.validatedParentIds.push(record.parentItem.taskId);
|
|
11948
|
+
}
|
|
11949
|
+
|
|
11950
|
+
let validUpdate = true;
|
|
11951
|
+
if (record && record.hasChildRecords && this.validatedParentIds.indexOf(record.ganttProperties.taskId.toString()) !== -1) {
|
|
11952
|
+
validUpdate = false;
|
|
11953
|
+
}
|
|
11954
|
+
if (validUpdate) {
|
|
11955
|
+
if (record && record.ganttProperties.taskId !== this.isValidatedParentTaskID && ganttProp) {
|
|
11956
|
+
if ((taskBarModule.taskBarEditAction !== 'ParentDrag' && taskBarModule.taskBarEditAction !== 'ChildDrag')) {
|
|
11957
|
+
if (!ganttProp.hasChildRecords && record.hasChildRecords) {
|
|
11958
|
+
this.parent.editModule['updateChildItems'](record);
|
|
11959
|
+
this.isValidatedParentTaskID = record.ganttProperties.taskId;
|
|
11960
|
+
}
|
|
11961
|
+
}
|
|
11962
|
+
else if ((!record.hasChildRecords && taskBarModule.taskBarEditAction == 'ChildDrag') ||
|
|
11963
|
+
(record.hasChildRecords && taskBarModule.taskBarEditAction == 'ParentDrag')) {
|
|
11748
11964
|
this.parent.editModule['updateChildItems'](record);
|
|
11749
11965
|
this.isValidatedParentTaskID = record.ganttProperties.taskId;
|
|
11750
11966
|
}
|
|
11967
|
+
if (!ganttProp.hasChildRecords) {
|
|
11968
|
+
this.parent.dataOperation.updateParentItems(record, true);
|
|
11969
|
+
}
|
|
11751
11970
|
}
|
|
11752
|
-
else if (
|
|
11753
|
-
(validUpdate && taskBarModule.taskBarEditAction == 'ParentDrag')) {
|
|
11971
|
+
else if (record && record.hasChildRecords && !ganttProp) {
|
|
11754
11972
|
this.parent.editModule['updateChildItems'](record);
|
|
11755
|
-
this.isValidatedParentTaskID = record.ganttProperties.taskId;
|
|
11756
11973
|
}
|
|
11757
|
-
if (!ganttProp.hasChildRecords) {
|
|
11758
|
-
this.parent.dataOperation.updateParentItems(record, true);
|
|
11759
|
-
}
|
|
11760
|
-
}
|
|
11761
|
-
else if (record && record.hasChildRecords && !ganttProp) {
|
|
11762
|
-
this.parent.editModule['updateChildItems'](record);
|
|
11763
11974
|
}
|
|
11764
11975
|
}
|
|
11765
11976
|
}
|
|
@@ -11794,6 +12005,7 @@ class ConnectorLine {
|
|
|
11794
12005
|
this.transform = '';
|
|
11795
12006
|
this.connectorLinePath = '';
|
|
11796
12007
|
this.arrowPath = '';
|
|
12008
|
+
this.taskLineValue = 0;
|
|
11797
12009
|
this.expandedRecords = [];
|
|
11798
12010
|
this.parent = ganttObj;
|
|
11799
12011
|
this.dependencyViewContainer =
|
|
@@ -11841,7 +12053,7 @@ class ConnectorLine {
|
|
|
11841
12053
|
}
|
|
11842
12054
|
getTaskbarMidpoint(isMilestone) {
|
|
11843
12055
|
return Math.floor(isMilestone ?
|
|
11844
|
-
(this.parent.chartRowsModule.milestoneMarginTop + (this.parent.chartRowsModule.milestoneHeight / 2))
|
|
12056
|
+
(this.parent.chartRowsModule.milestoneMarginTop + (this.parent.chartRowsModule.milestoneHeight / 2)) :
|
|
11845
12057
|
(this.parent.chartRowsModule.taskBarMarginTop + (this.parent.chartRowsModule.taskBarHeight / 2))) + 1;
|
|
11846
12058
|
}
|
|
11847
12059
|
/**
|
|
@@ -11855,14 +12067,45 @@ class ConnectorLine {
|
|
|
11855
12067
|
*/
|
|
11856
12068
|
createConnectorLineObject(parentGanttData, childGanttData, predecessor) {
|
|
11857
12069
|
const connectorObj = {};
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
12070
|
+
let updatedRecords;
|
|
12071
|
+
if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps &&
|
|
12072
|
+
this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
12073
|
+
updatedRecords = this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport ?
|
|
12074
|
+
this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData'] : this.expandedRecords;
|
|
12075
|
+
}
|
|
12076
|
+
else {
|
|
12077
|
+
updatedRecords = this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport ?
|
|
12078
|
+
this.parent.flatData : this.expandedRecords;
|
|
12079
|
+
}
|
|
12080
|
+
let parentIndex;
|
|
12081
|
+
let childIndex;
|
|
12082
|
+
if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps &&
|
|
12083
|
+
this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
12084
|
+
let parentData = this.parent.flatData.filter((data) => {
|
|
12085
|
+
return data.ganttProperties.taskId.toString() == parentGanttData.ganttProperties.taskId.toString();
|
|
12086
|
+
})[0];
|
|
12087
|
+
let childData = this.parent.flatData.filter((data) => {
|
|
12088
|
+
return data.ganttProperties.taskId.toString() == childGanttData.ganttProperties.taskId.toString();
|
|
12089
|
+
})[0];
|
|
12090
|
+
parentIndex = parentData.index;
|
|
12091
|
+
childIndex = childData.index;
|
|
12092
|
+
}
|
|
12093
|
+
else {
|
|
12094
|
+
parentIndex = updatedRecords.indexOf(parentGanttData);
|
|
12095
|
+
childIndex = updatedRecords.indexOf(childGanttData);
|
|
12096
|
+
}
|
|
11862
12097
|
const parentGanttRecord = parentGanttData.ganttProperties;
|
|
11863
12098
|
const childGanttRecord = childGanttData.ganttProperties;
|
|
11864
|
-
|
|
11865
|
-
|
|
12099
|
+
let currentData;
|
|
12100
|
+
if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps &&
|
|
12101
|
+
this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
12102
|
+
currentData = this.parent.virtualScrollModule && this.parent.enableVirtualization ?
|
|
12103
|
+
this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData'] : this.parent.getExpandedRecords(this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData']);
|
|
12104
|
+
}
|
|
12105
|
+
else {
|
|
12106
|
+
currentData = this.parent.virtualScrollModule && this.parent.enableVirtualization ?
|
|
12107
|
+
this.parent.currentViewData : this.parent.getExpandedRecords(this.parent.currentViewData);
|
|
12108
|
+
}
|
|
11866
12109
|
connectorObj.parentIndexInCurrentView = currentData.indexOf(parentGanttData);
|
|
11867
12110
|
connectorObj.childIndexInCurrentView = currentData.indexOf(childGanttData);
|
|
11868
12111
|
const isVirtualScroll = this.parent.virtualScrollModule && this.parent.enableVirtualization;
|
|
@@ -12601,10 +12844,10 @@ class ConnectorLine {
|
|
|
12601
12844
|
* @private
|
|
12602
12845
|
*/
|
|
12603
12846
|
getConnectorLineTooltipInnerTd(fromTaskName, fromPredecessorText, toTaskName, toPredecessorText) {
|
|
12604
|
-
let innerTd = '<tr id="fromPredecessor"><td style="padding: 4px;">' + this.parent.localeObj.getConstant('from') + '</td><td> ';
|
|
12847
|
+
let innerTd = '<tr id="fromPredecessor"><td style="padding: 4px;width: 30px;">' + this.parent.localeObj.getConstant('from') + '</td><td> ';
|
|
12605
12848
|
innerTd = innerTd + fromTaskName + ' </td><td style="padding: 2px;"> ' + this.parent.localeObj.getConstant(fromPredecessorText) + ' </td> </tr>';
|
|
12606
12849
|
innerTd = innerTd + '<tr id="toPredecessor"><td style="padding: 4px;">' + this.parent.localeObj.getConstant('to') + '</td><td> ' + toTaskName;
|
|
12607
|
-
innerTd = innerTd + ' </td><td style="padding: 2px;"> ' + this.parent.localeObj.getConstant(toPredecessorText) + ' </td></tr></tbody><table>';
|
|
12850
|
+
innerTd = innerTd + ' </td><td style="padding: 2px;width: 30px;"> ' + this.parent.localeObj.getConstant(toPredecessorText) + ' </td></tr></tbody><table>';
|
|
12608
12851
|
return innerTd;
|
|
12609
12852
|
}
|
|
12610
12853
|
/**
|
|
@@ -12647,8 +12890,17 @@ class ConnectorLine {
|
|
|
12647
12890
|
if (isNullOrUndefined(id)) {
|
|
12648
12891
|
return null;
|
|
12649
12892
|
}
|
|
12650
|
-
|
|
12651
|
-
this.parent.
|
|
12893
|
+
if (this.parent.pdfExportModule && this.parent.pdfExportModule.isPdfExport && this.parent.pdfExportModule.helper.exportProps &&
|
|
12894
|
+
this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings && this.parent.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
12895
|
+
let a = this.parent.pdfExportModule.helper.beforeSinglePageExport['cloneFlatData'].filter((data) => {
|
|
12896
|
+
return data.ganttProperties.taskId.toString() === id.toString();
|
|
12897
|
+
})[0];
|
|
12898
|
+
return a;
|
|
12899
|
+
}
|
|
12900
|
+
else {
|
|
12901
|
+
return this.parent.viewType === 'ResourceView' ? this.parent.flatData[this.parent.getTaskIds().indexOf('T' + id.toString())] :
|
|
12902
|
+
this.parent.flatData[this.parent.ids.indexOf(id.toString())];
|
|
12903
|
+
}
|
|
12652
12904
|
}
|
|
12653
12905
|
/**
|
|
12654
12906
|
* Method to remove connector line from DOM
|
|
@@ -12766,6 +13018,7 @@ class Splitter$1 {
|
|
|
12766
13018
|
const leftPane = args.pane[0];
|
|
12767
13019
|
this.splitterPreviousPositionGrid = leftPane.scrollWidth + 1 + 'px';
|
|
12768
13020
|
this.splitterObject.paneSettings[0].size = this.getSpliterPositionInPercentage(this.splitterPreviousPositionGrid);
|
|
13021
|
+
this.splitterObject.paneSettings[1].size = (this.parent.ganttWidth - parseInt(this.splitterPreviousPositionGrid) - 4) + 'px';
|
|
12769
13022
|
const callBackPromise = new Deferred();
|
|
12770
13023
|
this.parent.trigger('splitterResized', args, (splitterResizedArgs) => {
|
|
12771
13024
|
if (splitterResizedArgs.cancel === true) {
|
|
@@ -12974,8 +13227,8 @@ class Tooltip$1 {
|
|
|
12974
13227
|
if (taskbarTemplateNode) {
|
|
12975
13228
|
append(taskbarTemplateNode, tooltipTemplate);
|
|
12976
13229
|
}
|
|
12977
|
-
argsData.content = this.toolTipObj.content = taskbarTemplateNode ? tooltipTemplate :
|
|
12978
|
-
parent.tooltipModule.getTooltipContent((data.ganttProperties.isMilestone ? 'milestone' : 'taskbar'), data, parent, args);
|
|
13230
|
+
argsData.content = this.toolTipObj.content = taskbarTemplateNode ? tooltipTemplate : data ?
|
|
13231
|
+
parent.tooltipModule.getTooltipContent((data.ganttProperties.isMilestone ? 'milestone' : 'taskbar'), data, parent, args) : "";
|
|
12979
13232
|
}
|
|
12980
13233
|
else if (args.target.classList.contains('e-baseline-bar') ||
|
|
12981
13234
|
args.target.classList.contains('e-baseline-gantt-milestone')) {
|
|
@@ -12987,8 +13240,8 @@ class Tooltip$1 {
|
|
|
12987
13240
|
if (baseLineTemplateNode) {
|
|
12988
13241
|
append(baseLineTemplateNode, baselineTemplate);
|
|
12989
13242
|
}
|
|
12990
|
-
argsData.content = this.toolTipObj.content = baseLineTemplateNode ? baselineTemplate :
|
|
12991
|
-
parent.tooltipModule.getTooltipContent((data.ganttProperties.isMilestone ? 'milestone' : 'baseline'), data, parent, args);
|
|
13243
|
+
argsData.content = this.toolTipObj.content = baseLineTemplateNode ? baselineTemplate : data ?
|
|
13244
|
+
parent.tooltipModule.getTooltipContent((data.ganttProperties.isMilestone ? 'milestone' : 'baseline'), data, parent, args) : "";
|
|
12992
13245
|
}
|
|
12993
13246
|
else if (args.target.classList.contains('e-event-markers')) {
|
|
12994
13247
|
argsData.content = this.toolTipObj.content = parent.tooltipModule.getTooltipContent('marker', data, parent, args);
|
|
@@ -13055,7 +13308,7 @@ class Tooltip$1 {
|
|
|
13055
13308
|
// eslint-disable-next-line
|
|
13056
13309
|
tooltipCloseHandler(args) {
|
|
13057
13310
|
this.tooltipMouseEvent = null;
|
|
13058
|
-
if (!this.parent.isAdaptive) {
|
|
13311
|
+
if (!this.parent.isAdaptive && !isNullOrUndefined(this.currentTarget)) {
|
|
13059
13312
|
EventHandler.remove(this.currentTarget, 'mousemove', this.mouseMoveHandler);
|
|
13060
13313
|
}
|
|
13061
13314
|
this.currentTarget = null;
|
|
@@ -14035,6 +14288,7 @@ let Gantt = class Gantt extends Component {
|
|
|
14035
14288
|
createSpinner({ target: this.element }, this.createElement);
|
|
14036
14289
|
this.trigger('load', {});
|
|
14037
14290
|
this.element.classList.add(root);
|
|
14291
|
+
this.rowHeight = (!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? (this.rowHeight === 36) ? 46 : this.rowHeight : this.rowHeight;
|
|
14038
14292
|
if (this.isAdaptive) {
|
|
14039
14293
|
this.element.classList.add(adaptive);
|
|
14040
14294
|
}
|
|
@@ -14484,8 +14738,6 @@ let Gantt = class Gantt extends Component {
|
|
|
14484
14738
|
removeClass(ganttChartElement.querySelectorAll('.e-critical-milestone'), criticalMilestone);
|
|
14485
14739
|
removeClass(this.element.querySelectorAll('.e-connector-line'), criticalConnectorLineSVG);
|
|
14486
14740
|
removeClass(this.element.querySelectorAll('.e-connector-line-arrow'), criticalConnectorArrowSVG);
|
|
14487
|
-
const innerDivs = document.querySelector('.e-gantt-child-taskbar-inner-div');
|
|
14488
|
-
innerDivs.style.outlineColor = "";
|
|
14489
14741
|
}
|
|
14490
14742
|
wireEvents() {
|
|
14491
14743
|
if (this.allowKeyboard) {
|
|
@@ -14531,10 +14783,12 @@ let Gantt = class Gantt extends Component {
|
|
|
14531
14783
|
const pane2 = this.splitterModule.splitterObject.element.querySelectorAll('.e-pane')[1];
|
|
14532
14784
|
this.splitterModule.splitterPreviousPositionGrid = pane1.scrollWidth + 1 + 'px';
|
|
14533
14785
|
this.splitterModule.splitterPreviousPositionChart = pane2.scrollWidth + 1 + 'px';
|
|
14534
|
-
this.splitterModule.splitterObject.paneSettings[
|
|
14535
|
-
|
|
14786
|
+
this.splitterModule.splitterObject.paneSettings[1].size = (this.ganttWidth - parseInt(this.splitterModule.splitterPreviousPositionGrid) - 4) + 'px';
|
|
14787
|
+
let proxy = this;
|
|
14536
14788
|
if (this.timelineModule.isZoomToFit) {
|
|
14537
|
-
|
|
14789
|
+
setTimeout(() => {
|
|
14790
|
+
proxy.timelineModule.processZoomToFit();
|
|
14791
|
+
}, 0);
|
|
14538
14792
|
}
|
|
14539
14793
|
}
|
|
14540
14794
|
}
|
|
@@ -14578,6 +14832,37 @@ let Gantt = class Gantt extends Component {
|
|
|
14578
14832
|
}
|
|
14579
14833
|
updateCurrentViewData() {
|
|
14580
14834
|
this.currentViewData = this.treeGrid.getCurrentViewRecords().slice();
|
|
14835
|
+
if (!this.loadChildOnDemand && this.taskFields.hasChildMapping && this.currentViewData.length > 0) {
|
|
14836
|
+
this.autoCalculateDateScheduling = false;
|
|
14837
|
+
this.flatData = [];
|
|
14838
|
+
this.dataOperation.taskIds = [];
|
|
14839
|
+
this.ids = [];
|
|
14840
|
+
this.dataOperation.recordIndex = 0;
|
|
14841
|
+
this.dataOperation.dataArray = this.currentViewData;
|
|
14842
|
+
this.dataOperation.cloneDataSource();
|
|
14843
|
+
if (this.predecessorModule && this.taskFields.dependency) {
|
|
14844
|
+
this.predecessorModule['parentIds'] = [];
|
|
14845
|
+
this.predecessorModule['parentRecord'] = [];
|
|
14846
|
+
this.predecessorModule.updatePredecessors();
|
|
14847
|
+
}
|
|
14848
|
+
let gridData = this.treeGrid.grid.contentModule['rows'];
|
|
14849
|
+
const data = gridData.filter((x) => {
|
|
14850
|
+
if (x['data'][this.taskFields.id] === this.flatData[0].ganttProperties.taskId) {
|
|
14851
|
+
return x;
|
|
14852
|
+
}
|
|
14853
|
+
})[0];
|
|
14854
|
+
let index = data['index'];
|
|
14855
|
+
for (let i = 0; i < this.flatData.length; i++) {
|
|
14856
|
+
this.flatData[i].index = index;
|
|
14857
|
+
index++;
|
|
14858
|
+
}
|
|
14859
|
+
this.currentViewData = this.flatData;
|
|
14860
|
+
this.treeGrid.grid.currentViewData = this.flatData;
|
|
14861
|
+
if (!isNullOrUndefined(this.treeGrid['virtualScrollModule'])) {
|
|
14862
|
+
this.treeGrid['virtualScrollModule'].visualData = this.flatData;
|
|
14863
|
+
this.updatedRecords = this.flatData;
|
|
14864
|
+
}
|
|
14865
|
+
}
|
|
14581
14866
|
}
|
|
14582
14867
|
/**
|
|
14583
14868
|
* @param {IGanttData} records -Defines the delete record collections.
|
|
@@ -14597,7 +14882,7 @@ let Gantt = class Gantt extends Component {
|
|
|
14597
14882
|
* @private
|
|
14598
14883
|
*/
|
|
14599
14884
|
updateContentHeight(args) {
|
|
14600
|
-
if (!this.allowTaskbarOverlap && this.viewType === 'ResourceView' && !this.isLoad) {
|
|
14885
|
+
if ((!this.allowTaskbarOverlap && !this.ganttChartModule.isCollapseAll && !this.ganttChartModule.isExpandAll) && this.viewType === 'ResourceView' && !this.isLoad) {
|
|
14601
14886
|
return;
|
|
14602
14887
|
}
|
|
14603
14888
|
else {
|
|
@@ -14961,6 +15246,9 @@ let Gantt = class Gantt extends Component {
|
|
|
14961
15246
|
else {
|
|
14962
15247
|
this.getCurrentRecords(args);
|
|
14963
15248
|
}
|
|
15249
|
+
if (!this.loadChildOnDemand && this.taskFields.hasChildMapping) {
|
|
15250
|
+
this.updateContentHeight();
|
|
15251
|
+
}
|
|
14964
15252
|
if (this.enableCriticalPath && this.criticalPathModule) {
|
|
14965
15253
|
this.criticalPathModule.showCriticalPath(this.enableCriticalPath);
|
|
14966
15254
|
}
|
|
@@ -14976,6 +15264,9 @@ let Gantt = class Gantt extends Component {
|
|
|
14976
15264
|
}
|
|
14977
15265
|
this.initialChartRowElements = this.ganttChartModule.getChartRows();
|
|
14978
15266
|
this.isLoad = false;
|
|
15267
|
+
if (!this.loadChildOnDemand && this.taskFields.hasChildMapping) {
|
|
15268
|
+
this.autoCalculateDateScheduling = true;
|
|
15269
|
+
}
|
|
14979
15270
|
this.trigger('dataBound', args);
|
|
14980
15271
|
}
|
|
14981
15272
|
/**
|
|
@@ -15239,7 +15530,14 @@ let Gantt = class Gantt extends Component {
|
|
|
15239
15530
|
if (prop === 'locale') {
|
|
15240
15531
|
this.isLocaleChanged = true;
|
|
15241
15532
|
}
|
|
15242
|
-
|
|
15533
|
+
if (prop === 'taskFields') {
|
|
15534
|
+
if (!isNullOrUndefined(newProp.taskFields.child)) {
|
|
15535
|
+
return;
|
|
15536
|
+
}
|
|
15537
|
+
}
|
|
15538
|
+
if (prop !== 'allowTaskbarDragAndDrop') {
|
|
15539
|
+
isRefresh = true;
|
|
15540
|
+
}
|
|
15243
15541
|
break;
|
|
15244
15542
|
case 'validateManualTasksOnLinking':
|
|
15245
15543
|
this.validateManualTasksOnLinking = newProp.validateManualTasksOnLinking;
|
|
@@ -15919,6 +16217,9 @@ let Gantt = class Gantt extends Component {
|
|
|
15919
16217
|
* @returns {Promise<any>} .
|
|
15920
16218
|
*/
|
|
15921
16219
|
pdfExport(pdfExportProperties, isMultipleExport, pdfDoc, isBlob) {
|
|
16220
|
+
if (pdfExportProperties && pdfExportProperties.fitToWidthSettings && pdfExportProperties.fitToWidthSettings.isFitToWidth) {
|
|
16221
|
+
pdfExportProperties.pageOrientation == 'Landscape';
|
|
16222
|
+
}
|
|
15922
16223
|
return this.pdfExportModule ? this.pdfExportModule.export(pdfExportProperties, isMultipleExport, pdfDoc, isBlob)
|
|
15923
16224
|
: null;
|
|
15924
16225
|
}
|
|
@@ -16007,14 +16308,17 @@ let Gantt = class Gantt extends Component {
|
|
|
16007
16308
|
this.isTimelineRoundOff = isTimelineRoundOff;
|
|
16008
16309
|
this.timelineModule.refreshTimelineByTimeSpan();
|
|
16009
16310
|
this.dataOperation.reUpdateGanttDataPosition();
|
|
16010
|
-
this.
|
|
16011
|
-
|
|
16012
|
-
|
|
16013
|
-
|
|
16014
|
-
this.ganttChartModule.
|
|
16015
|
-
|
|
16016
|
-
|
|
16017
|
-
|
|
16311
|
+
if (!this.pdfExportModule || (this.pdfExportModule && !this.pdfExportModule.isPdfExport) || (this.pdfExportModule && this.pdfExportModule.isPdfExport && this.pdfExportModule.helper.exportProps &&
|
|
16312
|
+
this.pdfExportModule.helper.exportProps.fitToWidthSettings && !this.pdfExportModule.helper.exportProps.fitToWidthSettings.isFitToWidth)) {
|
|
16313
|
+
this.timelineModule.updateChartByNewTimeline();
|
|
16314
|
+
this.ganttChartModule.chartBodyContent.style.width = formatUnit(this.timelineModule.totalTimelineWidth);
|
|
16315
|
+
this.ganttChartModule.updateLastRowBottomWidth();
|
|
16316
|
+
if (this.taskFields.dependency) {
|
|
16317
|
+
this.ganttChartModule.reRenderConnectorLines();
|
|
16318
|
+
}
|
|
16319
|
+
if (isFrom !== 'beforeAdd') {
|
|
16320
|
+
this.notify('selectRowByIndex', {});
|
|
16321
|
+
}
|
|
16018
16322
|
}
|
|
16019
16323
|
}
|
|
16020
16324
|
/**
|
|
@@ -16593,7 +16897,13 @@ let Gantt = class Gantt extends Component {
|
|
|
16593
16897
|
*/
|
|
16594
16898
|
getRowByID(id) {
|
|
16595
16899
|
const record = this.getRecordByID(id.toString());
|
|
16596
|
-
|
|
16900
|
+
let index;
|
|
16901
|
+
if (!this.loadChildOnDemand && this.taskFields.hasChildMapping) {
|
|
16902
|
+
index = this.updatedRecords.map(item => item[this.taskFields.id]).indexOf(record.ganttProperties.taskId);
|
|
16903
|
+
}
|
|
16904
|
+
else {
|
|
16905
|
+
index = this.updatedRecords.indexOf(record);
|
|
16906
|
+
}
|
|
16597
16907
|
if (index !== -1) {
|
|
16598
16908
|
return this.getRowByIndex(index);
|
|
16599
16909
|
}
|
|
@@ -17054,6 +17364,9 @@ __decorate([
|
|
|
17054
17364
|
__decorate([
|
|
17055
17365
|
Property(true)
|
|
17056
17366
|
], Gantt.prototype, "enableVirtualMaskRow", void 0);
|
|
17367
|
+
__decorate([
|
|
17368
|
+
Property(false)
|
|
17369
|
+
], Gantt.prototype, "loadChildOnDemand", void 0);
|
|
17057
17370
|
__decorate([
|
|
17058
17371
|
Property(true)
|
|
17059
17372
|
], Gantt.prototype, "UpdateOffsetOnTaskbarEdit", void 0);
|
|
@@ -17557,7 +17870,7 @@ class CellEdit {
|
|
|
17557
17870
|
args.cancel = true;
|
|
17558
17871
|
return;
|
|
17559
17872
|
}
|
|
17560
|
-
if (data.hasChildRecords && ((field === taskSettings.endDate && ((!isNullOrUndefined(data['isManual']) &&
|
|
17873
|
+
if (data.hasChildRecords && !this.parent.allowParentDependency && ((field === taskSettings.endDate && ((!isNullOrUndefined(data['isManual']) &&
|
|
17561
17874
|
data['isManual'] === false) || this.parent.taskMode === 'Auto')) || field === taskSettings.duration
|
|
17562
17875
|
|| field === taskSettings.dependency || field === taskSettings.progress || field === taskSettings.work || field === 'taskType')) {
|
|
17563
17876
|
if ((field === taskSettings.dependency && !this.parent.allowParentDependency) || field !== taskSettings.dependency) {
|
|
@@ -17856,6 +18169,9 @@ class CellEdit {
|
|
|
17856
18169
|
* @returns {void} .
|
|
17857
18170
|
*/
|
|
17858
18171
|
durationEdited(args) {
|
|
18172
|
+
if (parseInt(args.data[this.parent.taskFields.duration]) < 0) {
|
|
18173
|
+
args.data[this.parent.taskFields.duration] = 0;
|
|
18174
|
+
}
|
|
17859
18175
|
const ganttProb = args.data.ganttProperties;
|
|
17860
18176
|
const durationString = args.data[this.parent.taskFields.duration];
|
|
17861
18177
|
this.parent.dataOperation.updateDurationValue(durationString, ganttProb);
|
|
@@ -18123,6 +18439,7 @@ class EditTooltip {
|
|
|
18123
18439
|
* @returns {void} .
|
|
18124
18440
|
*/
|
|
18125
18441
|
updateTooltipPosition(args) {
|
|
18442
|
+
args.element.style.visibility = 'visible';
|
|
18126
18443
|
const parentWithZoomStyle = this.parent.element.closest('[style*="zoom"]');
|
|
18127
18444
|
if (isNullOrUndefined(parentWithZoomStyle)) {
|
|
18128
18445
|
const containerPosition = this.parent.getOffsetRect(this.parent.chartPane);
|
|
@@ -18132,8 +18449,8 @@ class EditTooltip {
|
|
|
18132
18449
|
tooltipPositionX += leftEnd - (tooltipPositionX + args.element.offsetWidth);
|
|
18133
18450
|
}
|
|
18134
18451
|
args.element.style.left = tooltipPositionX + 'px';
|
|
18452
|
+
args.element.style.visibility = 'visible';
|
|
18135
18453
|
}
|
|
18136
|
-
args.element.style.visibility = 'visible';
|
|
18137
18454
|
}
|
|
18138
18455
|
/**
|
|
18139
18456
|
* To show/hide taskbar edit tooltip.
|
|
@@ -18364,13 +18681,10 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18364
18681
|
mouseDownHandler(e) {
|
|
18365
18682
|
if (this.parent.editSettings.allowTaskbarEditing && !this.parent.readOnly) {
|
|
18366
18683
|
this.canDrag = false;
|
|
18367
|
-
if (this.
|
|
18684
|
+
if (this.taskBarEditElement) {
|
|
18368
18685
|
const targetElement = this.getElementByPosition(e);
|
|
18369
18686
|
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) {
|
|
18687
|
+
if ((element && element.innerHTML === this.taskBarEditElement.innerHTML || this.taskBarEditElement.classList.contains("e-segmented-taskbar") || this.taskBarEditElement.classList.contains("collpse-parent-border"))) {
|
|
18374
18688
|
this.updateTaskBarEditElement(e);
|
|
18375
18689
|
this.canDrag = true;
|
|
18376
18690
|
e.preventDefault();
|
|
@@ -18393,7 +18707,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18393
18707
|
}
|
|
18394
18708
|
return;
|
|
18395
18709
|
}
|
|
18396
|
-
if (this.tapPointOnFocus && element && element.innerHTML !== this.taskBarEditElement.innerHTML) {
|
|
18710
|
+
if (this.tapPointOnFocus && !isNullOrUndefined(this.taskBarEditElement) && element && element.innerHTML !== this.taskBarEditElement.innerHTML) {
|
|
18397
18711
|
this.connectorSecondRecord = this.parent.ganttChartModule.getRecordByTaskBar(element);
|
|
18398
18712
|
this.connectorSecondAction = 'ConnectorPointLeftDrag';
|
|
18399
18713
|
this.connectorSecondElement = element;
|
|
@@ -18404,8 +18718,16 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18404
18718
|
this.showHideActivePredecessors(false);
|
|
18405
18719
|
this.initPublicProp();
|
|
18406
18720
|
}
|
|
18407
|
-
else if (targetElement.classList.contains(connectorPointLeftHover)
|
|
18408
|
-
|
|
18721
|
+
else if (targetElement.classList.contains(connectorPointLeftHover)) {
|
|
18722
|
+
this.canDrag = false;
|
|
18723
|
+
this.multipleSelectionEnabled();
|
|
18724
|
+
this.showHideTaskBarEditingElements(targetElement, this.taskBarEditElement);
|
|
18725
|
+
this.tapPointOnFocus = true;
|
|
18726
|
+
this.taskBarEditAction = 'ConnectorPointLeftDrag';
|
|
18727
|
+
this.connectorSecondRecord = this.taskBarEditRecord;
|
|
18728
|
+
this.taskBarEditingAction(e, false);
|
|
18729
|
+
}
|
|
18730
|
+
else if (targetElement.classList.contains(connectorPointRightHover)) {
|
|
18409
18731
|
this.canDrag = false;
|
|
18410
18732
|
this.multipleSelectionEnabled();
|
|
18411
18733
|
this.showHideTaskBarEditingElements(targetElement, this.taskBarEditElement);
|
|
@@ -18505,7 +18827,12 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18505
18827
|
}
|
|
18506
18828
|
// eslint-disable-next-line
|
|
18507
18829
|
mouseLeaveHandler(e) {
|
|
18508
|
-
this.
|
|
18830
|
+
if (this.taskBarEditAction === "ChildDrag" || this.taskBarEditAction === "ParentDrag" || this.taskBarEditAction === "ProgressResizing" || this.taskBarEditAction === "LeftResizing" || this.taskBarEditAction === "RightResizing") {
|
|
18831
|
+
this.dragMouseLeave = false;
|
|
18832
|
+
}
|
|
18833
|
+
else {
|
|
18834
|
+
this.dragMouseLeave = true;
|
|
18835
|
+
}
|
|
18509
18836
|
}
|
|
18510
18837
|
/**
|
|
18511
18838
|
* To update taskbar edited elements on mouse down action.
|
|
@@ -18535,7 +18862,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18535
18862
|
}
|
|
18536
18863
|
}
|
|
18537
18864
|
if (this.parent.editSettings.allowTaskbarEditing && element) {
|
|
18538
|
-
this.showHideTaskBarEditingElements(element, this.
|
|
18865
|
+
this.showHideTaskBarEditingElements(element, this.editElement);
|
|
18539
18866
|
this.editElement = element;
|
|
18540
18867
|
this.realTaskbarElement = this.editElement;
|
|
18541
18868
|
const index = this.editElement.getAttribute('data-segment-index');
|
|
@@ -18616,7 +18943,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18616
18943
|
else {
|
|
18617
18944
|
if (this.parent.isAdaptive) {
|
|
18618
18945
|
if (this.taskBarEditElement) {
|
|
18619
|
-
this.showHideTaskBarEditingElements(element, this.
|
|
18946
|
+
this.showHideTaskBarEditingElements(element, this.editElement);
|
|
18620
18947
|
}
|
|
18621
18948
|
this.initPublicProp();
|
|
18622
18949
|
}
|
|
@@ -18676,8 +19003,12 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18676
19003
|
&& isShowConnectorPoints) {
|
|
18677
19004
|
const connectorElement = !isNullOrUndefined(element.querySelector('.' + connectorPointLeft)) ?
|
|
18678
19005
|
element : element.parentElement;
|
|
18679
|
-
|
|
18680
|
-
|
|
19006
|
+
if (!isNullOrUndefined(connectorElement.querySelector('.' + connectorPointLeft))) {
|
|
19007
|
+
addClass([connectorElement.querySelector('.' + connectorPointLeft)], [connectorPointLeftHover]);
|
|
19008
|
+
}
|
|
19009
|
+
if (!isNullOrUndefined(connectorElement.querySelector('.' + connectorPointRight))) {
|
|
19010
|
+
addClass([connectorElement.querySelector('.' + connectorPointRight)], [connectorPointRightHover]);
|
|
19011
|
+
}
|
|
18681
19012
|
}
|
|
18682
19013
|
}
|
|
18683
19014
|
else if (!fadeConnectorLine) {
|
|
@@ -18804,7 +19135,8 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18804
19135
|
const item = this.taskBarEditRecord.ganttProperties;
|
|
18805
19136
|
this.previousItem = this.parent.timelineModule.extendFunction(item, this.previousItemProperty);
|
|
18806
19137
|
if (this.taskBarEditAction !== 'ConnectorPointLeftDrag' &&
|
|
18807
|
-
this.taskBarEditAction !== 'ConnectorPointRightDrag'
|
|
19138
|
+
this.taskBarEditAction !== 'ConnectorPointRightDrag' &&
|
|
19139
|
+
!(this.parent.viewType == 'ResourceView' && this.taskBarEditAction == 'ParentDrag')) {
|
|
18808
19140
|
this.editTooltip.showHideTaskbarEditTooltip(true, this.segmentIndex);
|
|
18809
19141
|
}
|
|
18810
19142
|
this.taskBarEditElement.setAttribute('aria-grabbed', 'true');
|
|
@@ -18841,6 +19173,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18841
19173
|
this.dragMouseLeave = false;
|
|
18842
19174
|
this.isMouseDragCheck();
|
|
18843
19175
|
if (this.isMouseDragged && this.taskBarEditAction) {
|
|
19176
|
+
event.preventDefault();
|
|
18844
19177
|
if (!isNullOrUndefined(this.taskbarElement) && !isNullOrUndefined(this.editElement) && (this.taskBarEditAction !== "ConnectorPointRightDrag" && this.taskBarEditAction !== "ConnectorPointLeftDrag") && !(this.parent.viewType === 'ResourceView' && this.currentData.hasChildRecords)) {
|
|
18845
19178
|
var currentElement = this.editElement.parentElement;
|
|
18846
19179
|
currentElement.style.setProperty("position", "absolute");
|
|
@@ -18929,9 +19262,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18929
19262
|
this.taskBarEditAction === 'ConnectorPointRightDrag') {
|
|
18930
19263
|
this.updateConnectorLineSecondProperties(e);
|
|
18931
19264
|
this.triggerDependencyEvent(e);
|
|
18932
|
-
|
|
18933
|
-
this.drawFalseLine();
|
|
18934
|
-
}
|
|
19265
|
+
this.drawFalseLine();
|
|
18935
19266
|
}
|
|
18936
19267
|
if (this.parent.viewType == 'ResourceView' && this.parent.allowTaskbarDragAndDrop) {
|
|
18937
19268
|
if (this.dragMoveY > this.mouseMoveY) {
|
|
@@ -18943,7 +19274,12 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18943
19274
|
this.currentItemTop = this.currentItemTop + this.mouseMoveY;
|
|
18944
19275
|
}
|
|
18945
19276
|
const containerPosition = this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);
|
|
18946
|
-
this.
|
|
19277
|
+
if (this.parent.isAdaptive || e.touches) {
|
|
19278
|
+
this.dragMoveY = e.touches[0].pageY - containerPosition.top + this.parent.ganttChartModule.scrollObject.previousScroll.top;
|
|
19279
|
+
}
|
|
19280
|
+
else {
|
|
19281
|
+
this.dragMoveY = e.pageY - containerPosition.top + this.parent.ganttChartModule.scrollObject.previousScroll.top;
|
|
19282
|
+
}
|
|
18947
19283
|
this.topValue = this.currentItemTop;
|
|
18948
19284
|
this.currentItemPrevTop = (this.currentItemPrevTop === 0 ||
|
|
18949
19285
|
this.topValue == this.currentItemTop) ? this.topValue :
|
|
@@ -19329,6 +19665,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
19329
19665
|
if (this.segmentIndex === 0) {
|
|
19330
19666
|
this.parent.setRecordValue('width', item.width - differenceWidth, item, true);
|
|
19331
19667
|
this.parent.setRecordValue('left', item.left + differenceWidth, item, true);
|
|
19668
|
+
segment.width = segment.width - differenceWidth;
|
|
19332
19669
|
for (let i = 1; i < item.segments.length; i++) {
|
|
19333
19670
|
const segment = segments[i];
|
|
19334
19671
|
segment.left = segment.left - differenceWidth;
|
|
@@ -19756,7 +20093,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
19756
20093
|
const milliSecondsPerPixel = (24 * 60 * 60 * 1000) / this.parent.perDayWidth;
|
|
19757
20094
|
pStartDate.setTime(pStartDate.getTime() + (left * milliSecondsPerPixel));
|
|
19758
20095
|
/* To render the milestone in proper date while editing */
|
|
19759
|
-
if (isMilestone && !isNullOrUndefined(property.
|
|
20096
|
+
if (isMilestone && !isNullOrUndefined(property.predecessorsName) && property.predecessorsName !== '') {
|
|
19760
20097
|
pStartDate.setDate(pStartDate.getDate() - 1);
|
|
19761
20098
|
this.parent.dateValidationModule.setTime(this.parent.defaultEndTime, pStartDate);
|
|
19762
20099
|
pStartDate = this.parent.dateValidationModule.checkStartDate(pStartDate, property, true);
|
|
@@ -19809,6 +20146,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
19809
20146
|
const traceParentTaskBar$$1 = this.taskBarEditElement.querySelector('.' + traceParentTaskBar);
|
|
19810
20147
|
const traceParentProgressBar$$1 = this.taskBarEditElement.querySelector('.' + traceParentProgressBar);
|
|
19811
20148
|
const traceConnectorPointRight = this.taskBarEditElement.querySelector('.' + rightConnectorPointOuterDiv);
|
|
20149
|
+
const segmentConnectorPointRight = taskBarMainContainer$$1.querySelector('.' + rightConnectorPointOuterDiv);
|
|
19812
20150
|
const manualParentTaskbar = this.taskBarEditElement;
|
|
19813
20151
|
const manualTaskbar = this.taskBarEditElement.querySelector('.' + manualParentTaskBar);
|
|
19814
20152
|
const manualParentRight = this.taskBarEditElement.querySelector('.' + manualParentRightResizer);
|
|
@@ -19835,6 +20173,9 @@ class TaskbarEdit extends DateProcessor {
|
|
|
19835
20173
|
}
|
|
19836
20174
|
taskBarMainContainer$$1.style.setProperty(position, (item.left) + 'px');
|
|
19837
20175
|
taskBarMainContainer$$1.style.width = (width) + 'px';
|
|
20176
|
+
if (segmentedTaskBarContainer && segmentConnectorPointRight) {
|
|
20177
|
+
segmentConnectorPointRight.style.left = (this.parent.isAdaptive ? (width + 10) : (width + 2)) + 'px';
|
|
20178
|
+
}
|
|
19838
20179
|
if (this.parent.viewType === 'ResourceView' && this.parent.allowTaskbarDragAndDrop && this.parent.rowDragAndDropModule &&
|
|
19839
20180
|
(this.taskBarEditAction === 'ChildDrag' || this.taskBarEditAction === 'MilestoneDrag')) {
|
|
19840
20181
|
taskBarMainContainer$$1.style.setProperty('top', (this.topValue) + 'px');
|
|
@@ -19951,9 +20292,9 @@ class TaskbarEdit extends DateProcessor {
|
|
|
19951
20292
|
}
|
|
19952
20293
|
if (segmentedTaskBarContainer) {
|
|
19953
20294
|
taskBarRightResizer$$1.style.setProperty(position, rightResizer + 'px');
|
|
19954
|
-
traceChildProgressBar$$1.style.width = (segment.
|
|
20295
|
+
traceChildProgressBar$$1.style.width = (segment.width) + 'px';
|
|
19955
20296
|
if (!isNullOrUndefined(childProgressResizer$$1)) {
|
|
19956
|
-
childProgressResizer$$1.style.setProperty(position, segment.
|
|
20297
|
+
childProgressResizer$$1.style.setProperty(position, segment.width - 10 + 'px');
|
|
19957
20298
|
}
|
|
19958
20299
|
}
|
|
19959
20300
|
}
|
|
@@ -20023,9 +20364,6 @@ class TaskbarEdit extends DateProcessor {
|
|
|
20023
20364
|
this.taskBarEditAction === 'ConnectorPointRightDrag') && this.drawPredecessor && (!this.connectorSecondRecord.hasChildRecords ||
|
|
20024
20365
|
this.connectorSecondRecord.hasChildRecords && this.parent.allowParentDependency)) {
|
|
20025
20366
|
this.parent.connectorLineEditModule.updatePredecessor(this.connectorSecondRecord, this.finalPredecessor);
|
|
20026
|
-
if (this.parent.UpdateOffsetOnTaskbarEdit) {
|
|
20027
|
-
this.parent.connectorLineEditModule['calculateOffset'](this.connectorSecondRecord);
|
|
20028
|
-
}
|
|
20029
20367
|
}
|
|
20030
20368
|
else {
|
|
20031
20369
|
if (x1 !== x2 || (Math.abs(y1 - resMouseY) >= (this.parent.rowHeight - this.parent.taskbarHeight) / 2)) {
|
|
@@ -20315,6 +20653,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
20315
20653
|
updateConnectorLineSecondProperties(e) {
|
|
20316
20654
|
const target = this.getElementByPosition(e);
|
|
20317
20655
|
const element = parentsUntil$1(target, taskBarMainContainer);
|
|
20656
|
+
const isBigger = document.body.className.includes("e-bigger");
|
|
20318
20657
|
this.connectorSecondAction = null;
|
|
20319
20658
|
let scrollTop = 0;
|
|
20320
20659
|
if (parentsUntil$1(target, connectorPointLeft)) {
|
|
@@ -20337,20 +20676,20 @@ class TaskbarEdit extends DateProcessor {
|
|
|
20337
20676
|
if ((this.parent.virtualScrollModule && this.parent.enableVirtualization &&
|
|
20338
20677
|
!this.elementOffsetLeft) || !this.parent.enableVirtualization) {
|
|
20339
20678
|
if (!this.parent.allowParentDependency) {
|
|
20340
|
-
this.elementOffsetLeft = this.realTaskbarElement.offsetLeft;
|
|
20679
|
+
this.elementOffsetLeft = this.realTaskbarElement.offsetLeft - ((isBigger) ? 10 : 0);
|
|
20341
20680
|
this.elementOffsetTop = this.realTaskbarElement.parentElement.offsetTop + this.realTaskbarElement.offsetHeight / 3 + scrollTop;
|
|
20342
20681
|
}
|
|
20343
20682
|
else {
|
|
20344
20683
|
if (this.taskBarEditElement.children[0].classList.contains('e-manualparent-main-container')) {
|
|
20345
|
-
this.elementOffsetLeft = this.realTaskbarElement.children[0]['offsetLeft'] + this.realTaskbarElement.offsetLeft;
|
|
20684
|
+
this.elementOffsetLeft = this.realTaskbarElement.children[0]['offsetLeft'] + this.realTaskbarElement.offsetLeft - ((isBigger) ? 10 : 0);
|
|
20346
20685
|
this.elementOffsetTop = ((this.realTaskbarElement.parentElement.offsetTop + this.realTaskbarElement.offsetHeight / 3 - 5) + this.taskBarEditElement.children[0]['offsetTop']) + scrollTop;
|
|
20347
20686
|
}
|
|
20348
20687
|
else {
|
|
20349
|
-
this.elementOffsetLeft = this.realTaskbarElement.offsetLeft;
|
|
20688
|
+
this.elementOffsetLeft = this.realTaskbarElement.offsetLeft - ((isBigger) ? 10 : 0);
|
|
20350
20689
|
this.elementOffsetTop = this.realTaskbarElement.parentElement.offsetTop + this.realTaskbarElement.offsetHeight / 3 + scrollTop;
|
|
20351
20690
|
}
|
|
20352
20691
|
}
|
|
20353
|
-
this.elementOffsetWidth = this.realTaskbarElement.offsetWidth;
|
|
20692
|
+
this.elementOffsetWidth = this.realTaskbarElement.offsetWidth + ((isBigger) ? 20 : 0);
|
|
20354
20693
|
this.elementOffsetHeight = this.realTaskbarElement.offsetHeight;
|
|
20355
20694
|
}
|
|
20356
20695
|
this.showHideTaskBarEditingElements(element, this.highlightedSecondElement, true);
|
|
@@ -20458,18 +20797,16 @@ class TaskbarEdit extends DateProcessor {
|
|
|
20458
20797
|
// Get XY coordinates for touch and non-touch device
|
|
20459
20798
|
getCoordinate(event) {
|
|
20460
20799
|
const coordinates = {};
|
|
20461
|
-
|
|
20800
|
+
const e = event;
|
|
20801
|
+
coordinates.pageX = e.pageX;
|
|
20802
|
+
coordinates.pageY = e.pageY;
|
|
20803
|
+
if (event && event.type !== 'click') {
|
|
20462
20804
|
const e = event;
|
|
20463
20805
|
if (e.type === 'touchmove' || e.type === 'touchstart' || e.type === 'touchend') {
|
|
20464
20806
|
coordinates.pageX = e.changedTouches[0].pageX;
|
|
20465
20807
|
coordinates.pageY = e.changedTouches[0].pageY;
|
|
20466
20808
|
}
|
|
20467
20809
|
}
|
|
20468
|
-
else if (event) {
|
|
20469
|
-
const e = event;
|
|
20470
|
-
coordinates.pageX = e.pageX;
|
|
20471
|
-
coordinates.pageY = e.pageY;
|
|
20472
|
-
}
|
|
20473
20810
|
return coordinates;
|
|
20474
20811
|
}
|
|
20475
20812
|
// Get current target element by mouse position
|
|
@@ -21417,7 +21754,7 @@ class DialogEdit {
|
|
|
21417
21754
|
if (!isNullOrUndefined(tasks.endDate) && tasks.endDate !== colName) {
|
|
21418
21755
|
this.updateScheduleFields(dialog, ganttProp, 'endDate');
|
|
21419
21756
|
}
|
|
21420
|
-
if (!isNullOrUndefined(tasks.duration) && tasks.duration !== colName) {
|
|
21757
|
+
if (!isNullOrUndefined(tasks.duration) && tasks.duration !== colName || ganttProp.duration >= 0) {
|
|
21421
21758
|
this.updateScheduleFields(dialog, ganttProp, 'duration');
|
|
21422
21759
|
}
|
|
21423
21760
|
if (!isNullOrUndefined(tasks.work) && tasks.work !== colName) {
|
|
@@ -21575,17 +21912,33 @@ class DialogEdit {
|
|
|
21575
21912
|
const ganttProp = currentData.ganttProperties;
|
|
21576
21913
|
const taskSettings = ganttObj.taskFields;
|
|
21577
21914
|
if (taskSettings.duration === columnName) {
|
|
21578
|
-
if (!isNullOrUndefined(value) && value !== '') {
|
|
21915
|
+
if (!isNullOrUndefined(value) && value !== '' && parseInt(value) >= 0) {
|
|
21579
21916
|
ganttObj.dataOperation.updateDurationValue(value, ganttProp);
|
|
21580
21917
|
this.parent.setRecordValue(taskSettings.duration, value, currentData);
|
|
21581
21918
|
this.parent.setRecordValue('taskData.' + taskSettings.duration, ganttProp.duration, currentData);
|
|
21919
|
+
this.validateDuration(currentData);
|
|
21582
21920
|
}
|
|
21583
21921
|
else {
|
|
21584
21922
|
if (ganttObj.allowUnscheduledTasks) {
|
|
21585
|
-
|
|
21923
|
+
if ((ganttProp.startDate && ganttProp.endDate && ganttProp.startDate.getTime() > ganttProp.endDate.getTime()) || value.indexOf('-') !== -1) {
|
|
21924
|
+
this.parent.setRecordValue('duration', 0, ganttProp, true);
|
|
21925
|
+
if (ganttProp.endDate) {
|
|
21926
|
+
this.parent.setRecordValue('startDate', ganttProp.endDate, ganttProp, true);
|
|
21927
|
+
}
|
|
21928
|
+
}
|
|
21929
|
+
else {
|
|
21930
|
+
if (value === "") {
|
|
21931
|
+
this.parent.setRecordValue('duration', null, ganttProp, true);
|
|
21932
|
+
if (ganttProp.endDate) {
|
|
21933
|
+
this.parent.setRecordValue('endDate', null, ganttProp, true);
|
|
21934
|
+
}
|
|
21935
|
+
}
|
|
21936
|
+
else {
|
|
21937
|
+
this.parent.setRecordValue('duration', ganttProp.duration, ganttProp, true);
|
|
21938
|
+
}
|
|
21939
|
+
}
|
|
21586
21940
|
}
|
|
21587
21941
|
}
|
|
21588
|
-
this.validateDuration(currentData);
|
|
21589
21942
|
this.parent.editModule.updateResourceRelatedFields(currentData, 'duration');
|
|
21590
21943
|
}
|
|
21591
21944
|
if (taskSettings.startDate === columnName) {
|
|
@@ -21593,13 +21946,15 @@ class DialogEdit {
|
|
|
21593
21946
|
let startDate = this.parent.dateValidationModule.getDateFromFormat(value);
|
|
21594
21947
|
startDate = this.parent.dateValidationModule.checkStartDate(startDate, ganttProp);
|
|
21595
21948
|
this.parent.setRecordValue('startDate', startDate, ganttProp, true);
|
|
21949
|
+
this.validateStartDate(currentData);
|
|
21596
21950
|
}
|
|
21597
21951
|
else {
|
|
21598
21952
|
if (ganttObj.allowUnscheduledTasks && !(currentData.hasChildRecords)) {
|
|
21599
21953
|
this.parent.setRecordValue('startDate', null, ganttProp, true);
|
|
21954
|
+
this.parent.setRecordValue('duration', null, ganttProp, true);
|
|
21955
|
+
this.parent.setRecordValue('isMilestone', false, ganttProp, true);
|
|
21600
21956
|
}
|
|
21601
21957
|
}
|
|
21602
|
-
this.validateStartDate(currentData);
|
|
21603
21958
|
}
|
|
21604
21959
|
if (taskSettings.endDate === columnName) {
|
|
21605
21960
|
if (value !== '') {
|
|
@@ -21614,13 +21969,15 @@ class DialogEdit {
|
|
|
21614
21969
|
if (isNullOrUndefined(ganttProp.startDate) || endDate.getTime() > (ganttProp.startDate).getTime()) {
|
|
21615
21970
|
this.parent.setRecordValue('endDate', endDate, ganttProp, true);
|
|
21616
21971
|
}
|
|
21972
|
+
this.validateEndDate(currentData);
|
|
21617
21973
|
}
|
|
21618
21974
|
else {
|
|
21619
21975
|
if (ganttObj.allowUnscheduledTasks) {
|
|
21620
21976
|
this.parent.setRecordValue('endDate', null, ganttProp, true);
|
|
21977
|
+
this.parent.setRecordValue('duration', null, ganttProp, true);
|
|
21978
|
+
this.parent.setRecordValue('isMilestone', false, ganttProp, true);
|
|
21621
21979
|
}
|
|
21622
21980
|
}
|
|
21623
|
-
this.validateEndDate(currentData);
|
|
21624
21981
|
}
|
|
21625
21982
|
if (taskSettings.work === columnName) {
|
|
21626
21983
|
if (!isNullOrUndefined(value) && value !== '') {
|
|
@@ -22022,7 +22379,7 @@ class DialogEdit {
|
|
|
22022
22379
|
let eDate = getValue('endDate', selectedItem);
|
|
22023
22380
|
let duration = getValue('duration', selectedItem);
|
|
22024
22381
|
const startDate = !isNullOrUndefined(gridData) && gridData.length > 0 ?
|
|
22025
|
-
!isNullOrUndefined(taskFields.endDate) ? new Date(getValue('endDate', gridData[0]).getTime()) :
|
|
22382
|
+
(!isNullOrUndefined(taskFields.endDate) && !isNullOrUndefined(gridData[0].endDate)) ? new Date(getValue('endDate', gridData[0]).getTime()) :
|
|
22026
22383
|
new Date(getValue('startDate', gridData[0]).getTime()) :
|
|
22027
22384
|
!isNullOrUndefined(this.beforeOpenArgs.rowData.ganttProperties.startDate) &&
|
|
22028
22385
|
new Date(this.beforeOpenArgs.rowData.ganttProperties.startDate.getTime());
|
|
@@ -22692,7 +23049,7 @@ class DialogEdit {
|
|
|
22692
23049
|
tasksData[fieldName] = column.edit.read(inputElement, controlObj.value);
|
|
22693
23050
|
}
|
|
22694
23051
|
}
|
|
22695
|
-
else if (
|
|
23052
|
+
else if (column.editType === 'booleanedit') {
|
|
22696
23053
|
if (inputElement instanceof HTMLInputElement && inputElement.checked === true) {
|
|
22697
23054
|
tasksData[fieldName] = true;
|
|
22698
23055
|
}
|
|
@@ -23026,14 +23383,55 @@ class ConnectorLineEdit {
|
|
|
23026
23383
|
idFromPredecessor(pre) {
|
|
23027
23384
|
const preArray = pre.split(',');
|
|
23028
23385
|
const preIdArray = [];
|
|
23029
|
-
let values;
|
|
23386
|
+
let values = [];
|
|
23030
23387
|
let match = [];
|
|
23031
23388
|
for (let j = 0; j < preArray.length; j++) {
|
|
23032
23389
|
const strArray = [];
|
|
23033
|
-
|
|
23034
|
-
|
|
23035
|
-
|
|
23036
|
-
|
|
23390
|
+
let isGUId = false;
|
|
23391
|
+
var regex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/;
|
|
23392
|
+
let elSplit = preArray[j].split('-');
|
|
23393
|
+
let id;
|
|
23394
|
+
if (elSplit.length === 6) {
|
|
23395
|
+
elSplit[4] = elSplit[4] + '-' + elSplit[5];
|
|
23396
|
+
elSplit.pop();
|
|
23397
|
+
}
|
|
23398
|
+
if (elSplit.length === 5 && elSplit[4].length > 12) {
|
|
23399
|
+
id = preArray[j].substring(0, 36);
|
|
23400
|
+
if (regex.test(id)) {
|
|
23401
|
+
isGUId = true;
|
|
23402
|
+
}
|
|
23403
|
+
}
|
|
23404
|
+
if (isGUId) {
|
|
23405
|
+
let split;
|
|
23406
|
+
split = elSplit[4].split('+');
|
|
23407
|
+
let spliceLength;
|
|
23408
|
+
if (split.length === 1) {
|
|
23409
|
+
values[0] = preArray[j];
|
|
23410
|
+
}
|
|
23411
|
+
else {
|
|
23412
|
+
spliceLength = split[1].length;
|
|
23413
|
+
values[0] = preArray[j].slice(0, -(spliceLength + 1));
|
|
23414
|
+
values[1] = split[1];
|
|
23415
|
+
}
|
|
23416
|
+
if (elSplit[4].indexOf('-') >= 0) {
|
|
23417
|
+
split = elSplit[4].split('-');
|
|
23418
|
+
if (split.length === 1) {
|
|
23419
|
+
values[0] = preArray[j];
|
|
23420
|
+
}
|
|
23421
|
+
else {
|
|
23422
|
+
spliceLength = split[1].length;
|
|
23423
|
+
values[0] = preArray[j].slice(0, -(spliceLength + 1));
|
|
23424
|
+
values[1] = split[1];
|
|
23425
|
+
}
|
|
23426
|
+
|
|
23427
|
+
}
|
|
23428
|
+
}
|
|
23429
|
+
else {
|
|
23430
|
+
values = preArray[j].split('+');
|
|
23431
|
+
if (preArray[j].indexOf('-') >= 0) {
|
|
23432
|
+
values = preArray[j].split('-');
|
|
23433
|
+
|
|
23434
|
+
}
|
|
23037
23435
|
}
|
|
23038
23436
|
if (!isNullOrUndefined(values[0])) {
|
|
23039
23437
|
const ids = this.parent.viewType === 'ResourceView' ? this.parent.getTaskIds() : this.parent.ids;
|
|
@@ -24682,10 +25080,11 @@ class Edit$2 {
|
|
|
24682
25080
|
this.parent.predecessorModule.isValidatedParentTaskID = '';
|
|
24683
25081
|
}
|
|
24684
25082
|
if (this.parent.allowParentDependency && ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
|
|
24685
|
-
(args.action === "DrawConnectorLine")
|
|
25083
|
+
(args.action === "DrawConnectorLine")) {
|
|
24686
25084
|
this.updateChildItems(ganttRecord);
|
|
24687
25085
|
}
|
|
24688
25086
|
this.updateParentItemOnEditing();
|
|
25087
|
+
this.parent.dataOperation.updateParentItems(ganttRecord, true);
|
|
24689
25088
|
}
|
|
24690
25089
|
/** Update parent up-to zeroth level */
|
|
24691
25090
|
if (ganttRecord.parentItem) {
|
|
@@ -24698,6 +25097,10 @@ class Edit$2 {
|
|
|
24698
25097
|
this.updateParentItemOnEditing();
|
|
24699
25098
|
}
|
|
24700
25099
|
}
|
|
25100
|
+
if (this.parent.UpdateOffsetOnTaskbarEdit && this.parent.connectorLineEditModule && args.data) {
|
|
25101
|
+
this.parent.connectorLineEditModule['calculateOffset'](args.data);
|
|
25102
|
+
}
|
|
25103
|
+
this.parent.predecessorModule['validatedParentIds'] = [];
|
|
24701
25104
|
this.initiateSaveAction(args);
|
|
24702
25105
|
}
|
|
24703
25106
|
updateParentItemOnEditing() {
|
|
@@ -24717,7 +25120,7 @@ class Edit$2 {
|
|
|
24717
25120
|
*/
|
|
24718
25121
|
updateParentChildRecord(data) {
|
|
24719
25122
|
const ganttRecord = data;
|
|
24720
|
-
if (ganttRecord.hasChildRecords && this.taskbarMoved && this.parent.taskMode === 'Auto' && (!isNullOrUndefined(this.parent.editModule.cellEditModule) && !this.parent.editModule.cellEditModule.isResourceCellEdited)) {
|
|
25123
|
+
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
25124
|
this.updateChildItems(ganttRecord);
|
|
24722
25125
|
}
|
|
24723
25126
|
if (!isNullOrUndefined(this.parent.editModule.cellEditModule)) {
|
|
@@ -25192,6 +25595,11 @@ class Edit$2 {
|
|
|
25192
25595
|
this.updateScheduleDatesOnEditing(args);
|
|
25193
25596
|
}
|
|
25194
25597
|
}
|
|
25598
|
+
if (this.parent.enableCriticalPath) {
|
|
25599
|
+
let criticalModule = this.parent.criticalPathModule;
|
|
25600
|
+
criticalModule.showCriticalPath(true);
|
|
25601
|
+
criticalModule.criticalConnectorLine(criticalModule.criticalPathCollection, criticalModule.detailPredecessorCollection, true, criticalModule.predecessorCollectionTaskIds);
|
|
25602
|
+
}
|
|
25195
25603
|
if (!this.parent.editSettings.allowTaskbarEditing || (this.parent.editSettings.allowTaskbarEditing &&
|
|
25196
25604
|
!this.taskbarEditModule.dependencyCancel)) {
|
|
25197
25605
|
eventArgs.requestType = 'save';
|
|
@@ -25205,11 +25613,6 @@ class Edit$2 {
|
|
|
25205
25613
|
eventArgs.taskBarEditAction = args.taskBarEditAction;
|
|
25206
25614
|
}
|
|
25207
25615
|
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
25616
|
this.parent.trigger('actionComplete', eventArgs);
|
|
25214
25617
|
if (!isNullOrUndefined(this.parent.loadingIndicator) && this.parent.loadingIndicator.indicatorType === "Shimmer") {
|
|
25215
25618
|
this.parent.hideMaskRow();
|
|
@@ -25395,7 +25798,9 @@ class Edit$2 {
|
|
|
25395
25798
|
if (!this.parent.taskFields.parentID) {
|
|
25396
25799
|
const deleteRecordIDs = [];
|
|
25397
25800
|
deleteRecordIDs.push(deletedRow.ganttProperties.rowUniqueID.toString());
|
|
25398
|
-
this.parent.
|
|
25801
|
+
if (this.parent.viewType === 'ProjectView') {
|
|
25802
|
+
this.parent.editModule.removeFromDataSource(deleteRecordIDs);
|
|
25803
|
+
}
|
|
25399
25804
|
}
|
|
25400
25805
|
const flatRecordIndex = this.parent.flatData.indexOf(deletedRow);
|
|
25401
25806
|
if (gObj.taskFields.parentID) {
|
|
@@ -26763,6 +27168,9 @@ class Edit$2 {
|
|
|
26763
27168
|
this.parent.flatData[this.parent.getTaskIds().indexOf('T' + args.data[tasks.id])] : this.parent.getRecordByID(args.data[tasks.id]);
|
|
26764
27169
|
if (!isNullOrUndefined(ganttData)) {
|
|
26765
27170
|
this.validateUpdateValues(args.newTaskData, ganttData, true);
|
|
27171
|
+
this.parent.dateValidationModule.calculateEndDate(ganttData);
|
|
27172
|
+
this.parent.dataOperation.updateWidthLeft(ganttData);
|
|
27173
|
+
this.parent.dataOperation.updateParentItems(ganttData);
|
|
26766
27174
|
}
|
|
26767
27175
|
if (!isNullOrUndefined(args.data[`${tempTaskID}`])) {
|
|
26768
27176
|
if (args.data[tempTaskID] != args.data['ganttProperties']['taskId']) {
|
|
@@ -28512,7 +28920,20 @@ class Selection$1 {
|
|
|
28512
28920
|
* @returns {Object[]} .
|
|
28513
28921
|
*/
|
|
28514
28922
|
getSelectedRecords() {
|
|
28515
|
-
|
|
28923
|
+
if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
28924
|
+
let selectedRows = [];
|
|
28925
|
+
let selectedIndexes = this.parent.selectionModule.getSelectedRowIndexes();
|
|
28926
|
+
for (let i = 0; i < selectedIndexes.length; i++) {
|
|
28927
|
+
const rec = this.parent.currentViewData.filter((data) => {
|
|
28928
|
+
return data.index == selectedIndexes[i];
|
|
28929
|
+
})[0];
|
|
28930
|
+
selectedRows.push(rec);
|
|
28931
|
+
}
|
|
28932
|
+
return selectedRows;
|
|
28933
|
+
}
|
|
28934
|
+
else {
|
|
28935
|
+
return this.parent.treeGrid.getSelectedRecords();
|
|
28936
|
+
}
|
|
28516
28937
|
}
|
|
28517
28938
|
/**
|
|
28518
28939
|
* Get the selected records for cell selection.
|
|
@@ -29166,7 +29587,15 @@ class Toolbar$3 {
|
|
|
29166
29587
|
let disableItems = [];
|
|
29167
29588
|
const edit = gObj.editSettings;
|
|
29168
29589
|
const gID = this.id;
|
|
29169
|
-
|
|
29590
|
+
let ind = gObj.selectedRowIndex;
|
|
29591
|
+
if (!this.parent.loadChildOnDemand && this.parent.taskFields.hasChildMapping) {
|
|
29592
|
+
for (let i = 0; i < gObj.updatedRecords.length; i++) {
|
|
29593
|
+
if (gObj.updatedRecords[i].index === ind) {
|
|
29594
|
+
ind = i;
|
|
29595
|
+
break;
|
|
29596
|
+
}
|
|
29597
|
+
}
|
|
29598
|
+
}
|
|
29170
29599
|
let previousGanttRecord;
|
|
29171
29600
|
const isSelected = gObj.selectionModule ? gObj.selectionModule.selectedRowIndexes.length === 1 ||
|
|
29172
29601
|
gObj.selectionModule.getSelectedRowCellIndexes().length === 1 ? true : false : false;
|
|
@@ -29696,6 +30125,7 @@ class DayMarkers {
|
|
|
29696
30125
|
/** @hidden */
|
|
29697
30126
|
class CriticalPath {
|
|
29698
30127
|
constructor(parent) {
|
|
30128
|
+
this.validatedids = [];
|
|
29699
30129
|
this.resourceCollectionIds = [];
|
|
29700
30130
|
this.criticalTasks = [];
|
|
29701
30131
|
this.parent = parent;
|
|
@@ -29722,6 +30152,7 @@ class CriticalPath {
|
|
|
29722
30152
|
const collectionTaskId = [];
|
|
29723
30153
|
const fromDataObject = [];
|
|
29724
30154
|
let criticalPathIds = [];
|
|
30155
|
+
this.criticalTasks = [];
|
|
29725
30156
|
/* eslint-disable-next-line */
|
|
29726
30157
|
if (parentRecords[0].ganttProperties.autoEndDate > parentRecords[0].ganttProperties.endDate && !parentRecords[0].ganttProperties.isAutoSchedule) {
|
|
29727
30158
|
checkEndDate = parentRecords[0].ganttProperties.autoEndDate;
|
|
@@ -29914,6 +30345,7 @@ class CriticalPath {
|
|
|
29914
30345
|
this.slackCalculation(fromDataObject, collection, collectionTaskId, checkEndDate, totalRecords, modelIds);
|
|
29915
30346
|
}
|
|
29916
30347
|
criticalPathIds = this.finalCriticalPath(collection, taskBeyondEnddate, totalRecords, modelIds, checkEndDate);
|
|
30348
|
+
this.validatedids = [];
|
|
29917
30349
|
this.criticalPathCollection = criticalPathIds;
|
|
29918
30350
|
this.detailPredecessorCollection = collection;
|
|
29919
30351
|
this.predecessorCollectionTaskIds = collectionTaskId;
|
|
@@ -30293,73 +30725,69 @@ class CriticalPath {
|
|
|
30293
30725
|
return this.parent.dataOperation.getDuration(startDate, endDate, durationUnit, record.ganttProperties.isAutoSchedule, true);
|
|
30294
30726
|
}
|
|
30295
30727
|
}
|
|
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
|
-
}
|
|
30728
|
+
updateCriticalTasks(record, criticalPathIds) {
|
|
30729
|
+
for (let i = 0; i < record.ganttProperties.predecessor.length; i++) {
|
|
30730
|
+
let fromRecord;
|
|
30731
|
+
if (this.parent.viewType === 'ProjectView') {
|
|
30732
|
+
fromRecord = this.parent.getRecordByID(record.ganttProperties.predecessor[i].from);
|
|
30733
|
+
}
|
|
30734
|
+
else {
|
|
30735
|
+
let resourceIndex = this.resourceCollectionIds.indexOf(record.ganttProperties.predecessor[i].from.toString());
|
|
30736
|
+
fromRecord = this.parent.flatData[resourceIndex];
|
|
30737
|
+
}
|
|
30738
|
+
let durationDiff;
|
|
30739
|
+
if (record.ganttProperties.endDate.getTime() >= this.maxEndDate.getTime()) {
|
|
30740
|
+
record.ganttProperties.slack = record.slack = 0 + ' ' + record.ganttProperties.durationUnit;
|
|
30741
|
+
if (record.ganttProperties.progress < 100) {
|
|
30742
|
+
record.isCritical = true;
|
|
30743
|
+
record.ganttProperties.isCritical = true;
|
|
30744
|
+
if (criticalPathIds.indexOf(parseInt(record.ganttProperties.taskId)) == -1) {
|
|
30745
|
+
criticalPathIds.push(parseInt(record.ganttProperties.taskId));
|
|
30324
30746
|
}
|
|
30325
|
-
|
|
30326
|
-
|
|
30327
|
-
|
|
30328
|
-
|
|
30329
|
-
|
|
30330
|
-
|
|
30331
|
-
|
|
30332
|
-
|
|
30333
|
-
|
|
30747
|
+
}
|
|
30748
|
+
}
|
|
30749
|
+
if (fromRecord) {
|
|
30750
|
+
if (record.ganttProperties.predecessor[i].type == 'FS') {
|
|
30751
|
+
durationDiff = this.parent.dataOperation.getDuration(fromRecord.ganttProperties.endDate, record.ganttProperties.startDate, fromRecord.ganttProperties.durationUnit, fromRecord.ganttProperties.isAutoSchedule, true);
|
|
30752
|
+
}
|
|
30753
|
+
else if (record.ganttProperties.predecessor[i].type == 'SS') {
|
|
30754
|
+
durationDiff = this.parent.dataOperation.getDuration(fromRecord.ganttProperties.startDate, record.ganttProperties.startDate, fromRecord.ganttProperties.durationUnit, fromRecord.ganttProperties.isAutoSchedule, true);
|
|
30755
|
+
}
|
|
30756
|
+
else if (record.ganttProperties.predecessor[i].type == 'FF') {
|
|
30757
|
+
durationDiff = this.parent.dataOperation.getDuration(fromRecord.ganttProperties.endDate, record.ganttProperties.endDate, fromRecord.ganttProperties.durationUnit, fromRecord.ganttProperties.isAutoSchedule, true);
|
|
30758
|
+
}
|
|
30759
|
+
else if (record.ganttProperties.predecessor[i].type == 'SF') {
|
|
30760
|
+
durationDiff = this.parent.dataOperation.getDuration(record.ganttProperties.endDate, fromRecord.ganttProperties.startDate, fromRecord.ganttProperties.durationUnit, fromRecord.ganttProperties.isAutoSchedule, true);
|
|
30761
|
+
}
|
|
30762
|
+
if (durationDiff == 0 && this.validatedids.indexOf(parseInt(fromRecord.ganttProperties.taskId)) == -1 && fromRecord.ganttProperties.taskId != record.ganttProperties.taskId) {
|
|
30763
|
+
fromRecord.ganttProperties.slack = record.ganttProperties.slack;
|
|
30764
|
+
fromRecord.slack = record.slack;
|
|
30765
|
+
fromRecord.isCritical = record.ganttProperties.isCritical;
|
|
30766
|
+
fromRecord.ganttProperties.isCritical = record.ganttProperties.isCritical;
|
|
30767
|
+
if (criticalPathIds.indexOf(parseInt(fromRecord.ganttProperties.taskId)) == -1 && fromRecord.ganttProperties.isCritical && fromRecord.ganttProperties.progress < 100) {
|
|
30768
|
+
this.validatedids.push(parseInt(fromRecord.ganttProperties.taskId));
|
|
30769
|
+
criticalPathIds.push(parseInt(fromRecord.ganttProperties.taskId));
|
|
30770
|
+
}
|
|
30771
|
+
if (fromRecord.ganttProperties.predecessorsName) {
|
|
30772
|
+
this.updateCriticalTasks(fromRecord, criticalPathIds);
|
|
30334
30773
|
}
|
|
30335
30774
|
}
|
|
30336
30775
|
}
|
|
30337
30776
|
}
|
|
30338
|
-
|
|
30777
|
+
}
|
|
30778
|
+
/* eslint-disable-next-line */
|
|
30779
|
+
finalCriticalPath(collection, taskBeyondEnddate, flatRecords, modelRecordIds, checkEndDate) {
|
|
30780
|
+
let criticalPathIds = [];
|
|
30781
|
+
let index;
|
|
30782
|
+
let predecessorFrom;
|
|
30783
|
+
for (let x = collection.length - 1; x >= 0; x--) {
|
|
30339
30784
|
if (this.parent.viewType === 'ProjectView') {
|
|
30340
|
-
index = modelRecordIds.indexOf(
|
|
30785
|
+
index = modelRecordIds.indexOf(collection[x]['taskid'].toString());
|
|
30341
30786
|
}
|
|
30342
30787
|
else {
|
|
30343
|
-
index = this.resourceCollectionIds.indexOf(
|
|
30788
|
+
index = this.resourceCollectionIds.indexOf(collection[x]['taskid'].toString());
|
|
30344
30789
|
}
|
|
30345
30790
|
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
30791
|
const noSlackValue = 0 + ' ' + flatRecords[index].ganttProperties.durationUnit;
|
|
30364
30792
|
for (let i = predecessorLength.length - 1; i >= 0; i--) {
|
|
30365
30793
|
let toID;
|
|
@@ -30372,6 +30800,7 @@ class CriticalPath {
|
|
|
30372
30800
|
let dateDifference;
|
|
30373
30801
|
const currentData = flatRecords[index].ganttProperties;
|
|
30374
30802
|
if (predecessorLength[i].type === 'FS') {
|
|
30803
|
+
/* eslint-disable-next-line */
|
|
30375
30804
|
if (predecessorLength[i].to != currentData.taskId.toString() || this.parent.viewType === 'ResourceView') {
|
|
30376
30805
|
/* eslint-disable-next-line */
|
|
30377
30806
|
dateDifference = this.parent.dataOperation.getDuration(currentData.endDate, flatRecords[toID].ganttProperties.startDate, currentData.durationUnit, currentData.isAutoSchedule, currentData.isMilestone);
|
|
@@ -30423,8 +30852,28 @@ class CriticalPath {
|
|
|
30423
30852
|
flatRecords[index].isCritical = true;
|
|
30424
30853
|
flatRecords[index].ganttProperties.isCritical = true;
|
|
30425
30854
|
this.criticalTasks.push(flatRecords[index]);
|
|
30426
|
-
|
|
30427
|
-
|
|
30855
|
+
if (criticalPathIds.indexOf(collection[x]['taskid']) === -1) {
|
|
30856
|
+
criticalPathIds.push(collection[x]['taskid']);
|
|
30857
|
+
}
|
|
30858
|
+
}
|
|
30859
|
+
}
|
|
30860
|
+
if (flatRecords[index].ganttProperties.predecessor.length > 0) {
|
|
30861
|
+
this.updateCriticalTasks(flatRecords[index], criticalPathIds);
|
|
30862
|
+
}
|
|
30863
|
+
}
|
|
30864
|
+
if (taskBeyondEnddate.length > 0) {
|
|
30865
|
+
for (let i = 0; i < taskBeyondEnddate.length; i++) {
|
|
30866
|
+
if (this.parent.viewType === 'ProjectView') {
|
|
30867
|
+
index = modelRecordIds.indexOf(taskBeyondEnddate[i].toString());
|
|
30868
|
+
}
|
|
30869
|
+
else {
|
|
30870
|
+
index = this.resourceCollectionIds.indexOf(taskBeyondEnddate[i].toString());
|
|
30871
|
+
}
|
|
30872
|
+
if (index !== -1 && flatRecords[index].ganttProperties.progress < 100) {
|
|
30873
|
+
this.criticalTasks.push(flatRecords[index]);
|
|
30874
|
+
if (criticalPathIds.indexOf(taskBeyondEnddate[i]) === -1) {
|
|
30875
|
+
criticalPathIds = criticalPathIds.concat(taskBeyondEnddate[i]);
|
|
30876
|
+
}
|
|
30428
30877
|
}
|
|
30429
30878
|
}
|
|
30430
30879
|
}
|
|
@@ -30469,7 +30918,7 @@ class CriticalPath {
|
|
|
30469
30918
|
}
|
|
30470
30919
|
}
|
|
30471
30920
|
/* eslint-disable-next-line */
|
|
30472
|
-
if (this.parent.allowUnscheduledTasks && !criticalData[columnFields.startDate] && !criticalData[columnFields.endDate] && criticalData[columnFields.duration]) {
|
|
30921
|
+
if (this.parent.allowUnscheduledTasks && criticalData && !criticalData[columnFields.startDate] && !criticalData[columnFields.endDate] && criticalData[columnFields.duration]) {
|
|
30473
30922
|
taskClass = criticalUnscheduledTask;
|
|
30474
30923
|
}
|
|
30475
30924
|
else {
|
|
@@ -30482,8 +30931,6 @@ class CriticalPath {
|
|
|
30482
30931
|
}
|
|
30483
30932
|
if (element.getElementsByClassName('e-gantt-child-taskbar-inner-div').length > 0) {
|
|
30484
30933
|
addClass(element.querySelectorAll('.e-gantt-child-taskbar-inner-div'), criticalChildTaskBarInnerDiv);
|
|
30485
|
-
const innerDivs = document.querySelector('.e-gantt-child-taskbar-inner-div');
|
|
30486
|
-
innerDivs.style.outlineColor = "";
|
|
30487
30934
|
}
|
|
30488
30935
|
if (element.getElementsByClassName('e-gantt-child-progressbar-inner-div').length > 0) {
|
|
30489
30936
|
addClass(element.querySelectorAll('.e-gantt-child-progressbar-inner-div'), taskClass);
|
|
@@ -31516,8 +31963,16 @@ class RowDD$1 {
|
|
|
31516
31963
|
const dragElement = this.parent.element.querySelector('.e-ganttdrag');
|
|
31517
31964
|
const ganttTop = this.parent.element.getClientRects()[0].top;
|
|
31518
31965
|
const ganttLeft = this.parent.element.getClientRects()[0].left;
|
|
31519
|
-
|
|
31520
|
-
|
|
31966
|
+
let left;
|
|
31967
|
+
let top;
|
|
31968
|
+
if (this.parent.isAdaptive) {
|
|
31969
|
+
left = args.originalEvent.event.touches[0].clientX - ganttLeft;
|
|
31970
|
+
top = args.originalEvent.event.touches[0].clientY - ganttTop;
|
|
31971
|
+
}
|
|
31972
|
+
else {
|
|
31973
|
+
left = getValue('event', args.originalEvent).clientX - ganttLeft;
|
|
31974
|
+
top = getValue('event', args.originalEvent).clientY - ganttTop;
|
|
31975
|
+
}
|
|
31521
31976
|
dragElement.style.left = left + 20 + 'px';
|
|
31522
31977
|
dragElement.style.top = top + 20 + 'px';
|
|
31523
31978
|
this.parent.trigger('rowDrag', args);
|
|
@@ -32370,6 +32825,8 @@ class PdfGanttTheme {
|
|
|
32370
32825
|
ganttStyle.taskbar.progressColor = new PdfColor(33, 82, 125);
|
|
32371
32826
|
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
32372
32827
|
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
32828
|
+
ganttStyle.taskbar.baselineColor = new PdfColor(240, 173, 78);
|
|
32829
|
+
ganttStyle.taskbar.baselineBorderColor = new PdfColor(240, 173, 78);
|
|
32373
32830
|
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
32374
32831
|
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
32375
32832
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(119, 119, 119);
|
|
@@ -32390,6 +32847,8 @@ class PdfGanttTheme {
|
|
|
32390
32847
|
ganttStyle.taskbar.progressColor = new PdfColor(0, 86, 179);
|
|
32391
32848
|
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
32392
32849
|
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
32850
|
+
ganttStyle.taskbar.baselineColor = new PdfColor(255, 193, 7);
|
|
32851
|
+
ganttStyle.taskbar.baselineBorderColor = new PdfColor(255, 193, 7);
|
|
32393
32852
|
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
32394
32853
|
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
32395
32854
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(108, 117, 125);
|
|
@@ -32412,6 +32871,8 @@ class PdfGanttTheme {
|
|
|
32412
32871
|
ganttStyle.taskbar.progressColor = new PdfColor(0, 91, 163);
|
|
32413
32872
|
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
32414
32873
|
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
32874
|
+
ganttStyle.taskbar.baselineColor = new PdfColor(216, 59, 1);
|
|
32875
|
+
ganttStyle.taskbar.baselineBorderColor = new PdfColor(216, 59, 1);
|
|
32415
32876
|
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
32416
32877
|
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
32417
32878
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(118, 118, 118);
|
|
@@ -32432,6 +32893,8 @@ class PdfGanttTheme {
|
|
|
32432
32893
|
ganttStyle.taskbar.progressColor = new PdfColor(63, 81, 181);
|
|
32433
32894
|
ganttStyle.taskbar.criticalTaskColor = new PdfColor(255, 139, 139);
|
|
32434
32895
|
ganttStyle.taskbar.criticalProgressColor = new PdfColor(255, 85, 85);
|
|
32896
|
+
ganttStyle.taskbar.baselineColor = new PdfColor(193, 87, 0);
|
|
32897
|
+
ganttStyle.taskbar.baselineBorderColor = new PdfColor(193, 87, 0);
|
|
32435
32898
|
ganttStyle.criticalConnectorLineColor = new PdfColor(255, 85, 85);
|
|
32436
32899
|
ganttStyle.taskbar.criticalTaskBorderColor = new PdfColor(255, 85, 85);
|
|
32437
32900
|
ganttStyle.taskbar.parentTaskColor = new PdfColor(132, 132, 132);
|
|
@@ -32926,7 +33389,7 @@ class PdfTreeGridLayouter extends ElementLayouter {
|
|
|
32926
33389
|
let startColumn = 0;
|
|
32927
33390
|
let endColumn = 0;
|
|
32928
33391
|
let cellWidths = 0;
|
|
32929
|
-
const availableWidth = this.currentGraphics.clientSize.width - this.currentBounds.x;
|
|
33392
|
+
const availableWidth = pointToPixel(this.currentGraphics.clientSize.width) - this.currentBounds.x;
|
|
32930
33393
|
for (let i = 0; i < this.treegrid.columns.count; i++) {
|
|
32931
33394
|
cellWidths += this.treegrid.columns.getColumn(i).width;
|
|
32932
33395
|
if (cellWidths >= availableWidth) {
|
|
@@ -33154,6 +33617,7 @@ class PdfTreeGridLayouter extends ElementLayouter {
|
|
|
33154
33617
|
let size = new SizeF(column.width, height);
|
|
33155
33618
|
if (cell.columnSpan > 1) {
|
|
33156
33619
|
size = new SizeF(cell.width, height);
|
|
33620
|
+
i += cell.columnSpan;
|
|
33157
33621
|
}
|
|
33158
33622
|
if (!this.checkIfDefaultFormat(column.format) && this.checkIfDefaultFormat(cell.style.format)) {
|
|
33159
33623
|
cell.style.format = column.format;
|
|
@@ -33506,12 +33970,15 @@ class PdfTreeGrid extends PdfLayoutElement {
|
|
|
33506
33970
|
colSpan = cell.columnSpan;
|
|
33507
33971
|
currentCellIndex = j;
|
|
33508
33972
|
cell.isCellMergeStart = true;
|
|
33973
|
+
let totalColumnWidth = this.columns.columns[currentCellIndex].width;
|
|
33509
33974
|
//Set Column merges.
|
|
33510
33975
|
while (colSpan > 1) {
|
|
33511
33976
|
currentCellIndex++;
|
|
33512
33977
|
row.cells.getCell(currentCellIndex).isCellMergeContinue = true;
|
|
33513
33978
|
colSpan--;
|
|
33979
|
+
totalColumnWidth += this.columns.columns[currentCellIndex].width;
|
|
33514
33980
|
}
|
|
33981
|
+
cell.width = totalColumnWidth;
|
|
33515
33982
|
}
|
|
33516
33983
|
else if (cell.columnSpan === 1 && cell.rowSpan > 1) {
|
|
33517
33984
|
rowSpan = cell.rowSpan;
|
|
@@ -33576,15 +34043,12 @@ class PdfTreeGrid extends PdfLayoutElement {
|
|
|
33576
34043
|
colSpan = cell.columnSpan;
|
|
33577
34044
|
currentCellIndex = j;
|
|
33578
34045
|
cell.isCellMergeStart = true;
|
|
33579
|
-
let totalColumnWidth = this.columns.columns[currentCellIndex].width;
|
|
33580
34046
|
//set Column merges.
|
|
33581
34047
|
while (colSpan > 1) {
|
|
33582
34048
|
currentCellIndex++;
|
|
33583
34049
|
row.cells.getCell(currentCellIndex).isCellMergeContinue = true;
|
|
33584
34050
|
colSpan--;
|
|
33585
|
-
totalColumnWidth += this.columns.columns[currentCellIndex].width;
|
|
33586
34051
|
}
|
|
33587
|
-
cell.width = totalColumnWidth;
|
|
33588
34052
|
}
|
|
33589
34053
|
else if (cell.columnSpan === 1 && cell.rowSpan > 1) {
|
|
33590
34054
|
rowSpan = cell.rowSpan;
|
|
@@ -33787,11 +34251,11 @@ class PdfTreeGridCell {
|
|
|
33787
34251
|
if (this.finishedDrawingCell) {
|
|
33788
34252
|
temp = (this.remainingString === '') ? this.remainingString : this.value;
|
|
33789
34253
|
/* 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);
|
|
34254
|
+
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
34255
|
}
|
|
33792
34256
|
else {
|
|
33793
34257
|
/* eslint-disable-next-line */
|
|
33794
|
-
graphics.drawString(this.remainingString, font, textPen, textBrush, (innerLayoutArea.x + leftAdjustment), innerLayoutArea.y, this.style.format);
|
|
34258
|
+
graphics.drawString(this.remainingString, font, textPen, textBrush, (innerLayoutArea.x + leftAdjustment), this.isHeaderCell ? innerLayoutArea.y - 16 : innerLayoutArea.y, this.style.format);
|
|
33795
34259
|
}
|
|
33796
34260
|
result = graphics.stringLayoutResult;
|
|
33797
34261
|
}
|
|
@@ -34427,8 +34891,99 @@ class PdfTreeGridColumnCollection {
|
|
|
34427
34891
|
*/
|
|
34428
34892
|
class ExportHelper {
|
|
34429
34893
|
constructor(parent) {
|
|
34894
|
+
this.totalColumnWidth = 0;
|
|
34895
|
+
this.beforeSinglePageExport = {};
|
|
34896
|
+
this.baselineHeight = 8;
|
|
34430
34897
|
this.parent = parent;
|
|
34431
34898
|
}
|
|
34899
|
+
processToFit() {
|
|
34900
|
+
this.beforeSinglePageExport['zoomingProjectStartDate'] = this.parent.zoomingProjectStartDate;
|
|
34901
|
+
this.beforeSinglePageExport['zoomingProjectEndDate'] = this.parent.zoomingProjectEndDate;
|
|
34902
|
+
this.beforeSinglePageExport['cloneProjectStartDate'] = this.parent.cloneProjectStartDate;
|
|
34903
|
+
this.beforeSinglePageExport['cloneProjectEndDate'] = this.parent.cloneProjectEndDate;
|
|
34904
|
+
this.beforeSinglePageExport['customTimelineSettings'] = extend({}, this.parent.timelineModule.customTimelineSettings, null, true);
|
|
34905
|
+
this.beforeSinglePageExport['isTimelineRoundOff'] = this.parent.isTimelineRoundOff;
|
|
34906
|
+
this.beforeSinglePageExport['topTier'] = this.parent.timelineModule.topTier;
|
|
34907
|
+
this.beforeSinglePageExport['topTierCellWidth'] = this.parent.timelineModule.topTierCellWidth;
|
|
34908
|
+
this.beforeSinglePageExport['topTierCollection'] = this.parent.timelineModule.topTierCollection;
|
|
34909
|
+
this.beforeSinglePageExport['bottomTier'] = this.parent.timelineModule.bottomTier;
|
|
34910
|
+
this.beforeSinglePageExport['bottomTierCellWidth'] = this.parent.timelineModule.bottomTierCellWidth;
|
|
34911
|
+
this.beforeSinglePageExport['bottomTierCollection'] = this.parent.timelineModule.bottomTierCollection;
|
|
34912
|
+
this.beforeSinglePageExport['totalTimelineWidth'] = this.parent.timelineModule.totalTimelineWidth;
|
|
34913
|
+
this.beforeSinglePageExport['timelineStartDate'] = this.parent.timelineModule.timelineStartDate;
|
|
34914
|
+
this.beforeSinglePageExport['timelineEndDate'] = this.parent.timelineModule.timelineEndDate;
|
|
34915
|
+
this.beforeSinglePageExport['timelineRoundOffEndDate'] = this.parent.timelineModule.timelineRoundOffEndDate;
|
|
34916
|
+
this.beforeSinglePageExport['perDayWidth'] = this.parent.perDayWidth;
|
|
34917
|
+
this.beforeSinglePageExport['updatedConnectorLineCollection'] = extend([], this.parent.updatedConnectorLineCollection, null, true);
|
|
34918
|
+
this.parent.timelineModule.isZoomToFit = true;
|
|
34919
|
+
this.parent.timelineModule.isZooming = false;
|
|
34920
|
+
if (!this.parent.zoomingProjectStartDate) {
|
|
34921
|
+
this.parent.zoomingProjectStartDate = this.parent.cloneProjectStartDate;
|
|
34922
|
+
this.parent.zoomingProjectEndDate = this.parent.cloneProjectEndDate;
|
|
34923
|
+
}
|
|
34924
|
+
if (this.parent.zoomingProjectStartDate > this.parent.cloneProjectStartDate) {
|
|
34925
|
+
this.parent.cloneProjectStartDate = new Date(this.parent.allowUnscheduledTasks ? this.parent.zoomingProjectStartDate : this.parent.cloneProjectStartDate);
|
|
34926
|
+
}
|
|
34927
|
+
this.parent.dataOperation.calculateProjectDates();
|
|
34928
|
+
const timeDifference = (this.parent.cloneProjectEndDate.getTime() - this.parent.cloneProjectStartDate.getTime());
|
|
34929
|
+
const totalDays = (timeDifference / (1000 * 3600 * 24));
|
|
34930
|
+
let chartsideWidth;
|
|
34931
|
+
let gridWidth;
|
|
34932
|
+
if (this.exportProps.fitToWidthSettings.gridWidth) {
|
|
34933
|
+
gridWidth = parseInt(this.exportProps.fitToWidthSettings.gridWidth.split('%')[0]);
|
|
34934
|
+
}
|
|
34935
|
+
if (this.exportProps.fitToWidthSettings.chartWidth) {
|
|
34936
|
+
chartsideWidth = parseInt(this.exportProps.fitToWidthSettings.chartWidth.split('%')[0]);
|
|
34937
|
+
}
|
|
34938
|
+
else {
|
|
34939
|
+
if (this.exportProps.fitToWidthSettings.gridWidth) {
|
|
34940
|
+
chartsideWidth = 100 - gridWidth;
|
|
34941
|
+
}
|
|
34942
|
+
else {
|
|
34943
|
+
chartsideWidth = 70;
|
|
34944
|
+
}
|
|
34945
|
+
}
|
|
34946
|
+
const pdfwidth = (this.parent.pdfExportModule['pdfPageDimensions'].width * chartsideWidth) / 100;
|
|
34947
|
+
const chartWidth = pdfwidth;
|
|
34948
|
+
const perDayWidth = chartWidth / totalDays;
|
|
34949
|
+
let zoomingLevel;
|
|
34950
|
+
let firstValue;
|
|
34951
|
+
let secondValue;
|
|
34952
|
+
const zoomingCollections = [...this.parent.zoomingLevels];
|
|
34953
|
+
const sortedCollectons = zoomingCollections.sort((a, b) => (!a.perDayWidth && !b.perDayWidth ? 0 : (a.perDayWidth < b.perDayWidth) ? 1 : -1));
|
|
34954
|
+
if (perDayWidth === 0) { // return when the Gantt chart is not in viewable state.
|
|
34955
|
+
return;
|
|
34956
|
+
}
|
|
34957
|
+
for (let i = 0; i < sortedCollectons.length; i++) {
|
|
34958
|
+
firstValue = sortedCollectons[i];
|
|
34959
|
+
if (i === sortedCollectons.length - 1) {
|
|
34960
|
+
zoomingLevel = sortedCollectons[i];
|
|
34961
|
+
break;
|
|
34962
|
+
}
|
|
34963
|
+
else {
|
|
34964
|
+
secondValue = sortedCollectons[i + 1];
|
|
34965
|
+
}
|
|
34966
|
+
if (perDayWidth >= firstValue.perDayWidth) {
|
|
34967
|
+
zoomingLevel = sortedCollectons[i];
|
|
34968
|
+
break;
|
|
34969
|
+
}
|
|
34970
|
+
if (perDayWidth < firstValue.perDayWidth && perDayWidth > secondValue.perDayWidth) {
|
|
34971
|
+
zoomingLevel = sortedCollectons[i + 1];
|
|
34972
|
+
break;
|
|
34973
|
+
}
|
|
34974
|
+
}
|
|
34975
|
+
const newTimeline = extend({}, {}, zoomingLevel, true);
|
|
34976
|
+
this.parent.timelineModule['roundOffDateToZoom'](this.parent.cloneProjectStartDate, true, perDayWidth, newTimeline.bottomTier.unit, zoomingLevel);
|
|
34977
|
+
this.parent.timelineModule['roundOffDateToZoom'](this.parent.cloneProjectEndDate, false, perDayWidth, newTimeline.bottomTier.unit, zoomingLevel);
|
|
34978
|
+
const numberOfCells = this.parent.timelineModule['calculateNumberOfTimelineCells'](newTimeline);
|
|
34979
|
+
const scrollHeight = this.parent.pdfExportModule['pdfPageDimensions'].height; //17 is horizontal scrollbar width
|
|
34980
|
+
const contentHeight = this.parent.pdfExportModule['pdfPageDimensions'].height;
|
|
34981
|
+
const emptySpace = contentHeight <= scrollHeight ? 0 : 17;
|
|
34982
|
+
newTimeline.timelineUnitSize = Math.abs((chartWidth - emptySpace)) / numberOfCells;
|
|
34983
|
+
this.parent.timelineModule['changeTimelineSettings'](newTimeline);
|
|
34984
|
+
this.parent.timelineModule.isZoomToFit = false;
|
|
34985
|
+
this.parent.timelineModule.isZooming = false;
|
|
34986
|
+
}
|
|
34432
34987
|
/**
|
|
34433
34988
|
* @param {IGanttData[]} data .
|
|
34434
34989
|
* @param {PdfGantt} gantt .
|
|
@@ -34450,11 +35005,16 @@ class ExportHelper {
|
|
|
34450
35005
|
this.gantt.style.cellPadding.right = 0;
|
|
34451
35006
|
this.ganttStyle = this.gantt.ganttStyle;
|
|
34452
35007
|
this.gantt.borderColor = this.ganttStyle.chartGridLineColor;
|
|
35008
|
+
this.parent.pdfExportModule.isPdfExport = true;
|
|
35009
|
+
if (this.exportProps.fitToWidthSettings && this.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
35010
|
+
this.processToFit();
|
|
35011
|
+
}
|
|
34453
35012
|
this.processHeaderContent();
|
|
34454
35013
|
this.processGanttContent();
|
|
34455
35014
|
this.processTimeline();
|
|
34456
35015
|
this.processTaskbar();
|
|
34457
35016
|
this.processPredecessor();
|
|
35017
|
+
this.parent.pdfExportModule.isPdfExport = false;
|
|
34458
35018
|
}
|
|
34459
35019
|
processHeaderContent() {
|
|
34460
35020
|
this.rowIndex++;
|
|
@@ -34508,7 +35068,9 @@ class ExportHelper {
|
|
|
34508
35068
|
this.renderEmptyGantt();
|
|
34509
35069
|
}
|
|
34510
35070
|
else {
|
|
34511
|
-
|
|
35071
|
+
let flatData;
|
|
35072
|
+
flatData = this.flatData;
|
|
35073
|
+
flatData.forEach((data) => {
|
|
34512
35074
|
this.row = this.gantt.rows.addRow();
|
|
34513
35075
|
if (data.hasChildRecords) {
|
|
34514
35076
|
this.gantt.rows.getRow(this.rowIndex).isParentRow = true;
|
|
@@ -34517,6 +35079,9 @@ class ExportHelper {
|
|
|
34517
35079
|
else {
|
|
34518
35080
|
this.processRecordRow(data);
|
|
34519
35081
|
}
|
|
35082
|
+
if (this.exportProps.fitToWidthSettings && this.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
35083
|
+
this.row.height = 33.33;
|
|
35084
|
+
}
|
|
34520
35085
|
this.rowIndex++;
|
|
34521
35086
|
});
|
|
34522
35087
|
}
|
|
@@ -34567,7 +35132,7 @@ class ExportHelper {
|
|
|
34567
35132
|
else {
|
|
34568
35133
|
predecessor.connectorLineColor = this.ganttStyle.connectorLineColor;
|
|
34569
35134
|
}
|
|
34570
|
-
|
|
35135
|
+
this.ganttStyle.connectorLineColor = predecessor.connectorLineColor;
|
|
34571
35136
|
this.gantt.predecessorCollection.push(predecessor);
|
|
34572
35137
|
});
|
|
34573
35138
|
this.parent.pdfExportModule.isPdfExport = false;
|
|
@@ -34630,7 +35195,9 @@ class ExportHelper {
|
|
|
34630
35195
|
* @returns {void} .
|
|
34631
35196
|
*/
|
|
34632
35197
|
processTaskbar() {
|
|
34633
|
-
|
|
35198
|
+
let flatData;
|
|
35199
|
+
flatData = this.flatData;
|
|
35200
|
+
flatData.forEach((data) => {
|
|
34634
35201
|
const taskbar = this.gantt.taskbar.add();
|
|
34635
35202
|
const ganttProp = data.ganttProperties;
|
|
34636
35203
|
taskbar.left = ganttProp.left;
|
|
@@ -34661,7 +35228,22 @@ class ExportHelper {
|
|
|
34661
35228
|
taskbar.startDate = ganttProp.startDate;
|
|
34662
35229
|
taskbar.endDate = ganttProp.endDate;
|
|
34663
35230
|
taskbar.height = this.parent.chartRowsModule.taskBarHeight;
|
|
35231
|
+
if (this.parent.renderBaseline) {
|
|
35232
|
+
let height;
|
|
35233
|
+
if ((taskbar.height + this.baselineHeight) <= this.parent.rowHeight) {
|
|
35234
|
+
height = taskbar.height;
|
|
35235
|
+
}
|
|
35236
|
+
else {
|
|
35237
|
+
height = taskbar.height - (this.baselineHeight + 1);
|
|
35238
|
+
}
|
|
35239
|
+
taskbar.height = height;
|
|
35240
|
+
}
|
|
35241
|
+
taskbar.baselineTop = this.parent.chartRowsModule.baselineTop;
|
|
34664
35242
|
taskbar.isMilestone = ganttProp.isMilestone;
|
|
35243
|
+
taskbar.baselineStartDate = ganttProp.baselineStartDate;
|
|
35244
|
+
taskbar.baselineEndDate = ganttProp.baselineEndDate;
|
|
35245
|
+
taskbar.baselineLeft = ganttProp.baselineLeft;
|
|
35246
|
+
taskbar.baselineWidth = ganttProp.baselineWidth;
|
|
34665
35247
|
taskbar.milestoneColor = new PdfColor(this.ganttStyle.taskbar.milestoneColor);
|
|
34666
35248
|
taskbar.isParentTask = data.hasChildRecords;
|
|
34667
35249
|
if (ganttProp.isMilestone) {
|
|
@@ -34692,6 +35274,7 @@ class ExportHelper {
|
|
|
34692
35274
|
taskbar.taskColor = new PdfColor(this.ganttStyle.taskbar.criticalTaskColor);
|
|
34693
35275
|
taskbar.progressColor = new PdfColor(this.ganttStyle.taskbar.criticalProgressColor);
|
|
34694
35276
|
taskbar.taskBorderColor = new PdfColor(this.ganttStyle.taskbar.criticalTaskBorderColor);
|
|
35277
|
+
taskbar.milestoneColor = new PdfColor(this.ganttStyle.taskbar.criticalTaskColor);
|
|
34695
35278
|
}
|
|
34696
35279
|
else {
|
|
34697
35280
|
taskbar.taskColor = new PdfColor(this.ganttStyle.taskbar.taskColor);
|
|
@@ -34699,6 +35282,8 @@ class ExportHelper {
|
|
|
34699
35282
|
taskbar.taskBorderColor = new PdfColor(this.ganttStyle.taskbar.taskBorderColor);
|
|
34700
35283
|
}
|
|
34701
35284
|
}
|
|
35285
|
+
taskbar.baselineColor = new PdfColor(this.ganttStyle.taskbar.baselineColor);
|
|
35286
|
+
taskbar.baselineBorderColor = new PdfColor(this.ganttStyle.taskbar.baselineBorderColor);
|
|
34702
35287
|
taskbar.gridLineColor = new PdfColor(this.ganttStyle.chartGridLineColor);
|
|
34703
35288
|
this.gantt.taskbarCollection.push(taskbar);
|
|
34704
35289
|
const taskStyle = {};
|
|
@@ -34707,6 +35292,8 @@ class ExportHelper {
|
|
|
34707
35292
|
taskStyle.taskBorderColor = taskbar.taskBorderColor;
|
|
34708
35293
|
taskStyle.progressColor = taskbar.progressColor;
|
|
34709
35294
|
taskStyle.milestoneColor = taskbar.milestoneColor;
|
|
35295
|
+
taskStyle.baselineColor = taskbar.baselineColor;
|
|
35296
|
+
taskStyle.baselineBorderColor = taskbar.baselineBorderColor;
|
|
34710
35297
|
const args = {
|
|
34711
35298
|
taskbar: taskStyle,
|
|
34712
35299
|
data: data
|
|
@@ -34718,6 +35305,8 @@ class ExportHelper {
|
|
|
34718
35305
|
taskbar.taskBorderColor = args.taskbar.taskBorderColor;
|
|
34719
35306
|
taskbar.progressColor = args.taskbar.progressColor;
|
|
34720
35307
|
taskbar.milestoneColor = args.taskbar.milestoneColor;
|
|
35308
|
+
taskbar.baselineColor = args.taskbar.baselineColor;
|
|
35309
|
+
taskbar.baselineBorderColor = args.taskbar.baselineBorderColor;
|
|
34721
35310
|
}
|
|
34722
35311
|
});
|
|
34723
35312
|
}
|
|
@@ -34865,6 +35454,26 @@ class ExportHelper {
|
|
|
34865
35454
|
const widths = [];
|
|
34866
35455
|
const treeColumnIndex = 0;
|
|
34867
35456
|
const tWidth = (this.pdfDoc.pageSettings.width - 82);
|
|
35457
|
+
if (this.exportProps && this.exportProps.fitToWidthSettings && this.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
35458
|
+
let gridWidth;
|
|
35459
|
+
if (this.exportProps.fitToWidthSettings.gridWidth) {
|
|
35460
|
+
gridWidth = parseInt(this.exportProps.fitToWidthSettings.gridWidth.split('%')[0]);
|
|
35461
|
+
}
|
|
35462
|
+
else {
|
|
35463
|
+
if (this.exportProps.fitToWidthSettings.chartWidth) {
|
|
35464
|
+
let chartWidth = parseInt(this.exportProps.fitToWidthSettings.chartWidth.split('%')[0]);
|
|
35465
|
+
gridWidth = 100 - chartWidth;
|
|
35466
|
+
}
|
|
35467
|
+
else {
|
|
35468
|
+
gridWidth = 30;
|
|
35469
|
+
}
|
|
35470
|
+
}
|
|
35471
|
+
const pdfwidth = (this.parent.pdfExportModule['pdfPageDimensions'].width * gridWidth) / 100;
|
|
35472
|
+
const perColumnWidth = pdfwidth / this.gantt.columns.columns.length;
|
|
35473
|
+
for (let i = 0; i < this.gantt.columns.columns.length; i++) {
|
|
35474
|
+
this.gantt.columns.getColumn(i).width = perColumnWidth;
|
|
35475
|
+
}
|
|
35476
|
+
}
|
|
34868
35477
|
if (this.totalColumnWidth > (this.pdfDoc.pageSettings.width - 82)) {
|
|
34869
35478
|
this.gantt.style.allowHorizontalOverflow = true;
|
|
34870
35479
|
}
|
|
@@ -34979,6 +35588,8 @@ class ExportValueFormatter {
|
|
|
34979
35588
|
*/
|
|
34980
35589
|
class PdfGanttTaskbarCollection {
|
|
34981
35590
|
constructor(parent) {
|
|
35591
|
+
/** Defines the task baselineHeight . */
|
|
35592
|
+
this.baselineHeight = 8;
|
|
34982
35593
|
/**
|
|
34983
35594
|
* @private
|
|
34984
35595
|
*/
|
|
@@ -35025,6 +35636,7 @@ class PdfGanttTaskbarCollection {
|
|
|
35025
35636
|
//code for while current pdf page is exceed
|
|
35026
35637
|
if (yPoint > pageSize.height) {
|
|
35027
35638
|
page = this.GetNextPage(page);
|
|
35639
|
+
page['contentWidth'] = pointToPixel(detail.endPoint - detail.startPoint);
|
|
35028
35640
|
taskGraphics = page.graphics;
|
|
35029
35641
|
startPoint.y = 0;
|
|
35030
35642
|
if (this.parent.pdfExportModule.gantt.enableHeader) {
|
|
@@ -35032,6 +35644,11 @@ class PdfGanttTaskbarCollection {
|
|
|
35032
35644
|
startPoint.y = pixelToPoint(this.parent.timelineModule.isSingleTier ? 45 : 60);
|
|
35033
35645
|
}
|
|
35034
35646
|
isNextPage = true;
|
|
35647
|
+
const graphics = page.graphics;
|
|
35648
|
+
const pen = new PdfPen(new PdfColor(206, 206, 206));
|
|
35649
|
+
if (page['contentWidth'] && (this.parent.gridLines == "Both" || this.parent.gridLines == "Horizontal")) {
|
|
35650
|
+
graphics.drawRectangle(pen, startPoint.x, startPoint.y, page['contentWidth'] + 0.5, rowHeight);
|
|
35651
|
+
}
|
|
35035
35652
|
}
|
|
35036
35653
|
this.drawLeftLabel(page, startPoint, detail, cumulativeWidth);
|
|
35037
35654
|
//Draw Taskbar
|
|
@@ -35055,9 +35672,13 @@ class PdfGanttTaskbarCollection {
|
|
|
35055
35672
|
if (!taskbar.isMilestone) {
|
|
35056
35673
|
const taskbarPen = new PdfPen(taskbar.taskBorderColor);
|
|
35057
35674
|
const taskBrush = new PdfSolidBrush(taskbar.taskColor);
|
|
35675
|
+
const baselinePen = new PdfPen(taskbar.baselineBorderColor);
|
|
35676
|
+
const baselineBrush = new PdfSolidBrush(taskbar.baselineColor);
|
|
35058
35677
|
const progressPen = new PdfPen(taskbar.progressColor);
|
|
35059
35678
|
const progressBrush = new PdfSolidBrush(taskbar.progressColor);
|
|
35060
|
-
const
|
|
35679
|
+
const adjustHeightforTaskbar = pixelToPoint((this.parent.rowHeight - this.height) / 2.0);
|
|
35680
|
+
var adjustHeightforBaseline = pixelToPoint((this.parent.rowHeight - this.height) / 4.5);
|
|
35681
|
+
const adjustHeight = this.parent.renderBaseline ? adjustHeightforBaseline : adjustHeightforTaskbar;
|
|
35061
35682
|
pageIndex = page.section.indexOf(page);
|
|
35062
35683
|
const startDate = isNullOrUndefined(this.unscheduleStarteDate) ? this.startDate : this.unscheduleStarteDate;
|
|
35063
35684
|
const endDate = isNullOrUndefined(this.unscheduleEndDate) ? this.endDate : this.unscheduleEndDate;
|
|
@@ -35071,6 +35692,9 @@ class PdfGanttTaskbarCollection {
|
|
|
35071
35692
|
this.drawUnscheduledTask(taskGraphics, startPoint, cumulativeWidth, adjustHeight);
|
|
35072
35693
|
}
|
|
35073
35694
|
else {
|
|
35695
|
+
if (this.parent.renderBaseline && taskbar.baselineStartDate && taskbar.baselineEndDate) {
|
|
35696
|
+
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));
|
|
35697
|
+
}
|
|
35074
35698
|
taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth) + 0.5, startPoint.y + adjustHeight, pixelToPoint(taskbar.width), pixelToPoint(taskbar.height));
|
|
35075
35699
|
if (this.isScheduledTask) {
|
|
35076
35700
|
taskGraphics.drawRectangle(progressPen, progressBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth) + 0.5, startPoint.y + adjustHeight, pixelToPoint(taskbar.progressWidth), pixelToPoint(taskbar.height));
|
|
@@ -35102,6 +35726,9 @@ class PdfGanttTaskbarCollection {
|
|
|
35102
35726
|
this.drawUnscheduledTask(taskGraphics, startPoint, cumulativeWidth, adjustHeight);
|
|
35103
35727
|
}
|
|
35104
35728
|
else {
|
|
35729
|
+
if (this.parent.renderBaseline && taskbar.baselineStartDate && taskbar.baselineEndDate) {
|
|
35730
|
+
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));
|
|
35731
|
+
}
|
|
35105
35732
|
taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(this.left - cumulativeWidth) + 0.5, startPoint.y + adjustHeight, pixelToPoint(renderWidth), pixelToPoint(taskbar.height));
|
|
35106
35733
|
taskbar.width = taskbar.width - renderWidth;
|
|
35107
35734
|
if (this.isScheduledTask) {
|
|
@@ -35133,6 +35760,9 @@ class PdfGanttTaskbarCollection {
|
|
|
35133
35760
|
this.taskStartPoint = Object.assign({}, startPoint);
|
|
35134
35761
|
this.isStartPoint = true;
|
|
35135
35762
|
}
|
|
35763
|
+
if (this.parent.renderBaseline && taskbar.baselineStartDate && taskbar.baselineEndDate) {
|
|
35764
|
+
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));
|
|
35765
|
+
}
|
|
35136
35766
|
taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(taskbar.left + 0.5), startPoint.y + adjustHeight, pixelToPoint(taskbar.width), pixelToPoint(taskbar.height));
|
|
35137
35767
|
if (this.isScheduledTask) {
|
|
35138
35768
|
taskGraphics.drawRectangle(progressPen, progressBrush, startPoint.x + pixelToPoint(taskbar.left + 0.5), startPoint.y + adjustHeight, pixelToPoint(taskbar.progressWidth), pixelToPoint(taskbar.height));
|
|
@@ -35154,6 +35784,9 @@ class PdfGanttTaskbarCollection {
|
|
|
35154
35784
|
this.taskStartPoint = Object.assign({}, startPoint);
|
|
35155
35785
|
this.isStartPoint = true;
|
|
35156
35786
|
}
|
|
35787
|
+
if (this.parent.renderBaseline && taskbar.baselineStartDate && taskbar.baselineEndDate) {
|
|
35788
|
+
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));
|
|
35789
|
+
}
|
|
35157
35790
|
taskGraphics.drawRectangle(taskbarPen, taskBrush, startPoint.x + pixelToPoint(taskbar.left) + 0.5, startPoint.y + adjustHeight, pixelToPoint(detail.totalWidth), pixelToPoint(taskbar.height));
|
|
35158
35791
|
if (this.isScheduledTask) {
|
|
35159
35792
|
let progressBoundsWidth = 0;
|
|
@@ -35179,6 +35812,9 @@ class PdfGanttTaskbarCollection {
|
|
|
35179
35812
|
}
|
|
35180
35813
|
else {
|
|
35181
35814
|
this.drawMilestone(page, startPoint, detail, cumulativeWidth);
|
|
35815
|
+
if (this.parent.renderBaseline && taskbar.baselineStartDate && taskbar.baselineEndDate) {
|
|
35816
|
+
this.drawMilestone(page, startPoint, detail, cumulativeWidth);
|
|
35817
|
+
}
|
|
35182
35818
|
}
|
|
35183
35819
|
this.drawRightLabel(page, startPoint, detail, cumulativeWidth);
|
|
35184
35820
|
return isNextPage;
|
|
@@ -35337,13 +35973,20 @@ class PdfGanttTaskbarCollection {
|
|
|
35337
35973
|
const pageIndex = page.section.indexOf(page);
|
|
35338
35974
|
this.taskStartPoint = Object.assign({}, startPoint);
|
|
35339
35975
|
const milestonePen = new PdfPen(this.milestoneColor);
|
|
35340
|
-
const
|
|
35976
|
+
const adjustHeightforBaselineMilesone = pixelToPoint(((this.parent.rowHeight - this.height) / 3.0));
|
|
35977
|
+
const adjustHeightforMilesone = pixelToPoint(((this.parent.rowHeight - this.height) / 2.0));
|
|
35978
|
+
const adjustHeight = this.parent.renderBaseline ? adjustHeightforBaselineMilesone : adjustHeightforMilesone;
|
|
35341
35979
|
const milestoneBrush = new PdfSolidBrush(this.milestoneColor);
|
|
35980
|
+
const baselinePen = new PdfPen(this.baselineBorderColor);
|
|
35981
|
+
const baselineBrush = new PdfSolidBrush(this.baselineColor);
|
|
35342
35982
|
taskGraphics.save(); //saving graphics state
|
|
35343
|
-
const height = Math.floor(this.parent.chartRowsModule.taskBarHeight * 0.
|
|
35983
|
+
const height = Math.floor(this.parent.chartRowsModule.taskBarHeight * 0.8);
|
|
35344
35984
|
/* eslint-disable-next-line */
|
|
35345
35985
|
taskGraphics.translateTransform(startPoint.x + pixelToPoint(this.left - cumulativeWidth), startPoint.y + adjustHeight - (this.parent.chartRowsModule.taskBarHeight * 0.7) / 2);
|
|
35346
35986
|
taskGraphics.rotateTransform(45); //apply rotation
|
|
35987
|
+
if (this.parent.renderBaseline && this.baselineStartDate && this.baselineEndDate) {
|
|
35988
|
+
taskGraphics.drawRectangle(baselinePen, baselineBrush, 2, 2, pixelToPoint(height), pixelToPoint(height));
|
|
35989
|
+
}
|
|
35347
35990
|
taskGraphics.drawRectangle(milestonePen, milestoneBrush, 0, 0, pixelToPoint(height), pixelToPoint(height));
|
|
35348
35991
|
taskGraphics.restore(); //restoring graphics state
|
|
35349
35992
|
this.endPage = this.startPage = pageIndex;
|
|
@@ -35373,7 +36016,7 @@ class PdfTimeline {
|
|
|
35373
36016
|
* @returns {void}
|
|
35374
36017
|
*/
|
|
35375
36018
|
drawTimeline(page, startPoint, detail) {
|
|
35376
|
-
let remainWidth = Math.floor(detail.totalWidth);
|
|
36019
|
+
let remainWidth = pointToPixel(Math.floor(detail.totalWidth));
|
|
35377
36020
|
let renderWidth = 0;
|
|
35378
36021
|
this.topTierPoint.x = startPoint.x;
|
|
35379
36022
|
this.topTierPoint.y = startPoint.y;
|
|
@@ -35401,7 +36044,7 @@ class PdfTimeline {
|
|
|
35401
36044
|
//Primary header Event Arguments
|
|
35402
36045
|
/* eslint-disable-next-line */
|
|
35403
36046
|
this.triggerQueryTimelinecell(page, this.topTierPoint.x, this.topTierPoint.y, this.topTierHeight, renderWidth, pHeader.value, true);
|
|
35404
|
-
this.topTierPoint.x +=
|
|
36047
|
+
this.topTierPoint.x += renderWidth;
|
|
35405
36048
|
remainWidth -= renderWidth;
|
|
35406
36049
|
if (isCompleted) {
|
|
35407
36050
|
this.topTierIndex++;
|
|
@@ -35427,7 +36070,7 @@ class PdfTimeline {
|
|
|
35427
36070
|
//Secondary header Event Arguments
|
|
35428
36071
|
/* eslint-disable-next-line */
|
|
35429
36072
|
this.triggerQueryTimelinecell(page, this.bottomTierPoint.x, this.bottomTierPoint.y, this.bottomTierHeight, width, secondHeader.value, false);
|
|
35430
|
-
this.bottomTierPoint.x = this.bottomTierPoint.x +
|
|
36073
|
+
this.bottomTierPoint.x = this.bottomTierPoint.x + width;
|
|
35431
36074
|
remainWidth -= width;
|
|
35432
36075
|
secondHeader.completedWidth = width;
|
|
35433
36076
|
if (isCompleted) {
|
|
@@ -35458,7 +36101,7 @@ class PdfTimeline {
|
|
|
35458
36101
|
//Primary header Event Arguments
|
|
35459
36102
|
/* eslint-disable-next-line */
|
|
35460
36103
|
this.triggerQueryTimelinecell(page, this.topTierPoint.x, this.topTierPoint.y, this.topTierHeight, pHeader.completedWidth, pHeader.value, true);
|
|
35461
|
-
this.topTierPoint.x +=
|
|
36104
|
+
this.topTierPoint.x += pHeader.completedWidth;
|
|
35462
36105
|
}
|
|
35463
36106
|
}
|
|
35464
36107
|
}
|
|
@@ -35471,7 +36114,7 @@ class PdfTimeline {
|
|
|
35471
36114
|
//Secondary header Event Arguments
|
|
35472
36115
|
/* eslint-disable-next-line */
|
|
35473
36116
|
this.triggerQueryTimelinecell(page, this.bottomTierPoint.x, this.bottomTierPoint.y, this.bottomTierHeight, secondHeader.width, secondHeader.value, false);
|
|
35474
|
-
this.bottomTierPoint.x = this.bottomTierPoint.x +
|
|
36117
|
+
this.bottomTierPoint.x = this.bottomTierPoint.x + secondHeader.width;
|
|
35475
36118
|
}
|
|
35476
36119
|
}
|
|
35477
36120
|
}
|
|
@@ -35518,7 +36161,10 @@ class PdfTimeline {
|
|
|
35518
36161
|
const e = eventArgs.timelineCell;
|
|
35519
36162
|
const rectPen = new PdfPen(eventArgs.timelineCell.borderColor);
|
|
35520
36163
|
const rectBrush = new PdfSolidBrush(eventArgs.timelineCell.backgroundColor);
|
|
35521
|
-
graphics.drawRectangle(rectPen, rectBrush, x, y,
|
|
36164
|
+
graphics.drawRectangle(rectPen, rectBrush, x, y, width, pixelToPoint(height));
|
|
36165
|
+
if (!isTopTier && (this.parent.gridLines == "Both" || this.parent.gridLines == "Vertical")) {
|
|
36166
|
+
graphics.drawRectangle(rectPen, rectBrush, x, y + pixelToPoint(height), width, page.getClientSize().height);
|
|
36167
|
+
}
|
|
35522
36168
|
let font = new PdfStandardFont(ganttStyle.fontFamily, e.fontSize, e.fontStyle);
|
|
35523
36169
|
if (ganttStyle.font) {
|
|
35524
36170
|
font = ganttStyle.font;
|
|
@@ -35527,7 +36173,13 @@ class PdfTimeline {
|
|
|
35527
36173
|
const pLeft = ganttStyle.timeline.padding ? eventArgs.timelineCell.padding.left : 0;
|
|
35528
36174
|
const pTop = ganttStyle.timeline.padding ? eventArgs.timelineCell.padding.top : 0;
|
|
35529
36175
|
/* eslint-disable-next-line */
|
|
35530
|
-
|
|
36176
|
+
if (isTopTier) {
|
|
36177
|
+
x = x + pLeft + 4;
|
|
36178
|
+
}
|
|
36179
|
+
else {
|
|
36180
|
+
x = x + pLeft;
|
|
36181
|
+
}
|
|
36182
|
+
graphics.drawString(eventArgs.value, font, null, textBrush, x, y + pTop, pixelToPoint(width), pixelToPoint(height), e.format);
|
|
35531
36183
|
}
|
|
35532
36184
|
}
|
|
35533
36185
|
|
|
@@ -35682,7 +36334,9 @@ class PdfGanttPredecessor {
|
|
|
35682
36334
|
}
|
|
35683
36335
|
break;
|
|
35684
36336
|
}
|
|
35685
|
-
|
|
36337
|
+
const midPointforTaskbar = Math.round((this.parent.rowHeight - 1) / 2.0);
|
|
36338
|
+
const midPointforBaseline = Math.round((this.parent.rowHeight - 10) / 2.0);
|
|
36339
|
+
let midPoint = this.parent.renderBaseline ? midPointforBaseline : midPointforTaskbar;
|
|
35686
36340
|
midPoint = pixelToPoint(midPoint);
|
|
35687
36341
|
/* eslint-disable-next-line */
|
|
35688
36342
|
let point1, point2, point3, point4, point5, point6;
|
|
@@ -36145,6 +36799,7 @@ class PdfGantt extends PdfTreeGrid {
|
|
|
36145
36799
|
let pageData;
|
|
36146
36800
|
this.headerDetails.forEach((detail, index) => {
|
|
36147
36801
|
const page = this.result.page.section.getPages()[this.startPageIndex];
|
|
36802
|
+
page['contentWidth'] = pointToPixel(this.headerDetails[index].endPoint - this.headerDetails[index].startPoint);
|
|
36148
36803
|
this.chartHeader.drawTimeline(page, this.startPoint, detail);
|
|
36149
36804
|
taskbarPoint.y = taskbarPoint.y + pixelToPoint(this.parent.timelineModule.isSingleTier ? 45 : 60); // headerHeight
|
|
36150
36805
|
pageStartX = taskbarPoint.x;
|
|
@@ -36155,6 +36810,11 @@ class PdfGantt extends PdfTreeGrid {
|
|
|
36155
36810
|
const task = this.taskbarCollection[i];
|
|
36156
36811
|
const rowHeight = this.rows.getRow(i + 1).height;
|
|
36157
36812
|
const pdfPage = this.result.page.section.getPages()[this.startPageIndex];
|
|
36813
|
+
const graphics = pdfPage.graphics;
|
|
36814
|
+
const pen = new PdfPen(new PdfColor(206, 206, 206));
|
|
36815
|
+
if (page['contentWidth'] && (this.parent.gridLines == "Both" || this.parent.gridLines == "Horizontal")) {
|
|
36816
|
+
graphics.drawRectangle(pen, pageStartX, taskbarPoint.y, page['contentWidth'] + 0.5, rowHeight);
|
|
36817
|
+
}
|
|
36158
36818
|
/* eslint-disable-next-line */
|
|
36159
36819
|
const isNextPage = task.drawTaskbar(pdfPage, taskbarPoint, detail, cumulativeWidth, rowHeight, this.taskbarCollection[i]);
|
|
36160
36820
|
if (isNextPage) {
|
|
@@ -36286,11 +36946,23 @@ class PdfExport {
|
|
|
36286
36946
|
if (isNullOrUndefined(pdfExportProperties)) {
|
|
36287
36947
|
pdfExportProperties = {};
|
|
36288
36948
|
}
|
|
36289
|
-
if (pdfExportProperties.
|
|
36290
|
-
|
|
36949
|
+
if (pdfExportProperties.fitToWidthSettings && pdfExportProperties.fitToWidthSettings.isFitToWidth) {
|
|
36950
|
+
if (pdfExportProperties.exportType === 'CurrentViewData') {
|
|
36951
|
+
this.helper.beforeSinglePageExport['cloneFlatData'] = extend([], this.parent.currentViewData, null, true);
|
|
36952
|
+
}
|
|
36953
|
+
else {
|
|
36954
|
+
this.helper.beforeSinglePageExport['cloneFlatData'] = extend([], this.parent.flatData, null, true);
|
|
36955
|
+
}
|
|
36956
|
+
this.helper.beforeSinglePageExport['cloneCurrentViewData'] = extend([], this.parent.currentViewData, null, true);
|
|
36957
|
+
data = this.helper.beforeSinglePageExport['cloneFlatData'];
|
|
36291
36958
|
}
|
|
36292
36959
|
else {
|
|
36293
|
-
|
|
36960
|
+
if (pdfExportProperties.exportType === 'CurrentViewData') {
|
|
36961
|
+
data = this.parent.currentViewData;
|
|
36962
|
+
}
|
|
36963
|
+
else {
|
|
36964
|
+
data = this.parent.flatData;
|
|
36965
|
+
}
|
|
36294
36966
|
}
|
|
36295
36967
|
this.initGantt();
|
|
36296
36968
|
if (!isNullOrUndefined(pdfDoc)) {
|
|
@@ -36314,6 +36986,7 @@ class PdfExport {
|
|
|
36314
36986
|
const section = this.pdfDocument.sections.add();
|
|
36315
36987
|
this.processSectionExportProperties(section, pdfExportProperties);
|
|
36316
36988
|
const pdfPage = section.pages.add();
|
|
36989
|
+
this.pdfPageDimensions = pdfPage.getClientSize();
|
|
36317
36990
|
/* eslint-disable-next-line */
|
|
36318
36991
|
return new Promise((resolve, reject) => {
|
|
36319
36992
|
this.helper.processGridExport(data, this.gantt, pdfExportProperties);
|
|
@@ -36324,6 +36997,26 @@ class PdfExport {
|
|
|
36324
36997
|
format.break = PdfLayoutBreakType.FitElement;
|
|
36325
36998
|
const layouter = this.gantt.drawGrid(pdfPage, 0, 0, format);
|
|
36326
36999
|
this.gantt.drawChart(layouter);
|
|
37000
|
+
if (this.helper.exportProps && this.helper.exportProps.fitToWidthSettings && this.helper.exportProps.fitToWidthSettings.isFitToWidth) {
|
|
37001
|
+
this.parent.zoomingProjectStartDate = this.helper.beforeSinglePageExport['zoomingProjectStartDate'];
|
|
37002
|
+
this.parent.zoomingProjectEndDate = this.helper.beforeSinglePageExport['zoomingProjectEndDate'];
|
|
37003
|
+
this.parent.cloneProjectStartDate = this.helper.beforeSinglePageExport['cloneProjectStartDate'];
|
|
37004
|
+
this.parent.cloneProjectEndDate = this.helper.beforeSinglePageExport['cloneProjectEndDate'];
|
|
37005
|
+
this.parent.timelineModule.customTimelineSettings = this.helper.beforeSinglePageExport['customTimelineSettings'];
|
|
37006
|
+
this.parent.isTimelineRoundOff = this.helper.beforeSinglePageExport['isTimelineRoundOff'];
|
|
37007
|
+
this.parent.timelineModule.topTier = this.helper.beforeSinglePageExport['topTier'];
|
|
37008
|
+
this.parent.timelineModule.topTierCellWidth = this.helper.beforeSinglePageExport['topTierCellWidth'];
|
|
37009
|
+
this.parent.timelineModule.topTierCollection = this.helper.beforeSinglePageExport['topTierCollection'];
|
|
37010
|
+
this.parent.timelineModule.bottomTier = this.helper.beforeSinglePageExport['bottomTier'];
|
|
37011
|
+
this.parent.timelineModule.bottomTierCellWidth = this.helper.beforeSinglePageExport['bottomTierCellWidth'];
|
|
37012
|
+
this.parent.timelineModule.bottomTierCollection = this.helper.beforeSinglePageExport['bottomTierCollection'];
|
|
37013
|
+
this.parent.timelineModule.totalTimelineWidth = this.helper.beforeSinglePageExport['totalTimelineWidth'];
|
|
37014
|
+
this.parent.timelineModule.timelineStartDate = this.helper.beforeSinglePageExport['timelineStartDate'];
|
|
37015
|
+
this.parent.timelineModule.timelineEndDate = this.helper.beforeSinglePageExport['timelineEndDate'];
|
|
37016
|
+
this.parent.timelineModule.timelineRoundOffEndDate = this.helper.beforeSinglePageExport['timelineRoundOffEndDate'];
|
|
37017
|
+
this.parent.perDayWidth = this.helper.beforeSinglePageExport['perDayWidth'];
|
|
37018
|
+
this.parent.updatedConnectorLineCollection = this.helper.beforeSinglePageExport['updatedConnectorLineCollection'];
|
|
37019
|
+
}
|
|
36327
37020
|
if (!isMultipleExport) {
|
|
36328
37021
|
if (!this.isBlob) {
|
|
36329
37022
|
// save the PDF
|