k-vtable 1.0.36 → 1.0.37

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 (83) hide show
  1. package/cjs/ListTable.d.ts +1 -0
  2. package/cjs/ListTable.js +11 -1
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotTable.js +12 -6
  5. package/cjs/PivotTable.js.map +1 -1
  6. package/cjs/core/BaseTable.js +11 -9
  7. package/cjs/core/BaseTable.js.map +1 -1
  8. package/cjs/event/event.js +3 -1
  9. package/cjs/event/event.js.map +1 -1
  10. package/cjs/event/listener/table-group.js +52 -52
  11. package/cjs/event/listener/table-group.js.map +1 -1
  12. package/cjs/index.d.ts +1 -1
  13. package/cjs/index.js +1 -1
  14. package/cjs/index.js.map +1 -1
  15. package/cjs/layout/pivot-header-layout.d.ts +2 -2
  16. package/cjs/layout/simple-header-layout.js +7 -7
  17. package/cjs/layout/simple-header-layout.js.map +1 -1
  18. package/cjs/plugins/list-tree-stick-cell.js +29 -3
  19. package/cjs/plugins/list-tree-stick-cell.js.map +1 -1
  20. package/cjs/scenegraph/component/custom.js +2 -2
  21. package/cjs/scenegraph/component/custom.js.map +1 -1
  22. package/cjs/scenegraph/component/table-component.js +41 -50
  23. package/cjs/scenegraph/component/table-component.js.map +1 -1
  24. package/cjs/scenegraph/component/util.d.ts +1 -0
  25. package/cjs/scenegraph/component/util.js +9 -3
  26. package/cjs/scenegraph/component/util.js.map +1 -1
  27. package/cjs/scenegraph/layout/compute-col-width.js +1 -1
  28. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  29. package/cjs/scenegraph/layout/compute-row-height.js +1 -1
  30. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  31. package/cjs/scenegraph/layout/frozen.js +7 -3
  32. package/cjs/scenegraph/layout/frozen.js.map +1 -1
  33. package/cjs/scenegraph/scenegraph.js +5 -3
  34. package/cjs/scenegraph/scenegraph.js.map +1 -1
  35. package/cjs/scenegraph/utils/padding.d.ts +5 -2
  36. package/cjs/scenegraph/utils/padding.js +16 -13
  37. package/cjs/scenegraph/utils/padding.js.map +1 -1
  38. package/cjs/state/state.js +15 -15
  39. package/cjs/state/state.js.map +1 -1
  40. package/cjs/vrender.js.map +1 -1
  41. package/dist/vtable.js +256 -125
  42. package/dist/vtable.min.js +1 -1
  43. package/es/ListTable.d.ts +1 -0
  44. package/es/ListTable.js +11 -1
  45. package/es/ListTable.js.map +1 -1
  46. package/es/PivotTable.js +12 -6
  47. package/es/PivotTable.js.map +1 -1
  48. package/es/core/BaseTable.js +11 -9
  49. package/es/core/BaseTable.js.map +1 -1
  50. package/es/event/event.js +3 -1
  51. package/es/event/event.js.map +1 -1
  52. package/es/event/listener/table-group.js +52 -52
  53. package/es/event/listener/table-group.js.map +1 -1
  54. package/es/index.d.ts +1 -1
  55. package/es/index.js +1 -1
  56. package/es/index.js.map +1 -1
  57. package/es/layout/pivot-header-layout.d.ts +2 -2
  58. package/es/layout/simple-header-layout.js +7 -7
  59. package/es/layout/simple-header-layout.js.map +1 -1
  60. package/es/plugins/list-tree-stick-cell.js +32 -2
  61. package/es/plugins/list-tree-stick-cell.js.map +1 -1
  62. package/es/scenegraph/component/custom.js +2 -2
  63. package/es/scenegraph/component/custom.js.map +1 -1
  64. package/es/scenegraph/component/table-component.js +41 -51
  65. package/es/scenegraph/component/table-component.js.map +1 -1
  66. package/es/scenegraph/component/util.d.ts +1 -0
  67. package/es/scenegraph/component/util.js +6 -0
  68. package/es/scenegraph/component/util.js.map +1 -1
  69. package/es/scenegraph/layout/compute-col-width.js +1 -1
  70. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  71. package/es/scenegraph/layout/compute-row-height.js +1 -1
  72. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  73. package/es/scenegraph/layout/frozen.js +7 -3
  74. package/es/scenegraph/layout/frozen.js.map +1 -1
  75. package/es/scenegraph/scenegraph.js +5 -3
  76. package/es/scenegraph/scenegraph.js.map +1 -1
  77. package/es/scenegraph/utils/padding.d.ts +5 -2
  78. package/es/scenegraph/utils/padding.js +13 -9
  79. package/es/scenegraph/utils/padding.js.map +1 -1
  80. package/es/state/state.js +15 -13
  81. package/es/state/state.js.map +1 -1
  82. package/es/vrender.js.map +1 -1
  83. package/package.json +2 -2
package/es/PivotTable.js CHANGED
@@ -714,23 +714,29 @@ export class PivotTable extends BaseTable {
714
714
  }
715
715
  }
