@syncfusion/ej2-gantt 19.3.57 → 19.4.38

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 (34) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/dist/ej2-gantt.umd.min.js +2 -2
  3. package/dist/ej2-gantt.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-gantt.es2015.js +102 -46
  5. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  6. package/dist/es6/ej2-gantt.es5.js +99 -43
  7. package/dist/es6/ej2-gantt.es5.js.map +1 -1
  8. package/dist/global/ej2-gantt.min.js +2 -2
  9. package/dist/global/ej2-gantt.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +18 -18
  12. package/src/gantt/actions/context-menu.js +35 -14
  13. package/src/gantt/actions/dialog-edit.js +4 -1
  14. package/src/gantt/actions/edit.js +4 -0
  15. package/src/gantt/actions/rowdragdrop.js +2 -0
  16. package/src/gantt/actions/taskbar-edit.js +4 -1
  17. package/src/gantt/base/gantt.d.ts +15 -13
  18. package/src/gantt/base/gantt.js +30 -24
  19. package/src/gantt/base/task-processor.js +20 -3
  20. package/styles/bootstrap5-dark.css +6 -5
  21. package/styles/bootstrap5.css +6 -5
  22. package/styles/gantt/_bootstrap4-definition.scss +1 -0
  23. package/styles/gantt/_bootstrap5-definition.scss +1 -1
  24. package/styles/gantt/_fluent-definition.scss +163 -0
  25. package/styles/gantt/_layout.scss +1 -6
  26. package/styles/gantt/_theme.scss +2 -1
  27. package/styles/gantt/bootstrap5-dark.css +6 -5
  28. package/styles/gantt/bootstrap5.css +6 -5
  29. package/styles/gantt/icons/_fluent.scss +112 -0
  30. package/styles/gantt/icons/_tailwind-dark.scss +112 -112
  31. package/styles/gantt/tailwind-dark.css +1 -1
  32. package/styles/gantt/tailwind.css +1 -1
  33. package/styles/tailwind-dark.css +1 -1
  34. package/styles/tailwind.css +1 -1
@@ -2229,8 +2229,16 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
2229
2229
  var ganttProperties = ganttData.ganttProperties;
2230
2230
  var duration = data[taskSettings.duration];
2231
2231
  duration = isNullOrUndefined(duration) || duration === '' ? null : duration;
2232
- var startDate = this.getDateFromFormat(data[taskSettings.startDate], true);
2233
- var endDate = this.getDateFromFormat(data[taskSettings.endDate], true);
2232
+ var startDate;
2233
+ var endDate;
2234
+ if (ganttProperties.startDate && ganttProperties.endDate) {
2235
+ startDate = this.getDateFromFormat(ganttProperties.startDate, true);
2236
+ endDate = this.getDateFromFormat(ganttProperties.endDate, true);
2237
+ }
2238
+ else {
2239
+ startDate = this.getDateFromFormat(data[taskSettings.startDate], true);
2240
+ endDate = this.getDateFromFormat(data[taskSettings.endDate], true);
2241
+ }
2234
2242
  var segments = taskSettings.segments ? (data[taskSettings.segments] ||
2235
2243
  ganttData.taskData[taskSettings.segments]) : null;
2236
2244
  var isMileStone = taskSettings.milestone ? data[taskSettings.milestone] ? true : false : false;
@@ -2832,7 +2840,10 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
2832
2840
  if (!isNullOrUndefined(value)) {
2833
2841
  value = new Date(tempDate.getTime());
2834
2842
  }
2835
- this.parent.setRecordValue('taskData.' + mapping, value, task);
2843
+ if (!this.parent.isLoad && !this.parent.isDynamicData) {
2844
+ this.parent.setRecordValue('taskData.' + mapping, value, task);
2845
+ }
2846
+ this.parent.isDynamicData = false;
2836
2847
  };
