@syncfusion/ej2-gantt 24.2.7 → 24.2.8
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 +18 -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 +200 -154
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +200 -154
- 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 +13 -13
- 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 +9 -129
- 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 +15 -9
- package/src/gantt/renderer/timeline.js +2 -4
- package/styles/bootstrap.css +3 -3
- package/styles/gantt/bootstrap.css +3 -3
|
@@ -2263,12 +2263,14 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
|
|
|
2263
2263
|
work = parseFloat(work.toFixed(2));
|
|
2264
2264
|
}
|
|
2265
2265
|
}
|
|
2266
|
-
if (ganttData.childRecords
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2266
|
+
if (ganttData.childRecords) {
|
|
2267
|
+
if (ganttData.childRecords.length > 0 && this.parent.isOnEdit) {
|
|
2268
|
+
var childCompletedWorks = 0;
|
|
2269
|
+
for (var i = 0; i < ganttData.childRecords.length; i++) {
|
|
2270
|
+
childCompletedWorks += ganttData.childRecords[i].ganttProperties.work;
|
|
2271
|
+
}
|
|
2272
|
+
work += childCompletedWorks;
|
|
2270
2273
|
}
|
|
2271
|
-
work += childCompletedWorks;
|
|
2272
2274
|
}
|
|
2273
2275
|
this.parent.setRecordValue('work', work, ganttData.ganttProperties, true);
|
|
2274
2276
|
if (!isNullOrUndefined(this.parent.taskFields.work)) {
|
|
@@ -2484,7 +2486,7 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
|
|
|
2484
2486
|
this.parent.setRecordValue('work', work, ganttProperties, true);
|
|
2485
2487
|
switch (tType) {
|
|
2486
2488
|
case 'FixedDuration':
|
|
2487
|
-
this.
|
|
2489
|
+
this.updateWorkWithDuration(ganttData);
|
|
2488
2490
|
break;
|
|
2489
2491
|
case 'FixedWork':
|
|
2490
2492
|
this.updateUnitWithWork(ganttData);
|
|
@@ -2899,14 +2901,18 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
|
|
|
2899
2901
|
this.parent.ganttChartModule.scrollObject['isSetScrollLeft'])) && !isFromTimelineVirtulization) {
|
|
2900
2902
|
isValid = false;
|
|
2901
2903
|
}
|
|
2902
|
-
if (this.parent.enableTimelineVirtualization && isValid && !this.parent.timelineModule['performedTimeSpanAction']) {
|
|
2904
|
+
if (!this.parent.editModule && this.parent.enableTimelineVirtualization && isValid && !this.parent.timelineModule['performedTimeSpanAction']) {
|
|
2903
2905
|
leftValueForStartDate = (this.parent.enableTimelineVirtualization && this.parent.ganttChartModule.scrollObject.element.scrollLeft != 0)
|
|
2904
2906
|
? this.parent.ganttChartModule.scrollObject.getTimelineLeft() : null;
|
|
2905
2907
|
}
|
|
2906
|
-
var timelineStartDate = (this.parent.enableTimelineVirtualization && !isNullOrUndefined(leftValueForStartDate))
|
|
2908
|
+
var timelineStartDate = (!this.parent.editModule && this.parent.enableTimelineVirtualization && !isNullOrUndefined(leftValueForStartDate))
|
|
2907
2909
|
? new Date((this.parent.timelineModule['dateByLeftValue'](leftValueForStartDate)).toString()) : new Date(this.parent.timelineModule.timelineStartDate);
|
|
2908
2910
|
if (timelineStartDate) {
|
|
2909
|
-
|
|
2911
|
+
var leftValue = (date.getTime() - timelineStartDate.getTime()) / (1000 * 60 * 60 * 24) * this.parent.perDayWidth;
|
|
2912
|
+
if (this.parent.isInDst(timelineStartDate) && !this.parent.isInDst(startDate) && (this.parent.timelineModule.topTier == 'Hour' || this.parent.timelineModule.bottomTier == 'Hour')) {
|
|
2913
|
+
leftValue = leftValue - this.parent.timelineSettings.timelineUnitSize;
|
|
2914
|
+
}
|
|
2915
|
+
return leftValue;
|
|
2910
2916
|
}
|
|
2911
2917
|
else {
|
|
2912
2918
|
return 0;
|
|
@@ -6393,10 +6399,8 @@ var Timeline = /** @__PURE__ @class */ (function () {
|
|
|
6393
6399
|
this.parent.dateValidationModule.calculateProjectDates();
|
|
6394
6400
|
}
|
|
6395
6401
|
if (!isNullOrUndefined(this.parent.zoomingProjectStartDate)) {
|
|
6396
|
-
this.parent.cloneProjectStartDate = this.parent.
|
|
6397
|
-
|
|
6398
|
-
this.parent.cloneProjectEndDate = this.parent.cloneProjectEndDate.getTime() > this.parent.zoomingProjectEndDate.getTime()
|
|
6399
|
-
? this.parent.cloneProjectEndDate : this.parent.zoomingProjectEndDate;
|
|
6402
|
+
this.parent.cloneProjectStartDate = this.parent.zoomingProjectStartDate;
|
|
6403
|
+
this.parent.cloneProjectEndDate = this.parent.zoomingProjectEndDate;
|
|
6400
6404
|
}
|
|
6401
6405
|
this.parent.zoomingProjectStartDate = null;
|
|
6402
6406
|
this.parent.zoomingProjectEndDate = null;
|
|
@@ -12004,6 +12008,7 @@ var Dependency = /** @__PURE__ @class */ (function () {
|
|
|
12004
12008
|
this.parentIds = [];
|
|
12005
12009
|
this.parentPredecessors = [];
|
|
12006
12010
|
this.validatedParentIds = [];
|
|
12011
|
+
this.storeId = null;
|
|
12007
12012
|
this.parent = gantt;
|
|
12008
12013
|
this.dateValidateModule = this.parent.dateValidationModule;
|
|
12009
12014
|
}
|
|
@@ -12480,7 +12485,7 @@ var Dependency = /** @__PURE__ @class */ (function () {
|
|
|
12480
12485
|
}
|
|
12481
12486
|
if (flatData[count].hasChildRecords && this.parent.editModule && !this.parent.allowUnscheduledTasks
|
|
12482
12487
|
&& this.parent.allowParentDependency) {
|
|
12483
|
-
this.
|
|
12488
|
+
this.updateChildItems(flatData[count]);
|
|
12484
12489
|
}
|
|
12485
12490
|
}
|
|
12486
12491
|
}
|
|
@@ -12492,7 +12497,7 @@ var Dependency = /** @__PURE__ @class */ (function () {
|
|
|
12492
12497
|
var item = this.parentPredecessors[i];
|
|
12493
12498
|
this.validatePredecessorDates(item);
|
|
12494
12499
|
if (item.ganttProperties.startDate) {
|
|
12495
|
-
this.
|
|
12500
|
+
this.updateChildItems(item);
|
|
12496
12501
|
}
|
|
12497
12502
|
}
|
|
12498
12503
|
}
|
|
@@ -12870,7 +12875,15 @@ var Dependency = /** @__PURE__ @class */ (function () {
|
|
|
12870
12875
|
continue;
|
|
12871
12876
|
}
|
|
12872
12877
|
if (record) {
|
|
12873
|
-
this.
|
|
12878
|
+
if (this.parent.editModule.isFirstCall) {
|
|
12879
|
+
this.storeId = JSON.parse(JSON.stringify(this.parent.ids));
|
|
12880
|
+
this.parent.editModule.isFirstCall = false;
|
|
12881
|
+
}
|
|
12882
|
+
var index = (this.storeId && this.storeId.indexOf(record[this.parent.taskFields.id].toString()) !== -1) ? this.storeId.indexOf(record[this.parent.taskFields.id].toString()) : -1;
|
|
12883
|
+
if (index !== -1) {
|
|
12884
|
+
this.storeId = this.storeId.slice(0, index).concat(this.storeId.slice(index + 1));
|
|
12885
|
+
this.validatePredecessor(record, undefined, 'successor');
|
|
12886
|
+
}
|
|
12874
12887
|
}
|
|
12875
12888
|
}
|
|
12876
12889
|
if (record && !record.hasChildRecords && record.parentItem && this.validatedParentIds.indexOf(record.parentItem.taskId) == -1) {
|
|
@@ -12885,13 +12898,13 @@ var Dependency = /** @__PURE__ @class */ (function () {
|
|
|
12885
12898
|
if (record && record.ganttProperties.taskId !== this.isValidatedParentTaskID && ganttProp) {
|
|
12886
12899
|
if ((taskBarModule.taskBarEditAction !== 'ParentDrag' && taskBarModule.taskBarEditAction !== 'ChildDrag')) {
|
|
12887
12900
|
if (!ganttProp.hasChildRecords && record.hasChildRecords) {
|
|
12888
|
-
this.
|
|
12901
|
+
this.updateChildItems(record);
|
|
12889
12902
|
this.isValidatedParentTaskID = record.ganttProperties.taskId;
|
|
12890
12903
|
}
|
|
12891
12904
|
}
|
|
12892
12905
|
else if ((!record.hasChildRecords && taskBarModule.taskBarEditAction == 'ChildDrag') ||
|
|
12893
12906
|
(record.hasChildRecords && taskBarModule.taskBarEditAction == 'ParentDrag')) {
|
|
12894
|
-
this.
|
|
12907
|
+
this.updateChildItems(record);
|
|
12895
12908
|
this.isValidatedParentTaskID = record.ganttProperties.taskId;
|
|
12896
12909
|
}
|
|
12897
12910
|
if (!ganttProp.hasChildRecords) {
|
|
@@ -12899,10 +12912,127 @@ var Dependency = /** @__PURE__ @class */ (function () {
|
|
|
12899
12912
|
}
|
|
12900
12913
|
}
|
|
12901
12914
|
else if (record && record.hasChildRecords && !ganttProp) {
|
|
12902
|
-
this.
|
|
12915
|
+
this.updateChildItems(record);
|
|
12916
|
+
}
|
|
12917
|
+
}
|
|
12918
|
+
}
|
|
12919
|
+
};
|
|
12920
|
+
/**
|
|
12921
|
+
*
|
|
12922
|
+
* @param {IGanttData} ganttRecord .
|
|
12923
|
+
* @returns {void} .
|
|
12924
|
+
*/
|
|
12925
|
+
Dependency.prototype.updateChildItems = function (ganttRecord) {
|
|
12926
|
+
var previousData = this.parent.previousRecords[ganttRecord.uniqueID];
|
|
12927
|
+
var previousStartDate;
|
|
12928
|
+
if (isNullOrUndefined(previousData) ||
|
|
12929
|
+
(isNullOrUndefined(previousData) && !isNullOrUndefined(previousData.ganttProperties))) {
|
|
12930
|
+
previousStartDate = new Date(ganttRecord.ganttProperties.startDate.getTime());
|
|
12931
|
+
}
|
|
12932
|
+
else {
|
|
12933
|
+
if (!isNullOrUndefined(previousData.ganttProperties.startDate)) {
|
|
12934
|
+
previousStartDate = new Date(previousData.ganttProperties.startDate.getTime());
|
|
12935
|
+
}
|
|
12936
|
+
}
|
|
12937
|
+
var currentStartDate = ganttRecord.ganttProperties.startDate;
|
|
12938
|
+
var childRecords = [];
|
|
12939
|
+
var validStartDate;
|
|
12940
|
+
var validEndDate;
|
|
12941
|
+
var calcEndDate;
|
|
12942
|
+
var isRightMove;
|
|
12943
|
+
var durationDiff;
|
|
12944
|
+
this.getUpdatableChildRecords(ganttRecord, childRecords);
|
|
12945
|
+
if (childRecords.length === 0) {
|
|
12946
|
+
return;
|
|
12947
|
+
}
|
|
12948
|
+
if (!isNullOrUndefined(previousStartDate) && !isNullOrUndefined(currentStartDate) && previousStartDate.getTime() > currentStartDate.getTime()) {
|
|
12949
|
+
validStartDate = this.parent.dateValidationModule.checkStartDate(currentStartDate);
|
|
12950
|
+
validEndDate = this.parent.dateValidationModule.checkEndDate(previousStartDate, ganttRecord.ganttProperties);
|
|
12951
|
+
isRightMove = false;
|
|
12952
|
+
}
|
|
12953
|
+
else {
|
|
12954
|
+
validStartDate = this.parent.dateValidationModule.checkStartDate(previousStartDate);
|
|
12955
|
+
validEndDate = this.parent.dateValidationModule.checkEndDate(currentStartDate, ganttRecord.ganttProperties);
|
|
12956
|
+
isRightMove = true;
|
|
12957
|
+
}
|
|
12958
|
+
//Get Duration
|
|
12959
|
+
if (!isNullOrUndefined(validStartDate) && !isNullOrUndefined(validEndDate) && validStartDate.getTime() >= validEndDate.getTime()) {
|
|
12960
|
+
durationDiff = 0;
|
|
12961
|
+
}
|
|
12962
|
+
else {
|
|
12963
|
+
durationDiff = this.parent.dateValidationModule.getDuration(validStartDate, validEndDate, 'minute', true, false);
|
|
12964
|
+
}
|
|
12965
|
+
for (var i = 0; i < childRecords.length; i++) {
|
|
12966
|
+
if (childRecords[i].ganttProperties.isAutoSchedule) {
|
|
12967
|
+
if (durationDiff > 0) {
|
|
12968
|
+
var startDate = isScheduledTask(childRecords[i].ganttProperties) ?
|
|
12969
|
+
childRecords[i].ganttProperties.startDate : childRecords[i].ganttProperties.startDate ?
|
|
12970
|
+
childRecords[i].ganttProperties.startDate : childRecords[i].ganttProperties.endDate ?
|
|
12971
|
+
childRecords[i].ganttProperties.endDate : new Date(previousStartDate.toString());
|
|
12972
|
+
if (isRightMove) {
|
|
12973
|
+
calcEndDate = this.parent.dateValidationModule.getEndDate(this.parent.dateValidationModule.checkStartDate(startDate, childRecords[i].ganttProperties, childRecords[i].ganttProperties.isMilestone), durationDiff, 'minute', childRecords[i].ganttProperties, false);
|
|
12974
|
+
}
|
|
12975
|
+
else {
|
|
12976
|
+
calcEndDate = this.parent.dateValidationModule.getStartDate(this.parent.dateValidationModule.checkEndDate(startDate, childRecords[i].ganttProperties), durationDiff, 'minute', childRecords[i].ganttProperties);
|
|
12977
|
+
}
|
|
12978
|
+
this.calculateDateByRoundOffDuration(childRecords[i], calcEndDate);
|
|
12979
|
+
if (this.parent.isOnEdit && this.validatedChildItems.indexOf(childRecords[i]) === -1) {
|
|
12980
|
+
this.validatedChildItems.push(childRecords[i]);
|
|
12981
|
+
}
|
|
12982
|
+
}
|
|
12983
|
+
else if (isNullOrUndefined(previousData)) {
|
|
12984
|
+
calcEndDate = previousStartDate;
|
|
12985
|
+
this.calculateDateByRoundOffDuration(childRecords[i], calcEndDate);
|
|
12986
|
+
if (this.parent.isOnEdit && this.validatedChildItems.indexOf(childRecords[i]) === -1) {
|
|
12987
|
+
this.validatedChildItems.push(childRecords[i]);
|
|
12988
|
+
}
|
|
12903
12989
|
}
|
|
12904
12990
|
}
|
|
12905
12991
|
}
|
|
12992
|
+
if (childRecords.length) {
|
|
12993
|
+
this.parent.dataOperation.updateParentItems(ganttRecord, true);
|
|
12994
|
+
}
|
|
12995
|
+
};
|
|
12996
|
+
/**
|
|
12997
|
+
* To get updated child records.
|
|
12998
|
+
*
|
|
12999
|
+
* @param {IGanttData} parentRecord .
|
|
13000
|
+
* @param {IGanttData} childLists .
|
|
13001
|
+
* @returns {void} .
|
|
13002
|
+
*/
|
|
13003
|
+
Dependency.prototype.getUpdatableChildRecords = function (parentRecord, childLists) {
|
|
13004
|
+
var childRecords = parentRecord.childRecords;
|
|
13005
|
+
for (var i = 0; i < childRecords.length; i++) {
|
|
13006
|
+
if (childRecords[i].ganttProperties.isAutoSchedule) {
|
|
13007
|
+
childLists.push(childRecords[i]);
|
|
13008
|
+
if (childRecords[i].hasChildRecords) {
|
|
13009
|
+
this.getUpdatableChildRecords(childRecords[i], childLists);
|
|
13010
|
+
}
|
|
13011
|
+
}
|
|
13012
|
+
}
|
|
13013
|
+
};
|
|
13014
|
+
/**
|
|
13015
|
+
*
|
|
13016
|
+
* @param {IGanttData} data .
|
|
13017
|
+
* @param {Date} newStartDate .
|
|
13018
|
+
* @returns {void} .
|
|
13019
|
+
*/
|
|
13020
|
+
Dependency.prototype.calculateDateByRoundOffDuration = function (data, newStartDate) {
|
|
13021
|
+
var ganttRecord = data;
|
|
13022
|
+
var taskData = ganttRecord.ganttProperties;
|
|
13023
|
+
var projectStartDate = new Date(newStartDate.getTime());
|
|
13024
|
+
if (!isNullOrUndefined(taskData.endDate) && isNullOrUndefined(taskData.startDate)) {
|
|
13025
|
+
var endDate = this.parent.dateValidationModule.checkStartDate(projectStartDate, taskData, null);
|
|
13026
|
+
this.parent.setRecordValue('endDate', this.parent.dateValidationModule.checkEndDate(endDate, ganttRecord.ganttProperties), taskData, true);
|
|
13027
|
+
}
|
|
13028
|
+
else {
|
|
13029
|
+
this.parent.setRecordValue('startDate', this.parent.dateValidationModule.checkStartDate(projectStartDate, taskData, false), taskData, true);
|
|
13030
|
+
if (!isNullOrUndefined(taskData.duration)) {
|
|
13031
|
+
this.parent.dateValidationModule.calculateEndDate(ganttRecord);
|
|
13032
|
+
}
|
|
13033
|
+
}
|
|
13034
|
+
this.parent.dataOperation.updateWidthLeft(data);
|
|
13035
|
+
this.parent.dataOperation.updateTaskData(ganttRecord);
|
|
12906
13036
|
};
|
|
12907
13037
|
/**
|
|
12908
13038
|
* Method to get validate able predecessor alone from record
|
|
@@ -16457,7 +16587,7 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
|
|
|
16457
16587
|
this.treeGridModule.treeGridColumns = [];
|
|
16458
16588
|
this.treeGridModule.validateGanttColumns();
|
|
16459
16589
|
this.treeGrid.columns = this.treeGridModule.treeGridColumns;
|
|
16460
|
-
this.treeGrid.
|
|
16590
|
+
this.treeGrid.refreshColumns();
|
|
16461
16591
|
this.chartRowsModule.initiateTemplates();
|
|
16462
16592
|
this.timelineModule.updateChartByNewTimeline();
|
|
16463
16593
|
break;
|
|
@@ -17504,6 +17634,19 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
|
|
|
17504
17634
|
var tempSplitterSettings = {};
|
|
17505
17635
|
tempSplitterSettings[type] = value;
|
|
17506
17636
|
var splitterPosition = this.splitterModule.calculateSplitterPosition(tempSplitterSettings);
|
|
17637
|
+
switch (type) {
|
|
17638
|
+
case 'view':
|
|
17639
|
+
this.splitterSettings.view = tempSplitterSettings[type];
|
|
17640
|
+
break;
|
|
17641
|
+
case 'columnIndex':
|
|
17642
|
+
this.splitterSettings.columnIndex = tempSplitterSettings[type];
|
|
17643
|
+
break;
|
|
17644
|
+
case 'position':
|
|
17645
|
+
this.splitterSettings.position = tempSplitterSettings[type];
|
|
17646
|
+
break;
|
|
17647
|
+
default:
|
|
17648
|
+
break;
|
|
17649
|
+
}
|
|
17507
17650
|
var pane1 = this.splitterModule.splitterObject.element.querySelectorAll('.e-pane')[0];
|
|
17508
17651
|
var pane2 = this.splitterModule.splitterObject.element.querySelectorAll('.e-pane')[1];
|
|
17509
17652
|
this.splitterModule.splitterPreviousPositionGrid = pane1.scrollWidth + 1 + 'px';
|
|
@@ -20378,7 +20521,12 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
|
|
|
20378
20521
|
event.preventDefault();
|
|
20379
20522
|
if (!isNullOrUndefined(this.taskbarElement) && !isNullOrUndefined(this.editElement) && (this.taskBarEditAction !== "ConnectorPointRightDrag" && this.taskBarEditAction !== "ConnectorPointLeftDrag") && !(this.parent.viewType === 'ResourceView' && this.currentData.hasChildRecords)) {
|
|
20380
20523
|
var currentElement = this.editElement.parentElement;
|
|
20381
|
-
|
|
20524
|
+
if (this.parent.enableTimelineVirtualization && this.parent.timelineModule.wholeTimelineWidth > this.parent.element.offsetWidth * 3) {
|
|
20525
|
+
currentElement.style.setProperty("position", "relative");
|
|
20526
|
+
}
|
|
20527
|
+
else {
|
|
20528
|
+
currentElement.style.setProperty("position", "absolute");
|
|
20529
|
+
}
|
|
20382
20530
|
if ((this.taskBarEditAction === 'ChildDrag' || this.taskBarEditAction === 'LeftResizing') && !isNullOrUndefined(this.currentIndex) && !isNullOrUndefined(this.currentIndex) ? Number(this.currentIndex) === 0 : false) {
|
|
20383
20531
|
this.taskbarElement.childNodes[0].childNodes[0].style.setProperty("top", currentElement.parentElement.offsetTop + "px");
|
|
20384
20532
|
if (this.parent.allowTaskbarDragAndDrop && this.taskBarEditAction !== 'LeftResizing' && this.taskBarEditAction !== 'RightResizing' && this.taskBarEditAction !== 'ProgressResizing') {
|
|
@@ -20397,8 +20545,14 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
|
|
|
20397
20545
|
}
|
|
20398
20546
|
}
|
|
20399
20547
|
if (this.taskBarEditAction !== 'ProgressResizing') {
|
|
20400
|
-
|
|
20401
|
-
|
|
20548
|
+
if (this.parent.enableTimelineVirtualization && this.parent.timelineModule.wholeTimelineWidth > this.parent.element.offsetWidth * 3) {
|
|
20549
|
+
var rootElement = this.parent.ganttChartModule.chartBodyContainer.querySelectorAll(".e-chart-scroll-container");
|
|
20550
|
+
rootElement[0].appendChild(this.taskbarResizer);
|
|
20551
|
+
}
|
|
20552
|
+
else {
|
|
20553
|
+
var rootElement = this.parent.ganttChartModule.chartBodyContainer.querySelectorAll(".e-chart-rows-container");
|
|
20554
|
+
rootElement[0].appendChild(this.taskbarResizer);
|
|
20555
|
+
}
|
|
20402
20556
|
}
|
|
20403
20557
|
}
|
|
20404
20558
|
if (this.parent.allowTaskbarDragAndDrop && (this.taskBarEditAction === "ChildDrag" || this.taskBarEditAction === "ParentDrag" ||
|
|
@@ -21525,7 +21679,12 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
|
|
|
21525
21679
|
currentElement.style.position = null;
|
|
21526
21680
|
}
|
|
21527
21681
|
else {
|
|
21528
|
-
|
|
21682
|
+
if (this.parent.enableTimelineVirtualization && this.parent.timelineModule.wholeTimelineWidth > this.parent.element.offsetWidth * 3) {
|
|
21683
|
+
currentElement.style.setProperty("position", "relative");
|
|
21684
|
+
}
|
|
21685
|
+
else {
|
|
21686
|
+
currentElement.style.setProperty("position", "absolute");
|
|
21687
|
+
}
|
|
21529
21688
|
}
|
|
21530
21689
|
}
|
|
21531
21690
|
var item = this.taskBarEditRecord.ganttProperties;
|
|
@@ -26230,7 +26389,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
26230
26389
|
*/
|
|
26231
26390
|
this.deletedTaskDetails = [];
|
|
26232
26391
|
this.parent = parent;
|
|
26233
|
-
this.validatedChildItems = [];
|
|
26392
|
+
this.parent.predecessorModule.validatedChildItems = [];
|
|
26234
26393
|
if (this.parent.editSettings.allowEditing && this.parent.editSettings.mode === 'Auto') {
|
|
26235
26394
|
this.cellEditModule = new CellEdit(this.parent);
|
|
26236
26395
|
}
|
|
@@ -27067,8 +27226,8 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
27067
27226
|
}
|
|
27068
27227
|
if (this.parent.isConnectorLineUpdate && this.parent.autoCalculateDateScheduling) {
|
|
27069
27228
|
/* validating predecessor for updated child items */
|
|
27070
|
-
for (var i = 0; i < this.validatedChildItems.length; i++) {
|
|
27071
|
-
var child = this.validatedChildItems[i];
|
|
27229
|
+
for (var i = 0; i < this.parent.predecessorModule.validatedChildItems.length; i++) {
|
|
27230
|
+
var child = this.parent.predecessorModule.validatedChildItems[i];
|
|
27072
27231
|
if (child.ganttProperties.predecessor && child.ganttProperties.predecessor.length > 0) {
|
|
27073
27232
|
this.parent.editedTaskBarItem = child;
|
|
27074
27233
|
this.parent.predecessorModule.validatePredecessor(child, [], '');
|
|
@@ -27082,6 +27241,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
27082
27241
|
this.parent.editedTaskBarItem = ganttRecord;
|
|
27083
27242
|
}
|
|
27084
27243
|
if (!this.isValidatedEditedRecord) {
|
|
27244
|
+
this.isFirstCall = true;
|
|
27085
27245
|
this.parent.predecessorModule.validatePredecessor(ganttRecord, [], '');
|
|
27086
27246
|
}
|
|
27087
27247
|
this.isValidatedEditedRecord = false;
|
|
@@ -27089,7 +27249,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
27089
27249
|
}
|
|
27090
27250
|
if (this.parent.allowParentDependency && ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
|
|
27091
27251
|
(args.action === "DrawConnectorLine")) {
|
|
27092
|
-
this.updateChildItems(ganttRecord);
|
|
27252
|
+
this.parent.predecessorModule['updateChildItems'](ganttRecord);
|
|
27093
27253
|
}
|
|
27094
27254
|
this.updateParentItemOnEditing();
|
|
27095
27255
|
this.parent.dataOperation.updateParentItems(ganttRecord, true);
|
|
@@ -27102,6 +27262,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
27102
27262
|
var parentData = this.parent.getRecordByID(ganttRecord.parentItem.taskId);
|
|
27103
27263
|
if (!isNullOrUndefined(parentData)) {
|
|
27104
27264
|
if (!parentData.ganttProperties.predecessorsName) {
|
|
27265
|
+
this.isFirstCall = true;
|
|
27105
27266
|
this.parent.predecessorModule.validatePredecessor(parentData, [], '');
|
|
27106
27267
|
this.updateParentItemOnEditing();
|
|
27107
27268
|
this.parent.ganttChartModule.reRenderConnectorLines();
|
|
@@ -27132,7 +27293,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
27132
27293
|
Edit$$1.prototype.updateParentChildRecord = function (data) {
|
|
27133
27294
|
var ganttRecord = data;
|
|
27134
27295
|
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)) {
|
|
27135
|
-
this.updateChildItems(ganttRecord);
|
|
27296
|
+
this.parent.predecessorModule['updateChildItems'](ganttRecord);
|
|
27136
27297
|
}
|
|
27137
27298
|
if (!isNullOrUndefined(this.parent.editModule.cellEditModule)) {
|
|
27138
27299
|
this.parent.editModule.cellEditModule.isResourceCellEdited = false;
|
|
@@ -27177,29 +27338,6 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
27177
27338
|
this.parent.dataOperation.updateWidthLeft(data);
|
|
27178
27339
|
}
|
|
27179
27340
|
};
|
|
27180
|
-
/**
|
|
27181
|
-
*
|
|
27182
|
-
* @param {IGanttData} data .
|
|
27183
|
-
* @param {Date} newStartDate .
|
|
27184
|
-
* @returns {void} .
|
|
27185
|
-
*/
|
|
27186
|
-
Edit$$1.prototype.calculateDateByRoundOffDuration = function (data, newStartDate) {
|
|
27187
|
-
var ganttRecord = data;
|
|
27188
|
-
var taskData = ganttRecord.ganttProperties;
|
|
27189
|
-
var projectStartDate = new Date(newStartDate.getTime());
|
|
27190
|
-
if (!isNullOrUndefined(taskData.endDate) && isNullOrUndefined(taskData.startDate)) {
|
|
27191
|
-
var endDate = this.parent.dateValidationModule.checkStartDate(projectStartDate, taskData, null);
|
|
27192
|
-
this.parent.setRecordValue('endDate', this.parent.dateValidationModule.checkEndDate(endDate, ganttRecord.ganttProperties), taskData, true);
|
|
27193
|
-
}
|
|
27194
|
-
else {
|
|
27195
|
-
this.parent.setRecordValue('startDate', this.parent.dateValidationModule.checkStartDate(projectStartDate, taskData, false), taskData, true);
|
|
27196
|
-
if (!isNullOrUndefined(taskData.duration)) {
|
|
27197
|
-
this.parent.dateValidationModule.calculateEndDate(ganttRecord);
|
|
27198
|
-
}
|
|
27199
|
-
}
|
|
27200
|
-
this.parent.dataOperation.updateWidthLeft(data);
|
|
27201
|
-
this.parent.dataOperation.updateTaskData(ganttRecord);
|
|
27202
|
-
};
|
|
27203
27341
|
/**
|
|
27204
27342
|
* To update progress value of parent tasks
|
|
27205
27343
|
*
|
|
@@ -27309,106 +27447,6 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
27309
27447
|
Edit$$1.prototype.updateScheduleDatesOnEditing = function (args) {
|
|
27310
27448
|
//..
|
|
27311
27449
|
};
|
|
27312
|
-
/**
|
|
27313
|
-
*
|
|
27314
|
-
* @param {IGanttData} ganttRecord .
|
|
27315
|
-
* @returns {void} .
|
|
27316
|
-
*/
|
|
27317
|
-
Edit$$1.prototype.updateChildItems = function (ganttRecord) {
|
|
27318
|
-
var previousData = this.parent.previousRecords[ganttRecord.uniqueID];
|
|
27319
|
-
var previousStartDate;
|
|
27320
|
-
if (isNullOrUndefined(previousData) ||
|
|
27321
|
-
(isNullOrUndefined(previousData) && !isNullOrUndefined(previousData.ganttProperties))) {
|
|
27322
|
-
previousStartDate = new Date(ganttRecord.ganttProperties.startDate.getTime());
|
|
27323
|
-
}
|
|
27324
|
-
else {
|
|
27325
|
-
if (!isNullOrUndefined(previousData.ganttProperties.startDate)) {
|
|
27326
|
-
previousStartDate = new Date(previousData.ganttProperties.startDate.getTime());
|
|
27327
|
-
}
|
|
27328
|
-
}
|
|
27329
|
-
var currentStartDate = ganttRecord.ganttProperties.startDate;
|
|
27330
|
-
var childRecords = [];
|
|
27331
|
-
var validStartDate;
|
|
27332
|
-
var validEndDate;
|
|
27333
|
-
var calcEndDate;
|
|
27334
|
-
var isRightMove;
|
|
27335
|
-
var durationDiff;
|
|
27336
|
-
this.getUpdatableChildRecords(ganttRecord, childRecords);
|
|
27337
|
-
if (childRecords.length === 0) {
|
|
27338
|
-
return;
|
|
27339
|
-
}
|
|
27340
|
-
if (!isNullOrUndefined(previousStartDate) && !isNullOrUndefined(currentStartDate) && previousStartDate.getTime() > currentStartDate.getTime()) {
|
|
27341
|
-
validStartDate = this.parent.dateValidationModule.checkStartDate(currentStartDate);
|
|
27342
|
-
validEndDate = this.parent.dateValidationModule.checkEndDate(previousStartDate, ganttRecord.ganttProperties);
|
|
27343
|
-
isRightMove = false;
|
|
27344
|
-
}
|
|
27345
|
-
else {
|
|
27346
|
-
validStartDate = this.parent.dateValidationModule.checkStartDate(previousStartDate);
|
|
27347
|
-
validEndDate = this.parent.dateValidationModule.checkEndDate(currentStartDate, ganttRecord.ganttProperties);
|
|
27348
|
-
isRightMove = true;
|
|
27349
|
-
}
|
|
27350
|
-
//Get Duration
|
|
27351
|
-
if (!isNullOrUndefined(validStartDate) && !isNullOrUndefined(validEndDate) && validStartDate.getTime() >= validEndDate.getTime()) {
|
|
27352
|
-
durationDiff = 0;
|
|
27353
|
-
}
|
|
27354
|
-
else {
|
|
27355
|
-
durationDiff = this.parent.dateValidationModule.getDuration(validStartDate, validEndDate, 'minute', true, false);
|
|
27356
|
-
}
|
|
27357
|
-
for (var i = 0; i < childRecords.length; i++) {
|
|
27358
|
-
if (childRecords[i].ganttProperties.isAutoSchedule) {
|
|
27359
|
-
if (durationDiff > 0) {
|
|
27360
|
-
var startDate = isScheduledTask(childRecords[i].ganttProperties) ?
|
|
27361
|
-
childRecords[i].ganttProperties.startDate : childRecords[i].ganttProperties.startDate ?
|
|
27362
|
-
childRecords[i].ganttProperties.startDate : childRecords[i].ganttProperties.endDate ?
|
|
27363
|
-
childRecords[i].ganttProperties.endDate : new Date(previousStartDate.toString());
|
|
27364
|
-
if (isRightMove) {
|
|
27365
|
-
calcEndDate = this.parent.dateValidationModule.getEndDate(this.parent.dateValidationModule.checkStartDate(startDate, childRecords[i].ganttProperties, childRecords[i].ganttProperties.isMilestone), durationDiff, 'minute', childRecords[i].ganttProperties, false);
|
|
27366
|
-
}
|
|
27367
|
-
else {
|
|
27368
|
-
calcEndDate = this.parent.dateValidationModule.getStartDate(this.parent.dateValidationModule.checkEndDate(startDate, childRecords[i].ganttProperties), durationDiff, 'minute', childRecords[i].ganttProperties);
|
|
27369
|
-
}
|
|
27370
|
-
this.calculateDateByRoundOffDuration(childRecords[i], calcEndDate);
|
|
27371
|
-
if (this.parent.isOnEdit && this.validatedChildItems.indexOf(childRecords[i]) === -1) {
|
|
27372
|
-
this.validatedChildItems.push(childRecords[i]);
|
|
27373
|
-
}
|
|
27374
|
-
}
|
|
27375
|
-
else if (isNullOrUndefined(previousData)) {
|
|
27376
|
-
calcEndDate = previousStartDate;
|
|
27377
|
-
var initialData = this.parent.initialLoadData[childRecords[i].index];
|
|
27378
|
-
if (this.parent.isLoad) {
|
|
27379
|
-
this.calculateDateByRoundOffDuration(initialData, calcEndDate);
|
|
27380
|
-
}
|
|
27381
|
-
else {
|
|
27382
|
-
this.calculateDateByRoundOffDuration(childRecords[i], calcEndDate);
|
|
27383
|
-
}
|
|
27384
|
-
if (this.parent.isOnEdit && this.validatedChildItems.indexOf(childRecords[i]) === -1) {
|
|
27385
|
-
this.validatedChildItems.push(childRecords[i]);
|
|
27386
|
-
}
|
|
27387
|
-
}
|
|
27388
|
-
}
|
|
27389
|
-
}
|
|
27390
|
-
if (childRecords.length) {
|
|
27391
|
-
this.parent.dataOperation.updateParentItems(ganttRecord, true);
|
|
27392
|
-
}
|
|
27393
|
-
};
|
|
27394
|
-
/**
|
|
27395
|
-
* To get updated child records.
|
|
27396
|
-
*
|
|
27397
|
-
* @param {IGanttData} parentRecord .
|
|
27398
|
-
* @param {IGanttData} childLists .
|
|
27399
|
-
* @returns {void} .
|
|
27400
|
-
*/
|
|
27401
|
-
Edit$$1.prototype.getUpdatableChildRecords = function (parentRecord, childLists) {
|
|
27402
|
-
var childRecords = parentRecord.childRecords;
|
|
27403
|
-
for (var i = 0; i < childRecords.length; i++) {
|
|
27404
|
-
if (childRecords[i].ganttProperties.isAutoSchedule) {
|
|
27405
|
-
childLists.push(childRecords[i]);
|
|
27406
|
-
if (childRecords[i].hasChildRecords) {
|
|
27407
|
-
this.getUpdatableChildRecords(childRecords[i], childLists);
|
|
27408
|
-
}
|
|
27409
|
-
}
|
|
27410
|
-
}
|
|
27411
|
-
};
|
|
27412
27450
|
/**
|
|
27413
27451
|
* @param {ITaskbarEditedEventArgs} args .
|
|
27414
27452
|
* @returns {void} .
|
|
@@ -27921,7 +27959,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
27921
27959
|
this.resetValidateArgs();
|
|
27922
27960
|
this.parent.editedTaskBarItem = null;
|
|
27923
27961
|
this.parent.isOnEdit = false;
|
|
27924
|
-
this.validatedChildItems = [];
|
|
27962
|
+
this.parent.predecessorModule.validatedChildItems = [];
|
|
27925
27963
|
this.parent.isConnectorLineUpdate = false;
|
|
27926
27964
|
this.parent.editedTaskBarItem = null;
|
|
27927
27965
|
this.taskbarMoved = false;
|
|
@@ -29828,6 +29866,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
29828
29866
|
for (var k = 0; k < this.updateParentRecords.length; k++) {
|
|
29829
29867
|
this.parent.dataOperation.updateParentItems(this.updateParentRecords[k]);
|
|
29830
29868
|
}
|
|
29869
|
+
this.isFirstCall = true;
|
|
29831
29870
|
this.parent.editedRecords.forEach(function (record) {
|
|
29832
29871
|
_this.parent.predecessorModule.validatePredecessor(record, [], '');
|
|
29833
29872
|
});
|
|
@@ -30881,7 +30920,14 @@ var Selection$1 = /** @__PURE__ @class */ (function () {
|
|
|
30881
30920
|
if (this.parent.enableTimelineVirtualization) {
|
|
30882
30921
|
this.parent['isRowSelected'] = true;
|
|
30883
30922
|
}
|
|
30884
|
-
|
|
30923
|
+
if (args.data && !isNullOrUndefined(args.data['length'])) {
|
|
30924
|
+
for (var i = 0; i < args.data['length']; i++) {
|
|
30925
|
+
this.parent.ganttChartModule.updateScrollLeft(args.data[i].ganttProperties.left);
|
|
30926
|
+
}
|
|
30927
|
+
}
|
|
30928
|
+
else {
|
|
30929
|
+
this.parent.ganttChartModule.updateScrollLeft(getValue('data.ganttProperties.left', args));
|
|
30930
|
+
}
|
|
30885
30931
|
}
|
|
30886
30932
|
args.target = this.actualTarget;
|
|
30887
30933
|
if (!isNullOrUndefined(args.foreignKeyData) && Object.keys(args.foreignKeyData).length === 0) {
|