handsontable 0.0.0-next-e5dbebc-20240319 → 0.0.0-next-a7270c3-20240320

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 (98) hide show
  1. package/3rdparty/walkontable/src/cell/range.d.ts +1 -2
  2. package/3rdparty/walkontable/src/cell/range.js +5 -22
  3. package/3rdparty/walkontable/src/cell/range.mjs +5 -22
  4. package/base.js +2 -2
  5. package/base.mjs +2 -2
  6. package/core/viewportScroll/index.js +1 -4
  7. package/core/viewportScroll/index.mjs +1 -4
  8. package/core.d.ts +3 -4
  9. package/core.js +21 -76
  10. package/core.mjs +21 -76
  11. package/dist/handsontable.css +2 -2
  12. package/dist/handsontable.full.css +2 -2
  13. package/dist/handsontable.full.js +1357 -2619
  14. package/dist/handsontable.full.min.css +2 -2
  15. package/dist/handsontable.full.min.js +71 -71
  16. package/dist/handsontable.js +1361 -2623
  17. package/dist/handsontable.min.css +2 -2
  18. package/dist/handsontable.min.js +19 -19
  19. package/editorManager.js +8 -12
  20. package/editorManager.mjs +8 -12
  21. package/focusManager.js +1 -7
  22. package/focusManager.mjs +1 -7
  23. package/helpers/mixed.js +1 -1
  24. package/helpers/mixed.mjs +1 -1
  25. package/package.json +1 -1
  26. package/pluginHooks.d.ts +0 -4
  27. package/pluginHooks.js +1 -69
  28. package/pluginHooks.mjs +1 -69
  29. package/plugins/collapsibleColumns/collapsibleColumns.js +3 -9
  30. package/plugins/collapsibleColumns/collapsibleColumns.mjs +3 -9
  31. package/plugins/columnSorting/columnSorting.js +2 -8
  32. package/plugins/columnSorting/columnSorting.mjs +2 -8
  33. package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
  34. package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
  35. package/plugins/mergeCells/calculations/selection.js +70 -1
  36. package/plugins/mergeCells/calculations/selection.mjs +70 -1
  37. package/plugins/mergeCells/cellsCollection.js +0 -116
  38. package/plugins/mergeCells/cellsCollection.mjs +0 -116
  39. package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
  40. package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
  41. package/plugins/mergeCells/mergeCells.js +196 -337
  42. package/plugins/mergeCells/mergeCells.mjs +196 -337
  43. package/plugins/multiColumnSorting/multiColumnSorting.js +2 -8
  44. package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -8
  45. package/plugins/nestedHeaders/nestedHeaders.js +0 -1
  46. package/plugins/nestedHeaders/nestedHeaders.mjs +0 -1
  47. package/plugins/nestedRows/nestedRows.js +3 -9
  48. package/plugins/nestedRows/nestedRows.mjs +3 -9
  49. package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
  50. package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
  51. package/selection/highlight/visualSelection.js +0 -2
  52. package/selection/highlight/visualSelection.mjs +0 -2
  53. package/selection/selection.js +40 -209
  54. package/selection/selection.mjs +39 -208
  55. package/selection/transformation.js +32 -83
  56. package/selection/transformation.mjs +32 -83
  57. package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
  58. package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
  59. package/shortcutContexts/commands/editor/open.js +3 -18
  60. package/shortcutContexts/commands/editor/open.mjs +3 -18
  61. package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
  62. package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
  63. package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
  64. package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
  65. package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
  66. package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
  67. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
  68. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
  69. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
  70. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
  71. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
  72. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
  73. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
  74. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
  75. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
  76. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
  77. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
  78. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
  79. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
  80. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
  81. package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
  82. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
  83. package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
  84. package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
  85. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
  86. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
  87. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
  88. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
  89. package/shortcutContexts/grid.js +2 -2
  90. package/shortcutContexts/grid.mjs +2 -2
  91. package/shortcuts/context.js +1 -2
  92. package/shortcuts/context.mjs +1 -2
  93. package/utils/dataStructures/linkedList.js +1 -6
  94. package/utils/dataStructures/linkedList.mjs +1 -6
  95. package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
  96. package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
  97. package/plugins/mergeCells/focusOrder.js +0 -303
  98. package/plugins/mergeCells/focusOrder.mjs +0 -298
