@syncfusion/ej2-treegrid 32.2.7 → 32.2.9

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.
@@ -6850,11 +6850,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6850
6850
  rowData.hasChildRecords = record.hasChildRecords;
6851
6851
  rowData.parentUniqueID = record.parentUniqueID;
6852
6852
  rowData.expanded = record.expanded;
6853
- if (this.enableVirtualization) {
6854
- this.grid.selectionModule.selectedRowIndexes = this.grid.selectionModule.selectedRowIndexes.indexOf(record.index) === -1
6855
- && (this.selectedRowIndex >= 0 && this.selectedRowIndex !== record.index) ? [record.index] :
6856
- this.grid.selectionModule.selectedRowIndexes;
6857
- }
6858
6853
  this.grid.setRowData(key, rowData);
6859
6854
  var visibleRecords = this.getVisibleRecords();
6860
6855
  if (visibleRecords.length > 0 && key === (visibleRecords[visibleRecords.length - 1])["" + primaryKey]) {
@@ -11867,11 +11862,22 @@ var ExcelExport = /** @__PURE__ @class */ (function () {
11867
11862
  var query = new Query();
11868
11863
  if (!_this.isLocal()) {
11869
11864
  query = _this.generateQuery(query);
11870
- query.queries = _this.parent.grid.getDataModule().generateQuery().queries;
11871
- query = ExportHelper.getQuery(_this.parent.grid, data);
11872
- if (isNullOrUndefined(_this.parent.filterModule)) {
11873
- query.queries = query.queries.slice(1, 2);
11874
- query.params = query.params.slice(0, 0);
11865
+ var hasFilter = _this.parent.grid.filterSettings &&
11866
+ Array.isArray(_this.parent.grid.filterSettings.columns) &&
11867
+ _this.parent.grid.filterSettings.columns.length > 0;
11868
+ var hasSearch = _this.parent.grid.searchSettings &&
11869
+ typeof _this.parent.grid.searchSettings.key === 'string' &&
11870
+ _this.parent.grid.searchSettings.key.trim().length > 0;
11871
+ var hasSorting = _this.parent.grid.sortSettings &&
11872
+ Array.isArray(_this.parent.grid.sortSettings.columns) &&
11873
+ _this.parent.grid.sortSettings.columns.length > 0;
11874
+ if (hasFilter || hasSearch || hasSorting) {
11875
+ query.queries = _this.parent.grid.getDataModule().generateQuery().queries;
11876
+ query = ExportHelper.getQuery(_this.parent.grid, data);
11877
+ if (isNullOrUndefined(_this.parent.filterModule)) {
11878
+ query.queries = query.queries.slice(1, 2);
11879
+ query.params = query.params.slice(0, 0);
11880
+ }
11875
11881
  }
11876
11882
  setValue('query', query, property);
11877
11883
  }
@@ -11908,11 +11914,30 @@ var ExcelExport = /** @__PURE__ @class */ (function () {
11908
11914
  return query;
11909
11915
  };
11910
11916
  ExcelExport.prototype.manipulateExportProperties = function (property, dtSrc, queryResult) {
11917
+ var _this = this;
11911
11918
  //count not required for this query
11912
11919
  var args = Object();
11913
11920
  if (!isNullOrUndefined(this.parent.grid.getDataModule())) {
11914
11921
  setValue('query', this.parent.grid.getDataModule().generateQuery(true), args);
11915
11922
  }
11923
+ if (!this.isLocal() && !isNullOrUndefined(property) &&
11924
+ !isNullOrUndefined(property.isCollapsedStatePersist) &&
11925
+ property.isCollapsedStatePersist === false) {
11926
+ if (args.query && args.query.queries && args.query.queries.length) {
11927
+ args.query.queries = args.query.queries.filter(function (q) {
11928
+ if (q.fn === 'onWhere' && q.e) {
11929
+ var preds = q.e;
11930
+ if (preds && preds.field === _this.parent.parentIdMapping && (preds.value === null || preds.value === 'null')) {
11931
+ return false;
11932
+ }
11933
+ }
11934
+ return true;
11935
+ });
11936
+ }
11937
+ if (args.query && args.query.params && args.query.params.length) {
11938
+ args.query.params = args.query.params.filter(function (param) { return param.key !== 'IdMapping'; });
11939
+ }
11940
+ }
11916
11941
  setValue('isExport', true, args);
11917
11942
  if (!isNullOrUndefined(property) && !isNullOrUndefined(property.exportType)) {
11918
11943
  setValue('exportType', property.exportType, args);
@@ -12128,7 +12153,7 @@ var PdfExport = /** @__PURE__ @class */ (function () {
12128
12153
  };
12129
12154
  PdfExport.prototype.manipulatePdfProperties = function (prop, dtSrc, queryResult) {
12130
12155
  var _this = this;
12131
- var args = {};
12156
+ var args = Object();
12132
12157
  //count not required for this query
12133
12158
  var isLocal = !isRemoteData(this.parent) && isOffline(this.parent);
12134
12159
  setValue('query', this.parent.grid.getDataModule().generateQuery(true), args);
@@ -15873,6 +15898,9 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
15873
15898
  (this.parent.pageSettings.pageSize / 2) && (this.endIndex - nextSetResIndex) < (this.parent.pageSettings.pageSize / 2)) {
15874
15899
  this.startIndex = lastIndex - (this.parent.pageSettings.pageSize / 2);
15875
15900
  }
15901
+ if (this.totalRecords < this.parent.pageSettings.pageSize) {
15902
+ this.startIndex = 0;
15903
+ }
15876
15904
  if (scrollArgs.offset.top > (rowHeight * this.totalRecords)) {
15877
15905
  this.translateY = this.getTranslateY(scrollArgs.offset.top, content.getBoundingClientRect().height);
15878
15906
  }