@syncfusion/ej2-treegrid 32.1.19 → 32.1.22-1533505

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.
@@ -1499,7 +1499,7 @@ class Selection {
1499
1499
  const newSelectedUidMap = new Map();
1500
1500
  const newSelectedIndexes = [];
1501
1501
  for (const item of currentlySelectedItemsInOrder) {
1502
- if (item.hasChildRecords && isFilterOrSearch && item.level === 0) {
1502
+ if (item.hasChildRecords && isFilterOrSearch && item.level === 0 && this.parent.autoCheckHierarchy) {
1503
1503
  this.updateParentSelection(item);
1504
1504
  }
1505
1505
  if (item.uniqueID && item.checkboxState === 'check') {
@@ -1828,9 +1828,14 @@ class Selection {
1828
1828
  if ((requestType === 'filtering' || requestType === 'searching' || requestType === 'refresh' ||
1829
1829
  requestType === 'sorting' || requestType === 'paging' || requestType === 'expanding' ||
1830
1830
  requestType === 'expand' || requestType === 'collapsing' || requestType === 'collapse') && !isRemoteData(this.parent)) {
1831
- this.selectedItems = [];
1832
- this.selectedUidMap = new Map();
1833
- this.selectedIndexes = [];
1831
+ if (!(isCheckboxcolumn(this.parent) && (requestType === 'refresh' && this.parent['isVirtualExpandCollapse']))) {
1832
+ this.selectedItems = [];
1833
+ this.selectedUidMap = new Map();
1834
+ this.selectedIndexes = [];
1835
+ }
1836
+ if (requestType === 'filtering' || requestType === 'searching' || requestType === 'sorting') {
1837
+ this.headerSelection(false);
1838
+ }
1834
1839
  this.refreshVisibleCheckboxes();
1835
1840
  if (this.parent.autoCheckHierarchy) {
1836
1841
  this.updateHeaderCheckboxState();
@@ -4029,6 +4034,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4029
4034
  this.freezeColumnRefresh = true;
4030
4035
  this.componentRefresh = Component.prototype.refresh;
4031
4036
  this.isComponentRefresh = false;
4037
+ this.isVirtualExpandCollapse = false;
4032
4038
  this.objectEqualityChecker = (old, current) => {
4033
4039
  if (old) {
4034
4040
  const keys = Object.keys(old);
@@ -4821,12 +4827,18 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4821
4827
  this.renderComplete();
4822
4828
  const destroyTemplate = 'destroyTemplate';
4823
4829
  const destroyTemplateFn = this.grid[`${destroyTemplate}`];
4830
+ const isGantt = this['isFromGantt'] && this.isReact;
4824
4831
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4825
4832
  this.grid[`${destroyTemplate}`] = (args, index, callback) => {
4826
4833
  destroyTemplateFn.apply(this.grid);
4827
4834
  const portals = 'portals';
4828
4835
  if (!(this.isReact && isNullOrUndefined(this[`${portals}`]))) {
4829
- this.clearTemplate(args, index, callback);
4836
+ if (isGantt) {
4837
+ this['root'].clearTemplate(args, index, callback);
4838
+ }
4839
+ else {
4840
+ this.clearTemplate(args, index, callback);
4841
+ }
4830
4842
  }
4831
4843
  else if (!isNullOrUndefined(callback)) {
4832
4844
  callback();
@@ -4850,7 +4862,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4850
4862
  if (RecordsCount === 0 && this.columns.length === 0) {
4851
4863
  failureCases.push('Either of the Data source or columns should be given.');
4852
4864
  }
4853
- if (this.frozenColumns > 0 && this.columnModel.filter((col) => col.isFrozen)) {
4865
+ if (this.frozenColumns > 0 && this.columnModel.filter((col) => col.isFrozen).length > 0) {
4854
4866
  failureCases.push('Use only one attribute for Frozen either IsFrozen or FrozenColumns.');
4855
4867
  }
4856
4868
  if (this.enableVirtualization && !isNullOrUndefined(this.detailTemplate)) {
@@ -4860,7 +4872,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4860
4872
  && (!isNullOrUndefined(this.detailTemplate) || !isNullOrUndefined(this.rowTemplate))) {
4861
4873
  failureCases.push('Frozen rows and columns are not supported with the Detail template and row template.');
4862
4874
  }
4863
- if ((this.frozenColumns > 0 || this.columnModel.filter((col) => col.isFrozen).length > 0 || this.frozenRows > 0) && this.editSettings.mode === 'Cell') {
4875
+ if ((this.frozenColumns > 0 || this.columnModel.filter((col) => col.isFrozen).length > 0 || this.frozenRows > 0) && this.editSettings.allowEditing && this.editSettings.mode === 'Cell') {
4864
4876
  failureCases.push('Frozen rows and columns are not supported with cell editing.');
4865
4877
  }
4866
4878
  if (this.allowSelection && !isNullOrUndefined(this.rowTemplate)) {
@@ -5501,6 +5513,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5501
5513
  this.notify(batchSave, args);
5502
5514
  }
5503
5515
  this.notify('updateGridActions', args);
5516
+ this.isVirtualExpandCollapse = false;
5504
5517
  if (args.requestType === 'save' && this.aggregates.map((ag) => ag.showChildSummary === true).length) {
5505
5518
  this.grid.refresh();
5506
5519
  }
@@ -6512,6 +6525,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6512
6525
  const table = this.getContentTable();
6513
6526
  const sHeight = table.scrollHeight;
6514
6527
  const clientHeight = this.getContent().clientHeight;
6528
+ removeClass(table.querySelectorAll('td.e-lastrowcell'), 'e-lastrowcell');
6515
6529
  this.lastRowBorder(this.getRows()[currentRecords.indexOf(record)], sHeight <= clientHeight);
6516
6530
  }
6517
6531
  }
@@ -14625,7 +14639,8 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
14625
14639
  */
14626
14640
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
14627
14641
  getRowCollection(index, isMovable, isRowObject, isFrozenRight) {
14628
- const startIdx = parseInt(this.parent.getRows()[0].getAttribute(ariaRowIndex), 10) - 1;
14642
+ const rows = this.parent.getRows();
14643
+ const startIdx = rows.length > 0 ? parseInt(rows[0].getAttribute(ariaRowIndex), 10) - 1 : 0;
14629
14644
  const rowCollection = this.parent.getDataRows();
14630
14645
  const collection = isRowObject ? this.parent.getCurrentViewRecords() : rowCollection;
14631
14646
  let selectedRow = collection[index - startIdx];
@@ -15757,6 +15772,7 @@ class VirtualScroll {
15757
15772
  count: this.parent.flatData.length
15758
15773
  };
15759
15774
  this.handleSelection();
15775
+ this.parent['isVirtualExpandCollapse'] = true;
15760
15776
  const requestType = getValue('isCollapseAll', this.parent) ? 'collapseAll' : 'refresh';
15761
15777
  getValue('grid.renderModule', this.parent).dataManagerSuccess(actionDetails, { requestType: requestType });
15762
15778
  }