handsontable 0.0.0-next-e5dbebc-20240319 → 0.0.0-next-923e108-20240319
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.
- package/3rdparty/walkontable/src/cell/range.d.ts +1 -2
- package/3rdparty/walkontable/src/cell/range.js +5 -22
- package/3rdparty/walkontable/src/cell/range.mjs +5 -22
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/viewportScroll/index.js +1 -4
- package/core/viewportScroll/index.mjs +1 -4
- package/core.d.ts +3 -4
- package/core.js +21 -76
- package/core.mjs +21 -76
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +1357 -2619
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +71 -71
- package/dist/handsontable.js +1361 -2623
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +19 -19
- package/editorManager.js +8 -12
- package/editorManager.mjs +8 -12
- package/focusManager.js +1 -7
- package/focusManager.mjs +1 -7
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +1 -1
- package/pluginHooks.d.ts +0 -4
- package/pluginHooks.js +1 -69
- package/pluginHooks.mjs +1 -69
- package/plugins/collapsibleColumns/collapsibleColumns.js +3 -9
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +3 -9
- package/plugins/columnSorting/columnSorting.js +2 -8
- package/plugins/columnSorting/columnSorting.mjs +2 -8
- package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
- package/plugins/mergeCells/calculations/selection.js +70 -1
- package/plugins/mergeCells/calculations/selection.mjs +70 -1
- package/plugins/mergeCells/cellsCollection.js +0 -116
- package/plugins/mergeCells/cellsCollection.mjs +0 -116
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
- package/plugins/mergeCells/mergeCells.js +196 -337
- package/plugins/mergeCells/mergeCells.mjs +196 -337
- package/plugins/multiColumnSorting/multiColumnSorting.js +2 -8
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -8
- package/plugins/nestedHeaders/nestedHeaders.js +0 -1
- package/plugins/nestedHeaders/nestedHeaders.mjs +0 -1
- package/plugins/nestedRows/nestedRows.js +3 -9
- package/plugins/nestedRows/nestedRows.mjs +3 -9
- package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
- package/selection/highlight/visualSelection.js +0 -2
- package/selection/highlight/visualSelection.mjs +0 -2
- package/selection/selection.js +40 -209
- package/selection/selection.mjs +39 -208
- package/selection/transformation.js +32 -83
- package/selection/transformation.mjs +32 -83
- package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
- package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
- package/shortcutContexts/commands/editor/open.js +3 -18
- package/shortcutContexts/commands/editor/open.mjs +3 -18
- package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
- package/shortcutContexts/grid.js +2 -2
- package/shortcutContexts/grid.mjs +2 -2
- package/shortcuts/context.js +1 -2
- package/shortcuts/context.mjs +1 -2
- package/utils/dataStructures/linkedList.js +1 -6
- package/utils/dataStructures/linkedList.mjs +1 -6
- package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
- package/plugins/mergeCells/focusOrder.js +0 -303
- package/plugins/mergeCells/focusOrder.mjs +0 -298
@@ -29,10 +29,10 @@ var _Transformation_brand = /*#__PURE__*/new WeakSet();
|
|
29
29
|
class Transformation {
|
30
30
|
constructor(range, options) {
|
31
31
|
/**
|
32
|
-
*
|
32
|
+
* Sets the additional offset in table size that may occur when the `navigableHeaders` option
|
33
|
+
* is enabled.
|
33
34
|
*
|
34
|
-
* @param {
|
35
|
-
* @returns {{rowDir: 1|0|-1, colDir: 1|0|-1}}
|
35
|
+
* @param {{x: number, y: number}} offset Offset as x and y properties.
|
36
36
|
*/
|
37
37
|
_classPrivateMethodInitSpec(this, _Transformation_brand);
|
38
38
|
/**
|
@@ -73,6 +73,10 @@ class Transformation {
|
|
73
73
|
*/
|
74
74
|
transformStart(rowDelta, colDelta) {
|
75
75
|
let createMissingRecords = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
76
|
+
_assertClassBrand(_Transformation_brand, this, _setOffsetSize).call(this, {
|
77
|
+
x: _classPrivateFieldGet(_options, this).navigableHeaders() ? _classPrivateFieldGet(_options, this).countRowHeaders() : 0,
|
78
|
+
y: _classPrivateFieldGet(_options, this).navigableHeaders() ? _classPrivateFieldGet(_options, this).countColHeaders() : 0
|
79
|
+
});
|
76
80
|
const delta = _classPrivateFieldGet(_options, this).createCellCoords(rowDelta, colDelta);
|
77
81
|
let visualCoords = _classPrivateFieldGet(_range, this).current().highlight;
|
78
82
|
const highlightRenderableCoords = _classPrivateFieldGet(_options, this).visualToRenderableCoords(visualCoords);
|
@@ -152,46 +156,23 @@ class Transformation {
|
|
152
156
|
* @returns {CellCoords} Visual coordinates after transformation.
|
153
157
|
*/
|
154
158
|
transformEnd(rowDelta, colDelta) {
|
159
|
+
_assertClassBrand(_Transformation_brand, this, _setOffsetSize).call(this, {
|
160
|
+
x: _classPrivateFieldGet(_options, this).navigableHeaders() ? _classPrivateFieldGet(_options, this).countRowHeaders() : 0,
|
161
|
+
y: _classPrivateFieldGet(_options, this).navigableHeaders() ? _classPrivateFieldGet(_options, this).countColHeaders() : 0
|
162
|
+
});
|
155
163
|
const delta = _classPrivateFieldGet(_options, this).createCellCoords(rowDelta, colDelta);
|
156
164
|
const cellRange = _classPrivateFieldGet(_range, this).current();
|
157
165
|
const highlightRenderableCoords = _classPrivateFieldGet(_options, this).visualToRenderableCoords(cellRange.highlight);
|
158
|
-
const toRow = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedRow).call(this, cellRange.to.row, cellRange.from.row);
|
159
|
-
const toColumn = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedColumn).call(this, cellRange.to.col, cellRange.from.col);
|
160
166
|
const visualCoords = cellRange.to.clone();
|
161
167
|
let rowTransformDir = 0;
|
162
168
|
let colTransformDir = 0;
|
163
169
|
this.runLocalHooks('beforeTransformEnd', delta);
|
164
|
-
if (highlightRenderableCoords.row !== null && highlightRenderableCoords.col !== null
|
170
|
+
if (highlightRenderableCoords.row !== null && highlightRenderableCoords.col !== null) {
|
165
171
|
const {
|
166
|
-
row
|
167
|
-
col
|
168
|
-
} = _assertClassBrand(_Transformation_brand, this, _visualToZeroBasedCoords).call(this, cellRange.
|
169
|
-
const coords = _classPrivateFieldGet(_options, this).createCellCoords(
|
170
|
-
const topStartCorner = cellRange.getTopStartCorner();
|
171
|
-
const topEndCorner = cellRange.getTopEndCorner();
|
172
|
-
const bottomEndCorner = cellRange.getBottomEndCorner();
|
173
|
-
const restDelta = {
|
174
|
-
row: coords.row - highlightRow,
|
175
|
-
col: coords.col - highlightColumn
|
176
|
-
};
|
177
|
-
if (delta.col < 0) {
|
178
|
-
if (toColumn >= highlightColumn && coords.col < highlightColumn) {
|
179
|
-
coords.col = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedColumn).call(this, topStartCorner.col, topEndCorner.col) + restDelta.col;
|
180
|
-
}
|
181
|
-
} else if (delta.col > 0) {
|
182
|
-
if (toColumn <= highlightColumn && coords.col > highlightColumn) {
|
183
|
-
coords.col = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedColumn).call(this, topEndCorner.col, topStartCorner.col) + restDelta.col;
|
184
|
-
}
|
185
|
-
}
|
186
|
-
if (delta.row < 0) {
|
187
|
-
if (toRow >= highlightRow && coords.row < highlightRow) {
|
188
|
-
coords.row = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedRow).call(this, topStartCorner.row, bottomEndCorner.row) + restDelta.row;
|
189
|
-
}
|
190
|
-
} else if (delta.row > 0) {
|
191
|
-
if (toRow <= highlightRow && coords.row > highlightRow) {
|
192
|
-
coords.row = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedRow).call(this, bottomEndCorner.row, topStartCorner.row) + restDelta.row;
|
193
|
-
}
|
194
|
-
}
|
172
|
+
row,
|
173
|
+
col
|
174
|
+
} = _assertClassBrand(_Transformation_brand, this, _visualToZeroBasedCoords).call(this, cellRange.to);
|
175
|
+
const coords = _classPrivateFieldGet(_options, this).createCellCoords(row + delta.row, col + delta.col);
|
195
176
|
const {
|
196
177
|
rowDir,
|
197
178
|
colDir
|
@@ -211,24 +192,23 @@ class Transformation {
|
|
211
192
|
this.runLocalHooks('afterTransformEnd', visualCoords, rowTransformDir, colTransformDir);
|
212
193
|
return visualCoords;
|
213
194
|
}
|
214
|
-
|
215
|
-
/**
|
216
|
-
* Sets the additional offset in table size that may occur when the `navigableHeaders` option
|
217
|
-
* is enabled.
|
218
|
-
*
|
219
|
-
* @param {{x: number, y: number}} offset Offset as x and y properties.
|
220
|
-
*/
|
221
|
-
setOffsetSize(_ref) {
|
222
|
-
let {
|
223
|
-
x,
|
224
|
-
y
|
225
|
-
} = _ref;
|
226
|
-
_classPrivateFieldSet(_offset, this, {
|
227
|
-
x,
|
228
|
-
y
|
229
|
-
});
|
230
|
-
}
|
231
195
|
}
|
196
|
+
function _setOffsetSize(_ref) {
|
197
|
+
let {
|
198
|
+
x,
|
199
|
+
y
|
200
|
+
} = _ref;
|
201
|
+
_classPrivateFieldSet(_offset, this, {
|
202
|
+
x,
|
203
|
+
y
|
204
|
+
});
|
205
|
+
}
|
206
|
+
/**
|
207
|
+
* Clamps the coords to make sure they points to the cell (or header) in the table range.
|
208
|
+
*
|
209
|
+
* @param {CellCoords} zeroBasedCoords The coords object to clamp.
|
210
|
+
* @returns {{rowDir: 1|0|-1, colDir: 1|0|-1}}
|
211
|
+
*/
|
232
212
|
function _clampCoords(zeroBasedCoords) {
|
233
213
|
const {
|
234
214
|
width,
|
@@ -267,34 +247,6 @@ function _getTableSize() {
|
|
267
247
|
height: _classPrivateFieldGet(_offset, this).y + _classPrivateFieldGet(_options, this).countRenderableRows()
|
268
248
|
};
|
269
249
|
}
|
270
|
-
/**
|
271
|
-
* Finds the first non-hidden zero-based row in the table range.
|
272
|
-
*
|
273
|
-
* @param {number} visualRowFrom The visual row from which the search should start.
|
274
|
-
* @param {number} visualRowTo The visual row to which the search should end.
|
275
|
-
* @returns {number | null}
|
276
|
-
*/
|
277
|
-
function _findFirstNonHiddenZeroBasedRow(visualRowFrom, visualRowTo) {
|
278
|
-
const row = _classPrivateFieldGet(_options, this).findFirstNonHiddenRenderableRow(visualRowFrom, visualRowTo);
|
279
|
-
if (row === null) {
|
280
|
-
return null;
|
281
|
-
}
|
282
|
-
return _classPrivateFieldGet(_offset, this).y + row;
|
283
|
-
}
|
284
|
-
/**
|
285
|
-
* Finds the first non-hidden zero-based column in the table range.
|
286
|
-
*
|
287
|
-
* @param {number} visualColumnFrom The visual column from which the search should start.
|
288
|
-
* @param {number} visualColumnTo The visual column to which the search should end.
|
289
|
-
* @returns {number | null}
|
290
|
-
*/
|
291
|
-
function _findFirstNonHiddenZeroBasedColumn(visualColumnFrom, visualColumnTo) {
|
292
|
-
const column = _classPrivateFieldGet(_options, this).findFirstNonHiddenRenderableColumn(visualColumnFrom, visualColumnTo);
|
293
|
-
if (column === null) {
|
294
|
-
return null;
|
295
|
-
}
|
296
|
-
return _classPrivateFieldGet(_offset, this).x + column;
|
297
|
-
}
|
298
250
|
/**
|
299
251
|
* Translates the visual coordinates to zero-based ones.
|
300
252
|
*
|
@@ -306,9 +258,6 @@ function _visualToZeroBasedCoords(visualCoords) {
|
|
306
258
|
row,
|
307
259
|
col
|
308
260
|
} = _classPrivateFieldGet(_options, this).visualToRenderableCoords(visualCoords);
|
309
|
-
if (row === null || col === null) {
|
310
|
-
throw new Error('Renderable coords are not visible.');
|
311
|
-
}
|
312
261
|
return _classPrivateFieldGet(_options, this).createCellCoords(_classPrivateFieldGet(_offset, this).y + row, _classPrivateFieldGet(_offset, this).x + col);
|
313
262
|
}
|
314
263
|
/**
|
@@ -3,9 +3,9 @@
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
const command = exports.command = {
|
5
5
|
name: 'editorCloseAndSave',
|
6
|
-
callback(hot, event) {
|
6
|
+
callback(hot, event, keys) {
|
7
7
|
const editorManager = hot._getEditorManager();
|
8
8
|
editorManager.closeEditorAndSaveChanges(event.ctrlKey || event.metaKey);
|
9
|
-
editorManager.moveSelectionAfterEnter(
|
9
|
+
editorManager.moveSelectionAfterEnter(keys.includes('shift'));
|
10
10
|
}
|
11
11
|
};
|
@@ -1,8 +1,8 @@
|
|
1
1
|
export const command = {
|
2
2
|
name: 'editorCloseAndSave',
|
3
|
-
callback(hot, event) {
|
3
|
+
callback(hot, event, keys) {
|
4
4
|
const editorManager = hot._getEditorManager();
|
5
5
|
editorManager.closeEditorAndSaveChanges(event.ctrlKey || event.metaKey);
|
6
|
-
editorManager.moveSelectionAfterEnter(
|
6
|
+
editorManager.moveSelectionAfterEnter(keys.includes('shift'));
|
7
7
|
}
|
8
8
|
};
|
@@ -6,35 +6,20 @@ const command = exports.command = {
|
|
6
6
|
name: 'editorOpen',
|
7
7
|
callback(hot, event, keys) {
|
8
8
|
const editorManager = hot._getEditorManager();
|
9
|
-
const selectedRange = hot.getSelectedRangeLast();
|
10
9
|
const {
|
11
10
|
highlight
|
12
|
-
} =
|
13
|
-
|
14
|
-
// supports for navigating with enter key when multiple cells are selected
|
15
|
-
if (hot.selection.isMultiple() && !selectedRange.isHeader() && hot.countRenderedCols() > 0 && hot.countRenderedRows() > 0) {
|
16
|
-
const settings = hot.getSettings();
|
17
|
-
const enterMoves = typeof settings.enterMoves === 'function' ? settings.enterMoves(event) : settings.enterMoves;
|
18
|
-
if (keys.includes('shift')) {
|
19
|
-
hot.selection.transformFocus(-enterMoves.row, -enterMoves.col);
|
20
|
-
} else {
|
21
|
-
hot.selection.transformFocus(enterMoves.row, enterMoves.col);
|
22
|
-
}
|
23
|
-
return;
|
24
|
-
}
|
11
|
+
} = hot.getSelectedRangeLast();
|
25
12
|
if (highlight.isHeader()) {
|
26
13
|
return;
|
27
14
|
}
|
28
|
-
|
29
|
-
// supports editor opening with enter key
|
30
15
|
if (hot.getSettings().enterBeginsEditing) {
|
31
16
|
if (editorManager.cellProperties.readOnly) {
|
32
|
-
editorManager.moveSelectionAfterEnter(
|
17
|
+
editorManager.moveSelectionAfterEnter();
|
33
18
|
} else {
|
34
19
|
editorManager.openEditor(null, event, true);
|
35
20
|
}
|
36
21
|
} else {
|
37
|
-
editorManager.moveSelectionAfterEnter(
|
22
|
+
editorManager.moveSelectionAfterEnter(keys.includes('shift'));
|
38
23
|
}
|
39
24
|
(0, _event.stopImmediatePropagation)(event); // required by HandsontableEditor
|
40
25
|
}
|
@@ -3,35 +3,20 @@ export const command = {
|
|
3
3
|
name: 'editorOpen',
|
4
4
|
callback(hot, event, keys) {
|
5
5
|
const editorManager = hot._getEditorManager();
|
6
|
-
const selectedRange = hot.getSelectedRangeLast();
|
7
6
|
const {
|
8
7
|
highlight
|
9
|
-
} =
|
10
|
-
|
11
|
-
// supports for navigating with enter key when multiple cells are selected
|
12
|
-
if (hot.selection.isMultiple() && !selectedRange.isHeader() && hot.countRenderedCols() > 0 && hot.countRenderedRows() > 0) {
|
13
|
-
const settings = hot.getSettings();
|
14
|
-
const enterMoves = typeof settings.enterMoves === 'function' ? settings.enterMoves(event) : settings.enterMoves;
|
15
|
-
if (keys.includes('shift')) {
|
16
|
-
hot.selection.transformFocus(-enterMoves.row, -enterMoves.col);
|
17
|
-
} else {
|
18
|
-
hot.selection.transformFocus(enterMoves.row, enterMoves.col);
|
19
|
-
}
|
20
|
-
return;
|
21
|
-
}
|
8
|
+
} = hot.getSelectedRangeLast();
|
22
9
|
if (highlight.isHeader()) {
|
23
10
|
return;
|
24
11
|
}
|
25
|
-
|
26
|
-
// supports editor opening with enter key
|
27
12
|
if (hot.getSettings().enterBeginsEditing) {
|
28
13
|
if (editorManager.cellProperties.readOnly) {
|
29
|
-
editorManager.moveSelectionAfterEnter(
|
14
|
+
editorManager.moveSelectionAfterEnter();
|
30
15
|
} else {
|
31
16
|
editorManager.openEditor(null, event, true);
|
32
17
|
}
|
33
18
|
} else {
|
34
|
-
editorManager.moveSelectionAfterEnter(
|
19
|
+
editorManager.moveSelectionAfterEnter(keys.includes('shift'));
|
35
20
|
}
|
36
21
|
stopImmediatePropagation(event); // required by HandsontableEditor
|
37
22
|
}
|
@@ -7,7 +7,7 @@ const command = exports.command = {
|
|
7
7
|
const {
|
8
8
|
highlight
|
9
9
|
} = hot.getSelectedRangeLast();
|
10
|
-
if (
|
10
|
+
if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
|
11
11
|
hot.selection.transformEnd(1, 0);
|
12
12
|
}
|
13
13
|
}
|
@@ -4,7 +4,7 @@ export const command = {
|
|
4
4
|
const {
|
5
5
|
highlight
|
6
6
|
} = hot.getSelectedRangeLast();
|
7
|
-
if (
|
7
|
+
if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
|
8
8
|
hot.selection.transformEnd(1, 0);
|
9
9
|
}
|
10
10
|
}
|
@@ -7,7 +7,7 @@ const command = exports.command = {
|
|
7
7
|
const {
|
8
8
|
highlight
|
9
9
|
} = hot.getSelectedRangeLast();
|
10
|
-
if (
|
10
|
+
if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
|
11
11
|
hot.selection.transformEnd(0, -1 * hot.getDirectionFactor());
|
12
12
|
}
|
13
13
|
}
|
@@ -4,7 +4,7 @@ export const command = {
|
|
4
4
|
const {
|
5
5
|
highlight
|
6
6
|
} = hot.getSelectedRangeLast();
|
7
|
-
if (
|
7
|
+
if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
|
8
8
|
hot.selection.transformEnd(0, -1 * hot.getDirectionFactor());
|
9
9
|
}
|
10
10
|
}
|
@@ -7,7 +7,7 @@ const command = exports.command = {
|
|
7
7
|
const {
|
8
8
|
highlight
|
9
9
|
} = hot.getSelectedRangeLast();
|
10
|
-
if (
|
10
|
+
if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
|
11
11
|
hot.selection.transformEnd(0, hot.getDirectionFactor());
|
12
12
|
}
|
13
13
|
}
|
@@ -4,7 +4,7 @@ export const command = {
|
|
4
4
|
const {
|
5
5
|
highlight
|
6
6
|
} = hot.getSelectedRangeLast();
|
7
|
-
if (
|
7
|
+
if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
|
8
8
|
hot.selection.transformEnd(0, hot.getDirectionFactor());
|
9
9
|
}
|
10
10
|
}
|
@@ -16,9 +16,7 @@ const command = exports.command = {
|
|
16
16
|
const isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByRowHeader();
|
17
17
|
if (highlight.isCell() || isFocusHighlightedByHeader) {
|
18
18
|
const row = rowIndexMapper.getNearestNotHiddenIndex(hot.countRows() - 1, -1);
|
19
|
-
|
20
|
-
newFrom.row = highlight.row;
|
21
|
-
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
19
|
+
selection.setRangeStart(from.clone());
|
22
20
|
|
23
21
|
// Restore the row highlight by header flag after setting up a new selection.
|
24
22
|
if (isFocusHighlightedByHeader) {
|
@@ -13,9 +13,7 @@ export const command = {
|
|
13
13
|
const isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByRowHeader();
|
14
14
|
if (highlight.isCell() || isFocusHighlightedByHeader) {
|
15
15
|
const row = rowIndexMapper.getNearestNotHiddenIndex(hot.countRows() - 1, -1);
|
16
|
-
|
17
|
-
newFrom.row = highlight.row;
|
18
|
-
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
16
|
+
selection.setRangeStart(from.clone());
|
19
17
|
|
20
18
|
// Restore the row highlight by header flag after setting up a new selection.
|
21
19
|
if (isFocusHighlightedByHeader) {
|
@@ -9,16 +9,10 @@ const command = exports.command = {
|
|
9
9
|
columnIndexMapper
|
10
10
|
} = hot;
|
11
11
|
const {
|
12
|
-
highlight
|
13
|
-
from,
|
14
|
-
to
|
12
|
+
highlight
|
15
13
|
} = hot.getSelectedRangeLast();
|
16
|
-
if (
|
17
|
-
|
18
|
-
const newFrom = from.clone();
|
19
|
-
newFrom.col = highlight.col;
|
20
|
-
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
21
|
-
selection.setRangeEnd(hot._createCellCoords(to.row, column));
|
14
|
+
if (highlight.isCell()) {
|
15
|
+
selection.setRangeEnd(hot._createCellCoords(selection.selectedRange.current().from.row, columnIndexMapper.getNearestNotHiddenIndex(hot.countCols() - 1, -1)));
|
22
16
|
}
|
23
17
|
}
|
24
18
|
};
|
@@ -6,16 +6,10 @@ export const command = {
|
|
6
6
|
columnIndexMapper
|
7
7
|
} = hot;
|
8
8
|
const {
|
9
|
-
highlight
|
10
|
-
from,
|
11
|
-
to
|
9
|
+
highlight
|
12
10
|
} = hot.getSelectedRangeLast();
|
13
|
-
if (
|
14
|
-
|
15
|
-
const newFrom = from.clone();
|
16
|
-
newFrom.col = highlight.col;
|
17
|
-
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
18
|
-
selection.setRangeEnd(hot._createCellCoords(to.row, column));
|
11
|
+
if (highlight.isCell()) {
|
12
|
+
selection.setRangeEnd(hot._createCellCoords(selection.selectedRange.current().from.row, columnIndexMapper.getNearestNotHiddenIndex(hot.countCols() - 1, -1)));
|
19
13
|
}
|
20
14
|
}
|
21
15
|
};
|
@@ -9,17 +9,10 @@ const command = exports.command = {
|
|
9
9
|
columnIndexMapper
|
10
10
|
} = hot;
|
11
11
|
const {
|
12
|
-
highlight
|
13
|
-
from,
|
14
|
-
to
|
12
|
+
highlight
|
15
13
|
} = hot.getSelectedRangeLast();
|
16
|
-
if (
|
17
|
-
|
18
|
-
const column = columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
|
19
|
-
const newFrom = from.clone();
|
20
|
-
newFrom.col = highlight.col;
|
21
|
-
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
22
|
-
selection.setRangeEnd(hot._createCellCoords(to.row, column));
|
14
|
+
if (highlight.isCell()) {
|
15
|
+
selection.setRangeEnd(hot._createCellCoords(selection.selectedRange.current().from.row, columnIndexMapper.getNearestNotHiddenIndex(0, 1)));
|
23
16
|
}
|
24
17
|
}
|
25
18
|
};
|
@@ -6,17 +6,10 @@ export const command = {
|
|
6
6
|
columnIndexMapper
|
7
7
|
} = hot;
|
8
8
|
const {
|
9
|
-
highlight
|
10
|
-
from,
|
11
|
-
to
|
9
|
+
highlight
|
12
10
|
} = hot.getSelectedRangeLast();
|
13
|
-
if (
|
14
|
-
|
15
|
-
const column = columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
|
16
|
-
const newFrom = from.clone();
|
17
|
-
newFrom.col = highlight.col;
|
18
|
-
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
19
|
-
selection.setRangeEnd(hot._createCellCoords(to.row, column));
|
11
|
+
if (highlight.isCell()) {
|
12
|
+
selection.setRangeEnd(hot._createCellCoords(selection.selectedRange.current().from.row, columnIndexMapper.getNearestNotHiddenIndex(0, 1)));
|
20
13
|
}
|
21
14
|
}
|
22
15
|
};
|
@@ -16,9 +16,7 @@ const command = exports.command = {
|
|
16
16
|
const isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByColumnHeader();
|
17
17
|
if (highlight.isCell() || isFocusHighlightedByHeader) {
|
18
18
|
const column = columnIndexMapper.getNearestNotHiddenIndex(...(hot.isRtl() ? [hot.countCols() - 1, -1] : [0, 1]));
|
19
|
-
|
20
|
-
newFrom.col = highlight.col;
|
21
|
-
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
19
|
+
selection.setRangeStart(from.clone());
|
22
20
|
|
23
21
|
// Restore the column highlight by header flag after setting up a new selection.
|
24
22
|
if (isFocusHighlightedByHeader) {
|
@@ -13,9 +13,7 @@ export const command = {
|
|
13
13
|
const isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByColumnHeader();
|
14
14
|
if (highlight.isCell() || isFocusHighlightedByHeader) {
|
15
15
|
const column = columnIndexMapper.getNearestNotHiddenIndex(...(hot.isRtl() ? [hot.countCols() - 1, -1] : [0, 1]));
|
16
|
-
|
17
|
-
newFrom.col = highlight.col;
|
18
|
-
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
16
|
+
selection.setRangeStart(from.clone());
|
19
17
|
|
20
18
|
// Restore the column highlight by header flag after setting up a new selection.
|
21
19
|
if (isFocusHighlightedByHeader) {
|
@@ -16,9 +16,7 @@ const command = exports.command = {
|
|
16
16
|
const isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByColumnHeader();
|
17
17
|
if (highlight.isCell() || isFocusHighlightedByHeader) {
|
18
18
|
const column = columnIndexMapper.getNearestNotHiddenIndex(...(hot.isRtl() ? [0, 1] : [hot.countCols() - 1, -1]));
|
19
|
-
|
20
|
-
newFrom.col = highlight.col;
|
21
|
-
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
19
|
+
selection.setRangeStart(from.clone());
|
22
20
|
|
23
21
|
// Restore the column highlight by header flag after setting up a new selection.
|
24
22
|
if (isFocusHighlightedByHeader) {
|
@@ -13,9 +13,7 @@ export const command = {
|
|
13
13
|
const isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByColumnHeader();
|
14
14
|
if (highlight.isCell() || isFocusHighlightedByHeader) {
|
15
15
|
const column = columnIndexMapper.getNearestNotHiddenIndex(...(hot.isRtl() ? [0, 1] : [hot.countCols() - 1, -1]));
|
16
|
-
|
17
|
-
newFrom.col = highlight.col;
|
18
|
-
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
16
|
+
selection.setRangeStart(from.clone());
|
19
17
|
|
20
18
|
// Restore the column highlight by header flag after setting up a new selection.
|
21
19
|
if (isFocusHighlightedByHeader) {
|
@@ -16,9 +16,7 @@ const command = exports.command = {
|
|
16
16
|
const isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByRowHeader();
|
17
17
|
if (highlight.isCell() || isFocusHighlightedByHeader) {
|
18
18
|
const row = rowIndexMapper.getNearestNotHiddenIndex(0, 1);
|
19
|
-
|
20
|
-
newFrom.row = highlight.row;
|
21
|
-
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
19
|
+
selection.setRangeStart(from.clone());
|
22
20
|
|
23
21
|
// Restore the row highlight by header flag after setting up a new selection.
|
24
22
|
if (isFocusHighlightedByHeader) {
|
@@ -13,9 +13,7 @@ export const command = {
|
|
13
13
|
const isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByRowHeader();
|
14
14
|
if (highlight.isCell() || isFocusHighlightedByHeader) {
|
15
15
|
const row = rowIndexMapper.getNearestNotHiddenIndex(0, 1);
|
16
|
-
|
17
|
-
newFrom.row = highlight.row;
|
18
|
-
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
16
|
+
selection.setRangeStart(from.clone());
|
19
17
|
|
20
18
|
// Restore the row highlight by header flag after setting up a new selection.
|
21
19
|
if (isFocusHighlightedByHeader) {
|
@@ -7,7 +7,7 @@ const command = exports.command = {
|
|
7
7
|
const {
|
8
8
|
highlight
|
9
9
|
} = hot.getSelectedRangeLast();
|
10
|
-
if (
|
10
|
+
if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
|
11
11
|
hot.selection.transformEnd(-1, 0);
|
12
12
|
}
|
13
13
|
}
|
@@ -4,7 +4,7 @@ export const command = {
|
|
4
4
|
const {
|
5
5
|
highlight
|
6
6
|
} = hot.getSelectedRangeLast();
|
7
|
-
if (
|
7
|
+
if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
|
8
8
|
hot.selection.transformEnd(-1, 0);
|
9
9
|
}
|
10
10
|
}
|
@@ -5,12 +5,7 @@ const command = exports.command = {
|
|
5
5
|
name: 'moveCellSelectionInlineEnd',
|
6
6
|
callback(hot, event) {
|
7
7
|
const settings = hot.getSettings();
|
8
|
-
const selectedRange = hot.getSelectedRangeLast();
|
9
8
|
const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
|
10
|
-
|
11
|
-
hot.selection.transformFocus(-tabMoves.row, -tabMoves.col);
|
12
|
-
} else {
|
13
|
-
hot.selection.transformStart(-tabMoves.row, -tabMoves.col);
|
14
|
-
}
|
9
|
+
hot.selection.transformStart(-tabMoves.row, -tabMoves.col);
|
15
10
|
}
|
16
11
|
};
|
@@ -2,12 +2,7 @@ export const command = {
|
|
2
2
|
name: 'moveCellSelectionInlineEnd',
|
3
3
|
callback(hot, event) {
|
4
4
|
const settings = hot.getSettings();
|
5
|
-
const selectedRange = hot.getSelectedRangeLast();
|
6
5
|
const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
|
7
|
-
|
8
|
-
hot.selection.transformFocus(-tabMoves.row, -tabMoves.col);
|
9
|
-
} else {
|
10
|
-
hot.selection.transformStart(-tabMoves.row, -tabMoves.col);
|
11
|
-
}
|
6
|
+
hot.selection.transformStart(-tabMoves.row, -tabMoves.col);
|
12
7
|
}
|
13
8
|
};
|
@@ -5,12 +5,7 @@ const command = exports.command = {
|
|
5
5
|
name: 'moveCellSelectionInlineStart',
|
6
6
|
callback(hot, event) {
|
7
7
|
const settings = hot.getSettings();
|
8
|
-
const selectedRange = hot.getSelectedRangeLast();
|
9
8
|
const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
|
10
|
-
|
11
|
-
hot.selection.transformFocus(tabMoves.row, tabMoves.col);
|
12
|
-
} else {
|
13
|
-
hot.selection.transformStart(tabMoves.row, tabMoves.col);
|
14
|
-
}
|
9
|
+
hot.selection.transformStart(tabMoves.row, tabMoves.col);
|
15
10
|
}
|
16
11
|
};
|
@@ -2,12 +2,7 @@ export const command = {
|
|
2
2
|
name: 'moveCellSelectionInlineStart',
|
3
3
|
callback(hot, event) {
|
4
4
|
const settings = hot.getSettings();
|
5
|
-
const selectedRange = hot.getSelectedRangeLast();
|
6
5
|
const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
|
7
|
-
|
8
|
-
hot.selection.transformFocus(tabMoves.row, tabMoves.col);
|
9
|
-
} else {
|
10
|
-
hot.selection.transformStart(tabMoves.row, tabMoves.col);
|
11
|
-
}
|
6
|
+
hot.selection.transformStart(tabMoves.row, tabMoves.col);
|
12
7
|
}
|
13
8
|
};
|