@syncfusion/ej2-treegrid 20.3.52 → 20.3.57

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.
@@ -924,6 +924,7 @@ var Selection = /** @__PURE__ @class */ (function () {
924
924
  this.selectedItems = [];
925
925
  this.selectedIndexes = [];
926
926
  this.filteredList = [];
927
+ this.searchingRecords = [];
927
928
  this.addEventListener();
928
929
  }
929
930
  /**
@@ -1178,6 +1179,9 @@ var Selection = /** @__PURE__ @class */ (function () {
1178
1179
  if (this.filteredList.length === 0) {
1179
1180
  this.filteredList = filterResult;
1180
1181
  }
1182
+ if (this.parent.grid.searchSettings.key.length) {
1183
+ this.searchingRecords = filterResult;
1184
+ }
1181
1185
  else {
1182
1186
  if (this.filteredList !== filterResult) {
1183
1187
  this.filteredList = filterResult;
@@ -1189,13 +1193,22 @@ var Selection = /** @__PURE__ @class */ (function () {
1189
1193
  }
1190
1194
  }
1191
1195
  if (this.filteredList.length > 0) {
1192
- if (!this.parent.filterSettings.columns.length && this.filteredList.length) {
1196
+ if (!this.parent.filterSettings.columns.length && this.filteredList.length && !this.parent.grid.searchSettings.key.length) {
1193
1197
  this.filteredList = [];
1194
1198
  }
1199
+ if (this.searchingRecords.length && !isNullOrUndefined(checkAll)) {
1200
+ this.filteredList = this.searchingRecords;
1201
+ }
1202
+ }
1203
+ var data;
1204
+ if (this.parent.filterModule.filteredResult.length === 0 && this.parent.getCurrentViewRecords().length === 0 &&
1205
+ this.parent.filterSettings.columns.length > 0) {
1206
+ data = this.filteredList;
1207
+ }
1208
+ else {
1209
+ data = (!isNullOrUndefined(this.parent.filterModule) &&
1210
+ (this.filteredList.length > 0)) ? this.filteredList : this.parent.flatData;
1195
1211
  }
1196
- var data = (!isNullOrUndefined(this.parent.filterModule) &&
1197
- (this.filteredList.length > 0)) ? this.filteredList :
1198
- this.parent.flatData;
1199
1212
  data = isRemoteData(this.parent) ? this.parent.getCurrentViewRecords() : data;
1200
1213
  if (!isNullOrUndefined(checkAll)) {
1201
1214
  for (var i = 0; i < data.length; i++) {
@@ -5710,7 +5723,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5710
5723
  var obj = 'dialogObj';
5711
5724
  var showDialog = 'showDialog';
5712
5725
  if ((this.getBatchChanges()[this.changedRecords].length ||
5713
- this.getBatchChanges()[this.deletedRecords].length || this.getBatchChanges()[this.addedRecords].length) && this.editSettings.showConfirmDialog) {
5726
+ this.getBatchChanges()[this.deletedRecords].length || this.getBatchChanges()[this.addedRecords].length)
5727
+ && this.editSettings.showConfirmDialog) {
5714
5728
  var dialogObj = this.grid.editModule[obj];
5715
5729
  this.grid.editModule[showDialog]('CancelEdit', dialogObj);
5716
5730
  this.targetElement = target;
@@ -6151,6 +6165,10 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6151
6165
  this.localExpand(action, row, record);
6152
6166
  }
6153
6167
  }
6168
+ if (!isNullOrUndefined(targetEle) && targetEle.closest('.e-treerowcell').classList.contains('e-cellselectionbackground')) {
6169
+ targetEle.closest('.e-treerowcell').classList.remove('e-cellselectionbackground');
6170
+ targetEle.closest('.e-treerowcell').removeAttribute('aria-selected');
6171
+ }
6154
6172
  if (this.isPixelHeight() && !row.cells[0].classList.contains('e-lastrowcell')) {
6155
6173
  var totalRows = this.getRows();
6156
6174
  var rows = this.getContentTable().rows;
@@ -6167,20 +6185,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6167
6185
  }
6168
6186
  this.notify('rowExpandCollapse', { detailrows: detailrows, action: displayAction, record: record, row: row });
6169
6187
  this.updateAltRow(gridRows);
6170
- this.updateGridRowsVisible();
6171
- }
6172
- };
6173
- TreeGrid.prototype.updateGridRowsVisible = function () {
6174
- var rowsToRefresh = this.grid.getRowsObject();
6175
- var rows = this.getRows();
6176
- for (var i = 0; i < rows.length; i++) {
6177
- for (var j = 0; j < rowsToRefresh.length; j++) {
6178
- if (rows[i].dataset.uid === rowsToRefresh[j].uid) {
6179
- rowsToRefresh[j].visible = rows[i].style.display === 'none' ? false : true;
6180
- }
6181
- }
6182
6188
  }
6183
- this.grid.notify('refresh-Expand-and-Collapse', { rows: rowsToRefresh });
6184
6189
  };
6185
6190
  TreeGrid.prototype.updateChildOnDemand = function (expandingArgs) {
6186
6191
  var _this = this;
@@ -9552,6 +9557,8 @@ var Page$1 = /** @__PURE__ @class */ (function () {
9552
9557
  */
9553
9558
  Page$$1.prototype.collapseExpandPagedchilds = function (rowDetails) {
9554
9559
  rowDetails.record.expanded = rowDetails.action === 'collapse' ? false : true;
9560
+ this.parent.flatData.map(function (e) { return e.expanded = e.uniqueID === rowDetails.record.uniqueID &&
9561
+ e.expanded !== rowDetails.record.expanded ? rowDetails.record.expanded : e.expanded; });
9555
9562
  if (this.parent.enableImmutableMode) {
9556
9563
  var primaryKeyField_1 = this.parent.getPrimaryKeyFieldNames()[0];
9557
9564
  var record = this.parent.flatData.filter(function (e) {