handsontable 16.0.1 → 16.1.0-next-91b8a0f-20250905
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 +7842 -2990
- package/dist/handsontable.full.min.css +4 -5
- package/dist/handsontable.full.min.js +167 -165
- package/dist/handsontable.js +9638 -4807
- 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 +290 -0
- package/plugins/loading/loading.mjs +285 -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
package/tableView.js
CHANGED
@@ -165,25 +165,33 @@ class TableView {
|
|
165
165
|
if (!this.hot.isRenderSuspended()) {
|
166
166
|
const isFullRender = this.hot.forceFullRender;
|
167
167
|
this.hot.runHooks('beforeRender', isFullRender);
|
168
|
+
this._wt.draw(!isFullRender);
|
169
|
+
_assertClassBrand(_TableView_brand, this, _updateScrollbarClassNames).call(this);
|
168
170
|
if (this.postponedAdjustElementsSize) {
|
169
171
|
this.postponedAdjustElementsSize = false;
|
170
|
-
this.adjustElementsSize();
|
172
|
+
this.adjustElementsSize(true);
|
171
173
|
}
|
172
|
-
this._wt.draw(!isFullRender);
|
173
|
-
_assertClassBrand(_TableView_brand, this, _updateScrollbarClassNames).call(this);
|
174
174
|
this.hot.runHooks('afterRender', isFullRender);
|
175
175
|
this.hot.forceFullRender = false;
|
176
176
|
}
|
177
177
|
}
|
178
178
|
|
179
179
|
/**
|
180
|
-
* Adjust overlays elements size and master table size.
|
180
|
+
* Adjust overlays elements size and master table size. By default the internal `adjustElementsSize`
|
181
|
+
* call of the Walkontable is postponed to the next render cycle. If `flush` is set to `true`, the method
|
182
|
+
* will be executed immediately.
|
183
|
+
*
|
184
|
+
* TODO: This method should not exist. It is a workaround for the issue with updating the elements
|
185
|
+
* size after render. It should be calculated and updated automatically in Walkontable.
|
186
|
+
*
|
187
|
+
* @param {boolean} [flush=false] If `true`, the method will be executed immediately.
|
181
188
|
*/
|
182
189
|
adjustElementsSize() {
|
183
|
-
|
184
|
-
|
185
|
-
} else {
|
190
|
+
let flush = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
191
|
+
if (flush) {
|
186
192
|
this._wt.wtOverlays.adjustElementsSize();
|
193
|
+
} else {
|
194
|
+
this.postponedAdjustElementsSize = true;
|
187
195
|
}
|
188
196
|
}
|
189
197
|
|
@@ -285,6 +293,7 @@ class TableView {
|
|
285
293
|
*/
|
286
294
|
registerEvents() {
|
287
295
|
const {
|
296
|
+
rootWrapperElement,
|
288
297
|
rootElement,
|
289
298
|
rootDocument,
|
290
299
|
selection,
|
@@ -318,15 +327,19 @@ class TableView {
|
|
318
327
|
}
|
319
328
|
});
|
320
329
|
this.eventManager.addEventListener(documentElement, 'mouseup', event => {
|
330
|
+
var _rootDocument$querySe;
|
321
331
|
if (selection.isInProgress() && (0, _event.isLeftClick)(event)) {
|
322
332
|
selection.finish();
|
323
333
|
}
|
324
334
|
_classPrivateFieldSet(_mouseDown, this, false);
|
325
335
|
const isOutsideInputElement = (0, _element.isOutsideInput)(rootDocument.activeElement);
|
326
|
-
|
336
|
+
// TODO: This is a workaround to prevent the unlisten event from being triggered when the active element is inside a dialog.
|
337
|
+
// Should be removed when the focus manager is implemented.
|
338
|
+
const isInsideDialog = (_rootDocument$querySe = rootDocument.querySelector('.ht-dialog')) === null || _rootDocument$querySe === void 0 ? void 0 : _rootDocument$querySe.contains(rootDocument.activeElement);
|
339
|
+
if ((0, _element.isInput)(rootDocument.activeElement) && !isOutsideInputElement || isInsideDialog) {
|
327
340
|
return;
|
328
341
|
}
|
329
|
-
if (isOutsideInputElement || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !rootElement.contains(event.target) && !(0, _event.isRightClick)(event)) {
|
342
|
+
if (isOutsideInputElement || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !(rootWrapperElement !== null && rootWrapperElement !== void 0 ? rootWrapperElement : rootElement).contains(event.target) && !(0, _event.isRightClick)(event)) {
|
330
343
|
this.hot.unlisten();
|
331
344
|
}
|
332
345
|
});
|
@@ -1081,6 +1094,7 @@ class TableView {
|
|
1081
1094
|
* @returns {boolean}
|
1082
1095
|
*/
|
1083
1096
|
isTextSelectionAllowed(el) {
|
1097
|
+
var _this$hot$getSelected, _this$hot$getSelected2;
|
1084
1098
|
if ((0, _element.isInput)(el)) {
|
1085
1099
|
return true;
|
1086
1100
|
}
|
@@ -1088,10 +1102,11 @@ class TableView {
|
|
1088
1102
|
if (this.settings.fragmentSelection === true && isChildOfTableBody) {
|
1089
1103
|
return true;
|
1090
1104
|
}
|
1091
|
-
|
1105
|
+
const isSingleCell = (_this$hot$getSelected = (_this$hot$getSelected2 = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingleCell()) !== null && _this$hot$getSelected !== void 0 ? _this$hot$getSelected : false;
|
1106
|
+
if (this.settings.fragmentSelection === 'cell' && isSingleCell && isChildOfTableBody) {
|
1092
1107
|
return true;
|
1093
1108
|
}
|
1094
|
-
if (!this.settings.fragmentSelection && this.isCellEdited() &&
|
1109
|
+
if (!this.settings.fragmentSelection && this.isCellEdited() && isSingleCell) {
|
1095
1110
|
return true;
|
1096
1111
|
}
|
1097
1112
|
return false;
|
@@ -1107,17 +1122,6 @@ class TableView {
|
|
1107
1122
|
return _classPrivateFieldGet(_mouseDown, this);
|
1108
1123
|
}
|
1109
1124
|
|
1110
|
-
/**
|
1111
|
-
* Check if selected only one cell.
|
1112
|
-
*
|
1113
|
-
* @private
|
1114
|
-
* @returns {boolean}
|
1115
|
-
*/
|
1116
|
-
isSelectedOnlyCell() {
|
1117
|
-
var _this$hot$getSelected, _this$hot$getSelected2;
|
1118
|
-
return (_this$hot$getSelected = (_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingleCell()) !== null && _this$hot$getSelected !== void 0 ? _this$hot$getSelected : false;
|
1119
|
-
}
|
1120
|
-
|
1121
1125
|
/**
|
1122
1126
|
* Checks if active cell is editing.
|
1123
1127
|
*
|
@@ -1572,7 +1576,8 @@ class TableView {
|
|
1572
1576
|
}
|
1573
1577
|
|
1574
1578
|
/**
|
1575
|
-
* Gets
|
1579
|
+
* Gets table's width. The returned width is the width of the rendered cells that fit in the
|
1580
|
+
* current viewport. The value may change depends on the viewport position (scroll position).
|
1576
1581
|
*
|
1577
1582
|
* @returns {boolean}
|
1578
1583
|
*/
|
@@ -1581,7 +1586,8 @@ class TableView {
|
|
1581
1586
|
}
|
1582
1587
|
|
1583
1588
|
/**
|
1584
|
-
* Gets
|
1589
|
+
* Gets table's height. The returned height is the height of the rendered cells that fit in the
|
1590
|
+
* current viewport. The value may change depends on the viewport position (scroll position).
|
1585
1591
|
*
|
1586
1592
|
* @returns {boolean}
|
1587
1593
|
*/
|
@@ -1589,6 +1595,26 @@ class TableView {
|
|
1589
1595
|
return this._wt.wtTable.getHeight();
|
1590
1596
|
}
|
1591
1597
|
|
1598
|
+
/**
|
1599
|
+
* Gets table's total width. The returned width is the width of all rendered cells (including headers)
|
1600
|
+
* that can be displayed in the table.
|
1601
|
+
*
|
1602
|
+
* @returns {boolean}
|
1603
|
+
*/
|
1604
|
+
getTotalTableWidth() {
|
1605
|
+
return this._wt.wtTable.getTotalWidth();
|
1606
|
+
}
|
1607
|
+
|
1608
|
+
/**
|
1609
|
+
* Gets table's total height. The returned height is the height of all rendered cells (including headers)
|
1610
|
+
* that can be displayed in the table.
|
1611
|
+
*
|
1612
|
+
* @returns {boolean}
|
1613
|
+
*/
|
1614
|
+
getTotalTableHeight() {
|
1615
|
+
return this._wt.wtTable.getTotalHeight();
|
1616
|
+
}
|
1617
|
+
|
1592
1618
|
/**
|
1593
1619
|
* Gets the table's offset.
|
1594
1620
|
*
|
@@ -1661,7 +1687,7 @@ function _updateAriaColcount(delta) {
|
|
1661
1687
|
* Updates the class names on the root element based on the presence of scrollbars.
|
1662
1688
|
*
|
1663
1689
|
* This method checks if the table has vertical and/or horizontal scrollbars and
|
1664
|
-
* adds or removes the corresponding class names (`htHasScrollY` and
|
1690
|
+
* adds or removes the corresponding class names (`htHasScrollY`, `htHasScrollX` and more)
|
1665
1691
|
* to/from the root element.
|
1666
1692
|
*/
|
1667
1693
|
function _updateScrollbarClassNames() {
|
@@ -1671,10 +1697,20 @@ function _updateScrollbarClassNames() {
|
|
1671
1697
|
} else {
|
1672
1698
|
(0, _element.removeClass)(rootElement, 'htHasScrollY');
|
1673
1699
|
}
|
1700
|
+
if (this.isVerticallyScrollableByWindow()) {
|
1701
|
+
(0, _element.addClass)(rootElement, 'htVerticallyScrollableByWindow');
|
1702
|
+
} else {
|
1703
|
+
(0, _element.removeClass)(rootElement, 'htVerticallyScrollableByWindow');
|
1704
|
+
}
|
1674
1705
|
if (this.hasHorizontalScroll()) {
|
1675
1706
|
(0, _element.addClass)(rootElement, 'htHasScrollX');
|
1676
1707
|
} else {
|
1677
1708
|
(0, _element.removeClass)(rootElement, 'htHasScrollX');
|
1678
1709
|
}
|
1710
|
+
if (this.isHorizontallyScrollableByWindow()) {
|
1711
|
+
(0, _element.addClass)(rootElement, 'htHorizontallyScrollableByWindow');
|
1712
|
+
} else {
|
1713
|
+
(0, _element.removeClass)(rootElement, 'htHorizontallyScrollableByWindow');
|
1714
|
+
}
|
1679
1715
|
}
|
1680
1716
|
var _default = exports.default = TableView;
|
package/tableView.mjs
CHANGED
@@ -161,25 +161,33 @@ class TableView {
|
|
161
161
|
if (!this.hot.isRenderSuspended()) {
|
162
162
|
const isFullRender = this.hot.forceFullRender;
|
163
163
|
this.hot.runHooks('beforeRender', isFullRender);
|
164
|
+
this._wt.draw(!isFullRender);
|
165
|
+
_assertClassBrand(_TableView_brand, this, _updateScrollbarClassNames).call(this);
|
164
166
|
if (this.postponedAdjustElementsSize) {
|
165
167
|
this.postponedAdjustElementsSize = false;
|
166
|
-
this.adjustElementsSize();
|
168
|
+
this.adjustElementsSize(true);
|
167
169
|
}
|
168
|
-
this._wt.draw(!isFullRender);
|
169
|
-
_assertClassBrand(_TableView_brand, this, _updateScrollbarClassNames).call(this);
|
170
170
|
this.hot.runHooks('afterRender', isFullRender);
|
171
171
|
this.hot.forceFullRender = false;
|
172
172
|
}
|
173
173
|
}
|
174
174
|
|
175
175
|
/**
|
176
|
-
* Adjust overlays elements size and master table size.
|
176
|
+
* Adjust overlays elements size and master table size. By default the internal `adjustElementsSize`
|
177
|
+
* call of the Walkontable is postponed to the next render cycle. If `flush` is set to `true`, the method
|
178
|
+
* will be executed immediately.
|
179
|
+
*
|
180
|
+
* TODO: This method should not exist. It is a workaround for the issue with updating the elements
|
181
|
+
* size after render. It should be calculated and updated automatically in Walkontable.
|
182
|
+
*
|
183
|
+
* @param {boolean} [flush=false] If `true`, the method will be executed immediately.
|
177
184
|
*/
|
178
185
|
adjustElementsSize() {
|
179
|
-
|
180
|
-
|
181
|
-
} else {
|
186
|
+
let flush = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
187
|
+
if (flush) {
|
182
188
|
this._wt.wtOverlays.adjustElementsSize();
|
189
|
+
} else {
|
190
|
+
this.postponedAdjustElementsSize = true;
|
183
191
|
}
|
184
192
|
}
|
185
193
|
|
@@ -281,6 +289,7 @@ class TableView {
|
|
281
289
|
*/
|
282
290
|
registerEvents() {
|
283
291
|
const {
|
292
|
+
rootWrapperElement,
|
284
293
|
rootElement,
|
285
294
|
rootDocument,
|
286
295
|
selection,
|
@@ -314,15 +323,19 @@ class TableView {
|
|
314
323
|
}
|
315
324
|
});
|
316
325
|
this.eventManager.addEventListener(documentElement, 'mouseup', event => {
|
326
|
+
var _rootDocument$querySe;
|
317
327
|
if (selection.isInProgress() && isLeftClick(event)) {
|
318
328
|
selection.finish();
|
319
329
|
}
|
320
330
|
_classPrivateFieldSet(_mouseDown, this, false);
|
321
331
|
const isOutsideInputElement = isOutsideInput(rootDocument.activeElement);
|
322
|
-
|
332
|
+
// TODO: This is a workaround to prevent the unlisten event from being triggered when the active element is inside a dialog.
|
333
|
+
// Should be removed when the focus manager is implemented.
|
334
|
+
const isInsideDialog = (_rootDocument$querySe = rootDocument.querySelector('.ht-dialog')) === null || _rootDocument$querySe === void 0 ? void 0 : _rootDocument$querySe.contains(rootDocument.activeElement);
|
335
|
+
if (isInput(rootDocument.activeElement) && !isOutsideInputElement || isInsideDialog) {
|
323
336
|
return;
|
324
337
|
}
|
325
|
-
if (isOutsideInputElement || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !rootElement.contains(event.target) && !isRightClick(event)) {
|
338
|
+
if (isOutsideInputElement || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !(rootWrapperElement !== null && rootWrapperElement !== void 0 ? rootWrapperElement : rootElement).contains(event.target) && !isRightClick(event)) {
|
326
339
|
this.hot.unlisten();
|
327
340
|
}
|
328
341
|
});
|
@@ -1077,6 +1090,7 @@ class TableView {
|
|
1077
1090
|
* @returns {boolean}
|
1078
1091
|
*/
|
1079
1092
|
isTextSelectionAllowed(el) {
|
1093
|
+
var _this$hot$getSelected, _this$hot$getSelected2;
|
1080
1094
|
if (isInput(el)) {
|
1081
1095
|
return true;
|
1082
1096
|
}
|
@@ -1084,10 +1098,11 @@ class TableView {
|
|
1084
1098
|
if (this.settings.fragmentSelection === true && isChildOfTableBody) {
|
1085
1099
|
return true;
|
1086
1100
|
}
|
1087
|
-
|
1101
|
+
const isSingleCell = (_this$hot$getSelected = (_this$hot$getSelected2 = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingleCell()) !== null && _this$hot$getSelected !== void 0 ? _this$hot$getSelected : false;
|
1102
|
+
if (this.settings.fragmentSelection === 'cell' && isSingleCell && isChildOfTableBody) {
|
1088
1103
|
return true;
|
1089
1104
|
}
|
1090
|
-
if (!this.settings.fragmentSelection && this.isCellEdited() &&
|
1105
|
+
if (!this.settings.fragmentSelection && this.isCellEdited() && isSingleCell) {
|
1091
1106
|
return true;
|
1092
1107
|
}
|
1093
1108
|
return false;
|
@@ -1103,17 +1118,6 @@ class TableView {
|
|
1103
1118
|
return _classPrivateFieldGet(_mouseDown, this);
|
1104
1119
|
}
|
1105
1120
|
|
1106
|
-
/**
|
1107
|
-
* Check if selected only one cell.
|
1108
|
-
*
|
1109
|
-
* @private
|
1110
|
-
* @returns {boolean}
|
1111
|
-
*/
|
1112
|
-
isSelectedOnlyCell() {
|
1113
|
-
var _this$hot$getSelected, _this$hot$getSelected2;
|
1114
|
-
return (_this$hot$getSelected = (_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingleCell()) !== null && _this$hot$getSelected !== void 0 ? _this$hot$getSelected : false;
|
1115
|
-
}
|
1116
|
-
|
1117
1121
|
/**
|
1118
1122
|
* Checks if active cell is editing.
|
1119
1123
|
*
|
@@ -1568,7 +1572,8 @@ class TableView {
|
|
1568
1572
|
}
|
1569
1573
|
|
1570
1574
|
/**
|
1571
|
-
* Gets
|
1575
|
+
* Gets table's width. The returned width is the width of the rendered cells that fit in the
|
1576
|
+
* current viewport. The value may change depends on the viewport position (scroll position).
|
1572
1577
|
*
|
1573
1578
|
* @returns {boolean}
|
1574
1579
|
*/
|
@@ -1577,7 +1582,8 @@ class TableView {
|
|
1577
1582
|
}
|
1578
1583
|
|
1579
1584
|
/**
|
1580
|
-
* Gets
|
1585
|
+
* Gets table's height. The returned height is the height of the rendered cells that fit in the
|
1586
|
+
* current viewport. The value may change depends on the viewport position (scroll position).
|
1581
1587
|
*
|
1582
1588
|
* @returns {boolean}
|
1583
1589
|
*/
|
@@ -1585,6 +1591,26 @@ class TableView {
|
|
1585
1591
|
return this._wt.wtTable.getHeight();
|
1586
1592
|
}
|
1587
1593
|
|
1594
|
+
/**
|
1595
|
+
* Gets table's total width. The returned width is the width of all rendered cells (including headers)
|
1596
|
+
* that can be displayed in the table.
|
1597
|
+
*
|
1598
|
+
* @returns {boolean}
|
1599
|
+
*/
|
1600
|
+
getTotalTableWidth() {
|
1601
|
+
return this._wt.wtTable.getTotalWidth();
|
1602
|
+
}
|
1603
|
+
|
1604
|
+
/**
|
1605
|
+
* Gets table's total height. The returned height is the height of all rendered cells (including headers)
|
1606
|
+
* that can be displayed in the table.
|
1607
|
+
*
|
1608
|
+
* @returns {boolean}
|
1609
|
+
*/
|
1610
|
+
getTotalTableHeight() {
|
1611
|
+
return this._wt.wtTable.getTotalHeight();
|
1612
|
+
}
|
1613
|
+
|
1588
1614
|
/**
|
1589
1615
|
* Gets the table's offset.
|
1590
1616
|
*
|
@@ -1657,7 +1683,7 @@ function _updateAriaColcount(delta) {
|
|
1657
1683
|
* Updates the class names on the root element based on the presence of scrollbars.
|
1658
1684
|
*
|
1659
1685
|
* This method checks if the table has vertical and/or horizontal scrollbars and
|
1660
|
-
* adds or removes the corresponding class names (`htHasScrollY` and
|
1686
|
+
* adds or removes the corresponding class names (`htHasScrollY`, `htHasScrollX` and more)
|
1661
1687
|
* to/from the root element.
|
1662
1688
|
*/
|
1663
1689
|
function _updateScrollbarClassNames() {
|
@@ -1667,10 +1693,20 @@ function _updateScrollbarClassNames() {
|
|
1667
1693
|
} else {
|
1668
1694
|
removeClass(rootElement, 'htHasScrollY');
|
1669
1695
|
}
|
1696
|
+
if (this.isVerticallyScrollableByWindow()) {
|
1697
|
+
addClass(rootElement, 'htVerticallyScrollableByWindow');
|
1698
|
+
} else {
|
1699
|
+
removeClass(rootElement, 'htVerticallyScrollableByWindow');
|
1700
|
+
}
|
1670
1701
|
if (this.hasHorizontalScroll()) {
|
1671
1702
|
addClass(rootElement, 'htHasScrollX');
|
1672
1703
|
} else {
|
1673
1704
|
removeClass(rootElement, 'htHasScrollX');
|
1674
1705
|
}
|
1706
|
+
if (this.isHorizontallyScrollableByWindow()) {
|
1707
|
+
addClass(rootElement, 'htHorizontallyScrollableByWindow');
|
1708
|
+
} else {
|
1709
|
+
removeClass(rootElement, 'htHorizontallyScrollableByWindow');
|
1710
|
+
}
|
1675
1711
|
}
|
1676
1712
|
export default TableView;
|
@@ -0,0 +1,70 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
exports.announce = announce;
|
5
|
+
exports.install = install;
|
6
|
+
exports.uninstall = uninstall;
|
7
|
+
/**
|
8
|
+
* The module provides functionality to announce custom messages to assistive technologies.
|
9
|
+
*/
|
10
|
+
let announcerElement = null;
|
11
|
+
let installCounter = 0;
|
12
|
+
|
13
|
+
/**
|
14
|
+
* Installs the a11y announcer element into the provided root portal element. For each new Handsontable
|
15
|
+
* instance only one announcer element is created, so it can be reused across multiple instances.
|
16
|
+
*
|
17
|
+
* @param {HTMLElement} rootPortalElement The root element where the announcer will be installed.
|
18
|
+
*/
|
19
|
+
function install(rootPortalElement) {
|
20
|
+
const document = rootPortalElement.ownerDocument;
|
21
|
+
if (!announcerElement) {
|
22
|
+
announcerElement = document.createElement('div');
|
23
|
+
announcerElement.setAttribute('role', 'status');
|
24
|
+
announcerElement.setAttribute('aria-live', 'assertive');
|
25
|
+
announcerElement.setAttribute('aria-atomic', 'true');
|
26
|
+
const style = announcerElement.style;
|
27
|
+
style.position = 'absolute';
|
28
|
+
style.width = '1px';
|
29
|
+
style.height = '1px';
|
30
|
+
style.margin = '-1px';
|
31
|
+
style.overflow = 'hidden';
|
32
|
+
style.clipPath = 'rect(0 0 0 0)';
|
33
|
+
style.whiteSpace = 'nowrap';
|
34
|
+
rootPortalElement.appendChild(announcerElement);
|
35
|
+
}
|
36
|
+
installCounter += 1;
|
37
|
+
}
|
38
|
+
|
39
|
+
/**
|
40
|
+
* Uninstalls the a11y announcer element if it was installed.
|
41
|
+
*/
|
42
|
+
function uninstall() {
|
43
|
+
if (installCounter === 0) {
|
44
|
+
return;
|
45
|
+
}
|
46
|
+
if (installCounter === 1) {
|
47
|
+
announcerElement.remove();
|
48
|
+
announcerElement = null;
|
49
|
+
}
|
50
|
+
installCounter -= 1;
|
51
|
+
}
|
52
|
+
|
53
|
+
/**
|
54
|
+
* Announces a message to assistive technologies by updating the content of the a11y announcer element.
|
55
|
+
*
|
56
|
+
* @param {string} message The message to announce.
|
57
|
+
*/
|
58
|
+
function announce(message) {
|
59
|
+
if (!announcerElement) {
|
60
|
+
return;
|
61
|
+
}
|
62
|
+
|
63
|
+
// The value needs to be cleared first to ensure that screen readers announce the new message.
|
64
|
+
announcerElement.textContent = '';
|
65
|
+
setTimeout(() => {
|
66
|
+
if (announcerElement) {
|
67
|
+
announcerElement.textContent = message;
|
68
|
+
}
|
69
|
+
}, 100);
|
70
|
+
}
|
@@ -0,0 +1,64 @@
|
|
1
|
+
/**
|
2
|
+
* The module provides functionality to announce custom messages to assistive technologies.
|
3
|
+
*/
|
4
|
+
let announcerElement = null;
|
5
|
+
let installCounter = 0;
|
6
|
+
|
7
|
+
/**
|
8
|
+
* Installs the a11y announcer element into the provided root portal element. For each new Handsontable
|
9
|
+
* instance only one announcer element is created, so it can be reused across multiple instances.
|
10
|
+
*
|
11
|
+
* @param {HTMLElement} rootPortalElement The root element where the announcer will be installed.
|
12
|
+
*/
|
13
|
+
export function install(rootPortalElement) {
|
14
|
+
const document = rootPortalElement.ownerDocument;
|
15
|
+
if (!announcerElement) {
|
16
|
+
announcerElement = document.createElement('div');
|
17
|
+
announcerElement.setAttribute('role', 'status');
|
18
|
+
announcerElement.setAttribute('aria-live', 'assertive');
|
19
|
+
announcerElement.setAttribute('aria-atomic', 'true');
|
20
|
+
const style = announcerElement.style;
|
21
|
+
style.position = 'absolute';
|
22
|
+
style.width = '1px';
|
23
|
+
style.height = '1px';
|
24
|
+
style.margin = '-1px';
|
25
|
+
style.overflow = 'hidden';
|
26
|
+
style.clipPath = 'rect(0 0 0 0)';
|
27
|
+
style.whiteSpace = 'nowrap';
|
28
|
+
rootPortalElement.appendChild(announcerElement);
|
29
|
+
}
|
30
|
+
installCounter += 1;
|
31
|
+
}
|
32
|
+
|
33
|
+
/**
|
34
|
+
* Uninstalls the a11y announcer element if it was installed.
|
35
|
+
*/
|
36
|
+
export function uninstall() {
|
37
|
+
if (installCounter === 0) {
|
38
|
+
return;
|
39
|
+
}
|
40
|
+
if (installCounter === 1) {
|
41
|
+
announcerElement.remove();
|
42
|
+
announcerElement = null;
|
43
|
+
}
|
44
|
+
installCounter -= 1;
|
45
|
+
}
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Announces a message to assistive technologies by updating the content of the a11y announcer element.
|
49
|
+
*
|
50
|
+
* @param {string} message The message to announce.
|
51
|
+
*/
|
52
|
+
export function announce(message) {
|
53
|
+
if (!announcerElement) {
|
54
|
+
return;
|
55
|
+
}
|
56
|
+
|
57
|
+
// The value needs to be cleared first to ensure that screen readers announce the new message.
|
58
|
+
announcerElement.textContent = '';
|
59
|
+
setTimeout(() => {
|
60
|
+
if (announcerElement) {
|
61
|
+
announcerElement.textContent = message;
|
62
|
+
}
|
63
|
+
}, 100);
|
64
|
+
}
|
@@ -2,8 +2,14 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
exports.installFocusDetector = installFocusDetector;
|
5
|
-
var _element = require("
|
6
|
-
var _a11y = require("
|
5
|
+
var _element = require("../helpers/dom/element");
|
6
|
+
var _a11y = require("../helpers/a11y");
|
7
|
+
/**
|
8
|
+
* @typedef {object} FocusDetector
|
9
|
+
* @property {function(): void} activate Activates the focus detector.
|
10
|
+
* @property {function(): void} deactivate Deactivates the focus detector.
|
11
|
+
* @property {function('from_above' | 'from_below'): void} focus Focuses the input element in the given direction.
|
12
|
+
*/
|
7
13
|
/**
|
8
14
|
* Installs a focus detector module. The module appends two input elements into the DOM side by side.
|
9
15
|
* When the first input is focused, then it means that a user entered to the component using the TAB key
|
@@ -11,19 +17,31 @@ var _a11y = require("../../helpers/a11y");
|
|
11
17
|
* the element below the table. Each action, once detected, triggers the specific hook.
|
12
18
|
*
|
13
19
|
* @param {Handsontable} hot The Handsontable instance.
|
14
|
-
* @param {
|
15
|
-
* @
|
20
|
+
* @param {HTMLElement} wrapperElement The wrapper element to install the focus detector into.
|
21
|
+
* @param {{ onFocus: Function }} hooks An object with defined callbacks to call.
|
22
|
+
* @returns {FocusDetector}
|
16
23
|
*/
|
17
|
-
function installFocusDetector(hot) {
|
18
|
-
let hooks = arguments.length >
|
19
|
-
const rootElement = hot.rootElement;
|
24
|
+
function installFocusDetector(hot, wrapperElement) {
|
25
|
+
let hooks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
20
26
|
const inputTrapTop = createInputElement(hot);
|
21
27
|
const inputTrapBottom = createInputElement(hot);
|
22
|
-
inputTrapTop.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.
|
23
|
-
inputTrapBottom.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.
|
24
|
-
|
25
|
-
|
28
|
+
inputTrapTop.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.onFocus('from_above'));
|
29
|
+
inputTrapBottom.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.onFocus('from_below'));
|
30
|
+
wrapperElement.prepend(inputTrapTop);
|
31
|
+
wrapperElement.append(inputTrapBottom);
|
26
32
|
return {
|
33
|
+
/**
|
34
|
+
* Focuses the input element in the given direction.
|
35
|
+
*
|
36
|
+
* @param {string} direction The direction to focus the input element in.
|
37
|
+
*/
|
38
|
+
focus(direction) {
|
39
|
+
if (direction === 'from_above') {
|
40
|
+
inputTrapTop.focus();
|
41
|
+
} else {
|
42
|
+
inputTrapBottom.focus();
|
43
|
+
}
|
44
|
+
},
|
27
45
|
/**
|
28
46
|
* Activates the detector by resetting the tabIndex of the input elements.
|
29
47
|
*/
|
@@ -55,7 +73,7 @@ function createInputElement(hot) {
|
|
55
73
|
const rootDocument = hot.rootDocument;
|
56
74
|
const input = rootDocument.createElement('input');
|
57
75
|
input.type = 'text';
|
58
|
-
input.name = '
|
76
|
+
input.name = 'htFocusCatcher';
|
59
77
|
input.classList.add('htFocusCatcher');
|
60
78
|
if (hot.getSettings().ariaTags) {
|
61
79
|
(0, _element.setAttribute)(input, [(0, _a11y.A11Y_LABEL)('Focus catcher')]);
|
@@ -1,5 +1,11 @@
|
|
1
|
-
import { setAttribute } from "
|
2
|
-
import { A11Y_LABEL } from "
|
1
|
+
import { setAttribute } from "../helpers/dom/element.mjs";
|
2
|
+
import { A11Y_LABEL } from "../helpers/a11y.mjs";
|
3
|
+
/**
|
4
|
+
* @typedef {object} FocusDetector
|
5
|
+
* @property {function(): void} activate Activates the focus detector.
|
6
|
+
* @property {function(): void} deactivate Deactivates the focus detector.
|
7
|
+
* @property {function('from_above' | 'from_below'): void} focus Focuses the input element in the given direction.
|
8
|
+
*/
|
3
9
|
/**
|
4
10
|
* Installs a focus detector module. The module appends two input elements into the DOM side by side.
|
5
11
|
* When the first input is focused, then it means that a user entered to the component using the TAB key
|
@@ -7,19 +13,31 @@ import { A11Y_LABEL } from "../../helpers/a11y.mjs";
|
|
7
13
|
* the element below the table. Each action, once detected, triggers the specific hook.
|
8
14
|
*
|
9
15
|
* @param {Handsontable} hot The Handsontable instance.
|
10
|
-
* @param {
|
11
|
-
* @
|
16
|
+
* @param {HTMLElement} wrapperElement The wrapper element to install the focus detector into.
|
17
|
+
* @param {{ onFocus: Function }} hooks An object with defined callbacks to call.
|
18
|
+
* @returns {FocusDetector}
|
12
19
|
*/
|
13
|
-
export function installFocusDetector(hot) {
|
14
|
-
let hooks = arguments.length >
|
15
|
-
const rootElement = hot.rootElement;
|
20
|
+
export function installFocusDetector(hot, wrapperElement) {
|
21
|
+
let hooks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
16
22
|
const inputTrapTop = createInputElement(hot);
|
17
23
|
const inputTrapBottom = createInputElement(hot);
|
18
|
-
inputTrapTop.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.
|
19
|
-
inputTrapBottom.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.
|
20
|
-
|
21
|
-
|
24
|
+
inputTrapTop.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.onFocus('from_above'));
|
25
|
+
inputTrapBottom.addEventListener('focus', () => hooks === null || hooks === void 0 ? void 0 : hooks.onFocus('from_below'));
|
26
|
+
wrapperElement.prepend(inputTrapTop);
|
27
|
+
wrapperElement.append(inputTrapBottom);
|
22
28
|
return {
|
29
|
+
/**
|
30
|
+
* Focuses the input element in the given direction.
|
31
|
+
*
|
32
|
+
* @param {string} direction The direction to focus the input element in.
|
33
|
+
*/
|
34
|
+
focus(direction) {
|
35
|
+
if (direction === 'from_above') {
|
36
|
+
inputTrapTop.focus();
|
37
|
+
} else {
|
38
|
+
inputTrapBottom.focus();
|
39
|
+
}
|
40
|
+
},
|
23
41
|
/**
|
24
42
|
* Activates the detector by resetting the tabIndex of the input elements.
|
25
43
|
*/
|
@@ -51,7 +69,7 @@ function createInputElement(hot) {
|
|
51
69
|
const rootDocument = hot.rootDocument;
|
52
70
|
const input = rootDocument.createElement('input');
|
53
71
|
input.type = 'text';
|
54
|
-
input.name = '
|
72
|
+
input.name = 'htFocusCatcher';
|
55
73
|
input.classList.add('htFocusCatcher');
|
56
74
|
if (hot.getSettings().ariaTags) {
|
57
75
|
setAttribute(input, [A11Y_LABEL('Focus catcher')]);
|
@@ -50,6 +50,13 @@ class SamplesGenerator {
|
|
50
50
|
* @default {false}
|
51
51
|
*/
|
52
52
|
_defineProperty(this, "allowDuplicates", false);
|
53
|
+
/**
|
54
|
+
* `true` if hidden samples should be included, `false` otherwise.
|
55
|
+
*
|
56
|
+
* @type {boolean}
|
57
|
+
* @default {false}
|
58
|
+
*/
|
59
|
+
_defineProperty(this, "includeHidden", false);
|
53
60
|
this.dataFactory = dataFactory;
|
54
61
|
}
|
55
62
|
|
@@ -83,6 +90,15 @@ class SamplesGenerator {
|
|
83
90
|
this.allowDuplicates = allowDuplicates;
|
84
91
|
}
|
85
92
|
|
93
|
+
/**
|
94
|
+
* Sets the sampler to the mode where it will generate samples for hidden indexes.
|
95
|
+
*
|
96
|
+
* @param {boolean} includeHidden `true` to include hidden indexes, `false` otherwise.
|
97
|
+
*/
|
98
|
+
setIncludeHidden(includeHidden) {
|
99
|
+
this.includeHidden = includeHidden;
|
100
|
+
}
|
101
|
+
|
86
102
|
/**
|
87
103
|
* Generate samples for row. You can control which area should be sampled by passing `rowRange` object and `colRange` object.
|
88
104
|
*
|
@@ -145,7 +161,7 @@ class SamplesGenerator {
|
|
145
161
|
const computedKey = type === 'row' ? 'col' : 'row';
|
146
162
|
const sampledValues = [];
|
147
163
|
(0, _number.rangeEach)(range.from, range.to, index => {
|
148
|
-
const data = type === 'row' ? this.dataFactory(specifierValue, index) : this.dataFactory(index, specifierValue);
|
164
|
+
const data = type === 'row' ? this.dataFactory(specifierValue, index, this) : this.dataFactory(index, specifierValue, this);
|
149
165
|
if (data === false) {
|
150
166
|
return;
|
151
167
|
}
|