@syncfusion/ej2-treegrid 28.1.36 → 28.1.39

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 (82) hide show
  1. package/README.md +1 -1
  2. package/dist/ej2-treegrid.min.js +10 -1
  3. package/dist/ej2-treegrid.umd.min.js +10 -1
  4. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-treegrid.es2015.js +35 -35
  6. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  7. package/dist/es6/ej2-treegrid.es5.js +35 -35
  8. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  9. package/dist/global/ej2-treegrid.min.js +10 -1
  10. package/dist/global/ej2-treegrid.min.js.map +1 -1
  11. package/dist/global/index.d.ts +9 -0
  12. package/package.json +8 -7
  13. package/src/treegrid/actions/virtual-scroll.js +13 -5
  14. package/src/treegrid/base/data.js +1 -0
  15. package/src/treegrid/base/treegrid.js +1 -24
  16. package/src/treegrid/renderer/virtual-row-model-generator.js +4 -5
  17. package/src/treegrid/renderer/virtual-tree-content-render.js +18 -3
  18. package/src/treegrid/utils.d.ts +1 -1
  19. package/styles/bds-lite.css +11 -14
  20. package/styles/bds.css +11 -14
  21. package/styles/bootstrap-dark-lite.css +11 -14
  22. package/styles/bootstrap-dark.css +11 -14
  23. package/styles/bootstrap-lite.css +11 -14
  24. package/styles/bootstrap.css +11 -14
  25. package/styles/bootstrap4-lite.css +11 -14
  26. package/styles/bootstrap4.css +11 -14
  27. package/styles/bootstrap5-dark-lite.css +11 -14
  28. package/styles/bootstrap5-dark.css +11 -14
  29. package/styles/bootstrap5-lite.css +11 -14
  30. package/styles/bootstrap5.3-lite.css +11 -14
  31. package/styles/bootstrap5.3.css +11 -14
  32. package/styles/bootstrap5.css +11 -14
  33. package/styles/fabric-dark-lite.css +11 -14
  34. package/styles/fabric-dark.css +11 -14
  35. package/styles/fabric-lite.css +11 -14
  36. package/styles/fabric.css +11 -14
  37. package/styles/fluent-dark-lite.css +11 -14
  38. package/styles/fluent-dark.css +11 -14
  39. package/styles/fluent-lite.css +11 -14
  40. package/styles/fluent.css +11 -14
  41. package/styles/fluent2-lite.css +11 -14
  42. package/styles/fluent2.css +11 -14
  43. package/styles/highcontrast-light-lite.css +11 -14
  44. package/styles/highcontrast-light.css +11 -14
  45. package/styles/highcontrast-lite.css +11 -14
  46. package/styles/highcontrast.css +11 -14
  47. package/styles/material-dark-lite.css +11 -14
  48. package/styles/material-dark.css +11 -14
  49. package/styles/material-lite.css +11 -14
  50. package/styles/material.css +11 -14
  51. package/styles/material3-dark-lite.css +11 -14
  52. package/styles/material3-dark.css +11 -14
  53. package/styles/material3-lite.css +11 -14
  54. package/styles/material3.css +11 -14
  55. package/styles/tailwind-dark-lite.css +11 -14
  56. package/styles/tailwind-dark.css +11 -14
  57. package/styles/tailwind-lite.css +11 -14
  58. package/styles/tailwind.css +11 -14
  59. package/styles/tailwind3-lite.css +11 -14
  60. package/styles/tailwind3.css +11 -14
  61. package/styles/treegrid/_layout.scss +13 -15
  62. package/styles/treegrid/bds.css +11 -14
  63. package/styles/treegrid/bootstrap-dark.css +11 -14
  64. package/styles/treegrid/bootstrap.css +11 -14
  65. package/styles/treegrid/bootstrap4.css +11 -14
  66. package/styles/treegrid/bootstrap5-dark.css +11 -14
  67. package/styles/treegrid/bootstrap5.3.css +11 -14
  68. package/styles/treegrid/bootstrap5.css +11 -14
  69. package/styles/treegrid/fabric-dark.css +11 -14
  70. package/styles/treegrid/fabric.css +11 -14
  71. package/styles/treegrid/fluent-dark.css +11 -14
  72. package/styles/treegrid/fluent.css +11 -14
  73. package/styles/treegrid/fluent2.css +11 -14
  74. package/styles/treegrid/highcontrast-light.css +11 -14
  75. package/styles/treegrid/highcontrast.css +11 -14
  76. package/styles/treegrid/material-dark.css +11 -14
  77. package/styles/treegrid/material.css +11 -14
  78. package/styles/treegrid/material3-dark.css +11 -14
  79. package/styles/treegrid/material3.css +11 -14
  80. package/styles/treegrid/tailwind-dark.css +11 -14
  81. package/styles/treegrid/tailwind.css +11 -14
  82. package/styles/treegrid/tailwind3.css +11 -14
