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
@@ -0,0 +1,449 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
5
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
6
|
+
require("core-js/modules/esnext.iterator.for-each.js");
|
7
|
+
var _templateLiteralTag = require("../../helpers/templateLiteralTag");
|
8
|
+
var _object = require("../../helpers/object");
|
9
|
+
var _localHooks = _interopRequireDefault(require("../../mixins/localHooks"));
|
10
|
+
var C = _interopRequireWildcard(require("../../i18n/constants"));
|
11
|
+
var _element = require("../../helpers/dom/element");
|
12
|
+
var _a11y = require("../../helpers/a11y");
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
15
|
+
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
16
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
17
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
18
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
19
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
20
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
21
|
+
const TEMPLATE = `
|
22
|
+
<div data-ref="container" class="ht-pagination handsontable">
|
23
|
+
<div class="ht-pagination__inner">
|
24
|
+
<div data-ref="pageSizeSection" class="ht-page-size-section">
|
25
|
+
<span data-ref="pageSizeLabel" class="ht-page-size-section__label"></span>
|
26
|
+
<div class="ht-page-size-section__select-wrapper">
|
27
|
+
<select data-ref="pageSizeSelect" name="pageSize" data-hot-input></select>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
<div data-ref="pageCounterSection" class="ht-page-counter-section"></div>
|
31
|
+
<nav data-ref="pageNavSection" class="ht-page-navigation-section">
|
32
|
+
<button data-ref="first" class="ht-page-navigation-section__button ht-page-first"></button>
|
33
|
+
<button data-ref="prev" class="ht-page-navigation-section__button ht-page-prev"></button>
|
34
|
+
<span data-ref="pageNavLabel" class="ht-page-navigation-section__label"></span>
|
35
|
+
<button data-ref="next" class="ht-page-navigation-section__button ht-page-next"></button>
|
36
|
+
<button data-ref="last" class="ht-page-navigation-section__button ht-page-last"></button>
|
37
|
+
</nav>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
`;
|
41
|
+
|
42
|
+
/**
|
43
|
+
* PaginationUI is a UI component that renders and manages pagination controls.
|
44
|
+
* It handles user interactions (navigation and page size changes), and exposes methods to
|
45
|
+
* toggle visibility of pagination sections and update the state of the pagination controls.
|
46
|
+
*
|
47
|
+
* @private
|
48
|
+
* @class PaginationUI
|
49
|
+
*/
|
50
|
+
var _rootElement = /*#__PURE__*/new WeakMap();
|
51
|
+
var _uiContainer = /*#__PURE__*/new WeakMap();
|
52
|
+
var _isRtl = /*#__PURE__*/new WeakMap();
|
53
|
+
var _refs = /*#__PURE__*/new WeakMap();
|
54
|
+
var _themeName = /*#__PURE__*/new WeakMap();
|
55
|
+
var _phraseTranslator = /*#__PURE__*/new WeakMap();
|
56
|
+
var _shouldHaveBorder = /*#__PURE__*/new WeakMap();
|
57
|
+
var _a11yAnnouncer = /*#__PURE__*/new WeakMap();
|
58
|
+
var _PaginationUI_brand = /*#__PURE__*/new WeakSet();
|
59
|
+
class PaginationUI {
|
60
|
+
constructor(_ref) {
|
61
|
+
let {
|
62
|
+
rootElement,
|
63
|
+
uiContainer,
|
64
|
+
isRtl,
|
65
|
+
themeName,
|
66
|
+
phraseTranslator,
|
67
|
+
shouldHaveBorder,
|
68
|
+
a11yAnnouncer
|
69
|
+
} = _ref;
|
70
|
+
/**
|
71
|
+
* Updates the visibility of the pagination container based on the visibility of its sections.
|
72
|
+
*/
|
73
|
+
_classPrivateMethodInitSpec(this, _PaginationUI_brand);
|
74
|
+
/**
|
75
|
+
* The root element where the pagination UI will be installed.
|
76
|
+
*
|
77
|
+
* @type {HTMLElement}
|
78
|
+
*/
|
79
|
+
_classPrivateFieldInitSpec(this, _rootElement, void 0);
|
80
|
+
/**
|
81
|
+
* The container element where the pagination UI will be installed.
|
82
|
+
* If not provided, the pagination container will be injected after the root element.
|
83
|
+
*
|
84
|
+
* @type {HTMLElement}
|
85
|
+
*/
|
86
|
+
_classPrivateFieldInitSpec(this, _uiContainer, void 0);
|
87
|
+
/**
|
88
|
+
* Indicates if the UI is in RTL mode.
|
89
|
+
*
|
90
|
+
* @type {boolean}
|
91
|
+
*/
|
92
|
+
_classPrivateFieldInitSpec(this, _isRtl, false);
|
93
|
+
/**
|
94
|
+
* The references to the UI elements.
|
95
|
+
*
|
96
|
+
* @type {object}
|
97
|
+
*/
|
98
|
+
_classPrivateFieldInitSpec(this, _refs, void 0);
|
99
|
+
/**
|
100
|
+
* The name of the current theme.
|
101
|
+
*
|
102
|
+
* @type {string | undefined}
|
103
|
+
*/
|
104
|
+
_classPrivateFieldInitSpec(this, _themeName, void 0);
|
105
|
+
/**
|
106
|
+
* A function to translate phrases used in the UI.
|
107
|
+
*
|
108
|
+
* @type {function(string): string}
|
109
|
+
*/
|
110
|
+
_classPrivateFieldInitSpec(this, _phraseTranslator, void 0);
|
111
|
+
/**
|
112
|
+
* A function that determines whether the pagination should have a border.
|
113
|
+
*
|
114
|
+
* @type {function(): void}
|
115
|
+
*/
|
116
|
+
_classPrivateFieldInitSpec(this, _shouldHaveBorder, void 0);
|
117
|
+
/**
|
118
|
+
* A function allowing to announce accessibility messages.
|
119
|
+
*
|
120
|
+
* @type {function(string): void}
|
121
|
+
*/
|
122
|
+
_classPrivateFieldInitSpec(this, _a11yAnnouncer, void 0);
|
123
|
+
_classPrivateFieldSet(_rootElement, this, rootElement);
|
124
|
+
_classPrivateFieldSet(_uiContainer, this, uiContainer);
|
125
|
+
_classPrivateFieldSet(_isRtl, this, isRtl);
|
126
|
+
_classPrivateFieldSet(_themeName, this, themeName);
|
127
|
+
_classPrivateFieldSet(_phraseTranslator, this, phraseTranslator);
|
128
|
+
_classPrivateFieldSet(_shouldHaveBorder, this, shouldHaveBorder);
|
129
|
+
_classPrivateFieldSet(_a11yAnnouncer, this, a11yAnnouncer);
|
130
|
+
this.install();
|
131
|
+
}
|
132
|
+
|
133
|
+
/**
|
134
|
+
* Creates the pagination UI elements and sets up event listeners.
|
135
|
+
*/
|
136
|
+
install() {
|
137
|
+
var _classPrivateFieldGet2;
|
138
|
+
if ((_classPrivateFieldGet2 = _classPrivateFieldGet(_refs, this)) !== null && _classPrivateFieldGet2 !== void 0 && _classPrivateFieldGet2.container) {
|
139
|
+
return;
|
140
|
+
}
|
141
|
+
const elements = (0, _templateLiteralTag.html)`${TEMPLATE}`;
|
142
|
+
const {
|
143
|
+
container,
|
144
|
+
first,
|
145
|
+
prev,
|
146
|
+
next,
|
147
|
+
last,
|
148
|
+
pageSizeSelect
|
149
|
+
} = elements.refs;
|
150
|
+
_classPrivateFieldSet(_refs, this, elements.refs);
|
151
|
+
container.setAttribute('dir', _classPrivateFieldGet(_isRtl, this) ? 'rtl' : 'ltr');
|
152
|
+
const isDisabled = event => event.currentTarget.disabled;
|
153
|
+
const addClickListener = (eventName, element, callback) => {
|
154
|
+
element.addEventListener(eventName, event => {
|
155
|
+
if (!isDisabled(event)) {
|
156
|
+
callback();
|
157
|
+
}
|
158
|
+
});
|
159
|
+
};
|
160
|
+
addClickListener('click', first, () => this.runLocalHooks('firstPageClick'));
|
161
|
+
addClickListener('focus', first, () => this.runLocalHooks('focus', first));
|
162
|
+
addClickListener('click', prev, () => this.runLocalHooks('prevPageClick'));
|
163
|
+
addClickListener('focus', prev, () => this.runLocalHooks('focus', prev));
|
164
|
+
addClickListener('click', next, () => this.runLocalHooks('nextPageClick'));
|
165
|
+
addClickListener('focus', next, () => this.runLocalHooks('focus', next));
|
166
|
+
addClickListener('click', last, () => this.runLocalHooks('lastPageClick'));
|
167
|
+
addClickListener('focus', last, () => this.runLocalHooks('focus', last));
|
168
|
+
addClickListener('focus', pageSizeSelect, () => this.runLocalHooks('focus', pageSizeSelect));
|
169
|
+
pageSizeSelect.addEventListener('change', () => {
|
170
|
+
const value = pageSizeSelect.value === 'auto' ? 'auto' : Number.parseInt(pageSizeSelect.value, 10);
|
171
|
+
this.runLocalHooks('pageSizeChange', value);
|
172
|
+
});
|
173
|
+
this.setCounterSectionVisibility(false);
|
174
|
+
this.setNavigationSectionVisibility(false);
|
175
|
+
this.setPageSizeSectionVisibility(false);
|
176
|
+
if (_classPrivateFieldGet(_uiContainer, this)) {
|
177
|
+
_classPrivateFieldGet(_uiContainer, this).appendChild(elements.fragment);
|
178
|
+
(0, _element.addClass)(container, [_classPrivateFieldGet(_themeName, this), 'handsontable']);
|
179
|
+
} else {
|
180
|
+
_classPrivateFieldGet(_rootElement, this).after(elements.fragment);
|
181
|
+
}
|
182
|
+
}
|
183
|
+
|
184
|
+
/**
|
185
|
+
* Gets the pagination element.
|
186
|
+
*
|
187
|
+
* @returns {HTMLElement} The pagination element.
|
188
|
+
*/
|
189
|
+
getContainer() {
|
190
|
+
return _classPrivateFieldGet(_refs, this).container;
|
191
|
+
}
|
192
|
+
|
193
|
+
/**
|
194
|
+
* Gets the focusable elements.
|
195
|
+
*
|
196
|
+
* @returns {HTMLElement[]} The focusable elements.
|
197
|
+
*/
|
198
|
+
getFocusableElements() {
|
199
|
+
const {
|
200
|
+
first,
|
201
|
+
prev,
|
202
|
+
next,
|
203
|
+
last,
|
204
|
+
pageSizeSelect
|
205
|
+
} = _classPrivateFieldGet(_refs, this);
|
206
|
+
return [pageSizeSelect, first, prev, next, last].filter(element => !element.disabled);
|
207
|
+
}
|
208
|
+
|
209
|
+
/**
|
210
|
+
* Updates the width of the pagination container.
|
211
|
+
*
|
212
|
+
* @param {number} width The new width of the pagination container.
|
213
|
+
* @returns {PaginationUI} The instance of the PaginationUI for method chaining.
|
214
|
+
*/
|
215
|
+
updateWidth(width) {
|
216
|
+
_classPrivateFieldGet(_refs, this).container.style.width = `${width}px`;
|
217
|
+
return this;
|
218
|
+
}
|
219
|
+
|
220
|
+
/**
|
221
|
+
* Updates the theme of the pagination container.
|
222
|
+
*
|
223
|
+
* @param {string | false | undefined} themeName The name of the theme to use.
|
224
|
+
* @returns {PaginationUI} The instance of the PaginationUI for method chaining.
|
225
|
+
*/
|
226
|
+
updateTheme(themeName) {
|
227
|
+
_classPrivateFieldSet(_themeName, this, themeName);
|
228
|
+
if (_classPrivateFieldGet(_uiContainer, this)) {
|
229
|
+
const {
|
230
|
+
container
|
231
|
+
} = _classPrivateFieldGet(_refs, this);
|
232
|
+
(0, _element.removeClass)(container, /ht-theme-.*/g);
|
233
|
+
if (_classPrivateFieldGet(_themeName, this)) {
|
234
|
+
(0, _element.addClass)(container, _classPrivateFieldGet(_themeName, this));
|
235
|
+
}
|
236
|
+
}
|
237
|
+
return this;
|
238
|
+
}
|
239
|
+
|
240
|
+
/**
|
241
|
+
* Gets the height of the pagination container element.
|
242
|
+
*
|
243
|
+
* @returns {number}
|
244
|
+
*/
|
245
|
+
getHeight() {
|
246
|
+
return _classPrivateFieldGet(_refs, this).container.offsetHeight;
|
247
|
+
}
|
248
|
+
|
249
|
+
/**
|
250
|
+
* Refreshes the border state of the pagination container based on the external condition.
|
251
|
+
*
|
252
|
+
* @returns {PaginationUI} The instance of the PaginationUI for method chaining.
|
253
|
+
*/
|
254
|
+
refreshBorderState() {
|
255
|
+
const {
|
256
|
+
container
|
257
|
+
} = _classPrivateFieldGet(_refs, this);
|
258
|
+
if (_classPrivateFieldGet(_uiContainer, this) || _classPrivateFieldGet(_shouldHaveBorder, this).call(this)) {
|
259
|
+
(0, _element.addClass)(container, 'ht-pagination--bordered');
|
260
|
+
} else {
|
261
|
+
(0, _element.removeClass)(container, 'ht-pagination--bordered');
|
262
|
+
}
|
263
|
+
return this;
|
264
|
+
}
|
265
|
+
|
266
|
+
/**
|
267
|
+
* Updates the state of the pagination UI.
|
268
|
+
*
|
269
|
+
* @param {object} state The pagination state.
|
270
|
+
* @param {number} state.currentPage The current page number.
|
271
|
+
* @param {number} state.totalPages The total number of pages.
|
272
|
+
* @param {number} state.firstVisibleRowIndex The index of the first visible row on the current page.
|
273
|
+
* @param {number} state.lastVisibleRowIndex The index of the last visible row on the current page.
|
274
|
+
* @param {number} state.totalRenderedRows The total number of renderable rows.
|
275
|
+
* @param {Array<number | 'auto'>} state.pageSizeList The list of available page sizes.
|
276
|
+
* @param {number} state.pageSize The current page size.
|
277
|
+
* @param {boolean} state.autoPageSize Indicates if the page size is set to 'auto'.
|
278
|
+
* @returns {PaginationUI} The instance of the PaginationUI for method chaining.
|
279
|
+
*/
|
280
|
+
updateState(_ref2) {
|
281
|
+
let {
|
282
|
+
currentPage,
|
283
|
+
totalPages,
|
284
|
+
firstVisibleRowIndex,
|
285
|
+
lastVisibleRowIndex,
|
286
|
+
totalRenderedRows,
|
287
|
+
pageSizeList,
|
288
|
+
pageSize,
|
289
|
+
autoPageSize
|
290
|
+
} = _ref2;
|
291
|
+
const {
|
292
|
+
first,
|
293
|
+
prev,
|
294
|
+
next,
|
295
|
+
last,
|
296
|
+
pageCounterSection,
|
297
|
+
pageNavSection,
|
298
|
+
pageNavLabel,
|
299
|
+
pageSizeSelect,
|
300
|
+
pageSizeLabel
|
301
|
+
} = _classPrivateFieldGet(_refs, this);
|
302
|
+
const counterSectionText = _classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_COUNTER_SECTION, {
|
303
|
+
start: firstVisibleRowIndex + 1,
|
304
|
+
end: lastVisibleRowIndex + 1,
|
305
|
+
total: totalRenderedRows
|
306
|
+
});
|
307
|
+
const navLabelText = _classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_NAV_SECTION, {
|
308
|
+
currentPage,
|
309
|
+
totalPages
|
310
|
+
});
|
311
|
+
const pageSizeLabelText = _classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_PAGE_SIZE_SECTION);
|
312
|
+
pageCounterSection.textContent = counterSectionText;
|
313
|
+
pageNavLabel.textContent = navLabelText;
|
314
|
+
pageSizeSelect.textContent = '';
|
315
|
+
pageSizeLabel.textContent = `${pageSizeLabelText}:`;
|
316
|
+
(0, _element.setAttribute)(pageNavSection, [...[(0, _a11y.A11Y_LABEL)(_classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_SECTION))]]);
|
317
|
+
(0, _element.setAttribute)(pageSizeSelect, [...[(0, _a11y.A11Y_LABEL)(_classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_PAGE_SIZE_SECTION))], ...[(0, _a11y.A11Y_TABINDEX)(-1)]]);
|
318
|
+
_classPrivateFieldGet(_a11yAnnouncer, this).call(this, navLabelText);
|
319
|
+
this.refreshBorderState();
|
320
|
+
pageSizeList.forEach(pageSizeItem => {
|
321
|
+
const label = pageSizeItem === 'auto' ? _classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_PAGE_SIZE_AUTO) : pageSizeItem;
|
322
|
+
const option = new Option(label, pageSizeItem);
|
323
|
+
if (autoPageSize && pageSizeItem === 'auto' || !autoPageSize && pageSizeItem === pageSize) {
|
324
|
+
option.selected = true;
|
325
|
+
}
|
326
|
+
pageSizeSelect.add(option);
|
327
|
+
});
|
328
|
+
const isFirstPage = currentPage === 1;
|
329
|
+
const isLastPage = currentPage === totalPages;
|
330
|
+
if (pageNavSection.style.display !== 'none') {
|
331
|
+
const activeElement = _classPrivateFieldGet(_rootElement, this).ownerDocument.activeElement;
|
332
|
+
if (isFirstPage) {
|
333
|
+
(0, _element.addClass)(first, 'ht-page-navigation-section__button--disabled');
|
334
|
+
(0, _element.addClass)(prev, 'ht-page-navigation-section__button--disabled');
|
335
|
+
first.disabled = true;
|
336
|
+
prev.disabled = true;
|
337
|
+
} else {
|
338
|
+
(0, _element.removeClass)(first, 'ht-page-navigation-section__button--disabled');
|
339
|
+
(0, _element.removeClass)(prev, 'ht-page-navigation-section__button--disabled');
|
340
|
+
first.disabled = false;
|
341
|
+
prev.disabled = false;
|
342
|
+
}
|
343
|
+
if (isLastPage) {
|
344
|
+
(0, _element.addClass)(next, 'ht-page-navigation-section__button--disabled');
|
345
|
+
(0, _element.addClass)(last, 'ht-page-navigation-section__button--disabled');
|
346
|
+
next.disabled = true;
|
347
|
+
last.disabled = true;
|
348
|
+
} else {
|
349
|
+
(0, _element.removeClass)(next, 'ht-page-navigation-section__button--disabled');
|
350
|
+
(0, _element.removeClass)(last, 'ht-page-navigation-section__button--disabled');
|
351
|
+
next.disabled = false;
|
352
|
+
last.disabled = false;
|
353
|
+
}
|
354
|
+
if ([first, prev, next, last].includes(activeElement)) {
|
355
|
+
if (prev.disabled) {
|
356
|
+
next.focus();
|
357
|
+
} else if (next.disabled) {
|
358
|
+
prev.focus();
|
359
|
+
}
|
360
|
+
}
|
361
|
+
}
|
362
|
+
(0, _element.setAttribute)(first, [...[(0, _a11y.A11Y_LABEL)(_classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_FIRST_PAGE))], ...[(0, _a11y.A11Y_DISABLED)(isFirstPage)], ...[(0, _a11y.A11Y_TABINDEX)(-1)]]);
|
363
|
+
(0, _element.setAttribute)(prev, [...[(0, _a11y.A11Y_LABEL)(_classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_PREV_PAGE))], ...[(0, _a11y.A11Y_DISABLED)(isFirstPage)], ...[(0, _a11y.A11Y_TABINDEX)(-1)]]);
|
364
|
+
(0, _element.setAttribute)(next, [...[(0, _a11y.A11Y_LABEL)(_classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_NEXT_PAGE))], ...[(0, _a11y.A11Y_DISABLED)(isLastPage)], ...[(0, _a11y.A11Y_TABINDEX)(-1)]]);
|
365
|
+
(0, _element.setAttribute)(last, [...[(0, _a11y.A11Y_LABEL)(_classPrivateFieldGet(_phraseTranslator, this).call(this, C.PAGINATION_LAST_PAGE))], ...[(0, _a11y.A11Y_DISABLED)(isLastPage)], ...[(0, _a11y.A11Y_TABINDEX)(-1)]]);
|
366
|
+
return this;
|
367
|
+
}
|
368
|
+
|
369
|
+
/**
|
370
|
+
* Sets the visibility of the page size section.
|
371
|
+
*
|
372
|
+
* @param {boolean} isVisible True to show the page size section, false to hide it.
|
373
|
+
* @returns {PaginationUI} The instance of the PaginationUI for method chaining.
|
374
|
+
*/
|
375
|
+
setPageSizeSectionVisibility(isVisible) {
|
376
|
+
const {
|
377
|
+
pageSizeSection,
|
378
|
+
pageSizeSelect
|
379
|
+
} = _classPrivateFieldGet(_refs, this);
|
380
|
+
pageSizeSection.style.display = isVisible ? '' : 'none';
|
381
|
+
pageSizeSelect.disabled = !isVisible;
|
382
|
+
_assertClassBrand(_PaginationUI_brand, this, _updateContainerVisibility).call(this);
|
383
|
+
return this;
|
384
|
+
}
|
385
|
+
|
386
|
+
/**
|
387
|
+
* Sets the visibility of the page counter section.
|
388
|
+
*
|
389
|
+
* @param {boolean} isVisible True to show the page size section, false to hide it.
|
390
|
+
* @returns {PaginationUI} The instance of the PaginationUI for method chaining.
|
391
|
+
*/
|
392
|
+
setCounterSectionVisibility(isVisible) {
|
393
|
+
_classPrivateFieldGet(_refs, this).pageCounterSection.style.display = isVisible ? '' : 'none';
|
394
|
+
_assertClassBrand(_PaginationUI_brand, this, _updateContainerVisibility).call(this);
|
395
|
+
return this;
|
396
|
+
}
|
397
|
+
|
398
|
+
/**
|
399
|
+
* Sets the visibility of the page navigation section.
|
400
|
+
*
|
401
|
+
* @param {boolean} isVisible True to show the page size section, false to hide it.
|
402
|
+
* @returns {PaginationUI} The instance of the PaginationUI for method chaining.
|
403
|
+
*/
|
404
|
+
setNavigationSectionVisibility(isVisible) {
|
405
|
+
const {
|
406
|
+
pageNavSection,
|
407
|
+
first,
|
408
|
+
prev,
|
409
|
+
next,
|
410
|
+
last
|
411
|
+
} = _classPrivateFieldGet(_refs, this);
|
412
|
+
pageNavSection.style.display = isVisible ? '' : 'none';
|
413
|
+
first.disabled = !isVisible;
|
414
|
+
prev.disabled = !isVisible;
|
415
|
+
next.disabled = !isVisible;
|
416
|
+
last.disabled = !isVisible;
|
417
|
+
_assertClassBrand(_PaginationUI_brand, this, _updateContainerVisibility).call(this);
|
418
|
+
return this;
|
419
|
+
}
|
420
|
+
/**
|
421
|
+
* Removes the pagination UI elements from the DOM and clears the refs.
|
422
|
+
*/
|
423
|
+
destroy() {
|
424
|
+
var _classPrivateFieldGet3;
|
425
|
+
(_classPrivateFieldGet3 = _classPrivateFieldGet(_refs, this)) === null || _classPrivateFieldGet3 === void 0 || _classPrivateFieldGet3.container.remove();
|
426
|
+
_classPrivateFieldSet(_refs, this, null);
|
427
|
+
}
|
428
|
+
}
|
429
|
+
exports.PaginationUI = PaginationUI;
|
430
|
+
function _updateContainerVisibility() {
|
431
|
+
const {
|
432
|
+
container,
|
433
|
+
pageSizeSection,
|
434
|
+
pageCounterSection,
|
435
|
+
pageNavSection
|
436
|
+
} = _classPrivateFieldGet(_refs, this);
|
437
|
+
const isSectionVisible = pageSizeSection.style.display !== 'none' || pageCounterSection.style.display !== 'none' || pageNavSection.style.display !== 'none';
|
438
|
+
|
439
|
+
// adds or removes the corner around the Handsontable root element
|
440
|
+
if (!_classPrivateFieldGet(_uiContainer, this)) {
|
441
|
+
if (isSectionVisible) {
|
442
|
+
(0, _element.addClass)(_classPrivateFieldGet(_rootElement, this).querySelector('.ht-wrapper'), 'htPagination');
|
443
|
+
} else {
|
444
|
+
(0, _element.removeClass)(_classPrivateFieldGet(_rootElement, this).querySelector('.ht-wrapper'), 'htPagination');
|
445
|
+
}
|
446
|
+
}
|
447
|
+
container.style.display = isSectionVisible ? '' : 'none';
|
448
|
+
}
|
449
|
+
(0, _object.mixin)(PaginationUI, _localHooks.default);
|