@syncfusion/ej2-gantt 20.3.56 → 20.3.57

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/ej2-gantt.min.js +2 -2
  3. package/dist/ej2-gantt.umd.min.js +2 -2
  4. package/dist/ej2-gantt.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-gantt.es2015.js +57 -19
  6. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  7. package/dist/es6/ej2-gantt.es5.js +57 -19
  8. package/dist/es6/ej2-gantt.es5.js.map +1 -1
  9. package/dist/global/ej2-gantt.min.js +2 -2
  10. package/dist/global/ej2-gantt.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +13 -13
  13. package/src/gantt/actions/dependency.js +20 -4
  14. package/src/gantt/actions/dialog-edit.js +14 -8
  15. package/src/gantt/actions/edit.d.ts +1 -0
  16. package/src/gantt/actions/edit.js +13 -3
  17. package/src/gantt/base/gantt.d.ts +4 -0
  18. package/src/gantt/base/gantt.js +6 -0
  19. package/src/gantt/base/task-processor.js +1 -1
  20. package/src/gantt/base/tree-grid.js +1 -1
  21. package/src/gantt/renderer/chart-rows.js +1 -1
  22. package/src/gantt/renderer/timeline.js +1 -1
  23. package/styles/bootstrap-dark.css +122 -61
  24. package/styles/bootstrap.css +124 -62
  25. package/styles/bootstrap4.css +122 -61
  26. package/styles/bootstrap5-dark.css +122 -61
  27. package/styles/bootstrap5.css +122 -61
  28. package/styles/fabric-dark.css +122 -61
  29. package/styles/fabric.css +122 -61
  30. package/styles/fluent-dark.css +122 -61
  31. package/styles/fluent.css +122 -61
  32. package/styles/gantt/bootstrap-dark.css +122 -61
  33. package/styles/gantt/bootstrap.css +124 -62
  34. package/styles/gantt/bootstrap4.css +122 -61
  35. package/styles/gantt/bootstrap5-dark.css +122 -61
  36. package/styles/gantt/bootstrap5.css +122 -61
  37. package/styles/gantt/fabric-dark.css +122 -61
  38. package/styles/gantt/fabric.css +122 -61
  39. package/styles/gantt/fluent-dark.css +122 -61
  40. package/styles/gantt/fluent.css +122 -61
  41. package/styles/gantt/highcontrast-light.css +122 -61
  42. package/styles/gantt/highcontrast.css +122 -61
  43. package/styles/gantt/material-dark.css +128 -64
  44. package/styles/gantt/material.css +128 -64
  45. package/styles/gantt/tailwind-dark.css +126 -63
  46. package/styles/gantt/tailwind.css +126 -63
  47. package/styles/highcontrast-light.css +122 -61
  48. package/styles/highcontrast.css +122 -61
  49. package/styles/material-dark.css +128 -64
  50. package/styles/material.css +128 -64
  51. package/styles/tailwind-dark.css +126 -63
  52. package/styles/tailwind.css +126 -63
