@syncfusion/ej2-gantt 19.3.57 → 19.4.42

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 (48) hide show
  1. package/CHANGELOG.md +41 -1
  2. package/README.md +1 -1
  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 +149 -74
  6. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  7. package/dist/es6/ej2-gantt.es5.js +146 -71
  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/context-menu.js +35 -14
  14. package/src/gantt/actions/dialog-edit.js +6 -3
  15. package/src/gantt/actions/edit.js +5 -1
  16. package/src/gantt/actions/keyboard.js +6 -2
  17. package/src/gantt/actions/rowdragdrop.js +2 -0
  18. package/src/gantt/actions/taskbar-edit.js +5 -1
  19. package/src/gantt/base/date-processor.js +8 -1
  20. package/src/gantt/base/gantt-chart.js +0 -2
  21. package/src/gantt/base/gantt.d.ts +15 -13
  22. package/src/gantt/base/gantt.js +32 -28
  23. package/src/gantt/base/task-processor.js +26 -4
  24. package/src/gantt/base/tree-grid.js +3 -0
  25. package/src/gantt/renderer/chart-rows.js +2 -0
  26. package/src/gantt/renderer/timeline.d.ts +1 -0
  27. package/src/gantt/renderer/timeline.js +16 -15
  28. package/styles/bootstrap5-dark.css +6 -5
  29. package/styles/bootstrap5.css +6 -5
  30. package/styles/fabric-dark.css +1 -1
  31. package/styles/gantt/_bootstrap4-definition.scss +1 -0
  32. package/styles/gantt/_bootstrap5-definition.scss +1 -1
  33. package/styles/gantt/_fabric-dark-definition.scss +2 -1
  34. package/styles/gantt/_fluent-definition.scss +163 -0
  35. package/styles/gantt/_layout.scss +7 -7
  36. package/styles/gantt/_material-dark-definition.scss +2 -1
  37. package/styles/gantt/_theme.scss +2 -1
  38. package/styles/gantt/bootstrap5-dark.css +6 -5
  39. package/styles/gantt/bootstrap5.css +6 -5
  40. package/styles/gantt/fabric-dark.css +1 -1
  41. package/styles/gantt/icons/_fluent.scss +112 -0
  42. package/styles/gantt/icons/_tailwind-dark.scss +112 -112
  43. package/styles/gantt/material-dark.css +1 -1
  44. package/styles/gantt/tailwind-dark.css +1 -1
  45. package/styles/gantt/tailwind.css +1 -1
  46. package/styles/material-dark.css +1 -1
  47. package/styles/tailwind-dark.css +1 -1
  48. package/styles/tailwind.css +1 -1
@@ -482,7 +482,14 @@ class DateProcessor {
482
482
  tDuration = this.parent.editModule.taskbarEditModule.sumOfDuration(ganttProperties.segments);
483
483
  }
484
484
  else {
485
- tDuration = this.getDuration(ganttProperties.startDate, ganttProperties.endDate, ganttProperties.durationUnit, ganttProperties.isAutoSchedule, ganttProperties.isMilestone);
485
+ // eslint-disable-next-line
486
+ if (!isNullOrUndefined(ganttProperties.startDate) && !isNullOrUndefined(ganttProperties.endDate) &&
487
+ (ganttProperties.startDate).getTime() === (ganttProperties.endDate).getTime() && !isNullOrUndefined(ganttData.taskData[this.parent.taskFields.milestone])) {
488
+ tDuration = 1;
489
+ }
490
+ else {
491
+ tDuration = this.getDuration(ganttProperties.startDate, ganttProperties.endDate, ganttProperties.durationUnit, ganttProperties.isAutoSchedule, ganttProperties.isMilestone);
492
+ }
486
493
  }
487
494
  this.parent.setRecordValue('duration', tDuration, ganttProperties, true);
488
495
  const col = this.parent.columnByField[this.parent.columnMapping.duration];
