@syncfusion/ej2-treegrid 19.3.57 → 19.4.42

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.
Files changed (57) hide show
  1. package/.github/PULL_REQUEST_TEMPLATE/Bug.md +60 -0
  2. package/.github/PULL_REQUEST_TEMPLATE/feature.md +37 -0
  3. package/CHANGELOG.md +12 -33
  4. package/README.md +1 -1
  5. package/dist/ej2-treegrid.umd.min.js +2 -2
  6. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  7. package/dist/es6/ej2-treegrid.es2015.js +194 -31
  8. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  9. package/dist/es6/ej2-treegrid.es5.js +200 -30
  10. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  11. package/dist/global/ej2-treegrid.min.js +2 -2
  12. package/dist/global/ej2-treegrid.min.js.map +1 -1
  13. package/dist/global/index.d.ts +1 -1
  14. package/package.json +9 -9
  15. package/src/treegrid/actions/batch-edit.js +5 -5
  16. package/src/treegrid/actions/edit.js +1 -2
  17. package/src/treegrid/actions/excel-export.js +5 -2
  18. package/src/treegrid/actions/virtual-scroll.js +4 -1
  19. package/src/treegrid/base/interface.d.ts +4 -0
  20. package/src/treegrid/base/treegrid-model.d.ts +16 -1
  21. package/src/treegrid/base/treegrid.d.ts +43 -2
  22. package/src/treegrid/base/treegrid.js +157 -20
  23. package/src/treegrid/models/column.d.ts +10 -1
  24. package/src/treegrid/models/column.js +19 -0
  25. package/src/treegrid/renderer/virtual-row-model-generator.js +8 -0
  26. package/src/treegrid/renderer/virtual-tree-content-render.js +3 -1
  27. package/styles/bootstrap-dark.css +5 -0
  28. package/styles/bootstrap.css +5 -0
  29. package/styles/bootstrap4.css +5 -0
  30. package/styles/bootstrap5-dark.css +32 -27
  31. package/styles/bootstrap5.css +32 -27
  32. package/styles/fabric-dark.css +5 -0
  33. package/styles/fabric.css +5 -0
  34. package/styles/highcontrast-light.css +5 -0
  35. package/styles/highcontrast.css +5 -0
  36. package/styles/material-dark.css +5 -0
  37. package/styles/material.css +5 -0
  38. package/styles/tailwind-dark.css +31 -26
  39. package/styles/tailwind.css +5 -0
  40. package/styles/treegrid/_bootstrap5-definition.scss +4 -4
  41. package/styles/treegrid/_fluent-definition.scss +31 -0
  42. package/styles/treegrid/_layout.scss +8 -0
  43. package/styles/treegrid/_tailwind-definition.scss +4 -4
  44. package/styles/treegrid/bootstrap-dark.css +5 -0
  45. package/styles/treegrid/bootstrap.css +5 -0
  46. package/styles/treegrid/bootstrap4.css +5 -0
  47. package/styles/treegrid/bootstrap5-dark.css +32 -27
  48. package/styles/treegrid/bootstrap5.css +32 -27
  49. package/styles/treegrid/fabric-dark.css +5 -0
  50. package/styles/treegrid/fabric.css +5 -0
  51. package/styles/treegrid/highcontrast-light.css +5 -0
  52. package/styles/treegrid/highcontrast.css +5 -0
  53. package/styles/treegrid/icons/_fluent.scss +26 -0
  54. package/styles/treegrid/material-dark.css +5 -0
  55. package/styles/treegrid/material.css +5 -0
  56. package/styles/treegrid/tailwind-dark.css +31 -26
  57. package/styles/treegrid/tailwind.css +5 -0
@@ -1,5 +1,5 @@
1
1
  import { Browser, ChildProperty, Collection, Complex, Component, Event, EventHandler, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, addClass, classList, closest, compile, createElement, debounce, extend, getEnumValue, getValue, isNullOrUndefined, merge, remove, removeClass, select, setValue } from '@syncfusion/ej2-base';
