handsontable 0.0.0-next-200799f-20240311 → 0.0.0-next-bff5041-20240315

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.

Potentially problematic release.


This version of handsontable might be problematic. Click here for more details.

Files changed (272) hide show
  1. package/3rdparty/walkontable/src/calculator/viewportColumns.js +12 -17
  2. package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +12 -17
  3. package/3rdparty/walkontable/src/calculator/viewportRows.js +10 -15
  4. package/3rdparty/walkontable/src/calculator/viewportRows.mjs +10 -15
  5. package/3rdparty/walkontable/src/cell/coords.js +12 -17
  6. package/3rdparty/walkontable/src/cell/coords.mjs +12 -17
  7. package/3rdparty/walkontable/src/cell/range.d.ts +0 -1
  8. package/3rdparty/walkontable/src/cell/range.js +23 -45
  9. package/3rdparty/walkontable/src/cell/range.mjs +23 -45
  10. package/3rdparty/walkontable/src/core/_base.js +1 -1
  11. package/3rdparty/walkontable/src/core/_base.mjs +1 -1
  12. package/3rdparty/walkontable/src/event.js +72 -104
  13. package/3rdparty/walkontable/src/event.mjs +72 -104
  14. package/3rdparty/walkontable/src/overlays.js +1 -1
  15. package/3rdparty/walkontable/src/overlays.mjs +1 -1
  16. package/3rdparty/walkontable/src/scroll.js +15 -17
  17. package/3rdparty/walkontable/src/scroll.mjs +15 -17
  18. package/3rdparty/walkontable/src/selection/manager.js +48 -69
  19. package/3rdparty/walkontable/src/selection/manager.mjs +48 -69
  20. package/3rdparty/walkontable/src/selection/scanner.js +33 -42
  21. package/3rdparty/walkontable/src/selection/scanner.mjs +33 -42
  22. package/3rdparty/walkontable/src/utils/columnStretching.js +27 -44
  23. package/3rdparty/walkontable/src/utils/columnStretching.mjs +27 -44
  24. package/3rdparty/walkontable/src/utils/orderView/view.js +1 -1
  25. package/3rdparty/walkontable/src/utils/orderView/view.mjs +1 -1
  26. package/base.js +2 -2
  27. package/base.mjs +2 -2
  28. package/core/viewportScroll/index.js +1 -4
  29. package/core/viewportScroll/index.mjs +1 -4
  30. package/core.d.ts +3 -4
  31. package/core.js +22 -79
  32. package/core.mjs +22 -79
  33. package/dataMap/dataSource.js +1 -1
  34. package/dataMap/dataSource.mjs +1 -1
  35. package/dataMap/metaManager/metaLayers/cellMeta.js +1 -1
  36. package/dataMap/metaManager/metaLayers/cellMeta.mjs +1 -1
  37. package/dataMap/replaceData.js +1 -1
  38. package/dataMap/replaceData.mjs +1 -1
  39. package/dist/handsontable.css +2 -2
  40. package/dist/handsontable.full.css +2 -2
  41. package/dist/handsontable.full.js +7620 -10327
  42. package/dist/handsontable.full.min.css +2 -2
  43. package/dist/handsontable.full.min.js +277 -277
  44. package/dist/handsontable.js +5525 -7779
  45. package/dist/handsontable.min.css +2 -2
  46. package/dist/handsontable.min.js +33 -33
  47. package/dist/languages/all.min.js +1 -1
  48. package/dist/languages/ar-AR.min.js +1 -1
  49. package/dist/languages/cs-CZ.min.js +1 -1
  50. package/dist/languages/de-CH.min.js +1 -1
  51. package/dist/languages/de-DE.min.js +1 -1
  52. package/dist/languages/en-US.min.js +1 -1
  53. package/dist/languages/es-MX.min.js +1 -1
  54. package/dist/languages/fr-FR.min.js +1 -1
  55. package/dist/languages/hr-HR.min.js +1 -1
  56. package/dist/languages/it-IT.min.js +1 -1
  57. package/dist/languages/ja-JP.min.js +1 -1
  58. package/dist/languages/ko-KR.min.js +1 -1
  59. package/dist/languages/lv-LV.min.js +1 -1
  60. package/dist/languages/nb-NO.min.js +1 -1
  61. package/dist/languages/nl-NL.min.js +1 -1
  62. package/dist/languages/pl-PL.min.js +1 -1
  63. package/dist/languages/pt-BR.min.js +1 -1
  64. package/dist/languages/ru-RU.min.js +1 -1
  65. package/dist/languages/sr-SP.min.js +1 -1
  66. package/dist/languages/zh-CN.min.js +1 -1
  67. package/dist/languages/zh-TW.min.js +1 -1
  68. package/editorManager.js +21 -27
  69. package/editorManager.mjs +21 -27
  70. package/editors/autocompleteEditor/autocompleteEditor.js +6 -10
  71. package/editors/autocompleteEditor/autocompleteEditor.mjs +6 -10
  72. package/eventManager.js +1 -1
  73. package/eventManager.mjs +1 -1
  74. package/focusManager.js +58 -82
  75. package/focusManager.mjs +58 -82
  76. package/helpers/dom/element.js +1 -1
  77. package/helpers/dom/element.mjs +1 -1
  78. package/helpers/mixed.js +1 -1
  79. package/helpers/mixed.mjs +1 -1
  80. package/helpers/object.js +2 -2
  81. package/helpers/object.mjs +2 -2
  82. package/index.d.ts +10 -0
  83. package/package.json +2 -1
  84. package/pluginHooks.d.ts +0 -4
  85. package/pluginHooks.js +2 -44
  86. package/pluginHooks.mjs +2 -44
  87. package/plugins/autoColumnSize/autoColumnSize.js +49 -65
  88. package/plugins/autoColumnSize/autoColumnSize.mjs +49 -65
  89. package/plugins/autoRowSize/autoRowSize.js +28 -34
  90. package/plugins/autoRowSize/autoRowSize.mjs +28 -34
  91. package/plugins/autofill/autofill.js +30 -38
  92. package/plugins/autofill/autofill.mjs +30 -38
  93. package/plugins/base/base.js +12 -17
  94. package/plugins/base/base.mjs +12 -17
  95. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
  96. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
  97. package/plugins/collapsibleColumns/collapsibleColumns.js +36 -54
  98. package/plugins/collapsibleColumns/collapsibleColumns.mjs +36 -54
  99. package/plugins/columnSorting/columnSorting.js +40 -46
  100. package/plugins/columnSorting/columnSorting.mjs +40 -46
  101. package/plugins/columnSummary/columnSummary.js +22 -26
  102. package/plugins/columnSummary/columnSummary.mjs +22 -26
  103. package/plugins/comments/comments.js +116 -158
  104. package/plugins/comments/comments.mjs +116 -158
  105. package/plugins/contextMenu/contextMenu.js +20 -26
  106. package/plugins/contextMenu/contextMenu.mjs +20 -26
  107. package/plugins/contextMenu/itemsFactory.js +1 -1
  108. package/plugins/contextMenu/itemsFactory.mjs +1 -1
  109. package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
  110. package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
  111. package/plugins/contextMenu/menu/menu.js +13 -21
  112. package/plugins/contextMenu/menu/menu.mjs +13 -21
  113. package/plugins/contextMenu/menu/positioner.js +41 -58
  114. package/plugins/contextMenu/menu/positioner.mjs +41 -58
  115. package/plugins/copyPaste/copyPaste.js +113 -154
  116. package/plugins/copyPaste/copyPaste.mjs +113 -154
  117. package/plugins/copyPaste/copyableRanges.js +43 -66
  118. package/plugins/copyPaste/copyableRanges.mjs +43 -66
  119. package/plugins/customBorders/customBorders.js +11 -13
  120. package/plugins/customBorders/customBorders.mjs +11 -13
  121. package/plugins/dragToScroll/dragToScroll.js +6 -6
  122. package/plugins/dragToScroll/dragToScroll.mjs +6 -6
  123. package/plugins/dropdownMenu/dropdownMenu.js +78 -100
  124. package/plugins/dropdownMenu/dropdownMenu.mjs +78 -100
  125. package/plugins/exportFile/dataProvider.js +1 -1
  126. package/plugins/exportFile/dataProvider.mjs +1 -1
  127. package/plugins/filters/component/actionBar.js +9 -9
  128. package/plugins/filters/component/actionBar.mjs +8 -8
  129. package/plugins/filters/component/condition.js +13 -15
  130. package/plugins/filters/component/condition.mjs +13 -15
  131. package/plugins/filters/component/operators.js +6 -6
  132. package/plugins/filters/component/operators.mjs +6 -6
  133. package/plugins/filters/component/value.js +24 -28
  134. package/plugins/filters/component/value.mjs +24 -28
  135. package/plugins/filters/conditionUpdateObserver.js +22 -24
  136. package/plugins/filters/conditionUpdateObserver.mjs +22 -24
  137. package/plugins/filters/dataFilter.js +1 -1
  138. package/plugins/filters/dataFilter.mjs +1 -1
  139. package/plugins/filters/filters.js +81 -95
  140. package/plugins/filters/filters.mjs +81 -95
  141. package/plugins/filters/ui/input.js +13 -19
  142. package/plugins/filters/ui/input.mjs +13 -19
  143. package/plugins/filters/ui/link.js +8 -13
  144. package/plugins/filters/ui/link.mjs +8 -13
  145. package/plugins/filters/ui/multipleSelect.js +85 -112
  146. package/plugins/filters/ui/multipleSelect.mjs +85 -112
  147. package/plugins/filters/ui/radioInput.js +12 -20
  148. package/plugins/filters/ui/radioInput.mjs +12 -20
  149. package/plugins/filters/ui/select.js +50 -72
  150. package/plugins/filters/ui/select.mjs +49 -71
  151. package/plugins/formulas/formulas.js +268 -326
  152. package/plugins/formulas/formulas.mjs +269 -327
  153. package/plugins/formulas/indexSyncer/axisSyncer.js +38 -61
  154. package/plugins/formulas/indexSyncer/axisSyncer.mjs +38 -61
  155. package/plugins/formulas/indexSyncer/index.js +25 -48
  156. package/plugins/formulas/indexSyncer/index.mjs +25 -48
  157. package/plugins/hiddenColumns/hiddenColumns.js +64 -83
  158. package/plugins/hiddenColumns/hiddenColumns.mjs +64 -83
  159. package/plugins/hiddenRows/hiddenRows.js +63 -82
  160. package/plugins/hiddenRows/hiddenRows.mjs +63 -82
  161. package/plugins/manualColumnFreeze/manualColumnFreeze.js +24 -32
  162. package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +25 -33
  163. package/plugins/manualColumnMove/manualColumnMove.js +126 -170
  164. package/plugins/manualColumnMove/manualColumnMove.mjs +126 -170
  165. package/plugins/manualColumnResize/manualColumnResize.js +169 -230
  166. package/plugins/manualColumnResize/manualColumnResize.mjs +169 -230
  167. package/plugins/manualRowMove/manualRowMove.js +99 -128
  168. package/plugins/manualRowMove/manualRowMove.mjs +99 -128
  169. package/plugins/manualRowResize/manualRowResize.js +150 -209
  170. package/plugins/manualRowResize/manualRowResize.mjs +150 -209
  171. package/plugins/mergeCells/calculations/selection.js +71 -2
  172. package/plugins/mergeCells/calculations/selection.mjs +71 -2
  173. package/plugins/mergeCells/cellsCollection.js +1 -117
  174. package/plugins/mergeCells/cellsCollection.mjs +1 -117
  175. package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
  176. package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
  177. package/plugins/mergeCells/mergeCells.js +355 -595
  178. package/plugins/mergeCells/mergeCells.mjs +355 -595
  179. package/plugins/multiColumnSorting/multiColumnSorting.js +0 -6
  180. package/plugins/multiColumnSorting/multiColumnSorting.mjs +0 -6
  181. package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
  182. package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
  183. package/plugins/nestedHeaders/nestedHeaders.js +204 -254
  184. package/plugins/nestedHeaders/nestedHeaders.mjs +205 -255
  185. package/plugins/nestedHeaders/stateManager/headersTree.js +21 -32
  186. package/plugins/nestedHeaders/stateManager/headersTree.mjs +21 -32
  187. package/plugins/nestedHeaders/stateManager/index.js +30 -41
  188. package/plugins/nestedHeaders/stateManager/index.mjs +30 -41
  189. package/plugins/nestedHeaders/stateManager/sourceSettings.js +19 -30
  190. package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +19 -30
  191. package/plugins/nestedRows/data/dataManager.js +1 -1
  192. package/plugins/nestedRows/data/dataManager.mjs +1 -1
  193. package/plugins/nestedRows/nestedRows.js +138 -179
  194. package/plugins/nestedRows/nestedRows.mjs +139 -180
  195. package/plugins/nestedRows/ui/contextMenu.js +11 -15
  196. package/plugins/nestedRows/ui/contextMenu.mjs +10 -14
  197. package/plugins/nestedRows/utils/rowMoveController.js +1 -1
  198. package/plugins/nestedRows/utils/rowMoveController.mjs +1 -1
  199. package/plugins/persistentState/storage.js +2 -2
  200. package/plugins/persistentState/storage.mjs +2 -2
  201. package/plugins/search/search.js +7 -7
  202. package/plugins/search/search.mjs +7 -7
  203. package/plugins/touchScroll/touchScroll.js +15 -19
  204. package/plugins/touchScroll/touchScroll.mjs +16 -20
  205. package/plugins/trimRows/trimRows.js +6 -6
  206. package/plugins/trimRows/trimRows.mjs +6 -6
  207. package/renderers/checkboxRenderer/checkboxRenderer.js +4 -4
  208. package/renderers/checkboxRenderer/checkboxRenderer.mjs +4 -4
  209. package/selection/highlight/highlight.js +14 -14
  210. package/selection/highlight/highlight.mjs +13 -13
  211. package/selection/highlight/visualSelection.js +2 -16
  212. package/selection/highlight/visualSelection.mjs +2 -16
  213. package/selection/selection.js +60 -252
  214. package/selection/selection.mjs +59 -251
  215. package/selection/transformation.js +101 -175
  216. package/selection/transformation.mjs +101 -175
  217. package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
  218. package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
  219. package/shortcutContexts/commands/editor/open.js +3 -18
  220. package/shortcutContexts/commands/editor/open.mjs +3 -18
  221. package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
  222. package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
  223. package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
  224. package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
  225. package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
  226. package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
  227. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
  228. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
  229. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
  230. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
  231. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
  232. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
  233. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
  234. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
  235. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
  236. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
  237. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
  238. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
  239. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
  240. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
  241. package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
  242. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
  243. package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
  244. package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
  245. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
  246. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
  247. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
  248. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
  249. package/shortcutContexts/grid.js +2 -2
  250. package/shortcutContexts/grid.mjs +2 -2
  251. package/shortcuts/context.js +1 -2
  252. package/shortcuts/context.mjs +1 -2
  253. package/tableView.js +52 -98
  254. package/tableView.mjs +52 -98
  255. package/translations/changesObservable/observable.js +21 -38
  256. package/translations/changesObservable/observable.mjs +21 -38
  257. package/translations/changesObservable/observer.js +7 -12
  258. package/translations/changesObservable/observer.mjs +6 -11
  259. package/translations/mapCollections/aggregatedCollection.js +1 -1
  260. package/translations/mapCollections/aggregatedCollection.mjs +1 -1
  261. package/translations/maps/indexMap.js +1 -1
  262. package/translations/maps/indexMap.mjs +1 -1
  263. package/utils/dataStructures/linkedList.js +1 -6
  264. package/utils/dataStructures/linkedList.mjs +1 -6
  265. package/utils/dataStructures/tree.js +1 -1
  266. package/utils/dataStructures/tree.mjs +1 -1
  267. package/utils/interval.js +26 -44
  268. package/utils/interval.mjs +26 -44
  269. package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
  270. package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
  271. package/plugins/mergeCells/focusOrder.js +0 -258
  272. package/plugins/mergeCells/focusOrder.mjs +0 -253
