@syncfusion/ej2-gantt 19.4.43 → 19.4.52

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 (69) hide show
  1. package/CHANGELOG.md +37 -0
  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 +186 -29
  6. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  7. package/dist/es6/ej2-gantt.es5.js +186 -29
  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/cell-edit.d.ts +1 -0
  14. package/src/gantt/actions/cell-edit.js +2 -0
  15. package/src/gantt/actions/chart-scroll.js +1 -0
  16. package/src/gantt/actions/dialog-edit.js +18 -2
  17. package/src/gantt/actions/edit.d.ts +3 -1
  18. package/src/gantt/actions/edit.js +97 -10
  19. package/src/gantt/actions/filter.js +1 -1
  20. package/src/gantt/actions/keyboard.js +1 -1
  21. package/src/gantt/actions/rowdragdrop.js +1 -1
  22. package/src/gantt/actions/taskbar-edit.js +3 -1
  23. package/src/gantt/base/gantt-chart.js +6 -0
  24. package/src/gantt/base/gantt.js +17 -5
  25. package/src/gantt/base/tree-grid.js +4 -0
  26. package/src/gantt/renderer/chart-rows.js +3 -3
  27. package/src/gantt/renderer/edit-tooltip.js +1 -0
  28. package/src/gantt/renderer/timeline.d.ts +1 -0
  29. package/src/gantt/renderer/timeline.js +30 -5
  30. package/src/gantt/renderer/tooltip.js +1 -0
  31. package/styles/bootstrap-dark.css +15 -4
  32. package/styles/bootstrap.css +15 -4
  33. package/styles/bootstrap4.css +15 -4
  34. package/styles/bootstrap5-dark.css +13 -2
  35. package/styles/bootstrap5.css +13 -2
  36. package/styles/fabric-dark.css +12 -1
  37. package/styles/fabric.css +12 -1
  38. package/styles/gantt/_bootstrap-dark-definition.scss +3 -4
  39. package/styles/gantt/_bootstrap-definition.scss +3 -4
  40. package/styles/gantt/_bootstrap4-definition.scss +3 -4
  41. package/styles/gantt/_bootstrap5-definition.scss +1 -2
  42. package/styles/gantt/_fabric-dark-definition.scss +0 -1
  43. package/styles/gantt/_fabric-definition.scss +0 -1
  44. package/styles/gantt/_fluent-definition.scss +1 -2
  45. package/styles/gantt/_highcontrast-definition.scss +0 -1
  46. package/styles/gantt/_highcontrast-light-definition.scss +0 -1
  47. package/styles/gantt/_layout.scss +11 -1
  48. package/styles/gantt/_material-dark-definition.scss +0 -1
  49. package/styles/gantt/_material-definition.scss +0 -1
  50. package/styles/gantt/_tailwind-definition.scss +3 -4
  51. package/styles/gantt/bootstrap-dark.css +15 -4
  52. package/styles/gantt/bootstrap.css +15 -4
  53. package/styles/gantt/bootstrap4.css +15 -4
  54. package/styles/gantt/bootstrap5-dark.css +13 -2
  55. package/styles/gantt/bootstrap5.css +13 -2
  56. package/styles/gantt/fabric-dark.css +12 -1
  57. package/styles/gantt/fabric.css +12 -1
  58. package/styles/gantt/highcontrast-light.css +12 -1
  59. package/styles/gantt/highcontrast.css +12 -1
  60. package/styles/gantt/material-dark.css +12 -1
  61. package/styles/gantt/material.css +12 -1
  62. package/styles/gantt/tailwind-dark.css +15 -4
  63. package/styles/gantt/tailwind.css +15 -4
  64. package/styles/highcontrast-light.css +12 -1
  65. package/styles/highcontrast.css +12 -1
  66. package/styles/material-dark.css +12 -1
  67. package/styles/material.css +12 -1
  68. package/styles/tailwind-dark.css +15 -4
  69. package/styles/tailwind.css +15 -4
