handsontable 16.0.1 → 16.1.0-next-91b8a0f-20250905
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdparty/walkontable/src/overlays.js +12 -2
- package/3rdparty/walkontable/src/overlays.mjs +12 -2
- package/3rdparty/walkontable/src/viewport.js +2 -6
- package/3rdparty/walkontable/src/viewport.mjs +2 -6
- package/CHANGELOG.md +37 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/cellTypes/autocompleteType/accessors/index.js +7 -0
- package/cellTypes/autocompleteType/accessors/index.mjs +2 -0
- package/cellTypes/autocompleteType/accessors/valueGetter.js +14 -0
- package/cellTypes/autocompleteType/accessors/valueGetter.mjs +10 -0
- package/cellTypes/autocompleteType/accessors/valueSetter.js +25 -0
- package/cellTypes/autocompleteType/accessors/valueSetter.mjs +21 -0
- package/cellTypes/autocompleteType/autocompleteType.js +4 -1
- package/cellTypes/autocompleteType/autocompleteType.mjs +4 -1
- package/cellTypes/checkboxType/accessors/index.js +5 -0
- package/cellTypes/checkboxType/accessors/index.mjs +1 -0
- package/cellTypes/checkboxType/accessors/valueSetter.js +26 -0
- package/cellTypes/checkboxType/accessors/valueSetter.mjs +22 -0
- package/cellTypes/checkboxType/checkboxType.js +3 -1
- package/cellTypes/checkboxType/checkboxType.mjs +3 -1
- package/cellTypes/dropdownType/accessors/index.js +7 -0
- package/cellTypes/dropdownType/accessors/index.mjs +2 -0
- package/cellTypes/dropdownType/accessors/valueGetter.js +14 -0
- package/cellTypes/dropdownType/accessors/valueGetter.mjs +10 -0
- package/cellTypes/dropdownType/accessors/valueSetter.js +17 -0
- package/cellTypes/dropdownType/accessors/valueSetter.mjs +13 -0
- package/cellTypes/dropdownType/dropdownType.js +4 -1
- package/cellTypes/dropdownType/dropdownType.mjs +4 -1
- package/cellTypes/numericType/accessors/index.js +5 -0
- package/cellTypes/numericType/accessors/index.mjs +1 -0
- package/cellTypes/numericType/accessors/valueSetter.js +19 -0
- package/cellTypes/numericType/accessors/valueSetter.mjs +15 -0
- package/cellTypes/numericType/numericType.js +3 -1
- package/cellTypes/numericType/numericType.mjs +3 -1
- package/core/focusCatcher/index.js +37 -112
- package/core/focusCatcher/index.mjs +35 -110
- package/core/focusCatcher/utils.js +31 -0
- package/core/focusCatcher/utils.mjs +27 -0
- package/core/hooks/constants.js +242 -0
- package/core/hooks/constants.mjs +242 -0
- package/core/hooks/index.d.ts +22 -0
- package/core/viewportScroll/scrollStrategies/focusScroll.js +5 -1
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +5 -1
- package/core/viewportScroll/utils.js +1 -1
- package/core/viewportScroll/utils.mjs +1 -1
- package/core.d.ts +4 -0
- package/core.js +237 -139
- package/core.mjs +240 -142
- package/dataMap/dataMap.js +13 -3
- package/dataMap/dataMap.mjs +14 -4
- package/dataMap/dataSource.js +16 -0
- package/dataMap/dataSource.mjs +16 -0
- package/dataMap/metaManager/lazyFactoryMap.js +4 -3
- package/dataMap/metaManager/lazyFactoryMap.mjs +2 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +3 -2
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +3 -2
- package/dataMap/metaManager/metaSchema.js +289 -4
- package/dataMap/metaManager/metaSchema.mjs +289 -4
- package/dataMap/metaManager/utils.js +0 -11
- package/dataMap/metaManager/utils.mjs +0 -10
- package/dataMap/replaceData.js +1 -0
- package/dataMap/replaceData.mjs +1 -0
- package/dist/handsontable.css +281 -4
- package/dist/handsontable.full.css +281 -4
- package/dist/handsontable.full.js +7842 -2990
- package/dist/handsontable.full.min.css +4 -5
- package/dist/handsontable.full.min.js +167 -165
- package/dist/handsontable.js +9638 -4807
- package/dist/handsontable.min.css +4 -4
- package/dist/handsontable.min.js +52 -50
- package/dist/languages/all.js +231 -21
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.js +11 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.js +11 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.js +11 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.js +11 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.js +11 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.js +11 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fa-IR.js +11 -1
- package/dist/languages/fa-IR.min.js +1 -1
- package/dist/languages/fr-FR.js +11 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.js +11 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.js +11 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.js +11 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.js +11 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.js +11 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.js +11 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.js +11 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.js +11 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.js +11 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.js +11 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.js +11 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.js +11 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.js +11 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +4 -4
- package/editorManager.mjs +4 -4
- package/editors/autocompleteEditor/autocompleteEditor.js +50 -112
- package/editors/autocompleteEditor/autocompleteEditor.mjs +51 -113
- package/editors/baseEditor/baseEditor.js +10 -6
- package/editors/baseEditor/baseEditor.mjs +10 -6
- package/editors/handsontableEditor/handsontableEditor.js +9 -9
- package/editors/handsontableEditor/handsontableEditor.mjs +9 -9
- package/editors/textEditor/textEditor.js +0 -7
- package/editors/textEditor/textEditor.mjs +0 -7
- package/focusManager.js +2 -2
- package/focusManager.mjs +2 -2
- package/helpers/a11y.js +15 -2
- package/helpers/a11y.mjs +10 -2
- package/helpers/console.js +12 -0
- package/helpers/console.mjs +11 -0
- package/helpers/dom/element.js +4 -4
- package/helpers/dom/element.mjs +4 -4
- package/helpers/mixed.js +65 -2
- package/helpers/mixed.mjs +63 -2
- package/helpers/number.js +28 -0
- package/helpers/number.mjs +26 -0
- package/helpers/object.js +35 -0
- package/helpers/object.mjs +34 -0
- package/helpers/string.js +19 -0
- package/helpers/string.mjs +18 -0
- package/helpers/templateLiteralTag.js +57 -1
- package/helpers/templateLiteralTag.mjs +56 -1
- package/i18n/constants.js +13 -1
- package/i18n/constants.mjs +13 -1
- package/i18n/languages/ar-AR.js +11 -1
- package/i18n/languages/ar-AR.mjs +11 -1
- package/i18n/languages/cs-CZ.js +11 -1
- package/i18n/languages/cs-CZ.mjs +11 -1
- package/i18n/languages/de-CH.js +11 -1
- package/i18n/languages/de-CH.mjs +11 -1
- package/i18n/languages/de-DE.js +11 -1
- package/i18n/languages/de-DE.mjs +11 -1
- package/i18n/languages/en-US.js +11 -1
- package/i18n/languages/en-US.mjs +11 -1
- package/i18n/languages/es-MX.js +11 -1
- package/i18n/languages/es-MX.mjs +11 -1
- package/i18n/languages/fa-IR.js +11 -1
- package/i18n/languages/fa-IR.mjs +11 -1
- package/i18n/languages/fr-FR.js +11 -1
- package/i18n/languages/fr-FR.mjs +11 -1
- package/i18n/languages/hr-HR.js +11 -1
- package/i18n/languages/hr-HR.mjs +11 -1
- package/i18n/languages/it-IT.js +11 -1
- package/i18n/languages/it-IT.mjs +11 -1
- package/i18n/languages/ja-JP.js +11 -1
- package/i18n/languages/ja-JP.mjs +11 -1
- package/i18n/languages/ko-KR.js +11 -1
- package/i18n/languages/ko-KR.mjs +11 -1
- package/i18n/languages/lv-LV.js +11 -1
- package/i18n/languages/lv-LV.mjs +11 -1
- package/i18n/languages/nb-NO.js +11 -1
- package/i18n/languages/nb-NO.mjs +11 -1
- package/i18n/languages/nl-NL.js +11 -1
- package/i18n/languages/nl-NL.mjs +11 -1
- package/i18n/languages/pl-PL.js +11 -1
- package/i18n/languages/pl-PL.mjs +11 -1
- package/i18n/languages/pt-BR.js +11 -1
- package/i18n/languages/pt-BR.mjs +11 -1
- package/i18n/languages/ru-RU.js +11 -1
- package/i18n/languages/ru-RU.mjs +11 -1
- package/i18n/languages/sr-SP.js +11 -1
- package/i18n/languages/sr-SP.mjs +11 -1
- package/i18n/languages/zh-CN.js +11 -1
- package/i18n/languages/zh-CN.mjs +11 -1
- package/i18n/languages/zh-TW.js +11 -1
- package/i18n/languages/zh-TW.mjs +11 -1
- package/i18n/phraseFormatters/index.js +3 -1
- package/i18n/phraseFormatters/index.mjs +3 -1
- package/i18n/registry.js +5 -6
- package/i18n/registry.mjs +5 -6
- package/index.d.ts +27 -0
- package/languages/all.js +231 -21
- package/languages/ar-AR.js +11 -1
- package/languages/ar-AR.mjs +11 -1
- package/languages/cs-CZ.js +11 -1
- package/languages/cs-CZ.mjs +11 -1
- package/languages/de-CH.js +11 -1
- package/languages/de-CH.mjs +11 -1
- package/languages/de-DE.js +11 -1
- package/languages/de-DE.mjs +11 -1
- package/languages/en-US.js +11 -1
- package/languages/en-US.mjs +11 -1
- package/languages/es-MX.js +11 -1
- package/languages/es-MX.mjs +11 -1
- package/languages/fa-IR.js +11 -1
- package/languages/fa-IR.mjs +11 -1
- package/languages/fr-FR.js +11 -1
- package/languages/fr-FR.mjs +11 -1
- package/languages/hr-HR.js +11 -1
- package/languages/hr-HR.mjs +11 -1
- package/languages/index.js +231 -21
- package/languages/it-IT.js +11 -1
- package/languages/it-IT.mjs +11 -1
- package/languages/ja-JP.js +11 -1
- package/languages/ja-JP.mjs +11 -1
- package/languages/ko-KR.js +11 -1
- package/languages/ko-KR.mjs +11 -1
- package/languages/lv-LV.js +11 -1
- package/languages/lv-LV.mjs +11 -1
- package/languages/nb-NO.js +11 -1
- package/languages/nb-NO.mjs +11 -1
- package/languages/nl-NL.js +11 -1
- package/languages/nl-NL.mjs +11 -1
- package/languages/pl-PL.js +11 -1
- package/languages/pl-PL.mjs +11 -1
- package/languages/pt-BR.js +11 -1
- package/languages/pt-BR.mjs +11 -1
- package/languages/ru-RU.js +11 -1
- package/languages/ru-RU.mjs +11 -1
- package/languages/sr-SP.js +11 -1
- package/languages/sr-SP.mjs +11 -1
- package/languages/zh-CN.js +11 -1
- package/languages/zh-CN.mjs +11 -1
- package/languages/zh-TW.js +11 -1
- package/languages/zh-TW.mjs +11 -1
- package/mixins/localHooks.js +16 -0
- package/mixins/localHooks.mjs +16 -0
- package/package.json +19 -1
- package/plugins/autoRowSize/autoRowSize.js +43 -6
- package/plugins/autoRowSize/autoRowSize.mjs +43 -6
- package/plugins/autofill/autofill.js +50 -3
- package/plugins/autofill/autofill.mjs +50 -3
- package/plugins/base/base.js +86 -15
- package/plugins/base/base.mjs +87 -16
- package/plugins/collapsibleColumns/collapsibleColumns.js +4 -4
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +4 -4
- package/plugins/columnSorting/columnSorting.js +3 -3
- package/plugins/columnSorting/columnSorting.mjs +3 -3
- package/plugins/comments/comments.js +52 -22
- package/plugins/comments/comments.mjs +52 -22
- package/plugins/comments/contextMenuItem/addEditComment.js +3 -3
- package/plugins/comments/contextMenuItem/addEditComment.mjs +3 -3
- package/plugins/comments/contextMenuItem/readOnlyComment.js +2 -2
- package/plugins/comments/contextMenuItem/readOnlyComment.mjs +2 -2
- package/plugins/comments/contextMenuItem/removeComment.js +2 -2
- package/plugins/comments/contextMenuItem/removeComment.mjs +2 -2
- package/plugins/contextMenu/contextMenu.js +4 -5
- package/plugins/contextMenu/contextMenu.mjs +4 -5
- package/plugins/contextMenu/menu/cursor.js +1 -1
- package/plugins/contextMenu/menu/cursor.mjs +1 -1
- package/plugins/contextMenu/menu/defaultShortcutsList.js +5 -5
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +5 -5
- package/plugins/contextMenu/menu/menu.js +3 -3
- package/plugins/contextMenu/menu/menu.mjs +3 -3
- package/plugins/contextMenu/menu/positioner.js +1 -1
- package/plugins/contextMenu/menu/positioner.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/alignment.js +1 -1
- package/plugins/contextMenu/predefinedItems/alignment.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/clearColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/clearColumn.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/columnLeft.js +3 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/columnRight.js +3 -3
- package/plugins/contextMenu/predefinedItems/columnRight.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/readOnly.js +1 -1
- package/plugins/contextMenu/predefinedItems/readOnly.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/rowAbove.js +3 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.js +3 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/copy.js +1 -1
- package/plugins/copyPaste/contextMenuItem/copy.mjs +1 -1
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +3 -3
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +3 -3
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +3 -3
- package/plugins/copyPaste/contextMenuItem/cut.js +1 -1
- package/plugins/copyPaste/contextMenuItem/cut.mjs +1 -1
- package/plugins/copyPaste/copyPaste.js +75 -40
- package/plugins/copyPaste/copyPaste.mjs +76 -41
- package/plugins/customBorders/customBorders.js +1 -1
- package/plugins/customBorders/customBorders.mjs +1 -1
- package/plugins/dialog/dialog.d.ts +23 -0
- package/plugins/dialog/dialog.js +489 -0
- package/plugins/dialog/dialog.mjs +485 -0
- package/plugins/dialog/index.d.ts +1 -0
- package/plugins/dialog/index.js +7 -0
- package/plugins/dialog/index.mjs +1 -0
- package/plugins/dialog/ui.js +264 -0
- package/plugins/dialog/ui.mjs +259 -0
- package/plugins/dropdownMenu/dropdownMenu.js +5 -4
- package/plugins/dropdownMenu/dropdownMenu.mjs +5 -4
- package/plugins/filters/filters.js +2 -2
- package/plugins/filters/filters.mjs +2 -2
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +3 -3
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs +3 -3
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +4 -4
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +4 -4
- package/plugins/hiddenRows/contextMenuItem/hideRow.js +3 -3
- package/plugins/hiddenRows/contextMenuItem/hideRow.mjs +3 -3
- package/plugins/hiddenRows/contextMenuItem/showRow.js +4 -4
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +4 -4
- package/plugins/index.d.ts +9 -0
- package/plugins/index.js +9 -0
- package/plugins/index.mjs +7 -1
- package/plugins/loading/content.js +36 -0
- package/plugins/loading/content.mjs +31 -0
- package/plugins/loading/index.d.ts +1 -0
- package/plugins/loading/index.js +7 -0
- package/plugins/loading/index.mjs +1 -0
- package/plugins/loading/loading.d.ts +19 -0
- package/plugins/loading/loading.js +290 -0
- package/plugins/loading/loading.mjs +285 -0
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
- package/plugins/manualColumnMove/manualColumnMove.js +3 -3
- package/plugins/manualColumnMove/manualColumnMove.mjs +3 -3
- package/plugins/manualColumnResize/manualColumnResize.js +3 -3
- package/plugins/manualColumnResize/manualColumnResize.mjs +3 -3
- package/plugins/manualRowMove/manualRowMove.js +4 -4
- package/plugins/manualRowMove/manualRowMove.mjs +4 -4
- package/plugins/manualRowResize/manualRowResize.js +5 -2
- package/plugins/manualRowResize/manualRowResize.mjs +5 -2
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +15 -15
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +15 -15
- package/plugins/mergeCells/focusOrder.js +75 -39
- package/plugins/mergeCells/focusOrder.mjs +75 -39
- package/plugins/mergeCells/mergeCells.js +26 -19
- package/plugins/mergeCells/mergeCells.mjs +26 -19
- package/plugins/mergeCells/renderer.js +14 -8
- package/plugins/mergeCells/renderer.mjs +14 -8
- package/plugins/multiColumnSorting/multiColumnSorting.js +3 -3
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +3 -3
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +3 -3
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +3 -3
- package/plugins/nestedHeaders/nestedHeaders.js +47 -41
- package/plugins/nestedHeaders/nestedHeaders.mjs +47 -41
- package/plugins/nestedRows/nestedRows.js +3 -3
- package/plugins/nestedRows/nestedRows.mjs +3 -3
- package/plugins/nestedRows/ui/collapsing.js +1 -2
- package/plugins/nestedRows/ui/collapsing.mjs +1 -2
- package/plugins/nestedRows/ui/contextMenu.js +4 -4
- package/plugins/nestedRows/ui/contextMenu.mjs +4 -4
- package/plugins/nestedRows/ui/headers.js +4 -1
- package/plugins/nestedRows/ui/headers.mjs +4 -1
- package/plugins/pagination/focusController.js +27 -0
- package/plugins/pagination/focusController.mjs +23 -0
- package/plugins/pagination/index.d.ts +1 -0
- package/plugins/pagination/index.js +7 -0
- package/plugins/pagination/index.mjs +1 -0
- package/plugins/pagination/pagination.d.ts +52 -0
- package/plugins/pagination/pagination.js +1034 -0
- package/plugins/pagination/pagination.mjs +1030 -0
- package/plugins/pagination/strategies/autoPageSize.js +96 -0
- package/plugins/pagination/strategies/autoPageSize.mjs +92 -0
- package/plugins/pagination/strategies/fixedPageSize.js +88 -0
- package/plugins/pagination/strategies/fixedPageSize.mjs +84 -0
- package/plugins/pagination/strategies/index.js +22 -0
- package/plugins/pagination/strategies/index.mjs +18 -0
- package/plugins/pagination/ui.js +449 -0
- package/plugins/pagination/ui.mjs +443 -0
- package/plugins/pagination/utils.js +28 -0
- package/plugins/pagination/utils.mjs +24 -0
- package/plugins/stretchColumns/calculator.js +4 -0
- package/plugins/stretchColumns/calculator.mjs +4 -0
- package/plugins/stretchColumns/stretchColumns.js +1 -1
- package/plugins/stretchColumns/stretchColumns.mjs +1 -1
- package/plugins/undoRedo/actions/dataChange.js +17 -15
- package/plugins/undoRedo/actions/dataChange.mjs +17 -15
- package/renderers/checkboxRenderer/checkboxRenderer.js +3 -3
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +3 -3
- package/selection/range.js +11 -0
- package/selection/range.mjs +11 -0
- package/selection/selection.js +163 -124
- package/selection/selection.mjs +163 -124
- package/selection/transformation/_base.js +448 -0
- package/selection/transformation/_base.mjs +443 -0
- package/selection/transformation/extender.js +55 -0
- package/selection/transformation/extender.mjs +51 -0
- package/selection/transformation/focus.js +77 -0
- package/selection/transformation/focus.mjs +73 -0
- package/selection/transformation/index.js +7 -0
- package/selection/transformation/index.mjs +2 -0
- package/selection/utils.js +2 -1
- package/selection/utils.mjs +2 -1
- package/settings.d.ts +10 -1
- package/shortcutContexts/commands/editor/fastOpen.js +1 -1
- package/shortcutContexts/commands/editor/fastOpen.mjs +1 -1
- package/shortcutContexts/commands/editor/open.js +10 -4
- package/shortcutContexts/commands/editor/open.mjs +10 -4
- package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +2 -2
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +2 -2
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +2 -2
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +5 -2
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +5 -2
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +5 -2
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +5 -2
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +2 -2
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +2 -2
- package/shortcutContexts/commands/scrollToFocusedCell.js +1 -1
- package/shortcutContexts/commands/scrollToFocusedCell.mjs +1 -1
- package/shortcutContexts/grid.js +3 -3
- package/shortcutContexts/grid.mjs +3 -3
- package/shortcuts/context.js +4 -1
- package/shortcuts/context.mjs +4 -1
- package/shortcuts/manager.js +17 -3
- package/shortcuts/manager.mjs +17 -3
- package/styles/handsontable.css +288 -22
- package/styles/handsontable.min.css +3 -3
- package/styles/ht-theme-classic.css +828 -0
- package/styles/ht-theme-classic.min.css +30 -0
- package/styles/ht-theme-horizon.css +122 -26
- package/styles/ht-theme-horizon.min.css +3 -3
- package/styles/ht-theme-main.css +124 -28
- package/styles/ht-theme-main.min.css +3 -3
- package/tableView.js +61 -25
- package/tableView.mjs +61 -25
- package/utils/a11yAnnouncer.js +70 -0
- package/utils/a11yAnnouncer.mjs +64 -0
- package/{core/focusCatcher → utils}/focusDetector.js +30 -12
- package/{core/focusCatcher → utils}/focusDetector.mjs +30 -12
- package/utils/samplesGenerator.js +17 -1
- package/utils/samplesGenerator.mjs +17 -1
- package/utils/stylesHandler.js +23 -8
- package/utils/stylesHandler.mjs +23 -8
- package/utils/valueAccessors.js +45 -0
- package/utils/valueAccessors.mjs +40 -0
- package/validators/autocompleteValidator/autocompleteValidator.js +2 -1
- package/validators/autocompleteValidator/autocompleteValidator.mjs +2 -1
- package/selection/transformation.js +0 -335
- package/selection/transformation.mjs +0 -331
@@ -265,7 +265,7 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
265
265
|
* @param {HTMLCellElement} TH TH HTML element.
|
266
266
|
*/
|
267
267
|
setupHandlePosition(TH) {
|
268
|
-
if (!TH.parentNode) {
|
268
|
+
if (!TH.parentNode || _classPrivateFieldGet(_dblclick, this) > 1) {
|
269
269
|
return;
|
270
270
|
}
|
271
271
|
_classPrivateFieldSet(_currentTH, this, TH);
|
@@ -417,8 +417,8 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
417
417
|
*/
|
418
418
|
afterMouseDownTimeout() {
|
419
419
|
const render = () => {
|
420
|
-
this.hot.render();
|
421
420
|
this.hot.view.adjustElementsSize();
|
421
|
+
this.hot.render();
|
422
422
|
};
|
423
423
|
const resize = (column, forceRender) => {
|
424
424
|
const hookNewSize = this.hot.runHooks('beforeColumnResize', _classPrivateFieldGet(_newSize, this), column, true);
|
@@ -577,8 +577,8 @@ function _onMouseMove(event) {
|
|
577
577
|
*/
|
578
578
|
function _onMouseUp() {
|
579
579
|
const render = () => {
|
580
|
-
this.hot.render();
|
581
580
|
this.hot.view.adjustElementsSize();
|
581
|
+
this.hot.render();
|
582
582
|
};
|
583
583
|
const resize = (column, forceRender) => {
|
584
584
|
this.hot.runHooks('beforeColumnResize', _classPrivateFieldGet(_newSize, this), column, false);
|
@@ -260,7 +260,7 @@ export class ManualColumnResize extends BasePlugin {
|
|
260
260
|
* @param {HTMLCellElement} TH TH HTML element.
|
261
261
|
*/
|
262
262
|
setupHandlePosition(TH) {
|
263
|
-
if (!TH.parentNode) {
|
263
|
+
if (!TH.parentNode || _classPrivateFieldGet(_dblclick, this) > 1) {
|
264
264
|
return;
|
265
265
|
}
|
266
266
|
_classPrivateFieldSet(_currentTH, this, TH);
|
@@ -412,8 +412,8 @@ export class ManualColumnResize extends BasePlugin {
|
|
412
412
|
*/
|
413
413
|
afterMouseDownTimeout() {
|
414
414
|
const render = () => {
|
415
|
-
this.hot.render();
|
416
415
|
this.hot.view.adjustElementsSize();
|
416
|
+
this.hot.render();
|
417
417
|
};
|
418
418
|
const resize = (column, forceRender) => {
|
419
419
|
const hookNewSize = this.hot.runHooks('beforeColumnResize', _classPrivateFieldGet(_newSize, this), column, true);
|
@@ -571,8 +571,8 @@ function _onMouseMove(event) {
|
|
571
571
|
*/
|
572
572
|
function _onMouseUp() {
|
573
573
|
const render = () => {
|
574
|
-
this.hot.render();
|
575
574
|
this.hot.view.adjustElementsSize();
|
575
|
+
this.hot.render();
|
576
576
|
};
|
577
577
|
const resize = (column, forceRender) => {
|
578
578
|
this.hot.runHooks('beforeColumnResize', _classPrivateFieldGet(_newSize, this), column, false);
|
@@ -395,7 +395,7 @@ class ManualRowMove extends _base.BasePlugin {
|
|
395
395
|
* @returns {Array}
|
396
396
|
*/
|
397
397
|
prepareRowsToMoving() {
|
398
|
-
const selection = this.hot.
|
398
|
+
const selection = this.hot.getSelectedRangeActive();
|
399
399
|
const selectedRows = [];
|
400
400
|
if (!selection) {
|
401
401
|
return selectedRows;
|
@@ -528,7 +528,7 @@ function _onBeforeOnCellMouseDown(event, coords, TD, controller) {
|
|
528
528
|
wtViewport
|
529
529
|
} = this.hot.view._wt;
|
530
530
|
const isHeaderSelection = this.hot.selection.isSelectedByRowHeader();
|
531
|
-
const selection = this.hot.
|
531
|
+
const selection = this.hot.getSelectedRangeActive();
|
532
532
|
if (!selection || !isHeaderSelection || _classPrivateFieldGet(_pressed, this) || event.button !== 0) {
|
533
533
|
_classPrivateFieldSet(_pressed, this, false);
|
534
534
|
_classPrivateFieldGet(_rowsToMove, this).length = 0;
|
@@ -589,7 +589,7 @@ function _onMouseMove(event) {
|
|
589
589
|
* a boolean value that allows or disallows changing the selection for that particular area.
|
590
590
|
*/
|
591
591
|
function _onBeforeOnCellMouseOver(event, coords, TD, controller) {
|
592
|
-
const selectedRange = this.hot.
|
592
|
+
const selectedRange = this.hot.getSelectedRangeActive();
|
593
593
|
if (!selectedRange || !_classPrivateFieldGet(_pressed, this)) {
|
594
594
|
return;
|
595
595
|
}
|
@@ -624,8 +624,8 @@ function _onMouseUp() {
|
|
624
624
|
_classPrivateFieldGet(_rowsToMove, this).length = 0;
|
625
625
|
if (movePerformed === true) {
|
626
626
|
this.persistentStateSave();
|
627
|
-
this.hot.render();
|
628
627
|
this.hot.view.adjustElementsSize();
|
628
|
+
this.hot.render();
|
629
629
|
const selectionStart = this.hot.toVisualRow(firstMovedPhysicalRow);
|
630
630
|
const selectionEnd = selectionStart + rowsLen - 1;
|
631
631
|
this.hot.selectRows(selectionStart, selectionEnd);
|
@@ -391,7 +391,7 @@ export class ManualRowMove extends BasePlugin {
|
|
391
391
|
* @returns {Array}
|
392
392
|
*/
|
393
393
|
prepareRowsToMoving() {
|
394
|
-
const selection = this.hot.
|
394
|
+
const selection = this.hot.getSelectedRangeActive();
|
395
395
|
const selectedRows = [];
|
396
396
|
if (!selection) {
|
397
397
|
return selectedRows;
|
@@ -523,7 +523,7 @@ function _onBeforeOnCellMouseDown(event, coords, TD, controller) {
|
|
523
523
|
wtViewport
|
524
524
|
} = this.hot.view._wt;
|
525
525
|
const isHeaderSelection = this.hot.selection.isSelectedByRowHeader();
|
526
|
-
const selection = this.hot.
|
526
|
+
const selection = this.hot.getSelectedRangeActive();
|
527
527
|
if (!selection || !isHeaderSelection || _classPrivateFieldGet(_pressed, this) || event.button !== 0) {
|
528
528
|
_classPrivateFieldSet(_pressed, this, false);
|
529
529
|
_classPrivateFieldGet(_rowsToMove, this).length = 0;
|
@@ -584,7 +584,7 @@ function _onMouseMove(event) {
|
|
584
584
|
* a boolean value that allows or disallows changing the selection for that particular area.
|
585
585
|
*/
|
586
586
|
function _onBeforeOnCellMouseOver(event, coords, TD, controller) {
|
587
|
-
const selectedRange = this.hot.
|
587
|
+
const selectedRange = this.hot.getSelectedRangeActive();
|
588
588
|
if (!selectedRange || !_classPrivateFieldGet(_pressed, this)) {
|
589
589
|
return;
|
590
590
|
}
|
@@ -619,8 +619,8 @@ function _onMouseUp() {
|
|
619
619
|
_classPrivateFieldGet(_rowsToMove, this).length = 0;
|
620
620
|
if (movePerformed === true) {
|
621
621
|
this.persistentStateSave();
|
622
|
-
this.hot.render();
|
623
622
|
this.hot.view.adjustElementsSize();
|
623
|
+
this.hot.render();
|
624
624
|
const selectionStart = this.hot.toVisualRow(firstMovedPhysicalRow);
|
625
625
|
const selectionEnd = selectionStart + rowsLen - 1;
|
626
626
|
this.hot.selectRows(selectionStart, selectionEnd);
|
@@ -249,6 +249,9 @@ class ManualRowResize extends _base.BasePlugin {
|
|
249
249
|
* @param {HTMLCellElement} TH TH HTML element.
|
250
250
|
*/
|
251
251
|
setupHandlePosition(TH) {
|
252
|
+
if (_classPrivateFieldGet(_dblclick, this) > 1) {
|
253
|
+
return;
|
254
|
+
}
|
252
255
|
_classPrivateFieldSet(_currentTH, this, TH);
|
253
256
|
const {
|
254
257
|
view
|
@@ -414,8 +417,8 @@ class ManualRowResize extends _base.BasePlugin {
|
|
414
417
|
*/
|
415
418
|
afterMouseDownTimeout() {
|
416
419
|
const render = () => {
|
417
|
-
this.hot.render();
|
418
420
|
this.hot.view.adjustElementsSize();
|
421
|
+
this.hot.render();
|
419
422
|
};
|
420
423
|
const resize = (row, forceRender) => {
|
421
424
|
const hookNewSize = this.hot.runHooks('beforeRowResize', this.getActualRowHeight(row), row, true);
|
@@ -542,8 +545,8 @@ function _onMouseMove(event) {
|
|
542
545
|
*/
|
543
546
|
function _onMouseUp() {
|
544
547
|
const render = () => {
|
545
|
-
this.hot.render();
|
546
548
|
this.hot.view.adjustElementsSize();
|
549
|
+
this.hot.render();
|
547
550
|
};
|
548
551
|
const runHooks = (row, forceRender) => {
|
549
552
|
this.hot.runHooks('beforeRowResize', this.getActualRowHeight(row), row, false);
|
@@ -244,6 +244,9 @@ export class ManualRowResize extends BasePlugin {
|
|
244
244
|
* @param {HTMLCellElement} TH TH HTML element.
|
245
245
|
*/
|
246
246
|
setupHandlePosition(TH) {
|
247
|
+
if (_classPrivateFieldGet(_dblclick, this) > 1) {
|
248
|
+
return;
|
249
|
+
}
|
247
250
|
_classPrivateFieldSet(_currentTH, this, TH);
|
248
251
|
const {
|
249
252
|
view
|
@@ -409,8 +412,8 @@ export class ManualRowResize extends BasePlugin {
|
|
409
412
|
*/
|
410
413
|
afterMouseDownTimeout() {
|
411
414
|
const render = () => {
|
412
|
-
this.hot.render();
|
413
415
|
this.hot.view.adjustElementsSize();
|
416
|
+
this.hot.render();
|
414
417
|
};
|
415
418
|
const resize = (row, forceRender) => {
|
416
419
|
const hookNewSize = this.hot.runHooks('beforeRowResize', this.getActualRowHeight(row), row, true);
|
@@ -536,8 +539,8 @@ function _onMouseMove(event) {
|
|
536
539
|
*/
|
537
540
|
function _onMouseUp() {
|
538
541
|
const render = () => {
|
539
|
-
this.hot.render();
|
540
542
|
this.hot.view.adjustElementsSize();
|
543
|
+
this.hot.render();
|
541
544
|
};
|
542
545
|
const runHooks = (row, forceRender) => {
|
543
546
|
this.hot.runHooks('beforeRowResize', this.getActualRowHeight(row), row, false);
|
@@ -14,38 +14,38 @@ function toggleMergeItem(plugin) {
|
|
14
14
|
return {
|
15
15
|
key: 'mergeCells',
|
16
16
|
name() {
|
17
|
-
const
|
18
|
-
if (
|
19
|
-
const info = plugin.mergedCellsCollection.get(
|
20
|
-
if (info.row ===
|
17
|
+
const selection = this.getSelectedActive();
|
18
|
+
if (selection) {
|
19
|
+
const info = plugin.mergedCellsCollection.get(selection[0], selection[1]);
|
20
|
+
if (info.row === selection[0] && info.col === selection[1] && info.row + info.rowspan - 1 === selection[2] && info.col + info.colspan - 1 === selection[3]) {
|
21
21
|
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_UNMERGE_CELLS);
|
22
22
|
}
|
23
23
|
}
|
24
24
|
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_MERGE_CELLS);
|
25
25
|
},
|
26
26
|
callback() {
|
27
|
-
const
|
28
|
-
if (!
|
27
|
+
const activeRange = this.getSelectedRangeActive();
|
28
|
+
if (!activeRange) {
|
29
29
|
return;
|
30
30
|
}
|
31
|
-
|
31
|
+
activeRange.setDirection(this.isRtl() ? 'NE-SW' : 'NW-SE');
|
32
32
|
const {
|
33
33
|
from,
|
34
34
|
to
|
35
|
-
} =
|
36
|
-
plugin.toggleMerge(
|
35
|
+
} = activeRange;
|
36
|
+
plugin.toggleMerge(activeRange);
|
37
37
|
this.selectCell(from.row, from.col, to.row, to.col, false);
|
38
38
|
},
|
39
39
|
disabled() {
|
40
|
-
const
|
41
|
-
if (!
|
40
|
+
const selection = this.getSelectedActive();
|
41
|
+
if (!selection) {
|
42
42
|
return true;
|
43
43
|
}
|
44
44
|
const isSingleCell = _cellCoords.default.isSingleCell({
|
45
|
-
row:
|
46
|
-
col:
|
47
|
-
rowspan:
|
48
|
-
colspan:
|
45
|
+
row: selection[0],
|
46
|
+
col: selection[1],
|
47
|
+
rowspan: selection[2] - selection[0] + 1,
|
48
|
+
colspan: selection[3] - selection[1] + 1
|
49
49
|
});
|
50
50
|
return isSingleCell || this.selection.isSelectedByCorner();
|
51
51
|
},
|
@@ -8,38 +8,38 @@ export default function toggleMergeItem(plugin) {
|
|
8
8
|
return {
|
9
9
|
key: 'mergeCells',
|
10
10
|
name() {
|
11
|
-
const
|
12
|
-
if (
|
13
|
-
const info = plugin.mergedCellsCollection.get(
|
14
|
-
if (info.row ===
|
11
|
+
const selection = this.getSelectedActive();
|
12
|
+
if (selection) {
|
13
|
+
const info = plugin.mergedCellsCollection.get(selection[0], selection[1]);
|
14
|
+
if (info.row === selection[0] && info.col === selection[1] && info.row + info.rowspan - 1 === selection[2] && info.col + info.colspan - 1 === selection[3]) {
|
15
15
|
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_UNMERGE_CELLS);
|
16
16
|
}
|
17
17
|
}
|
18
18
|
return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_MERGE_CELLS);
|
19
19
|
},
|
20
20
|
callback() {
|
21
|
-
const
|
22
|
-
if (!
|
21
|
+
const activeRange = this.getSelectedRangeActive();
|
22
|
+
if (!activeRange) {
|
23
23
|
return;
|
24
24
|
}
|
25
|
-
|
25
|
+
activeRange.setDirection(this.isRtl() ? 'NE-SW' : 'NW-SE');
|
26
26
|
const {
|
27
27
|
from,
|
28
28
|
to
|
29
|
-
} =
|
30
|
-
plugin.toggleMerge(
|
29
|
+
} = activeRange;
|
30
|
+
plugin.toggleMerge(activeRange);
|
31
31
|
this.selectCell(from.row, from.col, to.row, to.col, false);
|
32
32
|
},
|
33
33
|
disabled() {
|
34
|
-
const
|
35
|
-
if (!
|
34
|
+
const selection = this.getSelectedActive();
|
35
|
+
if (!selection) {
|
36
36
|
return true;
|
37
37
|
}
|
38
38
|
const isSingleCell = MergedCellCoords.isSingleCell({
|
39
|
-
row:
|
40
|
-
col:
|
41
|
-
rowspan:
|
42
|
-
colspan:
|
39
|
+
row: selection[0],
|
40
|
+
col: selection[1],
|
41
|
+
rowspan: selection[2] - selection[0] + 1,
|
42
|
+
colspan: selection[3] - selection[1] + 1
|
43
43
|
});
|
44
44
|
return isSingleCell || this.selection.isSelectedByCorner();
|
45
45
|
},
|
@@ -3,6 +3,8 @@
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
require("core-js/modules/es.error.cause.js");
|
5
5
|
require("core-js/modules/es.array.push.js");
|
6
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
7
|
+
require("core-js/modules/esnext.iterator.for-each.js");
|
6
8
|
var _linkedList = _interopRequireDefault(require("../../utils/dataStructures/linkedList"));
|
7
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
8
10
|
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
|
@@ -35,11 +37,13 @@ class FocusOrder {
|
|
35
37
|
/**
|
36
38
|
* Pushes a new node to the provided list order.
|
37
39
|
*
|
38
|
-
* @param {
|
39
|
-
* @param {
|
40
|
-
* @param {
|
41
|
-
* @param {
|
42
|
-
* @param {
|
40
|
+
* @param {object} options The options object.
|
41
|
+
* @param {CellRange} options.selectedRange The selected range to build the focus order for.
|
42
|
+
* @param {number} options.selectionLayer The selection layer index.
|
43
|
+
* @param {LinkedList} options.listOrder The list order to push the node to.
|
44
|
+
* @param {WeakSet} options.mergeCellsVisitor The set of visited cells.
|
45
|
+
* @param {number} options.row The visual row index.
|
46
|
+
* @param {number} options.column The visual column index.
|
43
47
|
* @returns {NodeStructure | null}
|
44
48
|
*/
|
45
49
|
_classPrivateMethodInitSpec(this, _FocusOrder_brand);
|
@@ -183,53 +187,73 @@ class FocusOrder {
|
|
183
187
|
/**
|
184
188
|
* Rebuilds the focus order list based on the provided selection.
|
185
189
|
*
|
186
|
-
* @param {CellRange}
|
190
|
+
* @param {CellRange[]} selectedRanges The selected ranges to build the focus order for.
|
187
191
|
*/
|
188
|
-
buildFocusOrder(
|
189
|
-
const topStart = selectedRange.getTopStartCorner();
|
190
|
-
const bottomEnd = selectedRange.getBottomEndCorner();
|
191
|
-
const visitedHorizontalCells = new WeakSet();
|
192
|
+
buildFocusOrder(selectedRanges) {
|
192
193
|
_classPrivateFieldSet(_cellsHorizontalOrder, this, new _linkedList.default());
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
if (_classPrivateFieldGet(_columnIndexMapper, this).isHidden(c)) {
|
194
|
+
selectedRanges.forEach((range, selectionLayer) => {
|
195
|
+
const visitedHorizontalCells = new WeakSet();
|
196
|
+
const topStart = range.getTopStartCorner();
|
197
|
+
const bottomEnd = range.getBottomEndCorner();
|
198
|
+
for (let r = topStart.row; r <= bottomEnd.row; r++) {
|
199
|
+
if (_classPrivateFieldGet(_rowIndexMapper, this).isHidden(r)) {
|
200
200
|
// eslint-disable-next-line no-continue
|
201
201
|
continue;
|
202
202
|
}
|
203
|
-
|
204
|
-
|
205
|
-
|
203
|
+
for (let c = topStart.col; c <= bottomEnd.col; c++) {
|
204
|
+
if (_classPrivateFieldGet(_columnIndexMapper, this).isHidden(c)) {
|
205
|
+
// eslint-disable-next-line no-continue
|
206
|
+
continue;
|
207
|
+
}
|
208
|
+
const node = _assertClassBrand(_FocusOrder_brand, this, _pushOrderNode).call(this, {
|
209
|
+
selectedRange: range,
|
210
|
+
selectionLayer,
|
211
|
+
listOrder: _classPrivateFieldGet(_cellsHorizontalOrder, this),
|
212
|
+
mergeCellsVisitor: visitedHorizontalCells,
|
213
|
+
row: r,
|
214
|
+
column: c
|
215
|
+
});
|
216
|
+
if (node) {
|
217
|
+
_classPrivateFieldSet(_currentHorizontalLinkedNode, this, node);
|
218
|
+
}
|
206
219
|
}
|
207
220
|
}
|
208
|
-
}
|
221
|
+
});
|
209
222
|
|
210
223
|
// create circular linked list
|
211
224
|
if (_classPrivateFieldGet(_cellsHorizontalOrder, this).first) {
|
212
225
|
_classPrivateFieldGet(_cellsHorizontalOrder, this).first.prev = _classPrivateFieldGet(_cellsHorizontalOrder, this).last;
|
213
226
|
_classPrivateFieldGet(_cellsHorizontalOrder, this).last.next = _classPrivateFieldGet(_cellsHorizontalOrder, this).first;
|
214
227
|
}
|
215
|
-
const visitedVerticalCells = new WeakSet();
|
216
228
|
_classPrivateFieldSet(_cellsVerticalOrder, this, new _linkedList.default());
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
if (_classPrivateFieldGet(_rowIndexMapper, this).isHidden(r)) {
|
229
|
+
selectedRanges.forEach((range, selectionLayer) => {
|
230
|
+
const visitedVerticalCells = new WeakSet();
|
231
|
+
const topStart = range.getTopStartCorner();
|
232
|
+
const bottomEnd = range.getBottomEndCorner();
|
233
|
+
for (let c = topStart.col; c <= bottomEnd.col; c++) {
|
234
|
+
if (_classPrivateFieldGet(_columnIndexMapper, this).isHidden(c)) {
|
224
235
|
// eslint-disable-next-line no-continue
|
225
236
|
continue;
|
226
237
|
}
|
227
|
-
|
228
|
-
|
229
|
-
|
238
|
+
for (let r = topStart.row; r <= bottomEnd.row; r++) {
|
239
|
+
if (_classPrivateFieldGet(_rowIndexMapper, this).isHidden(r)) {
|
240
|
+
// eslint-disable-next-line no-continue
|
241
|
+
continue;
|
242
|
+
}
|
243
|
+
const node = _assertClassBrand(_FocusOrder_brand, this, _pushOrderNode).call(this, {
|
244
|
+
selectedRange: range,
|
245
|
+
selectionLayer,
|
246
|
+
listOrder: _classPrivateFieldGet(_cellsVerticalOrder, this),
|
247
|
+
mergeCellsVisitor: visitedVerticalCells,
|
248
|
+
row: r,
|
249
|
+
column: c
|
250
|
+
});
|
251
|
+
if (node) {
|
252
|
+
_classPrivateFieldSet(_currentVerticalLinkedNode, this, node);
|
253
|
+
}
|
230
254
|
}
|
231
255
|
}
|
232
|
-
}
|
256
|
+
});
|
233
257
|
|
234
258
|
// create circular linked list
|
235
259
|
if (_classPrivateFieldGet(_cellsVerticalOrder, this).first) {
|
@@ -242,38 +266,49 @@ class FocusOrder {
|
|
242
266
|
*
|
243
267
|
* @param {number} row The visual row index.
|
244
268
|
* @param {number} column The visual column index.
|
269
|
+
* @param {number} selectionLayerIndex The index of the selection layer to which the focus should be marked as active.
|
245
270
|
* @returns {FocusOrder}
|
246
271
|
*/
|
247
|
-
setActiveNode(row, column) {
|
272
|
+
setActiveNode(row, column, selectionLayerIndex) {
|
248
273
|
_classPrivateFieldGet(_cellsHorizontalOrder, this).inorder(node => {
|
249
274
|
const {
|
275
|
+
selectionLayer,
|
250
276
|
rowStart,
|
251
277
|
rowEnd,
|
252
278
|
colStart,
|
253
279
|
colEnd
|
254
280
|
} = node.data;
|
255
|
-
if (row >= rowStart && row <= rowEnd && column >= colStart && column <= colEnd) {
|
281
|
+
if (selectionLayer === selectionLayerIndex && row >= rowStart && row <= rowEnd && column >= colStart && column <= colEnd) {
|
256
282
|
_classPrivateFieldSet(_currentHorizontalLinkedNode, this, node);
|
257
|
-
return
|
283
|
+
return true;
|
258
284
|
}
|
259
285
|
});
|
260
286
|
_classPrivateFieldGet(_cellsVerticalOrder, this).inorder(node => {
|
261
287
|
const {
|
288
|
+
selectionLayer,
|
262
289
|
rowStart,
|
263
290
|
rowEnd,
|
264
291
|
colStart,
|
265
292
|
colEnd
|
266
293
|
} = node.data;
|
267
|
-
if (row >= rowStart && row <= rowEnd && column >= colStart && column <= colEnd) {
|
294
|
+
if (selectionLayer === selectionLayerIndex && row >= rowStart && row <= rowEnd && column >= colStart && column <= colEnd) {
|
268
295
|
_classPrivateFieldSet(_currentVerticalLinkedNode, this, node);
|
269
|
-
return
|
296
|
+
return true;
|
270
297
|
}
|
271
298
|
});
|
272
299
|
return this;
|
273
300
|
}
|
274
301
|
}
|
275
302
|
exports.FocusOrder = FocusOrder;
|
276
|
-
function _pushOrderNode(
|
303
|
+
function _pushOrderNode(_ref2) {
|
304
|
+
let {
|
305
|
+
selectedRange,
|
306
|
+
selectionLayer,
|
307
|
+
listOrder,
|
308
|
+
mergeCellsVisitor,
|
309
|
+
row,
|
310
|
+
column
|
311
|
+
} = _ref2;
|
277
312
|
const topStart = selectedRange.getTopStartCorner();
|
278
313
|
const bottomEnd = selectedRange.getBottomEndCorner();
|
279
314
|
const highlight = selectedRange.highlight.clone().normalize();
|
@@ -282,6 +317,7 @@ function _pushOrderNode(selectedRange, listOrder, mergeCellsVisitor, row, column
|
|
282
317
|
return null;
|
283
318
|
}
|
284
319
|
const node = {
|
320
|
+
selectionLayer,
|
285
321
|
colStart: column,
|
286
322
|
colEnd: column,
|
287
323
|
rowStart: row,
|