handsontable 0.0.0-next-9379dd1-20231020 → 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 +5 -40
- package/dist/handsontable.full.css +5 -40
- package/dist/handsontable.full.js +8038 -12837
- package/dist/handsontable.full.min.css +4 -4
- package/dist/handsontable.full.min.js +141 -141
- package/dist/handsontable.js +11488 -16287
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +21 -21
- 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} +308 -96
- package/plugins/contextMenu/{menu/menu.mjs → menu.mjs} +309 -97
- 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 +38 -97
- package/plugins/dropdownMenu/dropdownMenu.mjs +37 -96
- package/plugins/filters/constants.mjs +1 -1
- package/plugins/filters/filters.js +14 -31
- package/plugins/filters/filters.mjs +14 -31
- package/plugins/filters/ui/select.js +3 -3
- package/plugins/filters/ui/select.mjs +2 -2
- 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 +2 -20
- package/shortcuts/context.mjs +3 -20
- 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/index.js +0 -9
- package/plugins/contextMenu/menu/index.mjs +0 -1
- package/plugins/contextMenu/menu/navigator.js +0 -152
- package/plugins/contextMenu/menu/navigator.mjs +0 -148
- package/plugins/contextMenu/menu/positioner.js +0 -213
- package/plugins/contextMenu/menu/positioner.mjs +0 -209
- 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/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/editorManager.js
CHANGED
@@ -3,12 +3,15 @@
|
|
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");
|
6
7
|
var _registry = require("./editors/registry");
|
7
8
|
var _eventManager = _interopRequireDefault(require("./eventManager"));
|
8
9
|
var _mixed = require("./helpers/mixed");
|
9
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
10
11
|
const SHORTCUTS_GROUP_NAVIGATION = 'editorManager.navigation';
|
11
12
|
exports.SHORTCUTS_GROUP_NAVIGATION = SHORTCUTS_GROUP_NAVIGATION;
|
13
|
+
const SHORTCUTS_GROUP_EDITOR = 'editorManager.handlingEditor';
|
14
|
+
exports.SHORTCUTS_GROUP_EDITOR = SHORTCUTS_GROUP_EDITOR;
|
12
15
|
class EditorManager {
|
13
16
|
/**
|
14
17
|
* @param {Core} instance The Handsontable instance.
|
@@ -71,6 +74,9 @@ class EditorManager {
|
|
71
74
|
* @type {object}
|
72
75
|
*/
|
73
76
|
this.cellProperties = void 0;
|
77
|
+
const shortcutManager = this.instance.getShortcutManager();
|
78
|
+
shortcutManager.addContext('editor');
|
79
|
+
this.registerShortcuts();
|
74
80
|
this.instance.addHook('afterDocumentKeyDown', event => this.onAfterDocumentKeyDown(event));
|
75
81
|
|
76
82
|
// Open editor when text composition is started (IME editor)
|
@@ -82,6 +88,62 @@ class EditorManager {
|
|
82
88
|
this.instance.view._wt.update('onCellDblClick', (event, coords, elem) => this.onCellDblClick(event, coords, elem));
|
83
89
|
}
|
84
90
|
|
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
|
+
|
85
147
|
/**
|
86
148
|
* Lock the editor from being prepared and closed. Locking the editor prevents its closing and
|
87
149
|
* reinitialized after selecting the new cell. This feature is necessary for a mobile editor.
|
@@ -134,16 +196,10 @@ class EditorManager {
|
|
134
196
|
});
|
135
197
|
return;
|
136
198
|
}
|
137
|
-
const {
|
138
|
-
highlight
|
139
|
-
} = this.instance.getSelectedRangeLast();
|
140
|
-
if (highlight.isHeader()) {
|
141
|
-
return;
|
142
|
-
}
|
143
199
|
const {
|
144
200
|
row,
|
145
201
|
col
|
146
|
-
} = highlight;
|
202
|
+
} = this.instance.getSelectedRangeLast().highlight;
|
147
203
|
const modifiedCellCoords = this.instance.runHooks('modifyGetCellCoords', row, col);
|
148
204
|
let visualRowToCheck = row;
|
149
205
|
let visualColumnToCheck = col;
|
@@ -153,6 +209,17 @@ class EditorManager {
|
|
153
209
|
|
154
210
|
// Getting values using the modified coordinates.
|
155
211
|
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
|
+
}
|
156
223
|
if (!this.isCellEditable()) {
|
157
224
|
this.clearActiveEditor();
|
158
225
|
return;
|
@@ -196,7 +263,14 @@ class EditorManager {
|
|
196
263
|
return;
|
197
264
|
}
|
198
265
|
if (!this.activeEditor) {
|
199
|
-
|
266
|
+
const {
|
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();
|
200
274
|
this.prepareEditor();
|
201
275
|
}
|
202
276
|
if (this.activeEditor) {
|
@@ -260,15 +334,11 @@ class EditorManager {
|
|
260
334
|
* @returns {boolean}
|
261
335
|
*/
|
262
336
|
isCellEditable() {
|
263
|
-
const selection = this.instance.getSelectedRangeLast();
|
264
|
-
if (!selection) {
|
265
|
-
return false;
|
266
|
-
}
|
267
337
|
const editorClass = this.instance.getCellEditor(this.cellProperties);
|
268
338
|
const {
|
269
339
|
row,
|
270
340
|
col
|
271
|
-
} =
|
341
|
+
} = this.instance.getSelectedRangeLast().highlight;
|
272
342
|
const {
|
273
343
|
rowIndexMapper,
|
274
344
|
columnIndexMapper
|
@@ -304,13 +374,15 @@ class EditorManager {
|
|
304
374
|
* @param {KeyboardEvent} event The keyboard event object.
|
305
375
|
*/
|
306
376
|
onAfterDocumentKeyDown(event) {
|
307
|
-
|
308
|
-
if (!this.instance.isListening() || !selection || selection.highlight.isHeader() || (0, _event.isImmediatePropagationStopped)(event)) {
|
377
|
+
if (!this.instance.isListening()) {
|
309
378
|
return;
|
310
379
|
}
|
311
380
|
const {
|
312
381
|
keyCode
|
313
382
|
} = event;
|
383
|
+
if (!this.selection.isSelected()) {
|
384
|
+
return;
|
385
|
+
}
|
314
386
|
|
315
387
|
// catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)
|
316
388
|
const isCtrlPressed = (event.ctrlKey || event.metaKey) && !event.altKey;
|
package/editorManager.mjs
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
import { isFunctionKey, isCtrlMetaKey } from "./helpers/unicode.mjs";
|
2
|
-
import {
|
2
|
+
import { stopImmediatePropagation } from "./helpers/dom/event.mjs";
|
3
|
+
import { isOutsideInput } from "./helpers/dom/element.mjs";
|
3
4
|
import { getEditorInstance } from "./editors/registry.mjs";
|
4
5
|
import EventManager from "./eventManager.mjs";
|
5
6
|
import { isDefined } from "./helpers/mixed.mjs";
|
6
7
|
export const SHORTCUTS_GROUP_NAVIGATION = 'editorManager.navigation';
|
8
|
+
export const SHORTCUTS_GROUP_EDITOR = 'editorManager.handlingEditor';
|
7
9
|
class EditorManager {
|
8
10
|
/**
|
9
11
|
* @param {Core} instance The Handsontable instance.
|
@@ -66,6 +68,9 @@ class EditorManager {
|
|
66
68
|
* @type {object}
|
67
69
|
*/
|
68
70
|
this.cellProperties = void 0;
|
71
|
+
const shortcutManager = this.instance.getShortcutManager();
|
72
|
+
shortcutManager.addContext('editor');
|
73
|
+
this.registerShortcuts();
|
69
74
|
this.instance.addHook('afterDocumentKeyDown', event => this.onAfterDocumentKeyDown(event));
|
70
75
|
|
71
76
|
// Open editor when text composition is started (IME editor)
|
@@ -77,6 +82,62 @@ class EditorManager {
|
|
77
82
|
this.instance.view._wt.update('onCellDblClick', (event, coords, elem) => this.onCellDblClick(event, coords, elem));
|
78
83
|
}
|
79
84
|
|
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
|
+
|
80
141
|
/**
|
81
142
|
* Lock the editor from being prepared and closed. Locking the editor prevents its closing and
|
82
143
|
* reinitialized after selecting the new cell. This feature is necessary for a mobile editor.
|
@@ -129,16 +190,10 @@ class EditorManager {
|
|
129
190
|
});
|
130
191
|
return;
|
131
192
|
}
|
132
|
-
const {
|
133
|
-
highlight
|
134
|
-
} = this.instance.getSelectedRangeLast();
|
135
|
-
if (highlight.isHeader()) {
|
136
|
-
return;
|
137
|
-
}
|
138
193
|
const {
|
139
194
|
row,
|
140
195
|
col
|
141
|
-
} = highlight;
|
196
|
+
} = this.instance.getSelectedRangeLast().highlight;
|
142
197
|
const modifiedCellCoords = this.instance.runHooks('modifyGetCellCoords', row, col);
|
143
198
|
let visualRowToCheck = row;
|
144
199
|
let visualColumnToCheck = col;
|
@@ -148,6 +203,17 @@ class EditorManager {
|
|
148
203
|
|
149
204
|
// Getting values using the modified coordinates.
|
150
205
|
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
|
+
}
|
151
217
|
if (!this.isCellEditable()) {
|
152
218
|
this.clearActiveEditor();
|
153
219
|
return;
|
@@ -191,7 +257,14 @@ class EditorManager {
|
|
191
257
|
return;
|
192
258
|
}
|
193
259
|
if (!this.activeEditor) {
|
194
|
-
|
260
|
+
const {
|
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();
|
195
268
|
this.prepareEditor();
|
196
269
|
}
|
197
270
|
if (this.activeEditor) {
|
@@ -255,15 +328,11 @@ class EditorManager {
|
|
255
328
|
* @returns {boolean}
|
256
329
|
*/
|
257
330
|
isCellEditable() {
|
258
|
-
const selection = this.instance.getSelectedRangeLast();
|
259
|
-
if (!selection) {
|
260
|
-
return false;
|
261
|
-
}
|
262
331
|
const editorClass = this.instance.getCellEditor(this.cellProperties);
|
263
332
|
const {
|
264
333
|
row,
|
265
334
|
col
|
266
|
-
} =
|
335
|
+
} = this.instance.getSelectedRangeLast().highlight;
|
267
336
|
const {
|
268
337
|
rowIndexMapper,
|
269
338
|
columnIndexMapper
|
@@ -299,13 +368,15 @@ class EditorManager {
|
|
299
368
|
* @param {KeyboardEvent} event The keyboard event object.
|
300
369
|
*/
|
301
370
|
onAfterDocumentKeyDown(event) {
|
302
|
-
|
303
|
-
if (!this.instance.isListening() || !selection || selection.highlight.isHeader() || isImmediatePropagationStopped(event)) {
|
371
|
+
if (!this.instance.isListening()) {
|
304
372
|
return;
|
305
373
|
}
|
306
374
|
const {
|
307
375
|
keyCode
|
308
376
|
} = event;
|
377
|
+
if (!this.selection.isSelected()) {
|
378
|
+
return;
|
379
|
+
}
|
309
380
|
|
310
381
|
// catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)
|
311
382
|
const isCtrlPressed = (event.ctrlKey || event.metaKey) && !event.altKey;
|
@@ -10,7 +10,6 @@ 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");
|
14
13
|
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; }
|
15
14
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
16
15
|
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); }
|
@@ -114,8 +113,7 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
114
113
|
this.rawChoices = [];
|
115
114
|
privatePool.set(this, {
|
116
115
|
skipOne: false,
|
117
|
-
isMacOS: this.hot.rootWindow.navigator.platform.indexOf('Mac') > -1
|
118
|
-
idPrefix: instance.guid.slice(0, 9)
|
116
|
+
isMacOS: this.hot.rootWindow.navigator.platform.indexOf('Mac') > -1
|
119
117
|
});
|
120
118
|
}
|
121
119
|
|
@@ -142,27 +140,6 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
142
140
|
super.createElements();
|
143
141
|
(0, _element.addClass)(this.htContainer, 'autocompleteEditor');
|
144
142
|
(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
|
-
}
|
166
143
|
}
|
167
144
|
|
168
145
|
/**
|
@@ -172,13 +149,6 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
172
149
|
const priv = privatePool.get(this);
|
173
150
|
super.open();
|
174
151
|
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;
|
182
152
|
this.showEditableElement();
|
183
153
|
this.focus();
|
184
154
|
let scrollbarWidth = (0, _element.getScrollbarWidth)();
|
@@ -190,7 +160,6 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
190
160
|
this.htEditor.updateSettings({
|
191
161
|
colWidths: trimDropdown ? [(0, _element.outerWidth)(this.TEXTAREA) - 2] : void 0,
|
192
162
|
width: trimDropdown ? (0, _element.outerWidth)(this.TEXTAREA) + scrollbarWidth : void 0,
|
193
|
-
autoColumnSize: true,
|
194
163
|
renderer: (instance, TD, row, col, prop, value, cellProperties) => {
|
195
164
|
(0, _textRenderer.textRenderer)(instance, TD, row, col, prop, value, cellProperties);
|
196
165
|
const {
|
@@ -209,27 +178,10 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
209
178
|
cellValue = cellValue.replace(match, `<strong>${match}</strong>`);
|
210
179
|
}
|
211
180
|
}
|
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
|
-
}
|
217
181
|
TD.innerHTML = cellValue;
|
218
182
|
},
|
219
|
-
|
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
|
-
}
|
183
|
+
autoColumnSize: true
|
226
184
|
});
|
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
|
-
}
|
233
185
|
if (priv.skipOne) {
|
234
186
|
priv.skipOne = false;
|
235
187
|
}
|
@@ -244,9 +196,6 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
|
|
244
196
|
close() {
|
245
197
|
this.removeHooksByKey('beforeKeyDown');
|
246
198
|
super.close();
|
247
|
-
if (this.hot.getSettings().ariaTags) {
|
248
|
-
(0, _element.setAttribute)(this.TEXTAREA, [(0, _a11y.A11Y_EXPANDED)('false')]);
|
249
|
-
}
|
250
199
|
}
|
251
200
|
|
252
201
|
/**
|
@@ -5,12 +5,11 @@ 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,
|
8
|
+
import { addClass, getCaretPosition, getScrollbarWidth, getSelectionEndPosition, getTrimmingContainer, offset, outerHeight, outerWidth, 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";
|
14
13
|
const privatePool = new WeakMap();
|
15
14
|
export const EDITOR_TYPE = 'autocomplete';
|
16
15
|
|
@@ -110,8 +109,7 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
110
109
|
this.rawChoices = [];
|
111
110
|
privatePool.set(this, {
|
112
111
|
skipOne: false,
|
113
|
-
isMacOS: this.hot.rootWindow.navigator.platform.indexOf('Mac') > -1
|
114
|
-
idPrefix: instance.guid.slice(0, 9)
|
112
|
+
isMacOS: this.hot.rootWindow.navigator.platform.indexOf('Mac') > -1
|
115
113
|
});
|
116
114
|
}
|
117
115
|
|
@@ -138,27 +136,6 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
138
136
|
super.createElements();
|
139
137
|
addClass(this.htContainer, 'autocompleteEditor');
|
140
138
|
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
|
-
}
|
162
139
|
}
|
163
140
|
|
164
141
|
/**
|
@@ -168,13 +145,6 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
168
145
|
const priv = privatePool.get(this);
|
169
146
|
super.open();
|
170
147
|
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;
|
178
148
|
this.showEditableElement();
|
179
149
|
this.focus();
|
180
150
|
let scrollbarWidth = getScrollbarWidth();
|
@@ -186,7 +156,6 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
186
156
|
this.htEditor.updateSettings({
|
187
157
|
colWidths: trimDropdown ? [outerWidth(this.TEXTAREA) - 2] : void 0,
|
188
158
|
width: trimDropdown ? outerWidth(this.TEXTAREA) + scrollbarWidth : void 0,
|
189
|
-
autoColumnSize: true,
|
190
159
|
renderer: (instance, TD, row, col, prop, value, cellProperties) => {
|
191
160
|
textRenderer(instance, TD, row, col, prop, value, cellProperties);
|
192
161
|
const {
|
@@ -205,27 +174,10 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
205
174
|
cellValue = cellValue.replace(match, `<strong>${match}</strong>`);
|
206
175
|
}
|
207
176
|
}
|
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
|
-
}
|
213
177
|
TD.innerHTML = cellValue;
|
214
178
|
},
|
215
|
-
|
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
|
-
}
|
179
|
+
autoColumnSize: true
|
222
180
|
});
|
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
|
-
}
|
229
181
|
if (priv.skipOne) {
|
230
182
|
priv.skipOne = false;
|
231
183
|
}
|
@@ -240,9 +192,6 @@ export class AutocompleteEditor extends HandsontableEditor {
|
|
240
192
|
close() {
|
241
193
|
this.removeHooksByKey('beforeKeyDown');
|
242
194
|
super.close();
|
243
|
-
if (this.hot.getSettings().ariaTags) {
|
244
|
-
setAttribute(this.TEXTAREA, [A11Y_EXPANDED('false')]);
|
245
|
-
}
|
246
195
|
}
|
247
196
|
|
248
197
|
/**
|
@@ -7,7 +7,6 @@ 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");
|
11
10
|
var _object = require("../../helpers/object");
|
12
11
|
var _unicode = require("../../helpers/unicode");
|
13
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -45,7 +44,7 @@ class DateEditor extends _textEditor.TextEditor {
|
|
45
44
|
throw new Error('You need to include Pikaday to your project.');
|
46
45
|
}
|
47
46
|
super.init();
|
48
|
-
this.
|
47
|
+
this.instance.addHook('afterDestroy', () => {
|
49
48
|
this.parentDestroyed = true;
|
50
49
|
this.destroyElements();
|
51
50
|
});
|
@@ -70,21 +69,7 @@ class DateEditor extends _textEditor.TextEditor {
|
|
70
69
|
/**
|
71
70
|
* Prevent recognizing clicking on datepicker as clicking outside of table.
|
72
71
|
*/
|
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
|
-
});
|
72
|
+
eventManager.addEventListener(this.datePicker, 'mousedown', event => event.stopPropagation());
|
88
73
|
}
|
89
74
|
|
90
75
|
/**
|
@@ -125,9 +110,6 @@ class DateEditor extends _textEditor.TextEditor {
|
|
125
110
|
const editorContext = shortcutManager.getContext('editor');
|
126
111
|
super.open();
|
127
112
|
this.showDatepicker(event);
|
128
|
-
if (this.hot.getSettings().ariaTags) {
|
129
|
-
(0, _element.setAttribute)(this.TD, [(0, _a11y.A11Y_EXPANDED)('true')]);
|
130
|
-
}
|
131
113
|
editorContext.addShortcut({
|
132
114
|
keys: [['Enter']],
|
133
115
|
callback: keyboardEvent => {
|
@@ -150,12 +132,9 @@ class DateEditor extends _textEditor.TextEditor {
|
|
150
132
|
if ((_this$$datePicker = this.$datePicker) !== null && _this$$datePicker !== void 0 && _this$$datePicker.destroy) {
|
151
133
|
this.$datePicker.destroy();
|
152
134
|
}
|
153
|
-
this.
|
154
|
-
this.
|
135
|
+
this.instance._registerTimeout(() => {
|
136
|
+
this.instance._refreshBorders();
|
155
137
|
});
|
156
|
-
if (this.TD && this.hot.getSettings().ariaTags) {
|
157
|
-
(0, _element.setAttribute)(this.TD, [(0, _a11y.A11Y_EXPANDED)('false')]);
|
158
|
-
}
|
159
138
|
const shortcutManager = this.hot.getShortcutManager();
|
160
139
|
const editorContext = shortcutManager.getContext('editor');
|
161
140
|
editorContext.removeShortcutsByGroup(SHORTCUTS_GROUP_EDITOR);
|
@@ -173,6 +152,7 @@ class DateEditor extends _textEditor.TextEditor {
|
|
173
152
|
let ctrlDown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
174
153
|
if (restoreOriginalValue) {
|
175
154
|
// pressed ESC, restore original value
|
155
|
+
// var value = this.instance.getDataAtCell(this.row, this.col);
|
176
156
|
const value = this.originalValue;
|
177
157
|
if (value !== void 0) {
|
178
158
|
this.setValue(value);
|
@@ -189,7 +169,7 @@ class DateEditor extends _textEditor.TextEditor {
|
|
189
169
|
showDatepicker(event) {
|
190
170
|
const offset = this.TD.getBoundingClientRect();
|
191
171
|
const dateFormat = this.cellProperties.dateFormat || this.defaultDateFormat;
|
192
|
-
const isMouseDown = this.
|
172
|
+
const isMouseDown = this.instance.view.isMouseDown();
|
193
173
|
const isMeta = event ? (0, _unicode.isFunctionKey)(event.keyCode) : false;
|
194
174
|
let dateStr;
|
195
175
|
this.datePicker.style.display = 'block';
|
@@ -268,6 +248,7 @@ class DateEditor extends _textEditor.TextEditor {
|
|
268
248
|
dateStr = (0, _moment.default)(dateStr).format(this.cellProperties.dateFormat || this.defaultDateFormat);
|
269
249
|
}
|
270
250
|
this.setValue(dateStr);
|
251
|
+
this.hideDatepicker();
|
271
252
|
if (origOnSelect) {
|
272
253
|
origOnSelect();
|
273
254
|
}
|