716
716
  _refreshHierarchyState(col, row, recalculateColWidths = !0, beforeUpdateCell) {
717
- var _a, _b;
717
+ var _a, _b, _c;
718
718
  this.frozenColCount, this.frozenRowCount;
719
- const visibleStartRow = this.getBodyVisibleRowRange().rowStart;
719
+ const sizeTolerance = (null === (_a = this.options.customConfig) || void 0 === _a ? void 0 : _a._disableColumnAndRowSizeRound) ? 1 : 0, oldMaxScrollTop = (() => {
720
+ var _a, _b;
721
+ return Math.max(0, this.getAllRowsHeight() - (null !== (_b = null === (_a = this.scenegraph) || void 0 === _a ? void 0 : _a.height) && void 0 !== _b ? _b : this.tableNoFrameHeight) - sizeTolerance);
722
+ })(), isScrollToBottom = oldMaxScrollTop > 0 && this.scrollTop >= oldMaxScrollTop - 1, oldScrollTop = this.scrollTop, visibleStartRow = this.getBodyVisibleRowRange().rowStart;
720
723
  this.internalProps._oldRowCount = this.rowCount, this.internalProps._oldColCount = this.colCount;
721
724
  let notFillWidth = !1, notFillHeight = !1;
722
725
  this.stateManager.updateHoverIcon(col, row, void 0, void 0);
723
726
  const checkHasChart = this.internalProps.layoutMap.checkHasChart();
724
727
  checkHasChart && (this.autoFillWidth && (notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth),
725
728
  this.autoFillHeight && (notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight));
726
- const result = this.internalProps.layoutMap.isRowHeader(col, row) ? this.internalProps.layoutMap.toggleHierarchyState(col, row) : this.internalProps.layoutMap.toggleHierarchyStateForColumnTree(col, row);
729
+ const isChangeRowTree = this.internalProps.layoutMap.isRowHeader(col, row), oldHierarchyState = isChangeRowTree ? this.getHierarchyState(col, row) : void 0, shouldKeepBottomAfterToggle = isScrollToBottom && "expand" === oldHierarchyState, shouldKeepScrollAfterToggle = isChangeRowTree && !shouldKeepBottomAfterToggle, result = isChangeRowTree ? this.internalProps.layoutMap.toggleHierarchyState(col, row) : this.internalProps.layoutMap.toggleHierarchyStateForColumnTree(col, row);
727
730
  beforeUpdateCell && beforeUpdateCell(), this.refreshRowColCount();
728
731
  this.frozenColCount, this.frozenRowCount;
729
732
  this.clearCellStyleCache(), "tree" === this.rowHierarchyType && this.scenegraph.updateHierarchyIcon(col, row),
730
- null === (_a = this.reactCustomLayout) || void 0 === _a || _a.clearCache(), "grid-tree" !== this.rowHierarchyType && "grid-tree" !== this.columnHierarchyType ? this.scenegraph.updateRow(result.removeCellPositionsRowDirection, result.addCellPositionsRowDirection, result.updateCellPositionsRowDirection, recalculateColWidths) : (this.internalProps.stick.changedCells.clear(),
733
+ null === (_b = this.reactCustomLayout) || void 0 === _b || _b.clearCache(), "grid-tree" !== this.rowHierarchyType && "grid-tree" !== this.columnHierarchyType ? this.scenegraph.updateRow(result.removeCellPositionsRowDirection, result.addCellPositionsRowDirection, result.updateCellPositionsRowDirection, recalculateColWidths) : (this.internalProps.stick.changedCells.clear(),
731
734
  this.scenegraph.clearCells(), this.clearCellStyleCache(), this.scenegraph.createSceneGraph(),
732
- this.scrollToRow(visibleStartRow)), null === (_b = this.reactCustomLayout) || void 0 === _b || _b.updateAllCustomCell(),
733
- checkHasChart && (this.autoFillWidth && !notFillWidth && (notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth),
735
+ this.scrollToRow(visibleStartRow), shouldKeepBottomAfterToggle ? (this.clearCorrectTimer(),
736
+ this.setScrollTop(Number.MAX_SAFE_INTEGER)) : shouldKeepScrollAfterToggle && (this.clearCorrectTimer(),
737
+ this.setScrollTop(oldScrollTop))), null === (_c = this.reactCustomLayout) || void 0 === _c || _c.updateAllCustomCell(),
738
+ shouldKeepBottomAfterToggle ? (this.clearCorrectTimer(), this.setScrollTop(Number.MAX_SAFE_INTEGER)) : shouldKeepScrollAfterToggle && "grid-tree" !== this.rowHierarchyType && "grid-tree" !== this.columnHierarchyType && (this.clearCorrectTimer(),
739
+ this.setScrollTop(oldScrollTop)), checkHasChart && (this.autoFillWidth && !notFillWidth && (notFillWidth = this.getAllColsWidth() <= this.tableNoFrameWidth),
734
740
  this.autoFillHeight && !notFillHeight && (notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight),
735
741
  ("adaptive" === this.widthMode || notFillWidth || "adaptive" === this.heightMode || notFillHeight) && this.scenegraph.updateChartSizeForResizeColWidth(-1)),
736
742
  this.internalProps._oldRowCount = void 0, this.internalProps._oldColCount = void 0;