handsontable 16.0.1 → 16.1.0-next-abd8f2e-20250904
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdparty/walkontable/src/overlays.js +12 -2
- package/3rdparty/walkontable/src/overlays.mjs +12 -2
- package/3rdparty/walkontable/src/viewport.js +2 -6
- package/3rdparty/walkontable/src/viewport.mjs +2 -6
- package/CHANGELOG.md +37 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/cellTypes/autocompleteType/accessors/index.js +7 -0
- package/cellTypes/autocompleteType/accessors/index.mjs +2 -0
- package/cellTypes/autocompleteType/accessors/valueGetter.js +14 -0
- package/cellTypes/autocompleteType/accessors/valueGetter.mjs +10 -0
- package/cellTypes/autocompleteType/accessors/valueSetter.js +25 -0
- package/cellTypes/autocompleteType/accessors/valueSetter.mjs +21 -0
- package/cellTypes/autocompleteType/autocompleteType.js +4 -1
- package/cellTypes/autocompleteType/autocompleteType.mjs +4 -1
- package/cellTypes/checkboxType/accessors/index.js +5 -0
- package/cellTypes/checkboxType/accessors/index.mjs +1 -0
- package/cellTypes/checkboxType/accessors/valueSetter.js +26 -0
- package/cellTypes/checkboxType/accessors/valueSetter.mjs +22 -0
- package/cellTypes/checkboxType/checkboxType.js +3 -1
- package/cellTypes/checkboxType/checkboxType.mjs +3 -1
- package/cellTypes/dropdownType/accessors/index.js +7 -0
- package/cellTypes/dropdownType/accessors/index.mjs +2 -0
- package/cellTypes/dropdownType/accessors/valueGetter.js +14 -0
- package/cellTypes/dropdownType/accessors/valueGetter.mjs +10 -0
- package/cellTypes/dropdownType/accessors/valueSetter.js +17 -0
- package/cellTypes/dropdownType/accessors/valueSetter.mjs +13 -0
- package/cellTypes/dropdownType/dropdownType.js +4 -1
- package/cellTypes/dropdownType/dropdownType.mjs +4 -1
- package/cellTypes/numericType/accessors/index.js +5 -0
- package/cellTypes/numericType/accessors/index.mjs +1 -0
- package/cellTypes/numericType/accessors/valueSetter.js +19 -0
- package/cellTypes/numericType/accessors/valueSetter.mjs +15 -0
- package/cellTypes/numericType/numericType.js +3 -1
- package/cellTypes/numericType/numericType.mjs +3 -1
- package/core/focusCatcher/index.js +37 -112
- package/core/focusCatcher/index.mjs +35 -110
- package/core/focusCatcher/utils.js +31 -0
- package/core/focusCatcher/utils.mjs +27 -0
- package/core/hooks/constants.js +242 -0
- package/core/hooks/constants.mjs +242 -0
- package/core/hooks/index.d.ts +22 -0
- package/core/viewportScroll/scrollStrategies/focusScroll.js +5 -1
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +5 -1
- package/core/viewportScroll/utils.js +1 -1
- package/core/viewportScroll/utils.mjs +1 -1
- package/core.d.ts +4 -0
- package/core.js +237 -139
- package/core.mjs +240 -142
- package/dataMap/dataMap.js +13 -3
- package/dataMap/dataMap.mjs +14 -4
- package/dataMap/dataSource.js +16 -0
- package/dataMap/dataSource.mjs +16 -0
- package/dataMap/metaManager/lazyFactoryMap.js +4 -3
- package/dataMap/metaManager/lazyFactoryMap.mjs +2 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +3 -2
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +3 -2
- package/dataMap/metaManager/metaSchema.js +289 -4
- package/dataMap/metaManager/metaSchema.mjs +289 -4
- package/dataMap/metaManager/utils.js +0 -11
- package/dataMap/metaManager/utils.mjs +0 -10
- package/dataMap/replaceData.js +1 -0
- package/dataMap/replaceData.mjs +1 -0
- package/dist/handsontable.css +281 -4
- package/dist/handsontable.full.css +281 -4
- package/dist/handsontable.full.js +7844 -2990
- package/dist/handsontable.full.min.css +4 -5
- package/dist/handsontable.full.min.js +167 -165
- package/dist/handsontable.js +9639 -4806
- package/dist/handsontable.min.css +4 -4
- package/dist/handsontable.min.js +52 -50
- package/dist/languages/all.js +231 -21
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.js +11 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.js +11 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.js +11 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.js +11 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.js +11 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.js +11 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fa-IR.js +11 -1
- package/dist/languages/fa-IR.min.js +1 -1
- package/dist/languages/fr-FR.js +11 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.js +11 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.js +11 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.js +11 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.js +11 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.js +11 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.js +11 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.js +11 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.js +11 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.js +11 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.js +11 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.js +11 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.js +11 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.js +11 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +4 -4
- package/editorManager.mjs +4 -4
- package/editors/autocompleteEditor/autocompleteEditor.js +50 -112
- package/editors/autocompleteEditor/autocompleteEditor.mjs +51 -113
- package/editors/baseEditor/baseEditor.js +10 -6
- package/editors/baseEditor/baseEditor.mjs +10 -6
- package/editors/handsontableEditor/handsontableEditor.js +9 -9
- package/editors/handsontableEditor/handsontableEditor.mjs +9 -9
- package/editors/textEditor/textEditor.js +0 -7
- package/editors/textEditor/textEditor.mjs +0 -7
- package/focusManager.js +2 -2
- package/focusManager.mjs +2 -2
- package/helpers/a11y.js +15 -2
- package/helpers/a11y.mjs +10 -2
- package/helpers/console.js +12 -0
- package/helpers/console.mjs +11 -0
- package/helpers/dom/element.js +4 -4
- package/helpers/dom/element.mjs +4 -4
- package/helpers/mixed.js +65 -2
- package/helpers/mixed.mjs +63 -2
- package/helpers/number.js +28 -0
- package/helpers/number.mjs +26 -0
- package/helpers/object.js +35 -0
- package/helpers/object.mjs +34 -0
- package/helpers/string.js +19 -0
- package/helpers/string.mjs +18 -0
- package/helpers/templateLiteralTag.js +57 -1
- package/helpers/templateLiteralTag.mjs +56 -1
- package/i18n/constants.js +13 -1
- package/i18n/constants.mjs +13 -1
- package/i18n/languages/ar-AR.js +11 -1
- package/i18n/languages/ar-AR.mjs +11 -1
- package/i18n/languages/cs-CZ.js +11 -1
- package/i18n/languages/cs-CZ.mjs +11 -1
- package/i18n/languages/de-CH.js +11 -1
- package/i18n/languages/de-CH.mjs +11 -1
- package/i18n/languages/de-DE.js +11 -1
- package/i18n/languages/de-DE.mjs +11 -1
- package/i18n/languages/en-US.js +11 -1
- package/i18n/languages/en-US.mjs +11 -1
- package/i18n/languages/es-MX.js +11 -1
- package/i18n/languages/es-MX.mjs +11 -1
- package/i18n/languages/fa-IR.js +11 -1
- package/i18n/languages/fa-IR.mjs +11 -1
- package/i18n/languages/fr-FR.js +11 -1
- package/i18n/languages/fr-FR.mjs +11 -1
- package/i18n/languages/hr-HR.js +11 -1
- package/i18n/languages/hr-HR.mjs +11 -1
- package/i18n/languages/it-IT.js +11 -1
- package/i18n/languages/it-IT.mjs +11 -1
- package/i18n/languages/ja-JP.js +11 -1
- package/i18n/languages/ja-JP.mjs +11 -1
- package/i18n/languages/ko-KR.js +11 -1
- package/i18n/languages/ko-KR.mjs +11 -1
- package/i18n/languages/lv-LV.js +11 -1
- package/i18n/languages/lv-LV.mjs +11 -1
- package/i18n/languages/nb-NO.js +11 -1
- package/i18n/languages/nb-NO.mjs +11 -1
- package/i18n/languages/nl-NL.js +11 -1
- package/i18n/languages/nl-NL.mjs +11 -1
- package/i18n/languages/pl-PL.js +11 -1
- package/i18n/languages/pl-PL.mjs +11 -1
- package/i18n/languages/pt-BR.js +11 -1
- package/i18n/languages/pt-BR.mjs +11 -1
- package/i18n/languages/ru-RU.js +11 -1
- package/i18n/languages/ru-RU.mjs +11 -1
- package/i18n/languages/sr-SP.js +11 -1
- package/i18n/languages/sr-SP.mjs +11 -1
- package/i18n/languages/zh-CN.js +11 -1
- package/i18n/languages/zh-CN.mjs +11 -1
- package/i18n/languages/zh-TW.js +11 -1
- package/i18n/languages/zh-TW.mjs +11 -1
- package/i18n/phraseFormatters/index.js +3 -1
- package/i18n/phraseFormatters/index.mjs +3 -1
- package/i18n/registry.js +5 -6
- package/i18n/registry.mjs +5 -6
- package/index.d.ts +27 -0
- package/languages/all.js +231 -21
- package/languages/ar-AR.js +11 -1
- package/languages/ar-AR.mjs +11 -1
- package/languages/cs-CZ.js +11 -1
- package/languages/cs-CZ.mjs +11 -1
- package/languages/de-CH.js +11 -1
- package/languages/de-CH.mjs +11 -1
- package/languages/de-DE.js +11 -1
- package/languages/de-DE.mjs +11 -1
- package/languages/en-US.js +11 -1
- package/languages/en-US.mjs +11 -1
- package/languages/es-MX.js +11 -1
- package/languages/es-MX.mjs +11 -1
- package/languages/fa-IR.js +11 -1
- package/languages/fa-IR.mjs +11 -1
- package/languages/fr-FR.js +11 -1
- package/languages/fr-FR.mjs +11 -1
- package/languages/hr-HR.js +11 -1
- package/languages/hr-HR.mjs +11 -1
- package/languages/index.js +231 -21
- package/languages/it-IT.js +11 -1
- package/languages/it-IT.mjs +11 -1
- package/languages/ja-JP.js +11 -1
- package/languages/ja-JP.mjs +11 -1
- package/languages/ko-KR.js +11 -1
- package/languages/ko-KR.mjs +11 -1
- package/languages/lv-LV.js +11 -1
- package/languages/lv-LV.mjs +11 -1
- package/languages/nb-NO.js +11 -1
- package/languages/nb-NO.mjs +11 -1
- package/languages/nl-NL.js +11 -1
- package/languages/nl-NL.mjs +11 -1
- package/languages/pl-PL.js +11 -1
- package/languages/pl-PL.mjs +11 -1
- package/languages/pt-BR.js +11 -1
- package/languages/pt-BR.mjs +11 -1
- package/languages/ru-RU.js +11 -1
- package/languages/ru-RU.mjs +11 -1
- package/languages/sr-SP.js +11 -1
- package/languages/sr-SP.mjs +11 -1
- package/languages/zh-CN.js +11 -1
- package/languages/zh-CN.mjs +11 -1
- package/languages/zh-TW.js +11 -1
- package/languages/zh-TW.mjs +11 -1
- package/mixins/localHooks.js +16 -0
- package/mixins/localHooks.mjs +16 -0
- package/package.json +19 -1
- package/plugins/autoRowSize/autoRowSize.js +43 -6
- package/plugins/autoRowSize/autoRowSize.mjs +43 -6
- package/plugins/autofill/autofill.js +50 -3
- package/plugins/autofill/autofill.mjs +50 -3
- package/plugins/base/base.js +86 -15
- package/plugins/base/base.mjs +87 -16
- package/plugins/collapsibleColumns/collapsibleColumns.js +4 -4
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +4 -4
- package/plugins/columnSorting/columnSorting.js +3 -3
- package/plugins/columnSorting/columnSorting.mjs +3 -3
- package/plugins/comments/comments.js +52 -22
- package/plugins/comments/comments.mjs +52 -22
- package/plugins/comments/contextMenuItem/addEditComment.js +3 -3
- package/plugins/comments/contextMenuItem/addEditComment.mjs +3 -3
- package/plugins/comments/contextMenuItem/readOnlyComment.js +2 -2
- package/plugins/comments/contextMenuItem/readOnlyComment.mjs +2 -2
- package/plugins/comments/contextMenuItem/removeComment.js +2 -2
- package/plugins/comments/contextMenuItem/removeComment.mjs +2 -2
- package/plugins/contextMenu/contextMenu.js +4 -5
- package/plugins/contextMenu/contextMenu.mjs +4 -5
- package/plugins/contextMenu/menu/cursor.js +1 -1
- package/plugins/contextMenu/menu/cursor.mjs +1 -1
- package/plugins/contextMenu/menu/defaultShortcutsList.js +5 -5
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +5 -5
- package/plugins/contextMenu/menu/menu.js +3 -3
- package/plugins/contextMenu/menu/menu.mjs +3 -3
- package/plugins/contextMenu/menu/positioner.js +1 -1
- package/plugins/contextMenu/menu/positioner.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/alignment.js +1 -1
- package/plugins/contextMenu/predefinedItems/alignment.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/clearColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/clearColumn.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/columnLeft.js +3 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/columnRight.js +3 -3
- package/plugins/contextMenu/predefinedItems/columnRight.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/readOnly.js +1 -1
- package/plugins/contextMenu/predefinedItems/readOnly.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/rowAbove.js +3 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.js +3 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/copy.js +1 -1
- package/plugins/copyPaste/contextMenuItem/copy.mjs +1 -1
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +3 -3
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/cut.js +1 -1
- package/plugins/copyPaste/contextMenuItem/cut.mjs +1 -1
- package/plugins/copyPaste/copyPaste.js +75 -40
- package/plugins/copyPaste/copyPaste.mjs +76 -41
- package/plugins/customBorders/customBorders.js +1 -1
- package/plugins/customBorders/customBorders.mjs +1 -1
- package/plugins/dialog/dialog.d.ts +23 -0
- package/plugins/dialog/dialog.js +489 -0
- package/plugins/dialog/dialog.mjs +485 -0
- package/plugins/dialog/index.d.ts +1 -0
- package/plugins/dialog/index.js +7 -0
- package/plugins/dialog/index.mjs +1 -0
- package/plugins/dialog/ui.js +264 -0
- package/plugins/dialog/ui.mjs +259 -0
- package/plugins/dropdownMenu/dropdownMenu.js +5 -4
- package/plugins/dropdownMenu/dropdownMenu.mjs +5 -4
- package/plugins/filters/filters.js +2 -2
- package/plugins/filters/filters.mjs +2 -2
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +3 -3
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs +3 -3
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +4 -4
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +4 -4
- package/plugins/hiddenRows/contextMenuItem/hideRow.js +3 -3
- package/plugins/hiddenRows/contextMenuItem/hideRow.mjs +3 -3
- package/plugins/hiddenRows/contextMenuItem/showRow.js +4 -4
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +4 -4
- package/plugins/index.d.ts +9 -0
- package/plugins/index.js +9 -0
- package/plugins/index.mjs +7 -1
- package/plugins/loading/content.js +36 -0
- package/plugins/loading/content.mjs +31 -0
- package/plugins/loading/index.d.ts +1 -0
- package/plugins/loading/index.js +7 -0
- package/plugins/loading/index.mjs +1 -0
- package/plugins/loading/loading.d.ts +19 -0
- package/plugins/loading/loading.js +292 -0
- package/plugins/loading/loading.mjs +287 -0
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
- package/plugins/manualColumnMove/manualColumnMove.js +3 -3
- package/plugins/manualColumnMove/manualColumnMove.mjs +3 -3
- package/plugins/manualColumnResize/manualColumnResize.js +3 -3
- package/plugins/manualColumnResize/manualColumnResize.mjs +3 -3
- package/plugins/manualRowMove/manualRowMove.js +4 -4
- package/plugins/manualRowMove/manualRowMove.mjs +4 -4
- package/plugins/manualRowResize/manualRowResize.js +5 -2
- package/plugins/manualRowResize/manualRowResize.mjs +5 -2
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +15 -15
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +15 -15
- package/plugins/mergeCells/focusOrder.js +75 -39
- package/plugins/mergeCells/focusOrder.mjs +75 -39
- package/plugins/mergeCells/mergeCells.js +26 -19
- package/plugins/mergeCells/mergeCells.mjs +26 -19
- package/plugins/mergeCells/renderer.js +14 -8
- package/plugins/mergeCells/renderer.mjs +14 -8
- package/plugins/multiColumnSorting/multiColumnSorting.js +3 -3
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +3 -3
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +3 -3
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +3 -3
- package/plugins/nestedHeaders/nestedHeaders.js +47 -41
- package/plugins/nestedHeaders/nestedHeaders.mjs +47 -41
- package/plugins/nestedRows/nestedRows.js +3 -3
- package/plugins/nestedRows/nestedRows.mjs +3 -3
- package/plugins/nestedRows/ui/collapsing.js +1 -2
- package/plugins/nestedRows/ui/collapsing.mjs +1 -2
- package/plugins/nestedRows/ui/contextMenu.js +4 -4
- package/plugins/nestedRows/ui/contextMenu.mjs +4 -4
- package/plugins/nestedRows/ui/headers.js +4 -1
- package/plugins/nestedRows/ui/headers.mjs +4 -1
- package/plugins/pagination/focusController.js +27 -0
- package/plugins/pagination/focusController.mjs +23 -0
- package/plugins/pagination/index.d.ts +1 -0
- package/plugins/pagination/index.js +7 -0
- package/plugins/pagination/index.mjs +1 -0
- package/plugins/pagination/pagination.d.ts +52 -0
- package/plugins/pagination/pagination.js +1034 -0
- package/plugins/pagination/pagination.mjs +1030 -0
- package/plugins/pagination/strategies/autoPageSize.js +96 -0
- package/plugins/pagination/strategies/autoPageSize.mjs +92 -0
- package/plugins/pagination/strategies/fixedPageSize.js +88 -0
- package/plugins/pagination/strategies/fixedPageSize.mjs +84 -0
- package/plugins/pagination/strategies/index.js +22 -0
- package/plugins/pagination/strategies/index.mjs +18 -0
- package/plugins/pagination/ui.js +449 -0
- package/plugins/pagination/ui.mjs +443 -0
- package/plugins/pagination/utils.js +28 -0
- package/plugins/pagination/utils.mjs +24 -0
- package/plugins/stretchColumns/calculator.js +4 -0
- package/plugins/stretchColumns/calculator.mjs +4 -0
- package/plugins/stretchColumns/stretchColumns.js +1 -1
- package/plugins/stretchColumns/stretchColumns.mjs +1 -1
- package/plugins/undoRedo/actions/dataChange.js +17 -15
- package/plugins/undoRedo/actions/dataChange.mjs +17 -15
- package/renderers/checkboxRenderer/checkboxRenderer.js +3 -3
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +3 -3
- package/selection/range.js +11 -0
- package/selection/range.mjs +11 -0
- package/selection/selection.js +163 -124
- package/selection/selection.mjs +163 -124
- package/selection/transformation/_base.js +448 -0
- package/selection/transformation/_base.mjs +443 -0
- package/selection/transformation/extender.js +55 -0
- package/selection/transformation/extender.mjs +51 -0
- package/selection/transformation/focus.js +77 -0
- package/selection/transformation/focus.mjs +73 -0
- package/selection/transformation/index.js +7 -0
- package/selection/transformation/index.mjs +2 -0
- package/selection/utils.js +2 -1
- package/selection/utils.mjs +2 -1
- package/settings.d.ts +10 -1
- package/shortcutContexts/commands/editor/fastOpen.js +1 -1
- package/shortcutContexts/commands/editor/fastOpen.mjs +1 -1
- package/shortcutContexts/commands/editor/open.js +10 -4
- package/shortcutContexts/commands/editor/open.mjs +10 -4
- package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +2 -2
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +2 -2
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +2 -2
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +5 -2
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +5 -2
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +5 -2
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +5 -2
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +2 -2
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/scrollToFocusedCell.js +1 -1
- package/shortcutContexts/commands/scrollToFocusedCell.mjs +1 -1
- package/shortcutContexts/grid.js +3 -3
- package/shortcutContexts/grid.mjs +3 -3
- package/shortcuts/context.js +4 -1
- package/shortcuts/context.mjs +4 -1
- package/shortcuts/manager.js +17 -3
- package/shortcuts/manager.mjs +17 -3
- package/styles/handsontable.css +288 -22
- package/styles/handsontable.min.css +3 -3
- package/styles/ht-theme-classic.css +828 -0
- package/styles/ht-theme-classic.min.css +30 -0
- package/styles/ht-theme-horizon.css +122 -26
- package/styles/ht-theme-horizon.min.css +3 -3
- package/styles/ht-theme-main.css +124 -28
- package/styles/ht-theme-main.min.css +3 -3
- package/tableView.js +61 -25
- package/tableView.mjs +61 -25
- package/utils/a11yAnnouncer.js +70 -0
- package/utils/a11yAnnouncer.mjs +64 -0
- package/{core/focusCatcher → utils}/focusDetector.js +30 -12
- package/{core/focusCatcher → utils}/focusDetector.mjs +30 -12
- package/utils/samplesGenerator.js +17 -1
- package/utils/samplesGenerator.mjs +17 -1
- package/utils/stylesHandler.js +23 -8
- package/utils/stylesHandler.mjs +23 -8
- package/utils/valueAccessors.js +45 -0
- package/utils/valueAccessors.mjs +40 -0
- package/validators/autocompleteValidator/autocompleteValidator.js +2 -1
- package/validators/autocompleteValidator/autocompleteValidator.mjs +2 -1
- package/selection/transformation.js +0 -335
- package/selection/transformation.mjs +0 -331
@@ -3,7 +3,9 @@
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
exports.installFocusCatcher = installFocusCatcher;
|
5
5
|
var _shortcutContexts = require("../../shortcutContexts");
|
6
|
-
var _focusDetector = require("
|
6
|
+
var _focusDetector = require("../../utils/focusDetector");
|
7
|
+
var _utils = require("./utils");
|
8
|
+
var _mixed = require("../../helpers/mixed");
|
7
9
|
/**
|
8
10
|
* Installs a focus catcher module. The module observes when the table is focused and depending on
|
9
11
|
* from the which side it was focused on it selects a specified cell or releases the TAB navigation
|
@@ -12,27 +14,27 @@ var _focusDetector = require("./focusDetector");
|
|
12
14
|
* @param {Core} hot The Handsontable instance.
|
13
15
|
*/
|
14
16
|
function installFocusCatcher(hot) {
|
15
|
-
const clampCoordsIfNeeded = normalizeCoordsIfNeeded(hot);
|
17
|
+
const clampCoordsIfNeeded = (0, _utils.normalizeCoordsIfNeeded)(hot);
|
16
18
|
let recentlyAddedFocusCoords;
|
17
19
|
const {
|
18
20
|
activate,
|
19
21
|
deactivate
|
20
|
-
} = (0, _focusDetector.installFocusDetector)(hot, {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
hot.runHooks('modifyFocusOnTabNavigation', 'from_above', mostTopStartCoords);
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
22
|
+
} = (0, _focusDetector.installFocusDetector)(hot, hot.rootGridElement, {
|
23
|
+
onFocus(from) {
|
24
|
+
if (from === 'from_above') {
|
25
|
+
var _clampCoordsIfNeeded;
|
26
|
+
const mostTopStartCoords = (_clampCoordsIfNeeded = clampCoordsIfNeeded(recentlyAddedFocusCoords)) !== null && _clampCoordsIfNeeded !== void 0 ? _clampCoordsIfNeeded : (0, _mixed.getMostTopStartPosition)(hot);
|
27
|
+
const result = hot.runHooks('modifyFocusOnTabNavigation', 'from_above', mostTopStartCoords);
|
28
|
+
if (mostTopStartCoords && result !== false) {
|
29
|
+
hot.selectCell(mostTopStartCoords.row, mostTopStartCoords.col);
|
30
|
+
}
|
31
|
+
} else {
|
32
|
+
var _clampCoordsIfNeeded2;
|
33
|
+
const mostBottomEndCoords = (_clampCoordsIfNeeded2 = clampCoordsIfNeeded(recentlyAddedFocusCoords)) !== null && _clampCoordsIfNeeded2 !== void 0 ? _clampCoordsIfNeeded2 : (0, _mixed.getMostBottomEndPosition)(hot);
|
34
|
+
const result = hot.runHooks('modifyFocusOnTabNavigation', 'from_below', mostBottomEndCoords);
|
35
|
+
if (mostBottomEndCoords && result !== false) {
|
36
|
+
hot.selectCell(mostBottomEndCoords.row, mostBottomEndCoords.col);
|
37
|
+
}
|
36
38
|
}
|
37
39
|
hot.listen();
|
38
40
|
}
|
@@ -44,8 +46,20 @@ function installFocusCatcher(hot) {
|
|
44
46
|
let isSavingCoordsEnabled = true;
|
45
47
|
let isTabOrShiftTabPressed = false;
|
46
48
|
let preventViewportScroll = false;
|
47
|
-
hot.addHook('afterListen', () =>
|
48
|
-
|
49
|
+
hot.addHook('afterListen', () => {
|
50
|
+
const activeContextName = hot.getShortcutManager().getActiveContextName();
|
51
|
+
const activeContext = hot.getShortcutManager().getContext(activeContextName);
|
52
|
+
if ((activeContext === null || activeContext === void 0 ? void 0 : activeContext.scope) === 'table') {
|
53
|
+
deactivate();
|
54
|
+
}
|
55
|
+
});
|
56
|
+
hot.addHook('afterUnlisten', () => {
|
57
|
+
const activeContextName = hot.getShortcutManager().getActiveContextName();
|
58
|
+
const activeContext = hot.getShortcutManager().getContext(activeContextName);
|
59
|
+
if ((activeContext === null || activeContext === void 0 ? void 0 : activeContext.scope) === 'table') {
|
60
|
+
activate();
|
61
|
+
}
|
62
|
+
});
|
49
63
|
hot.addHook('afterSelection', (row, column, row2, column2, preventScrolling) => {
|
50
64
|
if (isTabOrShiftTabPressed && (rowWrapState.wrapped && rowWrapState.flipped || preventViewportScroll)) {
|
51
65
|
preventViewportScroll = false;
|
@@ -53,7 +67,7 @@ function installFocusCatcher(hot) {
|
|
53
67
|
}
|
54
68
|
if (isSavingCoordsEnabled) {
|
55
69
|
var _hot$getSelectedRange;
|
56
|
-
recentlyAddedFocusCoords = (_hot$getSelectedRange = hot.
|
70
|
+
recentlyAddedFocusCoords = (_hot$getSelectedRange = hot.getSelectedRangeActive()) === null || _hot$getSelectedRange === void 0 ? void 0 : _hot$getSelectedRange.highlight;
|
57
71
|
}
|
58
72
|
});
|
59
73
|
hot.addHook('beforeRowWrap', (interruptedByAutoInsertMode, newCoords, isFlipped) => {
|
@@ -84,7 +98,7 @@ function installFocusCatcher(hot) {
|
|
84
98
|
tabNavigation
|
85
99
|
} = hot.getSettings();
|
86
100
|
isTabOrShiftTabPressed = true;
|
87
|
-
if (hot.
|
101
|
+
if (hot.getSelectedRangeActive() && !tabNavigation) {
|
88
102
|
isSavingCoordsEnabled = false;
|
89
103
|
}
|
90
104
|
if (!tabNavigation) {
|
@@ -103,7 +117,7 @@ function installFocusCatcher(hot) {
|
|
103
117
|
isSavingCoordsEnabled = true;
|
104
118
|
if (!tabNavigation || !hot.selection.isSelected() || autoWrapRow && rowWrapState.wrapped && rowWrapState.flipped || !autoWrapRow && rowWrapState.wrapped) {
|
105
119
|
if (autoWrapRow && rowWrapState.wrapped && rowWrapState.flipped) {
|
106
|
-
recentlyAddedFocusCoords = event.shiftKey ? getMostTopStartPosition(hot) : getMostBottomEndPosition(hot);
|
120
|
+
recentlyAddedFocusCoords = event.shiftKey ? (0, _mixed.getMostTopStartPosition)(hot) : (0, _mixed.getMostBottomEndPosition)(hot);
|
107
121
|
}
|
108
122
|
deactivateTable();
|
109
123
|
return false;
|
@@ -114,93 +128,4 @@ function installFocusCatcher(hot) {
|
|
114
128
|
},
|
115
129
|
position: 'after'
|
116
130
|
}]);
|
117
|
-
}
|
118
|
-
|
119
|
-
/**
|
120
|
-
* Gets the coordinates of the most top-start cell or header (depends on the table settings and its size).
|
121
|
-
*
|
122
|
-
* @param {Core} hot The Handsontable instance.
|
123
|
-
* @returns {CellCoords|null}
|
124
|
-
*/
|
125
|
-
function getMostTopStartPosition(hot) {
|
126
|
-
const {
|
127
|
-
rowIndexMapper,
|
128
|
-
columnIndexMapper
|
129
|
-
} = hot;
|
130
|
-
const {
|
131
|
-
navigableHeaders
|
132
|
-
} = hot.getSettings();
|
133
|
-
let topRow = navigableHeaders && hot.countColHeaders() > 0 ? -hot.countColHeaders() : 0;
|
134
|
-
let startColumn = navigableHeaders && hot.countRowHeaders() > 0 ? -hot.countRowHeaders() : 0;
|
135
|
-
if (topRow === 0) {
|
136
|
-
topRow = rowIndexMapper.getVisualFromRenderableIndex(topRow);
|
137
|
-
}
|
138
|
-
if (startColumn === 0) {
|
139
|
-
startColumn = columnIndexMapper.getVisualFromRenderableIndex(startColumn);
|
140
|
-
}
|
141
|
-
if (topRow === null || startColumn === null) {
|
142
|
-
return null;
|
143
|
-
}
|
144
|
-
return hot._createCellCoords(topRow, startColumn);
|
145
|
-
}
|
146
|
-
|
147
|
-
/**
|
148
|
-
* Gets the coordinates of the most bottom-end cell or header (depends on the table settings and its size).
|
149
|
-
*
|
150
|
-
* @param {Core} hot The Handsontable instance.
|
151
|
-
* @returns {CellCoords|null}
|
152
|
-
*/
|
153
|
-
function getMostBottomEndPosition(hot) {
|
154
|
-
var _rowIndexMapper$getVi, _columnIndexMapper$ge;
|
155
|
-
const {
|
156
|
-
rowIndexMapper,
|
157
|
-
columnIndexMapper
|
158
|
-
} = hot;
|
159
|
-
const {
|
160
|
-
navigableHeaders
|
161
|
-
} = hot.getSettings();
|
162
|
-
let bottomRow = rowIndexMapper.getRenderableIndexesLength() - 1;
|
163
|
-
let endColumn = columnIndexMapper.getRenderableIndexesLength() - 1;
|
164
|
-
if (bottomRow < 0) {
|
165
|
-
if (!navigableHeaders || hot.countColHeaders() === 0) {
|
166
|
-
return null;
|
167
|
-
}
|
168
|
-
bottomRow = -1;
|
169
|
-
}
|
170
|
-
if (endColumn < 0) {
|
171
|
-
if (!navigableHeaders || hot.countColHeaders() === 0) {
|
172
|
-
return null;
|
173
|
-
}
|
174
|
-
endColumn = -1;
|
175
|
-
}
|
176
|
-
return hot._createCellCoords((_rowIndexMapper$getVi = rowIndexMapper.getVisualFromRenderableIndex(bottomRow)) !== null && _rowIndexMapper$getVi !== void 0 ? _rowIndexMapper$getVi : bottomRow, (_columnIndexMapper$ge = columnIndexMapper.getVisualFromRenderableIndex(endColumn)) !== null && _columnIndexMapper$ge !== void 0 ? _columnIndexMapper$ge : endColumn);
|
177
|
-
}
|
178
|
-
|
179
|
-
/**
|
180
|
-
* Normalizes the coordinates (clamps to nearest visible cell position within dataset range).
|
181
|
-
*
|
182
|
-
* @param {Core} hot The Handsontable instance.
|
183
|
-
* @returns {function(Coords | undefined): Coords | null}
|
184
|
-
*/
|
185
|
-
function normalizeCoordsIfNeeded(hot) {
|
186
|
-
return coords => {
|
187
|
-
if (!coords) {
|
188
|
-
return null;
|
189
|
-
}
|
190
|
-
const mostTopStartCoords = getMostTopStartPosition(hot);
|
191
|
-
const mostBottomEndCoords = getMostBottomEndPosition(hot);
|
192
|
-
if (coords.col < mostTopStartCoords.col) {
|
193
|
-
coords.col = mostTopStartCoords.col;
|
194
|
-
}
|
195
|
-
if (coords.col > mostBottomEndCoords.col) {
|
196
|
-
coords.col = mostBottomEndCoords.col;
|
197
|
-
}
|
198
|
-
if (coords.row < mostTopStartCoords.row) {
|
199
|
-
coords.row = mostTopStartCoords.row;
|
200
|
-
}
|
201
|
-
if (coords.row > mostBottomEndCoords.row) {
|
202
|
-
coords.row = mostBottomEndCoords.row;
|
203
|
-
}
|
204
|
-
return coords;
|
205
|
-
};
|
206
131
|
}
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import { GRID_GROUP } from "../../shortcutContexts/index.mjs";
|
2
|
-
import { installFocusDetector } from "
|
2
|
+
import { installFocusDetector } from "../../utils/focusDetector.mjs";
|
3
|
+
import { normalizeCoordsIfNeeded } from "./utils.mjs";
|
4
|
+
import { getMostTopStartPosition, getMostBottomEndPosition } from "../../helpers/mixed.mjs";
|
3
5
|
/**
|
4
6
|
* Installs a focus catcher module. The module observes when the table is focused and depending on
|
5
7
|
* from the which side it was focused on it selects a specified cell or releases the TAB navigation
|
@@ -13,22 +15,22 @@ export function installFocusCatcher(hot) {
|
|
13
15
|
const {
|
14
16
|
activate,
|
15
17
|
deactivate
|
16
|
-
} = installFocusDetector(hot, {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
hot.runHooks('modifyFocusOnTabNavigation', 'from_above', mostTopStartCoords);
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
18
|
+
} = installFocusDetector(hot, hot.rootGridElement, {
|
19
|
+
onFocus(from) {
|
20
|
+
if (from === 'from_above') {
|
21
|
+
var _clampCoordsIfNeeded;
|
22
|
+
const mostTopStartCoords = (_clampCoordsIfNeeded = clampCoordsIfNeeded(recentlyAddedFocusCoords)) !== null && _clampCoordsIfNeeded !== void 0 ? _clampCoordsIfNeeded : getMostTopStartPosition(hot);
|
23
|
+
const result = hot.runHooks('modifyFocusOnTabNavigation', 'from_above', mostTopStartCoords);
|
24
|
+
if (mostTopStartCoords && result !== false) {
|
25
|
+
hot.selectCell(mostTopStartCoords.row, mostTopStartCoords.col);
|
26
|
+
}
|
27
|
+
} else {
|
28
|
+
var _clampCoordsIfNeeded2;
|
29
|
+
const mostBottomEndCoords = (_clampCoordsIfNeeded2 = clampCoordsIfNeeded(recentlyAddedFocusCoords)) !== null && _clampCoordsIfNeeded2 !== void 0 ? _clampCoordsIfNeeded2 : getMostBottomEndPosition(hot);
|
30
|
+
const result = hot.runHooks('modifyFocusOnTabNavigation', 'from_below', mostBottomEndCoords);
|
31
|
+
if (mostBottomEndCoords && result !== false) {
|
32
|
+
hot.selectCell(mostBottomEndCoords.row, mostBottomEndCoords.col);
|
33
|
+
}
|
32
34
|
}
|
33
35
|
hot.listen();
|
34
36
|
}
|
@@ -40,8 +42,20 @@ export function installFocusCatcher(hot) {
|
|
40
42
|
let isSavingCoordsEnabled = true;
|
41
43
|
let isTabOrShiftTabPressed = false;
|
42
44
|
let preventViewportScroll = false;
|
43
|
-
hot.addHook('afterListen', () =>
|
44
|
-
|
45
|
+
hot.addHook('afterListen', () => {
|
46
|
+
const activeContextName = hot.getShortcutManager().getActiveContextName();
|
47
|
+
const activeContext = hot.getShortcutManager().getContext(activeContextName);
|
48
|
+
if ((activeContext === null || activeContext === void 0 ? void 0 : activeContext.scope) === 'table') {
|
49
|
+
deactivate();
|
50
|
+
}
|
51
|
+
});
|
52
|
+
hot.addHook('afterUnlisten', () => {
|
53
|
+
const activeContextName = hot.getShortcutManager().getActiveContextName();
|
54
|
+
const activeContext = hot.getShortcutManager().getContext(activeContextName);
|
55
|
+
if ((activeContext === null || activeContext === void 0 ? void 0 : activeContext.scope) === 'table') {
|
56
|
+
activate();
|
57
|
+
}
|
58
|
+
});
|
45
59
|
hot.addHook('afterSelection', (row, column, row2, column2, preventScrolling) => {
|
46
60
|
if (isTabOrShiftTabPressed && (rowWrapState.wrapped && rowWrapState.flipped || preventViewportScroll)) {
|
47
61
|
preventViewportScroll = false;
|
@@ -49,7 +63,7 @@ export function installFocusCatcher(hot) {
|
|
49
63
|
}
|
50
64
|
if (isSavingCoordsEnabled) {
|
51
65
|
var _hot$getSelectedRange;
|
52
|
-
recentlyAddedFocusCoords = (_hot$getSelectedRange = hot.
|
66
|
+
recentlyAddedFocusCoords = (_hot$getSelectedRange = hot.getSelectedRangeActive()) === null || _hot$getSelectedRange === void 0 ? void 0 : _hot$getSelectedRange.highlight;
|
53
67
|
}
|
54
68
|
});
|
55
69
|
hot.addHook('beforeRowWrap', (interruptedByAutoInsertMode, newCoords, isFlipped) => {
|
@@ -80,7 +94,7 @@ export function installFocusCatcher(hot) {
|
|
80
94
|
tabNavigation
|
81
95
|
} = hot.getSettings();
|
82
96
|
isTabOrShiftTabPressed = true;
|
83
|
-
if (hot.
|
97
|
+
if (hot.getSelectedRangeActive() && !tabNavigation) {
|
84
98
|
isSavingCoordsEnabled = false;
|
85
99
|
}
|
86
100
|
if (!tabNavigation) {
|
@@ -110,93 +124,4 @@ export function installFocusCatcher(hot) {
|
|
110
124
|
},
|
111
125
|
position: 'after'
|
112
126
|
}]);
|
113
|
-
}
|
114
|
-
|
115
|
-
/**
|
116
|
-
* Gets the coordinates of the most top-start cell or header (depends on the table settings and its size).
|
117
|
-
*
|
118
|
-
* @param {Core} hot The Handsontable instance.
|
119
|
-
* @returns {CellCoords|null}
|
120
|
-
*/
|
121
|
-
function getMostTopStartPosition(hot) {
|
122
|
-
const {
|
123
|
-
rowIndexMapper,
|
124
|
-
columnIndexMapper
|
125
|
-
} = hot;
|
126
|
-
const {
|
127
|
-
navigableHeaders
|
128
|
-
} = hot.getSettings();
|
129
|
-
let topRow = navigableHeaders && hot.countColHeaders() > 0 ? -hot.countColHeaders() : 0;
|
130
|
-
let startColumn = navigableHeaders && hot.countRowHeaders() > 0 ? -hot.countRowHeaders() : 0;
|
131
|
-
if (topRow === 0) {
|
132
|
-
topRow = rowIndexMapper.getVisualFromRenderableIndex(topRow);
|
133
|
-
}
|
134
|
-
if (startColumn === 0) {
|
135
|
-
startColumn = columnIndexMapper.getVisualFromRenderableIndex(startColumn);
|
136
|
-
}
|
137
|
-
if (topRow === null || startColumn === null) {
|
138
|
-
return null;
|
139
|
-
}
|
140
|
-
return hot._createCellCoords(topRow, startColumn);
|
141
|
-
}
|
142
|
-
|
143
|
-
/**
|
144
|
-
* Gets the coordinates of the most bottom-end cell or header (depends on the table settings and its size).
|
145
|
-
*
|
146
|
-
* @param {Core} hot The Handsontable instance.
|
147
|
-
* @returns {CellCoords|null}
|
148
|
-
*/
|
149
|
-
function getMostBottomEndPosition(hot) {
|
150
|
-
var _rowIndexMapper$getVi, _columnIndexMapper$ge;
|
151
|
-
const {
|
152
|
-
rowIndexMapper,
|
153
|
-
columnIndexMapper
|
154
|
-
} = hot;
|
155
|
-
const {
|
156
|
-
navigableHeaders
|
157
|
-
} = hot.getSettings();
|
158
|
-
let bottomRow = rowIndexMapper.getRenderableIndexesLength() - 1;
|
159
|
-
let endColumn = columnIndexMapper.getRenderableIndexesLength() - 1;
|
160
|
-
if (bottomRow < 0) {
|
161
|
-
if (!navigableHeaders || hot.countColHeaders() === 0) {
|
162
|
-
return null;
|
163
|
-
}
|
164
|
-
bottomRow = -1;
|
165
|
-
}
|
166
|
-
if (endColumn < 0) {
|
167
|
-
if (!navigableHeaders || hot.countColHeaders() === 0) {
|
168
|
-
return null;
|
169
|
-
}
|
170
|
-
endColumn = -1;
|
171
|
-
}
|
172
|
-
return hot._createCellCoords((_rowIndexMapper$getVi = rowIndexMapper.getVisualFromRenderableIndex(bottomRow)) !== null && _rowIndexMapper$getVi !== void 0 ? _rowIndexMapper$getVi : bottomRow, (_columnIndexMapper$ge = columnIndexMapper.getVisualFromRenderableIndex(endColumn)) !== null && _columnIndexMapper$ge !== void 0 ? _columnIndexMapper$ge : endColumn);
|
173
|
-
}
|
174
|
-
|
175
|
-
/**
|
176
|
-
* Normalizes the coordinates (clamps to nearest visible cell position within dataset range).
|
177
|
-
*
|
178
|
-
* @param {Core} hot The Handsontable instance.
|
179
|
-
* @returns {function(Coords | undefined): Coords | null}
|
180
|
-
*/
|
181
|
-
function normalizeCoordsIfNeeded(hot) {
|
182
|
-
return coords => {
|
183
|
-
if (!coords) {
|
184
|
-
return null;
|
185
|
-
}
|
186
|
-
const mostTopStartCoords = getMostTopStartPosition(hot);
|
187
|
-
const mostBottomEndCoords = getMostBottomEndPosition(hot);
|
188
|
-
if (coords.col < mostTopStartCoords.col) {
|
189
|
-
coords.col = mostTopStartCoords.col;
|
190
|
-
}
|
191
|
-
if (coords.col > mostBottomEndCoords.col) {
|
192
|
-
coords.col = mostBottomEndCoords.col;
|
193
|
-
}
|
194
|
-
if (coords.row < mostTopStartCoords.row) {
|
195
|
-
coords.row = mostTopStartCoords.row;
|
196
|
-
}
|
197
|
-
if (coords.row > mostBottomEndCoords.row) {
|
198
|
-
coords.row = mostBottomEndCoords.row;
|
199
|
-
}
|
200
|
-
return coords;
|
201
|
-
};
|
202
127
|
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
exports.normalizeCoordsIfNeeded = normalizeCoordsIfNeeded;
|
5
|
+
var _number = require("../../helpers/number");
|
6
|
+
var _mixed = require("../../helpers/mixed");
|
7
|
+
/**
|
8
|
+
* Normalizes the coordinates (clamps to nearest visible cell position within dataset range).
|
9
|
+
*
|
10
|
+
* @param {Core} hot The Handsontable instance.
|
11
|
+
* @returns {function(Coords | undefined): Coords | null}
|
12
|
+
*/
|
13
|
+
function normalizeCoordsIfNeeded(hot) {
|
14
|
+
return coords => {
|
15
|
+
if (!coords) {
|
16
|
+
return null;
|
17
|
+
}
|
18
|
+
const {
|
19
|
+
rowIndexMapper,
|
20
|
+
columnIndexMapper
|
21
|
+
} = hot;
|
22
|
+
if (rowIndexMapper.isHidden(coords.row) || columnIndexMapper.isHidden(coords.col)) {
|
23
|
+
return null;
|
24
|
+
}
|
25
|
+
const mostTopStartCoords = (0, _mixed.getMostTopStartPosition)(hot);
|
26
|
+
const mostBottomEndCoords = (0, _mixed.getMostBottomEndPosition)(hot);
|
27
|
+
coords.row = (0, _number.clamp)(coords.row, mostTopStartCoords.row, mostBottomEndCoords.row);
|
28
|
+
coords.col = (0, _number.clamp)(coords.col, mostTopStartCoords.col, mostBottomEndCoords.col);
|
29
|
+
return coords;
|
30
|
+
};
|
31
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { clamp } from "../../helpers/number.mjs";
|
2
|
+
import { getMostTopStartPosition, getMostBottomEndPosition } from "../../helpers/mixed.mjs";
|
3
|
+
/**
|
4
|
+
* Normalizes the coordinates (clamps to nearest visible cell position within dataset range).
|
5
|
+
*
|
6
|
+
* @param {Core} hot The Handsontable instance.
|
7
|
+
* @returns {function(Coords | undefined): Coords | null}
|
8
|
+
*/
|
9
|
+
export function normalizeCoordsIfNeeded(hot) {
|
10
|
+
return coords => {
|
11
|
+
if (!coords) {
|
12
|
+
return null;
|
13
|
+
}
|
14
|
+
const {
|
15
|
+
rowIndexMapper,
|
16
|
+
columnIndexMapper
|
17
|
+
} = hot;
|
18
|
+
if (rowIndexMapper.isHidden(coords.row) || columnIndexMapper.isHidden(coords.col)) {
|
19
|
+
return null;
|
20
|
+
}
|
21
|
+
const mostTopStartCoords = getMostTopStartPosition(hot);
|
22
|
+
const mostBottomEndCoords = getMostBottomEndPosition(hot);
|
23
|
+
coords.row = clamp(coords.row, mostTopStartCoords.row, mostBottomEndCoords.row);
|
24
|
+
coords.col = clamp(coords.col, mostTopStartCoords.col, mostBottomEndCoords.col);
|
25
|
+
return coords;
|
26
|
+
};
|
27
|
+
}
|