handsontable 0.0.0-next-af5139c-20230620 → 0.0.0-next-06a64be-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/{selection/border/border.js → border.js} +12 -7
- package/3rdparty/walkontable/src/{selection/border/border.mjs → border.mjs} +12 -7
- package/3rdparty/walkontable/src/cell/coords.d.ts +1 -6
- package/3rdparty/walkontable/src/cell/coords.js +12 -61
- package/3rdparty/walkontable/src/cell/coords.mjs +12 -61
- package/3rdparty/walkontable/src/cell/range.d.ts +2 -9
- package/3rdparty/walkontable/src/cell/range.js +7 -44
- package/3rdparty/walkontable/src/cell/range.mjs +7 -44
- package/3rdparty/walkontable/src/core/_base.js +3 -9
- package/3rdparty/walkontable/src/core/_base.mjs +3 -9
- 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 +2 -3
- package/3rdparty/walkontable/src/core/core.mjs +2 -3
- 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 +2 -10
- 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 +4 -2
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +4 -2
- package/3rdparty/walkontable/src/overlay/top.js +4 -2
- package/3rdparty/walkontable/src/overlay/top.mjs +4 -2
- package/3rdparty/walkontable/src/selection.js +355 -0
- package/3rdparty/walkontable/src/selection.mjs +349 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +0 -9
- package/3rdparty/walkontable/src/table.js +79 -7
- package/3rdparty/walkontable/src/table.mjs +80 -8
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.d.ts +3 -5
- package/core.js +309 -127
- package/core.mjs +309 -127
- package/dataMap/metaManager/metaSchema.js +0 -19
- package/dataMap/metaManager/metaSchema.mjs +0 -19
- package/dist/handsontable.css +3 -8
- package/dist/handsontable.full.css +3 -8
- package/dist/handsontable.full.js +9241 -11943
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +107 -107
- package/dist/handsontable.js +12628 -15330
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +4 -4
- package/editorManager.js +94 -21
- package/editorManager.mjs +98 -26
- package/editors/textEditor/textEditor.js +11 -3
- package/editors/textEditor/textEditor.mjs +12 -4
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/number.d.ts +0 -1
- package/helpers/number.js +0 -18
- package/helpers/number.mjs +0 -17
- package/package.json +1 -1
- package/pluginHooks.d.ts +1 -5
- package/pluginHooks.js +1 -89
- package/pluginHooks.mjs +1 -89
- package/plugins/collapsibleColumns/collapsibleColumns.js +24 -81
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +24 -81
- package/plugins/columnSorting/columnSorting.js +8 -50
- package/plugins/columnSorting/columnSorting.mjs +9 -49
- package/plugins/columnSorting/index.js +2 -4
- package/plugins/columnSorting/index.mjs +1 -1
- package/plugins/copyPaste/copyPaste.js +1 -5
- package/plugins/copyPaste/copyPaste.mjs +1 -5
- package/plugins/customBorders/customBorders.js +53 -18
- package/plugins/customBorders/customBorders.mjs +54 -19
- package/plugins/manualColumnResize/manualColumnResize.js +36 -5
- package/plugins/manualColumnResize/manualColumnResize.mjs +36 -5
- package/plugins/manualRowResize/manualRowResize.js +40 -9
- package/plugins/manualRowResize/manualRowResize.mjs +40 -9
- package/plugins/mergeCells/mergeCells.js +18 -5
- package/plugins/mergeCells/mergeCells.mjs +18 -5
- package/plugins/multiColumnSorting/multiColumnSorting.js +3 -42
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +3 -42
- package/plugins/nestedHeaders/nestedHeaders.js +10 -132
- package/plugins/nestedHeaders/nestedHeaders.mjs +10 -132
- package/plugins/nestedHeaders/stateManager/index.js +0 -37
- package/plugins/nestedHeaders/stateManager/index.mjs +0 -37
- package/plugins/nestedRows/nestedRows.js +7 -52
- package/plugins/nestedRows/nestedRows.mjs +7 -52
- package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
- package/selection/highlight/constants.js +16 -0
- package/selection/highlight/constants.mjs +6 -0
- package/selection/highlight/highlight.js +89 -312
- package/selection/highlight/highlight.mjs +85 -302
- package/selection/highlight/types/activeHeader.js +9 -10
- package/selection/highlight/types/activeHeader.mjs +8 -10
- package/selection/highlight/types/area.js +27 -12
- package/selection/highlight/types/area.mjs +30 -16
- package/selection/highlight/types/{focus.js → cell.js} +8 -5
- package/selection/highlight/types/{focus.mjs → cell.mjs} +7 -5
- package/selection/highlight/types/customSelection.js +10 -7
- package/selection/highlight/types/customSelection.mjs +9 -7
- package/selection/highlight/types/fill.js +8 -5
- package/selection/highlight/types/fill.mjs +7 -5
- package/selection/highlight/types/header.js +20 -10
- package/selection/highlight/types/header.mjs +19 -10
- package/selection/highlight/types/{row.js → index.js} +31 -27
- package/selection/highlight/types/{row.mjs → index.mjs} +29 -24
- package/selection/highlight/visualSelection.js +27 -31
- package/selection/highlight/visualSelection.mjs +27 -31
- package/selection/index.js +7 -4
- package/selection/index.mjs +3 -2
- 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 +181 -315
- package/selection/selection.mjs +180 -310
- package/selection/transformation.js +96 -233
- package/selection/transformation.mjs +93 -230
- package/selection/utils.js +36 -12
- package/selection/utils.mjs +36 -13
- package/settings.d.ts +0 -1
- package/shortcuts/manager.js +0 -2
- package/shortcuts/manager.mjs +0 -2
- package/tableView.js +9 -58
- package/tableView.mjs +9 -58
- package/translations/indexMapper.js +9 -8
- package/translations/indexMapper.mjs +9 -8
- package/3rdparty/walkontable/src/selection/border/constants.js +0 -18
- package/3rdparty/walkontable/src/selection/border/constants.mjs +0 -13
- package/3rdparty/walkontable/src/selection/constants.js +0 -63
- package/3rdparty/walkontable/src/selection/constants.mjs +0 -51
- package/3rdparty/walkontable/src/selection/index.js +0 -30
- package/3rdparty/walkontable/src/selection/index.mjs +0 -5
- package/3rdparty/walkontable/src/selection/manager.js +0 -329
- package/3rdparty/walkontable/src/selection/manager.mjs +0 -323
- package/3rdparty/walkontable/src/selection/scanner.js +0 -364
- package/3rdparty/walkontable/src/selection/scanner.mjs +0 -360
- package/3rdparty/walkontable/src/selection/selection.js +0 -133
- package/3rdparty/walkontable/src/selection/selection.mjs +0 -127
- package/selection/highlight/types/areaLayered.js +0 -54
- package/selection/highlight/types/areaLayered.mjs +0 -49
- package/selection/highlight/types/column.js +0 -50
- package/selection/highlight/types/column.mjs +0 -45
- package/shortcutContexts/commands/editor/closeAndSave.js +0 -15
- package/shortcutContexts/commands/editor/closeAndSave.mjs +0 -10
- package/shortcutContexts/commands/editor/closeWithoutSaving.js +0 -13
- package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +0 -8
- package/shortcutContexts/commands/editor/fastOpen.js +0 -16
- package/shortcutContexts/commands/editor/fastOpen.mjs +0 -11
- package/shortcutContexts/commands/editor/index.js +0 -16
- package/shortcutContexts/commands/editor/index.mjs +0 -12
- package/shortcutContexts/commands/editor/open.js +0 -29
- package/shortcutContexts/commands/editor/open.mjs +0 -24
- package/shortcutContexts/commands/emptySelectedCells.js +0 -12
- package/shortcutContexts/commands/emptySelectedCells.mjs +0 -7
- package/shortcutContexts/commands/extendCellsSelection/down.js +0 -15
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +0 -10
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +0 -21
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +0 -16
- package/shortcutContexts/commands/extendCellsSelection/index.js +0 -26
- package/shortcutContexts/commands/extendCellsSelection/index.mjs +0 -22
- package/shortcutContexts/commands/extendCellsSelection/left.js +0 -15
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +0 -10
- package/shortcutContexts/commands/extendCellsSelection/right.js +0 -15
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +0 -10
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +0 -19
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +0 -14
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +0 -22
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +0 -17
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +0 -17
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +0 -12
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +0 -17
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +0 -12
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +0 -40
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +0 -35
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +0 -40
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +0 -35
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +0 -22
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +0 -17
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +0 -19
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +0 -14
- package/shortcutContexts/commands/extendCellsSelection/up.js +0 -15
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +0 -10
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +0 -21
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +0 -16
- package/shortcutContexts/commands/index.js +0 -52
- package/shortcutContexts/commands/index.mjs +0 -48
- package/shortcutContexts/commands/moveCellSelection/down.js +0 -12
- package/shortcutContexts/commands/moveCellSelection/down.mjs +0 -7
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +0 -29
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +0 -24
- package/shortcutContexts/commands/moveCellSelection/index.js +0 -28
- package/shortcutContexts/commands/moveCellSelection/index.mjs +0 -24
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +0 -13
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +0 -8
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +0 -13
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +0 -8
- package/shortcutContexts/commands/moveCellSelection/left.js +0 -11
- package/shortcutContexts/commands/moveCellSelection/left.mjs +0 -6
- package/shortcutContexts/commands/moveCellSelection/right.js +0 -11
- package/shortcutContexts/commands/moveCellSelection/right.mjs +0 -6
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +0 -16
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +0 -11
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +0 -17
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +0 -12
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +0 -13
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +0 -8
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +0 -16
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +0 -11
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +0 -36
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +0 -31
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +0 -36
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +0 -31
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +0 -16
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +0 -11
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +0 -18
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +0 -13
- package/shortcutContexts/commands/moveCellSelection/up.js +0 -12
- package/shortcutContexts/commands/moveCellSelection/up.mjs +0 -7
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +0 -29
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +0 -24
- package/shortcutContexts/commands/populateSelectedCellsData.js +0 -35
- package/shortcutContexts/commands/populateSelectedCellsData.mjs +0 -30
- package/shortcutContexts/commands/selectAll.js +0 -11
- package/shortcutContexts/commands/selectAll.mjs +0 -6
- package/shortcutContexts/constants.js +0 -19
- package/shortcutContexts/constants.mjs +0 -12
- package/shortcutContexts/editor.js +0 -29
- package/shortcutContexts/editor.mjs +0 -25
- package/shortcutContexts/grid.js +0 -244
- package/shortcutContexts/grid.mjs +0 -240
- package/shortcutContexts/index.js +0 -29
- package/shortcutContexts/index.mjs +0 -15
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";
|
19
18
|
import "core-js/modules/es.array.sort.js";
|
20
19
|
import "core-js/modules/es.array.splice.js";
|
21
20
|
import "core-js/modules/es.number.is-integer.js";
|
22
21
|
import "core-js/modules/es.number.constructor.js";
|
23
22
|
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,6 +32,7 @@ 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";
|
35
36
|
import "core-js/modules/es.symbol.js";
|
36
37
|
import "core-js/modules/es.symbol.description.js";
|
37
38
|
import "core-js/modules/es.symbol.iterator.js";
|
@@ -65,7 +66,7 @@ import { Selection } from "./selection/index.mjs";
|
|
65
66
|
import { MetaManager, DynamicCellMetaMod, ExtendMetaPropertiesMod, replaceData } from "./dataMap/index.mjs";
|
66
67
|
import { createUniqueMap } from "./utils/dataStructures/uniqueMap.mjs";
|
67
68
|
import { createShortcutManager } from "./shortcuts/index.mjs";
|
68
|
-
|
69
|
+
var SHORTCUTS_GROUP = 'gridDefault';
|
69
70
|
var activeGuid = null;
|
70
71
|
|
71
72
|
/**
|
@@ -289,8 +290,12 @@ export default function Core(rootElement, userSettings) {
|
|
289
290
|
};
|
290
291
|
|
291
292
|
var selection = new Selection(tableMeta, {
|
292
|
-
rowIndexMapper:
|
293
|
-
|
293
|
+
rowIndexMapper: function rowIndexMapper() {
|
294
|
+
return instance.rowIndexMapper;
|
295
|
+
},
|
296
|
+
columnIndexMapper: function columnIndexMapper() {
|
297
|
+
return instance.columnIndexMapper;
|
298
|
+
},
|
294
299
|
countCols: function countCols() {
|
295
300
|
return instance.countCols();
|
296
301
|
},
|
@@ -303,18 +308,12 @@ export default function Core(rootElement, userSettings) {
|
|
303
308
|
isEditorOpened: function isEditorOpened() {
|
304
309
|
return instance.getActiveEditor() ? instance.getActiveEditor().isOpened() : false;
|
305
310
|
},
|
306
|
-
|
311
|
+
countColsTranslated: function countColsTranslated() {
|
307
312
|
return _this.view.countRenderableColumns();
|
308
313
|
},
|
309
|
-
|
314
|
+
countRowsTranslated: function countRowsTranslated() {
|
310
315
|
return _this.view.countRenderableRows();
|
311
316
|
},
|
312
|
-
countRowHeaders: function countRowHeaders() {
|
313
|
-
return _this.countRowHeaders();
|
314
|
-
},
|
315
|
-
countColHeaders: function countColHeaders() {
|
316
|
-
return _this.countColHeaders();
|
317
|
-
},
|
318
317
|
getShortcutManager: function getShortcutManager() {
|
319
318
|
return instance.getShortcutManager();
|
320
319
|
},
|
@@ -347,6 +346,12 @@ export default function Core(rootElement, userSettings) {
|
|
347
346
|
});
|
348
347
|
this.selection.addLocalHook('beforeSetRangeEnd', function (cellCoords) {
|
349
348
|
_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
|
+
}
|
350
355
|
});
|
351
356
|
this.selection.addLocalHook('afterSetRangeEnd', function (cellCoords) {
|
352
357
|
var preventScrolling = createObjectPropListener(false);
|
@@ -372,14 +377,7 @@ export default function Core(rootElement, userSettings) {
|
|
372
377
|
if (scrollToCell !== false) {
|
373
378
|
if (!isSelectedByAnyHeader) {
|
374
379
|
if (currentSelectedRange && !_this.selection.isMultiple()) {
|
375
|
-
|
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
|
-
}
|
380
|
+
_this.view.scrollViewport(visualToRenderableCoords(currentSelectedRange.from));
|
383
381
|
} else {
|
384
382
|
_this.view.scrollViewport(visualToRenderableCoords(cellCoords));
|
385
383
|
}
|
@@ -420,30 +418,6 @@ export default function Core(rootElement, userSettings) {
|
|
420
418
|
isMultiple.value = changedIsMultiple;
|
421
419
|
}
|
422
420
|
});
|
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
|
-
});
|
447
421
|
this.selection.addLocalHook('beforeModifyTransformStart', function (cellCoordsDelta) {
|
448
422
|
_this.runHooks('modifyTransformStart', cellCoordsDelta);
|
449
423
|
});
|
@@ -1602,8 +1576,8 @@ export default function Core(rootElement, userSettings) {
|
|
1602
1576
|
*/
|
1603
1577
|
this.spliceCol = function (column, index, amount) {
|
1604
1578
|
var _datamap;
|
1605
|
-
for (var
|
1606
|
-
elements[
|
1579
|
+
for (var _len = arguments.length, elements = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
1580
|
+
elements[_key - 3] = arguments[_key];
|
1607
1581
|
}
|
1608
1582
|
return (_datamap = datamap).spliceCol.apply(_datamap, [column, index, amount].concat(elements));
|
1609
1583
|
};
|
@@ -1621,8 +1595,8 @@ export default function Core(rootElement, userSettings) {
|
|
1621
1595
|
*/
|
1622
1596
|
this.spliceRow = function (row, index, amount) {
|
1623
1597
|
var _datamap2;
|
1624
|
-
for (var
|
1625
|
-
elements[
|
1598
|
+
for (var _len2 = arguments.length, elements = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
|
1599
|
+
elements[_key2 - 3] = arguments[_key2];
|
1626
1600
|
}
|
1627
1601
|
return (_datamap2 = datamap).spliceRow.apply(_datamap2, [row, index, amount].concat(elements));
|
1628
1602
|
};
|
@@ -1718,9 +1692,6 @@ export default function Core(rootElement, userSettings) {
|
|
1718
1692
|
}
|
1719
1693
|
var changes = [];
|
1720
1694
|
arrayEach(selection.getSelectedRange(), function (cellRange) {
|
1721
|
-
if (cellRange.isSingleHeader()) {
|
1722
|
-
return;
|
1723
|
-
}
|
1724
1695
|
var topStart = cellRange.getTopStartCorner();
|
1725
1696
|
var bottomEnd = cellRange.getBottomEndCorner();
|
1726
1697
|
rangeEach(topStart.row, bottomEnd.row, function (row) {
|
@@ -3035,8 +3006,8 @@ export default function Core(rootElement, userSettings) {
|
|
3035
3006
|
this.spliceCellsMeta = function (visualIndex) {
|
3036
3007
|
var _this5 = this;
|
3037
3008
|
var deleteAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
3038
|
-
for (var
|
3039
|
-
cellMetaRows[
|
3009
|
+
for (var _len3 = arguments.length, cellMetaRows = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
|
3010
|
+
cellMetaRows[_key3 - 2] = arguments[_key3];
|
3040
3011
|
}
|
3041
3012
|
if (cellMetaRows.length > 0 && !Array.isArray(cellMetaRows[0])) {
|
3042
3013
|
throw new Error('The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.');
|
@@ -3730,30 +3701,6 @@ export default function Core(rootElement, userSettings) {
|
|
3730
3701
|
return instance.view._wt.drawn ? instance.view._wt.wtTable.getVisibleColumnsCount() : -1;
|
3731
3702
|
};
|
3732
3703
|
|
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
|
-
|
3757
3704
|
/**
|
3758
3705
|
* Returns the number of empty rows. If the optional ending parameter is `true`, returns the
|
3759
3706
|
* number of empty rows at the bottom of the table.
|
@@ -3958,10 +3905,6 @@ export default function Core(rootElement, userSettings) {
|
|
3958
3905
|
* hot.selectColumns('id');
|
3959
3906
|
* // Select range of columns using visual indexes.
|
3960
3907
|
* 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);
|
3965
3908
|
* // Select range of columns using column properties.
|
3966
3909
|
* hot.selectColumns('id', 'last_name');
|
3967
3910
|
* ```
|
@@ -3972,15 +3915,11 @@ export default function Core(rootElement, userSettings) {
|
|
3972
3915
|
* @param {number} startColumn The visual column index from which the selection starts.
|
3973
3916
|
* @param {number} [endColumn=startColumn] The visual column index to which the selection finishes. If `endColumn`
|
3974
3917
|
* 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.
|
3978
3918
|
* @returns {boolean} `true` if selection was successful, `false` otherwise.
|
3979
3919
|
*/
|
3980
3920
|
this.selectColumns = function (startColumn) {
|
3981
3921
|
var endColumn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startColumn;
|
3982
|
-
|
3983
|
-
return selection.selectColumns(startColumn, endColumn, focusPosition);
|
3922
|
+
return selection.selectColumns(startColumn, endColumn);
|
3984
3923
|
};
|
3985
3924
|
|
3986
3925
|
/**
|
@@ -3990,12 +3929,8 @@ export default function Core(rootElement, userSettings) {
|
|
3990
3929
|
* ```js
|
3991
3930
|
* // Select row using visual index.
|
3992
3931
|
* hot.selectRows(1);
|
3993
|
-
* //
|
3932
|
+
* // Select range of rows using visual indexes.
|
3994
3933
|
* 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);
|
3999
3934
|
* ```
|
4000
3935
|
*
|
4001
3936
|
* @memberof Core#
|
@@ -4004,15 +3939,11 @@ export default function Core(rootElement, userSettings) {
|
|
4004
3939
|
* @param {number} startRow The visual row index from which the selection starts.
|
4005
3940
|
* @param {number} [endRow=startRow] The visual row index to which the selection finishes. If `endRow`
|
4006
3941
|
* 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.
|
4010
3942
|
* @returns {boolean} `true` if selection was successful, `false` otherwise.
|
4011
3943
|
*/
|
4012
3944
|
this.selectRows = function (startRow) {
|
4013
3945
|
var endRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startRow;
|
4014
|
-
|
4015
|
-
return selection.selectRows(startRow, endRow, focusPosition);
|
3946
|
+
return selection.selectRows(startRow, endRow);
|
4016
3947
|
};
|
4017
3948
|
|
4018
3949
|
/**
|
@@ -4031,16 +3962,9 @@ export default function Core(rootElement, userSettings) {
|
|
4031
3962
|
* The previous selection is overwritten.
|
4032
3963
|
*
|
4033
3964
|
* ```js
|
4034
|
-
* // select all cells in the table, including all headers
|
3965
|
+
* // select all cells in the table, including all headers
|
4035
3966
|
* hot.selectAll();
|
4036
3967
|
*
|
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
|
-
*
|
4044
3968
|
* // select all cells in the table, without headers
|
4045
3969
|
* hot.selectAll(false);
|
4046
3970
|
* ```
|
@@ -4048,20 +3972,15 @@ export default function Core(rootElement, userSettings) {
|
|
4048
3972
|
* @since 0.38.2
|
4049
3973
|
* @memberof Core#
|
4050
3974
|
* @function selectAll
|
4051
|
-
* @param {boolean} [
|
4052
|
-
* `false
|
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.
|
3975
|
+
* @param {boolean} [includeHeaders=true] `true`: include all row, column and corner headers.
|
3976
|
+
* `false`: don't include any headers.
|
4058
3977
|
*/
|
4059
3978
|
this.selectAll = function () {
|
4060
|
-
var
|
4061
|
-
var
|
4062
|
-
var
|
3979
|
+
var includeHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
3980
|
+
var includeRowHeaders = includeHeaders && this.hasRowHeaders();
|
3981
|
+
var includeColumnHeaders = includeHeaders && this.hasColHeaders();
|
4063
3982
|
preventScrollingToCell = true;
|
4064
|
-
selection.selectAll(includeRowHeaders, includeColumnHeaders
|
3983
|
+
selection.selectAll(includeRowHeaders, includeColumnHeaders);
|
4065
3984
|
preventScrollingToCell = false;
|
4066
3985
|
};
|
4067
3986
|
var getIndexToScroll = function getIndexToScroll(indexMapper, visualIndex) {
|
@@ -4465,16 +4384,6 @@ export default function Core(rootElement, userSettings) {
|
|
4465
4384
|
}
|
4466
4385
|
};
|
4467
4386
|
|
4468
|
-
/**
|
4469
|
-
* Gets the instance of the EditorManager.
|
4470
|
-
*
|
4471
|
-
* @private
|
4472
|
-
* @returns {EditorManager}
|
4473
|
-
*/
|
4474
|
-
this._getEditorManager = function () {
|
4475
|
-
return editorManager;
|
4476
|
-
};
|
4477
|
-
|
4478
4387
|
/**
|
4479
4388
|
* Check if currently it is RTL direction.
|
4480
4389
|
*
|
@@ -4547,11 +4456,284 @@ export default function Core(rootElement, userSettings) {
|
|
4547
4456
|
this.getShortcutManager = function () {
|
4548
4457
|
return shortcutManager;
|
4549
4458
|
};
|
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);
|
4550
4734
|
getPluginsNames().forEach(function (pluginName) {
|
4551
4735
|
var PluginClass = getPlugin(pluginName);
|
4552
4736
|
pluginsRegistry.addItem(pluginName, new PluginClass(_this));
|
4553
4737
|
});
|
4554
|
-
registerAllShortcutContexts(instance);
|
4555
|
-
shortcutManager.setActiveContextName('grid');
|
4556
4738
|
Hooks.getSingleton().run(instance, 'construct');
|
4557
4739
|
}
|
@@ -3112,25 +3112,6 @@ 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,
|
3134
3115
|
/**
|
3135
3116
|
* @description
|
3136
3117
|
* The `nestedHeaders` option configures the [`NestedHeaders`](@/api/nestedHeaders.md) plugin.
|
@@ -3108,25 +3108,6 @@ 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,
|
3130
3111
|
/**
|
3131
3112
|
* @description
|
3132
3113
|
* The `nestedHeaders` option configures the [`NestedHeaders`](@/api/nestedHeaders.md) plugin.
|