@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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 32.2.4
3
+ * version : 32.2.9
4
4
  * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-treegrid",
3
- "version": "32.2.4",
3
+ "version": "32.2.9",
4
4
  "description": "Essential JS 2 TreeGrid Component",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -8,10 +8,10 @@
8
8
  "module": "./index.js",
9
9
  "es2015": "./dist/es6/ej2-treegrid.es5.js",
10
10
  "dependencies": {
11
- "@syncfusion/ej2-base": "~32.2.3",
11
+ "@syncfusion/ej2-base": "~32.2.9",
12
12
  "@syncfusion/ej2-data": "~32.2.3",
13
- "@syncfusion/ej2-grids": "~32.2.3",
14
- "@syncfusion/ej2-popups": "~32.2.4"
13
+ "@syncfusion/ej2-grids": "~32.2.9",
14
+ "@syncfusion/ej2-popups": "~32.2.8"
15
15
  },
16
16
  "devDependencies": {},
17
17
  "keywords": [
@@ -95,11 +95,22 @@ var ExcelExport = /** @class */ (function () {
95
95
  var query = new Query();
96
96
  if (!_this.isLocal()) {
97
97
  query = _this.generateQuery(query);
98
- query.queries = _this.parent.grid.getDataModule().generateQuery().queries;
99
- query = ExportHelper.getQuery(_this.parent.grid, data);
100
- if (isNullOrUndefined(_this.parent.filterModule)) {
101
- query.queries = query.queries.slice(1, 2);
102
- query.params = query.params.slice(0, 0);
98
+ var hasFilter = _this.parent.grid.filterSettings &&
99
+ Array.isArray(_this.parent.grid.filterSettings.columns) &&
100
+ _this.parent.grid.filterSettings.columns.length > 0;
101
+ var hasSearch = _this.parent.grid.searchSettings &&
102
+ typeof _this.parent.grid.searchSettings.key === 'string' &&
103
+ _this.parent.grid.searchSettings.key.trim().length > 0;
104
+ var hasSorting = _this.parent.grid.sortSettings &&
105
+ Array.isArray(_this.parent.grid.sortSettings.columns) &&
106
+ _this.parent.grid.sortSettings.columns.length > 0;
107
+ if (hasFilter || hasSearch || hasSorting) {
108
+ query.queries = _this.parent.grid.getDataModule().generateQuery().queries;
109
+ query = ExportHelper.getQuery(_this.parent.grid, data);
110
+ if (isNullOrUndefined(_this.parent.filterModule)) {
111
+ query.queries = query.queries.slice(1, 2);
112
+ query.params = query.params.slice(0, 0);
113
+ }
103
114
  }
104
115
  setValue('query', query, property);
105
116
  }
@@ -136,11 +147,30 @@ var ExcelExport = /** @class */ (function () {
136
147
  return query;
137
148
  };
138
149
  ExcelExport.prototype.manipulateExportProperties = function (property, dtSrc, queryResult) {
150
+ var _this = this;
139
151
  //count not required for this query
140
152
  var args = Object();
141
153
  if (!isNullOrUndefined(this.parent.grid.getDataModule())) {
142
154
  setValue('query', this.parent.grid.getDataModule().generateQuery(true), args);
143
155
  }
156
+ if (!this.isLocal() && !isNullOrUndefined(property) &&
157
+ !isNullOrUndefined(property.isCollapsedStatePersist) &&
158
+ property.isCollapsedStatePersist === false) {
159
+ if (args.query && args.query.queries && args.query.queries.length) {
160
+ args.query.queries = args.query.queries.filter(function (q) {
161
+ if (q.fn === 'onWhere' && q.e) {
162
+ var preds = q.e;
163
+ if (preds && preds.field === _this.parent.parentIdMapping && (preds.value === null || preds.value === 'null')) {
164
+ return false;
165
+ }
166
+ }
167
+ return true;
168
+ });
169
+ }
170
+ if (args.query && args.query.params && args.query.params.length) {
171
+ args.query.params = args.query.params.filter(function (param) { return param.key !== 'IdMapping'; });
172
+ }
173
+ }
144
174
  setValue('isExport', true, args);
145
175
  if (!isNullOrUndefined(property) && !isNullOrUndefined(property.exportType)) {
146
176
  setValue('exportType', property.exportType, args);
@@ -10,6 +10,7 @@ import { Query } from '@syncfusion/ej2-data';
10
10
  export declare class PdfExport {
11
11
  private parent;
12
12
  private dataResults;
13
+ private isCollapsedStatePersist;
13
14
  /**
14
15
  * Constructor for PDF export module
15
16
  *
@@ -15,6 +15,7 @@ var PdfExport = /** @class */ (function () {
15
15
  * @param {TreeGrid} parent - Tree Grid instance
16
16
  */
17
17
  function PdfExport(parent) {
18
+ this.isCollapsedStatePersist = false;
18
19
  Grid.Inject(GridPdf);
19
20
  this.parent = parent;
20
21
  this.dataResults = {};
@@ -68,6 +69,18 @@ var PdfExport = /** @class */ (function () {
68
69
  var prop = Object();
69
70
  var isLocal = !isRemoteData(this.parent) && isOffline(this.parent);
70
71
  setValue('cancel', false, prop);
72
+ if (!isNullOrUndefined(pdfExportProperties)) {
73
+ this.isCollapsedStatePersist = pdfExportProperties.isCollapsedStatePersist;
74
+ }
75
+ if (!isNullOrUndefined(pdfExportProperties)) {
76
+ if (!isLocal && !isNullOrUndefined(pdfExportProperties.dataSource) && !pdfExportProperties.dataSource['dataSource']) {
77
+ return this.parent.grid.pdfExportModule.Map(this.parent.grid, pdfExportProperties, isMultipleExport, pdfDoc, isBlob);
78
+ }
79
+ if (pdfExportProperties.exportType === 'CurrentPage') {
80
+ pdfExportProperties.dataSource = this.parent.getCurrentViewRecords();
81
+ return this.parent.grid.pdfExportModule.Map(this.parent.grid, pdfExportProperties, isMultipleExport, pdfDoc, isBlob);
82
+ }
83
+ }
71
84
  return new Promise(function (resolve) {
72
85
  var dm = isLocal && !(dtSrc instanceof DataManager) ? new DataManager(dtSrc)
73
86
  : _this.parent.dataSource;
@@ -109,10 +122,28 @@ var PdfExport = /** @class */ (function () {
109
122
  return query;
110
123
  };
111
124
  PdfExport.prototype.manipulatePdfProperties = function (prop, dtSrc, queryResult) {
112
- var args = {};
125
+ var _this = this;
126
+ var args = Object();
113
127
  //count not required for this query
114
128
  var isLocal = !isRemoteData(this.parent) && isOffline(this.parent);
115
129
  setValue('query', this.parent.grid.getDataModule().generateQuery(true), args);
130
+ if (!isLocal && !isNullOrUndefined(prop) && !isNullOrUndefined(prop.isCollapsedStatePersist)
131
+ && prop.isCollapsedStatePersist === false) {
132
+ if (args.query && args.query.queries && args.query.queries.length) {
133
+ args.query.queries = args.query.queries.filter(function (q) {
134
+ if (q.fn === 'onWhere' && q.e) {
135
+ var preds = q.e;
136
+ if (preds && preds.field === _this.parent.parentIdMapping && (preds.value === null || preds.value === 'null')) {
137
+ return false;
138
+ }
139
+ }
140
+ return true;
141
+ });
142
+ }
143
+ if (args.query && args.query.params && args.query.params.length) {
144
+ args.query.params = args.query.params.filter(function (param) { return param.key !== 'IdMapping'; });
145
+ }
146
+ }
116
147
  setValue('isExport', true, args);
117
148
  setValue('isPdfExport', true, args);
118
149
  if (!isNullOrUndefined(prop) && !isNullOrUndefined(prop.isCollapsedStatePersist)) {
@@ -6,6 +6,7 @@ import { SortDirection } from '@syncfusion/ej2-grids';
6
6
  * @hidden
7
7
  */
8
8
  export declare class Sort {
9
+ sortedResult: Object[];
9
10
  private flatSortedData;
10
11
  private taskIds;
11
12
  private storedIndex;
@@ -50,6 +50,12 @@ var Sort = /** @class */ (function () {
50
50
  this.iterateSort(data, srtQry);
51
51
  this.storedIndex = -1;
52
52
  sortParams.modifiedData = this.flatSortedData;
53
+ if (srtQry.queries.filter(function (q) { return q.fn === 'onSortBy'; }).length > 0) {
54
+ this.sortedResult = this.flatSortedData.filter(function (item) { return !item.isSummaryRow; });
55
+ }
56
+ else {
57
+ this.sortedResult = [];
58
+ }
53
59
  this.flatSortedData = [];
54
60
  };
55
61
  Sort.prototype.iterateSort = function (data, srtQry) {
@@ -1583,23 +1583,7 @@ var TreeGrid = /** @class */ (function (_super) {
1583
1583
  if (args.requestType === 'save' && _this.aggregates.map(function (ag) { return ag.showChildSummary === true; }).length) {
1584
1584
  _this.grid.refresh();
1585
1585
  }
1586
- if (args.action === 'filter') {
1587
- if (!args.isCollapseMaintain && _this.filterModule['currentFilterObject'] !== '' && _this.enableVirtualization && !_this.initialRender && !_this.expandStateMapping && !(isRemoteData(_this) && _this.enableVirtualization)) {
1588
- _this.expandAll();
1589
- }
1590
- }
1591
- if (args.requestType === 'searching') {
1592
- if (!args.isCollapseMaintain && _this.searchSettings.key !== '' && _this.enableVirtualization && !_this.initialRender && !_this.expandStateMapping && !(isRemoteData(_this) && _this.enableVirtualization)) {
1593
- _this.expandAll();
1594
- }
1595
- }
1596
- if (args.action === 'clearFilter' && _this.enableCollapseAll) {
1597
- _this.collapseAll();
1598
- }
1599
- if (args.action === 'clearFilter' && _this.enableInfiniteScrolling) {
1600
- _this.expandAll();
1601
- }
1602
- if (args.requestType === 'sorting' && _this.enableInfiniteScrolling) {
1586
+ if ((args.action === 'clearFilter' || args.action === 'clear-filter' || args.requestType === 'sorting') && _this.enableInfiniteScrolling) {
1603
1587
  _this.expandAll();
1604
1588
  }
1605
1589
  if (_this.action === 'indenting' || _this.action === 'outdenting') {
@@ -787,6 +787,9 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
787
787
  (this.parent.pageSettings.pageSize / 2) && (this.endIndex - nextSetResIndex) < (this.parent.pageSettings.pageSize / 2)) {
788
788
  this.startIndex = lastIndex - (this.parent.pageSettings.pageSize / 2);
789
789
  }
790
+ if (this.totalRecords < this.parent.pageSettings.pageSize) {
791
+ this.startIndex = 0;
792
+ }
790
793
  if (scrollArgs.offset.top > (rowHeight * this.totalRecords)) {
791
794
  this.translateY = this.getTranslateY(scrollArgs.offset.top, content.getBoundingClientRect().height);
792
795
  }