@syncfusion/ej2-treegrid 32.2.4 → 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.
@@ -5851,23 +5851,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5851
5851
  if (args.requestType === 'save' && _this.aggregates.map(function (ag) { return ag.showChildSummary === true; }).length) {
5852
5852
  _this.grid.refresh();
5853
5853
  }
5854
- if (args.action === 'filter') {
5855
- if (!args.isCollapseMaintain && _this.filterModule['currentFilterObject'] !== '' && _this.enableVirtualization && !_this.initialRender && !_this.expandStateMapping && !(isRemoteData(_this) && _this.enableVirtualization)) {
5856
- _this.expandAll();
5857
- }
5858
- }
5859
- if (args.requestType === 'searching') {
5860
- if (!args.isCollapseMaintain && _this.searchSettings.key !== '' && _this.enableVirtualization && !_this.initialRender && !_this.expandStateMapping && !(isRemoteData(_this) && _this.enableVirtualization)) {
5861
- _this.expandAll();
5862
- }
5863
- }
5864
- if (args.action === 'clearFilter' && _this.enableCollapseAll) {
5865
- _this.collapseAll();
5866
- }
5867
- if (args.action === 'clearFilter' && _this.enableInfiniteScrolling) {
5868
- _this.expandAll();
5869
- }
5870
- if (args.requestType === 'sorting' && _this.enableInfiniteScrolling) {
5854
+ if ((args.action === 'clearFilter' || args.action === 'clear-filter' || args.requestType === 'sorting') && _this.enableInfiniteScrolling) {
5871
5855
  _this.expandAll();
5872
5856
  }
5873
5857
  if (_this.action === 'indenting' || _this.action === 'outdenting') {
@@ -11878,11 +11862,22 @@ var ExcelExport = /** @__PURE__ @class */ (function () {
11878
11862
  var query = new Query();
11879
11863
  if (!_this.isLocal()) {
11880
11864
  query = _this.generateQuery(query);
11881
- query.queries = _this.parent.grid.getDataModule().generateQuery().queries;
11882
- query = ExportHelper.getQuery(_this.parent.grid, data);
11883
- if (isNullOrUndefined(_this.parent.filterModule)) {
11884
- query.queries = query.queries.slice(1, 2);
11885
- 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
+ }
11886
11881
  }
11887
11882
  setValue('query', query, property);
11888
11883
  }
@@ -11919,11 +11914,30 @@ var ExcelExport = /** @__PURE__ @class */ (function () {
11919
11914
  return query;
11920
11915
  };
11921
11916
  ExcelExport.prototype.manipulateExportProperties = function (property, dtSrc, queryResult) {
11917
+ var _this = this;
11922
11918
  //count not required for this query
11923
11919
  var args = Object();
11924
11920
  if (!isNullOrUndefined(this.parent.grid.getDataModule())) {
11925
11921
  setValue('query', this.parent.grid.getDataModule().generateQuery(true), args);
11926
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
+ }
11927
11941
  setValue('isExport', true, args);
11928
11942
  if (!isNullOrUndefined(property) && !isNullOrUndefined(property.exportType)) {
11929
11943
  setValue('exportType', property.exportType, args);
@@ -12031,6 +12045,7 @@ var PdfExport = /** @__PURE__ @class */ (function () {
12031
12045
  * @param {TreeGrid} parent - Tree Grid instance
12032
12046
  */
12033
12047
  function PdfExport(parent) {
12048
+ this.isCollapsedStatePersist = false;
12034
12049
  Grid.Inject(PdfExport$1);
12035
12050
  this.parent = parent;
12036
12051
  this.dataResults = {};
@@ -12084,6 +12099,18 @@ var PdfExport = /** @__PURE__ @class */ (function () {
12084
12099
  var prop = Object();
12085
12100
  var isLocal = !isRemoteData(this.parent) && isOffline(this.parent);
12086
12101
  setValue('cancel', false, prop);
12102
+ if (!isNullOrUndefined(pdfExportProperties)) {
12103
+ this.isCollapsedStatePersist = pdfExportProperties.isCollapsedStatePersist;
12104
+ }
12105
+ if (!isNullOrUndefined(pdfExportProperties)) {
12106
+ if (!isLocal && !isNullOrUndefined(pdfExportProperties.dataSource) && !pdfExportProperties.dataSource['dataSource']) {
12107
+ return this.parent.grid.pdfExportModule.Map(this.parent.grid, pdfExportProperties, isMultipleExport, pdfDoc, isBlob);
12108
+ }
12109
+ if (pdfExportProperties.exportType === 'CurrentPage') {
12110
+ pdfExportProperties.dataSource = this.parent.getCurrentViewRecords();
12111
+ return this.parent.grid.pdfExportModule.Map(this.parent.grid, pdfExportProperties, isMultipleExport, pdfDoc, isBlob);
12112
+ }
12113
+ }
12087
12114
  return new Promise(function (resolve) {
12088
12115
  var dm = isLocal && !(dtSrc instanceof DataManager) ? new DataManager(dtSrc)
12089
12116
  : _this.parent.dataSource;
@@ -12125,10 +12152,28 @@ var PdfExport = /** @__PURE__ @class */ (function () {
12125
12152
  return query;
12126
12153
  };
12127
12154
  PdfExport.prototype.manipulatePdfProperties = function (prop, dtSrc, queryResult) {
12128
- var args = {};
12155
+ var _this = this;
12156
+ var args = Object();
12129
12157
  //count not required for this query
12130
12158
  var isLocal = !isRemoteData(this.parent) && isOffline(this.parent);
12131
12159
  setValue('query', this.parent.grid.getDataModule().generateQuery(true), args);
12160
+ if (!isLocal && !isNullOrUndefined(prop) && !isNullOrUndefined(prop.isCollapsedStatePersist)
12161
+ && prop.isCollapsedStatePersist === false) {
12162
+ if (args.query && args.query.queries && args.query.queries.length) {
12163
+ args.query.queries = args.query.queries.filter(function (q) {
12164
+ if (q.fn === 'onWhere' && q.e) {
12165
+ var preds = q.e;
12166
+ if (preds && preds.field === _this.parent.parentIdMapping && (preds.value === null || preds.value === 'null')) {
12167
+ return false;
12168
+ }
12169
+ }
12170
+ return true;
12171
+ });
12172
+ }
12173
+ if (args.query && args.query.params && args.query.params.length) {
12174
+ args.query.params = args.query.params.filter(function (param) { return param.key !== 'IdMapping'; });
12175
+ }
12176
+ }
12132
12177
  setValue('isExport', true, args);
12133
12178
  setValue('isPdfExport', true, args);
12134
12179
  if (!isNullOrUndefined(prop) && !isNullOrUndefined(prop.isCollapsedStatePersist)) {
@@ -12833,6 +12878,12 @@ var Sort = /** @__PURE__ @class */ (function () {
12833
12878
  this.iterateSort(data, srtQry);
12834
12879
  this.storedIndex = -1;
12835
12880
  sortParams.modifiedData = this.flatSortedData;
12881
+ if (srtQry.queries.filter(function (q) { return q.fn === 'onSortBy'; }).length > 0) {
12882
+ this.sortedResult = this.flatSortedData.filter(function (item) { return !item.isSummaryRow; });
12883
+ }
12884
+ else {
12885
+ this.sortedResult = [];
12886
+ }
12836
12887
  this.flatSortedData = [];
12837
12888
  };
12838
12889
  Sort.prototype.iterateSort = function (data, srtQry) {
@@ -15847,6 +15898,9 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
15847
15898
  (this.parent.pageSettings.pageSize / 2) && (this.endIndex - nextSetResIndex) < (this.parent.pageSettings.pageSize / 2)) {
15848
15899
  this.startIndex = lastIndex - (this.parent.pageSettings.pageSize / 2);
15849
15900
  }
15901
+ if (this.totalRecords < this.parent.pageSettings.pageSize) {
15902
+ this.startIndex = 0;
15903
+ }
15850
15904
  if (scrollArgs.offset.top > (rowHeight * this.totalRecords)) {
15851
15905
  this.translateY = this.getTranslateY(scrollArgs.offset.top, content.getBoundingClientRect().height);
15852
15906
  }