@@ -2376,6 +2376,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
2376
2376
  this.parent.grid.detailRowModule.expand(expandingTd);
2377
2377
  }
2378
2378
  }
2379
+ this.parent.grid.pageSettings.totalRecordsCount += rowDetails.rows.length;
2379
2380
  }
2380
2381
  else {
2381
2382
  this.fetchRemoteChildData({ action: rowDetails["" + name], record: rowDetails.record, rows: rowDetails.rows, parentRow: rowDetails.parentRow });
@@ -6729,18 +6730,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6729
6730
  this.trigger(expanded, expandArgs);
6730
6731
  }
6731
6732
  }
6732
- if (this.enableVirtualization) {
6733
- var index = this.grid.currentViewData.indexOf(record);
6734
- var expandedRow = isNullOrUndefined(row) ? this.getRows()[parseInt(index.toString(), 10)] : row;
6735
- if (!isNullOrUndefined(expandedRow)) {
6736
- var rowIndex = +expandedRow.getAttribute('data-rowindex');
6737
- var outBuffer = this.grid.pageSettings.pageSize - Math.ceil(this.grid.pageSettings.pageSize / 2);
6738
- var lastBlockIdx = initialTotalRecordsCount - outBuffer;
6739
- if (rowIndex > lastBlockIdx) {
6740
- this.grid.getContent().firstElementChild.scrollTop = rowIndex * this.grid.getRowHeight();
6741
- }
6742
- }
6743
- }
6744
6733
  };
6745
6734
  TreeGrid.prototype.expandCollapseAllChildren = function (record, action, key, level) {
6746
6735
  if ((!isNullOrUndefined(key) && record[this.getPrimaryKeyFieldNames()[0]] !== key) ||
@@ -6856,18 +6845,6 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6856
6845
  this.grid.getContent().firstElementChild.scrollBy(0, this.grid.getRowHeight());
6857
6846
  }
6858
6847
  }
6859
- if (this.enableVirtualization) {
6860
- var index = this.grid.currentViewData.indexOf(record);
6861
- var collapsedRow = isNullOrUndefined(row) ? this.getRows()[parseInt(index.toString(), 10)] : row;
6862
- if (!isNullOrUndefined(collapsedRow)) {
6863
- var rowIndex = +collapsedRow.getAttribute('data-rowindex');
6864
- var outBuffer = this.grid.pageSettings.pageSize - Math.ceil(this.grid.pageSettings.pageSize / 2);
6865
- var lastBlockIdx = this.grid.totalDataRecordsCount - outBuffer;
6866
- if (rowIndex > lastBlockIdx) {
6867
- this.grid.getContent().firstElementChild.scrollBy(0, (rowIndex - lastBlockIdx) * this.grid.getRowHeight());
6868
- }
6869
- }
6870
- }
6871
6848
  }
6872
6849
  };
6873
6850
  TreeGrid.prototype.updateExpandStateMapping = function (record, state) {
@@ -7542,6 +7519,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
7542
7519
  }
7543
7520
  }
7544
7521
  }
7522
+ this.grid.pageSettings.totalRecordsCount -= rows.length;
7545
7523
  };
7546
7524
  /**
7547
7525
  * Method to sanitize html element
@@ -10241,8 +10219,7 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
10241
10219
  if (!isNullOrUndefined(notifyArgs.virtualInfo)) {
10242
10220
  if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
10243
10221
  if (!((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
10244
- && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent))
10245
- || notifyArgs.virtualInfo.blockIndexes.length === 1) {
10222
+ && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent) || isRemoteData(this.parent))) {
10246
10223
  notifyArgs.virtualInfo.blockIndexes = info.blockIndexes;
10247
10224
  }
10248
10225
  }
@@ -10251,7 +10228,7 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
10251
10228
  }
10252
10229
  }
10253
10230
  if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
10254
- && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
10231
+ && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent) || isRemoteData(this.parent)) {
10255
10232
  return _super.prototype.generateRows.call(this, data, notifyArgs);
10256
10233
  }
10257
10234
  else {
@@ -10272,7 +10249,7 @@ var TreeVirtualRowModelGenerator = /** @__PURE__ @class */ (function (_super) {
10272
10249
  var clear = ['paging', 'refresh', 'sorting', 'filtering', 'searching', 'reorder',
10273
10250
  'save', 'delete'].some(function (value) { return action === value; });
10274
10251
  if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
10275
- && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
10252
+ && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent) || isRemoteData(this.parent)) {
10276
10253
  var model = 'model';
10277
10254
  var currentPage = this["" + model].currentPage;
10278
10255
  if (clear) {
@@ -14169,12 +14146,27 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
14169
14146
  }
14170
14147
  }