@@ -9,7 +9,7 @@ var _mixed = require("./../helpers/mixed");
9
9
  var _number = require("./../helpers/number");
10
10
  var _array = require("./../helpers/array");
11
11
  var _localHooks = _interopRequireDefault(require("./../mixins/localHooks"));
12
- var _transformation2 = _interopRequireDefault(require("./transformation"));
12
+ var _transformation = _interopRequireDefault(require("./transformation"));
13
13
  var _utils = require("./utils");
14
14
  var _templateLiteralTag = require("./../helpers/templateLiteralTag");
15
15
  var _a11y = require("../helpers/a11y");
@@ -21,18 +21,13 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
21
21
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
22
22
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
23
23
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
24
- function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
25
- function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
26
- function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
27
- function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
28
- function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
24
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
25
+ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
26
+ 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"); }
29
27
  /**
30
28
  * @class Selection
31
29
  * @util
32
30
  */
33
- var _transformation = /*#__PURE__*/new WeakMap();
34
- var _focusTransformation = /*#__PURE__*/new WeakMap();
35
- var _isFocusSelectionChanged = /*#__PURE__*/new WeakMap();
36
31
  var _disableHeadersHighlight = /*#__PURE__*/new WeakMap();
37
32
  var _selectionSource = /*#__PURE__*/new WeakMap();