2
- import { Aggregate, Cell, CellType, Clipboard, ColumnChooser, ColumnMenu, CommandColumn, ContextMenu, DetailRow, Edit, ExcelExport, Filter, Freeze, Grid, InfiniteScroll, InterSectionObserver, Logger, Page, PdfExport, Print, RenderType, Reorder, Resize, RowDD, RowDropSettings, RowRenderer, Scroll, Sort, Toolbar, VirtualContentRenderer, VirtualHeaderRenderer, VirtualRowModelGenerator, VirtualScroll, appendChildren, calculateAggregate, detailLists, extend as extend$1, getActualProperties, getObject, getUid, iterateArrayOrObject, parentsUntil, resetRowIndex, templateCompiler } from '@syncfusion/ej2-grids';
2
+ import { Aggregate, Cell, CellRenderer, CellType, Clipboard, ColumnChooser, ColumnMenu, CommandColumn, ContextMenu, DetailRow, Edit, ExcelExport, Filter, Freeze, Grid, InfiniteScroll, InterSectionObserver, Logger, Page, PdfExport, Print, RenderType, Reorder, Resize, RowDD, RowDropSettings, RowRenderer, Scroll, Sort, Toolbar, VirtualContentRenderer, VirtualHeaderRenderer, VirtualRowModelGenerator, VirtualScroll, appendChildren, calculateAggregate, detailLists, extend as extend$1, getActualProperties, getObject, getUid, iterateArrayOrObject, parentsUntil, resetRowIndex, templateCompiler } from '@syncfusion/ej2-grids';
3
3
  import { createCheckBox } from '@syncfusion/ej2-buttons';
4
4
  import { CacheAdaptor, DataManager, DataUtil, Deferred, JsonAdaptor, ODataAdaptor, Predicate, Query, RemoteSaveAdaptor, UrlAdaptor, WebApiAdaptor, WebMethodAdaptor } from '@syncfusion/ej2-data';
5
5
  import { createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
@@ -76,6 +76,25 @@ var Column = /** @__PURE__ @class */ (function () {
76
76
  this.filter = {};
77
77
  merge(this, options);
78
78
  }
79
+ /**
80
+ * Update the State changes reflected for TreeGrid columndirective in react platform.
81
+ *
82
+ * @param {Column} column - specifies the column
83
+ * @returns {void}
84
+ * @hidden
85
+ */
86
+ Column.prototype.setProperties = function (column) {
87
+ //Angular two way binding
88
+ var keys = Object.keys(column);
89
+ for (var i = 0; i < keys.length; i++) {
90
+ this[keys[i]] = column[keys[i]];
91
+ //Refresh the react columnTemplates on state change
92
+ if (this.parent && this.parent['isReact'] && keys[i] === 'template') {
93
+ var refreshReactColumnTemplateByUid = 'refreshReactColumnTemplateByUid';
94
+ this.parent.clipboardModule['treeGridParent'][refreshReactColumnTemplateByUid](this.uid);
95
+ }
96
+ }
97
+ };
79
98
  return Column;
80
99
  }());
81
100
 
@@ -3773,6 +3792,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3773
3792
  this.grid.allowResizing = this.allowResizing;
3774
3793
  this.grid.enableHover = this.enableHover;
3775
3794
  this.grid.enableAutoFill = this.enableAutoFill;
3795
+ this.grid.enableAdaptiveUI = this.enableAdaptiveUI;
3776
3796
  this.grid.enableImmutableMode = this.enableImmutableMode;
3777
3797
  this.grid.allowRowDragAndDrop = this.allowRowDragAndDrop;
3778
3798
  this.grid.rowDropSettings = getActualProperties(this.rowDropSettings);
@@ -3822,7 +3842,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3822
3842
  _this.grid.currentViewData.length !== _this.grid.selectionModule.selectedRowIndexes.length) {
3823
3843
  var updateRowSelection = 'updateRowSelection';
3824
3844
  for (var i = 0; i < _this.getRows().length; i++) {
3825
- if (_this.getRows()[i].getElementsByClassName("e-frame e-icons e-uncheck").length) {
3845
+ if (_this.getRows()[i].getElementsByClassName('e-frame e-icons e-uncheck').length) {
3826
3846
  _this.grid.selectionModule[updateRowSelection](_this.getRows()[i], _this.getCurrentViewRecords()[i].index);
3827
3847
  }
3828
3848
  }
@@ -3937,6 +3957,16 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3937
3957
  }
3938
3958
  }
