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
@@ -1,258 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- require("core-js/modules/es.error.cause.js");
5
- require("core-js/modules/es.array.push.js");
6
- var _linkedList = _interopRequireDefault(require("../../utils/dataStructures/linkedList"));
7
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
- function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
9
- function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
10
- function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
11
- function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
12
- function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
13
- function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
14
- function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
15
- function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
16
- 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; } }
17
- /**
18
- * Class responsible for providing the correct focus order (vertical and horizontal) within a selection that
19
- * contains merged cells.
20
- */
21
- var _cellsHorizontalOrder = /*#__PURE__*/new WeakMap();
22
- var _cellsVerticalOrder = /*#__PURE__*/new WeakMap();
23
- var _currentHorizontalLinkedNode = /*#__PURE__*/new WeakMap();
24
- var _currentVerticalLinkedNode = /*#__PURE__*/new WeakMap();
25
- var _mergedCellsGetter = /*#__PURE__*/new WeakMap();
26
- var _pushOrderNode = /*#__PURE__*/new WeakSet();
27
- class FocusOrder {
28
- constructor(mergedCellsGetter) {
29
- /**
30
- * Pushes a new node to the provided list order.
31
- *
32
- * @param {CellRange} selectedRange The selected range to build the focus order for.
33
- * @param {LinkedList} listOrder The list order to push the node to.
34
- * @param {WeakSet} mergeCellsVisitor The set of visited cells.
35
- * @param {number} row The visual row index.
36
- * @param {number} column The visual column index.
37
- * @returns {NodeStructure | null}
38
- */
39
- _classPrivateMethodInitSpec(this, _pushOrderNode);
40
- /**
41
- * The linked list of the all cells within the current selection in horizontal order. The list is
42
- * recreated every time the selection is changed.
43
- *
44
- * @type {LinkedList}
45
- */
46
- _classPrivateFieldInitSpec(this, _cellsHorizontalOrder, {
47
- writable: true,
48
- value: new _linkedList.default()
49
- });
50
- /**
51
- * The linked list of the all cells within the current selection in horizontal order. The list is
52
- * recreated every time the selection is changed.
53
- *
54
- * @type {LinkedList}
55
- */
56
- _classPrivateFieldInitSpec(this, _cellsVerticalOrder, {
57
- writable: true,
58
- value: new _linkedList.default()
59
- });
60
- /**
61
- * The currently highlighted cell within the horizontal linked list.
62
- *
63
- * @type {NodeStructure | null}
64
- */
65
- _classPrivateFieldInitSpec(this, _currentHorizontalLinkedNode, {
66
- writable: true,
67
- value: null
68
- });
69
- /**
70
- * The currently highlighted cell within the vertical linked list.
71
- *
72
- * @type {NodeStructure | null}
73
- */
74
- _classPrivateFieldInitSpec(this, _currentVerticalLinkedNode, {
75
- writable: true,
76
- value: null
77
- });
78
- /**
79
- * The merged cells getter function.
80
- *
81
- * @type {function(): {row: number, col: number, rowspan: number, colspan: number} | null}}
82
- */
83
- _classPrivateFieldInitSpec(this, _mergedCellsGetter, {
84
- writable: true,
85
- value: null
86
- });
87
- _classPrivateFieldSet(this, _mergedCellsGetter, mergedCellsGetter);
88
- }
89
-
90
- /**
91
- * Gets the currently selected node data from the vertical focus order list.
92
- *
93
- * @returns {NodeStructure}
94
- */
95
- getCurrentVerticalNode() {
96
- return _classPrivateFieldGet(this, _currentVerticalLinkedNode).data;
97
- }
98
-
99
- /**
100
- * Gets the next selected node data from the vertical focus order list.
101
- *
102
- * @returns {NodeStructure}
103
- */
104
- getNextVerticalNode() {
105
- return _classPrivateFieldGet(this, _currentVerticalLinkedNode).next.data;
106
- }
107
-
108
- /**
109
- * Gets the previous selected node data from the vertical focus order list.
110
- *
111
- * @returns {NodeStructure}
112
- */
113
- getPrevVerticalNode() {
114
- return _classPrivateFieldGet(this, _currentVerticalLinkedNode).prev.data;
115
- }
116
-
117
- /**
118
- * Gets the currently selected node data from the horizontal focus order list.
119
- *
120
- * @returns {NodeStructure}
121
- */
122
- getCurrentHorizontalNode() {
123
- return _classPrivateFieldGet(this, _currentHorizontalLinkedNode).data;
124
- }
125
-
126
- /**
127
- * Gets the next selected node data from the horizontal focus order list.
128
- *
129
- * @returns {NodeStructure}
130
- */
131
- getNextHorizontalNode() {
132
- return _classPrivateFieldGet(this, _currentHorizontalLinkedNode).next.data;
133
- }
134
-
135
- /**
136
- * Gets the previous selected node data from the horizontal focus order list.
137
- *
138
- * @returns {NodeStructure}
139
- */
140
- getPrevHorizontalNode() {
141
- return _classPrivateFieldGet(this, _currentHorizontalLinkedNode).prev.data;
142
- }
143
-
144
- /**
145
- * Rebuilds the focus order list based on the provided selection.
146
- *
147
- * @param {CellRange} selectedRange The selected range to build the focus order for.
148
- */
149
- buildFocusOrder(selectedRange) {
150
- const topStart = selectedRange.getTopStartCorner();
151
- const bottomEnd = selectedRange.getBottomEndCorner();
152
- const visitedHorizontalCells = new WeakSet();
153
- _classPrivateFieldSet(this, _cellsHorizontalOrder, new _linkedList.default());
154
- for (let r = topStart.row; r <= bottomEnd.row; r++) {
155
- for (let c = topStart.col; c <= bottomEnd.col; c++) {
156
- const mergeParent = _classPrivateFieldGet(this, _mergedCellsGetter).call(this, r, c);
157
- const node = _classPrivateMethodGet(this, _pushOrderNode, _pushOrderNode2).call(this, selectedRange, _classPrivateFieldGet(this, _cellsHorizontalOrder), visitedHorizontalCells, r, c);
158
- if (node) {
159
- _classPrivateFieldSet(this, _currentHorizontalLinkedNode, node);
160
- }
161
- if (mergeParent) {
162
- c += mergeParent.colspan - 1;
163
- if (mergeParent.col < topStart.col) {
164
- c += mergeParent.col - topStart.col;
165
- }
166
- }
167
- }
168
- }
169
-
170
- // create circular linked list
171
- _classPrivateFieldGet(this, _cellsHorizontalOrder).first.prev = _classPrivateFieldGet(this, _cellsHorizontalOrder).last;
172
- _classPrivateFieldGet(this, _cellsHorizontalOrder).last.next = _classPrivateFieldGet(this, _cellsHorizontalOrder).first;
173
- const visitedVerticalCells = new WeakSet();
174
- _classPrivateFieldSet(this, _cellsVerticalOrder, new _linkedList.default());
175
- for (let c = topStart.col; c <= bottomEnd.col; c++) {
176
- for (let r = topStart.row; r <= bottomEnd.row; r++) {
177
- const mergeParent = _classPrivateFieldGet(this, _mergedCellsGetter).call(this, r, c);
178
- const node = _classPrivateMethodGet(this, _pushOrderNode, _pushOrderNode2).call(this, selectedRange, _classPrivateFieldGet(this, _cellsVerticalOrder), visitedVerticalCells, r, c);
179
- if (node) {
180
- _classPrivateFieldSet(this, _currentVerticalLinkedNode, node);
181
- }
182
- if (mergeParent) {
183
- r += mergeParent.rowspan - 1;
184
- if (mergeParent.row < topStart.row) {
185
- r += mergeParent.row - topStart.row;
186
- }
187
- }
188
- }
189
- }
190
-
191
- // create circular linked list
192
- _classPrivateFieldGet(this, _cellsVerticalOrder).first.prev = _classPrivateFieldGet(this, _cellsVerticalOrder).last;
193
- _classPrivateFieldGet(this, _cellsVerticalOrder).last.next = _classPrivateFieldGet(this, _cellsVerticalOrder).first;
194
- }
195
- /**
196
- * Sets the active node based on the provided row and column.
197
- *
198
- * @param {number} row The visual row index.
199
- * @param {number} column The visual column index.
200
- */
201
- setActiveNode(row, column) {
202
- _classPrivateFieldGet(this, _cellsHorizontalOrder).inorder(node => {
203
- const {
204
- rowStart,
205
- rowEnd,
206
- colStart,
207
- colEnd
208
- } = node.data;
209
- if (row >= rowStart && row <= rowEnd && column >= colStart && column <= colEnd) {
210
- _classPrivateFieldSet(this, _currentHorizontalLinkedNode, node);
211
- return false;
212
- }
213
- });
214
- _classPrivateFieldGet(this, _cellsVerticalOrder).inorder(node => {
215
- const {
216
- rowStart,
217
- rowEnd,
218
- colStart,
219
- colEnd
220
- } = node.data;
221
- if (row >= rowStart && row <= rowEnd && column >= colStart && column <= colEnd) {
222
- _classPrivateFieldSet(this, _currentVerticalLinkedNode, node);
223
- return false;
224
- }
225
- });
226
- }
227
- }
228
- exports.FocusOrder = FocusOrder;
229
- function _pushOrderNode2(selectedRange, listOrder, mergeCellsVisitor, row, column) {
230
- const topStart = selectedRange.getTopStartCorner();
231
- const bottomEnd = selectedRange.getBottomEndCorner();
232
- const highlight = selectedRange.highlight.clone().normalize();
233
- const mergeParent = _classPrivateFieldGet(this, _mergedCellsGetter).call(this, row, column);
234
- if (mergeParent && mergeCellsVisitor.has(mergeParent)) {
235
- return null;
236
- }
237
- const node = {
238
- colStart: column,
239
- colEnd: column,
240
- rowStart: row,
241
- rowEnd: row
242
- };
243
- if (mergeParent) {
244
- mergeCellsVisitor.add(mergeParent);
245
- if (mergeParent.row < topStart.row || mergeParent.row + mergeParent.rowspan - 1 > bottomEnd.row || mergeParent.col < topStart.col || mergeParent.col + mergeParent.colspan - 1 > bottomEnd.col) {
246
- return null;
247
- }
248
- node.colStart = mergeParent.col;
249
- node.colEnd = mergeParent.col + mergeParent.colspan - 1;
250
- node.rowStart = mergeParent.row;
251
- node.rowEnd = mergeParent.row + mergeParent.rowspan - 1;
252
- }
253
- const linkedNode = listOrder.push(node);
254
- if (row === highlight.row && column === highlight.col || mergeParent && highlight.row >= mergeParent.row && highlight.row <= mergeParent.row + mergeParent.rowspan - 1 && highlight.col >= mergeParent.col && highlight.col <= mergeParent.col + mergeParent.colspan - 1) {
255
- return linkedNode;
256
- }
257
- return null;
258
- }
@@ -1,253 +0,0 @@
1
- import "core-js/modules/es.array.push.js";
2
- import "core-js/modules/es.error.cause.js";
3
- function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
4
- function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
5
- function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
6
- function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
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; } }
12
- import LinkedList from "../../utils/dataStructures/linkedList.mjs";
13
- /**
14
- * Class responsible for providing the correct focus order (vertical and horizontal) within a selection that
15
- * contains merged cells.
16
- */
17
- var _cellsHorizontalOrder = /*#__PURE__*/new WeakMap();
18
- var _cellsVerticalOrder = /*#__PURE__*/new WeakMap();
19
- var _currentHorizontalLinkedNode = /*#__PURE__*/new WeakMap();
20
- var _currentVerticalLinkedNode = /*#__PURE__*/new WeakMap();
21
- var _mergedCellsGetter = /*#__PURE__*/new WeakMap();
22
- var _pushOrderNode = /*#__PURE__*/new WeakSet();
23
- export class FocusOrder {
24
- constructor(mergedCellsGetter) {
25
- /**
26
- * Pushes a new node to the provided list order.
27
- *
28
- * @param {CellRange} selectedRange The selected range to build the focus order for.
29
- * @param {LinkedList} listOrder The list order to push the node to.
30
- * @param {WeakSet} mergeCellsVisitor The set of visited cells.
31
- * @param {number} row The visual row index.
32
- * @param {number} column The visual column index.
33
- * @returns {NodeStructure | null}
34
- */
35
- _classPrivateMethodInitSpec(this, _pushOrderNode);
36
- /**
37
- * The linked list of the all cells within the current selection in horizontal order. The list is
38
- * recreated every time the selection is changed.
39
- *
40
- * @type {LinkedList}
41
- */
42
- _classPrivateFieldInitSpec(this, _cellsHorizontalOrder, {
43
- writable: true,
44
- value: new LinkedList()
45
- });
46
- /**
47
- * The linked list of the all cells within the current selection in horizontal order. The list is
48
- * recreated every time the selection is changed.
49
- *
50
- * @type {LinkedList}
51
- */
52
- _classPrivateFieldInitSpec(this, _cellsVerticalOrder, {
53
- writable: true,
54
- value: new LinkedList()
55
- });
56
- /**
57
- * The currently highlighted cell within the horizontal linked list.
58
- *
59
- * @type {NodeStructure | null}
60
- */
61
- _classPrivateFieldInitSpec(this, _currentHorizontalLinkedNode, {
62
- writable: true,
63
- value: null
64
- });
65
- /**
66
- * The currently highlighted cell within the vertical linked list.
67
- *
68
- * @type {NodeStructure | null}
69
- */
70
- _classPrivateFieldInitSpec(this, _currentVerticalLinkedNode, {
71
- writable: true,
72
- value: null
73
- });
74
- /**
75
- * The merged cells getter function.
76
- *
77
- * @type {function(): {row: number, col: number, rowspan: number, colspan: number} | null}}
78
- */
79
- _classPrivateFieldInitSpec(this, _mergedCellsGetter, {
80
- writable: true,
81
- value: null
82
- });
83
- _classPrivateFieldSet(this, _mergedCellsGetter, mergedCellsGetter);
84
- }
85
-
86
- /**
87
- * Gets the currently selected node data from the vertical focus order list.
88
- *
89
- * @returns {NodeStructure}
90
- */
91
- getCurrentVerticalNode() {
92
- return _classPrivateFieldGet(this, _currentVerticalLinkedNode).data;
93
- }
94
-
95
- /**
96
- * Gets the next selected node data from the vertical focus order list.
97
- *
98
- * @returns {NodeStructure}
99
- */
100
- getNextVerticalNode() {
101
- return _classPrivateFieldGet(this, _currentVerticalLinkedNode).next.data;
102
- }
103
-
104
- /**
105
- * Gets the previous selected node data from the vertical focus order list.
106
- *
107
- * @returns {NodeStructure}
108
- */
109
- getPrevVerticalNode() {
110
- return _classPrivateFieldGet(this, _currentVerticalLinkedNode).prev.data;
111
- }
112
-
113
- /**
114
- * Gets the currently selected node data from the horizontal focus order list.
115
- *
116
- * @returns {NodeStructure}
117
- */
118
- getCurrentHorizontalNode() {
119
- return _classPrivateFieldGet(this, _currentHorizontalLinkedNode).data;
120
- }
121
-
122
- /**
123
- * Gets the next selected node data from the horizontal focus order list.
124
- *
125
- * @returns {NodeStructure}
126
- */
127
- getNextHorizontalNode() {
128
- return _classPrivateFieldGet(this, _currentHorizontalLinkedNode).next.data;
129
- }
130
-
131
- /**
132
- * Gets the previous selected node data from the horizontal focus order list.
133
- *
134
- * @returns {NodeStructure}
135
- */
136
- getPrevHorizontalNode() {
137
- return _classPrivateFieldGet(this, _currentHorizontalLinkedNode).prev.data;
138
- }
139
-
140
- /**
141
- * Rebuilds the focus order list based on the provided selection.
142
- *
143
- * @param {CellRange} selectedRange The selected range to build the focus order for.
144
- */
145
- buildFocusOrder(selectedRange) {
146
- const topStart = selectedRange.getTopStartCorner();
147
- const bottomEnd = selectedRange.getBottomEndCorner();
148
- const visitedHorizontalCells = new WeakSet();
149
- _classPrivateFieldSet(this, _cellsHorizontalOrder, new LinkedList());
150
- for (let r = topStart.row; r <= bottomEnd.row; r++) {
151
- for (let c = topStart.col; c <= bottomEnd.col; c++) {
152
- const mergeParent = _classPrivateFieldGet(this, _mergedCellsGetter).call(this, r, c);
153
- const node = _classPrivateMethodGet(this, _pushOrderNode, _pushOrderNode2).call(this, selectedRange, _classPrivateFieldGet(this, _cellsHorizontalOrder), visitedHorizontalCells, r, c);
154
- if (node) {
155
- _classPrivateFieldSet(this, _currentHorizontalLinkedNode, node);
156
- }
157
- if (mergeParent) {
158
- c += mergeParent.colspan - 1;
159
- if (mergeParent.col < topStart.col) {
160
- c += mergeParent.col - topStart.col;
161
- }
162
- }
163
- }
164
- }
165
-
166
- // create circular linked list
167
- _classPrivateFieldGet(this, _cellsHorizontalOrder).first.prev = _classPrivateFieldGet(this, _cellsHorizontalOrder).last;
168
- _classPrivateFieldGet(this, _cellsHorizontalOrder).last.next = _classPrivateFieldGet(this, _cellsHorizontalOrder).first;
169
- const visitedVerticalCells = new WeakSet();
170
- _classPrivateFieldSet(this, _cellsVerticalOrder, new LinkedList());
171
- for (let c = topStart.col; c <= bottomEnd.col; c++) {
172
- for (let r = topStart.row; r <= bottomEnd.row; r++) {
173
- const mergeParent = _classPrivateFieldGet(this, _mergedCellsGetter).call(this, r, c);
174
- const node = _classPrivateMethodGet(this, _pushOrderNode, _pushOrderNode2).call(this, selectedRange, _classPrivateFieldGet(this, _cellsVerticalOrder), visitedVerticalCells, r, c);
175
- if (node) {
176
- _classPrivateFieldSet(this, _currentVerticalLinkedNode, node);
177
- }
178
- if (mergeParent) {
179
- r += mergeParent.rowspan - 1;
180
- if (mergeParent.row < topStart.row) {
181
- r += mergeParent.row - topStart.row;
182
- }
183
- }
184
- }
185
- }
186
-
187
- // create circular linked list
188
- _classPrivateFieldGet(this, _cellsVerticalOrder).first.prev = _classPrivateFieldGet(this, _cellsVerticalOrder).last;
189
- _classPrivateFieldGet(this, _cellsVerticalOrder).last.next = _classPrivateFieldGet(this, _cellsVerticalOrder).first;
190
- }
191
- /**
192
- * Sets the active node based on the provided row and column.
193
- *
194
- * @param {number} row The visual row index.
195
- * @param {number} column The visual column index.
196
- */
197
- setActiveNode(row, column) {
198
- _classPrivateFieldGet(this, _cellsHorizontalOrder).inorder(node => {
199
- const {
200
- rowStart,
201
- rowEnd,
202
- colStart,
203
- colEnd
204
- } = node.data;
205
- if (row >= rowStart && row <= rowEnd && column >= colStart && column <= colEnd) {
206
- _classPrivateFieldSet(this, _currentHorizontalLinkedNode, node);
207
- return false;
208
- }
209
- });
210
- _classPrivateFieldGet(this, _cellsVerticalOrder).inorder(node => {
211
- const {
212
- rowStart,
213
- rowEnd,
214
- colStart,
215
- colEnd
216
- } = node.data;
217
- if (row >= rowStart && row <= rowEnd && column >= colStart && column <= colEnd) {
218
- _classPrivateFieldSet(this, _currentVerticalLinkedNode, node);
219
- return false;
220
- }
221
- });
222
- }
223
- }
224
- function _pushOrderNode2(selectedRange, listOrder, mergeCellsVisitor, row, column) {
225
- const topStart = selectedRange.getTopStartCorner();
226
- const bottomEnd = selectedRange.getBottomEndCorner();
227
- const highlight = selectedRange.highlight.clone().normalize();
228
- const mergeParent = _classPrivateFieldGet(this, _mergedCellsGetter).call(this, row, column);
229
- if (mergeParent && mergeCellsVisitor.has(mergeParent)) {
230
- return null;
231
- }
232
- const node = {
233
- colStart: column,
234
- colEnd: column,
235
- rowStart: row,
236
- rowEnd: row
237
- };
238
- if (mergeParent) {
239
- mergeCellsVisitor.add(mergeParent);
240
- if (mergeParent.row < topStart.row || mergeParent.row + mergeParent.rowspan - 1 > bottomEnd.row || mergeParent.col < topStart.col || mergeParent.col + mergeParent.colspan - 1 > bottomEnd.col) {
241
- return null;
242
- }
243
- node.colStart = mergeParent.col;
244
- node.colEnd = mergeParent.col + mergeParent.colspan - 1;
245
- node.rowStart = mergeParent.row;
246
- node.rowEnd = mergeParent.row + mergeParent.rowspan - 1;
247
- }
248
- const linkedNode = listOrder.push(node);
249
- if (row === highlight.row && column === highlight.col || mergeParent && highlight.row >= mergeParent.row && highlight.row <= mergeParent.row + mergeParent.rowspan - 1 && highlight.col >= mergeParent.col && highlight.col <= mergeParent.col + mergeParent.colspan - 1) {
250
- return linkedNode;
251
- }
252
- return null;
253
- }