@syncfusion/ej2-gantt 20.3.59 → 20.3.60

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.
@@ -4475,6 +4475,9 @@ var GanttChart = /** @__PURE__ @class */ (function () {
4475
4475
  this.parent.notify('chartMouseDown', e);
4476
4476
  this.parent.element.tabIndex = 0;
4477
4477
  }
4478
+ if (this.parent.editSettings.allowEditing && this.parent.treeGrid.element.getElementsByClassName('e-editedbatchcell').length > 0) {
4479
+ this.parent.treeGrid.endEdit();
4480
+ }
4478
4481
  };
4479
4482
  GanttChart.prototype.ganttChartMouseClick = function (e) {
4480
4483
  if (this.parent.autoFocusTasks) {
@@ -11076,6 +11079,9 @@ var Dependency = /** @__PURE__ @class */ (function () {
11076
11079
  this.parent.dataOperation.updateParentItems(record, true);
11077
11080
  }
11078
11081
  }
11082
+ else if (record && record.hasChildRecords && !ganttProp) {
11083
+ this.parent.editModule['updateChildItems'](record);
11084
+ }
11079
11085
  }
11080
11086
  };
11081
11087
  /**
@@ -12776,7 +12782,6 @@ var FocusModule = /** @__PURE__ @class */ (function () {
12776
12782
  if (ganttObj.selectedRowIndex === ganttObj.flatData.indexOf(currentSelectingRecord)) {
12777
12783
  return;
12778
12784
  }
12779
- ganttObj.selectionModule.selectRow(ganttObj.flatData.indexOf(currentSelectingRecord), false, true);
12780
12785
  }
12781
12786
  break;
12782
12787
  case 'downArrow':
@@ -18735,14 +18740,20 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
18735
18740
  new Date(nextSegment.startDate.getTime()) : this.parent.cloneProjectEndDate;
18736
18741
  var eDate = !isNullOrUndefined(previousSegment) ?
18737
18742
  new Date(previousSegment.endDate.getTime()) : this.parent.cloneProjectStartDate;
18738
- sDate.setHours(0, 0, 0, 0);
18739
- eDate.setHours(0, 0, 0, 0);
18740
18743
  var cStartDate = new Date(segment.startDate.getTime());
18741
18744
  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);