@@ -2190,8 +2197,16 @@ class TaskProcessor extends DateProcessor {
2190
2197
  const ganttProperties = ganttData.ganttProperties;
2191
2198
  let duration = data[taskSettings.duration];
2192
2199
  duration = isNullOrUndefined(duration) || duration === '' ? null : duration;
2193
- const startDate = this.getDateFromFormat(data[taskSettings.startDate], true);
2194
- const endDate = this.getDateFromFormat(data[taskSettings.endDate], true);
2200
+ let startDate;
2201
+ let endDate;
2202
+ if (ganttProperties.startDate && ganttProperties.endDate) {
2203
+ startDate = this.getDateFromFormat(ganttProperties.startDate, true);
2204
+ endDate = this.getDateFromFormat(ganttProperties.endDate, true);
2205
+ }
2206
+ else {
2207
+ startDate = this.getDateFromFormat(data[taskSettings.startDate], true);
2208
+ endDate = this.getDateFromFormat(data[taskSettings.endDate], true);
2209
+ }
2195
2210
  const segments = taskSettings.segments ? (data[taskSettings.segments] ||
2196
2211
  ganttData.taskData[taskSettings.segments]) : null;
2197
2212
  const isMileStone = taskSettings.milestone ? data[taskSettings.milestone] ? true : false : false;
@@ -2581,7 +2596,12 @@ class TaskProcessor extends DateProcessor {
2581
2596
  eDate.setHours(0, 0, 0, 0);
2582
2597
  }
2583
2598
  }
2584
- return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth);
2599
+ if ((sDate).getTime() === (eDate).getTime()) {
2600
+ return (this.parent.perDayWidth);
2601
+ }
2602
+ else {
2603
+ return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth);
2604
+ }
2585
2605
  }
