handsontable 0.0.0-next-612100d-20240219 → 0.0.0-next-d96e9b5-20240220
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 -0
- package/3rdparty/walkontable/src/cell/range.js +12 -0
- package/3rdparty/walkontable/src/cell/range.mjs +12 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/viewportScroll/index.js +4 -1
- package/core/viewportScroll/index.mjs +4 -1
- package/core/viewportScroll/scrollStrategies/focusScroll.js +15 -0
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +11 -0
- package/core.js +14 -0
- package/core.mjs +14 -0
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +1606 -1328
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +151 -151
- package/dist/handsontable.js +1606 -1328
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +19 -19
- package/editorManager.js +12 -8
- package/editorManager.mjs +12 -8
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +1 -1
- package/pluginHooks.d.ts +1 -0
- package/pluginHooks.js +43 -1
- package/pluginHooks.mjs +43 -1
- package/plugins/collapsibleColumns/collapsibleColumns.js +7 -1
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +7 -1
- package/plugins/columnSorting/columnSorting.js +6 -0
- package/plugins/columnSorting/columnSorting.mjs +6 -0
- package/plugins/contextMenu/menu/defaultShortcutsList.js +26 -10
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +26 -10
- package/plugins/mergeCells/calculations/selection.js +1 -70
- package/plugins/mergeCells/calculations/selection.mjs +1 -70
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +11 -1
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +11 -1
- package/plugins/mergeCells/mergeCells.js +182 -207
- package/plugins/mergeCells/mergeCells.mjs +182 -207
- package/plugins/multiColumnSorting/multiColumnSorting.js +6 -0
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +6 -0
- package/plugins/nestedHeaders/nestedHeaders.js +1 -0
- package/plugins/nestedHeaders/nestedHeaders.mjs +1 -0
- package/plugins/nestedRows/nestedRows.js +7 -1
- package/plugins/nestedRows/nestedRows.mjs +7 -1
- package/renderers/checkboxRenderer/checkboxRenderer.js +4 -4
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +4 -4
- package/selection/highlight/visualSelection.js +2 -0
- package/selection/highlight/visualSelection.mjs +2 -0
- package/selection/selection.js +195 -34
- package/selection/selection.mjs +194 -33
- package/selection/transformation.js +45 -30
- package/selection/transformation.mjs +45 -30
- package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
- package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
- package/shortcutContexts/commands/editor/open.js +18 -3
- package/shortcutContexts/commands/editor/open.mjs +18 -3
- 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 +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +9 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +9 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +10 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +10 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +3 -1
- 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 +6 -1
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +6 -1
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +6 -1
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +6 -1
- package/shortcutContexts/grid.js +2 -2
- package/shortcutContexts/grid.mjs +2 -2
- package/shortcuts/context.js +2 -1
- package/shortcuts/context.mjs +2 -1
@@ -6,20 +6,35 @@ 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();
|
9
10
|
const {
|
10
11
|
highlight
|
11
|
-
} =
|
12
|
+
} = selectedRange;
|
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
|
+
}
|
12
25
|
if (highlight.isHeader()) {
|
13
26
|
return;
|
14
27
|
}
|
28
|
+
|
29
|
+
// supports editor opening with enter key
|
15
30
|
if (hot.getSettings().enterBeginsEditing) {
|
16
31
|
if (editorManager.cellProperties.readOnly) {
|
17
|
-
editorManager.moveSelectionAfterEnter();
|
32
|
+
editorManager.moveSelectionAfterEnter(event);
|
18
33
|
} else {
|
19
34
|
editorManager.openEditor(null, event, true);
|
20
35
|
}
|
21
36
|
} else {
|
22
|
-
editorManager.moveSelectionAfterEnter(
|
37
|
+
editorManager.moveSelectionAfterEnter(event);
|
23
38
|
}
|
24
39
|
(0, _event.stopImmediatePropagation)(event); // required by HandsontableEditor
|
25
40
|
}
|
@@ -3,20 +3,35 @@ export const command = {
|
|
3
3
|
name: 'editorOpen',
|
4
4
|
callback(hot, event, keys) {
|
5
5
|
const editorManager = hot._getEditorManager();
|
6
|
+
const selectedRange = hot.getSelectedRangeLast();
|
6
7
|
const {
|
7
8
|
highlight
|
8
|
-
} =
|
9
|
+
} = selectedRange;
|
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
|
+
}
|
9
22
|
if (highlight.isHeader()) {
|
10
23
|
return;
|
11
24
|
}
|
25
|
+
|
26
|
+
// supports editor opening with enter key
|
12
27
|
if (hot.getSettings().enterBeginsEditing) {
|
13
28
|
if (editorManager.cellProperties.readOnly) {
|
14
|
-
editorManager.moveSelectionAfterEnter();
|
29
|
+
editorManager.moveSelectionAfterEnter(event);
|
15
30
|
} else {
|
16
31
|
editorManager.openEditor(null, event, true);
|
17
32
|
}
|
18
33
|
} else {
|
19
|
-
editorManager.moveSelectionAfterEnter(
|
34
|
+
editorManager.moveSelectionAfterEnter(event);
|
20
35
|
}
|
21
36
|
stopImmediatePropagation(event); // required by HandsontableEditor
|
22
37
|
}
|
@@ -7,7 +7,7 @@ const command = exports.command = {
|
|
7
7
|
const {
|
8
8
|
highlight
|
9
9
|
} = hot.getSelectedRangeLast();
|
10
|
-
if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
|
10
|
+
if (!hot.selection.isSelectedByColumnHeader() && !hot.selection.isSelectedByCorner() && (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 (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
|
7
|
+
if (!hot.selection.isSelectedByColumnHeader() && !hot.selection.isSelectedByCorner() && (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 (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
|
10
|
+
if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && (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 (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
|
7
|
+
if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && (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 (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
|
10
|
+
if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && (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 (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
|
7
|
+
if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader())) {
|
8
8
|
hot.selection.transformEnd(0, hot.getDirectionFactor());
|
9
9
|
}
|
10
10
|
}
|
@@ -16,7 +16,9 @@ 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
|
-
|
19
|
+
const newFrom = from.clone();
|
20
|
+
newFrom.row = highlight.row;
|
21
|
+
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
20
22
|
|
21
23
|
// Restore the row highlight by header flag after setting up a new selection.
|
22
24
|
if (isFocusHighlightedByHeader) {
|
@@ -13,7 +13,9 @@ 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
|
-
|
16
|
+
const newFrom = from.clone();
|
17
|
+
newFrom.row = highlight.row;
|
18
|
+
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
17
19
|
|
18
20
|
// Restore the row highlight by header flag after setting up a new selection.
|
19
21
|
if (isFocusHighlightedByHeader) {
|
@@ -9,10 +9,16 @@ const command = exports.command = {
|
|
9
9
|
columnIndexMapper
|
10
10
|
} = hot;
|
11
11
|
const {
|
12
|
-
highlight
|
12
|
+
highlight,
|
13
|
+
from,
|
14
|
+
to
|
13
15
|
} = hot.getSelectedRangeLast();
|
14
|
-
if (highlight.isCell()) {
|
15
|
-
|
16
|
+
if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && highlight.isCell()) {
|
17
|
+
const column = columnIndexMapper.getNearestNotHiddenIndex(hot.countCols() - 1, -1);
|
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));
|
16
22
|
}
|
17
23
|
}
|
18
24
|
};
|
@@ -6,10 +6,16 @@ export const command = {
|
|
6
6
|
columnIndexMapper
|
7
7
|
} = hot;
|
8
8
|
const {
|
9
|
-
highlight
|
9
|
+
highlight,
|
10
|
+
from,
|
11
|
+
to
|
10
12
|
} = hot.getSelectedRangeLast();
|
11
|
-
if (highlight.isCell()) {
|
12
|
-
|
13
|
+
if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && highlight.isCell()) {
|
14
|
+
const column = columnIndexMapper.getNearestNotHiddenIndex(hot.countCols() - 1, -1);
|
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));
|
13
19
|
}
|
14
20
|
}
|
15
21
|
};
|
@@ -9,10 +9,17 @@ const command = exports.command = {
|
|
9
9
|
columnIndexMapper
|
10
10
|
} = hot;
|
11
11
|
const {
|
12
|
-
highlight
|
12
|
+
highlight,
|
13
|
+
from,
|
14
|
+
to
|
13
15
|
} = hot.getSelectedRangeLast();
|
14
|
-
if (highlight.isCell()) {
|
15
|
-
|
16
|
+
if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && highlight.isCell()) {
|
17
|
+
const fixedColumns = parseInt(hot.getSettings().fixedColumnsStart, 10);
|
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));
|
16
23
|
}
|
17
24
|
}
|
18
25
|
};
|
@@ -6,10 +6,17 @@ export const command = {
|
|
6
6
|
columnIndexMapper
|
7
7
|
} = hot;
|
8
8
|
const {
|
9
|
-
highlight
|
9
|
+
highlight,
|
10
|
+
from,
|
11
|
+
to
|
10
12
|
} = hot.getSelectedRangeLast();
|
11
|
-
if (highlight.isCell()) {
|
12
|
-
|
13
|
+
if (!hot.selection.isSelectedByRowHeader() && !hot.selection.isSelectedByCorner() && highlight.isCell()) {
|
14
|
+
const fixedColumns = parseInt(hot.getSettings().fixedColumnsStart, 10);
|
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));
|
13
20
|
}
|
14
21
|
}
|
15
22
|
};
|
@@ -16,7 +16,9 @@ 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
|
-
|
19
|
+
const newFrom = from.clone();
|
20
|
+
newFrom.col = highlight.col;
|
21
|
+
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
20
22
|
|
21
23
|
// Restore the column highlight by header flag after setting up a new selection.
|
22
24
|
if (isFocusHighlightedByHeader) {
|
@@ -13,7 +13,9 @@ 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
|
-
|
16
|
+
const newFrom = from.clone();
|
17
|
+
newFrom.col = highlight.col;
|
18
|
+
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
17
19
|
|
18
20
|
// Restore the column highlight by header flag after setting up a new selection.
|
19
21
|
if (isFocusHighlightedByHeader) {
|
@@ -16,7 +16,9 @@ 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
|
-
|
19
|
+
const newFrom = from.clone();
|
20
|
+
newFrom.col = highlight.col;
|
21
|
+
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
20
22
|
|
21
23
|
// Restore the column highlight by header flag after setting up a new selection.
|
22
24
|
if (isFocusHighlightedByHeader) {
|
@@ -13,7 +13,9 @@ 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
|
-
|
16
|
+
const newFrom = from.clone();
|
17
|
+
newFrom.col = highlight.col;
|
18
|
+
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
17
19
|
|
18
20
|
// Restore the column highlight by header flag after setting up a new selection.
|
19
21
|
if (isFocusHighlightedByHeader) {
|
@@ -16,7 +16,9 @@ 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
|
-
|
19
|
+
const newFrom = from.clone();
|
20
|
+
newFrom.row = highlight.row;
|
21
|
+
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
20
22
|
|
21
23
|
// Restore the row highlight by header flag after setting up a new selection.
|
22
24
|
if (isFocusHighlightedByHeader) {
|
@@ -13,7 +13,9 @@ 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
|
-
|
16
|
+
const newFrom = from.clone();
|
17
|
+
newFrom.row = highlight.row;
|
18
|
+
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
17
19
|
|
18
20
|
// Restore the row highlight by header flag after setting up a new selection.
|
19
21
|
if (isFocusHighlightedByHeader) {
|
@@ -7,7 +7,7 @@ const command = exports.command = {
|
|
7
7
|
const {
|
8
8
|
highlight
|
9
9
|
} = hot.getSelectedRangeLast();
|
10
|
-
if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
|
10
|
+
if (!hot.selection.isSelectedByColumnHeader() && !hot.selection.isSelectedByCorner() && (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 (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
|
7
|
+
if (!hot.selection.isSelectedByColumnHeader() && !hot.selection.isSelectedByCorner() && (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader())) {
|
8
8
|
hot.selection.transformEnd(-1, 0);
|
9
9
|
}
|
10
10
|
}
|
@@ -5,7 +5,12 @@ const command = exports.command = {
|
|
5
5
|
name: 'moveCellSelectionInlineEnd',
|
6
6
|
callback(hot, event) {
|
7
7
|
const settings = hot.getSettings();
|
8
|
+
const selectedRange = hot.getSelectedRangeLast();
|
8
9
|
const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
|
9
|
-
hot.selection.
|
10
|
+
if (hot.selection.isMultiple() && !selectedRange.isHeader() && hot.countRenderedCols() > 0 && hot.countRenderedRows() > 0) {
|
11
|
+
hot.selection.transformFocus(-tabMoves.row, -tabMoves.col);
|
12
|
+
} else {
|
13
|
+
hot.selection.transformStart(-tabMoves.row, -tabMoves.col);
|
14
|
+
}
|
10
15
|
}
|
11
16
|
};
|
@@ -2,7 +2,12 @@ export const command = {
|
|
2
2
|
name: 'moveCellSelectionInlineEnd',
|
3
3
|
callback(hot, event) {
|
4
4
|
const settings = hot.getSettings();
|
5
|
+
const selectedRange = hot.getSelectedRangeLast();
|
5
6
|
const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
|
6
|
-
hot.selection.
|
7
|
+
if (hot.selection.isMultiple() && !selectedRange.isHeader() && hot.countRenderedCols() > 0 && hot.countRenderedRows() > 0) {
|
8
|
+
hot.selection.transformFocus(-tabMoves.row, -tabMoves.col);
|
9
|
+
} else {
|
10
|
+
hot.selection.transformStart(-tabMoves.row, -tabMoves.col);
|
11
|
+
}
|
7
12
|
}
|
8
13
|
};
|
@@ -5,7 +5,12 @@ const command = exports.command = {
|
|
5
5
|
name: 'moveCellSelectionInlineStart',
|
6
6
|
callback(hot, event) {
|
7
7
|
const settings = hot.getSettings();
|
8
|
+
const selectedRange = hot.getSelectedRangeLast();
|
8
9
|
const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
|
9
|
-
hot.selection.
|
10
|
+
if (hot.selection.isMultiple() && !selectedRange.isHeader() && hot.countRenderedCols() > 0 && hot.countRenderedRows() > 0) {
|
11
|
+
hot.selection.transformFocus(tabMoves.row, tabMoves.col);
|
12
|
+
} else {
|
13
|
+
hot.selection.transformStart(tabMoves.row, tabMoves.col);
|
14
|
+
}
|
10
15
|
}
|
11
16
|
};
|
@@ -2,7 +2,12 @@ export const command = {
|
|
2
2
|
name: 'moveCellSelectionInlineStart',
|
3
3
|
callback(hot, event) {
|
4
4
|
const settings = hot.getSettings();
|
5
|
+
const selectedRange = hot.getSelectedRangeLast();
|
5
6
|
const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
|
6
|
-
hot.selection.
|
7
|
+
if (hot.selection.isMultiple() && !selectedRange.isHeader() && hot.countRenderedCols() > 0 && hot.countRenderedRows() > 0) {
|
8
|
+
hot.selection.transformFocus(tabMoves.row, tabMoves.col);
|
9
|
+
} else {
|
10
|
+
hot.selection.transformStart(tabMoves.row, tabMoves.col);
|
11
|
+
}
|
7
12
|
}
|
8
13
|
};
|
package/shortcutContexts/grid.js
CHANGED
@@ -157,12 +157,12 @@ function shortcutsGridContext(hot) {
|
|
157
157
|
keys: [['Tab']],
|
158
158
|
// The property value is controlled by focusCatcher module (https://github.com/handsontable/handsontable/blob/master/handsontable/src/core/focusCatcher/index.js)
|
159
159
|
preventDefault: false,
|
160
|
-
callback:
|
160
|
+
callback: event => commandsPool.moveCellSelectionInlineStart(event)
|
161
161
|
}, {
|
162
162
|
keys: [['Shift', 'Tab']],
|
163
163
|
// The property value is controlled by focusCatcher module (https://github.com/handsontable/handsontable/blob/master/handsontable/src/core/focusCatcher/index.js)
|
164
164
|
preventDefault: false,
|
165
|
-
callback:
|
165
|
+
callback: event => commandsPool.moveCellSelectionInlineEnd(event)
|
166
166
|
}, {
|
167
167
|
keys: [['Control/Meta', 'Backspace']],
|
168
168
|
callback: () => commandsPool.scrollToFocusedCell()
|
@@ -153,12 +153,12 @@ export function shortcutsGridContext(hot) {
|
|
153
153
|
keys: [['Tab']],
|
154
154
|
// The property value is controlled by focusCatcher module (https://github.com/handsontable/handsontable/blob/master/handsontable/src/core/focusCatcher/index.js)
|
155
155
|
preventDefault: false,
|
156
|
-
callback:
|
156
|
+
callback: event => commandsPool.moveCellSelectionInlineStart(event)
|
157
157
|
}, {
|
158
158
|
keys: [['Shift', 'Tab']],
|
159
159
|
// The property value is controlled by focusCatcher module (https://github.com/handsontable/handsontable/blob/master/handsontable/src/core/focusCatcher/index.js)
|
160
160
|
preventDefault: false,
|
161
|
-
callback:
|
161
|
+
callback: event => commandsPool.moveCellSelectionInlineEnd(event)
|
162
162
|
}, {
|
163
163
|
keys: [['Control/Meta', 'Backspace']],
|
164
164
|
callback: () => commandsPool.scrollToFocusedCell()
|
package/shortcuts/context.js
CHANGED
@@ -90,7 +90,8 @@ const createContext = name => {
|
|
90
90
|
stopPropagation
|
91
91
|
};
|
92
92
|
if ((0, _mixed.isDefined)(relativeToGroup)) {
|
93
|
-
|
93
|
+
newShortcut.relativeToGroup = relativeToGroup;
|
94
|
+
newShortcut.position = position;
|
94
95
|
}
|
95
96
|
if (isContextObject(forwardToContext)) {
|
96
97
|
newShortcut.forwardToContext = forwardToContext;
|
package/shortcuts/context.mjs
CHANGED
@@ -86,7 +86,8 @@ export const createContext = name => {
|
|
86
86
|
stopPropagation
|
87
87
|
};
|
88
88
|
if (isDefined(relativeToGroup)) {
|
89
|
-
|
89
|
+
newShortcut.relativeToGroup = relativeToGroup;
|
90
|
+
newShortcut.position = position;
|
90
91
|
}
|
91
92
|
if (isContextObject(forwardToContext)) {
|
92
93
|
newShortcut.forwardToContext = forwardToContext;
|