handsontable 15.0.0 → 15.1.0-next-dfdf994-20250206
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdparty/walkontable/src/index.js +2 -0
- package/3rdparty/walkontable/src/index.mjs +2 -1
- package/3rdparty/walkontable/src/overlays.js +2 -39
- package/3rdparty/walkontable/src/overlays.mjs +2 -39
- package/3rdparty/walkontable/src/renderer/_base.js +3 -4
- package/3rdparty/walkontable/src/renderer/_base.mjs +2 -2
- package/3rdparty/walkontable/src/renderer/cells.js +7 -11
- package/3rdparty/walkontable/src/renderer/cells.mjs +6 -9
- package/3rdparty/walkontable/src/renderer/colGroup.js +6 -7
- package/3rdparty/walkontable/src/renderer/colGroup.mjs +5 -5
- package/3rdparty/walkontable/src/renderer/columnHeaders.js +4 -5
- package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +3 -3
- package/3rdparty/walkontable/src/renderer/index.js +18 -19
- package/3rdparty/walkontable/src/renderer/index.mjs +6 -6
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +6 -7
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +5 -5
- package/3rdparty/walkontable/src/renderer/rows.js +23 -11
- package/3rdparty/walkontable/src/renderer/rows.mjs +23 -10
- package/3rdparty/walkontable/src/renderer/table.js +1 -1
- package/3rdparty/walkontable/src/renderer/table.mjs +1 -1
- package/3rdparty/walkontable/src/selection/border/border.js +10 -2
- package/3rdparty/walkontable/src/selection/border/border.mjs +10 -2
- package/3rdparty/walkontable/src/utils/nodesPool.js +21 -6
- package/3rdparty/walkontable/src/utils/nodesPool.mjs +21 -6
- package/3rdparty/walkontable/src/utils/orderView/index.js +4 -5
- package/3rdparty/walkontable/src/utils/orderView/index.mjs +2 -2
- package/3rdparty/walkontable/src/utils/orderView/sharedView.js +3 -4
- package/3rdparty/walkontable/src/utils/orderView/sharedView.mjs +2 -2
- package/3rdparty/walkontable/src/utils/orderView/view.js +60 -76
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +59 -74
- package/3rdparty/walkontable/src/utils/orderView/viewDiffer/index.js +138 -0
- package/3rdparty/walkontable/src/utils/orderView/viewDiffer/index.mjs +135 -0
- package/3rdparty/walkontable/src/utils/orderView/viewDiffer/viewOrder.js +72 -0
- package/3rdparty/walkontable/src/utils/orderView/viewDiffer/viewOrder.mjs +68 -0
- package/3rdparty/walkontable/src/utils/orderView/viewSize.js +1 -1
- package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +1 -1
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.js +4 -5
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.mjs +3 -3
- package/CHANGELOG.md +54 -0
- package/README.md +3 -3
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/cellTypes/dropdownType/dropdownType.js +4 -2
- package/cellTypes/dropdownType/dropdownType.mjs +4 -2
- package/core.js +39 -38
- package/core.mjs +36 -35
- package/dataMap/dataMap.js +8 -0
- package/dataMap/dataMap.mjs +8 -0
- package/dataMap/dataSource.js +4 -0
- package/dataMap/dataSource.mjs +4 -0
- package/dataMap/metaManager/lazyFactoryMap.js +8 -5
- package/dataMap/metaManager/lazyFactoryMap.mjs +8 -5
- package/dataMap/metaManager/metaSchema.js +24 -9
- package/dataMap/metaManager/metaSchema.mjs +24 -9
- package/dist/handsontable.css +6 -2
- package/dist/handsontable.full.css +6 -2
- package/dist/handsontable.full.js +8020 -6915
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +530 -528
- package/dist/handsontable.js +3827 -2902
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +35 -33
- package/editors/autocompleteEditor/autocompleteEditor.js +1 -3
- package/editors/autocompleteEditor/autocompleteEditor.mjs +1 -3
- package/editors/dateEditor/dateEditor.js +4 -0
- package/editors/dateEditor/dateEditor.mjs +4 -0
- package/editors/dropdownEditor/dropdownEditor.js +3 -16
- package/editors/dropdownEditor/dropdownEditor.mjs +3 -16
- package/editors/handsontableEditor/handsontableEditor.js +4 -4
- package/editors/handsontableEditor/handsontableEditor.mjs +4 -4
- package/focusManager.js +1 -1
- package/focusManager.mjs +1 -1
- package/helpers/dom/element.d.ts +0 -1
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/helpers/object.js +4 -0
- package/helpers/object.mjs +4 -0
- package/package.json +2 -2
- package/plugins/base/base.js +0 -7
- package/plugins/base/base.mjs +0 -7
- package/plugins/comments/comments.js +12 -3
- package/plugins/comments/comments.mjs +12 -3
- package/plugins/contextMenu/contextMenu.js +2 -7
- package/plugins/contextMenu/contextMenu.mjs +2 -7
- package/plugins/contextMenu/menu/menu.js +2 -2
- package/plugins/contextMenu/menu/menu.mjs +2 -2
- package/plugins/contextMenu/predefinedItems/clearColumn.js +15 -4
- package/plugins/contextMenu/predefinedItems/clearColumn.mjs +15 -4
- package/plugins/filters/conditionCollection.js +8 -7
- package/plugins/filters/conditionCollection.mjs +8 -7
- package/plugins/filters/filters.js +26 -16
- package/plugins/filters/filters.mjs +26 -16
- package/plugins/filters/utils.js +7 -24
- package/plugins/filters/utils.mjs +7 -24
- package/plugins/hiddenColumns/hiddenColumns.js +1 -3
- package/plugins/hiddenColumns/hiddenColumns.mjs +1 -3
- package/plugins/hiddenRows/hiddenRows.js +1 -3
- package/plugins/hiddenRows/hiddenRows.mjs +1 -3
- package/plugins/manualRowMove/manualRowMove.js +1 -1
- package/plugins/manualRowMove/manualRowMove.mjs +1 -1
- package/plugins/mergeCells/calculations/autofill.js +60 -44
- package/plugins/mergeCells/calculations/autofill.mjs +60 -44
- package/plugins/mergeCells/cellsCollection.js +25 -8
- package/plugins/mergeCells/cellsCollection.mjs +25 -8
- package/plugins/mergeCells/mergeCells.js +15 -16
- package/plugins/mergeCells/mergeCells.mjs +15 -16
- package/plugins/nestedHeaders/nestedHeaders.js +6 -1
- package/plugins/nestedHeaders/nestedHeaders.mjs +6 -1
- package/plugins/nestedHeaders/stateManager/index.js +1 -2
- package/plugins/nestedHeaders/stateManager/index.mjs +1 -2
- package/plugins/nestedHeaders/utils/ghostTable.js +4 -0
- package/plugins/nestedHeaders/utils/ghostTable.mjs +4 -0
- package/plugins/nestedRows/utils/rowMoveController.js +1 -6
- package/plugins/nestedRows/utils/rowMoveController.mjs +1 -6
- package/plugins/undoRedo/actions/_base.js +19 -0
- package/plugins/undoRedo/actions/_base.mjs +15 -0
- package/plugins/undoRedo/actions/cellAlignment.js +85 -0
- package/plugins/undoRedo/actions/cellAlignment.mjs +81 -0
- package/plugins/undoRedo/actions/columnMove.js +84 -0
- package/plugins/undoRedo/actions/columnMove.mjs +80 -0
- package/plugins/undoRedo/actions/columnSort.js +73 -0
- package/plugins/undoRedo/actions/columnSort.mjs +69 -0
- package/plugins/undoRedo/actions/createColumn.js +60 -0
- package/plugins/undoRedo/actions/createColumn.mjs +56 -0
- package/plugins/undoRedo/actions/createRow.js +65 -0
- package/plugins/undoRedo/actions/createRow.mjs +61 -0
- package/plugins/undoRedo/actions/dataChange.js +123 -0
- package/plugins/undoRedo/actions/dataChange.mjs +119 -0
- package/plugins/undoRedo/actions/filters.js +66 -0
- package/plugins/undoRedo/actions/filters.mjs +62 -0
- package/plugins/undoRedo/actions/index.js +27 -0
- package/plugins/undoRedo/actions/index.mjs +23 -0
- package/plugins/undoRedo/actions/mergeCells.js +63 -0
- package/plugins/undoRedo/actions/mergeCells.mjs +59 -0
- package/plugins/undoRedo/actions/removeColumn.js +176 -0
- package/plugins/undoRedo/actions/removeColumn.mjs +172 -0
- package/plugins/undoRedo/actions/removeRow.js +119 -0
- package/plugins/undoRedo/actions/removeRow.mjs +115 -0
- package/plugins/undoRedo/actions/rowMove.js +84 -0
- package/plugins/undoRedo/actions/rowMove.mjs +80 -0
- package/plugins/undoRedo/actions/unmergeCells.js +56 -0
- package/plugins/undoRedo/actions/unmergeCells.mjs +52 -0
- package/plugins/undoRedo/index.js +3 -4
- package/plugins/undoRedo/index.mjs +1 -2
- package/plugins/undoRedo/undoRedo.js +277 -879
- package/plugins/undoRedo/undoRedo.mjs +277 -880
- package/plugins/undoRedo/utils.js +37 -0
- package/plugins/undoRedo/utils.mjs +33 -0
- package/renderers/checkboxRenderer/checkboxRenderer.js +8 -1
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +8 -1
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +1 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +1 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +2 -1
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +2 -1
- package/styles/handsontable.css +75 -103
- package/styles/handsontable.min.css +3 -3
- package/styles/ht-theme-horizon.css +2 -2
- package/styles/ht-theme-horizon.min.css +2 -2
- package/styles/ht-theme-main.css +2 -2
- package/styles/ht-theme-main.min.css +2 -2
- package/tableView.js +17 -1
- package/tableView.mjs +17 -1
- package/utils/autoResize.js +1 -1
- package/utils/autoResize.mjs +1 -1
- package/utils/parseTable.js +1 -1
- package/utils/parseTable.mjs +1 -1
- package/validators/dateValidator/dateValidator.js +1 -1
- package/validators/dateValidator/dateValidator.mjs +1 -1
@@ -1,4 +1,6 @@
|
|
1
1
|
import "core-js/modules/es.error.cause.js";
|
2
|
+
import "core-js/modules/esnext.iterator.constructor.js";
|
3
|
+
import "core-js/modules/esnext.iterator.every.js";
|
2
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
3
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
4
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); }
|
@@ -35,35 +37,20 @@ class AutofillCalculations {
|
|
35
37
|
this.mergedCellsCollection = this.plugin.mergedCellsCollection;
|
36
38
|
}
|
37
39
|
|
38
|
-
/**
|
39
|
-
* Correct the provided selection area, so it's not selecting only a part of a merged cell.
|
40
|
-
*
|
41
|
-
* @param {Array} selectionArea The selection to correct.
|
42
|
-
*/
|
43
|
-
correctSelectionAreaSize(selectionArea) {
|
44
|
-
if (selectionArea[0] === selectionArea[2] && selectionArea[1] === selectionArea[3]) {
|
45
|
-
const mergedCell = this.mergedCellsCollection.get(selectionArea[0], selectionArea[1]);
|
46
|
-
if (mergedCell) {
|
47
|
-
selectionArea[2] = selectionArea[0] + mergedCell.rowspan - 1;
|
48
|
-
selectionArea[3] = selectionArea[1] + mergedCell.colspan - 1;
|
49
|
-
}
|
50
|
-
}
|
51
|
-
}
|
52
|
-
|
53
40
|
/**
|
54
41
|
* Get the direction of the autofill process.
|
55
42
|
*
|
56
|
-
* @param {Array}
|
57
|
-
* @param {Array}
|
43
|
+
* @param {Array} baseArea The selection area.
|
44
|
+
* @param {Array} fullArea The final area (base + drag).
|
58
45
|
* @returns {string} `up`, `down`, `left` or `right`.
|
59
46
|
*/
|
60
|
-
getDirection(
|
47
|
+
getDirection(baseArea, fullArea) {
|
61
48
|
let direction = null;
|
62
|
-
if (
|
49
|
+
if (fullArea[0] === baseArea[0] && fullArea[1] === baseArea[1] && fullArea[3] === baseArea[3]) {
|
63
50
|
direction = 'down';
|
64
|
-
} else if (
|
51
|
+
} else if (fullArea[2] === baseArea[2] && fullArea[1] === baseArea[1] && fullArea[3] === baseArea[3]) {
|
65
52
|
direction = 'up';
|
66
|
-
} else if (
|
53
|
+
} else if (fullArea[1] === baseArea[1] && fullArea[2] === baseArea[2]) {
|
67
54
|
direction = 'right';
|
68
55
|
} else {
|
69
56
|
direction = 'left';
|
@@ -75,20 +62,20 @@ class AutofillCalculations {
|
|
75
62
|
* Snap the drag area to the farthest merged cell, so it won't clip any of the merged cells.
|
76
63
|
*
|
77
64
|
* @param {Array} baseArea The base selected area.
|
78
|
-
* @param {Array}
|
65
|
+
* @param {Array} fullArea The drag area.
|
79
66
|
* @param {string} dragDirection The autofill drag direction.
|
80
67
|
* @param {Array} foundMergedCells MergeCellCoords found in the base selection area.
|
81
68
|
* @returns {Array} The new drag area.
|
82
69
|
*/
|
83
|
-
snapDragArea(baseArea,
|
84
|
-
const newDragArea =
|
85
|
-
const fillSize = this.getAutofillSize(baseArea,
|
70
|
+
snapDragArea(baseArea, fullArea, dragDirection, foundMergedCells) {
|
71
|
+
const newDragArea = fullArea.slice(0);
|
72
|
+
const fillSize = this.getAutofillSize(baseArea, fullArea, dragDirection);
|
86
73
|
const [baseAreaStartRow, baseAreaStartColumn, baseAreaEndRow, baseAreaEndColumn] = baseArea;
|
87
74
|
const verticalDirection = ['up', 'down'].indexOf(dragDirection) > -1;
|
88
75
|
const fullCycle = verticalDirection ? baseAreaEndRow - baseAreaStartRow + 1 : baseAreaEndColumn - baseAreaStartColumn + 1;
|
89
76
|
const fulls = Math.floor(fillSize / fullCycle) * fullCycle;
|
90
77
|
const partials = fillSize - fulls;
|
91
|
-
const farthestCollection = this.getFarthestCollection(baseArea,
|
78
|
+
const farthestCollection = this.getFarthestCollection(baseArea, fullArea, dragDirection, foundMergedCells);
|
92
79
|
if (farthestCollection) {
|
93
80
|
if (dragDirection === 'down') {
|
94
81
|
const fill = farthestCollection.row + farthestCollection.rowspan - baseAreaStartRow - partials;
|
@@ -153,13 +140,13 @@ class AutofillCalculations {
|
|
153
140
|
*
|
154
141
|
* @private
|
155
142
|
* @param {Array} baseArea The base selection area.
|
156
|
-
* @param {Array}
|
143
|
+
* @param {Array} fullArea The drag area (containing the base area).
|
157
144
|
* @param {string} direction The drag direction.
|
158
145
|
* @returns {number|null} The "length" (height or width, depending on the direction) of the drag.
|
159
146
|
*/
|
160
|
-
getAutofillSize(baseArea,
|
147
|
+
getAutofillSize(baseArea, fullArea, direction) {
|
161
148
|
const [baseAreaStartRow, baseAreaStartColumn, baseAreaEndRow, baseAreaEndColumn] = baseArea;
|
162
|
-
const [dragAreaStartRow, dragAreaStartColumn, dragAreaEndRow, dragAreaEndColumn] =
|
149
|
+
const [dragAreaStartRow, dragAreaStartColumn, dragAreaEndRow, dragAreaEndColumn] = fullArea;
|
163
150
|
switch (direction) {
|
164
151
|
case 'up':
|
165
152
|
return baseAreaStartRow - dragAreaStartRow;
|
@@ -179,22 +166,30 @@ class AutofillCalculations {
|
|
179
166
|
*
|
180
167
|
* @private
|
181
168
|
* @param {Array} baseArea The base selection area.
|
182
|
-
* @param {Array}
|
169
|
+
* @param {Array} fullArea The base selection area extended by the drag area.
|
183
170
|
* @param {string} direction Drag direction.
|
184
171
|
* @returns {Array|null} Array representing the drag area coordinates.
|
185
172
|
*/
|
186
|
-
getDragArea(baseArea,
|
173
|
+
getDragArea(baseArea, fullArea, direction) {
|
187
174
|
const [baseAreaStartRow, baseAreaStartColumn, baseAreaEndRow, baseAreaEndColumn] = baseArea;
|
188
|
-
const [
|
175
|
+
const [fullAreaStartRow, fullAreaStartColumn, fullAreaEndRow, fullAreaEndColumn] = fullArea;
|
189
176
|
switch (direction) {
|
190
177
|
case 'up':
|
191
|
-
return [
|
178
|
+
return [fullAreaStartRow, fullAreaStartColumn, baseAreaStartRow - 1, baseAreaEndColumn];
|
192
179
|
case 'down':
|
193
|
-
|
180
|
+
{
|
181
|
+
const mergedCell = this.mergedCellsCollection.get(fullAreaEndRow, baseAreaEndColumn);
|
182
|
+
const rowShift = mergedCell ? mergedCell.rowspan - 1 : 0;
|
183
|
+
return [baseAreaEndRow + 1, baseAreaStartColumn, fullAreaEndRow + rowShift, baseAreaEndColumn];
|
184
|
+
}
|
194
185
|
case 'left':
|
195
|
-
return [
|
186
|
+
return [fullAreaStartRow, fullAreaStartColumn, baseAreaEndRow, baseAreaStartColumn - 1];
|
196
187
|
case 'right':
|
197
|
-
|
188
|
+
{
|
189
|
+
const mergedCell = this.mergedCellsCollection.get(fullAreaEndRow, baseAreaEndColumn);
|
190
|
+
const columnShift = mergedCell ? mergedCell.colspan - 1 : 0;
|
191
|
+
return [baseAreaStartRow, baseAreaEndColumn + columnShift, fullAreaEndRow, fullAreaEndColumn];
|
192
|
+
}
|
198
193
|
default:
|
199
194
|
return null;
|
200
195
|
}
|
@@ -205,17 +200,17 @@ class AutofillCalculations {
|
|
205
200
|
*
|
206
201
|
* @private
|
207
202
|
* @param {Array} baseArea The base selection area.
|
208
|
-
* @param {Array}
|
203
|
+
* @param {Array} fullArea The drag area (containing the base area).
|
209
204
|
* @param {string} direction The drag direction.
|
210
205
|
* @param {Array} mergedCellArray Array of the merged cells found in the base area.
|
211
206
|
* @returns {MergedCellCoords|null}
|
212
207
|
*/
|
213
|
-
getFarthestCollection(baseArea,
|
208
|
+
getFarthestCollection(baseArea, fullArea, direction, mergedCellArray) {
|
214
209
|
const [baseAreaStartRow, baseAreaStartColumn, baseAreaEndRow, baseAreaEndColumn] = baseArea;
|
215
210
|
const verticalDirection = ['up', 'down'].indexOf(direction) > -1;
|
216
211
|
const baseEnd = verticalDirection ? baseAreaEndRow : baseAreaEndColumn;
|
217
212
|
const baseStart = verticalDirection ? baseAreaStartRow : baseAreaStartColumn;
|
218
|
-
const fillSize = this.getAutofillSize(baseArea,
|
213
|
+
const fillSize = this.getAutofillSize(baseArea, fullArea, direction);
|
219
214
|
const fullCycle = verticalDirection ? baseAreaEndRow - baseAreaStartRow + 1 : baseAreaEndColumn - baseAreaStartColumn + 1;
|
220
215
|
const fulls = Math.floor(fillSize / fullCycle) * fullCycle;
|
221
216
|
const partials = fillSize - fulls;
|
@@ -290,7 +285,7 @@ class AutofillCalculations {
|
|
290
285
|
rowspan: current.rowspan,
|
291
286
|
col: current.col,
|
292
287
|
colspan: current.colspan
|
293
|
-
});
|
288
|
+
}, true);
|
294
289
|
break;
|
295
290
|
case 'down':
|
296
291
|
this.plugin.mergedCellsCollection.add({
|
@@ -298,7 +293,7 @@ class AutofillCalculations {
|
|
298
293
|
rowspan: current.rowspan,
|
299
294
|
col: current.col,
|
300
295
|
colspan: current.colspan
|
301
|
-
});
|
296
|
+
}, true);
|
302
297
|
break;
|
303
298
|
case 'left':
|
304
299
|
this.plugin.mergedCellsCollection.add({
|
@@ -306,7 +301,7 @@ class AutofillCalculations {
|
|
306
301
|
rowspan: current.rowspan,
|
307
302
|
col: current.col - fillOffset,
|
308
303
|
colspan: current.colspan
|
309
|
-
});
|
304
|
+
}, true);
|
310
305
|
break;
|
311
306
|
case 'right':
|
312
307
|
this.plugin.mergedCellsCollection.add({
|
@@ -314,7 +309,7 @@ class AutofillCalculations {
|
|
314
309
|
rowspan: current.rowspan,
|
315
310
|
col: current.col + fillOffset,
|
316
311
|
colspan: current.colspan
|
317
|
-
});
|
312
|
+
}, true);
|
318
313
|
break;
|
319
314
|
default:
|
320
315
|
}
|
@@ -389,7 +384,28 @@ class AutofillCalculations {
|
|
389
384
|
const topLeft = this.plugin.hot._createCellCoords(dragAreaStartRow, dragAreaStartColumn);
|
390
385
|
const bottomRight = this.plugin.hot._createCellCoords(dragAreaEndRow, dragAreaEndColumn);
|
391
386
|
const dragRange = this.plugin.hot._createCellRange(topLeft, topLeft, bottomRight);
|
392
|
-
|
387
|
+
const mergedCellsWithPartials = this.mergedCellsCollection.getWithinRange(dragRange, true);
|
388
|
+
if (mergedCellsWithPartials.length === 0) {
|
389
|
+
return false;
|
390
|
+
}
|
391
|
+
const mergedCellsWithoutPartials = this.mergedCellsCollection.getWithinRange(dragRange, false);
|
392
|
+
if (mergedCellsWithoutPartials.length === 0) {
|
393
|
+
return true;
|
394
|
+
}
|
395
|
+
if (direction === 'up' || direction === 'down') {
|
396
|
+
return !mergedCellsWithoutPartials.every(_ref => {
|
397
|
+
let {
|
398
|
+
colspan
|
399
|
+
} = _ref;
|
400
|
+
return colspan === dragRange.getWidth();
|
401
|
+
});
|
402
|
+
}
|
403
|
+
return !mergedCellsWithoutPartials.every(_ref2 => {
|
404
|
+
let {
|
405
|
+
rowspan
|
406
|
+
} = _ref2;
|
407
|
+
return rowspan === dragRange.getHeight();
|
408
|
+
});
|
393
409
|
}
|
394
410
|
}
|
395
411
|
export default AutofillCalculations;
|
@@ -109,18 +109,33 @@ class MergedCellsCollection {
|
|
109
109
|
/**
|
110
110
|
* Get the first-found merged cell containing the provided range.
|
111
111
|
*
|
112
|
-
* @param {CellRange
|
113
|
-
* @returns {MergedCellCoords|
|
112
|
+
* @param {CellRange} range The range to search merged cells for.
|
113
|
+
* @returns {MergedCellCoords | false}
|
114
114
|
*/
|
115
115
|
getByRange(range) {
|
116
|
+
const {
|
117
|
+
row: rowStart,
|
118
|
+
col: columnStart
|
119
|
+
} = range.getTopStartCorner();
|
120
|
+
const {
|
121
|
+
row: rowEnd,
|
122
|
+
col: columnEnd
|
123
|
+
} = range.getBottomEndCorner();
|
124
|
+
const mergedCellsLength = this.mergedCells.length;
|
116
125
|
let result = false;
|
117
|
-
(0
|
118
|
-
|
126
|
+
for (let i = 0; i < mergedCellsLength; i++) {
|
127
|
+
const mergedCell = this.mergedCells[i];
|
128
|
+
const {
|
129
|
+
row,
|
130
|
+
col,
|
131
|
+
rowspan,
|
132
|
+
colspan
|
133
|
+
} = mergedCell;
|
134
|
+
if (row >= rowStart && row + rowspan - 1 <= rowEnd && col >= columnStart && col + colspan - 1 <= columnEnd) {
|
119
135
|
result = mergedCell;
|
120
|
-
|
136
|
+
break;
|
121
137
|
}
|
122
|
-
|
123
|
-
});
|
138
|
+
}
|
124
139
|
return result;
|
125
140
|
}
|
126
141
|
|
@@ -230,7 +245,9 @@ class MergedCellsCollection {
|
|
230
245
|
_assertClassBrand(_MergedCellsCollection_brand, this, _addMergedCellToMatrix).call(this, newMergedCell);
|
231
246
|
return newMergedCell;
|
232
247
|
}
|
233
|
-
|
248
|
+
if (isOverlapping) {
|
249
|
+
(0, _console.warn)(MergedCellsCollection.IS_OVERLAPPING_WARNING(newMergedCell));
|
250
|
+
}
|
234
251
|
return false;
|
235
252
|
}
|
236
253
|
|
@@ -105,18 +105,33 @@ class MergedCellsCollection {
|
|
105
105
|
/**
|
106
106
|
* Get the first-found merged cell containing the provided range.
|
107
107
|
*
|
108
|
-
* @param {CellRange
|
109
|
-
* @returns {MergedCellCoords|
|
108
|
+
* @param {CellRange} range The range to search merged cells for.
|
109
|
+
* @returns {MergedCellCoords | false}
|
110
110
|
*/
|
111
111
|
getByRange(range) {
|
112
|
+
const {
|
113
|
+
row: rowStart,
|
114
|
+
col: columnStart
|
115
|
+
} = range.getTopStartCorner();
|
116
|
+
const {
|
117
|
+
row: rowEnd,
|
118
|
+
col: columnEnd
|
119
|
+
} = range.getBottomEndCorner();
|
120
|
+
const mergedCellsLength = this.mergedCells.length;
|
112
121
|
let result = false;
|
113
|
-
|
114
|
-
|
122
|
+
for (let i = 0; i < mergedCellsLength; i++) {
|
123
|
+
const mergedCell = this.mergedCells[i];
|
124
|
+
const {
|
125
|
+
row,
|
126
|
+
col,
|
127
|
+
rowspan,
|
128
|
+
colspan
|
129
|
+
} = mergedCell;
|
130
|
+
if (row >= rowStart && row + rowspan - 1 <= rowEnd && col >= columnStart && col + colspan - 1 <= columnEnd) {
|
115
131
|
result = mergedCell;
|
116
|
-
|
132
|
+
break;
|
117
133
|
}
|
118
|
-
|
119
|
-
});
|
134
|
+
}
|
120
135
|
return result;
|
121
136
|
}
|
122
137
|
|
@@ -226,7 +241,9 @@ class MergedCellsCollection {
|
|
226
241
|
_assertClassBrand(_MergedCellsCollection_brand, this, _addMergedCellToMatrix).call(this, newMergedCell);
|
227
242
|
return newMergedCell;
|
228
243
|
}
|
229
|
-
|
244
|
+
if (isOverlapping) {
|
245
|
+
warn(MergedCellsCollection.IS_OVERLAPPING_WARNING(newMergedCell));
|
246
|
+
}
|
230
247
|
return false;
|
231
248
|
}
|
232
249
|
|
@@ -909,8 +909,8 @@ class MergeCells extends _base.BasePlugin {
|
|
909
909
|
/**
|
910
910
|
* The `modifyAutofillRange` hook callback.
|
911
911
|
*
|
912
|
-
* @param {Array}
|
913
|
-
* @param {Array}
|
912
|
+
* @param {Array} fullArea The drag + base area coordinates.
|
913
|
+
* @param {Array} baseArea The selection information.
|
914
914
|
* @returns {Array} The new drag area.
|
915
915
|
*/
|
916
916
|
}
|
@@ -1294,23 +1294,19 @@ function _onAfterViewportColumnCalculatorOverride(calc) {
|
|
1294
1294
|
this.modifyViewportColumnStart(calc, nrOfRows);
|
1295
1295
|
this.modifyViewportColumnEnd(calc, nrOfRows);
|
1296
1296
|
}
|
1297
|
-
function _onModifyAutofillRange(
|
1298
|
-
this.autofillCalculations.
|
1299
|
-
|
1300
|
-
|
1301
|
-
if (this.autofillCalculations.dragAreaOverlapsCollections(select, dragArea, dragDirection)) {
|
1302
|
-
dragArea = select;
|
1303
|
-
return dragArea;
|
1297
|
+
function _onModifyAutofillRange(fullArea, baseArea) {
|
1298
|
+
const dragDirection = this.autofillCalculations.getDirection(baseArea, fullArea);
|
1299
|
+
if (this.autofillCalculations.dragAreaOverlapsCollections(baseArea, fullArea, dragDirection)) {
|
1300
|
+
return baseArea;
|
1304
1301
|
}
|
1305
|
-
const from = this.hot._createCellCoords(
|
1306
|
-
const to = this.hot._createCellCoords(
|
1302
|
+
const from = this.hot._createCellCoords(baseArea[0], baseArea[1]);
|
1303
|
+
const to = this.hot._createCellCoords(baseArea[2], baseArea[3]);
|
1307
1304
|
const range = this.hot._createCellRange(from, from, to);
|
1308
1305
|
const mergedCellsWithinSelectionArea = this.mergedCellsCollection.getWithinRange(range);
|
1309
1306
|
if (mergedCellsWithinSelectionArea.length === 0) {
|
1310
|
-
return
|
1307
|
+
return fullArea;
|
1311
1308
|
}
|
1312
|
-
|
1313
|
-
return dragArea;
|
1309
|
+
return this.autofillCalculations.snapDragArea(baseArea, fullArea, dragDirection, mergedCellsWithinSelectionArea);
|
1314
1310
|
}
|
1315
1311
|
/**
|
1316
1312
|
* `afterCreateCol` hook callback.
|
@@ -1474,7 +1470,6 @@ function _onModifyRowHeightByOverlayName(height, row, overlayType) {
|
|
1474
1470
|
rowspanCorrection = maxRowspan - mergedCellsWithinRange[0].rowspan;
|
1475
1471
|
}
|
1476
1472
|
mergedCellsWithinRange.forEach(_ref2 => {
|
1477
|
-
var _height;
|
1478
1473
|
let {
|
1479
1474
|
rowspan
|
1480
1475
|
} = _ref2;
|
@@ -1484,7 +1479,7 @@ function _onModifyRowHeightByOverlayName(height, row, overlayType) {
|
|
1484
1479
|
} else {
|
1485
1480
|
rowspanAfterCorrection = rowspan - rowspanCorrection;
|
1486
1481
|
}
|
1487
|
-
height = Math.max(
|
1482
|
+
height = Math.max(height !== null && height !== void 0 ? height : 0, _assertClassBrand(_MergeCells_brand, this, _sumCellsHeights).call(this, row, rowspanAfterCorrection));
|
1488
1483
|
});
|
1489
1484
|
return height;
|
1490
1485
|
}
|
@@ -1496,6 +1491,7 @@ function _onModifyRowHeightByOverlayName(height, row, overlayType) {
|
|
1496
1491
|
* @returns {number}
|
1497
1492
|
*/
|
1498
1493
|
function _sumCellsHeights(row, rowspan) {
|
1494
|
+
const stylesHandler = this.hot.view.getStylesHandler();
|
1499
1495
|
const defaultHeight = this.hot.view.getDefaultRowHeight();
|
1500
1496
|
const autoRowSizePlugin = this.hot.getPlugin('autoRowSize');
|
1501
1497
|
let height = 0;
|
@@ -1503,6 +1499,9 @@ function _sumCellsHeights(row, rowspan) {
|
|
1503
1499
|
if (!this.hot.rowIndexMapper.isHidden(i)) {
|
1504
1500
|
var _autoRowSizePlugin$ge;
|
1505
1501
|
height += (_autoRowSizePlugin$ge = autoRowSizePlugin === null || autoRowSizePlugin === void 0 ? void 0 : autoRowSizePlugin.getRowHeight(i)) !== null && _autoRowSizePlugin$ge !== void 0 ? _autoRowSizePlugin$ge : defaultHeight;
|
1502
|
+
if (i === 0 && !stylesHandler.isClassicTheme()) {
|
1503
|
+
height += 1; // border-top-width
|
1504
|
+
}
|
1506
1505
|
}
|
1507
1506
|
}
|
1508
1507
|
return height;
|
@@ -905,8 +905,8 @@ export class MergeCells extends BasePlugin {
|
|
905
905
|
/**
|
906
906
|
* The `modifyAutofillRange` hook callback.
|
907
907
|
*
|
908
|
-
* @param {Array}
|
909
|
-
* @param {Array}
|
908
|
+
* @param {Array} fullArea The drag + base area coordinates.
|
909
|
+
* @param {Array} baseArea The selection information.
|
910
910
|
* @returns {Array} The new drag area.
|
911
911
|
*/
|
912
912
|
}
|
@@ -1289,23 +1289,19 @@ function _onAfterViewportColumnCalculatorOverride(calc) {
|
|
1289
1289
|
this.modifyViewportColumnStart(calc, nrOfRows);
|
1290
1290
|
this.modifyViewportColumnEnd(calc, nrOfRows);
|
1291
1291
|
}
|
1292
|
-
function _onModifyAutofillRange(
|
1293
|
-
this.autofillCalculations.
|
1294
|
-
|
1295
|
-
|
1296
|
-
if (this.autofillCalculations.dragAreaOverlapsCollections(select, dragArea, dragDirection)) {
|
1297
|
-
dragArea = select;
|
1298
|
-
return dragArea;
|
1292
|
+
function _onModifyAutofillRange(fullArea, baseArea) {
|
1293
|
+
const dragDirection = this.autofillCalculations.getDirection(baseArea, fullArea);
|
1294
|
+
if (this.autofillCalculations.dragAreaOverlapsCollections(baseArea, fullArea, dragDirection)) {
|
1295
|
+
return baseArea;
|
1299
1296
|
}
|
1300
|
-
const from = this.hot._createCellCoords(
|
1301
|
-
const to = this.hot._createCellCoords(
|
1297
|
+
const from = this.hot._createCellCoords(baseArea[0], baseArea[1]);
|
1298
|
+
const to = this.hot._createCellCoords(baseArea[2], baseArea[3]);
|
1302
1299
|
const range = this.hot._createCellRange(from, from, to);
|
1303
1300
|
const mergedCellsWithinSelectionArea = this.mergedCellsCollection.getWithinRange(range);
|
1304
1301
|
if (mergedCellsWithinSelectionArea.length === 0) {
|
1305
|
-
return
|
1302
|
+
return fullArea;
|
1306
1303
|
}
|
1307
|
-
|
1308
|
-
return dragArea;
|
1304
|
+
return this.autofillCalculations.snapDragArea(baseArea, fullArea, dragDirection, mergedCellsWithinSelectionArea);
|
1309
1305
|
}
|
1310
1306
|
/**
|
1311
1307
|
* `afterCreateCol` hook callback.
|
@@ -1469,7 +1465,6 @@ function _onModifyRowHeightByOverlayName(height, row, overlayType) {
|
|
1469
1465
|
rowspanCorrection = maxRowspan - mergedCellsWithinRange[0].rowspan;
|
1470
1466
|
}
|
1471
1467
|
mergedCellsWithinRange.forEach(_ref2 => {
|
1472
|
-
var _height;
|
1473
1468
|
let {
|
1474
1469
|
rowspan
|
1475
1470
|
} = _ref2;
|
@@ -1479,7 +1474,7 @@ function _onModifyRowHeightByOverlayName(height, row, overlayType) {
|
|
1479
1474
|
} else {
|
1480
1475
|
rowspanAfterCorrection = rowspan - rowspanCorrection;
|
1481
1476
|
}
|
1482
|
-
height = Math.max(
|
1477
|
+
height = Math.max(height !== null && height !== void 0 ? height : 0, _assertClassBrand(_MergeCells_brand, this, _sumCellsHeights).call(this, row, rowspanAfterCorrection));
|
1483
1478
|
});
|
1484
1479
|
return height;
|
1485
1480
|
}
|
@@ -1491,6 +1486,7 @@ function _onModifyRowHeightByOverlayName(height, row, overlayType) {
|
|
1491
1486
|
* @returns {number}
|
1492
1487
|
*/
|
1493
1488
|
function _sumCellsHeights(row, rowspan) {
|
1489
|
+
const stylesHandler = this.hot.view.getStylesHandler();
|
1494
1490
|
const defaultHeight = this.hot.view.getDefaultRowHeight();
|
1495
1491
|
const autoRowSizePlugin = this.hot.getPlugin('autoRowSize');
|
1496
1492
|
let height = 0;
|
@@ -1498,6 +1494,9 @@ function _sumCellsHeights(row, rowspan) {
|
|
1498
1494
|
if (!this.hot.rowIndexMapper.isHidden(i)) {
|
1499
1495
|
var _autoRowSizePlugin$ge;
|
1500
1496
|
height += (_autoRowSizePlugin$ge = autoRowSizePlugin === null || autoRowSizePlugin === void 0 ? void 0 : autoRowSizePlugin.getRowHeight(i)) !== null && _autoRowSizePlugin$ge !== void 0 ? _autoRowSizePlugin$ge : defaultHeight;
|
1497
|
+
if (i === 0 && !stylesHandler.isClassicTheme()) {
|
1498
|
+
height += 1; // border-top-width
|
1499
|
+
}
|
1501
1500
|
}
|
1502
1501
|
}
|
1503
1502
|
return height;
|
@@ -425,6 +425,7 @@ class NestedHeaders extends _base.BasePlugin {
|
|
425
425
|
}
|
426
426
|
TH.removeAttribute('colspan');
|
427
427
|
(0, _element.removeClass)(TH, 'hiddenHeader');
|
428
|
+
(0, _element.removeClass)(TH, 'hiddenHeaderText');
|
428
429
|
const {
|
429
430
|
colspan,
|
430
431
|
isHidden,
|
@@ -436,12 +437,16 @@ class NestedHeaders extends _base.BasePlugin {
|
|
436
437
|
if (isPlaceholder || isHidden) {
|
437
438
|
(0, _element.addClass)(TH, 'hiddenHeader');
|
438
439
|
} else if (colspan > 1) {
|
439
|
-
var _wtOverlays$topInline, _wtOverlays$inlineSta;
|
440
|
+
var _wtOverlays$topInline, _wtOverlays$inlineSta, _wtOverlays$topOverla;
|
440
441
|
const {
|
441
442
|
wtOverlays
|
442
443
|
} = view._wt;
|
443
444
|
const isTopInlineStartOverlay = (_wtOverlays$topInline = wtOverlays.topInlineStartCornerOverlay) === null || _wtOverlays$topInline === void 0 ? void 0 : _wtOverlays$topInline.clone.wtTable.THEAD.contains(TH);
|
444
445
|
const isInlineStartOverlay = (_wtOverlays$inlineSta = wtOverlays.inlineStartOverlay) === null || _wtOverlays$inlineSta === void 0 ? void 0 : _wtOverlays$inlineSta.clone.wtTable.THEAD.contains(TH);
|
446
|
+
const isTopOverlay = (_wtOverlays$topOverla = wtOverlays.topOverlay) === null || _wtOverlays$topOverla === void 0 ? void 0 : _wtOverlays$topOverla.clone.wtTable.THEAD.contains(TH);
|
447
|
+
if (isTopOverlay && visualColumnIndex < fixedColumnsStart) {
|
448
|
+
(0, _element.addClass)(TH, 'hiddenHeaderText');
|
449
|
+
}
|
445
450
|
|
446
451
|
// Check if there is a fixed column enabled, if so then reduce colspan to fixed column width.
|
447
452
|
const correctedColspan = isTopInlineStartOverlay || isInlineStartOverlay ? Math.min(colspan, fixedColumnsStart - renderedColumnIndex) : colspan;
|
@@ -421,6 +421,7 @@ export class NestedHeaders extends BasePlugin {
|
|
421
421
|
}
|
422
422
|
TH.removeAttribute('colspan');
|
423
423
|
removeClass(TH, 'hiddenHeader');
|
424
|
+
removeClass(TH, 'hiddenHeaderText');
|
424
425
|
const {
|
425
426
|
colspan,
|
426
427
|
isHidden,
|
@@ -432,12 +433,16 @@ export class NestedHeaders extends BasePlugin {
|
|
432
433
|
if (isPlaceholder || isHidden) {
|
433
434
|
addClass(TH, 'hiddenHeader');
|
434
435
|
} else if (colspan > 1) {
|
435
|
-
var _wtOverlays$topInline, _wtOverlays$inlineSta;
|
436
|
+
var _wtOverlays$topInline, _wtOverlays$inlineSta, _wtOverlays$topOverla;
|
436
437
|
const {
|
437
438
|
wtOverlays
|
438
439
|
} = view._wt;
|
439
440
|
const isTopInlineStartOverlay = (_wtOverlays$topInline = wtOverlays.topInlineStartCornerOverlay) === null || _wtOverlays$topInline === void 0 ? void 0 : _wtOverlays$topInline.clone.wtTable.THEAD.contains(TH);
|
440
441
|
const isInlineStartOverlay = (_wtOverlays$inlineSta = wtOverlays.inlineStartOverlay) === null || _wtOverlays$inlineSta === void 0 ? void 0 : _wtOverlays$inlineSta.clone.wtTable.THEAD.contains(TH);
|
442
|
+
const isTopOverlay = (_wtOverlays$topOverla = wtOverlays.topOverlay) === null || _wtOverlays$topOverla === void 0 ? void 0 : _wtOverlays$topOverla.clone.wtTable.THEAD.contains(TH);
|
443
|
+
if (isTopOverlay && visualColumnIndex < fixedColumnsStart) {
|
444
|
+
addClass(TH, 'hiddenHeaderText');
|
445
|
+
}
|
441
446
|
|
442
447
|
// Check if there is a fixed column enabled, if so then reduce colspan to fixed column width.
|
443
448
|
const correctedColspan = isTopInlineStartOverlay || isInlineStartOverlay ? Math.min(colspan, fixedColumnsStart - renderedColumnIndex) : colspan;
|
@@ -348,7 +348,6 @@ class StateManager {
|
|
348
348
|
* @returns {number} Returns a header level in format -1 to -N.
|
349
349
|
*/
|
350
350
|
findTopMostEntireHeaderLevel(columnIndexFrom) {
|
351
|
-
var _headerLevel;
|
352
351
|
let columnIndexTo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : columnIndexFrom;
|
353
352
|
const columnsWidth = columnIndexTo - columnIndexFrom + 1;
|
354
353
|
let atLeastOneRootFound = false;
|
@@ -381,7 +380,7 @@ class StateManager {
|
|
381
380
|
if (atLeastOneRootFound && headerLevel === null) {
|
382
381
|
return -1;
|
383
382
|
}
|
384
|
-
return this.levelToRowCoords(
|
383
|
+
return this.levelToRowCoords(headerLevel !== null && headerLevel !== void 0 ? headerLevel : 0);
|
385
384
|
}
|
386
385
|
|
387
386
|
/**
|
@@ -344,7 +344,6 @@ export default class StateManager {
|
|
344
344
|
* @returns {number} Returns a header level in format -1 to -N.
|
345
345
|
*/
|
346
346
|
findTopMostEntireHeaderLevel(columnIndexFrom) {
|
347
|
-
var _headerLevel;
|
348
347
|
let columnIndexTo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : columnIndexFrom;
|
349
348
|
const columnsWidth = columnIndexTo - columnIndexFrom + 1;
|
350
349
|
let atLeastOneRootFound = false;
|
@@ -377,7 +376,7 @@ export default class StateManager {
|
|
377
376
|
if (atLeastOneRootFound && headerLevel === null) {
|
378
377
|
return -1;
|
379
378
|
}
|
380
|
-
return this.levelToRowCoords(
|
379
|
+
return this.levelToRowCoords(headerLevel !== null && headerLevel !== void 0 ? headerLevel : 0);
|
381
380
|
}
|
382
381
|
|
383
382
|
/**
|
@@ -81,8 +81,12 @@ class GhostTable {
|
|
81
81
|
* Build cache of the headers widths.
|
82
82
|
*/
|
83
83
|
buildWidthsMap() {
|
84
|
+
const currentThemeName = this.hot.getCurrentThemeName();
|
84
85
|
this.container = this.hot.rootDocument.createElement('div');
|
85
86
|
this.container.classList.add('handsontable', 'htGhostTable', 'htAutoSize');
|
87
|
+
if (currentThemeName) {
|
88
|
+
this.container.classList.add(currentThemeName);
|
89
|
+
}
|
86
90
|
this._buildGhostTable(this.container);
|
87
91
|
this.hot.rootDocument.body.appendChild(this.container);
|
88
92
|
const columns = this.container.querySelectorAll('tr:last-of-type th');
|
@@ -78,8 +78,12 @@ class GhostTable {
|
|
78
78
|
* Build cache of the headers widths.
|
79
79
|
*/
|
80
80
|
buildWidthsMap() {
|
81
|
+
const currentThemeName = this.hot.getCurrentThemeName();
|
81
82
|
this.container = this.hot.rootDocument.createElement('div');
|
82
83
|
this.container.classList.add('handsontable', 'htGhostTable', 'htAutoSize');
|
84
|
+
if (currentThemeName) {
|
85
|
+
this.container.classList.add(currentThemeName);
|
86
|
+
}
|
83
87
|
this._buildGhostTable(this.container);
|
84
88
|
this.hot.rootDocument.body.appendChild(this.container);
|
85
89
|
const columns = this.container.querySelectorAll('tr:last-of-type th');
|
@@ -247,8 +247,6 @@ class RowMoveController {
|
|
247
247
|
const rowsLen = rows.length;
|
248
248
|
let startRow = 0;
|
249
249
|
let endRow = 0;
|
250
|
-
let selection = null;
|
251
|
-
let lastColIndex = null;
|
252
250
|
if (this.movedToCollapsed) {
|
253
251
|
let physicalDropIndex = null;
|
254
252
|
if (rows[rowsLen - 1] < dropIndex) {
|
@@ -267,10 +265,7 @@ class RowMoveController {
|
|
267
265
|
startRow = dropIndex;
|
268
266
|
endRow = startRow + rowsLen - 1;
|
269
267
|
}
|
270
|
-
|
271
|
-
lastColIndex = this.hot.countCols() - 1;
|
272
|
-
selection.setRangeStart(this.hot._createCellCoords(startRow, 0));
|
273
|
-
selection.setRangeEnd(this.hot._createCellCoords(endRow, lastColIndex), true);
|
268
|
+
this.hot.selectCells([[startRow, 0, endRow, this.hot.countCols() - 1]], false);
|
274
269
|
}
|
275
270
|
|
276
271
|
// TODO: Reimplementation of function which is inside the `ManualRowMove` plugin.
|
@@ -244,8 +244,6 @@ export default class RowMoveController {
|
|
244
244
|
const rowsLen = rows.length;
|
245
245
|
let startRow = 0;
|
246
246
|
let endRow = 0;
|
247
|
-
let selection = null;
|
248
|
-
let lastColIndex = null;
|
249
247
|
if (this.movedToCollapsed) {
|
250
248
|
let physicalDropIndex = null;
|
251
249
|
if (rows[rowsLen - 1] < dropIndex) {
|
@@ -264,10 +262,7 @@ export default class RowMoveController {
|
|
264
262
|
startRow = dropIndex;
|
265
263
|
endRow = startRow + rowsLen - 1;
|
266
264
|
}
|
267
|
-
|
268
|
-
lastColIndex = this.hot.countCols() - 1;
|
269
|
-
selection.setRangeStart(this.hot._createCellCoords(startRow, 0));
|
270
|
-
selection.setRangeEnd(this.hot._createCellCoords(endRow, lastColIndex), true);
|
265
|
+
this.hot.selectCells([[startRow, 0, endRow, this.hot.countCols() - 1]], false);
|
271
266
|
}
|
272
267
|
|
273
268
|
// TODO: Reimplementation of function which is inside the `ManualRowMove` plugin.
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
require("core-js/modules/es.error.cause.js");
|
5
|
+
/**
|
6
|
+
* An abstract class that defines the structure of an undo/redo action.
|
7
|
+
*
|
8
|
+
* @class BaseAction
|
9
|
+
* @private
|
10
|
+
*/
|
11
|
+
class BaseAction {
|
12
|
+
undo() {
|
13
|
+
throw new Error('Not implemented');
|
14
|
+
}
|
15
|
+
redo() {
|
16
|
+
throw new Error('Not implemented');
|
17
|
+
}
|
18
|
+
}
|
19
|
+
exports.BaseAction = BaseAction;
|