2837
2848
  TaskProcessor.prototype.getDurationInDay = function (duration, durationUnit) {
2838
2849
  if (durationUnit === 'day') {
@@ -3654,7 +3665,13 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
3654
3665
  continue;
3655
3666
  }
3656
3667
  var startDate = this.getValidStartDate(childData.ganttProperties);
3668
+ if (parentData.hasChildRecords && !ganttProp.isAutoSchedule && !isNullOrUndefined(childData.ganttProperties.autoStartDate)) {
3669
+ startDate = childData.ganttProperties.autoStartDate;
3670
+ }
3657
3671
  var endDate = this.getValidEndDate(childData.ganttProperties);
3672
+ if (parentData.hasChildRecords && !ganttProp.isAutoSchedule && !isNullOrUndefined(childData.ganttProperties.autoEndDate)) {
3673
+ endDate = childData.ganttProperties.autoEndDate;
3674
+ }
3658
3675
  if (isNullOrUndefined(minStartDate)) {
3659
3676
  minStartDate = this.getDateFromFormat(startDate);
3660
3677
  }
@@ -12414,6 +12431,8 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
12414
12431
  /** @hidden */
12415
12432
  _this.isExpandCollapseLevelMethod = false;
12416
12433
  /** @hidden */
12434
+ _this.isDynamicData = false;
12435
+ /** @hidden */
12417
12436
  _this.isConnectorLineUpdate = false;
12418
12437
  /** @hidden */
12419
12438
  _this.staticSelectedRowIndex = -1;
@@ -12453,27 +12472,6 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
12453
12472
  Gantt.prototype.getModuleName = function () {
12454
12473
  return 'gantt';
12455
12474
  };
12456
- /**
12457
- * To get timezone offset.
12458
- *
12459
- * @returns {number} .
12460
- * @private
12461
- */
12462
- Gantt.prototype.getDefaultTZOffset = function () {
12463
- var janMonth = new Date(new Date().getFullYear(), 0, 1);
12464
- var julMonth = new Date(new Date().getFullYear(), 6, 1); //Because there is no reagions DST inbetwwen this range
12465
- return Math.max(janMonth.getTimezoneOffset(), julMonth.getTimezoneOffset());
12466
- };
12467
- /**
12468
- * To check whether the date is in DST.
12469
- *
12470
- * @param {Date} date .
12471
- * @returns {boolean} .
12472
- * @private
12473
- */
12474
- Gantt.prototype.isInDst = function (date) {
12475
- return date.getTimezoneOffset() < this.getDefaultTZOffset();
12476
- };
12477
12475
  /**
12478
12476
  * For internal use only - Initialize the event handler
12479
12477
  *
@@ -12592,6 +12590,27 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
12592
12590
  return ganttDateFormat;
12593
12591
  }
12594
12592
  };
12593
+ /**
12594
+ * To get timezone offset.
12595
+ *
12596
+ * @returns {number} .
12597
+ * @private
12598
+ */
12599
+ Gantt.prototype.getDefaultTZOffset = function () {
12600
+ var janMonth = new Date(new Date().getFullYear(), 0, 1);
12601
+ var julMonth = new Date(new Date().getFullYear(), 6, 1); //Because there is no reagions DST inbetwwen this range
12602
+ return Math.max(janMonth.getTimezoneOffset(), julMonth.getTimezoneOffset());
12603
+ };
12604
+ /**
12605
+ * To check whether the date is in DST.
12606
+ *
12607
+ * @param {Date} date .
12608
+ * @returns {boolean} .
12609
+ * @private
12610
+ */
12611
+ Gantt.prototype.isInDst = function (date) {
12612
+ return date.getTimezoneOffset() < this.getDefaultTZOffset();
12613
+ };
12595
12614
  /**
12596
12615
  * Method to map resource fields.
12597
12616
  *
@@ -12744,7 +12763,7 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
12744
12763
  this.treeGrid.dataSource = { result: this.flatData, count: count };
12745
12764
  }
12746
12765
  else {
12747
- this.treeGrid.dataSource = this.flatData.length > 0 ? this.flatData : [];
12766
+ this.treeGrid.dataSource = this.flatData;
12748
12767
  }
12749
12768
  }
12750
12769
  else {
@@ -14792,6 +14811,7 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
14792
14811
  * @public
14793
14812
  */
14794
14813
  Gantt.prototype.updateDataSource = function (dataSource, args) {
14814
+ this.isDynamicData = true;
14795
14815
  if (!isNullOrUndefined(args)) {
14796
14816
  for (var _i = 0, _a = Object.keys(args); _i < _a.length; _i++) { // eslint-disable-line
14797
14817
  var prop = _a[_i];
@@ -14995,12 +15015,15 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
14995
15015
  if (!isNullOrUndefined(rowData)) {
14996
15016
  var data = extend({}, {}, rowData.taskData, true);
14997
15017
  var taskfields = this.taskFields;
15018
+ if (data[taskfields.startDate]) {
15019
+ this.setRecordValue(taskfields.startDate, rowData.ganttProperties.startDate, data, true);
15020
+ }
14998
15021
  if (!isNullOrUndefined(taskfields.duration)) {
14999
15022
  data[taskfields.duration] = 0;
15000
15023
  }
15001
15024
  else {
15002
- data[taskfields.startDate] = new Date(rowData.taskData[taskfields.startDate]);
15003
- data[taskfields.endDate] = new Date(rowData.taskData[taskfields.startDate]);
15025
+ data[taskfields.startDate] = new Date(rowData.ganttProperties.startDate);
15026
+ data[taskfields.endDate] = new Date(rowData.ganttProperties.endDate);
15004
15027
  }
15005
15028
  if (!isNullOrUndefined(taskfields.milestone)) {
15006
15029
  if (data[taskfields.milestone] === false) {
@@ -16811,8 +16834,11 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
16811
16834
  if (this.isMouseDragged && this.taskBarEditAction) {
16812
16835
  var args = {
16813
16836
  cancel: false,
16814
- requestType: 'mergeSegment'
16837
+ requestType: 'taskbarediting'
16815
16838
  };
16839
+ if (this.segmentIndex !== -1) {
16840
+ args.requestType = 'mergeSegment';
16841
+ }
16816
16842
  this.parent.trigger('actionBegin', args, function (arg) {
16817
16843
  if (arg.cancel === false) {
16818
16844
  _this.taskBarEditingAction(event, false);
@@ -19298,7 +19324,7 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
19298
19324
  var datePickerModel = _this.beforeOpenArgs[generalTabString][_this.parent.taskFields[fields[i]]];
19299
19325
  var value = args.rowData[args.column.field];
19300
19326
  setValue('value', value, datePickerModel);
19301
- var datePicker = new DatePicker(datePickerModel);
19327
+ var datePicker = new _this.inputs[_this.parent.columnByField[_this.parent.taskFields[fields[i]]].editType](datePickerModel);
19302
19328
  datePicker.appendTo(args.element);
19303
19329
  },
19304
19330
  read: function (args) {
@@ -20185,6 +20211,9 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
20185
20211
  this.rowData.ganttProperties.segments = dataSource;
20186
20212
  this.parent.setRecordValue('segments', this.parent.dataOperation.setSegmentsInfo(this.rowData, false), this.rowData.ganttProperties, true);
20187
20213
  this.parent.setRecordValue('taskData.' + this.parent.taskFields.segments, userData, this.rowData);
20214
+ if (dataSource.length <= 0) {
20215
+ this.validateDuration(this.rowData);
20216
+ }
20188
20217
  }
20189
20218
  };
20190
20219
  // eslint-disable-next-line
@@ -23630,6 +23659,9 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23630
23659
  var taskFields = this.parent.taskFields;
23631
23660
  var dataSource = isCountRequired(this.parent) ? getValue('result', this.parent.dataSource) :
23632
23661
  this.parent.dataSource;
23662
+ if (this.parent.dataSource instanceof DataManager) {
23663
+ dataSource = this.parent.dataSource.dataSource.json;
23664
+ }
23633
23665
  for (var i = 0; i < addedRecord.length; i++) {
23634
23666
  if (isNullOrUndefined(rowPosition) || isNullOrUndefined(this.addRowSelectedItem)) {
23635
23667
  rowPosition = 'Top';
@@ -23702,6 +23734,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23702
23734
  Edit$$1.prototype.addRecord = function (data, rowPosition, rowIndex) {
23703
23735
  var _this = this;
23704
23736
  if (this.parent.editModule && this.parent.editSettings.allowAdding) {
23737
+ this.parent.isDynamicData = true;
23705
23738
  var cAddedRecord_1 = [];
23706
23739
  if (isNullOrUndefined(data)) {
23707
23740
  this.validateTaskPosition(data, rowPosition, rowIndex, cAddedRecord_1);
@@ -26479,6 +26512,12 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
26479
26512
  position = this.item;
26480
26513
  data = extend({}, {}, this.rowData.taskData, true);
26481
26514
  taskfields = this.parent.taskFields;
26515
+ if (data[taskfields.startDate]) {
26516
+ this.parent.setRecordValue(taskfields.startDate, this.rowData.ganttProperties.startDate, data, true);
26517
+ }
26518
+ if (data[taskfields.endDate]) {
26519
+ this.parent.setRecordValue(taskfields.endDate, this.rowData.ganttProperties.endDate, data, true);
26520
+ }
26482
26521
  if (!isNullOrUndefined(taskfields.dependency)) {
26483
26522
  data[taskfields.dependency] = null;
26484
26523
  }
@@ -26672,7 +26711,12 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
26672
26711
  var item = _a[_i];
26673
26712
  // let target: EventTarget = target;
26674
26713
  if (!item.separator) {
26675
- this.updateItemStatus(item, target, rowIndex);
26714
+ if ((target.classList.contains('e-gantt-unscheduled-taskbar')) && ((item.text === this.getLocale('splitTask')) || (item.text === this.getLocale('mergeTask')))) {
26715
+ this.hideItems.push(item.text);
26716
+ }
26717
+ else {
26718
+ this.updateItemStatus(item, target, rowIndex);
26719
+ }
26676
26720
  }
26677
26721
  }
26678
26722
  args.rowData = this.rowData;
@@ -26784,24 +26828,34 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
26784
26828
  break;
26785
26829
  case 'Indent':
26786
26830
  {
26787
- var index = this.parent.selectedRowIndex;
26788
- var isSelected = this.parent.selectionModule ? this.parent.selectionModule.selectedRowIndexes.length === 1 ||
26789
- this.parent.selectionModule.getSelectedRowCellIndexes().length === 1 ? true : false : false;
26790
- var prevRecord = this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0] - 1];
26791
- if (!this.parent.editSettings.allowEditing || index === 0 || index === -1 || !isSelected ||
26792
- this.parent.viewType === 'ResourceView' || this.parent.updatedRecords[index].level - prevRecord.level === 1) {
26793
- this.updateItemVisibility(item.text);
26831
+ if (!this.parent.allowSelection) {
26832
+ this.hideItems.push(item.text);
26833
+ }
26834
+ else {
26835
+ var index = this.parent.selectedRowIndex;
26836
+ var isSelected = this.parent.selectionModule ? this.parent.selectionModule.selectedRowIndexes.length === 1 ||
26837
+ this.parent.selectionModule.getSelectedRowCellIndexes().length === 1 ? true : false : false;
26838
+ var prevRecord = this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0] - 1];
26839
+ if (!this.parent.editSettings.allowEditing || index === 0 || index === -1 || !isSelected ||
26840
+ this.parent.viewType === 'ResourceView' || this.parent.updatedRecords[index].level - prevRecord.level === 1) {
26841
+ this.updateItemVisibility(item.text);
26842
+ }
26794
26843
  }
26795
26844
  break;
26796
26845
  }
26797
26846
  case 'Outdent':
26798
26847
  {
26799
- var ind = this.parent.selectionModule.getSelectedRowIndexes()[0];
26800
- var isSelect = this.parent.selectionModule ? this.parent.selectionModule.selectedRowIndexes.length === 1 ||
26801
- this.parent.selectionModule.getSelectedRowCellIndexes().length === 1 ? true : false : false;
26802
- if (!this.parent.editSettings.allowEditing || ind === -1 || ind === 0 || !isSelect ||
26803
- this.parent.viewType === 'ResourceView' || this.parent.updatedRecords[ind].level === 0) {
26804
- this.updateItemVisibility(item.text);
26848
+ if (!this.parent.allowSelection) {
26849
+ this.hideItems.push(item.text);
26850
+ }
26851
+ else {
26852
+ var ind = this.parent.selectionModule.getSelectedRowIndexes()[0];
26853
+ var isSelect = this.parent.selectionModule ? this.parent.selectionModule.selectedRowIndexes.length === 1 ||
26854
+ this.parent.selectionModule.getSelectedRowCellIndexes().length === 1 ? true : false : false;
26855
+ if (!this.parent.editSettings.allowEditing || ind === -1 || ind === 0 || !isSelect ||
26856
+ this.parent.viewType === 'ResourceView' || this.parent.updatedRecords[ind].level === 0) {
26857
+ this.updateItemVisibility(item.text);
26858
+ }
26805
26859
  }
26806
26860
  break;
26807
26861
  }
@@ -27686,6 +27740,7 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
27686
27740
  else {
27687
27741
  var level = 1;
27688
27742
  draggedRecord.level = droppedRecord.level + 1;
27743
+ this.parent.setRecordValue('level', this.draggedRecord.level, this.draggedRecord);
27689
27744
  this.updateChildRecordLevel(draggedRecord, level);
27690
27745
  }
27691
27746
  droppedRecord.expanded = true;
@@ -27770,6 +27825,7 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
27770
27825
  parentData = this.parent.treeGrid[id][record.parentItem.uniqueID];
27771
27826
  }
27772
27827
  currentRecord.level = record.parentItem ? parentData.level + level : record.level + 1;
27828
+ this.parent.setRecordValue('level', currentRecord.level, currentRecord);
27773
27829
  if (currentRecord.hasChildRecords) {
27774
27830
  level--;
27775
27831
  level = this.updateChildRecordLevel(currentRecord, level);