handsontable 16.0.1-next-eee5f08-20250710 → 16.1.0-next-abd8f2e-20250904
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdparty/walkontable/src/overlays.js +12 -2
- package/3rdparty/walkontable/src/overlays.mjs +12 -2
- package/3rdparty/walkontable/src/viewport.js +2 -6
- package/3rdparty/walkontable/src/viewport.mjs +2 -6
- package/CHANGELOG.md +32 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/cellTypes/autocompleteType/accessors/index.js +7 -0
- package/cellTypes/autocompleteType/accessors/index.mjs +2 -0
- package/cellTypes/autocompleteType/accessors/valueGetter.js +14 -0
- package/cellTypes/autocompleteType/accessors/valueGetter.mjs +10 -0
- package/cellTypes/autocompleteType/accessors/valueSetter.js +25 -0
- package/cellTypes/autocompleteType/accessors/valueSetter.mjs +21 -0
- package/cellTypes/autocompleteType/autocompleteType.js +4 -1
- package/cellTypes/autocompleteType/autocompleteType.mjs +4 -1
- package/cellTypes/checkboxType/accessors/index.js +5 -0
- package/cellTypes/checkboxType/accessors/index.mjs +1 -0
- package/cellTypes/checkboxType/accessors/valueSetter.js +26 -0
- package/cellTypes/checkboxType/accessors/valueSetter.mjs +22 -0
- package/cellTypes/checkboxType/checkboxType.js +3 -1
- package/cellTypes/checkboxType/checkboxType.mjs +3 -1
- package/cellTypes/dropdownType/accessors/index.js +7 -0
- package/cellTypes/dropdownType/accessors/index.mjs +2 -0
- package/cellTypes/dropdownType/accessors/valueGetter.js +14 -0
- package/cellTypes/dropdownType/accessors/valueGetter.mjs +10 -0
- package/cellTypes/dropdownType/accessors/valueSetter.js +17 -0
- package/cellTypes/dropdownType/accessors/valueSetter.mjs +13 -0
- package/cellTypes/dropdownType/dropdownType.js +4 -1
- package/cellTypes/dropdownType/dropdownType.mjs +4 -1
- package/cellTypes/numericType/accessors/index.js +5 -0
- package/cellTypes/numericType/accessors/index.mjs +1 -0
- package/cellTypes/numericType/accessors/valueSetter.js +19 -0
- package/cellTypes/numericType/accessors/valueSetter.mjs +15 -0
- package/cellTypes/numericType/numericType.js +3 -1
- package/cellTypes/numericType/numericType.mjs +3 -1
- package/core/focusCatcher/index.js +37 -112
- package/core/focusCatcher/index.mjs +35 -110
- package/core/focusCatcher/utils.js +31 -0
- package/core/focusCatcher/utils.mjs +27 -0
- package/core/hooks/constants.js +242 -0
- package/core/hooks/constants.mjs +242 -0
- package/core/hooks/index.d.ts +22 -0
- package/core/viewportScroll/scrollStrategies/focusScroll.js +5 -1
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +5 -1
- package/core/viewportScroll/utils.js +1 -1
- package/core/viewportScroll/utils.mjs +1 -1
- package/core.d.ts +4 -0
- package/core.js +237 -139
- package/core.mjs +240 -142
- package/dataMap/dataMap.js +13 -3
- package/dataMap/dataMap.mjs +14 -4
- package/dataMap/dataSource.js +16 -0
- package/dataMap/dataSource.mjs +16 -0
- package/dataMap/metaManager/lazyFactoryMap.js +4 -3
- package/dataMap/metaManager/lazyFactoryMap.mjs +2 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +3 -2
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +3 -2
- package/dataMap/metaManager/metaSchema.js +289 -4
- package/dataMap/metaManager/metaSchema.mjs +289 -4
- package/dataMap/metaManager/utils.js +0 -11
- package/dataMap/metaManager/utils.mjs +0 -10
- package/dataMap/replaceData.js +1 -0
- package/dataMap/replaceData.mjs +1 -0
- package/dist/handsontable.css +281 -4
- package/dist/handsontable.full.css +281 -4
- package/dist/handsontable.full.js +7844 -2990
- package/dist/handsontable.full.min.css +4 -5
- package/dist/handsontable.full.min.js +167 -165
- package/dist/handsontable.js +9639 -4806
- package/dist/handsontable.min.css +4 -4
- package/dist/handsontable.min.js +52 -50
- package/dist/languages/all.js +231 -21
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.js +11 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.js +11 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.js +11 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.js +11 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.js +11 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.js +11 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fa-IR.js +11 -1
- package/dist/languages/fa-IR.min.js +1 -1
- package/dist/languages/fr-FR.js +11 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.js +11 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.js +11 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.js +11 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.js +11 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.js +11 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.js +11 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.js +11 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.js +11 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.js +11 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.js +11 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.js +11 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.js +11 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.js +11 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +4 -4
- package/editorManager.mjs +4 -4
- package/editors/autocompleteEditor/autocompleteEditor.js +50 -112
- package/editors/autocompleteEditor/autocompleteEditor.mjs +51 -113
- package/editors/baseEditor/baseEditor.js +10 -6
- package/editors/baseEditor/baseEditor.mjs +10 -6
- package/editors/handsontableEditor/handsontableEditor.js +9 -9
- package/editors/handsontableEditor/handsontableEditor.mjs +9 -9
- package/editors/textEditor/textEditor.js +0 -7
- package/editors/textEditor/textEditor.mjs +0 -7
- package/focusManager.js +2 -2
- package/focusManager.mjs +2 -2
- package/helpers/a11y.js +15 -2
- package/helpers/a11y.mjs +10 -2
- package/helpers/console.js +12 -0
- package/helpers/console.mjs +11 -0
- package/helpers/dom/element.js +4 -4
- package/helpers/dom/element.mjs +4 -4
- package/helpers/mixed.js +65 -2
- package/helpers/mixed.mjs +63 -2
- package/helpers/number.js +28 -0
- package/helpers/number.mjs +26 -0
- package/helpers/object.js +35 -0
- package/helpers/object.mjs +34 -0
- package/helpers/string.js +19 -0
- package/helpers/string.mjs +18 -0
- package/helpers/templateLiteralTag.js +57 -1
- package/helpers/templateLiteralTag.mjs +56 -1
- package/i18n/constants.js +13 -1
- package/i18n/constants.mjs +13 -1
- package/i18n/languages/ar-AR.js +11 -1
- package/i18n/languages/ar-AR.mjs +11 -1
- package/i18n/languages/cs-CZ.js +11 -1
- package/i18n/languages/cs-CZ.mjs +11 -1
- package/i18n/languages/de-CH.js +11 -1
- package/i18n/languages/de-CH.mjs +11 -1
- package/i18n/languages/de-DE.js +11 -1
- package/i18n/languages/de-DE.mjs +11 -1
- package/i18n/languages/en-US.js +11 -1
- package/i18n/languages/en-US.mjs +11 -1
- package/i18n/languages/es-MX.js +11 -1
- package/i18n/languages/es-MX.mjs +11 -1
- package/i18n/languages/fa-IR.js +11 -1
- package/i18n/languages/fa-IR.mjs +11 -1
- package/i18n/languages/fr-FR.js +11 -1
- package/i18n/languages/fr-FR.mjs +11 -1
- package/i18n/languages/hr-HR.js +11 -1
- package/i18n/languages/hr-HR.mjs +11 -1
- package/i18n/languages/it-IT.js +11 -1
- package/i18n/languages/it-IT.mjs +11 -1
- package/i18n/languages/ja-JP.js +11 -1
- package/i18n/languages/ja-JP.mjs +11 -1
- package/i18n/languages/ko-KR.js +11 -1
- package/i18n/languages/ko-KR.mjs +11 -1
- package/i18n/languages/lv-LV.js +11 -1
- package/i18n/languages/lv-LV.mjs +11 -1
- package/i18n/languages/nb-NO.js +11 -1
- package/i18n/languages/nb-NO.mjs +11 -1
- package/i18n/languages/nl-NL.js +11 -1
- package/i18n/languages/nl-NL.mjs +11 -1
- package/i18n/languages/pl-PL.js +11 -1
- package/i18n/languages/pl-PL.mjs +11 -1
- package/i18n/languages/pt-BR.js +11 -1
- package/i18n/languages/pt-BR.mjs +11 -1
- package/i18n/languages/ru-RU.js +11 -1
- package/i18n/languages/ru-RU.mjs +11 -1
- package/i18n/languages/sr-SP.js +11 -1
- package/i18n/languages/sr-SP.mjs +11 -1
- package/i18n/languages/zh-CN.js +11 -1
- package/i18n/languages/zh-CN.mjs +11 -1
- package/i18n/languages/zh-TW.js +11 -1
- package/i18n/languages/zh-TW.mjs +11 -1
- package/i18n/phraseFormatters/index.js +3 -1
- package/i18n/phraseFormatters/index.mjs +3 -1
- package/i18n/registry.js +5 -6
- package/i18n/registry.mjs +5 -6
- package/index.d.ts +27 -0
- package/languages/all.js +231 -21
- package/languages/ar-AR.js +11 -1
- package/languages/ar-AR.mjs +11 -1
- package/languages/cs-CZ.js +11 -1
- package/languages/cs-CZ.mjs +11 -1
- package/languages/de-CH.js +11 -1
- package/languages/de-CH.mjs +11 -1
- package/languages/de-DE.js +11 -1
- package/languages/de-DE.mjs +11 -1
- package/languages/en-US.js +11 -1
- package/languages/en-US.mjs +11 -1
- package/languages/es-MX.js +11 -1
- package/languages/es-MX.mjs +11 -1
- package/languages/fa-IR.js +11 -1
- package/languages/fa-IR.mjs +11 -1
- package/languages/fr-FR.js +11 -1
- package/languages/fr-FR.mjs +11 -1
- package/languages/hr-HR.js +11 -1
- package/languages/hr-HR.mjs +11 -1
- package/languages/index.js +231 -21
- package/languages/it-IT.js +11 -1
- package/languages/it-IT.mjs +11 -1
- package/languages/ja-JP.js +11 -1
- package/languages/ja-JP.mjs +11 -1
- package/languages/ko-KR.js +11 -1
- package/languages/ko-KR.mjs +11 -1
- package/languages/lv-LV.js +11 -1
- package/languages/lv-LV.mjs +11 -1
- package/languages/nb-NO.js +11 -1
- package/languages/nb-NO.mjs +11 -1
- package/languages/nl-NL.js +11 -1
- package/languages/nl-NL.mjs +11 -1
- package/languages/pl-PL.js +11 -1
- package/languages/pl-PL.mjs +11 -1
- package/languages/pt-BR.js +11 -1
- package/languages/pt-BR.mjs +11 -1
- package/languages/ru-RU.js +11 -1
- package/languages/ru-RU.mjs +11 -1
- package/languages/sr-SP.js +11 -1
- package/languages/sr-SP.mjs +11 -1
- package/languages/zh-CN.js +11 -1
- package/languages/zh-CN.mjs +11 -1
- package/languages/zh-TW.js +11 -1
- package/languages/zh-TW.mjs +11 -1
- package/mixins/localHooks.js +16 -0
- package/mixins/localHooks.mjs +16 -0
- package/package.json +19 -1
- package/plugins/autoRowSize/autoRowSize.js +43 -6
- package/plugins/autoRowSize/autoRowSize.mjs +43 -6
- package/plugins/autofill/autofill.js +50 -3
- package/plugins/autofill/autofill.mjs +50 -3
- package/plugins/base/base.js +86 -15
- package/plugins/base/base.mjs +87 -16
- package/plugins/collapsibleColumns/collapsibleColumns.js +4 -4
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +4 -4
- package/plugins/columnSorting/columnSorting.js +3 -3
- package/plugins/columnSorting/columnSorting.mjs +3 -3
- package/plugins/comments/comments.js +52 -22
- package/plugins/comments/comments.mjs +52 -22
- package/plugins/comments/contextMenuItem/addEditComment.js +3 -3
- package/plugins/comments/contextMenuItem/addEditComment.mjs +3 -3
- package/plugins/comments/contextMenuItem/readOnlyComment.js +2 -2
- package/plugins/comments/contextMenuItem/readOnlyComment.mjs +2 -2
- package/plugins/comments/contextMenuItem/removeComment.js +2 -2
- package/plugins/comments/contextMenuItem/removeComment.mjs +2 -2
- package/plugins/contextMenu/contextMenu.js +4 -5
- package/plugins/contextMenu/contextMenu.mjs +4 -5
- package/plugins/contextMenu/menu/cursor.js +1 -1
- package/plugins/contextMenu/menu/cursor.mjs +1 -1
- package/plugins/contextMenu/menu/defaultShortcutsList.js +5 -5
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +5 -5
- package/plugins/contextMenu/menu/menu.js +3 -3
- package/plugins/contextMenu/menu/menu.mjs +3 -3
- package/plugins/contextMenu/menu/positioner.js +1 -1
- package/plugins/contextMenu/menu/positioner.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/alignment.js +1 -1
- package/plugins/contextMenu/predefinedItems/alignment.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/clearColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/clearColumn.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/columnLeft.js +3 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/columnRight.js +3 -3
- package/plugins/contextMenu/predefinedItems/columnRight.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/readOnly.js +1 -1
- package/plugins/contextMenu/predefinedItems/readOnly.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/rowAbove.js +3 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.js +3 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/copy.js +1 -1
- package/plugins/copyPaste/contextMenuItem/copy.mjs +1 -1
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +3 -3
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/cut.js +1 -1
- package/plugins/copyPaste/contextMenuItem/cut.mjs +1 -1
- package/plugins/copyPaste/copyPaste.js +75 -40
- package/plugins/copyPaste/copyPaste.mjs +76 -41
- package/plugins/customBorders/customBorders.js +1 -1
- package/plugins/customBorders/customBorders.mjs +1 -1
- package/plugins/dialog/dialog.d.ts +23 -0
- package/plugins/dialog/dialog.js +489 -0
- package/plugins/dialog/dialog.mjs +485 -0
- package/plugins/dialog/index.d.ts +1 -0
- package/plugins/dialog/index.js +7 -0
- package/plugins/dialog/index.mjs +1 -0
- package/plugins/dialog/ui.js +264 -0
- package/plugins/dialog/ui.mjs +259 -0
- package/plugins/dropdownMenu/dropdownMenu.js +5 -4
- package/plugins/dropdownMenu/dropdownMenu.mjs +5 -4
- package/plugins/filters/filters.js +2 -2
- package/plugins/filters/filters.mjs +2 -2
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +3 -3
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs +3 -3
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +4 -4
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +4 -4
- package/plugins/hiddenRows/contextMenuItem/hideRow.js +3 -3
- package/plugins/hiddenRows/contextMenuItem/hideRow.mjs +3 -3
- package/plugins/hiddenRows/contextMenuItem/showRow.js +4 -4
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +4 -4
- package/plugins/index.d.ts +9 -0
- package/plugins/index.js +9 -0
- package/plugins/index.mjs +7 -1
- package/plugins/loading/content.js +36 -0
- package/plugins/loading/content.mjs +31 -0
- package/plugins/loading/index.d.ts +1 -0
- package/plugins/loading/index.js +7 -0
- package/plugins/loading/index.mjs +1 -0
- package/plugins/loading/loading.d.ts +19 -0
- package/plugins/loading/loading.js +292 -0
- package/plugins/loading/loading.mjs +287 -0
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
- package/plugins/manualColumnMove/manualColumnMove.js +3 -3
- package/plugins/manualColumnMove/manualColumnMove.mjs +3 -3
- package/plugins/manualColumnResize/manualColumnResize.js +3 -3
- package/plugins/manualColumnResize/manualColumnResize.mjs +3 -3
- package/plugins/manualRowMove/manualRowMove.js +4 -4
- package/plugins/manualRowMove/manualRowMove.mjs +4 -4
- package/plugins/manualRowResize/manualRowResize.js +5 -2
- package/plugins/manualRowResize/manualRowResize.mjs +5 -2
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +15 -15
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +15 -15
- package/plugins/mergeCells/focusOrder.js +75 -39
- package/plugins/mergeCells/focusOrder.mjs +75 -39
- package/plugins/mergeCells/mergeCells.js +26 -19
- package/plugins/mergeCells/mergeCells.mjs +26 -19
- package/plugins/mergeCells/renderer.js +14 -8
- package/plugins/mergeCells/renderer.mjs +14 -8
- package/plugins/multiColumnSorting/multiColumnSorting.js +3 -3
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +3 -3
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +3 -3
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +3 -3
- package/plugins/nestedHeaders/nestedHeaders.js +47 -41
- package/plugins/nestedHeaders/nestedHeaders.mjs +47 -41
- package/plugins/nestedRows/nestedRows.js +3 -3
- package/plugins/nestedRows/nestedRows.mjs +3 -3
- package/plugins/nestedRows/ui/collapsing.js +1 -2
- package/plugins/nestedRows/ui/collapsing.mjs +1 -2
- package/plugins/nestedRows/ui/contextMenu.js +4 -4
- package/plugins/nestedRows/ui/contextMenu.mjs +4 -4
- package/plugins/nestedRows/ui/headers.js +4 -1
- package/plugins/nestedRows/ui/headers.mjs +4 -1
- package/plugins/pagination/focusController.js +27 -0
- package/plugins/pagination/focusController.mjs +23 -0
- package/plugins/pagination/index.d.ts +1 -0
- package/plugins/pagination/index.js +7 -0
- package/plugins/pagination/index.mjs +1 -0
- package/plugins/pagination/pagination.d.ts +52 -0
- package/plugins/pagination/pagination.js +1034 -0
- package/plugins/pagination/pagination.mjs +1030 -0
- package/plugins/pagination/strategies/autoPageSize.js +96 -0
- package/plugins/pagination/strategies/autoPageSize.mjs +92 -0
- package/plugins/pagination/strategies/fixedPageSize.js +88 -0
- package/plugins/pagination/strategies/fixedPageSize.mjs +84 -0
- package/plugins/pagination/strategies/index.js +22 -0
- package/plugins/pagination/strategies/index.mjs +18 -0
- package/plugins/pagination/ui.js +449 -0
- package/plugins/pagination/ui.mjs +443 -0
- package/plugins/pagination/utils.js +28 -0
- package/plugins/pagination/utils.mjs +24 -0
- package/plugins/stretchColumns/calculator.js +4 -0
- package/plugins/stretchColumns/calculator.mjs +4 -0
- package/plugins/stretchColumns/stretchColumns.js +1 -1
- package/plugins/stretchColumns/stretchColumns.mjs +1 -1
- package/plugins/undoRedo/actions/dataChange.js +17 -15
- package/plugins/undoRedo/actions/dataChange.mjs +17 -15
- package/renderers/checkboxRenderer/checkboxRenderer.js +3 -3
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +3 -3
- package/selection/range.js +11 -0
- package/selection/range.mjs +11 -0
- package/selection/selection.js +163 -124
- package/selection/selection.mjs +163 -124
- package/selection/transformation/_base.js +448 -0
- package/selection/transformation/_base.mjs +443 -0
- package/selection/transformation/extender.js +55 -0
- package/selection/transformation/extender.mjs +51 -0
- package/selection/transformation/focus.js +77 -0
- package/selection/transformation/focus.mjs +73 -0
- package/selection/transformation/index.js +7 -0
- package/selection/transformation/index.mjs +2 -0
- package/selection/utils.js +2 -1
- package/selection/utils.mjs +2 -1
- package/settings.d.ts +10 -1
- package/shortcutContexts/commands/editor/fastOpen.js +1 -1
- package/shortcutContexts/commands/editor/fastOpen.mjs +1 -1
- package/shortcutContexts/commands/editor/open.js +10 -4
- package/shortcutContexts/commands/editor/open.mjs +10 -4
- package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +2 -2
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +2 -2
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +2 -2
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +5 -2
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +5 -2
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +5 -2
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +5 -2
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +2 -2
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/scrollToFocusedCell.js +1 -1
- package/shortcutContexts/commands/scrollToFocusedCell.mjs +1 -1
- package/shortcutContexts/grid.js +3 -3
- package/shortcutContexts/grid.mjs +3 -3
- package/shortcuts/context.js +4 -1
- package/shortcuts/context.mjs +4 -1
- package/shortcuts/manager.js +17 -3
- package/shortcuts/manager.mjs +17 -3
- package/styles/handsontable.css +288 -22
- package/styles/handsontable.min.css +3 -3
- package/styles/ht-theme-classic.css +828 -0
- package/styles/ht-theme-classic.min.css +30 -0
- package/styles/ht-theme-horizon.css +122 -26
- package/styles/ht-theme-horizon.min.css +3 -3
- package/styles/ht-theme-main.css +124 -28
- package/styles/ht-theme-main.min.css +3 -3
- package/tableView.js +61 -25
- package/tableView.mjs +61 -25
- package/utils/a11yAnnouncer.js +70 -0
- package/utils/a11yAnnouncer.mjs +64 -0
- package/{core/focusCatcher → utils}/focusDetector.js +30 -12
- package/{core/focusCatcher → utils}/focusDetector.mjs +30 -12
- package/utils/samplesGenerator.js +17 -1
- package/utils/samplesGenerator.mjs +17 -1
- package/utils/stylesHandler.js +23 -8
- package/utils/stylesHandler.mjs +23 -8
- package/utils/valueAccessors.js +45 -0
- package/utils/valueAccessors.mjs +40 -0
- package/validators/autocompleteValidator/autocompleteValidator.js +2 -1
- package/validators/autocompleteValidator/autocompleteValidator.mjs +2 -1
- package/selection/transformation.js +0 -335
- package/selection/transformation.mjs +0 -331
@@ -149,7 +149,7 @@ export function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellPro
|
|
149
149
|
},
|
150
150
|
runOnlyIf: () => {
|
151
151
|
var _hotInstance$getSelec;
|
152
|
-
return (_hotInstance$getSelec = hotInstance.
|
152
|
+
return (_hotInstance$getSelec = hotInstance.getSelectedRangeActive()) === null || _hotInstance$getSelec === void 0 ? void 0 : _hotInstance$getSelec.highlight.isCell();
|
153
153
|
}
|
154
154
|
}, {
|
155
155
|
keys: [['enter']],
|
@@ -158,7 +158,7 @@ export function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellPro
|
|
158
158
|
return !areSelectedCheckboxCells(); // False blocks next action associated with the keyboard shortcut.
|
159
159
|
},
|
160
160
|
runOnlyIf: () => {
|
161
|
-
const range = hotInstance.
|
161
|
+
const range = hotInstance.getSelectedRangeActive();
|
162
162
|
return hotInstance.getSettings().enterBeginsEditing && (range === null || range === void 0 ? void 0 : range.highlight.isCell()) && !hotInstance.selection.isMultiple();
|
163
163
|
}
|
164
164
|
}, {
|
@@ -169,7 +169,7 @@ export function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellPro
|
|
169
169
|
},
|
170
170
|
runOnlyIf: () => {
|
171
171
|
var _hotInstance$getSelec2;
|
172
|
-
return (_hotInstance$getSelec2 = hotInstance.
|
172
|
+
return (_hotInstance$getSelec2 = hotInstance.getSelectedRangeActive()) === null || _hotInstance$getSelec2 === void 0 ? void 0 : _hotInstance$getSelec2.highlight.isCell();
|
173
173
|
}
|
174
174
|
}], config);
|
175
175
|
}
|
package/selection/range.js
CHANGED
@@ -66,6 +66,17 @@ class SelectionRange {
|
|
66
66
|
return this;
|
67
67
|
}
|
68
68
|
|
69
|
+
/**
|
70
|
+
* Pushes a new CellRange instance to the collection.
|
71
|
+
*
|
72
|
+
* @param {CellRange} cellRange The CellRange instance with defined visual coordinates.
|
73
|
+
* @returns {SelectionRange}
|
74
|
+
*/
|
75
|
+
push(cellRange) {
|
76
|
+
this.ranges.push(cellRange);
|
77
|
+
return this;
|
78
|
+
}
|
79
|
+
|
69
80
|
/**
|
70
81
|
* Removes from the stack the last added coordinates.
|
71
82
|
*
|
package/selection/range.mjs
CHANGED
@@ -63,6 +63,17 @@ class SelectionRange {
|
|
63
63
|
return this;
|
64
64
|
}
|
65
65
|
|
66
|
+
/**
|
67
|
+
* Pushes a new CellRange instance to the collection.
|
68
|
+
*
|
69
|
+
* @param {CellRange} cellRange The CellRange instance with defined visual coordinates.
|
70
|
+
* @returns {SelectionRange}
|
71
|
+
*/
|
72
|
+
push(cellRange) {
|
73
|
+
this.ranges.push(cellRange);
|
74
|
+
return this;
|
75
|
+
}
|
76
|
+
|
66
77
|
/**
|
67
78
|
* Removes from the stack the last added coordinates.
|
68
79
|
*
|
package/selection/selection.js
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
require("core-js/modules/es.error.cause.js");
|
5
|
+
require("core-js/modules/es.array.push.js");
|
5
6
|
require("core-js/modules/es.set.difference.v2.js");
|
6
7
|
require("core-js/modules/es.set.intersection.v2.js");
|
7
8
|
require("core-js/modules/es.set.is-disjoint-from.v2.js");
|
@@ -20,7 +21,7 @@ var _mixed = require("./../helpers/mixed");
|
|
20
21
|
var _number = require("./../helpers/number");
|
21
22
|
var _array = require("./../helpers/array");
|
22
23
|
var _localHooks = _interopRequireDefault(require("./../mixins/localHooks"));
|
23
|
-
var
|
24
|
+
var _transformation = require("./transformation");
|
24
25
|
var _utils = require("./utils");
|
25
26
|
var _templateLiteralTag = require("./../helpers/templateLiteralTag");
|
26
27
|
var _a11y = require("../helpers/a11y");
|
@@ -34,16 +35,26 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
34
35
|
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
35
36
|
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
36
37
|
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"); }
|
38
|
+
/**
|
39
|
+
* @typedef {object} SelectionState
|
40
|
+
* @property {CellRange[]} ranges The array of all ranges.
|
41
|
+
* @property {CellRange} activeRange The active range.
|
42
|
+
* @property {number} activeSelectionLayer The active selection layer.
|
43
|
+
* @property {number[]} selectedByRowHeader The state of the selected row headers.
|
44
|
+
* @property {number[]} selectedByColumnHeader The state of the selected column headers.
|
45
|
+
* @property {boolean} disableHeadersHighlight The state of the disable headers highlight.
|
46
|
+
*/
|
37
47
|
/**
|
38
48
|
* @class Selection
|
39
49
|
* @util
|
40
50
|
*/
|
41
|
-
var
|
51
|
+
var _extenderTransformation = /*#__PURE__*/new WeakMap();
|
42
52
|
var _focusTransformation = /*#__PURE__*/new WeakMap();
|
43
53
|
var _isFocusSelectionChanged = /*#__PURE__*/new WeakMap();
|
44
54
|
var _disableHeadersHighlight = /*#__PURE__*/new WeakMap();
|
45
55
|
var _selectionSource = /*#__PURE__*/new WeakMap();
|
46
56
|
var _expectedLayersCount = /*#__PURE__*/new WeakMap();
|
57
|
+
var _activeSelectionLayer = /*#__PURE__*/new WeakMap();
|
47
58
|
class Selection {
|
48
59
|
constructor(settings, tableProps) {
|
49
60
|
var _this = this;
|
@@ -82,13 +93,13 @@ class Selection {
|
|
82
93
|
/**
|
83
94
|
* The module for modifying coordinates of the start and end selection.
|
84
95
|
*
|
85
|
-
* @type {
|
96
|
+
* @type {ExtenderTransformation}
|
86
97
|
*/
|
87
|
-
_classPrivateFieldInitSpec(this,
|
98
|
+
_classPrivateFieldInitSpec(this, _extenderTransformation, void 0);
|
88
99
|
/**
|
89
100
|
* The module for modifying coordinates of the focus selection.
|
90
101
|
*
|
91
|
-
* @type {
|
102
|
+
* @type {FocusTransformation}
|
92
103
|
*/
|
93
104
|
_classPrivateFieldInitSpec(this, _focusTransformation, void 0);
|
94
105
|
/**
|
@@ -130,6 +141,13 @@ class Selection {
|
|
130
141
|
* @param {number}
|
131
142
|
*/
|
132
143
|
_classPrivateFieldInitSpec(this, _expectedLayersCount, -1);
|
144
|
+
/**
|
145
|
+
* The index of the active range layer. Active range layer is the layer that has visible focus highlight.
|
146
|
+
* Focus highlight may jump between selection range layers.
|
147
|
+
*
|
148
|
+
* @type {number}
|
149
|
+
*/
|
150
|
+
_classPrivateFieldInitSpec(this, _activeSelectionLayer, 0);
|
133
151
|
this.settings = settings;
|
134
152
|
this.tableProps = tableProps;
|
135
153
|
this.highlight = new _highlight.default({
|
@@ -152,95 +170,67 @@ class Selection {
|
|
152
170
|
createCellCoords: (row, column) => this.tableProps.createCellCoords(row, column),
|
153
171
|
createCellRange: (highlight, from, to) => this.tableProps.createCellRange(highlight, from, to)
|
154
172
|
});
|
155
|
-
_classPrivateFieldSet(
|
156
|
-
|
157
|
-
|
158
|
-
countRenderableRows: () => this.tableProps.countRenderableRows(),
|
159
|
-
countRenderableColumns: () => this.tableProps.countRenderableColumns(),
|
160
|
-
visualToRenderableCoords: coords => this.tableProps.visualToRenderableCoords(coords),
|
161
|
-
renderableToVisualCoords: coords => this.tableProps.renderableToVisualCoords(coords),
|
162
|
-
findFirstNonHiddenRenderableRow: function () {
|
163
|
-
return _this.tableProps.findFirstNonHiddenRenderableRow(...arguments);
|
164
|
-
},
|
165
|
-
findFirstNonHiddenRenderableColumn: function () {
|
166
|
-
return _this.tableProps.findFirstNonHiddenRenderableColumn(...arguments);
|
167
|
-
},
|
168
|
-
createCellCoords: (row, column) => this.tableProps.createCellCoords(row, column),
|
173
|
+
_classPrivateFieldSet(_extenderTransformation, this, new _transformation.ExtenderTransformation(this.selectedRange, {
|
174
|
+
...this.tableProps,
|
175
|
+
navigableHeaders: () => settings.navigableHeaders,
|
169
176
|
fixedRowsBottom: () => settings.fixedRowsBottom,
|
170
177
|
minSpareRows: () => settings.minSpareRows,
|
171
178
|
minSpareCols: () => settings.minSpareCols,
|
172
179
|
autoWrapRow: () => settings.autoWrapRow,
|
173
180
|
autoWrapCol: () => settings.autoWrapCol
|
174
181
|
}));
|
175
|
-
_classPrivateFieldSet(_focusTransformation, this, new
|
176
|
-
|
177
|
-
|
178
|
-
countRenderableRows: () => {
|
179
|
-
const range = this.selectedRange.current();
|
180
|
-
return this.tableProps.countRenderableRowsInRange(0, range.getOuterBottomEndCorner().row);
|
181
|
-
},
|
182
|
-
countRenderableColumns: () => {
|
183
|
-
const range = this.selectedRange.current();
|
184
|
-
return this.tableProps.countRenderableColumnsInRange(0, range.getOuterBottomEndCorner().col);
|
185
|
-
},
|
186
|
-
visualToRenderableCoords: coords => this.tableProps.visualToRenderableCoords(coords),
|
187
|
-
renderableToVisualCoords: coords => this.tableProps.renderableToVisualCoords(coords),
|
188
|
-
findFirstNonHiddenRenderableRow: function () {
|
189
|
-
return _this.tableProps.findFirstNonHiddenRenderableRow(...arguments);
|
190
|
-
},
|
191
|
-
findFirstNonHiddenRenderableColumn: function () {
|
192
|
-
return _this.tableProps.findFirstNonHiddenRenderableColumn(...arguments);
|
193
|
-
},
|
194
|
-
createCellCoords: (row, column) => this.tableProps.createCellCoords(row, column),
|
182
|
+
_classPrivateFieldSet(_focusTransformation, this, new _transformation.FocusTransformation(this.selectedRange, {
|
183
|
+
...this.tableProps,
|
184
|
+
navigableHeaders: () => settings.navigableHeaders,
|
195
185
|
fixedRowsBottom: () => 0,
|
196
186
|
minSpareRows: () => 0,
|
197
187
|
minSpareCols: () => 0,
|
198
188
|
autoWrapRow: () => true,
|
199
189
|
autoWrapCol: () => true
|
200
190
|
}));
|
201
|
-
_classPrivateFieldGet(
|
191
|
+
_classPrivateFieldGet(_extenderTransformation, this).addLocalHook('beforeTransformStart', function () {
|
202
192
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
203
193
|
args[_key] = arguments[_key];
|
204
194
|
}
|
205
195
|
return _this.runLocalHooks('beforeModifyTransformStart', ...args);
|
206
196
|
});
|
207
|
-
_classPrivateFieldGet(
|
197
|
+
_classPrivateFieldGet(_extenderTransformation, this).addLocalHook('afterTransformStart', function () {
|
208
198
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
209
199
|
args[_key2] = arguments[_key2];
|
210
200
|
}
|
211
201
|
return _this.runLocalHooks('afterModifyTransformStart', ...args);
|
212
202
|
});
|
213
|
-
_classPrivateFieldGet(
|
203
|
+
_classPrivateFieldGet(_extenderTransformation, this).addLocalHook('beforeTransformEnd', function () {
|
214
204
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
215
205
|
args[_key3] = arguments[_key3];
|
216
206
|
}
|
217
207
|
return _this.runLocalHooks('beforeModifyTransformEnd', ...args);
|
218
208
|
});
|
219
|
-
_classPrivateFieldGet(
|
209
|
+
_classPrivateFieldGet(_extenderTransformation, this).addLocalHook('afterTransformEnd', function () {
|
220
210
|
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
221
211
|
args[_key4] = arguments[_key4];
|
222
212
|
}
|
223
213
|
return _this.runLocalHooks('afterModifyTransformEnd', ...args);
|
224
214
|
});
|
225
|
-
_classPrivateFieldGet(
|
215
|
+
_classPrivateFieldGet(_extenderTransformation, this).addLocalHook('insertRowRequire', function () {
|
226
216
|
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
227
217
|
args[_key5] = arguments[_key5];
|
228
218
|
}
|
229
219
|
return _this.runLocalHooks('insertRowRequire', ...args);
|
230
220
|
});
|
231
|
-
_classPrivateFieldGet(
|
221
|
+
_classPrivateFieldGet(_extenderTransformation, this).addLocalHook('insertColRequire', function () {
|
232
222
|
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
233
223
|
args[_key6] = arguments[_key6];
|
234
224
|
}
|
235
225
|
return _this.runLocalHooks('insertColRequire', ...args);
|
236
226
|
});
|
237
|
-
_classPrivateFieldGet(
|
227
|
+
_classPrivateFieldGet(_extenderTransformation, this).addLocalHook('beforeRowWrap', function () {
|
238
228
|
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
239
229
|
args[_key7] = arguments[_key7];
|
240
230
|
}
|
241
231
|
return _this.runLocalHooks('beforeRowWrap', ...args);
|
242
232
|
});
|
243
|
-
_classPrivateFieldGet(
|
233
|
+
_classPrivateFieldGet(_extenderTransformation, this).addLocalHook('beforeColumnWrap', function () {
|
244
234
|
for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
|
245
235
|
args[_key8] = arguments[_key8];
|
246
236
|
}
|
@@ -261,7 +251,7 @@ class Selection {
|
|
261
251
|
}
|
262
252
|
|
263
253
|
/**
|
264
|
-
*
|
254
|
+
* Gets all selection range layers of the selection.
|
265
255
|
*
|
266
256
|
* @returns {SelectionRange}
|
267
257
|
*/
|
@@ -269,6 +259,33 @@ class Selection {
|
|
269
259
|
return this.selectedRange;
|
270
260
|
}
|
271
261
|
|
262
|
+
/**
|
263
|
+
* Gets the active selection range layer.
|
264
|
+
*
|
265
|
+
* @returns {CellRange}
|
266
|
+
*/
|
267
|
+
getActiveSelectedRange() {
|
268
|
+
return this.selectedRange.peekByIndex(_classPrivateFieldGet(_activeSelectionLayer, this));
|
269
|
+
}
|
270
|
+
|
271
|
+
/**
|
272
|
+
* Gets the index of the active selection range layer.
|
273
|
+
*
|
274
|
+
* @returns {number}
|
275
|
+
*/
|
276
|
+
getActiveSelectionLayerIndex() {
|
277
|
+
return _classPrivateFieldGet(_activeSelectionLayer, this);
|
278
|
+
}
|
279
|
+
|
280
|
+
/**
|
281
|
+
* Sets the index of the active selection range layer.
|
282
|
+
*
|
283
|
+
* @param {number} layerIndex The index of the active selection range layer.
|
284
|
+
*/
|
285
|
+
setActiveSelectionLayerIndex(layerIndex) {
|
286
|
+
_classPrivateFieldSet(_activeSelectionLayer, this, layerIndex);
|
287
|
+
}
|
288
|
+
|
272
289
|
/**
|
273
290
|
* Marks the source of the selection. It can be one of the following values: `mouse`, or any other string.
|
274
291
|
*
|
@@ -348,10 +365,20 @@ class Selection {
|
|
348
365
|
// We are creating copy. We would like to modify just the start of the selection by below hook. Then original coords
|
349
366
|
// should be handled by next methods.
|
350
367
|
const coordsClone = coords.clone();
|
368
|
+
_classPrivateFieldSet(_disableHeadersHighlight, this, false);
|
351
369
|
_classPrivateFieldSet(_isFocusSelectionChanged, this, false);
|
352
370
|
this.runLocalHooks(`beforeSetRangeStart${fragment ? 'Only' : ''}`, coordsClone);
|
353
371
|
if (!isMultipleMode || isMultipleMode && !isMultipleSelection && (0, _mixed.isUndefined)(multipleSelection)) {
|
354
372
|
this.selectedRange.clear();
|
373
|
+
(0, _array.arrayEach)(this.highlight.getAreas(), highlight => void highlight.clear());
|
374
|
+
(0, _array.arrayEach)(this.highlight.getLayeredAreas(), highlight => void highlight.clear());
|
375
|
+
(0, _array.arrayEach)(this.highlight.getRowHeaders(), highlight => void highlight.clear());
|
376
|
+
(0, _array.arrayEach)(this.highlight.getColumnHeaders(), highlight => void highlight.clear());
|
377
|
+
(0, _array.arrayEach)(this.highlight.getActiveRowHeaders(), highlight => void highlight.clear());
|
378
|
+
(0, _array.arrayEach)(this.highlight.getActiveColumnHeaders(), highlight => void highlight.clear());
|
379
|
+
(0, _array.arrayEach)(this.highlight.getActiveCornerHeaders(), highlight => void highlight.clear());
|
380
|
+
(0, _array.arrayEach)(this.highlight.getRowHighlights(), highlight => void highlight.clear());
|
381
|
+
(0, _array.arrayEach)(this.highlight.getColumnHighlights(), highlight => void highlight.clear());
|
355
382
|
}
|
356
383
|
this.selectedRange.add(coordsClone).current().setHighlight(highlightCoords.clone());
|
357
384
|
if (this.getLayerLevel() === 0) {
|
@@ -381,15 +408,18 @@ class Selection {
|
|
381
408
|
* Ends selection range on given coordinate object.
|
382
409
|
*
|
383
410
|
* @param {CellCoords} coords Visual coords.
|
411
|
+
* @param {number} [layerIndex] The layer index to set the end on. If not provided, the current layer level is used.
|
384
412
|
*/
|
385
413
|
setRangeEnd(coords) {
|
414
|
+
let layerIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLayerLevel();
|
386
415
|
if (this.selectedRange.isEmpty()) {
|
387
416
|
return;
|
388
417
|
}
|
418
|
+
this.setActiveSelectionLayerIndex(layerIndex);
|
389
419
|
const coordsClone = coords.clone();
|
390
420
|
const countRows = this.tableProps.countRows();
|
391
421
|
const countCols = this.tableProps.countCols();
|
392
|
-
const isSingle = this.
|
422
|
+
const isSingle = this.getActiveSelectedRange().clone().setTo(coords).isSingleHeader();
|
393
423
|
|
394
424
|
// Ignore processing the end range when the header selection starts overlapping the corner and
|
395
425
|
// the selection is not a single header highlight.
|
@@ -398,7 +428,7 @@ class Selection {
|
|
398
428
|
}
|
399
429
|
this.runLocalHooks('beforeSetRangeEnd', coordsClone);
|
400
430
|
this.begin();
|
401
|
-
const cellRange = this.
|
431
|
+
const cellRange = this.getActiveSelectedRange();
|
402
432
|
if (!this.settings.navigableHeaders) {
|
403
433
|
cellRange.highlight.normalize();
|
404
434
|
}
|
@@ -429,8 +459,8 @@ class Selection {
|
|
429
459
|
}
|
430
460
|
}
|
431
461
|
this.runLocalHooks('beforeHighlightSet');
|
432
|
-
this.setRangeFocus(this.
|
433
|
-
this.applyAndCommit();
|
462
|
+
this.setRangeFocus(this.getActiveSelectedRange().highlight, layerIndex);
|
463
|
+
this.applyAndCommit(this.getActiveSelectedRange(), layerIndex);
|
434
464
|
const isLastLayer = _classPrivateFieldGet(_expectedLayersCount, this) === -1 || this.selectedRange.size() === _classPrivateFieldGet(_expectedLayersCount, this);
|
435
465
|
this.runLocalHooks('afterSetRangeEnd', coords, isLastLayer);
|
436
466
|
}
|
@@ -443,24 +473,10 @@ class Selection {
|
|
443
473
|
* @param {number} [layerLevel] The layer level to apply. If not provided, the current layer level is used.
|
444
474
|
*/
|
445
475
|
applyAndCommit() {
|
446
|
-
let cellRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.
|
476
|
+
let cellRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getActiveSelectedRange();
|
447
477
|
let layerLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLayerLevel();
|
448
478
|
const countRows = this.tableProps.countRows();
|
449
479
|
const countCols = this.tableProps.countCols();
|
450
|
-
|
451
|
-
// If the next layer level is lower than previous then clear all area and header highlights. This is the
|
452
|
-
// indication that the new selection is performing.
|
453
|
-
if (layerLevel < this.highlight.layerLevel) {
|
454
|
-
(0, _array.arrayEach)(this.highlight.getAreas(), highlight => void highlight.clear());
|
455
|
-
(0, _array.arrayEach)(this.highlight.getLayeredAreas(), highlight => void highlight.clear());
|
456
|
-
(0, _array.arrayEach)(this.highlight.getRowHeaders(), highlight => void highlight.clear());
|
457
|
-
(0, _array.arrayEach)(this.highlight.getColumnHeaders(), highlight => void highlight.clear());
|
458
|
-
(0, _array.arrayEach)(this.highlight.getActiveRowHeaders(), highlight => void highlight.clear());
|
459
|
-
(0, _array.arrayEach)(this.highlight.getActiveColumnHeaders(), highlight => void highlight.clear());
|
460
|
-
(0, _array.arrayEach)(this.highlight.getActiveCornerHeaders(), highlight => void highlight.clear());
|
461
|
-
(0, _array.arrayEach)(this.highlight.getRowHighlights(), highlight => void highlight.clear());
|
462
|
-
(0, _array.arrayEach)(this.highlight.getColumnHighlights(), highlight => void highlight.clear());
|
463
|
-
}
|
464
480
|
this.highlight.useLayerLevel(layerLevel);
|
465
481
|
const areaHighlight = this.highlight.createArea();
|
466
482
|
const layeredAreaHighlight = this.highlight.createLayeredArea();
|
@@ -487,7 +503,7 @@ class Selection {
|
|
487
503
|
// For single cell selection in the same layer, we do not create area selection to prevent blue background.
|
488
504
|
// When non-consecutive selection is performed we have to add that missing area selection to the previous layer
|
489
505
|
// based on previous coordinates. It only occurs when the previous selection wasn't select multiple cells.
|
490
|
-
const previousRange = this.selectedRange.
|
506
|
+
const previousRange = this.selectedRange.peekByIndex(layerLevel - 1);
|
491
507
|
this.highlight.useLayerLevel(layerLevel - 1);
|
492
508
|
this.highlight.createArea().add(previousRange.from).commit()
|
493
509
|
// Range may start with hidden indexes. Commit would not found start point (as we add just the `from` coords).
|
@@ -534,12 +550,17 @@ class Selection {
|
|
534
550
|
* Sets the selection focus position at the specified coordinates.
|
535
551
|
*
|
536
552
|
* @param {CellCoords} coords The CellCoords instance with defined visual coordinates.
|
553
|
+
* @param {number} [layerIndex] The layer index to set the focus on.
|
537
554
|
*/
|
538
555
|
setRangeFocus(coords) {
|
556
|
+
let layerIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLayerLevel();
|
539
557
|
if (this.selectedRange.isEmpty()) {
|
540
558
|
return;
|
541
559
|
}
|
542
|
-
|
560
|
+
this.setActiveSelectionLayerIndex(layerIndex);
|
561
|
+
_classPrivateFieldGet(_extenderTransformation, this).setActiveLayerIndex(layerIndex);
|
562
|
+
_classPrivateFieldGet(_focusTransformation, this).setActiveLayerIndex(layerIndex);
|
563
|
+
const cellRange = this.getActiveSelectedRange();
|
543
564
|
if (!this.inProgress) {
|
544
565
|
this.runLocalHooks('beforeSetFocus', coords);
|
545
566
|
}
|
@@ -568,15 +589,10 @@ class Selection {
|
|
568
589
|
*/
|
569
590
|
transformStart(rowDelta, colDelta) {
|
570
591
|
let createMissingRecords = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
});
|
576
|
-
} else {
|
577
|
-
_classPrivateFieldGet(_transformation, this).resetOffsetSize();
|
578
|
-
}
|
579
|
-
this.setRangeStart(_classPrivateFieldGet(_transformation, this).transformStart(rowDelta, colDelta, createMissingRecords));
|
592
|
+
const {
|
593
|
+
visualCoords
|
594
|
+
} = _classPrivateFieldGet(_extenderTransformation, this).transformStart(rowDelta, colDelta, createMissingRecords);
|
595
|
+
this.setRangeStart(visualCoords);
|
580
596
|
}
|
581
597
|
|
582
598
|
/**
|
@@ -586,15 +602,11 @@ class Selection {
|
|
586
602
|
* @param {number} colDelta Columns number to move, value can be passed as negative number.
|
587
603
|
*/
|
588
604
|
transformEnd(rowDelta, colDelta) {
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
} else {
|
595
|
-
_classPrivateFieldGet(_transformation, this).resetOffsetSize();
|
596
|
-
}
|
597
|
-
this.setRangeEnd(_classPrivateFieldGet(_transformation, this).transformEnd(rowDelta, colDelta));
|
605
|
+
const {
|
606
|
+
visualCoords,
|
607
|
+
selectionLayer
|
608
|
+
} = _classPrivateFieldGet(_extenderTransformation, this).transformEnd(rowDelta, colDelta);
|
609
|
+
this.setRangeEnd(visualCoords, selectionLayer);
|
598
610
|
}
|
599
611
|
|
600
612
|
/**
|
@@ -604,28 +616,11 @@ class Selection {
|
|
604
616
|
* @param {number} colDelta Columns number to move, value can be passed as negative number.
|
605
617
|
*/
|
606
618
|
transformFocus(rowDelta, colDelta) {
|
607
|
-
const range = this.selectedRange.current();
|
608
619
|
const {
|
609
|
-
|
610
|
-
|
611
|
-
} =
|
612
|
-
|
613
|
-
const rowsInRange = this.tableProps.countRenderableRowsInRange(0, row - 1);
|
614
|
-
if (range.highlight.isHeader()) {
|
615
|
-
// for header focus selection calculate the new coords based on the selection including headers
|
616
|
-
_classPrivateFieldGet(_focusTransformation, this).setOffsetSize({
|
617
|
-
x: col < 0 ? Math.abs(col) : -columnsInRange,
|
618
|
-
y: row < 0 ? Math.abs(row) : -rowsInRange
|
619
|
-
});
|
620
|
-
} else {
|
621
|
-
// for focus selection in cells calculate the new coords only based on the selected cells
|
622
|
-
_classPrivateFieldGet(_focusTransformation, this).setOffsetSize({
|
623
|
-
x: col < 0 ? 0 : -columnsInRange,
|
624
|
-
y: row < 0 ? 0 : -rowsInRange
|
625
|
-
});
|
626
|
-
}
|
627
|
-
const focusCoords = _classPrivateFieldGet(_focusTransformation, this).transformStart(rowDelta, colDelta);
|
628
|
-
this.setRangeFocus(focusCoords.normalize());
|
620
|
+
selectionLayer,
|
621
|
+
visualCoords
|
622
|
+
} = _classPrivateFieldGet(_focusTransformation, this).transformStart(rowDelta, colDelta);
|
623
|
+
this.setRangeFocus(visualCoords.normalize(), selectionLayer);
|
629
624
|
}
|
630
625
|
|
631
626
|
/**
|
@@ -638,7 +633,7 @@ class Selection {
|
|
638
633
|
if (!this.isSelected()) {
|
639
634
|
return;
|
640
635
|
}
|
641
|
-
const range = this.
|
636
|
+
const range = this.getActiveSelectedRange();
|
642
637
|
if (this.isSelectedByCorner()) {
|
643
638
|
this.selectAll(true, true, {
|
644
639
|
disableHeadersHighlight: true
|
@@ -687,7 +682,7 @@ class Selection {
|
|
687
682
|
if (!this.isSelected()) {
|
688
683
|
return;
|
689
684
|
}
|
690
|
-
const range = this.
|
685
|
+
const range = this.getActiveSelectedRange();
|
691
686
|
if (this.isSelectedByCorner()) {
|
692
687
|
this.selectAll(true, true, {
|
693
688
|
disableHeadersHighlight: true
|
@@ -752,7 +747,7 @@ class Selection {
|
|
752
747
|
* @returns {boolean}
|
753
748
|
*/
|
754
749
|
isMultiple() {
|
755
|
-
let cellRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.
|
750
|
+
let cellRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getActiveSelectedRange();
|
756
751
|
if (!this.isSelected()) {
|
757
752
|
return false;
|
758
753
|
}
|
@@ -945,7 +940,7 @@ class Selection {
|
|
945
940
|
* the logical coordinates points on them.
|
946
941
|
*/
|
947
942
|
selectAll() {
|
948
|
-
var _this$
|
943
|
+
var _this$getActiveSelect;
|
949
944
|
let includeRowHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
950
945
|
let includeColumnHeaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
951
946
|
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
@@ -963,19 +958,20 @@ class Selection {
|
|
963
958
|
if (rowFrom === 0 && columnFrom === 0 && (nrOfRows === 0 || nrOfColumns === 0)) {
|
964
959
|
return;
|
965
960
|
}
|
966
|
-
let highlight = (_this$
|
961
|
+
let highlight = (_this$getActiveSelect = this.getActiveSelectedRange()) === null || _this$getActiveSelect === void 0 ? void 0 : _this$getActiveSelect.highlight;
|
967
962
|
const {
|
968
963
|
focusPosition,
|
969
964
|
disableHeadersHighlight
|
970
965
|
} = options;
|
971
|
-
_classPrivateFieldSet(_disableHeadersHighlight, this, disableHeadersHighlight);
|
972
966
|
if (focusPosition && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.row) && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.col)) {
|
973
967
|
highlight = this.tableProps.createCellCoords((0, _number.clamp)(focusPosition.row, rowFrom, nrOfRows - 1), (0, _number.clamp)(focusPosition.col, columnFrom, nrOfColumns - 1));
|
974
968
|
}
|
975
969
|
const startCoords = this.tableProps.createCellCoords(rowFrom, columnFrom);
|
976
970
|
const endCoords = this.tableProps.createCellCoords(nrOfRows - 1, nrOfColumns - 1);
|
977
971
|
this.clear();
|
972
|
+
this.runLocalHooks('beforeSelectAll', startCoords, endCoords, highlight);
|
978
973
|
this.setRangeStartOnly(startCoords, undefined, highlight);
|
974
|
+
_classPrivateFieldSet(_disableHeadersHighlight, this, disableHeadersHighlight);
|
979
975
|
if (columnFrom < 0) {
|
980
976
|
this.selectedByRowHeader.add(this.getLayerLevel());
|
981
977
|
}
|
@@ -983,8 +979,8 @@ class Selection {
|
|
983
979
|
this.selectedByColumnHeader.add(this.getLayerLevel());
|
984
980
|
}
|
985
981
|
this.setRangeEnd(endCoords);
|
982
|
+
this.runLocalHooks('afterSelectAll', startCoords, endCoords, highlight);
|
986
983
|
this.finish();
|
987
|
-
_classPrivateFieldSet(_disableHeadersHighlight, this, false);
|
988
984
|
}
|
989
985
|
|
990
986
|
/**
|
@@ -1091,10 +1087,6 @@ class Selection {
|
|
1091
1087
|
const from = this.tableProps.createCellCoords(fromRow, start);
|
1092
1088
|
const to = this.tableProps.createCellCoords(toRow, end);
|
1093
1089
|
this.runLocalHooks('beforeSelectColumns', from, to, highlight);
|
1094
|
-
|
1095
|
-
// disallow modifying row axis for that hooks
|
1096
|
-
from.row = fromRow;
|
1097
|
-
to.row = toRow;
|
1098
1090
|
this.setRangeStartOnly(from, undefined, highlight);
|
1099
1091
|
this.selectedByColumnHeader.add(this.getLayerLevel());
|
1100
1092
|
this.setRangeEnd(to);
|
@@ -1146,10 +1138,6 @@ class Selection {
|
|
1146
1138
|
const from = this.tableProps.createCellCoords(startRow, fromColumn);
|
1147
1139
|
const to = this.tableProps.createCellCoords(endRow, toColumn);
|
1148
1140
|
this.runLocalHooks('beforeSelectRows', from, to, highlight);
|
1149
|
-
|
1150
|
-
// disallow modifying column axis for that hooks
|
1151
|
-
from.col = fromColumn;
|
1152
|
-
to.col = toColumn;
|
1153
1141
|
this.setRangeStartOnly(from, undefined, highlight);
|
1154
1142
|
this.selectedByRowHeader.add(this.getLayerLevel());
|
1155
1143
|
this.setRangeEnd(to);
|
@@ -1159,6 +1147,57 @@ class Selection {
|
|
1159
1147
|
return isValid;
|
1160
1148
|
}
|
1161
1149
|
|
1150
|
+
/**
|
1151
|
+
* Allows importing the selection for all layers from the provided array of CellRange objects.
|
1152
|
+
* The method clears the current selection and sets the new one without triggering any
|
1153
|
+
* selection related hooks.
|
1154
|
+
*
|
1155
|
+
* @param {SelectionState} selectionState The selection state to import.
|
1156
|
+
*/
|
1157
|
+
importSelection(_ref) {
|
1158
|
+
let {
|
1159
|
+
ranges,
|
1160
|
+
activeRange,
|
1161
|
+
activeSelectionLayer,
|
1162
|
+
selectedByRowHeader,
|
1163
|
+
selectedByColumnHeader,
|
1164
|
+
disableHeadersHighlight
|
1165
|
+
} = _ref;
|
1166
|
+
if (ranges.length === 0) {
|
1167
|
+
return;
|
1168
|
+
}
|
1169
|
+
this.selectedRange.clear();
|
1170
|
+
this.highlight.clear();
|
1171
|
+
this.inProgress = true;
|
1172
|
+
_classPrivateFieldSet(_disableHeadersHighlight, this, disableHeadersHighlight);
|
1173
|
+
this.selectedByRowHeader = new Set(selectedByRowHeader);
|
1174
|
+
this.selectedByColumnHeader = new Set(selectedByColumnHeader);
|
1175
|
+
this.setActiveSelectionLayerIndex(0);
|
1176
|
+
ranges.forEach((cellRange, selectionLayerIndex) => {
|
1177
|
+
this.selectedRange.push(cellRange);
|
1178
|
+
this.applyAndCommit(cellRange, selectionLayerIndex);
|
1179
|
+
});
|
1180
|
+
this.setRangeFocus(activeRange.highlight, activeSelectionLayer);
|
1181
|
+
_classPrivateFieldSet(_disableHeadersHighlight, this, false);
|
1182
|
+
this.inProgress = false;
|
1183
|
+
}
|
1184
|
+
|
1185
|
+
/**
|
1186
|
+
* Exports all selection layers with other properties related to the selection state.
|
1187
|
+
*
|
1188
|
+
* @returns {SelectionState}
|
1189
|
+
*/
|
1190
|
+
exportSelection() {
|
1191
|
+
return {
|
1192
|
+
ranges: Array.from(this.selectedRange).map(range => range.clone()),
|
1193
|
+
activeRange: this.getActiveSelectedRange(),
|
1194
|
+
activeSelectionLayer: this.getActiveSelectionLayerIndex(),
|
1195
|
+
selectedByRowHeader: Array.from(this.selectedByRowHeader),
|
1196
|
+
selectedByColumnHeader: Array.from(this.selectedByColumnHeader),
|
1197
|
+
disableHeadersHighlight: _classPrivateFieldGet(_disableHeadersHighlight, this)
|
1198
|
+
};
|
1199
|
+
}
|
1200
|
+
|
1162
1201
|
/**
|
1163
1202
|
* Refreshes the whole selection by clearing, reapplying and committing (calculating visual to renderable indexes)
|
1164
1203
|
* the selection by using already added visual ranges. The method can be useful when underneath some indexes
|
@@ -1225,7 +1264,7 @@ class Selection {
|
|
1225
1264
|
return;
|
1226
1265
|
}
|
1227
1266
|
const currentLayer = this.getLayerLevel();
|
1228
|
-
const cellRange = this.
|
1267
|
+
const cellRange = this.getActiveSelectedRange();
|
1229
1268
|
if (this.highlight.isEnabledFor(_highlight.FOCUS_TYPE, cellRange.highlight)) {
|
1230
1269
|
this.highlight.getFocus().commit().syncWith(cellRange);
|
1231
1270
|
}
|