handsontable 0.0.0-next-53a190b-20240403 → 0.0.0-next-5a535ed-20240403

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 (284) hide show
  1. package/3rdparty/walkontable/src/calculator/viewportColumns.js +17 -12
  2. package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +17 -12
  3. package/3rdparty/walkontable/src/calculator/viewportRows.js +15 -10
  4. package/3rdparty/walkontable/src/calculator/viewportRows.mjs +15 -10
  5. package/3rdparty/walkontable/src/cell/coords.js +17 -12
  6. package/3rdparty/walkontable/src/cell/coords.mjs +17 -12
  7. package/3rdparty/walkontable/src/cell/range.d.ts +1 -2
  8. package/3rdparty/walkontable/src/cell/range.js +28 -40
  9. package/3rdparty/walkontable/src/cell/range.mjs +28 -40
  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 +104 -72
  13. package/3rdparty/walkontable/src/event.mjs +104 -72
  14. package/3rdparty/walkontable/src/overlay/inlineStart.js +1 -15
  15. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -16
  16. package/3rdparty/walkontable/src/overlay/top.js +0 -11
  17. package/3rdparty/walkontable/src/overlay/top.mjs +1 -12
  18. package/3rdparty/walkontable/src/overlays.js +4 -46
  19. package/3rdparty/walkontable/src/overlays.mjs +4 -46
  20. package/3rdparty/walkontable/src/scroll.js +17 -15
  21. package/3rdparty/walkontable/src/scroll.mjs +17 -15
  22. package/3rdparty/walkontable/src/selection/manager.js +69 -48
  23. package/3rdparty/walkontable/src/selection/manager.mjs +69 -48
  24. package/3rdparty/walkontable/src/selection/scanner.js +42 -33
  25. package/3rdparty/walkontable/src/selection/scanner.mjs +42 -33
  26. package/3rdparty/walkontable/src/utils/columnStretching.js +44 -27
  27. package/3rdparty/walkontable/src/utils/columnStretching.mjs +44 -27
  28. package/3rdparty/walkontable/src/utils/orderView/view.js +1 -1
  29. package/3rdparty/walkontable/src/utils/orderView/view.mjs +1 -1
  30. package/base.js +2 -2
  31. package/base.mjs +2 -2
  32. package/core/viewportScroll/index.js +1 -4
  33. package/core/viewportScroll/index.mjs +1 -4
  34. package/core.d.ts +3 -4
  35. package/core.js +22 -77
  36. package/core.mjs +22 -77
  37. package/dataMap/dataSource.js +1 -1
  38. package/dataMap/dataSource.mjs +1 -1
  39. package/dataMap/metaManager/metaLayers/cellMeta.js +1 -1
  40. package/dataMap/metaManager/metaLayers/cellMeta.mjs +1 -1
  41. package/dataMap/metaManager/metaSchema.js +1 -1
  42. package/dataMap/metaManager/metaSchema.mjs +1 -1
  43. package/dataMap/replaceData.js +1 -1
  44. package/dataMap/replaceData.mjs +1 -1
  45. package/dist/handsontable.css +4 -4
  46. package/dist/handsontable.full.css +4 -4
  47. package/dist/handsontable.full.js +9121 -9062
  48. package/dist/handsontable.full.min.css +3 -3
  49. package/dist/handsontable.full.min.js +292 -292
  50. package/dist/handsontable.js +6573 -6967
  51. package/dist/handsontable.min.css +3 -3
  52. package/dist/handsontable.min.js +25 -25
  53. package/dist/languages/all.min.js +1 -1
  54. package/dist/languages/ar-AR.min.js +1 -1
  55. package/dist/languages/cs-CZ.min.js +1 -1
  56. package/dist/languages/de-CH.min.js +1 -1
  57. package/dist/languages/de-DE.min.js +1 -1
  58. package/dist/languages/en-US.min.js +1 -1
  59. package/dist/languages/es-MX.min.js +1 -1
  60. package/dist/languages/fr-FR.min.js +1 -1
  61. package/dist/languages/hr-HR.min.js +1 -1
  62. package/dist/languages/it-IT.min.js +1 -1
  63. package/dist/languages/ja-JP.min.js +1 -1
  64. package/dist/languages/ko-KR.min.js +1 -1
  65. package/dist/languages/lv-LV.min.js +1 -1
  66. package/dist/languages/nb-NO.min.js +1 -1
  67. package/dist/languages/nl-NL.min.js +1 -1
  68. package/dist/languages/pl-PL.min.js +1 -1
  69. package/dist/languages/pt-BR.min.js +1 -1
  70. package/dist/languages/ru-RU.min.js +1 -1
  71. package/dist/languages/sr-SP.min.js +1 -1
  72. package/dist/languages/zh-CN.min.js +1 -1
  73. package/dist/languages/zh-TW.min.js +1 -1
  74. package/editorManager.js +23 -25
  75. package/editorManager.mjs +23 -25
  76. package/editors/autocompleteEditor/autocompleteEditor.js +10 -6
  77. package/editors/autocompleteEditor/autocompleteEditor.mjs +10 -6
  78. package/editors/selectEditor/selectEditor.js +19 -20
  79. package/editors/selectEditor/selectEditor.mjs +19 -20
  80. package/eventManager.js +1 -1
  81. package/eventManager.mjs +1 -1
  82. package/focusManager.js +82 -64
  83. package/focusManager.mjs +82 -64
  84. package/helpers/dom/element.js +1 -23
  85. package/helpers/dom/element.mjs +1 -21
  86. package/helpers/mixed.js +1 -1
  87. package/helpers/mixed.mjs +1 -1
  88. package/helpers/object.js +2 -2
  89. package/helpers/object.mjs +2 -2
  90. package/index.d.ts +0 -10
  91. package/package.json +2 -7
  92. package/pluginHooks.d.ts +3 -4
  93. package/pluginHooks.js +38 -99
  94. package/pluginHooks.mjs +38 -99
  95. package/plugins/autoColumnSize/autoColumnSize.js +65 -49
  96. package/plugins/autoColumnSize/autoColumnSize.mjs +65 -49
  97. package/plugins/autoRowSize/autoRowSize.js +34 -28
  98. package/plugins/autoRowSize/autoRowSize.mjs +34 -28
  99. package/plugins/autofill/autofill.js +38 -30
  100. package/plugins/autofill/autofill.mjs +38 -30
  101. package/plugins/base/base.js +17 -12
  102. package/plugins/base/base.mjs +17 -12
  103. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
  104. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
  105. package/plugins/collapsibleColumns/collapsibleColumns.js +50 -59
  106. package/plugins/collapsibleColumns/collapsibleColumns.mjs +50 -59
  107. package/plugins/columnSorting/columnSorting.js +45 -49
  108. package/plugins/columnSorting/columnSorting.mjs +45 -49
  109. package/plugins/columnSummary/columnSummary.js +26 -22
  110. package/plugins/columnSummary/columnSummary.mjs +26 -22
  111. package/plugins/comments/comments.js +158 -116
  112. package/plugins/comments/comments.mjs +158 -116
  113. package/plugins/contextMenu/contextMenu.js +26 -20
  114. package/plugins/contextMenu/contextMenu.mjs +26 -20
  115. package/plugins/contextMenu/itemsFactory.js +1 -1
  116. package/plugins/contextMenu/itemsFactory.mjs +1 -1
  117. package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
  118. package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
  119. package/plugins/contextMenu/menu/menu.js +21 -13
  120. package/plugins/contextMenu/menu/menu.mjs +21 -13
  121. package/plugins/contextMenu/menu/positioner.js +58 -41
  122. package/plugins/contextMenu/menu/positioner.mjs +58 -41
  123. package/plugins/copyPaste/copyPaste.js +157 -116
  124. package/plugins/copyPaste/copyPaste.mjs +157 -116
  125. package/plugins/copyPaste/copyableRanges.js +66 -43
  126. package/plugins/copyPaste/copyableRanges.mjs +66 -43
  127. package/plugins/customBorders/customBorders.js +13 -11
  128. package/plugins/customBorders/customBorders.mjs +13 -11
  129. package/plugins/dragToScroll/dragToScroll.js +6 -6
  130. package/plugins/dragToScroll/dragToScroll.mjs +6 -6
  131. package/plugins/dropdownMenu/dropdownMenu.js +106 -80
  132. package/plugins/dropdownMenu/dropdownMenu.mjs +106 -80
  133. package/plugins/exportFile/dataProvider.js +1 -1
  134. package/plugins/exportFile/dataProvider.mjs +1 -1
  135. package/plugins/filters/component/actionBar.js +9 -9
  136. package/plugins/filters/component/actionBar.mjs +8 -8
  137. package/plugins/filters/component/condition.js +15 -13
  138. package/plugins/filters/component/condition.mjs +15 -13
  139. package/plugins/filters/component/operators.js +6 -6
  140. package/plugins/filters/component/operators.mjs +6 -6
  141. package/plugins/filters/component/value.js +28 -24
  142. package/plugins/filters/component/value.mjs +28 -24
  143. package/plugins/filters/conditionUpdateObserver.js +24 -22
  144. package/plugins/filters/conditionUpdateObserver.mjs +24 -22
  145. package/plugins/filters/dataFilter.js +1 -1
  146. package/plugins/filters/dataFilter.mjs +1 -1
  147. package/plugins/filters/filters.js +95 -81
  148. package/plugins/filters/filters.mjs +95 -81
  149. package/plugins/filters/ui/input.js +19 -13
  150. package/plugins/filters/ui/input.mjs +19 -13
  151. package/plugins/filters/ui/link.js +13 -8
  152. package/plugins/filters/ui/link.mjs +13 -8
  153. package/plugins/filters/ui/multipleSelect.js +112 -85
  154. package/plugins/filters/ui/multipleSelect.mjs +112 -85
  155. package/plugins/filters/ui/radioInput.js +20 -12
  156. package/plugins/filters/ui/radioInput.mjs +20 -12
  157. package/plugins/filters/ui/select.js +72 -50
  158. package/plugins/filters/ui/select.mjs +71 -49
  159. package/plugins/formulas/formulas.js +326 -268
  160. package/plugins/formulas/formulas.mjs +327 -269
  161. package/plugins/formulas/indexSyncer/axisSyncer.js +61 -38
  162. package/plugins/formulas/indexSyncer/axisSyncer.mjs +61 -38
  163. package/plugins/formulas/indexSyncer/index.js +48 -25
  164. package/plugins/formulas/indexSyncer/index.mjs +48 -25
  165. package/plugins/hiddenColumns/hiddenColumns.js +83 -64
  166. package/plugins/hiddenColumns/hiddenColumns.mjs +83 -64
  167. package/plugins/hiddenRows/hiddenRows.js +82 -63
  168. package/plugins/hiddenRows/hiddenRows.mjs +82 -63
  169. package/plugins/manualColumnFreeze/manualColumnFreeze.js +32 -24
  170. package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +33 -25
  171. package/plugins/manualColumnMove/manualColumnMove.js +170 -126
  172. package/plugins/manualColumnMove/manualColumnMove.mjs +170 -126
  173. package/plugins/manualColumnResize/manualColumnResize.js +230 -169
  174. package/plugins/manualColumnResize/manualColumnResize.mjs +230 -169
  175. package/plugins/manualRowMove/manualRowMove.js +128 -99
  176. package/plugins/manualRowMove/manualRowMove.mjs +128 -99
  177. package/plugins/manualRowResize/manualRowResize.js +209 -150
  178. package/plugins/manualRowResize/manualRowResize.mjs +209 -150
  179. package/plugins/mergeCells/calculations/selection.js +71 -2
  180. package/plugins/mergeCells/calculations/selection.mjs +71 -2
  181. package/plugins/mergeCells/cellsCollection.js +1 -117
  182. package/plugins/mergeCells/cellsCollection.mjs +1 -117
  183. package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
  184. package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
  185. package/plugins/mergeCells/mergeCells.js +397 -499
  186. package/plugins/mergeCells/mergeCells.mjs +397 -499
  187. package/plugins/multiColumnSorting/multiColumnSorting.js +2 -8
  188. package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -8
  189. package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
  190. package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
  191. package/plugins/nestedHeaders/nestedHeaders.js +253 -205
  192. package/plugins/nestedHeaders/nestedHeaders.mjs +254 -206
  193. package/plugins/nestedHeaders/stateManager/headersTree.js +32 -21
  194. package/plugins/nestedHeaders/stateManager/headersTree.mjs +32 -21
  195. package/plugins/nestedHeaders/stateManager/index.js +41 -30
  196. package/plugins/nestedHeaders/stateManager/index.mjs +41 -30
  197. package/plugins/nestedHeaders/stateManager/sourceSettings.js +30 -19
  198. package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +30 -19
  199. package/plugins/nestedRows/data/dataManager.js +1 -1
  200. package/plugins/nestedRows/data/dataManager.mjs +1 -1
  201. package/plugins/nestedRows/nestedRows.js +182 -151
  202. package/plugins/nestedRows/nestedRows.mjs +183 -152
  203. package/plugins/nestedRows/ui/contextMenu.js +15 -11
  204. package/plugins/nestedRows/ui/contextMenu.mjs +14 -10
  205. package/plugins/nestedRows/utils/rowMoveController.js +1 -1
  206. package/plugins/nestedRows/utils/rowMoveController.mjs +1 -1
  207. package/plugins/persistentState/storage.js +2 -2
  208. package/plugins/persistentState/storage.mjs +2 -2
  209. package/plugins/search/search.js +7 -7
  210. package/plugins/search/search.mjs +7 -7
  211. package/plugins/touchScroll/touchScroll.js +19 -15
  212. package/plugins/touchScroll/touchScroll.mjs +20 -16
  213. package/plugins/trimRows/trimRows.js +6 -6
  214. package/plugins/trimRows/trimRows.mjs +6 -6
  215. package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
  216. package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
  217. package/selection/highlight/highlight.js +14 -14
  218. package/selection/highlight/highlight.mjs +13 -13
  219. package/selection/highlight/visualSelection.js +0 -2
  220. package/selection/highlight/visualSelection.mjs +0 -2
  221. package/selection/selection.js +67 -225
  222. package/selection/selection.mjs +66 -224
  223. package/selection/transformation.js +118 -149
  224. package/selection/transformation.mjs +118 -149
  225. package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
  226. package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
  227. package/shortcutContexts/commands/editor/open.js +3 -18
  228. package/shortcutContexts/commands/editor/open.mjs +3 -18
  229. package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
  230. package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
  231. package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
  232. package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
  233. package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
  234. package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
  235. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
  236. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
  237. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
  238. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
  239. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
  240. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
  241. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
  242. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
  243. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
  244. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
  245. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
  246. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
  247. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
  248. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
  249. package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
  250. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
  251. package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
  252. package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
  253. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
  254. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
  255. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
  256. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
  257. package/shortcutContexts/grid.js +3 -9
  258. package/shortcutContexts/grid.mjs +3 -9
  259. package/shortcuts/context.js +1 -2
  260. package/shortcuts/context.mjs +1 -2
  261. package/tableView.js +78 -52
  262. package/tableView.mjs +78 -52
  263. package/translations/changesObservable/observable.js +38 -21
  264. package/translations/changesObservable/observable.mjs +38 -21
  265. package/translations/changesObservable/observer.js +12 -7
  266. package/translations/changesObservable/observer.mjs +11 -6
  267. package/translations/mapCollections/aggregatedCollection.js +1 -1
  268. package/translations/mapCollections/aggregatedCollection.mjs +1 -1
  269. package/translations/maps/indexMap.js +1 -1
  270. package/translations/maps/indexMap.mjs +1 -1
  271. package/utils/dataStructures/linkedList.js +1 -6
  272. package/utils/dataStructures/linkedList.mjs +1 -6
  273. package/utils/dataStructures/tree.js +1 -1
  274. package/utils/dataStructures/tree.mjs +1 -1
  275. package/utils/interval.js +44 -26
  276. package/utils/interval.mjs +44 -26
  277. package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
  278. package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
  279. package/i18n/languages/ar-AR.d.ts +0 -5
  280. package/i18n/languages/cs-CZ.d.ts +0 -5
  281. package/i18n/languages/hr-HR.d.ts +0 -5
  282. package/i18n/languages/sr-SP.d.ts +0 -5
  283. package/plugins/mergeCells/focusOrder.js +0 -305
  284. package/plugins/mergeCells/focusOrder.mjs +0 -300
