@syncfusion/ej2-gantt 19.3.47 → 19.3.48

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.
@@ -16590,6 +16590,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
16590
16590
  TaskbarEdit.prototype.showHideTaskBarEditingElements = function (element, secondElement, fadeConnectorLine) {
16591
16591
  secondElement = secondElement ? secondElement : this.editElement;
16592
16592
  var isShowProgressResizer = this.parent.taskFields.progress ? true : false;
16593
+ var isShowConnectorPoints = true;
16593
16594
  if (this.parent.readOnly) {
16594
16595
  return;
16595
16596
  }
@@ -16599,6 +16600,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
16599
16600
  if (!isNullOrUndefined(parentRecord)) {
16600
16601
  if (!parentRecord.expanded) {
16601
16602
  isShowProgressResizer = false;
16603
+ isShowConnectorPoints = false;
16602
16604
  }
16603
16605
  }
16604
16606
  }
@@ -16625,7 +16627,7 @@ var TaskbarEdit = /** @__PURE__ @class */ (function (_super) {
16625
16627
  if (!isNullOrUndefined(this.parent.taskFields.dependency)
16626
16628
  && (element.querySelector('.' + connectorPointLeft)
16627
16629
  || element.parentElement.querySelector('.' + connectorPointLeft))
16628
- && isShowProgressResizer) {
16630
+ && isShowConnectorPoints) {
16629
16631
  var connectorElement = !isNullOrUndefined(element.querySelector('.' + connectorPointLeft)) ?
16630
16632
  element : element.parentElement;
16631
16633
  addClass([connectorElement.querySelector('.' + connectorPointLeft)], [connectorPointLeftHover]);
@@ -26597,6 +26599,11 @@ var ContextMenu$2 = /** @__PURE__ @class */ (function () {
26597
26599
  var target = args.event ? args.event.target :
26598
26600
  !this.parent.focusModule ? this.parent.focusModule.getActiveElement() :
26599
26601
  this.parent.ganttChartModule.targetElement;
26602
+ // Closed edited cell before opening context menu
26603
+ // eslint-disable-next-line
26604
+ if (!isNullOrUndefined(this.parent.editModule) && this.parent.editModule.cellEditModule && this.parent.editModule.cellEditModule.isCellEdit && target.parentElement.classList.contains('e-row')) {
26605
+ this.parent.treeGrid.closeEdit();
26606
+ }
26600
26607
  if (!isNullOrUndefined(args.element) && args.element.id === this.parent.element.id + '_contextmenu') {
26601
26608
  this.clickedPosition = getValue('event', args).clientX;
26602
26609
  }
@@ -27290,80 +27297,113 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
27290
27297
  }
27291
27298
  var count = 0;
27292
27299
  var dragLength = dragRecords.length;
27293
- for (var i = 0; i < dragLength; i++) {
27294
- this.parent.isOnEdit = true;
27300
+ var _loop_1 = function (i) {
27301
+ this_1.parent.isOnEdit = true;
27295
27302
  draggedRecord = dragRecords[i];
27296
- this.draggedRecord = draggedRecord;
27297
- if (this.dropPosition !== 'Invalid') {
27298
- if (this.parent.viewType === 'ResourceView') {
27299
- this.checkisSharedTask();
27300
- this.previousParent = this.draggedRecord.parentItem.uniqueID;
27303
+ this_1.draggedRecord = draggedRecord;
27304
+ if (this_1.dropPosition !== 'Invalid') {
27305
+ if (this_1.parent.viewType === 'ResourceView') {
27306
+ this_1.checkisSharedTask();
27307
+ this_1.previousParent = this_1.draggedRecord.parentItem.uniqueID;
27301
27308
  }
27302
- if (this.isSharedTask) {
27303
- return;
27309
+ if (this_1.isSharedTask) {
27310
+ return { value: void 0 };
27304
27311
  }
27305
27312
  if (isByMethod) {
27306
- this.deleteDragRow();
27313
+ this_1.deleteDragRow();
27307
27314
  }
27308
- var recordIndex1 = this.treeGridData.indexOf(droppedRecord);
27309
- if (this.dropPosition === 'topSegment') {
27310
- this.dropAtTop(recordIndex1);
27315
+ var recordIndex1 = this_1.treeGridData.indexOf(droppedRecord);
27316
+ if (this_1.dropPosition === 'topSegment') {
27317
+ this_1.dropAtTop(recordIndex1);
27311
27318
  }
27312
- if (this.dropPosition === 'bottomSegment') {
27313
- if (!this.isSharedTask) {
27319
+ if (this_1.dropPosition === 'bottomSegment') {
27320
+ if (!this_1.isSharedTask) {
27314
27321
  if (!droppedRecord.hasChildRecords) {
27315
- if (this.parent.taskFields.parentID && this.ganttData.length > 0) {
27316
- this.ganttData.splice(recordIndex1 + 1, 0, this.draggedRecord.taskData);
27322
+ if (this_1.parent.taskFields.parentID && this_1.ganttData.length > 0) {
27323
+ this_1.ganttData.splice(recordIndex1 + 1, 0, this_1.draggedRecord.taskData);
27317
27324
  }
27318
- this.treeGridData.splice(recordIndex1 + 1, 0, this.draggedRecord);
27319
- this.parent.ids.splice(recordIndex1 + 1, 0, this.draggedRecord.ganttProperties.rowUniqueID.toString());
27320
- if (this.parent.viewType === 'ResourceView') {
27321
- var taskId = this.draggedRecord.level === 0 ? 'R' + this.draggedRecord.ganttProperties.taskId : 'T' + this.draggedRecord.ganttProperties.taskId;
27322
- this.parent.getTaskIds().splice(recordIndex1 + 1, 0, taskId);
27325
+ this_1.treeGridData.splice(recordIndex1 + 1, 0, this_1.draggedRecord);
27326
+ this_1.parent.ids.splice(recordIndex1 + 1, 0, this_1.draggedRecord.ganttProperties.rowUniqueID.toString());
27327
+ if (this_1.parent.viewType === 'ResourceView') {
27328
+ var taskId = this_1.draggedRecord.level === 0 ? 'R' + this_1.draggedRecord.ganttProperties.taskId : 'T' + this_1.draggedRecord.ganttProperties.taskId;
27329
+ this_1.parent.getTaskIds().splice(recordIndex1 + 1, 0, taskId);
27323
27330
  }
27324
27331
  }
27325
27332
  else {
27326
- count = this.parent.editModule.getChildCount(droppedRecord, 0);
27327
- if (this.parent.taskFields.parentID && this.ganttData.length > 0) {
27328
- this.ganttData.splice(recordIndex1 + count + 1, 0, this.draggedRecord.taskData);
27333
+ count = this_1.parent.editModule.getChildCount(droppedRecord, 0);
27334
+ if (this_1.parent.taskFields.parentID && this_1.ganttData.length > 0) {
27335
+ this_1.ganttData.splice(recordIndex1 + count + 1, 0, this_1.draggedRecord.taskData);
27329
27336
  }
27330
- this.treeGridData.splice(recordIndex1 + count + 1, 0, this.draggedRecord);
27337
+ this_1.treeGridData.splice(recordIndex1 + count + 1, 0, this_1.draggedRecord);
27331
27338
  /* eslint-disable-next-line */
27332
- this.parent.ids.splice(recordIndex1 + count + 1, 0, this.draggedRecord.ganttProperties.rowUniqueID.toString());
27333
- if (this.parent.viewType === 'ResourceView') {
27334
- var spliceId = this.draggedRecord.level === 0 ? 'R' + this.draggedRecord.ganttProperties.taskId : 'T' + this.draggedRecord.ganttProperties.taskId;
27335
- this.parent.getTaskIds().splice(recordIndex1 + count + 1, 0, spliceId);
27339
+ this_1.parent.ids.splice(recordIndex1 + count + 1, 0, this_1.draggedRecord.ganttProperties.rowUniqueID.toString());
27340
+ if (this_1.parent.viewType === 'ResourceView') {
27341
+ var spliceId = this_1.draggedRecord.level === 0 ? 'R' + this_1.draggedRecord.ganttProperties.taskId : 'T' + this_1.draggedRecord.ganttProperties.taskId;
27342
+ this_1.parent.getTaskIds().splice(recordIndex1 + count + 1, 0, spliceId);
27336
27343
  }
27337
27344
  }
27338
- this.parent.setRecordValue('parentItem', this.treeGridData[recordIndex1].parentItem, draggedRecord);
27339
- this.parent.setRecordValue('parentUniqueID', this.treeGridData[recordIndex1].parentUniqueID, draggedRecord);
27340
- this.parent.setRecordValue('level', this.treeGridData[recordIndex1].level, draggedRecord);
27345
+ this_1.parent.setRecordValue('parentItem', this_1.treeGridData[recordIndex1].parentItem, draggedRecord);
27346
+ this_1.parent.setRecordValue('parentUniqueID', this_1.treeGridData[recordIndex1].parentUniqueID, draggedRecord);
27347
+ this_1.parent.setRecordValue('level', this_1.treeGridData[recordIndex1].level, draggedRecord);
27341
27348
  if (draggedRecord.hasChildRecords) {
27342
27349
  var level = 1;
27343
- this.updateChildRecordLevel(draggedRecord, level);
27344
- this.updateChildRecord(draggedRecord, recordIndex1 + count + 1);
27350
+ this_1.updateChildRecordLevel(draggedRecord, level);
27351
+ this_1.updateChildRecord(draggedRecord, recordIndex1 + count + 1);
27345
27352
  }
27346
27353
  if (droppedRecord.parentItem) {
27347
- var rec = this.parent.getParentTask(droppedRecord.parentItem).childRecords;
27354
+ var rec = this_1.parent.getParentTask(droppedRecord.parentItem).childRecords;
27348
27355
  var childRecords = rec;
27349
27356
  var droppedRecordIndex = childRecords.indexOf(droppedRecord) + 1;
27350
27357
  childRecords.splice(droppedRecordIndex, 0, draggedRecord);
27351
27358
  }
27352
27359
  }
27353
27360
  }
27354
- if (this.dropPosition === 'middleSegment') {
27355
- this.dropMiddle(recordIndex1);
27361
+ if (this_1.dropPosition === 'middleSegment') {
27362
+ this_1.dropMiddle(recordIndex1);
27356
27363
  if (droppedRecord.childRecords.length > 0) {
27357
27364
  delete droppedRecord.ganttProperties.segments;
27358
- delete droppedRecord.taskData[this.parent.taskFields.segments];
27365
+ delete droppedRecord.taskData[this_1.parent.taskFields.segments];
27359
27366
  }
27360
27367
  }
27361
27368
  // eslint-disable-next-line
27362
- if (!isNullOrUndefined(draggedRecord.parentItem && this.updateParentRecords.indexOf(draggedRecord.parentItem) !== -1)) {
27363
- this.updateParentRecords.push(draggedRecord.parentItem);
27369
+ if (!isNullOrUndefined(draggedRecord.parentItem && this_1.updateParentRecords.indexOf(draggedRecord.parentItem) !== -1)) {
27370
+ this_1.updateParentRecords.push(draggedRecord.parentItem);
27371
+ }
27372
+ }
27373
+ if (!this_1.parent.enableVirtualization) {
27374
+ var data_1 = gObj.flatData;
27375
+ var startIndex = void 0;
27376
+ var endIndex = void 0;
27377
+ if (draggedRecord.index < droppedRecord.index) {
27378
+ startIndex = draggedRecord.index;
27379
+ endIndex = droppedRecord.index;
27380
+ }
27381
+ else {
27382
+ startIndex = droppedRecord.index;
27383
+ endIndex = draggedRecord.index;
27384
+ }
27385
+ var _loop_2 = function (i_1) {
27386
+ if (!isNullOrUndefined(data_1[i_1])) {
27387
+ data_1[i_1].index = i_1;
27388
+ if (!isNullOrUndefined(data_1[i_1].parentItem)) {
27389
+ var updatedParent = data_1.filter(function (e) {
27390
+ return e.uniqueID === data_1[i_1].parentUniqueID;
27391
+ })[0];
27392
+ data_1[i_1].parentItem.index = updatedParent.index;
27393
+ }
27394
+ }
27395
+ };
27396
+ for (var i_1 = startIndex; i_1 <= endIndex; i_1++) {
27397
+ _loop_2(i_1);
27364
27398
  }
27365
27399
  }
27366
27400
  gObj.rowDragAndDropModule.refreshDataSource();
27401
+ };
27402
+ var this_1 = this;
27403
+ for (var i = 0; i < dragLength; i++) {
27404
+ var state_1 = _loop_1(i);
27405
+ if (typeof state_1 === "object")
27406
+ return state_1.value;
27367
27407
  }
27368
27408
  if (this.dropPosition === 'middleSegment') {
27369
27409
  if (droppedRecord.ganttProperties.predecessor) {