@syncfusion/ej2-treegrid 31.2.5 → 31.2.10

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.
@@ -4828,6 +4828,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4828
4828
  this.grid["" + enableHtmlSanitizer] = this.enableHtmlSanitizer;
4829
4829
  this.grid.enableStickyHeader = this.enableStickyHeader;
4830
4830
  this.grid.emptyRecordTemplate = this.emptyRecordTemplate;
4831
+ this.grid.isRowSelectable = this.isRowSelectable;
4831
4832
  var isTreeGrid = 'isTreeGrid';
4832
4833
  this.grid["" + isTreeGrid] = true;
4833
4834
  };
@@ -5214,7 +5215,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5214
5215
  }
5215
5216
  else {
5216
5217
  this.grid.dataSource = !(this.dataSource instanceof DataManager) ?
5217
- this.flatData : new DataManager(this.dataSource.dataSource, this.dataSource.defaultQuery, this.dataSource.adaptor);
5218
+ this.flatData : new DataManager(this.dataSource.dataSource, this.dataSource.defaultQuery, this.dataSource.adaptor, this.hasPreAndPostMiddleware(this.dataSource) ? this.dataSource : undefined);
5218
5219
  }
5219
5220
  if (this.dataSource instanceof DataManager && (this.dataSource.dataSource.offline || this.dataSource.ready)) {
5220
5221
  this.grid.dataSource["" + dataSource].json = extendArray(this.dataSource["" + dataSource].json);
@@ -5850,6 +5851,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5850
5851
  case 'emptyRecordTemplate':
5851
5852
  this.grid.emptyRecordTemplate = this.emptyRecordTemplate;
5852
5853
  break;
5854
+ case 'isRowSelectable':
5855
+ this.grid.isRowSelectable = this.isRowSelectable;
5856
+ break;
5853
5857
  case 'editSettings':
5854
5858
  if (this.grid.isEdit && this.grid.editSettings.mode === 'Normal' && newProp["" + prop].mode &&
5855
5859
  (newProp["" + prop].mode === 'Cell' || newProp["" + prop].mode === 'Row')) {
@@ -6620,6 +6624,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6620
6624
  this.setProperties({ searchSettings: getObject('properties', this.grid.searchSettings) }, true);
6621
6625
  this.setProperties({ sortSettings: getObject('properties', this.grid.sortSettings) }, true);
6622
6626
  };
6627
+ TreeGrid.prototype.hasPreAndPostMiddleware = function (obj) {
6628
+ return (obj && typeof obj.applyPreRequestMiddlewares === 'function' && typeof obj.applyPostRequestMiddlewares === 'function');
6629
+ };
6623
6630
  /**
6624
6631
  * Retrieves the content table element of the TreeGrid.
6625
6632
  *
@@ -6777,7 +6784,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6777
6784
  }
6778
6785
  else {
6779
6786
  this.grid.setProperties({
6780
- dataSource: new DataManager(this.dataSource.dataSource, this.dataSource.defaultQuery, this.dataSource.adaptor)
6787
+ dataSource: new DataManager(this.dataSource.dataSource, this.dataSource.defaultQuery, this.dataSource.adaptor, this.hasPreAndPostMiddleware(this.dataSource) ? this.dataSource : undefined)
6781
6788
  }, true);
6782
6789
  }
6783
6790
  }
@@ -7909,6 +7916,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7909
7916
  TreeGrid.prototype.addListener = function () {
7910
7917
  this.on('updateResults', this.updateResultModel, this);
7911
7918
  this.grid.on('initial-end', this.afterGridRender, this);
7919
+ this.grid.on('partial-filter-update', this.partialFilterUpdate, this);
7912
7920
  };
7913
7921
  TreeGrid.prototype.updateResultModel = function (returnResult) {
7914
7922
  this.dataResults = returnResult;
@@ -7924,6 +7932,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7924
7932
  this.off('updateResults', this.updateResultModel);
7925
7933
  this.grid.off('initial-end', this.afterGridRender);
7926
7934
  this.grid.off('last-rowcell-border-updated', this.lastRowCellBorderUpdated);
7935
+ this.grid.off('partial-filter-update', this.partialFilterUpdate);
7936
+ };
7937
+ TreeGrid.prototype.partialFilterUpdate = function (args) {
7938
+ var gridFiltered = args.gridFiltered;
7939
+ this.notify('updateFilterRecs', { data: gridFiltered });
7927
7940
  };
7928
7941
  /**
7929
7942
  * Filters the TreeGrid rows based on a specified column and filter criteria.
@@ -8546,6 +8559,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
8546
8559
  __decorate$c([
8547
8560
  Property(-1)
8548
8561
  ], TreeGrid.prototype, "selectedRowIndex", void 0);
8562
+ __decorate$c([
8563
+ Property(null)
8564
+ ], TreeGrid.prototype, "isRowSelectable", void 0);
8549
8565
  __decorate$c([
8550
8566
  Complex({}, SelectionSettings)
8551
8567
  ], TreeGrid.prototype, "selectionSettings", void 0);
@@ -14679,6 +14695,21 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
14679
14695
  }
14680
14696
  return cells;
14681
14697
  };
14698
+ /**
14699
+ * returns the index of a row in virtualization case
14700
+ *
14701
+ * @param {number} index - The index of the row.
14702
+ * @returns {number} virtual index of that row.
14703
+ */
14704
+ VirtualTreeContentRenderer.prototype.getVirtualRowIndex = function (index) {
14705
+ if (isNullOrUndefined(this.prevInfo)) {
14706
+ return index;
14707
+ }
14708
+ else {
14709
+ var startIdx = (this.parent.getRowsObject()[0]).index;
14710
+ return startIdx + index;
14711
+ }
14712
+ };
14682
14713
  /**
14683
14714
  * Generates a cell object with provided column and row configurations.
14684
14715
  *
@@ -15647,10 +15678,12 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
15647
15678
  */
15648
15679
  VirtualScroll.prototype.updateSelection = function (args) {
15649
15680
  if (args.isHeaderCheckboxClicked &&
15650
- this.parent.grid.currentViewData.length !== this.parent.grid.selectionModule.selectedRowIndexes.length) {
15681
+ this.parent.grid.currentViewData.length !== this.parent.grid.selectionModule.selectedRowIndexes.length &&
15682
+ args.target.classList.contains('e-uncheck')) {
15651
15683
  var updateRowSelection = 'updateRowSelection';
15652
15684
  for (var i = 0; i < this.parent.getRows().length; i++) {
15653
- if (this.parent.getRows()[parseInt(i.toString(), 10)].getElementsByClassName('e-frame e-icons e-uncheck').length) {
15685
+ if (this.parent.getRows()[parseInt(i.toString(), 10)].getElementsByClassName('e-frame e-icons e-uncheck').length &&
15686
+ !this.parent.getRows()[parseInt(i.toString(), 10)].querySelector('.e-checkbox-disabled')) {
15654
15687
  this.parent.grid.selectionModule["" + updateRowSelection](this.parent.getRows()[parseInt(i.toString(), 10)],
15655
15688
  // eslint-disable-next-line max-len
15656
15689
  this.parent.getCurrentViewRecords()[parseInt(i.toString(), 10)].index);