@syncfusion/ej2-treegrid 32.2.3 → 32.2.7

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.3
3
+ * version : 32.2.7
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.3",
3
+ "version": "32.2.7",
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.6",
12
12
  "@syncfusion/ej2-data": "~32.2.3",
13
- "@syncfusion/ej2-grids": "~32.2.3",
14
- "@syncfusion/ej2-popups": "~32.2.3"
13
+ "@syncfusion/ej2-grids": "~32.2.7",
14
+ "@syncfusion/ej2-popups": "~32.2.7"
15
15
  },
16
16
  "devDependencies": {},
17
17
  "keywords": [
@@ -228,7 +228,7 @@ var BatchEdit = /** @class */ (function () {
228
228
  return;
229
229
  }
230
230
  if (this.parent.editModule['isAddedRowByMethod'] && !isNullOrUndefined(this.parent.editModule['addRowIndex']) &&
231
- !this.parent.editModule['isAddedRowByContextMenu'] && (this.parent.grid.selectedRowIndex === -1 || this.parent.editModule['batchEditModule'].isAdd)) {
231
+ !this.parent.editModule['isAddedRowByContextMenu'] && (this.parent.editModule['selectedIndex'] >= 0 || this.parent.editModule['batchEditModule'].isAdd)) {
232
232
  this.selectedIndex = this.parent.editModule['selectedIndex'];
233
233
  this.addRowIndex = this.parent.editModule['addRowIndex'];
234
234
  this.addRowRecord = this.batchRecords.length ? this.batchRecords[this.selectedIndex]
@@ -603,6 +603,9 @@ var BatchEdit = /** @class */ (function () {
603
603
  if (this.parent.editModule['isAddedRowByContextMenu']) {
604
604
  this.parent.editModule['isAddedRowByContextMenu'] = false;
605
605
  }
606
+ if (this.parent.editModule['isAddedRowByMethod']) {
607
+ this.parent.editModule['isAddedRowByMethod'] = false;
608
+ }
606
609
  };
607
610
  BatchEdit.prototype.getActualRowObjectIndex = function (index) {
608
611
  var rows = this.parent.grid.getDataRows();
@@ -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) {
125
+ var _this = this;
112
126
  var args = {};
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') {
@@ -2598,6 +2582,11 @@ var TreeGrid = /** @class */ (function (_super) {
2598
2582
  rowData.hasChildRecords = record.hasChildRecords;
2599
2583
  rowData.parentUniqueID = record.parentUniqueID;
2600
2584
  rowData.expanded = record.expanded;
2585
+ if (this.enableVirtualization) {
2586
+ this.grid.selectionModule.selectedRowIndexes = this.grid.selectionModule.selectedRowIndexes.indexOf(record.index) === -1
2587
+ && (this.selectedRowIndex >= 0 && this.selectedRowIndex !== record.index) ? [record.index] :
2588
+ this.grid.selectionModule.selectedRowIndexes;
2589
+ }
2601
2590
  this.grid.setRowData(key, rowData);
2602
2591
  var visibleRecords = this.getVisibleRecords();
2603
2592
  if (visibleRecords.length > 0 && key === (visibleRecords[visibleRecords.length - 1])["" + primaryKey]) {