@syncfusion/ej2-gantt 20.3.59 → 20.3.61
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 +22 -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 +63 -12
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +83 -27
- 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 +12 -12
- package/src/gantt/actions/dependency.js +3 -0
- package/src/gantt/actions/dialog-edit.js +1 -1
- package/src/gantt/actions/edit.js +54 -19
- package/src/gantt/actions/keyboard.js +0 -1
- package/src/gantt/actions/taskbar-edit.js +12 -6
- package/src/gantt/base/date-processor.js +4 -0
- package/src/gantt/base/gantt-chart.js +10 -1
|
@@ -413,6 +413,10 @@ class DateProcessor {
|
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
|
+
if (ganttProp && ganttProp.baselineStartDate && cloneDate &&
|
|
417
|
+
ganttProp.baselineStartDate.getTime() > cloneDate.getTime()) {
|
|
418
|
+
cloneDate.setDate(cloneDate.getDate() + 1);
|
|
419
|
+
}
|
|
416
420
|
return cloneDate;
|
|
417
421
|
}
|
|
418
422
|
}
|
|
@@ -4431,6 +4435,9 @@ class GanttChart {
|
|
|
4431
4435
|
this.parent.notify('chartMouseDown', e);
|
|
4432
4436
|
this.parent.element.tabIndex = 0;
|
|
4433
4437
|
}
|
|
4438
|
+
if (this.parent.editSettings.allowEditing && this.parent.treeGrid.element.getElementsByClassName('e-editedbatchcell').length > 0) {
|
|
4439
|
+
this.parent.treeGrid.endEdit();
|
|
4440
|
+
}
|
|
4434
4441
|
}
|
|
4435
4442
|
ganttChartMouseClick(e) {
|
|
4436
4443
|
if (this.parent.autoFocusTasks) {
|
|
@@ -4511,6 +4518,12 @@ class GanttChart {
|
|
|
4511
4518
|
*/
|
|
4512
4519
|
documentMouseUp(e) {
|
|
4513
4520
|
this.isGanttElement = true;
|
|
4521
|
+
if (e.target.classList.contains('e-treegridexpand') ||
|
|
4522
|
+
e.target.classList.contains('e-treegridcollapse')) {
|
|
4523
|
+
if (getValue('isEditCollapse', this.parent.treeGrid) === true) {
|
|
4524
|
+
setValue('isEditCollapse', false, this.parent.treeGrid);
|
|
4525
|
+
}
|
|
4526
|
+
}
|
|
4514
4527
|
if (this.parent.allowRowDragAndDrop) {
|
|
4515
4528
|
const ganttDragElemet = this.parent.element.querySelector('.e-ganttdrag');
|
|
4516
4529
|
if (ganttDragElemet) {
|
|
@@ -10684,6 +10697,9 @@ class Dependency {
|
|
|
10684
10697
|
this.parent.dataOperation.updateParentItems(record, true);
|
|
10685
10698
|
}
|
|
10686
10699
|
}
|
|
10700
|
+
else if (record && record.hasChildRecords && !ganttProp) {
|
|
10701
|
+
this.parent.editModule['updateChildItems'](record);
|
|
10702
|
+
}
|
|
10687
10703
|
}
|
|
10688
10704
|
}
|
|
10689
10705
|
/**
|
|
@@ -12378,7 +12394,6 @@ class FocusModule {
|
|
|
12378
12394
|
if (ganttObj.selectedRowIndex === ganttObj.flatData.indexOf(currentSelectingRecord)) {
|
|
12379
12395
|
return;
|
|
12380
12396
|
}
|
|
12381
|
-
ganttObj.selectionModule.selectRow(ganttObj.flatData.indexOf(currentSelectingRecord), false, true);
|
|
12382
12397
|
}
|
|
12383
12398
|
break;
|
|
12384
12399
|
case 'downArrow':
|
|
@@ -18280,14 +18295,20 @@ class TaskbarEdit extends DateProcessor {
|
|
|
18280
18295
|
new Date(nextSegment.startDate.getTime()) : this.parent.cloneProjectEndDate;
|
|
18281
18296
|
const eDate = !isNullOrUndefined(previousSegment) ?
|
|
18282
18297
|
new Date(previousSegment.endDate.getTime()) : this.parent.cloneProjectStartDate;
|
|
18283
|
-
sDate.setHours(0, 0, 0, 0);
|
|
18284
|
-
eDate.setHours(0, 0, 0, 0);
|
|
18285
18298
|
const cStartDate = new Date(segment.startDate.getTime());
|
|
18286
18299
|
const cEndDate = new Date(segment.endDate.getTime());
|
|
18287
|
-
|
|
18288
|
-
|
|
18289
|
-
|
|
18290
|
-
|
|
18300
|
+
if (this.parent.timelineModule.topTier === 'Day' && this.parent.timelineModule.bottomTier === 'Hour') {
|
|
18301
|
+
cStartDate.setHours(cStartDate.getHours() - 1);
|
|
18302
|
+
cEndDate.setHours(cEndDate.getHours() + 1);
|
|
18303
|
+
}
|
|
18304
|
+
else {
|
|
18305
|
+
sDate.setHours(0, 0, 0, 0);
|
|
18306
|
+
eDate.setHours(0, 0, 0, 0);
|
|
18307
|
+
cStartDate.setDate(cStartDate.getDate() - 1);
|
|
18308
|
+
cEndDate.setDate(cEndDate.getDate() + 1);
|
|
18309
|
+
cStartDate.setHours(0, 0, 0, 0);
|
|
18310
|
+
cEndDate.setHours(0, 0, 0, 0);
|
|
18311
|
+
}
|
|
18291
18312
|
if (cStartDate.getTime() <= eDate.getTime() && !isNullOrUndefined(previousSegment) && !isNullOrUndefined(segment)) {
|
|
18292
18313
|
const segmentIndexes = [
|
|
18293
18314
|
{ 'firstSegmentIndex': previousSegment.segmentIndex, 'secondSegmentIndex': segment.segmentIndex }
|
|
@@ -20401,7 +20422,7 @@ class DialogEdit {
|
|
|
20401
20422
|
inputElement = this.createInputElement('', ganttId + '' + column.field, column.field);
|
|
20402
20423
|
divElement.appendChild(inputElement);
|
|
20403
20424
|
}
|
|
20404
|
-
inputModel.enabled = !this.isCheckIsDisabled(column);
|
|
20425
|
+
inputModel.enabled = !isNullOrUndefined(inputModel.enabled) ? inputModel.enabled : !this.isCheckIsDisabled(column);
|
|
20405
20426
|
if (column.field === this.parent.taskFields.duration) {
|
|
20406
20427
|
if (!isNullOrUndefined(column.valueAccessor)) {
|
|
20407
20428
|
if (typeof column.valueAccessor === 'string') {
|
|
@@ -22575,6 +22596,7 @@ class Edit$2 {
|
|
|
22575
22596
|
this.parent.editedTaskBarItem = ganttRecord;
|
|
22576
22597
|
}
|
|
22577
22598
|
this.parent.predecessorModule.validatePredecessor(ganttRecord, [], '');
|
|
22599
|
+
this.parent.predecessorModule.isValidatedParentTaskID = '';
|
|
22578
22600
|
}
|
|
22579
22601
|
if (ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
|
|
22580
22602
|
(args.action === "DrawConnectorLine" || args.action === "CellEditing" || args.action === "DialogEditing")) {
|
|
@@ -23110,6 +23132,12 @@ class Edit$2 {
|
|
|
23110
23132
|
}
|
|
23111
23133
|
if (!isNullOrUndefined(unassignedTasks)) {
|
|
23112
23134
|
this.addNewRecord(updateRecord, unassignedTasks);
|
|
23135
|
+
const updatedData = this.parent.currentViewData.filter((data) => {
|
|
23136
|
+
return (data.ganttProperties.taskId === updateRecord.ganttProperties.taskId &&
|
|
23137
|
+
(data.hasChildRecords === updateRecord.hasChildRecords));
|
|
23138
|
+
})[0];
|
|
23139
|
+
updateRecord.parentItem = updatedData.parentItem;
|
|
23140
|
+
updateRecord.parentUniqueID = updatedData.parentUniqueID;
|
|
23113
23141
|
}
|
|
23114
23142
|
else {
|
|
23115
23143
|
// Block for create the unassigned task.
|
|
@@ -23385,13 +23413,17 @@ class Edit$2 {
|
|
|
23385
23413
|
const data = selectedRecords[i];
|
|
23386
23414
|
const ids = data.ganttProperties.sharedTaskUniqueIds;
|
|
23387
23415
|
for (let j = 0; j < ids.length; j++) {
|
|
23388
|
-
|
|
23416
|
+
if (this.parent.ids.indexOf(ids[j].toString()) !== -1) {
|
|
23417
|
+
deleteRecords.push(this.parent.flatData[this.parent.ids.indexOf(ids[j].toString())]);
|
|
23418
|
+
}
|
|
23419
|
+
}
|
|
23420
|
+
if (this.parent.ids.indexOf(data.ganttProperties.rowUniqueID) !== -1) {
|
|
23421
|
+
deleteRecords.push(this.parent.flatData[this.parent.ids.indexOf(data.ganttProperties.rowUniqueID)]);
|
|
23389
23422
|
}
|
|
23390
|
-
deleteRecords.push(this.parent.flatData[this.parent.ids.indexOf(data.ganttProperties.rowUniqueID)]);
|
|
23391
23423
|
}
|
|
23392
23424
|
else {
|
|
23393
23425
|
const resourceParent = this.parent.flatData.filter((data) => {
|
|
23394
|
-
return (
|
|
23426
|
+
return (data.ganttProperties.taskId === selectedRecords[i].ganttProperties.taskId &&
|
|
23395
23427
|
data.hasChildRecords);
|
|
23396
23428
|
})[0];
|
|
23397
23429
|
deleteRecords.push(resourceParent);
|
|
@@ -23846,7 +23878,26 @@ class Edit$2 {
|
|
|
23846
23878
|
return !data.hasChildRecords;
|
|
23847
23879
|
});
|
|
23848
23880
|
for (let i = 0; i < updateUnAssignedResources.length; i++) {
|
|
23849
|
-
this.
|
|
23881
|
+
const unassignedTask = this.parent.flatData.filter((data) => {
|
|
23882
|
+
return data.ganttProperties.taskName === this.parent.localeObj.getConstant('unassignedTask');
|
|
23883
|
+
})[0];
|
|
23884
|
+
const isDuplicate = unassignedTask.childRecords.filter((data) => {
|
|
23885
|
+
return data.ganttProperties.taskId === updateUnAssignedResources[i].ganttProperties.taskId;
|
|
23886
|
+
});
|
|
23887
|
+
const parentTask = this.parent.getParentTask(updateUnAssignedResources[i].parentItem);
|
|
23888
|
+
if (parentTask && parentTask.ganttProperties.taskName !==
|
|
23889
|
+
this.parent.localeObj.getConstant('unassignedTask') && isDuplicate.length === 0) {
|
|
23890
|
+
this.checkWithUnassignedTask(updateUnAssignedResources[i]);
|
|
23891
|
+
if (parentTask) {
|
|
23892
|
+
this.parent.dataOperation.updateParentItems(updateUnAssignedResources[i].parentItem);
|
|
23893
|
+
}
|
|
23894
|
+
}
|
|
23895
|
+
else if (!parentTask && isDuplicate.length === 0) {
|
|
23896
|
+
this.checkWithUnassignedTask(updateUnAssignedResources[i]);
|
|
23897
|
+
if (updateUnAssignedResources[i].parentItem) {
|
|
23898
|
+
this.parent.dataOperation.updateParentItems(updateUnAssignedResources[i].parentItem);
|
|
23899
|
+
}
|
|
23900
|
+
}
|
|
23850
23901
|
}
|
|
23851
23902
|
}
|
|
23852
23903
|
this.parent.trigger('actionComplete', eventArgs);
|