@@ -1,298 +0,0 @@
1
- import "core-js/modules/es.error.cause.js";
2
- import "core-js/modules/es.array.push.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 _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
7
- function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
8
- 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"); }
9
- import LinkedList from "../../utils/dataStructures/linkedList.mjs";
10
- /**
11
- * Class responsible for providing the correct focus order (vertical and horizontal) within a selection that
12
- * contains merged cells.
13
- */
14
- var _cellsHorizontalOrder = /*#__PURE__*/new WeakMap();
15
- var _cellsVerticalOrder = /*#__PURE__*/new WeakMap();
16
- var _currentHorizontalLinkedNode = /*#__PURE__*/new WeakMap();
17
- var _currentVerticalLinkedNode = /*#__PURE__*/new WeakMap();
18
- var _mergedCellsGetter = /*#__PURE__*/new WeakMap();
19
- var _rowIndexMapper = /*#__PURE__*/new WeakMap();
20
- var _columnIndexMapper = /*#__PURE__*/new WeakMap();
21
- var _FocusOrder_brand = /*#__PURE__*/new WeakSet();
22
- export class FocusOrder {
23
- constructor(_ref) {
24
- let {
25
- mergedCellsGetter,
26
- rowIndexMapper,
27
- columnIndexMapper
28
- } = _ref;
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, _FocusOrder_brand);
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, new LinkedList());
47
- /**
48
- * The linked list of the all cells within the current selection in horizontal order. The list is
49
- * recreated every time the selection is changed.
50
- *
51
- * @type {LinkedList}
52
- */
53
- _classPrivateFieldInitSpec(this, _cellsVerticalOrder, new LinkedList());
54
- /**
55
- * The currently highlighted cell within the horizontal linked list.
56
- *
57
- * @type {NodeStructure | null}
58
- */
59
- _classPrivateFieldInitSpec(this, _currentHorizontalLinkedNode, null);
60
- /**
61
- * The currently highlighted cell within the vertical linked list.
62
- *
63
- * @type {NodeStructure | null}
64
- */
65
- _classPrivateFieldInitSpec(this, _currentVerticalLinkedNode, null);
66
- /**
67
- * The merged cells getter function.
68
- *
69
- * @type {function(): {row: number, col: number, rowspan: number, colspan: number} | null}}
70
- */
71
- _classPrivateFieldInitSpec(this, _mergedCellsGetter, null);
72
- /**
73
- * The row index mapper.
74
- *
75
- * @type {IndexMapper}
76
- */
77
- _classPrivateFieldInitSpec(this, _rowIndexMapper, null);
78
- /**
79
- * The column index mapper.
80
- *
81
- * @type {IndexMapper}
82
- */
83
- _classPrivateFieldInitSpec(this, _columnIndexMapper, null);
84
- _classPrivateFieldSet(_mergedCellsGetter, this, mergedCellsGetter);
85
- _classPrivateFieldSet(_rowIndexMapper, this, rowIndexMapper);
86
- _classPrivateFieldSet(_columnIndexMapper, this, columnIndexMapper);
87
- }
88
-
89
- /**
90
- * Gets the currently selected node data from the vertical focus order list.
91
- *
92
- * @returns {NodeStructure}
93
- */
94
- getCurrentVerticalNode() {
95
- return _classPrivateFieldGet(_currentVerticalLinkedNode, this).data;
96
- }
97
-
98
- /**
99
- * Gets the first node data from the vertical focus order list.
100
- *
101
- * @returns {NodeStructure}
102
- */
103
- getFirstVerticalNode() {
104
- return _classPrivateFieldGet(_cellsVerticalOrder, this).first.data;
105
- }
106
-
107
- /**
108
- * Gets the next selected node data from the vertical focus order list.
109
- *
110
- * @returns {NodeStructure}
111
- */
112
- getNextVerticalNode() {
113
- return _classPrivateFieldGet(_currentVerticalLinkedNode, this).next.data;
114
- }
115
-
116
- /**
117
- * Gets the previous selected node data from the vertical focus order list.
118
- *
119
- * @returns {NodeStructure}
120
- */
121
- getPrevVerticalNode() {
122
- return _classPrivateFieldGet(_currentVerticalLinkedNode, this).prev.data;
123
- }
124
-
125
- /**
126
- * Gets the currently selected node data from the horizontal focus order list.
127
- *
128
- * @returns {NodeStructure}
129
- */
130
- getCurrentHorizontalNode() {
131
- return _classPrivateFieldGet(_currentHorizontalLinkedNode, this).data;
132
- }
133
-
134
- /**
135
- * Gets the first node data from the horizontal focus order list.
136
- *
137
- * @returns {NodeStructure}
138
- */
139
- getFirstHorizontalNode() {
140
- return _classPrivateFieldGet(_cellsHorizontalOrder, this).first.data;
141
- }
142
-
143
- /**
144
- * Gets the next selected node data from the horizontal focus order list.
145
- *
146
- * @returns {NodeStructure}
147
- */
148
- getNextHorizontalNode() {
149
- return _classPrivateFieldGet(_currentHorizontalLinkedNode, this).next.data;
150
- }
151
-
152
- /**
153
- * Gets the previous selected node data from the horizontal focus order list.
154
- *
155
- * @returns {NodeStructure}
156
- */
157
- getPrevHorizontalNode() {
158
- return _classPrivateFieldGet(_currentHorizontalLinkedNode, this).prev.data;
159
- }
160
-
161
- /**
162
- * Sets the previous node from the vertical focus order list as active.
163
- */
164
- setPrevNodeAsActive() {
165
- _classPrivateFieldSet(_currentVerticalLinkedNode, this, _classPrivateFieldGet(_currentVerticalLinkedNode, this).prev);
166
- _classPrivateFieldSet(_currentHorizontalLinkedNode, this, _classPrivateFieldGet(_currentHorizontalLinkedNode, this).prev);
167
- }
168
-
169
- /**
170
- * Sets the previous node from the horizontal focus order list as active.
171
- */
172
- setNextNodeAsActive() {
173
- _classPrivateFieldSet(_currentVerticalLinkedNode, this, _classPrivateFieldGet(_currentVerticalLinkedNode, this).next);
174
- _classPrivateFieldSet(_currentHorizontalLinkedNode, this, _classPrivateFieldGet(_currentHorizontalLinkedNode, this).next);
175
- }
176
-
177
- /**
178
- * Rebuilds the focus order list based on the provided selection.
179
- *
180
- * @param {CellRange} selectedRange The selected range to build the focus order for.
181
- */
182
- buildFocusOrder(selectedRange) {
183
- const topStart = selectedRange.getTopStartCorner();
184
- const bottomEnd = selectedRange.getBottomEndCorner();
185
- const visitedHorizontalCells = new WeakSet();
186
- _classPrivateFieldSet(_cellsHorizontalOrder, this, new LinkedList());
187
- for (let r = topStart.row; r <= bottomEnd.row; r++) {
188
- if (_classPrivateFieldGet(_rowIndexMapper, this).isHidden(r)) {
189
- // eslint-disable-next-line no-continue
190
- continue;
191
- }
192
- for (let c = topStart.col; c <= bottomEnd.col; c++) {
193
- if (_classPrivateFieldGet(_columnIndexMapper, this).isHidden(c)) {
194
- // eslint-disable-next-line no-continue
195
- continue;
196
- }
197
- const node = _assertClassBrand(_FocusOrder_brand, this, _pushOrderNode).call(this, selectedRange, _classPrivateFieldGet(_cellsHorizontalOrder, this), visitedHorizontalCells, r, c);
198
- if (node) {
199
- _classPrivateFieldSet(_currentHorizontalLinkedNode, this, node);
200
- }
201
- }
202
- }
203
-
204
- // create circular linked list
205
- if (_classPrivateFieldGet(_cellsHorizontalOrder, this).first) {
206
- _classPrivateFieldGet(_cellsHorizontalOrder, this).first.prev = _classPrivateFieldGet(_cellsHorizontalOrder, this).last;
207
- _classPrivateFieldGet(_cellsHorizontalOrder, this).last.next = _classPrivateFieldGet(_cellsHorizontalOrder, this).first;
208
- }
209
- const visitedVerticalCells = new WeakSet();
210
- _classPrivateFieldSet(_cellsVerticalOrder, this, new LinkedList());
211
- for (let c = topStart.col; c <= bottomEnd.col; c++) {
212
- if (_classPrivateFieldGet(_columnIndexMapper, this).isHidden(c)) {
213
- // eslint-disable-next-line no-continue
214
- continue;
215
- }
216
- for (let r = topStart.row; r <= bottomEnd.row; r++) {
217
- if (_classPrivateFieldGet(_rowIndexMapper, this).isHidden(r)) {
218
- // eslint-disable-next-line no-continue
219
- continue;
220
- }
221
- const node = _assertClassBrand(_FocusOrder_brand, this, _pushOrderNode).call(this, selectedRange, _classPrivateFieldGet(_cellsVerticalOrder, this), visitedVerticalCells, r, c);
222
- if (node) {
223
- _classPrivateFieldSet(_currentVerticalLinkedNode, this, node);
224
- }
225
- }
226
- }
227
-
228
- // create circular linked list
229
- if (_classPrivateFieldGet(_cellsVerticalOrder, this).first) {
230
- _classPrivateFieldGet(_cellsVerticalOrder, this).first.prev = _classPrivateFieldGet(_cellsVerticalOrder, this).last;
231
- _classPrivateFieldGet(_cellsVerticalOrder, this).last.next = _classPrivateFieldGet(_cellsVerticalOrder, this).first;
232
- }
233
- }
234
- /**
235
- * Sets the active node based on the provided row and column.
236
- *
237
- * @param {number} row The visual row index.
238
- * @param {number} column The visual column index.
239
- * @returns {FocusOrder}
240
- */
241
- setActiveNode(row, column) {
242
- _classPrivateFieldGet(_cellsHorizontalOrder, this).inorder(node => {
243
- const {
244
- rowStart,
245
- rowEnd,
246
- colStart,
247
- colEnd
248
- } = node.data;
249
- if (row >= rowStart && row <= rowEnd && column >= colStart && column <= colEnd) {
250
- _classPrivateFieldSet(_currentHorizontalLinkedNode, this, node);
251
- return false;
252
- }
253
- });
254
- _classPrivateFieldGet(_cellsVerticalOrder, this).inorder(node => {
255
- const {
256
- rowStart,
257
- rowEnd,
258
- colStart,
259
- colEnd
260
- } = node.data;
261
- if (row >= rowStart && row <= rowEnd && column >= colStart && column <= colEnd) {
262
- _classPrivateFieldSet(_currentVerticalLinkedNode, this, node);
263
- return false;
264
- }
265
- });
266
- return this;
267
- }
268
- }
269
- function _pushOrderNode(selectedRange, listOrder, mergeCellsVisitor, row, column) {
270
- const topStart = selectedRange.getTopStartCorner();
271
- const bottomEnd = selectedRange.getBottomEndCorner();
272
- const highlight = selectedRange.highlight.clone().normalize();
273
- const mergeParent = _classPrivateFieldGet(_mergedCellsGetter, this).call(this, row, column);
274
- if (mergeParent && mergeCellsVisitor.has(mergeParent)) {
275
- return null;
276
- }
277
- const node = {
278
- colStart: column,
279
- colEnd: column,
280
- rowStart: row,
281
- rowEnd: row
282
- };
283
- if (mergeParent) {
284
- mergeCellsVisitor.add(mergeParent);
285
- if (mergeParent.row < topStart.row || mergeParent.row + mergeParent.rowspan - 1 > bottomEnd.row || mergeParent.col < topStart.col || mergeParent.col + mergeParent.colspan - 1 > bottomEnd.col) {
286
- return null;
287
- }
288
- node.colStart = mergeParent.col;
289
- node.colEnd = mergeParent.col + mergeParent.colspan - 1;
290
- node.rowStart = mergeParent.row;
291
- node.rowEnd = mergeParent.row + mergeParent.rowspan - 1;
292
- }
293
- const linkedNode = listOrder.push(node);
294
- 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) {
295
- return linkedNode;
296
- }
297
- return null;
298
- }