14171
14148
  }
14172
- if (((downScroll && (scrollArgs.offset.top < (rowHeight * this.totalRecords)))
14149
+ if (isRemoteData(this.parent) || ((downScroll && (scrollArgs.offset.top < (rowHeight * this.totalRecords)))
14173
14150
  || (upScroll)) || (scrollArgs.direction === 'right' || scrollArgs.direction === 'left') ||
14174
14151
  ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
14175
14152
  && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') && (downScroll || upScroll) || isCountRequired(this.parent))) {
14176
14153
  var viewInfo = this.currentInfo = getValue('getInfoFromView', this).apply(this, [scrollArgs.direction, info, scrollArgs.offset]);
14177
14154
  this.previousInfo = viewInfo;
14155
+ if (this.prevInfo && ((info.axis === 'Y' && this.prevInfo.blockIndexes.toString() === viewInfo.blockIndexes.toString())
14156
+ || ((info.axis === 'X' && this.prevInfo.columnIndexes.toString() === viewInfo.columnIndexes.toString())
14157
+ || (this.parent.isFrozenGrid() && this.parent.getVisibleFrozenLeftCount() >= viewInfo.columnIndexes[0]
14158
+ && this.prevInfo.columnIndexes.toString().includes(viewInfo.columnIndexes.toString()))))) {
14159
+ this.parent.removeMaskRow();
14160
+ this.parent.notify('removeGanttShimmer', { requestType: 'hideShimmer' });
14161
+ if (Browser.isIE) {
14162
+ this.parent.hideSpinner();
14163
+ }
14164
+ this.requestType = this.requestType === 'virtualscroll' ? this['empty'] : this.requestType;
14165
+ if (info.axis === 'Y') {
14166
+ this['restoreEdit']();
14167
+ }
14168
+ return;
14169
+ }
14178
14170
  this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization ? viewInfo.columnIndexes : []);
14179
14171
  var page = viewInfo.loadNext && !viewInfo.loadSelf ? viewInfo.nextInfo.page : viewInfo.page;
14180
14172
  this.parent.setProperties({ pageSettings: { currentPage: page } }, true);
@@ -14201,7 +14193,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
14201
14193
  };
14202
14194
  VirtualTreeContentRenderer.prototype.appendContent = function (target, newChild, e) {
14203
14195
  if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
14204
- && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
14196
+ && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent) || isRemoteData(this.parent)) {
14205
14197
  if (getValue('isExpandCollapse', e)) {
14206
14198
  this.isRemoteExpand = true;
14207
14199
  }
@@ -14537,14 +14529,22 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
14537
14529
  endIndex = startIndex + this.parent.grid.pageSettings.pageSize;
14538
14530
  }
14539
14531
  if (!isNullOrUndefined(this.expandCollapseRec)) {
14540
- var resourceCount = this.parent.getRows();
14532
+ var resourceCount = this.parent.grid.pageSettings.pageSize;
14541
14533
  var sIndex = visualData.indexOf(this.expandCollapseRec);
14542
- var tempdata = visualData.slice(sIndex, sIndex + resourceCount.length);
14543
- if (tempdata.length < resourceCount.length && sIndex >= 0 && startIndex !== 0) {
14544
- sIndex = visualData.length - resourceCount.length;
14534
+ var tempdata = visualData.slice(sIndex, sIndex + resourceCount);
14535
+ if (tempdata.length < resourceCount && sIndex >= 0 && startIndex !== 0) {
14536
+ sIndex = visualData.length - resourceCount;
14545
14537
  sIndex = sIndex > 0 ? sIndex : 0;
14546
- startIndex = sIndex;
14547
14538
  endIndex = visualData.length;
14539
+ if (endIndex - startIndex < resourceCount) {
14540
+ var newRowsCount = sIndex - startIndex;
14541
+ startIndex = sIndex;
14542
+ if (visualData.indexOf(this.expandCollapseRec) > visualData.length - resourceCount / 2) {
14543
+ var newTranslateY = translateY + (newRowsCount * this.parent.grid.getRowHeight());
14544
+ this.parent.grid.contentModule['translateY'] = newTranslateY;
14545
+ this.parent.grid.contentModule.virtualEle.adjustTable(0, newTranslateY);
14546
+ }
14547
+ }
14548
14548
  }
14549
14549
  else if (getValue('isCollapseAll', this.parent)) {
14550
14550
  startIndex = 0;