@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
@@ -2208,6 +2208,7 @@ class DataManipulation {
2208
2208
  this.parent.grid.detailRowModule.expand(expandingTd);
2209
2209
  }
2210
2210
  }
2211
+ this.parent.grid.pageSettings.totalRecordsCount += rowDetails.rows.length;
2211
2212
  }
2212
2213
  else {
2213
2214
  this.fetchRemoteChildData({ action: rowDetails[`${name}`], record: rowDetails.record, rows: rowDetails.rows, parentRow: rowDetails.parentRow });
@@ -6417,18 +6418,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6417
6418
  this.trigger(expanded, expandArgs);
6418
6419
  }
6419
6420
  }
6420
- if (this.enableVirtualization) {
6421
- const index = this.grid.currentViewData.indexOf(record);
6422
- const expandedRow = isNullOrUndefined(row) ? this.getRows()[parseInt(index.toString(), 10)] : row;
6423
- if (!isNullOrUndefined(expandedRow)) {
6424
- const rowIndex = +expandedRow.getAttribute('data-rowindex');
6425
- const outBuffer = this.grid.pageSettings.pageSize - Math.ceil(this.grid.pageSettings.pageSize / 2);
6426
- const lastBlockIdx = initialTotalRecordsCount - outBuffer;
6427
- if (rowIndex > lastBlockIdx) {
6428
- this.grid.getContent().firstElementChild.scrollTop = rowIndex * this.grid.getRowHeight();
6429
- }
6430
- }
6431
- }
6432
6421
  }
6433
6422
  expandCollapseAllChildren(record, action, key, level) {
6434
6423
  if ((!isNullOrUndefined(key) && record[this.getPrimaryKeyFieldNames()[0]] !== key) ||
@@ -6543,18 +6532,6 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6543
6532
  this.grid.getContent().firstElementChild.scrollBy(0, this.grid.getRowHeight());
6544
6533
  }
6545
6534
  }
6546
- if (this.enableVirtualization) {
6547
- const index = this.grid.currentViewData.indexOf(record);
6548
- const collapsedRow = isNullOrUndefined(row) ? this.getRows()[parseInt(index.toString(), 10)] : row;
6549
- if (!isNullOrUndefined(collapsedRow)) {
6550
- const rowIndex = +collapsedRow.getAttribute('data-rowindex');
6551
- const outBuffer = this.grid.pageSettings.pageSize - Math.ceil(this.grid.pageSettings.pageSize / 2);
6552
- const lastBlockIdx = this.grid.totalDataRecordsCount - outBuffer;
6553
- if (rowIndex > lastBlockIdx) {
6554
- this.grid.getContent().firstElementChild.scrollBy(0, (rowIndex - lastBlockIdx) * this.grid.getRowHeight());
6555
- }
6556
- }
6557
- }
6558
6535
  }
6559
6536
  }
6560
6537
  updateExpandStateMapping(record, state) {
@@ -7205,6 +7182,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
7205
7182
  }
7206
7183
  }
7207
7184
  }
7185
+ this.grid.pageSettings.totalRecordsCount -= rows.length;
7208
7186
  }
