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/editorManager.js
CHANGED
@@ -3,15 +3,12 @@
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
var _unicode = require("./helpers/unicode");
|
5
5
|
var _event = require("./helpers/dom/event");
|
6
|
-
var _element = require("./helpers/dom/element");
|
7
6
|
var _registry = require("./editors/registry");
|
8
7
|
var _eventManager = _interopRequireDefault(require("./eventManager"));
|
9
8
|
var _mixed = require("./helpers/mixed");
|
10
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
10
|
const SHORTCUTS_GROUP_NAVIGATION = 'editorManager.navigation';
|
12
11
|
exports.SHORTCUTS_GROUP_NAVIGATION = SHORTCUTS_GROUP_NAVIGATION;
|
13
|
-
const SHORTCUTS_GROUP_EDITOR = 'editorManager.handlingEditor';
|
14
|
-
exports.SHORTCUTS_GROUP_EDITOR = SHORTCUTS_GROUP_EDITOR;
|
15
12
|
class EditorManager {
|
16
13
|
/**
|
17
14
|
* @param {Core} instance The Handsontable instance.
|
@@ -74,9 +71,6 @@ class EditorManager {
|
|
74
71
|
* @type {object}
|
75
72
|
*/
|
76
73
|
this.cellProperties = void 0;
|
77
|
-
const shortcutManager = this.instance.getShortcutManager();
|
78
|
-
shortcutManager.addContext('editor');
|
79
|
-
this.registerShortcuts();
|
80
74
|
this.instance.addHook('afterDocumentKeyDown', event => this.onAfterDocumentKeyDown(event));
|
81
75
|
|
82
76
|
// Open editor when text composition is started (IME editor)
|
@@ -88,62 +82,6 @@ class EditorManager {
|
|
88
82
|
this.instance.view._wt.update('onCellDblClick', (event, coords, elem) => this.onCellDblClick(event, coords, elem));
|
89
83
|
}
|
90
84
|
|
91
|
-
/**
|
92
|
-
* Register shortcuts responsible for handling some actions related to an editor.
|
93
|
-
*
|
94
|
-
* @private
|
95
|
-
*/
|
96
|
-
registerShortcuts() {
|
97
|
-
const shortcutManager = this.instance.getShortcutManager();
|
98
|
-
const gridContext = shortcutManager.getContext('grid');
|
99
|
-
const editorContext = shortcutManager.getContext('editor');
|
100
|
-
const config = {
|
101
|
-
group: SHORTCUTS_GROUP_EDITOR
|
102
|
-
};
|
103
|
-
editorContext.addShortcuts([{
|
104
|
-
keys: [['Enter'], ['Enter', 'Shift'], ['Enter', 'Control/Meta'], ['Enter', 'Control/Meta', 'Shift']],
|
105
|
-
callback: (event, keys) => {
|
106
|
-
this.closeEditorAndSaveChanges(shortcutManager.isCtrlPressed());
|
107
|
-
this.moveSelectionAfterEnter(keys.includes('shift'));
|
108
|
-
}
|
109
|
-
}, {
|
110
|
-
keys: [['Escape'], ['Escape', 'Control/Meta']],
|
111
|
-
callback: () => {
|
112
|
-
this.closeEditorAndRestoreOriginalValue(shortcutManager.isCtrlPressed());
|
113
|
-
this.activeEditor.focus();
|
114
|
-
}
|
115
|
-
}], config);
|
116
|
-
gridContext.addShortcuts([{
|
117
|
-
keys: [['F2']],
|
118
|
-
callback: event => {
|
119
|
-
this.openEditor(null, event, true);
|
120
|
-
}
|
121
|
-
}, {
|
122
|
-
keys: [['Backspace'], ['Delete']],
|
123
|
-
callback: () => {
|
124
|
-
this.instance.emptySelectedCells();
|
125
|
-
this.prepareEditor();
|
126
|
-
}
|
127
|
-
}, {
|
128
|
-
keys: [['Enter'], ['Enter', 'Shift']],
|
129
|
-
callback: (event, keys) => {
|
130
|
-
if (this.instance.getSettings().enterBeginsEditing) {
|
131
|
-
if (this.cellProperties.readOnly) {
|
132
|
-
this.moveSelectionAfterEnter();
|
133
|
-
} else {
|
134
|
-
this.openEditor(null, event, true);
|
135
|
-
}
|
136
|
-
} else {
|
137
|
-
this.moveSelectionAfterEnter(keys.includes('shift'));
|
138
|
-
}
|
139
|
-
(0, _event.stopImmediatePropagation)(event); // required by HandsontableEditor
|
140
|
-
}
|
141
|
-
}], {
|
142
|
-
...config,
|
143
|
-
runOnlyIf: () => (0, _mixed.isDefined)(this.instance.getSelected())
|
144
|
-
});
|
145
|
-
}
|
146
|
-
|
147
85
|
/**
|
148
86
|
* Lock the editor from being prepared and closed. Locking the editor prevents its closing and
|
149
87
|
* reinitialized after selecting the new cell. This feature is necessary for a mobile editor.
|
@@ -196,10 +134,16 @@ class EditorManager {
|
|
196
134
|
});
|
197
135
|
return;
|
198
136
|
}
|
137
|
+
const {
|
138
|
+
highlight
|
139
|
+
} = this.instance.getSelectedRangeLast();
|
140
|
+
if (highlight.isHeader()) {
|
141
|
+
return;
|
142
|
+
}
|
199
143
|
const {
|
200
144
|
row,
|
201
145
|
col
|
202
|
-
} =
|
146
|
+
} = highlight;
|
203
147
|
const modifiedCellCoords = this.instance.runHooks('modifyGetCellCoords', row, col);
|
204
148
|
let visualRowToCheck = row;
|
205
149
|
let visualColumnToCheck = col;
|
@@ -209,17 +153,6 @@ class EditorManager {
|
|
209
153
|
|
210
154
|
// Getting values using the modified coordinates.
|
211
155
|
this.cellProperties = this.instance.getCellMeta(visualRowToCheck, visualColumnToCheck);
|
212
|
-
const {
|
213
|
-
activeElement
|
214
|
-
} = this.instance.rootDocument;
|
215
|
-
|
216
|
-
// Blurring the `activeElement` removes the unwanted border around the focusable element (#6877)
|
217
|
-
// and resets the `document.activeElement` property. The blurring should happen only when the
|
218
|
-
// previously selected input element has not belonged to the Handsontable editor. If blurring is
|
219
|
-
// triggered for all elements, there is a problem with the disappearing IME editor (#9672).
|
220
|
-
if (activeElement && (0, _element.isOutsideInput)(activeElement)) {
|
221
|
-
activeElement.blur();
|
222
|
-
}
|
223
156
|
if (!this.isCellEditable()) {
|
224
157
|
this.clearActiveEditor();
|
225
158
|
return;
|
@@ -263,14 +196,7 @@ class EditorManager {
|
|
263
196
|
return;
|
264
197
|
}
|
265
198
|
if (!this.activeEditor) {
|
266
|
-
|
267
|
-
row,
|
268
|
-
col
|
269
|
-
} = this.instance.getSelectedRangeLast().highlight;
|
270
|
-
const renderableRowIndex = this.instance.rowIndexMapper.getRenderableFromVisualIndex(row);
|
271
|
-
const renderableColumnIndex = this.instance.columnIndexMapper.getRenderableFromVisualIndex(col);
|
272
|
-
this.instance.view.scrollViewport(this.instance._createCellCoords(renderableRowIndex, renderableColumnIndex));
|
273
|
-
this.instance.view.render();
|
199
|
+
this.instance.scrollToFocusedCell();
|
274
200
|
this.prepareEditor();
|
275
201
|
}
|
276
202
|
if (this.activeEditor) {
|
@@ -334,11 +260,15 @@ class EditorManager {
|
|
334
260
|
* @returns {boolean}
|
335
261
|
*/
|
336
262
|
isCellEditable() {
|
263
|
+
const selection = this.instance.getSelectedRangeLast();
|
264
|
+
if (!selection) {
|
265
|
+
return false;
|
266
|
+
}
|
337
267
|
const editorClass = this.instance.getCellEditor(this.cellProperties);
|
338
268
|
const {
|
339
269
|
row,
|
340
270
|
col
|
341
|
-
} =
|
271
|
+
} = selection.highlight;
|
342
272
|
const {
|
343
273
|
rowIndexMapper,
|
344
274
|
columnIndexMapper
|
@@ -374,15 +304,13 @@ class EditorManager {
|
|
374
304
|
* @param {KeyboardEvent} event The keyboard event object.
|
375
305
|
*/
|
376
306
|
onAfterDocumentKeyDown(event) {
|
377
|
-
|
307
|
+
const selection = this.instance.getSelectedRangeLast();
|
308
|
+
if (!this.instance.isListening() || !selection || selection.highlight.isHeader() || (0, _event.isImmediatePropagationStopped)(event)) {
|
378
309
|
return;
|
379
310
|
}
|
380
311
|
const {
|
381
312
|
keyCode
|
382
313
|
} = event;
|
383
|
-
if (!this.selection.isSelected()) {
|
384
|
-
return;
|
385
|
-
}
|
386
314
|
|
387
315
|
// catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)
|
388
316
|
const isCtrlPressed = (event.ctrlKey || event.metaKey) && !event.altKey;
|
package/editorManager.mjs
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
import { isFunctionKey, isCtrlMetaKey } from "./helpers/unicode.mjs";
|
2
|
-
import {
|
3
|
-
import { isOutsideInput } from "./helpers/dom/element.mjs";
|
2
|
+
import { isImmediatePropagationStopped } from "./helpers/dom/event.mjs";
|
4
3
|
import { getEditorInstance } from "./editors/registry.mjs";
|
5
4
|
import EventManager from "./eventManager.mjs";
|
6
5
|
import { isDefined } from "./helpers/mixed.mjs";
|
7
6
|
export const SHORTCUTS_GROUP_NAVIGATION = 'editorManager.navigation';
|
8
|
-
export const SHORTCUTS_GROUP_EDITOR = 'editorManager.handlingEditor';
|
9
7
|
class EditorManager {
|
10
8
|
/**
|
11
9
|
* @param {Core} instance The Handsontable instance.
|
@@ -68,9 +66,6 @@ class EditorManager {
|
|
68
66
|
* @type {object}
|
69
67
|
*/
|
70
68
|
this.cellProperties = void 0;
|
71
|
-
const shortcutManager = this.instance.getShortcutManager();
|
72
|
-
shortcutManager.addContext('editor');
|
73
|
-
this.registerShortcuts();
|
74
69
|
this.instance.addHook('afterDocumentKeyDown', event => this.onAfterDocumentKeyDown(event));
|
75
70
|
|
76
71
|
// Open editor when text composition is started (IME editor)
|
@@ -82,62 +77,6 @@ class EditorManager {
|
|
82
77
|
this.instance.view._wt.update('onCellDblClick', (event, coords, elem) => this.onCellDblClick(event, coords, elem));
|
83
78
|
}
|
84
79
|
|
85
|
-
/**
|
86
|
-
* Register shortcuts responsible for handling some actions related to an editor.
|
87
|
-
*
|
88
|
-
* @private
|
89
|
-
*/
|
90
|
-
registerShortcuts() {
|
91
|
-
const shortcutManager = this.instance.getShortcutManager();
|
92
|
-
const gridContext = shortcutManager.getContext('grid');
|
93
|
-
const editorContext = shortcutManager.getContext('editor');
|
94
|
-
const config = {
|
95
|
-
group: SHORTCUTS_GROUP_EDITOR
|
96
|
-
};
|
97
|
-
editorContext.addShortcuts([{
|
98
|
-
keys: [['Enter'], ['Enter', 'Shift'], ['Enter', 'Control/Meta'], ['Enter', 'Control/Meta', 'Shift']],
|
99
|
-
callback: (event, keys) => {
|
100
|
-
this.closeEditorAndSaveChanges(shortcutManager.isCtrlPressed());
|
101
|
-
this.moveSelectionAfterEnter(keys.includes('shift'));
|
102
|
-
}
|
103
|
-
}, {
|
104
|
-
keys: [['Escape'], ['Escape', 'Control/Meta']],
|
105
|
-
callback: () => {
|
106
|
-
this.closeEditorAndRestoreOriginalValue(shortcutManager.isCtrlPressed());
|
107
|
-
this.activeEditor.focus();
|
108
|
-
}
|
109
|
-
}], config);
|
110
|
-
gridContext.addShortcuts([{
|
111
|
-
keys: [['F2']],
|
112
|
-
callback: event => {
|
113
|
-
this.openEditor(null, event, true);
|
114
|
-
}
|
115
|
-
}, {
|
116
|
-
keys: [['Backspace'], ['Delete']],
|
117
|
-
callback: () => {
|
118
|
-
this.instance.emptySelectedCells();
|
119
|
-
this.prepareEditor();
|
120
|
-
}
|
121
|
-
}, {
|
122
|
-
keys: [['Enter'], ['Enter', 'Shift']],
|
123
|
-
callback: (event, keys) => {
|
124
|
-
if (this.instance.getSettings().enterBeginsEditing) {
|
125
|
-
if (this.cellProperties.readOnly) {
|
126
|
-
this.moveSelectionAfterEnter();
|
127
|
-
} else {
|
128
|
-
this.openEditor(null, event, true);
|
129
|
-
}
|
130
|
-
} else {
|
131
|
-
this.moveSelectionAfterEnter(keys.includes('shift'));
|
132
|
-
}
|
133
|
-
stopImmediatePropagation(event); // required by HandsontableEditor
|
134
|
-
}
|
135
|
-
}], {
|
136
|
-
...config,
|
137
|
-
runOnlyIf: () => isDefined(this.instance.getSelected())
|
138
|
-
});
|
139
|
-
}
|
140
|
-
|
141
80
|
/**
|
142
81
|
* Lock the editor from being prepared and closed. Locking the editor prevents its closing and
|
143
82
|
* reinitialized after selecting the new cell. This feature is necessary for a mobile editor.
|
@@ -190,10 +129,16 @@ class EditorManager {
|
|
190
129
|
});
|
191
130
|
return;
|
192
131
|
}
|
132
|
+
const {
|
133
|
+
highlight
|
134
|
+
} = this.instance.getSelectedRangeLast();
|
135
|
+
if (highlight.isHeader()) {
|
136
|
+
return;
|
137
|
+
}
|
193
138
|
const {
|
194
139
|
row,
|
195
140
|
col
|
196
|
-
} =
|
141
|
+
} = highlight;
|
197
142
|
const modifiedCellCoords = this.instance.runHooks('modifyGetCellCoords', row, col);
|
198
143
|
let visualRowToCheck = row;
|
199
144
|
let visualColumnToCheck = col;
|
@@ -203,17 +148,6 @@ class EditorManager {
|
|
203
148
|
|
204
149
|
// Getting values using the modified coordinates.
|
205
150
|
this.cellProperties = this.instance.getCellMeta(visualRowToCheck, visualColumnToCheck);
|
206
|
-
const {
|
207
|
-
activeElement
|
208
|
-
} = this.instance.rootDocument;
|
209
|
-
|
210
|
-
// Blurring the `activeElement` removes the unwanted border around the focusable element (#6877)
|
211
|
-
// and resets the `document.activeElement` property. The blurring should happen only when the
|
212
|
-
// previously selected input element has not belonged to the Handsontable editor. If blurring is
|
213
|
-
// triggered for all elements, there is a problem with the disappearing IME editor (#9672).
|
214
|
-
if (activeElement && isOutsideInput(activeElement)) {
|
215
|
-
activeElement.blur();
|
216
|
-
}
|
217
151
|
if (!this.isCellEditable()) {
|
218
152
|
this.clearActiveEditor();
|
219
153
|
return;
|
@@ -257,14 +191,7 @@ class EditorManager {
|
|
257
191
|
return;
|
258
192
|
}
|
259
193
|
if (!this.activeEditor) {
|
260
|
-
|
261
|
-
row,
|
262
|
-
col
|
263
|
-
} = this.instance.getSelectedRangeLast().highlight;
|
264
|
-
const renderableRowIndex = this.instance.rowIndexMapper.getRenderableFromVisualIndex(row);
|
265
|
-
const renderableColumnIndex = this.instance.columnIndexMapper.getRenderableFromVisualIndex(col);
|
266
|
-
this.instance.view.scrollViewport(this.instance._createCellCoords(renderableRowIndex, renderableColumnIndex));
|
267
|
-
this.instance.view.render();
|
194
|
+
this.instance.scrollToFocusedCell();
|
268
195
|
this.prepareEditor();
|
269
196
|
}
|
270
197
|
if (this.activeEditor) {
|
@@ -328,11 +255,15 @@ class EditorManager {
|
|
328
255
|
* @returns {boolean}
|
329
256
|
*/
|
330
257
|
isCellEditable() {
|
258
|
+
const selection = this.instance.getSelectedRangeLast();
|
259
|
+
if (!selection) {
|
260
|
+
return false;
|
261
|
+
}
|
331
262
|
const editorClass = this.instance.getCellEditor(this.cellProperties);
|
332
263
|
const {
|
333
264
|
row,
|
334
265
|
col
|
335
|
-
} =
|
266
|
+
} = selection.highlight;
|
336
267
|
const {
|
337
268
|
rowIndexMapper,
|
338
269
|
columnIndexMapper
|
@@ -368,15 +299,13 @@ class EditorManager {
|
|
368
299
|
* @param {KeyboardEvent} event The keyboard event object.
|
369
300
|
*/
|
370
301
|
onAfterDocumentKeyDown(event) {
|
371
|
-
|
302
|
+
const selection = this.instance.getSelectedRangeLast();
|
303
|
+
if (!this.instance.isListening() || !selection || selection.highlight.isHeader() || isImmediatePropagationStopped(event)) {
|
372
304
|
return;
|
373
305
|
}
|
374
306
|
const {
|
375
307
|
keyCode
|
376
308
|
} = event;
|
377
|
-
if (!this.selection.isSelected()) {
|
378
|
-
return;
|
379
|
-
}
|
380
309
|
|
381
310
|
// catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)
|
382
311
|
const isCtrlPressed = (event.ctrlKey || event.metaKey) && !event.altKey;
|
@@ -10,6 +10,7 @@ var _mixed = require("../../helpers/mixed");
|
|
10
10
|
var _string = require("../../helpers/string");
|
11
11
|
var _unicode = require("../../helpers/unicode");
|
12
12
|
var _textRenderer = require("../../renderers/textRenderer");
|
13
|
+
var _a11y = require("../../helpers/a11y");
|
13
14
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
14
15
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
15
16
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
@@ -113,7 +114,8 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
113
114
|
this.rawChoices = [];
|
114
115
|
privatePool.set(this, {
|
115
116
|
skipOne: false,
|
116
|
-
isMacOS: this.hot.rootWindow.navigator.platform.indexOf('Mac') > -1
|
117
|
+
isMacOS: this.hot.rootWindow.navigator.platform.indexOf('Mac') > -1,
|
118
|
+
idPrefix: instance.guid.slice(0, 9)
|
117
119
|
});
|
118
120
|
}
|
119
121
|
|
@@ -140,6 +142,27 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
140
142
|
super.createElements();
|
141
143
|
(0, _element.addClass)(this.htContainer, 'autocompleteEditor');
|
142
144
|
(0, _element.addClass)(this.htContainer, this.hot.rootWindow.navigator.platform.indexOf('Mac') === -1 ? '' : 'htMacScroll');
|
145
|
+
if (this.hot.getSettings().ariaTags) {
|
146
|
+
(0, _element.setAttribute)(this.TEXTAREA, [(0, _a11y.A11Y_TEXT)(), (0, _a11y.A11Y_COMBOBOX)(), (0, _a11y.A11Y_HASPOPUP)('listbox'), (0, _a11y.A11Y_AUTOCOMPLETE)()]);
|
147
|
+
}
|
148
|
+
}
|
149
|
+
|
150
|
+
/**
|
151
|
+
* Prepares editor's metadata and configuration of the internal Handsontable's instance.
|
152
|
+
*
|
153
|
+
* @param {number} row The visual row index.
|
154
|
+
* @param {number} col The visual column index.
|
155
|
+
* @param {number|string} prop The column property (passed when datasource is an array of objects).
|
156
|
+
* @param {HTMLTableCellElement} td The rendered cell element.
|
157
|
+
* @param {*} value The rendered value.
|
158
|
+
* @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}).
|
159
|
+
*/
|
160
|
+
prepare(row, col, prop, td, value, cellProperties) {
|
161
|
+
const priv = privatePool.get(this);
|
162
|
+
super.prepare(row, col, prop, td, value, cellProperties);
|
163
|
+
if (this.hot.getSettings().ariaTags) {
|
164
|
+
(0, _element.setAttribute)(this.TEXTAREA, [(0, _a11y.A11Y_EXPANDED)('false'), (0, _a11y.A11Y_CONTROLS)(`${priv.idPrefix}-listbox-${row}-${col}`)]);
|
165
|
+
}
|
143
166
|
}
|
144
167
|
|
145
168
|
/**
|
@@ -149,6 +172,13 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
149
172
|
const priv = privatePool.get(this);
|
150
173
|
super.open();
|
151
174
|
const trimDropdown = this.cellProperties.trimDropdown === void 0 ? true : this.cellProperties.trimDropdown;
|
175
|
+
const rootInstanceAriaTagsEnabled = this.hot.getSettings().ariaTags;
|
176
|
+
const sourceArray = Array.isArray(this.cellProperties.source) ? this.cellProperties.source : null;
|
177
|
+
const sourceSize = sourceArray === null || sourceArray === void 0 ? void 0 : sourceArray.length;
|
178
|
+
const {
|
179
|
+
row: rowIndex,
|
180
|
+
col: colIndex
|
181
|
+
} = this;
|
152
182
|
this.showEditableElement();
|
153
183
|
this.focus();
|
154
184
|
let scrollbarWidth = (0, _element.getScrollbarWidth)();
|
@@ -160,6 +190,7 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
160
190
|
this.htEditor.updateSettings({
|
161
191
|
colWidths: trimDropdown ? [(0, _element.outerWidth)(this.TEXTAREA) - 2] : void 0,
|
162
192
|
width: trimDropdown ? (0, _element.outerWidth)(this.TEXTAREA) + scrollbarWidth : void 0,
|
193
|
+
autoColumnSize: true,
|
163
194
|
renderer: (instance, TD, row, col, prop, value, cellProperties) => {
|
164
195
|
(0, _textRenderer.textRenderer)(instance, TD, row, col, prop, value, cellProperties);
|
165
196
|
const {
|
@@ -178,10 +209,27 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
178
209
|
cellValue = cellValue.replace(match, `<strong>${match}</strong>`);
|
179
210
|
}
|
180
211
|
}
|
212
|
+
if (rootInstanceAriaTagsEnabled) {
|
213
|
+
(0, _element.setAttribute)(TD, [(0, _a11y.A11Y_OPTION)(),
|
214
|
+
// Add `setsize` and `posinset` only if the source is an array.
|
215
|
+
...(sourceArray ? [(0, _a11y.A11Y_SETSIZE)(sourceSize)] : []), ...(sourceArray ? [(0, _a11y.A11Y_POSINSET)(sourceArray.indexOf(value) + 1)] : []), ['id', `${this.htEditor.rootElement.id}_${row}-${col}`]]);
|
216
|
+
}
|
181
217
|
TD.innerHTML = cellValue;
|
182
218
|
},
|
183
|
-
|
219
|
+
afterSelection: (startRow, startCol) => {
|
220
|
+
if (rootInstanceAriaTagsEnabled) {
|
221
|
+
const TD = this.htEditor.getCell(startRow, startCol, true);
|
222
|
+
(0, _element.setAttribute)(TD, [(0, _a11y.A11Y_SELECTED)()]);
|
223
|
+
(0, _element.setAttribute)(this.TEXTAREA, ...(0, _a11y.A11Y_ACTIVEDESCENDANT)(TD.id));
|
224
|
+
}
|
225
|
+
}
|
184
226
|
});
|
227
|
+
if (rootInstanceAriaTagsEnabled) {
|
228
|
+
// Add `role=presentation` to the main table to prevent the readers from treating the option list as a table.
|
229
|
+
(0, _element.setAttribute)(this.htEditor.view._wt.wtOverlays.wtTable.TABLE, ...(0, _a11y.A11Y_PRESENTATION)());
|
230
|
+
(0, _element.setAttribute)(this.htEditor.rootElement, [(0, _a11y.A11Y_LISTBOX)(), (0, _a11y.A11Y_LIVE)('polite'), (0, _a11y.A11Y_RELEVANT)('text'), ['id', `${priv.idPrefix}-listbox-${rowIndex}-${colIndex}`]]);
|
231
|
+
(0, _element.setAttribute)(this.TEXTAREA, ...(0, _a11y.A11Y_EXPANDED)('true'));
|
232
|
+
}
|
185
233
|
if (priv.skipOne) {
|
186
234
|
priv.skipOne = false;
|
187
235
|
}
|
@@ -196,6 +244,9 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
196
244
|
close() {
|
197
245
|
this.removeHooksByKey('beforeKeyDown');
|
198
246
|
super.close();
|
247
|
+
if (this.hot.getSettings().ariaTags) {
|
248
|
+
(0, _element.setAttribute)(this.TEXTAREA, [(0, _a11y.A11Y_EXPANDED)('false')]);
|
249
|
+
}
|
199
250
|
}
|
200
251
|
|
201
252
|
/**
|
@@ -5,11 +5,12 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
|
|
5
5
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
6
6
|
import { HandsontableEditor } from "../handsontableEditor/index.mjs";
|
7
7
|
import { arrayMap, pivot } from "../../helpers/array.mjs";
|
8
|
-
import { addClass, getCaretPosition, getScrollbarWidth, getSelectionEndPosition, getTrimmingContainer, offset, outerHeight, outerWidth, setCaretPosition } from "../../helpers/dom/element.mjs";
|
8
|
+
import { addClass, getCaretPosition, getScrollbarWidth, getSelectionEndPosition, getTrimmingContainer, offset, outerHeight, outerWidth, setAttribute, setCaretPosition } from "../../helpers/dom/element.mjs";
|
9
9
|
import { isDefined, stringify } from "../../helpers/mixed.mjs";
|
10
10
|
import { stripTags } from "../../helpers/string.mjs";
|
11
11
|
import { KEY_CODES, isPrintableChar } from "../../helpers/unicode.mjs";
|
12
12
|
import { textRenderer } from "../../renderers/textRenderer/index.mjs";
|
13
|
+
import { A11Y_ACTIVEDESCENDANT, A11Y_AUTOCOMPLETE, A11Y_COMBOBOX, A11Y_CONTROLS, A11Y_EXPANDED, A11Y_HASPOPUP, A11Y_LISTBOX, A11Y_LIVE, A11Y_OPTION, A11Y_POSINSET, A11Y_PRESENTATION, A11Y_RELEVANT, A11Y_SELECTED, A11Y_SETSIZE, A11Y_TEXT } from "../../helpers/a11y.mjs";
|
13
14
|
const privatePool = new WeakMap();
|
14
15
|
export const EDITOR_TYPE = 'autocomplete';
|
15
16
|
|
@@ -109,7 +110,8 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
109
110
|
this.rawChoices = [];
|
110
111
|
privatePool.set(this, {
|
111
112
|
skipOne: false,
|
112
|
-
isMacOS: this.hot.rootWindow.navigator.platform.indexOf('Mac') > -1
|
113
|
+
isMacOS: this.hot.rootWindow.navigator.platform.indexOf('Mac') > -1,
|
114
|
+
idPrefix: instance.guid.slice(0, 9)
|
113
115
|
});
|
114
116
|
}
|
115
117
|
|
@@ -136,6 +138,27 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
136
138
|
super.createElements();
|
137
139
|
addClass(this.htContainer, 'autocompleteEditor');
|
138
140
|
addClass(this.htContainer, this.hot.rootWindow.navigator.platform.indexOf('Mac') === -1 ? '' : 'htMacScroll');
|
141
|
+
if (this.hot.getSettings().ariaTags) {
|
142
|
+
setAttribute(this.TEXTAREA, [A11Y_TEXT(), A11Y_COMBOBOX(), A11Y_HASPOPUP('listbox'), A11Y_AUTOCOMPLETE()]);
|
143
|
+
}
|
144
|
+
}
|
145
|
+
|
146
|
+
/**
|
147
|
+
* Prepares editor's metadata and configuration of the internal Handsontable's instance.
|
148
|
+
*
|
149
|
+
* @param {number} row The visual row index.
|
150
|
+
* @param {number} col The visual column index.
|
151
|
+
* @param {number|string} prop The column property (passed when datasource is an array of objects).
|
152
|
+
* @param {HTMLTableCellElement} td The rendered cell element.
|
153
|
+
* @param {*} value The rendered value.
|
154
|
+
* @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}).
|
155
|
+
*/
|
156
|
+
prepare(row, col, prop, td, value, cellProperties) {
|
157
|
+
const priv = privatePool.get(this);
|
158
|
+
super.prepare(row, col, prop, td, value, cellProperties);
|
159
|
+
if (this.hot.getSettings().ariaTags) {
|
160
|
+
setAttribute(this.TEXTAREA, [A11Y_EXPANDED('false'), A11Y_CONTROLS(`${priv.idPrefix}-listbox-${row}-${col}`)]);
|
161
|
+
}
|
139
162
|
}
|
140
163
|
|
141
164
|
/**
|
@@ -145,6 +168,13 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
145
168
|
const priv = privatePool.get(this);
|
146
169
|
super.open();
|
147
170
|
const trimDropdown = this.cellProperties.trimDropdown === void 0 ? true : this.cellProperties.trimDropdown;
|
171
|
+
const rootInstanceAriaTagsEnabled = this.hot.getSettings().ariaTags;
|
172
|
+
const sourceArray = Array.isArray(this.cellProperties.source) ? this.cellProperties.source : null;
|
173
|
+
const sourceSize = sourceArray === null || sourceArray === void 0 ? void 0 : sourceArray.length;
|
174
|
+
const {
|
175
|
+
row: rowIndex,
|
176
|
+
col: colIndex
|
177
|
+
} = this;
|
148
178
|
this.showEditableElement();
|
149
179
|
this.focus();
|
150
180
|
let scrollbarWidth = getScrollbarWidth();
|
@@ -156,6 +186,7 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
156
186
|
this.htEditor.updateSettings({
|
157
187
|
colWidths: trimDropdown ? [outerWidth(this.TEXTAREA) - 2] : void 0,
|
158
188
|
width: trimDropdown ? outerWidth(this.TEXTAREA) + scrollbarWidth : void 0,
|
189
|
+
autoColumnSize: true,
|
159
190
|
renderer: (instance, TD, row, col, prop, value, cellProperties) => {
|
160
191
|
textRenderer(instance, TD, row, col, prop, value, cellProperties);
|
161
192
|
const {
|
@@ -174,10 +205,27 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
174
205
|
cellValue = cellValue.replace(match, `<strong>${match}</strong>`);
|
175
206
|
}
|
176
207
|
}
|
208
|
+
if (rootInstanceAriaTagsEnabled) {
|
209
|
+
setAttribute(TD, [A11Y_OPTION(),
|
210
|
+
// Add `setsize` and `posinset` only if the source is an array.
|
211
|
+
...(sourceArray ? [A11Y_SETSIZE(sourceSize)] : []), ...(sourceArray ? [A11Y_POSINSET(sourceArray.indexOf(value) + 1)] : []), ['id', `${this.htEditor.rootElement.id}_${row}-${col}`]]);
|
212
|
+
}
|
177
213
|
TD.innerHTML = cellValue;
|
178
214
|
},
|
179
|
-
|
215
|
+
afterSelection: (startRow, startCol) => {
|
216
|
+
if (rootInstanceAriaTagsEnabled) {
|
217
|
+
const TD = this.htEditor.getCell(startRow, startCol, true);
|
218
|
+
setAttribute(TD, [A11Y_SELECTED()]);
|
219
|
+
setAttribute(this.TEXTAREA, ...A11Y_ACTIVEDESCENDANT(TD.id));
|
220
|
+
}
|
221
|
+
}
|
180
222
|
});
|
223
|
+
if (rootInstanceAriaTagsEnabled) {
|
224
|
+
// Add `role=presentation` to the main table to prevent the readers from treating the option list as a table.
|
225
|
+
setAttribute(this.htEditor.view._wt.wtOverlays.wtTable.TABLE, ...A11Y_PRESENTATION());
|
226
|
+
setAttribute(this.htEditor.rootElement, [A11Y_LISTBOX(), A11Y_LIVE('polite'), A11Y_RELEVANT('text'), ['id', `${priv.idPrefix}-listbox-${rowIndex}-${colIndex}`]]);
|
227
|
+
setAttribute(this.TEXTAREA, ...A11Y_EXPANDED('true'));
|
228
|
+
}
|
181
229
|
if (priv.skipOne) {
|
182
230
|
priv.skipOne = false;
|
183
231
|
}
|
@@ -192,6 +240,9 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
192
240
|
close() {
|
193
241
|
this.removeHooksByKey('beforeKeyDown');
|
194
242
|
super.close();
|
243
|
+
if (this.hot.getSettings().ariaTags) {
|
244
|
+
setAttribute(this.TEXTAREA, [A11Y_EXPANDED('false')]);
|
245
|
+
}
|
195
246
|
}
|
196
247
|
|
197
248
|
/**
|
@@ -7,6 +7,7 @@ var _pikaday = _interopRequireDefault(require("pikaday"));
|
|
7
7
|
var _textEditor = require("../textEditor");
|
8
8
|
var _eventManager = _interopRequireDefault(require("../../eventManager"));
|
9
9
|
var _element = require("../../helpers/dom/element");
|
10
|
+
var _a11y = require("../../helpers/a11y");
|
10
11
|
var _object = require("../../helpers/object");
|
11
12
|
var _unicode = require("../../helpers/unicode");
|
12
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -44,7 +45,7 @@ class DateEditor extends _textEditor.TextEditor {
|
|
44
45
|
throw new Error('You need to include Pikaday to your project.');
|
45
46
|
}
|
46
47
|
super.init();
|
47
|
-
this.
|
48
|
+
this.hot.addHook('afterDestroy', () => {
|
48
49
|
this.parentDestroyed = true;
|
49
50
|
this.destroyElements();
|
50
51
|
});
|
@@ -69,7 +70,21 @@ class DateEditor extends _textEditor.TextEditor {
|
|
69
70
|
/**
|
70
71
|
* Prevent recognizing clicking on datepicker as clicking outside of table.
|
71
72
|
*/
|
72
|
-
eventManager.addEventListener(this.datePicker, 'mousedown', event =>
|
73
|
+
eventManager.addEventListener(this.datePicker, 'mousedown', event => {
|
74
|
+
if ((0, _element.hasClass)(event.target, 'pika-day')) {
|
75
|
+
this.hideDatepicker();
|
76
|
+
}
|
77
|
+
event.stopPropagation();
|
78
|
+
});
|
79
|
+
|
80
|
+
/**
|
81
|
+
* Prevent caret movement in the TEXTAREA when navigating over the date picker.
|
82
|
+
*/
|
83
|
+
eventManager.addEventListener(this.TEXTAREA, 'keydown', event => {
|
84
|
+
if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(event.code)) {
|
85
|
+
event.preventDefault();
|
86
|
+
}
|
87
|
+
});
|
73
88
|
}
|
74
89
|
|
75
90
|
/**
|
@@ -110,6 +125,9 @@ class DateEditor extends _textEditor.TextEditor {
|
|
110
125
|
const editorContext = shortcutManager.getContext('editor');
|
111
126
|
super.open();
|
112
127
|
this.showDatepicker(event);
|
128
|
+
if (this.hot.getSettings().ariaTags) {
|
129
|
+
(0, _element.setAttribute)(this.TD, [(0, _a11y.A11Y_EXPANDED)('true')]);
|
130
|
+
}
|
113
131
|
editorContext.addShortcut({
|
114
132
|
keys: [['Enter']],
|
115
133
|
callback: keyboardEvent => {
|
@@ -132,9 +150,12 @@ class DateEditor extends _textEditor.TextEditor {
|
|
132
150
|
if ((_this$$datePicker = this.$datePicker) !== null && _this$$datePicker !== void 0 && _this$$datePicker.destroy) {
|
133
151
|
this.$datePicker.destroy();
|
134
152
|
}
|
135
|
-
this.
|
136
|
-
this.
|
153
|
+
this.hot._registerTimeout(() => {
|
154
|
+
this.hot._refreshBorders();
|
137
155
|
});
|
156
|
+
if (this.TD && this.hot.getSettings().ariaTags) {
|
157
|
+
(0, _element.setAttribute)(this.TD, [(0, _a11y.A11Y_EXPANDED)('false')]);
|
158
|
+
}
|
138
159
|
const shortcutManager = this.hot.getShortcutManager();
|
139
160
|
const editorContext = shortcutManager.getContext('editor');
|
140
161
|
editorContext.removeShortcutsByGroup(SHORTCUTS_GROUP_EDITOR);
|
@@ -152,7 +173,6 @@ class DateEditor extends _textEditor.TextEditor {
|
|
152
173
|
let ctrlDown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
153
174
|
if (restoreOriginalValue) {
|
154
175
|
// pressed ESC, restore original value
|
155
|
-
// var value = this.instance.getDataAtCell(this.row, this.col);
|
156
176
|
const value = this.originalValue;
|
157
177
|
if (value !== void 0) {
|
158
178
|
this.setValue(value);
|
@@ -169,7 +189,7 @@ class DateEditor extends _textEditor.TextEditor {
|
|
169
189
|
showDatepicker(event) {
|
170
190
|
const offset = this.TD.getBoundingClientRect();
|
171
191
|
const dateFormat = this.cellProperties.dateFormat || this.defaultDateFormat;
|
172
|
-
const isMouseDown = this.
|
192
|
+
const isMouseDown = this.hot.view.isMouseDown();
|
173
193
|
const isMeta = event ? (0, _unicode.isFunctionKey)(event.keyCode) : false;
|
174
194
|
let dateStr;
|
175
195
|
this.datePicker.style.display = 'block';
|
@@ -248,7 +268,6 @@ class DateEditor extends _textEditor.TextEditor {
|
|
248
268
|
dateStr = (0, _moment.default)(dateStr).format(this.cellProperties.dateFormat || this.defaultDateFormat);
|
249
269
|
}
|
250
270
|
this.setValue(dateStr);
|
251
|
-
this.hideDatepicker();
|
252
271
|
if (origOnSelect) {
|
253
272
|
origOnSelect();
|
254
273
|
}
|