@syncfusion/ej2-treegrid 35.1.37 → 35.1.46

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 : 35.1.37
3
+ * version : 35.1.46
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": "35.1.37",
3
+ "version": "35.1.46",
4
4
  "description": "Essential JS 2 TreeGrid Component",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -10,8 +10,8 @@
10
10
  "dependencies": {
11
11
  "@syncfusion/ej2-base": "~35.1.37",
12
12
  "@syncfusion/ej2-data": "~35.1.37",
13
- "@syncfusion/ej2-grids": "~35.1.37",
14
- "@syncfusion/ej2-popups": "~35.1.37"
13
+ "@syncfusion/ej2-grids": "~35.1.42",
14
+ "@syncfusion/ej2-popups": "~35.1.42"
15
15
  },
16
16
  "devDependencies": {},
17
17
  "keywords": [
@@ -10,6 +10,10 @@ export declare class DomVirtualization {
10
10
  private parent;
11
11
  private locator;
12
12
  private visualData;
13
+ /** @hidden */
14
+ startIndex: number;
15
+ /** @hidden */
16
+ endIndex: number;
13
17
  /**
14
18
  * Constructor for DomVirtualization module
15
19
  *
@@ -51,6 +55,7 @@ export declare class DomVirtualization {
51
55
  * @returns {void} No return value as the function executes a procedure.
52
56
  */
53
57
  private collapseExpandVirtualchilds;
58
+ private updateCurrentDomVirtualRecords;
54
59
  destroy(): void;
55
60
  }
56
61
  export declare class DomVirtualTreeExtension extends GridDomVirtualization {
@@ -32,6 +32,10 @@ var DomVirtualization = /** @class */ (function () {
32
32
  * @param {ServiceLocator} locator - Service locator for dependency injection
33
33
  */
34
34
  function DomVirtualization(parent, locator) {
35
+ /** @hidden */
36
+ this.startIndex = -1;
37
+ /** @hidden */
38
+ this.endIndex = -1;
35
39
  initializeTelemetryFeature('DomVirtualization', 'TreeGrid');
36
40
  this.parent = parent;
37
41
  this.locator = locator;
@@ -52,6 +56,7 @@ var DomVirtualization = /** @class */ (function () {
52
56
  this.parent.on(destroy, this.destroy, this);
53
57
  this.parent.on(events.virtualExpandCollapse, this.collapseExpandVirtualchilds, this);
54
58
  this.parent.on(events.pagingActions, this.virtualPageAction, this);
59
+ this.parent.grid.on(events.beforeDomVirtualRenderRows, this.updateCurrentDomVirtualRecords, this);
55
60
  };
56
61
  /**
57
62
  * @hidden
@@ -64,6 +69,7 @@ var DomVirtualization = /** @class */ (function () {
64
69
  this.parent.off(destroy, this.destroy);
65
70
  this.parent.off(events.virtualExpandCollapse, this.collapseExpandVirtualchilds);
66
71
  this.parent.off(events.pagingActions, this.virtualPageAction);
72
+ this.parent.grid.off(events.beforeDomVirtualRenderRows, this.updateCurrentDomVirtualRecords);
67
73
  };
68
74
  /**
69
75
  * Handles the action related to virtual scrolling with paging details.
@@ -207,6 +213,11 @@ var DomVirtualization = /** @class */ (function () {
207
213
  };
208
214
  getValue('grid.renderModule', this.parent).dataManagerSuccess(actionDetails, { requestType: 'refresh' });
209
215
  };
216
+ DomVirtualization.prototype.updateCurrentDomVirtualRecords = function (args) {
217
+ this.startIndex = args.startIndex;
218
+ this.endIndex = args.endIndex;
219
+ this.parent.currentDomVirtualRecords = this.parent.virtualDomScrollData.slice(this.startIndex, this.endIndex);
220
+ };
210
221
  DomVirtualization.prototype.destroy = function () {
211
222
  this.removeEventListener();
212
223
  };
@@ -210,7 +210,7 @@ var Selection = /** @class */ (function () {
210
210
  var headerElement = this.parent.getHeaderContent().querySelectorAll('.e-headercelldiv')[this.columnIndex];
211
211
  if (headerElement && headerElement.querySelectorAll('.e-treeselectall').length === 0) {
212
212
  var value = false; // Initial state can be false.
213
- var rowChkBox = this.parent.createElement('input', { className: 'e-treeselectall', attrs: { 'type': 'checkbox' } });
213
+ var rowChkBox = this.parent.createElement('input', { className: 'e-treeselectall', attrs: { 'type': 'checkbox', 'aria-label': 'Select all checkbox' } });
214
214
  var checkWrap = createCheckBox(this.parent.createElement, false, { checked: value, label: ' ' });
215
215
  headerElement.classList.add('e-headerchkcelldiv');
216
216
  checkWrap.classList.add('e-hierarchycheckbox');
@@ -53,11 +53,25 @@ var Aggregate = /** @class */ (function () {
53
53
  var childRecordsLength;
54
54
  var columns = this.parent.getColumns();
55
55
  if (this.parent.aggregates.filter(function (x) { return x.showChildSummary; }).length) {
56
- for (var i = 0, len = dataLength; i < len; i++) {
56
+ var _loop_1 = function (i, len) {
57
57
  parentRecord = parentRecords[parseInt(i.toString(), 10)];
58
- childRecordsLength = this.getChildRecordsLength(parentRecord, flatRecords);
58
+ childRecordsLength = this_1.getChildRecordsLength(parentRecord, flatRecords);
59
59
  if (childRecordsLength) {
60
- var _loop_1 = function (summaryRowIndex, len_1) {
60
+ var childRecords_1 = getObject('childRecords', parentRecord) || [];
61
+ var existingSummaryRows = childRecords_1.filter(function (e) {
62
+ return getObject('isSummaryRow', e) && getObject('parentUniqueID', e) === parentRecord.uniqueID;
63
+ });
64
+ existingSummaryRows.forEach(function (summaryRow) {
65
+ var summaryIndex = flatRecords.indexOf(summaryRow);
66
+ if (summaryIndex !== -1) {
67
+ flatRecords.splice(summaryIndex, 1);
68
+ }
69
+ var childSummaryIndex = childRecords_1.indexOf(summaryRow);
70
+ if (childSummaryIndex !== -1) {
71
+ childRecords_1.splice(childSummaryIndex, 1);
72
+ }
73
+ });
74
+ var _loop_2 = function (summaryRowIndex, len_1) {
61
75
  var item = void 0;
62
76
  item = {};
63
77
  for (var i_1 = 0; i_1 < columns.length; i_1++) {
@@ -84,9 +98,8 @@ var Aggregate = /** @class */ (function () {
84
98
  setValue('isSummaryRow', true, item);
85
99
  setValue('parentUniqueID', summaryParent.uniqueID, item);
86
100
  if (isSort) {
87
- var childRecords = getObject('childRecords', parentRecord);
88
- if (childRecords.length) {
89
- childRecords.push(item);
101
+ if (childRecords_1.length) {
102
+ childRecords_1.push(item);
90
103
  }
91
104
  }
92
105
  flatRecords.splice(currentIndex, 0, item);
@@ -95,12 +108,15 @@ var Aggregate = /** @class */ (function () {
95
108
  return "continue";
96
109
  }
97
110
  };
98
- var this_1 = this;
99
111
  for (var summaryRowIndex = 1, len_1 = summaryLength; summaryRowIndex <= len_1; summaryRowIndex++) {
100
- _loop_1(summaryRowIndex, len_1);
112
+ _loop_2(summaryRowIndex, len_1);
101
113
  }
102
- this.flatChildRecords = [];
114
+ this_1.flatChildRecords = [];
103
115
  }
116
+ };
117
+ var this_1 = this;
118
+ for (var i = 0, len = dataLength; i < len; i++) {
119
+ _loop_1(i, len);
104
120
  }
105
121
  }
106
122
  else {
@@ -162,3 +162,5 @@ export declare const actionFailure: string;
162
162
  export declare const collapseActionComplete: string;
163
163
  /** @hidden */
164
164
  export declare const hierarchyCheckstateUpdate: string;
165
+ /** @hidden */
166
+ export declare const beforeDomVirtualRenderRows: string;
@@ -162,3 +162,5 @@ export var actionFailure = 'actionFailure';
162
162
  export var collapseActionComplete = 'collapseActionComplete';
163
163
  /** @hidden */
164
164
  export var hierarchyCheckstateUpdate = 'hierarchy-checkstate-update';
165
+ /** @hidden */
166
+ export var beforeDomVirtualRenderRows = 'before-dom-virtual-rows-render';
@@ -142,6 +142,8 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
142
142
  /** @hidden */
143
143
  virtualDomScrollData: Object[];
144
144
  /** @hidden */
145
+ currentDomVirtualRecords: ITreeData[];
146
+ /** @hidden */
145
147
  private remoteCollapsedData;
146
148
  /** @hidden */
147
149
  private remoteExpandedData;