@@ -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;
@@ -7429,7 +7429,7 @@ var GanttTreeGrid = /** @__PURE__ @class */ (function () {
7429
7429
  column.valueAccessor = column.valueAccessor ? column.valueAccessor : !isNullOrUndefined(column.edit) ? null :
7430
7430
  this.durationValueAccessor.bind(this);
7431
7431
  column.editType = column.editType ? column.editType : 'stringedit';
7432
- column.type = 'string';
7432
+ column.type = column.type ? column.type : 'string';
7433
7433
  }
7434
7434
  else if (taskSettings.progress === column.field) {
7435
7435
  this.composeProgressColumn(column);
@@ -9718,7 +9718,7 @@ var ChartRows = /** @__PURE__ @class */ (function (_super) {
9718
9718
  for (var index = 0; index < this.parent.currentViewData.length; index++) {
9719
9719
  var oldIndex = oldKeys[this.parent.currentViewData[index][key]];
9720
9720
  var modifiedRecIndex = this.parent.modifiedRecords.indexOf(this.parent.currentViewData[index]);
9721
- if (isNullOrUndefined(oldIndex) || modifiedRecIndex !== -1) {
9721
+ if (isNullOrUndefined(oldIndex) || modifiedRecIndex !== -1 || this.parent.isFromRenderBaseline) {
9722
9722
  var tRow = this.getGanttChartRow(index, this.parent.currentViewData[index]);
9723
9723
  this.ganttChartTableBody.appendChild(tRow);
9724
9724
  this.refreshedTr.push(this.ganttChartTableBody.querySelectorAll('tr')[index]);
@@ -10987,6 +10987,11 @@ var Dependency = /** @__PURE__ @class */ (function () {
10987
10987
  return;
10988
10988
  }
10989
10989
  if (childGanttRecord.ganttProperties.predecessor) {
10990
+ var taskBarModule = this.parent.editModule.taskbarEditModule;
10991
+ var ganttProp = void 0;
10992
+ if (taskBarModule) {
10993
+ ganttProp = taskBarModule.taskBarEditRecord;
10994
+ }
10990
10995
  var predecessorsCollection = childGanttRecord.ganttProperties.predecessor;
10991
10996
  var parentGanttRecord = void 0;
10992
10997
  var record = null;
@@ -11051,10 +11056,21 @@ var Dependency = /** @__PURE__ @class */ (function () {
11051
11056
  this.validatePredecessor(record, undefined, 'successor');
11052
11057
  }
11053
11058
  }
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;
11059
+ if (record && record.ganttProperties.taskId !== this.isValidatedParentTaskID && ganttProp) {
11060
+ if ((taskBarModule.taskBarEditAction !== 'ParentDrag' && taskBarModule.taskBarEditAction !== 'ChildDrag')) {
11061
+ if (!ganttProp.hasChildRecords && record.hasChildRecords) {
11062
+ this.parent.editModule['updateChildItems'](record);
11063
+ this.isValidatedParentTaskID = record.ganttProperties.taskId;
11064
+ }
11065
+ }
11066
+ else if ((record.hasChildRecords && taskBarModule.taskBarEditAction == 'ChildDrag') ||
11067
+ (!ganttProp.ganttProperties.predecessorsName && taskBarModule.taskBarEditAction == 'ParentDrag')) {
11068
+ this.parent.editModule['updateChildItems'](record);
11069
+ this.isValidatedParentTaskID = record.ganttProperties.taskId;
11070
+ }
11071
+ if (!ganttProp.hasChildRecords) {
11072
+ this.parent.dataOperation.updateParentItems(record, true);
11073
+ }
11058
11074
  }
11059
11075
  }
11060
11076
  };
@@ -13066,6 +13082,10 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
13066
13082
  * @private
13067
13083
  */
13068
13084
  _this.isFromOnPropertyChange = false;
13085
+ /**
13086
+ * @private
13087
+ */
13088
+ _this.isFromRenderBaseline = false;
13069
13089
  /**
13070
13090
  * @private
13071
13091
  */
@@ -13993,8 +14013,10 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
13993
14013
  case 'labelSettings':
13994
14014
  case 'renderBaseline':
13995
14015
  case 'baselineColor':
14016
+ this.isFromRenderBaseline = true;
13996
14017
  this.chartRowsModule.initiateTemplates();
13997
14018
  this.chartRowsModule.refreshGanttRows();
14019
+ this.isFromRenderBaseline = false;
13998
14020
  break;
13999
14021
  case 'resourceIDMapping':
14000
14022
  case 'resourceNameMapping':
@@ -21182,17 +21204,19 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
21182
21204
  this.parent.setRecordValue('durationUnit', fromRecord.ganttProperties.durationUnit, toRecord.ganttProperties, true);
21183
21205
  this.parent.setRecordValue('work', fromRecord.ganttProperties.work, toRecord.ganttProperties, true);
21184
21206
  this.parent.setRecordValue('type', fromRecord.ganttProperties.taskType, toRecord.ganttProperties, true);
21207
+ this.parent.setRecordValue('resourceNames', fromRecord.ganttProperties.resourceNames, toRecord.ganttProperties, true);
21208
+ this.parent.setRecordValue('resourceInfo', fromRecord.ganttProperties.resourceInfo, toRecord.ganttProperties, true);
21185
21209
  if (!isNullOrUndefined(this.parent.taskFields.startDate)) {
21186
- this.parent.dataOperation.updateMappingData(this.rowData, this.parent.taskFields.startDate);
21210
+ this.parent.dataOperation.updateMappingData(toRecord, this.parent.taskFields.startDate);
21187
21211
  }
21188
21212
  if (!isNullOrUndefined(this.parent.taskFields.endDate)) {
21189
- this.parent.dataOperation.updateMappingData(this.rowData, this.parent.taskFields.endDate);
21213
+ this.parent.dataOperation.updateMappingData(toRecord, this.parent.taskFields.endDate);
21190
21214
  }
21191
21215
  if (!isNullOrUndefined(this.parent.taskFields.duration)) {
21192
- this.parent.dataOperation.updateMappingData(this.rowData, this.parent.taskFields.duration);
21216
+ this.parent.dataOperation.updateMappingData(toRecord, this.parent.taskFields.duration);
21193
21217
  this.parent.setRecordValue('durationUnit', fromRecord.ganttProperties.durationUnit, this.rowData, true);
21194
21218
  if (this.rowData.ganttProperties.duration === 0) {
21195
- this.parent.setRecordValue('isMilestone', true, this.rowData.ganttProperties, true);
21219
+ this.parent.setRecordValue('isMilestone', true, toRecord.ganttProperties, true);
21196
21220
  }
21197
21221
  else {
21198
21222
  this.parent.setRecordValue('isMilestone', false, this.rowData.ganttProperties, true);
@@ -21207,6 +21231,9 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
21207
21231
  if (!isNullOrUndefined(this.parent.taskFields.type)) {
21208
21232
  this.parent.dataOperation.updateMappingData(this.rowData, "type");
21209
21233
  }
21234
+ if (!isNullOrUndefined(this.parent.taskFields.resourceInfo)) {
21235
+ this.parent.dataOperation.updateMappingData(this.rowData, "resourceInfo");
21236
+ }
21210
21237
  };
21211
21238
  DialogEdit.prototype.updatePredecessorTab = function (preElement) {
21212
21239
  var gridObj = preElement.ej2_instances[0];
@@ -21269,10 +21296,11 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
21269
21296
  }
21270
21297
  var idArray = [];
21271
21298
  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);
21299
+ this.parent.setRecordValue('resourceInfo', selectedItems, this.editedRecord.ganttProperties, true);
21300
+ this.parent.dataOperation.updateMappingData(this.editedRecord, 'resourceInfo');
21301
+ this.parent.editModule.updateResourceRelatedFields(this.editedRecord, 'resource');
21302
+ this.validateDuration(this.editedRecord);
21303
+ this.updateScheduleProperties(this.editedRecord, this.rowData);
21276
21304
  }
21277
21305
  else {
21278
21306
  for (var i = 0; i < selectedItems.length; i++) {
@@ -22256,6 +22284,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
22256
22284
  function Edit$$1(parent) {
22257
22285
  this.isFromDeleteMethod = false;
22258
22286
  this.targetedRecords = [];
22287
+ this.isNewRecordAdded = false;
22259
22288
  /** @hidden */
22260
22289
  this.updateParentRecords = [];
22261
22290
  /** @hidden */
@@ -23057,7 +23086,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23057
23086
  if (ganttRecord.parentItem) {
23058
23087
  this.parent.dataOperation.updateParentItems(ganttRecord, true);
23059
23088
  var parentData = this.parent.getRecordByID(ganttRecord.parentItem.taskId);
23060
- if (parentData.ganttProperties.predecessor) {
23089
+ if (!parentData.ganttProperties.predecessorsName) {
23061
23090
  this.parent.predecessorModule.validatePredecessor(parentData, [], '');
23062
23091
  this.updateParentItemOnEditing();
23063
23092
  }
@@ -24710,6 +24739,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24710
24739
  parentItem.taskData[child] = [];
24711
24740
  parentItem.taskData[child].push(record.taskData);
24712
24741
  }
24742
+ this.isNewRecordAdded = true;
24713
24743
  }
24714
24744
  }
24715
24745
  };
@@ -24828,9 +24858,10 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24828
24858
  dataSource.push(addedRecord[i].taskData);
24829
24859
  }
24830
24860
  else {
24831
- if (isNullOrUndefined(addedRecord[i].parentItem)) {
24861
+ if (!this.isNewRecordAdded) {
24832
24862
  this.addDataInRealDataSource(dataSource, addedRecord[i].taskData, rowPosition);
24833
24863
  }
24864
+ this.isNewRecordAdded = false;
24834
24865
  }
24835
24866
  }
24836
24867
  this.isBreakLoop = false;
@@ -25560,7 +25591,14 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
25560
25591
  if (this.dropPosition === 'topSegment' || this.dropPosition === 'bottomSegment') {
25561
25592
  var rowPos = this.dropPosition === 'topSegment' ? 'Above' : 'Below';
25562
25593
  this.parent.editModule.addRowSelectedItem = droppedRec;
25563
- this.parent.editModule.updateRealDataSource(draggedRec, rowPos);
25594
+ var dragRecord = [];
25595
+ if (!Array.isArray(draggedRec)) {
25596
+ dragRecord[0] = draggedRec;
25597
+ }
25598
+ else {
25599
+ dragRecord = draggedRec;
25600
+ }
25601
+ this.parent.editModule.updateRealDataSource(dragRecord, rowPos);
25564
25602
  delete this.parent.editModule.addRowSelectedItem;
25565
25603
  }
25566
25604
  }