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
@@ -292,7 +292,7 @@ class CollapsibleColumns extends _base.BasePlugin {
|
|
292
292
|
const {
|
293
293
|
row,
|
294
294
|
col
|
295
|
-
} = this.hot.
|
295
|
+
} = this.hot.getSelectedRangeActive().highlight;
|
296
296
|
const {
|
297
297
|
collapsible,
|
298
298
|
isCollapsed,
|
@@ -318,7 +318,7 @@ class CollapsibleColumns extends _base.BasePlugin {
|
|
318
318
|
},
|
319
319
|
runOnlyIf: () => {
|
320
320
|
var _this$hot$getSelected, _this$hot$getSelected2;
|
321
|
-
return ((_this$hot$getSelected = this.hot.
|
321
|
+
return ((_this$hot$getSelected = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.isSingle()) && ((_this$hot$getSelected2 = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight.isHeader());
|
322
322
|
},
|
323
323
|
group: SHORTCUTS_GROUP,
|
324
324
|
relativeToGroup: _shortcutContexts.EDITOR_EDIT_GROUP,
|
@@ -510,7 +510,7 @@ class CollapsibleColumns extends _base.BasePlugin {
|
|
510
510
|
});
|
511
511
|
}, true);
|
512
512
|
const isActionPerformed = this.getCollapsedColumns().length !== currentCollapsedColumns.length;
|
513
|
-
const selectionRange = this.hot.
|
513
|
+
const selectionRange = this.hot.getSelectedRangeActive();
|
514
514
|
if (action === 'collapse' && isActionPerformed && selectionRange) {
|
515
515
|
const {
|
516
516
|
row,
|
@@ -526,8 +526,8 @@ class CollapsibleColumns extends _base.BasePlugin {
|
|
526
526
|
}
|
527
527
|
}
|
528
528
|
this.hot.runHooks(actionTranslator.afterHook, currentCollapsedColumns, destinationCollapsedColumns, isActionPossible, isActionPerformed);
|
529
|
-
this.hot.render();
|
530
529
|
this.hot.view.adjustElementsSize();
|
530
|
+
this.hot.render();
|
531
531
|
}
|
532
532
|
|
533
533
|
/**
|
@@ -289,7 +289,7 @@ export class CollapsibleColumns extends BasePlugin {
|
|
289
289
|
const {
|
290
290
|
row,
|
291
291
|
col
|
292
|
-
} = this.hot.
|
292
|
+
} = this.hot.getSelectedRangeActive().highlight;
|
293
293
|
const {
|
294
294
|
collapsible,
|
295
295
|
isCollapsed,
|
@@ -315,7 +315,7 @@ export class CollapsibleColumns extends BasePlugin {
|
|
315
315
|
},
|
316
316
|
runOnlyIf: () => {
|
317
317
|
var _this$hot$getSelected, _this$hot$getSelected2;
|
318
|
-
return ((_this$hot$getSelected = this.hot.
|
318
|
+
return ((_this$hot$getSelected = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.isSingle()) && ((_this$hot$getSelected2 = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight.isHeader());
|
319
319
|
},
|
320
320
|
group: SHORTCUTS_GROUP,
|
321
321
|
relativeToGroup: SHORTCUTS_GROUP_EDITOR,
|
@@ -507,7 +507,7 @@ export class CollapsibleColumns extends BasePlugin {
|
|
507
507
|
});
|
508
508
|
}, true);
|
509
509
|
const isActionPerformed = this.getCollapsedColumns().length !== currentCollapsedColumns.length;
|
510
|
-
const selectionRange = this.hot.
|
510
|
+
const selectionRange = this.hot.getSelectedRangeActive();
|
511
511
|
if (action === 'collapse' && isActionPerformed && selectionRange) {
|
512
512
|
const {
|
513
513
|
row,
|
@@ -523,8 +523,8 @@ export class CollapsibleColumns extends BasePlugin {
|
|
523
523
|
}
|
524
524
|
}
|
525
525
|
this.hot.runHooks(actionTranslator.afterHook, currentCollapsedColumns, destinationCollapsedColumns, isActionPossible, isActionPerformed);
|
526
|
-
this.hot.render();
|
527
526
|
this.hot.view.adjustElementsSize();
|
527
|
+
this.hot.render();
|
528
528
|
}
|
529
529
|
|
530
530
|
/**
|
@@ -238,7 +238,7 @@ class ColumnSorting extends _base.BasePlugin {
|
|
238
238
|
callback: () => {
|
239
239
|
const {
|
240
240
|
highlight
|
241
|
-
} = this.hot.
|
241
|
+
} = this.hot.getSelectedRangeActive();
|
242
242
|
this.sort(this.getColumnNextConfig(highlight.col));
|
243
243
|
|
244
244
|
// prevent default Enter behavior (move to the next row within a selection range)
|
@@ -246,8 +246,8 @@ class ColumnSorting extends _base.BasePlugin {
|
|
246
246
|
},
|
247
247
|
runOnlyIf: () => {
|
248
248
|
var _this$hot$getSelected, _this$hot$getSelected2;
|
249
|
-
const highlight = (_this$hot$getSelected = this.hot.
|
250
|
-
return highlight && ((_this$hot$getSelected2 = this.hot.
|
249
|
+
const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
|
250
|
+
return highlight && ((_this$hot$getSelected2 = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingle()) && this.hot.selection.isCellVisible(highlight) && highlight.row === -1 && highlight.col >= 0;
|
251
251
|
},
|
252
252
|
relativeToGroup: _shortcutContexts.EDITOR_EDIT_GROUP,
|
253
253
|
position: 'before',
|
@@ -235,7 +235,7 @@ export class ColumnSorting extends BasePlugin {
|
|
235
235
|
callback: () => {
|
236
236
|
const {
|
237
237
|
highlight
|
238
|
-
} = this.hot.
|
238
|
+
} = this.hot.getSelectedRangeActive();
|
239
239
|
this.sort(this.getColumnNextConfig(highlight.col));
|
240
240
|
|
241
241
|
// prevent default Enter behavior (move to the next row within a selection range)
|
@@ -243,8 +243,8 @@ export class ColumnSorting extends BasePlugin {
|
|
243
243
|
},
|
244
244
|
runOnlyIf: () => {
|
245
245
|
var _this$hot$getSelected, _this$hot$getSelected2;
|
246
|
-
const highlight = (_this$hot$getSelected = this.hot.
|
247
|
-
return highlight && ((_this$hot$getSelected2 = this.hot.
|
246
|
+
const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
|
247
|
+
return highlight && ((_this$hot$getSelected2 = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.isSingle()) && this.hot.selection.isCellVisible(highlight) && highlight.row === -1 && highlight.col >= 0;
|
248
248
|
},
|
249
249
|
relativeToGroup: SHORTCUTS_GROUP_EDITOR,
|
250
250
|
position: 'before',
|
@@ -6,6 +6,7 @@ require("core-js/modules/es.array.push.js");
|
|
6
6
|
var _element = require("../../helpers/dom/element");
|
7
7
|
var _event = require("../../helpers/dom/event");
|
8
8
|
var _object = require("../../helpers/object");
|
9
|
+
var _src = require("../../3rdparty/walkontable/src");
|
9
10
|
var _base = require("../base");
|
10
11
|
var _commentEditor = _interopRequireDefault(require("./commentEditor"));
|
11
12
|
var _displaySwitch2 = _interopRequireDefault(require("./displaySwitch"));
|
@@ -179,6 +180,7 @@ var _editor = /*#__PURE__*/new WeakMap();
|
|
179
180
|
var _displaySwitch = /*#__PURE__*/new WeakMap();
|
180
181
|
var _preventEditorAutoSwitch = /*#__PURE__*/new WeakMap();
|
181
182
|
var _preventEditorHiding = /*#__PURE__*/new WeakMap();
|
183
|
+
var _preventEditorSaveOnBlur = /*#__PURE__*/new WeakMap();
|
182
184
|
var _cellBelowCursor = /*#__PURE__*/new WeakMap();
|
183
185
|
var _commentValueBeforeSave = /*#__PURE__*/new WeakMap();
|
184
186
|
var _Comments_brand = /*#__PURE__*/new WeakSet();
|
@@ -200,21 +202,18 @@ class Comments extends _base.BasePlugin {
|
|
200
202
|
/**
|
201
203
|
* Instance of {@link CommentEditor}.
|
202
204
|
*
|
203
|
-
* @private
|
204
205
|
* @type {CommentEditor}
|
205
206
|
*/
|
206
207
|
_classPrivateFieldInitSpec(this, _editor, null);
|
207
208
|
/**
|
208
209
|
* Instance of {@link DisplaySwitch}.
|
209
210
|
*
|
210
|
-
* @private
|
211
211
|
* @type {DisplaySwitch}
|
212
212
|
*/
|
213
213
|
_classPrivateFieldInitSpec(this, _displaySwitch, null);
|
214
214
|
/**
|
215
215
|
* Prevents showing/hiding editor that reacts on the logic triggered by the "mouseover" events.
|
216
216
|
*
|
217
|
-
* @private
|
218
217
|
* @type {boolean}
|
219
218
|
*/
|
220
219
|
_classPrivateFieldInitSpec(this, _preventEditorAutoSwitch, false);
|
@@ -222,21 +221,24 @@ class Comments extends _base.BasePlugin {
|
|
222
221
|
* Prevents hiding editor when the table viewport is scrolled and that scroll is triggered by the
|
223
222
|
* keyboard shortcut that insert or edits the comment.
|
224
223
|
*
|
225
|
-
* @private
|
226
224
|
* @type {boolean}
|
227
225
|
*/
|
228
226
|
_classPrivateFieldInitSpec(this, _preventEditorHiding, false);
|
227
|
+
/**
|
228
|
+
* Prevents saving the comment value when the editor is blurred.
|
229
|
+
*
|
230
|
+
* @type {boolean}
|
231
|
+
*/
|
232
|
+
_classPrivateFieldInitSpec(this, _preventEditorSaveOnBlur, false);
|
229
233
|
/**
|
230
234
|
* The flag that allows processing mousedown event correctly when comments editor is triggered.
|
231
235
|
*
|
232
|
-
* @private
|
233
236
|
* @type {boolean}
|
234
237
|
*/
|
235
238
|
_classPrivateFieldInitSpec(this, _cellBelowCursor, null);
|
236
239
|
/**
|
237
240
|
* Holds the comment value before it's actually saved to the cell meta.
|
238
241
|
*
|
239
|
-
* @private
|
240
242
|
* @type {string}
|
241
243
|
*/
|
242
244
|
_classPrivateFieldInitSpec(this, _commentValueBeforeSave, '');
|
@@ -331,7 +333,7 @@ class Comments extends _base.BasePlugin {
|
|
331
333
|
gridContext.addShortcut({
|
332
334
|
keys: [['Control', 'Alt', 'M']],
|
333
335
|
callback: () => {
|
334
|
-
const range = this.hot.
|
336
|
+
const range = this.hot.getSelectedRangeActive();
|
335
337
|
_classPrivateFieldSet(_preventEditorHiding, this, true);
|
336
338
|
this.hot.scrollToFocusedCell(() => {
|
337
339
|
this.setRange(range);
|
@@ -346,7 +348,7 @@ class Comments extends _base.BasePlugin {
|
|
346
348
|
stopPropagation: true,
|
347
349
|
runOnlyIf: () => {
|
348
350
|
var _this$hot$getSelected;
|
349
|
-
return (_this$hot$getSelected = this.hot.
|
351
|
+
return (_this$hot$getSelected = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isCell();
|
350
352
|
},
|
351
353
|
group: SHORTCUTS_GROUP
|
352
354
|
});
|
@@ -373,7 +375,9 @@ class Comments extends _base.BasePlugin {
|
|
373
375
|
keys: [['Shift', 'Tab'], ['Tab']],
|
374
376
|
forwardToContext: manager.getContext('grid'),
|
375
377
|
callback: () => {
|
378
|
+
_classPrivateFieldSet(_preventEditorSaveOnBlur, this, true);
|
376
379
|
_classPrivateFieldGet(_editor, this).setValue(_classPrivateFieldGet(_editor, this).getValue());
|
380
|
+
this.setComment();
|
377
381
|
this.hide();
|
378
382
|
manager.setActiveContextName('grid');
|
379
383
|
},
|
@@ -463,8 +467,10 @@ class Comments extends _base.BasePlugin {
|
|
463
467
|
} else if (editorValue !== null && editorValue !== undefined) {
|
464
468
|
comment = editorValue;
|
465
469
|
}
|
466
|
-
const
|
467
|
-
|
470
|
+
const {
|
471
|
+
row,
|
472
|
+
col
|
473
|
+
} = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
|
468
474
|
this.updateCommentMeta(row, col, {
|
469
475
|
[META_COMMENT_VALUE]: comment
|
470
476
|
});
|
@@ -495,7 +501,11 @@ class Comments extends _base.BasePlugin {
|
|
495
501
|
if (!this.range.from) {
|
496
502
|
throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');
|
497
503
|
}
|
498
|
-
|
504
|
+
const {
|
505
|
+
row,
|
506
|
+
col
|
507
|
+
} = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
|
508
|
+
this.hot.setCellMeta(row, col, META_COMMENT);
|
499
509
|
if (forceRender) {
|
500
510
|
this.hot.render();
|
501
511
|
}
|
@@ -523,9 +533,11 @@ class Comments extends _base.BasePlugin {
|
|
523
533
|
* @returns {string|undefined} Returns a content of the comment.
|
524
534
|
*/
|
525
535
|
getComment() {
|
526
|
-
const
|
527
|
-
|
528
|
-
|
536
|
+
const {
|
537
|
+
row,
|
538
|
+
col
|
539
|
+
} = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
|
540
|
+
return this.getCommentMeta(row, col, META_COMMENT_VALUE);
|
529
541
|
}
|
530
542
|
|
531
543
|
/**
|
@@ -550,15 +562,13 @@ class Comments extends _base.BasePlugin {
|
|
550
562
|
throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');
|
551
563
|
}
|
552
564
|
const {
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
}
|
557
|
-
} = this.range;
|
565
|
+
row,
|
566
|
+
col
|
567
|
+
} = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
|
558
568
|
if (row < 0 || row > this.hot.countSourceRows() - 1 || col < 0 || col > this.hot.countSourceCols() - 1) {
|
559
569
|
return false;
|
560
570
|
}
|
561
|
-
const meta = this.hot.getCellMeta(
|
571
|
+
const meta = this.hot.getCellMeta(row, col);
|
562
572
|
_classPrivateFieldGet(_displaySwitch, this).cancelHiding();
|
563
573
|
_classPrivateFieldGet(_editor, this).setValue((_ref = meta[META_COMMENT] ? meta[META_COMMENT][META_COMMENT_VALUE] : null) !== null && _ref !== void 0 ? _ref : '');
|
564
574
|
_classPrivateFieldGet(_editor, this).show();
|
@@ -604,7 +614,7 @@ class Comments extends _base.BasePlugin {
|
|
604
614
|
const {
|
605
615
|
row: visualRow,
|
606
616
|
col: visualColumn
|
607
|
-
} = this.
|
617
|
+
} = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
|
608
618
|
let renderableRow = rowIndexMapper.getRenderableFromVisualIndex(visualRow);
|
609
619
|
let renderableColumn = columnIndexMapper.getRenderableFromVisualIndex(visualColumn);
|
610
620
|
// Used when the requested row is hidden, and the editor needs to be positioned on the previous row's coords.
|
@@ -747,6 +757,12 @@ class Comments extends _base.BasePlugin {
|
|
747
757
|
return _classPrivateFieldGet(_editor, this).getInputElement();
|
748
758
|
}
|
749
759
|
|
760
|
+
/**
|
761
|
+
* Gets the coords object from the range object.
|
762
|
+
*
|
763
|
+
* @returns {CellCoords} The coords object.
|
764
|
+
*/
|
765
|
+
|
750
766
|
/**
|
751
767
|
* Destroys the plugin instance.
|
752
768
|
*/
|
@@ -823,6 +839,10 @@ function _onAfterRenderer(TD, cellProperties) {
|
|
823
839
|
* editor content and gives back the keyboard shortcuts control by switching to the "grid" context.
|
824
840
|
*/
|
825
841
|
function _onEditorBlur() {
|
842
|
+
if (_classPrivateFieldGet(_preventEditorSaveOnBlur, this)) {
|
843
|
+
_classPrivateFieldSet(_preventEditorSaveOnBlur, this, false);
|
844
|
+
return;
|
845
|
+
}
|
826
846
|
_classPrivateFieldSet(_commentValueBeforeSave, this, '');
|
827
847
|
this.hot.getShortcutManager().setActiveContextName('grid');
|
828
848
|
this.setComment();
|
@@ -843,7 +863,11 @@ function _onEditorFocus() {
|
|
843
863
|
* @param {number} height The new height of the editor.
|
844
864
|
*/
|
845
865
|
function _onEditorResize(width, height) {
|
846
|
-
|
866
|
+
const {
|
867
|
+
row,
|
868
|
+
col
|
869
|
+
} = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
|
870
|
+
this.updateCommentMeta(row, col, {
|
847
871
|
[META_STYLE]: {
|
848
872
|
width,
|
849
873
|
height
|
@@ -868,4 +892,10 @@ function _onAfterScroll() {
|
|
868
892
|
if (!_classPrivateFieldGet(_preventEditorHiding, this)) {
|
869
893
|
this.hide();
|
870
894
|
}
|
895
|
+
}
|
896
|
+
function _getRangeCoords() {
|
897
|
+
if (this.range instanceof _src.CellRange) {
|
898
|
+
return this.range.highlight;
|
899
|
+
}
|
900
|
+
return this.hot._createCellCoords(this.range.from.row, this.range.from.col);
|
871
901
|
}
|
@@ -12,6 +12,7 @@ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.h
|
|
12
12
|
import { addClass, closest, getScrollbarWidth, hasClass, hasVerticalScrollbar, hasHorizontalScrollbar, isChildOf, outerHeight } from "../../helpers/dom/element.mjs";
|
13
13
|
import { stopImmediatePropagation } from "../../helpers/dom/event.mjs";
|
14
14
|
import { deepClone, deepExtend } from "../../helpers/object.mjs";
|
15
|
+
import { CellRange } from "../../3rdparty/walkontable/src/index.mjs";
|
15
16
|
import { BasePlugin } from "../base/index.mjs";
|
16
17
|
import CommentEditor from "./commentEditor.mjs";
|
17
18
|
import DisplaySwitch from "./displaySwitch.mjs";
|
@@ -175,6 +176,7 @@ var _editor = /*#__PURE__*/new WeakMap();
|
|
175
176
|
var _displaySwitch = /*#__PURE__*/new WeakMap();
|
176
177
|
var _preventEditorAutoSwitch = /*#__PURE__*/new WeakMap();
|
177
178
|
var _preventEditorHiding = /*#__PURE__*/new WeakMap();
|
179
|
+
var _preventEditorSaveOnBlur = /*#__PURE__*/new WeakMap();
|
178
180
|
var _cellBelowCursor = /*#__PURE__*/new WeakMap();
|
179
181
|
var _commentValueBeforeSave = /*#__PURE__*/new WeakMap();
|
180
182
|
var _Comments_brand = /*#__PURE__*/new WeakSet();
|
@@ -196,21 +198,18 @@ export class Comments extends BasePlugin {
|
|
196
198
|
/**
|
197
199
|
* Instance of {@link CommentEditor}.
|
198
200
|
*
|
199
|
-
* @private
|
200
201
|
* @type {CommentEditor}
|
201
202
|
*/
|
202
203
|
_classPrivateFieldInitSpec(this, _editor, null);
|
203
204
|
/**
|
204
205
|
* Instance of {@link DisplaySwitch}.
|
205
206
|
*
|
206
|
-
* @private
|
207
207
|
* @type {DisplaySwitch}
|
208
208
|
*/
|
209
209
|
_classPrivateFieldInitSpec(this, _displaySwitch, null);
|
210
210
|
/**
|
211
211
|
* Prevents showing/hiding editor that reacts on the logic triggered by the "mouseover" events.
|
212
212
|
*
|
213
|
-
* @private
|
214
213
|
* @type {boolean}
|
215
214
|
*/
|
216
215
|
_classPrivateFieldInitSpec(this, _preventEditorAutoSwitch, false);
|
@@ -218,21 +217,24 @@ export class Comments extends BasePlugin {
|
|
218
217
|
* Prevents hiding editor when the table viewport is scrolled and that scroll is triggered by the
|
219
218
|
* keyboard shortcut that insert or edits the comment.
|
220
219
|
*
|
221
|
-
* @private
|
222
220
|
* @type {boolean}
|
223
221
|
*/
|
224
222
|
_classPrivateFieldInitSpec(this, _preventEditorHiding, false);
|
223
|
+
/**
|
224
|
+
* Prevents saving the comment value when the editor is blurred.
|
225
|
+
*
|
226
|
+
* @type {boolean}
|
227
|
+
*/
|
228
|
+
_classPrivateFieldInitSpec(this, _preventEditorSaveOnBlur, false);
|
225
229
|
/**
|
226
230
|
* The flag that allows processing mousedown event correctly when comments editor is triggered.
|
227
231
|
*
|
228
|
-
* @private
|
229
232
|
* @type {boolean}
|
230
233
|
*/
|
231
234
|
_classPrivateFieldInitSpec(this, _cellBelowCursor, null);
|
232
235
|
/**
|
233
236
|
* Holds the comment value before it's actually saved to the cell meta.
|
234
237
|
*
|
235
|
-
* @private
|
236
238
|
* @type {string}
|
237
239
|
*/
|
238
240
|
_classPrivateFieldInitSpec(this, _commentValueBeforeSave, '');
|
@@ -327,7 +329,7 @@ export class Comments extends BasePlugin {
|
|
327
329
|
gridContext.addShortcut({
|
328
330
|
keys: [['Control', 'Alt', 'M']],
|
329
331
|
callback: () => {
|
330
|
-
const range = this.hot.
|
332
|
+
const range = this.hot.getSelectedRangeActive();
|
331
333
|
_classPrivateFieldSet(_preventEditorHiding, this, true);
|
332
334
|
this.hot.scrollToFocusedCell(() => {
|
333
335
|
this.setRange(range);
|
@@ -342,7 +344,7 @@ export class Comments extends BasePlugin {
|
|
342
344
|
stopPropagation: true,
|
343
345
|
runOnlyIf: () => {
|
344
346
|
var _this$hot$getSelected;
|
345
|
-
return (_this$hot$getSelected = this.hot.
|
347
|
+
return (_this$hot$getSelected = this.hot.getSelectedRangeActive()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isCell();
|
346
348
|
},
|
347
349
|
group: SHORTCUTS_GROUP
|
348
350
|
});
|
@@ -369,7 +371,9 @@ export class Comments extends BasePlugin {
|
|
369
371
|
keys: [['Shift', 'Tab'], ['Tab']],
|
370
372
|
forwardToContext: manager.getContext('grid'),
|
371
373
|
callback: () => {
|
374
|
+
_classPrivateFieldSet(_preventEditorSaveOnBlur, this, true);
|
372
375
|
_classPrivateFieldGet(_editor, this).setValue(_classPrivateFieldGet(_editor, this).getValue());
|
376
|
+
this.setComment();
|
373
377
|
this.hide();
|
374
378
|
manager.setActiveContextName('grid');
|
375
379
|
},
|
@@ -459,8 +463,10 @@ export class Comments extends BasePlugin {
|
|
459
463
|
} else if (editorValue !== null && editorValue !== undefined) {
|
460
464
|
comment = editorValue;
|
461
465
|
}
|
462
|
-
const
|
463
|
-
|
466
|
+
const {
|
467
|
+
row,
|
468
|
+
col
|
469
|
+
} = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
|
464
470
|
this.updateCommentMeta(row, col, {
|
465
471
|
[META_COMMENT_VALUE]: comment
|
466
472
|
});
|
@@ -491,7 +497,11 @@ export class Comments extends BasePlugin {
|
|
491
497
|
if (!this.range.from) {
|
492
498
|
throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');
|
493
499
|
}
|
494
|
-
|
500
|
+
const {
|
501
|
+
row,
|
502
|
+
col
|
503
|
+
} = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
|
504
|
+
this.hot.setCellMeta(row, col, META_COMMENT);
|
495
505
|
if (forceRender) {
|
496
506
|
this.hot.render();
|
497
507
|
}
|
@@ -519,9 +529,11 @@ export class Comments extends BasePlugin {
|
|
519
529
|
* @returns {string|undefined} Returns a content of the comment.
|
520
530
|
*/
|
521
531
|
getComment() {
|
522
|
-
const
|
523
|
-
|
524
|
-
|
532
|
+
const {
|
533
|
+
row,
|
534
|
+
col
|
535
|
+
} = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
|
536
|
+
return this.getCommentMeta(row, col, META_COMMENT_VALUE);
|
525
537
|
}
|
526
538
|
|
527
539
|
/**
|
@@ -546,15 +558,13 @@ export class Comments extends BasePlugin {
|
|
546
558
|
throw new Error('Before using this method, first set cell range (hot.getPlugin("comment").setRange())');
|
547
559
|
}
|
548
560
|
const {
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
}
|
553
|
-
} = this.range;
|
561
|
+
row,
|
562
|
+
col
|
563
|
+
} = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
|
554
564
|
if (row < 0 || row > this.hot.countSourceRows() - 1 || col < 0 || col > this.hot.countSourceCols() - 1) {
|
555
565
|
return false;
|
556
566
|
}
|
557
|
-
const meta = this.hot.getCellMeta(
|
567
|
+
const meta = this.hot.getCellMeta(row, col);
|
558
568
|
_classPrivateFieldGet(_displaySwitch, this).cancelHiding();
|
559
569
|
_classPrivateFieldGet(_editor, this).setValue((_ref = meta[META_COMMENT] ? meta[META_COMMENT][META_COMMENT_VALUE] : null) !== null && _ref !== void 0 ? _ref : '');
|
560
570
|
_classPrivateFieldGet(_editor, this).show();
|
@@ -600,7 +610,7 @@ export class Comments extends BasePlugin {
|
|
600
610
|
const {
|
601
611
|
row: visualRow,
|
602
612
|
col: visualColumn
|
603
|
-
} = this.
|
613
|
+
} = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
|
604
614
|
let renderableRow = rowIndexMapper.getRenderableFromVisualIndex(visualRow);
|
605
615
|
let renderableColumn = columnIndexMapper.getRenderableFromVisualIndex(visualColumn);
|
606
616
|
// Used when the requested row is hidden, and the editor needs to be positioned on the previous row's coords.
|
@@ -743,6 +753,12 @@ export class Comments extends BasePlugin {
|
|
743
753
|
return _classPrivateFieldGet(_editor, this).getInputElement();
|
744
754
|
}
|
745
755
|
|
756
|
+
/**
|
757
|
+
* Gets the coords object from the range object.
|
758
|
+
*
|
759
|
+
* @returns {CellCoords} The coords object.
|
760
|
+
*/
|
761
|
+
|
746
762
|
/**
|
747
763
|
* Destroys the plugin instance.
|
748
764
|
*/
|
@@ -818,6 +834,10 @@ function _onAfterRenderer(TD, cellProperties) {
|
|
818
834
|
* editor content and gives back the keyboard shortcuts control by switching to the "grid" context.
|
819
835
|
*/
|
820
836
|
function _onEditorBlur() {
|
837
|
+
if (_classPrivateFieldGet(_preventEditorSaveOnBlur, this)) {
|
838
|
+
_classPrivateFieldSet(_preventEditorSaveOnBlur, this, false);
|
839
|
+
return;
|
840
|
+
}
|
821
841
|
_classPrivateFieldSet(_commentValueBeforeSave, this, '');
|
822
842
|
this.hot.getShortcutManager().setActiveContextName('grid');
|
823
843
|
this.setComment();
|
@@ -838,7 +858,11 @@ function _onEditorFocus() {
|
|
838
858
|
* @param {number} height The new height of the editor.
|
839
859
|
*/
|
840
860
|
function _onEditorResize(width, height) {
|
841
|
-
|
861
|
+
const {
|
862
|
+
row,
|
863
|
+
col
|
864
|
+
} = _assertClassBrand(_Comments_brand, this, _getRangeCoords).call(this);
|
865
|
+
this.updateCommentMeta(row, col, {
|
842
866
|
[META_STYLE]: {
|
843
867
|
width,
|
844
868
|
height
|
@@ -863,4 +887,10 @@ function _onAfterScroll() {
|
|
863
887
|
if (!_classPrivateFieldGet(_preventEditorHiding, this)) {
|
864
888
|
this.hide();
|
865
889
|
}
|
890
|
+
}
|
891
|
+
function _getRangeCoords() {
|
892
|
+
if (this.range instanceof CellRange) {
|
893
|
+
return this.range.highlight;
|
894
|
+
}
|
895
|
+
return this.hot._createCellCoords(this.range.from.row, this.range.from.col);
|
866
896
|
}
|
@@ -13,20 +13,20 @@ function addEditCommentItem(plugin) {
|
|
13
13
|
key: 'commentsAddEdit',
|
14
14
|
name() {
|
15
15
|
var _this$getSelectedRang;
|
16
|
-
const highlight = (_this$getSelectedRang = this.
|
16
|
+
const highlight = (_this$getSelectedRang = this.getSelectedRangeActive()) === null || _this$getSelectedRang === void 0 ? void 0 : _this$getSelectedRang.highlight;
|
17
17
|
if (highlight !== null && highlight !== void 0 && highlight.isCell() && plugin.getCommentAtCell(highlight.row, highlight.col)) {
|
18
18
|
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_EDIT_COMMENT);
|
19
19
|
}
|
20
20
|
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ADD_COMMENT);
|
21
21
|
},
|
22
22
|
callback() {
|
23
|
-
const range = this.
|
23
|
+
const range = this.getSelectedRangeActive();
|
24
24
|
plugin.setRange(range);
|
25
25
|
plugin.show();
|
26
26
|
plugin.focusEditor();
|
27
27
|
},
|
28
28
|
disabled() {
|
29
|
-
const range = this.
|
29
|
+
const range = this.getSelectedRangeActive();
|
30
30
|
if (!range || range.highlight.isHeader() || this.selection.isEntireRowSelected() && this.selection.isEntireColumnSelected() || this.countRenderedRows() === 0 || this.countRenderedCols() === 0) {
|
31
31
|
return true;
|
32
32
|
}
|
@@ -8,20 +8,20 @@ export default function addEditCommentItem(plugin) {
|
|
8
8
|
key: 'commentsAddEdit',
|
9
9
|
name() {
|
10
10
|
var _this$getSelectedRang;
|
11
|
-
const highlight = (_this$getSelectedRang = this.
|
11
|
+
const highlight = (_this$getSelectedRang = this.getSelectedRangeActive()) === null || _this$getSelectedRang === void 0 ? void 0 : _this$getSelectedRang.highlight;
|
12
12
|
if (highlight !== null && highlight !== void 0 && highlight.isCell() && plugin.getCommentAtCell(highlight.row, highlight.col)) {
|
13
13
|
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_EDIT_COMMENT);
|
14
14
|
}
|
15
15
|
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ADD_COMMENT);
|
16
16
|
},
|
17
17
|
callback() {
|
18
|
-
const range = this.
|
18
|
+
const range = this.getSelectedRangeActive();
|
19
19
|
plugin.setRange(range);
|
20
20
|
plugin.show();
|
21
21
|
plugin.focusEditor();
|
22
22
|
},
|
23
23
|
disabled() {
|
24
|
-
const range = this.
|
24
|
+
const range = this.getSelectedRangeActive();
|
25
25
|
if (!range || range.highlight.isHeader() || this.selection.isEntireRowSelected() && this.selection.isEntireColumnSelected() || this.countRenderedRows() === 0 || this.countRenderedCols() === 0) {
|
26
26
|
return true;
|
27
27
|
}
|
@@ -21,7 +21,7 @@ function readOnlyCommentItem(plugin) {
|
|
21
21
|
return areReadOnly ? (0, _utils.markLabelAsSelected)(label) : label;
|
22
22
|
},
|
23
23
|
callback() {
|
24
|
-
const range = this.
|
24
|
+
const range = this.getSelectedRangeActive();
|
25
25
|
range.forAll((row, column) => {
|
26
26
|
if (row >= 0 && column >= 0) {
|
27
27
|
const currentState = !!plugin.getCommentMeta(row, column, _comments.META_READONLY);
|
@@ -32,7 +32,7 @@ function readOnlyCommentItem(plugin) {
|
|
32
32
|
});
|
33
33
|
},
|
34
34
|
disabled() {
|
35
|
-
const range = this.
|
35
|
+
const range = this.getSelectedRangeActive();
|
36
36
|
if (!range || range.highlight.isHeader() || !plugin.getCommentAtCell(range.highlight.row, range.highlight.col) || this.selection.isEntireRowSelected() && this.selection.isEntireColumnSelected() || this.countRenderedRows() === 0 || this.countRenderedCols() === 0) {
|
37
37
|
return true;
|
38
38
|
}
|
@@ -16,7 +16,7 @@ export default function readOnlyCommentItem(plugin) {
|
|
16
16
|
return areReadOnly ? markLabelAsSelected(label) : label;
|
17
17
|
},
|
18
18
|
callback() {
|
19
|
-
const range = this.
|
19
|
+
const range = this.getSelectedRangeActive();
|
20
20
|
range.forAll((row, column) => {
|
21
21
|
if (row >= 0 && column >= 0) {
|
22
22
|
const currentState = !!plugin.getCommentMeta(row, column, META_READONLY);
|
@@ -27,7 +27,7 @@ export default function readOnlyCommentItem(plugin) {
|
|
27
27
|
});
|
28
28
|
},
|
29
29
|
disabled() {
|
30
|
-
const range = this.
|
30
|
+
const range = this.getSelectedRangeActive();
|
31
31
|
if (!range || range.highlight.isHeader() || !plugin.getCommentAtCell(range.highlight.row, range.highlight.col) || this.selection.isEntireRowSelected() && this.selection.isEntireColumnSelected() || this.countRenderedRows() === 0 || this.countRenderedCols() === 0) {
|
32
32
|
return true;
|
33
33
|
}
|
@@ -15,7 +15,7 @@ function removeCommentItem(plugin) {
|
|
15
15
|
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_REMOVE_COMMENT);
|
16
16
|
},
|
17
17
|
callback() {
|
18
|
-
const range = this.
|
18
|
+
const range = this.getSelectedRangeActive();
|
19
19
|
range.forAll((row, column) => {
|
20
20
|
if (row >= 0 && column >= 0) {
|
21
21
|
plugin.removeCommentAtCell(row, column, false);
|
@@ -24,7 +24,7 @@ function removeCommentItem(plugin) {
|
|
24
24
|
this.render();
|
25
25
|
},
|
26
26
|
disabled() {
|
27
|
-
const range = this.
|
27
|
+
const range = this.getSelectedRangeActive();
|
28
28
|
if (!range || range.highlight.isHeader() || this.selection.isEntireRowSelected() && this.selection.isEntireColumnSelected() || this.countRenderedRows() === 0 || this.countRenderedCols() === 0) {
|
29
29
|
return true;
|
30
30
|
}
|
@@ -10,7 +10,7 @@ export default function removeCommentItem(plugin) {
|
|
10
10
|
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_REMOVE_COMMENT);
|
11
11
|
},
|
12
12
|
callback() {
|
13
|
-
const range = this.
|
13
|
+
const range = this.getSelectedRangeActive();
|
14
14
|
range.forAll((row, column) => {
|
15
15
|
if (row >= 0 && column >= 0) {
|
16
16
|
plugin.removeCommentAtCell(row, column, false);
|
@@ -19,7 +19,7 @@ export default function removeCommentItem(plugin) {
|
|
19
19
|
this.render();
|
20
20
|
},
|
21
21
|
disabled() {
|
22
|
-
const range = this.
|
22
|
+
const range = this.getSelectedRangeActive();
|
23
23
|
if (!range || range.highlight.isHeader() || this.selection.isEntireRowSelected() && this.selection.isEntireColumnSelected() || this.countRenderedRows() === 0 || this.countRenderedCols() === 0) {
|
24
24
|
return true;
|
25
25
|
}
|