18745
+ if (this.parent.timelineModule.topTier === 'Day' && this.parent.timelineModule.bottomTier === 'Hour') {
18746
+ cStartDate.setHours(cStartDate.getHours() - 1);
18747
+ cEndDate.setHours(cEndDate.getHours() + 1);
18748
+ }
18749
+ else {
18750
+ sDate.setHours(0, 0, 0, 0);
18751
+ eDate.setHours(0, 0, 0, 0);
18752
+ cStartDate.setDate(cStartDate.getDate() - 1);
18753
+ cEndDate.setDate(cEndDate.getDate() + 1);
18754
+ cStartDate.setHours(0, 0, 0, 0);
18755
+ cEndDate.setHours(0, 0, 0, 0);
18756
+ }
18746
18757
  if (cStartDate.getTime() <= eDate.getTime() && !isNullOrUndefined(previousSegment) && !isNullOrUndefined(segment)) {
18747
18758
  var segmentIndexes = [
18748
18759
  { 'firstSegmentIndex': previousSegment.segmentIndex, 'secondSegmentIndex': segment.segmentIndex }
@@ -20875,7 +20886,7 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
20875
20886
  inputElement = this.createInputElement('', ganttId + '' + column.field, column.field);
20876
20887
  divElement.appendChild(inputElement);
20877
20888
  }
20878
- inputModel.enabled = !this.isCheckIsDisabled(column);
20889
+ inputModel.enabled = !isNullOrUndefined(inputModel.enabled) ? inputModel.enabled : !this.isCheckIsDisabled(column);
20879
20890
  if (column.field === this.parent.taskFields.duration) {
20880
20891
  if (!isNullOrUndefined(column.valueAccessor)) {
20881
20892
  if (typeof column.valueAccessor === 'string') {
@@ -23079,6 +23090,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23079
23090
  this.parent.editedTaskBarItem = ganttRecord;
23080
23091
  }
23081
23092
  this.parent.predecessorModule.validatePredecessor(ganttRecord, [], '');
23093
+ this.parent.predecessorModule.isValidatedParentTaskID = '';
23082
23094
  }
23083
23095
  if (ganttRecord.hasChildRecords && this.parent.previousRecords[ganttRecord.uniqueID].ganttProperties.startDate &&
23084
23096
  (args.action === "DrawConnectorLine" || args.action === "CellEditing" || args.action === "DialogEditing")) {
@@ -23615,6 +23627,12 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23615
23627
  }
23616
23628
  if (!isNullOrUndefined(unassignedTasks)) {
23617
23629
  this.addNewRecord(updateRecord, unassignedTasks);
23630
+ var updatedData = this.parent.currentViewData.filter(function (data) {
23631
+ return (data.ganttProperties.taskId === updateRecord.ganttProperties.taskId &&
23632
+ (data.hasChildRecords === updateRecord.hasChildRecords));
23633
+ })[0];
23634
+ updateRecord.parentItem = updatedData.parentItem;
23635
+ updateRecord.parentUniqueID = updatedData.parentUniqueID;
23618
23636
  }
23619
23637
  else {
23620
23638
  // Block for create the unassigned task.
@@ -23890,13 +23908,17 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23890
23908
  var data = selectedRecords[i];
23891
23909
  var ids = data.ganttProperties.sharedTaskUniqueIds;
23892
23910
  for (var j = 0; j < ids.length; j++) {
23893
- deleteRecords.push(this_1.parent.flatData[this_1.parent.ids.indexOf(ids[j].toString())]);
23911
+ if (this_1.parent.ids.indexOf(ids[j].toString()) !== -1) {
23912
+ deleteRecords.push(this_1.parent.flatData[this_1.parent.ids.indexOf(ids[j].toString())]);
23913
+ }
23914
+ }
23915
+ if (this_1.parent.ids.indexOf(data.ganttProperties.rowUniqueID) !== -1) {
23916
+ deleteRecords.push(this_1.parent.flatData[this_1.parent.ids.indexOf(data.ganttProperties.rowUniqueID)]);
23894
23917
  }
23895
- deleteRecords.push(this_1.parent.flatData[this_1.parent.ids.indexOf(data.ganttProperties.rowUniqueID)]);
23896
23918
  }
23897
23919
  else {
23898
23920
  var resourceParent = this_1.parent.flatData.filter(function (data) {
23899
- return (parseInt(data.ganttProperties.taskId) == parseInt(selectedRecords[i].ganttProperties.taskId) &&
23921
+ return (data.ganttProperties.taskId === selectedRecords[i].ganttProperties.taskId &&
23900
23922
  data.hasChildRecords);
23901
23923
  })[0];
23902
23924
  deleteRecords.push(resourceParent);
@@ -24281,6 +24303,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24281
24303
  });
24282
24304
  };
24283
24305
  Edit$$1.prototype.deleteSuccess = function (args) {
24306
+ var _this = this;
24284
24307
  var flatData = this.parent.flatData;
24285
24308
  var currentData = this.parent.currentViewData;
24286
24309
  var deletedRecords = this.parent.getRecordFromFlatdata(args.deletedRecordCollection);
@@ -24352,11 +24375,34 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24352
24375
  setValue('action', args.action, eventArgs);
24353
24376
  this.parent.isOnDelete = false;
24354
24377
  if (this.parent.viewType === 'ResourceView') {
24355
- var updateUnAssignedResources = eventArgs.data.filter(function (data) {
24378
+ var updateUnAssignedResources_1 = eventArgs.data.filter(function (data) {
24356
24379
  return !data.hasChildRecords;
24357
24380
  });
24358
- for (var i = 0; i < updateUnAssignedResources.length; i++) {
24359
- this.checkWithUnassignedTask(updateUnAssignedResources[i]);
24381
+ var _loop_2 = function (i) {
24382
+ var unassignedTask = this_2.parent.flatData.filter(function (data) {
24383
+ return data.ganttProperties.taskName === _this.parent.localeObj.getConstant('unassignedTask');
24384
+ })[0];
24385
+ var isDuplicate = unassignedTask.childRecords.filter(function (data) {
24386
+ return data.ganttProperties.taskId === updateUnAssignedResources_1[i].ganttProperties.taskId;
24387
+ });
24388
+ var parentTask = this_2.parent.getParentTask(updateUnAssignedResources_1[i].parentItem);
24389
+ if (parentTask && parentTask.ganttProperties.taskName !==
24390
+ this_2.parent.localeObj.getConstant('unassignedTask') && isDuplicate.length === 0) {
24391
+ this_2.checkWithUnassignedTask(updateUnAssignedResources_1[i]);
24392
+ if (parentTask) {
24393
+ this_2.parent.dataOperation.updateParentItems(updateUnAssignedResources_1[i].parentItem);
24394
+ }
24395
+ }
24396
+ else if (!parentTask && isDuplicate.length === 0) {
24397
+ this_2.checkWithUnassignedTask(updateUnAssignedResources_1[i]);
24398
+ if (updateUnAssignedResources_1[i].parentItem) {
24399
+ this_2.parent.dataOperation.updateParentItems(updateUnAssignedResources_1[i].parentItem);
24400
+ }
24401
+ }
24402
+ };
24403
+ var this_2 = this;
24404
+ for (var i = 0; i < updateUnAssignedResources_1.length; i++) {
24405
+ _loop_2(i);
24360
24406
  }
24361
24407
  }
24362
24408
  this.parent.trigger('actionComplete', eventArgs);
@@ -24813,27 +24859,27 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24813
24859
  }
24814
24860
  }
24815
24861
  }
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) {
24862
+ var _loop_3 = function (i) {
24863
+ var originalData = this_3.parent.modifiedRecords[i];
24864
+ var treeIndex = this_3.parent.allowRowDragAndDrop ? 1 : 0;
24865
+ var uniqueTaskID = this_3.parent.taskFields.id;
24866
+ originalIndex = this_3.parent.currentViewData.findIndex(function (data) {
24821
24867
  return (data[uniqueTaskID] == originalData[uniqueTaskID]);
24822
24868
  });
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],
24869
+ if (this_3.parent.treeGrid.getRows()[originalIndex]) {
24870
+ this_3.parent.treeGrid.renderModule.cellRender({
24871
+ data: originalData, cell: this_3.parent.treeGrid.getRows()[originalIndex].cells[this_3.parent.treeColumnIndex + treeIndex],
24872
+ column: this_3.parent.treeGrid.grid.getColumns()[this_3.parent.treeColumnIndex],
24827
24873
  requestType: 'rowDragAndDrop'
24828
24874
  });
24829
- this_2.parent.treeGrid.renderModule.RowModifier({
24830
- data: originalData, row: this_2.parent.treeGrid.getRows()[originalIndex], rowHeight: this_2.parent.rowHeight
24875
+ this_3.parent.treeGrid.renderModule.RowModifier({
24876
+ data: originalData, row: this_3.parent.treeGrid.getRows()[originalIndex], rowHeight: this_3.parent.rowHeight
24831
24877
  });
24832
24878
  }
24833
24879
  };
24834
- var this_2 = this, originalIndex;
24880
+ var this_3 = this, originalIndex;
24835
24881
  for (var i = 0; i < this.parent.modifiedRecords.length; i++) {
24836
- _loop_2(i);
24882
+ _loop_3(i);
24837
24883
  }
24838
24884
  };
24839
24885
  /**