handsontable 0.0.0-next-9059914-20231025 → 0.0.0-next-21d91d0-20231025
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 +50 -11
- package/3rdparty/walkontable/src/cell/coords.mjs +50 -11
- package/3rdparty/walkontable/src/cell/range.d.ts +9 -2
- package/3rdparty/walkontable/src/cell/range.js +38 -7
- package/3rdparty/walkontable/src/cell/range.mjs +38 -7
- package/3rdparty/walkontable/src/core/_base.js +9 -3
- package/3rdparty/walkontable/src/core/_base.mjs +9 -3
- package/3rdparty/walkontable/src/core/clone.js +2 -2
- package/3rdparty/walkontable/src/core/clone.mjs +2 -2
- package/3rdparty/walkontable/src/core/core.js +3 -2
- package/3rdparty/walkontable/src/core/core.mjs +3 -2
- package/3rdparty/walkontable/src/event.js +12 -10
- package/3rdparty/walkontable/src/event.mjs +12 -10
- 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 +13 -2
- package/3rdparty/walkontable/src/overlay/_base.mjs +14 -3
- 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 +2 -6
- package/3rdparty/walkontable/src/overlay/top.mjs +2 -6
- package/3rdparty/walkontable/src/renderer/cells.js +10 -0
- package/3rdparty/walkontable/src/renderer/cells.mjs +11 -1
- package/3rdparty/walkontable/src/renderer/columnHeaders.js +10 -0
- package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +11 -1
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +5 -0
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +5 -0
- package/3rdparty/walkontable/src/renderer/rows.js +13 -0
- package/3rdparty/walkontable/src/renderer/rows.mjs +13 -0
- package/3rdparty/walkontable/src/renderer/table.js +9 -0
- package/3rdparty/walkontable/src/renderer/table.mjs +9 -0
- package/3rdparty/walkontable/src/scroll.js +2 -0
- package/3rdparty/walkontable/src/scroll.mjs +2 -0
- 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 +274 -0
- package/3rdparty/walkontable/src/selection/manager.mjs +269 -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 +13 -4
- package/3rdparty/walkontable/src/settings.mjs +13 -4
- 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 +19 -78
- package/3rdparty/walkontable/src/table.mjs +20 -79
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/cellTypes/dateType/dateType.d.ts +3 -3
- package/cellTypes/dateType/dateType.js +2 -2
- package/cellTypes/dateType/dateType.mjs +2 -2
- package/cellTypes/handsontableType/handsontableType.d.ts +3 -3
- package/cellTypes/handsontableType/handsontableType.js +2 -2
- package/cellTypes/handsontableType/handsontableType.mjs +2 -2
- package/cellTypes/index.d.ts +3 -0
- package/cellTypes/index.js +4 -0
- package/cellTypes/index.mjs +3 -1
- package/cellTypes/selectType/index.d.ts +1 -0
- package/cellTypes/selectType/index.js +6 -0
- package/cellTypes/selectType/index.mjs +1 -0
- package/cellTypes/selectType/selectType.d.ts +14 -0
- package/cellTypes/selectType/selectType.js +13 -0
- package/cellTypes/selectType/selectType.mjs +8 -0
- package/core/focusCatcher/focusDetector.js +63 -0
- package/core/focusCatcher/focusDetector.mjs +59 -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 +9 -4
- package/core.js +285 -327
- package/core.mjs +285 -327
- package/dataMap/metaManager/metaSchema.js +65 -0
- package/dataMap/metaManager/metaSchema.mjs +65 -0
- package/dataMap/metaManager/mods/extendMetaProperties.js +7 -1
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +7 -1
- package/dataMap/replaceData.js +5 -0
- package/dataMap/replaceData.mjs +5 -0
- package/dist/handsontable.css +51 -15
- package/dist/handsontable.full.css +51 -15
- package/dist/handsontable.full.js +13360 -7840
- package/dist/handsontable.full.min.css +7 -7
- package/dist/handsontable.full.min.js +136 -136
- package/dist/handsontable.js +20955 -15435
- package/dist/handsontable.min.css +6 -6
- package/dist/handsontable.min.js +24 -24
- package/dist/languages/all.js +6 -2
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/en-US.js +3 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/pl-PL.js +3 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/editorManager.js +15 -87
- package/editorManager.mjs +16 -87
- package/editors/autocompleteEditor/autocompleteEditor.js +53 -2
- package/editors/autocompleteEditor/autocompleteEditor.mjs +54 -3
- package/editors/dateEditor/dateEditor.js +26 -7
- package/editors/dateEditor/dateEditor.mjs +27 -8
- package/editors/handsontableEditor/handsontableEditor.js +9 -1
- package/editors/handsontableEditor/handsontableEditor.mjs +10 -2
- package/editors/textEditor/textEditor.js +19 -27
- package/editors/textEditor/textEditor.mjs +22 -30
- package/focusManager.d.ts +12 -0
- package/focusManager.js +265 -0
- package/focusManager.mjs +261 -0
- package/helpers/a11y.js +79 -0
- package/helpers/a11y.mjs +38 -0
- package/helpers/dom/element.js +188 -9
- package/helpers/dom/element.mjs +182 -9
- 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/i18n/constants.js +7 -1
- package/i18n/constants.mjs +4 -1
- package/i18n/languages/en-US.js +3 -1
- package/i18n/languages/en-US.mjs +3 -1
- package/i18n/languages/pl-PL.js +3 -1
- package/i18n/languages/pl-PL.mjs +3 -1
- package/languages/all.js +6 -2
- package/languages/en-US.js +3 -1
- package/languages/en-US.mjs +3 -1
- package/languages/index.js +6 -2
- package/languages/pl-PL.js +3 -1
- package/languages/pl-PL.mjs +3 -1
- package/package.json +21 -1
- package/pluginHooks.d.ts +12 -1
- package/pluginHooks.js +152 -1
- package/pluginHooks.mjs +152 -1
- package/plugins/collapsibleColumns/collapsibleColumns.js +74 -4
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +75 -5
- package/plugins/columnSorting/columnSorting.js +43 -0
- package/plugins/columnSorting/columnSorting.mjs +44 -3
- 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 +252 -189
- package/plugins/comments/comments.mjs +251 -190
- 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/commandExecutor.js +2 -3
- package/plugins/contextMenu/commandExecutor.mjs +2 -3
- package/plugins/contextMenu/contextMenu.d.ts +1 -1
- package/plugins/contextMenu/contextMenu.js +75 -36
- package/plugins/contextMenu/contextMenu.mjs +74 -35
- package/plugins/contextMenu/itemsFactory.js +2 -3
- package/plugins/contextMenu/itemsFactory.mjs +3 -4
- package/plugins/contextMenu/{cursor.mjs → menu/cursor.js} +6 -4
- package/plugins/contextMenu/{cursor.js → menu/cursor.mjs} +4 -10
- package/plugins/contextMenu/menu/defaultShortcutsList.js +88 -0
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +84 -0
- package/plugins/contextMenu/menu/index.js +9 -0
- package/plugins/contextMenu/menu/index.mjs +1 -0
- package/plugins/contextMenu/{menu.js → menu/menu.js} +145 -421
- package/plugins/contextMenu/{menu.mjs → menu/menu.mjs} +146 -422
- package/plugins/contextMenu/menu/menuItemRenderer.js +58 -0
- package/plugins/contextMenu/menu/menuItemRenderer.mjs +54 -0
- package/plugins/contextMenu/menu/navigator.js +27 -0
- package/plugins/contextMenu/menu/navigator.mjs +23 -0
- package/plugins/contextMenu/menu/positioner.js +213 -0
- package/plugins/contextMenu/menu/positioner.mjs +209 -0
- package/plugins/contextMenu/menu/shortcuts.js +114 -0
- package/plugins/contextMenu/menu/shortcuts.mjs +110 -0
- package/plugins/contextMenu/menu/utils.js +177 -0
- package/plugins/contextMenu/menu/utils.mjs +163 -0
- 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.js → predefinedItems/index.js} +14 -14
- package/plugins/contextMenu/predefinedItems/index.mjs +68 -0
- 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 +35 -151
- package/plugins/contextMenu/utils.mjs +35 -144
- 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 +127 -78
- package/plugins/copyPaste/copyPaste.mjs +128 -79
- package/plugins/customBorders/customBorders.js +23 -20
- package/plugins/customBorders/customBorders.mjs +24 -21
- package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
- package/plugins/dropdownMenu/dropdownMenu.js +127 -40
- package/plugins/dropdownMenu/dropdownMenu.mjs +126 -39
- package/plugins/filters/component/_base.js +23 -8
- package/plugins/filters/component/_base.mjs +23 -8
- package/plugins/filters/component/actionBar.js +29 -27
- package/plugins/filters/component/actionBar.mjs +26 -23
- package/plugins/filters/component/condition.js +46 -59
- package/plugins/filters/component/condition.mjs +40 -52
- package/plugins/filters/component/operators.js +21 -22
- package/plugins/filters/component/operators.mjs +18 -18
- package/plugins/filters/component/value.js +35 -26
- package/plugins/filters/component/value.mjs +32 -22
- package/plugins/filters/constants.mjs +1 -1
- package/plugins/filters/filters.js +106 -62
- package/plugins/filters/filters.mjs +99 -55
- package/plugins/filters/menu/focusController.js +123 -0
- package/plugins/filters/menu/focusController.mjs +119 -0
- package/plugins/filters/menu/focusNavigator.js +30 -0
- package/plugins/filters/menu/focusNavigator.mjs +26 -0
- package/plugins/filters/ui/_base.js +35 -13
- package/plugins/filters/ui/_base.mjs +35 -13
- package/plugins/filters/ui/input.js +43 -32
- package/plugins/filters/ui/input.mjs +42 -30
- package/plugins/filters/ui/link.js +44 -12
- package/plugins/filters/ui/link.mjs +44 -11
- package/plugins/filters/ui/multipleSelect.js +234 -129
- package/plugins/filters/ui/multipleSelect.mjs +232 -127
- package/plugins/filters/ui/radioInput.js +42 -18
- package/plugins/filters/ui/radioInput.mjs +42 -17
- package/plugins/filters/ui/select.js +144 -75
- package/plugins/filters/ui/select.mjs +142 -72
- package/plugins/hiddenColumns/hiddenColumns.mjs +1 -1
- package/plugins/hiddenRows/hiddenRows.mjs +1 -1
- package/plugins/manualColumnMove/manualColumnMove.js +3 -1
- package/plugins/manualColumnMove/manualColumnMove.mjs +3 -1
- package/plugins/mergeCells/mergeCells.js +5 -16
- package/plugins/mergeCells/mergeCells.mjs +5 -16
- package/plugins/multiColumnSorting/multiColumnSorting.js +37 -2
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +37 -2
- package/plugins/nestedHeaders/nestedHeaders.js +240 -10
- package/plugins/nestedHeaders/nestedHeaders.mjs +241 -11
- package/plugins/nestedHeaders/stateManager/index.js +102 -3
- package/plugins/nestedHeaders/stateManager/index.mjs +102 -3
- package/plugins/nestedRows/nestedRows.js +41 -0
- package/plugins/nestedRows/nestedRows.mjs +41 -0
- package/plugins/nestedRows/ui/headers.js +11 -0
- package/plugins/nestedRows/ui/headers.mjs +12 -1
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +8 -0
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +8 -0
- package/renderers/baseRenderer/baseRenderer.js +17 -0
- package/renderers/baseRenderer/baseRenderer.mjs +18 -1
- package/renderers/checkboxRenderer/checkboxRenderer.js +9 -4
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +9 -4
- package/renderers/dateRenderer/dateRenderer.d.ts +5 -0
- package/renderers/dateRenderer/dateRenderer.js +29 -0
- package/renderers/dateRenderer/dateRenderer.mjs +24 -0
- package/renderers/dateRenderer/index.d.ts +1 -0
- package/renderers/dateRenderer/index.js +6 -0
- package/renderers/dateRenderer/index.mjs +1 -0
- package/renderers/handsontableRenderer/handsontableRenderer.d.ts +5 -0
- package/renderers/handsontableRenderer/handsontableRenderer.js +29 -0
- package/renderers/handsontableRenderer/handsontableRenderer.mjs +24 -0
- package/renderers/handsontableRenderer/index.d.ts +1 -0
- package/renderers/handsontableRenderer/index.js +6 -0
- package/renderers/handsontableRenderer/index.mjs +1 -0
- package/renderers/index.d.ts +9 -0
- package/renderers/selectRenderer/index.d.ts +1 -0
- package/renderers/selectRenderer/index.js +6 -0
- package/renderers/selectRenderer/index.mjs +1 -0
- package/renderers/selectRenderer/selectRenderer.d.ts +5 -0
- package/renderers/selectRenderer/selectRenderer.js +27 -0
- package/renderers/selectRenderer/selectRenderer.mjs +22 -0
- 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 +31 -27
- package/selection/highlight/visualSelection.mjs +31 -27
- package/selection/index.js +4 -7
- package/selection/index.mjs +2 -3
- package/selection/mouseEventHandler.js +7 -1
- package/selection/mouseEventHandler.mjs +7 -1
- package/selection/range.js +8 -8
- package/selection/range.mjs +8 -8
- package/selection/selection.js +321 -152
- package/selection/selection.mjs +318 -151
- 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 +4 -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 +25 -0
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +21 -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 +25 -0
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +21 -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 +33 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +29 -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 +33 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +29 -0
- package/shortcutContexts/commands/populateSelectedCellsData.js +29 -0
- package/shortcutContexts/commands/populateSelectedCellsData.mjs +25 -0
- package/shortcutContexts/commands/scrollToFocusedCell.js +35 -0
- package/shortcutContexts/commands/scrollToFocusedCell.mjs +31 -0
- package/shortcutContexts/commands/selectAll.js +12 -0
- package/shortcutContexts/commands/selectAll.mjs +8 -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/context.js +23 -4
- package/shortcuts/context.mjs +23 -5
- package/shortcuts/manager.js +25 -7
- package/shortcuts/manager.mjs +26 -7
- package/shortcuts/recorder.js +3 -3
- package/shortcuts/recorder.mjs +3 -3
- package/shortcuts/utils.js +19 -5
- package/shortcuts/utils.mjs +18 -4
- package/tableView.js +111 -13
- package/tableView.mjs +112 -14
- package/utils/paginator.js +151 -0
- package/utils/paginator.mjs +147 -0
- package/3rdparty/walkontable/src/selection.js +0 -295
- package/3rdparty/walkontable/src/selection.mjs +0 -290
- package/plugins/contextMenu/predefinedItems.mjs +0 -68
- package/plugins/copyPaste/focusableElement.js +0 -186
- package/plugins/copyPaste/focusableElement.mjs +0 -180
- 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
package/selection/selection.js
CHANGED
@@ -2,21 +2,36 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
require("core-js/modules/es.error.cause.js");
|
5
|
-
var
|
6
|
-
var
|
5
|
+
var _src = require("./../3rdparty/walkontable/src");
|
6
|
+
var _highlight = _interopRequireWildcard(require("./highlight/highlight"));
|
7
7
|
var _range = _interopRequireDefault(require("./range"));
|
8
8
|
var _object = require("./../helpers/object");
|
9
9
|
var _mixed = require("./../helpers/mixed");
|
10
|
+
var _number = require("./../helpers/number");
|
10
11
|
var _array = require("./../helpers/array");
|
11
12
|
var _localHooks = _interopRequireDefault(require("./../mixins/localHooks"));
|
12
13
|
var _transformation = _interopRequireDefault(require("./transformation"));
|
13
14
|
var _utils = require("./utils");
|
14
15
|
var _templateLiteralTag = require("./../helpers/templateLiteralTag");
|
16
|
+
var _a11y = require("../helpers/a11y");
|
15
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
19
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
20
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
21
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
22
|
+
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; }
|
23
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
24
|
+
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); }
|
25
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
26
|
+
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; } }
|
27
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
28
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
29
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
16
30
|
/**
|
17
31
|
* @class Selection
|
18
32
|
* @util
|
19
33
|
*/
|
34
|
+
var _disableHeadersHighlight = /*#__PURE__*/new WeakMap();
|
20
35
|
class Selection {
|
21
36
|
constructor(settings, tableProps) {
|
22
37
|
var _this = this;
|
@@ -25,57 +40,73 @@ class Selection {
|
|
25
40
|
*
|
26
41
|
* @type {GridSettings}
|
27
42
|
*/
|
28
|
-
this
|
43
|
+
_defineProperty(this, "settings", void 0);
|
29
44
|
/**
|
30
45
|
* An additional object with dynamically defined properties which describes table state.
|
31
46
|
*
|
32
47
|
* @type {object}
|
33
48
|
*/
|
34
|
-
this
|
49
|
+
_defineProperty(this, "tableProps", void 0);
|
35
50
|
/**
|
36
51
|
* The flag which determines if the selection is in progress.
|
37
52
|
*
|
38
53
|
* @type {boolean}
|
39
54
|
*/
|
40
|
-
this
|
55
|
+
_defineProperty(this, "inProgress", false);
|
41
56
|
/**
|
42
|
-
*
|
57
|
+
* Selection data layer (handle visual coordinates).
|
43
58
|
*
|
44
|
-
* @type {
|
59
|
+
* @type {SelectionRange}
|
45
60
|
*/
|
46
|
-
this.
|
61
|
+
_defineProperty(this, "selectedRange", new _range.default((highlight, from, to) => {
|
62
|
+
return this.tableProps.createCellRange(highlight, from, to);
|
63
|
+
}));
|
64
|
+
/**
|
65
|
+
* Visualization layer.
|
66
|
+
*
|
67
|
+
* @type {Highlight}
|
68
|
+
*/
|
69
|
+
_defineProperty(this, "highlight", void 0);
|
70
|
+
/**
|
71
|
+
* The module for modifying coordinates.
|
72
|
+
*
|
73
|
+
* @type {Transformation}
|
74
|
+
*/
|
75
|
+
_defineProperty(this, "transformation", void 0);
|
47
76
|
/**
|
48
77
|
* The collection of the selection layer levels where the whole row was selected using the row header or
|
49
78
|
* the corner header.
|
50
79
|
*
|
51
|
-
* @type {Set
|
80
|
+
* @type {Set<number>}
|
52
81
|
*/
|
53
|
-
this
|
82
|
+
_defineProperty(this, "selectedByRowHeader", new Set());
|
54
83
|
/**
|
55
84
|
* The collection of the selection layer levels where the whole column was selected using the column header or
|
56
85
|
* the corner header.
|
57
86
|
*
|
58
|
-
* @type {Set
|
87
|
+
* @type {Set<number>}
|
59
88
|
*/
|
60
|
-
this
|
89
|
+
_defineProperty(this, "selectedByColumnHeader", new Set());
|
61
90
|
/**
|
62
|
-
*
|
91
|
+
* When sets disable highlighting the headers even when the logical coordinates points on them.
|
63
92
|
*
|
64
|
-
* @type {
|
93
|
+
* @type {boolean}
|
65
94
|
*/
|
66
|
-
this
|
67
|
-
|
95
|
+
_classPrivateFieldInitSpec(this, _disableHeadersHighlight, {
|
96
|
+
writable: true,
|
97
|
+
value: false
|
68
98
|
});
|
69
|
-
|
70
|
-
|
71
|
-
*
|
72
|
-
* @type {Highlight}
|
73
|
-
*/
|
99
|
+
this.settings = settings;
|
100
|
+
this.tableProps = tableProps;
|
74
101
|
this.highlight = new _highlight.default({
|
75
102
|
headerClassName: settings.currentHeaderClassName,
|
103
|
+
headerAttributes: [(0, _a11y.A11Y_SELECTED)()],
|
76
104
|
activeHeaderClassName: settings.activeHeaderClassName,
|
77
105
|
rowClassName: settings.currentRowClassName,
|
78
106
|
columnClassName: settings.currentColClassName,
|
107
|
+
cellAttributes: [(0, _a11y.A11Y_SELECTED)()],
|
108
|
+
rowIndexMapper: this.tableProps.rowIndexMapper,
|
109
|
+
columnIndexMapper: this.tableProps.columnIndexMapper,
|
79
110
|
disabledCellSelection: (row, column) => this.tableProps.isDisabledCellSelection(row, column),
|
80
111
|
cellCornerVisible: function () {
|
81
112
|
return _this.isCellCornerVisible(...arguments);
|
@@ -86,21 +117,19 @@ class Selection {
|
|
86
117
|
visualToRenderableCoords: coords => this.tableProps.visualToRenderableCoords(coords),
|
87
118
|
renderableToVisualCoords: coords => this.tableProps.renderableToVisualCoords(coords),
|
88
119
|
createCellCoords: (row, column) => this.tableProps.createCellCoords(row, column),
|
89
|
-
createCellRange: (highlight, from, to) => this.tableProps.createCellRange(highlight, from, to)
|
90
|
-
rowIndexMapper: () => this.tableProps.rowIndexMapper(),
|
91
|
-
columnIndexMapper: () => this.tableProps.columnIndexMapper()
|
120
|
+
createCellRange: (highlight, from, to) => this.tableProps.createCellRange(highlight, from, to)
|
92
121
|
});
|
93
|
-
/**
|
94
|
-
* The module for modifying coordinates.
|
95
|
-
*
|
96
|
-
* @type {Transformation}
|
97
|
-
*/
|
98
122
|
this.transformation = new _transformation.default(this.selectedRange, {
|
99
|
-
|
100
|
-
|
123
|
+
rowIndexMapper: this.tableProps.rowIndexMapper,
|
124
|
+
columnIndexMapper: this.tableProps.columnIndexMapper,
|
125
|
+
countRenderableRows: () => this.tableProps.countRenderableRows(),
|
126
|
+
countRenderableColumns: () => this.tableProps.countRenderableColumns(),
|
127
|
+
countRowHeaders: () => this.tableProps.countRowHeaders(),
|
128
|
+
countColHeaders: () => this.tableProps.countColHeaders(),
|
101
129
|
visualToRenderableCoords: coords => this.tableProps.visualToRenderableCoords(coords),
|
102
130
|
renderableToVisualCoords: coords => this.tableProps.renderableToVisualCoords(coords),
|
103
131
|
createCellCoords: (row, column) => this.tableProps.createCellCoords(row, column),
|
132
|
+
navigableHeaders: () => settings.navigableHeaders,
|
104
133
|
fixedRowsBottom: () => settings.fixedRowsBottom,
|
105
134
|
minSpareRows: () => settings.minSpareRows,
|
106
135
|
minSpareCols: () => settings.minSpareCols,
|
@@ -155,14 +184,14 @@ class Selection {
|
|
155
184
|
}
|
156
185
|
|
157
186
|
/**
|
158
|
-
* Indicate that selection process began. It sets
|
187
|
+
* Indicate that selection process began. It sets internally `.inProgress` property to `true`.
|
159
188
|
*/
|
160
189
|
begin() {
|
161
190
|
this.inProgress = true;
|
162
191
|
}
|
163
192
|
|
164
193
|
/**
|
165
|
-
* Indicate that selection process finished. It sets
|
194
|
+
* Indicate that selection process finished. It sets internally `.inProgress` property to `false`.
|
166
195
|
*/
|
167
196
|
finish() {
|
168
197
|
this.runLocalHooks('afterSelectionFinished', Array.from(this.selectedRange));
|
@@ -187,33 +216,25 @@ class Selection {
|
|
187
216
|
* the default trigger will be used.
|
188
217
|
* @param {boolean} [fragment=false] If `true`, the selection will be treated as a partial selection where the
|
189
218
|
* `setRangeEnd` method won't be called on every `setRangeStart` call.
|
219
|
+
* @param {CellCoords} [highlightCoords] If set, allows changing the coordinates of the highlight/focus cell.
|
190
220
|
*/
|
191
221
|
setRangeStart(coords, multipleSelection) {
|
192
222
|
let fragment = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
223
|
+
let highlightCoords = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : coords;
|
193
224
|
const isMultipleMode = this.settings.selectionMode === 'multiple';
|
194
225
|
const isMultipleSelection = (0, _mixed.isUndefined)(multipleSelection) ? this.tableProps.getShortcutManager().isCtrlPressed() : multipleSelection;
|
195
|
-
const isRowNegative = coords.row < 0;
|
196
|
-
const isColumnNegative = coords.col < 0;
|
197
|
-
const selectedByCorner = isRowNegative && isColumnNegative;
|
198
226
|
// We are creating copy. We would like to modify just the start of the selection by below hook. Then original coords
|
199
227
|
// should be handled by next methods.
|
200
228
|
const coordsClone = coords.clone();
|
201
|
-
this.selectedByCorner = selectedByCorner;
|
202
229
|
this.runLocalHooks(`beforeSetRangeStart${fragment ? 'Only' : ''}`, coordsClone);
|
203
230
|
if (!isMultipleMode || isMultipleMode && !isMultipleSelection && (0, _mixed.isUndefined)(multipleSelection)) {
|
204
231
|
this.selectedRange.clear();
|
205
232
|
}
|
206
|
-
this.selectedRange.add(coordsClone);
|
233
|
+
this.selectedRange.add(coordsClone).current().setHighlight(highlightCoords.clone());
|
207
234
|
if (this.getLayerLevel() === 0) {
|
208
235
|
this.selectedByRowHeader.clear();
|
209
236
|
this.selectedByColumnHeader.clear();
|
210
237
|
}
|
211
|
-
if (!selectedByCorner && isColumnNegative) {
|
212
|
-
this.selectedByRowHeader.add(this.getLayerLevel());
|
213
|
-
}
|
214
|
-
if (!selectedByCorner && isRowNegative) {
|
215
|
-
this.selectedByColumnHeader.add(this.getLayerLevel());
|
216
|
-
}
|
217
238
|
if (!fragment) {
|
218
239
|
this.setRangeEnd(coords);
|
219
240
|
}
|
@@ -226,9 +247,11 @@ class Selection {
|
|
226
247
|
* @param {boolean} [multipleSelection] If `true`, selection will be worked in 'multiple' mode. This option works
|
227
248
|
* only when 'selectionMode' is set as 'multiple'. If the argument is not defined
|
228
249
|
* the default trigger will be used.
|
250
|
+
* @param {CellCoords} [highlightCoords] If set, allows changing the coordinates of the highlight/focus cell.
|
229
251
|
*/
|
230
252
|
setRangeStartOnly(coords, multipleSelection) {
|
231
|
-
|
253
|
+
let highlightCoords = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : coords;
|
254
|
+
this.setRangeStart(coords, multipleSelection, true, highlightCoords);
|
232
255
|
}
|
233
256
|
|
234
257
|
/**
|
@@ -240,21 +263,40 @@ class Selection {
|
|
240
263
|
if (this.selectedRange.isEmpty()) {
|
241
264
|
return;
|
242
265
|
}
|
243
|
-
|
244
|
-
// We are creating copy. We would like to modify just the end of the selection by below hook. Then original coords
|
245
|
-
// should be handled by next methods.
|
246
266
|
const coordsClone = coords.clone();
|
267
|
+
const countRows = this.tableProps.countRows();
|
268
|
+
const countCols = this.tableProps.countCols();
|
269
|
+
const isSingle = this.selectedRange.current().clone().setTo(coords).isSingleHeader();
|
270
|
+
|
271
|
+
// Ignore processing the end range when the header selection starts overlapping the corner and
|
272
|
+
// the selection is not a single header highlight.
|
273
|
+
if ((countRows > 0 || countCols > 0) && (countRows === 0 && coordsClone.col < 0 && !isSingle || countCols === 0 && coordsClone.row < 0 && !isSingle)) {
|
274
|
+
return;
|
275
|
+
}
|
247
276
|
this.runLocalHooks('beforeSetRangeEnd', coordsClone);
|
248
277
|
this.begin();
|
249
278
|
const cellRange = this.selectedRange.current();
|
250
|
-
if (this.settings.
|
251
|
-
cellRange.
|
279
|
+
if (!this.settings.navigableHeaders) {
|
280
|
+
cellRange.highlight.normalize();
|
281
|
+
}
|
282
|
+
if (this.settings.selectionMode === 'single') {
|
283
|
+
cellRange.setFrom(cellRange.highlight);
|
284
|
+
cellRange.setTo(cellRange.highlight);
|
285
|
+
} else {
|
286
|
+
cellRange.setTo(coordsClone);
|
252
287
|
}
|
253
288
|
|
254
|
-
//
|
255
|
-
|
256
|
-
|
257
|
-
|
289
|
+
// Prevent creating "area" selection that overlaps headers.
|
290
|
+
if (countRows > 0 && countCols > 0) {
|
291
|
+
if (!this.settings.navigableHeaders || this.settings.navigableHeaders && !cellRange.isSingleHeader()) {
|
292
|
+
cellRange.to.normalize();
|
293
|
+
}
|
294
|
+
}
|
295
|
+
this.runLocalHooks('beforeHighlightSet');
|
296
|
+
const focusHighlight = this.highlight.getFocus();
|
297
|
+
focusHighlight.clear();
|
298
|
+
if (this.highlight.isEnabledFor(_highlight.FOCUS_TYPE, cellRange.highlight)) {
|
299
|
+
focusHighlight.add(this.selectedRange.current().highlight).commit().syncWith(cellRange);
|
258
300
|
}
|
259
301
|
const layerLevel = this.getLayerLevel();
|
260
302
|
|
@@ -262,69 +304,80 @@ class Selection {
|
|
262
304
|
// indication that the new selection is performing.
|
263
305
|
if (layerLevel < this.highlight.layerLevel) {
|
264
306
|
(0, _array.arrayEach)(this.highlight.getAreas(), highlight => void highlight.clear());
|
265
|
-
(0, _array.arrayEach)(this.highlight.
|
266
|
-
(0, _array.arrayEach)(this.highlight.
|
307
|
+
(0, _array.arrayEach)(this.highlight.getLayeredAreas(), highlight => void highlight.clear());
|
308
|
+
(0, _array.arrayEach)(this.highlight.getRowHeaders(), highlight => void highlight.clear());
|
309
|
+
(0, _array.arrayEach)(this.highlight.getColumnHeaders(), highlight => void highlight.clear());
|
310
|
+
(0, _array.arrayEach)(this.highlight.getActiveRowHeaders(), highlight => void highlight.clear());
|
311
|
+
(0, _array.arrayEach)(this.highlight.getActiveColumnHeaders(), highlight => void highlight.clear());
|
312
|
+
(0, _array.arrayEach)(this.highlight.getActiveCornerHeaders(), highlight => void highlight.clear());
|
313
|
+
(0, _array.arrayEach)(this.highlight.getRowHighlights(), highlight => void highlight.clear());
|
314
|
+
(0, _array.arrayEach)(this.highlight.getColumnHighlights(), highlight => void highlight.clear());
|
267
315
|
}
|
268
316
|
this.highlight.useLayerLevel(layerLevel);
|
269
|
-
const areaHighlight = this.highlight.
|
270
|
-
const
|
271
|
-
const
|
317
|
+
const areaHighlight = this.highlight.createArea();
|
318
|
+
const layeredAreaHighlight = this.highlight.createLayeredArea();
|
319
|
+
const rowHeaderHighlight = this.highlight.createRowHeader();
|
320
|
+
const columnHeaderHighlight = this.highlight.createColumnHeader();
|
321
|
+
const activeRowHeaderHighlight = this.highlight.createActiveRowHeader();
|
322
|
+
const activeColumnHeaderHighlight = this.highlight.createActiveColumnHeader();
|
323
|
+
const activeCornerHeaderHighlight = this.highlight.createActiveCornerHeader();
|
324
|
+
const rowHighlight = this.highlight.createRowHighlight();
|
325
|
+
const columnHighlight = this.highlight.createColumnHighlight();
|
272
326
|
areaHighlight.clear();
|
273
|
-
|
274
|
-
|
275
|
-
|
327
|
+
layeredAreaHighlight.clear();
|
328
|
+
rowHeaderHighlight.clear();
|
329
|
+
columnHeaderHighlight.clear();
|
330
|
+
activeRowHeaderHighlight.clear();
|
331
|
+
activeColumnHeaderHighlight.clear();
|
332
|
+
activeCornerHeaderHighlight.clear();
|
333
|
+
rowHighlight.clear();
|
334
|
+
columnHighlight.clear();
|
335
|
+
if (this.highlight.isEnabledFor(_highlight.AREA_TYPE, cellRange.highlight) && (this.isMultiple() || layerLevel >= 1)) {
|
276
336
|
areaHighlight.add(cellRange.from).add(cellRange.to).commit();
|
337
|
+
layeredAreaHighlight.add(cellRange.from).add(cellRange.to).commit();
|
277
338
|
if (layerLevel === 1) {
|
278
339
|
// For single cell selection in the same layer, we do not create area selection to prevent blue background.
|
279
340
|
// When non-consecutive selection is performed we have to add that missing area selection to the previous layer
|
280
341
|
// based on previous coordinates. It only occurs when the previous selection wasn't select multiple cells.
|
281
342
|
const previousRange = this.selectedRange.previous();
|
282
|
-
this.highlight.useLayerLevel(layerLevel - 1)
|
343
|
+
this.highlight.useLayerLevel(layerLevel - 1);
|
344
|
+
this.highlight.createArea().add(previousRange.from).commit()
|
345
|
+
// Range may start with hidden indexes. Commit would not found start point (as we add just the `from` coords).
|
346
|
+
.syncWith(previousRange);
|
347
|
+
this.highlight.createLayeredArea().add(previousRange.from).commit()
|
283
348
|
// Range may start with hidden indexes. Commit would not found start point (as we add just the `from` coords).
|
284
349
|
.syncWith(previousRange);
|
285
350
|
this.highlight.useLayerLevel(layerLevel);
|
286
351
|
}
|
287
352
|
}
|
288
|
-
if (this.highlight.isEnabledFor(
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
}
|
305
|
-
if (this.settings.selectionMode === 'single') {
|
306
|
-
if (this.isSelectedByAnyHeader()) {
|
307
|
-
headerCellRange.from.normalize();
|
353
|
+
if (this.highlight.isEnabledFor(_highlight.HEADER_TYPE, cellRange.highlight)) {
|
354
|
+
if (!cellRange.isSingleHeader()) {
|
355
|
+
const rowCoordsFrom = this.tableProps.createCellCoords(Math.max(cellRange.from.row, 0), -1);
|
356
|
+
const rowCoordsTo = this.tableProps.createCellCoords(cellRange.to.row, -1);
|
357
|
+
const columnCoordsFrom = this.tableProps.createCellCoords(-1, Math.max(cellRange.from.col, 0));
|
358
|
+
const columnCoordsTo = this.tableProps.createCellCoords(-1, cellRange.to.col);
|
359
|
+
if (this.settings.selectionMode === 'single') {
|
360
|
+
rowHeaderHighlight.add(rowCoordsFrom).commit();
|
361
|
+
columnHeaderHighlight.add(columnCoordsFrom).commit();
|
362
|
+
rowHighlight.add(rowCoordsFrom).commit();
|
363
|
+
columnHighlight.add(columnCoordsFrom).commit();
|
364
|
+
} else {
|
365
|
+
rowHeaderHighlight.add(rowCoordsFrom).add(rowCoordsTo).commit();
|
366
|
+
columnHeaderHighlight.add(columnCoordsFrom).add(columnCoordsTo).commit();
|
367
|
+
rowHighlight.add(rowCoordsFrom).add(rowCoordsTo).commit();
|
368
|
+
columnHighlight.add(columnCoordsFrom).add(columnCoordsTo).commit();
|
308
369
|
}
|
309
|
-
headerHighlight.add(headerCellRange.from).commit();
|
310
|
-
} else {
|
311
|
-
headerHighlight.add(headerCellRange.from).add(headerCellRange.to).commit();
|
312
370
|
}
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
if (isRowSelected) {
|
318
|
-
activeHeaderHighlight.add(this.tableProps.createCellCoords(cellRange.from.row, -1)).add(this.tableProps.createCellCoords(cellRange.to.row, -1)).commit();
|
319
|
-
}
|
371
|
+
const highlightRowHeaders = !_classPrivateFieldGet(this, _disableHeadersHighlight) && this.isEntireRowSelected() && (countCols > 0 && countCols === cellRange.getWidth() || countCols === 0 && this.isSelectedByRowHeader());
|
372
|
+
const highlightColumnHeaders = !_classPrivateFieldGet(this, _disableHeadersHighlight) && this.isEntireColumnSelected() && (countRows > 0 && countRows === cellRange.getHeight() || countRows === 0 && this.isSelectedByColumnHeader());
|
373
|
+
if (highlightRowHeaders) {
|
374
|
+
activeRowHeaderHighlight.add(this.tableProps.createCellCoords(Math.max(cellRange.from.row, 0), Math.min(-this.tableProps.countRowHeaders(), -1))).add(this.tableProps.createCellCoords(Math.max(cellRange.to.row, 0), -1)).commit();
|
320
375
|
}
|
321
|
-
if (
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
activeHeaderHighlight.add(this.tableProps.createCellCoords(-1, cellRange.from.col)).add(this.tableProps.createCellCoords(-1, cellRange.to.col)).commit();
|
327
|
-
}
|
376
|
+
if (highlightColumnHeaders) {
|
377
|
+
activeColumnHeaderHighlight.add(this.tableProps.createCellCoords(Math.min(-this.tableProps.countColHeaders(), -1), Math.max(cellRange.from.col, 0))).add(this.tableProps.createCellCoords(-1, Math.max(cellRange.to.col, 0))).commit();
|
378
|
+
}
|
379
|
+
if (highlightRowHeaders && highlightColumnHeaders) {
|
380
|
+
activeCornerHeaderHighlight.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(), -this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1, -1)).commit();
|
328
381
|
}
|
329
382
|
}
|
330
383
|
this.runLocalHooks('afterSetRangeEnd', coords);
|
@@ -347,12 +400,12 @@ class Selection {
|
|
347
400
|
*
|
348
401
|
* @param {number} rowDelta Rows number to move, value can be passed as negative number.
|
349
402
|
* @param {number} colDelta Columns number to move, value can be passed as negative number.
|
350
|
-
* @param {boolean} [
|
351
|
-
*
|
403
|
+
* @param {boolean} [createMissingRecords=false] If `true` the new rows/columns will be created if necessary.
|
404
|
+
* Otherwise, row/column will be created according to `minSpareRows/minSpareCols` settings of Handsontable.
|
352
405
|
*/
|
353
406
|
transformStart(rowDelta, colDelta) {
|
354
|
-
let
|
355
|
-
this.setRangeStart(this.transformation.transformStart(rowDelta, colDelta,
|
407
|
+
let createMissingRecords = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
408
|
+
this.setRangeStart(this.transformation.transformStart(rowDelta, colDelta, createMissingRecords));
|
356
409
|
}
|
357
410
|
|
358
411
|
/**
|
@@ -393,7 +446,7 @@ class Selection {
|
|
393
446
|
*/
|
394
447
|
isSelectedByRowHeader() {
|
395
448
|
let layerLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getLayerLevel();
|
396
|
-
return !this.isSelectedByCorner(layerLevel) && this.
|
449
|
+
return !this.isSelectedByCorner(layerLevel) && (layerLevel === -1 ? this.selectedByRowHeader.size > 0 : this.selectedByRowHeader.has(layerLevel));
|
397
450
|
}
|
398
451
|
|
399
452
|
/**
|
@@ -405,7 +458,19 @@ class Selection {
|
|
405
458
|
*/
|
406
459
|
isEntireRowSelected() {
|
407
460
|
let layerLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getLayerLevel();
|
408
|
-
|
461
|
+
const tester = range => {
|
462
|
+
const {
|
463
|
+
col
|
464
|
+
} = range.getOuterTopStartCorner();
|
465
|
+
const rowHeaders = this.tableProps.countRowHeaders();
|
466
|
+
const countCols = this.tableProps.countCols();
|
467
|
+
return (rowHeaders > 0 && col < 0 || rowHeaders === 0) && range.getWidth() === countCols;
|
468
|
+
};
|
469
|
+
if (layerLevel === -1) {
|
470
|
+
return Array.from(this.selectedRange).some(range => tester(range));
|
471
|
+
}
|
472
|
+
const range = this.selectedRange.peekByIndex(layerLevel);
|
473
|
+
return range ? tester(range) : false;
|
409
474
|
}
|
410
475
|
|
411
476
|
/**
|
@@ -418,7 +483,7 @@ class Selection {
|
|
418
483
|
*/
|
419
484
|
isSelectedByColumnHeader() {
|
420
485
|
let layerLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getLayerLevel();
|
421
|
-
return !this.isSelectedByCorner() && this.
|
486
|
+
return !this.isSelectedByCorner() && (layerLevel === -1 ? this.selectedByColumnHeader.size > 0 : this.selectedByColumnHeader.has(layerLevel));
|
422
487
|
}
|
423
488
|
|
424
489
|
/**
|
@@ -430,7 +495,19 @@ class Selection {
|
|
430
495
|
*/
|
431
496
|
isEntireColumnSelected() {
|
432
497
|
let layerLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getLayerLevel();
|
433
|
-
|
498
|
+
const tester = range => {
|
499
|
+
const {
|
500
|
+
row
|
501
|
+
} = range.getOuterTopStartCorner();
|
502
|
+
const colHeaders = this.tableProps.countColHeaders();
|
503
|
+
const countRows = this.tableProps.countRows();
|
504
|
+
return (colHeaders > 0 && row < 0 || colHeaders === 0) && range.getHeight() === countRows;
|
505
|
+
};
|
506
|
+
if (layerLevel === -1) {
|
507
|
+
return Array.from(this.selectedRange).some(range => tester(range));
|
508
|
+
}
|
509
|
+
const range = this.selectedRange.peekByIndex(layerLevel);
|
510
|
+
return range ? tester(range) : false;
|
434
511
|
}
|
435
512
|
|
436
513
|
/**
|
@@ -448,7 +525,7 @@ class Selection {
|
|
448
525
|
* @returns {boolean}
|
449
526
|
*/
|
450
527
|
isSelectedByCorner() {
|
451
|
-
return this.
|
528
|
+
return this.selectedByColumnHeader.has(this.getLayerLevel()) && this.selectedByRowHeader.has(this.getLayerLevel());
|
452
529
|
}
|
453
530
|
|
454
531
|
/**
|
@@ -507,31 +584,61 @@ class Selection {
|
|
507
584
|
}
|
508
585
|
|
509
586
|
/**
|
510
|
-
*
|
587
|
+
* Selects all cells and headers.
|
511
588
|
*
|
512
|
-
* @param {boolean} [includeRowHeaders=false] `true` If the selection should include the row headers,
|
513
|
-
* otherwise.
|
514
|
-
* @param {boolean} [includeColumnHeaders=false] `true` If the selection should include the column
|
515
|
-
* otherwise.
|
589
|
+
* @param {boolean} [includeRowHeaders=false] `true` If the selection should include the row headers,
|
590
|
+
* `false` otherwise.
|
591
|
+
* @param {boolean} [includeColumnHeaders=false] `true` If the selection should include the column
|
592
|
+
* headers, `false` otherwise.
|
593
|
+
* @param {object} [options] Additional object with options.
|
594
|
+
* @param {{row: number, col: number} | boolean} [options.focusPosition] The argument allows changing the cell/header
|
595
|
+
* focus position. The value takes an object with a `row` and `col` properties from -N to N, where
|
596
|
+
* negative values point to the headers and positive values point to the cell range. If `false`, the focus
|
597
|
+
* position won't be changed.
|
598
|
+
* @param {boolean} [options.disableHeadersHighlight] If `true`, disables highlighting the headers even when
|
599
|
+
* the logical coordinates points on them.
|
516
600
|
*/
|
517
601
|
selectAll() {
|
602
|
+
var _this$getSelectedRang;
|
518
603
|
let includeRowHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
519
604
|
let includeColumnHeaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
605
|
+
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
606
|
+
focusPosition: false,
|
607
|
+
disableHeadersHighlight: false
|
608
|
+
};
|
520
609
|
const nrOfRows = this.tableProps.countRows();
|
521
610
|
const nrOfColumns = this.tableProps.countCols();
|
611
|
+
const countRowHeaders = this.tableProps.countRowHeaders();
|
612
|
+
const countColHeaders = this.tableProps.countColHeaders();
|
613
|
+
const rowFrom = includeColumnHeaders ? -countColHeaders : 0;
|
614
|
+
const columnFrom = includeRowHeaders ? -countRowHeaders : 0;
|
522
615
|
|
523
616
|
// We can't select cells when there is no data.
|
524
|
-
if (
|
617
|
+
if (rowFrom === 0 && columnFrom === 0 && (nrOfRows === 0 || nrOfColumns === 0)) {
|
525
618
|
return;
|
526
619
|
}
|
527
|
-
|
620
|
+
let highlight = (_this$getSelectedRang = this.getSelectedRange().current()) === null || _this$getSelectedRang === void 0 ? void 0 : _this$getSelectedRang.highlight;
|
621
|
+
const {
|
622
|
+
focusPosition,
|
623
|
+
disableHeadersHighlight
|
624
|
+
} = options;
|
625
|
+
_classPrivateFieldSet(this, _disableHeadersHighlight, disableHeadersHighlight);
|
626
|
+
if (focusPosition && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.row) && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.col)) {
|
627
|
+
highlight = this.tableProps.createCellCoords((0, _number.clamp)(focusPosition.row, rowFrom, nrOfRows - 1), (0, _number.clamp)(focusPosition.col, columnFrom, nrOfColumns - 1));
|
628
|
+
}
|
629
|
+
const startCoords = this.tableProps.createCellCoords(rowFrom, columnFrom);
|
528
630
|
const endCoords = this.tableProps.createCellCoords(nrOfRows - 1, nrOfColumns - 1);
|
529
631
|
this.clear();
|
530
|
-
this.setRangeStartOnly(startCoords);
|
531
|
-
|
532
|
-
|
632
|
+
this.setRangeStartOnly(startCoords, void 0, highlight);
|
633
|
+
if (columnFrom < 0) {
|
634
|
+
this.selectedByRowHeader.add(this.getLayerLevel());
|
635
|
+
}
|
636
|
+
if (rowFrom < 0) {
|
637
|
+
this.selectedByColumnHeader.add(this.getLayerLevel());
|
638
|
+
}
|
533
639
|
this.setRangeEnd(endCoords);
|
534
640
|
this.finish();
|
641
|
+
_classPrivateFieldSet(this, _disableHeadersHighlight, false);
|
535
642
|
}
|
536
643
|
|
537
644
|
/**
|
@@ -556,21 +663,29 @@ class Selection {
|
|
556
663
|
propToCol: prop => this.tableProps.propToCol(prop),
|
557
664
|
keepDirection: true
|
558
665
|
});
|
559
|
-
const
|
560
|
-
const
|
666
|
+
const navigableHeaders = this.settings.navigableHeaders;
|
667
|
+
const tableParams = {
|
668
|
+
countRows: this.tableProps.countRows(),
|
669
|
+
countCols: this.tableProps.countCols(),
|
670
|
+
countRowHeaders: navigableHeaders ? this.tableProps.countRowHeaders() : 0,
|
671
|
+
countColHeaders: navigableHeaders ? this.tableProps.countColHeaders() : 0
|
672
|
+
};
|
561
673
|
|
562
674
|
// Check if every layer of the coordinates are valid.
|
563
675
|
const isValid = !selectionRanges.some(selection => {
|
564
|
-
const
|
565
|
-
const
|
566
|
-
return !
|
676
|
+
const cellRange = selectionSchemaNormalizer(selection);
|
677
|
+
const rangeValidity = cellRange.isValid(tableParams);
|
678
|
+
return !(rangeValidity && !cellRange.containsHeaders() || rangeValidity && cellRange.containsHeaders() && cellRange.isSingleHeader());
|
567
679
|
});
|
568
680
|
if (isValid) {
|
569
681
|
this.clear();
|
570
682
|
(0, _array.arrayEach)(selectionRanges, selection => {
|
571
|
-
const
|
572
|
-
|
573
|
-
|
683
|
+
const {
|
684
|
+
from,
|
685
|
+
to
|
686
|
+
} = selectionSchemaNormalizer(selection);
|
687
|
+
this.setRangeStartOnly(from.clone(), false);
|
688
|
+
this.setRangeEnd(to.clone());
|
574
689
|
this.finish();
|
575
690
|
});
|
576
691
|
}
|
@@ -583,22 +698,43 @@ class Selection {
|
|
583
698
|
*
|
584
699
|
* @param {number|string} startColumn Visual column index or column property from which the selection starts.
|
585
700
|
* @param {number|string} [endColumn] Visual column index or column property from to the selection finishes.
|
586
|
-
* @param {number} [
|
587
|
-
*
|
588
|
-
*
|
701
|
+
* @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
|
702
|
+
* The value can take visual row index from -N to N, where negative values
|
703
|
+
* point to the headers and positive values point to the cell range.
|
589
704
|
* @returns {boolean} Returns `true` if selection was successful, `false` otherwise.
|
590
705
|
*/
|
591
706
|
selectColumns(startColumn) {
|
592
707
|
let endColumn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startColumn;
|
593
|
-
let
|
708
|
+
let focusPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
594
709
|
const start = typeof startColumn === 'string' ? this.tableProps.propToCol(startColumn) : startColumn;
|
595
710
|
const end = typeof endColumn === 'string' ? this.tableProps.propToCol(endColumn) : endColumn;
|
596
|
-
const
|
597
|
-
const
|
598
|
-
const
|
711
|
+
const countRows = this.tableProps.countRows();
|
712
|
+
const countCols = this.tableProps.countCols();
|
713
|
+
const countColHeaders = this.tableProps.countColHeaders();
|
714
|
+
const columnHeaderLastIndex = countColHeaders === 0 ? 0 : -countColHeaders;
|
715
|
+
const fromCoords = new _src.CellCoords(columnHeaderLastIndex, start);
|
716
|
+
const toCoords = new _src.CellCoords(countRows - 1, end);
|
717
|
+
const isValid = new _src.CellRange(fromCoords, fromCoords, toCoords).isValid({
|
718
|
+
countRows,
|
719
|
+
countCols,
|
720
|
+
countRowHeaders: 0,
|
721
|
+
countColHeaders
|
722
|
+
});
|
599
723
|
if (isValid) {
|
600
|
-
|
601
|
-
|
724
|
+
const fromRow = countColHeaders === 0 ? 0 : (0, _number.clamp)(focusPosition, columnHeaderLastIndex, -1);
|
725
|
+
const toRow = countRows - 1;
|
726
|
+
const from = this.tableProps.createCellCoords(fromRow, start);
|
727
|
+
const to = this.tableProps.createCellCoords(toRow, end);
|
728
|
+
const highlight = this.tableProps.createCellCoords((0, _number.clamp)(focusPosition, columnHeaderLastIndex, countRows - 1), start);
|
729
|
+
this.runLocalHooks('beforeSelectColumns', from, to, highlight);
|
730
|
+
|
731
|
+
// disallow modifying row axis for that hooks
|
732
|
+
from.row = fromRow;
|
733
|
+
to.row = toRow;
|
734
|
+
this.setRangeStartOnly(from, void 0, highlight);
|
735
|
+
this.selectedByColumnHeader.add(this.getLayerLevel());
|
736
|
+
this.setRangeEnd(to);
|
737
|
+
this.runLocalHooks('afterSelectColumns', from, to, highlight);
|
602
738
|
this.finish();
|
603
739
|
}
|
604
740
|
return isValid;
|
@@ -609,20 +745,41 @@ class Selection {
|
|
609
745
|
*
|
610
746
|
* @param {number} startRow Visual row index from which the selection starts.
|
611
747
|
* @param {number} [endRow] Visual row index from to the selection finishes.
|
612
|
-
* @param {number} [
|
613
|
-
*
|
614
|
-
*
|
748
|
+
* @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
|
749
|
+
* The value can take visual column index from -N to N, where negative values
|
750
|
+
* point to the headers and positive values point to the cell range.
|
615
751
|
* @returns {boolean} Returns `true` if selection was successful, `false` otherwise.
|
616
752
|
*/
|
617
753
|
selectRows(startRow) {
|
618
754
|
let endRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startRow;
|
619
|
-
let
|
620
|
-
const
|
621
|
-
const
|
622
|
-
const
|
755
|
+
let focusPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
756
|
+
const countRows = this.tableProps.countRows();
|
757
|
+
const countCols = this.tableProps.countCols();
|
758
|
+
const countRowHeaders = this.tableProps.countRowHeaders();
|
759
|
+
const rowHeaderLastIndex = countRowHeaders === 0 ? 0 : -countRowHeaders;
|
760
|
+
const fromCoords = new _src.CellCoords(startRow, rowHeaderLastIndex);
|
761
|
+
const toCoords = new _src.CellCoords(endRow, countCols - 1);
|
762
|
+
const isValid = new _src.CellRange(fromCoords, fromCoords, toCoords).isValid({
|
763
|
+
countRows,
|
764
|
+
countCols,
|
765
|
+
countRowHeaders,
|
766
|
+
countColHeaders: 0
|
767
|
+
});
|
623
768
|
if (isValid) {
|
624
|
-
|
625
|
-
|
769
|
+
const fromColumn = countRowHeaders === 0 ? 0 : (0, _number.clamp)(focusPosition, rowHeaderLastIndex, -1);
|
770
|
+
const toColumn = countCols - 1;
|
771
|
+
const from = this.tableProps.createCellCoords(startRow, fromColumn);
|
772
|
+
const to = this.tableProps.createCellCoords(endRow, toColumn);
|
773
|
+
const highlight = this.tableProps.createCellCoords(startRow, (0, _number.clamp)(focusPosition, rowHeaderLastIndex, countCols - 1));
|
774
|
+
this.runLocalHooks('beforeSelectRows', from, to, highlight);
|
775
|
+
|
776
|
+
// disallow modifying column axis for that hooks
|
777
|
+
from.col = fromColumn;
|
778
|
+
to.col = toColumn;
|
779
|
+
this.setRangeStartOnly(from, void 0, highlight);
|
780
|
+
this.selectedByRowHeader.add(this.getLayerLevel());
|
781
|
+
this.setRangeEnd(to);
|
782
|
+
this.runLocalHooks('afterSelectRows', from, to, highlight);
|
626
783
|
this.finish();
|
627
784
|
}
|
628
785
|
return isValid;
|
@@ -639,19 +796,31 @@ class Selection {
|
|
639
796
|
if (!this.isSelected()) {
|
640
797
|
return;
|
641
798
|
}
|
642
|
-
const
|
799
|
+
const focusHighlight = this.highlight.getFocus();
|
643
800
|
const currentLayer = this.getLayerLevel();
|
644
|
-
|
801
|
+
focusHighlight.commit().syncWith(this.selectedRange.current());
|
645
802
|
|
646
803
|
// Rewriting rendered ranges going through all layers.
|
647
804
|
for (let layerLevel = 0; layerLevel < this.selectedRange.size(); layerLevel += 1) {
|
648
805
|
this.highlight.useLayerLevel(layerLevel);
|
649
|
-
const areaHighlight = this.highlight.
|
650
|
-
const
|
651
|
-
const
|
806
|
+
const areaHighlight = this.highlight.createArea();
|
807
|
+
const areaLayeredHighlight = this.highlight.createLayeredArea();
|
808
|
+
const rowHeaderHighlight = this.highlight.createRowHeader();
|
809
|
+
const columnHeaderHighlight = this.highlight.createColumnHeader();
|
810
|
+
const activeRowHeaderHighlight = this.highlight.createActiveRowHeader();
|
811
|
+
const activeColumnHeaderHighlight = this.highlight.createActiveColumnHeader();
|
812
|
+
const activeCornerHeaderHighlight = this.highlight.createActiveCornerHeader();
|
813
|
+
const rowHighlight = this.highlight.createRowHighlight();
|
814
|
+
const columnHighlight = this.highlight.createColumnHighlight();
|
652
815
|
areaHighlight.commit();
|
653
|
-
|
654
|
-
|
816
|
+
areaLayeredHighlight.commit();
|
817
|
+
rowHeaderHighlight.commit();
|
818
|
+
columnHeaderHighlight.commit();
|
819
|
+
activeRowHeaderHighlight.commit();
|
820
|
+
activeColumnHeaderHighlight.commit();
|
821
|
+
activeCornerHeaderHighlight.commit();
|
822
|
+
rowHighlight.commit();
|
823
|
+
columnHighlight.commit();
|
655
824
|
}
|
656
825
|
|
657
826
|
// Reverting starting layer for the Highlight.
|