@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.
@@ -414,6 +414,10 @@ var DateProcessor = /** @__PURE__ @class */ (function () {
414
414
  }
415
415
  }
416
416
  }
417
+ if (ganttProp && ganttProp.baselineStartDate && cloneDate &&
418
+ ganttProp.baselineStartDate.getTime() > cloneDate.getTime()) {
419
+ cloneDate.setDate(cloneDate.getDate() + 1);
420
+ }
417
421
  return cloneDate;
418
422
  }
419
423
  };
@@ -4475,6 +4479,9 @@ var GanttChart = /** @__PURE__ @class */ (function () {
4475
4479
  this.parent.notify('chartMouseDown', e);
4476
4480
  this.parent.element.tabIndex = 0;
4477
4481
  }
4482
+ if (this.parent.editSettings.allowEditing && this.parent.treeGrid.element.getElementsByClassName('e-editedbatchcell').length > 0) {
4483
+ this.parent.treeGrid.endEdit();
4484
+ }
4478
4485
  };
4479
4486
  GanttChart.prototype.ganttChartMouseClick = function (e) {
4480
4487
  if (this.parent.autoFocusTasks) {
@@ -4555,6 +4562,12 @@ var GanttChart = /** @__PURE__ @class */ (function () {
4555
4562
  */
4556
4563
  GanttChart.prototype.documentMouseUp = function (e) {
4557
4564
  this.isGanttElement = true;
4565
+ if (e.target.classList.contains('e-treegridexpand') ||
4566
+ e.target.classList.contains('e-treegridcollapse')) {
4567
+ if (getValue('isEditCollapse', this.parent.treeGrid) === true) {
4568
+ setValue('isEditCollapse', false, this.parent.treeGrid);
4569
+ }
4570
+ }
4558
4571
  if (this.parent.allowRowDragAndDrop) {
4559
4572
  var ganttDragElemet = this.parent.element.querySelector('.e-ganttdrag');
4560
4573
  if (ganttDragElemet) {
@@ -11076,6 +11089,9 @@ var Dependency = /** @__PURE__ @class */ (function () {
11076
11089
  this.parent.dataOperation.updateParentItems(record, true);
11077
11090
  }
11078
11091
  }
11092
+ else if (record && record.hasChildRecords && !ganttProp) {
11093
+ this.parent.editModule['updateChildItems'](record);
11094
+ }
11079
11095
  }
11080
11096
  };
11081
11097
  /**
@@ -12776,7 +12792,6 @@ var FocusModule = /** @__PURE__ @class */ (function () {
12776
12792
  if (ganttObj.selectedRowIndex === ganttObj.flatData.indexOf(currentSelectingRecord)) {
12777
12793
  return;
12778
12794
  }
12779
- ganttObj.selectionModule.selectRow(ganttObj.flatData.indexOf(currentSelectingRecord), false, true);
12780
12795
  }
12781
12796
  break;
12782
12797
  case 'downArrow':
@@ -18735,14 +18750,20 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
18735
18750
  new Date(nextSegment.startDate.getTime()) : this.parent.cloneProjectEndDate;
18736
18751
  var eDate = !isNullOrUndefined(previousSegment) ?
18737
18752
  new Date(previousSegment.endDate.getTime()) : this.parent.cloneProjectStartDate;
18738
- sDate.setHours(0, 0, 0, 0);
18739
- eDate.setHours(0, 0, 0, 0);
18740
18753
  var cStartDate = new Date(segment.startDate.getTime());
18741
18754
  var cEndDate = new Date(segment.endDate.getTime());
18742
- cStartDate.setDate(cStartDate.getDate() - 1);
18743
- cEndDate.setDate(cEndDate.getDate() + 1);
18744
- cStartDate.setHours(0, 0, 0, 0);
18745
- cEndDate.setHours(0, 0, 0, 0);
18755
+ if (this.parent.timelineModule.topTier === 'Day' && this.parent.timelineModule.bottomTier === 'Hour') {
18756
+ cStartDate.setHours(cStartDate.getHours() - 1);
18757
+ cEndDate.setHours(cEndDate.getHours() + 1);
18758
+ }
18759
+ else {
18760
+ sDate.setHours(0, 0, 0, 0);
18761
+ eDate.setHours(0, 0, 0, 0);
18762
+ cStartDate.setDate(cStartDate.getDate() - 1);
18763
+ cEndDate.setDate(cEndDate.getDate() + 1);
18764
+ cStartDate.setHours(0, 0, 0, 0);
18765
+ cEndDate.setHours(0, 0, 0, 0);
18766
+ }
18746
18767
  if (cStartDate.getTime() <= eDate.getTime() && !isNullOrUndefined(previousSegment) && !isNullOrUndefined(segment)) {
18747
18768
  var segmentIndexes = [
18748
18769
  { 'firstSegmentIndex': previousSegment.segmentIndex, 'secondSegmentIndex': segment.segmentIndex }
@@ -20875,7 +20896,7 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
20875
20896
  inputElement = this.createInputElement('', ganttId + '' + column.field, column.field);
20876
20897
  divElement.appendChild(inputElement);
20877
20898
  }
20878
- inputModel.enabled = !this.isCheckIsDisabled(column);
20899
+ inputModel.enabled = !isNullOrUndefined(inputModel.enabled) ? inputModel.enabled : !this.isCheckIsDisabled(column);
20879
20900
  if (column.field === this.parent.taskFields.duration) {
20880
20901
  if (!isNullOrUndefined(column.valueAccessor)) {
20881
20902
  if (typeof column.valueAccessor === 'string') {
@@ -23079,6 +23100,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23079
23100
  this.parent.editedTaskBarItem = ganttRecord;
23080
23101
  }
23081
23102
  this.parent.predecessorModule.validatePredecessor(ganttRecord, [], '');
23103
+ this.parent.predecessorModule.isValidatedParentTaskID = '';
23082
23104
  }
23083
23105
  if (ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
23084
23106
  (args.action === "DrawConnectorLine" || args.action === "CellEditing" || args.action === "DialogEditing")) {
@@ -23615,6 +23637,12 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23615
23637
  }
23616
23638
  if (!isNullOrUndefined(unassignedTasks)) {
23617
23639
  this.addNewRecord(updateRecord, unassignedTasks);
23640
+ var updatedData = this.parent.currentViewData.filter(function (data) {
23641
+ return (data.ganttProperties.taskId === updateRecord.ganttProperties.taskId &&
23642
+ (data.hasChildRecords === updateRecord.hasChildRecords));
23643
+ })[0];
23644
+ updateRecord.parentItem = updatedData.parentItem;
23645
+ updateRecord.parentUniqueID = updatedData.parentUniqueID;
23618
23646
  }
23619
23647
  else {
23620
23648
  // Block for create the unassigned task.
@@ -23890,13 +23918,17 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23890
23918
  var data = selectedRecords[i];
23891
23919
  var ids = data.ganttProperties.sharedTaskUniqueIds;
23892
23920
  for (var j = 0; j < ids.length; j++) {
23893
- deleteRecords.push(this_1.parent.flatData[this_1.parent.ids.indexOf(ids[j].toString())]);
23921
+ if (this_1.parent.ids.indexOf(ids[j].toString()) !== -1) {
23922
+ deleteRecords.push(this_1.parent.flatData[this_1.parent.ids.indexOf(ids[j].toString())]);
23923
+ }
23924
+ }
23925
+ if (this_1.parent.ids.indexOf(data.ganttProperties.rowUniqueID) !== -1) {
23926
+ deleteRecords.push(this_1.parent.flatData[this_1.parent.ids.indexOf(data.ganttProperties.rowUniqueID)]);
23894
23927
  }
23895
- deleteRecords.push(this_1.parent.flatData[this_1.parent.ids.indexOf(data.ganttProperties.rowUniqueID)]);
23896
23928
  }
23897
23929
  else {
23898
23930
  var resourceParent = this_1.parent.flatData.filter(function (data) {
23899
- return (parseInt(data.ganttProperties.taskId) == parseInt(selectedRecords[i].ganttProperties.taskId) &&
23931
+ return (data.ganttProperties.taskId === selectedRecords[i].ganttProperties.taskId &&
23900
23932
  data.hasChildRecords);
23901
23933
  })[0];
23902
23934
  deleteRecords.push(resourceParent);
@@ -24281,6 +24313,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24281
24313
  });
24282
24314
  };
24283
24315
  Edit$$1.prototype.deleteSuccess = function (args) {
24316
+ var _this = this;
24284
24317
  var flatData = this.parent.flatData;
24285
24318
  var currentData = this.parent.currentViewData;
24286
24319
  var deletedRecords = this.parent.getRecordFromFlatdata(args.deletedRecordCollection);
@@ -24352,11 +24385,34 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24352
24385
  setValue('action', args.action, eventArgs);
24353
24386
  this.parent.isOnDelete = false;
24354
24387
  if (this.parent.viewType === 'ResourceView') {
24355
- var updateUnAssignedResources = eventArgs.data.filter(function (data) {
24388
+ var updateUnAssignedResources_1 = eventArgs.data.filter(function (data) {
24356
24389
  return !data.hasChildRecords;
24357
24390
  });
24358
- for (var i = 0; i < updateUnAssignedResources.length; i++) {
24359
- this.checkWithUnassignedTask(updateUnAssignedResources[i]);
24391
+ var _loop_2 = function (i) {
24392
+ var unassignedTask = this_2.parent.flatData.filter(function (data) {
24393
+ return data.ganttProperties.taskName === _this.parent.localeObj.getConstant('unassignedTask');
24394
+ })[0];
24395
+ var isDuplicate = unassignedTask.childRecords.filter(function (data) {
24396
+ return data.ganttProperties.taskId === updateUnAssignedResources_1[i].ganttProperties.taskId;
24397
+ });
24398
+ var parentTask = this_2.parent.getParentTask(updateUnAssignedResources_1[i].parentItem);
24399
+ if (parentTask && parentTask.ganttProperties.taskName !==
24400
+ this_2.parent.localeObj.getConstant('unassignedTask') && isDuplicate.length === 0) {
24401
+ this_2.checkWithUnassignedTask(updateUnAssignedResources_1[i]);
24402
+ if (parentTask) {
24403
+ this_2.parent.dataOperation.updateParentItems(updateUnAssignedResources_1[i].parentItem);
24404
+ }
24405
+ }
24406
+ else if (!parentTask && isDuplicate.length === 0) {
24407
+ this_2.checkWithUnassignedTask(updateUnAssignedResources_1[i]);
24408
+ if (updateUnAssignedResources_1[i].parentItem) {
24409
+ this_2.parent.dataOperation.updateParentItems(updateUnAssignedResources_1[i].parentItem);
24410
+ }
24411
+ }
24412
+ };
24413
+ var this_2 = this;
24414
+ for (var i = 0; i < updateUnAssignedResources_1.length; i++) {
24415
+ _loop_2(i);
24360
24416
  }
24361
24417
  }
24362
24418
  this.parent.trigger('actionComplete', eventArgs);
@@ -24813,27 +24869,27 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24813
24869
  }
24814
24870
  }
24815
24871
  }
24816
- var _loop_2 = function (i) {
24817
- var originalData = this_2.parent.modifiedRecords[i];
24818
- var treeIndex = this_2.parent.allowRowDragAndDrop ? 1 : 0;
24819
- var uniqueTaskID = this_2.parent.taskFields.id;
24820
- originalIndex = this_2.parent.currentViewData.findIndex(function (data) {
24872
+ var _loop_3 = function (i) {
24873
+ var originalData = this_3.parent.modifiedRecords[i];
24874
+ var treeIndex = this_3.parent.allowRowDragAndDrop ? 1 : 0;
24875
+ var uniqueTaskID = this_3.parent.taskFields.id;
24876
+ originalIndex = this_3.parent.currentViewData.findIndex(function (data) {
24821
24877
  return (data[uniqueTaskID] == originalData[uniqueTaskID]);
24822
24878
  });
24823
- if (this_2.parent.treeGrid.getRows()[originalIndex]) {
24824
- this_2.parent.treeGrid.renderModule.cellRender({
24825
- data: originalData, cell: this_2.parent.treeGrid.getRows()[originalIndex].cells[this_2.parent.treeColumnIndex + treeIndex],
24826
- column: this_2.parent.treeGrid.grid.getColumns()[this_2.parent.treeColumnIndex],
24879
+ if (this_3.parent.treeGrid.getRows()[originalIndex]) {
24880
+ this_3.parent.treeGrid.renderModule.cellRender({
24881
+ data: originalData, cell: this_3.parent.treeGrid.getRows()[originalIndex].cells[this_3.parent.treeColumnIndex + treeIndex],
24882
+ column: this_3.parent.treeGrid.grid.getColumns()[this_3.parent.treeColumnIndex],
24827
24883
  requestType: 'rowDragAndDrop'
24828
24884
  });
24829
- this_2.parent.treeGrid.renderModule.RowModifier({
24830
- data: originalData, row: this_2.parent.treeGrid.getRows()[originalIndex], rowHeight: this_2.parent.rowHeight
24885
+ this_3.parent.treeGrid.renderModule.RowModifier({
24886
+ data: originalData, row: this_3.parent.treeGrid.getRows()[originalIndex], rowHeight: this_3.parent.rowHeight
24831
24887
  });
24832
24888
  }
24833
24889
  };
24834
- var this_2 = this, originalIndex;
24890
+ var this_3 = this, originalIndex;
24835
24891
  for (var i = 0; i < this.parent.modifiedRecords.length; i++) {
24836
- _loop_2(i);
24892
+ _loop_3(i);
24837
24893
  }
24838
24894
  };
24839
24895
  /**