@syncfusion/ej2-treegrid 26.2.8 → 26.2.10

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 : 26.2.8
3
+ * version : 26.2.10
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. 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,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-treegrid@*",
3
- "_id": "@syncfusion/ej2-treegrid@26.2.5",
3
+ "_id": "@syncfusion/ej2-treegrid@26.2.9",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-SbqItsn2WUqCY7wylqfKsT7CrQAMvcvOVg8fUxvlvaoLrY+WfKJilARHRfRsOgVCZd45ouHOhClP3BDqhgNZuA==",
5
+ "_integrity": "sha512-sZpmBjfiblJpSR/xujnXOM5x8uSx+l1ql4v13nTnls8uxKrYXqjRD5QnDxGag1D9Dyzh3pcOEGQygRG/ida/NQ==",
6
6
  "_location": "/@syncfusion/ej2-treegrid",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -24,8 +24,8 @@
24
24
  "/@syncfusion/ej2-react-treegrid",
25
25
  "/@syncfusion/ej2-vue-treegrid"
26
26
  ],
27
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-26.2.5.tgz",
28
- "_shasum": "ce6e6979b443ce1f1031368a9280d8b3a7819bfb",
27
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-26.2.9.tgz",
28
+ "_shasum": "3a23a5e660312b2fb62e5fb19e12f001b4450cf6",
29
29
  "_spec": "@syncfusion/ej2-treegrid@*",
30
30
  "_where": "/jenkins/workspace/elease-automation_release_26.1.1/packages/included",
31
31
  "author": {
@@ -36,10 +36,10 @@
36
36
  },
37
37
  "bundleDependencies": false,
38
38
  "dependencies": {
39
- "@syncfusion/ej2-base": "~26.2.5",
40
- "@syncfusion/ej2-data": "~26.2.5",
41
- "@syncfusion/ej2-grids": "~26.2.8",
42
- "@syncfusion/ej2-popups": "~26.2.8"
39
+ "@syncfusion/ej2-base": "~26.2.10",
40
+ "@syncfusion/ej2-data": "~26.2.10",
41
+ "@syncfusion/ej2-grids": "~26.2.10",
42
+ "@syncfusion/ej2-popups": "~26.2.10"
43
43
  },
44
44
  "deprecated": false,
45
45
  "description": "Essential JS 2 TreeGrid Component",
@@ -76,6 +76,6 @@
76
76
  "url": "git+https://github.com/syncfusion/ej2-treegrid.git"
77
77
  },
78
78
  "typings": "index.d.ts",
79
- "version": "26.2.8",
79
+ "version": "26.2.10",
80
80
  "sideEffects": false
81
81
  }
