@syncfusion/ej2-treegrid 28.1.37 → 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 (79) hide show
  1. package/README.md +1 -1
  2. package/dist/ej2-treegrid.min.js +2 -2
  3. package/dist/ej2-treegrid.umd.min.js +2 -2
  4. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-treegrid.es2015.js +15 -29
  6. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  7. package/dist/es6/ej2-treegrid.es5.js +15 -29
  8. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  9. package/dist/global/ej2-treegrid.min.js +2 -2
  10. package/dist/global/ej2-treegrid.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  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/styles/bds-lite.css +11 -14
  17. package/styles/bds.css +11 -14
  18. package/styles/bootstrap-dark-lite.css +11 -14
  19. package/styles/bootstrap-dark.css +11 -14
  20. package/styles/bootstrap-lite.css +11 -14
  21. package/styles/bootstrap.css +11 -14
  22. package/styles/bootstrap4-lite.css +11 -14
  23. package/styles/bootstrap4.css +11 -14
  24. package/styles/bootstrap5-dark-lite.css +11 -14
  25. package/styles/bootstrap5-dark.css +11 -14
  26. package/styles/bootstrap5-lite.css +11 -14
  27. package/styles/bootstrap5.3-lite.css +11 -14
  28. package/styles/bootstrap5.3.css +11 -14
  29. package/styles/bootstrap5.css +11 -14
  30. package/styles/fabric-dark-lite.css +11 -14
  31. package/styles/fabric-dark.css +11 -14
  32. package/styles/fabric-lite.css +11 -14
  33. package/styles/fabric.css +11 -14
  34. package/styles/fluent-dark-lite.css +11 -14
  35. package/styles/fluent-dark.css +11 -14
  36. package/styles/fluent-lite.css +11 -14
  37. package/styles/fluent.css +11 -14
  38. package/styles/fluent2-lite.css +11 -14
  39. package/styles/fluent2.css +11 -14
  40. package/styles/highcontrast-light-lite.css +11 -14
  41. package/styles/highcontrast-light.css +11 -14
  42. package/styles/highcontrast-lite.css +11 -14
  43. package/styles/highcontrast.css +11 -14
  44. package/styles/material-dark-lite.css +11 -14
  45. package/styles/material-dark.css +11 -14
  46. package/styles/material-lite.css +11 -14
  47. package/styles/material.css +11 -14
  48. package/styles/material3-dark-lite.css +11 -14
  49. package/styles/material3-dark.css +11 -14
  50. package/styles/material3-lite.css +11 -14
  51. package/styles/material3.css +11 -14
  52. package/styles/tailwind-dark-lite.css +11 -14
  53. package/styles/tailwind-dark.css +11 -14
  54. package/styles/tailwind-lite.css +11 -14
  55. package/styles/tailwind.css +11 -14
  56. package/styles/tailwind3-lite.css +11 -14
  57. package/styles/tailwind3.css +11 -14
  58. package/styles/treegrid/_layout.scss +13 -15
  59. package/styles/treegrid/bds.css +11 -14
  60. package/styles/treegrid/bootstrap-dark.css +11 -14
  61. package/styles/treegrid/bootstrap.css +11 -14
  62. package/styles/treegrid/bootstrap4.css +11 -14
  63. package/styles/treegrid/bootstrap5-dark.css +11 -14
  64. package/styles/treegrid/bootstrap5.3.css +11 -14
  65. package/styles/treegrid/bootstrap5.css +11 -14
  66. package/styles/treegrid/fabric-dark.css +11 -14
  67. package/styles/treegrid/fabric.css +11 -14
  68. package/styles/treegrid/fluent-dark.css +11 -14
  69. package/styles/treegrid/fluent.css +11 -14
  70. package/styles/treegrid/fluent2.css +11 -14
  71. package/styles/treegrid/highcontrast-light.css +11 -14
  72. package/styles/treegrid/highcontrast.css +11 -14
  73. package/styles/treegrid/material-dark.css +11 -14
  74. package/styles/treegrid/material.css +11 -14
  75. package/styles/treegrid/material3-dark.css +11 -14
  76. package/styles/treegrid/material3.css +11 -14
  77. package/styles/treegrid/tailwind-dark.css +11 -14
  78. package/styles/treegrid/tailwind.css +11 -14
  79. 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
@@ -14096,14 +14074,22 @@ class VirtualScroll {
14096
14074
  endIndex = startIndex + this.parent.grid.pageSettings.pageSize;
14097
14075
  }
14098
14076
  if (!isNullOrUndefined(this.expandCollapseRec)) {
14099
- const resourceCount = this.parent.getRows();
14077
+ const resourceCount = this.parent.grid.pageSettings.pageSize;
14100
14078
  let sIndex = visualData.indexOf(this.expandCollapseRec);
14101
- const tempdata = visualData.slice(sIndex, sIndex + resourceCount.length);
14102
- if (tempdata.length < resourceCount.length && sIndex >= 0 && startIndex !== 0) {
14103
- 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;
14104
14082
  sIndex = sIndex > 0 ? sIndex : 0;
14105
- startIndex = sIndex;
14106
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
+ }
14107
14093
  }
14108
14094
  else if (getValue('isCollapseAll', this.parent)) {
14109
14095
  startIndex = 0;