@@ -4,9 +4,11 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
4
4
  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; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
6
6
  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); }
7
- function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
8
- function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
9
- 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"); }
7
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
8
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
9
+ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
10
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
11
+ 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; } }
10
12
  import Highlight, { AREA_TYPE, HEADER_TYPE, FOCUS_TYPE } from "./highlight/highlight.mjs";
11
13
  import SelectionRange from "./range.mjs";
12
14
  import { createObjectPropListener, mixin } from "./../helpers/object.mjs";
@@ -22,9 +24,6 @@ import { A11Y_SELECTED } from "../helpers/a11y.mjs";
22
24
  * @class Selection
23
25
  * @util
24
26
  */
25
- var _transformation = /*#__PURE__*/new WeakMap();
26
- var _focusTransformation = /*#__PURE__*/new WeakMap();
27
- var _isFocusSelectionChanged = /*#__PURE__*/new WeakMap();
28
27
  var _disableHeadersHighlight = /*#__PURE__*/new WeakMap();
29
28
  var _selectionSource = /*#__PURE__*/new WeakMap();
30
29
  var _expectedLayersCount = /*#__PURE__*/new WeakMap();
@@ -64,17 +63,11 @@ class Selection {
64
63
  */
65
64
  _defineProperty(this, "highlight", void 0);
66
65
  /**
67
- * The module for modifying coordinates of the start and end selection.
66
+ * The module for modifying coordinates.
68
67
  *
69
68
  * @type {Transformation}
70
69
  */
71
- _classPrivateFieldInitSpec(this, _transformation, void 0);
72
- /**
73
- * The module for modifying coordinates of the focus selection.
74
- *
75
- * @type {Transformation}
76
- */
77
- _classPrivateFieldInitSpec(this, _focusTransformation, void 0);
70
+ _defineProperty(this, "transformation", void 0);
78
71
  /**
79
72
  * The collection of the selection layer levels where the whole row was selected using the row header or
80
73
  * the corner header.
@@ -89,31 +82,34 @@ class Selection {
89
82
  * @type {Set<number>}
90
83
  */
91
84
  _defineProperty(this, "selectedByColumnHeader", new Set());
92
- /**
93
- * The flag which determines if the focus selection was changed.
94
- *
95
- * @type {boolean}
96
- */
97
- _classPrivateFieldInitSpec(this, _isFocusSelectionChanged, false);
98
85
  /**
99
86
  * When sets disable highlighting the headers even when the logical coordinates points on them.
100
87
  *
101
88
  * @type {boolean}
102
89
  */
103
- _classPrivateFieldInitSpec(this, _disableHeadersHighlight, false);
90
+ _classPrivateFieldInitSpec(this, _disableHeadersHighlight, {
91
+ writable: true,
92
+ value: false
93
+ });
104
94
  /**
105
95
  * The source of the selection. It can be one of the following values: `mouse`, `unknown` or any other string.
106
96
  *
107
97
  * @type {'mouse' | 'unknown' | string}
108
98
  */
109
- _classPrivateFieldInitSpec(this, _selectionSource, 'unknown');
99
+ _classPrivateFieldInitSpec(this, _selectionSource, {
100
+ writable: true,
101
+ value: 'unknown'
102
+ });
110
103
  /**
111
104
  * The number of expected layers. It is used mostly to track when the last selection layer of non-contiguous
112
105
  * selection is applied, thus the viewport scroll is triggered.
113
106
  *
114
107
  * @param {number}
115
108
  */
116
- _classPrivateFieldInitSpec(this, _expectedLayersCount, -1);
109
+ _classPrivateFieldInitSpec(this, _expectedLayersCount, {
110
+ writable: true,
111
+ value: -1
112
+ });
117
113
  this.settings = settings;
118
114
  this.tableProps = tableProps;
119
115
  this.highlight = new Highlight({
@@ -136,112 +132,71 @@ class Selection {
136
132
  createCellCoords: (row, column) => this.tableProps.createCellCoords(row, column),
137
133
  createCellRange: (highlight, from, to) => this.tableProps.createCellRange(highlight, from, to)
138
134
  });
139
- _classPrivateFieldSet(_transformation, this, new Transformation(this.selectedRange, {
135
+ this.transformation = new Transformation(this.selectedRange, {
140
136
  rowIndexMapper: this.tableProps.rowIndexMapper,
141
137
  columnIndexMapper: this.tableProps.columnIndexMapper,
142
138
  countRenderableRows: () => this.tableProps.countRenderableRows(),
143
139
  countRenderableColumns: () => this.tableProps.countRenderableColumns(),
140
+ countRowHeaders: () => this.tableProps.countRowHeaders(),
141
+ countColHeaders: () => this.tableProps.countColHeaders(),
144
142
  visualToRenderableCoords: coords => this.tableProps.visualToRenderableCoords(coords),
145
143
  renderableToVisualCoords: coords => this.tableProps.renderableToVisualCoords(coords),
146
- findFirstNonHiddenRenderableRow: function () {
147
- return _this.tableProps.findFirstNonHiddenRenderableRow(...arguments);
148
- },
149
- findFirstNonHiddenRenderableColumn: function () {
150
- return _this.tableProps.findFirstNonHiddenRenderableColumn(...arguments);
151
- },
152
144
  createCellCoords: (row, column) => this.tableProps.createCellCoords(row, column),
145
+ navigableHeaders: () => settings.navigableHeaders,
153
146
  fixedRowsBottom: () => settings.fixedRowsBottom,
154
147
  minSpareRows: () => settings.minSpareRows,
155
148
  minSpareCols: () => settings.minSpareCols,
156
149
  autoWrapRow: () => settings.autoWrapRow,
157
150
  autoWrapCol: () => settings.autoWrapCol
158
- }));
159
- _classPrivateFieldSet(_focusTransformation, this, new Transformation(this.selectedRange, {
160
- rowIndexMapper: this.tableProps.rowIndexMapper,
161
- columnIndexMapper: this.tableProps.columnIndexMapper,
162
- countRenderableRows: () => {
163
- const range = this.selectedRange.current();
164
- return this.tableProps.countRenderableRowsInRange(0, range.getOuterBottomEndCorner().row);
165
- },
166
- countRenderableColumns: () => {
167
- const range = this.selectedRange.current();
168
- return this.tableProps.countRenderableColumnsInRange(0, range.getOuterBottomEndCorner().col);
169
- },
170
- visualToRenderableCoords: coords => this.tableProps.visualToRenderableCoords(coords),
171
- 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
- createCellCoords: (row, column) => this.tableProps.createCellCoords(row, column),
179
- fixedRowsBottom: () => 0,
180
- minSpareRows: () => 0,
181
- minSpareCols: () => 0,
182
- autoWrapRow: () => true,
183
- autoWrapCol: () => true
184
- }));
185
- _classPrivateFieldGet(_transformation, this).addLocalHook('beforeTransformStart', function () {
151
+ });
152
+ this.transformation.addLocalHook('beforeTransformStart', function () {
186
153
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
187
154
  args[_key] = arguments[_key];
188
155
  }
189
156
  return _this.runLocalHooks('beforeModifyTransformStart', ...args);
190
157
  });
191
- _classPrivateFieldGet(_transformation, this).addLocalHook('afterTransformStart', function () {
158
+ this.transformation.addLocalHook('afterTransformStart', function () {
192
159
  for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
193
160
  args[_key2] = arguments[_key2];
194
161
  }
195
162
  return _this.runLocalHooks('afterModifyTransformStart', ...args);
196
163
  });
197
- _classPrivateFieldGet(_transformation, this).addLocalHook('beforeTransformEnd', function () {
164
+ this.transformation.addLocalHook('beforeTransformEnd', function () {
198
165
  for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
199
166
  args[_key3] = arguments[_key3];
200
167
  }
201
168
  return _this.runLocalHooks('beforeModifyTransformEnd', ...args);
202
169
  });
203
- _classPrivateFieldGet(_transformation, this).addLocalHook('afterTransformEnd', function () {
170
+ this.transformation.addLocalHook('afterTransformEnd', function () {
204
171
  for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
205
172
  args[_key4] = arguments[_key4];
206
173
  }
207
174
  return _this.runLocalHooks('afterModifyTransformEnd', ...args);
208
175
  });
209
- _classPrivateFieldGet(_transformation, this).addLocalHook('insertRowRequire', function () {
176
+ this.transformation.addLocalHook('insertRowRequire', function () {
210
177
  for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
211
178
  args[_key5] = arguments[_key5];
212
179
  }
213
180
  return _this.runLocalHooks('insertRowRequire', ...args);
214
181
  });
215
- _classPrivateFieldGet(_transformation, this).addLocalHook('insertColRequire', function () {
182
+ this.transformation.addLocalHook('insertColRequire', function () {
216
183
  for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
217
184
  args[_key6] = arguments[_key6];
218
185
  }
219
186
  return _this.runLocalHooks('insertColRequire', ...args);
220
187
  });
221
- _classPrivateFieldGet(_transformation, this).addLocalHook('beforeRowWrap', function () {
188
+ this.transformation.addLocalHook('beforeRowWrap', function () {
222
189
  for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
223
190
  args[_key7] = arguments[_key7];
224
191
  }
225
192
  return _this.runLocalHooks('beforeRowWrap', ...args);
226
193
  });
227
- _classPrivateFieldGet(_transformation, this).addLocalHook('beforeColumnWrap', function () {
194
+ this.transformation.addLocalHook('beforeColumnWrap', function () {
228
195
  for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
229
196
  args[_key8] = arguments[_key8];
230
197
  }
231
198
  return _this.runLocalHooks('beforeColumnWrap', ...args);
232
199
  });
233
- _classPrivateFieldGet(_focusTransformation, this).addLocalHook('beforeTransformStart', function () {
234
- for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
235
- args[_key9] = arguments[_key9];
236
- }
237
- return _this.runLocalHooks('beforeModifyTransformFocus', ...args);
238
- });
239
- _classPrivateFieldGet(_focusTransformation, this).addLocalHook('afterTransformStart', function () {
240
- for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
241
- args[_key10] = arguments[_key10];
242
- }
243
- return _this.runLocalHooks('afterModifyTransformFocus', ...args);
244
- });
245
200
  }
246
201
 
247
202
  /**
@@ -259,14 +214,14 @@ class Selection {
259
214
  * @param {'mouse' | 'unknown' | string} sourceName The source name.
260
215
  */
261
216
  markSource(sourceName) {
262
- _classPrivateFieldSet(_selectionSource, this, sourceName);
217
+ _classPrivateFieldSet(this, _selectionSource, sourceName);
263
218
  }
264
219
 
265
220
  /**
266
221
  * Marks end of the selection source. It restores the selection source to default value which is 'unknown'.
267
222
  */
268
223
  markEndSource() {
269
- _classPrivateFieldSet(_selectionSource, this, 'unknown');
224
+ _classPrivateFieldSet(this, _selectionSource, 'unknown');
270
225
  }
271
226
 
272
227
  /**
@@ -275,7 +230,7 @@ class Selection {
275
230
  * @returns {'mouse' | 'unknown' | string}
276
231
  */
277
232
  getSelectionSource() {
278
- return _classPrivateFieldGet(_selectionSource, this);
233
+ return _classPrivateFieldGet(this, _selectionSource);
279
234
  }
280
235
 
281
236
  /**
@@ -285,7 +240,7 @@ class Selection {
285
240
  * @param {number} layersCount The number of expected layers.
286
241
  */
287
242
  setExpectedLayers(layersCount) {
288
- _classPrivateFieldSet(_expectedLayersCount, this, layersCount);
243
+ _classPrivateFieldSet(this, _expectedLayersCount, layersCount);
289
244
  }
290
245
 
291
246
  /**
@@ -301,7 +256,7 @@ class Selection {
301
256
  finish() {
302
257
  this.runLocalHooks('afterSelectionFinished', Array.from(this.selectedRange));
303
258
  this.inProgress = false;
304
- _classPrivateFieldSet(_expectedLayersCount, this, -1);
259
+ _classPrivateFieldSet(this, _expectedLayersCount, -1);
305
260
  }
306
261
 
307
262
  /**
@@ -332,7 +287,6 @@ class Selection {
332
287
  // We are creating copy. We would like to modify just the start of the selection by below hook. Then original coords
333
288
  // should be handled by next methods.
334
289
  const coordsClone = coords.clone();
335
- _classPrivateFieldSet(_isFocusSelectionChanged, this, false);
336
290
  this.runLocalHooks(`beforeSetRangeStart${fragment ? 'Only' : ''}`, coordsClone);
337
291
  if (!isMultipleMode || isMultipleMode && !isMultipleSelection && isUndefined(multipleSelection)) {
338
292
  this.selectedRange.clear();
@@ -390,20 +344,7 @@ class Selection {
390
344
  cellRange.setFrom(cellRange.highlight);
391
345
  cellRange.setTo(cellRange.highlight);
392
346
  } else {
393
- const horizontalDir = cellRange.getHorizontalDirection();
394
- const verticalDir = cellRange.getVerticalDirection();
395
- const isMultiple = this.isMultiple();
396
347
  cellRange.setTo(coordsClone);
397
- if (isMultiple && (horizontalDir !== cellRange.getHorizontalDirection() || cellRange.getWidth() === 1 && !cellRange.includes(cellRange.highlight))) {
398
- cellRange.from.assign({
399
- col: cellRange.highlight.col
400
- });
401
- }
402
- if (isMultiple && (verticalDir !== cellRange.getVerticalDirection() || cellRange.getHeight() === 1 && !cellRange.includes(cellRange.highlight))) {
403
- cellRange.from.assign({
404
- row: cellRange.highlight.row
405
- });
406
- }
407
348
  }
408
349
 
409
350
  // Prevent creating "area" selection that overlaps headers.
@@ -413,7 +354,11 @@ class Selection {
413
354
  }
414
355
  }
415
356
  this.runLocalHooks('beforeHighlightSet');
416
- this.setRangeFocus(this.selectedRange.current().highlight);
357
+ const focusHighlight = this.highlight.getFocus();
358
+ focusHighlight.clear();
359
+ if (this.highlight.isEnabledFor(FOCUS_TYPE, cellRange.highlight)) {
360
+ focusHighlight.add(this.selectedRange.current().highlight).commit().syncWith(cellRange);
361
+ }
417
362
  const layerLevel = this.getLayerLevel();
418
363
 
419
364
  // If the next layer level is lower than previous then clear all area and header highlights. This is the
@@ -484,8 +429,8 @@ class Selection {
484
429
  columnHighlight.add(columnCoordsFrom).add(columnCoordsTo).commit();
485
430
  }
486
431
  }
487
- const highlightRowHeaders = !_classPrivateFieldGet(_disableHeadersHighlight, this) && this.isEntireRowSelected() && (countCols > 0 && countCols === cellRange.getWidth() || countCols === 0 && this.isSelectedByRowHeader());
488
- const highlightColumnHeaders = !_classPrivateFieldGet(_disableHeadersHighlight, this) && this.isEntireColumnSelected() && (countRows > 0 && countRows === cellRange.getHeight() || countRows === 0 && this.isSelectedByColumnHeader());
432
+ const highlightRowHeaders = !_classPrivateFieldGet(this, _disableHeadersHighlight) && this.isEntireRowSelected() && (countCols > 0 && countCols === cellRange.getWidth() || countCols === 0 && this.isSelectedByRowHeader());
433
+ const highlightColumnHeaders = !_classPrivateFieldGet(this, _disableHeadersHighlight) && this.isEntireColumnSelected() && (countRows > 0 && countRows === cellRange.getHeight() || countRows === 0 && this.isSelectedByColumnHeader());
489
434
  if (highlightRowHeaders) {
490
435
  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();
491
436
  }
@@ -496,36 +441,20 @@ class Selection {
496
441
  activeCornerHeaderHighlight.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(), -this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1, -1)).commit();
497
442
  }
498
443
  }
499
- const isLastLayer = _classPrivateFieldGet(_expectedLayersCount, this) === -1 || this.selectedRange.size() === _classPrivateFieldGet(_expectedLayersCount, this);
444
+ const isLastLayer = _classPrivateFieldGet(this, _expectedLayersCount) === -1 || this.selectedRange.size() === _classPrivateFieldGet(this, _expectedLayersCount);
500
445
  this.runLocalHooks('afterSetRangeEnd', coords, isLastLayer);
501
446
  }
502
447
 
503
448
  /**
504
- * Sets the selection focus position at the specified coordinates.
449
+ * Returns information if we have a multiselection. This method check multiselection only on the latest layer of
450
+ * the selection.
505
451
  *
506
- * @param {CellCoords} coords The CellCoords instance with defined visual coordinates.
452
+ * @returns {boolean}
507
453
  */
508
- setRangeFocus(coords) {
509
- if (this.selectedRange.isEmpty()) {
510
- return;
511
- }
512
- const cellRange = this.selectedRange.current();
513
- if (!this.inProgress) {
514
- this.runLocalHooks('beforeSetFocus', coords);
515
- }
516
- const focusHighlight = this.highlight.getFocus();
517
- focusHighlight.clear();
518
- cellRange.setHighlight(coords);
519
- if (!this.inProgress) {
520
- this.runLocalHooks('beforeHighlightSet');
521
- }
522
- if (this.highlight.isEnabledFor(FOCUS_TYPE, cellRange.highlight)) {
523
- focusHighlight.add(cellRange.highlight).commit().syncWith(cellRange);
524
- }
525
- if (!this.inProgress) {
526
- _classPrivateFieldSet(_isFocusSelectionChanged, this, true);
527
- this.runLocalHooks('afterSetFocus', cellRange.highlight);
528
- }
454
+ isMultiple() {
455
+ const isMultipleListener = createObjectPropListener(!this.selectedRange.current().isSingle());
456
+ this.runLocalHooks('afterIsMultipleSelection', isMultipleListener);
457
+ return isMultipleListener.value;
529
458
  }
530
459
 
531
460
  /**
@@ -538,13 +467,7 @@ class Selection {
538
467
  */
539
468
  transformStart(rowDelta, colDelta) {
540
469
  let createMissingRecords = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
541
- if (this.settings.navigableHeaders) {
542
- _classPrivateFieldGet(_transformation, this).setOffsetSize({
543
- x: this.tableProps.countRowHeaders(),
544
- y: this.tableProps.countColHeaders()
545
- });
546
- }
547
- this.setRangeStart(_classPrivateFieldGet(_transformation, this).transformStart(rowDelta, colDelta, createMissingRecords));
470
+ this.setRangeStart(this.transformation.transformStart(rowDelta, colDelta, createMissingRecords));
548
471
  }
549
472
 
550
473
  /**
@@ -554,44 +477,7 @@ class Selection {
554
477
  * @param {number} colDelta Columns number to move, value can be passed as negative number.
555
478
  */
556
479
  transformEnd(rowDelta, colDelta) {
557
- if (this.settings.navigableHeaders) {
558
- _classPrivateFieldGet(_transformation, this).setOffsetSize({
559
- x: this.tableProps.countRowHeaders(),
560
- y: this.tableProps.countColHeaders()
561
- });
562
- }
563
- this.setRangeEnd(_classPrivateFieldGet(_transformation, this).transformEnd(rowDelta, colDelta));
564
- }
565
-
566
- /**
567
- * Transforms the focus cell selection relative to the current focus position.
568
- *
569
- * @param {number} rowDelta Rows number to move, value can be passed as negative number.
570
- * @param {number} colDelta Columns number to move, value can be passed as negative number.
571
- */
572
- transformFocus(rowDelta, colDelta) {
573
- const range = this.selectedRange.current();
574
- const {
575
- row,
576
- col
577
- } = range.getOuterTopStartCorner();
578
- const columnsInRange = this.tableProps.countRenderableColumnsInRange(0, col - 1);
579
- const rowsInRange = this.tableProps.countRenderableRowsInRange(0, row - 1);
580
- if (range.highlight.isHeader()) {
581
- // for header focus selection calculate the new coords based on the selection including headers
582
- _classPrivateFieldGet(_focusTransformation, this).setOffsetSize({
583
- x: col < 0 ? Math.abs(col) : -columnsInRange,
584
- y: row < 0 ? Math.abs(row) : -rowsInRange
585
- });
586
- } else {
587
- // for focus selection in cells calculate the new coords only based on the selected cells
588
- _classPrivateFieldGet(_focusTransformation, this).setOffsetSize({
589
- x: col < 0 ? 0 : -columnsInRange,
590
- y: row < 0 ? 0 : -rowsInRange
591
- });
592
- }
593
- const focusCoords = _classPrivateFieldGet(_focusTransformation, this).transformStart(rowDelta, colDelta);
594
- this.setRangeFocus(focusCoords.normalize());
480
+ this.setRangeEnd(this.transformation.transformEnd(rowDelta, colDelta));
595
481
  }
596
482
 
597
483
  /**
@@ -612,30 +498,6 @@ class Selection {
612
498
  return !this.selectedRange.isEmpty();
613
499
  }
614
500
 
615
- /**
616
- * Returns information if we have a multi-selection. This method check multi-selection only on the latest layer of
617
- * the selection.
618
- *
619
- * @returns {boolean}
620
- */
621
- isMultiple() {
622
- if (!this.isSelected()) {
623
- return false;
624
- }
625
- const isMultipleListener = createObjectPropListener(!this.selectedRange.current().isSingle());
626
- this.runLocalHooks('afterIsMultipleSelection', isMultipleListener);
627
- return isMultipleListener.value;
628
- }
629
-
630
- /**
631
- * Checks if the last selection involves changing the focus cell position only.
632
- *
633
- * @returns {boolean}
634
- */
635
- isFocusSelectionChanged() {
636
- return this.isSelected() && _classPrivateFieldGet(_isFocusSelectionChanged, this);
637
- }
638
-
639
501
  /**
640
502
  * Returns `true` if the selection was applied by clicking to the row header. If the `layerLevel`
641
503
  * argument is passed then only that layer will be checked. Otherwise, it checks if any row header
@@ -834,7 +696,7 @@ class Selection {
834
696
  focusPosition,
835
697
  disableHeadersHighlight
836
698
  } = options;
837
- _classPrivateFieldSet(_disableHeadersHighlight, this, disableHeadersHighlight);
699
+ _classPrivateFieldSet(this, _disableHeadersHighlight, disableHeadersHighlight);
838
700
  if (focusPosition && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.row) && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.col)) {
839
701
  highlight = this.tableProps.createCellCoords(clamp(focusPosition.row, rowFrom, nrOfRows - 1), clamp(focusPosition.col, columnFrom, nrOfColumns - 1));
840
702
  }
@@ -850,7 +712,7 @@ class Selection {
850
712
  }
851
713
  this.setRangeEnd(endCoords);
852
714
  this.finish();
853
- _classPrivateFieldSet(_disableHeadersHighlight, this, false);
715
+ _classPrivateFieldSet(this, _disableHeadersHighlight, false);
854
716
  }
855
717
 
856
718
  /**
@@ -918,10 +780,9 @@ class Selection {
918
780
  *
919
781
  * @param {number|string} startColumn Visual column index or column property from which the selection starts.
920
782
  * @param {number|string} [endColumn] Visual column index or column property from to the selection finishes.
921
- * @param {number | { row: number, col: number }} [focusPosition=0] The argument allows changing the cell/header focus
922
- * position. The value can take visual row index from -N to N, where negative values point to the headers and positive
923
- * values point to the cell range. An object with `row` and `col` properties also can be passed to change the focus
924
- * position horizontally.
783
+ * @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
784
+ * The value can take visual row index from -N to N, where negative values
785
+ * point to the headers and positive values point to the cell range.
925
786
  * @returns {boolean} Returns `true` if selection was successful, `false` otherwise.
926
787
  */
927
788
  selectColumns(startColumn) {
@@ -942,20 +803,11 @@ class Selection {
942
803
  countColHeaders
943
804
  });
944
805
  if (isValid) {
945
- let highlightRow = 0;
946
- let highlightColumn = 0;
947
- if (Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.row) && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.col)) {
948
- highlightRow = clamp(focusPosition.row, columnHeaderLastIndex, countRows - 1);
949
- highlightColumn = clamp(focusPosition.col, Math.min(start, end), Math.max(start, end));
950
- } else {
951
- highlightRow = clamp(focusPosition, columnHeaderLastIndex, countRows - 1);
952
- highlightColumn = start;
953
- }
954
- const highlight = this.tableProps.createCellCoords(highlightRow, highlightColumn);
955
- const fromRow = countColHeaders === 0 ? 0 : clamp(highlight.row, columnHeaderLastIndex, -1);
806
+ const fromRow = countColHeaders === 0 ? 0 : clamp(focusPosition, columnHeaderLastIndex, -1);
956
807
  const toRow = countRows - 1;
957
808
  const from = this.tableProps.createCellCoords(fromRow, start);
958
809
  const to = this.tableProps.createCellCoords(toRow, end);
810
+ const highlight = this.tableProps.createCellCoords(clamp(focusPosition, columnHeaderLastIndex, countRows - 1), start);
959
811
  this.runLocalHooks('beforeSelectColumns', from, to, highlight);
960
812
 
961
813
  // disallow modifying row axis for that hooks
@@ -975,10 +827,9 @@ class Selection {
975
827
  *
976
828
  * @param {number} startRow Visual row index from which the selection starts.
977
829
  * @param {number} [endRow] Visual row index from to the selection finishes.
978
- * @param {number | { row: number, col: number }} [focusPosition=0] The argument allows changing the cell/header focus
979
- * position. The value can take visual row index from -N to N, where negative values point to the headers and positive
980
- * values point to the cell range. An object with `row` and `col` properties also can be passed to change the focus
981
- * position horizontally.
830
+ * @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
831
+ * The value can take visual column index from -N to N, where negative values
832
+ * point to the headers and positive values point to the cell range.
982
833
  * @returns {boolean} Returns `true` if selection was successful, `false` otherwise.
983
834
  */
984
835
  selectRows(startRow) {
@@ -997,20 +848,11 @@ class Selection {
997
848
  countColHeaders: 0
998
849
  });
999
850
  if (isValid) {
1000
- let highlightRow = 0;
1001
- let highlightColumn = 0;
1002
- if (Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.row) && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.col)) {
1003
- highlightRow = clamp(focusPosition.row, Math.min(startRow, endRow), Math.max(startRow, endRow));
1004
- highlightColumn = clamp(focusPosition.col, rowHeaderLastIndex, countCols - 1);
1005
- } else {
1006
- highlightRow = startRow;
1007
- highlightColumn = clamp(focusPosition, rowHeaderLastIndex, countCols - 1);
1008
- }
1009
- const highlight = this.tableProps.createCellCoords(highlightRow, highlightColumn);
1010
- const fromColumn = countRowHeaders === 0 ? 0 : clamp(highlight.col, rowHeaderLastIndex, -1);
851
+ const fromColumn = countRowHeaders === 0 ? 0 : clamp(focusPosition, rowHeaderLastIndex, -1);
1011
852
  const toColumn = countCols - 1;
1012
853
  const from = this.tableProps.createCellCoords(startRow, fromColumn);
1013
854
  const to = this.tableProps.createCellCoords(endRow, toColumn);
855
+ const highlight = this.tableProps.createCellCoords(startRow, clamp(focusPosition, rowHeaderLastIndex, countCols - 1));
1014
856
  this.runLocalHooks('beforeSelectRows', from, to, highlight);
1015
857
 
1016
858
  // disallow modifying column axis for that hooks