@syncfusion/ej2-treegrid 28.1.35 → 28.1.36

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 (96) hide show
  1. package/dist/ej2-treegrid.min.js +1 -10
  2. package/dist/ej2-treegrid.umd.min.js +1 -10
  3. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-treegrid.es2015.js +34 -5
  5. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  6. package/dist/es6/ej2-treegrid.es5.js +34 -5
  7. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  8. package/dist/global/ej2-treegrid.min.js +1 -10
  9. package/dist/global/ej2-treegrid.min.js.map +1 -1
  10. package/dist/global/index.d.ts +0 -9
  11. package/package.json +6 -7
  12. package/src/treegrid/base/treegrid.js +28 -1
  13. package/src/treegrid/renderer/virtual-tree-content-render.js +6 -4
  14. package/styles/bds-lite.css +16 -12
  15. package/styles/bds.css +16 -12
  16. package/styles/bootstrap-dark-lite.css +23 -16
  17. package/styles/bootstrap-dark.css +23 -16
  18. package/styles/bootstrap-lite.css +34 -15
  19. package/styles/bootstrap.css +34 -15
  20. package/styles/bootstrap4-lite.css +23 -16
  21. package/styles/bootstrap4.css +23 -16
  22. package/styles/bootstrap5-dark-lite.css +23 -16
  23. package/styles/bootstrap5-dark.css +23 -16
  24. package/styles/bootstrap5-lite.css +23 -16
  25. package/styles/bootstrap5.3-lite.css +23 -16
  26. package/styles/bootstrap5.3.css +23 -16
  27. package/styles/bootstrap5.css +23 -16
  28. package/styles/fabric-dark-lite.css +23 -16
  29. package/styles/fabric-dark.css +23 -16
  30. package/styles/fabric-lite.css +23 -16
  31. package/styles/fabric.css +23 -16
  32. package/styles/fluent-dark-lite.css +23 -16
  33. package/styles/fluent-dark.css +23 -16
  34. package/styles/fluent-lite.css +23 -16
  35. package/styles/fluent.css +23 -16
  36. package/styles/fluent2-lite.css +23 -16
  37. package/styles/fluent2.css +23 -16
  38. package/styles/highcontrast-light-lite.css +23 -16
  39. package/styles/highcontrast-light.css +23 -16
  40. package/styles/highcontrast-lite.css +23 -16
  41. package/styles/highcontrast.css +23 -16
  42. package/styles/material-dark-lite.css +23 -16
  43. package/styles/material-dark.css +23 -16
  44. package/styles/material-lite.css +23 -16
  45. package/styles/material.css +23 -16
  46. package/styles/material3-dark-lite.css +23 -16
  47. package/styles/material3-dark.css +23 -16
  48. package/styles/material3-lite.css +23 -16
  49. package/styles/material3.css +23 -16
  50. package/styles/tailwind-dark-lite.css +23 -16
  51. package/styles/tailwind-dark.css +23 -16
  52. package/styles/tailwind-lite.css +23 -16
  53. package/styles/tailwind.css +23 -16
  54. package/styles/tailwind3-lite.css +23 -16
  55. package/styles/tailwind3.css +23 -16
  56. package/styles/treegrid/_icons.scss +8 -5
  57. package/styles/treegrid/_layout.scss +17 -13
  58. package/styles/treegrid/bds.css +16 -12
  59. package/styles/treegrid/bootstrap-dark.css +23 -16
  60. package/styles/treegrid/bootstrap.css +34 -15
  61. package/styles/treegrid/bootstrap4.css +23 -16
  62. package/styles/treegrid/bootstrap5-dark.css +23 -16
  63. package/styles/treegrid/bootstrap5.3.css +23 -16
  64. package/styles/treegrid/bootstrap5.css +23 -16
  65. package/styles/treegrid/fabric-dark.css +23 -16
  66. package/styles/treegrid/fabric.css +23 -16
  67. package/styles/treegrid/fluent-dark.css +23 -16
  68. package/styles/treegrid/fluent.css +23 -16
  69. package/styles/treegrid/fluent2.css +23 -16
  70. package/styles/treegrid/highcontrast-light.css +23 -16
  71. package/styles/treegrid/highcontrast.css +23 -16
  72. package/styles/treegrid/icons/_bootstrap-dark.scss +8 -5
  73. package/styles/treegrid/icons/_bootstrap.scss +24 -4
  74. package/styles/treegrid/icons/_bootstrap4.scss +8 -5
  75. package/styles/treegrid/icons/_bootstrap5.3.scss +8 -5
  76. package/styles/treegrid/icons/_bootstrap5.scss +8 -5
  77. package/styles/treegrid/icons/_fabric-dark.scss +8 -5
  78. package/styles/treegrid/icons/_fabric.scss +8 -5
  79. package/styles/treegrid/icons/_fluent.scss +8 -5
  80. package/styles/treegrid/icons/_fluent2.scss +8 -5
  81. package/styles/treegrid/icons/_fusionnew.scss +8 -5
  82. package/styles/treegrid/icons/_highcontrast-light.scss +8 -5
  83. package/styles/treegrid/icons/_highcontrast.scss +8 -5
  84. package/styles/treegrid/icons/_material-dark.scss +8 -5
  85. package/styles/treegrid/icons/_material.scss +8 -5
  86. package/styles/treegrid/icons/_material3.scss +8 -5
  87. package/styles/treegrid/icons/_tailwind-dark.scss +9 -6
  88. package/styles/treegrid/icons/_tailwind.scss +8 -5
  89. package/styles/treegrid/icons/_tailwind3.scss +8 -5
  90. package/styles/treegrid/material-dark.css +23 -16
  91. package/styles/treegrid/material.css +23 -16
  92. package/styles/treegrid/material3-dark.css +23 -16
  93. package/styles/treegrid/material3.css +23 -16
  94. package/styles/treegrid/tailwind-dark.css +23 -16
  95. package/styles/treegrid/tailwind.css +23 -16
  96. package/styles/treegrid/tailwind3.css +23 -16
