handsontable 0.0.0-next-9059914-20231025 → 0.0.0-next-cecf979-20231026
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.d.ts +1 -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/core.js
CHANGED
@@ -12,6 +12,7 @@ var _browser = require("./helpers/browser");
|
|
12
12
|
var _editorManager = _interopRequireDefault(require("./editorManager"));
|
13
13
|
var _eventManager = _interopRequireDefault(require("./eventManager"));
|
14
14
|
var _object = require("./helpers/object");
|
15
|
+
var _focusManager = require("./focusManager");
|
15
16
|
var _array = require("./helpers/array");
|
16
17
|
var _parseTable = require("./utils/parseTable");
|
17
18
|
var _registry = require("./plugins/registry");
|
@@ -31,12 +32,22 @@ var _registry5 = require("./i18n/registry");
|
|
31
32
|
var _utils = require("./i18n/utils");
|
32
33
|
var _selection = require("./selection");
|
33
34
|
var _dataMap = require("./dataMap");
|
35
|
+
var _index3 = require("./core/index");
|
34
36
|
var _uniqueMap = require("./utils/dataStructures/uniqueMap");
|
35
37
|
var _shortcuts = require("./shortcuts");
|
38
|
+
var _shortcutContexts = require("./shortcutContexts");
|
36
39
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
37
|
-
const SHORTCUTS_GROUP = 'gridDefault';
|
38
40
|
let activeGuid = null;
|
39
41
|
|
42
|
+
/**
|
43
|
+
* Keeps the collection of the all Handsontable instances created on the same page. The
|
44
|
+
* list is then used to trigger the "afterUnlisten" hook when the "listen()" method was
|
45
|
+
* called on another instance.
|
46
|
+
*
|
47
|
+
* @type {Map<string, Core>}
|
48
|
+
*/
|
49
|
+
const foreignHotInstances = new Map();
|
50
|
+
|
40
51
|
/**
|
41
52
|
* A set of deprecated feature names.
|
42
53
|
*
|
@@ -96,7 +107,8 @@ const deprecationWarns = new Set();
|
|
96
107
|
* @param {boolean} [rootInstanceSymbol=false] Indicates if the instance is root of all later instances created.
|
97
108
|
*/
|
98
109
|
function Core(rootElement, userSettings) {
|
99
|
-
var _userSettings$layoutD
|
110
|
+
var _userSettings$layoutD,
|
111
|
+
_this = this;
|
100
112
|
let rootInstanceSymbol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
101
113
|
let preventScrollingToCell = false;
|
102
114
|
let instance = this;
|
@@ -105,6 +117,7 @@ function Core(rootElement, userSettings) {
|
|
105
117
|
let dataSource;
|
106
118
|
let grid;
|
107
119
|
let editorManager;
|
120
|
+
let focusManager;
|
108
121
|
let firstRun = true;
|
109
122
|
if ((0, _rootInstance.hasValidParameter)(rootInstanceSymbol)) {
|
110
123
|
(0, _rootInstance.registerAsRootInstance)(this);
|
@@ -213,6 +226,8 @@ function Core(rootElement, userSettings) {
|
|
213
226
|
}
|
214
227
|
this.guid = `ht_${(0, _string.randomString)()}`; // this is the namespace for global events
|
215
228
|
|
229
|
+
foreignHotInstances.set(this.guid, this);
|
230
|
+
|
216
231
|
/**
|
217
232
|
* Instance of index mapper which is responsible for managing the column indexes.
|
218
233
|
*
|
@@ -261,14 +276,16 @@ function Core(rootElement, userSettings) {
|
|
261
276
|
};
|
262
277
|
|
263
278
|
let selection = new _selection.Selection(tableMeta, {
|
264
|
-
rowIndexMapper:
|
265
|
-
columnIndexMapper:
|
279
|
+
rowIndexMapper: instance.rowIndexMapper,
|
280
|
+
columnIndexMapper: instance.columnIndexMapper,
|
266
281
|
countCols: () => instance.countCols(),
|
267
282
|
countRows: () => instance.countRows(),
|
268
283
|
propToCol: prop => datamap.propToCol(prop),
|
269
284
|
isEditorOpened: () => instance.getActiveEditor() ? instance.getActiveEditor().isOpened() : false,
|
270
|
-
|
271
|
-
|
285
|
+
countRenderableColumns: () => this.view.countRenderableColumns(),
|
286
|
+
countRenderableRows: () => this.view.countRenderableRows(),
|
287
|
+
countRowHeaders: () => this.countRowHeaders(),
|
288
|
+
countColHeaders: () => this.countColHeaders(),
|
272
289
|
getShortcutManager: () => instance.getShortcutManager(),
|
273
290
|
createCellCoords: (row, column) => instance._createCellCoords(row, column),
|
274
291
|
createCellRange: (highlight, from, to) => instance._createCellRange(highlight, from, to),
|
@@ -287,6 +304,9 @@ function Core(rootElement, userSettings) {
|
|
287
304
|
};
|
288
305
|
this.columnIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);
|
289
306
|
this.rowIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);
|
307
|
+
this.selection.addLocalHook('beforeHighlightSet', () => {
|
308
|
+
this.runHooks('beforeSelectionHighlightSet');
|
309
|
+
});
|
290
310
|
this.selection.addLocalHook('beforeSetRangeStart', cellCoords => {
|
291
311
|
this.runHooks('beforeSetRangeStart', cellCoords);
|
292
312
|
});
|
@@ -295,12 +315,6 @@ function Core(rootElement, userSettings) {
|
|
295
315
|
});
|
296
316
|
this.selection.addLocalHook('beforeSetRangeEnd', cellCoords => {
|
297
317
|
this.runHooks('beforeSetRangeEnd', cellCoords);
|
298
|
-
if (cellCoords.row < 0) {
|
299
|
-
cellCoords.row = this.view._wt.wtTable.getFirstVisibleRow();
|
300
|
-
}
|
301
|
-
if (cellCoords.col < 0) {
|
302
|
-
cellCoords.col = this.view._wt.wtTable.getFirstVisibleColumn();
|
303
|
-
}
|
304
318
|
});
|
305
319
|
this.selection.addLocalHook('afterSetRangeEnd', cellCoords => {
|
306
320
|
const preventScrolling = (0, _object.createObjectPropListener)(false);
|
@@ -313,8 +327,6 @@ function Core(rootElement, userSettings) {
|
|
313
327
|
this.runHooks('afterSelection', from.row, from.col, to.row, to.col, preventScrolling, selectionLayerLevel);
|
314
328
|
this.runHooks('afterSelectionByProp', from.row, instance.colToProp(from.col), to.row, instance.colToProp(to.col), preventScrolling, selectionLayerLevel); // eslint-disable-line max-len
|
315
329
|
|
316
|
-
const isSelectedByAnyHeader = this.selection.isSelectedByAnyHeader();
|
317
|
-
const currentSelectedRange = this.selection.selectedRange.current();
|
318
330
|
let scrollToCell = true;
|
319
331
|
if (preventScrollingToCell) {
|
320
332
|
scrollToCell = false;
|
@@ -322,19 +334,42 @@ function Core(rootElement, userSettings) {
|
|
322
334
|
if (preventScrolling.isTouched()) {
|
323
335
|
scrollToCell = !preventScrolling.value;
|
324
336
|
}
|
337
|
+
const currentSelectedRange = this.selection.selectedRange.current();
|
338
|
+
const isSelectedByAnyHeader = this.selection.isSelectedByAnyHeader();
|
325
339
|
const isSelectedByRowHeader = this.selection.isSelectedByRowHeader();
|
326
340
|
const isSelectedByColumnHeader = this.selection.isSelectedByColumnHeader();
|
327
341
|
if (scrollToCell !== false) {
|
328
342
|
if (!isSelectedByAnyHeader) {
|
329
343
|
if (currentSelectedRange && !this.selection.isMultiple()) {
|
330
|
-
|
344
|
+
const {
|
345
|
+
row,
|
346
|
+
col
|
347
|
+
} = currentSelectedRange.from;
|
348
|
+
if (row < 0 && col >= 0) {
|
349
|
+
this.scrollViewportTo({
|
350
|
+
col
|
351
|
+
});
|
352
|
+
} else if (col < 0 && row >= 0) {
|
353
|
+
this.scrollViewportTo({
|
354
|
+
row
|
355
|
+
});
|
356
|
+
} else {
|
357
|
+
this.scrollViewportTo({
|
358
|
+
row,
|
359
|
+
col
|
360
|
+
});
|
361
|
+
}
|
331
362
|
} else {
|
332
|
-
this.
|
363
|
+
this.scrollViewportTo(cellCoords.toObject());
|
333
364
|
}
|
334
365
|
} else if (isSelectedByRowHeader) {
|
335
|
-
this.
|
366
|
+
this.scrollViewportTo({
|
367
|
+
row: cellCoords.row
|
368
|
+
});
|
336
369
|
} else if (isSelectedByColumnHeader) {
|
337
|
-
this.
|
370
|
+
this.scrollViewportTo({
|
371
|
+
col: cellCoords.col
|
372
|
+
});
|
338
373
|
}
|
339
374
|
}
|
340
375
|
|
@@ -369,6 +404,30 @@ function Core(rootElement, userSettings) {
|
|
369
404
|
isMultiple.value = changedIsMultiple;
|
370
405
|
}
|
371
406
|
});
|
407
|
+
this.selection.addLocalHook('beforeSelectColumns', function () {
|
408
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
409
|
+
args[_key] = arguments[_key];
|
410
|
+
}
|
411
|
+
return _this.runHooks('beforeSelectColumns', ...args);
|
412
|
+
});
|
413
|
+
this.selection.addLocalHook('afterSelectColumns', function () {
|
414
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
415
|
+
args[_key2] = arguments[_key2];
|
416
|
+
}
|
417
|
+
return _this.runHooks('afterSelectColumns', ...args);
|
418
|
+
});
|
419
|
+
this.selection.addLocalHook('beforeSelectRows', function () {
|
420
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
421
|
+
args[_key3] = arguments[_key3];
|
422
|
+
}
|
423
|
+
return _this.runHooks('beforeSelectRows', ...args);
|
424
|
+
});
|
425
|
+
this.selection.addLocalHook('afterSelectRows', function () {
|
426
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
427
|
+
args[_key4] = arguments[_key4];
|
428
|
+
}
|
429
|
+
return _this.runHooks('afterSelectRows', ...args);
|
430
|
+
});
|
372
431
|
this.selection.addLocalHook('beforeModifyTransformStart', cellCoordsDelta => {
|
373
432
|
this.runHooks('modifyTransformStart', cellCoordsDelta);
|
374
433
|
});
|
@@ -474,7 +533,9 @@ function Core(rootElement, userSettings) {
|
|
474
533
|
const currentFromRow = currentFromRange === null || currentFromRange === void 0 ? void 0 : currentFromRange.row;
|
475
534
|
const startVisualRowIndex = instance.toVisualRow(startRowPhysicalIndex);
|
476
535
|
if (selection.isSelectedByCorner()) {
|
477
|
-
|
536
|
+
selection.selectAll(true, true, {
|
537
|
+
disableHeadersHighlight: true
|
538
|
+
});
|
478
539
|
} else if ((0, _mixed.isDefined)(currentFromRow) && currentFromRow >= startVisualRowIndex) {
|
479
540
|
// Moving the selection (if it exists) downward – it should be applied to the "old" row.
|
480
541
|
// TODO: The logic here should be handled by selection module.
|
@@ -528,7 +589,9 @@ function Core(rootElement, userSettings) {
|
|
528
589
|
const currentFromColumn = currentFromRange === null || currentFromRange === void 0 ? void 0 : currentFromRange.col;
|
529
590
|
const startVisualColumnIndex = instance.toVisualColumn(startColumnPhysicalIndex);
|
530
591
|
if (selection.isSelectedByCorner()) {
|
531
|
-
|
592
|
+
selection.selectAll(true, true, {
|
593
|
+
disableHeadersHighlight: true
|
594
|
+
});
|
532
595
|
} else if ((0, _mixed.isDefined)(currentFromColumn) && currentFromColumn >= startVisualColumnIndex) {
|
533
596
|
// Moving the selection (if it exists) rightward – it should be applied to the "old" column.
|
534
597
|
// TODO: The logic here should be handled by selection module.
|
@@ -1018,6 +1081,10 @@ function Core(rootElement, userSettings) {
|
|
1018
1081
|
this.updateSettings(tableMeta, true);
|
1019
1082
|
this.view = new _tableView.default(this);
|
1020
1083
|
editorManager = _editorManager.default.getInstance(instance, tableMeta, selection);
|
1084
|
+
focusManager = new _focusManager.FocusManager(instance);
|
1085
|
+
if ((0, _rootInstance.isRootInstance)(this)) {
|
1086
|
+
(0, _index3.installFocusCatcher)(instance);
|
1087
|
+
}
|
1021
1088
|
instance.runHooks('init');
|
1022
1089
|
this.forceFullRender = true; // used when data was changed
|
1023
1090
|
this.view.render();
|
@@ -1431,6 +1498,11 @@ function Core(rootElement, userSettings) {
|
|
1431
1498
|
*/
|
1432
1499
|
this.listen = function () {
|
1433
1500
|
if (instance && !instance.isListening()) {
|
1501
|
+
foreignHotInstances.forEach(foreignHot => {
|
1502
|
+
if (instance !== foreignHot) {
|
1503
|
+
foreignHot.unlisten();
|
1504
|
+
}
|
1505
|
+
});
|
1434
1506
|
activeGuid = instance.guid;
|
1435
1507
|
instance.runHooks('afterListen');
|
1436
1508
|
}
|
@@ -1515,8 +1587,8 @@ function Core(rootElement, userSettings) {
|
|
1515
1587
|
* @returns {Array} Returns removed portion of columns.
|
1516
1588
|
*/
|
1517
1589
|
this.spliceCol = function (column, index, amount) {
|
1518
|
-
for (var
|
1519
|
-
elements[
|
1590
|
+
for (var _len5 = arguments.length, elements = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
|
1591
|
+
elements[_key5 - 3] = arguments[_key5];
|
1520
1592
|
}
|
1521
1593
|
return datamap.spliceCol(column, index, amount, ...elements);
|
1522
1594
|
};
|
@@ -1533,8 +1605,8 @@ function Core(rootElement, userSettings) {
|
|
1533
1605
|
* @returns {Array} Returns removed portion of rows.
|
1534
1606
|
*/
|
1535
1607
|
this.spliceRow = function (row, index, amount) {
|
1536
|
-
for (var
|
1537
|
-
elements[
|
1608
|
+
for (var _len6 = arguments.length, elements = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
|
1609
|
+
elements[_key6 - 3] = arguments[_key6];
|
1538
1610
|
}
|
1539
1611
|
return datamap.spliceRow(row, index, amount, ...elements);
|
1540
1612
|
};
|
@@ -1631,6 +1703,9 @@ function Core(rootElement, userSettings) {
|
|
1631
1703
|
}
|
1632
1704
|
const changes = [];
|
1633
1705
|
(0, _array.arrayEach)(selection.getSelectedRange(), cellRange => {
|
1706
|
+
if (cellRange.isSingleHeader()) {
|
1707
|
+
return;
|
1708
|
+
}
|
1634
1709
|
const topStart = cellRange.getTopStartCorner();
|
1635
1710
|
const bottomEnd = cellRange.getBottomEndCorner();
|
1636
1711
|
(0, _number.rangeEach)(topStart.row, bottomEnd.row, row => {
|
@@ -2928,8 +3003,8 @@ function Core(rootElement, userSettings) {
|
|
2928
3003
|
*/
|
2929
3004
|
this.spliceCellsMeta = function (visualIndex) {
|
2930
3005
|
let deleteAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
2931
|
-
for (var
|
2932
|
-
cellMetaRows[
|
3006
|
+
for (var _len7 = arguments.length, cellMetaRows = new Array(_len7 > 2 ? _len7 - 2 : 0), _key7 = 2; _key7 < _len7; _key7++) {
|
3007
|
+
cellMetaRows[_key7 - 2] = arguments[_key7];
|
2933
3008
|
}
|
2934
3009
|
if (cellMetaRows.length > 0 && !Array.isArray(cellMetaRows[0])) {
|
2935
3010
|
throw new Error('The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.');
|
@@ -3620,6 +3695,30 @@ function Core(rootElement, userSettings) {
|
|
3620
3695
|
return instance.view._wt.drawn ? instance.view._wt.wtTable.getVisibleColumnsCount() : -1;
|
3621
3696
|
};
|
3622
3697
|
|
3698
|
+
/**
|
3699
|
+
* Returns the number of rendered row headers.
|
3700
|
+
*
|
3701
|
+
* @since 14.0.0
|
3702
|
+
* @memberof Core#
|
3703
|
+
* @function countRowHeaders
|
3704
|
+
* @returns {number} Number of row headers.
|
3705
|
+
*/
|
3706
|
+
this.countRowHeaders = function () {
|
3707
|
+
return this.view.getRowHeadersCount();
|
3708
|
+
};
|
3709
|
+
|
3710
|
+
/**
|
3711
|
+
* Returns the number of rendered column headers.
|
3712
|
+
*
|
3713
|
+
* @since 14.0.0
|
3714
|
+
* @memberof Core#
|
3715
|
+
* @function countColHeaders
|
3716
|
+
* @returns {number} Number of column headers.
|
3717
|
+
*/
|
3718
|
+
this.countColHeaders = function () {
|
3719
|
+
return this.view.getColumnHeadersCount();
|
3720
|
+
};
|
3721
|
+
|
3623
3722
|
/**
|
3624
3723
|
* Returns the number of empty rows. If the optional ending parameter is `true`, returns the
|
3625
3724
|
* number of empty rows at the bottom of the table.
|
@@ -3824,6 +3923,10 @@ function Core(rootElement, userSettings) {
|
|
3824
3923
|
* hot.selectColumns('id');
|
3825
3924
|
* // Select range of columns using visual indexes.
|
3826
3925
|
* hot.selectColumns(1, 4);
|
3926
|
+
* // Select range of columns using visual indexes and mark the first header as highlighted.
|
3927
|
+
* hot.selectColumns(1, 2, -1);
|
3928
|
+
* // Select range of columns using visual indexes and mark the second cell as highlighted.
|
3929
|
+
* hot.selectColumns(2, 1, 1);
|
3827
3930
|
* // Select range of columns using column properties.
|
3828
3931
|
* hot.selectColumns('id', 'last_name');
|
3829
3932
|
* ```
|
@@ -3834,11 +3937,15 @@ function Core(rootElement, userSettings) {
|
|
3834
3937
|
* @param {number} startColumn The visual column index from which the selection starts.
|
3835
3938
|
* @param {number} [endColumn=startColumn] The visual column index to which the selection finishes. If `endColumn`
|
3836
3939
|
* is not defined the column defined by `startColumn` will be selected.
|
3940
|
+
* @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
|
3941
|
+
* The value can take visual row index from -N to N, where negative values
|
3942
|
+
* point to the headers and positive values point to the cell range.
|
3837
3943
|
* @returns {boolean} `true` if selection was successful, `false` otherwise.
|
3838
3944
|
*/
|
3839
3945
|
this.selectColumns = function (startColumn) {
|
3840
3946
|
let endColumn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startColumn;
|
3841
|
-
|
3947
|
+
let focusPosition = arguments.length > 2 ? arguments[2] : undefined;
|
3948
|
+
return selection.selectColumns(startColumn, endColumn, focusPosition);
|
3842
3949
|
};
|
3843
3950
|
|
3844
3951
|
/**
|
@@ -3848,8 +3955,12 @@ function Core(rootElement, userSettings) {
|
|
3848
3955
|
* ```js
|
3849
3956
|
* // Select row using visual index.
|
3850
3957
|
* hot.selectRows(1);
|
3851
|
-
* //
|
3958
|
+
* // select a range of rows, using visual indexes.
|
3852
3959
|
* hot.selectRows(1, 4);
|
3960
|
+
* // select a range of rows, using visual indexes, and mark the header as highlighted.
|
3961
|
+
* hot.selectRows(1, 2, -1);
|
3962
|
+
* // Select range of rows using visual indexes and mark the second cell as highlighted.
|
3963
|
+
* hot.selectRows(2, 1, 1);
|
3853
3964
|
* ```
|
3854
3965
|
*
|
3855
3966
|
* @memberof Core#
|
@@ -3858,11 +3969,15 @@ function Core(rootElement, userSettings) {
|
|
3858
3969
|
* @param {number} startRow The visual row index from which the selection starts.
|
3859
3970
|
* @param {number} [endRow=startRow] The visual row index to which the selection finishes. If `endRow`
|
3860
3971
|
* is not defined the row defined by `startRow` will be selected.
|
3972
|
+
* @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
|
3973
|
+
* The value can take visual column index from -N to N, where negative values
|
3974
|
+
* point to the headers and positive values point to the cell range.
|
3861
3975
|
* @returns {boolean} `true` if selection was successful, `false` otherwise.
|
3862
3976
|
*/
|
3863
3977
|
this.selectRows = function (startRow) {
|
3864
3978
|
let endRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startRow;
|
3865
|
-
|
3979
|
+
let focusPosition = arguments.length > 2 ? arguments[2] : undefined;
|
3980
|
+
return selection.selectRows(startRow, endRow, focusPosition);
|
3866
3981
|
};
|
3867
3982
|
|
3868
3983
|
/**
|
@@ -3881,9 +3996,16 @@ function Core(rootElement, userSettings) {
|
|
3881
3996
|
* The previous selection is overwritten.
|
3882
3997
|
*
|
3883
3998
|
* ```js
|
3884
|
-
* // select all cells in the table, including all headers
|
3999
|
+
* // select all cells in the table, including all headers and the corner cell
|
3885
4000
|
* hot.selectAll();
|
3886
4001
|
*
|
4002
|
+
* // select all cells in the table, including row headers but excluding the corner cell
|
4003
|
+
* hot.selectAll(true, false);
|
4004
|
+
*
|
4005
|
+
* // select all cells in the table, including all headers and the corner cell, but move the focus
|
4006
|
+
* // highlight to position -2, -1
|
4007
|
+
* hot.selectAll(-2, -1);
|
4008
|
+
*
|
3887
4009
|
* // select all cells in the table, without headers
|
3888
4010
|
* hot.selectAll(false);
|
3889
4011
|
* ```
|
@@ -3891,15 +4013,25 @@ function Core(rootElement, userSettings) {
|
|
3891
4013
|
* @since 0.38.2
|
3892
4014
|
* @memberof Core#
|
3893
4015
|
* @function selectAll
|
3894
|
-
* @param {boolean} [
|
3895
|
-
* `false
|
4016
|
+
* @param {boolean} [includeRowHeaders=false] `true` If the selection should include the row headers,
|
4017
|
+
* `false` otherwise.
|
4018
|
+
* @param {boolean} [includeColumnHeaders=false] `true` If the selection should include the column
|
4019
|
+
* headers, `false` otherwise.
|
4020
|
+
*
|
4021
|
+
* @param {object} [options] Additional object with options.
|
4022
|
+
* @param {{row: number, col: number} | boolean} [options.focusPosition] The argument allows changing the cell/header
|
4023
|
+
* focus position. The value takes an object with a `row` and `col` properties from -N to N, where
|
4024
|
+
* negative values point to the headers and positive values point to the cell range. If `false`, the focus
|
4025
|
+
* position won't be changed.
|
4026
|
+
* @param {boolean} [options.disableHeadersHighlight] If `true`, disables highlighting the headers even when
|
4027
|
+
* the logical coordinates points on them.
|
3896
4028
|
*/
|
3897
4029
|
this.selectAll = function () {
|
3898
|
-
let
|
3899
|
-
|
3900
|
-
|
4030
|
+
let includeRowHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
4031
|
+
let includeColumnHeaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : includeRowHeaders;
|
4032
|
+
let options = arguments.length > 2 ? arguments[2] : undefined;
|
3901
4033
|
preventScrollingToCell = true;
|
3902
|
-
selection.selectAll(includeRowHeaders, includeColumnHeaders);
|
4034
|
+
selection.selectAll(includeRowHeaders, includeColumnHeaders, options);
|
3903
4035
|
preventScrollingToCell = false;
|
3904
4036
|
};
|
3905
4037
|
const getIndexToScroll = (indexMapper, visualIndex) => {
|
@@ -3908,55 +4040,117 @@ function Core(rootElement, userSettings) {
|
|
3908
4040
|
};
|
3909
4041
|
|
3910
4042
|
/**
|
3911
|
-
* Scroll viewport to coordinates specified by the `row` and `
|
4043
|
+
* Scroll viewport to coordinates specified by the `row` and/or `col` object properties.
|
4044
|
+
*
|
4045
|
+
* ```js
|
4046
|
+
* // scroll the viewport to the visual row index (leave the horizontal scroll untouched)
|
4047
|
+
* hot.scrollViewportTo({ row: 50 });
|
4048
|
+
*
|
4049
|
+
* // scroll the viewport to the passed coordinates so that the cell at 50, 50 will be snapped to
|
4050
|
+
* // the bottom-end table's edge.
|
4051
|
+
* hot.scrollViewportTo({
|
4052
|
+
* row: 50,
|
4053
|
+
* col: 50,
|
4054
|
+
* verticalSnap: 'bottom',
|
4055
|
+
* horizontalSnap: 'end',
|
4056
|
+
* });
|
4057
|
+
* ```
|
3912
4058
|
*
|
3913
4059
|
* @memberof Core#
|
3914
4060
|
* @function scrollViewportTo
|
3915
|
-
* @param {
|
3916
|
-
*
|
3917
|
-
* @param {number} [
|
3918
|
-
*
|
3919
|
-
*
|
3920
|
-
*
|
3921
|
-
*
|
3922
|
-
*
|
3923
|
-
*
|
4061
|
+
* @param {object} options A dictionary containing the following parameters:
|
4062
|
+
* @param {number} [options.row] Specifies the number of visual rows along the Y axis to scroll the viewport.
|
4063
|
+
* @param {number} [options.col] Specifies the number of visual columns along the X axis to scroll the viewport.
|
4064
|
+
* @param {'top' | 'bottom'} [options.verticalSnap] Determines to which edge of the table the viewport will be scrolled based on the passed coordinates.
|
4065
|
+
* This option is a string which must take one of the following values:
|
4066
|
+
* - `top`: The viewport will be scrolled to a row in such a way that it will be positioned on the top of the viewport;
|
4067
|
+
* - `bottom`: The viewport will be scrolled to a row in such a way that it will be positioned on the bottom of the viewport;
|
4068
|
+
* - If the property is not defined the vertical auto-snapping is enabled. Depending on where the viewport is scrolled from, a row will
|
4069
|
+
* be positioned at the top or bottom of the viewport.
|
4070
|
+
* @param {'start' | 'end'} [options.horizontalSnap] Determines to which edge of the table the viewport will be scrolled based on the passed coordinates.
|
4071
|
+
* This option is a string which must take one of the following values:
|
4072
|
+
* - `start`: The viewport will be scrolled to a column in such a way that it will be positioned on the start (left edge or right, if the layout direction is set to `rtl`) of the viewport;
|
4073
|
+
* - `end`: The viewport will be scrolled to a column in such a way that it will be positioned on the end (right edge or left, if the layout direction is set to `rtl`) of the viewport;
|
4074
|
+
* - If the property is not defined the horizontal auto-snapping is enabled. Depending on where the viewport is scrolled from, a column will
|
4075
|
+
* be positioned at the start or end of the viewport.
|
4076
|
+
* @param {boolean} [options.considerHiddenIndexes=true] If `true`, we handle visual indexes, otherwise we handle only indexes which
|
3924
4077
|
* may be rendered when they are in the viewport (we don't consider hidden indexes as they aren't rendered).
|
3925
|
-
* @returns {boolean} `true` if
|
3926
|
-
*/
|
3927
|
-
this.scrollViewportTo = function (
|
3928
|
-
let
|
3929
|
-
|
3930
|
-
|
3931
|
-
|
3932
|
-
|
4078
|
+
* @returns {boolean} `true` if viewport was scrolled, `false` otherwise.
|
4079
|
+
*/
|
4080
|
+
this.scrollViewportTo = function () {
|
4081
|
+
let {
|
4082
|
+
row,
|
4083
|
+
col,
|
4084
|
+
verticalSnap,
|
4085
|
+
horizontalSnap,
|
4086
|
+
considerHiddenIndexes
|
4087
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4088
|
+
let snapToTop;
|
4089
|
+
let snapToBottom;
|
4090
|
+
let snapToInlineStart;
|
4091
|
+
let snapToInlineEnd;
|
4092
|
+
if (verticalSnap !== undefined) {
|
4093
|
+
snapToTop = verticalSnap === 'top';
|
4094
|
+
snapToBottom = !snapToTop;
|
4095
|
+
}
|
4096
|
+
if (horizontalSnap !== undefined) {
|
4097
|
+
snapToInlineStart = horizontalSnap === 'start';
|
4098
|
+
snapToInlineEnd = !snapToInlineStart;
|
4099
|
+
}
|
3933
4100
|
let renderableRow = row;
|
3934
|
-
let renderableColumn =
|
3935
|
-
if (considerHiddenIndexes) {
|
3936
|
-
const
|
3937
|
-
const
|
3938
|
-
const visualRowToScroll =
|
3939
|
-
const visualColumnToScroll =
|
4101
|
+
let renderableColumn = col;
|
4102
|
+
if (considerHiddenIndexes === undefined || considerHiddenIndexes) {
|
4103
|
+
const isValidRowGrid = Number.isInteger(row) && row >= 0;
|
4104
|
+
const isValidColumnGrid = Number.isInteger(col) && col >= 0;
|
4105
|
+
const visualRowToScroll = isValidRowGrid ? getIndexToScroll(this.rowIndexMapper, row) : undefined;
|
4106
|
+
const visualColumnToScroll = isValidColumnGrid ? getIndexToScroll(this.columnIndexMapper, col) : undefined;
|
3940
4107
|
if (visualRowToScroll === null || visualColumnToScroll === null) {
|
3941
4108
|
return false;
|
3942
4109
|
}
|
3943
|
-
renderableRow =
|
3944
|
-
renderableColumn =
|
4110
|
+
renderableRow = isValidRowGrid ? instance.rowIndexMapper.getRenderableFromVisualIndex(visualRowToScroll) : row;
|
4111
|
+
renderableColumn = isValidColumnGrid ? instance.columnIndexMapper.getRenderableFromVisualIndex(visualColumnToScroll) : col;
|
3945
4112
|
}
|
3946
4113
|
const isRowInteger = Number.isInteger(renderableRow);
|
3947
4114
|
const isColumnInteger = Number.isInteger(renderableColumn);
|
3948
|
-
if (isRowInteger && isColumnInteger) {
|
3949
|
-
return instance.view.scrollViewport(instance._createCellCoords(renderableRow, renderableColumn), snapToTop,
|
4115
|
+
if (isRowInteger && renderableRow >= 0 && isColumnInteger && renderableColumn >= 0) {
|
4116
|
+
return instance.view.scrollViewport(instance._createCellCoords(renderableRow, renderableColumn), snapToTop, snapToInlineEnd, snapToBottom, snapToInlineStart);
|
3950
4117
|
}
|
3951
|
-
if (isRowInteger && isColumnInteger
|
4118
|
+
if (isRowInteger && renderableRow >= 0 && (isColumnInteger && renderableColumn < 0 || !isColumnInteger)) {
|
3952
4119
|
return instance.view.scrollViewportVertically(renderableRow, snapToTop, snapToBottom);
|
3953
4120
|
}
|
3954
|
-
if (isColumnInteger && isRowInteger
|
3955
|
-
return instance.view.scrollViewportHorizontally(renderableColumn,
|
4121
|
+
if (isColumnInteger && renderableColumn >= 0 && (isRowInteger && renderableRow < 0 || !isRowInteger)) {
|
4122
|
+
return instance.view.scrollViewportHorizontally(renderableColumn, snapToInlineEnd, snapToInlineStart);
|
3956
4123
|
}
|
3957
4124
|
return false;
|
3958
4125
|
};
|
3959
4126
|
|
4127
|
+
/**
|
4128
|
+
* Scrolls the viewport to coordinates specified by the currently focused cell.
|
4129
|
+
*
|
4130
|
+
* @since 14.0.0
|
4131
|
+
* @memberof Core#
|
4132
|
+
* @fires Hooks#afterScroll
|
4133
|
+
* @function scrollToFocusedCell
|
4134
|
+
* @param {Function} callback The callback function to call after the viewport is scrolled.
|
4135
|
+
*/
|
4136
|
+
this.scrollToFocusedCell = function () {
|
4137
|
+
let callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : () => {};
|
4138
|
+
if (!this.selection.isSelected()) {
|
4139
|
+
return;
|
4140
|
+
}
|
4141
|
+
this.addHookOnce('afterScroll', callback);
|
4142
|
+
const {
|
4143
|
+
highlight
|
4144
|
+
} = this.getSelectedRangeLast();
|
4145
|
+
const isScrolled = this.scrollViewportTo(highlight.toObject());
|
4146
|
+
if (isScrolled) {
|
4147
|
+
this.view.render();
|
4148
|
+
} else {
|
4149
|
+
this.removeHook('afterScroll', callback);
|
4150
|
+
this._registerImmediate(() => callback());
|
4151
|
+
}
|
4152
|
+
};
|
4153
|
+
|
3960
4154
|
/**
|
3961
4155
|
* Removes the table from the DOM and destroys the instance of the Handsontable.
|
3962
4156
|
*
|
@@ -3977,6 +4171,7 @@ function Core(rootElement, userSettings) {
|
|
3977
4171
|
dataSource = null;
|
3978
4172
|
this.getShortcutManager().destroy();
|
3979
4173
|
metaManager.clearCache();
|
4174
|
+
foreignHotInstances.delete(this.guid);
|
3980
4175
|
if ((0, _rootInstance.isRootInstance)(instance)) {
|
3981
4176
|
const licenseInfo = this.rootDocument.querySelector('.hot-display-license-info');
|
3982
4177
|
if (licenseInfo) {
|
@@ -4300,6 +4495,16 @@ function Core(rootElement, userSettings) {
|
|
4300
4495
|
}
|
4301
4496
|
};
|
4302
4497
|
|
4498
|
+
/**
|
4499
|
+
* Gets the instance of the EditorManager.
|
4500
|
+
*
|
4501
|
+
* @private
|
4502
|
+
* @returns {EditorManager}
|
4503
|
+
*/
|
4504
|
+
this._getEditorManager = function () {
|
4505
|
+
return editorManager;
|
4506
|
+
};
|
4507
|
+
|
4303
4508
|
/**
|
4304
4509
|
* Check if currently it is RTL direction.
|
4305
4510
|
*
|
@@ -4370,270 +4575,23 @@ function Core(rootElement, userSettings) {
|
|
4370
4575
|
this.getShortcutManager = function () {
|
4371
4576
|
return shortcutManager;
|
4372
4577
|
};
|
4373
|
-
|
4374
|
-
|
4375
|
-
|
4376
|
-
|
4377
|
-
|
4378
|
-
|
4578
|
+
|
4579
|
+
/**
|
4580
|
+
* Return the Focus Manager responsible for managing the browser's focus in the table.
|
4581
|
+
*
|
4582
|
+
* @memberof Core#
|
4583
|
+
* @since 14.0.0
|
4584
|
+
* @function getFocusManager
|
4585
|
+
* @returns {FocusManager}
|
4586
|
+
*/
|
4587
|
+
this.getFocusManager = function () {
|
4588
|
+
return focusManager;
|
4379
4589
|
};
|
4380
|
-
shortcutManager.setActiveContextName('grid');
|
4381
|
-
gridContext.addShortcuts([{
|
4382
|
-
keys: [['Control/Meta', 'A']],
|
4383
|
-
callback: () => {
|
4384
|
-
instance.selectAll();
|
4385
|
-
}
|
4386
|
-
}, {
|
4387
|
-
keys: [['Control/Meta', 'Enter']],
|
4388
|
-
callback: () => {
|
4389
|
-
const selectedRange = instance.getSelectedRange();
|
4390
|
-
const {
|
4391
|
-
row: highlightRow,
|
4392
|
-
col: highlightColumn
|
4393
|
-
} = selectedRange[selectedRange.length - 1].highlight;
|
4394
|
-
const valueToPopulate = instance.getDataAtCell(highlightRow, highlightColumn);
|
4395
|
-
const cellValues = new Map();
|
4396
|
-
for (let i = 0; i < selectedRange.length; i++) {
|
4397
|
-
selectedRange[i].forAll((row, column) => {
|
4398
|
-
if (row >= 0 && column >= 0 && (row !== highlightRow || column !== highlightColumn)) {
|
4399
|
-
const {
|
4400
|
-
readOnly
|
4401
|
-
} = instance.getCellMeta(row, column);
|
4402
|
-
if (!readOnly) {
|
4403
|
-
cellValues.set(`${row}x${column}`, [row, column, valueToPopulate]);
|
4404
|
-
}
|
4405
|
-
}
|
4406
|
-
});
|
4407
|
-
}
|
4408
|
-
instance.setDataAtCell(Array.from(cellValues.values()));
|
4409
|
-
},
|
4410
|
-
runOnlyIf: () => instance.getSelectedRangeLast().getCellsCount() > 1
|
4411
|
-
}, {
|
4412
|
-
keys: [['ArrowUp']],
|
4413
|
-
callback: () => {
|
4414
|
-
selection.transformStart(-1, 0);
|
4415
|
-
}
|
4416
|
-
}, {
|
4417
|
-
keys: [['ArrowUp', 'Control/Meta']],
|
4418
|
-
captureCtrl: true,
|
4419
|
-
callback: () => {
|
4420
|
-
selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1), instance.getSelectedRangeLast().highlight.col));
|
4421
|
-
}
|
4422
|
-
}, {
|
4423
|
-
keys: [['ArrowUp', 'Shift']],
|
4424
|
-
callback: () => {
|
4425
|
-
selection.transformEnd(-1, 0);
|
4426
|
-
}
|
4427
|
-
}, {
|
4428
|
-
keys: [['ArrowUp', 'Shift', 'Control/Meta']],
|
4429
|
-
captureCtrl: true,
|
4430
|
-
callback: () => {
|
4431
|
-
const {
|
4432
|
-
from,
|
4433
|
-
to
|
4434
|
-
} = instance.getSelectedRangeLast();
|
4435
|
-
const row = instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1);
|
4436
|
-
selection.setRangeStart(from.clone());
|
4437
|
-
selection.setRangeEnd(instance._createCellCoords(row, to.col));
|
4438
|
-
},
|
4439
|
-
runOnlyIf: () => !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader())
|
4440
|
-
}, {
|
4441
|
-
keys: [['ArrowDown']],
|
4442
|
-
callback: () => {
|
4443
|
-
selection.transformStart(1, 0);
|
4444
|
-
}
|
4445
|
-
}, {
|
4446
|
-
keys: [['ArrowDown', 'Control/Meta']],
|
4447
|
-
captureCtrl: true,
|
4448
|
-
callback: () => {
|
4449
|
-
selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1), instance.getSelectedRangeLast().highlight.col));
|
4450
|
-
}
|
4451
|
-
}, {
|
4452
|
-
keys: [['ArrowDown', 'Shift']],
|
4453
|
-
callback: () => {
|
4454
|
-
selection.transformEnd(1, 0);
|
4455
|
-
}
|
4456
|
-
}, {
|
4457
|
-
keys: [['ArrowDown', 'Shift', 'Control/Meta']],
|
4458
|
-
captureCtrl: true,
|
4459
|
-
callback: () => {
|
4460
|
-
const {
|
4461
|
-
from,
|
4462
|
-
to
|
4463
|
-
} = instance.getSelectedRangeLast();
|
4464
|
-
const row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1);
|
4465
|
-
selection.setRangeStart(from.clone());
|
4466
|
-
selection.setRangeEnd(instance._createCellCoords(row, to.col));
|
4467
|
-
},
|
4468
|
-
runOnlyIf: () => !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader())
|
4469
|
-
}, {
|
4470
|
-
keys: [['ArrowLeft']],
|
4471
|
-
callback: () => {
|
4472
|
-
selection.transformStart(0, -1 * instance.getDirectionFactor());
|
4473
|
-
}
|
4474
|
-
}, {
|
4475
|
-
keys: [['ArrowLeft', 'Control/Meta']],
|
4476
|
-
captureCtrl: true,
|
4477
|
-
callback: () => {
|
4478
|
-
const row = instance.getSelectedRangeLast().highlight.row;
|
4479
|
-
const column = instance.columnIndexMapper.getNearestNotHiddenIndex(...(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
|
4480
|
-
selection.setRangeStart(instance._createCellCoords(row, column));
|
4481
|
-
}
|
4482
|
-
}, {
|
4483
|
-
keys: [['ArrowLeft', 'Shift']],
|
4484
|
-
callback: () => {
|
4485
|
-
selection.transformEnd(0, -1 * instance.getDirectionFactor());
|
4486
|
-
}
|
4487
|
-
}, {
|
4488
|
-
keys: [['ArrowLeft', 'Shift', 'Control/Meta']],
|
4489
|
-
captureCtrl: true,
|
4490
|
-
callback: () => {
|
4491
|
-
const {
|
4492
|
-
from,
|
4493
|
-
to
|
4494
|
-
} = instance.getSelectedRangeLast();
|
4495
|
-
const column = instance.columnIndexMapper.getNearestNotHiddenIndex(...(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
|
4496
|
-
selection.setRangeStart(from.clone());
|
4497
|
-
selection.setRangeEnd(instance._createCellCoords(to.row, column));
|
4498
|
-
},
|
4499
|
-
runOnlyIf: () => !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader())
|
4500
|
-
}, {
|
4501
|
-
keys: [['ArrowRight']],
|
4502
|
-
callback: () => {
|
4503
|
-
selection.transformStart(0, instance.getDirectionFactor());
|
4504
|
-
}
|
4505
|
-
}, {
|
4506
|
-
keys: [['ArrowRight', 'Control/Meta']],
|
4507
|
-
captureCtrl: true,
|
4508
|
-
callback: () => {
|
4509
|
-
const row = instance.getSelectedRangeLast().highlight.row;
|
4510
|
-
const column = instance.columnIndexMapper.getNearestNotHiddenIndex(...(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
|
4511
|
-
selection.setRangeStart(instance._createCellCoords(row, column));
|
4512
|
-
}
|
4513
|
-
}, {
|
4514
|
-
keys: [['ArrowRight', 'Shift']],
|
4515
|
-
callback: () => {
|
4516
|
-
selection.transformEnd(0, instance.getDirectionFactor());
|
4517
|
-
}
|
4518
|
-
}, {
|
4519
|
-
keys: [['ArrowRight', 'Shift', 'Control/Meta']],
|
4520
|
-
captureCtrl: true,
|
4521
|
-
callback: () => {
|
4522
|
-
const {
|
4523
|
-
from,
|
4524
|
-
to
|
4525
|
-
} = instance.getSelectedRangeLast();
|
4526
|
-
const column = instance.columnIndexMapper.getNearestNotHiddenIndex(...(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
|
4527
|
-
selection.setRangeStart(from.clone());
|
4528
|
-
selection.setRangeEnd(instance._createCellCoords(to.row, column));
|
4529
|
-
},
|
4530
|
-
runOnlyIf: () => !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader())
|
4531
|
-
}, {
|
4532
|
-
keys: [['Home']],
|
4533
|
-
captureCtrl: true,
|
4534
|
-
callback: () => {
|
4535
|
-
const fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
|
4536
|
-
const row = instance.getSelectedRangeLast().highlight.row;
|
4537
|
-
const column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
|
4538
|
-
selection.setRangeStart(instance._createCellCoords(row, column));
|
4539
|
-
},
|
4540
|
-
runOnlyIf: () => instance.view.isMainTableNotFullyCoveredByOverlays()
|
4541
|
-
}, {
|
4542
|
-
keys: [['Home', 'Shift']],
|
4543
|
-
callback: () => {
|
4544
|
-
selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(0, 1)));
|
4545
|
-
}
|
4546
|
-
}, {
|
4547
|
-
keys: [['Home', 'Control/Meta']],
|
4548
|
-
captureCtrl: true,
|
4549
|
-
callback: () => {
|
4550
|
-
const fixedRows = parseInt(instance.getSettings().fixedRowsTop, 10);
|
4551
|
-
const fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
|
4552
|
-
const row = instance.rowIndexMapper.getNearestNotHiddenIndex(fixedRows, 1);
|
4553
|
-
const column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
|
4554
|
-
selection.setRangeStart(instance._createCellCoords(row, column));
|
4555
|
-
},
|
4556
|
-
runOnlyIf: () => instance.view.isMainTableNotFullyCoveredByOverlays()
|
4557
|
-
}, {
|
4558
|
-
keys: [['End']],
|
4559
|
-
captureCtrl: true,
|
4560
|
-
callback: () => {
|
4561
|
-
selection.setRangeStart(instance._createCellCoords(instance.getSelectedRangeLast().highlight.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
|
4562
|
-
},
|
4563
|
-
runOnlyIf: () => instance.view.isMainTableNotFullyCoveredByOverlays()
|
4564
|
-
}, {
|
4565
|
-
keys: [['End', 'Shift']],
|
4566
|
-
callback: () => {
|
4567
|
-
selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
|
4568
|
-
}
|
4569
|
-
}, {
|
4570
|
-
keys: [['End', 'Control/Meta']],
|
4571
|
-
captureCtrl: true,
|
4572
|
-
callback: () => {
|
4573
|
-
const fixedRows = parseInt(instance.getSettings().fixedRowsBottom, 10);
|
4574
|
-
const row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - fixedRows - 1, -1);
|
4575
|
-
const column = instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1);
|
4576
|
-
selection.setRangeStart(instance._createCellCoords(row, column));
|
4577
|
-
},
|
4578
|
-
runOnlyIf: () => instance.view.isMainTableNotFullyCoveredByOverlays()
|
4579
|
-
}, {
|
4580
|
-
keys: [['PageUp']],
|
4581
|
-
callback: () => {
|
4582
|
-
selection.transformStart(-instance.countVisibleRows(), 0);
|
4583
|
-
}
|
4584
|
-
}, {
|
4585
|
-
keys: [['PageUp', 'Shift']],
|
4586
|
-
callback: () => {
|
4587
|
-
const {
|
4588
|
-
to
|
4589
|
-
} = instance.getSelectedRangeLast();
|
4590
|
-
const nextRowIndexToSelect = Math.max(to.row - instance.countVisibleRows(), 0);
|
4591
|
-
const row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, 1);
|
4592
|
-
if (row !== null) {
|
4593
|
-
const coords = instance._createCellCoords(row, to.col);
|
4594
|
-
const scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
|
4595
|
-
const nextVerticalScroll = Math.max(coords.row - scrollPadding, 0);
|
4596
|
-
selection.setRangeEnd(coords);
|
4597
|
-
instance.scrollViewportTo(nextVerticalScroll);
|
4598
|
-
}
|
4599
|
-
}
|
4600
|
-
}, {
|
4601
|
-
keys: [['PageDown']],
|
4602
|
-
callback: () => {
|
4603
|
-
selection.transformStart(instance.countVisibleRows(), 0);
|
4604
|
-
}
|
4605
|
-
}, {
|
4606
|
-
keys: [['PageDown', 'Shift']],
|
4607
|
-
callback: () => {
|
4608
|
-
const {
|
4609
|
-
to
|
4610
|
-
} = instance.getSelectedRangeLast();
|
4611
|
-
const nextRowIndexToSelect = Math.min(to.row + instance.countVisibleRows(), instance.countRows() - 1);
|
4612
|
-
const row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, -1);
|
4613
|
-
if (row !== null) {
|
4614
|
-
const coords = instance._createCellCoords(row, to.col);
|
4615
|
-
const scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
|
4616
|
-
const nextVerticalScroll = Math.min(coords.row - scrollPadding, instance.countRows() - 1);
|
4617
|
-
selection.setRangeEnd(coords);
|
4618
|
-
instance.scrollViewportTo(nextVerticalScroll);
|
4619
|
-
}
|
4620
|
-
}
|
4621
|
-
}, {
|
4622
|
-
keys: [['Tab']],
|
4623
|
-
callback: event => {
|
4624
|
-
const tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
4625
|
-
selection.transformStart(tabMoves.row, tabMoves.col, true);
|
4626
|
-
}
|
4627
|
-
}, {
|
4628
|
-
keys: [['Shift', 'Tab']],
|
4629
|
-
callback: event => {
|
4630
|
-
const tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
4631
|
-
selection.transformStart(-tabMoves.row, -tabMoves.col);
|
4632
|
-
}
|
4633
|
-
}], gridConfig);
|
4634
4590
|
(0, _registry.getPluginsNames)().forEach(pluginName => {
|
4635
4591
|
const PluginClass = (0, _registry.getPlugin)(pluginName);
|
4636
4592
|
pluginsRegistry.addItem(pluginName, new PluginClass(this));
|
4637
4593
|
});
|
4594
|
+
(0, _shortcutContexts.registerAllShortcutContexts)(instance);
|
4595
|
+
shortcutManager.setActiveContextName('grid');
|
4638
4596
|
_pluginHooks.default.getSingleton().run(instance, 'construct');
|
4639
4597
|
}
|