2586
2606
  /**
2587
2607
  * Get task left value
@@ -2790,7 +2810,10 @@ class TaskProcessor extends DateProcessor {
2790
2810
  if (!isNullOrUndefined(value)) {
2791
2811
  value = new Date(tempDate.getTime());
2792
2812
  }
2793
- this.parent.setRecordValue('taskData.' + mapping, value, task);
2813
+ if (!this.parent.isLoad && !this.parent.isDynamicData) {
2814
+ this.parent.setRecordValue('taskData.' + mapping, value, task);
2815
+ }
2816
+ this.parent.isDynamicData = false;
2794
2817
  }
2795
2818
  getDurationInDay(duration, durationUnit) {
2796
2819
  if (durationUnit === 'day') {
@@ -3608,8 +3631,14 @@ class TaskProcessor extends DateProcessor {
3608
3631
  }
3609
3632
  continue;
3610
3633
  }
3611
- const startDate = this.getValidStartDate(childData.ganttProperties);
3612
- const endDate = this.getValidEndDate(childData.ganttProperties);
3634
+ let startDate = this.getValidStartDate(childData.ganttProperties);
3635
+ if (parentData.hasChildRecords && !ganttProp.isAutoSchedule && !isNullOrUndefined(childData.ganttProperties.autoStartDate)) {
3636
+ startDate = childData.ganttProperties.autoStartDate;
3637
+ }
3638
+ let endDate = this.getValidEndDate(childData.ganttProperties);
3639
+ if (parentData.hasChildRecords && !ganttProp.isAutoSchedule && !isNullOrUndefined(childData.ganttProperties.autoEndDate)) {
3640
+ endDate = childData.ganttProperties.autoEndDate;
3641
+ }
3613
3642
  if (isNullOrUndefined(minStartDate)) {
3614
3643
  minStartDate = this.getDateFromFormat(startDate);
3615
3644
  }
@@ -4810,8 +4839,6 @@ class GanttChart {
4810
4839
  this.parent.treeGrid.collapseAll();
4811
4840
  }
4812
4841
  this.isExpandAll = false;
4813
- const focussedElement = this.parent.element.querySelector('.e-treegrid');
4814
- focussedElement.focus();
4815
4842
  }
4816
4843
  /**
4817
4844
  * Public method to expand particular level of rows.
@@ -6024,9 +6051,6 @@ class Timeline {
6024
6051
  parentTr = this.getHeaterTemplateString(new Date(startDate.toString()), mode, tier, false, count, timelineCell);
6025
6052
  scheduleDateCollection.push(new Date(startDate.toString()));
6026
6053
  increment = this.getIncrement(startDate, count, mode);
6027
- if (this.parent.isInDst(startDate)) {
6028
- increment = increment + (1000 * 60 * 60);
6029
- }
6030
6054
  newTime = startDate.getTime() + increment;
6031
6055
  startDate.setTime(newTime);
6032
6056
  if (startDate >= endDate) {
@@ -6090,24 +6114,17 @@ class Timeline {
6090
6114
  dayIntervel - 1 : dayIntervel : dayIntervel;
6091
6115
  lastDay.setDate(lastDay.getDate() + (dayIntervel + (7 * count)));
6092
6116
  increment = lastDay.getTime() - firstDay.getTime();
6093
- if ((this.parent.isInDst(lastDay) && !this.parent.isInDst(firstDay)) ||
6094
- (!this.parent.isInDst(lastDay) && this.parent.isInDst(firstDay))) {
6095
- increment = increment - (1000 * 60 * 60);
6096
- }
6097
6117
  break;
6098
6118
  }
6099
6119
  case 'Day':
6100
6120
  lastDay.setHours(24, 0, 0, 0);
6101
6121
  increment = (lastDay.getTime() - firstDay.getTime()) + (1000 * 60 * 60 * 24 * (count - 1));
6102
- if ((this.parent.isInDst(lastDay) && !this.parent.isInDst(firstDay)) ||
6103
- (!this.parent.isInDst(lastDay) && this.parent.isInDst(firstDay))) {
6104
- increment -= (1000 * 60 * 60);
6105
- }
6106
6122
  break;
6107
6123
  case 'Hour':
6108
6124
  lastDay.setMinutes(60);
6109
6125
  lastDay.setSeconds(0);
6110
6126
  increment = (lastDay.getTime() - firstDay.getTime()) + (1000 * 60 * 60 * (count - 1));
6127
+ increment = this.checkDate(firstDay, lastDay, increment, count);
6111
6128
  break;
6112
6129
  case 'Minutes':
6113
6130
  lastDay.setSeconds(60);
@@ -6116,6 +6133,21 @@ class Timeline {
6116
6133
  }
6117
6134
  return increment;
6118
6135
  }
6136
+ checkDate(firstDay, lastDay, increment, count) {
6137
+ var date = new Date(firstDay.getTime());
6138
+ date.setTime(date.getTime() + increment);
6139
+ if (((date.getTime() - lastDay.getTime()) / (1000 * 60 * 60)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
6140
+ var diffCount = count - (date.getTime() - lastDay.getTime()) / (1000 * 60 * 60);
6141
+ if (!this.parent.isInDst(date)) {
6142
+ increment += (1000 * 60 * 60 * diffCount);
6143
+ }
6144
+ else if (this.parent.isInDst(date)) {
6145
+ increment -= (1000 * 60 * 60 * diffCount);
6146
+ }
6147
+ }
6148
+ return increment;
6149
+ }
6150
+ ;
6119
6151
  /**
6120
6152
  * Method to find header cell was weekend or not
6121
6153
  *
@@ -6198,10 +6230,6 @@ class Timeline {
6198
6230
  */
6199
6231
  calculateWidthBetweenTwoDate(mode, scheduleWeeks, endDate) {
6200
6232
  let timeDifference = (endDate.getTime() - scheduleWeeks.getTime());
6201
- if ((this.parent.isInDst(scheduleWeeks) && !this.parent.isInDst(endDate)) ||
6202
- (!this.parent.isInDst(scheduleWeeks) && this.parent.isInDst(endDate))) {
6203
- timeDifference = timeDifference - (1000 * 60 * 60);
6204
- }
6205
6233
  const balanceDay = (timeDifference / (1000 * 60 * 60 * 24));
6206
6234
  return balanceDay * this.parent.perDayWidth;
6207
6235
  }
