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
@@ -86,7 +86,7 @@ export class MultipleSelectionHandles extends BasePlugin {
|
|
86
86
|
this.eventManager.addEventListener(rootElement, 'touchstart', event => {
|
87
87
|
let selectedRange;
|
88
88
|
if (hasClass(event.target, 'topSelectionHandle-HitArea')) {
|
89
|
-
selectedRange = _this.hot.
|
89
|
+
selectedRange = _this.hot.getSelectedRangeActive();
|
90
90
|
_this.dragged.push('top');
|
91
91
|
_this.touchStartRange = {
|
92
92
|
width: selectedRange.getWidth(),
|
@@ -96,7 +96,7 @@ export class MultipleSelectionHandles extends BasePlugin {
|
|
96
96
|
event.preventDefault();
|
97
97
|
return false;
|
98
98
|
} else if (hasClass(event.target, 'bottomSelectionHandle-HitArea')) {
|
99
|
-
selectedRange = _this.hot.
|
99
|
+
selectedRange = _this.hot.getSelectedRangeActive();
|
100
100
|
_this.dragged.push('bottom');
|
101
101
|
_this.touchStartRange = {
|
102
102
|
width: selectedRange.getWidth(),
|
@@ -142,7 +142,7 @@ export class MultipleSelectionHandles extends BasePlugin {
|
|
142
142
|
if (targetCoords.col === -1) {
|
143
143
|
targetCoords.col = 0;
|
144
144
|
}
|
145
|
-
selectedRange = _this.hot.
|
145
|
+
selectedRange = _this.hot.getSelectedRangeActive();
|
146
146
|
rangeWidth = selectedRange.getWidth();
|
147
147
|
rangeHeight = selectedRange.getHeight();
|
148
148
|
rangeDirection = selectedRange.getDirection();
|
@@ -103,13 +103,21 @@ var _hidingIndexMapObserver = /*#__PURE__*/new WeakMap();
|
|
103
103
|
var _focusInitialCoords = /*#__PURE__*/new WeakMap();
|
104
104
|
var _isColumnsSelectionInProgress = /*#__PURE__*/new WeakMap();
|
105
105
|
var _recentlyHighlightCoords = /*#__PURE__*/new WeakMap();
|
106
|
+
var _updateFocusHighlightPosition = /*#__PURE__*/new WeakMap();
|
106
107
|
var _NestedHeaders_brand = /*#__PURE__*/new WeakSet();
|
107
108
|
class NestedHeaders extends _base.BasePlugin {
|
108
109
|
constructor() {
|
109
110
|
super(...arguments);
|
110
111
|
/**
|
111
|
-
*
|
112
|
-
*
|
112
|
+
* Allows to control to which column index the viewport will be scrolled. To ensure that the viewport
|
113
|
+
* is scrolled to the correct column for the nested header the most left and the most right visual column
|
114
|
+
* indexes are used.
|
115
|
+
*
|
116
|
+
* @param {number} visualColumn A visual column index to which the viewport will be scrolled.
|
117
|
+
* @param {{ value: 'auto' | 'start' | 'end' }} snapping If `'start'`, viewport is scrolled to show
|
118
|
+
* the cell on the left of the table. If `'end'`, viewport is scrolled to show the cell on the right of
|
119
|
+
* the table. When `'auto'`, the viewport is scrolled only when the column is outside of the viewport.
|
120
|
+
* @returns {number}
|
113
121
|
*/
|
114
122
|
_classPrivateMethodInitSpec(this, _NestedHeaders_brand);
|
115
123
|
/**
|
@@ -160,6 +168,34 @@ class NestedHeaders extends _base.BasePlugin {
|
|
160
168
|
* @type {boolean}
|
161
169
|
*/
|
162
170
|
_defineProperty(this, "detectedOverlappedHeaders", false);
|
171
|
+
/**
|
172
|
+
* Updates the selection focus highlight position to point to the nested header root element (TH)
|
173
|
+
* even when the logical coordinates point in-between the header.
|
174
|
+
*
|
175
|
+
* The method uses arrow function to keep the reference to the class method. Necessary for
|
176
|
+
* the `removeLocalHook` method of the row and column index mapper.
|
177
|
+
*/
|
178
|
+
_classPrivateFieldInitSpec(this, _updateFocusHighlightPosition, () => {
|
179
|
+
var _this$hot;
|
180
|
+
const selection = (_this$hot = this.hot) === null || _this$hot === void 0 ? void 0 : _this$hot.getSelectedRangeActive();
|
181
|
+
if (!selection) {
|
182
|
+
return;
|
183
|
+
}
|
184
|
+
const {
|
185
|
+
highlight
|
186
|
+
} = selection;
|
187
|
+
const isNestedHeadersRange = highlight.isHeader() && highlight.col >= 0;
|
188
|
+
if (isNestedHeadersRange) {
|
189
|
+
const columnIndex = _classPrivateFieldGet(_stateManager, this).findLeftMostColumnIndex(highlight.row, highlight.col);
|
190
|
+
const focusHighlight = this.hot.selection.highlight.getFocus();
|
191
|
+
|
192
|
+
// Correct the highlight/focus selection to highlight the correct TH element
|
193
|
+
focusHighlight.visualCellRange.highlight.col = columnIndex;
|
194
|
+
focusHighlight.visualCellRange.from.col = columnIndex;
|
195
|
+
focusHighlight.visualCellRange.to.col = columnIndex;
|
196
|
+
focusHighlight.commit();
|
197
|
+
}
|
198
|
+
});
|
163
199
|
}
|
164
200
|
static get PLUGIN_KEY() {
|
165
201
|
return PLUGIN_KEY;
|
@@ -234,8 +270,8 @@ class NestedHeaders extends _base.BasePlugin {
|
|
234
270
|
}
|
235
271
|
return _assertClassBrand(_NestedHeaders_brand, _this, _onModifyTransformStart).call(_this, ...args);
|
236
272
|
});
|
237
|
-
this.addHook('afterSelection', () =>
|
238
|
-
this.addHook('afterSelectionFocusSet', () =>
|
273
|
+
this.addHook('afterSelection', () => _classPrivateFieldGet(_updateFocusHighlightPosition, this).call(this));
|
274
|
+
this.addHook('afterSelectionFocusSet', () => _classPrivateFieldGet(_updateFocusHighlightPosition, this).call(this));
|
239
275
|
this.addHook('beforeViewportScrollHorizontally', function () {
|
240
276
|
for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
|
241
277
|
args[_key8] = arguments[_key8];
|
@@ -285,8 +321,8 @@ class NestedHeaders extends _base.BasePlugin {
|
|
285
321
|
}
|
286
322
|
return _assertClassBrand(_NestedHeaders_brand, _this, _onModifyFocusedElement).call(_this, ...args);
|
287
323
|
});
|
288
|
-
this.hot.columnIndexMapper.addLocalHook('cacheUpdated', (
|
289
|
-
this.hot.rowIndexMapper.addLocalHook('cacheUpdated', (
|
324
|
+
this.hot.columnIndexMapper.addLocalHook('cacheUpdated', _classPrivateFieldGet(_updateFocusHighlightPosition, this));
|
325
|
+
this.hot.rowIndexMapper.addLocalHook('cacheUpdated', _classPrivateFieldGet(_updateFocusHighlightPosition, this));
|
290
326
|
super.enablePlugin();
|
291
327
|
this.updatePlugin(); // @TODO: Workaround for broken plugin initialization abstraction.
|
292
328
|
}
|
@@ -346,6 +382,8 @@ class NestedHeaders extends _base.BasePlugin {
|
|
346
382
|
* Disables the plugin functionality for this Handsontable instance.
|
347
383
|
*/
|
348
384
|
disablePlugin() {
|
385
|
+
this.hot.rowIndexMapper.removeLocalHook('cacheUpdated', _classPrivateFieldGet(_updateFocusHighlightPosition, this));
|
386
|
+
this.hot.columnIndexMapper.removeLocalHook('cacheUpdated', _classPrivateFieldGet(_updateFocusHighlightPosition, this));
|
349
387
|
this.clearColspans();
|
350
388
|
_classPrivateFieldGet(_stateManager, this).clear();
|
351
389
|
_classPrivateFieldGet(_hidingIndexMapObserver, this).unsubscribe();
|
@@ -543,41 +581,9 @@ class NestedHeaders extends _base.BasePlugin {
|
|
543
581
|
}
|
544
582
|
}
|
545
583
|
exports.NestedHeaders = NestedHeaders;
|
546
|
-
function _updateFocusHighlightPosition() {
|
547
|
-
var _this$hot;
|
548
|
-
const selection = (_this$hot = this.hot) === null || _this$hot === void 0 ? void 0 : _this$hot.getSelectedRangeLast();
|
549
|
-
if (!selection) {
|
550
|
-
return;
|
551
|
-
}
|
552
|
-
const {
|
553
|
-
highlight
|
554
|
-
} = selection;
|
555
|
-
const isNestedHeadersRange = highlight.isHeader() && highlight.col >= 0;
|
556
|
-
if (isNestedHeadersRange) {
|
557
|
-
const columnIndex = _classPrivateFieldGet(_stateManager, this).findLeftMostColumnIndex(highlight.row, highlight.col);
|
558
|
-
const focusHighlight = this.hot.selection.highlight.getFocus();
|
559
|
-
|
560
|
-
// Correct the highlight/focus selection to highlight the correct TH element
|
561
|
-
focusHighlight.visualCellRange.highlight.col = columnIndex;
|
562
|
-
focusHighlight.visualCellRange.from.col = columnIndex;
|
563
|
-
focusHighlight.visualCellRange.to.col = columnIndex;
|
564
|
-
focusHighlight.commit();
|
565
|
-
}
|
566
|
-
}
|
567
|
-
/**
|
568
|
-
* Allows to control to which column index the viewport will be scrolled. To ensure that the viewport
|
569
|
-
* is scrolled to the correct column for the nested header the most left and the most right visual column
|
570
|
-
* indexes are used.
|
571
|
-
*
|
572
|
-
* @param {number} visualColumn A visual column index to which the viewport will be scrolled.
|
573
|
-
* @param {{ value: 'auto' | 'start' | 'end' }} snapping If `'start'`, viewport is scrolled to show
|
574
|
-
* the cell on the left of the table. If `'end'`, viewport is scrolled to show the cell on the right of
|
575
|
-
* the table. When `'auto'`, the viewport is scrolled only when the column is outside of the viewport.
|
576
|
-
* @returns {number}
|
577
|
-
*/
|
578
584
|
function _onBeforeViewportScrollHorizontally(visualColumn, snapping) {
|
579
585
|
var _classPrivateFieldGet4;
|
580
|
-
const selection = this.hot.
|
586
|
+
const selection = this.hot.getSelectedRangeActive();
|
581
587
|
if (!selection) {
|
582
588
|
return visualColumn;
|
583
589
|
}
|
@@ -793,7 +799,7 @@ function _onBeforeOnCellMouseOver(event, coords, TD, controller) {
|
|
793
799
|
columnIndex,
|
794
800
|
origColspan
|
795
801
|
} = headerNodeData;
|
796
|
-
const selectedRange = this.hot.
|
802
|
+
const selectedRange = this.hot.getSelectedRangeActive();
|
797
803
|
const topStartCoords = selectedRange.getTopStartCorner();
|
798
804
|
const bottomEndCoords = selectedRange.getBottomEndCorner();
|
799
805
|
const {
|
@@ -854,7 +860,7 @@ function _onBeforeSelectionHighlightSet() {
|
|
854
860
|
function _onModifyTransformStart(delta) {
|
855
861
|
const {
|
856
862
|
highlight
|
857
|
-
} = this.hot.
|
863
|
+
} = this.hot.getSelectedRangeActive();
|
858
864
|
const nextCoords = this.hot._createCellCoords(highlight.row + delta.row, highlight.col + delta.col);
|
859
865
|
const isNestedHeadersRange = nextCoords.isHeader() && nextCoords.col >= 0;
|
860
866
|
if (!isNestedHeadersRange) {
|
@@ -99,13 +99,21 @@ var _hidingIndexMapObserver = /*#__PURE__*/new WeakMap();
|
|
99
99
|
var _focusInitialCoords = /*#__PURE__*/new WeakMap();
|
100
100
|
var _isColumnsSelectionInProgress = /*#__PURE__*/new WeakMap();
|
101
101
|
var _recentlyHighlightCoords = /*#__PURE__*/new WeakMap();
|
102
|
+
var _updateFocusHighlightPosition = /*#__PURE__*/new WeakMap();
|
102
103
|
var _NestedHeaders_brand = /*#__PURE__*/new WeakSet();
|
103
104
|
export class NestedHeaders extends BasePlugin {
|
104
105
|
constructor() {
|
105
106
|
super(...arguments);
|
106
107
|
/**
|
107
|
-
*
|
108
|
-
*
|
108
|
+
* Allows to control to which column index the viewport will be scrolled. To ensure that the viewport
|
109
|
+
* is scrolled to the correct column for the nested header the most left and the most right visual column
|
110
|
+
* indexes are used.
|
111
|
+
*
|
112
|
+
* @param {number} visualColumn A visual column index to which the viewport will be scrolled.
|
113
|
+
* @param {{ value: 'auto' | 'start' | 'end' }} snapping If `'start'`, viewport is scrolled to show
|
114
|
+
* the cell on the left of the table. If `'end'`, viewport is scrolled to show the cell on the right of
|
115
|
+
* the table. When `'auto'`, the viewport is scrolled only when the column is outside of the viewport.
|
116
|
+
* @returns {number}
|
109
117
|
*/
|
110
118
|
_classPrivateMethodInitSpec(this, _NestedHeaders_brand);
|
111
119
|
/**
|
@@ -156,6 +164,34 @@ export class NestedHeaders extends BasePlugin {
|
|
156
164
|
* @type {boolean}
|
157
165
|
*/
|
158
166
|
_defineProperty(this, "detectedOverlappedHeaders", false);
|
167
|
+
/**
|
168
|
+
* Updates the selection focus highlight position to point to the nested header root element (TH)
|
169
|
+
* even when the logical coordinates point in-between the header.
|
170
|
+
*
|
171
|
+
* The method uses arrow function to keep the reference to the class method. Necessary for
|
172
|
+
* the `removeLocalHook` method of the row and column index mapper.
|
173
|
+
*/
|
174
|
+
_classPrivateFieldInitSpec(this, _updateFocusHighlightPosition, () => {
|
175
|
+
var _this$hot;
|
176
|
+
const selection = (_this$hot = this.hot) === null || _this$hot === void 0 ? void 0 : _this$hot.getSelectedRangeActive();
|
177
|
+
if (!selection) {
|
178
|
+
return;
|
179
|
+
}
|
180
|
+
const {
|
181
|
+
highlight
|
182
|
+
} = selection;
|
183
|
+
const isNestedHeadersRange = highlight.isHeader() && highlight.col >= 0;
|
184
|
+
if (isNestedHeadersRange) {
|
185
|
+
const columnIndex = _classPrivateFieldGet(_stateManager, this).findLeftMostColumnIndex(highlight.row, highlight.col);
|
186
|
+
const focusHighlight = this.hot.selection.highlight.getFocus();
|
187
|
+
|
188
|
+
// Correct the highlight/focus selection to highlight the correct TH element
|
189
|
+
focusHighlight.visualCellRange.highlight.col = columnIndex;
|
190
|
+
focusHighlight.visualCellRange.from.col = columnIndex;
|
191
|
+
focusHighlight.visualCellRange.to.col = columnIndex;
|
192
|
+
focusHighlight.commit();
|
193
|
+
}
|
194
|
+
});
|
159
195
|
}
|
160
196
|
static get PLUGIN_KEY() {
|
161
197
|
return PLUGIN_KEY;
|
@@ -230,8 +266,8 @@ export class NestedHeaders extends BasePlugin {
|
|
230
266
|
}
|
231
267
|
return _assertClassBrand(_NestedHeaders_brand, _this, _onModifyTransformStart).call(_this, ...args);
|
232
268
|
});
|
233
|
-
this.addHook('afterSelection', () =>
|
234
|
-
this.addHook('afterSelectionFocusSet', () =>
|
269
|
+
this.addHook('afterSelection', () => _classPrivateFieldGet(_updateFocusHighlightPosition, this).call(this));
|
270
|
+
this.addHook('afterSelectionFocusSet', () => _classPrivateFieldGet(_updateFocusHighlightPosition, this).call(this));
|
235
271
|
this.addHook('beforeViewportScrollHorizontally', function () {
|
236
272
|
for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
|
237
273
|
args[_key8] = arguments[_key8];
|
@@ -281,8 +317,8 @@ export class NestedHeaders extends BasePlugin {
|
|
281
317
|
}
|
282
318
|
return _assertClassBrand(_NestedHeaders_brand, _this, _onModifyFocusedElement).call(_this, ...args);
|
283
319
|
});
|
284
|
-
this.hot.columnIndexMapper.addLocalHook('cacheUpdated', (
|
285
|
-
this.hot.rowIndexMapper.addLocalHook('cacheUpdated', (
|
320
|
+
this.hot.columnIndexMapper.addLocalHook('cacheUpdated', _classPrivateFieldGet(_updateFocusHighlightPosition, this));
|
321
|
+
this.hot.rowIndexMapper.addLocalHook('cacheUpdated', _classPrivateFieldGet(_updateFocusHighlightPosition, this));
|
286
322
|
super.enablePlugin();
|
287
323
|
this.updatePlugin(); // @TODO: Workaround for broken plugin initialization abstraction.
|
288
324
|
}
|
@@ -342,6 +378,8 @@ export class NestedHeaders extends BasePlugin {
|
|
342
378
|
* Disables the plugin functionality for this Handsontable instance.
|
343
379
|
*/
|
344
380
|
disablePlugin() {
|
381
|
+
this.hot.rowIndexMapper.removeLocalHook('cacheUpdated', _classPrivateFieldGet(_updateFocusHighlightPosition, this));
|
382
|
+
this.hot.columnIndexMapper.removeLocalHook('cacheUpdated', _classPrivateFieldGet(_updateFocusHighlightPosition, this));
|
345
383
|
this.clearColspans();
|
346
384
|
_classPrivateFieldGet(_stateManager, this).clear();
|
347
385
|
_classPrivateFieldGet(_hidingIndexMapObserver, this).unsubscribe();
|
@@ -538,41 +576,9 @@ export class NestedHeaders extends BasePlugin {
|
|
538
576
|
return _classPrivateFieldGet(_stateManager, this).getHeaderTreeNodeData(coords.row, coords.col);
|
539
577
|
}
|
540
578
|
}
|
541
|
-
function _updateFocusHighlightPosition() {
|
542
|
-
var _this$hot;
|
543
|
-
const selection = (_this$hot = this.hot) === null || _this$hot === void 0 ? void 0 : _this$hot.getSelectedRangeLast();
|
544
|
-
if (!selection) {
|
545
|
-
return;
|
546
|
-
}
|
547
|
-
const {
|
548
|
-
highlight
|
549
|
-
} = selection;
|
550
|
-
const isNestedHeadersRange = highlight.isHeader() && highlight.col >= 0;
|
551
|
-
if (isNestedHeadersRange) {
|
552
|
-
const columnIndex = _classPrivateFieldGet(_stateManager, this).findLeftMostColumnIndex(highlight.row, highlight.col);
|
553
|
-
const focusHighlight = this.hot.selection.highlight.getFocus();
|
554
|
-
|
555
|
-
// Correct the highlight/focus selection to highlight the correct TH element
|
556
|
-
focusHighlight.visualCellRange.highlight.col = columnIndex;
|
557
|
-
focusHighlight.visualCellRange.from.col = columnIndex;
|
558
|
-
focusHighlight.visualCellRange.to.col = columnIndex;
|
559
|
-
focusHighlight.commit();
|
560
|
-
}
|
561
|
-
}
|
562
|
-
/**
|
563
|
-
* Allows to control to which column index the viewport will be scrolled. To ensure that the viewport
|
564
|
-
* is scrolled to the correct column for the nested header the most left and the most right visual column
|
565
|
-
* indexes are used.
|
566
|
-
*
|
567
|
-
* @param {number} visualColumn A visual column index to which the viewport will be scrolled.
|
568
|
-
* @param {{ value: 'auto' | 'start' | 'end' }} snapping If `'start'`, viewport is scrolled to show
|
569
|
-
* the cell on the left of the table. If `'end'`, viewport is scrolled to show the cell on the right of
|
570
|
-
* the table. When `'auto'`, the viewport is scrolled only when the column is outside of the viewport.
|
571
|
-
* @returns {number}
|
572
|
-
*/
|
573
579
|
function _onBeforeViewportScrollHorizontally(visualColumn, snapping) {
|
574
580
|
var _classPrivateFieldGet4;
|
575
|
-
const selection = this.hot.
|
581
|
+
const selection = this.hot.getSelectedRangeActive();
|
576
582
|
if (!selection) {
|
577
583
|
return visualColumn;
|
578
584
|
}
|
@@ -788,7 +794,7 @@ function _onBeforeOnCellMouseOver(event, coords, TD, controller) {
|
|
788
794
|
columnIndex,
|
789
795
|
origColspan
|
790
796
|
} = headerNodeData;
|
791
|
-
const selectedRange = this.hot.
|
797
|
+
const selectedRange = this.hot.getSelectedRangeActive();
|
792
798
|
const topStartCoords = selectedRange.getTopStartCorner();
|
793
799
|
const bottomEndCoords = selectedRange.getBottomEndCorner();
|
794
800
|
const {
|
@@ -849,7 +855,7 @@ function _onBeforeSelectionHighlightSet() {
|
|
849
855
|
function _onModifyTransformStart(delta) {
|
850
856
|
const {
|
851
857
|
highlight
|
852
|
-
} = this.hot.
|
858
|
+
} = this.hot.getSelectedRangeActive();
|
853
859
|
const nextCoords = this.hot._createCellCoords(highlight.row + delta.row, highlight.col + delta.col);
|
854
860
|
const isNestedHeadersRange = nextCoords.isHeader() && nextCoords.col >= 0;
|
855
861
|
if (!isNestedHeadersRange) {
|
@@ -278,7 +278,7 @@ class NestedRows extends _base.BasePlugin {
|
|
278
278
|
callback: () => {
|
279
279
|
const {
|
280
280
|
highlight
|
281
|
-
} = this.hot.
|
281
|
+
} = this.hot.getSelectedRangeActive();
|
282
282
|
const row = this.collapsingUI.translateTrimmedRow(highlight.row);
|
283
283
|
if (this.collapsingUI.areChildrenCollapsed(row)) {
|
284
284
|
this.collapsingUI.expandChildren(row);
|
@@ -291,8 +291,8 @@ class NestedRows extends _base.BasePlugin {
|
|
291
291
|
},
|
292
292
|
runOnlyIf: () => {
|
293
293
|
var _this$hot$getSelected, _this$hot$getSelected2;
|
294
|
-
const highlight = (_this$hot$getSelected = this.hot.
|
295
|
-
return highlight && ((_this$hot$getSelected2 = this.hot.
|
294
|
+
const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
|
295
|
+
return highlight && ((_this$hot$getSelected2 = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingle()) && this.hot.selection.isCellVisible(highlight) && highlight.col === -1 && highlight.row >= 0;
|
296
296
|
},
|
297
297
|
group: SHORTCUTS_GROUP,
|
298
298
|
relativeToGroup: _shortcutContexts.EDITOR_EDIT_GROUP,
|
@@ -274,7 +274,7 @@ export class NestedRows extends BasePlugin {
|
|
274
274
|
callback: () => {
|
275
275
|
const {
|
276
276
|
highlight
|
277
|
-
} = this.hot.
|
277
|
+
} = this.hot.getSelectedRangeActive();
|
278
278
|
const row = this.collapsingUI.translateTrimmedRow(highlight.row);
|
279
279
|
if (this.collapsingUI.areChildrenCollapsed(row)) {
|
280
280
|
this.collapsingUI.expandChildren(row);
|
@@ -287,8 +287,8 @@ export class NestedRows extends BasePlugin {
|
|
287
287
|
},
|
288
288
|
runOnlyIf: () => {
|
289
289
|
var _this$hot$getSelected, _this$hot$getSelected2;
|
290
|
-
const highlight = (_this$hot$getSelected = this.hot.
|
291
|
-
return highlight && ((_this$hot$getSelected2 = this.hot.
|
290
|
+
const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
|
291
|
+
return highlight && ((_this$hot$getSelected2 = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingle()) && this.hot.selection.isCellVisible(highlight) && highlight.col === -1 && highlight.row >= 0;
|
292
292
|
},
|
293
293
|
group: SHORTCUTS_GROUP,
|
294
294
|
relativeToGroup: SHORTCUTS_GROUP_EDITOR,
|
@@ -460,10 +460,9 @@ class CollapsingUI extends _base.default {
|
|
460
460
|
* @private
|
461
461
|
*/
|
462
462
|
renderAndAdjust() {
|
463
|
-
this.hot.render();
|
464
|
-
|
465
463
|
// Dirty workaround to prevent scroll height not adjusting to the table height. Needs refactoring in the future.
|
466
464
|
this.hot.view.adjustElementsSize();
|
465
|
+
this.hot.render();
|
467
466
|
}
|
468
467
|
}
|
469
468
|
var _default = exports.default = CollapsingUI;
|
@@ -456,10 +456,9 @@ class CollapsingUI extends BaseUI {
|
|
456
456
|
* @private
|
457
457
|
*/
|
458
458
|
renderAndAdjust() {
|
459
|
-
this.hot.render();
|
460
|
-
|
461
459
|
// Dirty workaround to prevent scroll height not adjusting to the table height. Needs refactoring in the future.
|
462
460
|
this.hot.view.adjustElementsSize();
|
461
|
+
this.hot.render();
|
463
462
|
}
|
464
463
|
}
|
465
464
|
export default CollapsingUI;
|
@@ -58,12 +58,12 @@ class ContextMenuUI extends _base.default {
|
|
58
58
|
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD);
|
59
59
|
},
|
60
60
|
callback: () => {
|
61
|
-
const translatedRowIndex = this.dataManager.translateTrimmedRow(this.hot.
|
61
|
+
const translatedRowIndex = this.dataManager.translateTrimmedRow(this.hot.getSelectedActive()[0]);
|
62
62
|
const parent = this.dataManager.getDataObject(translatedRowIndex);
|
63
63
|
this.dataManager.addChild(parent);
|
64
64
|
},
|
65
65
|
disabled: () => {
|
66
|
-
const selected = this.hot.
|
66
|
+
const selected = this.hot.getSelectedActive();
|
67
67
|
return !selected || selected[0] < 0 || this.hot.selection.isSelectedByColumnHeader() || this.hot.countRows() >= this.hot.getSettings().maxRows;
|
68
68
|
}
|
69
69
|
}, {
|
@@ -72,10 +72,10 @@ class ContextMenuUI extends _base.default {
|
|
72
72
|
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD);
|
73
73
|
},
|
74
74
|
callback: () => {
|
75
|
-
this.dataManager.detachFromParent(this.hot.
|
75
|
+
this.dataManager.detachFromParent(this.hot.getSelectedActive());
|
76
76
|
},
|
77
77
|
disabled: () => {
|
78
|
-
const selected = this.hot.
|
78
|
+
const selected = this.hot.getSelectedActive();
|
79
79
|
const translatedRowIndex = this.dataManager.translateTrimmedRow(selected[0]);
|
80
80
|
const parent = this.dataManager.getRowParent(translatedRowIndex);
|
81
81
|
return !parent || !selected || selected[0] < 0 || this.hot.selection.isSelectedByColumnHeader() || this.hot.countRows() >= this.hot.getSettings().maxRows;
|
@@ -53,12 +53,12 @@ class ContextMenuUI extends BaseUI {
|
|
53
53
|
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD);
|
54
54
|
},
|
55
55
|
callback: () => {
|
56
|
-
const translatedRowIndex = this.dataManager.translateTrimmedRow(this.hot.
|
56
|
+
const translatedRowIndex = this.dataManager.translateTrimmedRow(this.hot.getSelectedActive()[0]);
|
57
57
|
const parent = this.dataManager.getDataObject(translatedRowIndex);
|
58
58
|
this.dataManager.addChild(parent);
|
59
59
|
},
|
60
60
|
disabled: () => {
|
61
|
-
const selected = this.hot.
|
61
|
+
const selected = this.hot.getSelectedActive();
|
62
62
|
return !selected || selected[0] < 0 || this.hot.selection.isSelectedByColumnHeader() || this.hot.countRows() >= this.hot.getSettings().maxRows;
|
63
63
|
}
|
64
64
|
}, {
|
@@ -67,10 +67,10 @@ class ContextMenuUI extends BaseUI {
|
|
67
67
|
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD);
|
68
68
|
},
|
69
69
|
callback: () => {
|
70
|
-
this.dataManager.detachFromParent(this.hot.
|
70
|
+
this.dataManager.detachFromParent(this.hot.getSelectedActive());
|
71
71
|
},
|
72
72
|
disabled: () => {
|
73
|
-
const selected = this.hot.
|
73
|
+
const selected = this.hot.getSelectedActive();
|
74
74
|
const translatedRowIndex = this.dataManager.translateTrimmedRow(selected[0]);
|
75
75
|
const parent = this.dataManager.getRowParent(translatedRowIndex);
|
76
76
|
return !parent || !selected || selected[0] < 0 || this.hot.selection.isSelectedByColumnHeader() || this.hot.countRows() >= this.hot.getSettings().maxRows;
|
@@ -68,8 +68,11 @@ class HeadersUI extends _base.default {
|
|
68
68
|
*/
|
69
69
|
appendLevelIndicators(row, TH) {
|
70
70
|
const rowIndex = this.hot.toPhysicalRow(row);
|
71
|
-
const rowLevel = this.dataManager.getRowLevel(rowIndex);
|
72
71
|
const rowObject = this.dataManager.getDataObject(rowIndex);
|
72
|
+
if (!rowObject) {
|
73
|
+
return;
|
74
|
+
}
|
75
|
+
const rowLevel = this.dataManager.getRowLevel(rowIndex);
|
73
76
|
const innerDiv = TH.getElementsByTagName('DIV')[0];
|
74
77
|
const innerSpan = innerDiv.querySelector('span.rowHeader');
|
75
78
|
const previousIndicators = innerDiv.querySelectorAll('[class^="ht_nesting"]');
|
@@ -64,8 +64,11 @@ class HeadersUI extends BaseUI {
|
|
64
64
|
*/
|
65
65
|
appendLevelIndicators(row, TH) {
|
66
66
|
const rowIndex = this.hot.toPhysicalRow(row);
|
67
|
-
const rowLevel = this.dataManager.getRowLevel(rowIndex);
|
68
67
|
const rowObject = this.dataManager.getDataObject(rowIndex);
|
68
|
+
if (!rowObject) {
|
69
|
+
return;
|
70
|
+
}
|
71
|
+
const rowLevel = this.dataManager.getRowLevel(rowIndex);
|
69
72
|
const innerDiv = TH.getElementsByTagName('DIV')[0];
|
70
73
|
const innerSpan = innerDiv.querySelector('span.rowHeader');
|
71
74
|
const previousIndicators = innerDiv.querySelectorAll('[class^="ht_nesting"]');
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
exports.createPaginationFocusController = createPaginationFocusController;
|
5
|
+
var _paginator = require("../../utils/paginator");
|
6
|
+
/**
|
7
|
+
* Creates a pagination focus controller instance.
|
8
|
+
*
|
9
|
+
* @private
|
10
|
+
* @param {object} options The options for the pagination focus controller.
|
11
|
+
* @param {HTMLElement[]} options.focusableElements The focusable elements.
|
12
|
+
* @returns {PaginationController} The pagination controller instance.
|
13
|
+
*/
|
14
|
+
function createPaginationFocusController(_ref) {
|
15
|
+
let {
|
16
|
+
focusableElements
|
17
|
+
} = _ref;
|
18
|
+
const navigator = (0, _paginator.createPaginator)({
|
19
|
+
initialPage: 0,
|
20
|
+
size: () => focusableElements().length,
|
21
|
+
onItemSelect: currentIndex => {
|
22
|
+
const elements = focusableElements();
|
23
|
+
elements[currentIndex].focus();
|
24
|
+
}
|
25
|
+
});
|
26
|
+
return navigator;
|
27
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { createPaginator } from "../../utils/paginator.mjs";
|
2
|
+
/**
|
3
|
+
* Creates a pagination focus controller instance.
|
4
|
+
*
|
5
|
+
* @private
|
6
|
+
* @param {object} options The options for the pagination focus controller.
|
7
|
+
* @param {HTMLElement[]} options.focusableElements The focusable elements.
|
8
|
+
* @returns {PaginationController} The pagination controller instance.
|
9
|
+
*/
|
10
|
+
export function createPaginationFocusController(_ref) {
|
11
|
+
let {
|
12
|
+
focusableElements
|
13
|
+
} = _ref;
|
14
|
+
const navigator = createPaginator({
|
15
|
+
initialPage: 0,
|
16
|
+
size: () => focusableElements().length,
|
17
|
+
onItemSelect: currentIndex => {
|
18
|
+
const elements = focusableElements();
|
19
|
+
elements[currentIndex].focus();
|
20
|
+
}
|
21
|
+
});
|
22
|
+
return navigator;
|
23
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './pagination';
|
@@ -0,0 +1 @@
|
|
1
|
+
export { PLUGIN_KEY, PLUGIN_PRIORITY, Pagination } from "./pagination.mjs";
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import Core from '../../core';
|
2
|
+
import { BasePlugin } from '../base';
|
3
|
+
|
4
|
+
type PageSizeOption = number | 'auto';
|
5
|
+
|
6
|
+
export interface DetailedSettings {
|
7
|
+
pageSize?: PageSizeOption;
|
8
|
+
pageSizeList?: Array<PageSizeOption>;
|
9
|
+
initialPage?: number;
|
10
|
+
showPageSize?: boolean;
|
11
|
+
showCounter?: boolean;
|
12
|
+
showNavigation?: boolean;
|
13
|
+
uiContainer?: HTMLElement;
|
14
|
+
}
|
15
|
+
|
16
|
+
export type Settings = boolean | DetailedSettings;
|
17
|
+
|
18
|
+
type PaginationData = {
|
19
|
+
currentPage: number;
|
20
|
+
totalPages: number;
|
21
|
+
pageSize: number;
|
22
|
+
pageSizeList: Array<PageSizeOption>;
|
23
|
+
autoPageSize: boolean;
|
24
|
+
numberOfRenderedRows: number;
|
25
|
+
firstVisibleRowIndex: number;
|
26
|
+
lastVisibleRowIndex: number;
|
27
|
+
}
|
28
|
+
|
29
|
+
export class Pagination extends BasePlugin {
|
30
|
+
constructor(hotInstance: Core);
|
31
|
+
isEnabled(): boolean;
|
32
|
+
|
33
|
+
getPaginationData(): PaginationData;
|
34
|
+
setPage(pageNumber: number): void;
|
35
|
+
resetPage(): void;
|
36
|
+
setPageSize(pageSize: PageSizeOption): void;
|
37
|
+
resetPageSize(): void;
|
38
|
+
resetPagination(): void;
|
39
|
+
nextPage(): void;
|
40
|
+
prevPage(): void;
|
41
|
+
firstPage(): void;
|
42
|
+
lastPage(): void;
|
43
|
+
hasPreviousPage(): boolean;
|
44
|
+
hasNextPage(): boolean;
|
45
|
+
getCurrentPageData(): any[];
|
46
|
+
showPageSizeSection(): void;
|
47
|
+
hidePageSizeSection(): void;
|
48
|
+
showPageCounterSection(): void;
|
49
|
+
hidePageCounterSection(): void;
|
50
|
+
showPageNavigationSection(): void;
|
51
|
+
hidePageNavigationSection(): void;
|
52
|
+
}
|