@@ -712,7 +712,7 @@ var RowDD = /** @class */ (function () {
712
712
  this.canDrop = false;
713
713
  this.addErrorElem();
714
714
  }
715
- if (!tObj.rowDropSettings.targetID && this.canDrop) {
715
+ if (!tObj.rowDropSettings.targetID && this.canDrop && !isNullOrUndefined(args.rows[0])) {
716
716
  tObj.rowDragAndDropModule.updateIcon(args.rows, rowIdx, args);
717
717
  }
718
718
  if (isNullOrUndefined(tObj.rowDropSettings.targetID) && !this.canDrop) {
@@ -33,6 +33,7 @@ var VirtualScroll = /** @class */ (function () {
33
33
  function VirtualScroll(parent) {
34
34
  this.prevstartIndex = -1;
35
35
  this.prevendIndex = -1;
36
+ this.prevSelectedRecord = [];
36
37
  this.parent = parent;
37
38
  Grid.Inject(TreeVirtual);
38
39
  this.addEventListener();
@@ -163,7 +164,8 @@ var VirtualScroll = /** @class */ (function () {
163
164
  }
164
165
  }
165
166
  //}
166
- if (this.prevrequestType === 'collapseAll' && pageingDetails.actionArgs.requestType === 'virtualscroll' && !isNullOrUndefined(this.parent.idMapping)) {
167
+ if (this.prevrequestType === 'collapseAll' && pageingDetails.actionArgs.requestType === 'virtualscroll'
168
+ && !isNullOrUndefined(this.parent.idMapping) && startIndex === 0) {
167
169
  startIndex = 0;
168
170
  endIndex = this.parent.grid.pageSettings.pageSize - 1;
169
171
  this.parent.grid.notify(events.virtualActionArgs, { setTop: true });
@@ -1210,6 +1210,16 @@ var TreeGrid = /** @class */ (function (_super) {
1210
1210
  _this.grid.selectionModule["" + updateRowSelection](_this.getRows()[parseInt(index.toString(), 10)], index);
1211
1211
  }
1212
1212
  }
1213
+ if (_this.enableVirtualization && _this.selectionSettings.persistSelection
1214
+ && !isNullOrUndefined(_this.virtualScrollModule.prevSelectedRecord)) {
1215
+ for (var i = 0; i < _this.virtualScrollModule.prevSelectedRecord.length; i++) {
1216
+ var updateRowSelection = 'updateRowSelection';
1217
+ var index =
1218
+ // eslint-disable-next-line max-len
1219
+ _this.getCurrentViewRecords().indexOf(_this.virtualScrollModule.prevSelectedRecord[parseInt(i.toString(), 10)]);
1220
+ _this.grid.selectionModule["" + updateRowSelection](_this.getRows()[parseInt(index.toString(), 10)], index);
1221
+ }
1222
+ }
1213
1223
  _this.trigger(events.dataBound, args);
1214
1224
  _this.initialRender = false;
1215
1225
  };
@@ -3010,22 +3020,13 @@ var TreeGrid = /** @class */ (function (_super) {
3010
3020
  expandArgs = { data: parentRec, row: row };
3011
3021
  this.trigger(events.expanded, expandArgs);
3012
3022
  }
3023
+ else if (!this.isExpandAll && this.enableVirtualization && this.selectionSettings.persistSelection
3024
+ && !isNullOrUndefined(this.virtualScrollModule.prevSelectedRecord)) {
3025
+ this.virtualScrollModule.prevSelectedRecord = [];
3026
+ }
3013
3027
  else if (!this.isExpandAll) {
3014
3028
  this.trigger(events.expanded, expandArgs);
3015
3029
  }
3016
- if (record.expanded && this.enableVirtualization && this.selectionSettings.persistSelection
3017
- && !isNullOrUndefined(this.virtualScrollModule.prevSelectedRecord)) {
3018
- for (var i = 0; i < this.virtualScrollModule.prevSelectedRecord.length; i++) {
3019
- if (record.uniqueID ===
3020
- this.virtualScrollModule.prevSelectedRecord[parseInt(i.toString(), 10)].parentItem.uniqueID) {
3021
- var updateRowSelection = 'updateRowSelection';
3022
- var index =
3023
- // eslint-disable-next-line max-len
3024
- this.getCurrentViewRecords().indexOf(this.virtualScrollModule.prevSelectedRecord[parseInt(i.toString(), 10)]);
3025
- this.grid.selectionModule["" + updateRowSelection](this.getRows()[parseInt(index.toString(), 10)], index);
3026
- }
3027
- }
3028
- }
3029
3030
  }
3030
3031
  };
3031
3032
  TreeGrid.prototype.expandCollapseAllChildren = function (record, action, key, level) {
@@ -387,14 +387,17 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
387
387
  var info = scrollArgs.sentinel;
388
388
  var rowHeight = this.parent.getRowHeight();
389
389
  var outBuffer = this.parent.pageSettings.pageSize - Math.ceil(this.parent.pageSettings.pageSize / 2);
390
- var content = this.parent.getContent().querySelector('.e-content');
390
+ var content;
391
+ if (!isNullOrUndefined(this.parent.contentModule)) {
392
+ content = this.parent.getContent().querySelector('.e-content');
393
+ }
391
394
  var scrollHeight = outBuffer * rowHeight;
392
395
  var upScroll = (scrollArgs.offset.top - this.translateY) <= 0;
393
396
  var downScroll = Math.ceil(scrollArgs.offset.top - this.translateY) + rowHeight >= scrollHeight;
394
397
  var selectedRowIndex = 'selectedRowIndex';
395
398
  var currentViewData = this.parent.currentViewData;
396
399
  var indexValue = 'index';
397
- if (upScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {
400
+ if (upScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') && !isNullOrUndefined(content)) {
398
401
  var vHeight = +(this.parent.height.toString().indexOf('%') < 0 ? parseInt(this.parent.height.toString(), 10) :
399
402
  this.parent.element.getBoundingClientRect().height);
400
403
  var index = (~~(content.scrollTop / rowHeight)
@@ -442,7 +445,7 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
442
445
  scrollArgs.offset.top - (outBuffer * rowHeight) + 10 : 0;
443
446
  }
444
447
  }
445
- else if (downScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {
448
+ else if (downScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') && !isNullOrUndefined(content)) {
446
449
  var nextSetResIndex = ~~(content.scrollTop / rowHeight);
447
450
  var isLastBlock = (this["" + selectedRowIndex] + this.parent.pageSettings.pageSize) < this.totalRecords ? false : true;
448
451
  if (!isNullOrUndefined(this["" + selectedRowIndex]) && this["" + selectedRowIndex] !== -1 &&