@syncfusion/ej2-gantt 19.4.42 → 19.4.50

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 (67) hide show
  1. package/CHANGELOG.md +37 -0
  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 +193 -33
  5. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  6. package/dist/es6/ej2-gantt.es5.js +193 -33
  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/cell-edit.d.ts +1 -0
  13. package/src/gantt/actions/cell-edit.js +2 -0
  14. package/src/gantt/actions/chart-scroll.js +1 -0
  15. package/src/gantt/actions/dialog-edit.js +18 -2
  16. package/src/gantt/actions/edit.d.ts +3 -1
  17. package/src/gantt/actions/edit.js +101 -10
  18. package/src/gantt/actions/filter.js +1 -1
  19. package/src/gantt/actions/keyboard.js +1 -1
  20. package/src/gantt/actions/rowdragdrop.js +1 -1
  21. package/src/gantt/actions/taskbar-edit.js +3 -1
  22. package/src/gantt/base/gantt-chart.js +6 -0
  23. package/src/gantt/base/gantt.js +18 -5
  24. package/src/gantt/base/task-processor.js +9 -7
  25. package/src/gantt/renderer/edit-tooltip.js +1 -0
  26. package/src/gantt/renderer/timeline.d.ts +1 -0
  27. package/src/gantt/renderer/timeline.js +30 -5
  28. package/src/gantt/renderer/tooltip.js +1 -0
  29. package/styles/bootstrap-dark.css +12 -4
  30. package/styles/bootstrap.css +12 -4
  31. package/styles/bootstrap4.css +12 -4
  32. package/styles/bootstrap5-dark.css +10 -2
  33. package/styles/bootstrap5.css +10 -2
  34. package/styles/fabric-dark.css +9 -1
  35. package/styles/fabric.css +9 -1
  36. package/styles/gantt/_bootstrap-dark-definition.scss +3 -4
  37. package/styles/gantt/_bootstrap-definition.scss +3 -4
  38. package/styles/gantt/_bootstrap4-definition.scss +3 -4
  39. package/styles/gantt/_bootstrap5-definition.scss +1 -2
  40. package/styles/gantt/_fabric-dark-definition.scss +0 -1
  41. package/styles/gantt/_fabric-definition.scss +0 -1
  42. package/styles/gantt/_fluent-definition.scss +1 -2
  43. package/styles/gantt/_highcontrast-definition.scss +0 -1
  44. package/styles/gantt/_highcontrast-light-definition.scss +0 -1
  45. package/styles/gantt/_layout.scss +8 -1
  46. package/styles/gantt/_material-dark-definition.scss +0 -1
  47. package/styles/gantt/_material-definition.scss +0 -1
  48. package/styles/gantt/_tailwind-definition.scss +3 -4
  49. package/styles/gantt/bootstrap-dark.css +12 -4
  50. package/styles/gantt/bootstrap.css +12 -4
  51. package/styles/gantt/bootstrap4.css +12 -4
  52. package/styles/gantt/bootstrap5-dark.css +10 -2
  53. package/styles/gantt/bootstrap5.css +10 -2
  54. package/styles/gantt/fabric-dark.css +9 -1
  55. package/styles/gantt/fabric.css +9 -1
  56. package/styles/gantt/highcontrast-light.css +9 -1
  57. package/styles/gantt/highcontrast.css +9 -1
  58. package/styles/gantt/material-dark.css +9 -1
  59. package/styles/gantt/material.css +9 -1
  60. package/styles/gantt/tailwind-dark.css +12 -4
  61. package/styles/gantt/tailwind.css +12 -4
  62. package/styles/highcontrast-light.css +9 -1
  63. package/styles/highcontrast.css +9 -1
  64. package/styles/material-dark.css +9 -1
  65. package/styles/material.css +9 -1
  66. package/styles/tailwind-dark.css +12 -4
  67. package/styles/tailwind.css +12 -4