@@ -4003,6 +4003,7 @@ class ChartScroll {
4003
4003
  */
4004
4004
  setScrollTop(scrollTop) {
4005
4005
  this.element.scrollTop = scrollTop;
4006
+ this.parent.treeGrid.element.querySelector('.e-content').scrollTop = scrollTop;
4006
4007
  }
4007
4008
  /**
4008
4009
  * To set scroll left for chart scroll container
@@ -4395,6 +4396,12 @@ class GanttChart {
4395
4396
  * @private
4396
4397
  */
4397
4398
  mouseUp(e) {
4399
+ if (this.parent.allowRowDragAndDrop) {
4400
+ const ganttDragElemet = this.parent.element.querySelector('.e-ganttdrag');
4401
+ if (ganttDragElemet) {
4402
+ ganttDragElemet.remove();
4403
+ }
4404
+ }
4398
4405
  if (!this.isGanttElement) {
4399
4406
  this.parent.notify('chartMouseUp', e);
4400
4407
  }
@@ -6034,6 +6041,7 @@ class Timeline {
6034
6041
  * @private
6035
6042
  */
6036
6043
  createTimelineTemplate(tier) {
6044
+ var isFirstCell = false;
6037
6045
  const parent = this.parent;
6038
6046
  let parentTh = '';
6039
6047
  let parentTr = '';
@@ -6050,10 +6058,19 @@ class Timeline {
6050
6058
  // PDf export collection
6051
6059
  const timelineCell = {};
6052
6060
  timelineCell.startDate = new Date(startDate.getTime());
6053
- parentTr = this.getHeaterTemplateString(new Date(startDate.toString()), mode, tier, false, count, timelineCell);
6061
+ if (mode === 'Month' && tier === 'bottomTier' && ((this.parent.currentZoomingLevel.level === 5) || (this.parent.currentZoomingLevel.level === 6)) && scheduleDateCollection.length === 0) {
6062
+ isFirstCell = true;
6063
+ }
6064
+ parentTr = this.getHeaterTemplateString(new Date(startDate.toString()), mode, tier, false, count, timelineCell, isFirstCell);
6054
6065
  scheduleDateCollection.push(new Date(startDate.toString()));
6055
- increment = this.getIncrement(startDate, count, mode);
6056
- newTime = startDate.getTime() + increment;
6066
+ if (isFirstCell) {
6067
+ newTime = this.calculateQuarterEndDate(startDate).getTime();
6068
+ }
6069
+ else {
6070
+ increment = this.getIncrement(startDate, count, mode);
6071
+ newTime = startDate.getTime() + increment;
6072
+ }
6073
+ isFirstCell = false;
6057
6074
  startDate.setTime(newTime);
6058
6075
  if (startDate >= endDate) {
6059
6076
  /* eslint-disable-next-line */
@@ -6163,6 +6180,21 @@ class Timeline {
6163
6180
  mode === 'Hour' || mode === 'Minutes') &&
6164
6181
  this.parent.nonWorkingDayIndex.indexOf(day.getDay()) !== -1;
6165
6182
  }
6183
+ calculateQuarterEndDate(date) {
6184
+ const month = date.getMonth();
6185
+ if (month >= 0 && month <= 2) {
6186
+ return new Date(date.getFullYear(), 3, 1);
6187
+ }
6188
+ else if (month >= 3 && month <= 5) {
6189
+ return new Date(date.getFullYear(), 6, 1);
6190
+ }
6191
+ else if (month >= 6 && month <= 8) {
6192
+ return new Date(date.getFullYear(), 9, 1);
6193
+ }
6194
+ else {
6195
+ return new Date(date.getFullYear() + 1, 0, 1);
6196
+ }
6197
+ }
6166
6198
  /**
6167
6199
  * To construct template string.
6168
6200
  *
@@ -6176,7 +6208,7 @@ class Timeline {
6176
6208
  * @private
6177
6209
  */
6178
6210
  /* eslint-disable-next-line */
6179
- getHeaterTemplateString(scheduleWeeks, mode, tier, isLast, count, timelineCell) {
6211
+ getHeaterTemplateString(scheduleWeeks, mode, tier, isLast, count, timelineCell, isFirstCell) {
6180
6212
  let parentTr = '';
6181
6213
  let td = '';
6182
6214
  const format = tier === 'topTier' ?
@@ -6191,7 +6223,7 @@ class Timeline {
6191
6223
  this.customFormat(scheduleWeeks, format, tier, mode, formatter);
6192
6224
  thWidth = (this.getIncrement(scheduleWeeks, count, mode) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth;
6193
6225
  const cellWidth = thWidth;
6194
- thWidth = isLast ? this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.timelineRoundOffEndDate)
6226
+ thWidth = isLast || isFirstCell ? isLast ? this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.timelineRoundOffEndDate) : this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.calculateQuarterEndDate(scheduleWeeks))
6195
6227
  : thWidth;
6196
6228
  const isWeekendCell = this.isWeekendHeaderCell(mode, tier, scheduleWeeks);
6197
6229
  const textClassName = tier === 'topTier' ? ' e-gantt-top-cell-text' : '';
@@ -6859,6 +6891,10 @@ class GanttTreeGrid {
6859
6891
  }
6860
6892
  actionBegin(args) {
6861
6893
  this.parent.notify('actionBegin', args);
6894
+ let flag = getValue('doubleClickTarget', this.parent.treeGrid.editModule);
6895
+ if (flag !== null) {
6896
+ setValue('doubleClickTarget', null, this.parent.treeGrid.editModule);
6897
+ }
6862
6898
  this.parent.trigger('actionBegin', args);
6863
6899
  } // eslint-disable-next-line
6864
6900
  created(args) {
@@ -7945,9 +7981,9 @@ class ChartRows extends DateProcessor {
7945
7981
  }
7946
7982
  if (labelString !== 'null') {
7947
7983
  taskLabel$$1 = '<span class="' + taskLabel + '" style="line-height:' +
7948
- (this.taskBarHeight - 1) + 'px; text-align:' + (this.parent.viewType === 'ResourceView' ? 'left;' : '') +
7949
- 'display:' + (this.parent.viewType === 'ResourceView' ? 'inline-flex;' : '') +
7950
- 'width:' + (this.parent.viewType === 'ResourceView' ? (data.ganttProperties.width - 10) : '') + 'px; height:' +
7984
+ (this.taskBarHeight - 1) + 'px; text-align: left;' +
7985
+ 'display:' + 'inline-block;' +
7986
+ 'width:' + (data.ganttProperties.width - 10) + 'px; height:' +
7951
7987
  this.taskBarHeight + 'px;">' + labelString + '</span>';
7952
7988
  }
7953
7989
  const template = !isNullOrUndefined(data.ganttProperties.segments) && data.ganttProperties.segments.length > 0 ?
@@ -11489,6 +11525,7 @@ class Tooltip$1 {
11489
11525
  tooltipPositionY = tooltipPositionY + 10;
11490
11526
  }
11491
11527
  args.element.style.top = tooltipPositionY + 'px';
11528
+ args.element.style.visibility = 'visible';
11492
11529
  }
11493
11530
  /**
11494
11531
  * Method to get mouse pointor position
@@ -11853,7 +11890,7 @@ class FocusModule {
11853
11890
  {
11854
11891
  if (isNullOrUndefined(document.getElementById(this.parent.element.id + '_dialog'))) {
11855
11892
  e.preventDefault();
11856
- ganttObj.addRecord();
11893
+ ganttObj.addRecord(undefined, this.parent.editSettings.newRowPosition);
11857
11894
  const focussedElement = ganttObj.element;
11858
11895
  focussedElement.focus();
11859
11896
  }
@@ -12260,7 +12297,13 @@ let Gantt = class Gantt extends Component {
12260
12297
  let settingsHeight;
12261
12298
  if (typeof (this.height) !== 'number' && this.height.indexOf('%') !== -1 && (this.element.parentElement &&
12262
12299
  !this.element.parentElement.style.height || this.element.parentElement.style.height.indexOf('%') !== -1)) {
12263
- let ganttHeight = Number(this.height.split("%")[0]);
12300
+ let ganttHeight;
12301
+ if (this.element.parentElement.style.height.indexOf('%') == -1) {
12302
+ ganttHeight = Number(this.height.split("%")[0]);
12303
+ }
12304
+ else {
12305
+ ganttHeight = Number(this.element.parentElement.style.height.split("%")[0]);
12306
+ }
12264
12307
  ganttHeight = (ganttHeight * window.innerHeight) / 100;
12265
12308
  if (this.height === '100%') {
12266
12309
  ganttHeight = ganttHeight - 16;
@@ -12415,10 +12458,16 @@ let Gantt = class Gantt extends Component {
12415
12458
  let settingsHeight;
12416
12459
  if (this.height.indexOf('%') !== -1) {
12417
12460
  let ganttHeight = Number(this.height.split("%")[0]);
12418
- if (this.element.parentElement && (this.element.parentElement.style.height
12419
- || this.element.parentElement.style.height.indexOf('%') !== -1)) {
12420
- let containerHeight = Number(this.element.parentElement.style.height.split("px")[0]);
12421
- ganttHeight = (ganttHeight * containerHeight) / 100;
12461
+ if (this.element.parentElement && (this.element.parentElement.style.height)) {
12462
+ let containerHeight;
12463
+ if (this.element.parentElement.style.height.indexOf('%') == -1) {
12464
+ containerHeight = Number(this.element.parentElement.style.height.split("px")[0]);
12465
+ ganttHeight = (ganttHeight * containerHeight) / 100;
12466
+ }
12467
+ else {
12468
+ containerHeight = Number(this.element.parentElement.style.height.split("%")[0]);
12469
+ ganttHeight = (window.innerHeight * containerHeight) / 100;
12470
+ }
12422
12471
  }
12423
12472
  else {
12424
12473
  ganttHeight = Number(this.height.split("%")[0]);
@@ -15185,6 +15234,7 @@ class CellEdit {
15185
15234
  * @private
15186
15235
  */
15187
15236
  this.isCellEdit = false;
15237
+ this.isResourceCellEdited = false;
15188
15238
  this.parent = ganttObj;
15189
15239
  this.bindTreeGridProperties();
15190
15240
  }
@@ -15613,6 +15663,7 @@ class CellEdit {
15613
15663
  const resourceSettings = this.parent.resourceFields;
15614
15664
  const editedResourceId = editedObj[this.parent.taskFields.resourceInfo];
15615
15665
  if (editedResourceId) {
15666
+ this.isResourceCellEdited = true;
15616
15667
  const tempResourceInfo = this.parent.dataOperation.setResourceInfo(editedObj);
15617
15668
  const editedResouceLength = tempResourceInfo.length;
15618
15669
  const previousResource = previousData.ganttProperties.resourceInfo;
@@ -15784,6 +15835,7 @@ class EditTooltip {
15784
15835
  tooltipPositionX += leftEnd - (tooltipPositionX + args.element.offsetWidth);
15785
15836
  }
15786
15837
  args.element.style.left = tooltipPositionX + 'px';
15838
+ args.element.style.visibility = 'visible';
15787
15839
  }
15788
15840
  /**
15789
15841
  * To show/hide taskbar edit tooltip.
@@ -16403,7 +16455,9 @@ class TaskbarEdit extends DateProcessor {
16403
16455
  if (this.isMouseDragged && this.taskBarEditAction) {
16404
16456
  const args = {
16405
16457
  cancel: false,
16406
- requestType: 'taskbarediting'
16458
+ requestType: 'taskbarediting',
16459
+ taskBarEditAction: this.taskBarEditAction,
16460
+ data: this.taskBarEditRecord
16407
16461
  };
16408
16462
  if (this.segmentIndex !== -1) {
16409
16463
  args.requestType = 'mergeSegment';
@@ -18883,7 +18937,15 @@ class DialogEdit {
18883
18937
  field: fields[i], headerText: this.localeObj.getConstant(fields[i]), editType: 'stringedit', width: '200px',
18884
18938
  edit: {
18885
18939
  write: (args) => {
18886
- const datePickerModel = this.beforeOpenArgs[generalTabString][this.parent.taskFields[fields[i]]];
18940
+ let datePickerModel;
18941
+ if (!isNullOrUndefined(this.beforeOpenArgs[generalTabString])) {
18942
+ datePickerModel = this.beforeOpenArgs[generalTabString][this.parent.taskFields[fields[i]]];
18943
+ }
18944
+ else {
18945
+ let columnFields = this.getGeneralColumnFields();
18946
+ let columnModel = this.getFieldsModel(columnFields);
18947
+ datePickerModel = columnModel[this.parent.taskFields[fields[i]]];
18948
+ }
18887
18949
  const value = args.rowData[args.column.field];
18888
18950
  setValue('value', value, datePickerModel);
18889
18951
  const datePicker = new this.inputs[this.parent.columnByField[this.parent.taskFields[fields[i]]].editType](datePickerModel);
@@ -18906,7 +18968,15 @@ class DialogEdit {
18906
18968
  field: fields[i], headerText: this.localeObj.getConstant(fields[i]), editType: 'stringedit', width: '100px',
18907
18969
  edit: {
18908
18970
  write: (args) => {
18909
- const inputTextModel = this.beforeOpenArgs[generalTabString][this.parent.taskFields[fields[i]]];
18971
+ let inputTextModel;
18972
+ if (!isNullOrUndefined(this.beforeOpenArgs[generalTabString])) {
18973
+ inputTextModel = this.beforeOpenArgs[generalTabString][this.parent.taskFields[fields[i]]];
18974
+ }
18975
+ else {
18976
+ let columnFields = this.getGeneralColumnFields();
18977
+ let columnModel = this.getFieldsModel(columnFields);
18978
+ inputTextModel = columnModel[this.parent.taskFields[fields[i]]];
18979
+ }
18910
18980
  inputTextModel.floatLabelType = 'Never';
18911
18981
  const value = args.rowData[args.column.field];
18912
18982
  if (!isNullOrUndefined(value)) {
@@ -21565,9 +21635,12 @@ class Edit$2 {
21565
21635
  */
21566
21636
  updateParentChildRecord(data) {
21567
21637
  const ganttRecord = data;
21568
- if (ganttRecord.hasChildRecords && this.taskbarMoved && this.parent.taskMode === 'Auto') {
21638
+ if (ganttRecord.hasChildRecords && this.taskbarMoved && this.parent.taskMode === 'Auto' && (!isNullOrUndefined(this.parent.editModule.cellEditModule) && !this.parent.editModule.cellEditModule.isResourceCellEdited)) {
21569
21639
  this.updateChildItems(ganttRecord);
21570
21640
  }
21641
+ if (!isNullOrUndefined(this.parent.editModule.cellEditModule)) {
21642
+ this.parent.editModule.cellEditModule.isResourceCellEdited = false;
21643
+ }
21571
21644
  }
21572
21645
  /**
21573
21646
  * To update records while changing schedule mode.
@@ -23017,7 +23090,7 @@ class Edit$2 {
23017
23090
  /*Record Updates*/
23018
23091
  recordIndex = flatRecords.indexOf(this.addRowSelectedItem);
23019
23092
  updatedCollectionIndex = currentViewData.indexOf(this.addRowSelectedItem);
23020
- this.recordCollectionUpdate(childIndex, recordIndex, updatedCollectionIndex, record, parentItem);
23093
+ this.recordCollectionUpdate(childIndex, recordIndex, updatedCollectionIndex, record, parentItem, rowPosition);
23021
23094
  break;
23022
23095
  case 'Below':
23023
23096
  currentItemIndex = flatRecords.indexOf(this.addRowSelectedItem);
@@ -23031,7 +23104,7 @@ class Edit$2 {
23031
23104
  recordIndex = currentItemIndex + 1;
23032
23105
  updatedCollectionIndex = currentViewData.indexOf(this.addRowSelectedItem) + 1;
23033
23106
  }
23034
- this.recordCollectionUpdate(childIndex + 1, recordIndex, updatedCollectionIndex, record, parentItem);
23107
+ this.recordCollectionUpdate(childIndex + 1, recordIndex, updatedCollectionIndex, record, parentItem, rowPosition);
23035
23108
  break;
23036
23109
  case 'Child':
23037
23110
  currentItemIndex = flatRecords.indexOf(this.addRowSelectedItem);
@@ -23059,7 +23132,7 @@ class Edit$2 {
23059
23132
  this.addRowSelectedItem.ganttProperties.segments = null;
23060
23133
  }
23061
23134
  }
23062
- this.recordCollectionUpdate(childIndex + 1, recordIndex, updatedCollectionIndex, record, parentItem);
23135
+ this.recordCollectionUpdate(childIndex + 1, recordIndex, updatedCollectionIndex, record, parentItem, rowPosition);
23063
23136
  break;
23064
23137
  }
23065
23138
  this.newlyAddedRecordBackup = record;
@@ -23073,7 +23146,7 @@ class Edit$2 {
23073
23146
  * @returns {void} .
23074
23147
  * @private
23075
23148
  */
23076
- recordCollectionUpdate(childIndex, recordIndex, updatedCollectionIndex, record, parentItem) {
23149
+ recordCollectionUpdate(childIndex, recordIndex, updatedCollectionIndex, record, parentItem, rowPosition) {
23077
23150
  const flatRecords = this.parent.flatData;
23078
23151
  const currentViewData = this.parent.currentViewData;
23079
23152
  const ids = this.parent.ids;
@@ -23095,7 +23168,15 @@ class Edit$2 {
23095
23168
  !isNullOrUndefined(this.parent.dataSource)) {
23096
23169
  const child = this.parent.taskFields.child;
23097
23170
  if (parentItem.taskData[child] && parentItem.taskData[child].length > 0) {
23098
- parentItem.taskData[child].push(record.taskData);
23171
+ if (rowPosition === 'Above') {
23172
+ parentItem.taskData[child].splice(childIndex, 0, record.taskData);
23173
+ }
23174
+ else if (rowPosition === 'Below') {
23175
+ parentItem.taskData[child].splice(childIndex + 1, 0, record.taskData);
23176
+ }
23177
+ else {
23178
+ parentItem.taskData[child].push(record.taskData);
23179
+ }
23099
23180
  }
23100
23181
  else {
23101
23182
  parentItem.taskData[child] = [];
@@ -23180,13 +23261,13 @@ class Edit$2 {
23180
23261
  }
23181
23262
  for (let i = 0; i < addedRecord.length; i++) {
23182
23263
  if (isNullOrUndefined(rowPosition) || isNullOrUndefined(this.addRowSelectedItem)) {
23183
- rowPosition = 'Top';
23264
+ rowPosition = rowPosition === 'Bottom' ? 'Bottom' : 'Top';
23184
23265
  }
23185
23266
  if (rowPosition === 'Top') {
23186
23267
  dataSource.splice(0, 0, addedRecord[i].taskData);
23187
23268
  }
23188
23269
  else if (rowPosition === 'Bottom') {
23189
- dataSource.push(addedRecord[i]);
23270
+ dataSource.push(addedRecord[i].taskData);
23190
23271
  }
23191
23272
  else {
23192
23273
  if (!isNullOrUndefined(taskFields.id) && !isNullOrUndefined(taskFields.parentID)) {
@@ -23338,7 +23419,7 @@ class Edit$2 {
23338
23419
  else {
23339
23420
  if (this.parent.viewType === 'ProjectView') {
23340
23421
  if ((rowPosition === 'Top' || rowPosition === 'Bottom') ||
23341
- ((rowPosition === 'Above' || rowPosition === 'Below') && !args.data.parentItem)) {
23422
+ ((rowPosition === 'Above' || rowPosition === 'Below' || rowPosition === 'Child') && !args.data.parentItem)) {
23342
23423
  if (args.data instanceof Array) {
23343
23424
  this.updateRealDataSource(args.data, rowPosition);
23344
23425
  }
@@ -23381,6 +23462,59 @@ class Edit$2 {
23381
23462
  * @returns {void} .
23382
23463
  * @private
23383
23464
  */
23465
+ createNewRecord() {
23466
+ const tempRecord = {};
23467
+ const ganttColumns = this.parent.ganttColumns;
23468
+ const taskSettingsFields = this.parent.taskFields;
23469
+ const taskId = this.parent.editModule.getNewTaskId();
23470
+ for (let i = 0; i < ganttColumns.length; i++) {
23471
+ const fieldName = ganttColumns[i].field;
23472
+ if (fieldName === taskSettingsFields.id) {
23473
+ tempRecord[fieldName] = taskId;
23474
+ }
23475
+ else if (ganttColumns[i].field === taskSettingsFields.startDate) {
23476
+ if (isNullOrUndefined(tempRecord[taskSettingsFields.endDate])) {
23477
+ tempRecord[fieldName] = this.parent.editModule.dialogModule.getMinimumStartDate();
23478
+ }
23479
+ else {
23480
+ tempRecord[fieldName] = new Date(tempRecord[taskSettingsFields.endDate]);
23481
+ }
23482
+ if (this.parent.timezone) {
23483
+ tempRecord[fieldName] = this.parent.dateValidationModule.remove(tempRecord[fieldName], this.parent.timezone);
23484
+ }
23485
+ }
23486
+ else if (ganttColumns[i].field === taskSettingsFields.endDate) {
23487
+ if (isNullOrUndefined(tempRecord[taskSettingsFields.startDate])) {
23488
+ tempRecord[fieldName] = this.parent.editModule.dialogModule.getMinimumStartDate();
23489
+ }
23490
+ else {
23491
+ tempRecord[fieldName] = new Date(tempRecord[taskSettingsFields.startDate]);
23492
+ }
23493
+ if (this.parent.timezone) {
23494
+ tempRecord[fieldName] = this.parent.dateValidationModule.remove(tempRecord[fieldName], this.parent.timezone);
23495
+ }
23496
+ }
23497
+ else if (ganttColumns[i].field === taskSettingsFields.duration) {
23498
+ tempRecord[fieldName] = 1;
23499
+ }
23500
+ else if (ganttColumns[i].field === taskSettingsFields.name) {
23501
+ tempRecord[fieldName] = this.parent.editModule.dialogModule['localeObj'].getConstant('addDialogTitle') + ' ' + taskId;
23502
+ }
23503
+ else if (ganttColumns[i].field === taskSettingsFields.progress) {
23504
+ tempRecord[fieldName] = 0;
23505
+ }
23506
+ else if (ganttColumns[i].field === taskSettingsFields.work) {
23507
+ tempRecord[fieldName] = 0;
23508
+ }
23509
+ else if (ganttColumns[i].field === 'taskType') {
23510
+ tempRecord[fieldName] = this.parent.taskType;
23511
+ }
23512
+ else {
23513
+ tempRecord[this.parent.ganttColumns[i].field] = '';
23514
+ }
23515
+ }
23516
+ return tempRecord;
23517
+ }
23384
23518
  validateTaskPosition(data, rowPosition, rowIndex, cAddedRecord) {
23385
23519
  const selectedRowIndex = isNullOrUndefined(rowIndex) || isNaN(parseInt(rowIndex.toString(), 10)) ?
23386
23520
  this.parent.selectionModule ?
@@ -23392,7 +23526,7 @@ class Edit$2 {
23392
23526
  this.parent.selectionModule.getSelectedRowCellIndexes()[0].rowIndex : null : null : rowIndex;
23393
23527
  this.addRowSelectedItem = isNullOrUndefined(selectedRowIndex) ? null : this.parent.updatedRecords[selectedRowIndex];
23394
23528
  rowPosition = isNullOrUndefined(rowPosition) ? this.parent.editSettings.newRowPosition : rowPosition;
23395
- data = isNullOrUndefined(data) ? this.parent.editModule.dialogModule.composeAddRecord() : data;
23529
+ data = isNullOrUndefined(data) ? this.createNewRecord() : data;
23396
23530
  if (((isNullOrUndefined(selectedRowIndex) || selectedRowIndex < 0 ||
23397
23531
  isNullOrUndefined(this.addRowSelectedItem)) && (rowPosition === 'Above'
23398
23532
  || rowPosition === 'Below'
@@ -23885,6 +24019,25 @@ class Edit$2 {
23885
24019
  const delRow = this.parent.getTaskByUniqueID(this.draggedRecord.uniqueID);
23886
24020
  this.removeRecords(delRow);
23887
24021
  }
24022
+ updateIndentedChildRecords(indentedRecord) {
24023
+ let createParentItem = {
24024
+ uniqueID: indentedRecord.uniqueID,
24025
+ expanded: indentedRecord.expanded,
24026
+ level: indentedRecord.level,
24027
+ index: indentedRecord.index,
24028
+ taskId: indentedRecord.ganttProperties.rowUniqueID
24029
+ };
24030
+ for (let i = 0; i < indentedRecord.childRecords.length; i++) {
24031
+ this.parent.setRecordValue('parentItem', createParentItem, indentedRecord.childRecords[i]);
24032
+ this.parent.setRecordValue('parentUniqueID', indentedRecord.uniqueID, indentedRecord.childRecords[i]);
24033
+ }
24034
+ if (indentedRecord.hasChildRecords) {
24035
+ indentedRecord = indentedRecord.childRecords;
24036
+ for (let j = 0; j < indentedRecord['length']; j++) {
24037
+ this.updateIndentedChildRecords(indentedRecord[j]);
24038
+ }
24039
+ }
24040
+ }
23888
24041
  dropMiddle(recordIndex1) {
23889
24042
  const obj = this.parent;
23890
24043
  const childRec = this.parent.editModule.getChildCount(this.droppedRecord, 0);
@@ -23900,6 +24053,10 @@ class Edit$2 {
23900
24053
  this.recordLevel();
23901
24054
  if (this.draggedRecord.hasChildRecords) {
23902
24055
  this.updateChildRecord(this.draggedRecord, childRecordsLength, this.droppedRecord.expanded);
24056
+ if (this.parent.enableImmutableMode) {
24057
+ let indentedRecord = this.draggedRecord;
24058
+ this.updateIndentedChildRecords(indentedRecord);
24059
+ }
23903
24060
  }
23904
24061
  if (isNullOrUndefined(this.draggedRecord.parentItem &&
23905
24062
  this.updateParentRecords.indexOf(this.draggedRecord.parentItem) !== -1)) {
@@ -24380,7 +24537,7 @@ class Filter$1 {
24380
24537
  const ganttElement = closest(element, '#' + this.parent.element.id)
24381
24538
  || element.querySelector('#' + this.parent.element.id);
24382
24539
  if ((!(this.filterMenuElement.contains(element)) && !isNullOrUndefined(ganttElement)) || element.nodeName === 'HTML'
24383
- || element.nodeName === 'DIV') {
24540
+ || ((element.nodeName === 'DIV') && (!element.classList.contains('e-day')))) {
24384
24541
  remove(this.filterMenuElement);
24385
24542
  this.parent.treeGrid.grid.notify('filter-menu-close', { isOpen: false });
24386
24543
  this.filterMenuElement = null;
@@ -27124,7 +27281,7 @@ class RowDD$1 {
27124
27281
  if (this.dropPosition === 'topSegment' || this.dropPosition === 'bottomSegment') {
27125
27282
  const rowPosition = this.dropPosition === 'topSegment' ? 'Above' : 'Below';
27126
27283
  this.parent.editModule.addRowSelectedItem = droppedRecord;
27127
- this.parent.editModule.updateRealDataSource(draggedRecord, rowPosition);
27284
+ this.parent.editModule.updateRealDataSource([draggedRecord], rowPosition);
27128
27285
  delete this.parent.editModule.addRowSelectedItem;
27129
27286
  }
27130
27287
  }