handsontable 18.0.0 → 18.1.0-rc7
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.
- package/3rdparty/walkontable/src/axisSizing/axisSizeSource.d.mts +1 -0
- package/3rdparty/walkontable/src/axisSizing/axisSizeSource.d.ts +55 -0
- package/3rdparty/walkontable/src/axisSizing/axisSizeSource.js +15 -0
- package/3rdparty/walkontable/src/axisSizing/axisSizeSource.mjs +14 -0
- package/3rdparty/walkontable/src/axisSizing/boxModel.d.mts +1 -0
- package/3rdparty/walkontable/src/axisSizing/boxModel.d.ts +32 -0
- package/3rdparty/walkontable/src/axisSizing/boxModel.js +45 -0
- package/3rdparty/walkontable/src/axisSizing/boxModel.mjs +33 -0
- package/3rdparty/walkontable/src/axisSizing/columnUtils.d.mts +2 -0
- package/3rdparty/walkontable/src/{utils/column.d.ts → axisSizing/columnUtils.d.ts} +12 -10
- package/3rdparty/walkontable/src/axisSizing/columnUtils.js +147 -0
- package/3rdparty/walkontable/src/axisSizing/columnUtils.mjs +142 -0
- package/3rdparty/walkontable/src/axisSizing/defaultSizeSource.d.mts +1 -0
- package/3rdparty/walkontable/src/axisSizing/defaultSizeSource.d.ts +58 -0
- package/3rdparty/walkontable/src/axisSizing/defaultSizeSource.js +129 -0
- package/3rdparty/walkontable/src/axisSizing/defaultSizeSource.mjs +119 -0
- package/3rdparty/walkontable/src/axisSizing/oversizedRows.d.mts +1 -0
- package/3rdparty/walkontable/src/axisSizing/oversizedRows.d.ts +162 -0
- package/3rdparty/walkontable/src/axisSizing/oversizedRows.js +424 -0
- package/3rdparty/walkontable/src/axisSizing/oversizedRows.mjs +522 -0
- package/3rdparty/walkontable/src/axisSizing/positionCache/index.d.ts +130 -0
- package/3rdparty/walkontable/src/axisSizing/positionCache/index.js +256 -0
- package/3rdparty/walkontable/src/axisSizing/positionCache/index.mjs +262 -0
- package/3rdparty/walkontable/src/axisSizing/positionCache/prefixSumStrategy.d.mts +1 -0
- package/3rdparty/walkontable/src/axisSizing/positionCache/prefixSumStrategy.d.ts +51 -0
- package/3rdparty/walkontable/src/axisSizing/positionCache/prefixSumStrategy.js +121 -0
- package/3rdparty/walkontable/src/axisSizing/positionCache/prefixSumStrategy.mjs +117 -0
- package/3rdparty/walkontable/src/axisSizing/positionCache/sparseStrategy.d.mts +1 -0
- package/3rdparty/walkontable/src/axisSizing/positionCache/sparseStrategy.d.ts +53 -0
- package/3rdparty/walkontable/src/axisSizing/positionCache/sparseStrategy.js +206 -0
- package/3rdparty/walkontable/src/axisSizing/positionCache/sparseStrategy.mjs +203 -0
- package/3rdparty/walkontable/src/axisSizing/positionCache/strategy.d.mts +1 -0
- package/3rdparty/walkontable/src/axisSizing/positionCache/strategy.d.ts +53 -0
- package/3rdparty/walkontable/src/axisSizing/positionCache/strategy.js +40 -0
- package/3rdparty/walkontable/src/axisSizing/positionCache/strategy.mjs +41 -0
- package/3rdparty/walkontable/src/axisSizing/positionCache/uniformStrategy.d.mts +1 -0
- package/3rdparty/walkontable/src/axisSizing/positionCache/uniformStrategy.d.ts +47 -0
- package/3rdparty/walkontable/src/axisSizing/positionCache/uniformStrategy.js +121 -0
- package/3rdparty/walkontable/src/axisSizing/positionCache/uniformStrategy.mjs +115 -0
- package/3rdparty/walkontable/src/axisSizing/rowUtils.d.mts +2 -0
- package/3rdparty/walkontable/src/{utils/row.d.ts → axisSizing/rowUtils.d.ts} +11 -9
- package/3rdparty/walkontable/src/axisSizing/rowUtils.js +111 -0
- package/3rdparty/walkontable/src/axisSizing/rowUtils.mjs +106 -0
- package/3rdparty/walkontable/src/axisSizing/sizeGetters.d.mts +2 -0
- package/3rdparty/walkontable/src/axisSizing/sizeGetters.d.ts +84 -0
- package/3rdparty/walkontable/src/axisSizing/sizeGetters.js +102 -0
- package/3rdparty/walkontable/src/axisSizing/sizeGetters.mjs +92 -0
- package/3rdparty/walkontable/src/calculator/axisCalculation.d.ts +1 -1
- package/3rdparty/walkontable/src/calculator/calculationType/renderedColumns.d.ts +10 -0
- package/3rdparty/walkontable/src/calculator/calculationType/renderedColumns.js +10 -1
- package/3rdparty/walkontable/src/calculator/calculationType/renderedColumns.mjs +10 -1
- package/3rdparty/walkontable/src/calculator/calculationType/renderedRows.d.ts +9 -0
- package/3rdparty/walkontable/src/calculator/calculationType/renderedRows.js +9 -1
- package/3rdparty/walkontable/src/calculator/calculationType/renderedRows.mjs +9 -1
- package/3rdparty/walkontable/src/calculator/viewportColumns.d.ts +1 -1
- package/3rdparty/walkontable/src/calculator/viewportRows.d.ts +1 -1
- package/3rdparty/walkontable/src/cell/range.d.ts +10 -0
- package/3rdparty/walkontable/src/cell/range.js +14 -3
- package/3rdparty/walkontable/src/cell/range.mjs +11 -0
- package/3rdparty/walkontable/src/core/_base.d.ts +21 -21
- package/3rdparty/walkontable/src/core/_base.js +58 -147
- package/3rdparty/walkontable/src/core/_base.mjs +17 -147
- package/3rdparty/walkontable/src/core/clone.d.ts +4 -14
- package/3rdparty/walkontable/src/core/clone.js +51 -5
- package/3rdparty/walkontable/src/core/clone.mjs +10 -5
- package/3rdparty/walkontable/src/core/core.d.ts +1 -5
- package/3rdparty/walkontable/src/core/core.js +52 -47
- package/3rdparty/walkontable/src/core/core.mjs +12 -48
- package/3rdparty/walkontable/src/domMeasure/geometryReader.d.mts +1 -0
- package/3rdparty/walkontable/src/domMeasure/geometryReader.d.ts +172 -0
- package/3rdparty/walkontable/src/domMeasure/geometryReader.js +19 -0
- package/3rdparty/walkontable/src/domMeasure/geometryReader.mjs +16 -0
- package/3rdparty/walkontable/src/domMeasure/liveGeometryReader.d.mts +1 -0
- package/3rdparty/walkontable/src/domMeasure/liveGeometryReader.d.ts +134 -0
- package/3rdparty/walkontable/src/domMeasure/liveGeometryReader.js +200 -0
- package/3rdparty/walkontable/src/domMeasure/liveGeometryReader.mjs +198 -0
- package/3rdparty/walkontable/src/event.d.ts +25 -12
- package/3rdparty/walkontable/src/event.js +91 -224
- package/3rdparty/walkontable/src/event.mjs +90 -224
- package/3rdparty/walkontable/src/facade/core.d.ts +6 -6
- package/3rdparty/walkontable/src/index.d.ts +1 -1
- package/3rdparty/walkontable/src/index.js +2 -2
- package/3rdparty/walkontable/src/index.mjs +1 -1
- package/3rdparty/walkontable/src/overlay/index.d.ts +6 -6
- package/3rdparty/walkontable/src/overlay/index.js +11 -11
- package/3rdparty/walkontable/src/overlay/index.mjs +6 -6
- package/3rdparty/walkontable/src/overlay/overlays.d.ts +375 -0
- package/3rdparty/walkontable/src/overlay/overlays.js +612 -0
- package/3rdparty/walkontable/src/overlay/overlays.mjs +601 -0
- package/3rdparty/walkontable/src/overlay/{_base.d.ts → regions/_base.d.ts} +65 -16
- package/3rdparty/walkontable/src/overlay/{_base.js → regions/_base.js} +160 -50
- package/3rdparty/walkontable/src/overlay/{_base.mjs → regions/_base.mjs} +163 -47
- package/3rdparty/walkontable/src/overlay/regions/bottomInlineStartCornerOverlay.d.mts +1 -0
- package/3rdparty/walkontable/src/overlay/{bottomInlineStartCorner.d.ts → regions/bottomInlineStartCornerOverlay.d.ts} +5 -10
- package/3rdparty/walkontable/src/overlay/{bottomInlineStartCorner.js → regions/bottomInlineStartCornerOverlay.js} +18 -20
- package/3rdparty/walkontable/src/overlay/{bottomInlineStartCorner.mjs → regions/bottomInlineStartCornerOverlay.mjs} +18 -20
- package/3rdparty/walkontable/src/overlay/regions/bottomOverlay.d.mts +1 -0
- package/3rdparty/walkontable/src/overlay/{bottom.d.ts → regions/bottomOverlay.d.ts} +16 -11
- package/3rdparty/walkontable/src/overlay/{bottom.js → regions/bottomOverlay.js} +113 -66
- package/3rdparty/walkontable/src/overlay/{bottom.mjs → regions/bottomOverlay.mjs} +113 -66
- package/3rdparty/walkontable/src/overlay/regions/inlineStartOverlay.d.mts +1 -0
- package/3rdparty/walkontable/src/overlay/{inlineStart.d.ts → regions/inlineStartOverlay.d.ts} +17 -11
- package/3rdparty/walkontable/src/overlay/{inlineStart.js → regions/inlineStartOverlay.js} +122 -67
- package/3rdparty/walkontable/src/overlay/{inlineStart.mjs → regions/inlineStartOverlay.mjs} +122 -67
- package/3rdparty/walkontable/src/overlay/regions/topInlineStartCornerOverlay.d.mts +1 -0
- package/3rdparty/walkontable/src/overlay/{topInlineStartCorner.d.ts → regions/topInlineStartCornerOverlay.d.ts} +5 -10
- package/3rdparty/walkontable/src/overlay/{topInlineStartCorner.js → regions/topInlineStartCornerOverlay.js} +13 -16
- package/3rdparty/walkontable/src/overlay/{topInlineStartCorner.mjs → regions/topInlineStartCornerOverlay.mjs} +13 -16
- package/3rdparty/walkontable/src/overlay/regions/topOverlay.d.mts +1 -0
- package/3rdparty/walkontable/src/overlay/{top.d.ts → regions/topOverlay.d.ts} +32 -11
- package/3rdparty/walkontable/src/overlay/{top.js → regions/topOverlay.js} +163 -77
- package/3rdparty/walkontable/src/overlay/{top.mjs → regions/topOverlay.mjs} +163 -77
- package/3rdparty/walkontable/src/overlay/resizeMonitor.d.mts +1 -0
- package/3rdparty/walkontable/src/overlay/resizeMonitor.d.ts +49 -0
- package/3rdparty/walkontable/src/overlay/resizeMonitor.js +154 -0
- package/3rdparty/walkontable/src/overlay/resizeMonitor.mjs +153 -0
- package/3rdparty/walkontable/src/overlay/scroll/nativeScrollInput.d.mts +1 -0
- package/3rdparty/walkontable/src/overlay/scroll/nativeScrollInput.d.ts +62 -0
- package/3rdparty/walkontable/src/overlay/scroll/nativeScrollInput.js +290 -0
- package/3rdparty/walkontable/src/overlay/scroll/nativeScrollInput.mjs +295 -0
- package/3rdparty/walkontable/src/overlay/scroll/scrollSync.d.mts +1 -0
- package/3rdparty/walkontable/src/overlay/scroll/scrollSync.d.ts +176 -0
- package/3rdparty/walkontable/src/overlay/scroll/scrollSync.js +549 -0
- package/3rdparty/walkontable/src/overlay/scroll/scrollSync.mjs +557 -0
- package/3rdparty/walkontable/src/overlay/spreaderSize.d.mts +1 -0
- package/3rdparty/walkontable/src/overlay/spreaderSize.d.ts +67 -0
- package/3rdparty/walkontable/src/overlay/spreaderSize.js +178 -0
- package/3rdparty/walkontable/src/overlay/spreaderSize.mjs +179 -0
- package/3rdparty/walkontable/src/{stickyScrollStrategy.d.ts → overlay/strategies/stickyScrollStrategy.d.ts} +33 -21
- package/3rdparty/walkontable/src/{stickyScrollStrategy.js → overlay/strategies/stickyScrollStrategy.js} +60 -41
- package/3rdparty/walkontable/src/{stickyScrollStrategy.mjs → overlay/strategies/stickyScrollStrategy.mjs} +58 -38
- package/3rdparty/walkontable/src/ports.d.mts +1 -0
- package/3rdparty/walkontable/src/ports.d.ts +54 -0
- package/3rdparty/walkontable/src/ports.js +23 -0
- package/3rdparty/walkontable/src/ports.mjs +24 -0
- package/3rdparty/walkontable/src/{renderer → render}/_base.d.ts +1 -1
- package/3rdparty/walkontable/src/{renderer → render}/cells.js +1 -1
- package/3rdparty/walkontable/src/{renderer → render}/cells.mjs +1 -1
- package/3rdparty/walkontable/src/{renderer → render}/columnHeaders.d.ts +1 -0
- package/3rdparty/walkontable/src/{renderer → render}/columnHeaders.js +43 -1
- package/3rdparty/walkontable/src/{renderer → render}/columnHeaders.mjs +44 -2
- package/3rdparty/walkontable/src/render/index.d.mts +1 -0
- package/3rdparty/walkontable/src/{renderer → render}/index.d.ts +11 -3
- package/3rdparty/walkontable/src/{renderer → render}/index.js +13 -3
- package/3rdparty/walkontable/src/{renderer → render}/index.mjs +11 -1
- package/3rdparty/walkontable/src/{renderer → render}/rows.js +1 -1
- package/3rdparty/walkontable/src/{renderer → render}/rows.mjs +1 -1
- package/3rdparty/walkontable/src/render/tableRenderer.d.mts +1 -0
- package/3rdparty/walkontable/src/{renderer/table.d.ts → render/tableRenderer.d.ts} +12 -2
- package/3rdparty/walkontable/src/render/tableRenderer.js +382 -0
- package/3rdparty/walkontable/src/{renderer/table.mjs → render/tableRenderer.mjs} +159 -6
- package/3rdparty/walkontable/src/{scroll.d.ts → scroll/scroll.d.ts} +27 -10
- package/3rdparty/walkontable/src/{scroll.js → scroll/scroll.js} +108 -32
- package/3rdparty/walkontable/src/{scroll.mjs → scroll/scroll.mjs} +106 -29
- package/3rdparty/walkontable/src/selection/border/border.d.ts +313 -5
- package/3rdparty/walkontable/src/selection/border/border.js +861 -51
- package/3rdparty/walkontable/src/selection/border/border.mjs +863 -53
- package/3rdparty/walkontable/src/selection/border/types.d.ts +30 -0
- package/3rdparty/walkontable/src/selection/manager.js +237 -0
- package/3rdparty/walkontable/src/selection/manager.mjs +238 -1
- package/3rdparty/walkontable/src/settings/accessor.d.mts +2 -0
- package/3rdparty/walkontable/src/settings/accessor.d.ts +74 -0
- package/3rdparty/walkontable/src/settings/accessor.js +78 -0
- package/3rdparty/walkontable/src/settings/accessor.mjs +71 -0
- package/3rdparty/walkontable/src/settings/defaults.d.mts +1 -0
- package/3rdparty/walkontable/src/{settings.d.ts → settings/defaults.d.ts} +16 -77
- package/3rdparty/walkontable/src/settings/defaults.js +146 -0
- package/3rdparty/walkontable/src/settings/defaults.mjs +225 -0
- package/3rdparty/walkontable/src/settings/index.d.mts +1 -0
- package/3rdparty/walkontable/src/settings/index.d.ts +6 -0
- package/3rdparty/walkontable/src/settings/index.js +20 -0
- package/3rdparty/walkontable/src/settings/index.mjs +5 -0
- package/3rdparty/walkontable/src/table/baseTable.d.mts +2 -0
- package/3rdparty/walkontable/src/table/baseTable.d.ts +284 -0
- package/3rdparty/walkontable/src/table/baseTable.js +295 -0
- package/3rdparty/walkontable/src/table/baseTable.mjs +283 -0
- package/3rdparty/walkontable/src/table/cellAccess.d.mts +1 -0
- package/3rdparty/walkontable/src/table/cellAccess.d.ts +101 -0
- package/3rdparty/walkontable/src/table/cellAccess.js +238 -0
- package/3rdparty/walkontable/src/table/cellAccess.mjs +229 -0
- package/3rdparty/walkontable/src/table/domScaffold.d.mts +1 -0
- package/3rdparty/walkontable/src/table/domScaffold.d.ts +37 -0
- package/3rdparty/walkontable/src/table/domScaffold.js +145 -0
- package/3rdparty/walkontable/src/table/domScaffold.mjs +136 -0
- package/3rdparty/walkontable/src/table/drawCycle.d.mts +1 -0
- package/3rdparty/walkontable/src/table/drawCycle.d.ts +16 -0
- package/3rdparty/walkontable/src/table/drawCycle.js +405 -0
- package/3rdparty/walkontable/src/table/drawCycle.mjs +403 -0
- package/3rdparty/walkontable/src/table/rangeQuery/renderedRange.d.mts +1 -0
- package/3rdparty/walkontable/src/table/rangeQuery/renderedRange.d.ts +38 -0
- package/3rdparty/walkontable/src/table/rangeQuery/renderedRange.js +15 -0
- package/3rdparty/walkontable/src/table/rangeQuery/renderedRange.mjs +14 -0
- package/3rdparty/walkontable/src/table/{mixin → rangeQuery}/stickyColumnsStart.d.ts +1 -1
- package/3rdparty/walkontable/src/table/{mixin → rangeQuery}/stickyColumnsStart.js +1 -1
- package/3rdparty/walkontable/src/table/{mixin → rangeQuery}/stickyColumnsStart.mjs +1 -1
- package/3rdparty/walkontable/src/table/{mixin → rangeQuery}/stickyRowsBottom.d.ts +1 -1
- package/3rdparty/walkontable/src/table/{mixin → rangeQuery}/stickyRowsTop.d.ts +1 -1
- package/3rdparty/walkontable/src/table/{mixin → rangeQuery}/stickyRowsTop.js +1 -1
- package/3rdparty/walkontable/src/table/{mixin → rangeQuery}/stickyRowsTop.mjs +1 -1
- package/3rdparty/walkontable/src/table/rangeQuery/viewportPredicates.d.mts +2 -0
- package/3rdparty/walkontable/src/table/rangeQuery/viewportPredicates.d.ts +226 -0
- package/3rdparty/walkontable/src/table/rangeQuery/viewportPredicates.js +251 -0
- package/3rdparty/walkontable/src/table/rangeQuery/viewportPredicates.mjs +241 -0
- package/3rdparty/walkontable/src/table/rangeQuery/virtualRange.d.mts +1 -0
- package/3rdparty/walkontable/src/table/rangeQuery/virtualRange.d.ts +14 -0
- package/3rdparty/walkontable/src/table/rangeQuery/virtualRange.js +196 -0
- package/3rdparty/walkontable/src/table/rangeQuery/virtualRange.mjs +179 -0
- package/3rdparty/walkontable/src/table/regions/bottomInlineStartCornerTable.d.mts +2 -0
- package/3rdparty/walkontable/src/table/regions/bottomInlineStartCornerTable.d.ts +16 -0
- package/3rdparty/walkontable/src/table/{bottomInlineStartCorner.js → regions/bottomInlineStartCornerTable.js} +9 -12
- package/3rdparty/walkontable/src/table/regions/bottomInlineStartCornerTable.mjs +21 -0
- package/3rdparty/walkontable/src/table/regions/bottomTable.d.mts +2 -0
- package/3rdparty/walkontable/src/table/regions/bottomTable.d.ts +15 -0
- package/3rdparty/walkontable/src/table/regions/bottomTable.js +35 -0
- package/3rdparty/walkontable/src/table/regions/bottomTable.mjs +20 -0
- package/3rdparty/walkontable/src/table/regions/inlineStartTable.d.mts +2 -0
- package/3rdparty/walkontable/src/table/regions/inlineStartTable.d.ts +12 -0
- package/3rdparty/walkontable/src/table/regions/inlineStartTable.js +32 -0
- package/3rdparty/walkontable/src/table/regions/inlineStartTable.mjs +17 -0
- package/3rdparty/walkontable/src/table/regions/masterTable.d.mts +2 -0
- package/3rdparty/walkontable/src/table/{master.d.ts → regions/masterTable.d.ts} +4 -13
- package/3rdparty/walkontable/src/table/{master.js → regions/masterTable.js} +23 -48
- package/3rdparty/walkontable/src/table/{master.mjs → regions/masterTable.mjs} +22 -47
- package/3rdparty/walkontable/src/table/regions/topInlineStartCornerTable.d.mts +2 -0
- package/3rdparty/walkontable/src/table/regions/topInlineStartCornerTable.d.ts +16 -0
- package/3rdparty/walkontable/src/table/{topInlineStartCorner.js → regions/topInlineStartCornerTable.js} +9 -12
- package/3rdparty/walkontable/src/table/regions/topInlineStartCornerTable.mjs +21 -0
- package/3rdparty/walkontable/src/table/regions/topTable.d.mts +2 -0
- package/3rdparty/walkontable/src/table/regions/topTable.d.ts +15 -0
- package/3rdparty/walkontable/src/table/regions/topTable.js +35 -0
- package/3rdparty/walkontable/src/table/regions/topTable.mjs +20 -0
- package/3rdparty/walkontable/src/types.d.ts +7 -69
- package/3rdparty/walkontable/src/types.mjs +2 -1
- package/3rdparty/walkontable/src/utils/pointerToCoords.d.mts +1 -0
- package/3rdparty/walkontable/src/utils/{cellCoords.d.ts → pointerToCoords.d.ts} +24 -0
- package/3rdparty/walkontable/src/utils/pointerToCoords.js +181 -0
- package/3rdparty/walkontable/src/utils/pointerToCoords.mjs +186 -0
- package/3rdparty/walkontable/src/viewport/boxLayout/gatherLayoutInput.d.mts +1 -0
- package/3rdparty/walkontable/src/viewport/boxLayout/gatherLayoutInput.d.ts +40 -0
- package/3rdparty/walkontable/src/viewport/boxLayout/gatherLayoutInput.js +139 -0
- package/3rdparty/walkontable/src/viewport/boxLayout/gatherLayoutInput.mjs +131 -0
- package/3rdparty/walkontable/src/viewport/boxLayout/layoutSnapshot.d.mts +1 -0
- package/3rdparty/walkontable/src/viewport/boxLayout/layoutSnapshot.d.ts +133 -0
- package/3rdparty/walkontable/src/viewport/boxLayout/layoutSnapshot.js +18 -0
- package/3rdparty/walkontable/src/viewport/boxLayout/layoutSnapshot.mjs +18 -0
- package/3rdparty/walkontable/src/viewport/boxLayout/resolveLayout.d.mts +1 -0
- package/3rdparty/walkontable/src/viewport/boxLayout/resolveLayout.d.ts +17 -0
- package/3rdparty/walkontable/src/viewport/boxLayout/resolveLayout.js +104 -0
- package/3rdparty/walkontable/src/viewport/boxLayout/resolveLayout.mjs +99 -0
- package/3rdparty/walkontable/src/viewport/calculatorFactory.d.mts +1 -0
- package/3rdparty/walkontable/src/viewport/calculatorFactory.d.ts +84 -0
- package/3rdparty/walkontable/src/viewport/calculatorFactory.js +588 -0
- package/3rdparty/walkontable/src/viewport/calculatorFactory.mjs +601 -0
- package/3rdparty/walkontable/src/viewport/viewport.d.ts +267 -0
- package/3rdparty/walkontable/src/viewport/viewport.js +368 -0
- package/3rdparty/walkontable/src/viewport/viewport.mjs +360 -0
- package/3rdparty/walkontable/src/viewport/workspaceSize.d.mts +1 -0
- package/3rdparty/walkontable/src/viewport/workspaceSize.d.ts +59 -0
- package/3rdparty/walkontable/src/viewport/workspaceSize.js +284 -0
- package/3rdparty/walkontable/src/viewport/workspaceSize.mjs +282 -0
- package/3rdparty/walkontable/src/wire.d.mts +1 -0
- package/3rdparty/walkontable/src/wire.d.ts +81 -0
- package/3rdparty/walkontable/src/wire.js +56 -0
- package/3rdparty/walkontable/src/wire.mjs +56 -0
- package/CHANGELOG.md +114 -1
- package/LICENSE.txt +1 -1
- package/README.md +2 -2
- package/base.d.ts +13 -4
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/cellTypes/checkboxType/accessors/valueSetter.d.ts +1 -1
- package/cellTypes/checkboxType/accessors/valueSetter.js +3 -1
- package/cellTypes/checkboxType/accessors/valueSetter.mjs +3 -1
- package/cellTypes/index.d.ts +3 -2
- package/cellTypes/index.js +9 -0
- package/cellTypes/index.mjs +5 -2
- package/cellTypes/intlDatetimeType/index.d.mts +1 -0
- package/cellTypes/intlDatetimeType/index.d.ts +1 -0
- package/cellTypes/intlDatetimeType/index.js +19 -0
- package/cellTypes/intlDatetimeType/index.mjs +1 -0
- package/cellTypes/intlDatetimeType/intlDatetimeType.d.mts +1 -0
- package/cellTypes/intlDatetimeType/intlDatetimeType.d.ts +16 -0
- package/cellTypes/intlDatetimeType/intlDatetimeType.js +31 -0
- package/cellTypes/intlDatetimeType/intlDatetimeType.mjs +15 -0
- package/cellTypes/multiSelectType/index.d.ts +1 -1
- package/cellTypes/multiSelectType/index.js +3 -0
- package/cellTypes/multiSelectType/index.mjs +1 -1
- package/cellTypes/multiSelectType/multiSelectType.d.ts +1 -0
- package/cellTypes/multiSelectType/multiSelectType.js +4 -0
- package/cellTypes/multiSelectType/multiSelectType.mjs +1 -0
- package/cellTypes/numericType/accessors/valueSetter.js +30 -2
- package/cellTypes/numericType/accessors/valueSetter.mjs +31 -3
- package/core/hooks/bucket.d.ts +40 -6
- package/core/hooks/bucket.js +108 -72
- package/core/hooks/bucket.mjs +113 -72
- package/core/hooks/constants.js +254 -16
- package/core/hooks/constants.mjs +254 -16
- package/core/hooks/index.js +27 -22
- package/core/hooks/index.mjs +27 -22
- package/core/layout/constants.d.ts +11 -0
- package/core/layout/constants.js +6 -0
- package/core/layout/constants.mjs +12 -0
- package/core/layout/domSlot.d.ts +3 -1
- package/core/layout/domSlot.js +16 -2
- package/core/layout/domSlot.mjs +16 -2
- package/core/layout/index.d.ts +2 -2
- package/core/layout/index.js +6 -0
- package/core/layout/index.mjs +2 -2
- package/core/layout/layoutManager.d.ts +13 -0
- package/core/layout/layoutManager.js +21 -4
- package/core/layout/layoutManager.mjs +22 -2
- package/core/settings.d.ts +102 -6
- package/core/types.d.ts +15 -1
- package/core/types.mjs +9 -0
- package/core.js +534 -88
- package/core.mjs +537 -91
- package/dataMap/dataMap.d.ts +3 -13
- package/dataMap/dataMap.js +100 -41
- package/dataMap/dataMap.mjs +101 -42
- package/dataMap/dataSource.js +4 -1
- package/dataMap/dataSource.mjs +4 -1
- package/dataMap/metaManager/index.d.ts +62 -8
- package/dataMap/metaManager/index.js +66 -0
- package/dataMap/metaManager/index.mjs +66 -0
- package/dataMap/metaManager/lazyFactoryMap.d.ts +68 -43
- package/dataMap/metaManager/lazyFactoryMap.js +497 -110
- package/dataMap/metaManager/lazyFactoryMap.mjs +511 -111
- package/dataMap/metaManager/metaLayers/cellMeta.d.ts +55 -8
- package/dataMap/metaManager/metaLayers/cellMeta.js +108 -8
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +108 -8
- package/dataMap/metaManager/metaLayers/columnMeta.d.ts +2 -1
- package/dataMap/metaManager/metaLayers/columnMeta.js +1 -0
- package/dataMap/metaManager/metaLayers/columnMeta.mjs +1 -0
- package/dataMap/metaManager/metaSchema.js +759 -39
- package/dataMap/metaManager/metaSchema.mjs +759 -39
- package/dataMap/metaManager/mods/dynamicCellMeta.d.ts +24 -10
- package/dataMap/metaManager/mods/dynamicCellMeta.js +252 -28
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +253 -29
- package/dataMap/sourceDataValidator.d.ts +13 -21
- package/dataMap/sourceDataValidator.js +39 -29
- package/dataMap/sourceDataValidator.mjs +50 -33
- package/dist/handsontable.full.js +30027 -11261
- package/dist/handsontable.full.min.js +168 -112
- package/dist/handsontable.js +32468 -13762
- package/dist/handsontable.min.js +172 -116
- package/dist/languages/all.js +2 -1
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/fa-IR.js +2 -1
- package/dist/languages/fa-IR.min.js +1 -1
- package/dist/themes/classic.js +9 -3
- package/dist/themes/classic.min.js +4 -4
- package/dist/themes/horizon.js +9 -3
- package/dist/themes/horizon.min.js +4 -4
- package/dist/themes/main.js +9 -3
- package/dist/themes/main.min.js +4 -4
- package/dist/themes/static/variables/colors/ant.js +3 -3
- package/dist/themes/static/variables/colors/ant.min.js +3 -3
- package/dist/themes/static/variables/colors/classic.js +3 -3
- package/dist/themes/static/variables/colors/classic.min.js +3 -3
- package/dist/themes/static/variables/colors/horizon.js +3 -3
- package/dist/themes/static/variables/colors/horizon.min.js +3 -3
- package/dist/themes/static/variables/colors/main.js +3 -3
- package/dist/themes/static/variables/colors/main.min.js +3 -3
- package/dist/themes/static/variables/colors/material.js +3 -3
- package/dist/themes/static/variables/colors/material.min.js +3 -3
- package/dist/themes/static/variables/colors/shadcn.js +3 -3
- package/dist/themes/static/variables/colors/shadcn.min.js +3 -3
- package/dist/themes/static/variables/density.js +3 -3
- package/dist/themes/static/variables/density.min.js +3 -3
- package/dist/themes/static/variables/helpers/iconsMap.js +4 -9
- package/dist/themes/static/variables/helpers/iconsMap.min.js +4 -9
- package/dist/themes/static/variables/icons/horizon.js +3 -3
- package/dist/themes/static/variables/icons/horizon.min.js +3 -3
- package/dist/themes/static/variables/icons/main.js +3 -3
- package/dist/themes/static/variables/icons/main.min.js +3 -3
- package/dist/themes/static/variables/sizing.js +3 -3
- package/dist/themes/static/variables/sizing.min.js +3 -3
- package/dist/themes/static/variables/tokens/classic.js +9 -3
- package/dist/themes/static/variables/tokens/classic.min.js +4 -4
- package/dist/themes/static/variables/tokens/horizon.js +9 -3
- package/dist/themes/static/variables/tokens/horizon.min.js +4 -4
- package/dist/themes/static/variables/tokens/main.js +9 -3
- package/dist/themes/static/variables/tokens/main.min.js +4 -4
- package/editorManager.js +152 -3
- package/editorManager.mjs +152 -3
- package/editors/autocompleteEditor/autocompleteEditor.js +58 -11
- package/editors/autocompleteEditor/autocompleteEditor.mjs +59 -12
- package/editors/baseEditor/baseEditor.d.ts +15 -3
- package/editors/baseEditor/baseEditor.js +5 -3
- package/editors/baseEditor/baseEditor.mjs +15 -3
- package/editors/factory.js +5 -2
- package/editors/factory.mjs +5 -2
- package/editors/index.d.ts +3 -2
- package/editors/index.js +8 -0
- package/editors/index.mjs +3 -1
- package/editors/intlDatetimeEditor/index.d.mts +1 -0
- package/editors/intlDatetimeEditor/index.d.ts +1 -0
- package/editors/intlDatetimeEditor/index.js +19 -0
- package/editors/intlDatetimeEditor/index.mjs +1 -0
- package/editors/intlDatetimeEditor/intlDatetimeEditor.d.mts +1 -0
- package/editors/intlDatetimeEditor/intlDatetimeEditor.d.ts +42 -0
- package/editors/intlDatetimeEditor/intlDatetimeEditor.js +108 -0
- package/editors/intlDatetimeEditor/intlDatetimeEditor.mjs +93 -0
- package/editors/multiSelectEditor/multiSelectEditor.js +11 -9
- package/editors/multiSelectEditor/multiSelectEditor.mjs +12 -10
- package/editors/selectEditor/selectEditor.js +2 -1
- package/editors/selectEditor/selectEditor.mjs +2 -1
- package/editors/textEditor/textEditor.js +1 -1
- package/editors/textEditor/textEditor.mjs +2 -2
- package/eventManager.d.ts +3 -3
- package/focusManager/grid.d.ts +28 -0
- package/focusManager/grid.js +85 -2
- package/focusManager/grid.mjs +81 -3
- package/focusManager/scopeManager.js +1 -1
- package/focusManager/scopeManager.mjs +2 -2
- package/handsontable-non-commercial-license.pdf +0 -0
- package/helpers/array.d.ts +25 -0
- package/helpers/array.js +41 -4
- package/helpers/array.mjs +56 -4
- package/helpers/console.d.ts +25 -3
- package/helpers/console.js +40 -7
- package/helpers/console.mjs +52 -7
- package/helpers/dateTime.d.ts +14 -0
- package/helpers/dateTime.js +74 -2
- package/helpers/dateTime.mjs +73 -2
- package/helpers/dom/cellCoords.js +156 -13
- package/helpers/dom/cellCoords.mjs +156 -13
- package/helpers/dom/element.d.ts +47 -8
- package/helpers/dom/element.js +104 -18
- package/helpers/dom/element.mjs +132 -23
- package/helpers/dom/event.d.ts +58 -0
- package/helpers/dom/event.js +39 -0
- package/helpers/dom/event.mjs +63 -0
- package/helpers/errors.d.ts +5 -0
- package/helpers/errors.js +10 -6
- package/helpers/errors.mjs +10 -6
- package/helpers/feature.d.ts +19 -0
- package/helpers/feature.js +21 -0
- package/helpers/feature.mjs +30 -0
- package/helpers/function.d.ts +1 -1
- package/helpers/function.js +4 -1
- package/helpers/function.mjs +4 -1
- package/helpers/mixed.d.ts +103 -0
- package/helpers/mixed.js +373 -4
- package/helpers/mixed.mjs +413 -4
- package/helpers/moves.js +2 -1
- package/helpers/moves.mjs +2 -1
- package/helpers/number.d.ts +22 -0
- package/helpers/number.js +49 -0
- package/helpers/number.mjs +66 -0
- package/helpers/string.d.ts +14 -10
- package/helpers/string.js +17 -9
- package/helpers/string.mjs +27 -17
- package/helpers/templateString.d.mts +1 -0
- package/helpers/templateString.d.ts +13 -0
- package/helpers/templateString.js +29 -0
- package/helpers/templateString.mjs +19 -0
- package/helpers/uiButton.d.mts +1 -0
- package/helpers/uiButton.d.ts +21 -0
- package/helpers/uiButton.js +37 -0
- package/helpers/uiButton.mjs +31 -0
- package/i18n/languages/fa-IR.d.ts +1 -0
- package/i18n/languages/fa-IR.js +1 -0
- package/i18n/languages/fa-IR.mjs +1 -0
- package/index.d.ts +3 -3
- package/languages/all.js +2 -1
- package/languages/fa-IR.js +2 -1
- package/languages/fa-IR.mjs +1 -0
- package/languages/index.js +2 -1
- package/package.json +61 -1
- package/plugins/autoColumnSize/autoColumnSize.d.ts +24 -1
- package/plugins/autoColumnSize/autoColumnSize.js +501 -82
- package/plugins/autoColumnSize/autoColumnSize.mjs +508 -83
- package/plugins/autoRowSize/autoRowSize.d.ts +40 -5
- package/plugins/autoRowSize/autoRowSize.js +68 -24
- package/plugins/autoRowSize/autoRowSize.mjs +98 -29
- package/plugins/autofill/autofill.js +30 -12
- package/plugins/autofill/autofill.mjs +30 -12
- package/plugins/base/base.d.ts +10 -0
- package/plugins/collapsibleColumns/collapsibleColumns.d.ts +4 -0
- package/plugins/collapsibleColumns/collapsibleColumns.js +89 -8
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +93 -8
- package/plugins/columnSorting/columnSorting.d.ts +31 -2
- package/plugins/columnSorting/columnSorting.js +151 -24
- package/plugins/columnSorting/columnSorting.mjs +153 -26
- package/plugins/columnSorting/columnStatesManager.d.ts +1 -1
- package/plugins/columnSorting/columnStatesManager.js +1 -7
- package/plugins/columnSorting/columnStatesManager.mjs +1 -7
- package/plugins/columnSorting/domHelpers.d.ts +3 -0
- package/plugins/columnSorting/domHelpers.js +9 -0
- package/plugins/columnSorting/domHelpers.mjs +3 -3
- package/plugins/columnSorting/rootComparator.js +21 -16
- package/plugins/columnSorting/rootComparator.mjs +21 -16
- package/plugins/columnSorting/sortFunction/checkbox.js +7 -5
- package/plugins/columnSorting/sortFunction/checkbox.mjs +7 -5
- package/plugins/columnSorting/sortFunction/default.js +15 -4
- package/plugins/columnSorting/sortFunction/default.mjs +15 -4
- package/plugins/columnSorting/sortFunction/intlDatetime.d.mts +1 -0
- package/plugins/columnSorting/sortFunction/intlDatetime.d.ts +10 -0
- package/plugins/columnSorting/sortFunction/intlDatetime.js +23 -0
- package/plugins/columnSorting/sortFunction/intlDatetime.mjs +12 -0
- package/plugins/columnSorting/sortService/registry.js +2 -0
- package/plugins/columnSorting/sortService/registry.mjs +2 -0
- package/plugins/columnSorting/utils.d.ts +8 -0
- package/plugins/columnSorting/utils.js +37 -45
- package/plugins/columnSorting/utils.mjs +42 -47
- package/plugins/columnSummary/columnSummary.js +9 -5
- package/plugins/columnSummary/columnSummary.mjs +9 -5
- package/plugins/columnSummary/endpoints.d.ts +69 -2
- package/plugins/columnSummary/endpoints.js +181 -29
- package/plugins/columnSummary/endpoints.mjs +181 -29
- package/plugins/comments/commentEditor.js +1 -1
- package/plugins/comments/commentEditor.mjs +2 -2
- package/plugins/contextMenu/contextMenu.d.ts +12 -1
- package/plugins/contextMenu/contextMenu.js +30 -6
- package/plugins/contextMenu/contextMenu.mjs +30 -6
- package/plugins/contextMenu/index.d.ts +1 -1
- package/plugins/contextMenu/menu/menu.d.ts +22 -1
- package/plugins/contextMenu/menu/menu.js +211 -3
- package/plugins/contextMenu/menu/menu.mjs +212 -4
- package/plugins/contextMenu/menu/menuItemRenderer.js +2 -2
- package/plugins/contextMenu/menu/menuItemRenderer.mjs +2 -2
- package/plugins/contextMenu/predefinedItems/alignment.js +14 -14
- package/plugins/contextMenu/predefinedItems/alignment.mjs +14 -14
- package/plugins/contextMenu/predefinedItems/clearColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/clearColumn.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/readOnly.js +3 -3
- package/plugins/contextMenu/predefinedItems/readOnly.mjs +3 -3
- package/plugins/contextMenu/utils.js +1 -1
- package/plugins/contextMenu/utils.mjs +1 -1
- package/plugins/copyPaste/copyPaste.js +70 -16
- package/plugins/copyPaste/copyPaste.mjs +71 -17
- package/plugins/copyPaste/copyableRanges.js +6 -2
- package/plugins/copyPaste/copyableRanges.mjs +6 -2
- package/plugins/copyPaste/pasteEvent.d.ts +1 -1
- package/plugins/customBorders/customBorders.d.ts +21 -40
- package/plugins/customBorders/customBorders.js +1080 -201
- package/plugins/customBorders/customBorders.mjs +1082 -203
- package/plugins/customBorders/utils.d.ts +71 -0
- package/plugins/customBorders/utils.js +63 -0
- package/plugins/customBorders/utils.mjs +101 -0
- package/plugins/dataProvider/dataProvider.d.ts +2 -1
- package/plugins/dataProvider/dataProvider.js +22 -7
- package/plugins/dataProvider/dataProvider.mjs +22 -7
- package/plugins/dataProvider/query/crud.js +1 -1
- package/plugins/dataProvider/query/crud.mjs +1 -1
- package/plugins/dialog/dialog.js +14 -9
- package/plugins/dialog/dialog.mjs +14 -9
- package/plugins/dialog/templates/confirm.d.ts +1 -1
- package/plugins/dialog/templates/confirm.js +2 -1
- package/plugins/dialog/templates/confirm.mjs +2 -1
- package/plugins/dialog/ui.d.ts +5 -3
- package/plugins/dialog/ui.js +12 -4
- package/plugins/dialog/ui.mjs +12 -4
- package/plugins/dragToScroll/dragToScroll.d.ts +2 -2
- package/plugins/dragToScroll/dragToScroll.js +150 -14
- package/plugins/dragToScroll/dragToScroll.mjs +151 -15
- package/plugins/dropdownMenu/dropdownMenu.d.ts +5 -1
- package/plugins/dropdownMenu/dropdownMenu.js +45 -3
- package/plugins/dropdownMenu/dropdownMenu.mjs +46 -4
- package/plugins/dropdownMenu/index.d.ts +1 -0
- package/plugins/emptyDataState/emptyDataState.js +4 -6
- package/plugins/emptyDataState/emptyDataState.mjs +4 -6
- package/plugins/emptyDataState/ui.js +2 -1
- package/plugins/emptyDataState/ui.mjs +2 -1
- package/plugins/exportFile/dataProvider.js +7 -9
- package/plugins/exportFile/dataProvider.mjs +7 -9
- package/plugins/exportFile/exportFile.d.ts +10 -3
- package/plugins/exportFile/types/_base.js +4 -10
- package/plugins/exportFile/types/_base.mjs +4 -10
- package/plugins/exportFile/types/xlsx/cell-style.js +4 -2
- package/plugins/exportFile/types/xlsx/cell-style.mjs +4 -2
- package/plugins/exportFile/types/xlsx/date-utils.d.ts +15 -0
- package/plugins/exportFile/types/xlsx/date-utils.js +31 -0
- package/plugins/exportFile/types/xlsx/date-utils.mjs +36 -0
- package/plugins/exportFile/types/xlsx.js +13 -9
- package/plugins/exportFile/types/xlsx.mjs +14 -10
- package/plugins/exportFile/utils.d.ts +9 -1
- package/plugins/exportFile/utils.js +27 -4
- package/plugins/exportFile/utils.mjs +40 -2
- package/plugins/filters/component/_base.d.ts +1 -2
- package/plugins/filters/component/_base.js +1 -2
- package/plugins/filters/component/_base.mjs +1 -2
- package/plugins/filters/component/condition.d.ts +1 -0
- package/plugins/filters/component/condition.js +2 -0
- package/plugins/filters/component/condition.mjs +2 -0
- package/plugins/filters/component/value.d.ts +5 -6
- package/plugins/filters/component/value.js +53 -34
- package/plugins/filters/component/value.mjs +54 -35
- package/plugins/filters/condition/date/after.js +2 -1
- package/plugins/filters/condition/date/after.mjs +2 -1
- package/plugins/filters/condition/date/afterOrEqual.js +2 -1
- package/plugins/filters/condition/date/afterOrEqual.mjs +2 -1
- package/plugins/filters/condition/date/before.js +2 -1
- package/plugins/filters/condition/date/before.mjs +2 -1
- package/plugins/filters/condition/date/beforeOrEqual.js +2 -1
- package/plugins/filters/condition/date/beforeOrEqual.mjs +2 -1
- package/plugins/filters/condition/equal.d.ts +7 -0
- package/plugins/filters/condition/equal.js +4 -0
- package/plugins/filters/condition/equal.mjs +10 -0
- package/plugins/filters/condition/intlDatetime/after.d.mts +1 -0
- package/plugins/filters/condition/intlDatetime/after.d.ts +18 -0
- package/plugins/filters/condition/intlDatetime/after.js +77 -0
- package/plugins/filters/condition/intlDatetime/after.mjs +22 -0
- package/plugins/filters/condition/intlDatetime/afterOrEqual.d.mts +1 -0
- package/plugins/filters/condition/intlDatetime/afterOrEqual.d.ts +18 -0
- package/plugins/filters/condition/intlDatetime/afterOrEqual.js +77 -0
- package/plugins/filters/condition/intlDatetime/afterOrEqual.mjs +22 -0
- package/plugins/filters/condition/intlDatetime/before.d.mts +1 -0
- package/plugins/filters/condition/intlDatetime/before.d.ts +18 -0
- package/plugins/filters/condition/intlDatetime/before.js +77 -0
- package/plugins/filters/condition/intlDatetime/before.mjs +22 -0
- package/plugins/filters/condition/intlDatetime/beforeOrEqual.d.mts +1 -0
- package/plugins/filters/condition/intlDatetime/beforeOrEqual.d.ts +18 -0
- package/plugins/filters/condition/intlDatetime/beforeOrEqual.js +77 -0
- package/plugins/filters/condition/intlDatetime/beforeOrEqual.mjs +22 -0
- package/plugins/filters/condition/intlDatetime/between.d.mts +1 -0
- package/plugins/filters/condition/intlDatetime/between.d.ts +18 -0
- package/plugins/filters/condition/intlDatetime/between.js +78 -0
- package/plugins/filters/condition/intlDatetime/between.mjs +23 -0
- package/plugins/filters/condition/intlDatetime/today.d.mts +1 -0
- package/plugins/filters/condition/intlDatetime/today.d.ts +17 -0
- package/plugins/filters/condition/intlDatetime/today.js +76 -0
- package/plugins/filters/condition/intlDatetime/today.mjs +20 -0
- package/plugins/filters/condition/intlDatetime/tomorrow.d.mts +1 -0
- package/plugins/filters/condition/intlDatetime/tomorrow.d.ts +17 -0
- package/plugins/filters/condition/intlDatetime/tomorrow.js +77 -0
- package/plugins/filters/condition/intlDatetime/tomorrow.mjs +21 -0
- package/plugins/filters/condition/intlDatetime/yesterday.d.mts +1 -0
- package/plugins/filters/condition/intlDatetime/yesterday.d.ts +17 -0
- package/plugins/filters/condition/intlDatetime/yesterday.js +77 -0
- package/plugins/filters/condition/intlDatetime/yesterday.mjs +21 -0
- package/plugins/filters/conditionCollection.js +4 -7
- package/plugins/filters/conditionCollection.mjs +4 -7
- package/plugins/filters/conditionUpdateObserver.d.ts +2 -2
- package/plugins/filters/conditionUpdateObserver.js +148 -49
- package/plugins/filters/conditionUpdateObserver.mjs +148 -49
- package/plugins/filters/constants.d.ts +1 -0
- package/plugins/filters/constants.js +31 -0
- package/plugins/filters/constants.mjs +28 -0
- package/plugins/filters/dataFilter.d.ts +4 -12
- package/plugins/filters/dataFilter.js +7 -19
- package/plugins/filters/dataFilter.mjs +8 -20
- package/plugins/filters/filters.d.ts +33 -9
- package/plugins/filters/filters.js +91 -31
- package/plugins/filters/filters.mjs +92 -32
- package/plugins/filters/sortComparators.d.ts +9 -2
- package/plugins/filters/sortComparators.js +34 -1
- package/plugins/filters/sortComparators.mjs +38 -3
- package/plugins/filters/ui/input.d.ts +4 -0
- package/plugins/filters/ui/input.js +18 -6
- package/plugins/filters/ui/input.mjs +18 -6
- package/plugins/filters/ui/multipleSelect.js +27 -4
- package/plugins/filters/ui/multipleSelect.mjs +27 -4
- package/plugins/filters/ui/select.js +1 -1
- package/plugins/filters/ui/select.mjs +1 -1
- package/plugins/formulas/engine/register.d.ts +5 -4
- package/plugins/formulas/engine/register.js +5 -2
- package/plugins/formulas/engine/register.mjs +9 -5
- package/plugins/formulas/engine/settings.d.ts +2 -6
- package/plugins/formulas/engine/settings.js +29 -4
- package/plugins/formulas/engine/settings.mjs +29 -4
- package/plugins/formulas/engine/types.d.ts +12 -2
- package/plugins/formulas/formulas.d.ts +39 -0
- package/plugins/formulas/formulas.js +789 -47
- package/plugins/formulas/formulas.mjs +793 -49
- package/plugins/formulas/hyperlinkUrl.d.mts +1 -0
- package/plugins/formulas/hyperlinkUrl.d.ts +12 -0
- package/plugins/formulas/hyperlinkUrl.js +32 -0
- package/plugins/formulas/hyperlinkUrl.mjs +32 -0
- package/plugins/formulas/indexSyncer/axisSyncer.d.ts +1 -0
- package/plugins/formulas/indexSyncer/axisSyncer.js +72 -15
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +72 -15
- package/plugins/formulas/utils.d.ts +9 -0
- package/plugins/formulas/utils.js +21 -0
- package/plugins/formulas/utils.mjs +25 -0
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +6 -1
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +6 -1
- package/plugins/hiddenColumns/hiddenColumns.js +6 -3
- package/plugins/hiddenColumns/hiddenColumns.mjs +6 -3
- package/plugins/hiddenRows/contextMenuItem/showRow.js +6 -1
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +6 -1
- package/plugins/hiddenRows/hiddenRows.js +6 -3
- package/plugins/hiddenRows/hiddenRows.mjs +6 -3
- package/plugins/index.d.ts +5 -1
- package/plugins/index.js +10 -0
- package/plugins/index.mjs +5 -1
- package/plugins/loading/content.d.ts +5 -3
- package/plugins/loading/content.js +3 -2
- package/plugins/loading/content.mjs +8 -5
- package/plugins/loading/loading.d.ts +5 -2
- package/plugins/loading/loading.mjs +5 -2
- package/plugins/manualColumnMove/manualColumnMove.d.ts +10 -0
- package/plugins/manualColumnMove/manualColumnMove.js +122 -20
- package/plugins/manualColumnMove/manualColumnMove.mjs +123 -21
- package/plugins/manualColumnResize/manualColumnResize.d.ts +20 -7
- package/plugins/manualColumnResize/manualColumnResize.js +33 -13
- package/plugins/manualColumnResize/manualColumnResize.mjs +34 -14
- package/plugins/manualRowResize/manualRowResize.d.ts +21 -8
- package/plugins/manualRowResize/manualRowResize.js +34 -14
- package/plugins/manualRowResize/manualRowResize.mjs +35 -15
- package/plugins/mergeCells/cellCoords.d.ts +8 -0
- package/plugins/mergeCells/cellCoords.js +11 -0
- package/plugins/mergeCells/cellCoords.mjs +11 -0
- package/plugins/mergeCells/cellsCollection.d.ts +46 -2
- package/plugins/mergeCells/cellsCollection.js +189 -68
- package/plugins/mergeCells/cellsCollection.mjs +189 -68
- package/plugins/mergeCells/focusOrder.d.ts +26 -20
- package/plugins/mergeCells/focusOrder.js +358 -177
- package/plugins/mergeCells/focusOrder.mjs +363 -172
- package/plugins/mergeCells/mergeCells.d.ts +13 -8
- package/plugins/mergeCells/mergeCells.js +322 -64
- package/plugins/mergeCells/mergeCells.mjs +322 -64
- package/plugins/moveCells/helpers.d.mts +1 -0
- package/plugins/moveCells/helpers.d.ts +21 -0
- package/plugins/moveCells/helpers.js +20 -0
- package/plugins/moveCells/helpers.mjs +15 -0
- package/plugins/moveCells/index.d.mts +1 -0
- package/plugins/moveCells/index.d.ts +1 -0
- package/plugins/moveCells/index.js +22 -0
- package/plugins/moveCells/index.mjs +1 -0
- package/plugins/moveCells/moveCells.d.mts +1 -0
- package/plugins/moveCells/moveCells.d.ts +80 -0
- package/plugins/moveCells/moveCells.js +602 -0
- package/plugins/moveCells/moveCells.mjs +587 -0
- package/plugins/multiColumnSorting/multiColumnSorting.d.ts +8 -8
- package/plugins/multiColumnSorting/multiColumnSorting.js +11 -16
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +11 -16
- package/plugins/multiColumnSorting/rootComparator.js +26 -19
- package/plugins/multiColumnSorting/rootComparator.mjs +26 -19
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.d.ts +19 -4
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +273 -58
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +273 -58
- package/plugins/nestedHeaders/nestedHeaders.d.ts +10 -1
- package/plugins/nestedHeaders/nestedHeaders.js +222 -23
- package/plugins/nestedHeaders/nestedHeaders.mjs +222 -23
- package/plugins/nestedHeaders/stateManager/columnArrangement.d.mts +1 -0
- package/plugins/nestedHeaders/stateManager/columnArrangement.d.ts +37 -0
- package/plugins/nestedHeaders/stateManager/columnArrangement.js +35 -0
- package/plugins/nestedHeaders/stateManager/columnArrangement.mjs +30 -0
- package/plugins/nestedHeaders/stateManager/deriveSettings.d.mts +1 -0
- package/plugins/nestedHeaders/stateManager/deriveSettings.d.ts +57 -0
- package/plugins/nestedHeaders/stateManager/deriveSettings.js +115 -0
- package/plugins/nestedHeaders/stateManager/deriveSettings.mjs +135 -0
- package/plugins/nestedHeaders/stateManager/headersTree.d.ts +14 -1
- package/plugins/nestedHeaders/stateManager/index.d.ts +76 -13
- package/plugins/nestedHeaders/stateManager/index.js +381 -38
- package/plugins/nestedHeaders/stateManager/index.mjs +382 -39
- package/plugins/nestedHeaders/stateManager/matrixGenerator.js +3 -2
- package/plugins/nestedHeaders/stateManager/matrixGenerator.mjs +3 -2
- package/plugins/nestedHeaders/stateManager/settingsNormalizer.js +5 -1
- package/plugins/nestedHeaders/stateManager/settingsNormalizer.mjs +5 -1
- package/plugins/nestedHeaders/stateManager/sourceSettings.d.ts +23 -6
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +20 -4
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +20 -4
- package/plugins/nestedHeaders/stateManager/utils.d.ts +17 -1
- package/plugins/nestedHeaders/stateManager/utils.js +6 -1
- package/plugins/nestedHeaders/stateManager/utils.mjs +6 -1
- package/plugins/nestedHeaders/utils/ghostTable.js +21 -8
- package/plugins/nestedHeaders/utils/ghostTable.mjs +21 -8
- package/plugins/nestedRows/data/dataManager.d.ts +4 -1
- package/plugins/nestedRows/data/dataManager.js +10 -4
- package/plugins/nestedRows/data/dataManager.mjs +10 -4
- package/plugins/nestedRows/nestedRows.d.ts +127 -1
- package/plugins/nestedRows/nestedRows.js +330 -8
- package/plugins/nestedRows/nestedRows.mjs +330 -8
- package/plugins/nestedRows/ui/collapsing.d.ts +58 -0
- package/plugins/nestedRows/ui/collapsing.js +236 -40
- package/plugins/nestedRows/ui/collapsing.mjs +236 -40
- package/plugins/notification/notification.d.ts +2 -1
- package/plugins/notification/notification.js +6 -3
- package/plugins/notification/notification.mjs +6 -3
- package/plugins/notification/ui.d.ts +8 -5
- package/plugins/notification/ui.js +18 -6
- package/plugins/notification/ui.mjs +18 -6
- package/plugins/pagination/pagination.js +2 -2
- package/plugins/pagination/pagination.mjs +2 -2
- package/plugins/search/search.js +23 -2
- package/plugins/search/search.mjs +23 -2
- package/plugins/selectionHandles/helpers.d.mts +1 -0
- package/plugins/selectionHandles/helpers.d.ts +17 -0
- package/plugins/selectionHandles/helpers.js +16 -0
- package/plugins/selectionHandles/helpers.mjs +11 -0
- package/plugins/selectionHandles/index.d.mts +1 -0
- package/plugins/selectionHandles/index.d.ts +1 -0
- package/plugins/selectionHandles/index.js +22 -0
- package/plugins/selectionHandles/index.mjs +1 -0
- package/plugins/selectionHandles/selectionHandles.d.mts +1 -0
- package/plugins/selectionHandles/selectionHandles.d.ts +52 -0
- package/plugins/selectionHandles/selectionHandles.js +342 -0
- package/plugins/selectionHandles/selectionHandles.mjs +323 -0
- package/plugins/trimRows/trimRows.d.ts +1 -1
- package/plugins/trimRows/trimRows.js +6 -2
- package/plugins/trimRows/trimRows.mjs +6 -2
- package/plugins/types.d.ts +4 -0
- package/plugins/undoRedo/actions/cellAlignment.js +1 -1
- package/plugins/undoRedo/actions/cellAlignment.mjs +1 -1
- package/plugins/undoRedo/actions/createColumn.js +4 -1
- package/plugins/undoRedo/actions/createColumn.mjs +4 -1
- package/plugins/undoRedo/actions/createRow.js +4 -1
- package/plugins/undoRedo/actions/createRow.mjs +4 -1
- package/plugins/undoRedo/actions/fixedCounts.d.mts +1 -0
- package/plugins/undoRedo/actions/fixedCounts.d.ts +36 -0
- package/plugins/undoRedo/actions/fixedCounts.js +63 -0
- package/plugins/undoRedo/actions/fixedCounts.mjs +62 -0
- package/plugins/undoRedo/actions/index.js +2 -0
- package/plugins/undoRedo/actions/index.mjs +2 -0
- package/plugins/undoRedo/actions/moveCells.d.mts +1 -0
- package/plugins/undoRedo/actions/moveCells.d.ts +104 -0
- package/plugins/undoRedo/actions/moveCells.js +225 -0
- package/plugins/undoRedo/actions/moveCells.mjs +227 -0
- package/plugins/undoRedo/actions/removeColumn.d.ts +18 -2
- package/plugins/undoRedo/actions/removeColumn.js +11 -4
- package/plugins/undoRedo/actions/removeColumn.mjs +12 -5
- package/plugins/undoRedo/actions/removeRow.js +2 -57
- package/plugins/undoRedo/actions/removeRow.mjs +2 -57
- package/plugins/undoRedo/undoRedo.d.ts +26 -0
- package/plugins/undoRedo/undoRedo.js +36 -2
- package/plugins/undoRedo/undoRedo.mjs +36 -2
- package/plugins/undoRedo/utils.d.ts +29 -0
- package/plugins/undoRedo/utils.js +55 -3
- package/plugins/undoRedo/utils.mjs +59 -0
- package/renderSizeProbe.d.mts +1 -0
- package/renderSizeProbe.d.ts +60 -0
- package/renderSizeProbe.js +163 -0
- package/renderSizeProbe.mjs +176 -0
- package/renderers/checkboxRenderer/checkboxRenderer.js +9 -4
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +9 -4
- package/renderers/index.d.ts +3 -2
- package/renderers/index.js +8 -0
- package/renderers/index.mjs +3 -1
- package/renderers/intlDatetimeRenderer/index.d.mts +1 -0
- package/renderers/intlDatetimeRenderer/index.d.ts +1 -0
- package/renderers/intlDatetimeRenderer/index.js +22 -0
- package/renderers/intlDatetimeRenderer/index.mjs +1 -0
- package/renderers/intlDatetimeRenderer/intlDatetimeRenderer.d.mts +1 -0
- package/renderers/intlDatetimeRenderer/intlDatetimeRenderer.d.ts +26 -0
- package/renderers/intlDatetimeRenderer/intlDatetimeRenderer.js +82 -0
- package/renderers/intlDatetimeRenderer/intlDatetimeRenderer.mjs +67 -0
- package/renderers/multiSelectRenderer/multiSelectRenderer.js +2 -3
- package/renderers/multiSelectRenderer/multiSelectRenderer.mjs +2 -3
- package/renderers/multiSelectRenderer/utils/utils.d.ts +1 -1
- package/renderers/multiSelectRenderer/utils/utils.js +11 -8
- package/renderers/multiSelectRenderer/utils/utils.mjs +11 -8
- package/renderers/passwordRenderer/passwordRenderer.js +6 -1
- package/renderers/passwordRenderer/passwordRenderer.mjs +6 -1
- package/renderers/renderCell.d.mts +1 -0
- package/renderers/renderCell.d.ts +37 -0
- package/renderers/renderCell.js +43 -0
- package/renderers/renderCell.mjs +48 -0
- package/selection/highlight/types/areaLayered.d.ts +3 -1
- package/selection/highlight/types/areaLayered.js +4 -2
- package/selection/highlight/types/areaLayered.mjs +6 -2
- package/selection/highlight/types/focus.d.ts +3 -1
- package/selection/highlight/types/focus.js +3 -2
- package/selection/highlight/types/focus.mjs +5 -2
- package/selection/mouseEventHandler.js +29 -26
- package/selection/mouseEventHandler.mjs +29 -26
- package/selection/moveCells.d.mts +1 -0
- package/selection/moveCells.d.ts +15 -0
- package/selection/moveCells.js +13 -0
- package/selection/moveCells.mjs +9 -0
- package/selection/selection.d.ts +56 -2
- package/selection/selection.js +149 -5
- package/selection/selection.mjs +149 -5
- package/selection/types.d.ts +3 -0
- package/settings.d.ts +24 -3
- package/shortcuts/context.d.ts +4 -0
- package/shortcuts/context.js +16 -8
- package/shortcuts/context.mjs +20 -8
- package/shortcuts/contexts/commands/populateSelectedCellsData.js +1 -1
- package/shortcuts/contexts/commands/populateSelectedCellsData.mjs +1 -1
- package/styles/handsontable.css +504 -158
- package/styles/handsontable.min.css +4 -4
- package/styles/handsontableStyles.d.mts +2 -0
- package/styles/handsontableStyles.d.ts +2 -0
- package/styles/handsontableStyles.js +1 -1
- package/styles/handsontableStyles.mjs +1 -1
- package/styles/ht-icons-horizon.css +1 -10
- package/styles/ht-icons-horizon.min.css +4 -4
- package/styles/ht-icons-main.css +1 -10
- package/styles/ht-icons-main.min.css +4 -4
- package/styles/ht-theme-classic-no-icons.css +6 -0
- package/styles/ht-theme-classic-no-icons.min.css +4 -4
- package/styles/ht-theme-classic.css +7 -10
- package/styles/ht-theme-classic.min.css +4 -4
- package/styles/ht-theme-horizon-no-icons.css +6 -0
- package/styles/ht-theme-horizon-no-icons.min.css +4 -4
- package/styles/ht-theme-horizon.css +7 -10
- package/styles/ht-theme-horizon.min.css +4 -4
- package/styles/ht-theme-main-no-icons.css +6 -0
- package/styles/ht-theme-main-no-icons.min.css +4 -4
- package/styles/ht-theme-main.css +7 -10
- package/styles/ht-theme-main.min.css +4 -4
- package/tableView.d.ts +17 -4
- package/tableView.js +208 -42
- package/tableView.mjs +209 -43
- package/themes/engine/index.d.ts +2 -1
- package/themes/engine/index.js +3 -0
- package/themes/engine/index.mjs +1 -1
- package/themes/engine/manager.d.ts +75 -3
- package/themes/engine/manager.js +242 -6
- package/themes/engine/manager.mjs +249 -6
- package/themes/engine/utils/cssVariables.d.ts +18 -1
- package/themes/engine/utils/cssVariables.js +27 -11
- package/themes/engine/utils/cssVariables.mjs +28 -11
- package/themes/engine/utils/validation.js +7 -0
- package/themes/engine/utils/validation.mjs +7 -0
- package/themes/static/variables/helpers/iconsMap.js +1 -6
- package/themes/static/variables/helpers/iconsMap.mjs +1 -6
- package/themes/static/variables/tokens/classic.js +6 -0
- package/themes/static/variables/tokens/classic.mjs +6 -0
- package/themes/static/variables/tokens/horizon.js +6 -0
- package/themes/static/variables/tokens/horizon.mjs +6 -0
- package/themes/static/variables/tokens/main.js +6 -0
- package/themes/static/variables/tokens/main.mjs +6 -0
- package/themes/types.d.ts +1 -1
- package/translations/indexMapper.d.ts +14 -9
- package/translations/indexMapper.js +104 -43
- package/translations/indexMapper.mjs +104 -43
- package/translations/mapCollections/aggregatedCollection.js +20 -35
- package/translations/mapCollections/aggregatedCollection.mjs +20 -35
- package/translations/mapCollections/mapCollection.d.ts +10 -4
- package/translations/mapCollections/mapCollection.js +2 -2
- package/translations/mapCollections/mapCollection.mjs +2 -2
- package/translations/maps/booleanMap.d.mts +1 -0
- package/translations/maps/booleanMap.d.ts +86 -0
- package/translations/maps/booleanMap.js +300 -0
- package/translations/maps/booleanMap.mjs +308 -0
- package/translations/maps/hidingMap.d.ts +5 -2
- package/translations/maps/hidingMap.js +8 -3
- package/translations/maps/hidingMap.mjs +8 -3
- package/translations/maps/index.d.ts +5 -2
- package/translations/maps/index.js +7 -3
- package/translations/maps/index.mjs +10 -2
- package/translations/maps/indexMap.d.ts +26 -2
- package/translations/maps/indexMap.js +78 -6
- package/translations/maps/indexMap.mjs +78 -6
- package/translations/maps/indexesSequence.d.ts +53 -2
- package/translations/maps/indexesSequence.js +225 -3
- package/translations/maps/indexesSequence.mjs +233 -3
- package/translations/maps/trimmingMap.d.ts +5 -2
- package/translations/maps/trimmingMap.js +8 -3
- package/translations/maps/trimmingMap.mjs +8 -3
- package/translations/maps/utils/actionsOnIndexes.js +20 -1
- package/translations/maps/utils/actionsOnIndexes.mjs +20 -1
- package/translations/maps/utils/indexesSequence.js +12 -3
- package/translations/maps/utils/indexesSequence.mjs +12 -3
- package/translations/maps/utils/physicallyIndexed.js +12 -1
- package/translations/maps/utils/physicallyIndexed.mjs +12 -1
- package/utils/entitlementLicenseKey/classify.d.mts +1 -0
- package/utils/entitlementLicenseKey/classify.d.ts +34 -0
- package/utils/entitlementLicenseKey/classify.js +97 -0
- package/utils/entitlementLicenseKey/classify.mjs +96 -0
- package/utils/entitlementLicenseKey/constants.d.mts +1 -0
- package/utils/entitlementLicenseKey/constants.d.ts +69 -0
- package/utils/entitlementLicenseKey/constants.js +54 -0
- package/utils/entitlementLicenseKey/constants.mjs +66 -0
- package/utils/entitlementLicenseKey/detectFormat.d.mts +1 -0
- package/utils/entitlementLicenseKey/detectFormat.d.ts +23 -0
- package/utils/entitlementLicenseKey/detectFormat.js +60 -0
- package/utils/entitlementLicenseKey/detectFormat.mjs +60 -0
- package/utils/entitlementLicenseKey/encoding.d.mts +1 -0
- package/utils/entitlementLicenseKey/encoding.d.ts +58 -0
- package/utils/entitlementLicenseKey/encoding.js +161 -0
- package/utils/entitlementLicenseKey/encoding.mjs +172 -0
- package/utils/entitlementLicenseKey/extractKeyData.d.mts +1 -0
- package/utils/entitlementLicenseKey/extractKeyData.d.ts +47 -0
- package/utils/entitlementLicenseKey/extractKeyData.js +213 -0
- package/utils/entitlementLicenseKey/extractKeyData.mjs +232 -0
- package/utils/entitlementLicenseKey/grants.d.mts +1 -0
- package/utils/entitlementLicenseKey/grants.d.ts +54 -0
- package/utils/entitlementLicenseKey/grants.js +68 -0
- package/utils/entitlementLicenseKey/grants.mjs +84 -0
- package/utils/entitlementLicenseKey/index.d.mts +1 -0
- package/utils/entitlementLicenseKey/index.d.ts +8 -0
- package/utils/entitlementLicenseKey/index.js +53 -0
- package/utils/entitlementLicenseKey/index.mjs +6 -0
- package/utils/entitlementLicenseKey/sha512.d.mts +1 -0
- package/utils/entitlementLicenseKey/sha512.d.ts +11 -0
- package/utils/entitlementLicenseKey/sha512.js +328 -0
- package/utils/entitlementLicenseKey/sha512.mjs +327 -0
- package/utils/entitlementLicenseKey/types.d.mts +1 -0
- package/utils/entitlementLicenseKey/types.d.ts +84 -0
- package/utils/entitlementLicenseKey/types.js +8 -0
- package/utils/entitlementLicenseKey/types.mjs +10 -0
- package/utils/ghostTable.d.ts +1 -0
- package/utils/ghostTable.js +60 -11
- package/utils/ghostTable.mjs +60 -11
- package/utils/licenseBranding/badge.d.mts +1 -0
- package/utils/licenseBranding/badge.d.ts +21 -0
- package/utils/licenseBranding/badge.js +237 -0
- package/utils/licenseBranding/badge.mjs +244 -0
- package/utils/licenseBranding/content.d.mts +1 -0
- package/utils/licenseBranding/content.d.ts +54 -0
- package/utils/licenseBranding/content.js +93 -0
- package/utils/licenseBranding/content.mjs +79 -0
- package/utils/licenseBranding/index.d.mts +1 -0
- package/utils/licenseBranding/index.d.ts +14 -0
- package/utils/licenseBranding/index.js +55 -0
- package/utils/licenseBranding/index.mjs +56 -0
- package/utils/licenseBranding/lockScreen.d.mts +1 -0
- package/utils/licenseBranding/lockScreen.d.ts +23 -0
- package/utils/licenseBranding/lockScreen.js +150 -0
- package/utils/licenseBranding/lockScreen.mjs +159 -0
- package/utils/licenseNotification.d.ts +19 -0
- package/utils/licenseNotification.js +56 -29
- package/utils/licenseNotification.mjs +61 -29
- package/utils/movableMeta.d.mts +1 -0
- package/utils/movableMeta.d.ts +40 -0
- package/utils/movableMeta.js +47 -0
- package/utils/movableMeta.mjs +46 -0
- package/utils/parseTable.js +16 -7
- package/utils/parseTable.mjs +16 -7
- package/utils/samplesGenerator.d.ts +41 -14
- package/utils/samplesGenerator.js +114 -42
- package/utils/samplesGenerator.mjs +114 -42
- package/utils/sanitizer.d.mts +1 -0
- package/utils/sanitizer.d.ts +47 -0
- package/utils/sanitizer.js +43 -0
- package/utils/sanitizer.mjs +55 -0
- package/utils/stylesHandler.d.ts +13 -0
- package/utils/stylesHandler.js +55 -2
- package/utils/stylesHandler.mjs +55 -2
- package/validators/autocompleteValidator/autocompleteValidator.js +3 -0
- package/validators/autocompleteValidator/autocompleteValidator.mjs +3 -0
- package/validators/index.d.ts +3 -2
- package/validators/index.js +8 -0
- package/validators/index.mjs +3 -1
- package/validators/intlDatetimeValidator/index.d.mts +1 -0
- package/validators/intlDatetimeValidator/index.d.ts +1 -0
- package/validators/intlDatetimeValidator/index.js +25 -0
- package/validators/intlDatetimeValidator/index.mjs +1 -0
- package/validators/intlDatetimeValidator/intlDatetimeValidator.d.mts +1 -0
- package/validators/intlDatetimeValidator/intlDatetimeValidator.d.ts +28 -0
- package/validators/intlDatetimeValidator/intlDatetimeValidator.js +49 -0
- package/validators/intlDatetimeValidator/intlDatetimeValidator.mjs +37 -0
- package/3rdparty/walkontable/src/overlay/bottom.d.mts +0 -1
- package/3rdparty/walkontable/src/overlay/bottomInlineStartCorner.d.mts +0 -1
- package/3rdparty/walkontable/src/overlay/inlineStart.d.mts +0 -1
- package/3rdparty/walkontable/src/overlay/top.d.mts +0 -1
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.d.mts +0 -1
- package/3rdparty/walkontable/src/overlays.d.ts +0 -329
- package/3rdparty/walkontable/src/overlays.js +0 -870
- package/3rdparty/walkontable/src/overlays.mjs +0 -860
- package/3rdparty/walkontable/src/renderer/table.d.mts +0 -1
- package/3rdparty/walkontable/src/renderer/table.js +0 -229
- package/3rdparty/walkontable/src/settings.d.mts +0 -2
- package/3rdparty/walkontable/src/settings.js +0 -196
- package/3rdparty/walkontable/src/settings.mjs +0 -263
- package/3rdparty/walkontable/src/table/bottom.d.mts +0 -2
- package/3rdparty/walkontable/src/table/bottom.d.ts +0 -19
- package/3rdparty/walkontable/src/table/bottom.js +0 -38
- package/3rdparty/walkontable/src/table/bottom.mjs +0 -23
- package/3rdparty/walkontable/src/table/bottomInlineStartCorner.d.mts +0 -2
- package/3rdparty/walkontable/src/table/bottomInlineStartCorner.d.ts +0 -20
- package/3rdparty/walkontable/src/table/bottomInlineStartCorner.mjs +0 -24
- package/3rdparty/walkontable/src/table/inlineStart.d.mts +0 -2
- package/3rdparty/walkontable/src/table/inlineStart.d.ts +0 -16
- package/3rdparty/walkontable/src/table/inlineStart.js +0 -35
- package/3rdparty/walkontable/src/table/inlineStart.mjs +0 -20
- package/3rdparty/walkontable/src/table/master.d.mts +0 -2
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.d.mts +0 -2
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.d.ts +0 -75
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +0 -122
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +0 -112
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.d.mts +0 -2
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.d.ts +0 -75
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +0 -122
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +0 -112
- package/3rdparty/walkontable/src/table/top.d.mts +0 -2
- package/3rdparty/walkontable/src/table/top.d.ts +0 -19
- package/3rdparty/walkontable/src/table/top.js +0 -38
- package/3rdparty/walkontable/src/table/top.mjs +0 -23
- package/3rdparty/walkontable/src/table/topInlineStartCorner.d.mts +0 -2
- package/3rdparty/walkontable/src/table/topInlineStartCorner.d.ts +0 -20
- package/3rdparty/walkontable/src/table/topInlineStartCorner.mjs +0 -24
- package/3rdparty/walkontable/src/table.d.mts +0 -2
- package/3rdparty/walkontable/src/table.d.ts +0 -741
- package/3rdparty/walkontable/src/table.js +0 -1120
- package/3rdparty/walkontable/src/table.mjs +0 -1105
- package/3rdparty/walkontable/src/utils/cellCoords.d.mts +0 -1
- package/3rdparty/walkontable/src/utils/cellCoords.js +0 -54
- package/3rdparty/walkontable/src/utils/cellCoords.mjs +0 -54
- package/3rdparty/walkontable/src/utils/column.d.mts +0 -2
- package/3rdparty/walkontable/src/utils/column.js +0 -75
- package/3rdparty/walkontable/src/utils/column.mjs +0 -70
- package/3rdparty/walkontable/src/utils/positionCache.d.mts +0 -1
- package/3rdparty/walkontable/src/utils/positionCache.d.ts +0 -91
- package/3rdparty/walkontable/src/utils/positionCache.js +0 -193
- package/3rdparty/walkontable/src/utils/positionCache.mjs +0 -194
- package/3rdparty/walkontable/src/utils/row.d.mts +0 -2
- package/3rdparty/walkontable/src/utils/row.js +0 -46
- package/3rdparty/walkontable/src/utils/row.mjs +0 -41
- package/3rdparty/walkontable/src/viewport.d.ts +0 -254
- package/3rdparty/walkontable/src/viewport.js +0 -533
- package/3rdparty/walkontable/src/viewport.mjs +0 -523
- /package/3rdparty/walkontable/src/{renderer → axisSizing/positionCache}/index.d.mts +0 -0
- /package/3rdparty/walkontable/src/{overlays.d.mts → overlay/overlays.d.mts} +0 -0
- /package/3rdparty/walkontable/src/overlay/{_base.d.mts → regions/_base.d.mts} +0 -0
- /package/3rdparty/walkontable/src/{stickyScrollStrategy.d.mts → overlay/strategies/stickyScrollStrategy.d.mts} +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/_base.d.mts +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/_base.js +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/_base.mjs +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/cells.d.mts +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/cells.d.ts +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/colGroup.d.mts +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/colGroup.d.ts +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/colGroup.js +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/colGroup.mjs +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/columnHeaderRows.d.mts +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/columnHeaderRows.d.ts +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/columnHeaderRows.js +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/columnHeaderRows.mjs +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/columnHeaders.d.mts +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/rowHeaders.d.mts +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/rowHeaders.d.ts +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/rowHeaders.js +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/rowHeaders.mjs +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/rows.d.mts +0 -0
- /package/3rdparty/walkontable/src/{renderer → render}/rows.d.ts +0 -0
- /package/3rdparty/walkontable/src/{scroll.d.mts → scroll/scroll.d.mts} +0 -0
- /package/3rdparty/walkontable/src/table/{mixin → rangeQuery}/stickyColumnsStart.d.mts +0 -0
- /package/3rdparty/walkontable/src/table/{mixin → rangeQuery}/stickyRowsBottom.d.mts +0 -0
- /package/3rdparty/walkontable/src/table/{mixin → rangeQuery}/stickyRowsBottom.js +0 -0
- /package/3rdparty/walkontable/src/table/{mixin → rangeQuery}/stickyRowsBottom.mjs +0 -0
- /package/3rdparty/walkontable/src/table/{mixin → rangeQuery}/stickyRowsTop.d.mts +0 -0
- /package/3rdparty/walkontable/src/{viewport.d.mts → viewport/viewport.d.mts} +0 -0
|
@@ -3,6 +3,41 @@ function _check_private_redeclaration(obj, privateCollection) {
|
|
|
3
3
|
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
|
+
function _class_apply_descriptor_get(receiver, descriptor) {
|
|
7
|
+
if (descriptor.get) {
|
|
8
|
+
return descriptor.get.call(receiver);
|
|
9
|
+
}
|
|
10
|
+
return descriptor.value;
|
|
11
|
+
}
|
|
12
|
+
function _class_apply_descriptor_set(receiver, descriptor, value) {
|
|
13
|
+
if (descriptor.set) {
|
|
14
|
+
descriptor.set.call(receiver, value);
|
|
15
|
+
} else {
|
|
16
|
+
if (!descriptor.writable) {
|
|
17
|
+
throw new TypeError("attempted to set read only private field");
|
|
18
|
+
}
|
|
19
|
+
descriptor.value = value;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function _class_extract_field_descriptor(receiver, privateMap, action) {
|
|
23
|
+
if (!privateMap.has(receiver)) {
|
|
24
|
+
throw new TypeError("attempted to " + action + " private field on non-instance");
|
|
25
|
+
}
|
|
26
|
+
return privateMap.get(receiver);
|
|
27
|
+
}
|
|
28
|
+
function _class_private_field_get(receiver, privateMap) {
|
|
29
|
+
var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get");
|
|
30
|
+
return _class_apply_descriptor_get(receiver, descriptor);
|
|
31
|
+
}
|
|
32
|
+
function _class_private_field_init(obj, privateMap, value) {
|
|
33
|
+
_check_private_redeclaration(obj, privateMap);
|
|
34
|
+
privateMap.set(obj, value);
|
|
35
|
+
}
|
|
36
|
+
function _class_private_field_set(receiver, privateMap, value) {
|
|
37
|
+
var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set");
|
|
38
|
+
_class_apply_descriptor_set(receiver, descriptor, value);
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
6
41
|
function _class_private_method_get(receiver, privateSet, fn) {
|
|
7
42
|
if (!privateSet.has(receiver)) {
|
|
8
43
|
throw new TypeError("attempted to get private field on non-instance");
|
|
@@ -18,10 +53,10 @@ import { throwWithCause } from '../../helpers/errors.mjs';
|
|
|
18
53
|
import { hasOwnProperty, deepClone } from '../../helpers/object.mjs';
|
|
19
54
|
import { warn } from '../../helpers/console.mjs';
|
|
20
55
|
import { rangeEach } from '../../helpers/number.mjs';
|
|
21
|
-
import { arrayEach, arrayReduce
|
|
56
|
+
import { arrayEach, arrayReduce } from '../../helpers/array.mjs';
|
|
22
57
|
import * as C from '../../i18n/constants.mjs';
|
|
23
58
|
import { top as menuItemTop, bottom as menuItemBottom, left as menuItemLeft, right as menuItemRight, noBorders as menuItemNoBorders } from './contextMenuItem/index.mjs';
|
|
24
|
-
import { createId, createDefaultCustomBorder, createSingleEmptyBorder, createEmptyBorders, extendDefaultBorder, hasLeftRightTypeOptions, hasStartEndTypeOptions, toInlinePropName, normalizeBorder, denormalizeBorder } from './utils.mjs';
|
|
59
|
+
import { createId, createDefaultCustomBorder, createSingleEmptyBorder, createEmptyBorders, extendDefaultBorder, hasLeftRightTypeOptions, hasStartEndTypeOptions, toInlinePropName, normalizeBorder, denormalizeBorder, getShiftedIndexAfterInsert, getShiftedIndexAfterRemove, resolveRangeBorderSide, getViewportUnionRanges, isIndexInViewportUnion } from './utils.mjs';
|
|
25
60
|
import { detectSelectionType, normalizeSelectionFactory } from '../../selection/index.mjs';
|
|
26
61
|
import { isDefined } from '../../helpers/mixed.mjs';
|
|
27
62
|
export const PLUGIN_KEY = 'customBorders';
|
|
@@ -50,31 +85,373 @@ export const PLUGIN_PRIORITY = 90;
|
|
|
50
85
|
*/ function isCellCoord(value) {
|
|
51
86
|
return isRecord(value) && typeof value.row === 'number' && typeof value.col === 'number';
|
|
52
87
|
}
|
|
53
|
-
/**
|
|
54
|
-
* Type guard returning true when the string is a valid border side name.
|
|
55
|
-
*
|
|
56
|
-
* @param {string} value The string to test.
|
|
57
|
-
* @returns {boolean}
|
|
58
|
-
*/ function isBorderSide(value) {
|
|
59
|
-
return value === 'top' || value === 'bottom' || value === 'start' || value === 'end';
|
|
60
|
-
}
|
|
61
88
|
const SUPPORTED_STYLES = [
|
|
62
89
|
'dashed',
|
|
63
90
|
'dotted',
|
|
64
91
|
'solid'
|
|
65
92
|
];
|
|
93
|
+
/**
|
|
94
|
+
* Default number of border configuration entries applied per background batch when
|
|
95
|
+
* `customBordersProgressive` is enabled. Sized so a batch stays within a frame budget.
|
|
96
|
+
*/ const DEFAULT_PROGRESSIVE_CHUNK_SIZE = 5000;
|
|
66
97
|
var /**
|
|
98
|
+
* Positions of the saved borders in the `savedBorders` array, keyed by the border id.
|
|
99
|
+
* Lets bulk border operations locate an existing border in O(1) instead of scanning the array.
|
|
100
|
+
*/ _savedBordersIndex = /*#__PURE__*/ new WeakMap(), /**
|
|
101
|
+
* Cache of the plugin-created custom selections keyed by the border id. Under viewport
|
|
102
|
+
* virtualization this holds only the selections currently in the rendered range.
|
|
103
|
+
*/ _customSelectionsCache = /*#__PURE__*/ new WeakMap(), /**
|
|
104
|
+
* Visual-row index of the saved borders: maps a visual row to the borders on that row. Lets the
|
|
105
|
+
* viewport sync collect only the borders inside the rendered range in O(viewport) instead of
|
|
106
|
+
* scanning every saved border each render. Rebuilt lazily from `savedBorders` when marked stale.
|
|
107
|
+
*/ _bordersByRow = /*#__PURE__*/ new WeakMap(), /**
|
|
108
|
+
* When `true`, `#bordersByRow` is stale and rebuilt on the next viewport sync. Set whenever the
|
|
109
|
+
* `savedBorders` model changes; keeps the per-frame sync cost bounded by the viewport, not the
|
|
110
|
+
* total border count.
|
|
111
|
+
*/ _bordersByRowDirty = /*#__PURE__*/ new WeakMap(), /**
|
|
112
|
+
* During a `createCustomBorders` pass, holds the `row,col` keys already written in this pass, so a
|
|
113
|
+
* cell touched for the first time can skip the existing-meta merge read (there is nothing to merge
|
|
114
|
+
* on a fresh cell - the pass starts after the previous borders' meta is cleared). Only cells hit by
|
|
115
|
+
* an overlapping range are re-read. Outside a config pass this is `null`, so every other code path
|
|
116
|
+
* (e.g. `setBorders`) keeps reading existing meta and merges as before. Cuts a full O(N)
|
|
117
|
+
* `getCellMeta` pass out of applying a large, non-overlapping `customBorders` config.
|
|
118
|
+
*
|
|
119
|
+
* A progressive load keeps the Set alive across its batches (see {@link #inConfigPass} for why
|
|
120
|
+
* that does not leak the skip into the gaps between them).
|
|
121
|
+
*/ _configPassTouched = /*#__PURE__*/ new WeakMap(), /**
|
|
122
|
+
* `true` only while `createCustomBorders` is running. A progressive load must keep
|
|
123
|
+
* {@link #configPassTouched} alive across all of its batches, so that ranges overlapping across a
|
|
124
|
+
* batch boundary still merge - but the Set alone cannot gate the first-touch skip, because the
|
|
125
|
+
* batches are separated by timeouts during which application code can call the public API. Without
|
|
126
|
+
* this flag a `setBorders` call landing in such a gap would treat the cell as a first touch, skip
|
|
127
|
+
* the existing-meta read, and silently drop the sides already on that cell.
|
|
128
|
+
*/ _inConfigPass = /*#__PURE__*/ new WeakMap(), /**
|
|
129
|
+
* Guards the plugin's own `borders` cell-meta writes so the `afterSetCellMeta` /
|
|
130
|
+
* `afterRemoveCellMeta` listeners react only to external writes (UndoRedo restoring meta, user
|
|
131
|
+
* code calling `setCellMeta` directly). Without it every internal write would re-enter the model
|
|
132
|
+
* upsert it originated from.
|
|
133
|
+
*/ _isInternalMetaWrite = /*#__PURE__*/ new WeakMap(), /**
|
|
134
|
+
* Whether a render following external `borders` cell-meta writes is already scheduled. External
|
|
135
|
+
* writes arrive one cell at a time (UndoRedo restores the meta of an undone row/column removal
|
|
136
|
+
* cell by cell), so the render is coalesced into a single pass for the whole synchronous batch
|
|
137
|
+
* instead of one full render per cell.
|
|
138
|
+
*/ _isMetaSyncRenderScheduled = /*#__PURE__*/ new WeakMap(), /**
|
|
139
|
+
* Pending border configuration entries for a progressive (background-batched) application, or
|
|
140
|
+
* `null` when no progressive load is in flight. Set when `customBordersProgressive` is enabled.
|
|
141
|
+
*/ _progressiveQueue = /*#__PURE__*/ new WeakMap(), /**
|
|
142
|
+
* Index of the next entry in `#progressiveQueue` to apply.
|
|
143
|
+
*/ _progressiveIndex = /*#__PURE__*/ new WeakMap(), /**
|
|
144
|
+
* Number of entries applied per progressive batch.
|
|
145
|
+
*/ _progressiveChunkSize = /*#__PURE__*/ new WeakMap(), /**
|
|
146
|
+
* Monotonic generation token for the active progressive load. Bumped on start, finish, flush, and
|
|
147
|
+
* cancel; a scheduled batch aborts if its captured token no longer matches, so stale timers become
|
|
148
|
+
* no-ops without needing to track and clear individual timeout handles.
|
|
149
|
+
*/ _progressiveToken = /*#__PURE__*/ new WeakMap(), /**
|
|
150
|
+
* Physical row index of each saved border captured before a row move, parallel to `savedBorders`.
|
|
151
|
+
* Used to re-derive each border's visual row after the move reorders the visual index mapping.
|
|
152
|
+
* `null` when no move is in progress.
|
|
153
|
+
*/ _rowMoveSnapshot = /*#__PURE__*/ new WeakMap(), /**
|
|
154
|
+
* Physical column index of each saved border captured before a column move, parallel to
|
|
155
|
+
* `savedBorders`. Used to re-derive each border's visual column after the move reorders the
|
|
156
|
+
* visual index mapping. `null` when no move is in progress.
|
|
157
|
+
*/ _columnMoveSnapshot = /*#__PURE__*/ new WeakMap(), /**
|
|
158
|
+
* Reads the cell's existing borders for a merge, unless this is the first time the cell is touched
|
|
159
|
+
* within a `createCustomBorders` pass - in which case the cell is known to be border-free (the pass
|
|
160
|
+
* runs after the previous borders' meta is cleared), so the read is skipped and `undefined` is
|
|
161
|
+
* returned. Outside a config pass (`#configPassTouched` is `null`) it always reads, preserving the
|
|
162
|
+
* merge behavior of `setBorders` and other callers. Skipping the first-touch read removes a full
|
|
163
|
+
* O(N) `getCellMeta` pass from applying a large, non-overlapping config.
|
|
164
|
+
*
|
|
165
|
+
* @param {number} row Visual row index.
|
|
166
|
+
* @param {number} column Visual column index.
|
|
167
|
+
* @returns {unknown} The existing `borders` meta value, or `undefined` when the read is skipped.
|
|
168
|
+
*/ _readExistingBordersForMerge = /*#__PURE__*/ new WeakSet(), /**
|
|
169
|
+
* Writes or removes the plugin-owned `borders` cell meta with the re-entrancy guard raised, so
|
|
170
|
+
* the external-write listeners ignore it. Pass `null` to remove the meta.
|
|
171
|
+
*
|
|
172
|
+
* Both `setCellMeta` and `removeCellMeta` are vetoable - a `beforeSetCellMeta` /
|
|
173
|
+
* `beforeRemoveCellMeta` listener returning `false` makes them a no-op (an app blocking border
|
|
174
|
+
* edits on locked cells, for example). The write is therefore verified against the resulting meta
|
|
175
|
+
* and reported back, so callers can leave the border model untouched instead of recording a border
|
|
176
|
+
* that has no cell meta behind it. The verification only runs when a matching `before*` listener
|
|
177
|
+
* is registered - without one no veto is possible, and skipping the read keeps the
|
|
178
|
+
* config-application path free of a per-border `getCellMeta` resolution.
|
|
179
|
+
*
|
|
180
|
+
* The removal is verified against the own property, not the resolved value: a `borders` key
|
|
181
|
+
* cascading from the grid or column level survives `removeCellMeta` (which deletes the own key
|
|
182
|
+
* only), so a resolved read would report a veto that never happened. The check covers the
|
|
183
|
+
* cascade; a `borders` key supplied by a `cells` function is written back as an own property and
|
|
184
|
+
* is unsupported - such values are not plugin-owned and never enter the border model.
|
|
185
|
+
*
|
|
186
|
+
* @param {number} row Visual row index.
|
|
187
|
+
* @param {number} column Visual column index.
|
|
188
|
+
* @param {object|null} value The denormalized border object, or `null` to remove.
|
|
189
|
+
* @returns {boolean} `true` when the meta now matches the requested write, `false` when it was vetoed.
|
|
190
|
+
*/ _writeBordersMeta = /*#__PURE__*/ new WeakSet(), /**
|
|
191
|
+
* Builds the border object for a single cell of a range configuration. The cell's existing
|
|
192
|
+
* borders are merged first, so a cell touched by several overlapping ranges keeps every side.
|
|
193
|
+
* Each side that lies on a range edge is resolved through {@link resolveRangeBorderSide}, so an
|
|
194
|
+
* empty side inherits the range-level `border` style instead of the default.
|
|
195
|
+
*
|
|
196
|
+
* @param {number} rowIndex Visual row index of the cell.
|
|
197
|
+
* @param {number} colIndex Visual column index of the cell.
|
|
198
|
+
* @param {object} customBorder The range configuration object.
|
|
199
|
+
* @param {object} range The `{ from, to }` range the configuration applies to.
|
|
200
|
+
* @returns {object} The merged border and the number of sides applied to this cell.
|
|
201
|
+
*/ _buildRangeCellBorder = /*#__PURE__*/ new WeakSet(), /**
|
|
202
|
+
* Destroys every plugin-owned custom selection and clears the rendered working set. Selections
|
|
203
|
+
* added to `highlight.customSelections` by other code are left untouched - the plugin only owns
|
|
204
|
+
* the entries tracked in its working-set cache. Does not touch the `savedBorders` model.
|
|
205
|
+
*/ _destroyAllSelections = /*#__PURE__*/ new WeakSet(), /**
|
|
206
|
+
* Clears the entire border model and its rendered working set: cancels any in-flight progressive
|
|
207
|
+
* load, removes the `borders` meta from every previously bordered cell, empties `savedBorders` and
|
|
208
|
+
* its indexes, and destroys the rendered selections. Shared by `clearBorders()` (clear all) and
|
|
209
|
+
* `changeBorderSettings()` (a fresh array config / `updateSettings` replace). Does not render.
|
|
210
|
+
*/ _resetBorderModel = /*#__PURE__*/ new WeakSet(), /**
|
|
211
|
+
* Rebuilds the visual-row index (`#bordersByRow`) from `savedBorders`. Runs at most once per model
|
|
212
|
+
* change (guarded by `#bordersByRowDirty`), never per render, so the per-frame viewport sync stays
|
|
213
|
+
* bounded by the viewport rather than the total border count.
|
|
214
|
+
*/ _rebuildBordersByRow = /*#__PURE__*/ new WeakSet(), /**
|
|
215
|
+
* Patches a single border into the visual-row index, replacing any entry the row bucket already
|
|
216
|
+
* holds for the same id (a style edit re-inserts a fresh border object for the same cell). Runs
|
|
217
|
+
* only when the index is current - while it is dirty the next sync rebuilds it from scratch, so
|
|
218
|
+
* patching it would be wasted work.
|
|
219
|
+
*
|
|
220
|
+
* @param {object} border The border to index.
|
|
221
|
+
*/ _indexBorderByRow = /*#__PURE__*/ new WeakSet(), /**
|
|
222
|
+
* Drops a single border from the visual-row index. Runs only when the index is current, for the
|
|
223
|
+
* same reason as {@link #indexBorderByRow}.
|
|
224
|
+
*
|
|
225
|
+
* @param {number} row Visual row index the border sits on.
|
|
226
|
+
* @param {string} borderId The id of the border to drop.
|
|
227
|
+
*/ _unindexBorderByRow = /*#__PURE__*/ new WeakSet(), /**
|
|
228
|
+
* Synchronizes the rendered custom selections with the current viewport. Creates selections for
|
|
229
|
+
* bordered cells that entered the rendered range and destroys those that left it, so the selection
|
|
230
|
+
* manager only ever iterates and draws O(viewport) borders regardless of how many are configured.
|
|
231
|
+
* Called on every view render (`beforeViewRender`), before the selection borders are drawn.
|
|
232
|
+
*/ _syncViewportSelections = /*#__PURE__*/ new WeakSet(), /**
|
|
233
|
+
* Creates and registers a rendered custom selection for a single border, keyed by its id in the
|
|
234
|
+
* working-set cache. The `Border` DOM itself is created lazily by the selection manager when the
|
|
235
|
+
* cell is inside the overlay's rendered range.
|
|
236
|
+
*
|
|
237
|
+
* @param {object} border The border model to render.
|
|
238
|
+
*/ _addSelectionForBorder = /*#__PURE__*/ new WeakSet(), /**
|
|
239
|
+
* Rebuilds the id-to-position index of the saved borders after positions have shifted.
|
|
240
|
+
*/ _rebuildSavedBordersIndex = /*#__PURE__*/ new WeakSet(), /**
|
|
241
|
+
* Reads and normalizes the `customBordersProgressive` setting.
|
|
242
|
+
*
|
|
243
|
+
* @returns {{ enabled: boolean, chunkSize: number }}
|
|
244
|
+
*/ _resolveProgressiveSetting = /*#__PURE__*/ new WeakSet(), /**
|
|
245
|
+
* Starts a progressive (background-batched) application of a border configuration. The first batch
|
|
246
|
+
* is scheduled asynchronously so the initial grid render is not blocked.
|
|
247
|
+
*
|
|
248
|
+
* @param {Array} borders The border configuration entries to apply.
|
|
249
|
+
* @param {number} chunkSize The number of entries to apply per batch.
|
|
250
|
+
*/ _startProgressiveApply = /*#__PURE__*/ new WeakSet(), /**
|
|
251
|
+
* Schedules the next progressive batch on a timeout so the browser can paint between batches.
|
|
252
|
+
* `_registerTimeout` auto-clears on `destroy`; the generation token guards against stale runs.
|
|
253
|
+
*
|
|
254
|
+
* @param {number} token The generation token captured when the load started.
|
|
255
|
+
*/ _scheduleProgressiveChunk = /*#__PURE__*/ new WeakSet(), /**
|
|
256
|
+
* Applies one progressive batch, renders so the newly in-viewport borders appear, then schedules
|
|
257
|
+
* the next batch or finishes. Aborts if the load was cancelled/superseded (token mismatch).
|
|
258
|
+
*
|
|
259
|
+
* @param {number} token The generation token captured when the load started.
|
|
260
|
+
*/ _processProgressiveChunk = /*#__PURE__*/ new WeakSet(), /**
|
|
261
|
+
* Applies all remaining progressive batches synchronously and finishes. Used when the border model
|
|
262
|
+
* must be complete immediately - e.g. before a structural change remaps coordinates.
|
|
263
|
+
*/ _flushProgressiveApply = /*#__PURE__*/ new WeakSet(), /**
|
|
264
|
+
* Finalizes a progressive load: clears the queue and pass state, invalidates any pending batch
|
|
265
|
+
* (token bump), and fires `afterCustomBordersUpdate` to signal the borders are complete.
|
|
266
|
+
*/ _finishProgressiveApply = /*#__PURE__*/ new WeakSet(), /**
|
|
267
|
+
* Cancels an in-flight progressive load without firing the completion hook (the borders are being
|
|
268
|
+
* discarded/replaced). Invalidates pending batches via the token bump.
|
|
269
|
+
*/ _cancelProgressiveApply = /*#__PURE__*/ new WeakSet(), /**
|
|
67
270
|
* Validate the style settings. If the style value is not supported, the property is removed from the configuration.
|
|
68
271
|
*
|
|
69
272
|
* @private
|
|
70
273
|
* @param {object[]} customBorders The user defined custom border objects array.
|
|
71
274
|
*/ _validateStyleSettings = /*#__PURE__*/ new WeakSet(), /**
|
|
275
|
+
* Re-synchronizes the saved borders and their rendered custom selections after rows or columns
|
|
276
|
+
* are inserted or removed. Each saved border's coordinate on the given axis is passed through
|
|
277
|
+
* `mapIndex`; a result of `-1` means the border's cell no longer exists and the border is dropped,
|
|
278
|
+
* otherwise the border moves to the new coordinate. The cell meta is left untouched - Handsontable
|
|
279
|
+
* already shifts it, and this method only realigns the plugin's own bookkeeping to that meta.
|
|
280
|
+
*
|
|
281
|
+
* @param {string} axis The coordinate axis to shift - `'row'` or `'col'`.
|
|
282
|
+
* @param {Function} mapIndex Maps an old visual index to its new index, or `-1` when removed.
|
|
283
|
+
*/ _shiftBorders = /*#__PURE__*/ new WeakSet(), /**
|
|
284
|
+
* Re-synchronizes the saved borders and their rendered custom selections after a row or column
|
|
285
|
+
* move. Each border's new visual index on the given axis is derived from the physical index
|
|
286
|
+
* captured before the move, so the border follows the cell it was applied to.
|
|
287
|
+
*
|
|
288
|
+
* @param {string} axis The coordinate axis to remap - `'row'` or `'col'`.
|
|
289
|
+
* @param {Array} snapshot Physical indexes captured before the move, parallel to `savedBorders`.
|
|
290
|
+
* @param {Function} toVisualIndex Translates a physical index to its current visual index.
|
|
291
|
+
*/ _applyMoveSnapshot = /*#__PURE__*/ new WeakSet(), /**
|
|
292
|
+
* Reindexes the model after a structural change has rewritten border coordinates and ids, then
|
|
293
|
+
* drops and re-renders the working set so the viewport sync rebuilds it from the updated model.
|
|
294
|
+
* Tearing the selections down first also avoids transient id collisions (a shifted border's new id
|
|
295
|
+
* can equal another border's not-yet-shifted old id). Shared by `#shiftBorders` and
|
|
296
|
+
* `#applyMoveSnapshot`.
|
|
297
|
+
*
|
|
298
|
+
* @param {boolean} [render=true] If `true`, a render is forced so `#syncViewportSelections`
|
|
299
|
+
* rebuilds the working set. Pass `false` when the caller runs inside an operation that renders on
|
|
300
|
+
* its own afterwards - rendering from within such an operation paints a half-updated grid.
|
|
301
|
+
*/ _rebuildWorkingSetFromModel = /*#__PURE__*/ new WeakSet(), /**
|
|
302
|
+
* Destroys the custom selection for the given border id and removes it from the highlight
|
|
303
|
+
* collection and the id cache. Used when a border's cell is removed from the table.
|
|
304
|
+
*
|
|
305
|
+
* @param {string} borderId The id of the border whose selection should be destroyed.
|
|
306
|
+
*/ _destroyBorderSelection = /*#__PURE__*/ new WeakSet(), /**
|
|
72
307
|
* Add border options to context menu.
|
|
73
308
|
*
|
|
74
309
|
* @param {object} defaultOptions Context menu items.
|
|
75
310
|
*/ _onAfterContextMenuDefaultOptions = /*#__PURE__*/ new WeakSet(), /**
|
|
76
|
-
* `
|
|
77
|
-
|
|
311
|
+
* `init` hook callback. Builds the border model without forcing a render: the `init` hook fires
|
|
312
|
+
* right before the core's first render, and a render forced from here would paint the grid
|
|
313
|
+
* before later-priority plugins (e.g. NestedHeaders) run their own `init` setup, leaving
|
|
314
|
+
* corrupted header DOM behind (#11031 regression). The core's first render syncs and draws the
|
|
315
|
+
* master overlay's borders; the freshly-bootstrapped overlay clones need one more selection
|
|
316
|
+
* pass, so that render is scheduled for `afterInit` - still inside the same synchronous init
|
|
317
|
+
* sequence, but after every plugin finished its initialization.
|
|
318
|
+
*/ _onAfterInit = /*#__PURE__*/ new WeakSet(), /**
|
|
319
|
+
* `beforeViewRender` hook callback. Synchronizes the rendered custom-border selections with the
|
|
320
|
+
* current viewport so only visible borders are materialized and drawn.
|
|
321
|
+
*
|
|
322
|
+
* The sync runs *before* the draw, not after it. The draw resolves the new rendered range
|
|
323
|
+
* (`createCalculators`) before firing `beforeViewRender`, so the range this reads is already the
|
|
324
|
+
* one about to be painted; the overlay clones then draw their selections, and the master draws
|
|
325
|
+
* its own at the end of the same cycle. Syncing from `afterViewRender` instead would land between
|
|
326
|
+
* those two, so a selection created there reached the master but missed the clones - a border
|
|
327
|
+
* scrolled back into a frozen row or column stayed invisible until an unrelated render.
|
|
328
|
+
*/ _onBeforeViewRender = /*#__PURE__*/ new WeakMap(), /**
|
|
329
|
+
* `afterSetCellMeta` hook callback. Follows an external write of the `borders` cell meta (e.g.
|
|
330
|
+
* UndoRedo restoring the meta of an undone row/column removal, or user code calling
|
|
331
|
+
* `setCellMeta` directly) by upserting the matching entry in the border model, so the model and
|
|
332
|
+
* the meta cannot diverge. The plugin's own writes are excluded by the re-entrancy guard.
|
|
333
|
+
*
|
|
334
|
+
* @param {number} row Visual row index.
|
|
335
|
+
* @param {number} column Visual column index.
|
|
336
|
+
* @param {string} key The meta key that was written.
|
|
337
|
+
* @param {*} value The written value.
|
|
338
|
+
*/ _onAfterSetCellMeta = /*#__PURE__*/ new WeakMap(), /**
|
|
339
|
+
* Schedules a single render for a batch of external `borders` cell-meta writes.
|
|
340
|
+
*
|
|
341
|
+
* The writes arrive per cell (`setCellMetaObject` fans a restored meta object out into one
|
|
342
|
+
* `setCellMeta` call per key, and UndoRedo replays one entry per removed cell), so rendering
|
|
343
|
+
* from the listener itself would run a full render for every bordered cell of the restored
|
|
344
|
+
* range. The microtask runs after the synchronous write batch but before the browser can paint,
|
|
345
|
+
* so the borders are still rebuilt within the same frame - no intermediate blank state. The
|
|
346
|
+
* microtask is registered through the core, which cancels pending ones on `destroy`.
|
|
347
|
+
*/ _scheduleMetaSyncRender = /*#__PURE__*/ new WeakSet(), /**
|
|
348
|
+
* `afterRemoveCellMeta` hook callback. Follows an external removal of the `borders` cell meta by
|
|
349
|
+
* dropping the matching entry from the border model and its rendered selection.
|
|
350
|
+
*
|
|
351
|
+
* @param {number} row Visual row index.
|
|
352
|
+
* @param {number} column Visual column index.
|
|
353
|
+
* @param {string} key The removed meta key.
|
|
354
|
+
*/ _onAfterRemoveCellMeta = /*#__PURE__*/ new WeakMap(), /**
|
|
355
|
+
* Applies any in-flight progressive load synchronously, so the border model is complete and its
|
|
356
|
+
* coordinates still describe the grid as the configuration meant them. Every structural change
|
|
357
|
+
* runs this from its `before*` hook: the core shifts the cell meta before firing the matching
|
|
358
|
+
* `after*` hook, so a queue drained from there would write its `borders` meta onto cells the
|
|
359
|
+
* configuration never targeted, leaving the meta and the model permanently out of step. The
|
|
360
|
+
* row/column move handlers flush from their `before*` hooks for the same reason.
|
|
361
|
+
*
|
|
362
|
+
* Auto-inserted rows and columns (`minSpareRows` / `minSpareCols`) append at the end and shift
|
|
363
|
+
* nothing, so they keep the load progressive instead of forcing it to complete.
|
|
364
|
+
*
|
|
365
|
+
* The `before*` hooks are vetoable, and the flush runs before the veto outcome is known - a
|
|
366
|
+
* later listener may still cancel the operation. A vetoed attempt therefore completes the load:
|
|
367
|
+
* nothing shifts, so the flushed model stays correct, but the remaining configuration is applied
|
|
368
|
+
* synchronously in that call. This is a deliberate trade-off - draining from the `after*` side
|
|
369
|
+
* corrupts the meta coordinates (the reason the flush lives here), and an already-applied queue
|
|
370
|
+
* cannot be re-armed.
|
|
371
|
+
*
|
|
372
|
+
* @param {string} [source] Source that triggered the structural change.
|
|
373
|
+
*/ _flushBeforeStructuralChange = /*#__PURE__*/ new WeakSet(), /**
|
|
374
|
+
* `beforeCreateRow` hook callback.
|
|
375
|
+
*
|
|
376
|
+
* @param {number} index Visual index of the first row about to be created.
|
|
377
|
+
* @param {number} amount Number of rows about to be created.
|
|
378
|
+
* @param {string} [source] Source that triggered the row creation.
|
|
379
|
+
*/ _onBeforeCreateRow = /*#__PURE__*/ new WeakMap(), /**
|
|
380
|
+
* `beforeRemoveRow` hook callback.
|
|
381
|
+
*
|
|
382
|
+
* @param {number} index Visual index of the first row about to be removed.
|
|
383
|
+
* @param {number} amount Number of rows about to be removed.
|
|
384
|
+
* @param {Array} physicalRows Physical indexes of the rows about to be removed.
|
|
385
|
+
* @param {string} [source] Source that triggered the row removal.
|
|
386
|
+
*/ _onBeforeRemoveRow = /*#__PURE__*/ new WeakMap(), /**
|
|
387
|
+
* `beforeCreateCol` hook callback.
|
|
388
|
+
*
|
|
389
|
+
* @param {number} index Visual index of the first column about to be created.
|
|
390
|
+
* @param {number} amount Number of columns about to be created.
|
|
391
|
+
* @param {string} [source] Source that triggered the column creation.
|
|
392
|
+
*/ _onBeforeCreateCol = /*#__PURE__*/ new WeakMap(), /**
|
|
393
|
+
* `beforeRemoveCol` hook callback.
|
|
394
|
+
*
|
|
395
|
+
* @param {number} index Visual index of the first column about to be removed.
|
|
396
|
+
* @param {number} amount Number of columns about to be removed.
|
|
397
|
+
* @param {Array} physicalColumns Physical indexes of the columns about to be removed.
|
|
398
|
+
* @param {string} [source] Source that triggered the column removal.
|
|
399
|
+
*/ _onBeforeRemoveCol = /*#__PURE__*/ new WeakMap(), /**
|
|
400
|
+
* `afterCreateRow` hook callback. Shifts every border at or below the insertion point down.
|
|
401
|
+
*
|
|
402
|
+
* @param {number} index Visual index of the first newly created row.
|
|
403
|
+
* @param {number} amount Number of created rows.
|
|
404
|
+
* @param {string} [source] Source that triggered the row creation.
|
|
405
|
+
*/ _onAfterCreateRow = /*#__PURE__*/ new WeakMap(), /**
|
|
406
|
+
* `afterRemoveRow` hook callback. Drops borders on removed rows and shifts the rest up.
|
|
407
|
+
*
|
|
408
|
+
* @param {number} index Visual index of the first removed row.
|
|
409
|
+
* @param {number} amount Number of removed rows.
|
|
410
|
+
*/ _onAfterRemoveRow = /*#__PURE__*/ new WeakMap(), /**
|
|
411
|
+
* `afterCreateCol` hook callback. Shifts every border at or after the insertion point right.
|
|
412
|
+
*
|
|
413
|
+
* @param {number} index Visual index of the first newly created column.
|
|
414
|
+
* @param {number} amount Number of created columns.
|
|
415
|
+
* @param {string} [source] Source that triggered the column creation.
|
|
416
|
+
*/ _onAfterCreateCol = /*#__PURE__*/ new WeakMap(), /**
|
|
417
|
+
* `afterRemoveCol` hook callback. Drops borders on removed columns and shifts the rest left.
|
|
418
|
+
*
|
|
419
|
+
* @param {number} index Visual index of the first removed column.
|
|
420
|
+
* @param {number} amount Number of removed columns.
|
|
421
|
+
*/ _onAfterRemoveCol = /*#__PURE__*/ new WeakMap(), /**
|
|
422
|
+
* `beforeRowMove` hook callback. Snapshots each saved border's physical row so it can be
|
|
423
|
+
* re-derived after the move reorders the visual index mapping.
|
|
424
|
+
*
|
|
425
|
+
* @param {Array} movedRows Visual row indexes being moved.
|
|
426
|
+
* @param {number} finalIndex Target start index for the moved rows.
|
|
427
|
+
* @param {number|undefined} dropIndex Drop index of the move.
|
|
428
|
+
* @param {boolean} movePossible Whether the move is possible.
|
|
429
|
+
*/ _onBeforeRowMove = /*#__PURE__*/ new WeakMap(), /**
|
|
430
|
+
* `afterRowMove` hook callback. Re-derives each border's visual row from the pre-move snapshot.
|
|
431
|
+
*
|
|
432
|
+
* @param {Array} movedRows Visual row indexes that were moved.
|
|
433
|
+
* @param {number} finalIndex Target start index for the moved rows.
|
|
434
|
+
* @param {number|undefined} dropIndex Drop index of the move.
|
|
435
|
+
* @param {boolean} movePossible Whether the move was possible.
|
|
436
|
+
* @param {boolean} orderChanged Whether the move changed the row order.
|
|
437
|
+
*/ _onAfterRowMove = /*#__PURE__*/ new WeakMap(), /**
|
|
438
|
+
* `beforeColumnMove` hook callback. Snapshots each saved border's physical column so it can be
|
|
439
|
+
* re-derived after the move reorders the visual index mapping.
|
|
440
|
+
*
|
|
441
|
+
* @param {Array} movedColumns Visual column indexes being moved.
|
|
442
|
+
* @param {number} finalIndex Target start index for the moved columns.
|
|
443
|
+
* @param {number|undefined} dropIndex Drop index of the move.
|
|
444
|
+
* @param {boolean} movePossible Whether the move is possible.
|
|
445
|
+
*/ _onBeforeColumnMove = /*#__PURE__*/ new WeakMap(), /**
|
|
446
|
+
* `afterColumnMove` hook callback. Re-derives each border's visual column from the pre-move
|
|
447
|
+
* snapshot.
|
|
448
|
+
*
|
|
449
|
+
* @param {Array} movedColumns Visual column indexes that were moved.
|
|
450
|
+
* @param {number} finalIndex Target start index for the moved columns.
|
|
451
|
+
* @param {number|undefined} dropIndex Drop index of the move.
|
|
452
|
+
* @param {boolean} movePossible Whether the move was possible.
|
|
453
|
+
* @param {boolean} orderChanged Whether the move changed the column order.
|
|
454
|
+
*/ _onAfterColumnMove = /*#__PURE__*/ new WeakMap();
|
|
78
455
|
/**
|
|
79
456
|
* @plugin CustomBorders
|
|
80
457
|
* @class CustomBorders
|
|
@@ -138,6 +515,17 @@ var /**
|
|
|
138
515
|
return PLUGIN_PRIORITY;
|
|
139
516
|
}
|
|
140
517
|
/**
|
|
518
|
+
* Returns the settings keys that trigger the plugin update on `updateSettings()`. Beside the
|
|
519
|
+
* plugin key itself this covers `customBordersProgressive`, which changes how the very same
|
|
520
|
+
* configuration is applied - without it, switching only that option would stay inert until some
|
|
521
|
+
* unrelated `customBorders` update happened to come along.
|
|
522
|
+
*/ static get SETTING_KEYS() {
|
|
523
|
+
return [
|
|
524
|
+
PLUGIN_KEY,
|
|
525
|
+
'customBordersProgressive'
|
|
526
|
+
];
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
141
529
|
* Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit}
|
|
142
530
|
* hook and if it returns `true` then the {@link CustomBorders#enablePlugin} method is called.
|
|
143
531
|
*
|
|
@@ -153,11 +541,27 @@ var /**
|
|
|
153
541
|
}
|
|
154
542
|
this.addHook('afterContextMenuDefaultOptions', (options)=>_class_private_method_get(this, _onAfterContextMenuDefaultOptions, onAfterContextMenuDefaultOptions).call(this, options));
|
|
155
543
|
this.addHook('init', ()=>_class_private_method_get(this, _onAfterInit, onAfterInit).call(this));
|
|
544
|
+
this.addHook('beforeCreateRow', _class_private_field_get(this, _onBeforeCreateRow));
|
|
545
|
+
this.addHook('afterCreateRow', _class_private_field_get(this, _onAfterCreateRow));
|
|
546
|
+
this.addHook('beforeRemoveRow', _class_private_field_get(this, _onBeforeRemoveRow));
|
|
547
|
+
this.addHook('afterRemoveRow', _class_private_field_get(this, _onAfterRemoveRow));
|
|
548
|
+
this.addHook('beforeCreateCol', _class_private_field_get(this, _onBeforeCreateCol));
|
|
549
|
+
this.addHook('afterCreateCol', _class_private_field_get(this, _onAfterCreateCol));
|
|
550
|
+
this.addHook('beforeRemoveCol', _class_private_field_get(this, _onBeforeRemoveCol));
|
|
551
|
+
this.addHook('afterRemoveCol', _class_private_field_get(this, _onAfterRemoveCol));
|
|
552
|
+
this.addHook('beforeRowMove', _class_private_field_get(this, _onBeforeRowMove));
|
|
553
|
+
this.addHook('afterRowMove', _class_private_field_get(this, _onAfterRowMove));
|
|
554
|
+
this.addHook('beforeColumnMove', _class_private_field_get(this, _onBeforeColumnMove));
|
|
555
|
+
this.addHook('afterColumnMove', _class_private_field_get(this, _onAfterColumnMove));
|
|
556
|
+
this.addHook('beforeViewRender', _class_private_field_get(this, _onBeforeViewRender));
|
|
557
|
+
this.addHook('afterSetCellMeta', _class_private_field_get(this, _onAfterSetCellMeta));
|
|
558
|
+
this.addHook('afterRemoveCellMeta', _class_private_field_get(this, _onAfterRemoveCellMeta));
|
|
156
559
|
super.enablePlugin();
|
|
157
560
|
}
|
|
158
561
|
/**
|
|
159
562
|
* Disables the plugin functionality for this Handsontable instance.
|
|
160
563
|
*/ disablePlugin() {
|
|
564
|
+
_class_private_method_get(this, _cancelProgressiveApply, cancelProgressiveApply).call(this);
|
|
161
565
|
this.hideBorders();
|
|
162
566
|
super.disablePlugin();
|
|
163
567
|
}
|
|
@@ -190,7 +594,12 @@ var /**
|
|
|
190
594
|
* ```
|
|
191
595
|
*
|
|
192
596
|
* @param {Array[]|CellRange[]} selectionRanges Array of selection ranges.
|
|
193
|
-
* @param {object} borderObject Object with `top`, `
|
|
597
|
+
* @param {object} borderObject Object with `top`, `bottom`, `start`, and `end` properties.
|
|
598
|
+
* Each side object can include:
|
|
599
|
+
* - `width` (`number`) Border width in pixels (default: `1`).
|
|
600
|
+
* - `color` (`string`) CSS border color value (default: `'#000'`).
|
|
601
|
+
* - `hide` (`boolean`) Hides a border side when set to `true`.
|
|
602
|
+
* Legacy aliases `left` and `right` are also supported and are normalized to `start` and `end`.
|
|
194
603
|
*/ setBorders(selectionRanges, borderObject) {
|
|
195
604
|
let borderKeys = [
|
|
196
605
|
'top',
|
|
@@ -220,15 +629,11 @@ var /**
|
|
|
220
629
|
});
|
|
221
630
|
});
|
|
222
631
|
/*
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
Selection.getBorder, which creates a new instance of Border.
|
|
229
|
-
|
|
230
|
-
Seems wise to keep this single-direction flow of creating new Borders
|
|
231
|
-
*/ this.hot.view.render();
|
|
632
|
+
A forced render is used (not a fast `view.render()`) so the `beforeViewRender` hook fires and
|
|
633
|
+
`#syncViewportSelections` materializes the custom selections for the just-changed, in-viewport
|
|
634
|
+
borders before the selection borders are drawn. A fast draw can be skipped when Walkontable
|
|
635
|
+
detects no cell/viewport change, which would leave the new border model unrendered.
|
|
636
|
+
*/ this.hot.render();
|
|
232
637
|
}
|
|
233
638
|
/**
|
|
234
639
|
* Get custom borders.
|
|
@@ -289,12 +694,8 @@ var /**
|
|
|
289
694
|
if (selectionRanges) {
|
|
290
695
|
this.setBorders(selectionRanges);
|
|
291
696
|
} else {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
this.clearNullCellRange();
|
|
295
|
-
this.hot.removeCellMeta(border.row, border.col, 'borders');
|
|
296
|
-
});
|
|
297
|
-
this.savedBorders.length = 0;
|
|
697
|
+
_class_private_method_get(this, _resetBorderModel, resetBorderModel).call(this);
|
|
698
|
+
this.hot.render();
|
|
298
699
|
}
|
|
299
700
|
}
|
|
300
701
|
/**
|
|
@@ -307,16 +708,25 @@ var /**
|
|
|
307
708
|
const hasSavedBorders = this.checkSavedBorders(border);
|
|
308
709
|
if (!hasSavedBorders) {
|
|
309
710
|
this.savedBorders.push(border);
|
|
711
|
+
_class_private_field_get(this, _savedBordersIndex).set(border.id, this.savedBorders.length - 1);
|
|
310
712
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
713
|
+
// Only the model is updated here; the rendered custom selection is created (or refreshed) by
|
|
714
|
+
// `#syncViewportSelections` on the next view render, and only if the border is inside the
|
|
715
|
+
// rendered range. This is what makes the plugin scale: selections and their border DOM are
|
|
716
|
+
// materialized for the viewport, not for every bordered cell. `place` is accepted for backward
|
|
717
|
+
// compatibility but no longer drives an incremental per-side toggle - the sync rebuilds the
|
|
718
|
+
// visible selection from the (already updated) border model, which carries the final side styles.
|
|
719
|
+
//
|
|
720
|
+
// The row index is patched for this one border rather than invalidated wholesale. Marking it
|
|
721
|
+
// dirty would make the next render rebuild it from the whole of `savedBorders`, so a progressive
|
|
722
|
+
// load - which renders once per batch - would rebuild a growing array once per batch and cost
|
|
723
|
+
// O(borders² / chunkSize) over the load, in the exact path the batching exists to speed up.
|
|
724
|
+
_class_private_method_get(this, _indexBorderByRow, indexBorderByRow).call(this, border);
|
|
725
|
+
// Drop any selection currently rendering this cell so the sync recreates it from the updated
|
|
726
|
+
// border object. The border id is coordinate-based and unchanged by a style edit, so without this
|
|
727
|
+
// the sync would keep the stale selection (it only adds/removes by id). No-op during bulk config
|
|
728
|
+
// load, when nothing is rendered yet.
|
|
729
|
+
_class_private_method_get(this, _destroyBorderSelection, destroyBorderSelection).call(this, border.id);
|
|
320
730
|
}
|
|
321
731
|
/**
|
|
322
732
|
* Prepare borders from setting (single cell).
|
|
@@ -334,22 +744,34 @@ var /**
|
|
|
334
744
|
}
|
|
335
745
|
let border = createEmptyBorders(row, column);
|
|
336
746
|
if (borderDescriptor) {
|
|
747
|
+
// A descriptor means "update these sides": start from the cell's existing borders so the
|
|
748
|
+
// sides it does not mention are kept, then layer the descriptor on top. With no descriptor
|
|
749
|
+
// the border stays all-hidden, which is the "clear this cell" intent handled below.
|
|
750
|
+
const existing = _class_private_method_get(this, _readExistingBordersForMerge, readExistingBordersForMerge).call(this, row, column);
|
|
751
|
+
if (isBorderObject(existing)) {
|
|
752
|
+
border = normalizeBorder(deepClone(existing));
|
|
753
|
+
// The merge base describes THIS cell regardless of the bookkeeping fields the stored meta
|
|
754
|
+
// carries - they can be stale when the meta is a detached snapshot (e.g. UndoRedo restoring
|
|
755
|
+
// borders captured at pre-shift coordinates).
|
|
756
|
+
border.row = row;
|
|
757
|
+
border.col = column;
|
|
758
|
+
border.id = createId(row, column);
|
|
759
|
+
}
|
|
337
760
|
border = extendDefaultBorder(border, borderDescriptor);
|
|
338
|
-
arrayEach(this.hot.selection.highlight.customSelections, (customSelection)=>{
|
|
339
|
-
const { settings } = customSelection;
|
|
340
|
-
if (border.id === settings.id) {
|
|
341
|
-
Object.assign(settings, borderDescriptor);
|
|
342
|
-
const s = settings;
|
|
343
|
-
border.id = s.id;
|
|
344
|
-
border.top = s.top;
|
|
345
|
-
border.bottom = s.bottom;
|
|
346
|
-
border.start = s.start;
|
|
347
|
-
border.end = s.end;
|
|
348
|
-
return false; // breaks forAll
|
|
349
|
-
}
|
|
350
|
-
});
|
|
351
761
|
}
|
|
352
|
-
|
|
762
|
+
// When every side is hidden (e.g. `setBorders(range)` with no style object, used to clear a
|
|
763
|
+
// cell) the border is removed entirely - dropped from the model and its cell meta - rather than
|
|
764
|
+
// stored as an all-hidden object. The rendered selection is reconciled by the viewport sync.
|
|
765
|
+
if (this.countHide(border) === 4) {
|
|
766
|
+
this.removeAllBorders(row, column);
|
|
767
|
+
return;
|
|
768
|
+
}
|
|
769
|
+
// A vetoed meta write must not reach the model - otherwise `getBorders()` would report a border
|
|
770
|
+
// that `getCellMeta().borders` knows nothing about, and clearing the model later would try to
|
|
771
|
+
// remove a meta key that was never written.
|
|
772
|
+
if (!_class_private_method_get(this, _writeBordersMeta, writeBordersMeta).call(this, row, column, denormalizeBorder(border))) {
|
|
773
|
+
return;
|
|
774
|
+
}
|
|
353
775
|
this.insertBorderIntoSettings(border, place);
|
|
354
776
|
}
|
|
355
777
|
/**
|
|
@@ -363,39 +785,13 @@ var /**
|
|
|
363
785
|
const lastColumnIndex = Math.min(range.to.col, this.hot.countCols() - 1);
|
|
364
786
|
rangeEach(range.from.row, lastRowIndex, (rowIndex)=>{
|
|
365
787
|
rangeEach(range.from.col, lastColumnIndex, (colIndex)=>{
|
|
366
|
-
const border =
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
// Please keep in mind that `range.to.row` may be beyond the table boundaries. The border won't be rendered.
|
|
375
|
-
if (rowIndex === range.to.row) {
|
|
376
|
-
if (hasOwnProperty(customBorder, 'bottom')) {
|
|
377
|
-
add += 1;
|
|
378
|
-
border.bottom = customBorder.bottom;
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
if (colIndex === range.from.col) {
|
|
382
|
-
if (hasOwnProperty(customBorder, 'start')) {
|
|
383
|
-
add += 1;
|
|
384
|
-
border.start = customBorder.start;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
// Please keep in mind that `range.to.col` may be beyond the table boundaries. The border won't be rendered.
|
|
388
|
-
if (colIndex === range.to.col) {
|
|
389
|
-
if (hasOwnProperty(customBorder, 'end')) {
|
|
390
|
-
add += 1;
|
|
391
|
-
border.end = customBorder.end;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
if (add > 0) {
|
|
395
|
-
this.hot.setCellMeta(rowIndex, colIndex, 'borders', denormalizeBorder(border));
|
|
788
|
+
const { border, add } = _class_private_method_get(this, _buildRangeCellBorder, buildRangeCellBorder).call(this, rowIndex, colIndex, customBorder, range);
|
|
789
|
+
// `#buildRangeCellBorder` already merged this cell's existing borders, so overlapping
|
|
790
|
+
// ranges accumulate their sides in the model. The rendered selection is (re)built from the
|
|
791
|
+
// merged model by `#syncViewportSelections` on the next view render. A cell whose meta
|
|
792
|
+
// write is vetoed is skipped entirely, so the model never gets ahead of the meta.
|
|
793
|
+
if (add > 0 && _class_private_method_get(this, _writeBordersMeta, writeBordersMeta).call(this, rowIndex, colIndex, denormalizeBorder(border))) {
|
|
396
794
|
this.insertBorderIntoSettings(border, undefined);
|
|
397
|
-
} else {
|
|
398
|
-
// TODO sometimes it enters here. Why?
|
|
399
795
|
}
|
|
400
796
|
});
|
|
401
797
|
});
|
|
@@ -407,11 +803,18 @@ var /**
|
|
|
407
803
|
* @param {number} row Visual row index.
|
|
408
804
|
* @param {number} column Visual column index.
|
|
409
805
|
*/ removeAllBorders(row, column) {
|
|
806
|
+
// The meta removal is vetoable, so it runs first: when a `beforeRemoveCellMeta` listener blocks
|
|
807
|
+
// it the cell keeps its `borders` meta, and dropping the border from the model anyway would
|
|
808
|
+
// leave `getBorders()` and `getCellMeta().borders` disagreeing.
|
|
809
|
+
if (!_class_private_method_get(this, _writeBordersMeta, writeBordersMeta).call(this, row, column, null)) {
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
410
812
|
const borderId = createId(row, column);
|
|
411
813
|
this.spliceBorder(borderId);
|
|
412
|
-
this.
|
|
413
|
-
this
|
|
414
|
-
|
|
814
|
+
_class_private_method_get(this, _unindexBorderByRow, unindexBorderByRow).call(this, row, borderId);
|
|
815
|
+
// Destroy the rendered selection if this border is currently in the viewport working set; if it
|
|
816
|
+
// is off-screen there is nothing rendered to remove.
|
|
817
|
+
_class_private_method_get(this, _destroyBorderSelection, destroyBorderSelection).call(this, borderId);
|
|
415
818
|
}
|
|
416
819
|
/**
|
|
417
820
|
* Set borders for each cell re. To border position.
|
|
@@ -434,20 +837,15 @@ var /**
|
|
|
434
837
|
const hideCount = this.countHide(bordersMeta);
|
|
435
838
|
if (hideCount === 4) {
|
|
436
839
|
this.removeAllBorders(row, column);
|
|
437
|
-
} else {
|
|
438
|
-
|
|
439
|
-
if (!customSelectionsChecker) {
|
|
440
|
-
this.insertBorderIntoSettings(bordersMeta, undefined);
|
|
441
|
-
}
|
|
442
|
-
this.hot.setCellMeta(row, column, 'borders', denormalizeBorder(bordersMeta));
|
|
840
|
+
} else if (_class_private_method_get(this, _writeBordersMeta, writeBordersMeta).call(this, row, column, denormalizeBorder(bordersMeta))) {
|
|
841
|
+
this.insertBorderIntoSettings(bordersMeta, undefined);
|
|
443
842
|
}
|
|
444
843
|
} else {
|
|
445
844
|
bordersMeta[place] = createDefaultCustomBorder();
|
|
446
|
-
|
|
447
|
-
if (
|
|
845
|
+
// The meta is written first so a vetoed write leaves the model untouched.
|
|
846
|
+
if (_class_private_method_get(this, _writeBordersMeta, writeBordersMeta).call(this, row, column, denormalizeBorder(bordersMeta))) {
|
|
448
847
|
this.insertBorderIntoSettings(bordersMeta, undefined);
|
|
449
848
|
}
|
|
450
|
-
this.hot.setCellMeta(row, column, 'borders', denormalizeBorder(bordersMeta));
|
|
451
849
|
}
|
|
452
850
|
}
|
|
453
851
|
/**
|
|
@@ -506,6 +904,9 @@ var /**
|
|
|
506
904
|
}
|
|
507
905
|
}
|
|
508
906
|
});
|
|
907
|
+
// Border changes above only updated the model; render so `#syncViewportSelections` materializes
|
|
908
|
+
// the visible selections for the changed cells.
|
|
909
|
+
this.hot.render();
|
|
509
910
|
}
|
|
510
911
|
/**
|
|
511
912
|
* Create borders from settings.
|
|
@@ -513,14 +914,30 @@ var /**
|
|
|
513
914
|
* @private
|
|
514
915
|
* @param {Array} customBorders Object with `row` and `col`, `start`, `end`, `top` and `bottom` properties.
|
|
515
916
|
*/ createCustomBorders(customBorders) {
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
917
|
+
// Own the first-touch tracking Set only when one is not already active. A progressive load keeps
|
|
918
|
+
// a single Set across all its batches (so overlapping ranges split across batches still merge
|
|
919
|
+
// correctly); a plain synchronous call owns and clears it here.
|
|
920
|
+
const ownsPass = _class_private_field_get(this, _configPassTouched) === null;
|
|
921
|
+
const wasInConfigPass = _class_private_field_get(this, _inConfigPass);
|
|
922
|
+
if (ownsPass) {
|
|
923
|
+
_class_private_field_set(this, _configPassTouched, new Set());
|
|
924
|
+
}
|
|
925
|
+
_class_private_field_set(this, _inConfigPass, true);
|
|
926
|
+
try {
|
|
927
|
+
arrayEach(customBorders, (customBorder)=>{
|
|
928
|
+
const normCustomBorder = normalizeBorder(customBorder);
|
|
929
|
+
if (normCustomBorder.range) {
|
|
930
|
+
this.prepareBorderFromCustomAddedRange(normCustomBorder.range, normCustomBorder);
|
|
931
|
+
} else {
|
|
932
|
+
this.prepareBorderFromCustomAdded(normCustomBorder.row ?? 0, normCustomBorder.col ?? 0, normCustomBorder, undefined);
|
|
933
|
+
}
|
|
934
|
+
});
|
|
935
|
+
} finally{
|
|
936
|
+
_class_private_field_set(this, _inConfigPass, wasInConfigPass);
|
|
937
|
+
if (ownsPass) {
|
|
938
|
+
_class_private_field_set(this, _configPassTouched, null);
|
|
522
939
|
}
|
|
523
|
-
}
|
|
940
|
+
}
|
|
524
941
|
}
|
|
525
942
|
/**
|
|
526
943
|
* Count hide property in border object.
|
|
@@ -546,38 +963,12 @@ var /**
|
|
|
546
963
|
}, 0);
|
|
547
964
|
}
|
|
548
965
|
/**
|
|
549
|
-
*
|
|
550
|
-
*
|
|
551
|
-
* @private
|
|
552
|
-
* @param {string} borderId Border id name as string.
|
|
553
|
-
*/ clearBordersFromSelectionSettings(borderId) {
|
|
554
|
-
const index = arrayMap(this.hot.selection.highlight.customSelections, (customSelection)=>customSelection.settings.id).indexOf(borderId);
|
|
555
|
-
if (index > -1) {
|
|
556
|
-
this.hot.selection.highlight.customSelections[index].clear();
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
/**
|
|
560
|
-
* Clear cellRange with null value.
|
|
561
|
-
*
|
|
562
|
-
* @private
|
|
563
|
-
*/ clearNullCellRange() {
|
|
564
|
-
arrayEach(this.hot.selection.highlight.customSelections, (customSelection, index)=>{
|
|
565
|
-
if (customSelection.cellRange === null) {
|
|
566
|
-
customSelection.destroy();
|
|
567
|
-
this.hot.selection.highlight.customSelections.splice(index, 1);
|
|
568
|
-
return false; // breaks forAll
|
|
569
|
-
}
|
|
570
|
-
});
|
|
571
|
-
}
|
|
572
|
-
/**
|
|
573
|
-
* Hide custom borders.
|
|
966
|
+
* Hide custom borders. Destroys the rendered working-set selections; the `savedBorders` model is
|
|
967
|
+
* kept so the borders can be re-materialized if the plugin is re-enabled.
|
|
574
968
|
*
|
|
575
969
|
* @private
|
|
576
970
|
*/ hideBorders() {
|
|
577
|
-
|
|
578
|
-
this.clearBordersFromSelectionSettings(border.id);
|
|
579
|
-
this.clearNullCellRange();
|
|
580
|
-
});
|
|
971
|
+
_class_private_method_get(this, _destroyAllSelections, destroyAllSelections).call(this);
|
|
581
972
|
}
|
|
582
973
|
/**
|
|
583
974
|
* Splice border from savedBorders.
|
|
@@ -585,9 +976,10 @@ var /**
|
|
|
585
976
|
* @private
|
|
586
977
|
* @param {string} borderId Border id name as string.
|
|
587
978
|
*/ spliceBorder(borderId) {
|
|
588
|
-
const index =
|
|
979
|
+
const index = _class_private_field_get(this, _savedBordersIndex).get(borderId) ?? -1;
|
|
589
980
|
if (index > -1) {
|
|
590
981
|
this.savedBorders.splice(index, 1);
|
|
982
|
+
_class_private_method_get(this, _rebuildSavedBordersIndex, rebuildSavedBordersIndex).call(this);
|
|
591
983
|
}
|
|
592
984
|
}
|
|
593
985
|
/**
|
|
@@ -605,73 +997,11 @@ var /**
|
|
|
605
997
|
this.spliceBorder(border.id);
|
|
606
998
|
check = true;
|
|
607
999
|
} else {
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
check = true;
|
|
612
|
-
return false; // breaks forAll
|
|
613
|
-
}
|
|
614
|
-
});
|
|
615
|
-
}
|
|
616
|
-
return check;
|
|
617
|
-
}
|
|
618
|
-
/**
|
|
619
|
-
* Check if an border already exists in the customSelections, and if true call toggleHiddenClass method.
|
|
620
|
-
*
|
|
621
|
-
* @private
|
|
622
|
-
* @param {object} border Object with `row` and `col`, `start`, `end`, `top` and `bottom`, `id` and
|
|
623
|
-
* `border` ({Object} with `color`, `width` and `cornerVisible` property) properties.
|
|
624
|
-
* @param {string} place Coordinate where add/remove border - `top`, `bottom`, `start`, `end` and `noBorders`.
|
|
625
|
-
* @param {boolean} remove True when remove borders, and false when add borders.
|
|
626
|
-
*
|
|
627
|
-
* @returns {boolean}
|
|
628
|
-
*/ checkCustomSelectionsFromContextMenu(border, place, remove) {
|
|
629
|
-
let check = false;
|
|
630
|
-
const customSelections = this.hot.selection.highlight.customSelections;
|
|
631
|
-
arrayEach(customSelections, (customSelection)=>{
|
|
632
|
-
if (border.id === customSelection.settings.id) {
|
|
633
|
-
const borders = this.hot.view._wt.selectionManager.getBorderInstances(customSelection);
|
|
634
|
-
if (isBorderSide(place)) {
|
|
635
|
-
arrayEach(borders, (borderObject)=>{
|
|
636
|
-
borderObject.toggleHiddenClass(place, remove ?? false);
|
|
637
|
-
});
|
|
638
|
-
}
|
|
1000
|
+
const index = _class_private_field_get(this, _savedBordersIndex).get(border.id);
|
|
1001
|
+
if (index !== undefined) {
|
|
1002
|
+
this.savedBorders[index] = border;
|
|
639
1003
|
check = true;
|
|
640
|
-
return false; // breaks forAll
|
|
641
1004
|
}
|
|
642
|
-
});
|
|
643
|
-
return check;
|
|
644
|
-
}
|
|
645
|
-
/**
|
|
646
|
-
* Check if an border already exists in the customSelections, and if true reset cellRange.
|
|
647
|
-
*
|
|
648
|
-
* @private
|
|
649
|
-
* @param {object} border Object with `row` and `col`, `start`, `end`, `top` and `bottom`, `id` and
|
|
650
|
-
* `border` ({Object} with `color`, `width` and `cornerVisible` property) properties.
|
|
651
|
-
* @param {CellRange} cellRange The selection range to check.
|
|
652
|
-
* @param {string} [place] Coordinate where add/remove border - `top`, `bottom`, `start`, `end`.
|
|
653
|
-
* @returns {boolean}
|
|
654
|
-
*/ checkCustomSelections(border, cellRange, place) {
|
|
655
|
-
const hideCount = this.countHide(border);
|
|
656
|
-
let check = false;
|
|
657
|
-
if (hideCount === 4) {
|
|
658
|
-
this.removeAllBorders(border.row, border.col);
|
|
659
|
-
check = true;
|
|
660
|
-
} else {
|
|
661
|
-
arrayEach(this.hot.selection.highlight.customSelections, (customSelection)=>{
|
|
662
|
-
if (border.id === customSelection.settings.id) {
|
|
663
|
-
customSelection.visualCellRange = cellRange;
|
|
664
|
-
customSelection.commit();
|
|
665
|
-
if (place && isBorderSide(place)) {
|
|
666
|
-
const borders = this.hot.view._wt.selectionManager.getBorderInstances(customSelection);
|
|
667
|
-
arrayEach(borders, (borderObject)=>{
|
|
668
|
-
borderObject.changeBorderStyle(place, border);
|
|
669
|
-
});
|
|
670
|
-
}
|
|
671
|
-
check = true;
|
|
672
|
-
return false; // breaks forAll
|
|
673
|
-
}
|
|
674
|
-
});
|
|
675
1005
|
}
|
|
676
1006
|
return check;
|
|
677
1007
|
}
|
|
@@ -679,18 +1009,38 @@ var /**
|
|
|
679
1009
|
* Change borders from settings.
|
|
680
1010
|
*
|
|
681
1011
|
* @private
|
|
682
|
-
|
|
1012
|
+
* @param {boolean} [render=true] If `true`, a render is forced after the border model is rebuilt
|
|
1013
|
+
* so `#syncViewportSelections` materializes the visible selections. Pass `false` on the `init`
|
|
1014
|
+
* path: the `init` hook fires before the core's own first render, so that render performs the
|
|
1015
|
+
* sync - and rendering here would paint the grid before later-priority plugins (e.g.
|
|
1016
|
+
* NestedHeaders) finish their `init` setup, leaving corrupted header DOM behind.
|
|
1017
|
+
*/ changeBorderSettings(render = true) {
|
|
683
1018
|
const customBorders = this.hot.getSettings()[PLUGIN_KEY];
|
|
684
1019
|
if (Array.isArray(customBorders)) {
|
|
685
1020
|
const bordersClone = deepClone(customBorders.filter(isRecord));
|
|
686
1021
|
this.checkSettingsCohesion(bordersClone);
|
|
687
|
-
|
|
688
|
-
|
|
1022
|
+
// A fresh array config replaces the previous borders (this is also the `updateSettings` path).
|
|
1023
|
+
// Reset the model and clear the previous cells' meta first so `prepareBorderFromCustomAdded`
|
|
1024
|
+
// starts from a clean slate instead of merging the new config onto stale meta.
|
|
1025
|
+
_class_private_method_get(this, _resetBorderModel, resetBorderModel).call(this);
|
|
1026
|
+
const progressive = _class_private_method_get(this, _resolveProgressiveSetting, resolveProgressiveSetting).call(this);
|
|
1027
|
+
if (progressive.enabled && bordersClone.length > 0) {
|
|
1028
|
+
// Apply borders in background batches: render the (border-less) grid now so it is
|
|
1029
|
+
// interactive immediately; batches fill in and `afterCustomBordersUpdate` fires on drain.
|
|
1030
|
+
_class_private_method_get(this, _startProgressiveApply, startProgressiveApply).call(this, bordersClone, progressive.chunkSize);
|
|
1031
|
+
if (render) {
|
|
1032
|
+
this.hot.render();
|
|
1033
|
+
}
|
|
1034
|
+
return;
|
|
689
1035
|
}
|
|
690
1036
|
this.createCustomBorders(bordersClone);
|
|
691
1037
|
} else if (customBorders !== undefined) {
|
|
692
1038
|
this.createCustomBorders(this.savedBorders);
|
|
693
1039
|
}
|
|
1040
|
+
if (render) {
|
|
1041
|
+
this.hot.render();
|
|
1042
|
+
}
|
|
1043
|
+
this.hot.runHooks('afterCustomBordersUpdate');
|
|
694
1044
|
}
|
|
695
1045
|
/**
|
|
696
1046
|
* Checks the settings cohesion. The properties such like "left"/"right" are supported only
|
|
@@ -712,17 +1062,467 @@ var /**
|
|
|
712
1062
|
/**
|
|
713
1063
|
* Destroys the plugin instance.
|
|
714
1064
|
*/ destroy() {
|
|
1065
|
+
// Cancel any in-flight progressive load and release the border model / working-set graphs so a
|
|
1066
|
+
// destroyed instance does not retain them for the page lifetime.
|
|
1067
|
+
_class_private_method_get(this, _cancelProgressiveApply, cancelProgressiveApply).call(this);
|
|
1068
|
+
this.savedBorders = [];
|
|
1069
|
+
_class_private_field_get(this, _savedBordersIndex).clear();
|
|
1070
|
+
_class_private_field_get(this, _bordersByRow).clear();
|
|
1071
|
+
_class_private_field_get(this, _customSelectionsCache).clear();
|
|
1072
|
+
_class_private_field_set(this, _rowMoveSnapshot, null);
|
|
1073
|
+
_class_private_field_set(this, _columnMoveSnapshot, null);
|
|
715
1074
|
super.destroy();
|
|
716
1075
|
}
|
|
717
1076
|
constructor(...args){
|
|
718
|
-
super(...args), _class_private_method_init(this, _validateStyleSettings), _class_private_method_init(this, _onAfterContextMenuDefaultOptions), _class_private_method_init(this, _onAfterInit),
|
|
1077
|
+
super(...args), _class_private_method_init(this, _readExistingBordersForMerge), _class_private_method_init(this, _writeBordersMeta), _class_private_method_init(this, _buildRangeCellBorder), _class_private_method_init(this, _destroyAllSelections), _class_private_method_init(this, _resetBorderModel), _class_private_method_init(this, _rebuildBordersByRow), _class_private_method_init(this, _indexBorderByRow), _class_private_method_init(this, _unindexBorderByRow), _class_private_method_init(this, _syncViewportSelections), _class_private_method_init(this, _addSelectionForBorder), _class_private_method_init(this, _rebuildSavedBordersIndex), _class_private_method_init(this, _resolveProgressiveSetting), _class_private_method_init(this, _startProgressiveApply), _class_private_method_init(this, _scheduleProgressiveChunk), _class_private_method_init(this, _processProgressiveChunk), _class_private_method_init(this, _flushProgressiveApply), _class_private_method_init(this, _finishProgressiveApply), _class_private_method_init(this, _cancelProgressiveApply), _class_private_method_init(this, _validateStyleSettings), _class_private_method_init(this, _shiftBorders), _class_private_method_init(this, _applyMoveSnapshot), _class_private_method_init(this, _rebuildWorkingSetFromModel), _class_private_method_init(this, _destroyBorderSelection), _class_private_method_init(this, _onAfterContextMenuDefaultOptions), _class_private_method_init(this, _onAfterInit), _class_private_method_init(this, _scheduleMetaSyncRender), _class_private_method_init(this, _flushBeforeStructuralChange), _class_private_field_init(this, _savedBordersIndex, {
|
|
1078
|
+
writable: true,
|
|
1079
|
+
value: void 0
|
|
1080
|
+
}), _class_private_field_init(this, _customSelectionsCache, {
|
|
1081
|
+
writable: true,
|
|
1082
|
+
value: void 0
|
|
1083
|
+
}), _class_private_field_init(this, _bordersByRow, {
|
|
1084
|
+
writable: true,
|
|
1085
|
+
value: void 0
|
|
1086
|
+
}), _class_private_field_init(this, _bordersByRowDirty, {
|
|
1087
|
+
writable: true,
|
|
1088
|
+
value: void 0
|
|
1089
|
+
}), _class_private_field_init(this, _configPassTouched, {
|
|
1090
|
+
writable: true,
|
|
1091
|
+
value: void 0
|
|
1092
|
+
}), _class_private_field_init(this, _inConfigPass, {
|
|
1093
|
+
writable: true,
|
|
1094
|
+
value: void 0
|
|
1095
|
+
}), _class_private_field_init(this, _isInternalMetaWrite, {
|
|
1096
|
+
writable: true,
|
|
1097
|
+
value: void 0
|
|
1098
|
+
}), _class_private_field_init(this, _isMetaSyncRenderScheduled, {
|
|
1099
|
+
writable: true,
|
|
1100
|
+
value: void 0
|
|
1101
|
+
}), _class_private_field_init(this, _progressiveQueue, {
|
|
1102
|
+
writable: true,
|
|
1103
|
+
value: void 0
|
|
1104
|
+
}), _class_private_field_init(this, _progressiveIndex, {
|
|
1105
|
+
writable: true,
|
|
1106
|
+
value: void 0
|
|
1107
|
+
}), _class_private_field_init(this, _progressiveChunkSize, {
|
|
1108
|
+
writable: true,
|
|
1109
|
+
value: void 0
|
|
1110
|
+
}), _class_private_field_init(this, _progressiveToken, {
|
|
1111
|
+
writable: true,
|
|
1112
|
+
value: void 0
|
|
1113
|
+
}), _class_private_field_init(this, _rowMoveSnapshot, {
|
|
1114
|
+
writable: true,
|
|
1115
|
+
value: void 0
|
|
1116
|
+
}), _class_private_field_init(this, _columnMoveSnapshot, {
|
|
1117
|
+
writable: true,
|
|
1118
|
+
value: void 0
|
|
1119
|
+
}), _class_private_field_init(this, _onBeforeViewRender, {
|
|
1120
|
+
writable: true,
|
|
1121
|
+
value: void 0
|
|
1122
|
+
}), _class_private_field_init(this, _onAfterSetCellMeta, {
|
|
1123
|
+
writable: true,
|
|
1124
|
+
value: void 0
|
|
1125
|
+
}), _class_private_field_init(this, _onAfterRemoveCellMeta, {
|
|
1126
|
+
writable: true,
|
|
1127
|
+
value: void 0
|
|
1128
|
+
}), _class_private_field_init(this, _onBeforeCreateRow, {
|
|
1129
|
+
writable: true,
|
|
1130
|
+
value: void 0
|
|
1131
|
+
}), _class_private_field_init(this, _onBeforeRemoveRow, {
|
|
1132
|
+
writable: true,
|
|
1133
|
+
value: void 0
|
|
1134
|
+
}), _class_private_field_init(this, _onBeforeCreateCol, {
|
|
1135
|
+
writable: true,
|
|
1136
|
+
value: void 0
|
|
1137
|
+
}), _class_private_field_init(this, _onBeforeRemoveCol, {
|
|
1138
|
+
writable: true,
|
|
1139
|
+
value: void 0
|
|
1140
|
+
}), _class_private_field_init(this, _onAfterCreateRow, {
|
|
1141
|
+
writable: true,
|
|
1142
|
+
value: void 0
|
|
1143
|
+
}), _class_private_field_init(this, _onAfterRemoveRow, {
|
|
1144
|
+
writable: true,
|
|
1145
|
+
value: void 0
|
|
1146
|
+
}), _class_private_field_init(this, _onAfterCreateCol, {
|
|
1147
|
+
writable: true,
|
|
1148
|
+
value: void 0
|
|
1149
|
+
}), _class_private_field_init(this, _onAfterRemoveCol, {
|
|
1150
|
+
writable: true,
|
|
1151
|
+
value: void 0
|
|
1152
|
+
}), _class_private_field_init(this, _onBeforeRowMove, {
|
|
1153
|
+
writable: true,
|
|
1154
|
+
value: void 0
|
|
1155
|
+
}), _class_private_field_init(this, _onAfterRowMove, {
|
|
1156
|
+
writable: true,
|
|
1157
|
+
value: void 0
|
|
1158
|
+
}), _class_private_field_init(this, _onBeforeColumnMove, {
|
|
1159
|
+
writable: true,
|
|
1160
|
+
value: void 0
|
|
1161
|
+
}), _class_private_field_init(this, _onAfterColumnMove, {
|
|
1162
|
+
writable: true,
|
|
1163
|
+
value: void 0
|
|
1164
|
+
}), /**
|
|
719
1165
|
* Saved borders.
|
|
720
1166
|
*
|
|
721
1167
|
* @private
|
|
722
1168
|
* @type {Array}
|
|
723
|
-
*/ this.savedBorders = []
|
|
1169
|
+
*/ this.savedBorders = [], _class_private_field_set(this, _savedBordersIndex, new Map()), _class_private_field_set(this, _customSelectionsCache, new Map()), _class_private_field_set(this, _bordersByRow, new Map()), _class_private_field_set(this, _bordersByRowDirty, true), _class_private_field_set(this, _configPassTouched, null), _class_private_field_set(this, _inConfigPass, false), _class_private_field_set(this, _isInternalMetaWrite, false), _class_private_field_set(this, _isMetaSyncRenderScheduled, false), _class_private_field_set(this, _progressiveQueue, null), _class_private_field_set(this, _progressiveIndex, 0), _class_private_field_set(this, _progressiveChunkSize, DEFAULT_PROGRESSIVE_CHUNK_SIZE), _class_private_field_set(this, _progressiveToken, 0), _class_private_field_set(this, _rowMoveSnapshot, null), _class_private_field_set(this, _columnMoveSnapshot, null), _class_private_field_set(this, _onBeforeViewRender, ()=>{
|
|
1170
|
+
_class_private_method_get(this, _syncViewportSelections, syncViewportSelections).call(this);
|
|
1171
|
+
}), _class_private_field_set(this, _onAfterSetCellMeta, (row, column, key, value)=>{
|
|
1172
|
+
if (_class_private_field_get(this, _isInternalMetaWrite) || key !== 'borders' || !isRecord(value)) {
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1175
|
+
// The written value may be a complete plugin-shaped border object (UndoRedo restoring the meta
|
|
1176
|
+
// of an undone removal) or a partial user-authored one (e.g. `{ top: { width: 2 } }` passed to
|
|
1177
|
+
// `setCellMeta` directly), so it must not be required to carry the internal `id`/`row`/`col`
|
|
1178
|
+
// bookkeeping fields. Routing it through `prepareBorderFromCustomAdded` treats it as a border
|
|
1179
|
+
// descriptor for the write's coordinates. The meta key was already replaced by this write (the
|
|
1180
|
+
// previous sides are gone), so the descriptor defines the cell's borders: the canonical
|
|
1181
|
+
// (complete, denormalized) object is written back to the meta, an all-hidden result clears the
|
|
1182
|
+
// cell, and the model entry is upserted - so meta and model cannot diverge.
|
|
1183
|
+
this.prepareBorderFromCustomAdded(row, column, normalizeBorder(deepClone(value)), undefined);
|
|
1184
|
+
// `setCellMeta` does not render, and the model update above dropped the cell's previous rendered
|
|
1185
|
+
// selection so the viewport sync can rebuild it. Without a render the old border DOM is gone
|
|
1186
|
+
// and the new one waits for some unrelated render - the cell would appear to lose its border.
|
|
1187
|
+
_class_private_method_get(this, _scheduleMetaSyncRender, scheduleMetaSyncRender).call(this);
|
|
1188
|
+
}), _class_private_field_set(this, _onAfterRemoveCellMeta, (row, column, key)=>{
|
|
1189
|
+
if (_class_private_field_get(this, _isInternalMetaWrite) || key !== 'borders') {
|
|
1190
|
+
return;
|
|
1191
|
+
}
|
|
1192
|
+
const borderId = createId(row, column);
|
|
1193
|
+
this.spliceBorder(borderId);
|
|
1194
|
+
_class_private_method_get(this, _unindexBorderByRow, unindexBorderByRow).call(this, row, borderId);
|
|
1195
|
+
_class_private_method_get(this, _destroyBorderSelection, destroyBorderSelection).call(this, borderId);
|
|
1196
|
+
}), _class_private_field_set(this, _onBeforeCreateRow, (index, amount, source)=>{
|
|
1197
|
+
_class_private_method_get(this, _flushBeforeStructuralChange, flushBeforeStructuralChange).call(this, source);
|
|
1198
|
+
}), _class_private_field_set(this, _onBeforeRemoveRow, (index, amount, physicalRows, source)=>{
|
|
1199
|
+
_class_private_method_get(this, _flushBeforeStructuralChange, flushBeforeStructuralChange).call(this, source);
|
|
1200
|
+
}), _class_private_field_set(this, _onBeforeCreateCol, (index, amount, source)=>{
|
|
1201
|
+
_class_private_method_get(this, _flushBeforeStructuralChange, flushBeforeStructuralChange).call(this, source);
|
|
1202
|
+
}), _class_private_field_set(this, _onBeforeRemoveCol, (index, amount, physicalColumns, source)=>{
|
|
1203
|
+
_class_private_method_get(this, _flushBeforeStructuralChange, flushBeforeStructuralChange).call(this, source);
|
|
1204
|
+
}), _class_private_field_set(this, _onAfterCreateRow, (index, amount, source)=>{
|
|
1205
|
+
if (source === 'auto') {
|
|
1206
|
+
return;
|
|
1207
|
+
}
|
|
1208
|
+
_class_private_method_get(this, _shiftBorders, shiftBorders).call(this, 'row', (currentIndex)=>getShiftedIndexAfterInsert(currentIndex, index, amount));
|
|
1209
|
+
}), _class_private_field_set(this, _onAfterRemoveRow, (index, amount)=>{
|
|
1210
|
+
_class_private_method_get(this, _shiftBorders, shiftBorders).call(this, 'row', (currentIndex)=>getShiftedIndexAfterRemove(currentIndex, index, amount));
|
|
1211
|
+
}), _class_private_field_set(this, _onAfterCreateCol, (index, amount, source)=>{
|
|
1212
|
+
// Auto-inserted columns (e.g. `minSpareCols`) append at the end and, like auto rows, do NOT
|
|
1213
|
+
// shift cell meta in the core (`DataMap#createCol` skips `metaManager.createColumn` for
|
|
1214
|
+
// `source === 'auto'`). Shifting the border model here would then diverge from the meta, so skip
|
|
1215
|
+
// it - mirrors `#onAfterCreateRow`.
|
|
1216
|
+
if (source === 'auto') {
|
|
1217
|
+
return;
|
|
1218
|
+
}
|
|
1219
|
+
_class_private_method_get(this, _shiftBorders, shiftBorders).call(this, 'col', (currentIndex)=>getShiftedIndexAfterInsert(currentIndex, index, amount));
|
|
1220
|
+
}), _class_private_field_set(this, _onAfterRemoveCol, (index, amount)=>{
|
|
1221
|
+
_class_private_method_get(this, _shiftBorders, shiftBorders).call(this, 'col', (currentIndex)=>getShiftedIndexAfterRemove(currentIndex, index, amount));
|
|
1222
|
+
}), _class_private_field_set(this, _onBeforeRowMove, (movedRows, finalIndex, dropIndex, movePossible)=>{
|
|
1223
|
+
// Snapshot needs the complete model; finish any in-flight progressive load first.
|
|
1224
|
+
_class_private_method_get(this, _flushProgressiveApply, flushProgressiveApply).call(this);
|
|
1225
|
+
_class_private_field_set(this, _rowMoveSnapshot, movePossible ? this.savedBorders.map((border)=>this.hot.toPhysicalRow(border.row)) : null);
|
|
1226
|
+
}), _class_private_field_set(this, _onAfterRowMove, (movedRows, finalIndex, dropIndex, movePossible, orderChanged)=>{
|
|
1227
|
+
const snapshot = _class_private_field_get(this, _rowMoveSnapshot);
|
|
1228
|
+
_class_private_field_set(this, _rowMoveSnapshot, null);
|
|
1229
|
+
if (!snapshot || !orderChanged) {
|
|
1230
|
+
return;
|
|
1231
|
+
}
|
|
1232
|
+
_class_private_method_get(this, _applyMoveSnapshot, applyMoveSnapshot).call(this, 'row', snapshot, (physicalIndex)=>this.hot.toVisualRow(physicalIndex));
|
|
1233
|
+
}), _class_private_field_set(this, _onBeforeColumnMove, (movedColumns, finalIndex, dropIndex, movePossible)=>{
|
|
1234
|
+
// Snapshot needs the complete model; finish any in-flight progressive load first.
|
|
1235
|
+
_class_private_method_get(this, _flushProgressiveApply, flushProgressiveApply).call(this);
|
|
1236
|
+
_class_private_field_set(this, _columnMoveSnapshot, movePossible ? this.savedBorders.map((border)=>this.hot.toPhysicalColumn(border.col)) : null);
|
|
1237
|
+
}), _class_private_field_set(this, _onAfterColumnMove, (movedColumns, finalIndex, dropIndex, movePossible, orderChanged)=>{
|
|
1238
|
+
const snapshot = _class_private_field_get(this, _columnMoveSnapshot);
|
|
1239
|
+
_class_private_field_set(this, _columnMoveSnapshot, null);
|
|
1240
|
+
if (!snapshot || !orderChanged) {
|
|
1241
|
+
return;
|
|
1242
|
+
}
|
|
1243
|
+
_class_private_method_get(this, _applyMoveSnapshot, applyMoveSnapshot).call(this, 'col', snapshot, (physicalIndex)=>this.hot.toVisualColumn(physicalIndex));
|
|
1244
|
+
});
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
function readExistingBordersForMerge(row, column) {
|
|
1248
|
+
const seen = _class_private_field_get(this, _configPassTouched);
|
|
1249
|
+
if (seen === null || !_class_private_field_get(this, _inConfigPass)) {
|
|
1250
|
+
return this.hot.getCellMeta(row, column).borders;
|
|
1251
|
+
}
|
|
1252
|
+
const key = `${row},${column}`;
|
|
1253
|
+
const shouldRead = seen.has(key);
|
|
1254
|
+
seen.add(key);
|
|
1255
|
+
return shouldRead ? this.hot.getCellMeta(row, column).borders : undefined;
|
|
1256
|
+
}
|
|
1257
|
+
function writeBordersMeta(row, column, value) {
|
|
1258
|
+
// Sampled before the write: a `runOnce` veto listener removes itself the moment it fires, so
|
|
1259
|
+
// probing afterwards would read `false` for a write that was in fact vetoed.
|
|
1260
|
+
const isVetoable = this.hot.hasHook(value === null ? 'beforeRemoveCellMeta' : 'beforeSetCellMeta');
|
|
1261
|
+
_class_private_field_set(this, _isInternalMetaWrite, true);
|
|
1262
|
+
try {
|
|
1263
|
+
if (value === null) {
|
|
1264
|
+
this.hot.removeCellMeta(row, column, 'borders');
|
|
1265
|
+
} else {
|
|
1266
|
+
this.hot.setCellMeta(row, column, 'borders', value);
|
|
1267
|
+
}
|
|
1268
|
+
} finally{
|
|
1269
|
+
_class_private_field_set(this, _isInternalMetaWrite, false);
|
|
1270
|
+
}
|
|
1271
|
+
if (!isVetoable) {
|
|
1272
|
+
return true;
|
|
1273
|
+
}
|
|
1274
|
+
// Same effective resolution as `getCellMeta`; the cell already holds stored meta after the
|
|
1275
|
+
// write above, so the transient read returns that stored object with its own properties
|
|
1276
|
+
// observable.
|
|
1277
|
+
const written = this.hot.getCellMetaTransient(row, column);
|
|
1278
|
+
return value === null ? !hasOwnProperty(written, 'borders') : written.borders === value;
|
|
1279
|
+
}
|
|
1280
|
+
function buildRangeCellBorder(rowIndex, colIndex, customBorder, range) {
|
|
1281
|
+
const existing = _class_private_method_get(this, _readExistingBordersForMerge, readExistingBordersForMerge).call(this, rowIndex, colIndex);
|
|
1282
|
+
const border = isBorderObject(existing) ? normalizeBorder(deepClone(existing)) : createEmptyBorders(rowIndex, colIndex);
|
|
1283
|
+
let add = 0;
|
|
1284
|
+
const applyEdge = (isEdge, sideKey)=>{
|
|
1285
|
+
// `range.to.row`/`range.to.col` may lie beyond the table; those cells are never iterated.
|
|
1286
|
+
if (isEdge && hasOwnProperty(customBorder, sideKey)) {
|
|
1287
|
+
border[sideKey] = resolveRangeBorderSide(customBorder[sideKey], customBorder.border);
|
|
1288
|
+
add += 1;
|
|
1289
|
+
}
|
|
1290
|
+
};
|
|
1291
|
+
applyEdge(rowIndex === range.from.row, 'top');
|
|
1292
|
+
applyEdge(rowIndex === range.to.row, 'bottom');
|
|
1293
|
+
applyEdge(colIndex === range.from.col, 'start');
|
|
1294
|
+
applyEdge(colIndex === range.to.col, 'end');
|
|
1295
|
+
if (isRecord(customBorder.border)) {
|
|
1296
|
+
border.border = customBorder.border;
|
|
1297
|
+
}
|
|
1298
|
+
return {
|
|
1299
|
+
border,
|
|
1300
|
+
add
|
|
1301
|
+
};
|
|
1302
|
+
}
|
|
1303
|
+
function destroyAllSelections() {
|
|
1304
|
+
const { customSelections } = this.hot.selection.highlight;
|
|
1305
|
+
const owned = new Set(_class_private_field_get(this, _customSelectionsCache).values());
|
|
1306
|
+
for(let index = customSelections.length - 1; index >= 0; index--){
|
|
1307
|
+
if (owned.has(customSelections[index])) {
|
|
1308
|
+
customSelections[index].destroy();
|
|
1309
|
+
customSelections.splice(index, 1);
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
_class_private_field_get(this, _customSelectionsCache).clear();
|
|
1313
|
+
}
|
|
1314
|
+
function resetBorderModel() {
|
|
1315
|
+
_class_private_method_get(this, _cancelProgressiveApply, cancelProgressiveApply).call(this);
|
|
1316
|
+
// A `beforeRemoveCellMeta` listener can veto the removal. Those cells keep their `borders` meta,
|
|
1317
|
+
// so they keep their model entry too - clearing the model around them would leave `getBorders()`
|
|
1318
|
+
// and `getCellMeta().borders` disagreeing.
|
|
1319
|
+
const kept = [];
|
|
1320
|
+
arrayEach(this.savedBorders, (border)=>{
|
|
1321
|
+
if (!_class_private_method_get(this, _writeBordersMeta, writeBordersMeta).call(this, border.row, border.col, null)) {
|
|
1322
|
+
kept.push(border);
|
|
1323
|
+
}
|
|
1324
|
+
});
|
|
1325
|
+
this.savedBorders = kept;
|
|
1326
|
+
_class_private_method_get(this, _rebuildSavedBordersIndex, rebuildSavedBordersIndex).call(this);
|
|
1327
|
+
_class_private_field_get(this, _bordersByRow).clear();
|
|
1328
|
+
_class_private_field_set(this, _bordersByRowDirty, true);
|
|
1329
|
+
_class_private_method_get(this, _destroyAllSelections, destroyAllSelections).call(this);
|
|
1330
|
+
}
|
|
1331
|
+
function rebuildBordersByRow() {
|
|
1332
|
+
_class_private_field_get(this, _bordersByRow).clear();
|
|
1333
|
+
arrayEach(this.savedBorders, (border)=>{
|
|
1334
|
+
const rowBorders = _class_private_field_get(this, _bordersByRow).get(border.row);
|
|
1335
|
+
if (rowBorders) {
|
|
1336
|
+
rowBorders.push(border);
|
|
1337
|
+
} else {
|
|
1338
|
+
_class_private_field_get(this, _bordersByRow).set(border.row, [
|
|
1339
|
+
border
|
|
1340
|
+
]);
|
|
1341
|
+
}
|
|
1342
|
+
});
|
|
1343
|
+
_class_private_field_set(this, _bordersByRowDirty, false);
|
|
1344
|
+
}
|
|
1345
|
+
function indexBorderByRow(border) {
|
|
1346
|
+
if (_class_private_field_get(this, _bordersByRowDirty)) {
|
|
1347
|
+
return;
|
|
1348
|
+
}
|
|
1349
|
+
// A border removed by `checkSavedBorders` (all four sides hidden) is no longer in the model, so
|
|
1350
|
+
// it must leave the index rather than enter it.
|
|
1351
|
+
if (!_class_private_field_get(this, _savedBordersIndex).has(border.id)) {
|
|
1352
|
+
_class_private_method_get(this, _unindexBorderByRow, unindexBorderByRow).call(this, border.row, border.id);
|
|
1353
|
+
return;
|
|
1354
|
+
}
|
|
1355
|
+
const rowBorders = _class_private_field_get(this, _bordersByRow).get(border.row);
|
|
1356
|
+
if (!rowBorders) {
|
|
1357
|
+
_class_private_field_get(this, _bordersByRow).set(border.row, [
|
|
1358
|
+
border
|
|
1359
|
+
]);
|
|
1360
|
+
return;
|
|
1361
|
+
}
|
|
1362
|
+
const at = rowBorders.findIndex((indexed)=>indexed.id === border.id);
|
|
1363
|
+
if (at === -1) {
|
|
1364
|
+
rowBorders.push(border);
|
|
1365
|
+
} else {
|
|
1366
|
+
rowBorders[at] = border;
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
function unindexBorderByRow(row, borderId) {
|
|
1370
|
+
if (_class_private_field_get(this, _bordersByRowDirty)) {
|
|
1371
|
+
return;
|
|
1372
|
+
}
|
|
1373
|
+
const rowBorders = _class_private_field_get(this, _bordersByRow).get(row);
|
|
1374
|
+
if (!rowBorders) {
|
|
1375
|
+
return;
|
|
1376
|
+
}
|
|
1377
|
+
const at = rowBorders.findIndex((indexed)=>indexed.id === borderId);
|
|
1378
|
+
if (at === -1) {
|
|
1379
|
+
return;
|
|
1380
|
+
}
|
|
1381
|
+
rowBorders.splice(at, 1);
|
|
1382
|
+
if (rowBorders.length === 0) {
|
|
1383
|
+
_class_private_field_get(this, _bordersByRow).delete(row);
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
function syncViewportSelections() {
|
|
1387
|
+
if (_class_private_field_get(this, _bordersByRowDirty)) {
|
|
1388
|
+
_class_private_method_get(this, _rebuildBordersByRow, rebuildBordersByRow).call(this);
|
|
1389
|
+
}
|
|
1390
|
+
const view = this.hot.view;
|
|
1391
|
+
const firstRow = view.getFirstRenderedVisibleRow();
|
|
1392
|
+
const lastRow = view.getLastRenderedVisibleRow();
|
|
1393
|
+
const firstColumn = view.getFirstRenderedVisibleColumn();
|
|
1394
|
+
const lastColumn = view.getLastRenderedVisibleColumn();
|
|
1395
|
+
// Nothing rendered (e.g. detached table or headers only) - drop the whole working set.
|
|
1396
|
+
if (firstRow === null || lastRow === null || firstColumn === null || lastColumn === null) {
|
|
1397
|
+
if (_class_private_field_get(this, _customSelectionsCache).size > 0) {
|
|
1398
|
+
_class_private_method_get(this, _destroyAllSelections, destroyAllSelections).call(this);
|
|
1399
|
+
}
|
|
1400
|
+
return;
|
|
1401
|
+
}
|
|
1402
|
+
// Frozen rows/columns are rendered by the overlay clones even when the master rendered range
|
|
1403
|
+
// excludes them, so the working window is the union of the frozen areas and the master range.
|
|
1404
|
+
const settings = this.hot.getSettings();
|
|
1405
|
+
const fixedRowsTop = Number(settings.fixedRowsTop) || 0;
|
|
1406
|
+
const fixedRowsBottom = Number(settings.fixedRowsBottom) || 0;
|
|
1407
|
+
const fixedColumnsStart = Number(settings.fixedColumnsStart) || 0;
|
|
1408
|
+
const totalRows = this.hot.countRows();
|
|
1409
|
+
const totalColumns = this.hot.countCols();
|
|
1410
|
+
const rowRanges = getViewportUnionRanges(firstRow, lastRow, fixedRowsTop, fixedRowsBottom, totalRows);
|
|
1411
|
+
const shouldBeVisible = new Set();
|
|
1412
|
+
arrayEach(rowRanges, ([fromRow, toRow])=>{
|
|
1413
|
+
for(let row = fromRow; row <= toRow; row++){
|
|
1414
|
+
const rowBorders = _class_private_field_get(this, _bordersByRow).get(row);
|
|
1415
|
+
if (!rowBorders) {
|
|
1416
|
+
continue; // eslint-disable-line no-continue
|
|
1417
|
+
}
|
|
1418
|
+
arrayEach(rowBorders, (border)=>{
|
|
1419
|
+
if (isIndexInViewportUnion(border.col, firstColumn, lastColumn, fixedColumnsStart, 0, totalColumns)) {
|
|
1420
|
+
shouldBeVisible.add(border.id);
|
|
1421
|
+
if (!_class_private_field_get(this, _customSelectionsCache).has(border.id)) {
|
|
1422
|
+
_class_private_method_get(this, _addSelectionForBorder, addSelectionForBorder).call(this, border);
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
});
|
|
1426
|
+
}
|
|
1427
|
+
});
|
|
1428
|
+
// Remove selections that scrolled out of the rendered range.
|
|
1429
|
+
arrayEach(Array.from(_class_private_field_get(this, _customSelectionsCache).keys()), (borderId)=>{
|
|
1430
|
+
if (!shouldBeVisible.has(borderId)) {
|
|
1431
|
+
_class_private_method_get(this, _destroyBorderSelection, destroyBorderSelection).call(this, borderId);
|
|
1432
|
+
}
|
|
1433
|
+
});
|
|
1434
|
+
}
|
|
1435
|
+
function addSelectionForBorder(border) {
|
|
1436
|
+
const borderCoords = this.hot._createCellCoords(border.row, border.col);
|
|
1437
|
+
const visualCellRange = this.hot._createCellRange(borderCoords, borderCoords, borderCoords);
|
|
1438
|
+
const { customSelections } = this.hot.selection.highlight;
|
|
1439
|
+
this.hot.selection.highlight.addCustomSelection({
|
|
1440
|
+
border,
|
|
1441
|
+
visualCellRange
|
|
1442
|
+
});
|
|
1443
|
+
_class_private_field_get(this, _customSelectionsCache).set(border.id, customSelections[customSelections.length - 1]);
|
|
1444
|
+
}
|
|
1445
|
+
function rebuildSavedBordersIndex() {
|
|
1446
|
+
_class_private_field_get(this, _savedBordersIndex).clear();
|
|
1447
|
+
arrayEach(this.savedBorders, (border, index)=>{
|
|
1448
|
+
_class_private_field_get(this, _savedBordersIndex).set(border.id, index);
|
|
1449
|
+
});
|
|
1450
|
+
}
|
|
1451
|
+
function resolveProgressiveSetting() {
|
|
1452
|
+
const setting = this.hot.getSettings().customBordersProgressive;
|
|
1453
|
+
if (setting === true) {
|
|
1454
|
+
return {
|
|
1455
|
+
enabled: true,
|
|
1456
|
+
chunkSize: DEFAULT_PROGRESSIVE_CHUNK_SIZE
|
|
1457
|
+
};
|
|
1458
|
+
}
|
|
1459
|
+
if (isRecord(setting)) {
|
|
1460
|
+
const size = typeof setting.chunkSize === 'number' && setting.chunkSize > 0 ? Math.floor(setting.chunkSize) : DEFAULT_PROGRESSIVE_CHUNK_SIZE;
|
|
1461
|
+
return {
|
|
1462
|
+
enabled: true,
|
|
1463
|
+
chunkSize: size
|
|
1464
|
+
};
|
|
1465
|
+
}
|
|
1466
|
+
return {
|
|
1467
|
+
enabled: false,
|
|
1468
|
+
chunkSize: DEFAULT_PROGRESSIVE_CHUNK_SIZE
|
|
1469
|
+
};
|
|
1470
|
+
}
|
|
1471
|
+
function startProgressiveApply(borders, chunkSize) {
|
|
1472
|
+
_class_private_field_set(this, _progressiveToken, _class_private_field_get(this, _progressiveToken) + 1);
|
|
1473
|
+
_class_private_field_set(this, _progressiveQueue, borders);
|
|
1474
|
+
_class_private_field_set(this, _progressiveIndex, 0);
|
|
1475
|
+
_class_private_field_set(this, _progressiveChunkSize, chunkSize);
|
|
1476
|
+
// One first-touch tracking Set shared across every batch (overlap-merge correctness).
|
|
1477
|
+
_class_private_field_set(this, _configPassTouched, new Set());
|
|
1478
|
+
_class_private_method_get(this, _scheduleProgressiveChunk, scheduleProgressiveChunk).call(this, _class_private_field_get(this, _progressiveToken));
|
|
1479
|
+
}
|
|
1480
|
+
function scheduleProgressiveChunk(token) {
|
|
1481
|
+
this.hot._registerTimeout(()=>_class_private_method_get(this, _processProgressiveChunk, processProgressiveChunk).call(this, token), 0);
|
|
1482
|
+
}
|
|
1483
|
+
function processProgressiveChunk(token) {
|
|
1484
|
+
if (token !== _class_private_field_get(this, _progressiveToken) || _class_private_field_get(this, _progressiveQueue) === null) {
|
|
1485
|
+
return;
|
|
1486
|
+
}
|
|
1487
|
+
const queue = _class_private_field_get(this, _progressiveQueue);
|
|
1488
|
+
const end = Math.min(_class_private_field_get(this, _progressiveIndex) + _class_private_field_get(this, _progressiveChunkSize), queue.length);
|
|
1489
|
+
this.createCustomBorders(queue.slice(_class_private_field_get(this, _progressiveIndex), end));
|
|
1490
|
+
_class_private_field_set(this, _progressiveIndex, end);
|
|
1491
|
+
this.hot.render();
|
|
1492
|
+
if (_class_private_field_get(this, _progressiveIndex) >= queue.length) {
|
|
1493
|
+
_class_private_method_get(this, _finishProgressiveApply, finishProgressiveApply).call(this);
|
|
1494
|
+
} else {
|
|
1495
|
+
_class_private_method_get(this, _scheduleProgressiveChunk, scheduleProgressiveChunk).call(this, token);
|
|
724
1496
|
}
|
|
725
1497
|
}
|
|
1498
|
+
function flushProgressiveApply() {
|
|
1499
|
+
if (_class_private_field_get(this, _progressiveQueue) === null) {
|
|
1500
|
+
return;
|
|
1501
|
+
}
|
|
1502
|
+
const queue = _class_private_field_get(this, _progressiveQueue);
|
|
1503
|
+
while(_class_private_field_get(this, _progressiveIndex) < queue.length){
|
|
1504
|
+
const end = Math.min(_class_private_field_get(this, _progressiveIndex) + _class_private_field_get(this, _progressiveChunkSize), queue.length);
|
|
1505
|
+
this.createCustomBorders(queue.slice(_class_private_field_get(this, _progressiveIndex), end));
|
|
1506
|
+
_class_private_field_set(this, _progressiveIndex, end);
|
|
1507
|
+
}
|
|
1508
|
+
_class_private_method_get(this, _finishProgressiveApply, finishProgressiveApply).call(this);
|
|
1509
|
+
}
|
|
1510
|
+
function finishProgressiveApply() {
|
|
1511
|
+
_class_private_field_set(this, _progressiveToken, _class_private_field_get(this, _progressiveToken) + 1);
|
|
1512
|
+
_class_private_field_set(this, _progressiveQueue, null);
|
|
1513
|
+
_class_private_field_set(this, _progressiveIndex, 0);
|
|
1514
|
+
_class_private_field_set(this, _configPassTouched, null);
|
|
1515
|
+
this.hot.runHooks('afterCustomBordersUpdate');
|
|
1516
|
+
}
|
|
1517
|
+
function cancelProgressiveApply() {
|
|
1518
|
+
if (_class_private_field_get(this, _progressiveQueue) === null) {
|
|
1519
|
+
return;
|
|
1520
|
+
}
|
|
1521
|
+
_class_private_field_set(this, _progressiveToken, _class_private_field_get(this, _progressiveToken) + 1);
|
|
1522
|
+
_class_private_field_set(this, _progressiveQueue, null);
|
|
1523
|
+
_class_private_field_set(this, _progressiveIndex, 0);
|
|
1524
|
+
_class_private_field_set(this, _configPassTouched, null);
|
|
1525
|
+
}
|
|
726
1526
|
function validateStyleSettings(customBorders) {
|
|
727
1527
|
customBorders.forEach((customBorder)=>{
|
|
728
1528
|
Object.keys(customBorder).forEach((key)=>{
|
|
@@ -743,6 +1543,66 @@ The border style will be ignored.`);
|
|
|
743
1543
|
});
|
|
744
1544
|
});
|
|
745
1545
|
}
|
|
1546
|
+
function shiftBorders(axis, mapIndex) {
|
|
1547
|
+
// The in-flight progressive load was already flushed from the matching `before*` hook, while the
|
|
1548
|
+
// queue's coordinates still matched the grid. Flushing here instead would be too late: the core
|
|
1549
|
+
// shifts the cell meta before it fires the `after*` hooks, so the flushed entries would write
|
|
1550
|
+
// their `borders` meta onto post-shift cells the configuration never targeted.
|
|
1551
|
+
const survivors = [];
|
|
1552
|
+
arrayEach(this.savedBorders, (border)=>{
|
|
1553
|
+
const nextIndex = mapIndex(border[axis]);
|
|
1554
|
+
if (nextIndex === -1) {
|
|
1555
|
+
return;
|
|
1556
|
+
}
|
|
1557
|
+
border[axis] = nextIndex;
|
|
1558
|
+
border.id = createId(border.row, border.col);
|
|
1559
|
+
survivors.push(border);
|
|
1560
|
+
});
|
|
1561
|
+
this.savedBorders.length = 0;
|
|
1562
|
+
arrayEach(survivors, (border)=>this.savedBorders.push(border));
|
|
1563
|
+
// No render here: the `afterCreate*`/`afterRemove*` hooks fire from inside `alter()`, before it
|
|
1564
|
+
// finishes rewriting the column/row headers, and `alter()` renders once it is done. Forcing a
|
|
1565
|
+
// render mid-`alter()` paints a header row the closing render then treats as up to date, so the
|
|
1566
|
+
// labels stay bound to their pre-insert columns while the new column is appended at the end -
|
|
1567
|
+
// clicking a header then selects a different column than the one the label sits on (#11031).
|
|
1568
|
+
_class_private_method_get(this, _rebuildWorkingSetFromModel, rebuildWorkingSetFromModel).call(this, false);
|
|
1569
|
+
}
|
|
1570
|
+
function applyMoveSnapshot(axis, snapshot, toVisualIndex) {
|
|
1571
|
+
arrayEach(this.savedBorders, (border, index)=>{
|
|
1572
|
+
const physicalIndex = snapshot[index];
|
|
1573
|
+
if (typeof physicalIndex !== 'number') {
|
|
1574
|
+
return;
|
|
1575
|
+
}
|
|
1576
|
+
const visualIndex = toVisualIndex(physicalIndex);
|
|
1577
|
+
if (typeof visualIndex !== 'number') {
|
|
1578
|
+
return;
|
|
1579
|
+
}
|
|
1580
|
+
border[axis] = visualIndex;
|
|
1581
|
+
border.id = createId(border.row, border.col);
|
|
1582
|
+
});
|
|
1583
|
+
_class_private_method_get(this, _rebuildWorkingSetFromModel, rebuildWorkingSetFromModel).call(this);
|
|
1584
|
+
}
|
|
1585
|
+
function rebuildWorkingSetFromModel(render = true) {
|
|
1586
|
+
_class_private_method_get(this, _rebuildSavedBordersIndex, rebuildSavedBordersIndex).call(this);
|
|
1587
|
+
_class_private_field_set(this, _bordersByRowDirty, true);
|
|
1588
|
+
_class_private_method_get(this, _destroyAllSelections, destroyAllSelections).call(this);
|
|
1589
|
+
if (render) {
|
|
1590
|
+
this.hot.render();
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
function destroyBorderSelection(borderId) {
|
|
1594
|
+
const customSelection = _class_private_field_get(this, _customSelectionsCache).get(borderId);
|
|
1595
|
+
if (!customSelection) {
|
|
1596
|
+
return;
|
|
1597
|
+
}
|
|
1598
|
+
const { customSelections } = this.hot.selection.highlight;
|
|
1599
|
+
const index = customSelections.indexOf(customSelection);
|
|
1600
|
+
if (index > -1) {
|
|
1601
|
+
customSelections.splice(index, 1);
|
|
1602
|
+
}
|
|
1603
|
+
customSelection.destroy();
|
|
1604
|
+
_class_private_field_get(this, _customSelectionsCache).delete(borderId);
|
|
1605
|
+
}
|
|
746
1606
|
function onAfterContextMenuDefaultOptions(rawOptions) {
|
|
747
1607
|
if (!this.hot.getSettings()[PLUGIN_KEY]) {
|
|
748
1608
|
return;
|
|
@@ -784,5 +1644,24 @@ function onAfterContextMenuDefaultOptions(rawOptions) {
|
|
|
784
1644
|
});
|
|
785
1645
|
}
|
|
786
1646
|
function onAfterInit() {
|
|
787
|
-
this.changeBorderSettings();
|
|
1647
|
+
this.changeBorderSettings(false);
|
|
1648
|
+
if (this.savedBorders.length > 0) {
|
|
1649
|
+
this.hot.addHookOnce('afterInit', ()=>this.hot.render());
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
function scheduleMetaSyncRender() {
|
|
1653
|
+
if (_class_private_field_get(this, _isMetaSyncRenderScheduled)) {
|
|
1654
|
+
return;
|
|
1655
|
+
}
|
|
1656
|
+
_class_private_field_set(this, _isMetaSyncRenderScheduled, true);
|
|
1657
|
+
this.hot._registerMicrotask(()=>{
|
|
1658
|
+
_class_private_field_set(this, _isMetaSyncRenderScheduled, false);
|
|
1659
|
+
this.hot.render();
|
|
1660
|
+
});
|
|
1661
|
+
}
|
|
1662
|
+
function flushBeforeStructuralChange(source) {
|
|
1663
|
+
if (source === 'auto') {
|
|
1664
|
+
return;
|
|
1665
|
+
}
|
|
1666
|
+
_class_private_method_get(this, _flushProgressiveApply, flushProgressiveApply).call(this);
|
|
788
1667
|
}
|