@@ -6888,6 +6916,9 @@ class GanttTreeGrid {
6888
6916
  if (getValue('requestType', args) === 'refresh' && isNullOrUndefined(getValue('type', args)) && this.parent.addDeleteRecord) {
6889
6917
  if (this.parent.selectedRowIndex != -1) {
6890
6918
  this.parent.selectRow(this.parent.selectedRowIndex);
6919
+ if (this.parent.selectedRowIndex > this.parent.currentViewData.length - 1) {
6920
+ this.parent.selectedRowIndex = -1;
6921
+ }
6891
6922
  }
6892
6923
  else {
6893
6924
  this.parent.selectRow(0);
@@ -8940,6 +8971,7 @@ class ChartRows extends DateProcessor {
8940
8971
  }
8941
8972
  }
8942
8973
  }
8974
+ this.parent.renderTemplates();
8943
8975
  this.triggerQueryTaskbarInfo();
8944
8976
  this.parent.modifiedRecords = [];
8945
8977
  if (collapsedResourceRecord.length) {
@@ -9303,6 +9335,7 @@ class ChartRows extends DateProcessor {
9303
9335
  else {
9304
9336
  tr.replaceChild(this.getGanttChartRow(index, data).childNodes[0], tr.childNodes[0]);
9305
9337
  }
9338
+ this.parent.renderTemplates();
9306
9339
  if (this.parent.viewType === 'ResourceView' && data.hasChildRecords && this.parent.showOverAllocation) {
9307
9340
  if (isValidateRange) {
9308
9341
  this.parent.ganttChartModule.renderRangeContainer(this.parent.currentViewData);
@@ -11702,6 +11735,10 @@ class FocusModule {
11702
11735
  onKeyPress(e) {
11703
11736
  const ganttObj = this.parent;
11704
11737
  const expandedRecords = ganttObj.getExpandedRecords(ganttObj.currentViewData);
11738
+ if (isNullOrUndefined(this.parent.focusModule.getActiveElement()) && (e.action === 'expandAll' || e.action === 'collapseAll')) {
11739
+ const focussedElement = this.parent.element.querySelector('.e-treegrid');
11740
+ focussedElement.focus();
11741
+ }
11705
11742
  const targetElement = this.parent.focusModule.getActiveElement();
11706
11743
  if (e.action === 'home' || e.action === 'end' || e.action === 'downArrow' || e.action === 'upArrow' || e.action === 'delete' ||
11707
11744
  e.action === 'rightArrow' || e.action === 'leftArrow' || e.action === 'focusTask' || e.action === 'focusSearch' ||
@@ -11814,9 +11851,9 @@ class FocusModule {
11814
11851
  {
11815
11852
  if (isNullOrUndefined(document.getElementById(this.parent.element.id + '_dialog'))) {
11816
11853
  e.preventDefault();
11817
- const focussedElement = ganttObj.element.querySelector('.e-gantt-chart');
11818
- focussedElement.focus();
11819
11854
  ganttObj.addRecord();
11855
+ const focussedElement = ganttObj.element;
11856
+ focussedElement.focus();
11820
11857
  }
11821
11858
  break;
11822
11859
  }
@@ -12001,6 +12038,8 @@ let Gantt = class Gantt extends Component {
12001
12038
  /** @hidden */
12002
12039
  this.isExpandCollapseLevelMethod = false;
12003
12040
  /** @hidden */
12041
+ this.isDynamicData = false;
12042
+ /** @hidden */
12004
12043
  this.isConnectorLineUpdate = false;
12005
12044
  /** @hidden */
12006
12045
  this.staticSelectedRowIndex = -1;
@@ -12039,27 +12078,6 @@ let Gantt = class Gantt extends Component {
12039
12078
  getModuleName() {
12040
12079
  return 'gantt';
12041
12080
  }
12042
- /**
12043
- * To get timezone offset.
12044
- *
12045
- * @returns {number} .
12046
- * @private
12047
- */
12048
- getDefaultTZOffset() {
12049
- const janMonth = new Date(new Date().getFullYear(), 0, 1);
12050
- const julMonth = new Date(new Date().getFullYear(), 6, 1); //Because there is no reagions DST inbetwwen this range
12051
- return Math.max(janMonth.getTimezoneOffset(), julMonth.getTimezoneOffset());
12052
- }
12053
- /**
12054
- * To check whether the date is in DST.
12055
- *
12056
- * @param {Date} date .
12057
- * @returns {boolean} .
12058
- * @private
12059
- */
12060
- isInDst(date) {
12061
- return date.getTimezoneOffset() < this.getDefaultTZOffset();
12062
- }
12063
12081
  /**
12064
12082
  * For internal use only - Initialize the event handler
12065
12083
  *
@@ -12178,6 +12196,27 @@ let Gantt = class Gantt extends Component {
12178
12196
  return ganttDateFormat;
12179
12197
  }
12180
12198
  }
12199
+ /**
12200
+ * To get timezone offset.
12201
+ *
12202
+ * @returns {number} .
12203
+ * @private
12204
+ */
12205
+ getDefaultTZOffset() {
12206
+ const janMonth = new Date(new Date().getFullYear(), 0, 1);
12207
+ const julMonth = new Date(new Date().getFullYear(), 6, 1); //Because there is no reagions DST inbetwwen this range
12208
+ return Math.max(janMonth.getTimezoneOffset(), julMonth.getTimezoneOffset());
12209
+ }
12210
+ /**
12211
+ * To check whether the date is in DST.
12212
+ *
12213
+ * @param {Date} date .
12214
+ * @returns {boolean} .
12215
+ * @private
12216
+ */
12217
+ isInDst(date) {
12218
+ return date.getTimezoneOffset() < this.getDefaultTZOffset();
12219
+ }
12181
12220
  /**
12182
12221
  * Method to map resource fields.
12183
12222
  *
@@ -12330,7 +12369,7 @@ let Gantt = class Gantt extends Component {
12330
12369
  this.treeGrid.dataSource = { result: this.flatData, count: count };
12331
12370
  }
12332
12371
  else {
12333
- this.treeGrid.dataSource = this.flatData.length > 0 ? this.flatData : [];
12372
+ this.treeGrid.dataSource = this.flatData;
12334
12373
  }
12335
12374
  }
12336
12375
  else {
@@ -12890,10 +12929,8 @@ let Gantt = class Gantt extends Component {
12890
12929
  this.treeGrid.grid.searchSettings = getActualProperties(this.searchSettings);
12891
12930
  this.treeGrid.grid.dataBind();
12892
12931
  }
12893
- else {
12894
- this.treeGrid.searchSettings = getActualProperties(this.searchSettings);
12895
- this.treeGrid.dataBind();
12896
- }
12932
+ this.treeGrid.searchSettings = getActualProperties(this.searchSettings);
12933
+ this.treeGrid.dataBind();
12897
12934
  if (this.toolbarModule) {
12898
12935
  this.toolbarModule.updateSearchTextBox();
12899
12936
  }
@@ -14376,6 +14413,7 @@ let Gantt = class Gantt extends Component {
14376
14413
  * @public
14377
14414
  */
14378
14415
  updateDataSource(dataSource, args) {
14416
+ this.isDynamicData = true;
14379
14417
  if (!isNullOrUndefined(args)) {
14380
14418
  for (let prop of Object.keys(args)) { // eslint-disable-line
14381
14419
  switch (prop) {
@@ -14578,12 +14616,15 @@ let Gantt = class Gantt extends Component {
14578
14616
  if (!isNullOrUndefined(rowData)) {
14579
14617
  const data = extend({}, {}, rowData.taskData, true);
14580
14618
  const taskfields = this.taskFields;
14619
+ if (data[taskfields.startDate]) {
14620
+ this.setRecordValue(taskfields.startDate, rowData.ganttProperties.startDate, data, true);
14621
+ }
14581
14622
  if (!isNullOrUndefined(taskfields.duration)) {
14582
14623
  data[taskfields.duration] = 0;
14583
14624
  }
14584
14625
  else {
14585
- data[taskfields.startDate] = new Date(rowData.taskData[taskfields.startDate]);
14586
- data[taskfields.endDate] = new Date(rowData.taskData[taskfields.startDate]);
14626
+ data[taskfields.startDate] = new Date(rowData.ganttProperties.startDate);
14627
+ data[taskfields.endDate] = new Date(rowData.ganttProperties.endDate);
14587
14628
  }
14588
14629
  if (!isNullOrUndefined(taskfields.milestone)) {
14589
14630
  if (data[taskfields.milestone] === false) {
@@ -16359,8 +16400,11 @@ class TaskbarEdit extends DateProcessor {
16359
16400
  if (this.isMouseDragged && this.taskBarEditAction) {
16360
16401
  const args = {
16361
16402
  cancel: false,
16362
- requestType: 'mergeSegment'
16403
+ requestType: 'taskbarediting'
16363
16404
  };
16405
+ if (this.segmentIndex !== -1) {
16406
+ args.requestType = 'mergeSegment';
16407
+ }
16364
16408
  this.parent.trigger('actionBegin', args, (arg) => {
16365
16409
  if (arg.cancel === false) {
16366
16410
  this.taskBarEditingAction(event, false);
@@ -17343,6 +17387,7 @@ class TaskbarEdit extends DateProcessor {
17343
17387
  this.isMouseDragged = false;
17344
17388
  }
17345
17389
  else {
17390
+ this.parent.isOnEdit = false;
17346
17391
  this.cancelTaskbarEditActionInMouseLeave();
17347
17392
  }
17348
17393
  }
@@ -17999,7 +18044,7 @@ class DialogEdit {
17999
18044
  tempData.ganttProperties.durationUnit = this.parent.durationUnit.toLocaleLowerCase();
18000
18045
  }
18001
18046
  else if (columns[i].field === taskSettings.name) {
18002
- tempData[field] = 'New Task ' + id;
18047
+ tempData[field] = this.localeObj.getConstant('addDialogTitle') + ' ' + id;
18003
18048
  tempData.ganttProperties.taskName = tempData[field];
18004
18049
  }
18005
18050
  else if (columns[i].field === taskSettings.progress) {
@@ -18838,7 +18883,7 @@ class DialogEdit {
18838
18883
  const datePickerModel = this.beforeOpenArgs[generalTabString][this.parent.taskFields[fields[i]]];
18839
18884
  const value = args.rowData[args.column.field];
18840
18885
  setValue('value', value, datePickerModel);
18841
- const datePicker = new DatePicker(datePickerModel);
18886
+ const datePicker = new this.inputs[this.parent.columnByField[this.parent.taskFields[fields[i]]].editType](datePickerModel);
18842
18887
  datePicker.appendTo(args.element);
18843
18888
  },
18844
18889
  read: (args) => {
@@ -18909,7 +18954,7 @@ class DialogEdit {
18909
18954
  inputValue = dialog.querySelector('#' + ganttId + 'SegmentsTabContainer' + columnName)
18910
18955
  .ej2_instances[0];
18911
18956
  }
18912
- if (inputValue.value !== tempValue.toString()) {
18957
+ if (inputValue.value.toString() !== tempValue.toString()) {
18913
18958
  inputValue.value = tempValue;
18914
18959
  inputValue.dataBind();
18915
18960
  }
@@ -19710,6 +19755,9 @@ class DialogEdit {
19710
19755
  this.rowData.ganttProperties.segments = dataSource;
19711
19756
  this.parent.setRecordValue('segments', this.parent.dataOperation.setSegmentsInfo(this.rowData, false), this.rowData.ganttProperties, true);
19712
19757
  this.parent.setRecordValue('taskData.' + this.parent.taskFields.segments, userData, this.rowData);
19758
+ if (dataSource.length <= 0) {
19759
+ this.validateDuration(this.rowData);
19760
+ }
19713
19761
  }
19714
19762
  }
19715
19763
  // eslint-disable-next-line
@@ -21492,7 +21540,7 @@ class Edit$2 {
21492
21540
  this.updateParentItemOnEditing();
21493
21541
  }
21494
21542
  /** Update parent up-to zeroth level */
21495
- if (ganttRecord.parentItem || this.parent.taskMode !== 'Auto') {
21543
+ if (ganttRecord.parentItem) {
21496
21544
  this.parent.dataOperation.updateParentItems(ganttRecord, true);
21497
21545
  }
21498
21546
  this.initiateSaveAction(args);
@@ -23122,8 +23170,11 @@ class Edit$2 {
23122
23170
  */
23123
23171
  updateRealDataSource(addedRecord, rowPosition) {
23124
23172
  const taskFields = this.parent.taskFields;
23125
- const dataSource = isCountRequired(this.parent) ? getValue('result', this.parent.dataSource) :
23173
+ let dataSource = isCountRequired(this.parent) ? getValue('result', this.parent.dataSource) :
23126
23174
  this.parent.dataSource;
23175
+ if (this.parent.dataSource instanceof DataManager) {
23176
+ dataSource = this.parent.dataSource.dataSource.json;
23177
+ }
23127
23178
  for (let i = 0; i < addedRecord.length; i++) {
23128
23179
  if (isNullOrUndefined(rowPosition) || isNullOrUndefined(this.addRowSelectedItem)) {
23129
23180
  rowPosition = 'Top';
@@ -23195,6 +23246,7 @@ class Edit$2 {
23195
23246
  */
23196
23247
  addRecord(data, rowPosition, rowIndex) {
23197
23248
  if (this.parent.editModule && this.parent.editSettings.allowAdding) {
23249
+ this.parent.isDynamicData = true;
23198
23250
  const cAddedRecord = [];
23199
23251
  if (isNullOrUndefined(data)) {
23200
23252
  this.validateTaskPosition(data, rowPosition, rowIndex, cAddedRecord);
@@ -25944,6 +25996,12 @@ class ContextMenu$2 {
25944
25996
  position = this.item;
25945
25997
  data = extend({}, {}, this.rowData.taskData, true);
25946
25998
  taskfields = this.parent.taskFields;
25999
+ if (data[taskfields.startDate]) {
26000
+ this.parent.setRecordValue(taskfields.startDate, this.rowData.ganttProperties.startDate, data, true);
26001
+ }
26002
+ if (data[taskfields.endDate]) {
26003
+ this.parent.setRecordValue(taskfields.endDate, this.rowData.ganttProperties.endDate, data, true);
26004
+ }
25947
26005
  if (!isNullOrUndefined(taskfields.dependency)) {
25948
26006
  data[taskfields.dependency] = null;
25949
26007
  }
@@ -26133,7 +26191,12 @@ class ContextMenu$2 {
26133
26191
  for (const item of args.items) {
26134
26192
  // let target: EventTarget = target;
26135
26193
  if (!item.separator) {
26136
- this.updateItemStatus(item, target, rowIndex);
26194
+ if ((target.classList.contains('e-gantt-unscheduled-taskbar')) && ((item.text === this.getLocale('splitTask')) || (item.text === this.getLocale('mergeTask')))) {
26195
+ this.hideItems.push(item.text);
26196
+ }
26197
+ else {
26198
+ this.updateItemStatus(item, target, rowIndex);
26199
+ }
26137
26200
  }
26138
26201
  }
26139
26202
  args.rowData = this.rowData;
@@ -26245,24 +26308,34 @@ class ContextMenu$2 {
26245
26308
  break;
26246
26309
  case 'Indent':
26247
26310
  {
26248
- const index = this.parent.selectedRowIndex;
26249
- const isSelected = this.parent.selectionModule ? this.parent.selectionModule.selectedRowIndexes.length === 1 ||
26250
- this.parent.selectionModule.getSelectedRowCellIndexes().length === 1 ? true : false : false;
26251
- const prevRecord = this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0] - 1];
26252
- if (!this.parent.editSettings.allowEditing || index === 0 || index === -1 || !isSelected ||
26253
- this.parent.viewType === 'ResourceView' || this.parent.updatedRecords[index].level - prevRecord.level === 1) {
26254
- this.updateItemVisibility(item.text);
26311
+ if (!this.parent.allowSelection) {
26312
+ this.hideItems.push(item.text);
26313
+ }
26314
+ else {
26315
+ const index = this.parent.selectedRowIndex;
26316
+ const isSelected = this.parent.selectionModule ? this.parent.selectionModule.selectedRowIndexes.length === 1 ||
26317
+ this.parent.selectionModule.getSelectedRowCellIndexes().length === 1 ? true : false : false;
26318
+ const prevRecord = this.parent.updatedRecords[this.parent.selectionModule.getSelectedRowIndexes()[0] - 1];
26319
+ if (!this.parent.editSettings.allowEditing || index === 0 || index === -1 || !isSelected ||
26320
+ this.parent.viewType === 'ResourceView' || this.parent.updatedRecords[index].level - prevRecord.level === 1) {
26321
+ this.updateItemVisibility(item.text);
26322
+ }
26255
26323
  }
26256
26324
  break;
26257
26325
  }
26258
26326
  case 'Outdent':
26259
26327
  {
26260
- const ind = this.parent.selectionModule.getSelectedRowIndexes()[0];
26261
- const isSelect = this.parent.selectionModule ? this.parent.selectionModule.selectedRowIndexes.length === 1 ||
26262
- this.parent.selectionModule.getSelectedRowCellIndexes().length === 1 ? true : false : false;
26263
- if (!this.parent.editSettings.allowEditing || ind === -1 || ind === 0 || !isSelect ||
26264
- this.parent.viewType === 'ResourceView' || this.parent.updatedRecords[ind].level === 0) {
26265
- this.updateItemVisibility(item.text);
26328
+ if (!this.parent.allowSelection) {
26329
+ this.hideItems.push(item.text);
26330
+ }
26331
+ else {
26332
+ const ind = this.parent.selectionModule.getSelectedRowIndexes()[0];
26333
+ const isSelect = this.parent.selectionModule ? this.parent.selectionModule.selectedRowIndexes.length === 1 ||
26334
+ this.parent.selectionModule.getSelectedRowCellIndexes().length === 1 ? true : false : false;
26335
+ if (!this.parent.editSettings.allowEditing || ind === -1 || ind === 0 || !isSelect ||
26336
+ this.parent.viewType === 'ResourceView' || this.parent.updatedRecords[ind].level === 0) {
26337
+ this.updateItemVisibility(item.text);
26338
+ }
26266
26339
  }
26267
26340
  break;
26268
26341
  }
@@ -27132,6 +27205,7 @@ class RowDD$1 {
27132
27205
  else {
27133
27206
  const level = 1;
27134
27207
  draggedRecord.level = droppedRecord.level + 1;
27208
+ this.parent.setRecordValue('level', this.draggedRecord.level, this.draggedRecord);
27135
27209
  this.updateChildRecordLevel(draggedRecord, level);
27136
27210
  }
27137
27211
  droppedRecord.expanded = true;
@@ -27216,6 +27290,7 @@ class RowDD$1 {
27216
27290
  parentData = this.parent.treeGrid[id][record.parentItem.uniqueID];
27217
27291
  }
27218
27292
  currentRecord.level = record.parentItem ? parentData.level + level : record.level + 1;
27293
+ this.parent.setRecordValue('level', currentRecord.level, currentRecord);
27219
27294
  if (currentRecord.hasChildRecords) {
27220
27295
  level--;
27221
27296
  level = this.updateChildRecordLevel(currentRecord, level);