@@ -2729,14 +2729,16 @@ var TaskProcessor = /** @__PURE__ @class */ (function (_super) {
2729
2729
  // eslint-disable-next-line
2730
2730
  var resourcesId = [];
2731
2731
  var resourcesName = [];
2732
- for (var i = 0; i < resourceData.length; i++) {
2733
- resourcesId.push(resourceData[i][resourceSettings.id]);
2734
- var resName = resourceData[i][resourceSettings.name];
2735
- var resourceUnit = resourceData[i][resourceSettings.unit];
2736
- if (resourceUnit !== 100) {
2737
- resName += '[' + resourceUnit + '%' + ']';
2732
+ if (!isNullOrUndefined(resourceData)) {
2733
+ for (var i = 0; i < resourceData.length; i++) {
2734
+ resourcesId.push(resourceData[i][resourceSettings.id]);
2735
+ var resName = resourceData[i][resourceSettings.name];
2736
+ var resourceUnit = resourceData[i][resourceSettings.unit];
2737
+ if (resourceUnit !== 100) {
2738
+ resName += '[' + resourceUnit + '%' + ']';
2739
+ }
2740
+ resourcesName.push(resName);
2738
2741
  }
2739
- resourcesName.push(resName);
2740
2742
  }
2741
2743
  this.parent.setRecordValue('resourceNames', resourcesName.join(','), ganttProp, true);
2742
2744
  this.updateTaskDataResource(ganttData);
@@ -4047,6 +4049,7 @@ var ChartScroll = /** @__PURE__ @class */ (function () {
4047
4049
  */
4048
4050
  ChartScroll.prototype.setScrollTop = function (scrollTop) {
4049
4051
  this.element.scrollTop = scrollTop;
4052
+ this.parent.treeGrid.element.querySelector('.e-content').scrollTop = scrollTop;
4050
4053
  };
4051
4054
  /**
4052
4055
  * To set scroll left for chart scroll container
@@ -4437,6 +4440,12 @@ var GanttChart = /** @__PURE__ @class */ (function () {
4437
4440
  * @private
4438
4441
  */
4439
4442
  GanttChart.prototype.mouseUp = function (e) {
4443
+ if (this.parent.allowRowDragAndDrop) {
4444
+ var ganttDragElemet = this.parent.element.querySelector('.e-ganttdrag');
4445
+ if (ganttDragElemet) {
4446
+ ganttDragElemet.remove();
4447
+ }
4448
+ }
4440
4449
  if (!this.isGanttElement) {
4441
4450
  this.parent.notify('chartMouseUp', e);
4442
4451
  }
@@ -6098,6 +6107,7 @@ var Timeline = /** @__PURE__ @class */ (function () {
6098
6107
  * @private
6099
6108
  */
6100
6109
  Timeline.prototype.createTimelineTemplate = function (tier) {
6110
+ var isFirstCell = false;
6101
6111
  var parent = this.parent;
6102
6112
  var parentTh = '';
6103
6113
  var parentTr = '';
@@ -6114,10 +6124,19 @@ var Timeline = /** @__PURE__ @class */ (function () {
6114
6124
  // PDf export collection
6115
6125
  var timelineCell = {};
6116
6126
  timelineCell.startDate = new Date(startDate.getTime());
6117
- parentTr = this.getHeaterTemplateString(new Date(startDate.toString()), mode, tier, false, count, timelineCell);
6127
+ if (mode === 'Month' && tier === 'bottomTier' && ((this.parent.currentZoomingLevel.level === 5) || (this.parent.currentZoomingLevel.level === 6)) && scheduleDateCollection.length === 0) {
6128
+ isFirstCell = true;
6129
+ }
6130
+ parentTr = this.getHeaterTemplateString(new Date(startDate.toString()), mode, tier, false, count, timelineCell, isFirstCell);
6118
6131
  scheduleDateCollection.push(new Date(startDate.toString()));
6119
- increment = this.getIncrement(startDate, count, mode);
6120
- newTime = startDate.getTime() + increment;
6132
+ if (isFirstCell) {
6133
+ newTime = this.calculateQuarterEndDate(startDate).getTime();
6134
+ }
6135
+ else {
6136
+ increment = this.getIncrement(startDate, count, mode);
6137
+ newTime = startDate.getTime() + increment;
6138
+ }
6139
+ isFirstCell = false;
6121
6140
  startDate.setTime(newTime);
6122
6141
  if (startDate >= endDate) {
6123
6142
  /* eslint-disable-next-line */
@@ -6227,6 +6246,21 @@ var Timeline = /** @__PURE__ @class */ (function () {
6227
6246
  mode === 'Hour' || mode === 'Minutes') &&
6228
6247
  this.parent.nonWorkingDayIndex.indexOf(day.getDay()) !== -1;
6229
6248
  };
6249
+ Timeline.prototype.calculateQuarterEndDate = function (date) {
6250
+ var month = date.getMonth();
6251
+ if (month >= 0 && month <= 2) {
6252
+ return new Date(date.getFullYear(), 3, 1);
6253
+ }
6254
+ else if (month >= 3 && month <= 5) {
6255
+ return new Date(date.getFullYear(), 6, 1);
6256
+ }
6257
+ else if (month >= 6 && month <= 8) {
6258
+ return new Date(date.getFullYear(), 9, 1);
6259
+ }
6260
+ else {
6261
+ return new Date(date.getFullYear() + 1, 0, 1);
6262
+ }
6263
+ };
6230
6264
  /**
6231
6265
  * To construct template string.
6232
6266
  *
@@ -6240,7 +6274,7 @@ var Timeline = /** @__PURE__ @class */ (function () {
6240
6274
  * @private
6241
6275
  */
6242
6276
  /* eslint-disable-next-line */
6243
- Timeline.prototype.getHeaterTemplateString = function (scheduleWeeks, mode, tier, isLast, count, timelineCell) {
6277
+ Timeline.prototype.getHeaterTemplateString = function (scheduleWeeks, mode, tier, isLast, count, timelineCell, isFirstCell) {
6244
6278
  var parentTr = '';
6245
6279
  var td = '';
6246
6280
  var format = tier === 'topTier' ?
@@ -6255,7 +6289,7 @@ var Timeline = /** @__PURE__ @class */ (function () {
6255
6289
  this.customFormat(scheduleWeeks, format, tier, mode, formatter);
6256
6290
  thWidth = (this.getIncrement(scheduleWeeks, count, mode) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth;
6257
6291
  var cellWidth = thWidth;
6258
- thWidth = isLast ? this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.timelineRoundOffEndDate)
6292
+ thWidth = isLast || isFirstCell ? isLast ? this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.timelineRoundOffEndDate) : this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.calculateQuarterEndDate(scheduleWeeks))
6259
6293
  : thWidth;
6260
6294
  var isWeekendCell = this.isWeekendHeaderCell(mode, tier, scheduleWeeks);
6261
6295
  var textClassName = tier === 'topTier' ? ' e-gantt-top-cell-text' : '';
@@ -11884,6 +11918,7 @@ var Tooltip$1 = /** @__PURE__ @class */ (function () {
11884
11918
  tooltipPositionY = tooltipPositionY + 10;
11885
11919
  }
11886
11920
  args.element.style.top = tooltipPositionY + 'px';
11921
+ args.element.style.visibility = 'visible';
11887
11922
  };
11888
11923
  /**
11889
11924
  * Method to get mouse pointor position
@@ -12249,7 +12284,7 @@ var FocusModule = /** @__PURE__ @class */ (function () {
12249
12284
  {
12250
12285
  if (isNullOrUndefined(document.getElementById(this.parent.element.id + '_dialog'))) {
12251
12286
  e.preventDefault();
12252
- ganttObj.addRecord();
12287
+ ganttObj.addRecord(undefined, this.parent.editSettings.newRowPosition);
12253
12288
  var focussedElement = ganttObj.element;
12254
12289
  focussedElement.focus();
12255
12290
  }
@@ -12671,8 +12706,14 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
12671
12706
  Gantt.prototype.calculateDimensions = function () {
12672
12707
  var settingsHeight;
12673
12708
  if (typeof (this.height) !== 'number' && this.height.indexOf('%') !== -1 && (this.element.parentElement &&
12674
- !this.element.parentElement.style.height)) {
12675
- var ganttHeight = Number(this.height.split("%")[0]);
12709
+ !this.element.parentElement.style.height || this.element.parentElement.style.height.indexOf('%') !== -1)) {
12710
+ var ganttHeight = void 0;
12711
+ if (this.element.parentElement.style.height.indexOf('%') == -1) {
12712
+ ganttHeight = Number(this.height.split("%")[0]);
12713
+ }
12714
+ else {
12715
+ ganttHeight = Number(this.element.parentElement.style.height.split("%")[0]);
12716
+ }
12676
12717
  ganttHeight = (ganttHeight * window.innerHeight) / 100;
12677
12718
  if (this.height === '100%') {
12678
12719
  ganttHeight = ganttHeight - 16;
@@ -12827,9 +12868,16 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
12827
12868
  var settingsHeight = void 0;
12828
12869
  if (this.height.indexOf('%') !== -1) {
12829
12870
  var ganttHeight = Number(this.height.split("%")[0]);
12830
- if (this.element.parentElement && this.element.parentElement.style.height) {
12831
- var containerHeight = Number(this.element.parentElement.style.height.split("px")[0]);
12832
- ganttHeight = (ganttHeight * containerHeight) / 100;
12871
+ if (this.element.parentElement && (this.element.parentElement.style.height)) {
12872
+ var containerHeight = void 0;
12873
+ if (this.element.parentElement.style.height.indexOf('%') == -1) {
12874
+ containerHeight = Number(this.element.parentElement.style.height.split("px")[0]);
12875
+ ganttHeight = (ganttHeight * containerHeight) / 100;
12876
+ }
12877
+ else {
12878
+ containerHeight = Number(this.element.parentElement.style.height.split("%")[0]);
12879
+ ganttHeight = (window.innerHeight * containerHeight) / 100;
12880
+ }
12833
12881
  }
12834
12882
  else {
12835
12883
  ganttHeight = Number(this.height.split("%")[0]);
@@ -15600,6 +15648,7 @@ var CellEdit = /** @__PURE__ @class */ (function () {
15600
15648
  * @private
15601
15649
  */
15602
15650
  this.isCellEdit = false;
15651
+ this.isResourceCellEdited = false;
15603
15652
  this.parent = ganttObj;
15604
15653
  this.bindTreeGridProperties();
15605
15654
  }
@@ -16029,6 +16078,7 @@ var CellEdit = /** @__PURE__ @class */ (function () {
16029
16078
  var resourceSettings = this.parent.resourceFields;
16030
16079
  var editedResourceId = editedObj[this.parent.taskFields.resourceInfo];
16031
16080
  if (editedResourceId) {
16081
+ this.isResourceCellEdited = true;
16032
16082
  var tempResourceInfo = this.parent.dataOperation.setResourceInfo(editedObj);
16033
16083
  var editedResouceLength = tempResourceInfo.length;
16034
16084
  var previousResource = previousData.ganttProperties.resourceInfo;
@@ -16205,6 +16255,7 @@ var EditTooltip = /** @__PURE__ @class */ (function () {
16205
16255
  tooltipPositionX += leftEnd - (tooltipPositionX + args.element.offsetWidth);
16206
16256
  }
16207
16257
  args.element.style.left = tooltipPositionX + 'px';
16258
+ args.element.style.visibility = 'visible';
16208
16259
  };
16209
16260
  /**
16210
16261
  * To show/hide taskbar edit tooltip.
@@ -16852,7 +16903,9 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
16852
16903
  if (this.isMouseDragged && this.taskBarEditAction) {
16853
16904
  var args = {
16854
16905
  cancel: false,
16855
- requestType: 'taskbarediting'
16906
+ requestType: 'taskbarediting',
16907
+ taskBarEditAction: this.taskBarEditAction,
16908
+ data: this.taskBarEditRecord
16856
16909
  };
16857
16910
  if (this.segmentIndex !== -1) {
16858
16911
  args.requestType = 'mergeSegment';
@@ -19340,7 +19393,15 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
19340
19393
  field: fields[i], headerText: this_1.localeObj.getConstant(fields[i]), editType: 'stringedit', width: '200px',
19341
19394
  edit: {
19342
19395
  write: function (args) {
19343
- var datePickerModel = _this.beforeOpenArgs[generalTabString][_this.parent.taskFields[fields[i]]];
19396
+ var datePickerModel;
19397
+ if (!isNullOrUndefined(_this.beforeOpenArgs[generalTabString])) {
19398
+ datePickerModel = _this.beforeOpenArgs[generalTabString][_this.parent.taskFields[fields[i]]];
19399
+ }
19400
+ else {
19401
+ var columnFields = _this.getGeneralColumnFields();
19402
+ var columnModel = _this.getFieldsModel(columnFields);
19403
+ datePickerModel = columnModel[_this.parent.taskFields[fields[i]]];
19404
+ }
19344
19405
  var value = args.rowData[args.column.field];
19345
19406
  setValue('value', value, datePickerModel);
19346
19407
  var datePicker = new _this.inputs[_this.parent.columnByField[_this.parent.taskFields[fields[i]]].editType](datePickerModel);
@@ -19363,7 +19424,15 @@ var DialogEdit = /** @__PURE__ @class */ (function () {
19363
19424
  field: fields[i], headerText: this_1.localeObj.getConstant(fields[i]), editType: 'stringedit', width: '100px',
19364
19425
  edit: {
19365
19426
  write: function (args) {
19366
- var inputTextModel = _this.beforeOpenArgs[generalTabString][_this.parent.taskFields[fields[i]]];
19427
+ var inputTextModel;
19428
+ if (!isNullOrUndefined(_this.beforeOpenArgs[generalTabString])) {
19429
+ inputTextModel = _this.beforeOpenArgs[generalTabString][_this.parent.taskFields[fields[i]]];
19430
+ }
19431
+ else {
19432
+ var columnFields = _this.getGeneralColumnFields();
19433
+ var columnModel = _this.getFieldsModel(columnFields);
19434
+ inputTextModel = columnModel[_this.parent.taskFields[fields[i]]];
19435
+ }
19367
19436
  inputTextModel.floatLabelType = 'Never';
19368
19437
  var value = args.rowData[args.column.field];
19369
19438
  if (!isNullOrUndefined(value)) {
@@ -22066,9 +22135,12 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
22066
22135
  */
22067
22136
  Edit$$1.prototype.updateParentChildRecord = function (data) {
22068
22137
  var ganttRecord = data;
22069
- if (ganttRecord.hasChildRecords && this.taskbarMoved && this.parent.taskMode === 'Auto') {
22138
+ if (ganttRecord.hasChildRecords && this.taskbarMoved && this.parent.taskMode === 'Auto' && (!isNullOrUndefined(this.parent.editModule.cellEditModule) && !this.parent.editModule.cellEditModule.isResourceCellEdited)) {
22070
22139
  this.updateChildItems(ganttRecord);
22071
22140
  }
22141
+ if (!isNullOrUndefined(this.parent.editModule.cellEditModule)) {
22142
+ this.parent.editModule.cellEditModule.isResourceCellEdited = false;
22143
+ }
22072
22144
  };
22073
22145
  /**
22074
22146
  * To update records while changing schedule mode.
@@ -23520,7 +23592,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23520
23592
  /*Record Updates*/
23521
23593
  recordIndex = flatRecords.indexOf(this.addRowSelectedItem);
23522
23594
  updatedCollectionIndex = currentViewData.indexOf(this.addRowSelectedItem);
23523
- this.recordCollectionUpdate(childIndex, recordIndex, updatedCollectionIndex, record, parentItem);
23595
+ this.recordCollectionUpdate(childIndex, recordIndex, updatedCollectionIndex, record, parentItem, rowPosition);
23524
23596
  break;
23525
23597
  case 'Below':
23526
23598
  currentItemIndex = flatRecords.indexOf(this.addRowSelectedItem);
@@ -23534,7 +23606,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23534
23606
  recordIndex = currentItemIndex + 1;
23535
23607
  updatedCollectionIndex = currentViewData.indexOf(this.addRowSelectedItem) + 1;
23536
23608
  }
23537
- this.recordCollectionUpdate(childIndex + 1, recordIndex, updatedCollectionIndex, record, parentItem);
23609
+ this.recordCollectionUpdate(childIndex + 1, recordIndex, updatedCollectionIndex, record, parentItem, rowPosition);
23538
23610
  break;
23539
23611
  case 'Child':
23540
23612
  currentItemIndex = flatRecords.indexOf(this.addRowSelectedItem);
@@ -23562,7 +23634,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23562
23634
  this.addRowSelectedItem.ganttProperties.segments = null;
23563
23635
  }
23564
23636
  }
23565
- this.recordCollectionUpdate(childIndex + 1, recordIndex, updatedCollectionIndex, record, parentItem);
23637
+ this.recordCollectionUpdate(childIndex + 1, recordIndex, updatedCollectionIndex, record, parentItem, rowPosition);
23566
23638
  break;
23567
23639
  }
23568
23640
  this.newlyAddedRecordBackup = record;
@@ -23576,7 +23648,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23576
23648
  * @returns {void} .
23577
23649
  * @private
23578
23650
  */
23579
- Edit$$1.prototype.recordCollectionUpdate = function (childIndex, recordIndex, updatedCollectionIndex, record, parentItem) {
23651
+ Edit$$1.prototype.recordCollectionUpdate = function (childIndex, recordIndex, updatedCollectionIndex, record, parentItem, rowPosition) {
23580
23652
  var flatRecords = this.parent.flatData;
23581
23653
  var currentViewData = this.parent.currentViewData;
23582
23654
  var ids = this.parent.ids;
@@ -23598,7 +23670,15 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23598
23670
  !isNullOrUndefined(this.parent.dataSource)) {
23599
23671
  var child = this.parent.taskFields.child;
23600
23672
  if (parentItem.taskData[child] && parentItem.taskData[child].length > 0) {
23601
- parentItem.taskData[child].push(record.taskData);
23673
+ if (rowPosition === 'Above') {
23674
+ parentItem.taskData[child].splice(childIndex, 0, record.taskData);
23675
+ }
23676
+ else if (rowPosition === 'Below') {
23677
+ parentItem.taskData[child].splice(childIndex + 1, 0, record.taskData);
23678
+ }
23679
+ else {
23680
+ parentItem.taskData[child].push(record.taskData);
23681
+ }
23602
23682
  }
23603
23683
  else {
23604
23684
  parentItem.taskData[child] = [];
@@ -23683,13 +23763,13 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23683
23763
  }
23684
23764
  for (var i = 0; i < addedRecord.length; i++) {
23685
23765
  if (isNullOrUndefined(rowPosition) || isNullOrUndefined(this.addRowSelectedItem)) {
23686
- rowPosition = 'Top';
23766
+ rowPosition = rowPosition === 'Bottom' ? 'Bottom' : 'Top';
23687
23767
  }
23688
23768
  if (rowPosition === 'Top') {
23689
23769
  dataSource.splice(0, 0, addedRecord[i].taskData);
23690
23770
  }
23691
23771
  else if (rowPosition === 'Bottom') {
23692
- dataSource.push(addedRecord[i]);
23772
+ dataSource.push(addedRecord[i].taskData);
23693
23773
  }
23694
23774
  else {
23695
23775
  if (!isNullOrUndefined(taskFields.id) && !isNullOrUndefined(taskFields.parentID)) {
@@ -23842,7 +23922,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23842
23922
  else {
23843
23923
  if (_this.parent.viewType === 'ProjectView') {
23844
23924
  if ((rowPosition === 'Top' || rowPosition === 'Bottom') ||
23845
- ((rowPosition === 'Above' || rowPosition === 'Below') && !args.data.parentItem)) {
23925
+ ((rowPosition === 'Above' || rowPosition === 'Below' || rowPosition === 'Child') && !args.data.parentItem)) {
23846
23926
  if (args.data instanceof Array) {
23847
23927
  _this.updateRealDataSource(args.data, rowPosition);
23848
23928
  }
@@ -23885,6 +23965,59 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23885
23965
  * @returns {void} .
23886
23966
  * @private
23887
23967
  */
23968
+ Edit$$1.prototype.createNewRecord = function () {
23969
+ var tempRecord = {};
23970
+ var ganttColumns = this.parent.ganttColumns;
23971
+ var taskSettingsFields = this.parent.taskFields;
23972
+ var taskId = this.parent.editModule.getNewTaskId();
23973
+ for (var i = 0; i < ganttColumns.length; i++) {
23974
+ var fieldName = ganttColumns[i].field;
23975
+ if (fieldName === taskSettingsFields.id) {
23976
+ tempRecord[fieldName] = taskId;
23977
+ }
23978
+ else if (ganttColumns[i].field === taskSettingsFields.startDate) {
23979
+ if (isNullOrUndefined(tempRecord[taskSettingsFields.endDate])) {
23980
+ tempRecord[fieldName] = this.parent.editModule.dialogModule.getMinimumStartDate();
23981
+ }
23982
+ else {
23983
+ tempRecord[fieldName] = new Date(tempRecord[taskSettingsFields.endDate]);
23984
+ }
23985
+ if (this.parent.timezone) {
23986
+ tempRecord[fieldName] = this.parent.dateValidationModule.remove(tempRecord[fieldName], this.parent.timezone);
23987
+ }
23988
+ }
23989
+ else if (ganttColumns[i].field === taskSettingsFields.endDate) {
23990
+ if (isNullOrUndefined(tempRecord[taskSettingsFields.startDate])) {
23991
+ tempRecord[fieldName] = this.parent.editModule.dialogModule.getMinimumStartDate();
23992
+ }
23993
+ else {
23994
+ tempRecord[fieldName] = new Date(tempRecord[taskSettingsFields.startDate]);
23995
+ }
23996
+ if (this.parent.timezone) {
23997
+ tempRecord[fieldName] = this.parent.dateValidationModule.remove(tempRecord[fieldName], this.parent.timezone);
23998
+ }
23999
+ }
24000
+ else if (ganttColumns[i].field === taskSettingsFields.duration) {
24001
+ tempRecord[fieldName] = 1;
24002
+ }
24003
+ else if (ganttColumns[i].field === taskSettingsFields.name) {
24004
+ tempRecord[fieldName] = this.parent.editModule.dialogModule['localeObj'].getConstant('addDialogTitle') + ' ' + taskId;
24005
+ }
24006
+ else if (ganttColumns[i].field === taskSettingsFields.progress) {
24007
+ tempRecord[fieldName] = 0;
24008
+ }
24009
+ else if (ganttColumns[i].field === taskSettingsFields.work) {
24010
+ tempRecord[fieldName] = 0;
24011
+ }
24012
+ else if (ganttColumns[i].field === 'taskType') {
24013
+ tempRecord[fieldName] = this.parent.taskType;
24014
+ }
24015
+ else {
24016
+ tempRecord[this.parent.ganttColumns[i].field] = '';
24017
+ }
24018
+ }
24019
+ return tempRecord;
24020
+ };
23888
24021
  Edit$$1.prototype.validateTaskPosition = function (data, rowPosition, rowIndex, cAddedRecord) {
23889
24022
  var selectedRowIndex = isNullOrUndefined(rowIndex) || isNaN(parseInt(rowIndex.toString(), 10)) ?
23890
24023
  this.parent.selectionModule ?
@@ -23896,7 +24029,7 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23896
24029
  this.parent.selectionModule.getSelectedRowCellIndexes()[0].rowIndex : null : null : rowIndex;
23897
24030
  this.addRowSelectedItem = isNullOrUndefined(selectedRowIndex) ? null : this.parent.updatedRecords[selectedRowIndex];
23898
24031
  rowPosition = isNullOrUndefined(rowPosition) ? this.parent.editSettings.newRowPosition : rowPosition;
23899
- data = isNullOrUndefined(data) ? this.parent.editModule.dialogModule.composeAddRecord() : data;
24032
+ data = isNullOrUndefined(data) ? this.createNewRecord() : data;
23900
24033
  if (((isNullOrUndefined(selectedRowIndex) || selectedRowIndex < 0 ||
23901
24034
  isNullOrUndefined(this.addRowSelectedItem)) && (rowPosition === 'Above'
23902
24035
  || rowPosition === 'Below'
@@ -23988,6 +24121,10 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
23988
24121
  }
23989
24122
  this.parent.timelineModule.updateTimeLineOnEditing([tempArray], args.action);
23990
24123
  }
24124
+ var flag = getValue('doubleClickTarget', this.parent.treeGrid.editModule);
24125
+ if (flag !== null) {
24126
+ setValue('doubleClickTarget', null, this.parent.treeGrid.editModule);
24127
+ }
23991
24128
  this.addSuccess(args);
23992
24129
  args = this.constructTaskAddedEventArgs(cAddedRecord, args.modifiedRecords, 'add');
23993
24130
  this.parent.trigger('actionComplete', args);
@@ -24391,6 +24528,25 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24391
24528
  var delRow = this.parent.getTaskByUniqueID(this.draggedRecord.uniqueID);
24392
24529
  this.removeRecords(delRow);
24393
24530
  };
24531
+ Edit$$1.prototype.updateIndentedChildRecords = function (indentedRecord) {
24532
+ var createParentItem = {
24533
+ uniqueID: indentedRecord.uniqueID,
24534
+ expanded: indentedRecord.expanded,
24535
+ level: indentedRecord.level,
24536
+ index: indentedRecord.index,
24537
+ taskId: indentedRecord.ganttProperties.rowUniqueID
24538
+ };
24539
+ for (var i = 0; i < indentedRecord.childRecords.length; i++) {
24540
+ this.parent.setRecordValue('parentItem', createParentItem, indentedRecord.childRecords[i]);
24541
+ this.parent.setRecordValue('parentUniqueID', indentedRecord.uniqueID, indentedRecord.childRecords[i]);
24542
+ }
24543
+ if (indentedRecord.hasChildRecords) {
24544
+ indentedRecord = indentedRecord.childRecords;
24545
+ for (var j = 0; j < indentedRecord['length']; j++) {
24546
+ this.updateIndentedChildRecords(indentedRecord[j]);
24547
+ }
24548
+ }
24549
+ };
24394
24550
  Edit$$1.prototype.dropMiddle = function (recordIndex1) {
24395
24551
  var obj = this.parent;
24396
24552
  var childRec = this.parent.editModule.getChildCount(this.droppedRecord, 0);
@@ -24406,6 +24562,10 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
24406
24562
  this.recordLevel();
24407
24563
  if (this.draggedRecord.hasChildRecords) {
24408
24564
  this.updateChildRecord(this.draggedRecord, childRecordsLength, this.droppedRecord.expanded);
24565
+ if (this.parent.enableImmutableMode) {
24566
+ var indentedRecord = this.draggedRecord;
24567
+ this.updateIndentedChildRecords(indentedRecord);
24568
+ }
24409
24569
  }
24410
24570
  if (isNullOrUndefined(this.draggedRecord.parentItem &&
24411
24571
  this.updateParentRecords.indexOf(this.draggedRecord.parentItem) !== -1)) {
@@ -24894,7 +25054,7 @@ var Filter$1 = /** @__PURE__ @class */ (function () {
24894
25054
  var ganttElement = closest(element, '#' + this.parent.element.id)
24895
25055
  || element.querySelector('#' + this.parent.element.id);
24896
25056
  if ((!(this.filterMenuElement.contains(element)) && !isNullOrUndefined(ganttElement)) || element.nodeName === 'HTML'
24897
- || element.nodeName === 'DIV') {
25057
+ || ((element.nodeName === 'DIV') && (!element.classList.contains('e-day')))) {
24898
25058
  remove(this.filterMenuElement);
24899
25059
  this.parent.treeGrid.grid.notify('filter-menu-close', { isOpen: false });
24900
25060
  this.filterMenuElement = null;
@@ -27675,7 +27835,7 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
27675
27835
  if (this.dropPosition === 'topSegment' || this.dropPosition === 'bottomSegment') {
27676
27836
  var rowPosition = this.dropPosition === 'topSegment' ? 'Above' : 'Below';
27677
27837
  this.parent.editModule.addRowSelectedItem = droppedRecord;
27678
- this.parent.editModule.updateRealDataSource(draggedRecord, rowPosition);
27838
+ this.parent.editModule.updateRealDataSource([draggedRecord], rowPosition);
27679
27839
  delete this.parent.editModule.addRowSelectedItem;
27680
27840
  }
27681
27841
  }