@syncfusion/ej2-gantt 20.3.56 → 20.3.58

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.
@@ -1709,7 +1709,7 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
1709
1709
  }
1710
1710
  });
1711
1711
  }
1712
- else if (!tempData[child]) {
1712
+ else if (!tempData[child] || (tempData[child] && tempData[child].length === 0)) {
1713
1713
  unassignedTasks.push(tempData);
1714
1714
  }
1715
1715
  if (tempData[this_1.parent.taskFields.child] && tempData[this_1.parent.taskFields.child].length) {
@@ -6373,7 +6373,7 @@ var Timeline = /** @__PURE__ @class */ (function () {
6373
6373
  endDate.setHours(24, 0, 0, 0);
6374
6374
  }
6375
6375
  }
6376
- if ((this.isZooming || this.parent.isLoad || this.parent.isFromOnPropertyChange) && isNullOrUndefined(this.parent.projectEndDate)) {
6376
+ if (isNullOrUndefined(this.parent.projectEndDate)) {
6377
6377
  this.updateTimelineAfterZooming(endDate, false);
6378
6378
  }
6379
6379
  return endDate;
@@ -6807,9 +6807,9 @@ var Timeline = /** @__PURE__ @class */ (function () {
6807
6807
  var validStartLeft = this.parent.dataOperation.getTaskLeft(validStartDate, false);
6808
6808
  var validEndLeft = this.parent.dataOperation.getTaskLeft(validEndDate, false);
6809
6809
  var isChanged = void 0;
6810
- if (!isNullOrUndefined(maxStartLeft) && (maxStartLeft < this.bottomTierCellWidth || maxStartLeft <= validStartLeft)) {
6810
+ if (!isNullOrUndefined(maxStartLeft) && (minStartDate < this.timelineStartDate) && (maxStartLeft < this.bottomTierCellWidth || maxStartLeft <= validStartLeft)) {
6811
6811
  isChanged = 'prevTimeSpan';
6812
- minStartDate = minStartDate > this.timelineStartDate ? this.timelineStartDate : minStartDate;
6812
+ minStartDate = this.timelineStartDate;
6813
6813
  }
6814
6814
  else {
6815
6815
  minStartDate = this.timelineStartDate;
@@ -7076,7 +7076,8 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7076
7076
  if (!isNullOrUndefined(this.parent.toolbarModule) && !isNullOrUndefined(this.parent.toolbarModule.element)) {
7077
7077
  toolbarHeight = this.parent.toolbarModule.element.offsetHeight;
7078
7078
  }
7079
- this.parent.treeGrid.height = this.parent.ganttHeight - toolbarHeight - 46;
7079
+ this.parent.treeGrid.height =
7080
+ this.parent.element.getElementsByClassName('e-chart-scroll-container e-content')[0]['offsetHeight'] - 19;
7080
7081
  };
7081
7082
  GanttTreeGrid.prototype.getContentDiv = function () {
7082
7083
  return this.treeGridElement.querySelector('.e-content');
@@ -7429,7 +7430,7 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7429
7430
  column.valueAccessor = column.valueAccessor ? column.valueAccessor : !isNullOrUndefined(column.edit) ? null :
7430
7431
  this.durationValueAccessor.bind(this);
7431
7432
  column.editType = column.editType ? column.editType : 'stringedit';
7432
- column.type = 'string';
7433
+ column.type = column.type ? column.type : 'string';
7433
7434
  }
7434
7435
  else if (taskSettings.progress === column.field) {
7435
7436
  this.composeProgressColumn(column);
@@ -9718,7 +9719,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9718
9719
  for (var index = 0; index < this.parent.currentViewData.length; index++) {
9719
9720
  var oldIndex = oldKeys[this.parent.currentViewData[index][key]];
9720
9721
  var modifiedRecIndex = this.parent.modifiedRecords.indexOf(this.parent.currentViewData[index]);
9721
- if (isNullOrUndefined(oldIndex) || modifiedRecIndex !== -1) {
9722
+ if (isNullOrUndefined(oldIndex) || modifiedRecIndex !== -1 || this.parent.isFromRenderBaseline) {
9722
9723
  var tRow = this.getGanttChartRow(index, this.parent.currentViewData[index]);
9723
9724
  this.ganttChartTableBody.appendChild(tRow);
9724
9725
  this.refreshedTr.push(this.ganttChartTableBody.querySelectorAll('tr')[index]);
@@ -10987,6 +10988,11 @@ var Dependency = /** @__PURE__ @class */ (function () {
10987
10988
  return;
10988
10989
  }
10989
10990
  if (childGanttRecord.ganttProperties.predecessor) {
10991
+ var taskBarModule = this.parent.editModule.taskbarEditModule;
10992
+ var ganttProp = void 0;
10993
+ if (taskBarModule) {
10994
+ ganttProp = taskBarModule.taskBarEditRecord;
10995
+ }
10990
10996
  var predecessorsCollection = childGanttRecord.ganttProperties.predecessor;
10991
10997
  var parentGanttRecord = void 0;
10992
10998
  var record = null;
@@ -11051,10 +11057,21 @@ var Dependency = /** @__PURE__ @class */ (function () {
11051
11057
  this.validatePredecessor(record, undefined, 'successor');
11052
11058
  }
11053
11059
  }
11054
- if (record && record.hasChildRecords && record.ganttProperties.taskId !== this.isValidatedParentTaskID &&
11055
- this.parent.editModule['taskbarMoved']) {
11056
- this.parent.editModule['updateChildItems'](record);
11057
- this.isValidatedParentTaskID = record.ganttProperties.taskId;
11060
+ if (record && record.ganttProperties.taskId !== this.isValidatedParentTaskID && ganttProp) {
11061
+ if ((taskBarModule.taskBarEditAction !== 'ParentDrag' && taskBarModule.taskBarEditAction !== 'ChildDrag')) {
11062
+ if (!ganttProp.hasChildRecords && record.hasChildRecords) {
11063
+ this.parent.editModule['updateChildItems'](record);
11064
+ this.isValidatedParentTaskID = record.ganttProperties.taskId;
11065
+ }
11066
+ }
11067
+ else if ((record.hasChildRecords && taskBarModule.taskBarEditAction == 'ChildDrag') ||
11068
+ (!ganttProp.ganttProperties.predecessorsName && taskBarModule.taskBarEditAction == 'ParentDrag')) {
11069
+ this.parent.editModule['updateChildItems'](record);
11070
+ this.isValidatedParentTaskID = record.ganttProperties.taskId;
11071
+ }
11072
+ if (!ganttProp.hasChildRecords) {
11073
+ this.parent.dataOperation.updateParentItems(record, true);
11074
+ }
11058
11075
  }
11059
11076
  }
11060
11077
  };
@@ -13066,6 +13083,10 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
13066
13083
  * @private
13067
13084
  */
13068
13085
  _this.isFromOnPropertyChange = false;
13086
+ /**
13087
+ * @private
13088
+ */
13089
+ _this.isFromRenderBaseline = false;
13069
13090
  /**
13070
13091
  * @private
13071
13092
  */
@@ -13993,8 +14014,10 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
13993
14014
  case 'labelSettings':
13994
14015
  case 'renderBaseline':
13995
14016
  case 'baselineColor':
14017
+ this.isFromRenderBaseline = true;
13996
14018
  this.chartRowsModule.initiateTemplates();
13997
14019
  this.chartRowsModule.refreshGanttRows();
14020
+ this.isFromRenderBaseline = false;
13998
14021
  break;
13999
14022
  case 'resourceIDMapping':
14000
14023
  case 'resourceNameMapping':
@@ -21182,17 +21205,19 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
21182
21205
  this.parent.setRecordValue('durationUnit', fromRecord.ganttProperties.durationUnit, toRecord.ganttProperties, true);
21183
21206
  this.parent.setRecordValue('work', fromRecord.ganttProperties.work, toRecord.ganttProperties, true);
21184
21207
  this.parent.setRecordValue('type', fromRecord.ganttProperties.taskType, toRecord.ganttProperties, true);
21208
+ this.parent.setRecordValue('resourceNames', fromRecord.ganttProperties.resourceNames, toRecord.ganttProperties, true);
21209
+ this.parent.setRecordValue('resourceInfo', fromRecord.ganttProperties.resourceInfo, toRecord.ganttProperties, true);
21185
21210
  if (!isNullOrUndefined(this.parent.taskFields.startDate)) {
21186
- this.parent.dataOperation.updateMappingData(this.rowData, this.parent.taskFields.startDate);
21211
+ this.parent.dataOperation.updateMappingData(toRecord, this.parent.taskFields.startDate);
21187
21212
  }
21188
21213
  if (!isNullOrUndefined(this.parent.taskFields.endDate)) {
21189
- this.parent.dataOperation.updateMappingData(this.rowData, this.parent.taskFields.endDate);
21214
+ this.parent.dataOperation.updateMappingData(toRecord, this.parent.taskFields.endDate);
21190
21215
  }
21191
21216
  if (!isNullOrUndefined(this.parent.taskFields.duration)) {
21192
- this.parent.dataOperation.updateMappingData(this.rowData, this.parent.taskFields.duration);
21217
+ this.parent.dataOperation.updateMappingData(toRecord, this.parent.taskFields.duration);
21193
21218
  this.parent.setRecordValue('durationUnit', fromRecord.ganttProperties.durationUnit, this.rowData, true);
21194
21219
  if (this.rowData.ganttProperties.duration === 0) {
21195
- this.parent.setRecordValue('isMilestone', true, this.rowData.ganttProperties, true);
21220
+ this.parent.setRecordValue('isMilestone', true, toRecord.ganttProperties, true);
21196
21221
  }
21197
21222
  else {
21198
21223
  this.parent.setRecordValue('isMilestone', false, this.rowData.ganttProperties, true);
@@ -21207,6 +21232,9 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
21207
21232
  if (!isNullOrUndefined(this.parent.taskFields.type)) {
21208
21233
  this.parent.dataOperation.updateMappingData(this.rowData, "type");
21209
21234
  }
21235
+ if (!isNullOrUndefined(this.parent.taskFields.resourceInfo)) {
21236
+ this.parent.dataOperation.updateMappingData(this.rowData, "resourceInfo");
21237
+ }
21210
21238
  };
21211
21239
  DialogEdit.prototype.updatePredecessorTab = function (preElement) {
21212
21240
  var gridObj = preElement.ej2_instances[0];
@@ -21269,10 +21297,11 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
21269
21297
  }
21270
21298
  var idArray = [];
21271
21299
  if (this.isEdit) {
21272
- this.parent.setRecordValue('resourceInfo', selectedItems, this.rowData.ganttProperties, true);
21273
- this.parent.dataOperation.updateMappingData(this.rowData, 'resourceInfo');
21274
- this.parent.editModule.updateResourceRelatedFields(this.rowData, 'resource');
21275
- this.validateDuration(this.rowData);
21300
+ this.parent.setRecordValue('resourceInfo', selectedItems, this.editedRecord.ganttProperties, true);
21301
+ this.parent.dataOperation.updateMappingData(this.editedRecord, 'resourceInfo');
21302
+ this.parent.editModule.updateResourceRelatedFields(this.editedRecord, 'resource');
21303
+ this.validateDuration(this.editedRecord);
21304
+ this.updateScheduleProperties(this.editedRecord, this.rowData);
21276
21305
  }
21277
21306
  else {
21278
21307
  for (var i = 0; i < selectedItems.length; i++) {
@@ -22256,6 +22285,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
22256
22285
  function Edit$$1(parent) {
22257
22286
  this.isFromDeleteMethod = false;
22258
22287
  this.targetedRecords = [];
22288
+ this.isNewRecordAdded = false;
22259
22289
  /** @hidden */
22260
22290
  this.updateParentRecords = [];
22261
22291
  /** @hidden */
@@ -23057,7 +23087,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23057
23087
  if (ganttRecord.parentItem) {
23058
23088
  this.parent.dataOperation.updateParentItems(ganttRecord, true);
23059
23089
  var parentData = this.parent.getRecordByID(ganttRecord.parentItem.taskId);
23060
- if (parentData.ganttProperties.predecessor) {
23090
+ if (!parentData.ganttProperties.predecessorsName) {
23061
23091
  this.parent.predecessorModule.validatePredecessor(parentData, [], '');
23062
23092
  this.updateParentItemOnEditing();
23063
23093
  }
@@ -24710,6 +24740,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24710
24740
  parentItem.taskData[child] = [];
24711
24741
  parentItem.taskData[child].push(record.taskData);
24712
24742
  }
24743
+ this.isNewRecordAdded = true;
24713
24744
  }
24714
24745
  }
24715
24746
  };
@@ -24828,9 +24859,10 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24828
24859
  dataSource.push(addedRecord[i].taskData);
24829
24860
  }
24830
24861
  else {
24831
- if (isNullOrUndefined(addedRecord[i].parentItem)) {
24862
+ if (!this.isNewRecordAdded) {
24832
24863
  this.addDataInRealDataSource(dataSource, addedRecord[i].taskData, rowPosition);
24833
24864
  }
24865
+ this.isNewRecordAdded = false;
24834
24866
  }
24835
24867
  }
24836
24868
  this.isBreakLoop = false;
@@ -25560,7 +25592,14 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
25560
25592
  if (this.dropPosition === 'topSegment' || this.dropPosition === 'bottomSegment') {
25561
25593
  var rowPos = this.dropPosition === 'topSegment' ? 'Above' : 'Below';
25562
25594
  this.parent.editModule.addRowSelectedItem = droppedRec;
25563
- this.parent.editModule.updateRealDataSource(draggedRec, rowPos);
25595
+ var dragRecord = [];
25596
+ if (!Array.isArray(draggedRec)) {
25597
+ dragRecord[0] = draggedRec;
25598
+ }
25599
+ else {
25600
+ dragRecord = draggedRec;
25601
+ }
25602
+ this.parent.editModule.updateRealDataSource(dragRecord, rowPos);
25564
25603
  delete this.parent.editModule.addRowSelectedItem;
25565
25604
  }
25566
25605
  }
@@ -26649,6 +26688,9 @@ var Selection$1 = /** @__PURE__ @class */ (function () {
26649
26688
  this.selectRows(this.selectedRowIndexes);
26650
26689
  };
26651
26690
  Selection$$1.prototype.addRemoveClass = function (records) {
26691
+ if (typeof (records) == "number") {
26692
+ records = Array.from(String(records), function (num) { return Number(num); });
26693
+ }
26652
26694
  var ganttRow = [].slice.call(this.parent.ganttChartModule.chartBodyContent.querySelector('tbody').children);
26653
26695
  var _loop_1 = function (i) {
26654
26696
  var selectedRow = ganttRow.filter(function (e) {