@syncfusion/ej2-gantt 22.2.7 → 22.2.8

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.
@@ -4033,6 +4033,7 @@ const chartRowCell = 'e-chart-row-cell';
4033
4033
  const chartRow = 'e-chart-row';
4034
4034
  const rowExpand = 'e-row-expand';
4035
4035
  const rowCollapse = 'e-row-collapse';
4036
+ const collapseParent = 'e-collapse-parent';
4036
4037
  const taskBarLeftResizer = 'e-taskbar-left-resizer';
4037
4038
  const taskBarRightResizer = 'e-taskbar-right-resizer';
4038
4039
  const childProgressResizer = 'e-child-progress-resizer';
@@ -10523,6 +10524,18 @@ class ChartRows extends DateProcessor {
10523
10524
  }
10524
10525
  }
10525
10526
  else if (taskbarElement) {
10527
+ if (taskbarElement && this.parent.enableVirtualization && !args.data.expanded) {
10528
+ const childElement = trElement.querySelector('.' + collapseParent);
10529
+ if (childElement) {
10530
+ for (let i = 0; i < childElement.childNodes.length; i++) {
10531
+ const taskbar = childElement.childNodes[i];
10532
+ const mainTaskbar = taskbar.querySelector('.' + traceChildTaskBar);
10533
+ if (mainTaskbar) {
10534
+ mainTaskbar.style.backgroundColor = args.taskbarBgColor;
10535
+ }
10536
+ }
10537
+ }
10538
+ }
10526
10539
  if (taskbarElement.querySelector(classCollections[0]) &&
10527
10540
  getComputedStyle(taskbarElement.querySelector(classCollections[0])).backgroundColor !== args.taskbarBgColor) {
10528
10541
  taskbarElement.querySelector(classCollections[0]).style.backgroundColor = args.taskbarBgColor;
@@ -10794,10 +10807,10 @@ class ChartRows extends DateProcessor {
10794
10807
  this.templateData = record;
10795
10808
  const parentTrNode = this.getTableTrNode();
10796
10809
  const leftLabelNode = this.leftLabelContainer();
10797
- const collapseParent = createElement('div', {
10810
+ const collapseParent$$1 = createElement('div', {
10798
10811
  className: 'e-collapse-parent'
10799
10812
  });
10800
- parentTrNode[0].childNodes[0].childNodes[0].appendChild(collapseParent);
10813
+ parentTrNode[0].childNodes[0].childNodes[0].appendChild(collapseParent$$1);
10801
10814
  const tasks = this.parent.dataOperation.setSortedChildTasks(record);
10802
10815
  this.parent.dataOperation.updateOverlappingIndex(tasks);
10803
10816
  let tRow;
@@ -13043,35 +13056,34 @@ class Tooltip$1 {
13043
13056
  */
13044
13057
  updateTooltipPosition(args) {
13045
13058
  args.element.style.visibility = 'visible';
13046
- if (isNullOrUndefined(this.tooltipMouseEvent) || args.target.classList.contains('e-notes-info')) {
13047
- return;
13048
- }
13049
- const postion = this.getPointorPosition(this.tooltipMouseEvent);
13050
- const containerPosition = this.parent.getOffsetRect(this.parent.chartPane);
13051
- const topEnd = containerPosition.top + this.parent.chartPane.offsetHeight;
13052
- const leftEnd = containerPosition.left + this.parent.chartPane.offsetWidth;
13053
- let tooltipPositionX = postion.x;
13054
- let tooltipPositionY = postion.y;
13055
- if (leftEnd < (tooltipPositionX + args.element.offsetWidth + 10)) {
13056
- while (leftEnd < (tooltipPositionX + args.element.offsetWidth + 10)) {
13057
- tooltipPositionX = leftEnd - args.element.offsetWidth - 10;
13058
- args.element.style.left = tooltipPositionX + 'px';
13059
- }
13060
- }
13061
- else {
13062
- tooltipPositionX = tooltipPositionX + 10;
13063
- args.element.style.left = tooltipPositionX + 'px';
13064
- }
13065
- if (window.innerHeight < args.element.offsetHeight + tooltipPositionY) {
13066
- tooltipPositionY = tooltipPositionY - args.element.offsetHeight - 10;
13067
- }
13068
- if ((topEnd < (tooltipPositionY + args.element.offsetHeight + 20))) {
13069
- tooltipPositionY = tooltipPositionY - args.element.offsetHeight - 10;
13070
- }
13071
- else {
13072
- tooltipPositionY = tooltipPositionY + 10;
13073
- }
13074
- args.element.style.top = tooltipPositionY + 'px';
13059
+ // if (isNullOrUndefined(this.tooltipMouseEvent) || args.target.classList.contains('e-notes-info')) {
13060
+ // return;
13061
+ // }
13062
+ // const postion: { x: number, y: number } = this.getPointorPosition(this.tooltipMouseEvent);
13063
+ // const containerPosition: { top: number, left: number, width?: number, height?: number } =
13064
+ // this.parent.getOffsetRect(this.parent.chartPane);
13065
+ // const topEnd: number = containerPosition.top + this.parent.chartPane.offsetHeight;
13066
+ // const leftEnd: number = containerPosition.left + this.parent.chartPane.offsetWidth;
13067
+ // let tooltipPositionX: number = postion.x;
13068
+ // let tooltipPositionY: number = postion.y;
13069
+ // if (leftEnd < (tooltipPositionX + args.element.offsetWidth + 10)) {
13070
+ // while (leftEnd < (tooltipPositionX + args.element.offsetWidth + 10)) {
13071
+ // tooltipPositionX = leftEnd - args.element.offsetWidth - 10;
13072
+ // args.element.style.left = tooltipPositionX + 'px';
13073
+ // }
13074
+ // } else {
13075
+ // tooltipPositionX = tooltipPositionX + 10;
13076
+ // args.element.style.left = tooltipPositionX + 'px';
13077
+ // }
13078
+ // if (window.innerHeight < args.element.offsetHeight + tooltipPositionY) {
13079
+ // tooltipPositionY = tooltipPositionY - args.element.offsetHeight - 10;
13080
+ // }
13081
+ // if ((topEnd < (tooltipPositionY + args.element.offsetHeight + 20))) {
13082
+ // tooltipPositionY = tooltipPositionY - args.element.offsetHeight - 10;
13083
+ // } else {
13084
+ // tooltipPositionY = tooltipPositionY + 10;
13085
+ // }
13086
+ // args.element.style.top = tooltipPositionY + 'px';
13075
13087
  }
13076
13088
  /**
13077
13089
  * Method to get mouse pointor position
@@ -14491,6 +14503,13 @@ let Gantt = class Gantt extends Component {
14491
14503
  if (this.enableCriticalPath && criticalModule && criticalModule.criticalPathCollection) {
14492
14504
  this.criticalPathModule.criticalConnectorLine(criticalModule.criticalPathCollection, criticalModule.detailPredecessorCollection, true, criticalModule.predecessorCollectionTaskIds);
14493
14505
  }
14506
+ this.calculateDimensions();
14507
+ const pane1 = this.splitterModule.splitterObject.element.querySelectorAll('.e-pane')[0];
14508
+ const pane2 = this.splitterModule.splitterObject.element.querySelectorAll('.e-pane')[1];
14509
+ this.splitterModule.splitterPreviousPositionGrid = pane1.scrollWidth + 1 + 'px';
14510
+ this.splitterModule.splitterPreviousPositionChart = pane2.scrollWidth + 1 + 'px';
14511
+ this.splitterModule.splitterObject.paneSettings[0].size = this.splitterModule['getSpliterPositionInPercentage'](this.splitterModule.splitterPreviousPositionGrid);
14512
+ this.splitterModule.splitterObject.paneSettings[1].size = this.splitterModule.splitterPreviousPositionChart;
14494
14513
  }
14495
14514
  }
14496
14515
  keyActionHandler(e) {
@@ -18074,13 +18093,13 @@ class EditTooltip {
18074
18093
  * @returns {void} .
18075
18094
  */
18076
18095
  updateTooltipPosition(args) {
18077
- const containerPosition = this.parent.getOffsetRect(this.parent.chartPane);
18078
- const leftEnd = containerPosition.left + this.parent.chartPane.offsetWidth;
18079
- let tooltipPositionX = args.element.offsetLeft;
18080
- if (leftEnd < (tooltipPositionX + args.element.offsetWidth)) {
18081
- tooltipPositionX += leftEnd - (tooltipPositionX + args.element.offsetWidth);
18082
- }
18083
- args.element.style.left = tooltipPositionX + 'px';
18096
+ // const containerPosition: { top: number, left: number } = this.parent.getOffsetRect(this.parent.chartPane);
18097
+ // const leftEnd: number = containerPosition.left + this.parent.chartPane.offsetWidth;
18098
+ // let tooltipPositionX: number = args.element.offsetLeft;
18099
+ // if (leftEnd < (tooltipPositionX + args.element.offsetWidth)) {
18100
+ // tooltipPositionX += leftEnd - (tooltipPositionX + args.element.offsetWidth);
18101
+ // }
18102
+ // args.element.style.left = tooltipPositionX + 'px';
18084
18103
  args.element.style.visibility = 'visible';
18085
18104
  }
18086
18105
  /**
@@ -18706,6 +18725,12 @@ class TaskbarEdit extends DateProcessor {
18706
18725
  */
18707
18726
  updateMouseDownProperties(event) {
18708
18727
  const e = this.getCoordinate(event);
18728
+ const parentWithZoomStyle = this.parent.element.closest('[style*="zoom"]');
18729
+ if (parentWithZoomStyle) {
18730
+ const zoom1 = parseFloat(getComputedStyle(parentWithZoomStyle).zoom);
18731
+ e.pageX = e.pageX / zoom1;
18732
+ e.pageY = e.pageY / zoom1;
18733
+ }
18709
18734
  if (e.pageX || e.pageY) {
18710
18735
  const containerPosition = this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);
18711
18736
  if (this.parent.enableRtl) {
@@ -18915,6 +18940,12 @@ class TaskbarEdit extends DateProcessor {
18915
18940
  updateMouseMoveProperties(event) {
18916
18941
  const containerPosition = this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);
18917
18942
  const e = this.getCoordinate(event);
18943
+ const parentWithZoomStyle = this.parent.element.closest('[style*="zoom"]');
18944
+ if (parentWithZoomStyle) {
18945
+ const zoom1 = parseFloat(getComputedStyle(parentWithZoomStyle).zoom);
18946
+ e.pageX = e.pageX / zoom1;
18947
+ e.pageY = e.pageY / zoom1;
18948
+ }
18918
18949
  if (e.pageX || e.pageY) {
18919
18950
  if (this.parent.enableRtl) {
18920
18951
  this.mouseMoveX = Math.abs(e.pageX - (containerPosition.left +
@@ -20305,6 +20336,12 @@ class TaskbarEdit extends DateProcessor {
20305
20336
  }
20306
20337
  // eslint-disable-next-line
20307
20338
  triggerDependencyEvent(e, mouseUp) {
20339
+ const parentWithZoomStyle = this.parent.element.closest('[style*="zoom"]');
20340
+ let zoomedPageY;
20341
+ if (parentWithZoomStyle) {
20342
+ const zoom1 = parseFloat(getComputedStyle(parentWithZoomStyle).zoom);
20343
+ zoomedPageY = e.pageY / zoom1;
20344
+ }
20308
20345
  const fromItem = this.taskBarEditRecord.ganttProperties;
20309
20346
  const toItem = this.connectorSecondRecord ? this.connectorSecondRecord.ganttProperties : null;
20310
20347
  let predecessor;
@@ -20366,7 +20403,7 @@ class TaskbarEdit extends DateProcessor {
20366
20403
  table[1].innerText = toItem.taskName;
20367
20404
  table[2].innerText = this.parent.localeObj.getConstant(currentTarget);
20368
20405
  const tooltipElement = this.parent.connectorLineModule.tooltipTable.parentElement.parentElement;
20369
- if (tooltipElement.offsetTop + tooltipElement.offsetHeight > e.pageY) {
20406
+ if (tooltipElement.offsetTop + tooltipElement.offsetHeight > zoomedPageY) {
20370
20407
  tooltipElement.style.top = (e.pageY - tooltipElement.offsetHeight - 20) + 'px';
20371
20408
  }
20372
20409
  }
@@ -30494,7 +30531,13 @@ class ContextMenu$2 {
30494
30531
  }
30495
30532
  break;
30496
30533
  case 'DeleteTask':
30497
- this.parent.editModule.deleteRecord(this.rowData);
30534
+ if ((this.parent.selectionSettings.mode !== 'Cell' && this.parent.selectionModule.selectedRowIndexes.length > 1)
30535
+ || (this.parent.selectionSettings.mode === 'Cell' && this.parent.selectionModule.getSelectedRowCellIndexes().length)) {
30536
+ this.parent.editModule.startDeleteAction();
30537
+ }
30538
+ else {
30539
+ this.parent.editModule.deleteRecord(this.rowData);
30540
+ }
30498
30541
  break;
30499
30542
  case 'ToTask':
30500
30543
  if (!isNullOrUndefined(this.rowData)) {