@syncfusion/ej2-gantt 24.2.7 → 24.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/dist/ej2-gantt.min.js +2 -2
- package/dist/ej2-gantt.umd.min.js +2 -2
- package/dist/ej2-gantt.umd.min.js.map +1 -1
- package/dist/es6/ej2-gantt.es2015.js +216 -167
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +216 -167
- package/dist/es6/ej2-gantt.es5.js.map +1 -1
- package/dist/global/ej2-gantt.min.js +2 -2
- package/dist/global/ej2-gantt.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +14 -14
- package/src/gantt/actions/dependency.d.ts +23 -0
- package/src/gantt/actions/dependency.js +132 -6
- package/src/gantt/actions/edit.d.ts +1 -22
- package/src/gantt/actions/edit.js +14 -133
- package/src/gantt/actions/selection.js +8 -1
- package/src/gantt/actions/taskbar-edit.js +20 -4
- package/src/gantt/base/gantt.js +14 -1
- package/src/gantt/base/task-processor.js +16 -10
- package/src/gantt/export/pdf-taskbar.js +1 -1
- package/src/gantt/export/pdf-timeline.js +0 -6
- package/src/gantt/renderer/timeline.js +11 -5
- package/styles/bootstrap.css +3 -3
- package/styles/gantt/bootstrap.css +3 -3
|
@@ -2225,12 +2225,14 @@ class TaskProcessor extends DateProcessor {
|
|
|
2225
2225
|
work = parseFloat(work.toFixed(2));
|
|
2226
2226
|
}
|
|
2227
2227
|
}
|
|
2228
|
-
if (ganttData.childRecords
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2228
|
+
if (ganttData.childRecords) {
|
|
2229
|
+
if (ganttData.childRecords.length > 0 && this.parent.isOnEdit) {
|
|
2230
|
+
let childCompletedWorks = 0;
|
|
2231
|
+
for (let i = 0; i < ganttData.childRecords.length; i++) {
|
|
2232
|
+
childCompletedWorks += ganttData.childRecords[i].ganttProperties.work;
|
|
2233
|
+
}
|
|
2234
|
+
work += childCompletedWorks;
|
|
2232
2235
|
}
|
|
2233
|
-
work += childCompletedWorks;
|
|
2234
2236
|
}
|
|
2235
2237
|
this.parent.setRecordValue('work', work, ganttData.ganttProperties, true);
|
|
2236
2238
|
if (!isNullOrUndefined(this.parent.taskFields.work)) {
|
|
@@ -2445,7 +2447,7 @@ class TaskProcessor extends DateProcessor {
|
|
|
2445
2447
|
this.parent.setRecordValue('work', work, ganttProperties, true);
|
|
2446
2448
|
switch (tType) {
|
|
2447
2449
|
case 'FixedDuration':
|
|
2448
|
-
this.
|
|
2450
|
+
this.updateWorkWithDuration(ganttData);
|
|
2449
2451
|
break;
|
|
2450
2452
|
case 'FixedWork':
|
|
2451
2453
|
this.updateUnitWithWork(ganttData);
|
|
@@ -2860,14 +2862,18 @@ class TaskProcessor extends DateProcessor {
|
|
|
2860
2862
|
this.parent.ganttChartModule.scrollObject['isSetScrollLeft'])) && !isFromTimelineVirtulization) {
|
|
2861
2863
|
isValid = false;
|
|
2862
2864
|
}
|
|
2863
|
-
if (this.parent.enableTimelineVirtualization && isValid && !this.parent.timelineModule['performedTimeSpanAction']) {
|
|
2865
|
+
if (!this.parent.editModule && this.parent.enableTimelineVirtualization && isValid && !this.parent.timelineModule['performedTimeSpanAction']) {
|
|
2864
2866
|
leftValueForStartDate = (this.parent.enableTimelineVirtualization && this.parent.ganttChartModule.scrollObject.element.scrollLeft != 0)
|
|
2865
2867
|
? this.parent.ganttChartModule.scrollObject.getTimelineLeft() : null;
|
|
2866
2868
|
}
|
|
2867
|
-
const timelineStartDate = (this.parent.enableTimelineVirtualization && !isNullOrUndefined(leftValueForStartDate))
|
|
2869
|
+
const timelineStartDate = (!this.parent.editModule && this.parent.enableTimelineVirtualization && !isNullOrUndefined(leftValueForStartDate))
|
|
2868
2870
|
? new Date((this.parent.timelineModule['dateByLeftValue'](leftValueForStartDate)).toString()) : new Date(this.parent.timelineModule.timelineStartDate);
|
|
2869
2871
|
if (timelineStartDate) {
|
|
2870
|
-
|
|
2872
|
+
let leftValue = (date.getTime() - timelineStartDate.getTime()) / (1000 * 60 * 60 * 24) * this.parent.perDayWidth;
|
|
2873
|
+
if (this.parent.isInDst(timelineStartDate) && !this.parent.isInDst(startDate) && (this.parent.timelineModule.topTier == 'Hour' || this.parent.timelineModule.bottomTier == 'Hour')) {
|
|
2874
|
+
leftValue = leftValue - this.parent.timelineSettings.timelineUnitSize;
|
|
2875
|
+
}
|
|
2876
|
+
return leftValue;
|
|
2871
2877
|
}
|
|
2872
2878
|
else {
|
|
2873
2879
|
return 0;
|
|
@@ -3936,7 +3942,7 @@ class TaskProcessor extends DateProcessor {
|
|
|
3936
3942
|
let deleteUpdate = false;
|
|
3937
3943
|
const ganttProp = parentData.ganttProperties;
|
|
3938
3944
|
if (this.parent.autoCalculateDateScheduling || this.parent.viewType === "ResourceView") {
|
|
3939
|
-
if (parentData.childRecords.length > 0) {
|
|
3945
|
+
if (parentData.childRecords && parentData.childRecords.length > 0) {
|
|
3940
3946
|
const previousStartDate = ganttProp.isAutoSchedule ? ganttProp.startDate : ganttProp.autoStartDate;
|
|
3941
3947
|
const previousEndDate = ganttProp.isAutoSchedule ? ganttProp.endDate :
|
|
3942
3948
|
ganttProp.autoEndDate;
|
|
@@ -6327,17 +6333,23 @@ class Timeline {
|
|
|
6327
6333
|
this.parent.dateValidationModule.calculateProjectDates();
|
|
6328
6334
|
}
|
|
6329
6335
|
if (!isNullOrUndefined(this.parent.zoomingProjectStartDate)) {
|
|
6330
|
-
this.parent.cloneProjectStartDate = this.parent.
|
|
6331
|
-
|
|
6332
|
-
this.parent.cloneProjectEndDate = this.parent.cloneProjectEndDate.getTime() > this.parent.zoomingProjectEndDate.getTime()
|
|
6333
|
-
? this.parent.cloneProjectEndDate : this.parent.zoomingProjectEndDate;
|
|
6336
|
+
this.parent.cloneProjectStartDate = this.parent.zoomingProjectStartDate;
|
|
6337
|
+
this.parent.cloneProjectEndDate = this.parent.zoomingProjectEndDate;
|
|
6334
6338
|
}
|
|
6335
6339
|
this.parent.zoomingProjectStartDate = null;
|
|
6336
6340
|
this.parent.zoomingProjectEndDate = null;
|
|
6337
6341
|
const currentZoomingLevel = this.checkCurrentZoomingLevel();
|
|
6338
6342
|
this.isZoomIn = isZoomIn;
|
|
6339
6343
|
this.isZooming = true;
|
|
6340
|
-
let currentLevel
|
|
6344
|
+
let currentLevel;
|
|
6345
|
+
let level = isZoomIn ? currentZoomingLevel + 1 : currentZoomingLevel - 1;
|
|
6346
|
+
const foundLevel = this.parent.zoomingLevels.find(tempLevel => tempLevel.level === level);
|
|
6347
|
+
if (foundLevel) {
|
|
6348
|
+
currentLevel = level;
|
|
6349
|
+
}
|
|
6350
|
+
else {
|
|
6351
|
+
currentLevel = currentZoomingLevel;
|
|
6352
|
+
}
|
|
6341
6353
|
if (this.parent.toolbarModule) {
|
|
6342
6354
|
if (isZoomIn) {
|
|
6343
6355
|
if (currentLevel === this.parent.zoomingLevels[this.parent.zoomingLevels.length - 1].level) {
|
|
@@ -11587,6 +11599,7 @@ class Dependency {
|
|
|
11587
11599
|
this.parentIds = [];
|
|
11588
11600
|
this.parentPredecessors = [];
|
|
11589
11601
|
this.validatedParentIds = [];
|
|
11602
|
+
this.storeId = null;
|
|
11590
11603
|
this.parent = gantt;
|
|
11591
11604
|
this.dateValidateModule = this.parent.dateValidationModule;
|
|
11592
11605
|
}
|
|
@@ -12062,7 +12075,7 @@ class Dependency {
|
|
|
12062
12075
|
}
|
|
12063
12076
|
if (flatData[count].hasChildRecords && this.parent.editModule && !this.parent.allowUnscheduledTasks
|
|
12064
12077
|
&& this.parent.allowParentDependency) {
|
|
12065
|
-
this.
|
|
12078
|
+
this.updateChildItems(flatData[count]);
|
|
12066
12079
|
}
|
|
12067
12080
|
}
|
|
12068
12081
|
}
|
|
@@ -12074,7 +12087,7 @@ class Dependency {
|
|
|
12074
12087
|
let item = this.parentPredecessors[i];
|
|
12075
12088
|
this.validatePredecessorDates(item);
|
|
12076
12089
|
if (item.ganttProperties.startDate) {
|
|
12077
|
-
this.
|
|
12090
|
+
this.updateChildItems(item);
|
|
12078
12091
|
}
|
|
12079
12092
|
}
|
|
12080
12093
|
}
|
|
@@ -12451,7 +12464,15 @@ class Dependency {
|
|
|
12451
12464
|
continue;
|
|
12452
12465
|
}
|
|
12453
12466
|
if (record) {
|
|
12454
|
-
this.
|
|
12467
|
+
if (this.parent.editModule.isFirstCall) {
|
|
12468
|
+
this.storeId = JSON.parse(JSON.stringify(this.parent.ids));
|
|
12469
|
+
this.parent.editModule.isFirstCall = false;
|
|
12470
|
+
}
|
|
12471
|
+
let index = (this.storeId && this.storeId.indexOf(record[this.parent.taskFields.id].toString()) !== -1) ? this.storeId.indexOf(record[this.parent.taskFields.id].toString()) : -1;
|
|
12472
|
+
if (index !== -1) {
|
|
12473
|
+
this.storeId = this.storeId.slice(0, index).concat(this.storeId.slice(index + 1));
|
|
12474
|
+
this.validatePredecessor(record, undefined, 'successor');
|
|
12475
|
+
}
|
|
12455
12476
|
}
|
|
12456
12477
|
}
|
|
12457
12478
|
if (record && !record.hasChildRecords && record.parentItem && this.validatedParentIds.indexOf(record.parentItem.taskId) == -1) {
|
|
@@ -12466,13 +12487,13 @@ class Dependency {
|
|
|
12466
12487
|
if (record && record.ganttProperties.taskId !== this.isValidatedParentTaskID && ganttProp) {
|
|
12467
12488
|
if ((taskBarModule.taskBarEditAction !== 'ParentDrag' && taskBarModule.taskBarEditAction !== 'ChildDrag')) {
|
|
12468
12489
|
if (!ganttProp.hasChildRecords && record.hasChildRecords) {
|
|
12469
|
-
this.
|
|
12490
|
+
this.updateChildItems(record);
|
|
12470
12491
|
this.isValidatedParentTaskID = record.ganttProperties.taskId;
|
|
12471
12492
|
}
|
|
12472
12493
|
}
|
|
12473
12494
|
else if ((!record.hasChildRecords && taskBarModule.taskBarEditAction == 'ChildDrag') ||
|
|
12474
12495
|
(record.hasChildRecords && taskBarModule.taskBarEditAction == 'ParentDrag')) {
|
|
12475
|
-
this.
|
|
12496
|
+
this.updateChildItems(record);
|
|
12476
12497
|
this.isValidatedParentTaskID = record.ganttProperties.taskId;
|
|
12477
12498
|
}
|
|
12478
12499
|
if (!ganttProp.hasChildRecords) {
|
|
@@ -12480,11 +12501,128 @@ class Dependency {
|
|
|
12480
12501
|
}
|
|
12481
12502
|
}
|
|
12482
12503
|
else if (record && record.hasChildRecords && !ganttProp) {
|
|
12483
|
-
this.
|
|
12504
|
+
this.updateChildItems(record);
|
|
12505
|
+
}
|
|
12506
|
+
}
|
|
12507
|
+
}
|
|
12508
|
+
}
|
|
12509
|
+
/**
|
|
12510
|
+
*
|
|
12511
|
+
* @param {IGanttData} ganttRecord .
|
|
12512
|
+
* @returns {void} .
|
|
12513
|
+
*/
|
|
12514
|
+
updateChildItems(ganttRecord) {
|
|
12515
|
+
const previousData = this.parent.previousRecords[ganttRecord.uniqueID];
|
|
12516
|
+
let previousStartDate;
|
|
12517
|
+
if (isNullOrUndefined(previousData) ||
|
|
12518
|
+
(isNullOrUndefined(previousData) && !isNullOrUndefined(previousData.ganttProperties))) {
|
|
12519
|
+
previousStartDate = new Date(ganttRecord.ganttProperties.startDate.getTime());
|
|
12520
|
+
}
|
|
12521
|
+
else {
|
|
12522
|
+
if (!isNullOrUndefined(previousData.ganttProperties.startDate)) {
|
|
12523
|
+
previousStartDate = new Date(previousData.ganttProperties.startDate.getTime());
|
|
12524
|
+
}
|
|
12525
|
+
}
|
|
12526
|
+
const currentStartDate = ganttRecord.ganttProperties.startDate;
|
|
12527
|
+
const childRecords = [];
|
|
12528
|
+
let validStartDate;
|
|
12529
|
+
let validEndDate;
|
|
12530
|
+
let calcEndDate;
|
|
12531
|
+
let isRightMove;
|
|
12532
|
+
let durationDiff;
|
|
12533
|
+
this.getUpdatableChildRecords(ganttRecord, childRecords);
|
|
12534
|
+
if (childRecords.length === 0) {
|
|
12535
|
+
return;
|
|
12536
|
+
}
|
|
12537
|
+
if (!isNullOrUndefined(previousStartDate) && !isNullOrUndefined(currentStartDate) && previousStartDate.getTime() > currentStartDate.getTime()) {
|
|
12538
|
+
validStartDate = this.parent.dateValidationModule.checkStartDate(currentStartDate);
|
|
12539
|
+
validEndDate = this.parent.dateValidationModule.checkEndDate(previousStartDate, ganttRecord.ganttProperties);
|
|
12540
|
+
isRightMove = false;
|
|
12541
|
+
}
|
|
12542
|
+
else {
|
|
12543
|
+
validStartDate = this.parent.dateValidationModule.checkStartDate(previousStartDate);
|
|
12544
|
+
validEndDate = this.parent.dateValidationModule.checkEndDate(currentStartDate, ganttRecord.ganttProperties);
|
|
12545
|
+
isRightMove = true;
|
|
12546
|
+
}
|
|
12547
|
+
//Get Duration
|
|
12548
|
+
if (!isNullOrUndefined(validStartDate) && !isNullOrUndefined(validEndDate) && validStartDate.getTime() >= validEndDate.getTime()) {
|
|
12549
|
+
durationDiff = 0;
|
|
12550
|
+
}
|
|
12551
|
+
else {
|
|
12552
|
+
durationDiff = this.parent.dateValidationModule.getDuration(validStartDate, validEndDate, 'minute', true, false);
|
|
12553
|
+
}
|
|
12554
|
+
for (let i = 0; i < childRecords.length; i++) {
|
|
12555
|
+
if (childRecords[i].ganttProperties.isAutoSchedule) {
|
|
12556
|
+
if (durationDiff > 0) {
|
|
12557
|
+
const startDate = isScheduledTask(childRecords[i].ganttProperties) ?
|
|
12558
|
+
childRecords[i].ganttProperties.startDate : childRecords[i].ganttProperties.startDate ?
|
|
12559
|
+
childRecords[i].ganttProperties.startDate : childRecords[i].ganttProperties.endDate ?
|
|
12560
|
+
childRecords[i].ganttProperties.endDate : new Date(previousStartDate.toString());
|
|
12561
|
+
if (isRightMove) {
|
|
12562
|
+
calcEndDate = this.parent.dateValidationModule.getEndDate(this.parent.dateValidationModule.checkStartDate(startDate, childRecords[i].ganttProperties, childRecords[i].ganttProperties.isMilestone), durationDiff, 'minute', childRecords[i].ganttProperties, false);
|
|
12563
|
+
}
|
|
12564
|
+
else {
|
|
12565
|
+
calcEndDate = this.parent.dateValidationModule.getStartDate(this.parent.dateValidationModule.checkEndDate(startDate, childRecords[i].ganttProperties), durationDiff, 'minute', childRecords[i].ganttProperties);
|
|
12566
|
+
}
|
|
12567
|
+
this.calculateDateByRoundOffDuration(childRecords[i], calcEndDate);
|
|
12568
|
+
if (this.parent.isOnEdit && this.validatedChildItems.indexOf(childRecords[i]) === -1) {
|
|
12569
|
+
this.validatedChildItems.push(childRecords[i]);
|
|
12570
|
+
}
|
|
12571
|
+
}
|
|
12572
|
+
else if (isNullOrUndefined(previousData)) {
|
|
12573
|
+
calcEndDate = previousStartDate;
|
|
12574
|
+
this.calculateDateByRoundOffDuration(childRecords[i], calcEndDate);
|
|
12575
|
+
if (this.parent.isOnEdit && this.validatedChildItems.indexOf(childRecords[i]) === -1) {
|
|
12576
|
+
this.validatedChildItems.push(childRecords[i]);
|
|
12577
|
+
}
|
|
12578
|
+
}
|
|
12579
|
+
}
|
|
12580
|
+
}
|
|
12581
|
+
if (childRecords.length) {
|
|
12582
|
+
this.parent.dataOperation.updateParentItems(ganttRecord, true);
|
|
12583
|
+
}
|
|
12584
|
+
}
|
|
12585
|
+
/**
|
|
12586
|
+
* To get updated child records.
|
|
12587
|
+
*
|
|
12588
|
+
* @param {IGanttData} parentRecord .
|
|
12589
|
+
* @param {IGanttData} childLists .
|
|
12590
|
+
* @returns {void} .
|
|
12591
|
+
*/
|
|
12592
|
+
getUpdatableChildRecords(parentRecord, childLists) {
|
|
12593
|
+
const childRecords = parentRecord.childRecords;
|
|
12594
|
+
for (let i = 0; i < childRecords.length; i++) {
|
|
12595
|
+
if (childRecords[i].ganttProperties.isAutoSchedule) {
|
|
12596
|
+
childLists.push(childRecords[i]);
|
|
12597
|
+
if (childRecords[i].hasChildRecords) {
|
|
12598
|
+
this.getUpdatableChildRecords(childRecords[i], childLists);
|
|
12484
12599
|
}
|
|
12485
12600
|
}
|
|
12486
12601
|
}
|
|
12487
12602
|
}
|
|
12603
|
+
/**
|
|
12604
|
+
*
|
|
12605
|
+
* @param {IGanttData} data .
|
|
12606
|
+
* @param {Date} newStartDate .
|
|
12607
|
+
* @returns {void} .
|
|
12608
|
+
*/
|
|
12609
|
+
calculateDateByRoundOffDuration(data, newStartDate) {
|
|
12610
|
+
const ganttRecord = data;
|
|
12611
|
+
const taskData = ganttRecord.ganttProperties;
|
|
12612
|
+
const projectStartDate = new Date(newStartDate.getTime());
|
|
12613
|
+
if (!isNullOrUndefined(taskData.endDate) && isNullOrUndefined(taskData.startDate)) {
|
|
12614
|
+
const endDate = this.parent.dateValidationModule.checkStartDate(projectStartDate, taskData, null);
|
|
12615
|
+
this.parent.setRecordValue('endDate', this.parent.dateValidationModule.checkEndDate(endDate, ganttRecord.ganttProperties), taskData, true);
|
|
12616
|
+
}
|
|
12617
|
+
else {
|
|
12618
|
+
this.parent.setRecordValue('startDate', this.parent.dateValidationModule.checkStartDate(projectStartDate, taskData, false), taskData, true);
|
|
12619
|
+
if (!isNullOrUndefined(taskData.duration)) {
|
|
12620
|
+
this.parent.dateValidationModule.calculateEndDate(ganttRecord);
|
|
12621
|
+
}
|
|
12622
|
+
}
|
|
12623
|
+
this.parent.dataOperation.updateWidthLeft(data);
|
|
12624
|
+
this.parent.dataOperation.updateTaskData(ganttRecord);
|
|
12625
|
+
}
|
|
12488
12626
|
/**
|
|
12489
12627
|
* Method to get validate able predecessor alone from record
|
|
12490
12628
|
*
|
|
@@ -16012,7 +16150,7 @@ let Gantt = class Gantt extends Component {
|
|
|
16012
16150
|
this.treeGridModule.treeGridColumns = [];
|
|
16013
16151
|
this.treeGridModule.validateGanttColumns();
|
|
16014
16152
|
this.treeGrid.columns = this.treeGridModule.treeGridColumns;
|
|
16015
|
-
this.treeGrid.
|
|
16153
|
+
this.treeGrid.refreshColumns();
|
|
16016
16154
|
this.chartRowsModule.initiateTemplates();
|
|
16017
16155
|
this.timelineModule.updateChartByNewTimeline();
|
|
16018
16156
|
break;
|
|
@@ -17059,6 +17197,19 @@ let Gantt = class Gantt extends Component {
|
|
|
17059
17197
|
const tempSplitterSettings = {};
|
|
17060
17198
|
tempSplitterSettings[type] = value;
|
|
17061
17199
|
const splitterPosition = this.splitterModule.calculateSplitterPosition(tempSplitterSettings);
|
|
17200
|
+
switch (type) {
|
|
17201
|
+
case 'view':
|
|
17202
|
+
this.splitterSettings.view = tempSplitterSettings[type];
|
|
17203
|
+
break;
|
|
17204
|
+
case 'columnIndex':
|
|
17205
|
+
this.splitterSettings.columnIndex = tempSplitterSettings[type];
|
|
17206
|
+
break;
|
|
17207
|
+
case 'position':
|
|
17208
|
+
this.splitterSettings.position = tempSplitterSettings[type];
|
|
17209
|
+
break;
|
|
17210
|
+
default:
|
|
17211
|
+
break;
|
|
17212
|
+
}
|
|
17062
17213
|
const pane1 = this.splitterModule.splitterObject.element.querySelectorAll('.e-pane')[0];
|
|
17063
17214
|
const pane2 = this.splitterModule.splitterObject.element.querySelectorAll('.e-pane')[1];
|
|
17064
17215
|
this.splitterModule.splitterPreviousPositionGrid = pane1.scrollWidth + 1 + 'px';
|
|
@@ -19895,7 +20046,12 @@ class TaskbarEdit extends DateProcessor {
|
|
|
19895
20046
|
event.preventDefault();
|
|
19896
20047
|
if (!isNullOrUndefined(this.taskbarElement) && !isNullOrUndefined(this.editElement) && (this.taskBarEditAction !== "ConnectorPointRightDrag" && this.taskBarEditAction !== "ConnectorPointLeftDrag") && !(this.parent.viewType === 'ResourceView' && this.currentData.hasChildRecords)) {
|
|
19897
20048
|
const currentElement = this.editElement.parentElement;
|
|
19898
|
-
|
|
20049
|
+
if (this.parent.enableTimelineVirtualization && this.parent.timelineModule.wholeTimelineWidth > this.parent.element.offsetWidth * 3) {
|
|
20050
|
+
currentElement.style.setProperty("position", "relative");
|
|
20051
|
+
}
|
|
20052
|
+
else {
|
|
20053
|
+
currentElement.style.setProperty("position", "absolute");
|
|
20054
|
+
}
|
|
19899
20055
|
if ((this.taskBarEditAction === 'ChildDrag' || this.taskBarEditAction === 'LeftResizing') && !isNullOrUndefined(this.currentIndex) && !isNullOrUndefined(this.currentIndex) ? Number(this.currentIndex) === 0 : false) {
|
|
19900
20056
|
this.taskbarElement.childNodes[0].childNodes[0].style.setProperty("top", currentElement.parentElement.offsetTop + "px");
|
|
19901
20057
|
if (this.parent.allowTaskbarDragAndDrop && this.taskBarEditAction !== 'LeftResizing' && this.taskBarEditAction !== 'RightResizing' && this.taskBarEditAction !== 'ProgressResizing') {
|
|
@@ -19914,8 +20070,14 @@ class TaskbarEdit extends DateProcessor {
|
|
|
19914
20070
|
}
|
|
19915
20071
|
}
|
|
19916
20072
|
if (this.taskBarEditAction !== 'ProgressResizing') {
|
|
19917
|
-
|
|
19918
|
-
|
|
20073
|
+
if (this.parent.enableTimelineVirtualization && this.parent.timelineModule.wholeTimelineWidth > this.parent.element.offsetWidth * 3) {
|
|
20074
|
+
var rootElement = this.parent.ganttChartModule.chartBodyContainer.querySelectorAll(".e-chart-scroll-container");
|
|
20075
|
+
rootElement[0].appendChild(this.taskbarResizer);
|
|
20076
|
+
}
|
|
20077
|
+
else {
|
|
20078
|
+
var rootElement = this.parent.ganttChartModule.chartBodyContainer.querySelectorAll(".e-chart-rows-container");
|
|
20079
|
+
rootElement[0].appendChild(this.taskbarResizer);
|
|
20080
|
+
}
|
|
19919
20081
|
}
|
|
19920
20082
|
}
|
|
19921
20083
|
if (this.parent.allowTaskbarDragAndDrop && (this.taskBarEditAction === "ChildDrag" || this.taskBarEditAction === "ParentDrag" ||
|
|
@@ -21040,7 +21202,12 @@ class TaskbarEdit extends DateProcessor {
|
|
|
21040
21202
|
currentElement.style.position = null;
|
|
21041
21203
|
}
|
|
21042
21204
|
else {
|
|
21043
|
-
|
|
21205
|
+
if (this.parent.enableTimelineVirtualization && this.parent.timelineModule.wholeTimelineWidth > this.parent.element.offsetWidth * 3) {
|
|
21206
|
+
currentElement.style.setProperty("position", "relative");
|
|
21207
|
+
}
|
|
21208
|
+
else {
|
|
21209
|
+
currentElement.style.setProperty("position", "absolute");
|
|
21210
|
+
}
|
|
21044
21211
|
}
|
|
21045
21212
|
}
|
|
21046
21213
|
const item = this.taskBarEditRecord.ganttProperties;
|
|
@@ -25683,7 +25850,7 @@ class Edit$2 {
|
|
|
25683
25850
|
*/
|
|
25684
25851
|
this.deletedTaskDetails = [];
|
|
25685
25852
|
this.parent = parent;
|
|
25686
|
-
this.validatedChildItems = [];
|
|
25853
|
+
this.parent.predecessorModule.validatedChildItems = [];
|
|
25687
25854
|
if (this.parent.editSettings.allowEditing && this.parent.editSettings.mode === 'Auto') {
|
|
25688
25855
|
this.cellEditModule = new CellEdit(this.parent);
|
|
25689
25856
|
}
|
|
@@ -26518,8 +26685,8 @@ class Edit$2 {
|
|
|
26518
26685
|
}
|
|
26519
26686
|
if (this.parent.isConnectorLineUpdate && this.parent.autoCalculateDateScheduling) {
|
|
26520
26687
|
/* validating predecessor for updated child items */
|
|
26521
|
-
for (let i = 0; i < this.validatedChildItems.length; i++) {
|
|
26522
|
-
const child = this.validatedChildItems[i];
|
|
26688
|
+
for (let i = 0; i < this.parent.predecessorModule.validatedChildItems.length; i++) {
|
|
26689
|
+
const child = this.parent.predecessorModule.validatedChildItems[i];
|
|
26523
26690
|
if (child.ganttProperties.predecessor && child.ganttProperties.predecessor.length > 0) {
|
|
26524
26691
|
this.parent.editedTaskBarItem = child;
|
|
26525
26692
|
this.parent.predecessorModule.validatePredecessor(child, [], '');
|
|
@@ -26533,6 +26700,7 @@ class Edit$2 {
|
|
|
26533
26700
|
this.parent.editedTaskBarItem = ganttRecord;
|
|
26534
26701
|
}
|
|
26535
26702
|
if (!this.isValidatedEditedRecord) {
|
|
26703
|
+
this.isFirstCall = true;
|
|
26536
26704
|
this.parent.predecessorModule.validatePredecessor(ganttRecord, [], '');
|
|
26537
26705
|
}
|
|
26538
26706
|
this.isValidatedEditedRecord = false;
|
|
@@ -26540,7 +26708,7 @@ class Edit$2 {
|
|
|
26540
26708
|
}
|
|
26541
26709
|
if (this.parent.allowParentDependency && ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
|
|
26542
26710
|
(args.action === "DrawConnectorLine")) {
|
|
26543
|
-
this.updateChildItems(ganttRecord);
|
|
26711
|
+
this.parent.predecessorModule['updateChildItems'](ganttRecord);
|
|
26544
26712
|
}
|
|
26545
26713
|
this.updateParentItemOnEditing();
|
|
26546
26714
|
this.parent.dataOperation.updateParentItems(ganttRecord, true);
|
|
@@ -26553,6 +26721,7 @@ class Edit$2 {
|
|
|
26553
26721
|
let parentData = this.parent.getRecordByID(ganttRecord.parentItem.taskId);
|
|
26554
26722
|
if (!isNullOrUndefined(parentData)) {
|
|
26555
26723
|
if (!parentData.ganttProperties.predecessorsName) {
|
|
26724
|
+
this.isFirstCall = true;
|
|
26556
26725
|
this.parent.predecessorModule.validatePredecessor(parentData, [], '');
|
|
26557
26726
|
this.updateParentItemOnEditing();
|
|
26558
26727
|
this.parent.ganttChartModule.reRenderConnectorLines();
|
|
@@ -26583,7 +26752,7 @@ class Edit$2 {
|
|
|
26583
26752
|
updateParentChildRecord(data) {
|
|
26584
26753
|
const ganttRecord = data;
|
|
26585
26754
|
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)) {
|
|
26586
|
-
this.updateChildItems(ganttRecord);
|
|
26755
|
+
this.parent.predecessorModule['updateChildItems'](ganttRecord);
|
|
26587
26756
|
}
|
|
26588
26757
|
if (!isNullOrUndefined(this.parent.editModule.cellEditModule)) {
|
|
26589
26758
|
this.parent.editModule.cellEditModule.isResourceCellEdited = false;
|
|
@@ -26628,29 +26797,6 @@ class Edit$2 {
|
|
|
26628
26797
|
this.parent.dataOperation.updateWidthLeft(data);
|
|
26629
26798
|
}
|
|
26630
26799
|
}
|
|
26631
|
-
/**
|
|
26632
|
-
*
|
|
26633
|
-
* @param {IGanttData} data .
|
|
26634
|
-
* @param {Date} newStartDate .
|
|
26635
|
-
* @returns {void} .
|
|
26636
|
-
*/
|
|
26637
|
-
calculateDateByRoundOffDuration(data, newStartDate) {
|
|
26638
|
-
const ganttRecord = data;
|
|
26639
|
-
const taskData = ganttRecord.ganttProperties;
|
|
26640
|
-
const projectStartDate = new Date(newStartDate.getTime());
|
|
26641
|
-
if (!isNullOrUndefined(taskData.endDate) && isNullOrUndefined(taskData.startDate)) {
|
|
26642
|
-
const endDate = this.parent.dateValidationModule.checkStartDate(projectStartDate, taskData, null);
|
|
26643
|
-
this.parent.setRecordValue('endDate', this.parent.dateValidationModule.checkEndDate(endDate, ganttRecord.ganttProperties), taskData, true);
|
|
26644
|
-
}
|
|
26645
|
-
else {
|
|
26646
|
-
this.parent.setRecordValue('startDate', this.parent.dateValidationModule.checkStartDate(projectStartDate, taskData, false), taskData, true);
|
|
26647
|
-
if (!isNullOrUndefined(taskData.duration)) {
|
|
26648
|
-
this.parent.dateValidationModule.calculateEndDate(ganttRecord);
|
|
26649
|
-
}
|
|
26650
|
-
}
|
|
26651
|
-
this.parent.dataOperation.updateWidthLeft(data);
|
|
26652
|
-
this.parent.dataOperation.updateTaskData(ganttRecord);
|
|
26653
|
-
}
|
|
26654
26800
|
/**
|
|
26655
26801
|
* To update progress value of parent tasks
|
|
26656
26802
|
*
|
|
@@ -26760,106 +26906,6 @@ class Edit$2 {
|
|
|
26760
26906
|
updateScheduleDatesOnEditing(args) {
|
|
26761
26907
|
//..
|
|
26762
26908
|
}
|
|
26763
|
-
/**
|
|
26764
|
-
*
|
|
26765
|
-
* @param {IGanttData} ganttRecord .
|
|
26766
|
-
* @returns {void} .
|
|
26767
|
-
*/
|
|
26768
|
-
updateChildItems(ganttRecord) {
|
|
26769
|
-
const previousData = this.parent.previousRecords[ganttRecord.uniqueID];
|
|
26770
|
-
let previousStartDate;
|
|
26771
|
-
if (isNullOrUndefined(previousData) ||
|
|
26772
|
-
(isNullOrUndefined(previousData) && !isNullOrUndefined(previousData.ganttProperties))) {
|
|
26773
|
-
previousStartDate = new Date(ganttRecord.ganttProperties.startDate.getTime());
|
|
26774
|
-
}
|
|
26775
|
-
else {
|
|
26776
|
-
if (!isNullOrUndefined(previousData.ganttProperties.startDate)) {
|
|
26777
|
-
previousStartDate = new Date(previousData.ganttProperties.startDate.getTime());
|
|
26778
|
-
}
|
|
26779
|
-
}
|
|
26780
|
-
const currentStartDate = ganttRecord.ganttProperties.startDate;
|
|
26781
|
-
const childRecords = [];
|
|
26782
|
-
let validStartDate;
|
|
26783
|
-
let validEndDate;
|
|
26784
|
-
let calcEndDate;
|
|
26785
|
-
let isRightMove;
|
|
26786
|
-
let durationDiff;
|
|
26787
|
-
this.getUpdatableChildRecords(ganttRecord, childRecords);
|
|
26788
|
-
if (childRecords.length === 0) {
|
|
26789
|
-
return;
|
|
26790
|
-
}
|
|
26791
|
-
if (!isNullOrUndefined(previousStartDate) && !isNullOrUndefined(currentStartDate) && previousStartDate.getTime() > currentStartDate.getTime()) {
|
|
26792
|
-
validStartDate = this.parent.dateValidationModule.checkStartDate(currentStartDate);
|
|
26793
|
-
validEndDate = this.parent.dateValidationModule.checkEndDate(previousStartDate, ganttRecord.ganttProperties);
|
|
26794
|
-
isRightMove = false;
|
|
26795
|
-
}
|
|
26796
|
-
else {
|
|
26797
|
-
validStartDate = this.parent.dateValidationModule.checkStartDate(previousStartDate);
|
|
26798
|
-
validEndDate = this.parent.dateValidationModule.checkEndDate(currentStartDate, ganttRecord.ganttProperties);
|
|
26799
|
-
isRightMove = true;
|
|
26800
|
-
}
|
|
26801
|
-
//Get Duration
|
|
26802
|
-
if (!isNullOrUndefined(validStartDate) && !isNullOrUndefined(validEndDate) && validStartDate.getTime() >= validEndDate.getTime()) {
|
|
26803
|
-
durationDiff = 0;
|
|
26804
|
-
}
|
|
26805
|
-
else {
|
|
26806
|
-
durationDiff = this.parent.dateValidationModule.getDuration(validStartDate, validEndDate, 'minute', true, false);
|
|
26807
|
-
}
|
|
26808
|
-
for (let i = 0; i < childRecords.length; i++) {
|
|
26809
|
-
if (childRecords[i].ganttProperties.isAutoSchedule) {
|
|
26810
|
-
if (durationDiff > 0) {
|
|
26811
|
-
const startDate = isScheduledTask(childRecords[i].ganttProperties) ?
|
|
26812
|
-
childRecords[i].ganttProperties.startDate : childRecords[i].ganttProperties.startDate ?
|
|
26813
|
-
childRecords[i].ganttProperties.startDate : childRecords[i].ganttProperties.endDate ?
|
|
26814
|
-
childRecords[i].ganttProperties.endDate : new Date(previousStartDate.toString());
|
|
26815
|
-
if (isRightMove) {
|
|
26816
|
-
calcEndDate = this.parent.dateValidationModule.getEndDate(this.parent.dateValidationModule.checkStartDate(startDate, childRecords[i].ganttProperties, childRecords[i].ganttProperties.isMilestone), durationDiff, 'minute', childRecords[i].ganttProperties, false);
|
|
26817
|
-
}
|
|
26818
|
-
else {
|
|
26819
|
-
calcEndDate = this.parent.dateValidationModule.getStartDate(this.parent.dateValidationModule.checkEndDate(startDate, childRecords[i].ganttProperties), durationDiff, 'minute', childRecords[i].ganttProperties);
|
|
26820
|
-
}
|
|
26821
|
-
this.calculateDateByRoundOffDuration(childRecords[i], calcEndDate);
|
|
26822
|
-
if (this.parent.isOnEdit && this.validatedChildItems.indexOf(childRecords[i]) === -1) {
|
|
26823
|
-
this.validatedChildItems.push(childRecords[i]);
|
|
26824
|
-
}
|
|
26825
|
-
}
|
|
26826
|
-
else if (isNullOrUndefined(previousData)) {
|
|
26827
|
-
calcEndDate = previousStartDate;
|
|
26828
|
-
const initialData = this.parent.initialLoadData[childRecords[i].index];
|
|
26829
|
-
if (this.parent.isLoad) {
|
|
26830
|
-
this.calculateDateByRoundOffDuration(initialData, calcEndDate);
|
|
26831
|
-
}
|
|
26832
|
-
else {
|
|
26833
|
-
this.calculateDateByRoundOffDuration(childRecords[i], calcEndDate);
|
|
26834
|
-
}
|
|
26835
|
-
if (this.parent.isOnEdit && this.validatedChildItems.indexOf(childRecords[i]) === -1) {
|
|
26836
|
-
this.validatedChildItems.push(childRecords[i]);
|
|
26837
|
-
}
|
|
26838
|
-
}
|
|
26839
|
-
}
|
|
26840
|
-
}
|
|
26841
|
-
if (childRecords.length) {
|
|
26842
|
-
this.parent.dataOperation.updateParentItems(ganttRecord, true);
|
|
26843
|
-
}
|
|
26844
|
-
}
|
|
26845
|
-
/**
|
|
26846
|
-
* To get updated child records.
|
|
26847
|
-
*
|
|
26848
|
-
* @param {IGanttData} parentRecord .
|
|
26849
|
-
* @param {IGanttData} childLists .
|
|
26850
|
-
* @returns {void} .
|
|
26851
|
-
*/
|
|
26852
|
-
getUpdatableChildRecords(parentRecord, childLists) {
|
|
26853
|
-
const childRecords = parentRecord.childRecords;
|
|
26854
|
-
for (let i = 0; i < childRecords.length; i++) {
|
|
26855
|
-
if (childRecords[i].ganttProperties.isAutoSchedule) {
|
|
26856
|
-
childLists.push(childRecords[i]);
|
|
26857
|
-
if (childRecords[i].hasChildRecords) {
|
|
26858
|
-
this.getUpdatableChildRecords(childRecords[i], childLists);
|
|
26859
|
-
}
|
|
26860
|
-
}
|
|
26861
|
-
}
|
|
26862
|
-
}
|
|
26863
26909
|
/**
|
|
26864
26910
|
* @param {ITaskbarEditedEventArgs} args .
|
|
26865
26911
|
* @returns {void} .
|
|
@@ -27371,7 +27417,7 @@ class Edit$2 {
|
|
|
27371
27417
|
this.resetValidateArgs();
|
|
27372
27418
|
this.parent.editedTaskBarItem = null;
|
|
27373
27419
|
this.parent.isOnEdit = false;
|
|
27374
|
-
this.validatedChildItems = [];
|
|
27420
|
+
this.parent.predecessorModule.validatedChildItems = [];
|
|
27375
27421
|
this.parent.isConnectorLineUpdate = false;
|
|
27376
27422
|
this.parent.editedTaskBarItem = null;
|
|
27377
27423
|
this.taskbarMoved = false;
|
|
@@ -28207,7 +28253,7 @@ class Edit$2 {
|
|
|
28207
28253
|
const fromRecord = this.parent.getRecordByID(predecessorCollection[count].from);
|
|
28208
28254
|
const toRecord = this.parent.getRecordByID(predecessorCollection[count].to);
|
|
28209
28255
|
validPredecessor = this.parent.connectorLineEditModule.validateParentPredecessor(fromRecord, toRecord);
|
|
28210
|
-
if (!validPredecessor) {
|
|
28256
|
+
if (!validPredecessor || !this.parent.allowParentDependency) {
|
|
28211
28257
|
if (predecessorCollection[count].to === parentRecordTaskData.rowUniqueID.toString()) {
|
|
28212
28258
|
childRecord = this.parent.getRecordByID(predecessorCollection[count].from);
|
|
28213
28259
|
predecessorIndex = getIndex(predecessorCollection[count], 'from', childRecord.ganttProperties.predecessor, 'to');
|
|
@@ -28233,7 +28279,7 @@ class Edit$2 {
|
|
|
28233
28279
|
}
|
|
28234
28280
|
}
|
|
28235
28281
|
}
|
|
28236
|
-
if (!validPredecessor) {
|
|
28282
|
+
if (!validPredecessor || !this.parent.allowParentDependency) {
|
|
28237
28283
|
this.parent.setRecordValue('predecessor', updatedPredecessor, parentRecord.ganttProperties, true);
|
|
28238
28284
|
this.parent.setRecordValue('predecessorsName', '', parentRecord.ganttProperties, true);
|
|
28239
28285
|
}
|
|
@@ -28475,14 +28521,15 @@ class Edit$2 {
|
|
|
28475
28521
|
}
|
|
28476
28522
|
for (let i = 0; i < this.parent.modifiedRecords.length; i++) {
|
|
28477
28523
|
const originalData = this.parent.modifiedRecords[i];
|
|
28478
|
-
let treeIndex = this.parent.allowRowDragAndDrop ? 1 : 0;
|
|
28524
|
+
let treeIndex = this.parent.rowDragAndDropModule && this.parent.allowRowDragAndDrop ? 1 : 0;
|
|
28479
28525
|
const uniqueTaskID = this.parent.taskFields.id;
|
|
28480
28526
|
let originalIndex = this.parent.currentViewData.findIndex((data) => {
|
|
28481
28527
|
return (data[uniqueTaskID] === originalData[uniqueTaskID]);
|
|
28482
28528
|
});
|
|
28483
28529
|
if (this.parent.treeGrid.getRows()[originalIndex]) {
|
|
28530
|
+
const row = this.parent.treeGrid.grid.getRowObjectFromUID(this.parent.treeGrid.grid.getDataRows()[originalIndex].getAttribute('data-uid'));
|
|
28484
28531
|
this.parent.treeGrid.renderModule.cellRender({
|
|
28485
|
-
data:
|
|
28532
|
+
data: row.data, cell: this.parent.treeGrid.getRows()[originalIndex].cells[this.parent.treeColumnIndex + treeIndex],
|
|
28486
28533
|
column: this.parent.treeGrid.grid.getColumns()[this.parent.treeColumnIndex],
|
|
28487
28534
|
requestType: 'rowDragAndDrop'
|
|
28488
28535
|
});
|
|
@@ -29260,6 +29307,7 @@ class Edit$2 {
|
|
|
29260
29307
|
for (let k = 0; k < this.updateParentRecords.length; k++) {
|
|
29261
29308
|
this.parent.dataOperation.updateParentItems(this.updateParentRecords[k]);
|
|
29262
29309
|
}
|
|
29310
|
+
this.isFirstCall = true;
|
|
29263
29311
|
this.parent.editedRecords.forEach(record => {
|
|
29264
29312
|
this.parent.predecessorModule.validatePredecessor(record, [], '');
|
|
29265
29313
|
});
|
|
@@ -30302,7 +30350,14 @@ class Selection$1 {
|
|
|
30302
30350
|
if (this.parent.enableTimelineVirtualization) {
|
|
30303
30351
|
this.parent['isRowSelected'] = true;
|
|
30304
30352
|
}
|
|
30305
|
-
|
|
30353
|
+
if (args.data && !isNullOrUndefined(args.data['length'])) {
|
|
30354
|
+
for (let i = 0; i < args.data['length']; i++) {
|
|
30355
|
+
this.parent.ganttChartModule.updateScrollLeft(args.data[i].ganttProperties.left);
|
|
30356
|
+
}
|
|
30357
|
+
}
|
|
30358
|
+
else {
|
|
30359
|
+
this.parent.ganttChartModule.updateScrollLeft(getValue('data.ganttProperties.left', args));
|
|
30360
|
+
}
|
|
30306
30361
|
}
|
|
30307
30362
|
args.target = this.actualTarget;
|
|
30308
30363
|
if (!isNullOrUndefined(args.foreignKeyData) && Object.keys(args.foreignKeyData).length === 0) {
|
|
@@ -37631,7 +37686,7 @@ class PdfGanttTaskbarCollection {
|
|
|
37631
37686
|
progressFormat.alignment = PdfTextAlignment.Right;
|
|
37632
37687
|
let isLabelString = false;
|
|
37633
37688
|
let updatedWidth;
|
|
37634
|
-
if (!isNullOrUndefined(this.taskLabel) && (/^[a-zA-
|
|
37689
|
+
if (!isNullOrUndefined(this.taskLabel) && (/^[a-zA-Z0-9]/.test(this.taskLabel))) {
|
|
37635
37690
|
isLabelString = true;
|
|
37636
37691
|
progressFormat.alignment = PdfTextAlignment.Left;
|
|
37637
37692
|
}
|
|
@@ -38794,12 +38849,6 @@ class PdfTimeline {
|
|
|
38794
38849
|
}
|
|
38795
38850
|
//Secondary header Event Arguments
|
|
38796
38851
|
/* eslint-disable-next-line */
|
|
38797
|
-
if (!this.parent.pdfExportModule.gantt.taskbar.isAutoFit() && this.parent.timelineModule.bottomTier !== "Day") {
|
|
38798
|
-
var unit = this.parent.perDayWidth;
|
|
38799
|
-
if (width < unit || (width > unit)) {
|
|
38800
|
-
width = unit;
|
|
38801
|
-
}
|
|
38802
|
-
}
|
|
38803
38852
|
this.triggerQueryTimelinecell(page, this.bottomTierPoint.x, this.bottomTierPoint.y, this.bottomTierHeight, width, secondHeader.value, false, secondHeader.startDate);
|
|
38804
38853
|
this.bottomTierPoint.x = (this.parent.pdfExportModule.gantt.taskbar.isAutoFit()) ? this.bottomTierPoint.x + width : this.bottomTierPoint.x + pixelToPoint(width);
|
|
38805
38854
|
remainWidth -= width;
|