38
33
  var _expectedLayersCount = /*#__PURE__*/new WeakMap();
@@ -72,23 +67,11 @@ class Selection {
72
67
  */
73
68
  _defineProperty(this, "highlight", void 0);
74
69
  /**
75
- * The module for modifying coordinates of the start and end selection.
70
+ * The module for modifying coordinates.
76
71
  *
77
72
  * @type {Transformation}
78
73
  */
79
- _classPrivateFieldInitSpec(this, _transformation, {
80
- writable: true,
81
- value: void 0
82
- });
83
- /**
84
- * The module for modifying coordinates of the focus selection.
85
- *
86
- * @type {Transformation}
87
- */
88
- _classPrivateFieldInitSpec(this, _focusTransformation, {
89
- writable: true,
90
- value: void 0
91
- });
74
+ _defineProperty(this, "transformation", void 0);
92
75
  /**
93
76
  * The collection of the selection layer levels where the whole row was selected using the row header or
94
77
  * the corner header.
@@ -103,43 +86,25 @@ class Selection {
103
86
  * @type {Set<number>}
104
87
  */
105
88
  _defineProperty(this, "selectedByColumnHeader", new Set());
106
- /**
107
- * The flag which determines if the focus selection was changed.
108
- *
109
- * @type {boolean}
110
- */
111
- _classPrivateFieldInitSpec(this, _isFocusSelectionChanged, {
112
- writable: true,
113
- value: false
114
- });
115
89
  /**
116
90
  * When sets disable highlighting the headers even when the logical coordinates points on them.
117
91
  *
118
92
  * @type {boolean}
119
93
  */
120
- _classPrivateFieldInitSpec(this, _disableHeadersHighlight, {
121
- writable: true,
122
- value: false
123
- });
94
+ _classPrivateFieldInitSpec(this, _disableHeadersHighlight, false);
124
95
  /**
125
96
  * The source of the selection. It can be one of the following values: `mouse`, `unknown` or any other string.
126
97
  *
127
98
  * @type {'mouse' | 'unknown' | string}
128
99
  */
129
- _classPrivateFieldInitSpec(this, _selectionSource, {
130
- writable: true,
131
- value: 'unknown'
132
- });
100
+ _classPrivateFieldInitSpec(this, _selectionSource, 'unknown');
133
101
  /**
134
102
  * The number of expected layers. It is used mostly to track when the last selection layer of non-contiguous
135
103
  * selection is applied, thus the viewport scroll is triggered.
136
104
  *
137
105
  * @param {number}
138
106
  */
139
- _classPrivateFieldInitSpec(this, _expectedLayersCount, {
140
- writable: true,
141
- value: -1
142
- });
107
+ _classPrivateFieldInitSpec(this, _expectedLayersCount, -1);
143
108
  this.settings = settings;
144
109
  this.tableProps = tableProps;
145
110
  this.highlight = new _highlight.default({
@@ -162,118 +127,71 @@ class Selection {
162
127
  createCellCoords: (row, column) => this.tableProps.createCellCoords(row, column),
163
128
  createCellRange: (highlight, from, to) => this.tableProps.createCellRange(highlight, from, to)
164
129
  });
165
- _classPrivateFieldSet(this, _transformation, new _transformation2.default(this.selectedRange, {
130
+ this.transformation = new _transformation.default(this.selectedRange, {
166
131
  rowIndexMapper: this.tableProps.rowIndexMapper,
167
132
  columnIndexMapper: this.tableProps.columnIndexMapper,
168
133
  countRenderableRows: () => this.tableProps.countRenderableRows(),
169
134
  countRenderableColumns: () => this.tableProps.countRenderableColumns(),
135
+ countRowHeaders: () => this.tableProps.countRowHeaders(),
136
+ countColHeaders: () => this.tableProps.countColHeaders(),
170
137
  visualToRenderableCoords: coords => this.tableProps.visualToRenderableCoords(coords),
171
138
  renderableToVisualCoords: coords => this.tableProps.renderableToVisualCoords(coords),
172
- findFirstNonHiddenRenderableRow: function () {
173
- return _this.tableProps.findFirstNonHiddenRenderableRow(...arguments);
174
- },
175
- findFirstNonHiddenRenderableColumn: function () {
176
- return _this.tableProps.findFirstNonHiddenRenderableColumn(...arguments);
177
- },
178
139
  createCellCoords: (row, column) => this.tableProps.createCellCoords(row, column),
140
+ navigableHeaders: () => settings.navigableHeaders,
179
141
  fixedRowsBottom: () => settings.fixedRowsBottom,
180
142
  minSpareRows: () => settings.minSpareRows,
181
143
  minSpareCols: () => settings.minSpareCols,
182
144
  autoWrapRow: () => settings.autoWrapRow,
183
145
  autoWrapCol: () => settings.autoWrapCol
184
- }));
185
- _classPrivateFieldSet(this, _focusTransformation, new _transformation2.default(this.selectedRange, {
186
- rowIndexMapper: this.tableProps.rowIndexMapper,
187
- columnIndexMapper: this.tableProps.columnIndexMapper,
188
- countRenderableRows: () => {
189
- const range = this.selectedRange.current();
190
- return this.tableProps.countRenderableRowsInRange(0, range.getOuterBottomEndCorner().row);
191
- },
192
- countRenderableColumns: () => {
193
- const range = this.selectedRange.current();
194
- return this.tableProps.countRenderableColumnsInRange(0, range.getOuterBottomEndCorner().col);
195
- },
196
- visualToRenderableCoords: coords => this.tableProps.visualToRenderableCoords(coords),
197
- renderableToVisualCoords: coords => this.tableProps.renderableToVisualCoords(coords),
198
- findFirstNonHiddenRenderableRow: function () {
199
- return _this.tableProps.findFirstNonHiddenRenderableRow(...arguments);
200
- },
201
- findFirstNonHiddenRenderableColumn: function () {
202
- return _this.tableProps.findFirstNonHiddenRenderableColumn(...arguments);
203
- },
204
- createCellCoords: (row, column) => this.tableProps.createCellCoords(row, column),
205
- fixedRowsBottom: () => 0,
206
- minSpareRows: () => 0,
207
- minSpareCols: () => 0,
208
- autoWrapRow: () => true,
209
- autoWrapCol: () => true
210
- }));
211
- _classPrivateFieldGet(this, _transformation).addLocalHook('beforeTransformStart', function () {
146
+ });
147
+ this.transformation.addLocalHook('beforeTransformStart', function () {
212
148
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
213
149
  args[_key] = arguments[_key];
214
150
  }
215
151
  return _this.runLocalHooks('beforeModifyTransformStart', ...args);
216
152
  });
217
- _classPrivateFieldGet(this, _transformation).addLocalHook('afterTransformStart', function () {
153
+ this.transformation.addLocalHook('afterTransformStart', function () {
218
154
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
219
155
  args[_key2] = arguments[_key2];
220
156
  }
221
157
  return _this.runLocalHooks('afterModifyTransformStart', ...args);
222
158
  });
223
- _classPrivateFieldGet(this, _transformation).addLocalHook('beforeTransformEnd', function () {
159
+ this.transformation.addLocalHook('beforeTransformEnd', function () {
224
160
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
225
161
  args[_key3] = arguments[_key3];
226
162
  }
227
163
  return _this.runLocalHooks('beforeModifyTransformEnd', ...args);
228
164
  });
229
- _classPrivateFieldGet(this, _transformation).addLocalHook('modifyTransformEndRestDelta', function () {
165
+ this.transformation.addLocalHook('afterTransformEnd', function () {
230
166
  for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
231
167
  args[_key4] = arguments[_key4];
232
168
  }
233
- return _this.runLocalHooks('modifyTransformEndRestDelta', ...args);
169
+ return _this.runLocalHooks('afterModifyTransformEnd', ...args);
234
170
  });
235
- _classPrivateFieldGet(this, _transformation).addLocalHook('afterTransformEnd', function () {
171
+ this.transformation.addLocalHook('insertRowRequire', function () {
236
172
  for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
237
173
  args[_key5] = arguments[_key5];
238
174
  }
239
- return _this.runLocalHooks('afterModifyTransformEnd', ...args);
175
+ return _this.runLocalHooks('insertRowRequire', ...args);
240
176
  });
241
- _classPrivateFieldGet(this, _transformation).addLocalHook('insertRowRequire', function () {
177
+ this.transformation.addLocalHook('insertColRequire', function () {
242
178
  for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
243
179
  args[_key6] = arguments[_key6];
244
180
  }
245
- return _this.runLocalHooks('insertRowRequire', ...args);
181
+ return _this.runLocalHooks('insertColRequire', ...args);
246
182
  });
247
- _classPrivateFieldGet(this, _transformation).addLocalHook('insertColRequire', function () {
183
+ this.transformation.addLocalHook('beforeRowWrap', function () {
248
184
  for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
249
185
  args[_key7] = arguments[_key7];
250
186
  }
251
- return _this.runLocalHooks('insertColRequire', ...args);
187
+ return _this.runLocalHooks('beforeRowWrap', ...args);
252
188
  });
253
- _classPrivateFieldGet(this, _transformation).addLocalHook('beforeRowWrap', function () {
189
+ this.transformation.addLocalHook('beforeColumnWrap', function () {
254
190
  for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
255
191
  args[_key8] = arguments[_key8];
256
192
  }
257
- return _this.runLocalHooks('beforeRowWrap', ...args);
258
- });
259
- _classPrivateFieldGet(this, _transformation).addLocalHook('beforeColumnWrap', function () {
260
- for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
261
- args[_key9] = arguments[_key9];
262
- }
263
193
  return _this.runLocalHooks('beforeColumnWrap', ...args);
264
194
  });
265
- _classPrivateFieldGet(this, _focusTransformation).addLocalHook('beforeTransformStart', function () {
266
- for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
267
- args[_key10] = arguments[_key10];
268
- }
269
- return _this.runLocalHooks('beforeModifyTransformFocus', ...args);
270
- });
271
- _classPrivateFieldGet(this, _focusTransformation).addLocalHook('afterTransformStart', function () {
272
- for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
273
- args[_key11] = arguments[_key11];
274
- }
275
- return _this.runLocalHooks('afterModifyTransformFocus', ...args);
276
- });
277
195
  }
278
196
 
279
197
  /**
@@ -291,14 +209,14 @@ class Selection {
291
209
  * @param {'mouse' | 'unknown' | string} sourceName The source name.
292
210
  */
293
211
  markSource(sourceName) {
294
- _classPrivateFieldSet(this, _selectionSource, sourceName);
212
+ _classPrivateFieldSet(_selectionSource, this, sourceName);
295
213
  }
296
214
 
297
215
  /**
298
216
  * Marks end of the selection source. It restores the selection source to default value which is 'unknown'.
299
217
  */
300
218
  markEndSource() {
301
- _classPrivateFieldSet(this, _selectionSource, 'unknown');
219
+ _classPrivateFieldSet(_selectionSource, this, 'unknown');
302
220
  }
303
221
 
304
222
  /**
@@ -307,7 +225,7 @@ class Selection {
307
225
  * @returns {'mouse' | 'unknown' | string}
308
226
  */
309
227
  getSelectionSource() {
310
- return _classPrivateFieldGet(this, _selectionSource);
228
+ return _classPrivateFieldGet(_selectionSource, this);
311
229
  }
312
230
 
313
231
  /**
@@ -317,7 +235,7 @@ class Selection {
317
235
  * @param {number} layersCount The number of expected layers.
318
236
  */
319
237
  setExpectedLayers(layersCount) {
320
- _classPrivateFieldSet(this, _expectedLayersCount, layersCount);
238
+ _classPrivateFieldSet(_expectedLayersCount, this, layersCount);
321
239
  }
322
240
 
323
241
  /**
@@ -333,7 +251,7 @@ class Selection {
333
251
  finish() {
334
252
  this.runLocalHooks('afterSelectionFinished', Array.from(this.selectedRange));
335
253
  this.inProgress = false;
336
- _classPrivateFieldSet(this, _expectedLayersCount, -1);
254
+ _classPrivateFieldSet(_expectedLayersCount, this, -1);
337
255
  }
338
256
 
339
257
  /**
@@ -364,7 +282,6 @@ class Selection {
364
282
  // We are creating copy. We would like to modify just the start of the selection by below hook. Then original coords
365
283
  // should be handled by next methods.
366
284
  const coordsClone = coords.clone();
367
- _classPrivateFieldSet(this, _isFocusSelectionChanged, false);
368
285
  this.runLocalHooks(`beforeSetRangeStart${fragment ? 'Only' : ''}`, coordsClone);
369
286
  if (!isMultipleMode || isMultipleMode && !isMultipleSelection && (0, _mixed.isUndefined)(multipleSelection)) {
370
287
  this.selectedRange.clear();
@@ -422,20 +339,7 @@ class Selection {
422
339
  cellRange.setFrom(cellRange.highlight);
423
340
  cellRange.setTo(cellRange.highlight);
424
341
  } else {
425
- const horizontalDir = cellRange.getHorizontalDirection();
426
- const verticalDir = cellRange.getVerticalDirection();
427
- const isMultiple = this.isMultiple();
428
342
  cellRange.setTo(coordsClone);
429
- if (isMultiple && horizontalDir !== cellRange.getHorizontalDirection()) {
430
- cellRange.from.assign({
431
- col: cellRange.highlight.col
432
- });
433
- }
434
- if (isMultiple && verticalDir !== cellRange.getVerticalDirection()) {
435
- cellRange.from.assign({
436
- row: cellRange.highlight.row
437
- });
438
- }
439
343
  }
440
344
 
441
345
  // Prevent creating "area" selection that overlaps headers.
@@ -445,7 +349,11 @@ class Selection {
445
349
  }
446
350
  }
447
351
  this.runLocalHooks('beforeHighlightSet');
448
- this.setRangeFocus(this.selectedRange.current().highlight);
352
+ const focusHighlight = this.highlight.getFocus();
353
+ focusHighlight.clear();
354
+ if (this.highlight.isEnabledFor(_highlight.FOCUS_TYPE, cellRange.highlight)) {
355
+ focusHighlight.add(this.selectedRange.current().highlight).commit().syncWith(cellRange);
356
+ }
449
357
  const layerLevel = this.getLayerLevel();
450
358
 
451
359
  // If the next layer level is lower than previous then clear all area and header highlights. This is the
@@ -516,8 +424,8 @@ class Selection {
516
424
  columnHighlight.add(columnCoordsFrom).add(columnCoordsTo).commit();
517
425
  }
518
426
  }
519
- const highlightRowHeaders = !_classPrivateFieldGet(this, _disableHeadersHighlight) && this.isEntireRowSelected() && (countCols > 0 && countCols === cellRange.getWidth() || countCols === 0 && this.isSelectedByRowHeader());
520
- const highlightColumnHeaders = !_classPrivateFieldGet(this, _disableHeadersHighlight) && this.isEntireColumnSelected() && (countRows > 0 && countRows === cellRange.getHeight() || countRows === 0 && this.isSelectedByColumnHeader());
427
+ const highlightRowHeaders = !_classPrivateFieldGet(_disableHeadersHighlight, this) && this.isEntireRowSelected() && (countCols > 0 && countCols === cellRange.getWidth() || countCols === 0 && this.isSelectedByRowHeader());
428
+ const highlightColumnHeaders = !_classPrivateFieldGet(_disableHeadersHighlight, this) && this.isEntireColumnSelected() && (countRows > 0 && countRows === cellRange.getHeight() || countRows === 0 && this.isSelectedByColumnHeader());
521
429
  if (highlightRowHeaders) {
522
430
  activeRowHeaderHighlight.add(this.tableProps.createCellCoords(Math.max(cellRange.from.row, 0), Math.min(-this.tableProps.countRowHeaders(), -1))).add(this.tableProps.createCellCoords(Math.max(cellRange.to.row, 0), -1)).commit();
523
431
  }
@@ -528,33 +436,20 @@ class Selection {
528
436
  activeCornerHeaderHighlight.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(), -this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1, -1)).commit();
529
437
  }
530
438
  }
531
- const isLastLayer = _classPrivateFieldGet(this, _expectedLayersCount) === -1 || this.selectedRange.size() === _classPrivateFieldGet(this, _expectedLayersCount);
439
+ const isLastLayer = _classPrivateFieldGet(_expectedLayersCount, this) === -1 || this.selectedRange.size() === _classPrivateFieldGet(_expectedLayersCount, this);
532
440
  this.runLocalHooks('afterSetRangeEnd', coords, isLastLayer);
533
441
  }
534
442
 
535
443
  /**
536
- * Sets the selection focus position at the specified coordinates.
444
+ * Returns information if we have a multiselection. This method check multiselection only on the latest layer of
445
+ * the selection.
537
446
  *
538
- * @param {CellCoords} coords The CellCoords instance with defined visual coordinates.
447
+ * @returns {boolean}
539
448
  */
540
- setRangeFocus(coords) {
541
- if (this.selectedRange.isEmpty()) {
542
- return;
543
- }
544
- const cellRange = this.selectedRange.current();
545
- const focusHighlight = this.highlight.getFocus();
546
- focusHighlight.clear();
547
- cellRange.setHighlight(coords);
548
- if (!this.inProgress) {
549
- this.runLocalHooks('beforeHighlightSet');
550
- }
551
- if (this.highlight.isEnabledFor(_highlight.FOCUS_TYPE, cellRange.highlight)) {
552
- focusHighlight.add(cellRange.highlight).commit().syncWith(cellRange);
553
- }
554
- if (!this.inProgress) {
555
- _classPrivateFieldSet(this, _isFocusSelectionChanged, true);
556
- this.runLocalHooks('afterSetFocus', cellRange.highlight);
557
- }
449
+ isMultiple() {
450
+ const isMultipleListener = (0, _object.createObjectPropListener)(!this.selectedRange.current().isSingle());
451
+ this.runLocalHooks('afterIsMultipleSelection', isMultipleListener);
452
+ return isMultipleListener.value;
558
453
  }
559
454
 
560
455
  /**
@@ -567,13 +462,7 @@ class Selection {
567
462
  */
568
463
  transformStart(rowDelta, colDelta) {
569
464
  let createMissingRecords = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
570
- if (this.settings.navigableHeaders) {
571
- _classPrivateFieldGet(this, _transformation).setOffsetSize({
572
- x: this.tableProps.countRowHeaders(),
573
- y: this.tableProps.countColHeaders()
574
- });
575
- }
576
- this.setRangeStart(_classPrivateFieldGet(this, _transformation).transformStart(rowDelta, colDelta, createMissingRecords));
465
+ this.setRangeStart(this.transformation.transformStart(rowDelta, colDelta, createMissingRecords));
577
466
  }
578
467
 
579
468
  /**
@@ -583,44 +472,7 @@ class Selection {
583
472
  * @param {number} colDelta Columns number to move, value can be passed as negative number.
584
473
  */
585
474
  transformEnd(rowDelta, colDelta) {
586
- if (this.settings.navigableHeaders) {
587
- _classPrivateFieldGet(this, _transformation).setOffsetSize({
588
- x: this.tableProps.countRowHeaders(),
589
- y: this.tableProps.countColHeaders()
590
- });
591
- }
592
- this.setRangeEnd(_classPrivateFieldGet(this, _transformation).transformEnd(rowDelta, colDelta));
593
- }
594
-
595
- /**
596
- * Transforms the focus cell selection relative to the current focus position.
597
- *
598
- * @param {number} rowDelta Rows number to move, value can be passed as negative number.
599
- * @param {number} colDelta Columns number to move, value can be passed as negative number.
600
- */
601
- transformFocus(rowDelta, colDelta) {
602
- const range = this.selectedRange.current();
603
- const {
604
- row,
605
- col
606
- } = range.getOuterTopStartCorner();
607
- const columnsInRange = this.tableProps.countRenderableColumnsInRange(0, col - 1);
608
- const rowsInRange = this.tableProps.countRenderableRowsInRange(0, row - 1);
609
- if (range.highlight.isHeader()) {
610
- // for header focus selection calculate the new coords based on the selection including headers
611
- _classPrivateFieldGet(this, _focusTransformation).setOffsetSize({
612
- x: col < 0 ? Math.abs(col) : -columnsInRange,
613
- y: row < 0 ? Math.abs(row) : -rowsInRange
614
- });
615
- } else {
616
- // for focus selection in cells calculate the new coords only based on the selected cells
617
- _classPrivateFieldGet(this, _focusTransformation).setOffsetSize({
618
- x: col < 0 ? 0 : -columnsInRange,
619
- y: row < 0 ? 0 : -rowsInRange
620
- });
621
- }
622
- const focusCoords = _classPrivateFieldGet(this, _focusTransformation).transformStart(rowDelta, colDelta);
623
- this.setRangeFocus(focusCoords.normalize());
475
+ this.setRangeEnd(this.transformation.transformEnd(rowDelta, colDelta));
624
476
  }
625
477
 
626
478
  /**
@@ -641,30 +493,6 @@ class Selection {
641
493
  return !this.selectedRange.isEmpty();
642
494
  }
643
495
 
644
- /**
645
- * Returns information if we have a multi-selection. This method check multi-selection only on the latest layer of
646
- * the selection.
647
- *
648
- * @returns {boolean}
649
- */
650
- isMultiple() {
651
- if (!this.isSelected()) {
652
- return false;
653
- }
654
- const isMultipleListener = (0, _object.createObjectPropListener)(!this.selectedRange.current().isSingle());
655
- this.runLocalHooks('afterIsMultipleSelection', isMultipleListener);
656
- return isMultipleListener.value;
657
- }
658
-
659
- /**
660
- * Checks if the last selection involves changing the focus cell position only.
661
- *
662
- * @returns {boolean}
663
- */
664
- isFocusSelectionChanged() {
665
- return this.isSelected() && _classPrivateFieldGet(this, _isFocusSelectionChanged);
666
- }
667
-
668
496
  /**
669
497
  * Returns `true` if the selection was applied by clicking to the row header. If the `layerLevel`
670
498
  * argument is passed then only that layer will be checked. Otherwise, it checks if any row header
@@ -863,7 +691,7 @@ class Selection {
863
691
  focusPosition,
864
692
  disableHeadersHighlight
865
693
  } = options;
866
- _classPrivateFieldSet(this, _disableHeadersHighlight, disableHeadersHighlight);
694
+ _classPrivateFieldSet(_disableHeadersHighlight, this, disableHeadersHighlight);
867
695
  if (focusPosition && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.row) && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.col)) {
868
696
  highlight = this.tableProps.createCellCoords((0, _number.clamp)(focusPosition.row, rowFrom, nrOfRows - 1), (0, _number.clamp)(focusPosition.col, columnFrom, nrOfColumns - 1));
869
697
  }
@@ -879,7 +707,7 @@ class Selection {
879
707
  }
880
708
  this.setRangeEnd(endCoords);
881
709
  this.finish();
882
- _classPrivateFieldSet(this, _disableHeadersHighlight, false);
710
+ _classPrivateFieldSet(_disableHeadersHighlight, this, false);
883
711
  }
884
712
 
885
713
  /**
@@ -947,10 +775,9 @@ class Selection {
947
775
  *
948
776
  * @param {number|string} startColumn Visual column index or column property from which the selection starts.
949
777
  * @param {number|string} [endColumn] Visual column index or column property from to the selection finishes.
950
- * @param {number | { row: number, col: number }} [focusPosition=0] The argument allows changing the cell/header focus
951
- * position. The value can take visual row index from -N to N, where negative values point to the headers and positive
952
- * values point to the cell range. An object with `row` and `col` properties also can be passed to change the focus
953
- * position horizontally.
778
+ * @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
779
+ * The value can take visual row index from -N to N, where negative values
780
+ * point to the headers and positive values point to the cell range.
954
781
  * @returns {boolean} Returns `true` if selection was successful, `false` otherwise.
955
782
  */
956
783
  selectColumns(startColumn) {
@@ -971,20 +798,11 @@ class Selection {
971
798
  countColHeaders
972
799
  });
973
800
  if (isValid) {
974
- let highlightRow = 0;
975
- let highlightColumn = 0;
976
- if (Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.row) && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.col)) {
977
- highlightRow = (0, _number.clamp)(focusPosition.row, columnHeaderLastIndex, countRows - 1);
978
- highlightColumn = (0, _number.clamp)(focusPosition.col, Math.min(start, end), Math.max(start, end));
979
- } else {
980
- highlightRow = (0, _number.clamp)(focusPosition, columnHeaderLastIndex, countRows - 1);
981
- highlightColumn = start;
982
- }
983
- const highlight = this.tableProps.createCellCoords(highlightRow, highlightColumn);
984
- const fromRow = countColHeaders === 0 ? 0 : (0, _number.clamp)(highlight.row, columnHeaderLastIndex, -1);
801
+ const fromRow = countColHeaders === 0 ? 0 : (0, _number.clamp)(focusPosition, columnHeaderLastIndex, -1);
985
802
  const toRow = countRows - 1;
986
803
  const from = this.tableProps.createCellCoords(fromRow, start);
987
804
  const to = this.tableProps.createCellCoords(toRow, end);
805
+ const highlight = this.tableProps.createCellCoords((0, _number.clamp)(focusPosition, columnHeaderLastIndex, countRows - 1), start);
988
806
  this.runLocalHooks('beforeSelectColumns', from, to, highlight);
989
807
 
990
808
  // disallow modifying row axis for that hooks
@@ -1004,10 +822,9 @@ class Selection {
1004
822
  *
1005
823
  * @param {number} startRow Visual row index from which the selection starts.
1006
824
  * @param {number} [endRow] Visual row index from to the selection finishes.
1007
- * @param {number | { row: number, col: number }} [focusPosition=0] The argument allows changing the cell/header focus
1008
- * position. The value can take visual row index from -N to N, where negative values point to the headers and positive
1009
- * values point to the cell range. An object with `row` and `col` properties also can be passed to change the focus
1010
- * position horizontally.
825
+ * @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
826
+ * The value can take visual column index from -N to N, where negative values
827
+ * point to the headers and positive values point to the cell range.
1011
828
  * @returns {boolean} Returns `true` if selection was successful, `false` otherwise.
1012
829
  */
1013
830
  selectRows(startRow) {
@@ -1026,20 +843,11 @@ class Selection {
1026
843
  countColHeaders: 0
1027
844
  });
1028
845
  if (isValid) {
1029
- let highlightRow = 0;
1030
- let highlightColumn = 0;
1031
- if (Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.row) && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.col)) {
1032
- highlightRow = (0, _number.clamp)(focusPosition.row, Math.min(startRow, endRow), Math.max(startRow, endRow));
1033
- highlightColumn = (0, _number.clamp)(focusPosition.col, rowHeaderLastIndex, countCols - 1);
1034
- } else {
1035
- highlightRow = startRow;
1036
- highlightColumn = (0, _number.clamp)(focusPosition, rowHeaderLastIndex, countCols - 1);
1037
- }
1038
- const highlight = this.tableProps.createCellCoords(highlightRow, highlightColumn);
1039
- const fromColumn = countRowHeaders === 0 ? 0 : (0, _number.clamp)(highlight.col, rowHeaderLastIndex, -1);
846
+ const fromColumn = countRowHeaders === 0 ? 0 : (0, _number.clamp)(focusPosition, rowHeaderLastIndex, -1);
1040
847
  const toColumn = countCols - 1;
1041
848
  const from = this.tableProps.createCellCoords(startRow, fromColumn);
1042
849
  const to = this.tableProps.createCellCoords(endRow, toColumn);
850
+ const highlight = this.tableProps.createCellCoords(startRow, (0, _number.clamp)(focusPosition, rowHeaderLastIndex, countCols - 1));
1043
851
  this.runLocalHooks('beforeSelectRows', from, to, highlight);
1044
852
 
1045
853
  // disallow modifying column axis for that hooks