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,17 +1,28 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
require("core-js/modules/es.error.cause.js");
|
3
4
|
exports.__esModule = true;
|
4
5
|
require("core-js/modules/es.array.push.js");
|
5
6
|
var _element = require("../../helpers/dom/element");
|
6
7
|
var _number = require("../../helpers/number");
|
7
|
-
var _event = require("../../helpers/dom/event");
|
8
8
|
var _templateLiteralTag = require("../../helpers/templateLiteralTag");
|
9
|
+
var _event = require("../../helpers/dom/event");
|
9
10
|
var _console = require("../../helpers/console");
|
10
11
|
var _selection = require("../../selection");
|
11
12
|
var _base = require("../base");
|
12
|
-
var
|
13
|
+
var _stateManager2 = _interopRequireDefault(require("./stateManager"));
|
13
14
|
var _ghostTable = _interopRequireDefault(require("./utils/ghostTable"));
|
14
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
16
|
+
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; }
|
17
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
18
|
+
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); }
|
19
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
20
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
21
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
22
|
+
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; } }
|
23
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
24
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
25
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
15
26
|
const PLUGIN_KEY = 'nestedHeaders';
|
16
27
|
exports.PLUGIN_KEY = PLUGIN_KEY;
|
17
28
|
const PLUGIN_PRIORITY = 280;
|
@@ -62,46 +73,54 @@ const PLUGIN_PRIORITY = 280;
|
|
62
73
|
* :::
|
63
74
|
*/
|
64
75
|
exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
|
76
|
+
var _stateManager = /*#__PURE__*/new WeakMap();
|
77
|
+
var _hidingIndexMapObserver = /*#__PURE__*/new WeakMap();
|
65
78
|
class NestedHeaders extends _base.BasePlugin {
|
79
|
+
constructor() {
|
80
|
+
super(...arguments);
|
81
|
+
/**
|
82
|
+
* The state manager for the nested headers.
|
83
|
+
*
|
84
|
+
* @private
|
85
|
+
* @type {StateManager}
|
86
|
+
*/
|
87
|
+
_classPrivateFieldInitSpec(this, _stateManager, {
|
88
|
+
writable: true,
|
89
|
+
value: new _stateManager2.default()
|
90
|
+
});
|
91
|
+
/**
|
92
|
+
* The instance of the ChangesObservable class that allows track the changes that happens in the
|
93
|
+
* column indexes.
|
94
|
+
*
|
95
|
+
* @private
|
96
|
+
* @type {ChangesObservable}
|
97
|
+
*/
|
98
|
+
_classPrivateFieldInitSpec(this, _hidingIndexMapObserver, {
|
99
|
+
writable: true,
|
100
|
+
value: null
|
101
|
+
});
|
102
|
+
/**
|
103
|
+
* Custom helper for getting widths of the nested headers.
|
104
|
+
*
|
105
|
+
* @private
|
106
|
+
* @type {GhostTable}
|
107
|
+
*/
|
108
|
+
// @TODO This should be changed after refactor handsontable/utils/ghostTable.
|
109
|
+
_defineProperty(this, "ghostTable", new _ghostTable.default(this.hot, (row, column) => this.getHeaderSettings(row, column)));
|
110
|
+
/**
|
111
|
+
* The flag which determines that the nested header settings contains overlapping headers
|
112
|
+
* configuration.
|
113
|
+
*
|
114
|
+
* @type {boolean}
|
115
|
+
*/
|
116
|
+
_defineProperty(this, "detectedOverlappedHeaders", false);
|
117
|
+
}
|
66
118
|
static get PLUGIN_KEY() {
|
67
119
|
return PLUGIN_KEY;
|
68
120
|
}
|
69
121
|
static get PLUGIN_PRIORITY() {
|
70
122
|
return PLUGIN_PRIORITY;
|
71
123
|
}
|
72
|
-
|
73
|
-
/**
|
74
|
-
* The state manager for the nested headers.
|
75
|
-
*
|
76
|
-
* @private
|
77
|
-
* @type {StateManager}
|
78
|
-
*/
|
79
|
-
#stateManager = new _stateManager.default();
|
80
|
-
/**
|
81
|
-
* The instance of the ChangesObservable class that allows track the changes that happens in the
|
82
|
-
* column indexes.
|
83
|
-
*
|
84
|
-
* @private
|
85
|
-
* @type {ChangesObservable}
|
86
|
-
*/
|
87
|
-
#hidingIndexMapObserver = null;
|
88
|
-
/**
|
89
|
-
* Custom helper for getting widths of the nested headers.
|
90
|
-
*
|
91
|
-
* @private
|
92
|
-
* @type {GhostTable}
|
93
|
-
*/
|
94
|
-
// @TODO This should be changed after refactor handsontable/utils/ghostTable.
|
95
|
-
ghostTable = new _ghostTable.default(this.hot, (row, column) => this.getHeaderSettings(row, column));
|
96
|
-
|
97
|
-
/**
|
98
|
-
* The flag which determines that the nested header settings contains overlapping headers
|
99
|
-
* configuration.
|
100
|
-
*
|
101
|
-
* @type {boolean}
|
102
|
-
*/
|
103
|
-
detectedOverlappedHeaders = false;
|
104
|
-
|
105
124
|
/**
|
106
125
|
* Check if plugin is enabled.
|
107
126
|
*
|
@@ -139,6 +158,10 @@ class NestedHeaders extends _base.BasePlugin {
|
|
139
158
|
this.addHook('beforeOnCellMouseOver', function () {
|
140
159
|
return _this.onBeforeOnCellMouseOver(...arguments);
|
141
160
|
});
|
161
|
+
this.addHook('modifyTransformStart', function () {
|
162
|
+
return _this.onModifyTransformStart(...arguments);
|
163
|
+
});
|
164
|
+
this.addHook('afterSelection', () => this.updateFocusHighlightPosition());
|
142
165
|
this.addHook('afterGetColumnHeaderRenderers', array => this.onAfterGetColumnHeaderRenderers(array));
|
143
166
|
this.addHook('modifyColWidth', function () {
|
144
167
|
return _this.onModifyColWidth(...arguments);
|
@@ -152,9 +175,14 @@ class NestedHeaders extends _base.BasePlugin {
|
|
152
175
|
this.addHook('beforeCopy', function () {
|
153
176
|
return _this.onBeforeCopy(...arguments);
|
154
177
|
});
|
178
|
+
this.addHook('beforeSelectColumns', function () {
|
179
|
+
return _this.onBeforeSelectColumns(...arguments);
|
180
|
+
});
|
155
181
|
this.addHook('afterViewportColumnCalculatorOverride', function () {
|
156
182
|
return _this.onAfterViewportColumnCalculatorOverride(...arguments);
|
157
183
|
});
|
184
|
+
this.hot.columnIndexMapper.addLocalHook('cacheUpdated', () => this.updateFocusHighlightPosition());
|
185
|
+
this.hot.rowIndexMapper.addLocalHook('cacheUpdated', () => this.updateFocusHighlightPosition());
|
158
186
|
super.enablePlugin();
|
159
187
|
this.updatePlugin(); // @TODO: Workaround for broken plugin initialization abstraction.
|
160
188
|
}
|
@@ -173,9 +201,9 @@ class NestedHeaders extends _base.BasePlugin {
|
|
173
201
|
const {
|
174
202
|
nestedHeaders
|
175
203
|
} = this.hot.getSettings();
|
176
|
-
this
|
204
|
+
_classPrivateFieldGet(this, _stateManager).setColumnsLimit(this.hot.countCols());
|
177
205
|
if (Array.isArray(nestedHeaders)) {
|
178
|
-
this.detectedOverlappedHeaders = this
|
206
|
+
this.detectedOverlappedHeaders = _classPrivateFieldGet(this, _stateManager).setState(nestedHeaders);
|
179
207
|
}
|
180
208
|
if (this.detectedOverlappedHeaders) {
|
181
209
|
(0, _console.warn)((0, _templateLiteralTag.toSingleLine)`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20
|
@@ -187,11 +215,11 @@ class NestedHeaders extends _base.BasePlugin {
|
|
187
215
|
// as if all the columns are visible, needs to be modified to be in sync with a dataset.
|
188
216
|
this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((isColumnHidden, physicalColumnIndex) => {
|
189
217
|
const actionName = isColumnHidden === true ? 'hide-column' : 'show-column';
|
190
|
-
this
|
218
|
+
_classPrivateFieldGet(this, _stateManager).triggerColumnModification(actionName, physicalColumnIndex);
|
191
219
|
});
|
192
220
|
}
|
193
|
-
if (!this
|
194
|
-
this
|
221
|
+
if (!_classPrivateFieldGet(this, _hidingIndexMapObserver) && this.enabled) {
|
222
|
+
_classPrivateFieldSet(this, _hidingIndexMapObserver, this.hot.columnIndexMapper.createChangesObserver('hiding').subscribe(changes => {
|
195
223
|
changes.forEach(_ref => {
|
196
224
|
let {
|
197
225
|
op,
|
@@ -200,11 +228,11 @@ class NestedHeaders extends _base.BasePlugin {
|
|
200
228
|
} = _ref;
|
201
229
|
if (op === 'replace') {
|
202
230
|
const actionName = newValue === true ? 'hide-column' : 'show-column';
|
203
|
-
this
|
231
|
+
_classPrivateFieldGet(this, _stateManager).triggerColumnModification(actionName, columnIndex);
|
204
232
|
}
|
205
233
|
});
|
206
234
|
this.ghostTable.buildWidthsMap();
|
207
|
-
});
|
235
|
+
}));
|
208
236
|
}
|
209
237
|
this.ghostTable.setLayersCount(this.getLayersCount()).buildWidthsMap();
|
210
238
|
super.updatePlugin();
|
@@ -215,9 +243,9 @@ class NestedHeaders extends _base.BasePlugin {
|
|
215
243
|
*/
|
216
244
|
disablePlugin() {
|
217
245
|
this.clearColspans();
|
218
|
-
this
|
219
|
-
this
|
220
|
-
this
|
246
|
+
_classPrivateFieldGet(this, _stateManager).clear();
|
247
|
+
_classPrivateFieldGet(this, _hidingIndexMapObserver).unsubscribe();
|
248
|
+
_classPrivateFieldSet(this, _hidingIndexMapObserver, null);
|
221
249
|
this.ghostTable.clear();
|
222
250
|
super.disablePlugin();
|
223
251
|
}
|
@@ -229,7 +257,7 @@ class NestedHeaders extends _base.BasePlugin {
|
|
229
257
|
* @returns {StateManager}
|
230
258
|
*/
|
231
259
|
getStateManager() {
|
232
|
-
return this
|
260
|
+
return _classPrivateFieldGet(this, _stateManager);
|
233
261
|
}
|
234
262
|
|
235
263
|
/**
|
@@ -239,7 +267,7 @@ class NestedHeaders extends _base.BasePlugin {
|
|
239
267
|
* @returns {number}
|
240
268
|
*/
|
241
269
|
getLayersCount() {
|
242
|
-
return this
|
270
|
+
return _classPrivateFieldGet(this, _stateManager).getLayersCount();
|
243
271
|
}
|
244
272
|
|
245
273
|
/**
|
@@ -253,7 +281,7 @@ class NestedHeaders extends _base.BasePlugin {
|
|
253
281
|
* @returns {object}
|
254
282
|
*/
|
255
283
|
getHeaderSettings(headerLevel, columnIndex) {
|
256
|
-
return this
|
284
|
+
return _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, columnIndex);
|
257
285
|
}
|
258
286
|
|
259
287
|
/**
|
@@ -307,7 +335,7 @@ class NestedHeaders extends _base.BasePlugin {
|
|
307
335
|
var _this2 = this;
|
308
336
|
const fixedColumnsStart = this.hot.view._wt.getSetting('fixedColumnsStart');
|
309
337
|
return (renderedColumnIndex, TH) => {
|
310
|
-
var
|
338
|
+
var _classPrivateFieldGet2;
|
311
339
|
const {
|
312
340
|
columnIndexMapper,
|
313
341
|
view
|
@@ -322,17 +350,18 @@ class NestedHeaders extends _base.BasePlugin {
|
|
322
350
|
colspan,
|
323
351
|
isHidden,
|
324
352
|
isPlaceholder
|
325
|
-
} = (
|
353
|
+
} = (_classPrivateFieldGet2 = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : {
|
326
354
|
label: ''
|
327
355
|
};
|
328
356
|
if (isPlaceholder || isHidden) {
|
329
357
|
(0, _element.addClass)(TH, 'hiddenHeader');
|
330
358
|
} else if (colspan > 1) {
|
359
|
+
var _wtOverlays$topInline, _wtOverlays$inlineSta;
|
331
360
|
const {
|
332
361
|
wtOverlays
|
333
362
|
} = view._wt;
|
334
|
-
const isTopInlineStartOverlay = wtOverlays.topInlineStartCornerOverlay
|
335
|
-
const isInlineStartOverlay = wtOverlays.inlineStartOverlay
|
363
|
+
const isTopInlineStartOverlay = (_wtOverlays$topInline = wtOverlays.topInlineStartCornerOverlay) === null || _wtOverlays$topInline === void 0 ? void 0 : _wtOverlays$topInline.clone.wtTable.THEAD.contains(TH);
|
364
|
+
const isInlineStartOverlay = (_wtOverlays$inlineSta = wtOverlays.inlineStartOverlay) === null || _wtOverlays$inlineSta === void 0 ? void 0 : _wtOverlays$inlineSta.clone.wtTable.THEAD.contains(TH);
|
336
365
|
|
337
366
|
// Check if there is a fixed column enabled, if so then reduce colspan to fixed column width.
|
338
367
|
const correctedColspan = isTopInlineStartOverlay || isInlineStartOverlay ? Math.min(colspan, fixedColumnsStart - renderedColumnIndex) : colspan;
|
@@ -358,17 +387,45 @@ class NestedHeaders extends _base.BasePlugin {
|
|
358
387
|
* @returns {string} Returns the column header value to update.
|
359
388
|
*/
|
360
389
|
getColumnHeaderValue(visualColumnIndex, headerLevel) {
|
361
|
-
var
|
390
|
+
var _classPrivateFieldGet3;
|
362
391
|
const {
|
363
392
|
isHidden,
|
364
393
|
isPlaceholder
|
365
|
-
} = (
|
394
|
+
} = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet3 !== void 0 ? _classPrivateFieldGet3 : {};
|
366
395
|
if (isPlaceholder || isHidden) {
|
367
396
|
return '';
|
368
397
|
}
|
369
398
|
return this.hot.getColHeader(visualColumnIndex, headerLevel);
|
370
399
|
}
|
371
400
|
|
401
|
+
/**
|
402
|
+
* Updates the selection focus highlight position to point to the nested header root element (TH)
|
403
|
+
* even when the logical coordinates point in-between the header.
|
404
|
+
*
|
405
|
+
* @private
|
406
|
+
*/
|
407
|
+
updateFocusHighlightPosition() {
|
408
|
+
var _this$hot;
|
409
|
+
const selection = (_this$hot = this.hot) === null || _this$hot === void 0 ? void 0 : _this$hot.getSelectedRangeLast();
|
410
|
+
if (!selection) {
|
411
|
+
return;
|
412
|
+
}
|
413
|
+
const {
|
414
|
+
highlight
|
415
|
+
} = selection;
|
416
|
+
const isNestedHeadersRange = highlight.isHeader() && highlight.col >= 0;
|
417
|
+
if (isNestedHeadersRange) {
|
418
|
+
const columnIndex = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(highlight.row, highlight.col);
|
419
|
+
const focusHighlight = this.hot.selection.highlight.getFocus();
|
420
|
+
|
421
|
+
// Correct the highlight/focus selection to highlight the correct TH element
|
422
|
+
focusHighlight.visualCellRange.highlight.col = columnIndex;
|
423
|
+
focusHighlight.visualCellRange.from.col = columnIndex;
|
424
|
+
focusHighlight.visualCellRange.to.col = columnIndex;
|
425
|
+
focusHighlight.commit();
|
426
|
+
}
|
427
|
+
}
|
428
|
+
|
372
429
|
/**
|
373
430
|
* Allows to control which header DOM element will be used to highlight.
|
374
431
|
*
|
@@ -379,12 +436,11 @@ class NestedHeaders extends _base.BasePlugin {
|
|
379
436
|
* @returns {number}
|
380
437
|
*/
|
381
438
|
onBeforeHighlightingColumnHeader(visualColumn, headerLevel, highlightMeta) {
|
382
|
-
const headerNodeData = this
|
439
|
+
const headerNodeData = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(headerLevel, visualColumn);
|
383
440
|
if (!headerNodeData) {
|
384
441
|
return visualColumn;
|
385
442
|
}
|
386
443
|
const {
|
387
|
-
classNames,
|
388
444
|
columnCursor,
|
389
445
|
selectionType,
|
390
446
|
selectionWidth
|
@@ -392,15 +448,15 @@ class NestedHeaders extends _base.BasePlugin {
|
|
392
448
|
const {
|
393
449
|
isRoot,
|
394
450
|
colspan
|
395
|
-
} = this
|
451
|
+
} = _classPrivateFieldGet(this, _stateManager).getHeaderSettings(headerLevel, visualColumn);
|
396
452
|
if (selectionType === _selection.HEADER_TYPE) {
|
397
453
|
if (!isRoot) {
|
398
454
|
return headerNodeData.columnIndex;
|
399
455
|
}
|
400
456
|
} else if (selectionType === _selection.ACTIVE_HEADER_TYPE) {
|
401
457
|
if (colspan > selectionWidth - columnCursor || !isRoot) {
|
402
|
-
//
|
403
|
-
|
458
|
+
// Prevents adding any CSS class names to the TH element
|
459
|
+
return null;
|
404
460
|
}
|
405
461
|
}
|
406
462
|
return visualColumn;
|
@@ -441,13 +497,14 @@ class NestedHeaders extends _base.BasePlugin {
|
|
441
497
|
}
|
442
498
|
for (let column = startCol; column <= endCol; column++) {
|
443
499
|
for (let row = startRow; row <= endRow; row++) {
|
500
|
+
var _classPrivateFieldGet4;
|
444
501
|
const zeroBasedColumnHeaderLevel = rowsCount + row;
|
445
502
|
const zeroBasedColumnIndex = column - startCol;
|
446
503
|
if (zeroBasedColumnIndex === 0) {
|
447
504
|
continue; // eslint-disable-line no-continue
|
448
505
|
}
|
449
506
|
|
450
|
-
const isRoot = this
|
507
|
+
const isRoot = (_classPrivateFieldGet4 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(row, column)) === null || _classPrivateFieldGet4 === void 0 ? void 0 : _classPrivateFieldGet4.isRoot;
|
451
508
|
if (isRoot === false) {
|
452
509
|
data[zeroBasedColumnHeaderLevel][zeroBasedColumnIndex] = '';
|
453
510
|
}
|
@@ -553,13 +610,90 @@ class NestedHeaders extends _base.BasePlugin {
|
|
553
610
|
controller.cell = true;
|
554
611
|
const columnsToSelect = [];
|
555
612
|
if (coords.col < from.col) {
|
556
|
-
columnsToSelect.push(bottomEndCoords.col, columnIndex);
|
613
|
+
columnsToSelect.push(bottomEndCoords.col, columnIndex, coords.row);
|
557
614
|
} else if (coords.col > from.col) {
|
558
|
-
columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1);
|
615
|
+
columnsToSelect.push(topStartCoords.col, columnIndex + origColspan - 1, coords.row);
|
559
616
|
} else {
|
560
|
-
columnsToSelect.push(columnIndex, columnIndex + origColspan - 1);
|
617
|
+
columnsToSelect.push(columnIndex, columnIndex + origColspan - 1, coords.row);
|
618
|
+
}
|
619
|
+
this.hot.selection.selectColumns(...columnsToSelect);
|
620
|
+
}
|
621
|
+
|
622
|
+
/**
|
623
|
+
* `modifyTransformStart` hook is called every time the keyboard navigation is used.
|
624
|
+
*
|
625
|
+
* @private
|
626
|
+
* @param {object} delta The transformation delta.
|
627
|
+
*/
|
628
|
+
onModifyTransformStart(delta) {
|
629
|
+
const {
|
630
|
+
highlight
|
631
|
+
} = this.hot.getSelectedRangeLast();
|
632
|
+
const nextCoords = this.hot._createCellCoords(highlight.row + delta.row, highlight.col + delta.col);
|
633
|
+
const isNestedHeadersRange = nextCoords.isHeader() && nextCoords.col >= 0;
|
634
|
+
if (!isNestedHeadersRange) {
|
635
|
+
return;
|
636
|
+
}
|
637
|
+
const visualColumnIndexStart = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(nextCoords.row, nextCoords.col);
|
638
|
+
const visualColumnIndexEnd = _classPrivateFieldGet(this, _stateManager).findRightMostColumnIndex(nextCoords.row, nextCoords.col);
|
639
|
+
if (delta.col < 0) {
|
640
|
+
const nextColumn = highlight.col >= visualColumnIndexStart && highlight.col <= visualColumnIndexEnd ? visualColumnIndexStart - 1 : visualColumnIndexEnd;
|
641
|
+
const notHiddenColumnIndex = this.hot.columnIndexMapper.getNearestNotHiddenIndex(nextColumn, -1);
|
642
|
+
if (notHiddenColumnIndex === null) {
|
643
|
+
// There are no visible columns anymore, so move the selection out of the table edge. This will
|
644
|
+
// be processed by the selection Transformer class as a move selection to the previous row (if autoWrapRow is enabled).
|
645
|
+
delta.col = -this.hot.view.countRenderableColumnsInRange(0, highlight.col);
|
646
|
+
} else {
|
647
|
+
delta.col = -Math.max(this.hot.view.countRenderableColumnsInRange(notHiddenColumnIndex, highlight.col) - 1, 1);
|
648
|
+
}
|
649
|
+
} else if (delta.col > 0) {
|
650
|
+
const nextColumn = highlight.col >= visualColumnIndexStart && highlight.col <= visualColumnIndexEnd ? visualColumnIndexEnd + 1 : visualColumnIndexStart;
|
651
|
+
const notHiddenColumnIndex = this.hot.columnIndexMapper.getNearestNotHiddenIndex(nextColumn, 1);
|
652
|
+
if (notHiddenColumnIndex === null) {
|
653
|
+
// There are no visible columns anymore, so move the selection out of the table edge. This will
|
654
|
+
// be processed by the selection Transformer class as a move selection to the next row (if autoWrapRow is enabled).
|
655
|
+
delta.col = this.hot.view.countRenderableColumnsInRange(highlight.col, this.hot.countCols());
|
656
|
+
} else {
|
657
|
+
delta.col = Math.max(this.hot.view.countRenderableColumnsInRange(highlight.col, notHiddenColumnIndex) - 1, 1);
|
658
|
+
}
|
659
|
+
}
|
660
|
+
}
|
661
|
+
|
662
|
+
/**
|
663
|
+
* The hook observes the column selection from the Selection API and modifies the column range to
|
664
|
+
* ensure that the whole nested column will be covered.
|
665
|
+
*
|
666
|
+
* @private
|
667
|
+
* @param {*} from The coords object where the selection starts.
|
668
|
+
* @param {*} to The coords object where the selection ends.
|
669
|
+
*/
|
670
|
+
onBeforeSelectColumns(from, to) {
|
671
|
+
const headerLevel = from.row;
|
672
|
+
const startNodeData = this._getHeaderTreeNodeDataByCoords({
|
673
|
+
row: headerLevel,
|
674
|
+
col: from.col
|
675
|
+
});
|
676
|
+
const endNodeData = this._getHeaderTreeNodeDataByCoords({
|
677
|
+
row: headerLevel,
|
678
|
+
col: to.col
|
679
|
+
});
|
680
|
+
if (to.col < from.col) {
|
681
|
+
// Column selection from right to left
|
682
|
+
if (startNodeData) {
|
683
|
+
from.col = startNodeData.columnIndex + startNodeData.origColspan - 1;
|
684
|
+
}
|
685
|
+
if (endNodeData) {
|
686
|
+
to.col = endNodeData.columnIndex;
|
687
|
+
}
|
688
|
+
} else if (to.col >= from.col) {
|
689
|
+
// Column selection from left to right or a single column selection
|
690
|
+
if (startNodeData) {
|
691
|
+
from.col = startNodeData.columnIndex;
|
692
|
+
}
|
693
|
+
if (endNodeData) {
|
694
|
+
to.col = endNodeData.columnIndex + endNodeData.origColspan - 1;
|
695
|
+
}
|
561
696
|
}
|
562
|
-
this.hot.selectColumns(...columnsToSelect);
|
563
697
|
}
|
564
698
|
|
565
699
|
/**
|
@@ -570,7 +704,7 @@ class NestedHeaders extends _base.BasePlugin {
|
|
570
704
|
*/
|
571
705
|
onAfterGetColumnHeaderRenderers(renderersArray) {
|
572
706
|
renderersArray.length = 0;
|
573
|
-
for (let headerLayer = 0; headerLayer < this
|
707
|
+
for (let headerLayer = 0; headerLayer < _classPrivateFieldGet(this, _stateManager).getLayersCount(); headerLayer++) {
|
574
708
|
renderersArray.push(this.headerRendererFactory(headerLayer));
|
575
709
|
}
|
576
710
|
}
|
@@ -582,11 +716,11 @@ class NestedHeaders extends _base.BasePlugin {
|
|
582
716
|
* @param {object} calc Viewport column calculator.
|
583
717
|
*/
|
584
718
|
onAfterViewportColumnCalculatorOverride(calc) {
|
585
|
-
const headerLayersCount = this
|
719
|
+
const headerLayersCount = _classPrivateFieldGet(this, _stateManager).getLayersCount();
|
586
720
|
let newStartColumn = calc.startColumn;
|
587
721
|
let nonRenderable = !!headerLayersCount;
|
588
722
|
for (let headerLayer = 0; headerLayer < headerLayersCount; headerLayer++) {
|
589
|
-
const startColumn = this
|
723
|
+
const startColumn = _classPrivateFieldGet(this, _stateManager).findLeftMostColumnIndex(headerLayer, calc.startColumn);
|
590
724
|
const renderedStartColumn = this.hot.columnIndexMapper.getRenderableFromVisualIndex(startColumn);
|
591
725
|
|
592
726
|
// If any of the headers for that column index is rendered, all of them should be rendered properly, see
|
@@ -605,7 +739,7 @@ class NestedHeaders extends _base.BasePlugin {
|
|
605
739
|
|
606
740
|
// If no headers for the provided column index are renderable, start rendering from the beginning of the upmost
|
607
741
|
// header for that position.
|
608
|
-
calc.startColumn = nonRenderable ? this
|
742
|
+
calc.startColumn = nonRenderable ? _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(0, newStartColumn).columnIndex : newStartColumn;
|
609
743
|
}
|
610
744
|
|
611
745
|
/**
|
@@ -635,10 +769,10 @@ class NestedHeaders extends _base.BasePlugin {
|
|
635
769
|
* @returns {string} Returns the column header value to update.
|
636
770
|
*/
|
637
771
|
onModifyColumnHeaderValue(value, visualColumnIndex, headerLevel) {
|
638
|
-
var
|
772
|
+
var _classPrivateFieldGet5;
|
639
773
|
const {
|
640
774
|
label
|
641
|
-
} = (
|
775
|
+
} = (_classPrivateFieldGet5 = _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet5 !== void 0 ? _classPrivateFieldGet5 : {
|
642
776
|
label: ''
|
643
777
|
};
|
644
778
|
return label;
|
@@ -672,10 +806,10 @@ class NestedHeaders extends _base.BasePlugin {
|
|
672
806
|
* Destroys the plugin instance.
|
673
807
|
*/
|
674
808
|
destroy() {
|
675
|
-
this
|
676
|
-
if (this
|
677
|
-
this
|
678
|
-
this
|
809
|
+
_classPrivateFieldSet(this, _stateManager, null);
|
810
|
+
if (_classPrivateFieldGet(this, _hidingIndexMapObserver) !== null) {
|
811
|
+
_classPrivateFieldGet(this, _hidingIndexMapObserver).unsubscribe();
|
812
|
+
_classPrivateFieldSet(this, _hidingIndexMapObserver, null);
|
679
813
|
}
|
680
814
|
super.destroy();
|
681
815
|
}
|
@@ -691,7 +825,7 @@ class NestedHeaders extends _base.BasePlugin {
|
|
691
825
|
if (coords.row >= 0 || coords.col < 0) {
|
692
826
|
return;
|
693
827
|
}
|
694
|
-
return this
|
828
|
+
return _classPrivateFieldGet(this, _stateManager).getHeaderTreeNodeData(coords.row, coords.col);
|
695
829
|
}
|
696
830
|
}
|
697
831
|
exports.NestedHeaders = NestedHeaders;
|