handsontable 0.0.0-next-06a64be-20230621 → 0.0.0-next-d1c8e0e-20230621
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/cell/coords.d.ts +6 -1
- package/3rdparty/walkontable/src/cell/coords.js +61 -12
- package/3rdparty/walkontable/src/cell/coords.mjs +61 -12
- package/3rdparty/walkontable/src/cell/range.d.ts +9 -2
- package/3rdparty/walkontable/src/cell/range.js +44 -7
- package/3rdparty/walkontable/src/cell/range.mjs +44 -7
- package/3rdparty/walkontable/src/core/_base.js +9 -3
- package/3rdparty/walkontable/src/core/_base.mjs +9 -3
- package/3rdparty/walkontable/src/core/clone.js +2 -2
- package/3rdparty/walkontable/src/core/clone.mjs +2 -2
- package/3rdparty/walkontable/src/core/core.js +3 -2
- package/3rdparty/walkontable/src/core/core.mjs +3 -2
- package/3rdparty/walkontable/src/event.js +7 -7
- package/3rdparty/walkontable/src/event.mjs +7 -7
- package/3rdparty/walkontable/src/facade/core.js +2 -2
- package/3rdparty/walkontable/src/facade/core.mjs +2 -2
- package/3rdparty/walkontable/src/index.js +10 -2
- package/3rdparty/walkontable/src/index.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/_base.js +1 -1
- package/3rdparty/walkontable/src/overlay/_base.mjs +1 -1
- package/3rdparty/walkontable/src/overlay/inlineStart.js +2 -4
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -4
- package/3rdparty/walkontable/src/overlay/top.js +2 -4
- package/3rdparty/walkontable/src/overlay/top.mjs +2 -4
- package/3rdparty/walkontable/src/{border.js → selection/border/border.js} +7 -12
- package/3rdparty/walkontable/src/{border.mjs → selection/border/border.mjs} +7 -12
- package/3rdparty/walkontable/src/selection/border/constants.js +18 -0
- package/3rdparty/walkontable/src/selection/border/constants.mjs +13 -0
- package/3rdparty/walkontable/src/selection/constants.js +63 -0
- package/3rdparty/walkontable/src/selection/constants.mjs +51 -0
- package/3rdparty/walkontable/src/selection/index.js +30 -0
- package/3rdparty/walkontable/src/selection/index.mjs +5 -0
- package/3rdparty/walkontable/src/selection/manager.js +329 -0
- package/3rdparty/walkontable/src/selection/manager.mjs +323 -0
- package/3rdparty/walkontable/src/selection/scanner.js +364 -0
- package/3rdparty/walkontable/src/selection/scanner.mjs +360 -0
- package/3rdparty/walkontable/src/selection/selection.js +133 -0
- package/3rdparty/walkontable/src/selection/selection.mjs +127 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +9 -0
- package/3rdparty/walkontable/src/table.js +7 -79
- package/3rdparty/walkontable/src/table.mjs +8 -80
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.d.ts +5 -3
- package/core.js +127 -309
- package/core.mjs +127 -309
- package/dataMap/metaManager/metaSchema.js +19 -0
- package/dataMap/metaManager/metaSchema.mjs +19 -0
- package/dist/handsontable.css +8 -3
- package/dist/handsontable.full.css +8 -3
- package/dist/handsontable.full.js +13658 -10651
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +112 -112
- package/dist/handsontable.js +16566 -13559
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +4 -4
- package/editorManager.js +21 -94
- package/editorManager.mjs +26 -98
- package/editors/textEditor/textEditor.js +3 -11
- package/editors/textEditor/textEditor.mjs +4 -12
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/number.d.ts +1 -0
- package/helpers/number.js +18 -0
- package/helpers/number.mjs +17 -0
- package/package.json +1 -1
- package/pluginHooks.d.ts +5 -1
- package/pluginHooks.js +89 -1
- package/pluginHooks.mjs +89 -1
- package/plugins/collapsibleColumns/collapsibleColumns.js +81 -24
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +81 -24
- package/plugins/columnSorting/columnSorting.js +50 -8
- package/plugins/columnSorting/columnSorting.mjs +49 -9
- package/plugins/columnSorting/index.js +4 -2
- package/plugins/columnSorting/index.mjs +1 -1
- package/plugins/comments/comments.js +11 -4
- package/plugins/comments/comments.mjs +11 -4
- package/plugins/contextMenu/contextMenu.d.ts +1 -1
- package/plugins/contextMenu/contextMenu.js +80 -29
- package/plugins/contextMenu/contextMenu.mjs +81 -30
- package/plugins/contextMenu/predefinedItems/alignment.js +7 -0
- package/plugins/contextMenu/predefinedItems/alignment.mjs +7 -0
- package/plugins/contextMenu/predefinedItems/clearColumn.js +5 -3
- package/plugins/contextMenu/predefinedItems/clearColumn.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.js +5 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/columnRight.js +5 -3
- package/plugins/contextMenu/predefinedItems/columnRight.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/readOnly.js +7 -0
- package/plugins/contextMenu/predefinedItems/readOnly.mjs +7 -0
- package/plugins/contextMenu/predefinedItems/removeColumn.js +7 -5
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/removeRow.js +7 -5
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.js +5 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.js +5 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.mjs +5 -3
- package/plugins/contextMenu/utils.js +25 -16
- package/plugins/contextMenu/utils.mjs +24 -15
- package/plugins/copyPaste/contextMenuItem/copy.js +7 -0
- package/plugins/copyPaste/contextMenuItem/copy.mjs +7 -0
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/cut.js +7 -0
- package/plugins/copyPaste/contextMenuItem/cut.mjs +7 -0
- package/plugins/copyPaste/copyPaste.js +5 -1
- package/plugins/copyPaste/copyPaste.mjs +5 -1
- package/plugins/customBorders/customBorders.js +25 -53
- package/plugins/customBorders/customBorders.mjs +26 -54
- package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
- package/plugins/dropdownMenu/dropdownMenu.js +94 -30
- package/plugins/dropdownMenu/dropdownMenu.mjs +94 -30
- package/plugins/filters/filters.js +62 -42
- package/plugins/filters/filters.mjs +61 -41
- package/plugins/mergeCells/mergeCells.js +5 -18
- package/plugins/mergeCells/mergeCells.mjs +5 -18
- package/plugins/multiColumnSorting/multiColumnSorting.js +42 -3
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +42 -3
- package/plugins/nestedHeaders/nestedHeaders.js +132 -10
- package/plugins/nestedHeaders/nestedHeaders.mjs +132 -10
- package/plugins/nestedHeaders/stateManager/index.js +37 -0
- package/plugins/nestedHeaders/stateManager/index.mjs +37 -0
- package/plugins/nestedRows/nestedRows.js +52 -7
- package/plugins/nestedRows/nestedRows.mjs +52 -7
- package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
- package/selection/highlight/highlight.js +312 -89
- package/selection/highlight/highlight.mjs +302 -85
- package/selection/highlight/types/activeHeader.js +10 -9
- package/selection/highlight/types/activeHeader.mjs +10 -8
- package/selection/highlight/types/area.js +12 -27
- package/selection/highlight/types/area.mjs +16 -30
- package/selection/highlight/types/areaLayered.js +54 -0
- package/selection/highlight/types/areaLayered.mjs +49 -0
- package/selection/highlight/types/column.js +50 -0
- package/selection/highlight/types/column.mjs +45 -0
- package/selection/highlight/types/customSelection.js +7 -10
- package/selection/highlight/types/customSelection.mjs +7 -9
- package/selection/highlight/types/fill.js +5 -8
- package/selection/highlight/types/fill.mjs +5 -7
- package/selection/highlight/types/{cell.js → focus.js} +5 -8
- package/selection/highlight/types/{cell.mjs → focus.mjs} +5 -7
- package/selection/highlight/types/header.js +10 -20
- package/selection/highlight/types/header.mjs +10 -19
- package/selection/highlight/types/{index.js → row.js} +27 -31
- package/selection/highlight/types/{index.mjs → row.mjs} +24 -29
- package/selection/highlight/visualSelection.js +31 -27
- package/selection/highlight/visualSelection.mjs +31 -27
- package/selection/index.js +4 -7
- package/selection/index.mjs +2 -3
- package/selection/mouseEventHandler.js +1 -1
- package/selection/mouseEventHandler.mjs +1 -1
- package/selection/range.js +8 -8
- package/selection/range.mjs +8 -8
- package/selection/selection.js +315 -181
- package/selection/selection.mjs +310 -180
- package/selection/transformation.js +233 -96
- package/selection/transformation.mjs +230 -93
- package/selection/utils.js +12 -36
- package/selection/utils.mjs +13 -36
- package/settings.d.ts +1 -0
- package/shortcutContexts/commands/editor/closeAndSave.js +15 -0
- package/shortcutContexts/commands/editor/closeAndSave.mjs +10 -0
- package/shortcutContexts/commands/editor/closeWithoutSaving.js +13 -0
- package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +8 -0
- package/shortcutContexts/commands/editor/fastOpen.js +16 -0
- package/shortcutContexts/commands/editor/fastOpen.mjs +11 -0
- package/shortcutContexts/commands/editor/index.js +16 -0
- package/shortcutContexts/commands/editor/index.mjs +12 -0
- package/shortcutContexts/commands/editor/open.js +29 -0
- package/shortcutContexts/commands/editor/open.mjs +24 -0
- package/shortcutContexts/commands/emptySelectedCells.js +12 -0
- package/shortcutContexts/commands/emptySelectedCells.mjs +7 -0
- package/shortcutContexts/commands/extendCellsSelection/down.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +10 -0
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +21 -0
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +16 -0
- package/shortcutContexts/commands/extendCellsSelection/index.js +26 -0
- package/shortcutContexts/commands/extendCellsSelection/index.mjs +22 -0
- package/shortcutContexts/commands/extendCellsSelection/left.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +10 -0
- package/shortcutContexts/commands/extendCellsSelection/right.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +10 -0
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +14 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +22 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +17 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +17 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +12 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +17 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +12 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +40 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +35 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +40 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +35 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +22 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +17 -0
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +14 -0
- package/shortcutContexts/commands/extendCellsSelection/up.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +10 -0
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +21 -0
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +16 -0
- package/shortcutContexts/commands/index.js +52 -0
- package/shortcutContexts/commands/index.mjs +48 -0
- package/shortcutContexts/commands/moveCellSelection/down.js +12 -0
- package/shortcutContexts/commands/moveCellSelection/down.mjs +7 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +29 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +24 -0
- package/shortcutContexts/commands/moveCellSelection/index.js +28 -0
- package/shortcutContexts/commands/moveCellSelection/index.mjs +24 -0
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/left.js +11 -0
- package/shortcutContexts/commands/moveCellSelection/left.mjs +6 -0
- package/shortcutContexts/commands/moveCellSelection/right.js +11 -0
- package/shortcutContexts/commands/moveCellSelection/right.mjs +6 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +16 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +11 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +12 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +16 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +11 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +36 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +31 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +36 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +31 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +16 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +11 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +18 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +13 -0
- package/shortcutContexts/commands/moveCellSelection/up.js +12 -0
- package/shortcutContexts/commands/moveCellSelection/up.mjs +7 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +29 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +24 -0
- package/shortcutContexts/commands/populateSelectedCellsData.js +35 -0
- package/shortcutContexts/commands/populateSelectedCellsData.mjs +30 -0
- package/shortcutContexts/commands/selectAll.js +11 -0
- package/shortcutContexts/commands/selectAll.mjs +6 -0
- package/shortcutContexts/constants.js +19 -0
- package/shortcutContexts/constants.mjs +12 -0
- package/shortcutContexts/editor.js +29 -0
- package/shortcutContexts/editor.mjs +25 -0
- package/shortcutContexts/grid.js +247 -0
- package/shortcutContexts/grid.mjs +243 -0
- package/shortcutContexts/index.js +29 -0
- package/shortcutContexts/index.mjs +15 -0
- package/shortcuts/manager.js +2 -0
- package/shortcuts/manager.mjs +2 -0
- package/shortcuts/recorder.js +2 -2
- package/shortcuts/recorder.mjs +2 -2
- package/shortcuts/utils.js +21 -5
- package/shortcuts/utils.mjs +20 -4
- package/tableView.js +58 -9
- package/tableView.mjs +58 -9
- package/translations/indexMapper.js +8 -9
- package/translations/indexMapper.mjs +8 -9
- package/3rdparty/walkontable/src/selection.js +0 -355
- package/3rdparty/walkontable/src/selection.mjs +0 -349
- package/selection/highlight/constants.js +0 -16
- package/selection/highlight/constants.mjs +0 -6
package/core.mjs
CHANGED
@@ -15,12 +15,12 @@ import "core-js/modules/es.set.js";
|
|
15
15
|
import "core-js/modules/es.string.iterator.js";
|
16
16
|
import "core-js/modules/web.dom-collections.iterator.js";
|
17
17
|
import "core-js/modules/es.array.includes.js";
|
18
|
+
import "core-js/modules/es.array.concat.js";
|
18
19
|
import "core-js/modules/es.array.sort.js";
|
19
20
|
import "core-js/modules/es.array.splice.js";
|
20
21
|
import "core-js/modules/es.number.is-integer.js";
|
21
22
|
import "core-js/modules/es.number.constructor.js";
|
22
23
|
import "core-js/modules/es.array.slice.js";
|
23
|
-
import "core-js/modules/es.array.concat.js";
|
24
24
|
import "core-js/modules/es.array.fill.js";
|
25
25
|
import "core-js/modules/es.array.map.js";
|
26
26
|
import "core-js/modules/es.regexp.exec.js";
|
@@ -32,7 +32,6 @@ import "core-js/modules/es.array.reverse.js";
|
|
32
32
|
import "core-js/modules/web.dom-collections.for-each.js";
|
33
33
|
import "core-js/modules/web.timers.js";
|
34
34
|
import "core-js/modules/web.immediate.js";
|
35
|
-
import "core-js/modules/es.map.js";
|
36
35
|
import "core-js/modules/es.symbol.js";
|
37
36
|
import "core-js/modules/es.symbol.description.js";
|
38
37
|
import "core-js/modules/es.symbol.iterator.js";
|
@@ -66,7 +65,7 @@ import { Selection } from "./selection/index.mjs";
|
|
66
65
|
import { MetaManager, DynamicCellMetaMod, ExtendMetaPropertiesMod, replaceData } from "./dataMap/index.mjs";
|
67
66
|
import { createUniqueMap } from "./utils/dataStructures/uniqueMap.mjs";
|
68
67
|
import { createShortcutManager } from "./shortcuts/index.mjs";
|
69
|
-
|
68
|
+
import { registerAllShortcutContexts } from "./shortcutContexts/index.mjs";
|
70
69
|
var activeGuid = null;
|
71
70
|
|
72
71
|
/**
|
@@ -290,12 +289,8 @@ export default function Core(rootElement, userSettings) {
|
|
290
289
|
};
|
291
290
|
|
292
291
|
var selection = new Selection(tableMeta, {
|
293
|
-
rowIndexMapper:
|
294
|
-
|
295
|
-
},
|
296
|
-
columnIndexMapper: function columnIndexMapper() {
|
297
|
-
return instance.columnIndexMapper;
|
298
|
-
},
|
292
|
+
rowIndexMapper: instance.rowIndexMapper,
|
293
|
+
columnIndexMapper: instance.columnIndexMapper,
|
299
294
|
countCols: function countCols() {
|
300
295
|
return instance.countCols();
|
301
296
|
},
|
@@ -308,12 +303,18 @@ export default function Core(rootElement, userSettings) {
|
|
308
303
|
isEditorOpened: function isEditorOpened() {
|
309
304
|
return instance.getActiveEditor() ? instance.getActiveEditor().isOpened() : false;
|
310
305
|
},
|
311
|
-
|
306
|
+
countRenderableColumns: function countRenderableColumns() {
|
312
307
|
return _this.view.countRenderableColumns();
|
313
308
|
},
|
314
|
-
|
309
|
+
countRenderableRows: function countRenderableRows() {
|
315
310
|
return _this.view.countRenderableRows();
|
316
311
|
},
|
312
|
+
countRowHeaders: function countRowHeaders() {
|
313
|
+
return _this.countRowHeaders();
|
314
|
+
},
|
315
|
+
countColHeaders: function countColHeaders() {
|
316
|
+
return _this.countColHeaders();
|
317
|
+
},
|
317
318
|
getShortcutManager: function getShortcutManager() {
|
318
319
|
return instance.getShortcutManager();
|
319
320
|
},
|
@@ -346,12 +347,6 @@ export default function Core(rootElement, userSettings) {
|
|
346
347
|
});
|
347
348
|
this.selection.addLocalHook('beforeSetRangeEnd', function (cellCoords) {
|
348
349
|
_this.runHooks('beforeSetRangeEnd', cellCoords);
|
349
|
-
if (cellCoords.row < 0) {
|
350
|
-
cellCoords.row = _this.view._wt.wtTable.getFirstVisibleRow();
|
351
|
-
}
|
352
|
-
if (cellCoords.col < 0) {
|
353
|
-
cellCoords.col = _this.view._wt.wtTable.getFirstVisibleColumn();
|
354
|
-
}
|
355
350
|
});
|
356
351
|
this.selection.addLocalHook('afterSetRangeEnd', function (cellCoords) {
|
357
352
|
var preventScrolling = createObjectPropListener(false);
|
@@ -377,7 +372,14 @@ export default function Core(rootElement, userSettings) {
|
|
377
372
|
if (scrollToCell !== false) {
|
378
373
|
if (!isSelectedByAnyHeader) {
|
379
374
|
if (currentSelectedRange && !_this.selection.isMultiple()) {
|
380
|
-
|
375
|
+
var renderableCoords = visualToRenderableCoords(currentSelectedRange.from);
|
376
|
+
if (renderableCoords.row < 0 && renderableCoords.col >= 0) {
|
377
|
+
_this.view.scrollViewportHorizontally(renderableCoords.col);
|
378
|
+
} else if (renderableCoords.col < 0 && renderableCoords.row >= 0) {
|
379
|
+
_this.view.scrollViewportVertically(renderableCoords.row);
|
380
|
+
} else {
|
381
|
+
_this.view.scrollViewport(renderableCoords);
|
382
|
+
}
|
381
383
|
} else {
|
382
384
|
_this.view.scrollViewport(visualToRenderableCoords(cellCoords));
|
383
385
|
}
|
@@ -418,6 +420,30 @@ export default function Core(rootElement, userSettings) {
|
|
418
420
|
isMultiple.value = changedIsMultiple;
|
419
421
|
}
|
420
422
|
});
|
423
|
+
this.selection.addLocalHook('beforeSelectColumns', function () {
|
424
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
425
|
+
args[_key] = arguments[_key];
|
426
|
+
}
|
427
|
+
return _this.runHooks.apply(_this, ['beforeSelectColumns'].concat(args));
|
428
|
+
});
|
429
|
+
this.selection.addLocalHook('afterSelectColumns', function () {
|
430
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
431
|
+
args[_key2] = arguments[_key2];
|
432
|
+
}
|
433
|
+
return _this.runHooks.apply(_this, ['afterSelectColumns'].concat(args));
|
434
|
+
});
|
435
|
+
this.selection.addLocalHook('beforeSelectRows', function () {
|
436
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
437
|
+
args[_key3] = arguments[_key3];
|
438
|
+
}
|
439
|
+
return _this.runHooks.apply(_this, ['beforeSelectRows'].concat(args));
|
440
|
+
});
|
441
|
+
this.selection.addLocalHook('afterSelectRows', function () {
|
442
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
443
|
+
args[_key4] = arguments[_key4];
|
444
|
+
}
|
445
|
+
return _this.runHooks.apply(_this, ['afterSelectRows'].concat(args));
|
446
|
+
});
|
421
447
|
this.selection.addLocalHook('beforeModifyTransformStart', function (cellCoordsDelta) {
|
422
448
|
_this.runHooks('modifyTransformStart', cellCoordsDelta);
|
423
449
|
});
|
@@ -1576,8 +1602,8 @@ export default function Core(rootElement, userSettings) {
|
|
1576
1602
|
*/
|
1577
1603
|
this.spliceCol = function (column, index, amount) {
|
1578
1604
|
var _datamap;
|
1579
|
-
for (var
|
1580
|
-
elements[
|
1605
|
+
for (var _len5 = arguments.length, elements = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
|
1606
|
+
elements[_key5 - 3] = arguments[_key5];
|
1581
1607
|
}
|
1582
1608
|
return (_datamap = datamap).spliceCol.apply(_datamap, [column, index, amount].concat(elements));
|
1583
1609
|
};
|
@@ -1595,8 +1621,8 @@ export default function Core(rootElement, userSettings) {
|
|
1595
1621
|
*/
|
1596
1622
|
this.spliceRow = function (row, index, amount) {
|
1597
1623
|
var _datamap2;
|
1598
|
-
for (var
|
1599
|
-
elements[
|
1624
|
+
for (var _len6 = arguments.length, elements = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
|
1625
|
+
elements[_key6 - 3] = arguments[_key6];
|
1600
1626
|
}
|
1601
1627
|
return (_datamap2 = datamap).spliceRow.apply(_datamap2, [row, index, amount].concat(elements));
|
1602
1628
|
};
|
@@ -1692,6 +1718,9 @@ export default function Core(rootElement, userSettings) {
|
|
1692
1718
|
}
|
1693
1719
|
var changes = [];
|
1694
1720
|
arrayEach(selection.getSelectedRange(), function (cellRange) {
|
1721
|
+
if (cellRange.isSingleHeader()) {
|
1722
|
+
return;
|
1723
|
+
}
|
1695
1724
|
var topStart = cellRange.getTopStartCorner();
|
1696
1725
|
var bottomEnd = cellRange.getBottomEndCorner();
|
1697
1726
|
rangeEach(topStart.row, bottomEnd.row, function (row) {
|
@@ -3006,8 +3035,8 @@ export default function Core(rootElement, userSettings) {
|
|
3006
3035
|
this.spliceCellsMeta = function (visualIndex) {
|
3007
3036
|
var _this5 = this;
|
3008
3037
|
var deleteAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
3009
|
-
for (var
|
3010
|
-
cellMetaRows[
|
3038
|
+
for (var _len7 = arguments.length, cellMetaRows = new Array(_len7 > 2 ? _len7 - 2 : 0), _key7 = 2; _key7 < _len7; _key7++) {
|
3039
|
+
cellMetaRows[_key7 - 2] = arguments[_key7];
|
3011
3040
|
}
|
3012
3041
|
if (cellMetaRows.length > 0 && !Array.isArray(cellMetaRows[0])) {
|
3013
3042
|
throw new Error('The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.');
|
@@ -3701,6 +3730,30 @@ export default function Core(rootElement, userSettings) {
|
|
3701
3730
|
return instance.view._wt.drawn ? instance.view._wt.wtTable.getVisibleColumnsCount() : -1;
|
3702
3731
|
};
|
3703
3732
|
|
3733
|
+
/**
|
3734
|
+
* Returns the number of rendered row headers.
|
3735
|
+
*
|
3736
|
+
* @since 13.0.0
|
3737
|
+
* @memberof Core#
|
3738
|
+
* @function countRowHeaders
|
3739
|
+
* @returns {number} Number of row headers.
|
3740
|
+
*/
|
3741
|
+
this.countRowHeaders = function () {
|
3742
|
+
return this.view.getRowHeadersCount();
|
3743
|
+
};
|
3744
|
+
|
3745
|
+
/**
|
3746
|
+
* Returns the number of rendered column headers.
|
3747
|
+
*
|
3748
|
+
* @since 13.0.0
|
3749
|
+
* @memberof Core#
|
3750
|
+
* @function countColHeaders
|
3751
|
+
* @returns {number} Number of column headers.
|
3752
|
+
*/
|
3753
|
+
this.countColHeaders = function () {
|
3754
|
+
return this.view.getColumnHeadersCount();
|
3755
|
+
};
|
3756
|
+
|
3704
3757
|
/**
|
3705
3758
|
* Returns the number of empty rows. If the optional ending parameter is `true`, returns the
|
3706
3759
|
* number of empty rows at the bottom of the table.
|
@@ -3905,6 +3958,10 @@ export default function Core(rootElement, userSettings) {
|
|
3905
3958
|
* hot.selectColumns('id');
|
3906
3959
|
* // Select range of columns using visual indexes.
|
3907
3960
|
* hot.selectColumns(1, 4);
|
3961
|
+
* // Select range of columns using visual indexes and mark the first header as highlighted.
|
3962
|
+
* hot.selectColumns(1, 2, -1);
|
3963
|
+
* // Select range of columns using visual indexes and mark the second cell as highlighted.
|
3964
|
+
* hot.selectColumns(2, 1, 1);
|
3908
3965
|
* // Select range of columns using column properties.
|
3909
3966
|
* hot.selectColumns('id', 'last_name');
|
3910
3967
|
* ```
|
@@ -3915,11 +3972,15 @@ export default function Core(rootElement, userSettings) {
|
|
3915
3972
|
* @param {number} startColumn The visual column index from which the selection starts.
|
3916
3973
|
* @param {number} [endColumn=startColumn] The visual column index to which the selection finishes. If `endColumn`
|
3917
3974
|
* is not defined the column defined by `startColumn` will be selected.
|
3975
|
+
* @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
|
3976
|
+
* The value can take visual row index from -N to N, where negative values
|
3977
|
+
* point to the headers and positive values point to the cell range.
|
3918
3978
|
* @returns {boolean} `true` if selection was successful, `false` otherwise.
|
3919
3979
|
*/
|
3920
3980
|
this.selectColumns = function (startColumn) {
|
3921
3981
|
var endColumn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startColumn;
|
3922
|
-
|
3982
|
+
var focusPosition = arguments.length > 2 ? arguments[2] : undefined;
|
3983
|
+
return selection.selectColumns(startColumn, endColumn, focusPosition);
|
3923
3984
|
};
|
3924
3985
|
|
3925
3986
|
/**
|
@@ -3929,8 +3990,12 @@ export default function Core(rootElement, userSettings) {
|
|
3929
3990
|
* ```js
|
3930
3991
|
* // Select row using visual index.
|
3931
3992
|
* hot.selectRows(1);
|
3932
|
-
* //
|
3993
|
+
* // select a range of rows, using visual indexes.
|
3933
3994
|
* hot.selectRows(1, 4);
|
3995
|
+
* // select a range of rows, using visual indexes, and mark the header as highlighted.
|
3996
|
+
* hot.selectRows(1, 2, -1);
|
3997
|
+
* // Select range of rows using visual indexes and mark the second cell as highlighted.
|
3998
|
+
* hot.selectRows(2, 1, 1);
|
3934
3999
|
* ```
|
3935
4000
|
*
|
3936
4001
|
* @memberof Core#
|
@@ -3939,11 +4004,15 @@ export default function Core(rootElement, userSettings) {
|
|
3939
4004
|
* @param {number} startRow The visual row index from which the selection starts.
|
3940
4005
|
* @param {number} [endRow=startRow] The visual row index to which the selection finishes. If `endRow`
|
3941
4006
|
* is not defined the row defined by `startRow` will be selected.
|
4007
|
+
* @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
|
4008
|
+
* The value can take visual column index from -N to N, where negative values
|
4009
|
+
* point to the headers and positive values point to the cell range.
|
3942
4010
|
* @returns {boolean} `true` if selection was successful, `false` otherwise.
|
3943
4011
|
*/
|
3944
4012
|
this.selectRows = function (startRow) {
|
3945
4013
|
var endRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startRow;
|
3946
|
-
|
4014
|
+
var focusPosition = arguments.length > 2 ? arguments[2] : undefined;
|
4015
|
+
return selection.selectRows(startRow, endRow, focusPosition);
|
3947
4016
|
};
|
3948
4017
|
|
3949
4018
|
/**
|
@@ -3962,9 +4031,16 @@ export default function Core(rootElement, userSettings) {
|
|
3962
4031
|
* The previous selection is overwritten.
|
3963
4032
|
*
|
3964
4033
|
* ```js
|
3965
|
-
* // select all cells in the table, including all headers
|
4034
|
+
* // select all cells in the table, including all headers and the corner cell
|
3966
4035
|
* hot.selectAll();
|
3967
4036
|
*
|
4037
|
+
* // select all cells in the table, including row headers but excluding the corner cell
|
4038
|
+
* hot.selectAll(true, false);
|
4039
|
+
*
|
4040
|
+
* // select all cells in the table, including all headers and the corner cell, but move the focus
|
4041
|
+
* // highlight to position -2, -1
|
4042
|
+
* hot.selectAll(-2, -1);
|
4043
|
+
*
|
3968
4044
|
* // select all cells in the table, without headers
|
3969
4045
|
* hot.selectAll(false);
|
3970
4046
|
* ```
|
@@ -3972,15 +4048,20 @@ export default function Core(rootElement, userSettings) {
|
|
3972
4048
|
* @since 0.38.2
|
3973
4049
|
* @memberof Core#
|
3974
4050
|
* @function selectAll
|
3975
|
-
* @param {boolean} [
|
3976
|
-
* `false
|
4051
|
+
* @param {boolean} [includeRowHeaders=false] `true` If the selection should include the row headers,
|
4052
|
+
* `false` otherwise.
|
4053
|
+
* @param {boolean} [includeColumnHeaders=false] `true` If the selection should include the column
|
4054
|
+
* headers, `false` otherwise.
|
4055
|
+
* @param {{row: number, col: number}} [focusPosition] The argument allows changing the cell/header
|
4056
|
+
* focus position. The value takes an object with a `row` and `col` properties (visual indexes)
|
4057
|
+
* from -N to N, where negative values point to the headers and positive values point to the cell range.
|
3977
4058
|
*/
|
3978
4059
|
this.selectAll = function () {
|
3979
|
-
var
|
3980
|
-
var
|
3981
|
-
var
|
4060
|
+
var includeRowHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
4061
|
+
var includeColumnHeaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : includeRowHeaders;
|
4062
|
+
var focusPosition = arguments.length > 2 ? arguments[2] : undefined;
|
3982
4063
|
preventScrollingToCell = true;
|
3983
|
-
selection.selectAll(includeRowHeaders, includeColumnHeaders);
|
4064
|
+
selection.selectAll(includeRowHeaders, includeColumnHeaders, focusPosition);
|
3984
4065
|
preventScrollingToCell = false;
|
3985
4066
|
};
|
3986
4067
|
var getIndexToScroll = function getIndexToScroll(indexMapper, visualIndex) {
|
@@ -4384,6 +4465,16 @@ export default function Core(rootElement, userSettings) {
|
|
4384
4465
|
}
|
4385
4466
|
};
|
4386
4467
|
|
4468
|
+
/**
|
4469
|
+
* Gets the instance of the EditorManager.
|
4470
|
+
*
|
4471
|
+
* @private
|
4472
|
+
* @returns {EditorManager}
|
4473
|
+
*/
|
4474
|
+
this._getEditorManager = function () {
|
4475
|
+
return editorManager;
|
4476
|
+
};
|
4477
|
+
|
4387
4478
|
/**
|
4388
4479
|
* Check if currently it is RTL direction.
|
4389
4480
|
*
|
@@ -4456,284 +4547,11 @@ export default function Core(rootElement, userSettings) {
|
|
4456
4547
|
this.getShortcutManager = function () {
|
4457
4548
|
return shortcutManager;
|
4458
4549
|
};
|
4459
|
-
var gridContext = shortcutManager.addContext('grid');
|
4460
|
-
var gridConfig = {
|
4461
|
-
runOnlyIf: function runOnlyIf() {
|
4462
|
-
return isDefined(instance.getSelected()) && instance.countRenderedRows() > 0 && instance.countRenderedCols() > 0;
|
4463
|
-
},
|
4464
|
-
group: SHORTCUTS_GROUP
|
4465
|
-
};
|
4466
|
-
shortcutManager.setActiveContextName('grid');
|
4467
|
-
gridContext.addShortcuts([{
|
4468
|
-
keys: [['Control/Meta', 'A']],
|
4469
|
-
callback: function callback() {
|
4470
|
-
instance.selectAll();
|
4471
|
-
}
|
4472
|
-
}, {
|
4473
|
-
keys: [['Control/Meta', 'Enter']],
|
4474
|
-
callback: function callback() {
|
4475
|
-
var selectedRange = instance.getSelectedRange();
|
4476
|
-
var _selectedRange$highli = selectedRange[selectedRange.length - 1].highlight,
|
4477
|
-
highlightRow = _selectedRange$highli.row,
|
4478
|
-
highlightColumn = _selectedRange$highli.col;
|
4479
|
-
var valueToPopulate = instance.getDataAtCell(highlightRow, highlightColumn);
|
4480
|
-
var cellValues = new Map();
|
4481
|
-
for (var i = 0; i < selectedRange.length; i++) {
|
4482
|
-
selectedRange[i].forAll(function (row, column) {
|
4483
|
-
if (row >= 0 && column >= 0 && (row !== highlightRow || column !== highlightColumn)) {
|
4484
|
-
var _instance$getCellMeta = instance.getCellMeta(row, column),
|
4485
|
-
readOnly = _instance$getCellMeta.readOnly;
|
4486
|
-
if (!readOnly) {
|
4487
|
-
cellValues.set("".concat(row, "x").concat(column), [row, column, valueToPopulate]);
|
4488
|
-
}
|
4489
|
-
}
|
4490
|
-
});
|
4491
|
-
}
|
4492
|
-
instance.setDataAtCell(Array.from(cellValues.values()));
|
4493
|
-
},
|
4494
|
-
runOnlyIf: function runOnlyIf() {
|
4495
|
-
return instance.getSelectedRangeLast().getCellsCount() > 1;
|
4496
|
-
}
|
4497
|
-
}, {
|
4498
|
-
keys: [['ArrowUp']],
|
4499
|
-
callback: function callback() {
|
4500
|
-
selection.transformStart(-1, 0);
|
4501
|
-
}
|
4502
|
-
}, {
|
4503
|
-
keys: [['ArrowUp', 'Control/Meta']],
|
4504
|
-
captureCtrl: true,
|
4505
|
-
callback: function callback() {
|
4506
|
-
selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1), instance.getSelectedRangeLast().highlight.col));
|
4507
|
-
}
|
4508
|
-
}, {
|
4509
|
-
keys: [['ArrowUp', 'Shift']],
|
4510
|
-
callback: function callback() {
|
4511
|
-
selection.transformEnd(-1, 0);
|
4512
|
-
}
|
4513
|
-
}, {
|
4514
|
-
keys: [['ArrowUp', 'Shift', 'Control/Meta']],
|
4515
|
-
captureCtrl: true,
|
4516
|
-
callback: function callback() {
|
4517
|
-
var _instance$getSelected = instance.getSelectedRangeLast(),
|
4518
|
-
from = _instance$getSelected.from,
|
4519
|
-
to = _instance$getSelected.to;
|
4520
|
-
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1);
|
4521
|
-
selection.setRangeStart(from.clone());
|
4522
|
-
selection.setRangeEnd(instance._createCellCoords(row, to.col));
|
4523
|
-
},
|
4524
|
-
runOnlyIf: function runOnlyIf() {
|
4525
|
-
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader());
|
4526
|
-
}
|
4527
|
-
}, {
|
4528
|
-
keys: [['ArrowDown']],
|
4529
|
-
callback: function callback() {
|
4530
|
-
selection.transformStart(1, 0);
|
4531
|
-
}
|
4532
|
-
}, {
|
4533
|
-
keys: [['ArrowDown', 'Control/Meta']],
|
4534
|
-
captureCtrl: true,
|
4535
|
-
callback: function callback() {
|
4536
|
-
selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1), instance.getSelectedRangeLast().highlight.col));
|
4537
|
-
}
|
4538
|
-
}, {
|
4539
|
-
keys: [['ArrowDown', 'Shift']],
|
4540
|
-
callback: function callback() {
|
4541
|
-
selection.transformEnd(1, 0);
|
4542
|
-
}
|
4543
|
-
}, {
|
4544
|
-
keys: [['ArrowDown', 'Shift', 'Control/Meta']],
|
4545
|
-
captureCtrl: true,
|
4546
|
-
callback: function callback() {
|
4547
|
-
var _instance$getSelected2 = instance.getSelectedRangeLast(),
|
4548
|
-
from = _instance$getSelected2.from,
|
4549
|
-
to = _instance$getSelected2.to;
|
4550
|
-
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1);
|
4551
|
-
selection.setRangeStart(from.clone());
|
4552
|
-
selection.setRangeEnd(instance._createCellCoords(row, to.col));
|
4553
|
-
},
|
4554
|
-
runOnlyIf: function runOnlyIf() {
|
4555
|
-
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader());
|
4556
|
-
}
|
4557
|
-
}, {
|
4558
|
-
keys: [['ArrowLeft']],
|
4559
|
-
callback: function callback() {
|
4560
|
-
selection.transformStart(0, -1 * instance.getDirectionFactor());
|
4561
|
-
}
|
4562
|
-
}, {
|
4563
|
-
keys: [['ArrowLeft', 'Control/Meta']],
|
4564
|
-
captureCtrl: true,
|
4565
|
-
callback: function callback() {
|
4566
|
-
var _instance$columnIndex;
|
4567
|
-
var row = instance.getSelectedRangeLast().highlight.row;
|
4568
|
-
var column = (_instance$columnIndex = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex, _toConsumableArray(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
|
4569
|
-
selection.setRangeStart(instance._createCellCoords(row, column));
|
4570
|
-
}
|
4571
|
-
}, {
|
4572
|
-
keys: [['ArrowLeft', 'Shift']],
|
4573
|
-
callback: function callback() {
|
4574
|
-
selection.transformEnd(0, -1 * instance.getDirectionFactor());
|
4575
|
-
}
|
4576
|
-
}, {
|
4577
|
-
keys: [['ArrowLeft', 'Shift', 'Control/Meta']],
|
4578
|
-
captureCtrl: true,
|
4579
|
-
callback: function callback() {
|
4580
|
-
var _instance$columnIndex2;
|
4581
|
-
var _instance$getSelected3 = instance.getSelectedRangeLast(),
|
4582
|
-
from = _instance$getSelected3.from,
|
4583
|
-
to = _instance$getSelected3.to;
|
4584
|
-
var column = (_instance$columnIndex2 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex2, _toConsumableArray(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
|
4585
|
-
selection.setRangeStart(from.clone());
|
4586
|
-
selection.setRangeEnd(instance._createCellCoords(to.row, column));
|
4587
|
-
},
|
4588
|
-
runOnlyIf: function runOnlyIf() {
|
4589
|
-
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader());
|
4590
|
-
}
|
4591
|
-
}, {
|
4592
|
-
keys: [['ArrowRight']],
|
4593
|
-
callback: function callback() {
|
4594
|
-
selection.transformStart(0, instance.getDirectionFactor());
|
4595
|
-
}
|
4596
|
-
}, {
|
4597
|
-
keys: [['ArrowRight', 'Control/Meta']],
|
4598
|
-
captureCtrl: true,
|
4599
|
-
callback: function callback() {
|
4600
|
-
var _instance$columnIndex3;
|
4601
|
-
var row = instance.getSelectedRangeLast().highlight.row;
|
4602
|
-
var column = (_instance$columnIndex3 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex3, _toConsumableArray(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
|
4603
|
-
selection.setRangeStart(instance._createCellCoords(row, column));
|
4604
|
-
}
|
4605
|
-
}, {
|
4606
|
-
keys: [['ArrowRight', 'Shift']],
|
4607
|
-
callback: function callback() {
|
4608
|
-
selection.transformEnd(0, instance.getDirectionFactor());
|
4609
|
-
}
|
4610
|
-
}, {
|
4611
|
-
keys: [['ArrowRight', 'Shift', 'Control/Meta']],
|
4612
|
-
captureCtrl: true,
|
4613
|
-
callback: function callback() {
|
4614
|
-
var _instance$columnIndex4;
|
4615
|
-
var _instance$getSelected4 = instance.getSelectedRangeLast(),
|
4616
|
-
from = _instance$getSelected4.from,
|
4617
|
-
to = _instance$getSelected4.to;
|
4618
|
-
var column = (_instance$columnIndex4 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex4, _toConsumableArray(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
|
4619
|
-
selection.setRangeStart(from.clone());
|
4620
|
-
selection.setRangeEnd(instance._createCellCoords(to.row, column));
|
4621
|
-
},
|
4622
|
-
runOnlyIf: function runOnlyIf() {
|
4623
|
-
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader());
|
4624
|
-
}
|
4625
|
-
}, {
|
4626
|
-
keys: [['Home']],
|
4627
|
-
captureCtrl: true,
|
4628
|
-
callback: function callback() {
|
4629
|
-
var fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
|
4630
|
-
var row = instance.getSelectedRangeLast().highlight.row;
|
4631
|
-
var column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
|
4632
|
-
selection.setRangeStart(instance._createCellCoords(row, column));
|
4633
|
-
},
|
4634
|
-
runOnlyIf: function runOnlyIf() {
|
4635
|
-
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4636
|
-
}
|
4637
|
-
}, {
|
4638
|
-
keys: [['Home', 'Shift']],
|
4639
|
-
callback: function callback() {
|
4640
|
-
selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(0, 1)));
|
4641
|
-
}
|
4642
|
-
}, {
|
4643
|
-
keys: [['Home', 'Control/Meta']],
|
4644
|
-
captureCtrl: true,
|
4645
|
-
callback: function callback() {
|
4646
|
-
var fixedRows = parseInt(instance.getSettings().fixedRowsTop, 10);
|
4647
|
-
var fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
|
4648
|
-
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(fixedRows, 1);
|
4649
|
-
var column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
|
4650
|
-
selection.setRangeStart(instance._createCellCoords(row, column));
|
4651
|
-
},
|
4652
|
-
runOnlyIf: function runOnlyIf() {
|
4653
|
-
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4654
|
-
}
|
4655
|
-
}, {
|
4656
|
-
keys: [['End']],
|
4657
|
-
captureCtrl: true,
|
4658
|
-
callback: function callback() {
|
4659
|
-
selection.setRangeStart(instance._createCellCoords(instance.getSelectedRangeLast().highlight.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
|
4660
|
-
},
|
4661
|
-
runOnlyIf: function runOnlyIf() {
|
4662
|
-
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4663
|
-
}
|
4664
|
-
}, {
|
4665
|
-
keys: [['End', 'Shift']],
|
4666
|
-
callback: function callback() {
|
4667
|
-
selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
|
4668
|
-
}
|
4669
|
-
}, {
|
4670
|
-
keys: [['End', 'Control/Meta']],
|
4671
|
-
captureCtrl: true,
|
4672
|
-
callback: function callback() {
|
4673
|
-
var fixedRows = parseInt(instance.getSettings().fixedRowsBottom, 10);
|
4674
|
-
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - fixedRows - 1, -1);
|
4675
|
-
var column = instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1);
|
4676
|
-
selection.setRangeStart(instance._createCellCoords(row, column));
|
4677
|
-
},
|
4678
|
-
runOnlyIf: function runOnlyIf() {
|
4679
|
-
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4680
|
-
}
|
4681
|
-
}, {
|
4682
|
-
keys: [['PageUp']],
|
4683
|
-
callback: function callback() {
|
4684
|
-
selection.transformStart(-instance.countVisibleRows(), 0);
|
4685
|
-
}
|
4686
|
-
}, {
|
4687
|
-
keys: [['PageUp', 'Shift']],
|
4688
|
-
callback: function callback() {
|
4689
|
-
var _instance$getSelected5 = instance.getSelectedRangeLast(),
|
4690
|
-
to = _instance$getSelected5.to;
|
4691
|
-
var nextRowIndexToSelect = Math.max(to.row - instance.countVisibleRows(), 0);
|
4692
|
-
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, 1);
|
4693
|
-
if (row !== null) {
|
4694
|
-
var coords = instance._createCellCoords(row, to.col);
|
4695
|
-
var scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
|
4696
|
-
var nextVerticalScroll = Math.max(coords.row - scrollPadding, 0);
|
4697
|
-
selection.setRangeEnd(coords);
|
4698
|
-
instance.scrollViewportTo(nextVerticalScroll);
|
4699
|
-
}
|
4700
|
-
}
|
4701
|
-
}, {
|
4702
|
-
keys: [['PageDown']],
|
4703
|
-
callback: function callback() {
|
4704
|
-
selection.transformStart(instance.countVisibleRows(), 0);
|
4705
|
-
}
|
4706
|
-
}, {
|
4707
|
-
keys: [['PageDown', 'Shift']],
|
4708
|
-
callback: function callback() {
|
4709
|
-
var _instance$getSelected6 = instance.getSelectedRangeLast(),
|
4710
|
-
to = _instance$getSelected6.to;
|
4711
|
-
var nextRowIndexToSelect = Math.min(to.row + instance.countVisibleRows(), instance.countRows() - 1);
|
4712
|
-
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, -1);
|
4713
|
-
if (row !== null) {
|
4714
|
-
var coords = instance._createCellCoords(row, to.col);
|
4715
|
-
var scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
|
4716
|
-
var nextVerticalScroll = Math.min(coords.row - scrollPadding, instance.countRows() - 1);
|
4717
|
-
selection.setRangeEnd(coords);
|
4718
|
-
instance.scrollViewportTo(nextVerticalScroll);
|
4719
|
-
}
|
4720
|
-
}
|
4721
|
-
}, {
|
4722
|
-
keys: [['Tab']],
|
4723
|
-
callback: function callback(event) {
|
4724
|
-
var tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
4725
|
-
selection.transformStart(tabMoves.row, tabMoves.col, true);
|
4726
|
-
}
|
4727
|
-
}, {
|
4728
|
-
keys: [['Shift', 'Tab']],
|
4729
|
-
callback: function callback(event) {
|
4730
|
-
var tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
4731
|
-
selection.transformStart(-tabMoves.row, -tabMoves.col);
|
4732
|
-
}
|
4733
|
-
}], gridConfig);
|
4734
4550
|
getPluginsNames().forEach(function (pluginName) {
|
4735
4551
|
var PluginClass = getPlugin(pluginName);
|
4736
4552
|
pluginsRegistry.addItem(pluginName, new PluginClass(_this));
|
4737
4553
|
});
|
4554
|
+
registerAllShortcutContexts(instance);
|
4555
|
+
shortcutManager.setActiveContextName('grid');
|
4738
4556
|
Hooks.getSingleton().run(instance, 'construct');
|
4739
4557
|
}
|
@@ -3112,6 +3112,25 @@ var _default = function _default() {
|
|
3112
3112
|
* ```
|
3113
3113
|
*/
|
3114
3114
|
multiColumnSorting: void 0,
|
3115
|
+
/**
|
3116
|
+
* When set to `true`, the `navigableHeaders` option lets you navigate [row headers](@/guides/rows/row-header.md) and [column headers](@/guides/columns/column-header.md), using the arrow keys or the <kbd>**Tab**</kbd> key (if the [`disableTabNavigation`](#disabletabnavigation) option is set to `false`).
|
3117
|
+
*
|
3118
|
+
* @since 13.0.0
|
3119
|
+
* @memberof Options#
|
3120
|
+
* @type {boolean}
|
3121
|
+
* @default false
|
3122
|
+
* @category Core
|
3123
|
+
*
|
3124
|
+
* @example
|
3125
|
+
* ```js
|
3126
|
+
* // you can navigate row and column headers with the keyboard
|
3127
|
+
* navigableHeaders: true,
|
3128
|
+
*
|
3129
|
+
* // default behavior: you can't navigate row and column headers with the keyboard
|
3130
|
+
* navigableHeaders: false,
|
3131
|
+
* ```
|
3132
|
+
*/
|
3133
|
+
navigableHeaders: false,
|
3115
3134
|
/**
|
3116
3135
|
* @description
|
3117
3136
|
* The `nestedHeaders` option configures the [`NestedHeaders`](@/api/nestedHeaders.md) plugin.
|
@@ -3108,6 +3108,25 @@ export default (function () {
|
|
3108
3108
|
* ```
|
3109
3109
|
*/
|
3110
3110
|
multiColumnSorting: void 0,
|
3111
|
+
/**
|
3112
|
+
* When set to `true`, the `navigableHeaders` option lets you navigate [row headers](@/guides/rows/row-header.md) and [column headers](@/guides/columns/column-header.md), using the arrow keys or the <kbd>**Tab**</kbd> key (if the [`disableTabNavigation`](#disabletabnavigation) option is set to `false`).
|
3113
|
+
*
|
3114
|
+
* @since 13.0.0
|
3115
|
+
* @memberof Options#
|
3116
|
+
* @type {boolean}
|
3117
|
+
* @default false
|
3118
|
+
* @category Core
|
3119
|
+
*
|
3120
|
+
* @example
|
3121
|
+
* ```js
|
3122
|
+
* // you can navigate row and column headers with the keyboard
|
3123
|
+
* navigableHeaders: true,
|
3124
|
+
*
|
3125
|
+
* // default behavior: you can't navigate row and column headers with the keyboard
|
3126
|
+
* navigableHeaders: false,
|
3127
|
+
* ```
|
3128
|
+
*/
|
3129
|
+
navigableHeaders: false,
|
3111
3130
|
/**
|
3112
3131
|
* @description
|
3113
3132
|
* The `nestedHeaders` option configures the [`NestedHeaders`](@/api/nestedHeaders.md) plugin.
|