7209
7187
  /**
7210
7188
  * Method to sanitize html element
@@ -9857,8 +9835,7 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
9857
9835
  if (!isNullOrUndefined(notifyArgs.virtualInfo)) {
9858
9836
  if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {
9859
9837
  if (!((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
9860
- && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent))
9861
- || notifyArgs.virtualInfo.blockIndexes.length === 1) {
9838
+ && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent) || isRemoteData(this.parent))) {
9862
9839
  notifyArgs.virtualInfo.blockIndexes = info.blockIndexes;
9863
9840
  }
9864
9841
  }
@@ -9867,7 +9844,7 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
9867
9844
  }
9868
9845
  }
9869
9846
  if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
9870
- && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
9847
+ && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent) || isRemoteData(this.parent)) {
9871
9848
  return super.generateRows(data, notifyArgs);
9872
9849
  }
9873
9850
  else {
@@ -9888,7 +9865,7 @@ class TreeVirtualRowModelGenerator extends VirtualRowModelGenerator {
9888
9865
  const clear = ['paging', 'refresh', 'sorting', 'filtering', 'searching', 'reorder',
9889
9866
  'save', 'delete'].some((value) => action === value);
9890
9867
  if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
9891
- && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
9868
+ && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent) || isRemoteData(this.parent)) {
9892
9869
  const model = 'model';
9893
9870
  const currentPage = this[`${model}`].currentPage;
9894
9871
  if (clear) {
@@ -13733,12 +13710,27 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13733
13710
  }
13734
13711
  }
13735
13712
  }
13736
- if (((downScroll && (scrollArgs.offset.top < (rowHeight * this.totalRecords)))
13713
+ if (isRemoteData(this.parent) || ((downScroll && (scrollArgs.offset.top < (rowHeight * this.totalRecords)))
13737
13714
  || (upScroll)) || (scrollArgs.direction === 'right' || scrollArgs.direction === 'left') ||
13738
13715
  ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
13739
13716
  && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') && (downScroll || upScroll) || isCountRequired(this.parent))) {
13740
13717
  const viewInfo = this.currentInfo = getValue('getInfoFromView', this).apply(this, [scrollArgs.direction, info, scrollArgs.offset]);
13741
13718
  this.previousInfo = viewInfo;
13719
+ if (this.prevInfo && ((info.axis === 'Y' && this.prevInfo.blockIndexes.toString() === viewInfo.blockIndexes.toString())
13720
+ || ((info.axis === 'X' && this.prevInfo.columnIndexes.toString() === viewInfo.columnIndexes.toString())
13721
+ || (this.parent.isFrozenGrid() && this.parent.getVisibleFrozenLeftCount() >= viewInfo.columnIndexes[0]
13722
+ && this.prevInfo.columnIndexes.toString().includes(viewInfo.columnIndexes.toString()))))) {
13723
+ this.parent.removeMaskRow();
13724
+ this.parent.notify('removeGanttShimmer', { requestType: 'hideShimmer' });
13725
+ if (Browser.isIE) {
13726
+ this.parent.hideSpinner();
13727
+ }
13728
+ this.requestType = this.requestType === 'virtualscroll' ? this['empty'] : this.requestType;
13729
+ if (info.axis === 'Y') {
13730
+ this['restoreEdit']();
13731
+ }
13732
+ return;
13733
+ }
13742
13734
  this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization ? viewInfo.columnIndexes : []);
13743
13735
  const page = viewInfo.loadNext && !viewInfo.loadSelf ? viewInfo.nextInfo.page : viewInfo.page;
13744
13736
  this.parent.setProperties({ pageSettings: { currentPage: page } }, true);
@@ -13765,7 +13757,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13765
13757
  }
13766
13758
  appendContent(target, newChild, e) {
13767
13759
  if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
13768
- && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {
13760
+ && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent) || isRemoteData(this.parent)) {
13769
13761
  if (getValue('isExpandCollapse', e)) {
13770
13762
  this.isRemoteExpand = true;
13771
13763
  }
@@ -14082,14 +14074,22 @@ class VirtualScroll {
14082
14074
  endIndex = startIndex + this.parent.grid.pageSettings.pageSize;
14083
14075
  }
14084
14076
  if (!isNullOrUndefined(this.expandCollapseRec)) {
14085
- const resourceCount = this.parent.getRows();
14077
+ const resourceCount = this.parent.grid.pageSettings.pageSize;
14086
14078
  let sIndex = visualData.indexOf(this.expandCollapseRec);
14087
- const tempdata = visualData.slice(sIndex, sIndex + resourceCount.length);
14088
- if (tempdata.length < resourceCount.length && sIndex >= 0 && startIndex !== 0) {
14089
- sIndex = visualData.length - resourceCount.length;
14079
+ const tempdata = visualData.slice(sIndex, sIndex + resourceCount);
14080
+ if (tempdata.length < resourceCount && sIndex >= 0 && startIndex !== 0) {
14081
+ sIndex = visualData.length - resourceCount;
14090
14082
  sIndex = sIndex > 0 ? sIndex : 0;
14091
- startIndex = sIndex;
14092
14083
  endIndex = visualData.length;
14084
+ if (endIndex - startIndex < resourceCount) {
14085
+ const newRowsCount = sIndex - startIndex;
14086
+ startIndex = sIndex;
14087
+ if (visualData.indexOf(this.expandCollapseRec) > visualData.length - resourceCount / 2) {
14088
+ const newTranslateY = translateY + (newRowsCount * this.parent.grid.getRowHeight());
14089
+ this.parent.grid.contentModule['translateY'] = newTranslateY;
14090
+ this.parent.grid.contentModule.virtualEle.adjustTable(0, newTranslateY);
14091
+ }
14092
+ }
14093
14093
  }
14094
14094
  else if (getValue('isCollapseAll', this.parent)) {
14095
14095
  startIndex = 0;