3939
3959
  }
3960
+ var action = 'action';
3961
+ if (_this.enableVirtualization && _this.selectionSettings.persistSelection && (_this.dataResults[action] === 'expand' || _this.dataResults[action] === 'collapse')) {
3962
+ var refreshPersistSelection = 'refreshPersistSelection';
3963
+ _this.grid.selectionModule[refreshPersistSelection]();
3964
+ if (_this.grid.selectionSettings.type === 'Single') {
3965
+ var updateRowSelection = 'updateRowSelection';
3966
+ var index = _this.getCurrentViewRecords().indexOf(_this.grid.selectionModule['data']);
3967
+ _this.grid.selectionModule[updateRowSelection](_this.getRows()[index], index);
3968
+ }
3969
+ }
3940
3970
  _this.trigger(dataBound, args);
3941
3971
  _this.initialRender = false;
3942
3972
  };
@@ -4134,8 +4164,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4134
4164
  _this.notify('clearFilters', { flatData: _this.grid.dataSource });
4135
4165
  _this.grid.setProperties({ dataSource: _this.dataResults.result }, true);
4136
4166
  if (isNullOrUndefined(_this.grid['changedProperties'].dataSource)) {
4137
- _this.grid.renderModule.data.dataManager = _this.grid.dataSource instanceof DataManager ? _this.grid.dataSource :
4167
+ _this.grid.renderModule.data.dataManager = _this.grid.dataSource instanceof DataManager ?
4168
+ _this.grid.dataSource :
4138
4169
  (isNullOrUndefined(_this.grid.dataSource) ? new DataManager() : new DataManager(_this.grid.dataSource));
4170
+ _this.grid.renderModule.data.isQueryInvokedFromData = true;
4171
+ _this.grid.query = _this.grid.query instanceof Query ? _this.grid.query : new Query();
4139
4172
  }
4140
4173
  }
4141
4174
  var callBackPromise = new Deferred();
@@ -4585,6 +4618,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4585
4618
  case 'enableAutoFill':
4586
4619
  this.grid.enableAutoFill = this.enableAutoFill;
4587
4620
  break;
4621
+ case 'enableAdaptiveUI':
4622
+ this.grid.enableAdaptiveUI = this.enableAdaptiveUI;
4623
+ break;
4588
4624
  case 'enableImmutableMode':
4589
4625
  this.grid.enableImmutableMode = this.enableImmutableMode;
4590
4626
  break;
@@ -5165,7 +5201,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5165
5201
  gridColumn[prop] = gridColumns[i][prop];
5166
5202
  }
5167
5203
  this.columnModel.push(new Column(gridColumn));
5168
- if (field === this.columnModel[i].field && (!isNullOrUndefined(temp) && temp !== '')) {
5204
+ if (field === this.columnModel[i].field && this.columnModel[i].type !== 'checkbox' && (!isNullOrUndefined(temp) && temp !== '')) {
5169
5205
  this.columnModel[i].template = temp;
5170
5206
  }
5171
5207
  }
@@ -5181,6 +5217,32 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5181
5217
  this[merge$$1] = undefined; // Workaround for blazor updateModel
5182
5218
  return this.columnModel;
5183
5219
  };
5220
+ /**
5221
+ * @param {string} columnUid - Defines column uid
5222
+ * @returns {void}
5223
+ * @hidden
5224
+ */
5225
+ TreeGrid.prototype.refreshReactColumnTemplateByUid = function (columnUid) {
5226
+ var _this = this;
5227
+ if (this.isReact) {
5228
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5229
+ this.clearTemplate(['columnTemplate'], undefined, function () {
5230
+ var cells = 'cells';
5231
+ var rowIdx = 'index';
5232
+ var rowsObj = _this.grid.getRowsObject();
5233
+ var indent = _this.grid.getIndentCount();
5234
+ var cellIndex = _this.grid.getNormalizedColumnIndex(columnUid);
5235
+ for (var j = 0; j < rowsObj.length; j++) {
5236
+ if (rowsObj[j].isDataRow && !isNullOrUndefined(rowsObj[j].index)) {
5237
+ var cell = rowsObj[j][cells][cellIndex];
5238
+ var cellRenderer = new CellRenderer(_this.grid, _this.grid.serviceLocator);
5239
+ var td = _this.getCellFromIndex(rowsObj[j].index, cellIndex - indent);
5240
+ cellRenderer.refreshTD(td, cell, rowsObj[j].data, { index: rowsObj[j][rowIdx] });
5241
+ }
5242
+ }
5243
+ });
5244
+ }
5245
+ };
5184
5246
  /**
5185
5247
  * Gets the content div of the TreeGrid.
5186
5248
  *
@@ -5450,9 +5512,11 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5450
5512
  *
5451
5513
  * @param {HTMLTableRowElement} row - Expands the given row
5452
5514
  * @param {Object} record - Expands the given record
5515
+ * @param {Object} key - Primary key value
5516
+ * @param {number} level - Specifies the hierarchical level of the record
5453
5517
  * @returns {void}
5454
5518
  */
