handsontable 16.0.1 → 16.1.0-next-abd8f2e-20250904
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdparty/walkontable/src/overlays.js +12 -2
- package/3rdparty/walkontable/src/overlays.mjs +12 -2
- package/3rdparty/walkontable/src/viewport.js +2 -6
- package/3rdparty/walkontable/src/viewport.mjs +2 -6
- package/CHANGELOG.md +37 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/cellTypes/autocompleteType/accessors/index.js +7 -0
- package/cellTypes/autocompleteType/accessors/index.mjs +2 -0
- package/cellTypes/autocompleteType/accessors/valueGetter.js +14 -0
- package/cellTypes/autocompleteType/accessors/valueGetter.mjs +10 -0
- package/cellTypes/autocompleteType/accessors/valueSetter.js +25 -0
- package/cellTypes/autocompleteType/accessors/valueSetter.mjs +21 -0
- package/cellTypes/autocompleteType/autocompleteType.js +4 -1
- package/cellTypes/autocompleteType/autocompleteType.mjs +4 -1
- package/cellTypes/checkboxType/accessors/index.js +5 -0
- package/cellTypes/checkboxType/accessors/index.mjs +1 -0
- package/cellTypes/checkboxType/accessors/valueSetter.js +26 -0
- package/cellTypes/checkboxType/accessors/valueSetter.mjs +22 -0
- package/cellTypes/checkboxType/checkboxType.js +3 -1
- package/cellTypes/checkboxType/checkboxType.mjs +3 -1
- package/cellTypes/dropdownType/accessors/index.js +7 -0
- package/cellTypes/dropdownType/accessors/index.mjs +2 -0
- package/cellTypes/dropdownType/accessors/valueGetter.js +14 -0
- package/cellTypes/dropdownType/accessors/valueGetter.mjs +10 -0
- package/cellTypes/dropdownType/accessors/valueSetter.js +17 -0
- package/cellTypes/dropdownType/accessors/valueSetter.mjs +13 -0
- package/cellTypes/dropdownType/dropdownType.js +4 -1
- package/cellTypes/dropdownType/dropdownType.mjs +4 -1
- package/cellTypes/numericType/accessors/index.js +5 -0
- package/cellTypes/numericType/accessors/index.mjs +1 -0
- package/cellTypes/numericType/accessors/valueSetter.js +19 -0
- package/cellTypes/numericType/accessors/valueSetter.mjs +15 -0
- package/cellTypes/numericType/numericType.js +3 -1
- package/cellTypes/numericType/numericType.mjs +3 -1
- package/core/focusCatcher/index.js +37 -112
- package/core/focusCatcher/index.mjs +35 -110
- package/core/focusCatcher/utils.js +31 -0
- package/core/focusCatcher/utils.mjs +27 -0
- package/core/hooks/constants.js +242 -0
- package/core/hooks/constants.mjs +242 -0
- package/core/hooks/index.d.ts +22 -0
- package/core/viewportScroll/scrollStrategies/focusScroll.js +5 -1
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +5 -1
- package/core/viewportScroll/utils.js +1 -1
- package/core/viewportScroll/utils.mjs +1 -1
- package/core.d.ts +4 -0
- package/core.js +237 -139
- package/core.mjs +240 -142
- package/dataMap/dataMap.js +13 -3
- package/dataMap/dataMap.mjs +14 -4
- package/dataMap/dataSource.js +16 -0
- package/dataMap/dataSource.mjs +16 -0
- package/dataMap/metaManager/lazyFactoryMap.js +4 -3
- package/dataMap/metaManager/lazyFactoryMap.mjs +2 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +3 -2
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +3 -2
- package/dataMap/metaManager/metaSchema.js +289 -4
- package/dataMap/metaManager/metaSchema.mjs +289 -4
- package/dataMap/metaManager/utils.js +0 -11
- package/dataMap/metaManager/utils.mjs +0 -10
- package/dataMap/replaceData.js +1 -0
- package/dataMap/replaceData.mjs +1 -0
- package/dist/handsontable.css +281 -4
- package/dist/handsontable.full.css +281 -4
- package/dist/handsontable.full.js +7844 -2990
- package/dist/handsontable.full.min.css +4 -5
- package/dist/handsontable.full.min.js +167 -165
- package/dist/handsontable.js +9639 -4806
- package/dist/handsontable.min.css +4 -4
- package/dist/handsontable.min.js +52 -50
- package/dist/languages/all.js +231 -21
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.js +11 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.js +11 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.js +11 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.js +11 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.js +11 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.js +11 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fa-IR.js +11 -1
- package/dist/languages/fa-IR.min.js +1 -1
- package/dist/languages/fr-FR.js +11 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.js +11 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.js +11 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.js +11 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.js +11 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.js +11 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.js +11 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.js +11 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.js +11 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.js +11 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.js +11 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.js +11 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.js +11 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.js +11 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +4 -4
- package/editorManager.mjs +4 -4
- package/editors/autocompleteEditor/autocompleteEditor.js +50 -112
- package/editors/autocompleteEditor/autocompleteEditor.mjs +51 -113
- package/editors/baseEditor/baseEditor.js +10 -6
- package/editors/baseEditor/baseEditor.mjs +10 -6
- package/editors/handsontableEditor/handsontableEditor.js +9 -9
- package/editors/handsontableEditor/handsontableEditor.mjs +9 -9
- package/editors/textEditor/textEditor.js +0 -7
- package/editors/textEditor/textEditor.mjs +0 -7
- package/focusManager.js +2 -2
- package/focusManager.mjs +2 -2
- package/helpers/a11y.js +15 -2
- package/helpers/a11y.mjs +10 -2
- package/helpers/console.js +12 -0
- package/helpers/console.mjs +11 -0
- package/helpers/dom/element.js +4 -4
- package/helpers/dom/element.mjs +4 -4
- package/helpers/mixed.js +65 -2
- package/helpers/mixed.mjs +63 -2
- package/helpers/number.js +28 -0
- package/helpers/number.mjs +26 -0
- package/helpers/object.js +35 -0
- package/helpers/object.mjs +34 -0
- package/helpers/string.js +19 -0
- package/helpers/string.mjs +18 -0
- package/helpers/templateLiteralTag.js +57 -1
- package/helpers/templateLiteralTag.mjs +56 -1
- package/i18n/constants.js +13 -1
- package/i18n/constants.mjs +13 -1
- package/i18n/languages/ar-AR.js +11 -1
- package/i18n/languages/ar-AR.mjs +11 -1
- package/i18n/languages/cs-CZ.js +11 -1
- package/i18n/languages/cs-CZ.mjs +11 -1
- package/i18n/languages/de-CH.js +11 -1
- package/i18n/languages/de-CH.mjs +11 -1
- package/i18n/languages/de-DE.js +11 -1
- package/i18n/languages/de-DE.mjs +11 -1
- package/i18n/languages/en-US.js +11 -1
- package/i18n/languages/en-US.mjs +11 -1
- package/i18n/languages/es-MX.js +11 -1
- package/i18n/languages/es-MX.mjs +11 -1
- package/i18n/languages/fa-IR.js +11 -1
- package/i18n/languages/fa-IR.mjs +11 -1
- package/i18n/languages/fr-FR.js +11 -1
- package/i18n/languages/fr-FR.mjs +11 -1
- package/i18n/languages/hr-HR.js +11 -1
- package/i18n/languages/hr-HR.mjs +11 -1
- package/i18n/languages/it-IT.js +11 -1
- package/i18n/languages/it-IT.mjs +11 -1
- package/i18n/languages/ja-JP.js +11 -1
- package/i18n/languages/ja-JP.mjs +11 -1
- package/i18n/languages/ko-KR.js +11 -1
- package/i18n/languages/ko-KR.mjs +11 -1
- package/i18n/languages/lv-LV.js +11 -1
- package/i18n/languages/lv-LV.mjs +11 -1
- package/i18n/languages/nb-NO.js +11 -1
- package/i18n/languages/nb-NO.mjs +11 -1
- package/i18n/languages/nl-NL.js +11 -1
- package/i18n/languages/nl-NL.mjs +11 -1
- package/i18n/languages/pl-PL.js +11 -1
- package/i18n/languages/pl-PL.mjs +11 -1
- package/i18n/languages/pt-BR.js +11 -1
- package/i18n/languages/pt-BR.mjs +11 -1
- package/i18n/languages/ru-RU.js +11 -1
- package/i18n/languages/ru-RU.mjs +11 -1
- package/i18n/languages/sr-SP.js +11 -1
- package/i18n/languages/sr-SP.mjs +11 -1
- package/i18n/languages/zh-CN.js +11 -1
- package/i18n/languages/zh-CN.mjs +11 -1
- package/i18n/languages/zh-TW.js +11 -1
- package/i18n/languages/zh-TW.mjs +11 -1
- package/i18n/phraseFormatters/index.js +3 -1
- package/i18n/phraseFormatters/index.mjs +3 -1
- package/i18n/registry.js +5 -6
- package/i18n/registry.mjs +5 -6
- package/index.d.ts +27 -0
- package/languages/all.js +231 -21
- package/languages/ar-AR.js +11 -1
- package/languages/ar-AR.mjs +11 -1
- package/languages/cs-CZ.js +11 -1
- package/languages/cs-CZ.mjs +11 -1
- package/languages/de-CH.js +11 -1
- package/languages/de-CH.mjs +11 -1
- package/languages/de-DE.js +11 -1
- package/languages/de-DE.mjs +11 -1
- package/languages/en-US.js +11 -1
- package/languages/en-US.mjs +11 -1
- package/languages/es-MX.js +11 -1
- package/languages/es-MX.mjs +11 -1
- package/languages/fa-IR.js +11 -1
- package/languages/fa-IR.mjs +11 -1
- package/languages/fr-FR.js +11 -1
- package/languages/fr-FR.mjs +11 -1
- package/languages/hr-HR.js +11 -1
- package/languages/hr-HR.mjs +11 -1
- package/languages/index.js +231 -21
- package/languages/it-IT.js +11 -1
- package/languages/it-IT.mjs +11 -1
- package/languages/ja-JP.js +11 -1
- package/languages/ja-JP.mjs +11 -1
- package/languages/ko-KR.js +11 -1
- package/languages/ko-KR.mjs +11 -1
- package/languages/lv-LV.js +11 -1
- package/languages/lv-LV.mjs +11 -1
- package/languages/nb-NO.js +11 -1
- package/languages/nb-NO.mjs +11 -1
- package/languages/nl-NL.js +11 -1
- package/languages/nl-NL.mjs +11 -1
- package/languages/pl-PL.js +11 -1
- package/languages/pl-PL.mjs +11 -1
- package/languages/pt-BR.js +11 -1
- package/languages/pt-BR.mjs +11 -1
- package/languages/ru-RU.js +11 -1
- package/languages/ru-RU.mjs +11 -1
- package/languages/sr-SP.js +11 -1
- package/languages/sr-SP.mjs +11 -1
- package/languages/zh-CN.js +11 -1
- package/languages/zh-CN.mjs +11 -1
- package/languages/zh-TW.js +11 -1
- package/languages/zh-TW.mjs +11 -1
- package/mixins/localHooks.js +16 -0
- package/mixins/localHooks.mjs +16 -0
- package/package.json +19 -1
- package/plugins/autoRowSize/autoRowSize.js +43 -6
- package/plugins/autoRowSize/autoRowSize.mjs +43 -6
- package/plugins/autofill/autofill.js +50 -3
- package/plugins/autofill/autofill.mjs +50 -3
- package/plugins/base/base.js +86 -15
- package/plugins/base/base.mjs +87 -16
- package/plugins/collapsibleColumns/collapsibleColumns.js +4 -4
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +4 -4
- package/plugins/columnSorting/columnSorting.js +3 -3
- package/plugins/columnSorting/columnSorting.mjs +3 -3
- package/plugins/comments/comments.js +52 -22
- package/plugins/comments/comments.mjs +52 -22
- package/plugins/comments/contextMenuItem/addEditComment.js +3 -3
- package/plugins/comments/contextMenuItem/addEditComment.mjs +3 -3
- package/plugins/comments/contextMenuItem/readOnlyComment.js +2 -2
- package/plugins/comments/contextMenuItem/readOnlyComment.mjs +2 -2
- package/plugins/comments/contextMenuItem/removeComment.js +2 -2
- package/plugins/comments/contextMenuItem/removeComment.mjs +2 -2
- package/plugins/contextMenu/contextMenu.js +4 -5
- package/plugins/contextMenu/contextMenu.mjs +4 -5
- package/plugins/contextMenu/menu/cursor.js +1 -1
- package/plugins/contextMenu/menu/cursor.mjs +1 -1
- package/plugins/contextMenu/menu/defaultShortcutsList.js +5 -5
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +5 -5
- package/plugins/contextMenu/menu/menu.js +3 -3
- package/plugins/contextMenu/menu/menu.mjs +3 -3
- package/plugins/contextMenu/menu/positioner.js +1 -1
- package/plugins/contextMenu/menu/positioner.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/alignment.js +1 -1
- package/plugins/contextMenu/predefinedItems/alignment.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/clearColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/clearColumn.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/columnLeft.js +3 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/columnRight.js +3 -3
- package/plugins/contextMenu/predefinedItems/columnRight.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/readOnly.js +1 -1
- package/plugins/contextMenu/predefinedItems/readOnly.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/rowAbove.js +3 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.js +3 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/copy.js +1 -1
- package/plugins/copyPaste/contextMenuItem/copy.mjs +1 -1
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +3 -3
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/cut.js +1 -1
- package/plugins/copyPaste/contextMenuItem/cut.mjs +1 -1
- package/plugins/copyPaste/copyPaste.js +75 -40
- package/plugins/copyPaste/copyPaste.mjs +76 -41
- package/plugins/customBorders/customBorders.js +1 -1
- package/plugins/customBorders/customBorders.mjs +1 -1
- package/plugins/dialog/dialog.d.ts +23 -0
- package/plugins/dialog/dialog.js +489 -0
- package/plugins/dialog/dialog.mjs +485 -0
- package/plugins/dialog/index.d.ts +1 -0
- package/plugins/dialog/index.js +7 -0
- package/plugins/dialog/index.mjs +1 -0
- package/plugins/dialog/ui.js +264 -0
- package/plugins/dialog/ui.mjs +259 -0
- package/plugins/dropdownMenu/dropdownMenu.js +5 -4
- package/plugins/dropdownMenu/dropdownMenu.mjs +5 -4
- package/plugins/filters/filters.js +2 -2
- package/plugins/filters/filters.mjs +2 -2
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +3 -3
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs +3 -3
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +4 -4
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +4 -4
- package/plugins/hiddenRows/contextMenuItem/hideRow.js +3 -3
- package/plugins/hiddenRows/contextMenuItem/hideRow.mjs +3 -3
- package/plugins/hiddenRows/contextMenuItem/showRow.js +4 -4
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +4 -4
- package/plugins/index.d.ts +9 -0
- package/plugins/index.js +9 -0
- package/plugins/index.mjs +7 -1
- package/plugins/loading/content.js +36 -0
- package/plugins/loading/content.mjs +31 -0
- package/plugins/loading/index.d.ts +1 -0
- package/plugins/loading/index.js +7 -0
- package/plugins/loading/index.mjs +1 -0
- package/plugins/loading/loading.d.ts +19 -0
- package/plugins/loading/loading.js +292 -0
- package/plugins/loading/loading.mjs +287 -0
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
- package/plugins/manualColumnMove/manualColumnMove.js +3 -3
- package/plugins/manualColumnMove/manualColumnMove.mjs +3 -3
- package/plugins/manualColumnResize/manualColumnResize.js +3 -3
- package/plugins/manualColumnResize/manualColumnResize.mjs +3 -3
- package/plugins/manualRowMove/manualRowMove.js +4 -4
- package/plugins/manualRowMove/manualRowMove.mjs +4 -4
- package/plugins/manualRowResize/manualRowResize.js +5 -2
- package/plugins/manualRowResize/manualRowResize.mjs +5 -2
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +15 -15
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +15 -15
- package/plugins/mergeCells/focusOrder.js +75 -39
- package/plugins/mergeCells/focusOrder.mjs +75 -39
- package/plugins/mergeCells/mergeCells.js +26 -19
- package/plugins/mergeCells/mergeCells.mjs +26 -19
- package/plugins/mergeCells/renderer.js +14 -8
- package/plugins/mergeCells/renderer.mjs +14 -8
- package/plugins/multiColumnSorting/multiColumnSorting.js +3 -3
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +3 -3
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +3 -3
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +3 -3
- package/plugins/nestedHeaders/nestedHeaders.js +47 -41
- package/plugins/nestedHeaders/nestedHeaders.mjs +47 -41
- package/plugins/nestedRows/nestedRows.js +3 -3
- package/plugins/nestedRows/nestedRows.mjs +3 -3
- package/plugins/nestedRows/ui/collapsing.js +1 -2
- package/plugins/nestedRows/ui/collapsing.mjs +1 -2
- package/plugins/nestedRows/ui/contextMenu.js +4 -4
- package/plugins/nestedRows/ui/contextMenu.mjs +4 -4
- package/plugins/nestedRows/ui/headers.js +4 -1
- package/plugins/nestedRows/ui/headers.mjs +4 -1
- package/plugins/pagination/focusController.js +27 -0
- package/plugins/pagination/focusController.mjs +23 -0
- package/plugins/pagination/index.d.ts +1 -0
- package/plugins/pagination/index.js +7 -0
- package/plugins/pagination/index.mjs +1 -0
- package/plugins/pagination/pagination.d.ts +52 -0
- package/plugins/pagination/pagination.js +1034 -0
- package/plugins/pagination/pagination.mjs +1030 -0
- package/plugins/pagination/strategies/autoPageSize.js +96 -0
- package/plugins/pagination/strategies/autoPageSize.mjs +92 -0
- package/plugins/pagination/strategies/fixedPageSize.js +88 -0
- package/plugins/pagination/strategies/fixedPageSize.mjs +84 -0
- package/plugins/pagination/strategies/index.js +22 -0
- package/plugins/pagination/strategies/index.mjs +18 -0
- package/plugins/pagination/ui.js +449 -0
- package/plugins/pagination/ui.mjs +443 -0
- package/plugins/pagination/utils.js +28 -0
- package/plugins/pagination/utils.mjs +24 -0
- package/plugins/stretchColumns/calculator.js +4 -0
- package/plugins/stretchColumns/calculator.mjs +4 -0
- package/plugins/stretchColumns/stretchColumns.js +1 -1
- package/plugins/stretchColumns/stretchColumns.mjs +1 -1
- package/plugins/undoRedo/actions/dataChange.js +17 -15
- package/plugins/undoRedo/actions/dataChange.mjs +17 -15
- package/renderers/checkboxRenderer/checkboxRenderer.js +3 -3
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +3 -3
- package/selection/range.js +11 -0
- package/selection/range.mjs +11 -0
- package/selection/selection.js +163 -124
- package/selection/selection.mjs +163 -124
- package/selection/transformation/_base.js +448 -0
- package/selection/transformation/_base.mjs +443 -0
- package/selection/transformation/extender.js +55 -0
- package/selection/transformation/extender.mjs +51 -0
- package/selection/transformation/focus.js +77 -0
- package/selection/transformation/focus.mjs +73 -0
- package/selection/transformation/index.js +7 -0
- package/selection/transformation/index.mjs +2 -0
- package/selection/utils.js +2 -1
- package/selection/utils.mjs +2 -1
- package/settings.d.ts +10 -1
- package/shortcutContexts/commands/editor/fastOpen.js +1 -1
- package/shortcutContexts/commands/editor/fastOpen.mjs +1 -1
- package/shortcutContexts/commands/editor/open.js +10 -4
- package/shortcutContexts/commands/editor/open.mjs +10 -4
- package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +2 -2
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +2 -2
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +2 -2
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +5 -2
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +5 -2
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +5 -2
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +5 -2
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +2 -2
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/scrollToFocusedCell.js +1 -1
- package/shortcutContexts/commands/scrollToFocusedCell.mjs +1 -1
- package/shortcutContexts/grid.js +3 -3
- package/shortcutContexts/grid.mjs +3 -3
- package/shortcuts/context.js +4 -1
- package/shortcuts/context.mjs +4 -1
- package/shortcuts/manager.js +17 -3
- package/shortcuts/manager.mjs +17 -3
- package/styles/handsontable.css +288 -22
- package/styles/handsontable.min.css +3 -3
- package/styles/ht-theme-classic.css +828 -0
- package/styles/ht-theme-classic.min.css +30 -0
- package/styles/ht-theme-horizon.css +122 -26
- package/styles/ht-theme-horizon.min.css +3 -3
- package/styles/ht-theme-main.css +124 -28
- package/styles/ht-theme-main.min.css +3 -3
- package/tableView.js +61 -25
- package/tableView.mjs +61 -25
- package/utils/a11yAnnouncer.js +70 -0
- package/utils/a11yAnnouncer.mjs +64 -0
- package/{core/focusCatcher → utils}/focusDetector.js +30 -12
- package/{core/focusCatcher → utils}/focusDetector.mjs +30 -12
- package/utils/samplesGenerator.js +17 -1
- package/utils/samplesGenerator.mjs +17 -1
- package/utils/stylesHandler.js +23 -8
- package/utils/stylesHandler.mjs +23 -8
- package/utils/valueAccessors.js +45 -0
- package/utils/valueAccessors.mjs +40 -0
- package/validators/autocompleteValidator/autocompleteValidator.js +2 -1
- package/validators/autocompleteValidator/autocompleteValidator.mjs +2 -1
- package/selection/transformation.js +0 -335
- package/selection/transformation.mjs +0 -331
@@ -0,0 +1,96 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
5
|
+
require("core-js/modules/es.array.push.js");
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
8
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
9
|
+
/**
|
10
|
+
* @typedef PageInfo
|
11
|
+
* @property {number} startIndex The visual index of the first item in the page.
|
12
|
+
* @property {number} endIndex The visual index of the last item in the page.
|
13
|
+
* @property {number} pageSize The number of items in the page.
|
14
|
+
*/
|
15
|
+
|
16
|
+
/**
|
17
|
+
* The module computes how many items fit on each page so that the combined
|
18
|
+
* height of items never exceeds the available viewport, eliminating vertical scroll.
|
19
|
+
* Unlike for "FixedPageSizeStrategy" plugin, this one calculates the "pageSize" for each
|
20
|
+
* page every time the `calculate` method is called.
|
21
|
+
*
|
22
|
+
* @private
|
23
|
+
* @class AutoPageSizeStrategy
|
24
|
+
*/
|
25
|
+
class AutoPageSizeStrategy {
|
26
|
+
constructor() {
|
27
|
+
/**
|
28
|
+
* @type {PageInfo[]}
|
29
|
+
*/
|
30
|
+
_defineProperty(this, "pages", []);
|
31
|
+
}
|
32
|
+
/**
|
33
|
+
* Calculates the state of pagination.
|
34
|
+
*
|
35
|
+
* @param {object} options Options for pagination calculation.
|
36
|
+
* @param {function(): number[]} options.itemsSizeProvider A function that returns an array of item sizes.
|
37
|
+
* @param {function(): number} options.viewportSizeProvider A function that returns the size of the viewport in pixels.
|
38
|
+
*/
|
39
|
+
calculate(_ref) {
|
40
|
+
let {
|
41
|
+
itemsSizeProvider,
|
42
|
+
viewportSizeProvider
|
43
|
+
} = _ref;
|
44
|
+
const itemSizes = itemsSizeProvider();
|
45
|
+
const viewportSize = viewportSizeProvider();
|
46
|
+
const pages = [];
|
47
|
+
let startIndex = 0;
|
48
|
+
let totalSize = 1; // 1px border compensation for the first row
|
49
|
+
let pageSize = 0;
|
50
|
+
for (let index = 0; index < itemSizes.length; index++) {
|
51
|
+
const itemSize = itemSizes[index];
|
52
|
+
if (pageSize > 0 && totalSize + itemSize >= viewportSize) {
|
53
|
+
pages.push({
|
54
|
+
startIndex,
|
55
|
+
endIndex: index - 1,
|
56
|
+
pageSize
|
57
|
+
});
|
58
|
+
startIndex = index;
|
59
|
+
totalSize = 1; // 1px border compensation for the first row
|
60
|
+
pageSize = 0;
|
61
|
+
}
|
62
|
+
totalSize += itemSize;
|
63
|
+
pageSize += 1;
|
64
|
+
}
|
65
|
+
pages.push({
|
66
|
+
startIndex,
|
67
|
+
endIndex: Math.max(0, itemSizes.length - 1),
|
68
|
+
pageSize
|
69
|
+
});
|
70
|
+
this.pages = pages;
|
71
|
+
}
|
72
|
+
|
73
|
+
/**
|
74
|
+
* Gets the total number of pages.
|
75
|
+
*
|
76
|
+
* @returns {number} The total number of pages.
|
77
|
+
*/
|
78
|
+
getTotalPages() {
|
79
|
+
return this.pages.length;
|
80
|
+
}
|
81
|
+
|
82
|
+
/**
|
83
|
+
* Gets the state of a specific page.
|
84
|
+
*
|
85
|
+
* @param {number} currentPage The current page number (1-based index).
|
86
|
+
* @returns {PageInfo | undefined}
|
87
|
+
*/
|
88
|
+
getState(currentPage) {
|
89
|
+
currentPage -= 1;
|
90
|
+
if (currentPage < 0 || currentPage >= this.getTotalPages()) {
|
91
|
+
return;
|
92
|
+
}
|
93
|
+
return this.pages[currentPage];
|
94
|
+
}
|
95
|
+
}
|
96
|
+
exports.AutoPageSizeStrategy = AutoPageSizeStrategy;
|
@@ -0,0 +1,92 @@
|
|
1
|
+
import "core-js/modules/es.error.cause.js";
|
2
|
+
import "core-js/modules/es.array.push.js";
|
3
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
5
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
6
|
+
/**
|
7
|
+
* @typedef PageInfo
|
8
|
+
* @property {number} startIndex The visual index of the first item in the page.
|
9
|
+
* @property {number} endIndex The visual index of the last item in the page.
|
10
|
+
* @property {number} pageSize The number of items in the page.
|
11
|
+
*/
|
12
|
+
|
13
|
+
/**
|
14
|
+
* The module computes how many items fit on each page so that the combined
|
15
|
+
* height of items never exceeds the available viewport, eliminating vertical scroll.
|
16
|
+
* Unlike for "FixedPageSizeStrategy" plugin, this one calculates the "pageSize" for each
|
17
|
+
* page every time the `calculate` method is called.
|
18
|
+
*
|
19
|
+
* @private
|
20
|
+
* @class AutoPageSizeStrategy
|
21
|
+
*/
|
22
|
+
export class AutoPageSizeStrategy {
|
23
|
+
constructor() {
|
24
|
+
/**
|
25
|
+
* @type {PageInfo[]}
|
26
|
+
*/
|
27
|
+
_defineProperty(this, "pages", []);
|
28
|
+
}
|
29
|
+
/**
|
30
|
+
* Calculates the state of pagination.
|
31
|
+
*
|
32
|
+
* @param {object} options Options for pagination calculation.
|
33
|
+
* @param {function(): number[]} options.itemsSizeProvider A function that returns an array of item sizes.
|
34
|
+
* @param {function(): number} options.viewportSizeProvider A function that returns the size of the viewport in pixels.
|
35
|
+
*/
|
36
|
+
calculate(_ref) {
|
37
|
+
let {
|
38
|
+
itemsSizeProvider,
|
39
|
+
viewportSizeProvider
|
40
|
+
} = _ref;
|
41
|
+
const itemSizes = itemsSizeProvider();
|
42
|
+
const viewportSize = viewportSizeProvider();
|
43
|
+
const pages = [];
|
44
|
+
let startIndex = 0;
|
45
|
+
let totalSize = 1; // 1px border compensation for the first row
|
46
|
+
let pageSize = 0;
|
47
|
+
for (let index = 0; index < itemSizes.length; index++) {
|
48
|
+
const itemSize = itemSizes[index];
|
49
|
+
if (pageSize > 0 && totalSize + itemSize >= viewportSize) {
|
50
|
+
pages.push({
|
51
|
+
startIndex,
|
52
|
+
endIndex: index - 1,
|
53
|
+
pageSize
|
54
|
+
});
|
55
|
+
startIndex = index;
|
56
|
+
totalSize = 1; // 1px border compensation for the first row
|
57
|
+
pageSize = 0;
|
58
|
+
}
|
59
|
+
totalSize += itemSize;
|
60
|
+
pageSize += 1;
|
61
|
+
}
|
62
|
+
pages.push({
|
63
|
+
startIndex,
|
64
|
+
endIndex: Math.max(0, itemSizes.length - 1),
|
65
|
+
pageSize
|
66
|
+
});
|
67
|
+
this.pages = pages;
|
68
|
+
}
|
69
|
+
|
70
|
+
/**
|
71
|
+
* Gets the total number of pages.
|
72
|
+
*
|
73
|
+
* @returns {number} The total number of pages.
|
74
|
+
*/
|
75
|
+
getTotalPages() {
|
76
|
+
return this.pages.length;
|
77
|
+
}
|
78
|
+
|
79
|
+
/**
|
80
|
+
* Gets the state of a specific page.
|
81
|
+
*
|
82
|
+
* @param {number} currentPage The current page number (1-based index).
|
83
|
+
* @returns {PageInfo | undefined}
|
84
|
+
*/
|
85
|
+
getState(currentPage) {
|
86
|
+
currentPage -= 1;
|
87
|
+
if (currentPage < 0 || currentPage >= this.getTotalPages()) {
|
88
|
+
return;
|
89
|
+
}
|
90
|
+
return this.pages[currentPage];
|
91
|
+
}
|
92
|
+
}
|
@@ -0,0 +1,88 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
5
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
7
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
8
|
+
/**
|
9
|
+
* @typedef PageInfo
|
10
|
+
* @property {number} startIndex The visual index of the first item in the page.
|
11
|
+
* @property {number} endIndex The visual index of the last item in the page.
|
12
|
+
* @property {number} pageSize The number of items in the page.
|
13
|
+
*/
|
14
|
+
|
15
|
+
/**
|
16
|
+
* The module computes the state of pagination based on a fixed page size.
|
17
|
+
*
|
18
|
+
* @class FixedPageSizeStrategy
|
19
|
+
* @private
|
20
|
+
*/
|
21
|
+
class FixedPageSizeStrategy {
|
22
|
+
constructor() {
|
23
|
+
/**
|
24
|
+
* The fixed page size.
|
25
|
+
*
|
26
|
+
* @type {number}
|
27
|
+
*/
|
28
|
+
_defineProperty(this, "pageSize", 1);
|
29
|
+
/**
|
30
|
+
* Total number of items in the dataset.
|
31
|
+
*
|
32
|
+
* @type {number}
|
33
|
+
*/
|
34
|
+
_defineProperty(this, "totalItems", 0);
|
35
|
+
/**
|
36
|
+
* Total number of pages.
|
37
|
+
*
|
38
|
+
* @type {number}
|
39
|
+
*/
|
40
|
+
_defineProperty(this, "totalPages", 0);
|
41
|
+
}
|
42
|
+
/**
|
43
|
+
* Calculates the state of pagination.
|
44
|
+
*
|
45
|
+
* @param {object} options Options for pagination calculation.
|
46
|
+
* @param {number} options.pageSize The fixed number of items per page.
|
47
|
+
* @param {number} options.totalItems The total number of items in the dataset.
|
48
|
+
*/
|
49
|
+
calculate(_ref) {
|
50
|
+
let {
|
51
|
+
pageSize,
|
52
|
+
totalItems
|
53
|
+
} = _ref;
|
54
|
+
this.pageSize = Math.max(pageSize, 1);
|
55
|
+
this.totalItems = totalItems;
|
56
|
+
this.totalPages = Math.max(1, Math.ceil(this.totalItems / this.pageSize));
|
57
|
+
}
|
58
|
+
|
59
|
+
/**
|
60
|
+
* Gets the total number of pages.
|
61
|
+
*
|
62
|
+
* @returns {number} The total number of pages.
|
63
|
+
*/
|
64
|
+
getTotalPages() {
|
65
|
+
return this.totalPages;
|
66
|
+
}
|
67
|
+
|
68
|
+
/**
|
69
|
+
* Gets the state of a specific page.
|
70
|
+
*
|
71
|
+
* @param {number} currentPage The current page number (1-based index).
|
72
|
+
* @returns {PageInfo | undefined}
|
73
|
+
*/
|
74
|
+
getState(currentPage) {
|
75
|
+
currentPage -= 1;
|
76
|
+
if (currentPage < 0 || currentPage >= this.getTotalPages()) {
|
77
|
+
return;
|
78
|
+
}
|
79
|
+
const startIndex = currentPage * this.pageSize;
|
80
|
+
const endIndex = Math.max(0, Math.min(startIndex + this.pageSize - 1, this.totalItems - 1));
|
81
|
+
return {
|
82
|
+
startIndex,
|
83
|
+
endIndex,
|
84
|
+
pageSize: this.pageSize
|
85
|
+
};
|
86
|
+
}
|
87
|
+
}
|
88
|
+
exports.FixedPageSizeStrategy = FixedPageSizeStrategy;
|
@@ -0,0 +1,84 @@
|
|
1
|
+
import "core-js/modules/es.error.cause.js";
|
2
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
4
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
5
|
+
/**
|
6
|
+
* @typedef PageInfo
|
7
|
+
* @property {number} startIndex The visual index of the first item in the page.
|
8
|
+
* @property {number} endIndex The visual index of the last item in the page.
|
9
|
+
* @property {number} pageSize The number of items in the page.
|
10
|
+
*/
|
11
|
+
|
12
|
+
/**
|
13
|
+
* The module computes the state of pagination based on a fixed page size.
|
14
|
+
*
|
15
|
+
* @class FixedPageSizeStrategy
|
16
|
+
* @private
|
17
|
+
*/
|
18
|
+
export class FixedPageSizeStrategy {
|
19
|
+
constructor() {
|
20
|
+
/**
|
21
|
+
* The fixed page size.
|
22
|
+
*
|
23
|
+
* @type {number}
|
24
|
+
*/
|
25
|
+
_defineProperty(this, "pageSize", 1);
|
26
|
+
/**
|
27
|
+
* Total number of items in the dataset.
|
28
|
+
*
|
29
|
+
* @type {number}
|
30
|
+
*/
|
31
|
+
_defineProperty(this, "totalItems", 0);
|
32
|
+
/**
|
33
|
+
* Total number of pages.
|
34
|
+
*
|
35
|
+
* @type {number}
|
36
|
+
*/
|
37
|
+
_defineProperty(this, "totalPages", 0);
|
38
|
+
}
|
39
|
+
/**
|
40
|
+
* Calculates the state of pagination.
|
41
|
+
*
|
42
|
+
* @param {object} options Options for pagination calculation.
|
43
|
+
* @param {number} options.pageSize The fixed number of items per page.
|
44
|
+
* @param {number} options.totalItems The total number of items in the dataset.
|
45
|
+
*/
|
46
|
+
calculate(_ref) {
|
47
|
+
let {
|
48
|
+
pageSize,
|
49
|
+
totalItems
|
50
|
+
} = _ref;
|
51
|
+
this.pageSize = Math.max(pageSize, 1);
|
52
|
+
this.totalItems = totalItems;
|
53
|
+
this.totalPages = Math.max(1, Math.ceil(this.totalItems / this.pageSize));
|
54
|
+
}
|
55
|
+
|
56
|
+
/**
|
57
|
+
* Gets the total number of pages.
|
58
|
+
*
|
59
|
+
* @returns {number} The total number of pages.
|
60
|
+
*/
|
61
|
+
getTotalPages() {
|
62
|
+
return this.totalPages;
|
63
|
+
}
|
64
|
+
|
65
|
+
/**
|
66
|
+
* Gets the state of a specific page.
|
67
|
+
*
|
68
|
+
* @param {number} currentPage The current page number (1-based index).
|
69
|
+
* @returns {PageInfo | undefined}
|
70
|
+
*/
|
71
|
+
getState(currentPage) {
|
72
|
+
currentPage -= 1;
|
73
|
+
if (currentPage < 0 || currentPage >= this.getTotalPages()) {
|
74
|
+
return;
|
75
|
+
}
|
76
|
+
const startIndex = currentPage * this.pageSize;
|
77
|
+
const endIndex = Math.max(0, Math.min(startIndex + this.pageSize - 1, this.totalItems - 1));
|
78
|
+
return {
|
79
|
+
startIndex,
|
80
|
+
endIndex,
|
81
|
+
pageSize: this.pageSize
|
82
|
+
};
|
83
|
+
}
|
84
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
exports.createPaginatorStrategy = createPaginatorStrategy;
|
5
|
+
require("core-js/modules/es.error.cause.js");
|
6
|
+
var _fixedPageSize = require("./fixedPageSize");
|
7
|
+
var _autoPageSize = require("./autoPageSize");
|
8
|
+
const strategies = new Map([['fixed', _fixedPageSize.FixedPageSizeStrategy], ['auto', _autoPageSize.AutoPageSizeStrategy]]);
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Create a pagination calculation strategy based on the provided type.
|
12
|
+
*
|
13
|
+
* @param {string} strategyType The type of pagination strategy to create.
|
14
|
+
* @returns {FixedPageSizeStrategy | AutoPageSizeStrategy}
|
15
|
+
*/
|
16
|
+
function createPaginatorStrategy(strategyType) {
|
17
|
+
if (!strategies.has(strategyType)) {
|
18
|
+
throw new Error(`Unknown pagination strategy type: ${strategyType}`);
|
19
|
+
}
|
20
|
+
const Strategy = strategies.get(strategyType);
|
21
|
+
return new Strategy();
|
22
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import "core-js/modules/es.error.cause.js";
|
2
|
+
import { FixedPageSizeStrategy } from "./fixedPageSize.mjs";
|
3
|
+
import { AutoPageSizeStrategy } from "./autoPageSize.mjs";
|
4
|
+
const strategies = new Map([['fixed', FixedPageSizeStrategy], ['auto', AutoPageSizeStrategy]]);
|
5
|
+
|
6
|
+
/**
|
7
|
+
* Create a pagination calculation strategy based on the provided type.
|
8
|
+
*
|
9
|
+
* @param {string} strategyType The type of pagination strategy to create.
|
10
|
+
* @returns {FixedPageSizeStrategy | AutoPageSizeStrategy}
|
11
|
+
*/
|
12
|
+
export function createPaginatorStrategy(strategyType) {
|
13
|
+
if (!strategies.has(strategyType)) {
|
14
|
+
throw new Error(`Unknown pagination strategy type: ${strategyType}`);
|
15
|
+
}
|
16
|
+
const Strategy = strategies.get(strategyType);
|
17
|
+
return new Strategy();
|
18
|
+
}
|