@syncfusion/ej2-treegrid 24.1.45 → 24.2.3

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.
@@ -6480,7 +6480,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6480
6480
  if (!isNullOrUndefined(row)) {
6481
6481
  row.setAttribute('aria-expanded', action === 'expand' ? 'true' : 'false');
6482
6482
  }
6483
- if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization || this.enableInfiniteScrolling) && !isRemoteData(this)
6483
+ if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization) && !isRemoteData(this)
6484
6484
  && !isCountRequired(this)) {
6485
6485
  this.notify(localPagedExpandCollapse, { action: action, row: row, record: record });
6486
6486
  }
@@ -10686,7 +10686,14 @@ class ContextMenu$1 {
10686
10686
  const selectedrow = tObj.getSelectedRows()[0];
10687
10687
  if ((indent || outdent) && !isNullOrUndefined(selectedrow)) {
10688
10688
  const targetElement = args.event.target.closest('td');
10689
- if (isNullOrUndefined(targetElement) || (!isNullOrUndefined(targetElement) && (!targetElement.classList.contains('e-rowcell') || targetElement.querySelectorAll('.e-gridform').length !== 0))) {
10689
+ if (isNullOrUndefined(targetElement) || (!isNullOrUndefined(targetElement) && (!targetElement.classList.contains('e-rowcell') ||
10690
+ targetElement.querySelectorAll('.e-gridform').length !== 0))) {
10691
+ for (const items of args.items) {
10692
+ if (items.text === 'Outdent' || items.text === 'Indent') {
10693
+ tObj.grid.contextMenuModule['hiddenItems'].push(items.text);
10694
+ }
10695
+ }
10696
+ tObj.grid.contextMenuModule.contextMenu.hideItems(tObj.grid.contextMenuModule['hiddenItems']);
10690
10697
  indent.style.display = outdent.style.display = 'none';
10691
10698
  }
10692
10699
  else {
@@ -10716,9 +10723,14 @@ class ContextMenu$1 {
10716
10723
  }
10717
10724
  }
10718
10725
  else {
10719
- if (tObj.grid.isEdit && isNullOrUndefined(selectedrow)) {
10720
- indent.style.display = 'none';
10721
- outdent.style.display = 'none';
10726
+ if (((indent || outdent) || tObj.grid.isEdit) && isNullOrUndefined(selectedrow)) {
10727
+ for (const items of args.items) {
10728
+ if (items.text === 'Outdent' || items.text === 'Indent') {
10729
+ tObj.grid.contextMenuModule['hiddenItems'].push(items.text);
10730
+ }
10731
+ }
10732
+ tObj.grid.contextMenuModule.contextMenu.hideItems(tObj.grid.contextMenuModule['hiddenItems']);
10733
+ indent.style.display = outdent.style.display = 'none';
10722
10734
  }
10723
10735
  }
10724
10736
  }
@@ -13597,7 +13609,6 @@ class InfiniteScroll$1 {
13597
13609
  this.parent.grid.on('infinite-edit-handler', this.infiniteEditHandler, this);
13598
13610
  this.parent.grid.on('infinite-crud-cancel', this.createRows, this);
13599
13611
  this.parent.grid.on('content-ready', this.contentready, this);
13600
- this.parent.on(localPagedExpandCollapse, this.collapseExpandInfinitechilds, this);
13601
13612
  }
13602
13613
  /**
13603
13614
  * @hidden
@@ -13613,7 +13624,6 @@ class InfiniteScroll$1 {
13613
13624
  this.parent.off(pagingActions, this.infinitePageAction);
13614
13625
  this.parent.grid.off('infinite-crud-cancel', this.createRows);
13615
13626
  this.parent.grid.off('content-ready', this.contentready);
13616
- this.parent.off(localPagedExpandCollapse, this.collapseExpandInfinitechilds);
13617
13627
  }
13618
13628
  /**
13619
13629
  * Handles the Expand Collapse action for Remote data with infinite scrolling.
@@ -13663,18 +13673,6 @@ class InfiniteScroll$1 {
13663
13673
  }
13664
13674
  }
13665
13675
  }
13666
- collapseExpandInfinitechilds(row) {
13667
- row.record.expanded = row.action === 'collapse' ? false : true;
13668
- const ret = {
13669
- result: this.parent.flatData,
13670
- row: row.row,
13671
- action: row.action,
13672
- record: row.record,
13673
- count: this.parent.flatData.length
13674
- };
13675
- const requestType = getValue('isCollapseAll', this.parent) ? 'collapseAll' : 'refresh';
13676
- getValue('grid.renderModule', this.parent).dataManagerSuccess(ret, { requestType: requestType });
13677
- }
13678
13676
  /**
13679
13677
  * Handles the page query for Data operations and CRUD actions.
13680
13678
  *
@@ -13687,10 +13685,7 @@ class InfiniteScroll$1 {
13687
13685
  infinitePageAction(pageingDetails) {
13688
13686
  const dm = new DataManager(pageingDetails.result);
13689
13687
  const expanded$$1 = new Predicate('expanded', 'notequal', null).or('expanded', 'notequal', undefined);
13690
- const infiniteParents = dm.executeLocal(new Query().where(expanded$$1));
13691
- const visualData = infiniteParents.filter((e) => {
13692
- return getExpandStatus(this.parent, e, infiniteParents);
13693
- });
13688
+ const visualData = dm.executeLocal(new Query().where(expanded$$1));
13694
13689
  const actionArgs = getValue('actionArgs', pageingDetails.actionArgs);
13695
13690
  const actions = getValue('actions', this.parent.grid.infiniteScrollModule);
13696
13691
  if (this.parent.grid.infiniteScrollModule['isInitialRender'] && !this.parent.initialRender) {
@@ -13709,10 +13704,10 @@ class InfiniteScroll$1 {
13709
13704
  if (isCache && this.parent.infiniteScrollSettings.initialBlocks > this.parent.infiniteScrollSettings.maxBlocks) {
13710
13705
  this.parent.infiniteScrollSettings.initialBlocks = this.parent.infiniteScrollSettings.maxBlocks;
13711
13706
  }
13712
- let size = initialRender ?
13707
+ const size = initialRender ?
13713
13708
  this.parent.grid.pageSettings.pageSize * this.parent.infiniteScrollSettings.initialBlocks :
13714
13709
  this.parent.grid.pageSettings.pageSize;
13715
- let current = this.parent.grid.pageSettings.currentPage;
13710
+ const current = this.parent.grid.pageSettings.currentPage;
13716
13711
  if (!isNullOrUndefined(actionArgs)) {
13717
13712
  const lastIndex = getValue('lastIndex', this.parent.grid.infiniteScrollModule);
13718
13713
  const firstIndex = getValue('firstIndex', this.parent.grid.infiniteScrollModule);
@@ -13727,10 +13722,6 @@ class InfiniteScroll$1 {
13727
13722
  query = query.take(this.parent.infiniteScrollSettings.initialBlocks * this.parent.pageSettings.pageSize);
13728
13723
  }
13729
13724
  else {
13730
- if ((pageingDetails.actionArgs['action'] === 'expand' || pageingDetails.actionArgs['action'] === 'collapse') && this.parent.grid.pageSettings.currentPage !== 1) {
13731
- current = 1;
13732
- size = this.parent.grid.pageSettings.pageSize * this.parent.grid.pageSettings.currentPage;
13733
- }
13734
13725
  query = query.page(current, size);
13735
13726
  }
13736
13727
  }