handsontable 16.0.1 → 16.1.0-next-91b8a0f-20250905
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdparty/walkontable/src/overlays.js +12 -2
- package/3rdparty/walkontable/src/overlays.mjs +12 -2
- package/3rdparty/walkontable/src/viewport.js +2 -6
- package/3rdparty/walkontable/src/viewport.mjs +2 -6
- package/CHANGELOG.md +37 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/cellTypes/autocompleteType/accessors/index.js +7 -0
- package/cellTypes/autocompleteType/accessors/index.mjs +2 -0
- package/cellTypes/autocompleteType/accessors/valueGetter.js +14 -0
- package/cellTypes/autocompleteType/accessors/valueGetter.mjs +10 -0
- package/cellTypes/autocompleteType/accessors/valueSetter.js +25 -0
- package/cellTypes/autocompleteType/accessors/valueSetter.mjs +21 -0
- package/cellTypes/autocompleteType/autocompleteType.js +4 -1
- package/cellTypes/autocompleteType/autocompleteType.mjs +4 -1
- package/cellTypes/checkboxType/accessors/index.js +5 -0
- package/cellTypes/checkboxType/accessors/index.mjs +1 -0
- package/cellTypes/checkboxType/accessors/valueSetter.js +26 -0
- package/cellTypes/checkboxType/accessors/valueSetter.mjs +22 -0
- package/cellTypes/checkboxType/checkboxType.js +3 -1
- package/cellTypes/checkboxType/checkboxType.mjs +3 -1
- package/cellTypes/dropdownType/accessors/index.js +7 -0
- package/cellTypes/dropdownType/accessors/index.mjs +2 -0
- package/cellTypes/dropdownType/accessors/valueGetter.js +14 -0
- package/cellTypes/dropdownType/accessors/valueGetter.mjs +10 -0
- package/cellTypes/dropdownType/accessors/valueSetter.js +17 -0
- package/cellTypes/dropdownType/accessors/valueSetter.mjs +13 -0
- package/cellTypes/dropdownType/dropdownType.js +4 -1
- package/cellTypes/dropdownType/dropdownType.mjs +4 -1
- package/cellTypes/numericType/accessors/index.js +5 -0
- package/cellTypes/numericType/accessors/index.mjs +1 -0
- package/cellTypes/numericType/accessors/valueSetter.js +19 -0
- package/cellTypes/numericType/accessors/valueSetter.mjs +15 -0
- package/cellTypes/numericType/numericType.js +3 -1
- package/cellTypes/numericType/numericType.mjs +3 -1
- package/core/focusCatcher/index.js +37 -112
- package/core/focusCatcher/index.mjs +35 -110
- package/core/focusCatcher/utils.js +31 -0
- package/core/focusCatcher/utils.mjs +27 -0
- package/core/hooks/constants.js +242 -0
- package/core/hooks/constants.mjs +242 -0
- package/core/hooks/index.d.ts +22 -0
- package/core/viewportScroll/scrollStrategies/focusScroll.js +5 -1
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +5 -1
- package/core/viewportScroll/utils.js +1 -1
- package/core/viewportScroll/utils.mjs +1 -1
- package/core.d.ts +4 -0
- package/core.js +237 -139
- package/core.mjs +240 -142
- package/dataMap/dataMap.js +13 -3
- package/dataMap/dataMap.mjs +14 -4
- package/dataMap/dataSource.js +16 -0
- package/dataMap/dataSource.mjs +16 -0
- package/dataMap/metaManager/lazyFactoryMap.js +4 -3
- package/dataMap/metaManager/lazyFactoryMap.mjs +2 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +3 -2
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +3 -2
- package/dataMap/metaManager/metaSchema.js +289 -4
- package/dataMap/metaManager/metaSchema.mjs +289 -4
- package/dataMap/metaManager/utils.js +0 -11
- package/dataMap/metaManager/utils.mjs +0 -10
- package/dataMap/replaceData.js +1 -0
- package/dataMap/replaceData.mjs +1 -0
- package/dist/handsontable.css +281 -4
- package/dist/handsontable.full.css +281 -4
- package/dist/handsontable.full.js +7842 -2990
- package/dist/handsontable.full.min.css +4 -5
- package/dist/handsontable.full.min.js +167 -165
- package/dist/handsontable.js +9638 -4807
- package/dist/handsontable.min.css +4 -4
- package/dist/handsontable.min.js +52 -50
- package/dist/languages/all.js +231 -21
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.js +11 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.js +11 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.js +11 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.js +11 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.js +11 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.js +11 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fa-IR.js +11 -1
- package/dist/languages/fa-IR.min.js +1 -1
- package/dist/languages/fr-FR.js +11 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.js +11 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.js +11 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.js +11 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.js +11 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.js +11 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.js +11 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.js +11 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.js +11 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.js +11 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.js +11 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.js +11 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.js +11 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.js +11 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +4 -4
- package/editorManager.mjs +4 -4
- package/editors/autocompleteEditor/autocompleteEditor.js +50 -112
- package/editors/autocompleteEditor/autocompleteEditor.mjs +51 -113
- package/editors/baseEditor/baseEditor.js +10 -6
- package/editors/baseEditor/baseEditor.mjs +10 -6
- package/editors/handsontableEditor/handsontableEditor.js +9 -9
- package/editors/handsontableEditor/handsontableEditor.mjs +9 -9
- package/editors/textEditor/textEditor.js +0 -7
- package/editors/textEditor/textEditor.mjs +0 -7
- package/focusManager.js +2 -2
- package/focusManager.mjs +2 -2
- package/helpers/a11y.js +15 -2
- package/helpers/a11y.mjs +10 -2
- package/helpers/console.js +12 -0
- package/helpers/console.mjs +11 -0
- package/helpers/dom/element.js +4 -4
- package/helpers/dom/element.mjs +4 -4
- package/helpers/mixed.js +65 -2
- package/helpers/mixed.mjs +63 -2
- package/helpers/number.js +28 -0
- package/helpers/number.mjs +26 -0
- package/helpers/object.js +35 -0
- package/helpers/object.mjs +34 -0
- package/helpers/string.js +19 -0
- package/helpers/string.mjs +18 -0
- package/helpers/templateLiteralTag.js +57 -1
- package/helpers/templateLiteralTag.mjs +56 -1
- package/i18n/constants.js +13 -1
- package/i18n/constants.mjs +13 -1
- package/i18n/languages/ar-AR.js +11 -1
- package/i18n/languages/ar-AR.mjs +11 -1
- package/i18n/languages/cs-CZ.js +11 -1
- package/i18n/languages/cs-CZ.mjs +11 -1
- package/i18n/languages/de-CH.js +11 -1
- package/i18n/languages/de-CH.mjs +11 -1
- package/i18n/languages/de-DE.js +11 -1
- package/i18n/languages/de-DE.mjs +11 -1
- package/i18n/languages/en-US.js +11 -1
- package/i18n/languages/en-US.mjs +11 -1
- package/i18n/languages/es-MX.js +11 -1
- package/i18n/languages/es-MX.mjs +11 -1
- package/i18n/languages/fa-IR.js +11 -1
- package/i18n/languages/fa-IR.mjs +11 -1
- package/i18n/languages/fr-FR.js +11 -1
- package/i18n/languages/fr-FR.mjs +11 -1
- package/i18n/languages/hr-HR.js +11 -1
- package/i18n/languages/hr-HR.mjs +11 -1
- package/i18n/languages/it-IT.js +11 -1
- package/i18n/languages/it-IT.mjs +11 -1
- package/i18n/languages/ja-JP.js +11 -1
- package/i18n/languages/ja-JP.mjs +11 -1
- package/i18n/languages/ko-KR.js +11 -1
- package/i18n/languages/ko-KR.mjs +11 -1
- package/i18n/languages/lv-LV.js +11 -1
- package/i18n/languages/lv-LV.mjs +11 -1
- package/i18n/languages/nb-NO.js +11 -1
- package/i18n/languages/nb-NO.mjs +11 -1
- package/i18n/languages/nl-NL.js +11 -1
- package/i18n/languages/nl-NL.mjs +11 -1
- package/i18n/languages/pl-PL.js +11 -1
- package/i18n/languages/pl-PL.mjs +11 -1
- package/i18n/languages/pt-BR.js +11 -1
- package/i18n/languages/pt-BR.mjs +11 -1
- package/i18n/languages/ru-RU.js +11 -1
- package/i18n/languages/ru-RU.mjs +11 -1
- package/i18n/languages/sr-SP.js +11 -1
- package/i18n/languages/sr-SP.mjs +11 -1
- package/i18n/languages/zh-CN.js +11 -1
- package/i18n/languages/zh-CN.mjs +11 -1
- package/i18n/languages/zh-TW.js +11 -1
- package/i18n/languages/zh-TW.mjs +11 -1
- package/i18n/phraseFormatters/index.js +3 -1
- package/i18n/phraseFormatters/index.mjs +3 -1
- package/i18n/registry.js +5 -6
- package/i18n/registry.mjs +5 -6
- package/index.d.ts +27 -0
- package/languages/all.js +231 -21
- package/languages/ar-AR.js +11 -1
- package/languages/ar-AR.mjs +11 -1
- package/languages/cs-CZ.js +11 -1
- package/languages/cs-CZ.mjs +11 -1
- package/languages/de-CH.js +11 -1
- package/languages/de-CH.mjs +11 -1
- package/languages/de-DE.js +11 -1
- package/languages/de-DE.mjs +11 -1
- package/languages/en-US.js +11 -1
- package/languages/en-US.mjs +11 -1
- package/languages/es-MX.js +11 -1
- package/languages/es-MX.mjs +11 -1
- package/languages/fa-IR.js +11 -1
- package/languages/fa-IR.mjs +11 -1
- package/languages/fr-FR.js +11 -1
- package/languages/fr-FR.mjs +11 -1
- package/languages/hr-HR.js +11 -1
- package/languages/hr-HR.mjs +11 -1
- package/languages/index.js +231 -21
- package/languages/it-IT.js +11 -1
- package/languages/it-IT.mjs +11 -1
- package/languages/ja-JP.js +11 -1
- package/languages/ja-JP.mjs +11 -1
- package/languages/ko-KR.js +11 -1
- package/languages/ko-KR.mjs +11 -1
- package/languages/lv-LV.js +11 -1
- package/languages/lv-LV.mjs +11 -1
- package/languages/nb-NO.js +11 -1
- package/languages/nb-NO.mjs +11 -1
- package/languages/nl-NL.js +11 -1
- package/languages/nl-NL.mjs +11 -1
- package/languages/pl-PL.js +11 -1
- package/languages/pl-PL.mjs +11 -1
- package/languages/pt-BR.js +11 -1
- package/languages/pt-BR.mjs +11 -1
- package/languages/ru-RU.js +11 -1
- package/languages/ru-RU.mjs +11 -1
- package/languages/sr-SP.js +11 -1
- package/languages/sr-SP.mjs +11 -1
- package/languages/zh-CN.js +11 -1
- package/languages/zh-CN.mjs +11 -1
- package/languages/zh-TW.js +11 -1
- package/languages/zh-TW.mjs +11 -1
- package/mixins/localHooks.js +16 -0
- package/mixins/localHooks.mjs +16 -0
- package/package.json +19 -1
- package/plugins/autoRowSize/autoRowSize.js +43 -6
- package/plugins/autoRowSize/autoRowSize.mjs +43 -6
- package/plugins/autofill/autofill.js +50 -3
- package/plugins/autofill/autofill.mjs +50 -3
- package/plugins/base/base.js +86 -15
- package/plugins/base/base.mjs +87 -16
- package/plugins/collapsibleColumns/collapsibleColumns.js +4 -4
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +4 -4
- package/plugins/columnSorting/columnSorting.js +3 -3
- package/plugins/columnSorting/columnSorting.mjs +3 -3
- package/plugins/comments/comments.js +52 -22
- package/plugins/comments/comments.mjs +52 -22
- package/plugins/comments/contextMenuItem/addEditComment.js +3 -3
- package/plugins/comments/contextMenuItem/addEditComment.mjs +3 -3
- package/plugins/comments/contextMenuItem/readOnlyComment.js +2 -2
- package/plugins/comments/contextMenuItem/readOnlyComment.mjs +2 -2
- package/plugins/comments/contextMenuItem/removeComment.js +2 -2
- package/plugins/comments/contextMenuItem/removeComment.mjs +2 -2
- package/plugins/contextMenu/contextMenu.js +4 -5
- package/plugins/contextMenu/contextMenu.mjs +4 -5
- package/plugins/contextMenu/menu/cursor.js +1 -1
- package/plugins/contextMenu/menu/cursor.mjs +1 -1
- package/plugins/contextMenu/menu/defaultShortcutsList.js +5 -5
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +5 -5
- package/plugins/contextMenu/menu/menu.js +3 -3
- package/plugins/contextMenu/menu/menu.mjs +3 -3
- package/plugins/contextMenu/menu/positioner.js +1 -1
- package/plugins/contextMenu/menu/positioner.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/alignment.js +1 -1
- package/plugins/contextMenu/predefinedItems/alignment.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/clearColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/clearColumn.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/columnLeft.js +3 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/columnRight.js +3 -3
- package/plugins/contextMenu/predefinedItems/columnRight.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/readOnly.js +1 -1
- package/plugins/contextMenu/predefinedItems/readOnly.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/rowAbove.js +3 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.js +3 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/copy.js +1 -1
- package/plugins/copyPaste/contextMenuItem/copy.mjs +1 -1
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +3 -3
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/cut.js +1 -1
- package/plugins/copyPaste/contextMenuItem/cut.mjs +1 -1
- package/plugins/copyPaste/copyPaste.js +75 -40
- package/plugins/copyPaste/copyPaste.mjs +76 -41
- package/plugins/customBorders/customBorders.js +1 -1
- package/plugins/customBorders/customBorders.mjs +1 -1
- package/plugins/dialog/dialog.d.ts +23 -0
- package/plugins/dialog/dialog.js +489 -0
- package/plugins/dialog/dialog.mjs +485 -0
- package/plugins/dialog/index.d.ts +1 -0
- package/plugins/dialog/index.js +7 -0
- package/plugins/dialog/index.mjs +1 -0
- package/plugins/dialog/ui.js +264 -0
- package/plugins/dialog/ui.mjs +259 -0
- package/plugins/dropdownMenu/dropdownMenu.js +5 -4
- package/plugins/dropdownMenu/dropdownMenu.mjs +5 -4
- package/plugins/filters/filters.js +2 -2
- package/plugins/filters/filters.mjs +2 -2
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +3 -3
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs +3 -3
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +4 -4
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +4 -4
- package/plugins/hiddenRows/contextMenuItem/hideRow.js +3 -3
- package/plugins/hiddenRows/contextMenuItem/hideRow.mjs +3 -3
- package/plugins/hiddenRows/contextMenuItem/showRow.js +4 -4
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +4 -4
- package/plugins/index.d.ts +9 -0
- package/plugins/index.js +9 -0
- package/plugins/index.mjs +7 -1
- package/plugins/loading/content.js +36 -0
- package/plugins/loading/content.mjs +31 -0
- package/plugins/loading/index.d.ts +1 -0
- package/plugins/loading/index.js +7 -0
- package/plugins/loading/index.mjs +1 -0
- package/plugins/loading/loading.d.ts +19 -0
- package/plugins/loading/loading.js +290 -0
- package/plugins/loading/loading.mjs +285 -0
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
- package/plugins/manualColumnMove/manualColumnMove.js +3 -3
- package/plugins/manualColumnMove/manualColumnMove.mjs +3 -3
- package/plugins/manualColumnResize/manualColumnResize.js +3 -3
- package/plugins/manualColumnResize/manualColumnResize.mjs +3 -3
- package/plugins/manualRowMove/manualRowMove.js +4 -4
- package/plugins/manualRowMove/manualRowMove.mjs +4 -4
- package/plugins/manualRowResize/manualRowResize.js +5 -2
- package/plugins/manualRowResize/manualRowResize.mjs +5 -2
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +15 -15
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +15 -15
- package/plugins/mergeCells/focusOrder.js +75 -39
- package/plugins/mergeCells/focusOrder.mjs +75 -39
- package/plugins/mergeCells/mergeCells.js +26 -19
- package/plugins/mergeCells/mergeCells.mjs +26 -19
- package/plugins/mergeCells/renderer.js +14 -8
- package/plugins/mergeCells/renderer.mjs +14 -8
- package/plugins/multiColumnSorting/multiColumnSorting.js +3 -3
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +3 -3
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +3 -3
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +3 -3
- package/plugins/nestedHeaders/nestedHeaders.js +47 -41
- package/plugins/nestedHeaders/nestedHeaders.mjs +47 -41
- package/plugins/nestedRows/nestedRows.js +3 -3
- package/plugins/nestedRows/nestedRows.mjs +3 -3
- package/plugins/nestedRows/ui/collapsing.js +1 -2
- package/plugins/nestedRows/ui/collapsing.mjs +1 -2
- package/plugins/nestedRows/ui/contextMenu.js +4 -4
- package/plugins/nestedRows/ui/contextMenu.mjs +4 -4
- package/plugins/nestedRows/ui/headers.js +4 -1
- package/plugins/nestedRows/ui/headers.mjs +4 -1
- package/plugins/pagination/focusController.js +27 -0
- package/plugins/pagination/focusController.mjs +23 -0
- package/plugins/pagination/index.d.ts +1 -0
- package/plugins/pagination/index.js +7 -0
- package/plugins/pagination/index.mjs +1 -0
- package/plugins/pagination/pagination.d.ts +52 -0
- package/plugins/pagination/pagination.js +1034 -0
- package/plugins/pagination/pagination.mjs +1030 -0
- package/plugins/pagination/strategies/autoPageSize.js +96 -0
- package/plugins/pagination/strategies/autoPageSize.mjs +92 -0
- package/plugins/pagination/strategies/fixedPageSize.js +88 -0
- package/plugins/pagination/strategies/fixedPageSize.mjs +84 -0
- package/plugins/pagination/strategies/index.js +22 -0
- package/plugins/pagination/strategies/index.mjs +18 -0
- package/plugins/pagination/ui.js +449 -0
- package/plugins/pagination/ui.mjs +443 -0
- package/plugins/pagination/utils.js +28 -0
- package/plugins/pagination/utils.mjs +24 -0
- package/plugins/stretchColumns/calculator.js +4 -0
- package/plugins/stretchColumns/calculator.mjs +4 -0
- package/plugins/stretchColumns/stretchColumns.js +1 -1
- package/plugins/stretchColumns/stretchColumns.mjs +1 -1
- package/plugins/undoRedo/actions/dataChange.js +17 -15
- package/plugins/undoRedo/actions/dataChange.mjs +17 -15
- package/renderers/checkboxRenderer/checkboxRenderer.js +3 -3
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +3 -3
- package/selection/range.js +11 -0
- package/selection/range.mjs +11 -0
- package/selection/selection.js +163 -124
- package/selection/selection.mjs +163 -124
- package/selection/transformation/_base.js +448 -0
- package/selection/transformation/_base.mjs +443 -0
- package/selection/transformation/extender.js +55 -0
- package/selection/transformation/extender.mjs +51 -0
- package/selection/transformation/focus.js +77 -0
- package/selection/transformation/focus.mjs +73 -0
- package/selection/transformation/index.js +7 -0
- package/selection/transformation/index.mjs +2 -0
- package/selection/utils.js +2 -1
- package/selection/utils.mjs +2 -1
- package/settings.d.ts +10 -1
- package/shortcutContexts/commands/editor/fastOpen.js +1 -1
- package/shortcutContexts/commands/editor/fastOpen.mjs +1 -1
- package/shortcutContexts/commands/editor/open.js +10 -4
- package/shortcutContexts/commands/editor/open.mjs +10 -4
- package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +2 -2
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +2 -2
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +2 -2
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +5 -2
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +5 -2
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +5 -2
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +5 -2
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +2 -2
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/scrollToFocusedCell.js +1 -1
- package/shortcutContexts/commands/scrollToFocusedCell.mjs +1 -1
- package/shortcutContexts/grid.js +3 -3
- package/shortcutContexts/grid.mjs +3 -3
- package/shortcuts/context.js +4 -1
- package/shortcuts/context.mjs +4 -1
- package/shortcuts/manager.js +17 -3
- package/shortcuts/manager.mjs +17 -3
- package/styles/handsontable.css +288 -22
- package/styles/handsontable.min.css +3 -3
- package/styles/ht-theme-classic.css +828 -0
- package/styles/ht-theme-classic.min.css +30 -0
- package/styles/ht-theme-horizon.css +122 -26
- package/styles/ht-theme-horizon.min.css +3 -3
- package/styles/ht-theme-main.css +124 -28
- package/styles/ht-theme-main.min.css +3 -3
- package/tableView.js +61 -25
- package/tableView.mjs +61 -25
- package/utils/a11yAnnouncer.js +70 -0
- package/utils/a11yAnnouncer.mjs +64 -0
- package/{core/focusCatcher → utils}/focusDetector.js +30 -12
- package/{core/focusCatcher → utils}/focusDetector.mjs +30 -12
- package/utils/samplesGenerator.js +17 -1
- package/utils/samplesGenerator.mjs +17 -1
- package/utils/stylesHandler.js +23 -8
- package/utils/stylesHandler.mjs +23 -8
- package/utils/valueAccessors.js +45 -0
- package/utils/valueAccessors.mjs +40 -0
- package/validators/autocompleteValidator/autocompleteValidator.js +2 -1
- package/validators/autocompleteValidator/autocompleteValidator.mjs +2 -1
- package/selection/transformation.js +0 -335
- package/selection/transformation.mjs +0 -331
@@ -0,0 +1,489 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
5
|
+
var _base = require("../base");
|
6
|
+
var _ui2 = require("./ui");
|
7
|
+
var _focusDetector2 = require("../../utils/focusDetector");
|
8
|
+
var _object = require("../../helpers/object");
|
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 = 'dialog';
|
16
|
+
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 360;
|
17
|
+
const SHORTCUTS_GROUP = PLUGIN_KEY;
|
18
|
+
const SHORTCUTS_CONTEXT_NAME = `plugin:${PLUGIN_KEY}`;
|
19
|
+
|
20
|
+
/* eslint-disable jsdoc/require-description-complete-sentence */
|
21
|
+
/**
|
22
|
+
* @plugin Dialog
|
23
|
+
* @class Dialog
|
24
|
+
*
|
25
|
+
* @description
|
26
|
+
* The dialog plugin provides a modal dialog system for Handsontable. It allows you to display custom content in modal dialogs
|
27
|
+
* that overlay the table, providing a way to show notifications, error messages, loading indicators, or any other interactive content.
|
28
|
+
*
|
29
|
+
* In order to enable the dialog mechanism, {@link Options#dialog} option must be set to `true`.
|
30
|
+
*
|
31
|
+
* The plugin provides several configuration options to customize the dialog behavior and appearance:
|
32
|
+
* - `content`: The string or HTMLElement content to display in the dialog (default: '')
|
33
|
+
* - `customClassName`: Custom class name to apply to the dialog (default: '')
|
34
|
+
* - `background`: Dialog background variant 'solid' | 'semi-transparent' (default: 'solid')
|
35
|
+
* - `contentBackground`: Whether to show content background (default: false)
|
36
|
+
* - `animation`: Whether to enable animations (default: true)
|
37
|
+
* - `closable`: Whether the dialog can be closed (default: false)
|
38
|
+
* - `a11y`: Object with accessibility options (default object below)
|
39
|
+
* ```js
|
40
|
+
* {
|
41
|
+
* role: 'dialog', // Role of the dialog 'dialog' | 'alertdialog' (default: 'dialog')
|
42
|
+
* ariaLabel: 'Dialog', // Label for the dialog (default: 'Dialog')
|
43
|
+
* ariaLabelledby: '', // ID of the element that labels the dialog (default: '')
|
44
|
+
* ariaDescribedby: '', // ID of the element that describes the dialog (default: ''),
|
45
|
+
* }
|
46
|
+
* ```
|
47
|
+
*
|
48
|
+
* @example
|
49
|
+
*
|
50
|
+
* ::: only-for javascript
|
51
|
+
* ```js
|
52
|
+
* // Enable dialog plugin with default options
|
53
|
+
* dialog: true,
|
54
|
+
*
|
55
|
+
* // Enable dialog plugin with custom configuration
|
56
|
+
* dialog: {
|
57
|
+
* content: 'Dialog content',
|
58
|
+
* customClassName: 'custom-dialog',
|
59
|
+
* background: 'semi-transparent',
|
60
|
+
* contentBackground: false,
|
61
|
+
* animation: false,
|
62
|
+
* closable: true,
|
63
|
+
* a11y: {
|
64
|
+
* role: 'dialog',
|
65
|
+
* ariaLabel: 'Dialog',
|
66
|
+
* ariaLabelledby: 'titleID',
|
67
|
+
* ariaDescribedby: 'descriptionID',
|
68
|
+
* }
|
69
|
+
* }
|
70
|
+
*
|
71
|
+
* // Access to dialog plugin instance:
|
72
|
+
* const dialogPlugin = hot.getPlugin('dialog');
|
73
|
+
*
|
74
|
+
* // Show a dialog programmatically:
|
75
|
+
* dialogPlugin.show({
|
76
|
+
* content: '<h2>Custom Dialog</h2><p>This is a custom dialog content.</p>',
|
77
|
+
* closable: true,
|
78
|
+
* });
|
79
|
+
*
|
80
|
+
* // Hide the dialog programmatically:
|
81
|
+
* dialogPlugin.hide();
|
82
|
+
*
|
83
|
+
* // Check if dialog is visible:
|
84
|
+
* const isVisible = dialogPlugin.isVisible();
|
85
|
+
* ```
|
86
|
+
* :::
|
87
|
+
*
|
88
|
+
* ::: only-for react
|
89
|
+
* ```jsx
|
90
|
+
* const MyComponent = () => {
|
91
|
+
* const hotRef = useRef(null);
|
92
|
+
*
|
93
|
+
* useEffect(() => {
|
94
|
+
* const hot = hotRef.current.hotInstance;
|
95
|
+
* const dialogPlugin = hot.getPlugin('dialog');
|
96
|
+
*
|
97
|
+
* dialogPlugin.show({
|
98
|
+
* content: <div>
|
99
|
+
* <h2>React Dialog</h2>
|
100
|
+
* <p>Dialog content rendered with React</p>
|
101
|
+
* </div>,
|
102
|
+
* closable: true
|
103
|
+
* });
|
104
|
+
* }, []);
|
105
|
+
*
|
106
|
+
* return (
|
107
|
+
* <HotTable
|
108
|
+
* ref={hotRef}
|
109
|
+
* settings={{
|
110
|
+
* data: data,
|
111
|
+
* dialog: {
|
112
|
+
* customClassName: 'react-dialog',
|
113
|
+
* closable: true
|
114
|
+
* }
|
115
|
+
* }}
|
116
|
+
* />
|
117
|
+
* );
|
118
|
+
* }
|
119
|
+
* ```
|
120
|
+
* :::
|
121
|
+
*
|
122
|
+
* ::: only-for angular
|
123
|
+
* ```ts
|
124
|
+
* hotSettings: Handsontable.GridSettings = {
|
125
|
+
* data: data,
|
126
|
+
* dialog: {
|
127
|
+
* customClassName: 'angular-dialog',
|
128
|
+
* closable: true
|
129
|
+
* }
|
130
|
+
* }
|
131
|
+
* ```
|
132
|
+
*
|
133
|
+
* ```html
|
134
|
+
* <hot-table
|
135
|
+
* [settings]="hotSettings">
|
136
|
+
* </hot-table>
|
137
|
+
* ```
|
138
|
+
* :::
|
139
|
+
*/
|
140
|
+
var _ui = /*#__PURE__*/new WeakMap();
|
141
|
+
var _isVisible = /*#__PURE__*/new WeakMap();
|
142
|
+
var _focusDetector = /*#__PURE__*/new WeakMap();
|
143
|
+
var _selectionState = /*#__PURE__*/new WeakMap();
|
144
|
+
var _Dialog_brand = /*#__PURE__*/new WeakSet();
|
145
|
+
class Dialog extends _base.BasePlugin {
|
146
|
+
constructor() {
|
147
|
+
super(...arguments);
|
148
|
+
/**
|
149
|
+
* Register shortcuts responsible for closing the dialog and navigating through the dialog.
|
150
|
+
*/
|
151
|
+
_classPrivateMethodInitSpec(this, _Dialog_brand);
|
152
|
+
/**
|
153
|
+
* UI instance of the dialog plugin.
|
154
|
+
*
|
155
|
+
* @type {DialogUI}
|
156
|
+
*/
|
157
|
+
_classPrivateFieldInitSpec(this, _ui, null);
|
158
|
+
/**
|
159
|
+
* Flag indicating if dialog is currently visible.
|
160
|
+
*
|
161
|
+
* @type {boolean}
|
162
|
+
*/
|
163
|
+
_classPrivateFieldInitSpec(this, _isVisible, false);
|
164
|
+
/**
|
165
|
+
* Focus detector instance.
|
166
|
+
*
|
167
|
+
* @type {FocusDetector}
|
168
|
+
*/
|
169
|
+
_classPrivateFieldInitSpec(this, _focusDetector, null);
|
170
|
+
/**
|
171
|
+
* Keeps the selection state that will be restored after the dialog is closed.
|
172
|
+
*
|
173
|
+
* @type {SelectionState | null}
|
174
|
+
*/
|
175
|
+
_classPrivateFieldInitSpec(this, _selectionState, null);
|
176
|
+
}
|
177
|
+
static get PLUGIN_KEY() {
|
178
|
+
return PLUGIN_KEY;
|
179
|
+
}
|
180
|
+
static get PLUGIN_PRIORITY() {
|
181
|
+
return PLUGIN_PRIORITY;
|
182
|
+
}
|
183
|
+
static get DEFAULT_SETTINGS() {
|
184
|
+
return {
|
185
|
+
content: '',
|
186
|
+
customClassName: '',
|
187
|
+
background: 'solid',
|
188
|
+
contentBackground: false,
|
189
|
+
animation: true,
|
190
|
+
closable: false,
|
191
|
+
a11y: {
|
192
|
+
role: 'dialog',
|
193
|
+
ariaLabel: 'Dialog',
|
194
|
+
ariaLabelledby: '',
|
195
|
+
ariaDescribedby: ''
|
196
|
+
}
|
197
|
+
};
|
198
|
+
}
|
199
|
+
static get SETTINGS_VALIDATORS() {
|
200
|
+
return {
|
201
|
+
content: value => typeof value === 'string' || typeof HTMLElement !== 'undefined' && value instanceof HTMLElement || typeof DocumentFragment !== 'undefined' && value instanceof DocumentFragment,
|
202
|
+
customClassName: value => typeof value === 'string',
|
203
|
+
background: value => ['solid', 'semi-transparent'].includes(value),
|
204
|
+
contentBackground: value => typeof value === 'boolean',
|
205
|
+
animation: value => typeof value === 'boolean',
|
206
|
+
closable: value => typeof value === 'boolean',
|
207
|
+
a11y: value => (0, _object.isObject)(value) && (typeof (value === null || value === void 0 ? void 0 : value.role) === 'undefined' || ['dialog', 'alertdialog'].includes(value === null || value === void 0 ? void 0 : value.role)) && (typeof (value === null || value === void 0 ? void 0 : value.ariaLabel) === 'undefined' || typeof (value === null || value === void 0 ? void 0 : value.ariaLabel) === 'string') && (typeof (value === null || value === void 0 ? void 0 : value.ariaLabelledby) === 'undefined' || typeof (value === null || value === void 0 ? void 0 : value.ariaLabelledby) === 'string') && (typeof (value === null || value === void 0 ? void 0 : value.ariaDescribedby) === 'undefined' || typeof (value === null || value === void 0 ? void 0 : value.ariaDescribedby) === 'string')
|
208
|
+
};
|
209
|
+
}
|
210
|
+
/**
|
211
|
+
* Check if the plugin is enabled in the handsontable settings.
|
212
|
+
*
|
213
|
+
* @returns {boolean}
|
214
|
+
*/
|
215
|
+
isEnabled() {
|
216
|
+
return !!this.hot.getSettings()[PLUGIN_KEY];
|
217
|
+
}
|
218
|
+
|
219
|
+
/**
|
220
|
+
* Enable plugin for this Handsontable instance.
|
221
|
+
*/
|
222
|
+
enablePlugin() {
|
223
|
+
if (this.enabled) {
|
224
|
+
return;
|
225
|
+
}
|
226
|
+
if (!_classPrivateFieldGet(_ui, this)) {
|
227
|
+
_classPrivateFieldSet(_ui, this, new _ui2.DialogUI({
|
228
|
+
rootElement: this.hot.rootGridElement,
|
229
|
+
isRtl: this.hot.isRtl()
|
230
|
+
}));
|
231
|
+
_classPrivateFieldGet(_ui, this).addLocalHook('clickDialogElement', () => _assertClassBrand(_Dialog_brand, this, _onDialogClick).call(this));
|
232
|
+
_classPrivateFieldSet(_focusDetector, this, (0, _focusDetector2.installFocusDetector)(this.hot, _classPrivateFieldGet(_ui, this).getDialogElement(), {
|
233
|
+
onFocus: from => {
|
234
|
+
this.hot.getShortcutManager().setActiveContextName(SHORTCUTS_CONTEXT_NAME);
|
235
|
+
this.hot.listen();
|
236
|
+
this.hot.runHooks('afterDialogFocus', `tab_${from}`);
|
237
|
+
}
|
238
|
+
}));
|
239
|
+
}
|
240
|
+
_assertClassBrand(_Dialog_brand, this, _registerShortcuts).call(this);
|
241
|
+
this.addHook('modifyFocusOnTabNavigation', from => _assertClassBrand(_Dialog_brand, this, _onFocusTabNavigation).call(this, from), 1);
|
242
|
+
this.addHook('afterViewRender', () => _assertClassBrand(_Dialog_brand, this, _onAfterRender).call(this));
|
243
|
+
this.addHook('afterListen', () => _assertClassBrand(_Dialog_brand, this, _onAfterListen).call(this));
|
244
|
+
this.addHook('afterUnlisten', () => _assertClassBrand(_Dialog_brand, this, _onAfterUnlisten).call(this));
|
245
|
+
super.enablePlugin();
|
246
|
+
}
|
247
|
+
|
248
|
+
/**
|
249
|
+
* Update plugin state after Handsontable settings update.
|
250
|
+
*/
|
251
|
+
updatePlugin() {
|
252
|
+
this.disablePlugin();
|
253
|
+
this.enablePlugin();
|
254
|
+
super.updatePlugin();
|
255
|
+
}
|
256
|
+
|
257
|
+
/**
|
258
|
+
* Disable plugin for this Handsontable instance.
|
259
|
+
*/
|
260
|
+
disablePlugin() {
|
261
|
+
this.hide();
|
262
|
+
_assertClassBrand(_Dialog_brand, this, _unregisterShortcuts).call(this);
|
263
|
+
super.disablePlugin();
|
264
|
+
}
|
265
|
+
/**
|
266
|
+
* Check if the dialog is currently visible.
|
267
|
+
*
|
268
|
+
* @returns {boolean} True if the dialog is visible, false otherwise.
|
269
|
+
*/
|
270
|
+
isVisible() {
|
271
|
+
return _classPrivateFieldGet(_isVisible, this);
|
272
|
+
}
|
273
|
+
|
274
|
+
/**
|
275
|
+
* Show dialog with given configuration.
|
276
|
+
* Displays the dialog with the specified content and options.
|
277
|
+
*
|
278
|
+
* @param {object} options Dialog configuration object containing content and display options.
|
279
|
+
* @param {string|HTMLElement|DocumentFragment} options.content The content to display in the dialog. Can be a string, HTMLElement, or DocumentFragment. Default: ''
|
280
|
+
* @param {string} options.customClassName Custom CSS class name to apply to the dialog container. Default: ''
|
281
|
+
* @param {'solid'|'semi-transparent'} options.background Dialog background variant. Default: 'solid'.
|
282
|
+
* @param {boolean} options.contentBackground Whether to show content background. Default: false.
|
283
|
+
* @param {boolean} options.animation Whether to enable animations when showing/hiding the dialog. Default: true.
|
284
|
+
* @param {boolean} options.closable Whether the dialog can be closed by user interaction. Default: false.
|
285
|
+
* @param {object} options.a11y Object with accessibility options.
|
286
|
+
* @param {string} options.a11y.role The role of the dialog. Default: 'dialog'.
|
287
|
+
* @param {string} options.a11y.ariaLabel The label of the dialog. Default: 'Dialog'.
|
288
|
+
* @param {string} options.a11y.ariaLabelledby The ID of the element that labels the dialog. Default: ''.
|
289
|
+
* @param {string} options.a11y.ariaDescribedby The ID of the element that describes the dialog. Default: ''.
|
290
|
+
*/
|
291
|
+
show() {
|
292
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
293
|
+
if (!this.enabled) {
|
294
|
+
return;
|
295
|
+
}
|
296
|
+
if (this.isVisible()) {
|
297
|
+
this.update(options);
|
298
|
+
return;
|
299
|
+
}
|
300
|
+
this.hot.runHooks('beforeDialogShow');
|
301
|
+
this.update(options);
|
302
|
+
_classPrivateFieldGet(_ui, this).showDialog(this.getSetting('animation'));
|
303
|
+
_classPrivateFieldSet(_isVisible, this, true);
|
304
|
+
_classPrivateFieldSet(_selectionState, this, this.hot.selection.exportSelection());
|
305
|
+
this.hot.deselectCell();
|
306
|
+
this.hot.runHooks('afterDialogShow');
|
307
|
+
const {
|
308
|
+
activeElement
|
309
|
+
} = this.hot.rootDocument;
|
310
|
+
if (this.hot.rootWrapperElement.contains(activeElement) || this.hot.rootPortalElement.contains(activeElement)) {
|
311
|
+
this.hot.unlisten();
|
312
|
+
this.hot.getShortcutManager().setActiveContextName(SHORTCUTS_CONTEXT_NAME);
|
313
|
+
this.hot.listen();
|
314
|
+
_classPrivateFieldGet(_ui, this).focusDialog();
|
315
|
+
this.hot.runHooks('afterDialogFocus', 'show');
|
316
|
+
}
|
317
|
+
}
|
318
|
+
|
319
|
+
/**
|
320
|
+
* Hide the currently open dialog.
|
321
|
+
* Closes the dialog and restores the focus to the table.
|
322
|
+
*/
|
323
|
+
hide() {
|
324
|
+
if (!this.isVisible()) {
|
325
|
+
return;
|
326
|
+
}
|
327
|
+
this.hot.runHooks('beforeDialogHide');
|
328
|
+
_classPrivateFieldGet(_ui, this).hideDialog(this.getSetting('animation'));
|
329
|
+
this.hot.getShortcutManager().setActiveContextName('grid');
|
330
|
+
_classPrivateFieldSet(_isVisible, this, false);
|
331
|
+
if (_classPrivateFieldGet(_selectionState, this)) {
|
332
|
+
this.hot.selection.importSelection(_classPrivateFieldGet(_selectionState, this));
|
333
|
+
this.hot.view.render();
|
334
|
+
_classPrivateFieldSet(_selectionState, this, null);
|
335
|
+
} else {
|
336
|
+
this.hot.selectCell(0, 0);
|
337
|
+
}
|
338
|
+
this.hot.runHooks('afterDialogHide');
|
339
|
+
}
|
340
|
+
|
341
|
+
/**
|
342
|
+
* Update the dialog configuration.
|
343
|
+
*
|
344
|
+
* @param {object} options Dialog configuration object containing content and display options.
|
345
|
+
* @param {string|HTMLElement|DocumentFragment} options.content The content to display in the dialog. Can be a string, HTMLElement, or DocumentFragment. Default: ''
|
346
|
+
* @param {string} options.customClassName Custom CSS class name to apply to the dialog container. Default: ''
|
347
|
+
* @param {'solid'|'semi-transparent'} options.background Dialog background variant. Default: 'solid'.
|
348
|
+
* @param {boolean} options.contentBackground Whether to show content background. Default: false.
|
349
|
+
* @param {boolean} options.animation Whether to enable animations when showing/hiding the dialog. Default: true.
|
350
|
+
* @param {boolean} options.closable Whether the dialog can be closed by user interaction. Default: false.
|
351
|
+
* @param {object} options.a11y Object with accessibility options.
|
352
|
+
* @param {string} options.a11y.role The role of the dialog. Default: 'dialog'.
|
353
|
+
* @param {string} options.a11y.ariaLabel The label of the dialog. Default: 'Dialog'.
|
354
|
+
* @param {string} options.a11y.ariaLabelledby The ID of the element that labels the dialog. Default: ''.
|
355
|
+
* @param {string} options.a11y.ariaDescribedby The ID of the element that describes the dialog. Default: ''.
|
356
|
+
*/
|
357
|
+
update(options) {
|
358
|
+
if (!this.enabled) {
|
359
|
+
return;
|
360
|
+
}
|
361
|
+
this.updatePluginSettings(options);
|
362
|
+
_classPrivateFieldGet(_ui, this).updateDialog({
|
363
|
+
isVisible: this.isVisible(),
|
364
|
+
content: this.getSetting('content'),
|
365
|
+
customClassName: this.getSetting('customClassName'),
|
366
|
+
background: this.getSetting('background'),
|
367
|
+
contentBackground: this.getSetting('contentBackground'),
|
368
|
+
animation: this.getSetting('animation'),
|
369
|
+
a11y: this.getSetting('a11y')
|
370
|
+
});
|
371
|
+
}
|
372
|
+
|
373
|
+
/**
|
374
|
+
* Focus the dialog.
|
375
|
+
*/
|
376
|
+
focus() {
|
377
|
+
_classPrivateFieldGet(_ui, this).focusDialog();
|
378
|
+
}
|
379
|
+
|
380
|
+
/**
|
381
|
+
* Handle focus tab navigation event.
|
382
|
+
*
|
383
|
+
* @param {'from_above' | 'from_below'} from The direction from which the focus was modified.
|
384
|
+
* @returns {boolean} Returns `false` to prevent the default focus behavior.
|
385
|
+
*/
|
386
|
+
|
387
|
+
/**
|
388
|
+
* Destroy dialog and reset plugin state.
|
389
|
+
*/
|
390
|
+
destroy() {
|
391
|
+
var _classPrivateFieldGet2;
|
392
|
+
(_classPrivateFieldGet2 = _classPrivateFieldGet(_ui, this)) === null || _classPrivateFieldGet2 === void 0 || _classPrivateFieldGet2.destroyDialog();
|
393
|
+
_classPrivateFieldSet(_ui, this, null);
|
394
|
+
_classPrivateFieldSet(_isVisible, this, false);
|
395
|
+
_classPrivateFieldSet(_focusDetector, this, null);
|
396
|
+
_classPrivateFieldSet(_selectionState, this, null);
|
397
|
+
super.destroy();
|
398
|
+
}
|
399
|
+
}
|
400
|
+
exports.Dialog = Dialog;
|
401
|
+
function _registerShortcuts() {
|
402
|
+
var _manager$getContext;
|
403
|
+
const manager = this.hot.getShortcutManager();
|
404
|
+
const pluginContext = (_manager$getContext = manager.getContext(SHORTCUTS_CONTEXT_NAME)) !== null && _manager$getContext !== void 0 ? _manager$getContext : manager.addContext(SHORTCUTS_CONTEXT_NAME);
|
405
|
+
pluginContext.addShortcut({
|
406
|
+
keys: [['Escape']],
|
407
|
+
callback: () => {
|
408
|
+
this.hide();
|
409
|
+
},
|
410
|
+
runOnlyIf: () => _classPrivateFieldGet(_isVisible, this) && this.getSetting('closable'),
|
411
|
+
group: SHORTCUTS_GROUP
|
412
|
+
});
|
413
|
+
pluginContext.addShortcut({
|
414
|
+
keys: [['Shift', 'Tab'], ['Tab']],
|
415
|
+
preventDefault: false,
|
416
|
+
callback: event => {
|
417
|
+
this.hot._registerTimeout(() => {
|
418
|
+
const {
|
419
|
+
activeElement
|
420
|
+
} = this.hot.rootDocument;
|
421
|
+
if (!_classPrivateFieldGet(_ui, this).isInsideDialog(activeElement)) {
|
422
|
+
this.hot.unlisten();
|
423
|
+
return;
|
424
|
+
}
|
425
|
+
if (event.shiftKey) {
|
426
|
+
this.hot.runHooks('dialogFocusPreviousElement');
|
427
|
+
} else {
|
428
|
+
this.hot.runHooks('dialogFocusNextElement');
|
429
|
+
}
|
430
|
+
}, 0);
|
431
|
+
},
|
432
|
+
group: SHORTCUTS_GROUP
|
433
|
+
});
|
434
|
+
}
|
435
|
+
/**
|
436
|
+
* Unregister shortcuts responsible for closing the dialog and navigating through the dialog.
|
437
|
+
*/
|
438
|
+
function _unregisterShortcuts() {
|
439
|
+
const shortcutManager = this.hot.getShortcutManager();
|
440
|
+
const pluginContext = shortcutManager.getContext(SHORTCUTS_CONTEXT_NAME);
|
441
|
+
pluginContext.removeShortcutsByGroup(SHORTCUTS_GROUP);
|
442
|
+
}
|
443
|
+
function _onFocusTabNavigation(from) {
|
444
|
+
if (this.isVisible()) {
|
445
|
+
_classPrivateFieldGet(_focusDetector, this).focus(from);
|
446
|
+
return false;
|
447
|
+
}
|
448
|
+
}
|
449
|
+
/**
|
450
|
+
* Handle dialog click event.
|
451
|
+
*/
|
452
|
+
function _onDialogClick() {
|
453
|
+
if (this.isVisible() && !this.hot.isListening()) {
|
454
|
+
this.hot.getShortcutManager().setActiveContextName(SHORTCUTS_CONTEXT_NAME);
|
455
|
+
this.hot.runHooks('afterDialogFocus', 'click');
|
456
|
+
}
|
457
|
+
this.hot.listen();
|
458
|
+
}
|
459
|
+
/**
|
460
|
+
* Called after the table is listened.
|
461
|
+
*/
|
462
|
+
function _onAfterListen() {
|
463
|
+
_classPrivateFieldGet(_focusDetector, this).deactivate();
|
464
|
+
}
|
465
|
+
/**
|
466
|
+
* Called after the table is unlistened.
|
467
|
+
*/
|
468
|
+
function _onAfterUnlisten() {
|
469
|
+
_classPrivateFieldGet(_focusDetector, this).activate();
|
470
|
+
}
|
471
|
+
/**
|
472
|
+
* Called after the rendering of the table is completed. It updates the width and
|
473
|
+
* height of the dialog container to the same size as the table.
|
474
|
+
*/
|
475
|
+
function _onAfterRender() {
|
476
|
+
const {
|
477
|
+
view,
|
478
|
+
rootWrapperElement,
|
479
|
+
rootWindow
|
480
|
+
} = this.hot;
|
481
|
+
const width = view.isHorizontallyScrollableByWindow() ? view.getTotalTableWidth() : view.getWorkspaceWidth();
|
482
|
+
_classPrivateFieldGet(_ui, this).updateWidth(width);
|
483
|
+
const dialogInfo = rootWrapperElement.querySelector('.hot-display-license-info');
|
484
|
+
if (dialogInfo) {
|
485
|
+
const height = dialogInfo.offsetHeight;
|
486
|
+
const marginTop = parseFloat(rootWindow.getComputedStyle(dialogInfo).marginTop);
|
487
|
+
_classPrivateFieldGet(_ui, this).updateHeight(height + marginTop);
|
488
|
+
}
|
489
|
+
}
|