handsontable 0.0.0-next-b0a4ea2-20231024 → 0.0.0-next-9059914-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/{selection/border/border.js → border.js} +12 -7
- package/3rdparty/walkontable/src/{selection/border/border.mjs → border.mjs} +12 -7
- package/3rdparty/walkontable/src/cell/coords.d.ts +1 -6
- package/3rdparty/walkontable/src/cell/coords.js +11 -50
- package/3rdparty/walkontable/src/cell/coords.mjs +11 -50
- package/3rdparty/walkontable/src/cell/range.d.ts +2 -9
- package/3rdparty/walkontable/src/cell/range.js +7 -38
- package/3rdparty/walkontable/src/cell/range.mjs +7 -38
- package/3rdparty/walkontable/src/core/_base.js +3 -9
- package/3rdparty/walkontable/src/core/_base.mjs +3 -9
- 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 +2 -3
- package/3rdparty/walkontable/src/core/core.mjs +2 -3
- package/3rdparty/walkontable/src/event.js +10 -12
- package/3rdparty/walkontable/src/event.mjs +10 -12
- package/3rdparty/walkontable/src/facade/core.js +2 -2
- package/3rdparty/walkontable/src/facade/core.mjs +2 -2
- package/3rdparty/walkontable/src/index.js +2 -10
- package/3rdparty/walkontable/src/index.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/_base.js +2 -13
- package/3rdparty/walkontable/src/overlay/_base.mjs +3 -14
- package/3rdparty/walkontable/src/overlay/inlineStart.js +6 -2
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +6 -2
- package/3rdparty/walkontable/src/overlay/top.js +6 -2
- package/3rdparty/walkontable/src/overlay/top.mjs +6 -2
- package/3rdparty/walkontable/src/renderer/cells.js +0 -10
- package/3rdparty/walkontable/src/renderer/cells.mjs +1 -11
- package/3rdparty/walkontable/src/renderer/columnHeaders.js +0 -10
- package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +1 -11
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +0 -5
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +0 -5
- package/3rdparty/walkontable/src/renderer/rows.js +0 -13
- package/3rdparty/walkontable/src/renderer/rows.mjs +0 -13
- package/3rdparty/walkontable/src/renderer/table.js +0 -9
- package/3rdparty/walkontable/src/renderer/table.mjs +0 -9
- package/3rdparty/walkontable/src/scroll.js +0 -2
- package/3rdparty/walkontable/src/scroll.mjs +0 -2
- package/3rdparty/walkontable/src/selection.js +295 -0
- package/3rdparty/walkontable/src/selection.mjs +290 -0
- package/3rdparty/walkontable/src/settings.js +4 -13
- package/3rdparty/walkontable/src/settings.mjs +4 -13
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +0 -9
- package/3rdparty/walkontable/src/table.js +78 -19
- package/3rdparty/walkontable/src/table.mjs +79 -20
- 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 +0 -3
- package/cellTypes/index.js +0 -4
- package/cellTypes/index.mjs +1 -3
- package/core.d.ts +4 -9
- package/core.js +327 -285
- package/core.mjs +327 -285
- package/dataMap/metaManager/metaSchema.js +0 -65
- package/dataMap/metaManager/metaSchema.mjs +0 -65
- package/dataMap/metaManager/mods/extendMetaProperties.js +1 -7
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +1 -7
- package/dataMap/replaceData.js +0 -5
- package/dataMap/replaceData.mjs +0 -5
- package/dist/handsontable.css +15 -51
- package/dist/handsontable.full.css +15 -51
- package/dist/handsontable.full.js +8668 -14188
- package/dist/handsontable.full.min.css +7 -7
- package/dist/handsontable.full.min.js +136 -136
- package/dist/handsontable.js +22829 -28349
- package/dist/handsontable.min.css +6 -6
- package/dist/handsontable.min.js +24 -24
- package/dist/languages/all.js +2 -6
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/en-US.js +1 -3
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/pl-PL.js +1 -3
- package/dist/languages/pl-PL.min.js +1 -1
- package/editorManager.js +87 -15
- package/editorManager.mjs +87 -16
- package/editors/autocompleteEditor/autocompleteEditor.js +2 -53
- package/editors/autocompleteEditor/autocompleteEditor.mjs +3 -54
- package/editors/dateEditor/dateEditor.js +7 -26
- package/editors/dateEditor/dateEditor.mjs +8 -27
- package/editors/handsontableEditor/handsontableEditor.js +1 -9
- package/editors/handsontableEditor/handsontableEditor.mjs +2 -10
- package/editors/textEditor/textEditor.js +27 -19
- package/editors/textEditor/textEditor.mjs +30 -22
- package/helpers/dom/element.js +9 -188
- package/helpers/dom/element.mjs +9 -182
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/number.d.ts +0 -1
- package/helpers/number.js +0 -18
- package/helpers/number.mjs +0 -17
- package/i18n/constants.js +1 -7
- package/i18n/constants.mjs +1 -4
- package/i18n/languages/en-US.js +1 -3
- package/i18n/languages/en-US.mjs +1 -3
- package/i18n/languages/pl-PL.js +1 -3
- package/i18n/languages/pl-PL.mjs +1 -3
- package/languages/all.js +2 -6
- package/languages/en-US.js +1 -3
- package/languages/en-US.mjs +1 -3
- package/languages/index.js +2 -6
- package/languages/pl-PL.js +1 -3
- package/languages/pl-PL.mjs +1 -3
- package/package.json +99 -116
- package/pluginHooks.d.ts +1 -12
- package/pluginHooks.js +1 -152
- package/pluginHooks.mjs +1 -152
- package/plugins/collapsibleColumns/collapsibleColumns.js +4 -74
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +5 -75
- package/plugins/columnSorting/columnSorting.js +0 -43
- package/plugins/columnSorting/columnSorting.mjs +3 -44
- package/plugins/columnSorting/index.js +1 -3
- package/plugins/columnSorting/index.mjs +1 -1
- package/plugins/comments/commentEditor.js +0 -1
- package/plugins/comments/commentEditor.mjs +0 -1
- package/plugins/comments/comments.js +189 -252
- package/plugins/comments/comments.mjs +190 -251
- package/plugins/contextMenu/commandExecutor.js +3 -2
- package/plugins/contextMenu/commandExecutor.mjs +3 -2
- package/plugins/contextMenu/contextMenu.d.ts +1 -1
- package/plugins/contextMenu/contextMenu.js +36 -75
- package/plugins/contextMenu/contextMenu.mjs +35 -74
- package/plugins/contextMenu/{menu/cursor.mjs → cursor.js} +10 -4
- package/plugins/contextMenu/{menu/cursor.js → cursor.mjs} +4 -6
- package/plugins/contextMenu/itemsFactory.js +3 -2
- package/plugins/contextMenu/itemsFactory.mjs +4 -3
- package/plugins/contextMenu/{menu/menu.js → menu.js} +421 -145
- package/plugins/contextMenu/{menu/menu.mjs → menu.mjs} +422 -146
- package/plugins/contextMenu/predefinedItems/alignment.js +0 -7
- package/plugins/contextMenu/predefinedItems/alignment.mjs +0 -7
- package/plugins/contextMenu/predefinedItems/clearColumn.js +3 -5
- package/plugins/contextMenu/predefinedItems/clearColumn.mjs +3 -5
- package/plugins/contextMenu/predefinedItems/columnLeft.js +3 -5
- package/plugins/contextMenu/predefinedItems/columnLeft.mjs +3 -5
- package/plugins/contextMenu/predefinedItems/columnRight.js +3 -5
- package/plugins/contextMenu/predefinedItems/columnRight.mjs +3 -5
- package/plugins/contextMenu/predefinedItems/readOnly.js +0 -7
- package/plugins/contextMenu/predefinedItems/readOnly.mjs +0 -7
- package/plugins/contextMenu/predefinedItems/removeColumn.js +5 -7
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +3 -5
- package/plugins/contextMenu/predefinedItems/removeRow.js +5 -7
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +3 -5
- package/plugins/contextMenu/predefinedItems/rowAbove.js +3 -5
- package/plugins/contextMenu/predefinedItems/rowAbove.mjs +3 -5
- package/plugins/contextMenu/predefinedItems/rowBelow.js +3 -5
- package/plugins/contextMenu/predefinedItems/rowBelow.mjs +3 -5
- package/plugins/contextMenu/{predefinedItems/index.js → predefinedItems.js} +14 -14
- package/plugins/contextMenu/predefinedItems.mjs +68 -0
- package/plugins/contextMenu/utils.js +151 -35
- package/plugins/contextMenu/utils.mjs +144 -35
- package/plugins/copyPaste/contextMenuItem/copy.js +0 -7
- package/plugins/copyPaste/contextMenuItem/copy.mjs +0 -7
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +1 -9
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +1 -9
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +1 -9
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +1 -9
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +1 -9
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +1 -9
- package/plugins/copyPaste/contextMenuItem/cut.js +0 -7
- package/plugins/copyPaste/contextMenuItem/cut.mjs +0 -7
- package/plugins/copyPaste/copyPaste.js +78 -127
- package/plugins/copyPaste/copyPaste.mjs +79 -128
- package/plugins/copyPaste/focusableElement.js +186 -0
- package/plugins/copyPaste/focusableElement.mjs +180 -0
- package/plugins/customBorders/customBorders.js +20 -23
- package/plugins/customBorders/customBorders.mjs +21 -24
- package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
- package/plugins/dropdownMenu/dropdownMenu.js +40 -127
- package/plugins/dropdownMenu/dropdownMenu.mjs +39 -126
- package/plugins/filters/component/_base.js +8 -23
- package/plugins/filters/component/_base.mjs +8 -23
- package/plugins/filters/component/actionBar.js +27 -29
- package/plugins/filters/component/actionBar.mjs +23 -26
- package/plugins/filters/component/condition.js +59 -46
- package/plugins/filters/component/condition.mjs +52 -40
- package/plugins/filters/component/operators.js +22 -21
- package/plugins/filters/component/operators.mjs +18 -18
- package/plugins/filters/component/value.js +26 -35
- package/plugins/filters/component/value.mjs +22 -32
- package/plugins/filters/constants.mjs +1 -1
- package/plugins/filters/filters.js +62 -106
- package/plugins/filters/filters.mjs +55 -99
- package/plugins/filters/ui/_base.js +13 -35
- package/plugins/filters/ui/_base.mjs +13 -35
- package/plugins/filters/ui/input.js +32 -43
- package/plugins/filters/ui/input.mjs +30 -42
- package/plugins/filters/ui/link.js +12 -44
- package/plugins/filters/ui/link.mjs +11 -44
- package/plugins/filters/ui/multipleSelect.js +129 -234
- package/plugins/filters/ui/multipleSelect.mjs +127 -232
- package/plugins/filters/ui/radioInput.js +18 -42
- package/plugins/filters/ui/radioInput.mjs +17 -42
- package/plugins/filters/ui/select.js +75 -144
- package/plugins/filters/ui/select.mjs +72 -142
- package/plugins/hiddenColumns/hiddenColumns.mjs +1 -1
- package/plugins/hiddenRows/hiddenRows.mjs +1 -1
- package/plugins/manualColumnMove/manualColumnMove.js +1 -3
- package/plugins/manualColumnMove/manualColumnMove.mjs +1 -3
- package/plugins/mergeCells/mergeCells.js +16 -5
- package/plugins/mergeCells/mergeCells.mjs +16 -5
- package/plugins/multiColumnSorting/multiColumnSorting.js +2 -37
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -37
- package/plugins/nestedHeaders/nestedHeaders.js +10 -240
- package/plugins/nestedHeaders/nestedHeaders.mjs +11 -241
- package/plugins/nestedHeaders/stateManager/index.js +3 -102
- package/plugins/nestedHeaders/stateManager/index.mjs +3 -102
- package/plugins/nestedRows/nestedRows.js +0 -41
- package/plugins/nestedRows/nestedRows.mjs +0 -41
- package/plugins/nestedRows/ui/headers.js +0 -11
- package/plugins/nestedRows/ui/headers.mjs +1 -12
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +0 -8
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +0 -8
- package/renderers/baseRenderer/baseRenderer.js +0 -17
- package/renderers/baseRenderer/baseRenderer.mjs +1 -18
- package/renderers/checkboxRenderer/checkboxRenderer.js +4 -9
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +4 -9
- package/renderers/index.d.ts +0 -9
- package/selection/highlight/constants.js +15 -0
- package/selection/highlight/constants.mjs +6 -0
- package/selection/highlight/highlight.js +71 -256
- package/selection/highlight/highlight.mjs +71 -250
- package/selection/highlight/types/activeHeader.js +8 -10
- package/selection/highlight/types/activeHeader.mjs +8 -10
- package/selection/highlight/types/area.js +18 -6
- package/selection/highlight/types/area.mjs +18 -6
- package/selection/highlight/types/{focus.js → cell.js} +7 -5
- package/selection/highlight/types/{focus.mjs → cell.mjs} +7 -5
- package/selection/highlight/types/customSelection.js +9 -7
- package/selection/highlight/types/customSelection.mjs +9 -7
- package/selection/highlight/types/fill.js +7 -5
- package/selection/highlight/types/fill.mjs +7 -5
- package/selection/highlight/types/header.js +18 -9
- package/selection/highlight/types/header.mjs +18 -9
- package/selection/highlight/types/index.js +35 -0
- package/selection/highlight/types/index.mjs +31 -0
- package/selection/highlight/visualSelection.js +27 -31
- package/selection/highlight/visualSelection.mjs +27 -31
- package/selection/index.js +7 -4
- package/selection/index.mjs +3 -2
- package/selection/mouseEventHandler.js +1 -7
- package/selection/mouseEventHandler.mjs +1 -7
- package/selection/range.js +8 -8
- package/selection/range.mjs +8 -8
- package/selection/selection.js +152 -321
- package/selection/selection.mjs +151 -318
- package/selection/transformation.js +90 -232
- package/selection/transformation.mjs +90 -232
- package/selection/utils.js +21 -15
- package/selection/utils.mjs +21 -16
- package/settings.d.ts +0 -4
- package/shortcuts/context.js +4 -23
- package/shortcuts/context.mjs +5 -23
- package/shortcuts/manager.js +7 -25
- package/shortcuts/manager.mjs +7 -26
- package/shortcuts/recorder.js +3 -3
- package/shortcuts/recorder.mjs +3 -3
- package/shortcuts/utils.js +5 -19
- package/shortcuts/utils.mjs +4 -18
- package/tableView.js +13 -111
- package/tableView.mjs +14 -112
- package/3rdparty/walkontable/src/selection/border/constants.js +0 -16
- package/3rdparty/walkontable/src/selection/border/constants.mjs +0 -12
- package/3rdparty/walkontable/src/selection/constants.js +0 -62
- package/3rdparty/walkontable/src/selection/constants.mjs +0 -51
- package/3rdparty/walkontable/src/selection/index.js +0 -26
- package/3rdparty/walkontable/src/selection/index.mjs +0 -5
- package/3rdparty/walkontable/src/selection/manager.js +0 -274
- package/3rdparty/walkontable/src/selection/manager.mjs +0 -269
- package/3rdparty/walkontable/src/selection/scanner.js +0 -270
- package/3rdparty/walkontable/src/selection/scanner.mjs +0 -267
- package/3rdparty/walkontable/src/selection/selection.js +0 -101
- package/3rdparty/walkontable/src/selection/selection.mjs +0 -96
- package/cellTypes/selectType/index.d.ts +0 -1
- package/cellTypes/selectType/index.js +0 -6
- package/cellTypes/selectType/index.mjs +0 -1
- package/cellTypes/selectType/selectType.d.ts +0 -14
- package/cellTypes/selectType/selectType.js +0 -13
- package/cellTypes/selectType/selectType.mjs +0 -8
- package/core/focusCatcher/focusDetector.js +0 -63
- package/core/focusCatcher/focusDetector.mjs +0 -59
- package/core/focusCatcher/index.js +0 -142
- package/core/focusCatcher/index.mjs +0 -138
- package/core/index.js +0 -9
- package/core/index.mjs +0 -1
- package/focusManager.d.ts +0 -12
- package/focusManager.js +0 -265
- package/focusManager.mjs +0 -261
- package/helpers/a11y.js +0 -79
- package/helpers/a11y.mjs +0 -38
- package/plugins/comments/contextMenuItem/addEditComment.js +0 -41
- package/plugins/comments/contextMenuItem/addEditComment.mjs +0 -35
- package/plugins/comments/contextMenuItem/readOnlyComment.js +0 -49
- package/plugins/comments/contextMenuItem/readOnlyComment.mjs +0 -43
- package/plugins/comments/contextMenuItem/removeComment.js +0 -38
- package/plugins/comments/contextMenuItem/removeComment.mjs +0 -32
- package/plugins/contextMenu/menu/defaultShortcutsList.js +0 -88
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +0 -84
- package/plugins/contextMenu/menu/index.js +0 -9
- package/plugins/contextMenu/menu/index.mjs +0 -1
- package/plugins/contextMenu/menu/menuItemRenderer.js +0 -58
- package/plugins/contextMenu/menu/menuItemRenderer.mjs +0 -54
- package/plugins/contextMenu/menu/navigator.js +0 -27
- package/plugins/contextMenu/menu/navigator.mjs +0 -23
- package/plugins/contextMenu/menu/positioner.js +0 -213
- package/plugins/contextMenu/menu/positioner.mjs +0 -209
- package/plugins/contextMenu/menu/shortcuts.js +0 -114
- package/plugins/contextMenu/menu/shortcuts.mjs +0 -110
- package/plugins/contextMenu/menu/utils.js +0 -177
- package/plugins/contextMenu/menu/utils.mjs +0 -163
- package/plugins/contextMenu/predefinedItems/index.mjs +0 -68
- package/plugins/filters/menu/focusController.js +0 -123
- package/plugins/filters/menu/focusController.mjs +0 -119
- package/plugins/filters/menu/focusNavigator.js +0 -30
- package/plugins/filters/menu/focusNavigator.mjs +0 -26
- package/renderers/dateRenderer/dateRenderer.d.ts +0 -5
- package/renderers/dateRenderer/dateRenderer.js +0 -29
- package/renderers/dateRenderer/dateRenderer.mjs +0 -24
- package/renderers/dateRenderer/index.d.ts +0 -1
- package/renderers/dateRenderer/index.js +0 -6
- package/renderers/dateRenderer/index.mjs +0 -1
- package/renderers/handsontableRenderer/handsontableRenderer.d.ts +0 -5
- package/renderers/handsontableRenderer/handsontableRenderer.js +0 -29
- package/renderers/handsontableRenderer/handsontableRenderer.mjs +0 -24
- package/renderers/handsontableRenderer/index.d.ts +0 -1
- package/renderers/handsontableRenderer/index.js +0 -6
- package/renderers/handsontableRenderer/index.mjs +0 -1
- package/renderers/selectRenderer/index.d.ts +0 -1
- package/renderers/selectRenderer/index.js +0 -6
- package/renderers/selectRenderer/index.mjs +0 -1
- package/renderers/selectRenderer/selectRenderer.d.ts +0 -5
- package/renderers/selectRenderer/selectRenderer.js +0 -27
- package/renderers/selectRenderer/selectRenderer.mjs +0 -22
- package/selection/highlight/types/areaLayered.js +0 -31
- package/selection/highlight/types/areaLayered.mjs +0 -26
- package/selection/highlight/types/column.js +0 -27
- package/selection/highlight/types/column.mjs +0 -22
- package/selection/highlight/types/row.js +0 -27
- package/selection/highlight/types/row.mjs +0 -22
- package/shortcutContexts/commands/editor/closeAndSave.js +0 -12
- package/shortcutContexts/commands/editor/closeAndSave.mjs +0 -8
- package/shortcutContexts/commands/editor/closeWithoutSaving.js +0 -12
- package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +0 -8
- package/shortcutContexts/commands/editor/fastOpen.js +0 -16
- package/shortcutContexts/commands/editor/fastOpen.mjs +0 -12
- package/shortcutContexts/commands/editor/index.js +0 -16
- package/shortcutContexts/commands/editor/index.mjs +0 -12
- package/shortcutContexts/commands/editor/open.js +0 -27
- package/shortcutContexts/commands/editor/open.mjs +0 -23
- package/shortcutContexts/commands/emptySelectedCells.js +0 -11
- package/shortcutContexts/commands/emptySelectedCells.mjs +0 -7
- package/shortcutContexts/commands/extendCellsSelection/down.js +0 -15
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +0 -11
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +0 -25
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +0 -21
- package/shortcutContexts/commands/extendCellsSelection/index.js +0 -26
- package/shortcutContexts/commands/extendCellsSelection/index.mjs +0 -22
- package/shortcutContexts/commands/extendCellsSelection/left.js +0 -15
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +0 -11
- package/shortcutContexts/commands/extendCellsSelection/right.js +0 -15
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +0 -11
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +0 -19
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +0 -15
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +0 -29
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +0 -25
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +0 -19
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +0 -15
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +0 -19
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +0 -15
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +0 -29
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +0 -25
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +0 -29
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +0 -25
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +0 -29
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +0 -25
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +0 -19
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +0 -15
- package/shortcutContexts/commands/extendCellsSelection/up.js +0 -15
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +0 -11
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +0 -25
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +0 -21
- package/shortcutContexts/commands/index.js +0 -35
- package/shortcutContexts/commands/index.mjs +0 -31
- package/shortcutContexts/commands/moveCellSelection/down.js +0 -13
- package/shortcutContexts/commands/moveCellSelection/down.mjs +0 -9
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +0 -33
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +0 -29
- package/shortcutContexts/commands/moveCellSelection/index.js +0 -28
- package/shortcutContexts/commands/moveCellSelection/index.mjs +0 -24
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +0 -12
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +0 -8
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +0 -12
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +0 -8
- package/shortcutContexts/commands/moveCellSelection/left.js +0 -10
- package/shortcutContexts/commands/moveCellSelection/left.mjs +0 -6
- package/shortcutContexts/commands/moveCellSelection/right.js +0 -10
- package/shortcutContexts/commands/moveCellSelection/right.mjs +0 -6
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +0 -17
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +0 -13
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +0 -18
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +0 -14
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +0 -14
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +0 -10
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +0 -17
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +0 -13
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +0 -19
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +0 -15
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +0 -21
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +0 -17
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +0 -17
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +0 -13
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +0 -19
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +0 -15
- package/shortcutContexts/commands/moveCellSelection/up.js +0 -13
- package/shortcutContexts/commands/moveCellSelection/up.mjs +0 -9
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +0 -33
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +0 -29
- package/shortcutContexts/commands/populateSelectedCellsData.js +0 -29
- package/shortcutContexts/commands/populateSelectedCellsData.mjs +0 -25
- package/shortcutContexts/commands/scrollToFocusedCell.js +0 -35
- package/shortcutContexts/commands/scrollToFocusedCell.mjs +0 -31
- package/shortcutContexts/commands/selectAll.js +0 -12
- package/shortcutContexts/commands/selectAll.mjs +0 -8
- package/shortcutContexts/constants.js +0 -13
- package/shortcutContexts/constants.mjs +0 -8
- package/shortcutContexts/editor.js +0 -25
- package/shortcutContexts/editor.mjs +0 -21
- package/shortcutContexts/grid.js +0 -163
- package/shortcutContexts/grid.mjs +0 -159
- package/shortcutContexts/index.js +0 -24
- package/shortcutContexts/index.mjs +0 -11
- package/utils/paginator.js +0 -151
- package/utils/paginator.mjs +0 -147
package/core.mjs
CHANGED
@@ -8,7 +8,6 @@ import { isMobileBrowser, isIpadOS } from "./helpers/browser.mjs";
|
|
8
8
|
import EditorManager from "./editorManager.mjs";
|
9
9
|
import EventManager from "./eventManager.mjs";
|
10
10
|
import { deepClone, duckSchema, isObjectEqual, isObject, deepObjectSize, hasOwnProperty, createObjectPropListener, objectEach } from "./helpers/object.mjs";
|
11
|
-
import { FocusManager } from "./focusManager.mjs";
|
12
11
|
import { arrayMap, arrayEach, arrayReduce, getDifferenceOfArrays, stringToArray, pivot } from "./helpers/array.mjs";
|
13
12
|
import { instanceToHTML } from "./utils/parseTable.mjs";
|
14
13
|
import { getPlugin, getPluginsNames } from "./plugins/registry.mjs";
|
@@ -28,21 +27,11 @@ import { hasLanguageDictionary, getValidLanguageCode, getTranslatedPhrase } from
|
|
28
27
|
import { warnUserAboutLanguageRegistration, normalizeLanguageCode } from "./i18n/utils.mjs";
|
29
28
|
import { Selection } from "./selection/index.mjs";
|
30
29
|
import { MetaManager, DynamicCellMetaMod, ExtendMetaPropertiesMod, replaceData } from "./dataMap/index.mjs";
|
31
|
-
import { installFocusCatcher } from "./core/index.mjs";
|
32
30
|
import { createUniqueMap } from "./utils/dataStructures/uniqueMap.mjs";
|
33
31
|
import { createShortcutManager } from "./shortcuts/index.mjs";
|
34
|
-
|
32
|
+
const SHORTCUTS_GROUP = 'gridDefault';
|
35
33
|
let activeGuid = null;
|
36
34
|
|
37
|
-
/**
|
38
|
-
* Keeps the collection of the all Handsontable instances created on the same page. The
|
39
|
-
* list is then used to trigger the "afterUnlisten" hook when the "listen()" method was
|
40
|
-
* called on another instance.
|
41
|
-
*
|
42
|
-
* @type {Map<string, Core>}
|
43
|
-
*/
|
44
|
-
const foreignHotInstances = new Map();
|
45
|
-
|
46
35
|
/**
|
47
36
|
* A set of deprecated feature names.
|
48
37
|
*
|
@@ -102,8 +91,7 @@ const deprecationWarns = new Set();
|
|
102
91
|
* @param {boolean} [rootInstanceSymbol=false] Indicates if the instance is root of all later instances created.
|
103
92
|
*/
|
104
93
|
export default function Core(rootElement, userSettings) {
|
105
|
-
var _userSettings$layoutD
|
106
|
-
_this = this;
|
94
|
+
var _userSettings$layoutD;
|
107
95
|
let rootInstanceSymbol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
108
96
|
let preventScrollingToCell = false;
|
109
97
|
let instance = this;
|
@@ -112,7 +100,6 @@ export default function Core(rootElement, userSettings) {
|
|
112
100
|
let dataSource;
|
113
101
|
let grid;
|
114
102
|
let editorManager;
|
115
|
-
let focusManager;
|
116
103
|
let firstRun = true;
|
117
104
|
if (hasValidParameter(rootInstanceSymbol)) {
|
118
105
|
registerAsRootInstance(this);
|
@@ -221,8 +208,6 @@ export default function Core(rootElement, userSettings) {
|
|
221
208
|
}
|
222
209
|
this.guid = `ht_${randomString()}`; // this is the namespace for global events
|
223
210
|
|
224
|
-
foreignHotInstances.set(this.guid, this);
|
225
|
-
|
226
211
|
/**
|
227
212
|
* Instance of index mapper which is responsible for managing the column indexes.
|
228
213
|
*
|
@@ -271,16 +256,14 @@ export default function Core(rootElement, userSettings) {
|
|
271
256
|
};
|
272
257
|
|
273
258
|
let selection = new Selection(tableMeta, {
|
274
|
-
rowIndexMapper: instance.rowIndexMapper,
|
275
|
-
columnIndexMapper: instance.columnIndexMapper,
|
259
|
+
rowIndexMapper: () => instance.rowIndexMapper,
|
260
|
+
columnIndexMapper: () => instance.columnIndexMapper,
|
276
261
|
countCols: () => instance.countCols(),
|
277
262
|
countRows: () => instance.countRows(),
|
278
263
|
propToCol: prop => datamap.propToCol(prop),
|
279
264
|
isEditorOpened: () => instance.getActiveEditor() ? instance.getActiveEditor().isOpened() : false,
|
280
|
-
|
281
|
-
|
282
|
-
countRowHeaders: () => this.countRowHeaders(),
|
283
|
-
countColHeaders: () => this.countColHeaders(),
|
265
|
+
countColsTranslated: () => this.view.countRenderableColumns(),
|
266
|
+
countRowsTranslated: () => this.view.countRenderableRows(),
|
284
267
|
getShortcutManager: () => instance.getShortcutManager(),
|
285
268
|
createCellCoords: (row, column) => instance._createCellCoords(row, column),
|
286
269
|
createCellRange: (highlight, from, to) => instance._createCellRange(highlight, from, to),
|
@@ -299,9 +282,6 @@ export default function Core(rootElement, userSettings) {
|
|
299
282
|
};
|
300
283
|
this.columnIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);
|
301
284
|
this.rowIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);
|
302
|
-
this.selection.addLocalHook('beforeHighlightSet', () => {
|
303
|
-
this.runHooks('beforeSelectionHighlightSet');
|
304
|
-
});
|
305
285
|
this.selection.addLocalHook('beforeSetRangeStart', cellCoords => {
|
306
286
|
this.runHooks('beforeSetRangeStart', cellCoords);
|
307
287
|
});
|
@@ -310,6 +290,12 @@ export default function Core(rootElement, userSettings) {
|
|
310
290
|
});
|
311
291
|
this.selection.addLocalHook('beforeSetRangeEnd', cellCoords => {
|
312
292
|
this.runHooks('beforeSetRangeEnd', cellCoords);
|
293
|
+
if (cellCoords.row < 0) {
|
294
|
+
cellCoords.row = this.view._wt.wtTable.getFirstVisibleRow();
|
295
|
+
}
|
296
|
+
if (cellCoords.col < 0) {
|
297
|
+
cellCoords.col = this.view._wt.wtTable.getFirstVisibleColumn();
|
298
|
+
}
|
313
299
|
});
|
314
300
|
this.selection.addLocalHook('afterSetRangeEnd', cellCoords => {
|
315
301
|
const preventScrolling = createObjectPropListener(false);
|
@@ -322,6 +308,8 @@ export default function Core(rootElement, userSettings) {
|
|
322
308
|
this.runHooks('afterSelection', from.row, from.col, to.row, to.col, preventScrolling, selectionLayerLevel);
|
323
309
|
this.runHooks('afterSelectionByProp', from.row, instance.colToProp(from.col), to.row, instance.colToProp(to.col), preventScrolling, selectionLayerLevel); // eslint-disable-line max-len
|
324
310
|
|
311
|
+
const isSelectedByAnyHeader = this.selection.isSelectedByAnyHeader();
|
312
|
+
const currentSelectedRange = this.selection.selectedRange.current();
|
325
313
|
let scrollToCell = true;
|
326
314
|
if (preventScrollingToCell) {
|
327
315
|
scrollToCell = false;
|
@@ -329,42 +317,19 @@ export default function Core(rootElement, userSettings) {
|
|
329
317
|
if (preventScrolling.isTouched()) {
|
330
318
|
scrollToCell = !preventScrolling.value;
|
331
319
|
}
|
332
|
-
const currentSelectedRange = this.selection.selectedRange.current();
|
333
|
-
const isSelectedByAnyHeader = this.selection.isSelectedByAnyHeader();
|
334
320
|
const isSelectedByRowHeader = this.selection.isSelectedByRowHeader();
|
335
321
|
const isSelectedByColumnHeader = this.selection.isSelectedByColumnHeader();
|
336
322
|
if (scrollToCell !== false) {
|
337
323
|
if (!isSelectedByAnyHeader) {
|
338
324
|
if (currentSelectedRange && !this.selection.isMultiple()) {
|
339
|
-
|
340
|
-
row,
|
341
|
-
col
|
342
|
-
} = currentSelectedRange.from;
|
343
|
-
if (row < 0 && col >= 0) {
|
344
|
-
this.scrollViewportTo({
|
345
|
-
col
|
346
|
-
});
|
347
|
-
} else if (col < 0 && row >= 0) {
|
348
|
-
this.scrollViewportTo({
|
349
|
-
row
|
350
|
-
});
|
351
|
-
} else {
|
352
|
-
this.scrollViewportTo({
|
353
|
-
row,
|
354
|
-
col
|
355
|
-
});
|
356
|
-
}
|
325
|
+
this.view.scrollViewport(visualToRenderableCoords(currentSelectedRange.from));
|
357
326
|
} else {
|
358
|
-
this.
|
327
|
+
this.view.scrollViewport(visualToRenderableCoords(cellCoords));
|
359
328
|
}
|
360
329
|
} else if (isSelectedByRowHeader) {
|
361
|
-
this.
|
362
|
-
row: cellCoords.row
|
363
|
-
});
|
330
|
+
this.view.scrollViewportVertically(instance.rowIndexMapper.getRenderableFromVisualIndex(cellCoords.row));
|
364
331
|
} else if (isSelectedByColumnHeader) {
|
365
|
-
this.
|
366
|
-
col: cellCoords.col
|
367
|
-
});
|
332
|
+
this.view.scrollViewportHorizontally(instance.columnIndexMapper.getRenderableFromVisualIndex(cellCoords.col));
|
368
333
|
}
|
369
334
|
}
|
370
335
|
|
@@ -399,30 +364,6 @@ export default function Core(rootElement, userSettings) {
|
|
399
364
|
isMultiple.value = changedIsMultiple;
|
400
365
|
}
|
401
366
|
});
|
402
|
-
this.selection.addLocalHook('beforeSelectColumns', function () {
|
403
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
404
|
-
args[_key] = arguments[_key];
|
405
|
-
}
|
406
|
-
return _this.runHooks('beforeSelectColumns', ...args);
|
407
|
-
});
|
408
|
-
this.selection.addLocalHook('afterSelectColumns', function () {
|
409
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
410
|
-
args[_key2] = arguments[_key2];
|
411
|
-
}
|
412
|
-
return _this.runHooks('afterSelectColumns', ...args);
|
413
|
-
});
|
414
|
-
this.selection.addLocalHook('beforeSelectRows', function () {
|
415
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
416
|
-
args[_key3] = arguments[_key3];
|
417
|
-
}
|
418
|
-
return _this.runHooks('beforeSelectRows', ...args);
|
419
|
-
});
|
420
|
-
this.selection.addLocalHook('afterSelectRows', function () {
|
421
|
-
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
422
|
-
args[_key4] = arguments[_key4];
|
423
|
-
}
|
424
|
-
return _this.runHooks('afterSelectRows', ...args);
|
425
|
-
});
|
426
367
|
this.selection.addLocalHook('beforeModifyTransformStart', cellCoordsDelta => {
|
427
368
|
this.runHooks('modifyTransformStart', cellCoordsDelta);
|
428
369
|
});
|
@@ -528,9 +469,7 @@ export default function Core(rootElement, userSettings) {
|
|
528
469
|
const currentFromRow = currentFromRange === null || currentFromRange === void 0 ? void 0 : currentFromRange.row;
|
529
470
|
const startVisualRowIndex = instance.toVisualRow(startRowPhysicalIndex);
|
530
471
|
if (selection.isSelectedByCorner()) {
|
531
|
-
|
532
|
-
disableHeadersHighlight: true
|
533
|
-
});
|
472
|
+
instance.selectAll();
|
534
473
|
} else if (isDefined(currentFromRow) && currentFromRow >= startVisualRowIndex) {
|
535
474
|
// Moving the selection (if it exists) downward – it should be applied to the "old" row.
|
536
475
|
// TODO: The logic here should be handled by selection module.
|
@@ -584,9 +523,7 @@ export default function Core(rootElement, userSettings) {
|
|
584
523
|
const currentFromColumn = currentFromRange === null || currentFromRange === void 0 ? void 0 : currentFromRange.col;
|
585
524
|
const startVisualColumnIndex = instance.toVisualColumn(startColumnPhysicalIndex);
|
586
525
|
if (selection.isSelectedByCorner()) {
|
587
|
-
|
588
|
-
disableHeadersHighlight: true
|
589
|
-
});
|
526
|
+
instance.selectAll();
|
590
527
|
} else if (isDefined(currentFromColumn) && currentFromColumn >= startVisualColumnIndex) {
|
591
528
|
// Moving the selection (if it exists) rightward – it should be applied to the "old" column.
|
592
529
|
// TODO: The logic here should be handled by selection module.
|
@@ -1076,10 +1013,6 @@ export default function Core(rootElement, userSettings) {
|
|
1076
1013
|
this.updateSettings(tableMeta, true);
|
1077
1014
|
this.view = new TableView(this);
|
1078
1015
|
editorManager = EditorManager.getInstance(instance, tableMeta, selection);
|
1079
|
-
focusManager = new FocusManager(instance);
|
1080
|
-
if (isRootInstance(this)) {
|
1081
|
-
installFocusCatcher(instance);
|
1082
|
-
}
|
1083
1016
|
instance.runHooks('init');
|
1084
1017
|
this.forceFullRender = true; // used when data was changed
|
1085
1018
|
this.view.render();
|
@@ -1493,11 +1426,6 @@ export default function Core(rootElement, userSettings) {
|
|
1493
1426
|
*/
|
1494
1427
|
this.listen = function () {
|
1495
1428
|
if (instance && !instance.isListening()) {
|
1496
|
-
foreignHotInstances.forEach(foreignHot => {
|
1497
|
-
if (instance !== foreignHot) {
|
1498
|
-
foreignHot.unlisten();
|
1499
|
-
}
|
1500
|
-
});
|
1501
1429
|
activeGuid = instance.guid;
|
1502
1430
|
instance.runHooks('afterListen');
|
1503
1431
|
}
|
@@ -1582,8 +1510,8 @@ export default function Core(rootElement, userSettings) {
|
|
1582
1510
|
* @returns {Array} Returns removed portion of columns.
|
1583
1511
|
*/
|
1584
1512
|
this.spliceCol = function (column, index, amount) {
|
1585
|
-
for (var
|
1586
|
-
elements[
|
1513
|
+
for (var _len = arguments.length, elements = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
1514
|
+
elements[_key - 3] = arguments[_key];
|
1587
1515
|
}
|
1588
1516
|
return datamap.spliceCol(column, index, amount, ...elements);
|
1589
1517
|
};
|
@@ -1600,8 +1528,8 @@ export default function Core(rootElement, userSettings) {
|
|
1600
1528
|
* @returns {Array} Returns removed portion of rows.
|
1601
1529
|
*/
|
1602
1530
|
this.spliceRow = function (row, index, amount) {
|
1603
|
-
for (var
|
1604
|
-
elements[
|
1531
|
+
for (var _len2 = arguments.length, elements = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
|
1532
|
+
elements[_key2 - 3] = arguments[_key2];
|
1605
1533
|
}
|
1606
1534
|
return datamap.spliceRow(row, index, amount, ...elements);
|
1607
1535
|
};
|
@@ -1698,9 +1626,6 @@ export default function Core(rootElement, userSettings) {
|
|
1698
1626
|
}
|
1699
1627
|
const changes = [];
|
1700
1628
|
arrayEach(selection.getSelectedRange(), cellRange => {
|
1701
|
-
if (cellRange.isSingleHeader()) {
|
1702
|
-
return;
|
1703
|
-
}
|
1704
1629
|
const topStart = cellRange.getTopStartCorner();
|
1705
1630
|
const bottomEnd = cellRange.getBottomEndCorner();
|
1706
1631
|
rangeEach(topStart.row, bottomEnd.row, row => {
|
@@ -2998,8 +2923,8 @@ export default function Core(rootElement, userSettings) {
|
|
2998
2923
|
*/
|
2999
2924
|
this.spliceCellsMeta = function (visualIndex) {
|
3000
2925
|
let deleteAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
3001
|
-
for (var
|
3002
|
-
cellMetaRows[
|
2926
|
+
for (var _len3 = arguments.length, cellMetaRows = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
|
2927
|
+
cellMetaRows[_key3 - 2] = arguments[_key3];
|
3003
2928
|
}
|
3004
2929
|
if (cellMetaRows.length > 0 && !Array.isArray(cellMetaRows[0])) {
|
3005
2930
|
throw new Error('The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.');
|
@@ -3690,30 +3615,6 @@ export default function Core(rootElement, userSettings) {
|
|
3690
3615
|
return instance.view._wt.drawn ? instance.view._wt.wtTable.getVisibleColumnsCount() : -1;
|
3691
3616
|
};
|
3692
3617
|
|
3693
|
-
/**
|
3694
|
-
* Returns the number of rendered row headers.
|
3695
|
-
*
|
3696
|
-
* @since 14.0.0
|
3697
|
-
* @memberof Core#
|
3698
|
-
* @function countRowHeaders
|
3699
|
-
* @returns {number} Number of row headers.
|
3700
|
-
*/
|
3701
|
-
this.countRowHeaders = function () {
|
3702
|
-
return this.view.getRowHeadersCount();
|
3703
|
-
};
|
3704
|
-
|
3705
|
-
/**
|
3706
|
-
* Returns the number of rendered column headers.
|
3707
|
-
*
|
3708
|
-
* @since 14.0.0
|
3709
|
-
* @memberof Core#
|
3710
|
-
* @function countColHeaders
|
3711
|
-
* @returns {number} Number of column headers.
|
3712
|
-
*/
|
3713
|
-
this.countColHeaders = function () {
|
3714
|
-
return this.view.getColumnHeadersCount();
|
3715
|
-
};
|
3716
|
-
|
3717
3618
|
/**
|
3718
3619
|
* Returns the number of empty rows. If the optional ending parameter is `true`, returns the
|
3719
3620
|
* number of empty rows at the bottom of the table.
|
@@ -3918,10 +3819,6 @@ export default function Core(rootElement, userSettings) {
|
|
3918
3819
|
* hot.selectColumns('id');
|
3919
3820
|
* // Select range of columns using visual indexes.
|
3920
3821
|
* hot.selectColumns(1, 4);
|
3921
|
-
* // Select range of columns using visual indexes and mark the first header as highlighted.
|
3922
|
-
* hot.selectColumns(1, 2, -1);
|
3923
|
-
* // Select range of columns using visual indexes and mark the second cell as highlighted.
|
3924
|
-
* hot.selectColumns(2, 1, 1);
|
3925
3822
|
* // Select range of columns using column properties.
|
3926
3823
|
* hot.selectColumns('id', 'last_name');
|
3927
3824
|
* ```
|
@@ -3932,15 +3829,11 @@ export default function Core(rootElement, userSettings) {
|
|
3932
3829
|
* @param {number} startColumn The visual column index from which the selection starts.
|
3933
3830
|
* @param {number} [endColumn=startColumn] The visual column index to which the selection finishes. If `endColumn`
|
3934
3831
|
* is not defined the column defined by `startColumn` will be selected.
|
3935
|
-
* @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
|
3936
|
-
* The value can take visual row index from -N to N, where negative values
|
3937
|
-
* point to the headers and positive values point to the cell range.
|
3938
3832
|
* @returns {boolean} `true` if selection was successful, `false` otherwise.
|
3939
3833
|
*/
|
3940
3834
|
this.selectColumns = function (startColumn) {
|
3941
3835
|
let endColumn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startColumn;
|
3942
|
-
|
3943
|
-
return selection.selectColumns(startColumn, endColumn, focusPosition);
|
3836
|
+
return selection.selectColumns(startColumn, endColumn);
|
3944
3837
|
};
|
3945
3838
|
|
3946
3839
|
/**
|
@@ -3950,12 +3843,8 @@ export default function Core(rootElement, userSettings) {
|
|
3950
3843
|
* ```js
|
3951
3844
|
* // Select row using visual index.
|
3952
3845
|
* hot.selectRows(1);
|
3953
|
-
* //
|
3846
|
+
* // Select range of rows using visual indexes.
|
3954
3847
|
* hot.selectRows(1, 4);
|
3955
|
-
* // select a range of rows, using visual indexes, and mark the header as highlighted.
|
3956
|
-
* hot.selectRows(1, 2, -1);
|
3957
|
-
* // Select range of rows using visual indexes and mark the second cell as highlighted.
|
3958
|
-
* hot.selectRows(2, 1, 1);
|
3959
3848
|
* ```
|
3960
3849
|
*
|
3961
3850
|
* @memberof Core#
|
@@ -3964,15 +3853,11 @@ export default function Core(rootElement, userSettings) {
|
|
3964
3853
|
* @param {number} startRow The visual row index from which the selection starts.
|
3965
3854
|
* @param {number} [endRow=startRow] The visual row index to which the selection finishes. If `endRow`
|
3966
3855
|
* is not defined the row defined by `startRow` will be selected.
|
3967
|
-
* @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
|
3968
|
-
* The value can take visual column index from -N to N, where negative values
|
3969
|
-
* point to the headers and positive values point to the cell range.
|
3970
3856
|
* @returns {boolean} `true` if selection was successful, `false` otherwise.
|
3971
3857
|
*/
|
3972
3858
|
this.selectRows = function (startRow) {
|
3973
3859
|
let endRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startRow;
|
3974
|
-
|
3975
|
-
return selection.selectRows(startRow, endRow, focusPosition);
|
3860
|
+
return selection.selectRows(startRow, endRow);
|
3976
3861
|
};
|
3977
3862
|
|
3978
3863
|
/**
|
@@ -3991,16 +3876,9 @@ export default function Core(rootElement, userSettings) {
|
|
3991
3876
|
* The previous selection is overwritten.
|
3992
3877
|
*
|
3993
3878
|
* ```js
|
3994
|
-
* // select all cells in the table, including all headers
|
3879
|
+
* // select all cells in the table, including all headers
|
3995
3880
|
* hot.selectAll();
|
3996
3881
|
*
|
3997
|
-
* // select all cells in the table, including row headers but excluding the corner cell
|
3998
|
-
* hot.selectAll(true, false);
|
3999
|
-
*
|
4000
|
-
* // select all cells in the table, including all headers and the corner cell, but move the focus
|
4001
|
-
* // highlight to position -2, -1
|
4002
|
-
* hot.selectAll(-2, -1);
|
4003
|
-
*
|
4004
3882
|
* // select all cells in the table, without headers
|
4005
3883
|
* hot.selectAll(false);
|
4006
3884
|
* ```
|
@@ -4008,25 +3886,15 @@ export default function Core(rootElement, userSettings) {
|
|
4008
3886
|
* @since 0.38.2
|
4009
3887
|
* @memberof Core#
|
4010
3888
|
* @function selectAll
|
4011
|
-
* @param {boolean} [
|
4012
|
-
* `false
|
4013
|
-
* @param {boolean} [includeColumnHeaders=false] `true` If the selection should include the column
|
4014
|
-
* headers, `false` otherwise.
|
4015
|
-
*
|
4016
|
-
* @param {object} [options] Additional object with options.
|
4017
|
-
* @param {{row: number, col: number} | boolean} [options.focusPosition] The argument allows changing the cell/header
|
4018
|
-
* focus position. The value takes an object with a `row` and `col` properties from -N to N, where
|
4019
|
-
* negative values point to the headers and positive values point to the cell range. If `false`, the focus
|
4020
|
-
* position won't be changed.
|
4021
|
-
* @param {boolean} [options.disableHeadersHighlight] If `true`, disables highlighting the headers even when
|
4022
|
-
* the logical coordinates points on them.
|
3889
|
+
* @param {boolean} [includeHeaders=true] `true`: include all row, column and corner headers.
|
3890
|
+
* `false`: don't include any headers.
|
4023
3891
|
*/
|
4024
3892
|
this.selectAll = function () {
|
4025
|
-
let
|
4026
|
-
|
4027
|
-
|
3893
|
+
let includeHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
3894
|
+
const includeRowHeaders = includeHeaders && this.hasRowHeaders();
|
3895
|
+
const includeColumnHeaders = includeHeaders && this.hasColHeaders();
|
4028
3896
|
preventScrollingToCell = true;
|
4029
|
-
selection.selectAll(includeRowHeaders, includeColumnHeaders
|
3897
|
+
selection.selectAll(includeRowHeaders, includeColumnHeaders);
|
4030
3898
|
preventScrollingToCell = false;
|
4031
3899
|
};
|
4032
3900
|
const getIndexToScroll = (indexMapper, visualIndex) => {
|
@@ -4035,117 +3903,55 @@ export default function Core(rootElement, userSettings) {
|
|
4035
3903
|
};
|
4036
3904
|
|
4037
3905
|
/**
|
4038
|
-
* Scroll viewport to coordinates specified by the `row` and
|
4039
|
-
*
|
4040
|
-
* ```js
|
4041
|
-
* // scroll the viewport to the visual row index (leave the horizontal scroll untouched)
|
4042
|
-
* hot.scrollViewportTo({ row: 50 });
|
4043
|
-
*
|
4044
|
-
* // scroll the viewport to the passed coordinates so that the cell at 50, 50 will be snapped to
|
4045
|
-
* // the bottom-end table's edge.
|
4046
|
-
* hot.scrollViewportTo({
|
4047
|
-
* row: 50,
|
4048
|
-
* col: 50,
|
4049
|
-
* verticalSnap: 'bottom',
|
4050
|
-
* horizontalSnap: 'end',
|
4051
|
-
* });
|
4052
|
-
* ```
|
3906
|
+
* Scroll viewport to coordinates specified by the `row` and `column` arguments.
|
4053
3907
|
*
|
4054
3908
|
* @memberof Core#
|
4055
3909
|
* @function scrollViewportTo
|
4056
|
-
* @param {
|
4057
|
-
*
|
4058
|
-
* @param {number} [
|
4059
|
-
*
|
4060
|
-
*
|
4061
|
-
*
|
4062
|
-
*
|
4063
|
-
*
|
4064
|
-
*
|
4065
|
-
* @param {'start' | 'end'} [options.horizontalSnap] Determines to which edge of the table the viewport will be scrolled based on the passed coordinates.
|
4066
|
-
* This option is a string which must take one of the following values:
|
4067
|
-
* - `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;
|
4068
|
-
* - `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;
|
4069
|
-
* - If the property is not defined the horizontal auto-snapping is enabled. Depending on where the viewport is scrolled from, a column will
|
4070
|
-
* be positioned at the start or end of the viewport.
|
4071
|
-
* @param {boolean} [options.considerHiddenIndexes=true] If `true`, we handle visual indexes, otherwise we handle only indexes which
|
3910
|
+
* @param {number} [row] Row index. If the last argument isn't defined we treat the index as a visual row index. Otherwise,
|
3911
|
+
* we are using the index for numbering only this rows which may be rendered (we don't consider hidden rows).
|
3912
|
+
* @param {number} [column] Column index. If the last argument isn't defined we treat the index as a visual column index.
|
3913
|
+
* Otherwise, we are using the index for numbering only this columns which may be rendered (we don't consider hidden columns).
|
3914
|
+
* @param {boolean} [snapToBottom=false] If `true`, the viewport is scrolled to show the cell at the bottom of the table.
|
3915
|
+
* However, if the cell's height is greater than the table's viewport height, the cell is snapped to the top edge.
|
3916
|
+
* @param {boolean} [snapToRight=false] If `true`, the viewport is scrolled to show the cell at the right side of the table.
|
3917
|
+
* However, if the cell is wider than the table's viewport width, the cell is snapped to the left edge (or to the right edge, if the layout direction is set to `rtl`).
|
3918
|
+
* @param {boolean} [considerHiddenIndexes=true] If `true`, we handle visual indexes, otherwise we handle only indexes which
|
4072
3919
|
* may be rendered when they are in the viewport (we don't consider hidden indexes as they aren't rendered).
|
4073
|
-
* @returns {boolean} `true` if
|
4074
|
-
*/
|
4075
|
-
this.scrollViewportTo = function () {
|
4076
|
-
let
|
4077
|
-
|
4078
|
-
|
4079
|
-
|
4080
|
-
|
4081
|
-
considerHiddenIndexes
|
4082
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4083
|
-
let snapToTop;
|
4084
|
-
let snapToBottom;
|
4085
|
-
let snapToInlineStart;
|
4086
|
-
let snapToInlineEnd;
|
4087
|
-
if (verticalSnap !== undefined) {
|
4088
|
-
snapToTop = verticalSnap === 'top';
|
4089
|
-
snapToBottom = !snapToTop;
|
4090
|
-
}
|
4091
|
-
if (horizontalSnap !== undefined) {
|
4092
|
-
snapToInlineStart = horizontalSnap === 'start';
|
4093
|
-
snapToInlineEnd = !snapToInlineStart;
|
4094
|
-
}
|
3920
|
+
* @returns {boolean} `true` if scroll was successful, `false` otherwise.
|
3921
|
+
*/
|
3922
|
+
this.scrollViewportTo = function (row, column) {
|
3923
|
+
let snapToBottom = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
3924
|
+
let snapToRight = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
3925
|
+
let considerHiddenIndexes = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
3926
|
+
const snapToTop = !snapToBottom;
|
3927
|
+
const snapToLeft = !snapToRight;
|
4095
3928
|
let renderableRow = row;
|
4096
|
-
let renderableColumn =
|
4097
|
-
if (considerHiddenIndexes
|
4098
|
-
const
|
4099
|
-
const
|
4100
|
-
const visualRowToScroll =
|
4101
|
-
const visualColumnToScroll =
|
3929
|
+
let renderableColumn = column;
|
3930
|
+
if (considerHiddenIndexes) {
|
3931
|
+
const isRowInteger = Number.isInteger(row);
|
3932
|
+
const isColumnInteger = Number.isInteger(column);
|
3933
|
+
const visualRowToScroll = isRowInteger ? getIndexToScroll(this.rowIndexMapper, row) : void 0;
|
3934
|
+
const visualColumnToScroll = isColumnInteger ? getIndexToScroll(this.columnIndexMapper, column) : void 0;
|
4102
3935
|
if (visualRowToScroll === null || visualColumnToScroll === null) {
|
4103
3936
|
return false;
|
4104
3937
|
}
|
4105
|
-
renderableRow =
|
4106
|
-
renderableColumn =
|
3938
|
+
renderableRow = isRowInteger ? instance.rowIndexMapper.getRenderableFromVisualIndex(visualRowToScroll) : void 0;
|
3939
|
+
renderableColumn = isColumnInteger ? instance.columnIndexMapper.getRenderableFromVisualIndex(visualColumnToScroll) : void 0;
|
4107
3940
|
}
|
4108
3941
|
const isRowInteger = Number.isInteger(renderableRow);
|
4109
3942
|
const isColumnInteger = Number.isInteger(renderableColumn);
|
4110
|
-
if (isRowInteger &&
|
4111
|
-
return instance.view.scrollViewport(instance._createCellCoords(renderableRow, renderableColumn), snapToTop,
|
3943
|
+
if (isRowInteger && isColumnInteger) {
|
3944
|
+
return instance.view.scrollViewport(instance._createCellCoords(renderableRow, renderableColumn), snapToTop, snapToRight, snapToBottom, snapToLeft);
|
4112
3945
|
}
|
4113
|
-
if (isRowInteger &&
|
3946
|
+
if (isRowInteger && isColumnInteger === false) {
|
4114
3947
|
return instance.view.scrollViewportVertically(renderableRow, snapToTop, snapToBottom);
|
4115
3948
|
}
|
4116
|
-
if (isColumnInteger &&
|
4117
|
-
return instance.view.scrollViewportHorizontally(renderableColumn,
|
3949
|
+
if (isColumnInteger && isRowInteger === false) {
|
3950
|
+
return instance.view.scrollViewportHorizontally(renderableColumn, snapToRight, snapToLeft);
|
4118
3951
|
}
|
4119
3952
|
return false;
|
4120
3953
|
};
|
4121
3954
|
|
4122
|
-
/**
|
4123
|
-
* Scrolls the viewport to coordinates specified by the currently focused cell.
|
4124
|
-
*
|
4125
|
-
* @since 14.0.0
|
4126
|
-
* @memberof Core#
|
4127
|
-
* @fires Hooks#afterScroll
|
4128
|
-
* @function scrollToFocusedCell
|
4129
|
-
* @param {Function} callback The callback function to call after the viewport is scrolled.
|
4130
|
-
*/
|
4131
|
-
this.scrollToFocusedCell = function () {
|
4132
|
-
let callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : () => {};
|
4133
|
-
if (!this.selection.isSelected()) {
|
4134
|
-
return;
|
4135
|
-
}
|
4136
|
-
this.addHookOnce('afterScroll', callback);
|
4137
|
-
const {
|
4138
|
-
highlight
|
4139
|
-
} = this.getSelectedRangeLast();
|
4140
|
-
const isScrolled = this.scrollViewportTo(highlight.toObject());
|
4141
|
-
if (isScrolled) {
|
4142
|
-
this.view.render();
|
4143
|
-
} else {
|
4144
|
-
this.removeHook('afterScroll', callback);
|
4145
|
-
this._registerImmediate(() => callback());
|
4146
|
-
}
|
4147
|
-
};
|
4148
|
-
|
4149
3955
|
/**
|
4150
3956
|
* Removes the table from the DOM and destroys the instance of the Handsontable.
|
4151
3957
|
*
|
@@ -4166,7 +3972,6 @@ export default function Core(rootElement, userSettings) {
|
|
4166
3972
|
dataSource = null;
|
4167
3973
|
this.getShortcutManager().destroy();
|
4168
3974
|
metaManager.clearCache();
|
4169
|
-
foreignHotInstances.delete(this.guid);
|
4170
3975
|
if (isRootInstance(instance)) {
|
4171
3976
|
const licenseInfo = this.rootDocument.querySelector('.hot-display-license-info');
|
4172
3977
|
if (licenseInfo) {
|
@@ -4490,16 +4295,6 @@ export default function Core(rootElement, userSettings) {
|
|
4490
4295
|
}
|
4491
4296
|
};
|
4492
4297
|
|
4493
|
-
/**
|
4494
|
-
* Gets the instance of the EditorManager.
|
4495
|
-
*
|
4496
|
-
* @private
|
4497
|
-
* @returns {EditorManager}
|
4498
|
-
*/
|
4499
|
-
this._getEditorManager = function () {
|
4500
|
-
return editorManager;
|
4501
|
-
};
|
4502
|
-
|
4503
4298
|
/**
|
4504
4299
|
* Check if currently it is RTL direction.
|
4505
4300
|
*
|
@@ -4570,23 +4365,270 @@ export default function Core(rootElement, userSettings) {
|
|
4570
4365
|
this.getShortcutManager = function () {
|
4571
4366
|
return shortcutManager;
|
4572
4367
|
};
|
4573
|
-
|
4574
|
-
|
4575
|
-
|
4576
|
-
|
4577
|
-
|
4578
|
-
|
4579
|
-
* @function getFocusManager
|
4580
|
-
* @returns {FocusManager}
|
4581
|
-
*/
|
4582
|
-
this.getFocusManager = function () {
|
4583
|
-
return focusManager;
|
4368
|
+
const gridContext = shortcutManager.addContext('grid');
|
4369
|
+
const gridConfig = {
|
4370
|
+
runOnlyIf: () => {
|
4371
|
+
return isDefined(instance.getSelected()) && instance.countRenderedRows() > 0 && instance.countRenderedCols() > 0;
|
4372
|
+
},
|
4373
|
+
group: SHORTCUTS_GROUP
|
4584
4374
|
};
|
4375
|
+
shortcutManager.setActiveContextName('grid');
|
4376
|
+
gridContext.addShortcuts([{
|
4377
|
+
keys: [['Control/Meta', 'A']],
|
4378
|
+
callback: () => {
|
4379
|
+
instance.selectAll();
|
4380
|
+
}
|
4381
|
+
}, {
|
4382
|
+
keys: [['Control/Meta', 'Enter']],
|
4383
|
+
callback: () => {
|
4384
|
+
const selectedRange = instance.getSelectedRange();
|
4385
|
+
const {
|
4386
|
+
row: highlightRow,
|
4387
|
+
col: highlightColumn
|
4388
|
+
} = selectedRange[selectedRange.length - 1].highlight;
|
4389
|
+
const valueToPopulate = instance.getDataAtCell(highlightRow, highlightColumn);
|
4390
|
+
const cellValues = new Map();
|
4391
|
+
for (let i = 0; i < selectedRange.length; i++) {
|
4392
|
+
selectedRange[i].forAll((row, column) => {
|
4393
|
+
if (row >= 0 && column >= 0 && (row !== highlightRow || column !== highlightColumn)) {
|
4394
|
+
const {
|
4395
|
+
readOnly
|
4396
|
+
} = instance.getCellMeta(row, column);
|
4397
|
+
if (!readOnly) {
|
4398
|
+
cellValues.set(`${row}x${column}`, [row, column, valueToPopulate]);
|
4399
|
+
}
|
4400
|
+
}
|
4401
|
+
});
|
4402
|
+
}
|
4403
|
+
instance.setDataAtCell(Array.from(cellValues.values()));
|
4404
|
+
},
|
4405
|
+
runOnlyIf: () => instance.getSelectedRangeLast().getCellsCount() > 1
|
4406
|
+
}, {
|
4407
|
+
keys: [['ArrowUp']],
|
4408
|
+
callback: () => {
|
4409
|
+
selection.transformStart(-1, 0);
|
4410
|
+
}
|
4411
|
+
}, {
|
4412
|
+
keys: [['ArrowUp', 'Control/Meta']],
|
4413
|
+
captureCtrl: true,
|
4414
|
+
callback: () => {
|
4415
|
+
selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1), instance.getSelectedRangeLast().highlight.col));
|
4416
|
+
}
|
4417
|
+
}, {
|
4418
|
+
keys: [['ArrowUp', 'Shift']],
|
4419
|
+
callback: () => {
|
4420
|
+
selection.transformEnd(-1, 0);
|
4421
|
+
}
|
4422
|
+
}, {
|
4423
|
+
keys: [['ArrowUp', 'Shift', 'Control/Meta']],
|
4424
|
+
captureCtrl: true,
|
4425
|
+
callback: () => {
|
4426
|
+
const {
|
4427
|
+
from,
|
4428
|
+
to
|
4429
|
+
} = instance.getSelectedRangeLast();
|
4430
|
+
const row = instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1);
|
4431
|
+
selection.setRangeStart(from.clone());
|
4432
|
+
selection.setRangeEnd(instance._createCellCoords(row, to.col));
|
4433
|
+
},
|
4434
|
+
runOnlyIf: () => !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader())
|
4435
|
+
}, {
|
4436
|
+
keys: [['ArrowDown']],
|
4437
|
+
callback: () => {
|
4438
|
+
selection.transformStart(1, 0);
|
4439
|
+
}
|
4440
|
+
}, {
|
4441
|
+
keys: [['ArrowDown', 'Control/Meta']],
|
4442
|
+
captureCtrl: true,
|
4443
|
+
callback: () => {
|
4444
|
+
selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1), instance.getSelectedRangeLast().highlight.col));
|
4445
|
+
}
|
4446
|
+
}, {
|
4447
|
+
keys: [['ArrowDown', 'Shift']],
|
4448
|
+
callback: () => {
|
4449
|
+
selection.transformEnd(1, 0);
|
4450
|
+
}
|
4451
|
+
}, {
|
4452
|
+
keys: [['ArrowDown', 'Shift', 'Control/Meta']],
|
4453
|
+
captureCtrl: true,
|
4454
|
+
callback: () => {
|
4455
|
+
const {
|
4456
|
+
from,
|
4457
|
+
to
|
4458
|
+
} = instance.getSelectedRangeLast();
|
4459
|
+
const row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1);
|
4460
|
+
selection.setRangeStart(from.clone());
|
4461
|
+
selection.setRangeEnd(instance._createCellCoords(row, to.col));
|
4462
|
+
},
|
4463
|
+
runOnlyIf: () => !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader())
|
4464
|
+
}, {
|
4465
|
+
keys: [['ArrowLeft']],
|
4466
|
+
callback: () => {
|
4467
|
+
selection.transformStart(0, -1 * instance.getDirectionFactor());
|
4468
|
+
}
|
4469
|
+
}, {
|
4470
|
+
keys: [['ArrowLeft', 'Control/Meta']],
|
4471
|
+
captureCtrl: true,
|
4472
|
+
callback: () => {
|
4473
|
+
const row = instance.getSelectedRangeLast().highlight.row;
|
4474
|
+
const column = instance.columnIndexMapper.getNearestNotHiddenIndex(...(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
|
4475
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4476
|
+
}
|
4477
|
+
}, {
|
4478
|
+
keys: [['ArrowLeft', 'Shift']],
|
4479
|
+
callback: () => {
|
4480
|
+
selection.transformEnd(0, -1 * instance.getDirectionFactor());
|
4481
|
+
}
|
4482
|
+
}, {
|
4483
|
+
keys: [['ArrowLeft', 'Shift', 'Control/Meta']],
|
4484
|
+
captureCtrl: true,
|
4485
|
+
callback: () => {
|
4486
|
+
const {
|
4487
|
+
from,
|
4488
|
+
to
|
4489
|
+
} = instance.getSelectedRangeLast();
|
4490
|
+
const column = instance.columnIndexMapper.getNearestNotHiddenIndex(...(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
|
4491
|
+
selection.setRangeStart(from.clone());
|
4492
|
+
selection.setRangeEnd(instance._createCellCoords(to.row, column));
|
4493
|
+
},
|
4494
|
+
runOnlyIf: () => !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader())
|
4495
|
+
}, {
|
4496
|
+
keys: [['ArrowRight']],
|
4497
|
+
callback: () => {
|
4498
|
+
selection.transformStart(0, instance.getDirectionFactor());
|
4499
|
+
}
|
4500
|
+
}, {
|
4501
|
+
keys: [['ArrowRight', 'Control/Meta']],
|
4502
|
+
captureCtrl: true,
|
4503
|
+
callback: () => {
|
4504
|
+
const row = instance.getSelectedRangeLast().highlight.row;
|
4505
|
+
const column = instance.columnIndexMapper.getNearestNotHiddenIndex(...(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
|
4506
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4507
|
+
}
|
4508
|
+
}, {
|
4509
|
+
keys: [['ArrowRight', 'Shift']],
|
4510
|
+
callback: () => {
|
4511
|
+
selection.transformEnd(0, instance.getDirectionFactor());
|
4512
|
+
}
|
4513
|
+
}, {
|
4514
|
+
keys: [['ArrowRight', 'Shift', 'Control/Meta']],
|
4515
|
+
captureCtrl: true,
|
4516
|
+
callback: () => {
|
4517
|
+
const {
|
4518
|
+
from,
|
4519
|
+
to
|
4520
|
+
} = instance.getSelectedRangeLast();
|
4521
|
+
const column = instance.columnIndexMapper.getNearestNotHiddenIndex(...(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
|
4522
|
+
selection.setRangeStart(from.clone());
|
4523
|
+
selection.setRangeEnd(instance._createCellCoords(to.row, column));
|
4524
|
+
},
|
4525
|
+
runOnlyIf: () => !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader())
|
4526
|
+
}, {
|
4527
|
+
keys: [['Home']],
|
4528
|
+
captureCtrl: true,
|
4529
|
+
callback: () => {
|
4530
|
+
const fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
|
4531
|
+
const row = instance.getSelectedRangeLast().highlight.row;
|
4532
|
+
const column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
|
4533
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4534
|
+
},
|
4535
|
+
runOnlyIf: () => instance.view.isMainTableNotFullyCoveredByOverlays()
|
4536
|
+
}, {
|
4537
|
+
keys: [['Home', 'Shift']],
|
4538
|
+
callback: () => {
|
4539
|
+
selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(0, 1)));
|
4540
|
+
}
|
4541
|
+
}, {
|
4542
|
+
keys: [['Home', 'Control/Meta']],
|
4543
|
+
captureCtrl: true,
|
4544
|
+
callback: () => {
|
4545
|
+
const fixedRows = parseInt(instance.getSettings().fixedRowsTop, 10);
|
4546
|
+
const fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
|
4547
|
+
const row = instance.rowIndexMapper.getNearestNotHiddenIndex(fixedRows, 1);
|
4548
|
+
const column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
|
4549
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4550
|
+
},
|
4551
|
+
runOnlyIf: () => instance.view.isMainTableNotFullyCoveredByOverlays()
|
4552
|
+
}, {
|
4553
|
+
keys: [['End']],
|
4554
|
+
captureCtrl: true,
|
4555
|
+
callback: () => {
|
4556
|
+
selection.setRangeStart(instance._createCellCoords(instance.getSelectedRangeLast().highlight.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
|
4557
|
+
},
|
4558
|
+
runOnlyIf: () => instance.view.isMainTableNotFullyCoveredByOverlays()
|
4559
|
+
}, {
|
4560
|
+
keys: [['End', 'Shift']],
|
4561
|
+
callback: () => {
|
4562
|
+
selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
|
4563
|
+
}
|
4564
|
+
}, {
|
4565
|
+
keys: [['End', 'Control/Meta']],
|
4566
|
+
captureCtrl: true,
|
4567
|
+
callback: () => {
|
4568
|
+
const fixedRows = parseInt(instance.getSettings().fixedRowsBottom, 10);
|
4569
|
+
const row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - fixedRows - 1, -1);
|
4570
|
+
const column = instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1);
|
4571
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4572
|
+
},
|
4573
|
+
runOnlyIf: () => instance.view.isMainTableNotFullyCoveredByOverlays()
|
4574
|
+
}, {
|
4575
|
+
keys: [['PageUp']],
|
4576
|
+
callback: () => {
|
4577
|
+
selection.transformStart(-instance.countVisibleRows(), 0);
|
4578
|
+
}
|
4579
|
+
}, {
|
4580
|
+
keys: [['PageUp', 'Shift']],
|
4581
|
+
callback: () => {
|
4582
|
+
const {
|
4583
|
+
to
|
4584
|
+
} = instance.getSelectedRangeLast();
|
4585
|
+
const nextRowIndexToSelect = Math.max(to.row - instance.countVisibleRows(), 0);
|
4586
|
+
const row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, 1);
|
4587
|
+
if (row !== null) {
|
4588
|
+
const coords = instance._createCellCoords(row, to.col);
|
4589
|
+
const scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
|
4590
|
+
const nextVerticalScroll = Math.max(coords.row - scrollPadding, 0);
|
4591
|
+
selection.setRangeEnd(coords);
|
4592
|
+
instance.scrollViewportTo(nextVerticalScroll);
|
4593
|
+
}
|
4594
|
+
}
|
4595
|
+
}, {
|
4596
|
+
keys: [['PageDown']],
|
4597
|
+
callback: () => {
|
4598
|
+
selection.transformStart(instance.countVisibleRows(), 0);
|
4599
|
+
}
|
4600
|
+
}, {
|
4601
|
+
keys: [['PageDown', 'Shift']],
|
4602
|
+
callback: () => {
|
4603
|
+
const {
|
4604
|
+
to
|
4605
|
+
} = instance.getSelectedRangeLast();
|
4606
|
+
const nextRowIndexToSelect = Math.min(to.row + instance.countVisibleRows(), instance.countRows() - 1);
|
4607
|
+
const row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, -1);
|
4608
|
+
if (row !== null) {
|
4609
|
+
const coords = instance._createCellCoords(row, to.col);
|
4610
|
+
const scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
|
4611
|
+
const nextVerticalScroll = Math.min(coords.row - scrollPadding, instance.countRows() - 1);
|
4612
|
+
selection.setRangeEnd(coords);
|
4613
|
+
instance.scrollViewportTo(nextVerticalScroll);
|
4614
|
+
}
|
4615
|
+
}
|
4616
|
+
}, {
|
4617
|
+
keys: [['Tab']],
|
4618
|
+
callback: event => {
|
4619
|
+
const tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
4620
|
+
selection.transformStart(tabMoves.row, tabMoves.col, true);
|
4621
|
+
}
|
4622
|
+
}, {
|
4623
|
+
keys: [['Shift', 'Tab']],
|
4624
|
+
callback: event => {
|
4625
|
+
const tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
4626
|
+
selection.transformStart(-tabMoves.row, -tabMoves.col);
|
4627
|
+
}
|
4628
|
+
}], gridConfig);
|
4585
4629
|
getPluginsNames().forEach(pluginName => {
|
4586
4630
|
const PluginClass = getPlugin(pluginName);
|
4587
4631
|
pluginsRegistry.addItem(pluginName, new PluginClass(this));
|
4588
4632
|
});
|
4589
|
-
registerAllShortcutContexts(instance);
|
4590
|
-
shortcutManager.setActiveContextName('grid');
|
4591
4633
|
Hooks.getSingleton().run(instance, 'construct');
|
4592
4634
|
}
|