@syncfusion/ej2-treegrid 31.2.5 → 31.2.12

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.
@@ -4507,6 +4507,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4507
4507
  this.grid[`${enableHtmlSanitizer}`] = this.enableHtmlSanitizer;
4508
4508
  this.grid.enableStickyHeader = this.enableStickyHeader;
4509
4509
  this.grid.emptyRecordTemplate = this.emptyRecordTemplate;
4510
+ this.grid.isRowSelectable = this.isRowSelectable;
4510
4511
  const isTreeGrid = 'isTreeGrid';
4511
4512
  this.grid[`${isTreeGrid}`] = true;
4512
4513
  }
@@ -4888,7 +4889,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4888
4889
  }
4889
4890
  else {
4890
4891
  this.grid.dataSource = !(this.dataSource instanceof DataManager) ?
4891
- this.flatData : new DataManager(this.dataSource.dataSource, this.dataSource.defaultQuery, this.dataSource.adaptor);
4892
+ this.flatData : new DataManager(this.dataSource.dataSource, this.dataSource.defaultQuery, this.dataSource.adaptor, this.hasPreAndPostMiddleware(this.dataSource) ? this.dataSource : undefined);
4892
4893
  }
4893
4894
  if (this.dataSource instanceof DataManager && (this.dataSource.dataSource.offline || this.dataSource.ready)) {
4894
4895
  this.grid.dataSource[`${dataSource}`].json = extendArray(this.dataSource[`${dataSource}`].json);
@@ -5517,6 +5518,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5517
5518
  case 'emptyRecordTemplate':
5518
5519
  this.grid.emptyRecordTemplate = this.emptyRecordTemplate;
5519
5520
  break;
5521
+ case 'isRowSelectable':
5522
+ this.grid.isRowSelectable = this.isRowSelectable;
5523
+ break;
5520
5524
  case 'editSettings':
5521
5525
  if (this.grid.isEdit && this.grid.editSettings.mode === 'Normal' && newProp[`${prop}`].mode &&
5522
5526
  (newProp[`${prop}`].mode === 'Cell' || newProp[`${prop}`].mode === 'Row')) {
@@ -6284,6 +6288,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6284
6288
  this.setProperties({ searchSettings: getObject('properties', this.grid.searchSettings) }, true);
6285
6289
  this.setProperties({ sortSettings: getObject('properties', this.grid.sortSettings) }, true);
6286
6290
  }
6291
+ hasPreAndPostMiddleware(obj) {
6292
+ return (obj && typeof obj.applyPreRequestMiddlewares === 'function' && typeof obj.applyPostRequestMiddlewares === 'function');
6293
+ }
6287
6294
  /**
6288
6295
  * Retrieves the content table element of the TreeGrid.
6289
6296
  *
@@ -6441,7 +6448,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6441
6448
  }
6442
6449
  else {
6443
6450
  this.grid.setProperties({
6444
- dataSource: new DataManager(this.dataSource.dataSource, this.dataSource.defaultQuery, this.dataSource.adaptor)
6451
+ dataSource: new DataManager(this.dataSource.dataSource, this.dataSource.defaultQuery, this.dataSource.adaptor, this.hasPreAndPostMiddleware(this.dataSource) ? this.dataSource : undefined)
6445
6452
  }, true);
6446
6453
  }
6447
6454
  }
@@ -7545,6 +7552,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
7545
7552
  addListener() {
7546
7553
  this.on('updateResults', this.updateResultModel, this);
7547
7554
  this.grid.on('initial-end', this.afterGridRender, this);
7555
+ this.grid.on('partial-filter-update', this.partialFilterUpdate, this);
7548
7556
  }
7549
7557
  updateResultModel(returnResult) {
7550
7558
  this.dataResults = returnResult;
@@ -7560,6 +7568,11 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
7560
7568
  this.off('updateResults', this.updateResultModel);
7561
7569
  this.grid.off('initial-end', this.afterGridRender);
7562
7570
  this.grid.off('last-rowcell-border-updated', this.lastRowCellBorderUpdated);
7571
+ this.grid.off('partial-filter-update', this.partialFilterUpdate);
7572
+ }
7573
+ partialFilterUpdate(args) {
7574
+ const gridFiltered = args.gridFiltered;
7575
+ this.notify('updateFilterRecs', { data: gridFiltered });
7563
7576
  }
7564
7577
  /**
7565
7578
  * Filters the TreeGrid rows based on a specified column and filter criteria.
@@ -8182,6 +8195,9 @@ __decorate$c([
8182
8195
  __decorate$c([
8183
8196
  Property(-1)
8184
8197
  ], TreeGrid.prototype, "selectedRowIndex", void 0);
8198
+ __decorate$c([
8199
+ Property(null)
8200
+ ], TreeGrid.prototype, "isRowSelectable", void 0);
8185
8201
  __decorate$c([
8186
8202
  Complex({}, SelectionSettings)
8187
8203
  ], TreeGrid.prototype, "selectionSettings", void 0);
@@ -14193,6 +14209,21 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
14193
14209
  }
14194
14210
  return cells;
14195
14211
  }
14212
+ /**
14213
+ * returns the index of a row in virtualization case
14214
+ *
14215
+ * @param {number} index - The index of the row.
14216
+ * @returns {number} virtual index of that row.
14217
+ */
14218
+ getVirtualRowIndex(index) {
14219
+ if (isNullOrUndefined(this.prevInfo)) {
14220
+ return index;
14221
+ }
14222
+ else {
14223
+ const startIdx = (this.parent.getRowsObject()[0]).index;
14224
+ return startIdx + index;
14225
+ }
14226
+ }
14196
14227
  /**
14197
14228
  * Generates a cell object with provided column and row configurations.
14198
14229
  *
@@ -15141,10 +15172,12 @@ class VirtualScroll {
15141
15172
  */
15142
15173
  updateSelection(args) {
15143
15174
  if (args.isHeaderCheckboxClicked &&
15144
- this.parent.grid.currentViewData.length !== this.parent.grid.selectionModule.selectedRowIndexes.length) {
15175
+ this.parent.grid.currentViewData.length !== this.parent.grid.selectionModule.selectedRowIndexes.length &&
15176
+ args.target.classList.contains('e-uncheck')) {
15145
15177
  const updateRowSelection = 'updateRowSelection';
15146
15178
  for (let i = 0; i < this.parent.getRows().length; i++) {
15147
- if (this.parent.getRows()[parseInt(i.toString(), 10)].getElementsByClassName('e-frame e-icons e-uncheck').length) {
15179
+ if (this.parent.getRows()[parseInt(i.toString(), 10)].getElementsByClassName('e-frame e-icons e-uncheck').length &&
15180
+ !this.parent.getRows()[parseInt(i.toString(), 10)].querySelector('.e-checkbox-disabled')) {
15148
15181
  this.parent.grid.selectionModule[`${updateRowSelection}`](this.parent.getRows()[parseInt(i.toString(), 10)],
15149
15182
  // eslint-disable-next-line max-len
15150
15183
  this.parent.getCurrentViewRecords()[parseInt(i.toString(), 10)].index);