handsontable 15.2.0 → 15.3.0-next-6f5f494-20250424
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/cell/range.js +14 -0
- package/3rdparty/walkontable/src/cell/range.mjs +14 -0
- package/3rdparty/walkontable/src/core/_base.js +2 -2
- package/3rdparty/walkontable/src/core/_base.mjs +3 -3
- package/3rdparty/walkontable/src/overlay/_base.js +0 -2
- package/3rdparty/walkontable/src/overlay/_base.mjs +0 -2
- package/3rdparty/walkontable/src/overlay/bottom.js +9 -6
- package/3rdparty/walkontable/src/overlay/bottom.mjs +9 -6
- package/3rdparty/walkontable/src/overlay/inlineStart.js +8 -5
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +8 -5
- package/3rdparty/walkontable/src/overlay/top.js +11 -6
- package/3rdparty/walkontable/src/overlay/top.mjs +11 -6
- package/3rdparty/walkontable/src/overlays.js +15 -11
- package/3rdparty/walkontable/src/overlays.mjs +15 -11
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +4 -1
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +4 -1
- package/3rdparty/walkontable/src/selection/border/border.js +5 -0
- package/3rdparty/walkontable/src/selection/border/border.mjs +5 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +3 -4
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +3 -4
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +8 -10
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +8 -10
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +3 -4
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +3 -4
- package/3rdparty/walkontable/src/table.js +5 -2
- package/3rdparty/walkontable/src/table.mjs +5 -2
- package/3rdparty/walkontable/src/utils/orderView/viewDiffer/viewOrder.js +0 -2
- package/3rdparty/walkontable/src/utils/orderView/viewDiffer/viewOrder.mjs +0 -2
- package/CHANGELOG.md +45 -1
- package/README.md +1 -1
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/focusCatcher/focusDetector.js +1 -1
- package/core/focusCatcher/focusDetector.mjs +2 -2
- package/core/hooks/constants.js +8 -0
- package/core/hooks/constants.mjs +8 -0
- package/core/hooks/index.d.ts +1 -0
- package/core/viewportScroll/scrollStrategies/columnHeaderScroll.js +7 -5
- package/core/viewportScroll/scrollStrategies/columnHeaderScroll.mjs +7 -5
- package/core/viewportScroll/scrollStrategies/focusScroll.js +8 -1
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +8 -1
- package/core/viewportScroll/scrollStrategies/multipleScroll.js +13 -1
- package/core/viewportScroll/scrollStrategies/multipleScroll.mjs +13 -1
- package/core/viewportScroll/scrollStrategies/noncontiguousScroll.js +13 -1
- package/core/viewportScroll/scrollStrategies/noncontiguousScroll.mjs +13 -1
- package/core/viewportScroll/scrollStrategies/rowHeaderScroll.js +7 -5
- package/core/viewportScroll/scrollStrategies/rowHeaderScroll.mjs +7 -5
- package/core/viewportScroll/scrollStrategies/singleScroll.js +8 -4
- package/core/viewportScroll/scrollStrategies/singleScroll.mjs +8 -4
- package/core/viewportScroll/utils.js +111 -0
- package/core/viewportScroll/utils.mjs +106 -0
- package/core.d.ts +2 -3
- package/core.js +125 -71
- package/core.mjs +126 -72
- package/dataMap/dataMap.js +0 -7
- package/dataMap/dataMap.mjs +0 -7
- package/dataMap/metaManager/index.js +8 -9
- package/dataMap/metaManager/index.mjs +8 -9
- package/dataMap/metaManager/mods/dynamicCellMeta.js +4 -1
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +4 -1
- package/dist/handsontable.css +4 -15
- package/dist/handsontable.full.css +4 -17
- package/dist/handsontable.full.js +4573 -4013
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +148 -148
- package/dist/handsontable.js +4287 -3730
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +19 -19
- package/editorManager.js +1 -7
- package/editorManager.mjs +1 -7
- package/editors/autocompleteEditor/autocompleteEditor.js +31 -7
- package/editors/autocompleteEditor/autocompleteEditor.mjs +31 -7
- package/focusManager.js +4 -2
- package/focusManager.mjs +4 -2
- package/helpers/browser.js +1 -1
- package/helpers/browser.mjs +1 -1
- package/helpers/dom/element.d.ts +1 -0
- package/helpers/dom/element.js +20 -0
- package/helpers/dom/element.mjs +19 -0
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/helpers/object.js +3 -0
- package/helpers/object.mjs +3 -0
- package/package.json +1 -1
- package/plugins/autoColumnSize/autoColumnSize.js +38 -17
- package/plugins/autoColumnSize/autoColumnSize.mjs +38 -17
- package/plugins/autoRowSize/autoRowSize.js +12 -6
- package/plugins/autoRowSize/autoRowSize.mjs +12 -6
- package/plugins/columnSorting/columnSorting.js +0 -4
- package/plugins/columnSorting/columnSorting.mjs +0 -4
- package/plugins/comments/comments.js +1 -0
- package/plugins/comments/comments.mjs +1 -0
- package/plugins/contextMenu/menu/defaultShortcutsList.js +2 -2
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +2 -2
- package/plugins/contextMenu/menu/menu.js +1 -0
- package/plugins/contextMenu/menu/menu.mjs +1 -0
- package/plugins/contextMenu/menu/positioner.js +10 -2
- package/plugins/contextMenu/menu/positioner.mjs +10 -2
- package/plugins/contextMenu/predefinedItems/redo.js +3 -3
- package/plugins/contextMenu/predefinedItems/redo.mjs +3 -3
- package/plugins/contextMenu/predefinedItems/undo.js +3 -3
- package/plugins/contextMenu/predefinedItems/undo.mjs +3 -3
- package/plugins/copyPaste/copyPaste.js +12 -9
- package/plugins/copyPaste/copyPaste.mjs +12 -9
- package/plugins/copyPaste/pasteEvent.js +3 -0
- package/plugins/copyPaste/pasteEvent.mjs +3 -0
- package/plugins/exportFile/exportFile.d.ts +1 -0
- package/plugins/exportFile/exportFile.js +2 -1
- package/plugins/exportFile/exportFile.mjs +2 -1
- package/plugins/exportFile/types/csv.js +76 -11
- package/plugins/exportFile/types/csv.mjs +76 -11
- package/plugins/filters/filters.js +24 -23
- package/plugins/filters/filters.mjs +24 -23
- package/plugins/filters/ui/multipleSelect.js +7 -1
- package/plugins/filters/ui/multipleSelect.mjs +7 -1
- package/plugins/formulas/formulas.d.ts +1 -1
- package/plugins/formulas/formulas.js +57 -60
- package/plugins/formulas/formulas.mjs +59 -62
- package/plugins/formulas/indexSyncer/axisSyncer.js +5 -1
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +5 -1
- package/plugins/hiddenColumns/hiddenColumns.js +1 -1
- package/plugins/hiddenColumns/hiddenColumns.mjs +1 -1
- package/plugins/hiddenRows/hiddenRows.js +1 -1
- package/plugins/hiddenRows/hiddenRows.mjs +1 -1
- package/plugins/manualColumnResize/manualColumnResize.js +4 -6
- package/plugins/manualColumnResize/manualColumnResize.mjs +4 -6
- package/plugins/manualRowResize/manualRowResize.js +4 -6
- package/plugins/manualRowResize/manualRowResize.mjs +4 -6
- package/plugins/mergeCells/mergeCells.js +10 -30
- package/plugins/mergeCells/mergeCells.mjs +10 -30
- package/plugins/mergeCells/renderer.js +15 -0
- package/plugins/mergeCells/renderer.mjs +15 -0
- package/plugins/mergeCells/utils.js +31 -0
- package/plugins/mergeCells/utils.mjs +27 -0
- package/plugins/nestedRows/data/dataManager.js +2 -2
- package/plugins/nestedRows/data/dataManager.mjs +2 -2
- package/plugins/undoRedo/actions/index.js +0 -2
- package/plugins/undoRedo/actions/index.mjs +0 -2
- package/plugins/undoRedo/actions/removeColumn.js +19 -14
- package/plugins/undoRedo/actions/removeColumn.mjs +19 -14
- package/plugins/undoRedo/actions/removeRow.js +12 -4
- package/plugins/undoRedo/actions/removeRow.mjs +12 -4
- package/selection/selection.js +3 -1
- package/selection/selection.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/down.js +7 -2
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +7 -2
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +8 -2
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +8 -2
- package/shortcutContexts/commands/extendCellsSelection/left.js +7 -2
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +7 -2
- package/shortcutContexts/commands/extendCellsSelection/right.js +7 -2
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +7 -2
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +7 -2
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +7 -2
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +7 -2
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +7 -2
- package/shortcutContexts/commands/extendCellsSelection/up.js +7 -2
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +7 -2
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +8 -2
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +8 -2
- package/shortcutContexts/commands/index.js +0 -2
- package/shortcutContexts/commands/index.mjs +0 -2
- package/shortcutContexts/commands/moveCellSelection/down.js +2 -0
- package/shortcutContexts/commands/moveCellSelection/down.mjs +2 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +6 -1
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +6 -1
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +8 -3
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +8 -3
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +8 -3
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +8 -3
- package/shortcutContexts/commands/moveCellSelection/left.js +6 -1
- package/shortcutContexts/commands/moveCellSelection/left.mjs +6 -1
- package/shortcutContexts/commands/moveCellSelection/right.js +6 -1
- package/shortcutContexts/commands/moveCellSelection/right.mjs +6 -1
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +4 -1
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +4 -1
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +2 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +2 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +2 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +2 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +2 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +2 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +2 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +2 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +2 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +2 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +6 -1
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +6 -1
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +2 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +2 -0
- package/shortcutContexts/commands/moveCellSelection/up.js +2 -0
- package/shortcutContexts/commands/moveCellSelection/up.mjs +2 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +6 -1
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +6 -1
- package/shortcutContexts/commands/selectAllCells.js +7 -2
- package/shortcutContexts/commands/selectAllCells.mjs +7 -2
- package/shortcutContexts/commands/selectAllCellsAndHeaders.js +7 -2
- package/shortcutContexts/commands/selectAllCellsAndHeaders.mjs +7 -2
- package/shortcutContexts/index.js +2 -2
- package/shortcutContexts/index.mjs +0 -2
- package/styles/handsontable.css +15 -17
- package/styles/handsontable.min.css +3 -3
- package/styles/ht-theme-horizon.css +2 -2
- package/styles/ht-theme-horizon.min.css +2 -2
- package/styles/ht-theme-main.css +2 -2
- package/styles/ht-theme-main.min.css +2 -2
- package/tableView.js +5 -8
- package/tableView.mjs +5 -8
- package/translations/indexMapper.js +0 -1
- package/translations/indexMapper.mjs +0 -1
- package/utils/ghostTable.js +3 -0
- package/utils/ghostTable.mjs +3 -0
package/CHANGELOG.md
CHANGED
@@ -9,6 +9,51 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
9
9
|
|
10
10
|
<!-- UNVERSIONED -->
|
11
11
|
|
12
|
+
## [15.3.0] - 2025-04-29
|
13
|
+
|
14
|
+
### Added
|
15
|
+
- Added missing boolean type to the editor in the react wrapper [#11514](https://github.com/handsontable/handsontable/pull/11514)
|
16
|
+
- Fixed comments for IME and add a new `beforeCompositionstart` hook. [#11521](https://github.com/handsontable/handsontable/pull/11521)
|
17
|
+
- Added horizontal scroll to the Filter's by value component [#11561](https://github.com/handsontable/handsontable/pull/11561)
|
18
|
+
- Add optional formula sanitization for csv export to prevent CSV Injection attacks [#11592](https://github.com/handsontable/handsontable/pull/11592)
|
19
|
+
|
20
|
+
### Changed
|
21
|
+
- Improved the initialization time of Handsontable with formulas enabled [#11474](https://github.com/handsontable/handsontable/pull/11474)
|
22
|
+
- Changed the size of the manual row and row resize guide line [#11507](https://github.com/handsontable/handsontable/pull/11507)
|
23
|
+
- Improve viewport scrolling behavior [#11577](https://github.com/handsontable/handsontable/pull/11577)
|
24
|
+
|
25
|
+
### Fixed
|
26
|
+
- Fixing issue with NestedRows plugin duplicating rows when moving children [#11362](https://github.com/handsontable/handsontable/pull/11362)
|
27
|
+
- Fixed an issue with row resize line alignment and resize handle flickering [#11500](https://github.com/handsontable/handsontable/pull/11500)
|
28
|
+
- Fixed an issue with autocomplete caret position after using scroll on a list of choices and dropdown width fixer [#11503](https://github.com/handsontable/handsontable/pull/11503)
|
29
|
+
- Fixed copy, cut an paste actions on tables with a selection reaching outside of the rendered viewport. [#11504](https://github.com/handsontable/handsontable/pull/11504)
|
30
|
+
- Fix submenu positiongin for all themes. [#11505](https://github.com/handsontable/handsontable/pull/11505)
|
31
|
+
- Fixed a problem where re-enabling the Hidden Columns configuration caused an error to be thrown if a selection was a part of the hidden range. [#11508](https://github.com/handsontable/handsontable/pull/11508)
|
32
|
+
- Fixed an issue with empty parentNode in the table getCords method [#11509](https://github.com/handsontable/handsontable/pull/11509)
|
33
|
+
- Improved undo/redo working for removed rows/columns [#11515](https://github.com/handsontable/handsontable/pull/11515)
|
34
|
+
- Fixed rows height calculations for merged cells on Safari [#11517](https://github.com/handsontable/handsontable/pull/11517)
|
35
|
+
- Fixed missing (incorrect) render call after dataset change [#11529](https://github.com/handsontable/handsontable/pull/11529)
|
36
|
+
- Fixed an issue with the mobile keyboard closing after clicking the filter search input on Android devices [#11532](https://github.com/handsontable/handsontable/pull/11532)
|
37
|
+
- Fixed a problem with multiple row header levels being rendered in reverse order. [#11533](https://github.com/handsontable/handsontable/pull/11533)
|
38
|
+
- Fixed `TypeError` error for AutoRowSize plugin [#11537](https://github.com/handsontable/handsontable/pull/11537)
|
39
|
+
- Allow changing the selection after filter is applied [#11538](https://github.com/handsontable/handsontable/pull/11538)
|
40
|
+
- Fixed a problem with the autocomplete editor rendering very slowly when provided with a long list of choices. [#11552](https://github.com/handsontable/handsontable/pull/11552)
|
41
|
+
- Fixed an issue with focus catcher accessibility [#11553](https://github.com/handsontable/handsontable/pull/11553)
|
42
|
+
- Fixed `TypeError` for rows removal for bottom overlay [#11555](https://github.com/handsontable/handsontable/pull/11555)
|
43
|
+
- Fixed calculating the first row height [#11557](https://github.com/handsontable/handsontable/pull/11557)
|
44
|
+
- Fixed an issue with highlighting the cell after call updateData [#11558](https://github.com/handsontable/handsontable/pull/11558)
|
45
|
+
- Fixed unmerge cells action triggered form keyboard shortcut [#11559](https://github.com/handsontable/handsontable/pull/11559)
|
46
|
+
- Fixed arrow left/right shortcuts for menu when the table was configured as `layoutDirection: rtl`. [#11562](https://github.com/handsontable/handsontable/pull/11562)
|
47
|
+
- Fixed an issue with duplicate boolean values in filters [#11563](https://github.com/handsontable/handsontable/pull/11563)
|
48
|
+
- Fixed an issue with data source for non-string values in the `name` property [#11565](https://github.com/handsontable/handsontable/pull/11565)
|
49
|
+
- Fixed settings object not being updated after new hooks [#11566](https://github.com/handsontable/handsontable/pull/11566)
|
50
|
+
- Fixed a problem with the table rendering all rows when it's configured to have `0px` height. [#11567](https://github.com/handsontable/handsontable/pull/11567)
|
51
|
+
- Fixed copy/paste/cut functionalities for web components [#11572](https://github.com/handsontable/handsontable/pull/11572)
|
52
|
+
- Fixed the `allowInvalid` option (both `true` and `false`) for the Dropdown Editor. [#11587](https://github.com/handsontable/handsontable/pull/11587)
|
53
|
+
- Fixed a problem with a deprecation warnings being thrown when using Context Menu's Undo and Redo items. [#11588](https://github.com/handsontable/handsontable/pull/11588)
|
54
|
+
- Fixed an error being thrown when editing a Autocomplete-typed cells with a long list of choices rendered in a small container. [#11589](https://github.com/handsontable/handsontable/pull/11589)
|
55
|
+
- Ensured that there's a single `@charset` entry in the classic theme's CSS files and that it's placed at the beginning of those files. [#11591](https://github.com/handsontable/handsontable/pull/11591)
|
56
|
+
|
12
57
|
## [15.2.0] - 2025-03-19
|
13
58
|
|
14
59
|
### Added
|
@@ -32,7 +77,6 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
32
77
|
- Fixed the Context Menu's items' state rendering. [#11422](https://github.com/handsontable/handsontable/pull/11422)
|
33
78
|
- Corrected the checkbox visibility in the no-theme variant. [#11427](https://github.com/handsontable/handsontable/pull/11427)
|
34
79
|
- Fixed problems with the cell content reading with `imeFastEdit` enabled. [#11442](https://github.com/handsontable/handsontable/pull/11442)
|
35
|
-
- Fixed a problem, where clicking on the Comments' editor element deselected the currently selected cells. [#11446](https://github.com/handsontable/handsontable/pull/11446)
|
36
80
|
- Fixed `hasVerticalScroll` and `hasHorizontalScroll` methods. [#11455](https://github.com/handsontable/handsontable/pull/11455)
|
37
81
|
- Fixed the editor border radius on mobile devices. [#11457](https://github.com/handsontable/handsontable/pull/11457)
|
38
82
|
- Fixed the wrong height of the first row. [#11458](https://github.com/handsontable/handsontable/pull/11458)
|
package/README.md
CHANGED
@@ -81,7 +81,7 @@ You can also use [Yarn](https://yarnpkg.com/package/handsontable), [NuGet](https
|
|
81
81
|
|
82
82
|
```html
|
83
83
|
<!-- Set the container's ID and apply the desired theme -->
|
84
|
-
<div id="handsontable-
|
84
|
+
<div id="handsontable-grid" class="ht-theme-main-dark-auto"></div>
|
85
85
|
```
|
86
86
|
|
87
87
|
### Setup
|
package/base.js
CHANGED
@@ -45,8 +45,8 @@ Handsontable.hooks = _hooks.Hooks.getSingleton();
|
|
45
45
|
Handsontable.CellCoords = _src.CellCoords;
|
46
46
|
Handsontable.CellRange = _src.CellRange;
|
47
47
|
Handsontable.packageName = 'handsontable';
|
48
|
-
Handsontable.buildDate = "
|
49
|
-
Handsontable.version = "15.
|
48
|
+
Handsontable.buildDate = "24/04/2025 11:28:31";
|
49
|
+
Handsontable.version = "15.3.0-next-6f5f494-20250424";
|
50
50
|
Handsontable.languages = {
|
51
51
|
dictionaryKeys: _registry.dictionaryKeys,
|
52
52
|
getLanguageDictionary: _registry.getLanguageDictionary,
|
package/base.mjs
CHANGED
@@ -35,8 +35,8 @@ Handsontable.hooks = Hooks.getSingleton();
|
|
35
35
|
Handsontable.CellCoords = CellCoords;
|
36
36
|
Handsontable.CellRange = CellRange;
|
37
37
|
Handsontable.packageName = 'handsontable';
|
38
|
-
Handsontable.buildDate = "
|
39
|
-
Handsontable.version = "15.
|
38
|
+
Handsontable.buildDate = "24/04/2025 11:28:36";
|
39
|
+
Handsontable.version = "15.3.0-next-6f5f494-20250424";
|
40
40
|
Handsontable.languages = {
|
41
41
|
dictionaryKeys,
|
42
42
|
getLanguageDictionary,
|
@@ -58,7 +58,7 @@ function createInputElement(hot) {
|
|
58
58
|
input.name = '__htFocusCatcher';
|
59
59
|
input.classList.add('htFocusCatcher');
|
60
60
|
if (hot.getSettings().ariaTags) {
|
61
|
-
(0, _element.setAttribute)(input, [(0, _a11y.
|
61
|
+
(0, _element.setAttribute)(input, [(0, _a11y.A11Y_LABEL)('Focus catcher')]);
|
62
62
|
}
|
63
63
|
return input;
|
64
64
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { setAttribute } from "../../helpers/dom/element.mjs";
|
2
|
-
import {
|
2
|
+
import { A11Y_LABEL } from "../../helpers/a11y.mjs";
|
3
3
|
/**
|
4
4
|
* Installs a focus detector module. The module appends two input elements into the DOM side by side.
|
5
5
|
* When the first input is focused, then it means that a user entered to the component using the TAB key
|
@@ -54,7 +54,7 @@ function createInputElement(hot) {
|
|
54
54
|
input.name = '__htFocusCatcher';
|
55
55
|
input.classList.add('htFocusCatcher');
|
56
56
|
if (hot.getSettings().ariaTags) {
|
57
|
-
setAttribute(input, [
|
57
|
+
setAttribute(input, [A11Y_LABEL('Focus catcher')]);
|
58
58
|
}
|
59
59
|
return input;
|
60
60
|
}
|
package/core/hooks/constants.js
CHANGED
@@ -336,6 +336,14 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
|
|
336
336
|
* @returns {string[]|undefined} Can return an `Array` of `String`s. Each of these strings will act like class names to be removed from all the cells in the table.
|
337
337
|
*/
|
338
338
|
'beforeRemoveCellClassNames',
|
339
|
+
/**
|
340
|
+
* Hook fired after `compositionstart` event is handled.
|
341
|
+
*
|
342
|
+
* @event Hooks#beforeCompositionStart
|
343
|
+
* @since 15.3.0
|
344
|
+
* @param {Event} event A native `composition` event object.
|
345
|
+
*/
|
346
|
+
'beforeCompositionStart',
|
339
347
|
/**
|
340
348
|
* Fired after getting the cell settings.
|
341
349
|
*
|
package/core/hooks/constants.mjs
CHANGED
@@ -333,6 +333,14 @@ export const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-com
|
|
333
333
|
* @returns {string[]|undefined} Can return an `Array` of `String`s. Each of these strings will act like class names to be removed from all the cells in the table.
|
334
334
|
*/
|
335
335
|
'beforeRemoveCellClassNames',
|
336
|
+
/**
|
337
|
+
* Hook fired after `compositionstart` event is handled.
|
338
|
+
*
|
339
|
+
* @event Hooks#beforeCompositionStart
|
340
|
+
* @since 15.3.0
|
341
|
+
* @param {Event} event A native `composition` event object.
|
342
|
+
*/
|
343
|
+
'beforeCompositionStart',
|
336
344
|
/**
|
337
345
|
* Fired after getting the cell settings.
|
338
346
|
*
|
package/core/hooks/index.d.ts
CHANGED
@@ -167,6 +167,7 @@ export interface Events {
|
|
167
167
|
beforeColumnSort?: (currentSortConfig: ColumnSortingConfig[], destinationSortConfigs: ColumnSortingConfig[]) => void | boolean;
|
168
168
|
beforeColumnWrap?: (isActionInterrupted: { value: boolean }, newCoords: CellCoords, isColumnFlipped: boolean) => void;
|
169
169
|
beforeColumnUnfreeze?: (columnIndex: number, isUnfreezingPerformed: boolean) => void | boolean;
|
170
|
+
beforeCompositionStart?: (event: CompositionEvent) => void;
|
170
171
|
beforeContextMenuSetItems?: (menuItems: ContextMenuMenuItemConfig[]) => void;
|
171
172
|
beforeContextMenuShow?: (context: ContextMenu) => void;
|
172
173
|
beforeCopy?: (data: CellValue[][], coords: RangeType[], copiedHeadersCount: { columnHeadersCount: number }) => void | boolean;
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
exports.columnHeaderScrollStrategy = columnHeaderScrollStrategy;
|
5
|
+
var _utils = require("../utils");
|
5
6
|
/**
|
6
7
|
* Scroll strategy for column header selection.
|
7
8
|
*
|
@@ -9,12 +10,13 @@ exports.columnHeaderScrollStrategy = columnHeaderScrollStrategy;
|
|
9
10
|
* @returns {function(): function(CellCoords): void}
|
10
11
|
*/
|
11
12
|
function columnHeaderScrollStrategy(hot) {
|
12
|
-
return
|
13
|
-
|
14
|
-
col
|
15
|
-
} = _ref;
|
13
|
+
return cellCoords => {
|
14
|
+
const scrollColumnTarget = (0, _utils.createScrollTargetCalculator)(hot).getComputedColumnTarget(cellCoords);
|
16
15
|
hot.scrollViewportTo({
|
17
|
-
col
|
16
|
+
col: scrollColumnTarget
|
17
|
+
}, () => {
|
18
|
+
const hasColumnHeaders = !!hot.getSettings().colHeaders;
|
19
|
+
(0, _utils.scrollWindowToCell)(hot.getCell(hasColumnHeaders ? -1 : 0, scrollColumnTarget, true));
|
18
20
|
});
|
19
21
|
};
|
20
22
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { scrollWindowToCell, createScrollTargetCalculator } from "../utils.mjs";
|
1
2
|
/**
|
2
3
|
* Scroll strategy for column header selection.
|
3
4
|
*
|
@@ -5,12 +6,13 @@
|
|
5
6
|
* @returns {function(): function(CellCoords): void}
|
6
7
|
*/
|
7
8
|
export function columnHeaderScrollStrategy(hot) {
|
8
|
-
return
|
9
|
-
|
10
|
-
col
|
11
|
-
} = _ref;
|
9
|
+
return cellCoords => {
|
10
|
+
const scrollColumnTarget = createScrollTargetCalculator(hot).getComputedColumnTarget(cellCoords);
|
12
11
|
hot.scrollViewportTo({
|
13
|
-
col
|
12
|
+
col: scrollColumnTarget
|
13
|
+
}, () => {
|
14
|
+
const hasColumnHeaders = !!hot.getSettings().colHeaders;
|
15
|
+
scrollWindowToCell(hot.getCell(hasColumnHeaders ? -1 : 0, scrollColumnTarget, true));
|
14
16
|
});
|
15
17
|
};
|
16
18
|
}
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
exports.focusScrollStrategy = focusScrollStrategy;
|
5
|
+
var _utils = require("../utils");
|
5
6
|
/**
|
6
7
|
* Scroll strategy for changed the focus position of the selection.
|
7
8
|
*
|
@@ -10,6 +11,12 @@ exports.focusScrollStrategy = focusScrollStrategy;
|
|
10
11
|
*/
|
11
12
|
function focusScrollStrategy(hot) {
|
12
13
|
return cellCoords => {
|
13
|
-
hot.scrollViewportTo(cellCoords.toObject())
|
14
|
+
hot.scrollViewportTo(cellCoords.toObject(), () => {
|
15
|
+
const {
|
16
|
+
row,
|
17
|
+
col
|
18
|
+
} = hot.getSelectedRangeLast().highlight;
|
19
|
+
(0, _utils.scrollWindowToCell)(hot.getCell(row, col, true));
|
20
|
+
});
|
14
21
|
};
|
15
22
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { scrollWindowToCell } from "../utils.mjs";
|
1
2
|
/**
|
2
3
|
* Scroll strategy for changed the focus position of the selection.
|
3
4
|
*
|
@@ -6,6 +7,12 @@
|
|
6
7
|
*/
|
7
8
|
export function focusScrollStrategy(hot) {
|
8
9
|
return cellCoords => {
|
9
|
-
hot.scrollViewportTo(cellCoords.toObject())
|
10
|
+
hot.scrollViewportTo(cellCoords.toObject(), () => {
|
11
|
+
const {
|
12
|
+
row,
|
13
|
+
col
|
14
|
+
} = hot.getSelectedRangeLast().highlight;
|
15
|
+
scrollWindowToCell(hot.getCell(row, col, true));
|
16
|
+
});
|
10
17
|
};
|
11
18
|
}
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
exports.multipleScrollStrategy = multipleScrollStrategy;
|
5
|
+
var _utils = require("../utils");
|
5
6
|
/**
|
6
7
|
* Scroll strategy for multiple selections.
|
7
8
|
*
|
@@ -10,6 +11,17 @@ exports.multipleScrollStrategy = multipleScrollStrategy;
|
|
10
11
|
*/
|
11
12
|
function multipleScrollStrategy(hot) {
|
12
13
|
return cellCoords => {
|
13
|
-
|
14
|
+
const scrollTargetCalc = (0, _utils.createScrollTargetCalculator)(hot);
|
15
|
+
const targetScroll = {
|
16
|
+
row: scrollTargetCalc.getComputedRowTarget(cellCoords),
|
17
|
+
col: scrollTargetCalc.getComputedColumnTarget(cellCoords)
|
18
|
+
};
|
19
|
+
hot.scrollViewportTo(targetScroll, () => {
|
20
|
+
const {
|
21
|
+
row,
|
22
|
+
col
|
23
|
+
} = targetScroll;
|
24
|
+
(0, _utils.scrollWindowToCell)(hot.getCell(row, col, true));
|
25
|
+
});
|
14
26
|
};
|
15
27
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { scrollWindowToCell, createScrollTargetCalculator } from "../utils.mjs";
|
1
2
|
/**
|
2
3
|
* Scroll strategy for multiple selections.
|
3
4
|
*
|
@@ -6,6 +7,17 @@
|
|
6
7
|
*/
|
7
8
|
export function multipleScrollStrategy(hot) {
|
8
9
|
return cellCoords => {
|
9
|
-
hot
|
10
|
+
const scrollTargetCalc = createScrollTargetCalculator(hot);
|
11
|
+
const targetScroll = {
|
12
|
+
row: scrollTargetCalc.getComputedRowTarget(cellCoords),
|
13
|
+
col: scrollTargetCalc.getComputedColumnTarget(cellCoords)
|
14
|
+
};
|
15
|
+
hot.scrollViewportTo(targetScroll, () => {
|
16
|
+
const {
|
17
|
+
row,
|
18
|
+
col
|
19
|
+
} = targetScroll;
|
20
|
+
scrollWindowToCell(hot.getCell(row, col, true));
|
21
|
+
});
|
10
22
|
};
|
11
23
|
}
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
exports.noncontiguousScrollStrategy = noncontiguousScrollStrategy;
|
5
|
+
var _utils = require("../utils");
|
5
6
|
/**
|
6
7
|
* Scroll strategy for non-contiguous selections.
|
7
8
|
*
|
@@ -10,6 +11,17 @@ exports.noncontiguousScrollStrategy = noncontiguousScrollStrategy;
|
|
10
11
|
*/
|
11
12
|
function noncontiguousScrollStrategy(hot) {
|
12
13
|
return cellCoords => {
|
13
|
-
|
14
|
+
const scrollTargetCalc = (0, _utils.createScrollTargetCalculator)(hot);
|
15
|
+
const targetScroll = {
|
16
|
+
row: scrollTargetCalc.getComputedRowTarget(cellCoords),
|
17
|
+
col: scrollTargetCalc.getComputedColumnTarget(cellCoords)
|
18
|
+
};
|
19
|
+
hot.scrollViewportTo(targetScroll, () => {
|
20
|
+
const {
|
21
|
+
row,
|
22
|
+
col
|
23
|
+
} = targetScroll;
|
24
|
+
(0, _utils.scrollWindowToCell)(hot.getCell(row, col, true));
|
25
|
+
});
|
14
26
|
};
|
15
27
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { scrollWindowToCell, createScrollTargetCalculator } from "../utils.mjs";
|
1
2
|
/**
|
2
3
|
* Scroll strategy for non-contiguous selections.
|
3
4
|
*
|
@@ -6,6 +7,17 @@
|
|
6
7
|
*/
|
7
8
|
export function noncontiguousScrollStrategy(hot) {
|
8
9
|
return cellCoords => {
|
9
|
-
hot
|
10
|
+
const scrollTargetCalc = createScrollTargetCalculator(hot);
|
11
|
+
const targetScroll = {
|
12
|
+
row: scrollTargetCalc.getComputedRowTarget(cellCoords),
|
13
|
+
col: scrollTargetCalc.getComputedColumnTarget(cellCoords)
|
14
|
+
};
|
15
|
+
hot.scrollViewportTo(targetScroll, () => {
|
16
|
+
const {
|
17
|
+
row,
|
18
|
+
col
|
19
|
+
} = targetScroll;
|
20
|
+
scrollWindowToCell(hot.getCell(row, col, true));
|
21
|
+
});
|
10
22
|
};
|
11
23
|
}
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
exports.rowHeaderScrollStrategy = rowHeaderScrollStrategy;
|
5
|
+
var _utils = require("../utils");
|
5
6
|
/**
|
6
7
|
* Scroll strategy for row header selection.
|
7
8
|
*
|
@@ -9,12 +10,13 @@ exports.rowHeaderScrollStrategy = rowHeaderScrollStrategy;
|
|
9
10
|
* @returns {function(): function(CellCoords): void}
|
10
11
|
*/
|
11
12
|
function rowHeaderScrollStrategy(hot) {
|
12
|
-
return
|
13
|
-
|
14
|
-
row
|
15
|
-
} = _ref;
|
13
|
+
return cellCoords => {
|
14
|
+
const scrollRowTarget = (0, _utils.createScrollTargetCalculator)(hot).getComputedRowTarget(cellCoords);
|
16
15
|
hot.scrollViewportTo({
|
17
|
-
row
|
16
|
+
row: scrollRowTarget
|
17
|
+
}, () => {
|
18
|
+
const hasRowHeaders = !!hot.getSettings().rowHeaders;
|
19
|
+
(0, _utils.scrollWindowToCell)(hot.getCell(scrollRowTarget, hasRowHeaders ? -1 : 0, true));
|
18
20
|
});
|
19
21
|
};
|
20
22
|
}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { scrollWindowToCell, createScrollTargetCalculator } from "../utils.mjs";
|
1
2
|
/**
|
2
3
|
* Scroll strategy for row header selection.
|
3
4
|
*
|
@@ -5,12 +6,13 @@
|
|
5
6
|
* @returns {function(): function(CellCoords): void}
|
6
7
|
*/
|
7
8
|
export function rowHeaderScrollStrategy(hot) {
|
8
|
-
return
|
9
|
-
|
10
|
-
row
|
11
|
-
} = _ref;
|
9
|
+
return cellCoords => {
|
10
|
+
const scrollRowTarget = createScrollTargetCalculator(hot).getComputedRowTarget(cellCoords);
|
12
11
|
hot.scrollViewportTo({
|
13
|
-
row
|
12
|
+
row: scrollRowTarget
|
13
|
+
}, () => {
|
14
|
+
const hasRowHeaders = !!hot.getSettings().rowHeaders;
|
15
|
+
scrollWindowToCell(hot.getCell(scrollRowTarget, hasRowHeaders ? -1 : 0, true));
|
14
16
|
});
|
15
17
|
};
|
16
18
|
}
|
@@ -2,11 +2,12 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
exports.singleScrollStrategy = singleScrollStrategy;
|
5
|
+
var _utils = require("../utils");
|
5
6
|
/**
|
6
7
|
* Scroll strategy for single cell selection.
|
7
8
|
*
|
8
9
|
* @param {Core} hot Handsontable instance.
|
9
|
-
* @returns {function(): function(CellCoords):
|
10
|
+
* @returns {function(): function(CellCoords): void}
|
10
11
|
*/
|
11
12
|
function singleScrollStrategy(hot) {
|
12
13
|
return cellCoords => {
|
@@ -15,20 +16,23 @@ function singleScrollStrategy(hot) {
|
|
15
16
|
row,
|
16
17
|
col
|
17
18
|
} = cellCoords;
|
19
|
+
const scrollWindow = () => {
|
20
|
+
(0, _utils.scrollWindowToCell)(hot.getCell(row, col, true));
|
21
|
+
};
|
18
22
|
|
19
23
|
// navigating through the column headers (when `navigableHeaders` is enabled)
|
20
24
|
// scrolls the viewport horizontally only
|
21
25
|
if (row < 0 && col >= 0) {
|
22
26
|
hot.scrollViewportTo({
|
23
27
|
col
|
24
|
-
});
|
28
|
+
}, scrollWindow);
|
25
29
|
|
26
30
|
// navigating through the row headers (when `navigableHeaders` is enabled)
|
27
31
|
// scrolls the viewport vertically only
|
28
32
|
} else if (col < 0 && row >= 0) {
|
29
33
|
hot.scrollViewportTo({
|
30
34
|
row
|
31
|
-
});
|
35
|
+
}, scrollWindow);
|
32
36
|
|
33
37
|
// navigating through the cells
|
34
38
|
} else {
|
@@ -40,7 +44,7 @@ function singleScrollStrategy(hot) {
|
|
40
44
|
hot.scrollViewportTo({
|
41
45
|
row,
|
42
46
|
col
|
43
|
-
});
|
47
|
+
}, scrollWindow);
|
44
48
|
}
|
45
49
|
};
|
46
50
|
}
|
@@ -1,8 +1,9 @@
|
|
1
|
+
import { scrollWindowToCell } from "../utils.mjs";
|
1
2
|
/**
|
2
3
|
* Scroll strategy for single cell selection.
|
3
4
|
*
|
4
5
|
* @param {Core} hot Handsontable instance.
|
5
|
-
* @returns {function(): function(CellCoords):
|
6
|
+
* @returns {function(): function(CellCoords): void}
|
6
7
|
*/
|
7
8
|
export function singleScrollStrategy(hot) {
|
8
9
|
return cellCoords => {
|
@@ -11,20 +12,23 @@ export function singleScrollStrategy(hot) {
|
|
11
12
|
row,
|
12
13
|
col
|
13
14
|
} = cellCoords;
|
15
|
+
const scrollWindow = () => {
|
16
|
+
scrollWindowToCell(hot.getCell(row, col, true));
|
17
|
+
};
|
14
18
|
|
15
19
|
// navigating through the column headers (when `navigableHeaders` is enabled)
|
16
20
|
// scrolls the viewport horizontally only
|
17
21
|
if (row < 0 && col >= 0) {
|
18
22
|
hot.scrollViewportTo({
|
19
23
|
col
|
20
|
-
});
|
24
|
+
}, scrollWindow);
|
21
25
|
|
22
26
|
// navigating through the row headers (when `navigableHeaders` is enabled)
|
23
27
|
// scrolls the viewport vertically only
|
24
28
|
} else if (col < 0 && row >= 0) {
|
25
29
|
hot.scrollViewportTo({
|
26
30
|
row
|
27
|
-
});
|
31
|
+
}, scrollWindow);
|
28
32
|
|
29
33
|
// navigating through the cells
|
30
34
|
} else {
|
@@ -36,7 +40,7 @@ export function singleScrollStrategy(hot) {
|
|
36
40
|
hot.scrollViewportTo({
|
37
41
|
row,
|
38
42
|
col
|
39
|
-
});
|
43
|
+
}, scrollWindow);
|
40
44
|
}
|
41
45
|
};
|
42
46
|
}
|
@@ -0,0 +1,111 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
exports.createScrollTargetCalculator = createScrollTargetCalculator;
|
5
|
+
exports.scrollWindowToCell = scrollWindowToCell;
|
6
|
+
var _element = require("../../helpers/dom/element");
|
7
|
+
/**
|
8
|
+
* Scrolls the browser's viewport to the specified element.
|
9
|
+
*
|
10
|
+
* @param {HTMLElement} element The element to scroll.
|
11
|
+
*/
|
12
|
+
function scrollWindowToCell(element) {
|
13
|
+
if ((0, _element.isHTMLElement)(element)) {
|
14
|
+
element.scrollIntoView({
|
15
|
+
block: 'nearest',
|
16
|
+
inline: 'nearest'
|
17
|
+
});
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
/**
|
22
|
+
* Creates a scroll target calculator that calculates the target row and column best viewport
|
23
|
+
* scroll position based on the current selection.
|
24
|
+
*
|
25
|
+
* @param {Core} hotInstance The Handsontable instance.
|
26
|
+
* @returns {{ getComputedColumnTarget: Function, getComputedRowTarget: Function }}
|
27
|
+
*/
|
28
|
+
function createScrollTargetCalculator(hotInstance) {
|
29
|
+
const {
|
30
|
+
selection,
|
31
|
+
view
|
32
|
+
} = hotInstance;
|
33
|
+
const cellRange = hotInstance.getSelectedRangeLast();
|
34
|
+
const source = selection.getSelectionSource();
|
35
|
+
const firstVisibleColumn = view.getFirstFullyVisibleColumn();
|
36
|
+
const lastVisibleColumn = view.getLastFullyVisibleColumn();
|
37
|
+
const selectionFirstColumn = cellRange.getTopStartCorner().col;
|
38
|
+
const selectionLastColumn = cellRange.getBottomEndCorner().col;
|
39
|
+
const isSelectionOutsideStartViewport = selectionFirstColumn <= firstVisibleColumn;
|
40
|
+
const isSelectionOutsideEndViewport = selectionLastColumn >= lastVisibleColumn;
|
41
|
+
const firstVisibleRow = view.getFirstFullyVisibleRow();
|
42
|
+
const lastVisibleRow = view.getLastFullyVisibleRow();
|
43
|
+
const selectionFirstRow = cellRange.getTopStartCorner().row;
|
44
|
+
const selectionLastRow = cellRange.getBottomEndCorner().row;
|
45
|
+
const isSelectionOutsideTopViewport = selectionFirstRow <= firstVisibleRow;
|
46
|
+
const isSelectionOutsideBottomViewport = selectionLastRow >= lastVisibleRow;
|
47
|
+
return {
|
48
|
+
/**
|
49
|
+
* Calculates the target column for scrolling.
|
50
|
+
*
|
51
|
+
* @param {CellCoords} lastSelectionCoords The last selection coordinates.
|
52
|
+
* @returns {number}
|
53
|
+
*/
|
54
|
+
getComputedColumnTarget(lastSelectionCoords) {
|
55
|
+
if (source === 'mouse' || source === 'keyboard') {
|
56
|
+
// For mouse or keyboard selection, always scroll to the last column
|
57
|
+
// defined by the last selection coords
|
58
|
+
return lastSelectionCoords.col;
|
59
|
+
}
|
60
|
+
if (isSelectionOutsideStartViewport && isSelectionOutsideEndViewport) {
|
61
|
+
// If the selection is outside both ends of the viewport, scroll to the
|
62
|
+
// column where the focused cell is located
|
63
|
+
return cellRange.highlight.col;
|
64
|
+
}
|
65
|
+
if (isSelectionOutsideStartViewport) {
|
66
|
+
// If the selection is outside the start (left) of the viewport, scroll to
|
67
|
+
// the first column of the selection range
|
68
|
+
return selectionFirstColumn;
|
69
|
+
}
|
70
|
+
if (isSelectionOutsideEndViewport) {
|
71
|
+
// If the selection is outside the end (right) of the viewport, scroll to
|
72
|
+
// the last column of the selection range
|
73
|
+
return selectionLastColumn;
|
74
|
+
}
|
75
|
+
|
76
|
+
// For other cases, scroll to the column defined by the last selection coords
|
77
|
+
return lastSelectionCoords.col;
|
78
|
+
},
|
79
|
+
/**
|
80
|
+
* Calculates the target row for scrolling.
|
81
|
+
*
|
82
|
+
* @param {CellCoords} lastSelectionCoords The last selection coordinates.
|
83
|
+
* @returns {number}
|
84
|
+
*/
|
85
|
+
getComputedRowTarget(lastSelectionCoords) {
|
86
|
+
if (source === 'mouse' || source === 'keyboard') {
|
87
|
+
// For mouse or keyboard selection, always scroll to the last row
|
88
|
+
// defined by the coords
|
89
|
+
return lastSelectionCoords.row;
|
90
|
+
}
|
91
|
+
if (isSelectionOutsideTopViewport && isSelectionOutsideBottomViewport) {
|
92
|
+
// If the selection is outside both ends of the viewport, scroll to the
|
93
|
+
// row where the focused cell is located
|
94
|
+
return cellRange.highlight.row;
|
95
|
+
}
|
96
|
+
if (isSelectionOutsideTopViewport) {
|
97
|
+
// If the selection is outside the top of the viewport, scroll to
|
98
|
+
// the first row of the selection range
|
99
|
+
return selectionFirstRow;
|
100
|
+
}
|
101
|
+
if (isSelectionOutsideBottomViewport) {
|
102
|
+
// If the selection is outside the bottom of the viewport, scroll to
|
103
|
+
// the last row of the selection range
|
104
|
+
return selectionLastRow;
|
105
|
+
}
|
106
|
+
|
107
|
+
// For other cases, scroll to the row defined by the last selection coords
|
108
|
+
return lastSelectionCoords.row;
|
109
|
+
}
|
110
|
+
};
|
111
|
+
}
|