5455
- TreeGrid.prototype.expandRow = function (row, record) {
5519
+ TreeGrid.prototype.expandRow = function (row, record, key, level) {
5456
5520
  var _this = this;
5457
5521
  record = this.getCollapseExpandRecords(row, record);
5458
5522
  if (!isNullOrUndefined(row) && row.cells[0].classList.contains('e-lastrowcell')) {
@@ -5462,6 +5526,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5462
5526
  this.trigger(expanding, args, function (expandingArgs) {
5463
5527
  if (!expandingArgs.cancel) {
5464
5528
  _this.expandCollapse('expand', row, record);
5529
+ if (expandingArgs.expandAll) {
5530
+ _this.expandCollapseAllChildren(record, 'expand', key, level);
5531
+ }
5465
5532
  var children = 'Children';
5466
5533
  if (!(isRemoteData(_this) && !isOffline(_this)) && (!isCountRequired(_this) || !isNullOrUndefined(record[children]))) {
5467
5534
  var collapseArgs = { data: record, row: row };
@@ -5471,6 +5538,19 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5471
5538
  }
5472
5539
  });
5473
5540
  };
5541
+ TreeGrid.prototype.expandCollapseAllChildren = function (record, action, key, level) {
5542
+ if ((!isNullOrUndefined(key) && record[this.getPrimaryKeyFieldNames()[0]] !== key) ||
5543
+ (!isNullOrUndefined(level) && level !== record.level)) {
5544
+ return;
5545
+ }
5546
+ var records = findChildrenRecords(record).filter(function (e) {
5547
+ return e.hasChildRecords;
5548
+ });
5549
+ records.unshift(record);
5550
+ for (var i = 0; i < records.length; i++) {
5551
+ this.expandCollapse(action, null, records[i]);
5552
+ }
5553
+ };
5474
5554
  TreeGrid.prototype.setHeightForFrozenContent = function () {
5475
5555
  var freeze = (this.grid.getFrozenLeftColumnsCount() > 0 || this.grid.getFrozenRightColumnsCount() > 0) ? true : false;
5476
5556
  if (this.grid.getFrozenColumns() > 0 || freeze) {
@@ -5494,14 +5574,18 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5494
5574
  *
5495
5575
  * @param {HTMLTableRowElement} row - Collapse the given row
5496
5576
  * @param {Object} record - Collapse the given record
5577
+ * @param {Object} key - Primary key value
5497
5578
  * @returns {void}
5498
5579
  */
5499
- TreeGrid.prototype.collapseRow = function (row, record) {
5580
+ TreeGrid.prototype.collapseRow = function (row, record, key) {
5500
5581
  var _this = this;
5501
5582
  record = this.getCollapseExpandRecords(row, record);
5502
5583
  var args = { data: record, row: row, cancel: false };
5503
5584
  this.trigger(collapsing, args, function (collapsingArgs) {
5504
5585
  if (!collapsingArgs.cancel) {
5586
+ if (collapsingArgs.collapseAll) {
5587
+ _this.expandCollapseAllChildren(record, 'collapse', key);
5588
+ }
5505
5589
  _this.expandCollapse('collapse', row, record);
5506
5590
  var collapseArgs = { data: record, row: row };
5507
5591
  if (!isRemoteData(_this)) {
@@ -5532,22 +5616,58 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5532
5616
  }
5533
5617
  return e.hasChildRecords && e.level === level;
5534
5618
  });
5535
- this.expandRow(null, rec);
5619
+ this.expandAction(rec, null, level, true);
5536
5620
  }
5537
5621
  else {
5538
5622
  var rec = this.getRecordDetails(level);
5539
- var row = getObject('rows', rec);
5540
5623
  var record = getObject('records', rec);
5541
- for (var i = 0; i < record.length; i++) {
5542
- if (!isNullOrUndefined(record[i].parentItem)) {
5543
- var pindex = this.flatData[record[i].parentItem.index].index;
5544
- if (this.flatData[pindex].expanded === false) {
5545
- record.push(this.flatData[pindex]);
5546
- this.flatData[pindex].expanded = true;
5624
+ this.expandAction(record, null, level);
5625
+ }
5626
+ };
5627
+ /**
5628
+ * Expands the records by given primary key value
5629
+ *
5630
+ * @param {Object} key - Expands the parent rows with given primary key value
5631
+ * @returns {void}
5632
+ */
5633
+ TreeGrid.prototype.expandByKey = function (key) {
5634
+ this.expandCollapseActionByKey(key, 'Expand');
5635
+ };
5636
+ TreeGrid.prototype.expandAction = function (record, key, level, isPaging) {
5637
+ if (isPaging === void 0) { isPaging = false; }
5638
+ var _loop_1 = function (i) {
5639
+ if (!isNullOrUndefined(record[i].parentItem)) {
5640
+ var puniqueID_1 = record[i].parentItem.uniqueID;
5641
+ var parentItem = this_1.flatData.filter(function (e) {
5642
+ return e.uniqueID === puniqueID_1;
5643
+ });
5644
+ if (isRemoteData(this_1)) {
5645
+ parentItem = this_1.getCurrentViewRecords().filter(function (e) {
5646
+ return e.uniqueID === puniqueID_1;
5647
+ });
5648
+ }
5649
+ if (parentItem[0].expanded === false) {
5650
+ record.push(parentItem[0]);
5651
+ parentItem[0].expanded = true;
5652
+ }
5653
+ else {
5654
+ if (!getExpandStatus(this_1, parentItem[0], this_1.parentData)) {
5655
+ if (parentItem[0].expanded && parentItem[0].parentItem !== undefined) {
5656
+ record.push(parentItem[0]);
5657
+ }
5547
5658
  }
5548
5659
  }
5549
- this.expandRow(row[i], record[i]);
5550
5660
  }
5661
+ if (!isPaging) {
5662
+ this_1.expandRow(null, record[i], key, level);
5663
+ }
5664
+ };
5665
+ var this_1 = this;
5666
+ for (var i = 0; i < record.length; i++) {
5667
+ _loop_1(i);
5668
+ }
5669
+ if (isPaging) {
5670
+ this.expandRow(null, record, key, level);
5551
5671
  }
5552
5672
  };
5553
5673
  TreeGrid.prototype.getRecordDetails = function (level) {
@@ -5575,14 +5695,46 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5575
5695
  }
5576
5696
  return e.hasChildRecords && e.level === level;
5577
5697
  });
5578
- this.collapseRow(null, record);
5698
+ this.collapseAction(record, null, true);
5579
5699
  }
5580
5700
  else {
5581
5701
  var rec = this.getRecordDetails(level);
5582
- var rows = getObject('rows', rec);
5583
5702
  var records = getObject('records', rec);
5584
- for (var i = 0; i < records.length; i++) {
5585
- this.collapseRow(rows[i], records[i]);
5703
+ this.collapseAction(records);
5704
+ }
5705
+ };
5706
+ /**
5707
+ * Collapses the records by given primary key value
5708
+ *
5709
+ * @param {Object} key - Collapses the parent rows with given primary key value
5710
+ * @returns {void}
5711
+ */
5712
+ TreeGrid.prototype.collapseByKey = function (key) {
5713
+ this.expandCollapseActionByKey(key, 'Collapse');
5714
+ };
5715
+ TreeGrid.prototype.expandCollapseActionByKey = function (key, action) {
5716
+ var primaryKeyField = this.getPrimaryKeyFieldNames()[0];
5717
+ var dataSource = isRemoteData(this) ? this.getCurrentViewRecords() : this.grid.dataSource;
5718
+ if (!isNullOrUndefined(primaryKeyField)) {
5719
+ var rec = dataSource.filter(function (e) {
5720
+ return e[primaryKeyField].toString() === key.toString();
5721
+ });
5722
+ if (action === 'Expand') {
5723
+ this.expandAction(rec, key, null);
5724
+ }
5725
+ else {
5726
+ this.collapseAction(rec, key);
5727
+ }
5728
+ }
5729
+ };
5730
+ TreeGrid.prototype.collapseAction = function (record, key, isPaging) {
5731
+ if (isPaging === void 0) { isPaging = false; }
5732
+ if (isPaging) {
5733
+ this.collapseRow(null, record);
5734
+ }
5735
+ else {
5736
+ for (var i = 0; i < record.length; i++) {
5737
+ this.collapseRow(null, record[i], key);
5586
5738
  }
5587
5739
  }
5588
5740
  if (!this.grid.contentModule.isDataSourceChanged && this.enableVirtualization && this.getRows()
@@ -6492,6 +6644,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6492
6644
  __decorate([
6493
6645
  Property(false)
6494
6646
  ], TreeGrid.prototype, "enableAutoFill", void 0);
6647
+ __decorate([
6648
+ Property(false)
6649
+ ], TreeGrid.prototype, "enableAdaptiveUI", void 0);
6495
6650
  __decorate([
6496
6651
  Property(false)
6497
6652
  ], TreeGrid.prototype, "enableImmutableMode", void 0);
@@ -8082,6 +8237,14 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
8082
8237
  return _super.prototype.getData.call(this);
8083
8238
  };
8084
8239
  TreeVirtualRowModelGenerator.prototype.generateRows = function (data, notifyArgs) {
8240
+ if (!isNullOrUndefined(notifyArgs.virtualInfo) && notifyArgs.virtualInfo.loadNext &&
8241
+ notifyArgs.virtualInfo.nextInfo.page !== this.parent.pageSettings.currentPage) {
8242
+ this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.nextInfo.page } }, true);
8243
+ }
8244
+ else if (!isNullOrUndefined(notifyArgs.virtualInfo) && !notifyArgs.virtualInfo.loadNext &&
8245
+ notifyArgs.virtualInfo.page !== this.parent.pageSettings.currentPage) {
8246
+ this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.page } }, true);
8247
+ }
8085
8248
  var info = this.getDataInfo();
8086
8249
  if (!isNullOrUndefined(notifyArgs.virtualInfo)) {
8087
8250
  if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
@@ -8536,9 +8699,9 @@ var ExcelExport$1 = /** @__PURE__ @class */ (function () {
8536
8699
  if (excelRow.type === 'excel') {
8537
8700
  var excelrowobj = excelRow.rowObj.data;
8538
8701
  var filtercolumnlength = this.parent.grid.filterSettings.columns.length;
8702
+ var rowlength = excelRow.excelRows.length;
8703
+ var rowlevel = excelrowobj.level;
8539
8704
  if (excelrowobj.parentItem && getParentData(this.parent, excelrowobj.parentItem.uniqueID, Boolean(filtercolumnlength))) {
8540
- var rowlength = excelRow.excelRows.length;
8541
- var rowlevel = excelrowobj.level;
8542
8705
  var expandedStatus = false;
8543
8706
  var sublevelState = false;
8544
8707
  var state = getExpandStatus(this.parent, excelrowobj, this.parent.parentData);
@@ -8549,6 +8712,9 @@ var ExcelExport$1 = /** @__PURE__ @class */ (function () {
8549
8712
  excelRow.excelRows[rowlength - 1].grouping = { outlineLevel: rowlevel, isCollapsed: sublevelState,
8550
8713
  isHidden: expandedStatus };
8551
8714
  }
8715
+ else if (excelrowobj.hasChildRecords && isNullOrUndefined(excelrowobj.parentItem)) {
8716
+ excelRow.excelRows[rowlength - 1].grouping = { outlineLevel: rowlevel };
8717
+ }
8552
8718
  }
8553
8719
  };
8554
8720
  /* eslint-disable-next-line */
@@ -9933,11 +10099,6 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
9933
10099
  var data = (this.parent.grid.dataSource instanceof DataManager ?
9934
10100
  this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);
9935
10101
  var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];
9936
- if (!isNullOrUndefined(this.parent[targetElement])) {
9937
- var row = this.parent[targetElement].closest('tr');
9938
- this.parent.collapseRow(row);
9939
- this.parent[targetElement] = null;
9940
- }
9941
10102
  if (!isNullOrUndefined(this.batchAddedRecords)) {
9942
10103
  for (var i = 0; i < this.batchAddedRecords.length; i++) {
9943
10104
  index = data.map(function (e) { return e[primaryKey]; }).indexOf(this.batchAddedRecords[i][primaryKey]);
@@ -9957,6 +10118,11 @@ var BatchEdit = /** @__PURE__ @class */ (function () {
9957
10118
  }
9958
10119
  }
9959
10120
  }
10121
+ if (!isNullOrUndefined(this.parent[targetElement])) {
10122
+ var row = this.parent[targetElement].closest('tr');
10123
+ this.parent.collapseRow(row);
10124
+ this.parent[targetElement] = null;
10125
+ }
9960
10126
  if (!isNullOrUndefined(this.batchDeletedRecords)) {
9961
10127
  for (var i = 0; i < this.batchDeletedRecords.length; i++) {
9962
10128
  if (!isNullOrUndefined(this.batchDeletedRecords[i][parentItem])) {
@@ -10931,8 +11097,7 @@ var Edit$1 = /** @__PURE__ @class */ (function () {
10931
11097
  var currentData = this.parent.grid.getCurrentViewRecords();
10932
11098
  if (this.parent.enableVirtualization && args.index !== 0) {
10933
11099
  this.addRowIndex = this.parent.grid.getCurrentViewRecords().indexOf(this.addRowRecord);
10934
- this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('aria-rowindex'));
10935
-
11100
+ this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('aria-rowindex'), 10);
10936
11101
  }
10937
11102
  var index = this.addRowIndex;
10938
11103
  value.uniqueID = getUid(this.parent.element.id + '_data_');
@@ -11455,7 +11620,8 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
11455
11620
  if (isNullOrUndefined(this.observer[containerRect])) {
11456
11621
  this.observer[containerRect] = this.observers[containerRect];
11457
11622
  }
11458
- if (args.selectedIndex !== 0 || isNullOrUndefined(this.parent['clipboardModule'].treeGridParent.editModule['addRowIndex'])) {
11623
+ if (isNullOrUndefined(this.parent['clipboardModule'].treeGridParent.editModule) || args.selectedIndex !== 0 ||
11624
+ isNullOrUndefined(this.parent['clipboardModule'].treeGridParent.editModule['addRowIndex'])) {
11459
11625
  _super.prototype[selectVirtualRow].call(this, args);
11460
11626
  }
11461
11627
  };
@@ -11693,6 +11859,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
11693
11859
  var replace = 'replaceWith';
11694
11860
  this.getTable().querySelector('tbody')[replace](target);
11695
11861
  if (!this.isExpandCollapse || this.translateY === 0) {
11862
+ this.translateY = this.translateY < 0 ? 0 : this.translateY;
11696
11863
  getValue('virtualEle', this).adjustTable(cOffset, this.translateY);
11697
11864
  }
11698
11865
  else {
@@ -11904,7 +12071,10 @@ var VirtualScroll$1 = /** @__PURE__ @class */ (function () {
11904
12071
  record: row.record,
11905
12072
  count: this.parent.flatData.length
11906
12073
  };
11907
- this.parent.grid.clearSelection();
12074
+ if (this.parent.enableVirtualization && this.parent.selectionSettings.mode === 'Cell' ||
12075
+ this.parent.selectionSettings.mode === 'Row' && !this.parent.selectionSettings.persistSelection) {
12076
+ this.parent.grid.clearSelection();
12077
+ }
11908
12078
  var requestType = getValue('isCollapseAll', this.parent) ? 'collapseAll' : 'refresh';
11909
12079
  getValue('grid.renderModule', this.parent).dataManagerSuccess(ret, { requestType: requestType });
11910
12080
  };