handsontable 16.0.1-next-eee5f08-20250710 → 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 +32 -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,292 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
5
|
+
var _base = require("../base");
|
6
|
+
var _content = require("./content");
|
7
|
+
var C = _interopRequireWildcard(require("../../i18n/constants"));
|
8
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
9
|
+
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
10
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
11
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
12
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
13
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
14
|
+
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"); }
|
15
|
+
const PLUGIN_KEY = exports.PLUGIN_KEY = 'loading';
|
16
|
+
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 350;
|
17
|
+
const LOADING_CLASS_NAME = exports.LOADING_CLASS_NAME = `ht-${PLUGIN_KEY}`;
|
18
|
+
|
19
|
+
/**
|
20
|
+
* @plugin Loading
|
21
|
+
* @class Loading
|
22
|
+
*
|
23
|
+
* @description
|
24
|
+
* The loading plugin provides a loading overlay system for Handsontable using the Dialog plugin.
|
25
|
+
* It displays a loading indicator with customizable title, icon, and description.
|
26
|
+
*
|
27
|
+
* In order to enable the loading mechanism, {@link Options#loading} option must be set to `true`.
|
28
|
+
*
|
29
|
+
* The plugin provides several configuration options to customize the loading behavior and appearance:
|
30
|
+
* - `icon`: Loading icon to display HTML (as string) in svg format (default: `<svg ... />`).
|
31
|
+
* - `title`: Loading title to display (default: 'Loading...').
|
32
|
+
* - `description`: Loading description to display (default: '').
|
33
|
+
*
|
34
|
+
* @example
|
35
|
+
*
|
36
|
+
* ::: only-for javascript
|
37
|
+
* ```js
|
38
|
+
* // Enable loading plugin with default options
|
39
|
+
* loading: true,
|
40
|
+
*
|
41
|
+
* // Enable loading plugin with custom configuration
|
42
|
+
* loading: {
|
43
|
+
* icon: 'A custom loading icon in SVG format',
|
44
|
+
* title: 'Custom loading title',
|
45
|
+
* description: 'Custom loading description',
|
46
|
+
* }
|
47
|
+
*
|
48
|
+
* // Access to loading plugin instance:
|
49
|
+
* const loadingPlugin = hot.getPlugin('loading');
|
50
|
+
*
|
51
|
+
* // Show a loading programmatically:
|
52
|
+
* loadingPlugin.show();
|
53
|
+
*
|
54
|
+
* // Hide the loading programmatically:
|
55
|
+
* loadingPlugin.hide();
|
56
|
+
*
|
57
|
+
* // Check if dialog is visible:
|
58
|
+
* const isVisible = loadingPlugin.isVisible();
|
59
|
+
* ```
|
60
|
+
* :::
|
61
|
+
*
|
62
|
+
* ::: only-for react
|
63
|
+
* ```jsx
|
64
|
+
* const MyComponent = () => {
|
65
|
+
* const hotRef = useRef(null);
|
66
|
+
*
|
67
|
+
* useEffect(() => {
|
68
|
+
* const hot = hotRef.current.hotInstance;
|
69
|
+
* const loadingPlugin = hot.getPlugin('loading');
|
70
|
+
*
|
71
|
+
* loadingPlugin.show();
|
72
|
+
* }, []);
|
73
|
+
*
|
74
|
+
* return (
|
75
|
+
* <HotTable
|
76
|
+
* ref={hotRef}
|
77
|
+
* settings={{
|
78
|
+
* data: data,
|
79
|
+
* loading: {
|
80
|
+
* icon: 'A custom loading icon in SVG format',
|
81
|
+
* title: 'Custom loading title',
|
82
|
+
* description: 'Custom loading description',
|
83
|
+
* }
|
84
|
+
* }}
|
85
|
+
* />
|
86
|
+
* );
|
87
|
+
* }
|
88
|
+
* ```
|
89
|
+
* :::
|
90
|
+
*
|
91
|
+
* ::: only-for angular
|
92
|
+
* ```ts
|
93
|
+
* hotSettings: Handsontable.GridSettings = {
|
94
|
+
* data: data,
|
95
|
+
* loading: {
|
96
|
+
* icon: 'A custom loading icon in SVG format',
|
97
|
+
* title: 'Custom loading title',
|
98
|
+
* description: 'Custom loading description',
|
99
|
+
* }
|
100
|
+
* }
|
101
|
+
* ```
|
102
|
+
*
|
103
|
+
* ```html
|
104
|
+
* <hot-table
|
105
|
+
* [settings]="hotSettings">
|
106
|
+
* </hot-table>
|
107
|
+
* ```
|
108
|
+
* :::
|
109
|
+
*/
|
110
|
+
var _dialogPlugin = /*#__PURE__*/new WeakMap();
|
111
|
+
var _Loading_brand = /*#__PURE__*/new WeakSet();
|
112
|
+
class Loading extends _base.BasePlugin {
|
113
|
+
constructor() {
|
114
|
+
super(...arguments);
|
115
|
+
/**
|
116
|
+
* Handle dialog focus event.
|
117
|
+
*/
|
118
|
+
_classPrivateMethodInitSpec(this, _Loading_brand);
|
119
|
+
/**
|
120
|
+
* Dialog instance reference.
|
121
|
+
*
|
122
|
+
* @type {Dialog|null}
|
123
|
+
*/
|
124
|
+
_classPrivateFieldInitSpec(this, _dialogPlugin, null);
|
125
|
+
}
|
126
|
+
static get PLUGIN_KEY() {
|
127
|
+
return PLUGIN_KEY;
|
128
|
+
}
|
129
|
+
static get PLUGIN_PRIORITY() {
|
130
|
+
return PLUGIN_PRIORITY;
|
131
|
+
}
|
132
|
+
static get DEFAULT_SETTINGS() {
|
133
|
+
return {
|
134
|
+
// eslint-disable-next-line max-len
|
135
|
+
icon: `<svg class="${LOADING_CLASS_NAME}__icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path stroke="currentColor" stroke-width="2" d="M15 8a7 7 0 1 1-3.5-6.062"></path></svg>`,
|
136
|
+
title: undefined,
|
137
|
+
description: ''
|
138
|
+
};
|
139
|
+
}
|
140
|
+
static get SETTINGS_VALIDATORS() {
|
141
|
+
return {
|
142
|
+
icon: value => typeof value === 'string',
|
143
|
+
title: value => typeof value === 'string',
|
144
|
+
description: value => typeof value === 'string'
|
145
|
+
};
|
146
|
+
}
|
147
|
+
/**
|
148
|
+
* Check if the plugin is enabled in the handsontable settings.
|
149
|
+
*
|
150
|
+
* @returns {boolean}
|
151
|
+
*/
|
152
|
+
isEnabled() {
|
153
|
+
return !!this.hot.getSettings()[PLUGIN_KEY];
|
154
|
+
}
|
155
|
+
|
156
|
+
/**
|
157
|
+
* Enable plugin for this Handsontable instance.
|
158
|
+
*/
|
159
|
+
enablePlugin() {
|
160
|
+
if (this.enabled) {
|
161
|
+
return;
|
162
|
+
}
|
163
|
+
if (_classPrivateFieldGet(_dialogPlugin, this) === null) {
|
164
|
+
var _classPrivateFieldGet2;
|
165
|
+
_classPrivateFieldSet(_dialogPlugin, this, this.hot.getPlugin('dialog'));
|
166
|
+
if (!((_classPrivateFieldGet2 = _classPrivateFieldGet(_dialogPlugin, this)) !== null && _classPrivateFieldGet2 !== void 0 && _classPrivateFieldGet2.isEnabled())) {
|
167
|
+
this.hot.updateSettings({
|
168
|
+
dialog: true
|
169
|
+
});
|
170
|
+
}
|
171
|
+
this.hot.addHook('afterDialogFocus', () => _assertClassBrand(_Loading_brand, this, _onAfterDialogFocus).call(this));
|
172
|
+
}
|
173
|
+
super.enablePlugin();
|
174
|
+
}
|
175
|
+
|
176
|
+
/**
|
177
|
+
* Update plugin state after Handsontable settings update.
|
178
|
+
*/
|
179
|
+
updatePlugin() {
|
180
|
+
this.disablePlugin();
|
181
|
+
this.enablePlugin();
|
182
|
+
super.updatePlugin();
|
183
|
+
}
|
184
|
+
|
185
|
+
/**
|
186
|
+
* Disable plugin for this Handsontable instance.
|
187
|
+
*/
|
188
|
+
disablePlugin() {
|
189
|
+
this.hide();
|
190
|
+
super.disablePlugin();
|
191
|
+
}
|
192
|
+
|
193
|
+
/**
|
194
|
+
* Check if loading dialog is currently visible.
|
195
|
+
*
|
196
|
+
* @returns {boolean}
|
197
|
+
*/
|
198
|
+
isVisible() {
|
199
|
+
var _classPrivateFieldGet3, _classPrivateFieldGet4;
|
200
|
+
return (_classPrivateFieldGet3 = (_classPrivateFieldGet4 = _classPrivateFieldGet(_dialogPlugin, this)) === null || _classPrivateFieldGet4 === void 0 ? void 0 : _classPrivateFieldGet4.isVisible()) !== null && _classPrivateFieldGet3 !== void 0 ? _classPrivateFieldGet3 : false;
|
201
|
+
}
|
202
|
+
|
203
|
+
/**
|
204
|
+
* Show loading dialog with optional custom options.
|
205
|
+
*
|
206
|
+
* @param {object} options Custom loading options.
|
207
|
+
* @param {string} options.icon Custom loading icon.
|
208
|
+
* @param {string} options.title Custom loading title.
|
209
|
+
* @param {string} options.description Custom loading description.
|
210
|
+
*/
|
211
|
+
show() {
|
212
|
+
var _classPrivateFieldGet5;
|
213
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
214
|
+
if (!this.isEnabled() || !_classPrivateFieldGet(_dialogPlugin, this) || !((_classPrivateFieldGet5 = _classPrivateFieldGet(_dialogPlugin, this)) !== null && _classPrivateFieldGet5 !== void 0 && _classPrivateFieldGet5.isEnabled())) {
|
215
|
+
return;
|
216
|
+
}
|
217
|
+
if (this.isVisible()) {
|
218
|
+
this.update(options);
|
219
|
+
return;
|
220
|
+
}
|
221
|
+
const shouldProceed = this.hot.runHooks('beforeLoadingShow');
|
222
|
+
if (shouldProceed === false) {
|
223
|
+
return;
|
224
|
+
}
|
225
|
+
this.update(options);
|
226
|
+
_classPrivateFieldGet(_dialogPlugin, this).show();
|
227
|
+
this.hot.runHooks('afterLoadingShow');
|
228
|
+
}
|
229
|
+
|
230
|
+
/**
|
231
|
+
* Hide loading dialog.
|
232
|
+
*/
|
233
|
+
hide() {
|
234
|
+
var _classPrivateFieldGet6;
|
235
|
+
if (!_classPrivateFieldGet(_dialogPlugin, this) || !((_classPrivateFieldGet6 = _classPrivateFieldGet(_dialogPlugin, this)) !== null && _classPrivateFieldGet6 !== void 0 && _classPrivateFieldGet6.isEnabled()) || !this.isVisible()) {
|
236
|
+
return;
|
237
|
+
}
|
238
|
+
const shouldProceed = this.hot.runHooks('beforeLoadingHide');
|
239
|
+
if (shouldProceed === false) {
|
240
|
+
return;
|
241
|
+
}
|
242
|
+
_classPrivateFieldGet(_dialogPlugin, this).hide();
|
243
|
+
this.hot.runHooks('afterLoadingHide');
|
244
|
+
}
|
245
|
+
|
246
|
+
/**
|
247
|
+
* Update loading description without hiding/showing the dialog.
|
248
|
+
*
|
249
|
+
* @param {object} options Custom loading options.
|
250
|
+
* @param {string} options.icon Custom loading icon.
|
251
|
+
* @param {string} options.title Custom loading title.
|
252
|
+
* @param {string} options.description Custom loading description.
|
253
|
+
*/
|
254
|
+
update(options) {
|
255
|
+
var _classPrivateFieldGet7, _this$getSetting;
|
256
|
+
if (!this.isEnabled() || !_classPrivateFieldGet(_dialogPlugin, this) || !((_classPrivateFieldGet7 = _classPrivateFieldGet(_dialogPlugin, this)) !== null && _classPrivateFieldGet7 !== void 0 && _classPrivateFieldGet7.isEnabled())) {
|
257
|
+
return;
|
258
|
+
}
|
259
|
+
this.updatePluginSettings(options);
|
260
|
+
const id = this.hot.guid;
|
261
|
+
const icon = this.getSetting('icon');
|
262
|
+
const title = (_this$getSetting = this.getSetting('title')) !== null && _this$getSetting !== void 0 ? _this$getSetting : this.hot.getTranslatedPhrase(C.LOADING_TITLE);
|
263
|
+
const description = this.getSetting('description');
|
264
|
+
const content = (0, _content.loadingContent)({
|
265
|
+
id,
|
266
|
+
icon,
|
267
|
+
title,
|
268
|
+
description
|
269
|
+
});
|
270
|
+
_classPrivateFieldGet(_dialogPlugin, this).update({
|
271
|
+
content,
|
272
|
+
customClassName: LOADING_CLASS_NAME,
|
273
|
+
background: this.hot.countSourceRows() === 0 ? 'solid' : 'semi-transparent',
|
274
|
+
a11y: {
|
275
|
+
role: 'alertdialog',
|
276
|
+
ariaLabelledby: `${id}-${PLUGIN_KEY}-title`,
|
277
|
+
ariaDescribedby: description ? `${id}-${PLUGIN_KEY}-description` : undefined
|
278
|
+
}
|
279
|
+
});
|
280
|
+
}
|
281
|
+
/**
|
282
|
+
* Destroy plugin instance.
|
283
|
+
*/
|
284
|
+
destroy() {
|
285
|
+
_classPrivateFieldSet(_dialogPlugin, this, null);
|
286
|
+
super.destroy();
|
287
|
+
}
|
288
|
+
}
|
289
|
+
exports.Loading = Loading;
|
290
|
+
function _onAfterDialogFocus() {
|
291
|
+
_classPrivateFieldGet(_dialogPlugin, this).focus();
|
292
|
+
}
|
@@ -0,0 +1,287 @@
|
|
1
|
+
import "core-js/modules/es.error.cause.js";
|
2
|
+
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
3
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
4
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
5
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
6
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
7
|
+
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"); }
|
8
|
+
import { BasePlugin } from "../base/index.mjs";
|
9
|
+
import { loadingContent } from "./content.mjs";
|
10
|
+
import * as C from "../../i18n/constants.mjs";
|
11
|
+
export const PLUGIN_KEY = 'loading';
|
12
|
+
export const PLUGIN_PRIORITY = 350;
|
13
|
+
export const LOADING_CLASS_NAME = `ht-${PLUGIN_KEY}`;
|
14
|
+
|
15
|
+
/**
|
16
|
+
* @plugin Loading
|
17
|
+
* @class Loading
|
18
|
+
*
|
19
|
+
* @description
|
20
|
+
* The loading plugin provides a loading overlay system for Handsontable using the Dialog plugin.
|
21
|
+
* It displays a loading indicator with customizable title, icon, and description.
|
22
|
+
*
|
23
|
+
* In order to enable the loading mechanism, {@link Options#loading} option must be set to `true`.
|
24
|
+
*
|
25
|
+
* The plugin provides several configuration options to customize the loading behavior and appearance:
|
26
|
+
* - `icon`: Loading icon to display HTML (as string) in svg format (default: `<svg ... />`).
|
27
|
+
* - `title`: Loading title to display (default: 'Loading...').
|
28
|
+
* - `description`: Loading description to display (default: '').
|
29
|
+
*
|
30
|
+
* @example
|
31
|
+
*
|
32
|
+
* ::: only-for javascript
|
33
|
+
* ```js
|
34
|
+
* // Enable loading plugin with default options
|
35
|
+
* loading: true,
|
36
|
+
*
|
37
|
+
* // Enable loading plugin with custom configuration
|
38
|
+
* loading: {
|
39
|
+
* icon: 'A custom loading icon in SVG format',
|
40
|
+
* title: 'Custom loading title',
|
41
|
+
* description: 'Custom loading description',
|
42
|
+
* }
|
43
|
+
*
|
44
|
+
* // Access to loading plugin instance:
|
45
|
+
* const loadingPlugin = hot.getPlugin('loading');
|
46
|
+
*
|
47
|
+
* // Show a loading programmatically:
|
48
|
+
* loadingPlugin.show();
|
49
|
+
*
|
50
|
+
* // Hide the loading programmatically:
|
51
|
+
* loadingPlugin.hide();
|
52
|
+
*
|
53
|
+
* // Check if dialog is visible:
|
54
|
+
* const isVisible = loadingPlugin.isVisible();
|
55
|
+
* ```
|
56
|
+
* :::
|
57
|
+
*
|
58
|
+
* ::: only-for react
|
59
|
+
* ```jsx
|
60
|
+
* const MyComponent = () => {
|
61
|
+
* const hotRef = useRef(null);
|
62
|
+
*
|
63
|
+
* useEffect(() => {
|
64
|
+
* const hot = hotRef.current.hotInstance;
|
65
|
+
* const loadingPlugin = hot.getPlugin('loading');
|
66
|
+
*
|
67
|
+
* loadingPlugin.show();
|
68
|
+
* }, []);
|
69
|
+
*
|
70
|
+
* return (
|
71
|
+
* <HotTable
|
72
|
+
* ref={hotRef}
|
73
|
+
* settings={{
|
74
|
+
* data: data,
|
75
|
+
* loading: {
|
76
|
+
* icon: 'A custom loading icon in SVG format',
|
77
|
+
* title: 'Custom loading title',
|
78
|
+
* description: 'Custom loading description',
|
79
|
+
* }
|
80
|
+
* }}
|
81
|
+
* />
|
82
|
+
* );
|
83
|
+
* }
|
84
|
+
* ```
|
85
|
+
* :::
|
86
|
+
*
|
87
|
+
* ::: only-for angular
|
88
|
+
* ```ts
|
89
|
+
* hotSettings: Handsontable.GridSettings = {
|
90
|
+
* data: data,
|
91
|
+
* loading: {
|
92
|
+
* icon: 'A custom loading icon in SVG format',
|
93
|
+
* title: 'Custom loading title',
|
94
|
+
* description: 'Custom loading description',
|
95
|
+
* }
|
96
|
+
* }
|
97
|
+
* ```
|
98
|
+
*
|
99
|
+
* ```html
|
100
|
+
* <hot-table
|
101
|
+
* [settings]="hotSettings">
|
102
|
+
* </hot-table>
|
103
|
+
* ```
|
104
|
+
* :::
|
105
|
+
*/
|
106
|
+
var _dialogPlugin = /*#__PURE__*/new WeakMap();
|
107
|
+
var _Loading_brand = /*#__PURE__*/new WeakSet();
|
108
|
+
export class Loading extends BasePlugin {
|
109
|
+
constructor() {
|
110
|
+
super(...arguments);
|
111
|
+
/**
|
112
|
+
* Handle dialog focus event.
|
113
|
+
*/
|
114
|
+
_classPrivateMethodInitSpec(this, _Loading_brand);
|
115
|
+
/**
|
116
|
+
* Dialog instance reference.
|
117
|
+
*
|
118
|
+
* @type {Dialog|null}
|
119
|
+
*/
|
120
|
+
_classPrivateFieldInitSpec(this, _dialogPlugin, null);
|
121
|
+
}
|
122
|
+
static get PLUGIN_KEY() {
|
123
|
+
return PLUGIN_KEY;
|
124
|
+
}
|
125
|
+
static get PLUGIN_PRIORITY() {
|
126
|
+
return PLUGIN_PRIORITY;
|
127
|
+
}
|
128
|
+
static get DEFAULT_SETTINGS() {
|
129
|
+
return {
|
130
|
+
// eslint-disable-next-line max-len
|
131
|
+
icon: `<svg class="${LOADING_CLASS_NAME}__icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16"><path stroke="currentColor" stroke-width="2" d="M15 8a7 7 0 1 1-3.5-6.062"></path></svg>`,
|
132
|
+
title: undefined,
|
133
|
+
description: ''
|
134
|
+
};
|
135
|
+
}
|
136
|
+
static get SETTINGS_VALIDATORS() {
|
137
|
+
return {
|
138
|
+
icon: value => typeof value === 'string',
|
139
|
+
title: value => typeof value === 'string',
|
140
|
+
description: value => typeof value === 'string'
|
141
|
+
};
|
142
|
+
}
|
143
|
+
/**
|
144
|
+
* Check if the plugin is enabled in the handsontable settings.
|
145
|
+
*
|
146
|
+
* @returns {boolean}
|
147
|
+
*/
|
148
|
+
isEnabled() {
|
149
|
+
return !!this.hot.getSettings()[PLUGIN_KEY];
|
150
|
+
}
|
151
|
+
|
152
|
+
/**
|
153
|
+
* Enable plugin for this Handsontable instance.
|
154
|
+
*/
|
155
|
+
enablePlugin() {
|
156
|
+
if (this.enabled) {
|
157
|
+
return;
|
158
|
+
}
|
159
|
+
if (_classPrivateFieldGet(_dialogPlugin, this) === null) {
|
160
|
+
var _classPrivateFieldGet2;
|
161
|
+
_classPrivateFieldSet(_dialogPlugin, this, this.hot.getPlugin('dialog'));
|
162
|
+
if (!((_classPrivateFieldGet2 = _classPrivateFieldGet(_dialogPlugin, this)) !== null && _classPrivateFieldGet2 !== void 0 && _classPrivateFieldGet2.isEnabled())) {
|
163
|
+
this.hot.updateSettings({
|
164
|
+
dialog: true
|
165
|
+
});
|
166
|
+
}
|
167
|
+
this.hot.addHook('afterDialogFocus', () => _assertClassBrand(_Loading_brand, this, _onAfterDialogFocus).call(this));
|
168
|
+
}
|
169
|
+
super.enablePlugin();
|
170
|
+
}
|
171
|
+
|
172
|
+
/**
|
173
|
+
* Update plugin state after Handsontable settings update.
|
174
|
+
*/
|
175
|
+
updatePlugin() {
|
176
|
+
this.disablePlugin();
|
177
|
+
this.enablePlugin();
|
178
|
+
super.updatePlugin();
|
179
|
+
}
|
180
|
+
|
181
|
+
/**
|
182
|
+
* Disable plugin for this Handsontable instance.
|
183
|
+
*/
|
184
|
+
disablePlugin() {
|
185
|
+
this.hide();
|
186
|
+
super.disablePlugin();
|
187
|
+
}
|
188
|
+
|
189
|
+
/**
|
190
|
+
* Check if loading dialog is currently visible.
|
191
|
+
*
|
192
|
+
* @returns {boolean}
|
193
|
+
*/
|
194
|
+
isVisible() {
|
195
|
+
var _classPrivateFieldGet3, _classPrivateFieldGet4;
|
196
|
+
return (_classPrivateFieldGet3 = (_classPrivateFieldGet4 = _classPrivateFieldGet(_dialogPlugin, this)) === null || _classPrivateFieldGet4 === void 0 ? void 0 : _classPrivateFieldGet4.isVisible()) !== null && _classPrivateFieldGet3 !== void 0 ? _classPrivateFieldGet3 : false;
|
197
|
+
}
|
198
|
+
|
199
|
+
/**
|
200
|
+
* Show loading dialog with optional custom options.
|
201
|
+
*
|
202
|
+
* @param {object} options Custom loading options.
|
203
|
+
* @param {string} options.icon Custom loading icon.
|
204
|
+
* @param {string} options.title Custom loading title.
|
205
|
+
* @param {string} options.description Custom loading description.
|
206
|
+
*/
|
207
|
+
show() {
|
208
|
+
var _classPrivateFieldGet5;
|
209
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
210
|
+
if (!this.isEnabled() || !_classPrivateFieldGet(_dialogPlugin, this) || !((_classPrivateFieldGet5 = _classPrivateFieldGet(_dialogPlugin, this)) !== null && _classPrivateFieldGet5 !== void 0 && _classPrivateFieldGet5.isEnabled())) {
|
211
|
+
return;
|
212
|
+
}
|
213
|
+
if (this.isVisible()) {
|
214
|
+
this.update(options);
|
215
|
+
return;
|
216
|
+
}
|
217
|
+
const shouldProceed = this.hot.runHooks('beforeLoadingShow');
|
218
|
+
if (shouldProceed === false) {
|
219
|
+
return;
|
220
|
+
}
|
221
|
+
this.update(options);
|
222
|
+
_classPrivateFieldGet(_dialogPlugin, this).show();
|
223
|
+
this.hot.runHooks('afterLoadingShow');
|
224
|
+
}
|
225
|
+
|
226
|
+
/**
|
227
|
+
* Hide loading dialog.
|
228
|
+
*/
|
229
|
+
hide() {
|
230
|
+
var _classPrivateFieldGet6;
|
231
|
+
if (!_classPrivateFieldGet(_dialogPlugin, this) || !((_classPrivateFieldGet6 = _classPrivateFieldGet(_dialogPlugin, this)) !== null && _classPrivateFieldGet6 !== void 0 && _classPrivateFieldGet6.isEnabled()) || !this.isVisible()) {
|
232
|
+
return;
|
233
|
+
}
|
234
|
+
const shouldProceed = this.hot.runHooks('beforeLoadingHide');
|
235
|
+
if (shouldProceed === false) {
|
236
|
+
return;
|
237
|
+
}
|
238
|
+
_classPrivateFieldGet(_dialogPlugin, this).hide();
|
239
|
+
this.hot.runHooks('afterLoadingHide');
|
240
|
+
}
|
241
|
+
|
242
|
+
/**
|
243
|
+
* Update loading description without hiding/showing the dialog.
|
244
|
+
*
|
245
|
+
* @param {object} options Custom loading options.
|
246
|
+
* @param {string} options.icon Custom loading icon.
|
247
|
+
* @param {string} options.title Custom loading title.
|
248
|
+
* @param {string} options.description Custom loading description.
|
249
|
+
*/
|
250
|
+
update(options) {
|
251
|
+
var _classPrivateFieldGet7, _this$getSetting;
|
252
|
+
if (!this.isEnabled() || !_classPrivateFieldGet(_dialogPlugin, this) || !((_classPrivateFieldGet7 = _classPrivateFieldGet(_dialogPlugin, this)) !== null && _classPrivateFieldGet7 !== void 0 && _classPrivateFieldGet7.isEnabled())) {
|
253
|
+
return;
|
254
|
+
}
|
255
|
+
this.updatePluginSettings(options);
|
256
|
+
const id = this.hot.guid;
|
257
|
+
const icon = this.getSetting('icon');
|
258
|
+
const title = (_this$getSetting = this.getSetting('title')) !== null && _this$getSetting !== void 0 ? _this$getSetting : this.hot.getTranslatedPhrase(C.LOADING_TITLE);
|
259
|
+
const description = this.getSetting('description');
|
260
|
+
const content = loadingContent({
|
261
|
+
id,
|
262
|
+
icon,
|
263
|
+
title,
|
264
|
+
description
|
265
|
+
});
|
266
|
+
_classPrivateFieldGet(_dialogPlugin, this).update({
|
267
|
+
content,
|
268
|
+
customClassName: LOADING_CLASS_NAME,
|
269
|
+
background: this.hot.countSourceRows() === 0 ? 'solid' : 'semi-transparent',
|
270
|
+
a11y: {
|
271
|
+
role: 'alertdialog',
|
272
|
+
ariaLabelledby: `${id}-${PLUGIN_KEY}-title`,
|
273
|
+
ariaDescribedby: description ? `${id}-${PLUGIN_KEY}-description` : undefined
|
274
|
+
}
|
275
|
+
});
|
276
|
+
}
|
277
|
+
/**
|
278
|
+
* Destroy plugin instance.
|
279
|
+
*/
|
280
|
+
destroy() {
|
281
|
+
_classPrivateFieldSet(_dialogPlugin, this, null);
|
282
|
+
super.destroy();
|
283
|
+
}
|
284
|
+
}
|
285
|
+
function _onAfterDialogFocus() {
|
286
|
+
_classPrivateFieldGet(_dialogPlugin, this).focus();
|
287
|
+
}
|
@@ -21,8 +21,8 @@ function freezeColumnItem(manualColumnFreezePlugin) {
|
|
21
21
|
}
|
22
22
|
}] = selected;
|
23
23
|
manualColumnFreezePlugin.freezeColumn(selectedColumn);
|
24
|
-
this.render();
|
25
24
|
this.view.adjustElementsSize();
|
25
|
+
this.render();
|
26
26
|
},
|
27
27
|
hidden() {
|
28
28
|
const selection = this.getSelectedRange();
|
@@ -16,8 +16,8 @@ export default function freezeColumnItem(manualColumnFreezePlugin) {
|
|
16
16
|
}
|
17
17
|
}] = selected;
|
18
18
|
manualColumnFreezePlugin.freezeColumn(selectedColumn);
|
19
|
-
this.render();
|
20
19
|
this.view.adjustElementsSize();
|
20
|
+
this.render();
|
21
21
|
},
|
22
22
|
hidden() {
|
23
23
|
const selection = this.getSelectedRange();
|
@@ -21,8 +21,8 @@ function unfreezeColumnItem(manualColumnFreezePlugin) {
|
|
21
21
|
}
|
22
22
|
}] = selected;
|
23
23
|
manualColumnFreezePlugin.unfreezeColumn(selectedColumn);
|
24
|
-
this.render();
|
25
24
|
this.view.adjustElementsSize();
|
25
|
+
this.render();
|
26
26
|
},
|
27
27
|
hidden() {
|
28
28
|
const selection = this.getSelectedRange();
|
@@ -16,8 +16,8 @@ export default function unfreezeColumnItem(manualColumnFreezePlugin) {
|
|
16
16
|
}
|
17
17
|
}] = selected;
|
18
18
|
manualColumnFreezePlugin.unfreezeColumn(selectedColumn);
|
19
|
-
this.render();
|
20
19
|
this.view.adjustElementsSize();
|
20
|
+
this.render();
|
21
21
|
},
|
22
22
|
hidden() {
|
23
23
|
const selection = this.getSelectedRange();
|
@@ -545,7 +545,7 @@ exports.ManualColumnMove = ManualColumnMove;
|
|
545
545
|
function _onBeforeOnCellMouseDown(event, coords, TD, controller) {
|
546
546
|
const wtTable = this.hot.view._wt.wtTable;
|
547
547
|
const isHeaderSelection = this.hot.selection.isSelectedByColumnHeader();
|
548
|
-
const selection = this.hot.
|
548
|
+
const selection = this.hot.getSelectedRangeActive();
|
549
549
|
// This block action shouldn't be handled below.
|
550
550
|
const isSortingElement = (0, _element.hasClass)(event.target, 'sortAction');
|
551
551
|
if (!selection || !isHeaderSelection || _classPrivateFieldGet(_pressed, this) || event.button !== 0 || isSortingElement) {
|
@@ -618,7 +618,7 @@ function _onMouseMove(event) {
|
|
618
618
|
* a boolean value that allows or disallows changing the selection for that particular area.
|
619
619
|
*/
|
620
620
|
function _onBeforeOnCellMouseOver(event, coords, TD, controller) {
|
621
|
-
const selectedRange = this.hot.
|
621
|
+
const selectedRange = this.hot.getSelectedRangeActive();
|
622
622
|
if (!selectedRange || !_classPrivateFieldGet(_pressed, this)) {
|
623
623
|
return;
|
624
624
|
}
|
@@ -654,8 +654,8 @@ function _onMouseUp() {
|
|
654
654
|
_classPrivateFieldGet(_columnsToMove, this).length = 0;
|
655
655
|
if (movePerformed === true) {
|
656
656
|
this.persistentStateSave();
|
657
|
-
this.hot.render();
|
658
657
|
this.hot.view.adjustElementsSize();
|
658
|
+
this.hot.render();
|
659
659
|
const selectionStart = this.hot.toVisualColumn(firstMovedPhysicalColumn);
|
660
660
|
const selectionEnd = selectionStart + columnsLen - 1;
|
661
661
|
this.hot.selectColumns(selectionStart, selectionEnd);
|
@@ -540,7 +540,7 @@ export class ManualColumnMove extends BasePlugin {
|
|
540
540
|
function _onBeforeOnCellMouseDown(event, coords, TD, controller) {
|
541
541
|
const wtTable = this.hot.view._wt.wtTable;
|
542
542
|
const isHeaderSelection = this.hot.selection.isSelectedByColumnHeader();
|
543
|
-
const selection = this.hot.
|
543
|
+
const selection = this.hot.getSelectedRangeActive();
|
544
544
|
// This block action shouldn't be handled below.
|
545
545
|
const isSortingElement = hasClass(event.target, 'sortAction');
|
546
546
|
if (!selection || !isHeaderSelection || _classPrivateFieldGet(_pressed, this) || event.button !== 0 || isSortingElement) {
|
@@ -613,7 +613,7 @@ function _onMouseMove(event) {
|
|
613
613
|
* a boolean value that allows or disallows changing the selection for that particular area.
|
614
614
|
*/
|
615
615
|
function _onBeforeOnCellMouseOver(event, coords, TD, controller) {
|
616
|
-
const selectedRange = this.hot.
|
616
|
+
const selectedRange = this.hot.getSelectedRangeActive();
|
617
617
|
if (!selectedRange || !_classPrivateFieldGet(_pressed, this)) {
|
618
618
|
return;
|
619
619
|
}
|
@@ -649,8 +649,8 @@ function _onMouseUp() {
|
|
649
649
|
_classPrivateFieldGet(_columnsToMove, this).length = 0;
|
650
650
|
if (movePerformed === true) {
|
651
651
|
this.persistentStateSave();
|
652
|
-
this.hot.render();
|
653
652
|
this.hot.view.adjustElementsSize();
|
653
|
+
this.hot.render();
|
654
654
|
const selectionStart = this.hot.toVisualColumn(firstMovedPhysicalColumn);
|
655
655
|
const selectionEnd = selectionStart + columnsLen - 1;
|
656
656
|
this.hot.selectColumns(selectionStart, selectionEnd);
|