@@ -4010,8 +4010,10 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4010
4010
  const freezePresent = this.injectedModules.filter((e) => {
4011
4011
  return e.prototype.getModuleName() === 'freeze';
4012
4012
  });
4013
+ const hasFreezeProp = Array.isArray(this.columns) &&
4014
+ this.columns.some((col) => !!col.freeze);
4013
4015
  if ((this.frozenColumns || this.frozenRows || this.getFrozenColumns() ||
4014
- this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount()) && freezePresent.length > 0) {
4016
+ hasFreezeProp) && freezePresent.length > 0) {
4015
4017
  modules.push({
4016
4018
  member: 'freeze', args: [this],
4017
4019
  name: 'Freeze'
@@ -6394,6 +6396,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6394
6396
  }
6395
6397
  // Internal method to handle the rows expand
6396
6398
  expandRows(row, record, parentRec) {
6399
+ const initialTotalRecordsCount = this.grid.totalDataRecordsCount;
6397
6400
  this.expandCollapse('expand', row, record);
6398
6401
  const children = 'Children';
6399
6402
  if (!(isRemoteData(this) && !isOffline(this)) && (!isCountRequired(this) || !isNullOrUndefined(record[`${children}`]))) {
@@ -6414,6 +6417,18 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6414
6417
  this.trigger(expanded, expandArgs);
6415
6418
  }
6416
6419
  }
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
+ }
6417
6432
  }
6418
6433
  expandCollapseAllChildren(record, action, key, level) {
6419
6434
  if ((!isNullOrUndefined(key) && record[this.getPrimaryKeyFieldNames()[0]] !== key) ||
@@ -6528,6 +6543,18 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6528
6543
  this.grid.getContent().firstElementChild.scrollBy(0, this.grid.getRowHeight());
6529
6544
  }
6530
6545
  }
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
+ }
6531
6558
  }
6532
6559
  }
6533
6560
  updateExpandStateMapping(record, state) {
@@ -13402,7 +13429,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13402
13429
  dataBoundEvent() {
13403
13430
  const dataBoundEve = 'dataBound';
13404
13431
  const initialRowTop = 'initialRowTop';
13405
- if (this.parent.getRows().length && !isNullOrUndefined(this.parent.getRowByIndex(0)) && !this[`${initialRowTop}`]) {
13432
+ if (!isNullOrUndefined(this.parent.getRows()) && this.parent.getRows().length && !isNullOrUndefined(this.parent.getRowByIndex(0)) && !this[`${initialRowTop}`]) {
13406
13433
  const rowTop = this.parent.getRowByIndex(0).getBoundingClientRect().top;
13407
13434
  const gridTop = this.parent.element.getBoundingClientRect().top;
13408
13435
  if (rowTop > 0) {
@@ -13593,7 +13620,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13593
13620
  content = this.parent.getContent().querySelector('.e-content');
13594
13621
  }
13595
13622
  const scrollHeight = outBuffer * rowHeight;
13596
- const upScroll = (scrollArgs.offset.top - this.translateY) < 0;
13623
+ const upScroll = (scrollArgs.offset.top - this.translateY) < 0 && this.activeKey !== 'downArrow';
13597
13624
  const downScroll = Math.ceil(scrollArgs.offset.top - this.translateY) + rowHeight >= scrollHeight;
13598
13625
  const selectedRowIndex = 'selectedRowIndex';
13599
13626
  const currentViewData = this.parent.currentViewData;
@@ -13618,7 +13645,8 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13618
13645
  this.startIndex = (this.startIndex - remains) < 0 ? 0 : (this.startIndex - remains);
13619
13646
  }
13620
13647
  if (currentViewData.length && (currentViewData[0][`${indexValue}`] >= this.parent.pageSettings.pageSize / 2) &&
13621
- ((currentViewData[0][`${indexValue}`] - this.startIndex) < (this.parent.pageSettings.pageSize / 2)) && this.parent.selectionModule.isRowSelected) {
13648
+ ((currentViewData[0][`${indexValue}`] - this.startIndex) < (this.parent.pageSettings.pageSize / 2)) &&
13649
+ this.parent.selectionModule && this.parent.selectionModule.isRowSelected) {
13622
13650
  this.startIndex = currentViewData[0][`${indexValue}`] - (this.parent.pageSettings.pageSize / 2);
13623
13651
  this.endIndex = this.startIndex + this.parent.pageSettings.pageSize;
13624
13652
  }
@@ -13675,7 +13703,8 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
13675
13703
  this.startIndex = lastIndex - (this.parent.pageSettings.pageSize / 2);
13676
13704
  }
13677
13705
  if (currentViewData.length && this.startIndex > currentViewData[0][`${indexValue}`] &&
13678
- ((this.startIndex - currentViewData[0][`${indexValue}`]) < (this.parent.pageSettings.pageSize / 2)) && this.parent.selectionModule.isRowSelected) {
13706
+ ((this.startIndex - currentViewData[0][`${indexValue}`]) < (this.parent.pageSettings.pageSize / 2)) &&
13707
+ this.parent.selectionModule && this.parent.selectionModule.isRowSelected) {
13679
13708
  this.startIndex = currentViewData[0][`${indexValue}`] + (this.parent.pageSettings.pageSize / 2);
13680
13709
  }
13681
13710
  if (this.parent.root.isSelfReference) {