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,264 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
5
|
+
var _templateLiteralTag = require("../../helpers/templateLiteralTag");
|
6
|
+
var _object = require("../../helpers/object");
|
7
|
+
var _localHooks = _interopRequireDefault(require("../../mixins/localHooks"));
|
8
|
+
var _element = require("../../helpers/dom/element");
|
9
|
+
var _a11y = require("../../helpers/a11y");
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
11
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
12
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
13
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
14
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
15
|
+
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"); }
|
16
|
+
const DIALOG_CLASS_NAME = 'ht-dialog';
|
17
|
+
const TEMPLATE = `
|
18
|
+
<div data-ref="dialogElement" class="${DIALOG_CLASS_NAME}">
|
19
|
+
<div data-ref="contentWrapperElement" class="${DIALOG_CLASS_NAME}__content-wrapper">
|
20
|
+
<div data-ref="contentElement" class="${DIALOG_CLASS_NAME}__content"></div>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
`;
|
24
|
+
|
25
|
+
/**
|
26
|
+
* DialogUI is a UI component that renders and manages dialog elements.
|
27
|
+
* It handles dialog creation, content updates, visibility toggling, and styling.
|
28
|
+
*
|
29
|
+
* @private
|
30
|
+
* @class DialogUI
|
31
|
+
*/
|
32
|
+
var _rootElement = /*#__PURE__*/new WeakMap();
|
33
|
+
var _refs = /*#__PURE__*/new WeakMap();
|
34
|
+
var _isRtl = /*#__PURE__*/new WeakMap();
|
35
|
+
class DialogUI {
|
36
|
+
constructor(_ref) {
|
37
|
+
let {
|
38
|
+
rootElement,
|
39
|
+
isRtl
|
40
|
+
} = _ref;
|
41
|
+
/**
|
42
|
+
* The root element where the dialog UI will be installed.
|
43
|
+
*
|
44
|
+
* @type {HTMLElement}
|
45
|
+
*/
|
46
|
+
_classPrivateFieldInitSpec(this, _rootElement, void 0);
|
47
|
+
/**
|
48
|
+
* The references to the UI elements.
|
49
|
+
*
|
50
|
+
* @type {object}
|
51
|
+
*/
|
52
|
+
_classPrivateFieldInitSpec(this, _refs, void 0);
|
53
|
+
/**
|
54
|
+
* Indicates if the UI is in RTL mode.
|
55
|
+
*
|
56
|
+
* @type {boolean}
|
57
|
+
*/
|
58
|
+
_classPrivateFieldInitSpec(this, _isRtl, false);
|
59
|
+
_classPrivateFieldSet(_rootElement, this, rootElement);
|
60
|
+
_classPrivateFieldSet(_isRtl, this, isRtl);
|
61
|
+
this.install();
|
62
|
+
}
|
63
|
+
|
64
|
+
/**
|
65
|
+
* Creates the dialog UI elements and sets up the structure.
|
66
|
+
*/
|
67
|
+
install() {
|
68
|
+
var _classPrivateFieldGet2;
|
69
|
+
if ((_classPrivateFieldGet2 = _classPrivateFieldGet(_refs, this)) !== null && _classPrivateFieldGet2 !== void 0 && _classPrivateFieldGet2.dialogElement) {
|
70
|
+
return;
|
71
|
+
}
|
72
|
+
const elements = (0, _templateLiteralTag.html)`${TEMPLATE}`;
|
73
|
+
_classPrivateFieldSet(_refs, this, elements.refs);
|
74
|
+
const {
|
75
|
+
dialogElement
|
76
|
+
} = _classPrivateFieldGet(_refs, this);
|
77
|
+
dialogElement.addEventListener('click', () => this.runLocalHooks('clickDialogElement'));
|
78
|
+
|
79
|
+
// Set ARIA attributes
|
80
|
+
(0, _element.setAttribute)(dialogElement, [(0, _a11y.A11Y_MODAL)(), (0, _a11y.A11Y_TABINDEX)(-1), ['dir', _classPrivateFieldGet(_isRtl, this) ? 'rtl' : 'ltr']]);
|
81
|
+
|
82
|
+
// Append to Handsontable after table grid element
|
83
|
+
_classPrivateFieldGet(_rootElement, this).after(elements.fragment);
|
84
|
+
}
|
85
|
+
|
86
|
+
/**
|
87
|
+
* Returns the dialog element.
|
88
|
+
*
|
89
|
+
* @returns {HTMLElement} The dialog element.
|
90
|
+
*/
|
91
|
+
getDialogElement() {
|
92
|
+
return _classPrivateFieldGet(_refs, this).dialogElement;
|
93
|
+
}
|
94
|
+
|
95
|
+
/**
|
96
|
+
* Checks if the given element is inside the dialog.
|
97
|
+
*
|
98
|
+
* @param {HTMLElement} element - The element to check.
|
99
|
+
* @returns {boolean} Returns `true` if the element is inside the dialog, `false` otherwise.
|
100
|
+
*/
|
101
|
+
isInsideDialog(element) {
|
102
|
+
return _classPrivateFieldGet(_refs, this).dialogElement.contains(element);
|
103
|
+
}
|
104
|
+
|
105
|
+
/**
|
106
|
+
* Updates the dialog content and class name.
|
107
|
+
*
|
108
|
+
* @param {object} options - Class name update options.
|
109
|
+
* @param {boolean} options.isVisible - Whether the dialog is visible.
|
110
|
+
* @param {string|HTMLElement} options.content - The content to render in the dialog.
|
111
|
+
* @param {string} options.customClassName - The custom class name to add to the dialog.
|
112
|
+
* @param {string} options.background - The background to add to the dialog.
|
113
|
+
* @param {boolean} options.contentBackground - Whether to show content background.
|
114
|
+
* @param {boolean} options.animation - Whether to add the animation class to the dialog.
|
115
|
+
* @param {object} options.a11y - The accessibility options for the dialog.
|
116
|
+
*
|
117
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
118
|
+
*/
|
119
|
+
updateDialog(_ref2) {
|
120
|
+
let {
|
121
|
+
isVisible,
|
122
|
+
content,
|
123
|
+
customClassName,
|
124
|
+
background,
|
125
|
+
contentBackground,
|
126
|
+
animation,
|
127
|
+
a11y
|
128
|
+
} = _ref2;
|
129
|
+
const {
|
130
|
+
dialogElement,
|
131
|
+
contentElement
|
132
|
+
} = _classPrivateFieldGet(_refs, this);
|
133
|
+
|
134
|
+
// Dialog class name
|
135
|
+
const customClass = customClassName ? ` ${customClassName}` : '';
|
136
|
+
const backgroundClass = background ? ` ${DIALOG_CLASS_NAME}--background-${background}` : '';
|
137
|
+
const animationClass = animation ? ` ${DIALOG_CLASS_NAME}--animation` : '';
|
138
|
+
const showClass = isVisible ? ` ${DIALOG_CLASS_NAME}--show` : '';
|
139
|
+
|
140
|
+
// Update dialog class name
|
141
|
+
dialogElement.className = `${DIALOG_CLASS_NAME}${customClass}${backgroundClass}${animationClass}${showClass}`;
|
142
|
+
|
143
|
+
// Dialog aria attributes
|
144
|
+
(0, _element.setAttribute)(dialogElement, [a11y.role === 'alertdialog' ? (0, _a11y.A11Y_ALERTDIALOG)() : (0, _a11y.A11Y_DIALOG)()]);
|
145
|
+
if (a11y.ariaLabel && !a11y.ariaLabelledby) {
|
146
|
+
(0, _element.setAttribute)(dialogElement, [a11y.ariaLabel ? (0, _a11y.A11Y_LABEL)(a11y.ariaLabel) : undefined]);
|
147
|
+
} else {
|
148
|
+
(0, _element.removeAttribute)(dialogElement, 'aria-label');
|
149
|
+
}
|
150
|
+
if (a11y.ariaLabelledby) {
|
151
|
+
(0, _element.setAttribute)(dialogElement, [(0, _a11y.A11Y_LABELED_BY)(a11y.ariaLabelledby)]);
|
152
|
+
} else {
|
153
|
+
(0, _element.removeAttribute)(dialogElement, 'aria-labelledby');
|
154
|
+
}
|
155
|
+
if (a11y.ariaDescribedby) {
|
156
|
+
(0, _element.setAttribute)(dialogElement, [(0, _a11y.A11Y_DESCRIBED_BY)(a11y.ariaDescribedby)]);
|
157
|
+
} else {
|
158
|
+
(0, _element.removeAttribute)(dialogElement, 'aria-describedby');
|
159
|
+
}
|
160
|
+
|
161
|
+
// Dialog content class name
|
162
|
+
const contentBackgroundClass = contentBackground ? ` ${DIALOG_CLASS_NAME}__content--background` : '';
|
163
|
+
|
164
|
+
// Update content class name
|
165
|
+
contentElement.className = `${DIALOG_CLASS_NAME}__content${contentBackgroundClass}`;
|
166
|
+
|
167
|
+
// Clear existing dialog content
|
168
|
+
contentElement.innerHTML = '';
|
169
|
+
|
170
|
+
// Render new dialog content
|
171
|
+
if (typeof content === 'string') {
|
172
|
+
(0, _element.fastInnerHTML)(contentElement, content);
|
173
|
+
} else if (content instanceof HTMLElement || content instanceof DocumentFragment) {
|
174
|
+
contentElement.appendChild(content);
|
175
|
+
}
|
176
|
+
return this;
|
177
|
+
}
|
178
|
+
|
179
|
+
/**
|
180
|
+
* Shows the dialog with optional animation.
|
181
|
+
*
|
182
|
+
* @param {boolean} animation - Whether to add the animation class to the dialog.
|
183
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
184
|
+
*/
|
185
|
+
showDialog(animation) {
|
186
|
+
const {
|
187
|
+
dialogElement
|
188
|
+
} = _classPrivateFieldGet(_refs, this);
|
189
|
+
dialogElement.style.display = 'block';
|
190
|
+
if (animation) {
|
191
|
+
// Triggers style and layout recalculation, so the display: block is fully committed before adding
|
192
|
+
// the class ht-dialog--show.
|
193
|
+
// eslint-disable-next-line no-unused-expressions
|
194
|
+
dialogElement.offsetHeight;
|
195
|
+
}
|
196
|
+
(0, _element.addClass)(dialogElement, `${DIALOG_CLASS_NAME}--show`);
|
197
|
+
return this;
|
198
|
+
}
|
199
|
+
|
200
|
+
/**
|
201
|
+
* Hides the dialog with optional animation.
|
202
|
+
*
|
203
|
+
* @param {boolean} animation - Whether to add the animation class to the dialog.
|
204
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
205
|
+
*/
|
206
|
+
hideDialog(animation) {
|
207
|
+
const {
|
208
|
+
dialogElement
|
209
|
+
} = _classPrivateFieldGet(_refs, this);
|
210
|
+
(0, _element.removeClass)(dialogElement, `${DIALOG_CLASS_NAME}--show`);
|
211
|
+
if (animation) {
|
212
|
+
dialogElement.addEventListener('transitionend', () => {
|
213
|
+
if (!(0, _element.hasClass)(dialogElement, `${DIALOG_CLASS_NAME}--show`)) {
|
214
|
+
dialogElement.style.display = 'none';
|
215
|
+
}
|
216
|
+
}, {
|
217
|
+
once: true
|
218
|
+
});
|
219
|
+
} else {
|
220
|
+
dialogElement.style.display = 'none';
|
221
|
+
}
|
222
|
+
return this;
|
223
|
+
}
|
224
|
+
|
225
|
+
/**
|
226
|
+
* Focuses the dialog element.
|
227
|
+
*/
|
228
|
+
focusDialog() {
|
229
|
+
_classPrivateFieldGet(_refs, this).dialogElement.focus();
|
230
|
+
}
|
231
|
+
|
232
|
+
/**
|
233
|
+
* Updates the width of the dialog container to the same size as the table.
|
234
|
+
*
|
235
|
+
* @param {number} width - The width of the table.
|
236
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
237
|
+
*/
|
238
|
+
updateWidth(width) {
|
239
|
+
_classPrivateFieldGet(_refs, this).dialogElement.style.width = `${width}px`;
|
240
|
+
return this;
|
241
|
+
}
|
242
|
+
|
243
|
+
/**
|
244
|
+
* Updates the height of the dialog container.
|
245
|
+
*
|
246
|
+
* @param {number} licenseInfoHeight - The height of the license info.
|
247
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
248
|
+
*/
|
249
|
+
updateHeight(licenseInfoHeight) {
|
250
|
+
_classPrivateFieldGet(_refs, this).dialogElement.style.height = `calc(100% - ${licenseInfoHeight}px)`;
|
251
|
+
return this;
|
252
|
+
}
|
253
|
+
|
254
|
+
/**
|
255
|
+
* Removes the dialog UI elements from the DOM and clears the refs.
|
256
|
+
*/
|
257
|
+
destroyDialog() {
|
258
|
+
var _classPrivateFieldGet3;
|
259
|
+
(_classPrivateFieldGet3 = _classPrivateFieldGet(_refs, this)) === null || _classPrivateFieldGet3 === void 0 || _classPrivateFieldGet3.dialogElement.remove();
|
260
|
+
_classPrivateFieldSet(_refs, this, null);
|
261
|
+
}
|
262
|
+
}
|
263
|
+
exports.DialogUI = DialogUI;
|
264
|
+
(0, _object.mixin)(DialogUI, _localHooks.default);
|
@@ -0,0 +1,259 @@
|
|
1
|
+
import "core-js/modules/es.error.cause.js";
|
2
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
3
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
4
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
5
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
6
|
+
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"); }
|
7
|
+
import { html } from "../../helpers/templateLiteralTag.mjs";
|
8
|
+
import { mixin } from "../../helpers/object.mjs";
|
9
|
+
import localHooks from "../../mixins/localHooks.mjs";
|
10
|
+
import { addClass, removeClass, hasClass, fastInnerHTML, setAttribute, removeAttribute } from "../../helpers/dom/element.mjs";
|
11
|
+
import { A11Y_DIALOG, A11Y_MODAL, A11Y_TABINDEX, A11Y_LABEL, A11Y_LABELED_BY, A11Y_DESCRIBED_BY, A11Y_ALERTDIALOG } from "../../helpers/a11y.mjs";
|
12
|
+
const DIALOG_CLASS_NAME = 'ht-dialog';
|
13
|
+
const TEMPLATE = `
|
14
|
+
<div data-ref="dialogElement" class="${DIALOG_CLASS_NAME}">
|
15
|
+
<div data-ref="contentWrapperElement" class="${DIALOG_CLASS_NAME}__content-wrapper">
|
16
|
+
<div data-ref="contentElement" class="${DIALOG_CLASS_NAME}__content"></div>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
`;
|
20
|
+
|
21
|
+
/**
|
22
|
+
* DialogUI is a UI component that renders and manages dialog elements.
|
23
|
+
* It handles dialog creation, content updates, visibility toggling, and styling.
|
24
|
+
*
|
25
|
+
* @private
|
26
|
+
* @class DialogUI
|
27
|
+
*/
|
28
|
+
var _rootElement = /*#__PURE__*/new WeakMap();
|
29
|
+
var _refs = /*#__PURE__*/new WeakMap();
|
30
|
+
var _isRtl = /*#__PURE__*/new WeakMap();
|
31
|
+
export class DialogUI {
|
32
|
+
constructor(_ref) {
|
33
|
+
let {
|
34
|
+
rootElement,
|
35
|
+
isRtl
|
36
|
+
} = _ref;
|
37
|
+
/**
|
38
|
+
* The root element where the dialog UI will be installed.
|
39
|
+
*
|
40
|
+
* @type {HTMLElement}
|
41
|
+
*/
|
42
|
+
_classPrivateFieldInitSpec(this, _rootElement, void 0);
|
43
|
+
/**
|
44
|
+
* The references to the UI elements.
|
45
|
+
*
|
46
|
+
* @type {object}
|
47
|
+
*/
|
48
|
+
_classPrivateFieldInitSpec(this, _refs, void 0);
|
49
|
+
/**
|
50
|
+
* Indicates if the UI is in RTL mode.
|
51
|
+
*
|
52
|
+
* @type {boolean}
|
53
|
+
*/
|
54
|
+
_classPrivateFieldInitSpec(this, _isRtl, false);
|
55
|
+
_classPrivateFieldSet(_rootElement, this, rootElement);
|
56
|
+
_classPrivateFieldSet(_isRtl, this, isRtl);
|
57
|
+
this.install();
|
58
|
+
}
|
59
|
+
|
60
|
+
/**
|
61
|
+
* Creates the dialog UI elements and sets up the structure.
|
62
|
+
*/
|
63
|
+
install() {
|
64
|
+
var _classPrivateFieldGet2;
|
65
|
+
if ((_classPrivateFieldGet2 = _classPrivateFieldGet(_refs, this)) !== null && _classPrivateFieldGet2 !== void 0 && _classPrivateFieldGet2.dialogElement) {
|
66
|
+
return;
|
67
|
+
}
|
68
|
+
const elements = html`${TEMPLATE}`;
|
69
|
+
_classPrivateFieldSet(_refs, this, elements.refs);
|
70
|
+
const {
|
71
|
+
dialogElement
|
72
|
+
} = _classPrivateFieldGet(_refs, this);
|
73
|
+
dialogElement.addEventListener('click', () => this.runLocalHooks('clickDialogElement'));
|
74
|
+
|
75
|
+
// Set ARIA attributes
|
76
|
+
setAttribute(dialogElement, [A11Y_MODAL(), A11Y_TABINDEX(-1), ['dir', _classPrivateFieldGet(_isRtl, this) ? 'rtl' : 'ltr']]);
|
77
|
+
|
78
|
+
// Append to Handsontable after table grid element
|
79
|
+
_classPrivateFieldGet(_rootElement, this).after(elements.fragment);
|
80
|
+
}
|
81
|
+
|
82
|
+
/**
|
83
|
+
* Returns the dialog element.
|
84
|
+
*
|
85
|
+
* @returns {HTMLElement} The dialog element.
|
86
|
+
*/
|
87
|
+
getDialogElement() {
|
88
|
+
return _classPrivateFieldGet(_refs, this).dialogElement;
|
89
|
+
}
|
90
|
+
|
91
|
+
/**
|
92
|
+
* Checks if the given element is inside the dialog.
|
93
|
+
*
|
94
|
+
* @param {HTMLElement} element - The element to check.
|
95
|
+
* @returns {boolean} Returns `true` if the element is inside the dialog, `false` otherwise.
|
96
|
+
*/
|
97
|
+
isInsideDialog(element) {
|
98
|
+
return _classPrivateFieldGet(_refs, this).dialogElement.contains(element);
|
99
|
+
}
|
100
|
+
|
101
|
+
/**
|
102
|
+
* Updates the dialog content and class name.
|
103
|
+
*
|
104
|
+
* @param {object} options - Class name update options.
|
105
|
+
* @param {boolean} options.isVisible - Whether the dialog is visible.
|
106
|
+
* @param {string|HTMLElement} options.content - The content to render in the dialog.
|
107
|
+
* @param {string} options.customClassName - The custom class name to add to the dialog.
|
108
|
+
* @param {string} options.background - The background to add to the dialog.
|
109
|
+
* @param {boolean} options.contentBackground - Whether to show content background.
|
110
|
+
* @param {boolean} options.animation - Whether to add the animation class to the dialog.
|
111
|
+
* @param {object} options.a11y - The accessibility options for the dialog.
|
112
|
+
*
|
113
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
114
|
+
*/
|
115
|
+
updateDialog(_ref2) {
|
116
|
+
let {
|
117
|
+
isVisible,
|
118
|
+
content,
|
119
|
+
customClassName,
|
120
|
+
background,
|
121
|
+
contentBackground,
|
122
|
+
animation,
|
123
|
+
a11y
|
124
|
+
} = _ref2;
|
125
|
+
const {
|
126
|
+
dialogElement,
|
127
|
+
contentElement
|
128
|
+
} = _classPrivateFieldGet(_refs, this);
|
129
|
+
|
130
|
+
// Dialog class name
|
131
|
+
const customClass = customClassName ? ` ${customClassName}` : '';
|
132
|
+
const backgroundClass = background ? ` ${DIALOG_CLASS_NAME}--background-${background}` : '';
|
133
|
+
const animationClass = animation ? ` ${DIALOG_CLASS_NAME}--animation` : '';
|
134
|
+
const showClass = isVisible ? ` ${DIALOG_CLASS_NAME}--show` : '';
|
135
|
+
|
136
|
+
// Update dialog class name
|
137
|
+
dialogElement.className = `${DIALOG_CLASS_NAME}${customClass}${backgroundClass}${animationClass}${showClass}`;
|
138
|
+
|
139
|
+
// Dialog aria attributes
|
140
|
+
setAttribute(dialogElement, [a11y.role === 'alertdialog' ? A11Y_ALERTDIALOG() : A11Y_DIALOG()]);
|
141
|
+
if (a11y.ariaLabel && !a11y.ariaLabelledby) {
|
142
|
+
setAttribute(dialogElement, [a11y.ariaLabel ? A11Y_LABEL(a11y.ariaLabel) : undefined]);
|
143
|
+
} else {
|
144
|
+
removeAttribute(dialogElement, 'aria-label');
|
145
|
+
}
|
146
|
+
if (a11y.ariaLabelledby) {
|
147
|
+
setAttribute(dialogElement, [A11Y_LABELED_BY(a11y.ariaLabelledby)]);
|
148
|
+
} else {
|
149
|
+
removeAttribute(dialogElement, 'aria-labelledby');
|
150
|
+
}
|
151
|
+
if (a11y.ariaDescribedby) {
|
152
|
+
setAttribute(dialogElement, [A11Y_DESCRIBED_BY(a11y.ariaDescribedby)]);
|
153
|
+
} else {
|
154
|
+
removeAttribute(dialogElement, 'aria-describedby');
|
155
|
+
}
|
156
|
+
|
157
|
+
// Dialog content class name
|
158
|
+
const contentBackgroundClass = contentBackground ? ` ${DIALOG_CLASS_NAME}__content--background` : '';
|
159
|
+
|
160
|
+
// Update content class name
|
161
|
+
contentElement.className = `${DIALOG_CLASS_NAME}__content${contentBackgroundClass}`;
|
162
|
+
|
163
|
+
// Clear existing dialog content
|
164
|
+
contentElement.innerHTML = '';
|
165
|
+
|
166
|
+
// Render new dialog content
|
167
|
+
if (typeof content === 'string') {
|
168
|
+
fastInnerHTML(contentElement, content);
|
169
|
+
} else if (content instanceof HTMLElement || content instanceof DocumentFragment) {
|
170
|
+
contentElement.appendChild(content);
|
171
|
+
}
|
172
|
+
return this;
|
173
|
+
}
|
174
|
+
|
175
|
+
/**
|
176
|
+
* Shows the dialog with optional animation.
|
177
|
+
*
|
178
|
+
* @param {boolean} animation - Whether to add the animation class to the dialog.
|
179
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
180
|
+
*/
|
181
|
+
showDialog(animation) {
|
182
|
+
const {
|
183
|
+
dialogElement
|
184
|
+
} = _classPrivateFieldGet(_refs, this);
|
185
|
+
dialogElement.style.display = 'block';
|
186
|
+
if (animation) {
|
187
|
+
// Triggers style and layout recalculation, so the display: block is fully committed before adding
|
188
|
+
// the class ht-dialog--show.
|
189
|
+
// eslint-disable-next-line no-unused-expressions
|
190
|
+
dialogElement.offsetHeight;
|
191
|
+
}
|
192
|
+
addClass(dialogElement, `${DIALOG_CLASS_NAME}--show`);
|
193
|
+
return this;
|
194
|
+
}
|
195
|
+
|
196
|
+
/**
|
197
|
+
* Hides the dialog with optional animation.
|
198
|
+
*
|
199
|
+
* @param {boolean} animation - Whether to add the animation class to the dialog.
|
200
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
201
|
+
*/
|
202
|
+
hideDialog(animation) {
|
203
|
+
const {
|
204
|
+
dialogElement
|
205
|
+
} = _classPrivateFieldGet(_refs, this);
|
206
|
+
removeClass(dialogElement, `${DIALOG_CLASS_NAME}--show`);
|
207
|
+
if (animation) {
|
208
|
+
dialogElement.addEventListener('transitionend', () => {
|
209
|
+
if (!hasClass(dialogElement, `${DIALOG_CLASS_NAME}--show`)) {
|
210
|
+
dialogElement.style.display = 'none';
|
211
|
+
}
|
212
|
+
}, {
|
213
|
+
once: true
|
214
|
+
});
|
215
|
+
} else {
|
216
|
+
dialogElement.style.display = 'none';
|
217
|
+
}
|
218
|
+
return this;
|
219
|
+
}
|
220
|
+
|
221
|
+
/**
|
222
|
+
* Focuses the dialog element.
|
223
|
+
*/
|
224
|
+
focusDialog() {
|
225
|
+
_classPrivateFieldGet(_refs, this).dialogElement.focus();
|
226
|
+
}
|
227
|
+
|
228
|
+
/**
|
229
|
+
* Updates the width of the dialog container to the same size as the table.
|
230
|
+
*
|
231
|
+
* @param {number} width - The width of the table.
|
232
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
233
|
+
*/
|
234
|
+
updateWidth(width) {
|
235
|
+
_classPrivateFieldGet(_refs, this).dialogElement.style.width = `${width}px`;
|
236
|
+
return this;
|
237
|
+
}
|
238
|
+
|
239
|
+
/**
|
240
|
+
* Updates the height of the dialog container.
|
241
|
+
*
|
242
|
+
* @param {number} licenseInfoHeight - The height of the license info.
|
243
|
+
* @returns {DialogUI} The instance of the DialogUI.
|
244
|
+
*/
|
245
|
+
updateHeight(licenseInfoHeight) {
|
246
|
+
_classPrivateFieldGet(_refs, this).dialogElement.style.height = `calc(100% - ${licenseInfoHeight}px)`;
|
247
|
+
return this;
|
248
|
+
}
|
249
|
+
|
250
|
+
/**
|
251
|
+
* Removes the dialog UI elements from the DOM and clears the refs.
|
252
|
+
*/
|
253
|
+
destroyDialog() {
|
254
|
+
var _classPrivateFieldGet3;
|
255
|
+
(_classPrivateFieldGet3 = _classPrivateFieldGet(_refs, this)) === null || _classPrivateFieldGet3 === void 0 || _classPrivateFieldGet3.dialogElement.remove();
|
256
|
+
_classPrivateFieldSet(_refs, this, null);
|
257
|
+
}
|
258
|
+
}
|
259
|
+
mixin(DialogUI, localHooks);
|
@@ -193,6 +193,7 @@ class DropdownMenu extends _base.BasePlugin {
|
|
193
193
|
}
|
194
194
|
return _assertClassBrand(_DropdownMenu_brand, _this, _onBeforeViewportScrollHorizontally).call(_this, ...args);
|
195
195
|
});
|
196
|
+
this.addHook('beforeDialogShow', () => this.close());
|
196
197
|
const settings = this.hot.getSettings()[PLUGIN_KEY];
|
197
198
|
const predefinedItems = {
|
198
199
|
items: this.itemsFactory.getItems(settings)
|
@@ -267,12 +268,12 @@ class DropdownMenu extends _base.BasePlugin {
|
|
267
268
|
const callback = () => {
|
268
269
|
const {
|
269
270
|
highlight
|
270
|
-
} = this.hot.
|
271
|
+
} = this.hot.getSelectedRangeActive();
|
271
272
|
if ((highlight.isHeader() && highlight.row === -1 || highlight.isCell()) && highlight.col >= 0) {
|
272
273
|
this.hot.selectColumns(highlight.col, highlight.col, -1);
|
273
274
|
const {
|
274
275
|
from
|
275
|
-
} = this.hot.
|
276
|
+
} = this.hot.getSelectedRangeActive();
|
276
277
|
const offset = (0, _utils.getDocumentOffsetByElement)(this.menu.container, this.hot.rootDocument);
|
277
278
|
const target = this.hot.getCell(-1, from.col, true).querySelector(`.${BUTTON_CLASS_NAME}`);
|
278
279
|
const rect = target.getBoundingClientRect();
|
@@ -295,7 +296,7 @@ class DropdownMenu extends _base.BasePlugin {
|
|
295
296
|
callback,
|
296
297
|
runOnlyIf: () => {
|
297
298
|
var _this$hot$getSelected;
|
298
|
-
const highlight = (_this$hot$getSelected = this.hot.
|
299
|
+
const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
|
299
300
|
return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isHeader() && !this.menu.isOpened();
|
300
301
|
},
|
301
302
|
captureCtrl: true,
|
@@ -305,7 +306,7 @@ class DropdownMenu extends _base.BasePlugin {
|
|
305
306
|
callback,
|
306
307
|
runOnlyIf: () => {
|
307
308
|
var _this$hot$getSelected2;
|
308
|
-
const highlight = (_this$hot$getSelected2 = this.hot.
|
309
|
+
const highlight = (_this$hot$getSelected2 = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight;
|
309
310
|
return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isCell() && !this.menu.isOpened();
|
310
311
|
},
|
311
312
|
group: SHORTCUTS_GROUP
|
@@ -190,6 +190,7 @@ export class DropdownMenu extends BasePlugin {
|
|
190
190
|
}
|
191
191
|
return _assertClassBrand(_DropdownMenu_brand, _this, _onBeforeViewportScrollHorizontally).call(_this, ...args);
|
192
192
|
});
|
193
|
+
this.addHook('beforeDialogShow', () => this.close());
|
193
194
|
const settings = this.hot.getSettings()[PLUGIN_KEY];
|
194
195
|
const predefinedItems = {
|
195
196
|
items: this.itemsFactory.getItems(settings)
|
@@ -264,12 +265,12 @@ export class DropdownMenu extends BasePlugin {
|
|
264
265
|
const callback = () => {
|
265
266
|
const {
|
266
267
|
highlight
|
267
|
-
} = this.hot.
|
268
|
+
} = this.hot.getSelectedRangeActive();
|
268
269
|
if ((highlight.isHeader() && highlight.row === -1 || highlight.isCell()) && highlight.col >= 0) {
|
269
270
|
this.hot.selectColumns(highlight.col, highlight.col, -1);
|
270
271
|
const {
|
271
272
|
from
|
272
|
-
} = this.hot.
|
273
|
+
} = this.hot.getSelectedRangeActive();
|
273
274
|
const offset = getDocumentOffsetByElement(this.menu.container, this.hot.rootDocument);
|
274
275
|
const target = this.hot.getCell(-1, from.col, true).querySelector(`.${BUTTON_CLASS_NAME}`);
|
275
276
|
const rect = target.getBoundingClientRect();
|
@@ -292,7 +293,7 @@ export class DropdownMenu extends BasePlugin {
|
|
292
293
|
callback,
|
293
294
|
runOnlyIf: () => {
|
294
295
|
var _this$hot$getSelected;
|
295
|
-
const highlight = (_this$hot$getSelected = this.hot.
|
296
|
+
const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
|
296
297
|
return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isHeader() && !this.menu.isOpened();
|
297
298
|
},
|
298
299
|
captureCtrl: true,
|
@@ -302,7 +303,7 @@ export class DropdownMenu extends BasePlugin {
|
|
302
303
|
callback,
|
303
304
|
runOnlyIf: () => {
|
304
305
|
var _this$hot$getSelected2;
|
305
|
-
const highlight = (_this$hot$getSelected2 = this.hot.
|
306
|
+
const highlight = (_this$hot$getSelected2 = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight;
|
306
307
|
return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isCell() && !this.menu.isOpened();
|
307
308
|
},
|
308
309
|
group: SHORTCUTS_GROUP
|
@@ -661,7 +661,7 @@ class Filters extends _base.BasePlugin {
|
|
661
661
|
this.importConditions(_classPrivateFieldGet(_previousConditionStack, this));
|
662
662
|
}
|
663
663
|
if (this.hot.selection.isSelected()) {
|
664
|
-
this.hot.selectCell(navigableHeaders ? -1 : 0, this.hot.
|
664
|
+
this.hot.selectCell(navigableHeaders ? -1 : 0, this.hot.getSelectedRangeActive().highlight.col);
|
665
665
|
}
|
666
666
|
if (allowFiltering !== false) {
|
667
667
|
this.hot.runHooks('afterFilter', conditions);
|
@@ -679,7 +679,7 @@ class Filters extends _base.BasePlugin {
|
|
679
679
|
*/
|
680
680
|
getSelectedColumn() {
|
681
681
|
var _this$hot$getSelected;
|
682
|
-
const highlight = (_this$hot$getSelected = this.hot.
|
682
|
+
const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
|
683
683
|
if (!highlight) {
|
684
684
|
return null;
|
685
685
|
}
|
@@ -656,7 +656,7 @@ export class Filters extends BasePlugin {
|
|
656
656
|
this.importConditions(_classPrivateFieldGet(_previousConditionStack, this));
|
657
657
|
}
|
658
658
|
if (this.hot.selection.isSelected()) {
|
659
|
-
this.hot.selectCell(navigableHeaders ? -1 : 0, this.hot.
|
659
|
+
this.hot.selectCell(navigableHeaders ? -1 : 0, this.hot.getSelectedRangeActive().highlight.col);
|
660
660
|
}
|
661
661
|
if (allowFiltering !== false) {
|
662
662
|
this.hot.runHooks('afterFilter', conditions);
|
@@ -674,7 +674,7 @@ export class Filters extends BasePlugin {
|
|
674
674
|
*/
|
675
675
|
getSelectedColumn() {
|
676
676
|
var _this$hot$getSelected;
|
677
|
-
const highlight = (_this$hot$getSelected = this.hot.
|
677
|
+
const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
|
678
678
|
if (!highlight) {
|
679
679
|
return null;
|
680
680
|
}
|
@@ -13,7 +13,7 @@ function hideColumnItem(hiddenColumnsPlugin) {
|
|
13
13
|
return {
|
14
14
|
key: 'hidden_columns_hide',
|
15
15
|
name() {
|
16
|
-
const selection = this.
|
16
|
+
const selection = this.getSelectedActive();
|
17
17
|
let pluralForm = 0;
|
18
18
|
if (Array.isArray(selection)) {
|
19
19
|
const [, fromColumn,, toColumn] = selection;
|
@@ -27,7 +27,7 @@ function hideColumnItem(hiddenColumnsPlugin) {
|
|
27
27
|
const {
|
28
28
|
from,
|
29
29
|
to
|
30
|
-
} = this.
|
30
|
+
} = this.getSelectedRangeActive();
|
31
31
|
const start = Math.max(Math.min(from.col, to.col), 0);
|
32
32
|
const end = Math.max(from.col, to.col);
|
33
33
|
const columnsToHide = [];
|
@@ -42,8 +42,8 @@ function hideColumnItem(hiddenColumnsPlugin) {
|
|
42
42
|
} else {
|
43
43
|
this.deselectCell();
|
44
44
|
}
|
45
|
-
this.render();
|
46
45
|
this.view.adjustElementsSize();
|
46
|
+
this.render();
|
47
47
|
},
|
48
48
|
disabled: false,
|
49
49
|
hidden() {
|