handsontable 0.0.0-next-b66c79f-20230713 → 0.0.0-next-08765b9-20230714
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/cell/coords.d.ts +6 -1
- package/3rdparty/walkontable/src/cell/coords.js +87 -33
- package/3rdparty/walkontable/src/cell/coords.mjs +87 -33
- package/3rdparty/walkontable/src/cell/range.d.ts +9 -2
- package/3rdparty/walkontable/src/cell/range.js +92 -46
- package/3rdparty/walkontable/src/cell/range.mjs +92 -46
- package/3rdparty/walkontable/src/core/_base.js +41 -33
- package/3rdparty/walkontable/src/core/_base.mjs +41 -33
- package/3rdparty/walkontable/src/core/clone.js +8 -5
- package/3rdparty/walkontable/src/core/clone.mjs +8 -5
- package/3rdparty/walkontable/src/core/core.js +3 -2
- package/3rdparty/walkontable/src/core/core.mjs +3 -2
- package/3rdparty/walkontable/src/event.js +9 -8
- package/3rdparty/walkontable/src/event.mjs +9 -8
- package/3rdparty/walkontable/src/facade/core.js +2 -2
- package/3rdparty/walkontable/src/facade/core.mjs +2 -2
- package/3rdparty/walkontable/src/index.js +10 -2
- package/3rdparty/walkontable/src/index.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/_base.js +11 -9
- package/3rdparty/walkontable/src/overlay/_base.mjs +11 -9
- package/3rdparty/walkontable/src/overlay/bottom.js +10 -8
- package/3rdparty/walkontable/src/overlay/bottom.mjs +10 -8
- package/3rdparty/walkontable/src/overlay/inlineStart.js +2 -6
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -6
- package/3rdparty/walkontable/src/overlay/top.js +12 -14
- package/3rdparty/walkontable/src/overlay/top.mjs +12 -14
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +16 -13
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +16 -13
- package/3rdparty/walkontable/src/overlays.js +75 -80
- package/3rdparty/walkontable/src/overlays.mjs +75 -80
- package/3rdparty/walkontable/src/scroll.js +27 -24
- package/3rdparty/walkontable/src/scroll.mjs +27 -24
- package/3rdparty/walkontable/src/{border.js → selection/border/border.js} +7 -12
- package/3rdparty/walkontable/src/{border.mjs → selection/border/border.mjs} +7 -12
- package/3rdparty/walkontable/src/selection/border/constants.js +16 -0
- package/3rdparty/walkontable/src/selection/border/constants.mjs +12 -0
- package/3rdparty/walkontable/src/selection/constants.js +62 -0
- package/3rdparty/walkontable/src/selection/constants.mjs +51 -0
- package/3rdparty/walkontable/src/selection/index.js +26 -0
- package/3rdparty/walkontable/src/selection/index.mjs +5 -0
- package/3rdparty/walkontable/src/selection/manager.js +259 -0
- package/3rdparty/walkontable/src/selection/manager.mjs +254 -0
- package/3rdparty/walkontable/src/selection/scanner.js +270 -0
- package/3rdparty/walkontable/src/selection/scanner.mjs +267 -0
- package/3rdparty/walkontable/src/selection/selection.js +101 -0
- package/3rdparty/walkontable/src/selection/selection.mjs +96 -0
- package/3rdparty/walkontable/src/settings.js +18 -17
- package/3rdparty/walkontable/src/settings.mjs +18 -17
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +9 -0
- package/3rdparty/walkontable/src/table.js +48 -115
- package/3rdparty/walkontable/src/table.mjs +49 -116
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/focusCatcher/focusDetector.js +58 -0
- package/core/focusCatcher/focusDetector.mjs +54 -0
- package/core/focusCatcher/index.js +142 -0
- package/core/focusCatcher/index.mjs +138 -0
- package/core/index.js +9 -0
- package/core/index.mjs +1 -0
- package/core.d.ts +6 -3
- package/core.js +181 -298
- package/core.mjs +181 -298
- package/dataMap/metaManager/metaLayers/cellMeta.js +2 -1
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +2 -1
- package/dataMap/metaManager/metaLayers/globalMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/globalMeta.mjs +1 -1
- package/dataMap/metaManager/metaSchema.js +41 -0
- package/dataMap/metaManager/metaSchema.mjs +41 -0
- package/dataMap/metaManager/mods/dynamicCellMeta.js +3 -2
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +3 -2
- package/dataMap/metaManager/utils.js +4 -2
- package/dataMap/metaManager/utils.mjs +4 -2
- package/dist/handsontable.css +19 -3
- package/dist/handsontable.full.css +19 -3
- package/dist/handsontable.full.js +10739 -7037
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +25 -25
- package/dist/handsontable.js +24884 -21182
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +19 -19
- package/editorManager.js +11 -75
- package/editorManager.mjs +11 -74
- package/editors/autocompleteEditor/autocompleteEditor.js +70 -67
- package/editors/autocompleteEditor/autocompleteEditor.mjs +70 -67
- package/editors/baseEditor/baseEditor.js +1 -1
- package/editors/baseEditor/baseEditor.mjs +1 -1
- package/editors/dateEditor/dateEditor.js +2 -1
- package/editors/dateEditor/dateEditor.mjs +2 -1
- package/editors/textEditor/textEditor.js +3 -11
- package/editors/textEditor/textEditor.mjs +4 -12
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/number.d.ts +1 -0
- package/helpers/number.js +18 -0
- package/helpers/number.mjs +17 -0
- package/helpers/object.js +1 -0
- package/helpers/object.mjs +1 -0
- package/index.js +5 -5
- package/index.mjs +5 -5
- package/package.json +1 -1
- package/pluginHooks.d.ts +7 -1
- package/pluginHooks.js +106 -1
- package/pluginHooks.mjs +106 -1
- package/plugins/autoColumnSize/autoColumnSize.js +4 -1
- package/plugins/autoColumnSize/autoColumnSize.mjs +4 -1
- package/plugins/collapsibleColumns/collapsibleColumns.js +110 -40
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +110 -40
- package/plugins/columnSorting/columnSorting.js +40 -1
- package/plugins/columnSorting/columnSorting.mjs +40 -3
- package/plugins/columnSorting/columnStatesManager.js +2 -1
- package/plugins/columnSorting/columnStatesManager.mjs +2 -1
- package/plugins/columnSorting/index.js +3 -1
- package/plugins/columnSorting/index.mjs +1 -1
- package/plugins/comments/commentEditor.js +1 -0
- package/plugins/comments/commentEditor.mjs +1 -0
- package/plugins/comments/comments.js +253 -191
- package/plugins/comments/comments.mjs +252 -192
- package/plugins/comments/contextMenuItem/addEditComment.js +41 -0
- package/plugins/comments/contextMenuItem/addEditComment.mjs +35 -0
- package/plugins/comments/contextMenuItem/readOnlyComment.js +49 -0
- package/plugins/comments/contextMenuItem/readOnlyComment.mjs +43 -0
- package/plugins/comments/contextMenuItem/removeComment.js +38 -0
- package/plugins/comments/contextMenuItem/removeComment.mjs +32 -0
- package/plugins/contextMenu/contextMenu.d.ts +1 -1
- package/plugins/contextMenu/contextMenu.js +72 -30
- package/plugins/contextMenu/contextMenu.mjs +73 -31
- package/plugins/contextMenu/predefinedItems/alignment.js +7 -0
- package/plugins/contextMenu/predefinedItems/alignment.mjs +7 -0
- package/plugins/contextMenu/predefinedItems/clearColumn.js +5 -3
- package/plugins/contextMenu/predefinedItems/clearColumn.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.js +5 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/columnRight.js +5 -3
- package/plugins/contextMenu/predefinedItems/columnRight.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/readOnly.js +7 -0
- package/plugins/contextMenu/predefinedItems/readOnly.mjs +7 -0
- package/plugins/contextMenu/predefinedItems/removeColumn.js +7 -5
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/removeRow.js +7 -5
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.js +5 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.js +5 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.mjs +5 -3
- package/plugins/contextMenu/utils.js +28 -16
- package/plugins/contextMenu/utils.mjs +27 -15
- package/plugins/copyPaste/contextMenuItem/copy.js +7 -0
- package/plugins/copyPaste/contextMenuItem/copy.mjs +7 -0
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/cut.js +7 -0
- package/plugins/copyPaste/contextMenuItem/cut.mjs +7 -0
- package/plugins/copyPaste/copyPaste.js +12 -6
- package/plugins/copyPaste/copyPaste.mjs +12 -6
- package/plugins/customBorders/customBorders.js +36 -29
- package/plugins/customBorders/customBorders.mjs +37 -30
- package/plugins/customBorders/utils.js +3 -3
- package/plugins/customBorders/utils.mjs +3 -3
- package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
- package/plugins/dropdownMenu/dropdownMenu.js +89 -32
- package/plugins/dropdownMenu/dropdownMenu.mjs +89 -32
- package/plugins/filters/conditionCollection.js +6 -5
- package/plugins/filters/conditionCollection.mjs +6 -5
- package/plugins/filters/filters.js +44 -21
- package/plugins/filters/filters.mjs +43 -20
- package/plugins/formulas/engine/register.js +3 -3
- package/plugins/formulas/engine/register.mjs +3 -3
- package/plugins/formulas/engine/settings.js +6 -3
- package/plugins/formulas/engine/settings.mjs +6 -3
- package/plugins/formulas/formulas.js +151 -143
- package/plugins/formulas/formulas.mjs +151 -143
- package/plugins/formulas/indexSyncer/axisSyncer.js +115 -79
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +115 -79
- package/plugins/formulas/indexSyncer/index.js +100 -64
- package/plugins/formulas/indexSyncer/index.mjs +100 -64
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +2 -2
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +2 -2
- package/plugins/hiddenColumns/hiddenColumns.js +51 -34
- package/plugins/hiddenColumns/hiddenColumns.mjs +51 -34
- package/plugins/hiddenRows/contextMenuItem/showRow.js +2 -2
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +2 -2
- package/plugins/hiddenRows/hiddenRows.js +50 -33
- package/plugins/hiddenRows/hiddenRows.mjs +50 -33
- package/plugins/manualRowResize/manualRowResize.js +2 -1
- package/plugins/manualRowResize/manualRowResize.mjs +2 -1
- package/plugins/mergeCells/mergeCells.js +6 -17
- package/plugins/mergeCells/mergeCells.mjs +6 -17
- package/plugins/multiColumnSorting/multiColumnSorting.js +37 -2
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +37 -2
- package/plugins/nestedHeaders/nestedHeaders.js +209 -75
- package/plugins/nestedHeaders/nestedHeaders.mjs +208 -74
- package/plugins/nestedHeaders/stateManager/headersTree.js +58 -38
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +58 -38
- package/plugins/nestedHeaders/stateManager/index.js +107 -49
- package/plugins/nestedHeaders/stateManager/index.mjs +105 -47
- package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.js +1 -1
- package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.mjs +1 -1
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +57 -37
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +57 -37
- package/plugins/nestedHeaders/utils/ghostTable.js +39 -35
- package/plugins/nestedHeaders/utils/ghostTable.mjs +39 -35
- package/plugins/nestedRows/data/dataManager.js +4 -2
- package/plugins/nestedRows/data/dataManager.mjs +4 -2
- package/plugins/nestedRows/nestedRows.js +41 -0
- package/plugins/nestedRows/nestedRows.mjs +41 -0
- package/plugins/persistentState/storage.js +1 -0
- package/plugins/persistentState/storage.mjs +1 -0
- package/plugins/undoRedo/undoRedo.js +2 -1
- package/plugins/undoRedo/undoRedo.mjs +2 -1
- package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
- package/selection/highlight/highlight.js +256 -71
- package/selection/highlight/highlight.mjs +250 -71
- package/selection/highlight/types/activeHeader.js +10 -8
- package/selection/highlight/types/activeHeader.mjs +10 -8
- package/selection/highlight/types/area.js +6 -18
- package/selection/highlight/types/area.mjs +6 -18
- package/selection/highlight/types/areaLayered.js +31 -0
- package/selection/highlight/types/areaLayered.mjs +26 -0
- package/selection/highlight/types/column.js +27 -0
- package/selection/highlight/types/column.mjs +22 -0
- package/selection/highlight/types/customSelection.js +7 -9
- package/selection/highlight/types/customSelection.mjs +7 -9
- package/selection/highlight/types/fill.js +5 -7
- package/selection/highlight/types/fill.mjs +5 -7
- package/selection/highlight/types/{cell.js → focus.js} +5 -7
- package/selection/highlight/types/{cell.mjs → focus.mjs} +5 -7
- package/selection/highlight/types/header.js +9 -18
- package/selection/highlight/types/header.mjs +9 -18
- package/selection/highlight/types/row.js +27 -0
- package/selection/highlight/types/row.mjs +22 -0
- package/selection/highlight/visualSelection.js +41 -33
- package/selection/highlight/visualSelection.mjs +41 -33
- package/selection/index.js +4 -7
- package/selection/index.mjs +2 -3
- package/selection/mouseEventHandler.js +1 -1
- package/selection/mouseEventHandler.mjs +1 -1
- package/selection/range.js +8 -8
- package/selection/range.mjs +8 -8
- package/selection/selection.js +290 -154
- package/selection/selection.mjs +287 -153
- package/selection/transformation.js +232 -90
- package/selection/transformation.mjs +232 -90
- package/selection/utils.js +15 -21
- package/selection/utils.mjs +16 -21
- package/settings.d.ts +2 -0
- package/shortcutContexts/commands/editor/closeAndSave.js +12 -0
- package/shortcutContexts/commands/editor/closeAndSave.mjs +8 -0
- package/shortcutContexts/commands/editor/closeWithoutSaving.js +12 -0
- package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +8 -0
- package/shortcutContexts/commands/editor/fastOpen.js +16 -0
- package/shortcutContexts/commands/editor/fastOpen.mjs +12 -0
- package/shortcutContexts/commands/editor/index.js +16 -0
- package/shortcutContexts/commands/editor/index.mjs +12 -0
- package/shortcutContexts/commands/editor/open.js +27 -0
- package/shortcutContexts/commands/editor/open.mjs +23 -0
- package/shortcutContexts/commands/emptySelectedCells.js +11 -0
- package/shortcutContexts/commands/emptySelectedCells.mjs +7 -0
- package/shortcutContexts/commands/extendCellsSelection/down.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +11 -0
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +21 -0
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +17 -0
- package/shortcutContexts/commands/extendCellsSelection/index.js +26 -0
- package/shortcutContexts/commands/extendCellsSelection/index.mjs +22 -0
- package/shortcutContexts/commands/extendCellsSelection/left.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +11 -0
- package/shortcutContexts/commands/extendCellsSelection/right.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +11 -0
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +15 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +29 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +25 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +15 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +15 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +29 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +25 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +29 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +25 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +29 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +25 -0
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +15 -0
- package/shortcutContexts/commands/extendCellsSelection/up.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +11 -0
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +21 -0
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +17 -0
- package/shortcutContexts/commands/index.js +35 -0
- package/shortcutContexts/commands/index.mjs +31 -0
- package/shortcutContexts/commands/moveCellSelection/down.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/down.mjs +9 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +31 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +27 -0
- package/shortcutContexts/commands/moveCellSelection/index.js +28 -0
- package/shortcutContexts/commands/moveCellSelection/index.mjs +24 -0
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +12 -0
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +12 -0
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/left.js +10 -0
- package/shortcutContexts/commands/moveCellSelection/left.mjs +6 -0
- package/shortcutContexts/commands/moveCellSelection/right.js +10 -0
- package/shortcutContexts/commands/moveCellSelection/right.mjs +6 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +13 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +18 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +14 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +14 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +10 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +13 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +19 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +15 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +21 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +13 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +19 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +15 -0
- package/shortcutContexts/commands/moveCellSelection/up.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/up.mjs +9 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +31 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +27 -0
- package/shortcutContexts/commands/populateSelectedCellsData.js +29 -0
- package/shortcutContexts/commands/populateSelectedCellsData.mjs +25 -0
- package/shortcutContexts/commands/scrollToFocusedCell.js +36 -0
- package/shortcutContexts/commands/scrollToFocusedCell.mjs +32 -0
- package/shortcutContexts/commands/selectAll.js +10 -0
- package/shortcutContexts/commands/selectAll.mjs +6 -0
- package/shortcutContexts/constants.js +13 -0
- package/shortcutContexts/constants.mjs +8 -0
- package/shortcutContexts/editor.js +25 -0
- package/shortcutContexts/editor.mjs +21 -0
- package/shortcutContexts/grid.js +163 -0
- package/shortcutContexts/grid.mjs +159 -0
- package/shortcutContexts/index.js +24 -0
- package/shortcutContexts/index.mjs +11 -0
- package/shortcuts/manager.js +2 -0
- package/shortcuts/manager.mjs +2 -0
- package/shortcuts/recorder.js +2 -2
- package/shortcuts/recorder.mjs +2 -2
- package/shortcuts/utils.js +19 -5
- package/shortcuts/utils.mjs +18 -4
- package/tableView.js +163 -91
- package/tableView.mjs +163 -91
- package/translations/changesObservable/observable.js +82 -54
- package/translations/changesObservable/observable.mjs +82 -54
- package/translations/changesObservable/observer.js +24 -11
- package/translations/changesObservable/observer.mjs +24 -11
- package/translations/maps/linkedPhysicalIndexToValueMap.js +14 -8
- package/translations/maps/linkedPhysicalIndexToValueMap.mjs +14 -8
- package/utils/dataStructures/tree.js +21 -18
- package/utils/dataStructures/tree.mjs +21 -18
- package/3rdparty/walkontable/src/selection.js +0 -295
- package/3rdparty/walkontable/src/selection.mjs +0 -290
- package/selection/highlight/constants.js +0 -15
- package/selection/highlight/constants.mjs +0 -6
- package/selection/highlight/types/index.js +0 -35
- package/selection/highlight/types/index.mjs +0 -31
@@ -1,8 +1,19 @@
|
|
1
1
|
import "core-js/modules/es.array.push.js";
|
2
|
+
import "core-js/modules/es.error.cause.js";
|
3
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
4
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
5
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
6
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
7
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
8
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
9
|
+
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
10
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
11
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
12
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
2
13
|
import { addClass, removeClass } from "../../helpers/dom/element.mjs";
|
3
14
|
import { isNumeric } from "../../helpers/number.mjs";
|
4
|
-
import { isLeftClick, isRightClick } from "../../helpers/dom/event.mjs";
|
5
15
|
import { toSingleLine } from "../../helpers/templateLiteralTag.mjs";
|
16
|
+
import { isLeftClick, isRightClick } from "../../helpers/dom/event.mjs";
|
6
17
|
import { warn } from "../../helpers/console.mjs";
|
7
18
|
import { ACTIVE_HEADER_TYPE, HEADER_TYPE } from "../../selection/index.mjs";
|
8
19
|
import { BasePlugin } from "../base/index.mjs";
|
@@ -56,46 +67,54 @@ export const PLUGIN_PRIORITY = 280;
|
|
56
67
|
* ```
|
57
68
|
* :::
|
58
69
|
*/
|
70
|
+
var _stateManager = /*#__PURE__*/new WeakMap();
|
71
|
+
var _hidingIndexMapObserver = /*#__PURE__*/new WeakMap();
|
59
72
|
export class NestedHeaders extends BasePlugin {
|
73
|
+
constructor() {
|
74
|
+
super(...arguments);
|
75
|
+
/**
|
76
|
+
* The state manager for the nested headers.
|
77
|
+
*
|
78
|
+
* @private
|
79
|
+
* @type {StateManager}
|
80
|
+
*/
|
81
|
+
_classPrivateFieldInitSpec(this, _stateManager, {
|
82
|
+
writable: true,
|
83
|
+
value: new StateManager()
|
84
|
+
});
|
85
|
+
/**
|
86
|
+
* The instance of the ChangesObservable class that allows track the changes that happens in the
|
87
|
+
* column indexes.
|
88
|
+
*
|
89
|
+
* @private
|
90
|
+
* @type {ChangesObservable}
|
91
|
+
*/
|
92
|
+
_classPrivateFieldInitSpec(this, _hidingIndexMapObserver, {
|
93
|
+
writable: true,
|
94
|
+
value: null
|
95
|
+
});
|
96
|
+
/**
|
97
|
+
* Custom helper for getting widths of the nested headers.
|
98
|
+
*
|
99
|
+
* @private
|
100
|
+
* @type {GhostTable}
|
101
|
+
*/
|
102
|
+
// @TODO This should be changed after refactor handsontable/utils/ghostTable.
|
103
|
+
_defineProperty(this, "ghostTable", new GhostTable(this.hot, (row, column) => this.getHeaderSettings(row, column)));
|
104
|
+
/**
|
105
|
+
* The flag which determines that the nested header settings contains overlapping headers
|
106
|
+
* configuration.
|
107
|
+
*
|
108
|
+
* @type {boolean}
|
109
|
+
*/
|
110
|
+
_defineProperty(this, "detectedOverlappedHeaders", false);
|
111
|
+
}
|
60
112
|
static get PLUGIN_KEY() {
|
61
113
|
return PLUGIN_KEY;
|
62
114
|
}
|
63
115
|
static get PLUGIN_PRIORITY() {
|
64
116
|
return PLUGIN_PRIORITY;
|
65
117
|
}
|
66
|
-
|
67
|
-
/**
|
68
|
-
* The state manager for the nested headers.
|
69
|
-
*
|
70
|
-
* @private
|
71
|
-
* @type {StateManager}
|
72
|
-
*/
|
73
|
-
#stateManager = new StateManager();
|
74
|
-
/**
|
75
|
-
* The instance of the ChangesObservable class that allows track the changes that happens in the
|
76
|
-
* column indexes.
|
77
|
-
*
|
78
|
-
* @private
|
79
|
-
* @type {ChangesObservable}
|
80
|
-
*/
|
81
|
-
#hidingIndexMapObserver = null;
|
82
|
-
/**
|
83
|
-
* Custom helper for getting widths of the nested headers.
|
84
|
-
*
|
85
|
-
* @private
|
86
|
-
* @type {GhostTable}
|
87
|
-
*/
|
88
|
-
// @TODO This should be changed after refactor handsontable/utils/ghostTable.
|
89
|
-
ghostTable = new GhostTable(this.hot, (row, column) => this.getHeaderSettings(row, column));
|
90
|
-
|
91
|
-
/**
|
92
|
-
* The flag which determines that the nested header settings contains overlapping headers
|
93
|
-
* configuration.
|
94
|
-
*
|
95
|
-
* @type {boolean}
|
96
|
-
*/
|
97
|
-
detectedOverlappedHeaders = false;
|
98
|
-
|
99
118
|
/**
|
100
119
|
* Check if plugin is enabled.
|
101
120
|
*
|
@@ -133,6 +152,10 @@ export class NestedHeaders extends BasePlugin {
|
|
133
152
|
this.addHook('beforeOnCellMouseOver', function () {
|
134
153
|
return _this.onBeforeOnCellMouseOver(...arguments);
|
135
154
|
});
|
155
|
+
this.addHook('modifyTransformStart', function () {
|
156
|
+
return _this.onModifyTransformStart(...arguments);
|
157
|
+
});
|
158
|
+
this.addHook('afterSelection', () => this.updateFocusHighlightPosition());
|
136
159
|
this.addHook('afterGetColumnHeaderRenderers', array => this.onAfterGetColumnHeaderRenderers(array));
|
137
160
|
this.addHook('modifyColWidth', function () {
|
138
161
|
return _this.onModifyColWidth(...arguments);
|
@@ -146,9 +169,14 @@ export class NestedHeaders extends BasePlugin {
|
|
146
169
|
this.addHook('beforeCopy', function () {
|
147
170
|
return _this.onBeforeCopy(...arguments);
|
148
171
|
});
|
172
|
+
this.addHook('beforeSelectColumns', function () {
|
173
|
+
return _this.onBeforeSelectColumns(...arguments);
|
174
|
+
});
|
149
175
|
this.addHook('afterViewportColumnCalculatorOverride', function () {
|
150
176
|
return _this.onAfterViewportColumnCalculatorOverride(...arguments);
|
151
177
|
});
|
178
|
+
this.hot.columnIndexMapper.addLocalHook('cacheUpdated', () => this.updateFocusHighlightPosition());
|
179
|
+
this.hot.rowIndexMapper.addLocalHook('cacheUpdated', () => this.updateFocusHighlightPosition());
|
152
180
|
super.enablePlugin();
|
153
181
|
this.updatePlugin(); // @TODO: Workaround for broken plugin initialization abstraction.
|
154
182
|
}
|
@@ -167,9 +195,9 @@ export class NestedHeaders extends BasePlugin {
|
|
167
195
|
const {
|
168
196
|
nestedHeaders
|
169
197
|
} = this.hot.getSettings();
|
170
|
-
this
|
198
|
+
_classPrivateFieldGet(this, _stateManager).setColumnsLimit(this.hot.countCols());
|
171
199
|
if (Array.isArray(nestedHeaders)) {
|
172
|
-
this.detectedOverlappedHeaders = this
|
200
|
+
this.detectedOverlappedHeaders = _classPrivateFieldGet(this, _stateManager).setState(nestedHeaders);
|
173
201
|
}
|
174
202
|
if (this.detectedOverlappedHeaders) {
|
175
203
|
warn(toSingleLine`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20
|
@@ -181,11 +209,11 @@ export class NestedHeaders extends BasePlugin {
|
|
181
209
|
// as if all the columns are visible, needs to be modified to be in sync with a dataset.
|
182
210
|
this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((isColumnHidden, physicalColumnIndex) => {
|
183
211
|
const actionName = isColumnHidden === true ? 'hide-column' : 'show-column';
|
184
|
-
this
|
212
|
+
_classPrivateFieldGet(this, _stateManager).triggerColumnModification(actionName, physicalColumnIndex);
|
185
213
|
});
|
186
214
|
}
|
187
|
-
if (!this
|
188
|
-
this
|
215
|
+
if (!_classPrivateFieldGet(this, _hidingIndexMapObserver) && this.enabled) {
|
216
|
+
_classPrivateFieldSet(this, _hidingIndexMapObserver, this.hot.columnIndexMapper.createChangesObserver('hiding').subscribe(changes => {
|
189
217
|
changes.forEach(_ref => {
|
190
218
|
let {
|
191
219
|
op,
|
@@ -194,11 +222,11 @@ export class NestedHeaders extends BasePlugin {
|
|
194
222
|
} = _ref;
|
195
223
|
if (op === 'replace') {
|
196
224
|
const actionName = newValue === true ? 'hide-column' : 'show-column';
|
197
|
-
this
|
225
|
+
_classPrivateFieldGet(this, _stateManager).triggerColumnModification(actionName, columnIndex);
|
198
226
|
}
|
199
227
|
});
|
200
228
|
this.ghostTable.buildWidthsMap();
|
201
|
-
});
|
229
|
+
}));
|
202
230
|
}
|
203
231
|
this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap();
|
204
232
|
super.updatePlugin();
|
@@ -209,9 +237,9 @@ export class NestedHeaders extends BasePlugin {
|
|
209
237
|
*/
|
210
238
|
disablePlugin() {
|
211
239
|
this.clearColspans();
|
212
|
-
this
|
213
|
-
this
|
214
|
-
this
|
240
|
+
_classPrivateFieldGet(this, _stateManager).clear();
|
241
|
+
_classPrivateFieldGet(this, _hidingIndexMapObserver).unsubscribe();
|
242
|
+
_classPrivateFieldSet(this, _hidingIndexMapObserver, null);
|
215
243
|
this.ghostTable.clear();
|
216
244
|
super.disablePlugin();
|
217
245
|
}
|
@@ -223,7 +251,7 @@ export class NestedHeaders extends BasePlugin {
|
|
223
251
|
* @returns {StateManager}
|
224
252
|
*/
|
225
253
|
getStateManager() {
|
226
|
-
return this
|
254
|
+
return _classPrivateFieldGet(this, _stateManager);
|
227
255
|
}
|
228
256
|
|
229
257
|
/**
|
@@ -233,7 +261,7 @@ export class NestedHeaders extends BasePlugin {
|
|
233
261
|
* @returns {number}
|
234
262
|
*/
|
235
263
|
getLayersCount() {
|
236
|
-
return this
|
264
|
+
return _classPrivateFieldGet(this, _stateManager).getLayersCount();
|
237
265
|
}
|
238
266
|
|
239
267
|
/**
|
@@ -247,7 +275,7 @@ export class NestedHeaders extends BasePlugin {
|
|
247
275
|
* @returns {object}
|
248
276
|
*/
|
249
277
|
getHeaderSettings(headerLevel, columnIndex) {
|
250
|
-
return this
|
278
|
+
return _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, columnIndex);
|
251
279
|
}
|
252
280
|
|
253
281
|
/**
|
@@ -301,7 +329,7 @@ export class NestedHeaders extends BasePlugin {
|
|
301
329
|
var _this2 = this;
|
302
330
|
const fixedColumnsStart = this.hot.view._wt.getSetting('fixedColumnsStart');
|
303
331
|
return (renderedColumnIndex, TH) => {
|
304
|
-
var
|
332
|
+
var _classPrivateFieldGet2;
|
305
333
|
const {
|
306
334
|
columnIndexMapper,
|
307
335
|
view
|
@@ -316,17 +344,18 @@ export class NestedHeaders extends BasePlugin {
|
|
316
344
|
colspan,
|
317
345
|
isHidden,
|
318
346
|
isPlaceholder
|
319
|
-
} = (
|
347
|
+
} = (_classPrivateFieldGet2 = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : {
|
320
348
|
label: ''
|
321
349
|
};
|
322
350
|
if (isPlaceholder || isHidden) {
|
323
351
|
addClass(TH, 'hiddenHeader');
|
324
352
|
} else if (colspan > 1) {
|
353
|
+
var _wtOverlays$topInline, _wtOverlays$inlineSta;
|
325
354
|
const {
|
326
355
|
wtOverlays
|
327
356
|
} = view._wt;
|
328
|
-
const isTopInlineStartOverlay = wtOverlays.topInlineStartCornerOverlay
|
329
|
-
const isInlineStartOverlay = wtOverlays.inlineStartOverlay
|
357
|
+
const isTopInlineStartOverlay = (_wtOverlays$topInline = wtOverlays.topInlineStartCornerOverlay) === null || _wtOverlays$topInline === void 0 ? void 0 : _wtOverlays$topInline.clone.wtTable.THEAD.contains(TH);
|
358
|
+
const isInlineStartOverlay = (_wtOverlays$inlineSta = wtOverlays.inlineStartOverlay) === null || _wtOverlays$inlineSta === void 0 ? void 0 : _wtOverlays$inlineSta.clone.wtTable.THEAD.contains(TH);
|
330
359
|
|
331
360
|
// Check if there is a fixed column enabled, if so then reduce colspan to fixed column width.
|
332
361
|
const correctedColspan = isTopInlineStartOverlay || isInlineStartOverlay ? Math.min(colspan, fixedColumnsStart - renderedColumnIndex) : colspan;
|
@@ -352,17 +381,45 @@ export class NestedHeaders extends BasePlugin {
|
|
352
381
|
* @returns {string} Returns the column header value to update.
|
353
382
|
*/
|
354
383
|
getColumnHeaderValue(visualColumnIndex, headerLevel) {
|
355
|
-
var
|
384
|
+
var _classPrivateFieldGet3;
|
356
385
|
const {
|
357
386
|
isHidden,
|
358
387
|
isPlaceholder
|
359
|
-
} = (
|
388
|
+
} = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet3 !== void 0 ? _classPrivateFieldGet3 : {};
|
360
389
|
if (isPlaceholder || isHidden) {
|
361
390
|
return '';
|
362
391
|
}
|
363
392
|
return this.hot.getColHeader(visualColumnIndex, headerLevel);
|
364
393
|
}
|
365
394
|
|
395
|
+
/**
|
396
|
+
* Updates the selection focus highlight position to point to the nested header root element (TH)
|
397
|
+
* even when the logical coordinates point in-between the header.
|
398
|
+
*
|
399
|
+
* @private
|
400
|
+
*/
|
401
|
+
updateFocusHighlightPosition() {
|
402
|
+
var _this$hot;
|
403
|
+
const selection = (_this$hot = this.hot) === null || _this$hot === void 0 ? void 0 : _this$hot.getSelectedRangeLast();
|
404
|
+
if (!selection) {
|
405
|
+
return;
|
406
|
+
}
|
407
|
+
const {
|
408
|
+
highlight
|
409
|
+
} = selection;
|
410
|
+
const isNestedHeadersRange = highlight.isHeader() && highlight.col >= 0;
|
411
|
+
if (isNestedHeadersRange) {
|
412
|
+
const columnIndex = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(highlight.row, highlight.col);
|
413
|
+
const focusHighlight = this.hot.selection.highlight.getFocus();
|
414
|
+
|
415
|
+
// Correct the highlight/focus selection to highlight the correct TH element
|
416
|
+
focusHighlight.visualCellRange.highlight.col = columnIndex;
|
417
|
+
focusHighlight.visualCellRange.from.col = columnIndex;
|
418
|
+
focusHighlight.visualCellRange.to.col = columnIndex;
|
419
|
+
focusHighlight.commit();
|
420
|
+
}
|
421
|
+
}
|
422
|
+
|
366
423
|
/**
|
367
424
|
* Allows to control which header DOM element will be used to highlight.
|
368
425
|
*
|
@@ -373,12 +430,11 @@ export class NestedHeaders extends BasePlugin {
|
|
373
430
|
* @returns {number}
|
374
431
|
*/
|
375
432
|
onBeforeHighlightingColumnHeader(visualColumn, headerLevel, highlightMeta) {
|
376
|
-
const headerNodeData = this
|
433
|
+
const headerNodeData = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(headerLevel, visualColumn);
|
377
434
|
if (!headerNodeData) {
|
378
435
|
return visualColumn;
|
379
436
|
}
|
380
437
|
const {
|
381
|
-
classNames,
|
382
438
|
columnCursor,
|
383
439
|
selectionType,
|
384
440
|
selectionWidth
|
@@ -386,15 +442,15 @@ export class NestedHeaders extends BasePlugin {
|
|
386
442
|
const {
|
387
443
|
isRoot,
|
388
444
|
colspan
|
389
|
-
} = this
|
445
|
+
} = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumn);
|
390
446
|
if (selectionType === HEADER_TYPE) {
|
391
447
|
if (!isRoot) {
|
392
448
|
return headerNodeData.columnIndex;
|
393
449
|
}
|
394
450
|
} else if (selectionType === ACTIVE_HEADER_TYPE) {
|
395
451
|
if (colspan > selectionWidth - columnCursor || !isRoot) {
|
396
|
-
//
|
397
|
-
|
452
|
+
// Prevents adding any CSS class names to the TH element
|
453
|
+
return null;
|
398
454
|
}
|
399
455
|
}
|
400
456
|
return visualColumn;
|
@@ -435,13 +491,14 @@ export class NestedHeaders extends BasePlugin {
|
|
435
491
|
}
|
436
492
|
for (let column = startCol; column <= endCol; column++) {
|
437
493
|
for (let row = startRow; row <= endRow; row++) {
|
494
|
+
var _classPrivateFieldGet4;
|
438
495
|
const zeroBasedColumnHeaderLevel = rowsCount + row;
|
439
496
|
const zeroBasedColumnIndex = column - startCol;
|
440
497
|
if (zeroBasedColumnIndex === 0) {
|
441
498
|
continue; // eslint-disable-line no-continue
|
442
499
|
}
|
443
500
|
|
444
|
-
const isRoot = this
|
501
|
+
const isRoot = (_classPrivateFieldGet4 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(row, column)) === null || _classPrivateFieldGet4 === void 0 ? void 0 : _classPrivateFieldGet4.isRoot;
|
445
502
|
if (isRoot === false) {
|
446
503
|
data[zeroBasedColumnHeaderLevel][zeroBasedColumnIndex] = '';
|
447
504
|
}
|
@@ -547,13 +604,90 @@ export class NestedHeaders extends BasePlugin {
|
|
547
604
|
controller.cell = true;
|
548
605
|
const columnsToSelect = [];
|
549
606
|
if (coords.col < from.col) {
|
550
|
-
columnsToSelect.push(bottomEndCoords.col, columnIndex);
|
607
|
+
columnsToSelect.push(bottomEndCoords.col, columnIndex, coords.row);
|
551
608
|
} else if (coords.col > from.col) {
|
552
|
-
columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1);
|
609
|
+
columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1, coords.row);
|
553
610
|
} else {
|
554
|
-
columnsToSelect.push(columnIndex, columnIndex + origColspan - 1);
|
611
|
+
columnsToSelect.push(columnIndex, columnIndex + origColspan - 1, coords.row);
|
612
|
+
}
|
613
|
+
this.hot.selection.selectColumns(...columnsToSelect);
|
614
|
+
}
|
615
|
+
|
616
|
+
/**
|
617
|
+
* `modifyTransformStart` hook is called every time the keyboard navigation is used.
|
618
|
+
*
|
619
|
+
* @private
|
620
|
+
* @param {object} delta The transformation delta.
|
621
|
+
*/
|
622
|
+
onModifyTransformStart(delta) {
|
623
|
+
const {
|
624
|
+
highlight
|
625
|
+
} = this.hot.getSelectedRangeLast();
|
626
|
+
const nextCoords = this.hot._createCellCoords(highlight.row + delta.row, highlight.col + delta.col);
|
627
|
+
const isNestedHeadersRange = nextCoords.isHeader() && nextCoords.col >= 0;
|
628
|
+
if (!isNestedHeadersRange) {
|
629
|
+
return;
|
630
|
+
}
|
631
|
+
const visualColumnIndexStart = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(nextCoords.row, nextCoords.col);
|
632
|
+
const visualColumnIndexEnd = _classPrivateFieldGet(this, _stateManager).findRightMostColumnIndex(nextCoords.row, nextCoords.col);
|
633
|
+
if (delta.col < 0) {
|
634
|
+
const nextColumn = highlight.col >= visualColumnIndexStart && highlight.col <= visualColumnIndexEnd ? visualColumnIndexStart - 1 : visualColumnIndexEnd;
|
635
|
+
const notHiddenColumnIndex = this.hot.columnIndexMapper.getNearestNotHiddenIndex(nextColumn, -1);
|
636
|
+
if (notHiddenColumnIndex === null) {
|
637
|
+
// There are no visible columns anymore, so move the selection out of the table edge. This will
|
638
|
+
// be processed by the selection Transformer class as a move selection to the previous row (if autoWrapRow is enabled).
|
639
|
+
delta.col = -this.hot.view.countRenderableColumnsInRange(0, highlight.col);
|
640
|
+
} else {
|
641
|
+
delta.col = -Math.max(this.hot.view.countRenderableColumnsInRange(notHiddenColumnIndex, highlight.col) - 1, 1);
|
642
|
+
}
|
643
|
+
} else if (delta.col > 0) {
|
644
|
+
const nextColumn = highlight.col >= visualColumnIndexStart && highlight.col <= visualColumnIndexEnd ? visualColumnIndexEnd + 1 : visualColumnIndexStart;
|
645
|
+
const notHiddenColumnIndex = this.hot.columnIndexMapper.getNearestNotHiddenIndex(nextColumn, 1);
|
646
|
+
if (notHiddenColumnIndex === null) {
|
647
|
+
// There are no visible columns anymore, so move the selection out of the table edge. This will
|
648
|
+
// be processed by the selection Transformer class as a move selection to the next row (if autoWrapRow is enabled).
|
649
|
+
delta.col = this.hot.view.countRenderableColumnsInRange(highlight.col, this.hot.countCols());
|
650
|
+
} else {
|
651
|
+
delta.col = Math.max(this.hot.view.countRenderableColumnsInRange(highlight.col, notHiddenColumnIndex) - 1, 1);
|
652
|
+
}
|
653
|
+
}
|
654
|
+
}
|
655
|
+
|
656
|
+
/**
|
657
|
+
* The hook observes the column selection from the Selection API and modifies the column range to
|
658
|
+
* ensure that the whole nested column will be covered.
|
659
|
+
*
|
660
|
+
* @private
|
661
|
+
* @param {*} from The coords object where the selection starts.
|
662
|
+
* @param {*} to The coords object where the selection ends.
|
663
|
+
*/
|
664
|
+
onBeforeSelectColumns(from, to) {
|
665
|
+
const headerLevel = from.row;
|
666
|
+
const startNodeData = this._getHeaderTreeNodeDataByCoords({
|
667
|
+
row: headerLevel,
|
668
|
+
col: from.col
|
669
|
+
});
|
670
|
+
const endNodeData = this._getHeaderTreeNodeDataByCoords({
|
671
|
+
row: headerLevel,
|
672
|
+
col: to.col
|
673
|
+
});
|
674
|
+
if (to.col < from.col) {
|
675
|
+
// Column selection from right to left
|
676
|
+
if (startNodeData) {
|
677
|
+
from.col = startNodeData.columnIndex + startNodeData.origColspan - 1;
|
678
|
+
}
|
679
|
+
if (endNodeData) {
|
680
|
+
to.col = endNodeData.columnIndex;
|
681
|
+
}
|
682
|
+
} else if (to.col >= from.col) {
|
683
|
+
// Column selection from left to right or a single column selection
|
684
|
+
if (startNodeData) {
|
685
|
+
from.col = startNodeData.columnIndex;
|
686
|
+
}
|
687
|
+
if (endNodeData) {
|
688
|
+
to.col = endNodeData.columnIndex + endNodeData.origColspan - 1;
|
689
|
+
}
|
555
690
|
}
|
556
|
-
this.hot.selectColumns(...columnsToSelect);
|
557
691
|
}
|
558
692
|
|
559
693
|
/**
|
@@ -564,7 +698,7 @@ export class NestedHeaders extends BasePlugin {
|
|
564
698
|
*/
|
565
699
|
onAfterGetColumnHeaderRenderers(renderersArray) {
|
566
700
|
renderersArray.length = 0;
|
567
|
-
for (let headerLayer = 0; headerLayer < this
|
701
|
+
for (let headerLayer = 0; headerLayer < _classPrivateFieldGet(this, _stateManager).getLayersCount(); headerLayer++) {
|
568
702
|
renderersArray.push(this.headerRendererFactory(headerLayer));
|
569
703
|
}
|
570
704
|
}
|
@@ -576,11 +710,11 @@ export class NestedHeaders extends BasePlugin {
|
|
576
710
|
* @param {object} calc Viewport column calculator.
|
577
711
|
*/
|
578
712
|
onAfterViewportColumnCalculatorOverride(calc) {
|
579
|
-
const headerLayersCount = this
|
713
|
+
const headerLayersCount = _classPrivateFieldGet(this, _stateManager).getLayersCount();
|
580
714
|
let newStartColumn = calc.startColumn;
|
581
715
|
let nonRenderable = !!headerLayersCount;
|
582
716
|
for (let headerLayer = 0; headerLayer < headerLayersCount; headerLayer++) {
|
583
|
-
const startColumn = this
|
717
|
+
const startColumn = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(headerLayer, calc.startColumn);
|
584
718
|
const renderedStartColumn = this.hot.columnIndexMapper.getRenderableFromVisualIndex(startColumn);
|
585
719
|
|
586
720
|
// If any of the headers for that column index is rendered, all of them should be rendered properly, see
|
@@ -599,7 +733,7 @@ export class NestedHeaders extends BasePlugin {
|
|
599
733
|
|
600
734
|
// If no headers for the provided column index are renderable, start rendering from the beginning of the upmost
|
601
735
|
// header for that position.
|
602
|
-
calc.startColumn = nonRenderable ? this
|
736
|
+
calc.startColumn = nonRenderable ? _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(0, newStartColumn).columnIndex : newStartColumn;
|
603
737
|
}
|
604
738
|
|
605
739
|
/**
|
@@ -629,10 +763,10 @@ export class NestedHeaders extends BasePlugin {
|
|
629
763
|
* @returns {string} Returns the column header value to update.
|
630
764
|
*/
|
631
765
|
onModifyColumnHeaderValue(value, visualColumnIndex, headerLevel) {
|
632
|
-
var
|
766
|
+
var _classPrivateFieldGet5;
|
633
767
|
const {
|
634
768
|
label
|
635
|
-
} = (
|
769
|
+
} = (_classPrivateFieldGet5 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet5 !== void 0 ? _classPrivateFieldGet5 : {
|
636
770
|
label: ''
|
637
771
|
};
|
638
772
|
return label;
|
@@ -666,10 +800,10 @@ export class NestedHeaders extends BasePlugin {
|
|
666
800
|
* Destroys the plugin instance.
|
667
801
|
*/
|
668
802
|
destroy() {
|
669
|
-
this
|
670
|
-
if (this
|
671
|
-
this
|
672
|
-
this
|
803
|
+
_classPrivateFieldSet(this, _stateManager, null);
|
804
|
+
if (_classPrivateFieldGet(this, _hidingIndexMapObserver) !== null) {
|
805
|
+
_classPrivateFieldGet(this, _hidingIndexMapObserver).unsubscribe();
|
806
|
+
_classPrivateFieldSet(this, _hidingIndexMapObserver, null);
|
673
807
|
}
|
674
808
|
super.destroy();
|
675
809
|
}
|
@@ -685,6 +819,6 @@ export class NestedHeaders extends BasePlugin {
|
|
685
819
|
if (coords.row >= 0 || coords.col < 0) {
|
686
820
|
return;
|
687
821
|
}
|
688
|
-
return this
|
822
|
+
return _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(coords.row, coords.col);
|
689
823
|
}
|
690
824
|
}
|
@@ -1,9 +1,17 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
4
5
|
var _array = require("../../../helpers/array");
|
5
6
|
var _tree = _interopRequireDefault(require("../../../utils/dataStructures/tree"));
|
6
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
9
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
10
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
11
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
12
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
13
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
14
|
+
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
7
15
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
8
16
|
/**
|
9
17
|
* @private
|
@@ -40,32 +48,44 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
40
48
|
*
|
41
49
|
*/
|
42
50
|
/* eslint-enable jsdoc/require-description-complete-sentence */
|
51
|
+
var _rootNodes = /*#__PURE__*/new WeakMap();
|
52
|
+
var _rootsIndex = /*#__PURE__*/new WeakMap();
|
53
|
+
var _sourceSettings = /*#__PURE__*/new WeakMap();
|
43
54
|
class HeadersTree {
|
44
|
-
/**
|
45
|
-
* The collection of nested headers settings structured into trees. The root trees are stored
|
46
|
-
* under the visual column index.
|
47
|
-
*
|
48
|
-
* @private
|
49
|
-
* @type {Map<number, TreeNode>}
|
50
|
-
*/
|
51
|
-
#rootNodes = new Map();
|
52
|
-
/**
|
53
|
-
* A map that translates the visual column indexes that intersect the range
|
54
|
-
* defined by the header colspan width to the root index.
|
55
|
-
*
|
56
|
-
* @private
|
57
|
-
* @type {Map<number, number>}
|
58
|
-
*/
|
59
|
-
#rootsIndex = new Map();
|
60
|
-
/**
|
61
|
-
* The instance of the SourceSettings class.
|
62
|
-
*
|
63
|
-
* @private
|
64
|
-
* @type {SourceSettings}
|
65
|
-
*/
|
66
|
-
#sourceSettings = null;
|
67
55
|
constructor(sourceSettings) {
|
68
|
-
|
56
|
+
/**
|
57
|
+
* The collection of nested headers settings structured into trees. The root trees are stored
|
58
|
+
* under the visual column index.
|
59
|
+
*
|
60
|
+
* @private
|
61
|
+
* @type {Map<number, TreeNode>}
|
62
|
+
*/
|
63
|
+
_classPrivateFieldInitSpec(this, _rootNodes, {
|
64
|
+
writable: true,
|
65
|
+
value: new Map()
|
66
|
+
});
|
67
|
+
/**
|
68
|
+
* A map that translates the visual column indexes that intersect the range
|
69
|
+
* defined by the header colspan width to the root index.
|
70
|
+
*
|
71
|
+
* @private
|
72
|
+
* @type {Map<number, number>}
|
73
|
+
*/
|
74
|
+
_classPrivateFieldInitSpec(this, _rootsIndex, {
|
75
|
+
writable: true,
|
76
|
+
value: new Map()
|
77
|
+
});
|
78
|
+
/**
|
79
|
+
* The instance of the SourceSettings class.
|
80
|
+
*
|
81
|
+
* @private
|
82
|
+
* @type {SourceSettings}
|
83
|
+
*/
|
84
|
+
_classPrivateFieldInitSpec(this, _sourceSettings, {
|
85
|
+
writable: true,
|
86
|
+
value: null
|
87
|
+
});
|
88
|
+
_classPrivateFieldSet(this, _sourceSettings, sourceSettings);
|
69
89
|
}
|
70
90
|
|
71
91
|
/**
|
@@ -74,7 +94,7 @@ class HeadersTree {
|
|
74
94
|
* @returns {TreeNode[]}
|
75
95
|
*/
|
76
96
|
getRoots() {
|
77
|
-
return Array.from(this
|
97
|
+
return Array.from(_classPrivateFieldGet(this, _rootNodes).values());
|
78
98
|
}
|
79
99
|
|
80
100
|
/**
|
@@ -85,8 +105,8 @@ class HeadersTree {
|
|
85
105
|
*/
|
86
106
|
getRootByColumn(columnIndex) {
|
87
107
|
let node;
|
88
|
-
if (this
|
89
|
-
node = this
|
108
|
+
if (_classPrivateFieldGet(this, _rootsIndex).has(columnIndex)) {
|
109
|
+
node = _classPrivateFieldGet(this, _rootNodes).get(_classPrivateFieldGet(this, _rootsIndex).get(columnIndex));
|
90
110
|
}
|
91
111
|
return node;
|
92
112
|
}
|
@@ -106,7 +126,7 @@ class HeadersTree {
|
|
106
126
|
|
107
127
|
// Normalize the visual column index to a 0-based system for a specific "box" defined
|
108
128
|
// by root node colspan width.
|
109
|
-
const normColumnIndex = columnIndex - this
|
129
|
+
const normColumnIndex = columnIndex - _classPrivateFieldGet(this, _rootsIndex).get(columnIndex);
|
110
130
|
let columnCursor = 0;
|
111
131
|
let treeNode;
|
112
132
|
|
@@ -136,8 +156,8 @@ class HeadersTree {
|
|
136
156
|
*/
|
137
157
|
rebuildTreeIndex() {
|
138
158
|
let columnIndex = 0;
|
139
|
-
this
|
140
|
-
(0, _array.arrayEach)(this
|
159
|
+
_classPrivateFieldGet(this, _rootsIndex).clear();
|
160
|
+
(0, _array.arrayEach)(_classPrivateFieldGet(this, _rootNodes), _ref => {
|
141
161
|
let [, {
|
142
162
|
data: {
|
143
163
|
colspan
|
@@ -145,7 +165,7 @@ class HeadersTree {
|
|
145
165
|
}] = _ref;
|
146
166
|
// Map tree range (colspan range/width) into visual column index of the root node.
|
147
167
|
for (let i = columnIndex; i < columnIndex + colspan; i++) {
|
148
|
-
this
|
168
|
+
_classPrivateFieldGet(this, _rootsIndex).set(i, columnIndex);
|
149
169
|
}
|
150
170
|
columnIndex += colspan;
|
151
171
|
});
|
@@ -157,12 +177,12 @@ class HeadersTree {
|
|
157
177
|
*/
|
158
178
|
buildTree() {
|
159
179
|
this.clear();
|
160
|
-
const columnsCount = this
|
180
|
+
const columnsCount = _classPrivateFieldGet(this, _sourceSettings).getColumnsCount();
|
161
181
|
let columnIndex = 0;
|
162
182
|
while (columnIndex < columnsCount) {
|
163
|
-
const columnSettings = this
|
183
|
+
const columnSettings = _classPrivateFieldGet(this, _sourceSettings).getHeaderSettings(0, columnIndex);
|
164
184
|
const rootNode = new _tree.default();
|
165
|
-
this
|
185
|
+
_classPrivateFieldGet(this, _rootNodes).set(columnIndex, rootNode);
|
166
186
|
this.buildLeaves(rootNode, columnIndex, 0, columnSettings.origColspan);
|
167
187
|
columnIndex += columnSettings.origColspan;
|
168
188
|
}
|
@@ -179,7 +199,7 @@ class HeadersTree {
|
|
179
199
|
*/
|
180
200
|
buildLeaves(parentNode, columnIndex, headerLevel) {
|
181
201
|
let extractionLength = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
182
|
-
const columnsSettings = this
|
202
|
+
const columnsSettings = _classPrivateFieldGet(this, _sourceSettings).getHeadersSettings(headerLevel, columnIndex, extractionLength);
|
183
203
|
headerLevel += 1;
|
184
204
|
(0, _array.arrayEach)(columnsSettings, columnSettings => {
|
185
205
|
const nodeData = {
|
@@ -206,7 +226,7 @@ class HeadersTree {
|
|
206
226
|
node = new _tree.default(nodeData);
|
207
227
|
parentNode.addChild(node);
|
208
228
|
}
|
209
|
-
if (headerLevel < this
|
229
|
+
if (headerLevel < _classPrivateFieldGet(this, _sourceSettings).getLayersCount()) {
|
210
230
|
this.buildLeaves(node, columnIndex, headerLevel, columnSettings.origColspan);
|
211
231
|
}
|
212
232
|
columnIndex += columnSettings.origColspan;
|
@@ -217,8 +237,8 @@ class HeadersTree {
|
|
217
237
|
* Clears the tree to the initial state.
|
218
238
|
*/
|
219
239
|
clear() {
|
220
|
-
this
|
221
|
-
this
|
240
|
+
_classPrivateFieldGet(this, _rootNodes).clear();
|
241
|
+
_classPrivateFieldGet(this, _rootsIndex).clear();
|
222
242
|
}
|
223
243
|
}
|
224
244
|
exports.default = HeadersTree;
|