@syncfusion/ej2-gantt 20.2.39 → 20.2.43

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.
@@ -400,7 +400,7 @@ class DateProcessor {
400
400
  if (hour > this.parent.defaultEndTime) {
401
401
  this.setTime(this.parent.defaultEndTime, cloneDate);
402
402
  }
403
- else if (hour <= this.parent.defaultStartTime && !ganttProp.isMilestone) {
403
+ else if (hour <= this.parent.defaultStartTime && !isNullOrUndefined(ganttProp) && !ganttProp.isMilestone) {
404
404
  cloneDate.setDate(cloneDate.getDate() - 1);
405
405
  this.setTime(this.parent.defaultEndTime, cloneDate);
406
406
  }
@@ -1466,7 +1466,13 @@ class DateProcessor {
1466
1466
  }
1467
1467
  sortDates(taskRange);
1468
1468
  if (!minStartDate || !maxEndDate) {
1469
- minStartDate = isNullOrUndefined(minStartDate) ? this.getDateFromFormat(new Date()) : minStartDate;
1469
+ if (!minStartDate) {
1470
+ minStartDate = isNullOrUndefined(minStartDate) ? this.getDateFromFormat(new Date()) : minStartDate;
1471
+ minStartDate.setHours(0, 0, 0, 0);
1472
+ }
1473
+ else {
1474
+ minStartDate = isNullOrUndefined(minStartDate) ? this.getDateFromFormat(new Date()) : minStartDate;
1475
+ }
1470
1476
  maxEndDate = this.getDateFromFormat(new Date(minStartDate.getTime()));
1471
1477
  maxEndDate.setDate(maxEndDate.getDate() + 20);
1472
1478
  }
@@ -4816,7 +4822,7 @@ class GanttChart {
4816
4822
  * @private
4817
4823
  */
4818
4824
  expandedGanttRow(args) {
4819
- if (isNullOrUndefined(args['gridRow'])) {
4825
+ if (isNullOrUndefined(args['gridRow']) && this.parent.enableVirtualization) {
4820
4826
  return;
4821
4827
  }
4822
4828
  const record = getValue('data', args);
@@ -5026,6 +5032,23 @@ class GanttChart {
5026
5032
  $target.closest('.e-chart-row') ? $target.closest('.e-chart-row').rowIndex : -1;
5027
5033
  const isTab = (e.action === 'tab') ? true : false;
5028
5034
  const nextElement = this.getNextElement($target, isTab, isInEditedState);
5035
+ this.tempNextElement = nextElement;
5036
+ if (!isNullOrUndefined(nextElement['cellIndex'])) {
5037
+ if (this.parent.allowRowDragAndDrop) {
5038
+ this.childrenIndex = nextElement['cellIndex'];
5039
+ this.nextElementIndex = nextElement['cellIndex'] - 1;
5040
+ }
5041
+ else {
5042
+ this.childrenIndex = nextElement['cellIndex'];
5043
+ this.nextElementIndex = nextElement['cellIndex'];
5044
+ }
5045
+ if (!this.parent.ganttColumns[this.nextElementIndex]['allowEditing'] && this.parent.ganttColumns[this.nextElementIndex]['field'] !== this.parent.taskFields.id) {
5046
+ this.isEditableElement = true;
5047
+ }
5048
+ else {
5049
+ this.isEditableElement = false;
5050
+ }
5051
+ }
5029
5052
  if (nextElement === 'noNextRow') {
5030
5053
  this.manageFocus($target, 'remove', true);
5031
5054
  return;
@@ -5073,7 +5096,8 @@ class GanttChart {
5073
5096
  this.parent.treeGrid.grid.notify('key-pressed', e);
5074
5097
  }
5075
5098
  }
5076
- if (!isNullOrUndefined(isInEditedState) && !this.parent.editModule.cellEditModule.isCellEdit) {
5099
+ if (!(this.parent.editModule && this.parent.editModule.cellEditModule
5100
+ && !isNullOrUndefined(this.parent.editModule.cellEditModule.editedColumn))) {
5077
5101
  if (nextElement) {
5078
5102
  if ($target.classList.contains('e-rowcell')) {
5079
5103
  this.manageFocus($target, 'remove', false);
@@ -6909,6 +6933,7 @@ class GanttTreeGrid {
6909
6933
  }
6910
6934
  composeProperties() {
6911
6935
  this.parent.treeGrid.showColumnMenu = this.parent.showColumnMenu;
6936
+ this.parent.treeGrid.enableCollapseAll = this.parent.collapseAllParentTasks;
6912
6937
  this.parent.treeGrid.columnMenuItems = this.parent.columnMenuItems;
6913
6938
  this.parent.treeGrid.childMapping = isNullOrUndefined(this.parent.taskFields.child) ? '' : this.parent.taskFields.child;
6914
6939
  this.parent.treeGrid.treeColumnIndex = this.parent.treeColumnIndex;
@@ -9639,6 +9664,12 @@ class ChartRows extends DateProcessor {
9639
9664
  }
9640
9665
  const dataId = this.parent.viewType === 'ProjectView' ? data.ganttProperties.taskId : data.ganttProperties.rowUniqueID;
9641
9666
  this.parent.treeGrid.grid.setRowData(dataId, data);
9667
+ let nextEditableElement = this.parent.ganttChartModule.tempNextElement;
9668
+ if (this.parent.ganttChartModule.isEditableElement && nextEditableElement) {
9669
+ this.parent.treeGrid.grid.focusModule.focus();
9670
+ addClass([this.parent.treeGrid.getRows()[tr['ariaRowIndex']].children[this.parent.ganttChartModule.childrenIndex]], 'e-focused');
9671
+ this.parent.ganttChartModule.tempNextElement = null;
9672
+ }
9642
9673
  const row = this.parent.treeGrid.grid.getRowObjectFromUID(this.parent.treeGrid.grid.getDataRows()[index].getAttribute('data-uid'));
9643
9674
  row.data = data;
9644
9675
  }
@@ -11829,7 +11860,7 @@ class Tooltip$1 {
11829
11860
  if (ganttData) {
11830
11861
  data = ganttData.ganttProperties;
11831
11862
  taskName = !isNullOrUndefined(data.taskName) ? '<tr class = "e-gantt-tooltip-rowcell"><td colspan="3">' +
11832
- data.taskName + '</td></tr>' : '';
11863
+ (this.parent.disableHtmlEncode ? data.taskName.replace(/</g, "&lt;").replace(/>/g, "&gt;") : data.taskName) + '</td></tr>' : '';
11833
11864
  }
11834
11865
  switch (elementType) {
11835
11866
  case 'milestone':
@@ -21281,7 +21312,7 @@ class Edit$2 {
21281
21312
  if (column.field === this.parent.taskFields.id) {
21282
21313
  this.updateIDColumnEditParams(column);
21283
21314
  }
21284
- else if (column.field === this.parent.taskFields.progress) {
21315
+ else if (column.field === this.parent.taskFields.progress && isNullOrUndefined(column.edit)) {
21285
21316
  this.updateProgessColumnEditParams(column);
21286
21317
  }
21287
21318
  else if (column.field === this.parent.taskFields.resourceInfo) {
@@ -23244,6 +23275,7 @@ class Edit$2 {
23244
23275
  eventArgs.modifiedRecords = args.updatedRecordCollection;
23245
23276
  eventArgs.modifiedTaskData = getTaskData(args.updatedRecordCollection, null, null, this.parent);
23246
23277
  setValue('action', args.action, eventArgs);
23278
+ this.parent.isOnDelete = false;
23247
23279
  this.parent.trigger('actionComplete', eventArgs);
23248
23280
  this.deletedTaskDetails = [];
23249
23281
  this.parent.initiateEditAction(false);
@@ -27557,7 +27589,7 @@ class ContextMenu$2 {
27557
27589
  let rowIndex = -1;
27558
27590
  if (args.gridRow) {
27559
27591
  // eslint-disable-next-line
27560
- rowIndex = parseInt(args.gridRow.getAttribute('aria-rowindex'), 0);
27592
+ rowIndex = parseInt(args.gridRow.getAttribute('data-rowindex'), 0);
27561
27593
  }
27562
27594
  else if (args.chartRow) {
27563
27595
  // eslint-disable-next-line
@@ -28186,7 +28218,7 @@ class RowDD$1 {
28186
28218
  ganttDragelem.remove();
28187
28219
  }
28188
28220
  const gridRow = closest(args.target, '.e-row');
28189
- const dropIndex = gridRow ? parseInt(gridRow.getAttribute('aria-rowindex'), 10) : args.dropIndex;
28221
+ const dropIndex = gridRow ? parseInt(gridRow.getAttribute('data-rowindex'), 10) : args.dropIndex;
28190
28222
  args.dropIndex = dropIndex;
28191
28223
  args.dropRecord = this.parent.updatedRecords[args.dropIndex];
28192
28224
  this.parent.trigger('rowDrop', args);