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