@syncfusion/ej2-gantt 20.3.52 → 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 +18 -18
  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
@@ -1685,7 +1685,7 @@ class TaskProcessor extends DateProcessor {
1685
1685
  }
1686
1686
  });
1687
1687
  }
1688
- else if (!tempData[child]) {
1688
+ else if (!tempData[child] || (tempData[child] && tempData[child].length === 0)) {
1689
1689
  unassignedTasks.push(tempData);
1690
1690
  }
1691
1691
  if (tempData[this.parent.taskFields.child] && tempData[this.parent.taskFields.child].length) {
@@ -6307,7 +6307,7 @@ class Timeline {
6307
6307
  endDate.setHours(24, 0, 0, 0);
6308
6308
  }
6309
6309
  }
6310
- if ((this.isZooming || this.parent.isLoad || this.parent.isFromOnPropertyChange) && isNullOrUndefined(this.parent.projectEndDate)) {
6310
+ if (isNullOrUndefined(this.parent.projectEndDate)) {
6311
6311
  this.updateTimelineAfterZooming(endDate, false);
6312
6312
  }
6313
6313
  return endDate;
@@ -7356,7 +7356,7 @@ class GanttTreeGrid {
7356
7356
  column.valueAccessor = column.valueAccessor ? column.valueAccessor : !isNullOrUndefined(column.edit) ? null :
7357
7357
  this.durationValueAccessor.bind(this);
7358
7358
  column.editType = column.editType ? column.editType : 'stringedit';
7359
- column.type = 'string';
7359
+ column.type = column.type ? column.type : 'string';
7360
7360
  }
7361
7361
  else if (taskSettings.progress === column.field) {
7362
7362
  this.composeProgressColumn(column);
@@ -9330,7 +9330,7 @@ class ChartRows extends DateProcessor {
9330
9330
  for (let index = 0; index < this.parent.currentViewData.length; index++) {
9331
9331
  const oldIndex = oldKeys[this.parent.currentViewData[index][key]];
9332
9332
  const modifiedRecIndex = this.parent.modifiedRecords.indexOf(this.parent.currentViewData[index]);
9333
- if (isNullOrUndefined(oldIndex) || modifiedRecIndex !== -1) {
9333
+ if (isNullOrUndefined(oldIndex) || modifiedRecIndex !== -1 || this.parent.isFromRenderBaseline) {
9334
9334
  const tRow = this.getGanttChartRow(index, this.parent.currentViewData[index]);
9335
9335
  this.ganttChartTableBody.appendChild(tRow);
9336
9336
  this.refreshedTr.push(this.ganttChartTableBody.querySelectorAll('tr')[index]);
@@ -10595,6 +10595,11 @@ class Dependency {
10595
10595
  return;
10596
10596
  }
10597
10597
  if (childGanttRecord.ganttProperties.predecessor) {
10598
+ const taskBarModule = this.parent.editModule.taskbarEditModule;
10599
+ let ganttProp;
10600
+ if (taskBarModule) {
10601
+ ganttProp = taskBarModule.taskBarEditRecord;
10602
+ }
10598
10603
  const predecessorsCollection = childGanttRecord.ganttProperties.predecessor;
10599
10604
  let parentGanttRecord;
10600
10605
  let record = null;
@@ -10659,10 +10664,21 @@ class Dependency {
10659
10664
  this.validatePredecessor(record, undefined, 'successor');
10660
10665
  }
10661
10666
  }
10662
- if (record && record.hasChildRecords && record.ganttProperties.taskId !== this.isValidatedParentTaskID &&
10663
- this.parent.editModule['taskbarMoved']) {
10664
- this.parent.editModule['updateChildItems'](record);
10665
- this.isValidatedParentTaskID = record.ganttProperties.taskId;
10667
+ if (record && record.ganttProperties.taskId !== this.isValidatedParentTaskID && ganttProp) {
10668
+ if ((taskBarModule.taskBarEditAction !== 'ParentDrag' && taskBarModule.taskBarEditAction !== 'ChildDrag')) {
10669
+ if (!ganttProp.hasChildRecords && record.hasChildRecords) {
10670
+ this.parent.editModule['updateChildItems'](record);
10671
+ this.isValidatedParentTaskID = record.ganttProperties.taskId;
10672
+ }
10673
+ }
10674
+ else if ((record.hasChildRecords && taskBarModule.taskBarEditAction == 'ChildDrag') ||
10675
+ (!ganttProp.ganttProperties.predecessorsName && taskBarModule.taskBarEditAction == 'ParentDrag')) {
10676
+ this.parent.editModule['updateChildItems'](record);
10677
+ this.isValidatedParentTaskID = record.ganttProperties.taskId;
10678
+ }
10679
+ if (!ganttProp.hasChildRecords) {
10680
+ this.parent.dataOperation.updateParentItems(record, true);
10681
+ }
10666
10682
  }
10667
10683
  }
10668
10684
  }
@@ -12653,6 +12669,10 @@ let Gantt = class Gantt extends Component {
12653
12669
  * @private
12654
12670
  */
12655
12671
  this.isFromOnPropertyChange = false;
12672
+ /**
12673
+ * @private
12674
+ */
12675
+ this.isFromRenderBaseline = false;
12656
12676
  /**
12657
12677
  * @private
12658
12678
  */
@@ -13576,8 +13596,10 @@ let Gantt = class Gantt extends Component {
13576
13596
  case 'labelSettings':
13577
13597
  case 'renderBaseline':
13578
13598
  case 'baselineColor':
13599
+ this.isFromRenderBaseline = true;
13579
13600
  this.chartRowsModule.initiateTemplates();
13580
13601
  this.chartRowsModule.refreshGanttRows();
13602
+ this.isFromRenderBaseline = false;
13581
13603
  break;
13582
13604
  case 'resourceIDMapping':
13583
13605
  case 'resourceNameMapping':
@@ -20707,17 +20729,19 @@ class DialogEdit {
20707
20729
  this.parent.setRecordValue('durationUnit', fromRecord.ganttProperties.durationUnit, toRecord.ganttProperties, true);
20708
20730
  this.parent.setRecordValue('work', fromRecord.ganttProperties.work, toRecord.ganttProperties, true);
20709
20731
  this.parent.setRecordValue('type', fromRecord.ganttProperties.taskType, toRecord.ganttProperties, true);
20732
+ this.parent.setRecordValue('resourceNames', fromRecord.ganttProperties.resourceNames, toRecord.ganttProperties, true);
20733
+ this.parent.setRecordValue('resourceInfo', fromRecord.ganttProperties.resourceInfo, toRecord.ganttProperties, true);
20710
20734
  if (!isNullOrUndefined(this.parent.taskFields.startDate)) {
20711
- this.parent.dataOperation.updateMappingData(this.rowData, this.parent.taskFields.startDate);
20735
+ this.parent.dataOperation.updateMappingData(toRecord, this.parent.taskFields.startDate);
20712
20736
  }
20713
20737
  if (!isNullOrUndefined(this.parent.taskFields.endDate)) {
20714
- this.parent.dataOperation.updateMappingData(this.rowData, this.parent.taskFields.endDate);
20738
+ this.parent.dataOperation.updateMappingData(toRecord, this.parent.taskFields.endDate);
20715
20739
  }
20716
20740
  if (!isNullOrUndefined(this.parent.taskFields.duration)) {
20717
- this.parent.dataOperation.updateMappingData(this.rowData, this.parent.taskFields.duration);
20741
+ this.parent.dataOperation.updateMappingData(toRecord, this.parent.taskFields.duration);
20718
20742
  this.parent.setRecordValue('durationUnit', fromRecord.ganttProperties.durationUnit, this.rowData, true);
20719
20743
  if (this.rowData.ganttProperties.duration === 0) {
20720
- this.parent.setRecordValue('isMilestone', true, this.rowData.ganttProperties, true);
20744
+ this.parent.setRecordValue('isMilestone', true, toRecord.ganttProperties, true);
20721
20745
  }
20722
20746
  else {
20723
20747
  this.parent.setRecordValue('isMilestone', false, this.rowData.ganttProperties, true);
@@ -20732,6 +20756,9 @@ class DialogEdit {
20732
20756
  if (!isNullOrUndefined(this.parent.taskFields.type)) {
20733
20757
  this.parent.dataOperation.updateMappingData(this.rowData, "type");
20734
20758
  }
20759
+ if (!isNullOrUndefined(this.parent.taskFields.resourceInfo)) {
20760
+ this.parent.dataOperation.updateMappingData(this.rowData, "resourceInfo");
20761
+ }
20735
20762
  }
20736
20763
  updatePredecessorTab(preElement) {
20737
20764
  const gridObj = preElement.ej2_instances[0];
@@ -20795,10 +20822,11 @@ class DialogEdit {
20795
20822
  }
20796
20823
  const idArray = [];
20797
20824
  if (this.isEdit) {
20798
- this.parent.setRecordValue('resourceInfo', selectedItems, this.rowData.ganttProperties, true);
20799
- this.parent.dataOperation.updateMappingData(this.rowData, 'resourceInfo');
20800
- this.parent.editModule.updateResourceRelatedFields(this.rowData, 'resource');
20801
- this.validateDuration(this.rowData);
20825
+ this.parent.setRecordValue('resourceInfo', selectedItems, this.editedRecord.ganttProperties, true);
20826
+ this.parent.dataOperation.updateMappingData(this.editedRecord, 'resourceInfo');
20827
+ this.parent.editModule.updateResourceRelatedFields(this.editedRecord, 'resource');
20828
+ this.validateDuration(this.editedRecord);
20829
+ this.updateScheduleProperties(this.editedRecord, this.rowData);
20802
20830
  }
20803
20831
  else {
20804
20832
  for (let i = 0; i < selectedItems.length; i++) {
@@ -21754,6 +21782,7 @@ class Edit$2 {
21754
21782
  constructor(parent) {
21755
21783
  this.isFromDeleteMethod = false;
21756
21784
  this.targetedRecords = [];
21785
+ this.isNewRecordAdded = false;
21757
21786
  /** @hidden */
21758
21787
  this.updateParentRecords = [];
21759
21788
  /** @hidden */
@@ -22553,7 +22582,7 @@ class Edit$2 {
22553
22582
  if (ganttRecord.parentItem) {
22554
22583
  this.parent.dataOperation.updateParentItems(ganttRecord, true);
22555
22584
  let parentData = this.parent.getRecordByID(ganttRecord.parentItem.taskId);
22556
- if (parentData.ganttProperties.predecessor) {
22585
+ if (!parentData.ganttProperties.predecessorsName) {
22557
22586
  this.parent.predecessorModule.validatePredecessor(parentData, [], '');
22558
22587
  this.updateParentItemOnEditing();
22559
22588
  }
@@ -24200,6 +24229,7 @@ class Edit$2 {
24200
24229
  parentItem.taskData[child] = [];
24201
24230
  parentItem.taskData[child].push(record.taskData);
24202
24231
  }
24232
+ this.isNewRecordAdded = true;
24203
24233
  }
24204
24234
  }
24205
24235
  }
@@ -24314,9 +24344,10 @@ class Edit$2 {
24314
24344
  dataSource.push(addedRecord[i].taskData);
24315
24345
  }
24316
24346
  else {
24317
- if (isNullOrUndefined(addedRecord[i].parentItem)) {
24347
+ if (!this.isNewRecordAdded) {
24318
24348
  this.addDataInRealDataSource(dataSource, addedRecord[i].taskData, rowPosition);
24319
24349
  }
24350
+ this.isNewRecordAdded = false;
24320
24351
  }
24321
24352
  }
24322
24353
  this.isBreakLoop = false;
@@ -25043,7 +25074,14 @@ class Edit$2 {
25043
25074
  if (this.dropPosition === 'topSegment' || this.dropPosition === 'bottomSegment') {
25044
25075
  const rowPos = this.dropPosition === 'topSegment' ? 'Above' : 'Below';
25045
25076
  this.parent.editModule.addRowSelectedItem = droppedRec;
25046
- this.parent.editModule.updateRealDataSource(draggedRec, rowPos);
25077
+ let dragRecord = [];
25078
+ if (!Array.isArray(draggedRec)) {
25079
+ dragRecord[0] = draggedRec;
25080
+ }
25081
+ else {
25082
+ dragRecord = draggedRec;
25083
+ }
25084
+ this.parent.editModule.updateRealDataSource(dragRecord, rowPos);
25047
25085
  delete this.parent.editModule.addRowSelectedItem;
25048
25086
  }
25049
25087
  }