handsontable 0.0.0-next-b7cca45-20230605 → 0.0.0-next-aa25cac-20230607
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 +328 -0
- package/3rdparty/walkontable/src/selection/manager.mjs +322 -0
- package/3rdparty/walkontable/src/selection/scanner.js +363 -0
- package/3rdparty/walkontable/src/selection/scanner.mjs +359 -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 +123 -308
- package/core.mjs +123 -308
- package/dataMap/metaManager/metaSchema.js +15 -0
- package/dataMap/metaManager/metaSchema.mjs +15 -0
- package/dist/handsontable.css +8 -3
- package/dist/handsontable.full.css +8 -3
- package/dist/handsontable.full.js +12578 -10028
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +120 -120
- package/dist/handsontable.js +18881 -16331
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +4 -4
- package/editorManager.js +21 -82
- package/editorManager.mjs +26 -86
- 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/copyPaste/copyPaste.js +5 -1
- package/plugins/copyPaste/copyPaste.mjs +5 -1
- package/plugins/customBorders/customBorders.js +18 -52
- package/plugins/customBorders/customBorders.mjs +19 -53
- package/plugins/mergeCells/mergeCells.js +5 -18
- package/plugins/mergeCells/mergeCells.mjs +5 -18
- 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/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
- package/selection/highlight/highlight.js +311 -88
- package/selection/highlight/highlight.mjs +301 -84
- 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 -180
- package/selection/selection.mjs +310 -179
- package/selection/transformation.js +233 -96
- package/selection/transformation.mjs +230 -93
- package/selection/utils.js +12 -35
- package/selection/utils.mjs +13 -35
- 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 +39 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +34 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +39 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +34 -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 +51 -0
- package/shortcutContexts/commands/index.mjs +47 -0
- package/shortcutContexts/commands/moveCellSelection/down.js +12 -0
- package/shortcutContexts/commands/moveCellSelection/down.mjs +7 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +11 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +6 -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 +35 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +30 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +35 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +30 -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 +11 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +6 -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 +244 -0
- package/shortcutContexts/grid.mjs +240 -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/tableView.js +58 -9
- package/tableView.mjs +58 -9
- package/3rdparty/walkontable/src/selection.js +0 -354
- package/3rdparty/walkontable/src/selection.mjs +0 -348
- package/selection/highlight/constants.js +0 -16
- package/selection/highlight/constants.mjs +0 -6
package/core.js
CHANGED
@@ -13,12 +13,12 @@ require("core-js/modules/es.set.js");
|
|
13
13
|
require("core-js/modules/es.string.iterator.js");
|
14
14
|
require("core-js/modules/web.dom-collections.iterator.js");
|
15
15
|
require("core-js/modules/es.array.includes.js");
|
16
|
+
require("core-js/modules/es.array.concat.js");
|
16
17
|
require("core-js/modules/es.array.sort.js");
|
17
18
|
require("core-js/modules/es.array.splice.js");
|
18
19
|
require("core-js/modules/es.number.is-integer.js");
|
19
20
|
require("core-js/modules/es.number.constructor.js");
|
20
21
|
require("core-js/modules/es.array.slice.js");
|
21
|
-
require("core-js/modules/es.array.concat.js");
|
22
22
|
require("core-js/modules/es.array.fill.js");
|
23
23
|
require("core-js/modules/es.array.map.js");
|
24
24
|
require("core-js/modules/es.regexp.exec.js");
|
@@ -29,7 +29,6 @@ require("core-js/modules/es.array.reverse.js");
|
|
29
29
|
require("core-js/modules/web.dom-collections.for-each.js");
|
30
30
|
require("core-js/modules/web.timers.js");
|
31
31
|
require("core-js/modules/web.immediate.js");
|
32
|
-
require("core-js/modules/es.map.js");
|
33
32
|
var _element = require("./helpers/dom/element");
|
34
33
|
var _function = require("./helpers/function");
|
35
34
|
var _mixed = require("./helpers/mixed");
|
@@ -60,6 +59,7 @@ var _selection = require("./selection");
|
|
60
59
|
var _dataMap = require("./dataMap");
|
61
60
|
var _uniqueMap = require("./utils/dataStructures/uniqueMap");
|
62
61
|
var _shortcuts = require("./shortcuts");
|
62
|
+
var _shortcutContexts = require("./shortcutContexts");
|
63
63
|
var _templateObject, _templateObject2;
|
64
64
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
65
65
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
@@ -74,7 +74,6 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
74
74
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
75
75
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
76
76
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
77
|
-
var SHORTCUTS_GROUP = 'gridDefault';
|
78
77
|
var activeGuid = null;
|
79
78
|
var deprecationWarns = new Set();
|
80
79
|
|
@@ -291,12 +290,8 @@ function Core(rootElement, userSettings) {
|
|
291
290
|
};
|
292
291
|
|
293
292
|
var selection = new _selection.Selection(tableMeta, {
|
294
|
-
rowIndexMapper:
|
295
|
-
|
296
|
-
},
|
297
|
-
columnIndexMapper: function columnIndexMapper() {
|
298
|
-
return instance.columnIndexMapper;
|
299
|
-
},
|
293
|
+
rowIndexMapper: instance.rowIndexMapper,
|
294
|
+
columnIndexMapper: instance.columnIndexMapper,
|
300
295
|
countCols: function countCols() {
|
301
296
|
return instance.countCols();
|
302
297
|
},
|
@@ -309,12 +304,18 @@ function Core(rootElement, userSettings) {
|
|
309
304
|
isEditorOpened: function isEditorOpened() {
|
310
305
|
return instance.getActiveEditor() ? instance.getActiveEditor().isOpened() : false;
|
311
306
|
},
|
312
|
-
|
307
|
+
countRenderableColumns: function countRenderableColumns() {
|
313
308
|
return _this.view.countRenderableColumns();
|
314
309
|
},
|
315
|
-
|
310
|
+
countRenderableRows: function countRenderableRows() {
|
316
311
|
return _this.view.countRenderableRows();
|
317
312
|
},
|
313
|
+
countRowHeaders: function countRowHeaders() {
|
314
|
+
return _this.countRowHeaders();
|
315
|
+
},
|
316
|
+
countColHeaders: function countColHeaders() {
|
317
|
+
return _this.countColHeaders();
|
318
|
+
},
|
318
319
|
getShortcutManager: function getShortcutManager() {
|
319
320
|
return instance.getShortcutManager();
|
320
321
|
},
|
@@ -347,12 +348,6 @@ function Core(rootElement, userSettings) {
|
|
347
348
|
});
|
348
349
|
this.selection.addLocalHook('beforeSetRangeEnd', function (cellCoords) {
|
349
350
|
_this.runHooks('beforeSetRangeEnd', cellCoords);
|
350
|
-
if (cellCoords.row < 0) {
|
351
|
-
cellCoords.row = _this.view._wt.wtTable.getFirstVisibleRow();
|
352
|
-
}
|
353
|
-
if (cellCoords.col < 0) {
|
354
|
-
cellCoords.col = _this.view._wt.wtTable.getFirstVisibleColumn();
|
355
|
-
}
|
356
351
|
});
|
357
352
|
this.selection.addLocalHook('afterSetRangeEnd', function (cellCoords) {
|
358
353
|
var preventScrolling = (0, _object.createObjectPropListener)(false);
|
@@ -378,7 +373,14 @@ function Core(rootElement, userSettings) {
|
|
378
373
|
if (scrollToCell !== false) {
|
379
374
|
if (!isSelectedByAnyHeader) {
|
380
375
|
if (currentSelectedRange && !_this.selection.isMultiple()) {
|
381
|
-
|
376
|
+
var renderableCoords = visualToRenderableCoords(currentSelectedRange.from);
|
377
|
+
if (renderableCoords.row < 0 && renderableCoords.col >= 0) {
|
378
|
+
_this.view.scrollViewportHorizontally(renderableCoords.col);
|
379
|
+
} else if (renderableCoords.col < 0 && renderableCoords.row >= 0) {
|
380
|
+
_this.view.scrollViewportVertically(renderableCoords.row);
|
381
|
+
} else {
|
382
|
+
_this.view.scrollViewport(renderableCoords);
|
383
|
+
}
|
382
384
|
} else {
|
383
385
|
_this.view.scrollViewport(visualToRenderableCoords(cellCoords));
|
384
386
|
}
|
@@ -419,6 +421,30 @@ function Core(rootElement, userSettings) {
|
|
419
421
|
isMultiple.value = changedIsMultiple;
|
420
422
|
}
|
421
423
|
});
|
424
|
+
this.selection.addLocalHook('beforeSelectColumns', function () {
|
425
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
426
|
+
args[_key] = arguments[_key];
|
427
|
+
}
|
428
|
+
return _this.runHooks.apply(_this, ['beforeSelectColumns'].concat(args));
|
429
|
+
});
|
430
|
+
this.selection.addLocalHook('afterSelectColumns', function () {
|
431
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
432
|
+
args[_key2] = arguments[_key2];
|
433
|
+
}
|
434
|
+
return _this.runHooks.apply(_this, ['afterSelectColumns'].concat(args));
|
435
|
+
});
|
436
|
+
this.selection.addLocalHook('beforeSelectRows', function () {
|
437
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
438
|
+
args[_key3] = arguments[_key3];
|
439
|
+
}
|
440
|
+
return _this.runHooks.apply(_this, ['beforeSelectRows'].concat(args));
|
441
|
+
});
|
442
|
+
this.selection.addLocalHook('afterSelectRows', function () {
|
443
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
444
|
+
args[_key4] = arguments[_key4];
|
445
|
+
}
|
446
|
+
return _this.runHooks.apply(_this, ['afterSelectRows'].concat(args));
|
447
|
+
});
|
422
448
|
this.selection.addLocalHook('beforeModifyTransformStart', function (cellCoordsDelta) {
|
423
449
|
_this.runHooks('modifyTransformStart', cellCoordsDelta);
|
424
450
|
});
|
@@ -1603,8 +1629,8 @@ function Core(rootElement, userSettings) {
|
|
1603
1629
|
*/
|
1604
1630
|
this.spliceCol = function (column, index, amount) {
|
1605
1631
|
var _datamap;
|
1606
|
-
for (var
|
1607
|
-
elements[
|
1632
|
+
for (var _len5 = arguments.length, elements = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
|
1633
|
+
elements[_key5 - 3] = arguments[_key5];
|
1608
1634
|
}
|
1609
1635
|
return (_datamap = datamap).spliceCol.apply(_datamap, [column, index, amount].concat(elements));
|
1610
1636
|
};
|
@@ -1622,8 +1648,8 @@ function Core(rootElement, userSettings) {
|
|
1622
1648
|
*/
|
1623
1649
|
this.spliceRow = function (row, index, amount) {
|
1624
1650
|
var _datamap2;
|
1625
|
-
for (var
|
1626
|
-
elements[
|
1651
|
+
for (var _len6 = arguments.length, elements = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
|
1652
|
+
elements[_key6 - 3] = arguments[_key6];
|
1627
1653
|
}
|
1628
1654
|
return (_datamap2 = datamap).spliceRow.apply(_datamap2, [row, index, amount].concat(elements));
|
1629
1655
|
};
|
@@ -3037,8 +3063,8 @@ function Core(rootElement, userSettings) {
|
|
3037
3063
|
this.spliceCellsMeta = function (visualIndex) {
|
3038
3064
|
var _this5 = this;
|
3039
3065
|
var deleteAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
3040
|
-
for (var
|
3041
|
-
cellMetaRows[
|
3066
|
+
for (var _len7 = arguments.length, cellMetaRows = new Array(_len7 > 2 ? _len7 - 2 : 0), _key7 = 2; _key7 < _len7; _key7++) {
|
3067
|
+
cellMetaRows[_key7 - 2] = arguments[_key7];
|
3042
3068
|
}
|
3043
3069
|
if (cellMetaRows.length > 0 && !Array.isArray(cellMetaRows[0])) {
|
3044
3070
|
throw new Error('The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.');
|
@@ -3732,6 +3758,30 @@ function Core(rootElement, userSettings) {
|
|
3732
3758
|
return instance.view._wt.drawn ? instance.view._wt.wtTable.getVisibleColumnsCount() : -1;
|
3733
3759
|
};
|
3734
3760
|
|
3761
|
+
/**
|
3762
|
+
* Returns the number of rendered row headers.
|
3763
|
+
*
|
3764
|
+
* @since 13.0.0
|
3765
|
+
* @memberof Core#
|
3766
|
+
* @function countRowHeaders
|
3767
|
+
* @returns {number} Number of row headers.
|
3768
|
+
*/
|
3769
|
+
this.countRowHeaders = function () {
|
3770
|
+
return this.view.getRowHeadersCount();
|
3771
|
+
};
|
3772
|
+
|
3773
|
+
/**
|
3774
|
+
* Returns the number of rendered column headers.
|
3775
|
+
*
|
3776
|
+
* @since 13.0.0
|
3777
|
+
* @memberof Core#
|
3778
|
+
* @function countColHeaders
|
3779
|
+
* @returns {number} Number of column headers.
|
3780
|
+
*/
|
3781
|
+
this.countColHeaders = function () {
|
3782
|
+
return this.view.getColumnHeadersCount();
|
3783
|
+
};
|
3784
|
+
|
3735
3785
|
/**
|
3736
3786
|
* Returns the number of empty rows. If the optional ending parameter is `true`, returns the
|
3737
3787
|
* number of empty rows at the bottom of the table.
|
@@ -3936,6 +3986,10 @@ function Core(rootElement, userSettings) {
|
|
3936
3986
|
* hot.selectColumns('id');
|
3937
3987
|
* // Select range of columns using visual indexes.
|
3938
3988
|
* hot.selectColumns(1, 4);
|
3989
|
+
* // Select range of columns using visual indexes and mark the first header as highlighted.
|
3990
|
+
* hot.selectColumns(1, 2, -1);
|
3991
|
+
* // Select range of columns using visual indexes and mark the second cell as highlighted.
|
3992
|
+
* hot.selectColumns(2, 1, 1);
|
3939
3993
|
* // Select range of columns using column properties.
|
3940
3994
|
* hot.selectColumns('id', 'last_name');
|
3941
3995
|
* ```
|
@@ -3946,11 +4000,15 @@ function Core(rootElement, userSettings) {
|
|
3946
4000
|
* @param {number} startColumn The visual column index from which the selection starts.
|
3947
4001
|
* @param {number} [endColumn=startColumn] The visual column index to which the selection finishes. If `endColumn`
|
3948
4002
|
* is not defined the column defined by `startColumn` will be selected.
|
4003
|
+
* @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
|
4004
|
+
* The value can take visual row index from -N to N, where negative values
|
4005
|
+
* point to the headers and positive values point to the cell range.
|
3949
4006
|
* @returns {boolean} `true` if selection was successful, `false` otherwise.
|
3950
4007
|
*/
|
3951
4008
|
this.selectColumns = function (startColumn) {
|
3952
4009
|
var endColumn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startColumn;
|
3953
|
-
|
4010
|
+
var focusPosition = arguments.length > 2 ? arguments[2] : undefined;
|
4011
|
+
return selection.selectColumns(startColumn, endColumn, focusPosition);
|
3954
4012
|
};
|
3955
4013
|
|
3956
4014
|
/**
|
@@ -3962,6 +4020,10 @@ function Core(rootElement, userSettings) {
|
|
3962
4020
|
* hot.selectRows(1);
|
3963
4021
|
* // Select range of rows using visual indexes.
|
3964
4022
|
* hot.selectRows(1, 4);
|
4023
|
+
* // Select range of rows using visual indexes and mark the first header as highlighted.
|
4024
|
+
* hot.selectRows(1, 2, -1);
|
4025
|
+
* // Select range of rows using visual indexes and mark the second cell as highlighted.
|
4026
|
+
* hot.selectRows(2, 1, 1);
|
3965
4027
|
* ```
|
3966
4028
|
*
|
3967
4029
|
* @memberof Core#
|
@@ -3970,11 +4032,15 @@ function Core(rootElement, userSettings) {
|
|
3970
4032
|
* @param {number} startRow The visual row index from which the selection starts.
|
3971
4033
|
* @param {number} [endRow=startRow] The visual row index to which the selection finishes. If `endRow`
|
3972
4034
|
* is not defined the row defined by `startRow` will be selected.
|
4035
|
+
* @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
|
4036
|
+
* The value can take visual column index from -N to N, where negative values
|
4037
|
+
* point to the headers and positive values point to the cell range.
|
3973
4038
|
* @returns {boolean} `true` if selection was successful, `false` otherwise.
|
3974
4039
|
*/
|
3975
4040
|
this.selectRows = function (startRow) {
|
3976
4041
|
var endRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startRow;
|
3977
|
-
|
4042
|
+
var focusPosition = arguments.length > 2 ? arguments[2] : undefined;
|
4043
|
+
return selection.selectRows(startRow, endRow, focusPosition);
|
3978
4044
|
};
|
3979
4045
|
|
3980
4046
|
/**
|
@@ -3993,9 +4059,16 @@ function Core(rootElement, userSettings) {
|
|
3993
4059
|
* The previous selection is overwritten.
|
3994
4060
|
*
|
3995
4061
|
* ```js
|
3996
|
-
* // select all cells in the table, including all headers
|
4062
|
+
* // select all cells in the table, including all headers with corner
|
3997
4063
|
* hot.selectAll();
|
3998
4064
|
*
|
4065
|
+
* // select all cells in the table, including row headers without corner
|
4066
|
+
* hot.selectAll(true, false);
|
4067
|
+
*
|
4068
|
+
* // select all cells in the table, including all headers with corner but move the focus
|
4069
|
+
* // highlight to position -2,-1
|
4070
|
+
* hot.selectAll(true, true, { row: -2, col: -1 });
|
4071
|
+
*
|
3999
4072
|
* // select all cells in the table, without headers
|
4000
4073
|
* hot.selectAll(false);
|
4001
4074
|
* ```
|
@@ -4003,15 +4076,20 @@ function Core(rootElement, userSettings) {
|
|
4003
4076
|
* @since 0.38.2
|
4004
4077
|
* @memberof Core#
|
4005
4078
|
* @function selectAll
|
4006
|
-
* @param {boolean} [
|
4007
|
-
* `false
|
4079
|
+
* @param {boolean} [includeRowHeaders=false] `true` If the selection should include the row headers,
|
4080
|
+
* `false` otherwise.
|
4081
|
+
* @param {boolean} [includeColumnHeaders=false] `true` If the selection should include the column
|
4082
|
+
* headers, `false` otherwise.
|
4083
|
+
* @param {{row: number, col: number}} [focusPosition] The argument allows changing the cell/header
|
4084
|
+
* focus position. The value takes an object with a `row` and `col` properties (visual indexes)
|
4085
|
+
* from -N to N, where negative values point to the headers and positive values point to the cell range.
|
4008
4086
|
*/
|
4009
4087
|
this.selectAll = function () {
|
4010
|
-
var
|
4011
|
-
var
|
4012
|
-
var
|
4088
|
+
var includeRowHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
4089
|
+
var includeColumnHeaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : includeRowHeaders;
|
4090
|
+
var focusPosition = arguments.length > 2 ? arguments[2] : undefined;
|
4013
4091
|
preventScrollingToCell = true;
|
4014
|
-
selection.selectAll(includeRowHeaders, includeColumnHeaders);
|
4092
|
+
selection.selectAll(includeRowHeaders, includeColumnHeaders, focusPosition);
|
4015
4093
|
preventScrollingToCell = false;
|
4016
4094
|
};
|
4017
4095
|
var getIndexToScroll = function getIndexToScroll(indexMapper, visualIndex) {
|
@@ -4415,6 +4493,16 @@ function Core(rootElement, userSettings) {
|
|
4415
4493
|
}
|
4416
4494
|
};
|
4417
4495
|
|
4496
|
+
/**
|
4497
|
+
* Gets the instance of the EditorManager.
|
4498
|
+
*
|
4499
|
+
* @private
|
4500
|
+
* @returns {EditorManager}
|
4501
|
+
*/
|
4502
|
+
this._getEditorManager = function () {
|
4503
|
+
return editorManager;
|
4504
|
+
};
|
4505
|
+
|
4418
4506
|
/**
|
4419
4507
|
* Check if currently it is RTL direction.
|
4420
4508
|
*
|
@@ -4487,284 +4575,11 @@ function Core(rootElement, userSettings) {
|
|
4487
4575
|
this.getShortcutManager = function () {
|
4488
4576
|
return shortcutManager;
|
4489
4577
|
};
|
4490
|
-
var gridContext = shortcutManager.addContext('grid');
|
4491
|
-
var gridConfig = {
|
4492
|
-
runOnlyIf: function runOnlyIf() {
|
4493
|
-
return (0, _mixed.isDefined)(instance.getSelected()) && instance.countRenderedRows() > 0 && instance.countRenderedCols() > 0;
|
4494
|
-
},
|
4495
|
-
group: SHORTCUTS_GROUP
|
4496
|
-
};
|
4497
|
-
shortcutManager.setActiveContextName('grid');
|
4498
|
-
gridContext.addShortcuts([{
|
4499
|
-
keys: [['Control/Meta', 'A']],
|
4500
|
-
callback: function callback() {
|
4501
|
-
instance.selectAll();
|
4502
|
-
}
|
4503
|
-
}, {
|
4504
|
-
keys: [['Control/Meta', 'Enter']],
|
4505
|
-
callback: function callback() {
|
4506
|
-
var selectedRange = instance.getSelectedRange();
|
4507
|
-
var _selectedRange$highli = selectedRange[selectedRange.length - 1].highlight,
|
4508
|
-
highlightRow = _selectedRange$highli.row,
|
4509
|
-
highlightColumn = _selectedRange$highli.col;
|
4510
|
-
var valueToPopulate = instance.getDataAtCell(highlightRow, highlightColumn);
|
4511
|
-
var cellValues = new Map();
|
4512
|
-
for (var i = 0; i < selectedRange.length; i++) {
|
4513
|
-
selectedRange[i].forAll(function (row, column) {
|
4514
|
-
if (row >= 0 && column >= 0 && (row !== highlightRow || column !== highlightColumn)) {
|
4515
|
-
var _instance$getCellMeta = instance.getCellMeta(row, column),
|
4516
|
-
readOnly = _instance$getCellMeta.readOnly;
|
4517
|
-
if (!readOnly) {
|
4518
|
-
cellValues.set("".concat(row, "x").concat(column), [row, column, valueToPopulate]);
|
4519
|
-
}
|
4520
|
-
}
|
4521
|
-
});
|
4522
|
-
}
|
4523
|
-
instance.setDataAtCell(Array.from(cellValues.values()));
|
4524
|
-
},
|
4525
|
-
runOnlyIf: function runOnlyIf() {
|
4526
|
-
return instance.getSelectedRangeLast().getCellsCount() > 1;
|
4527
|
-
}
|
4528
|
-
}, {
|
4529
|
-
keys: [['ArrowUp']],
|
4530
|
-
callback: function callback() {
|
4531
|
-
selection.transformStart(-1, 0);
|
4532
|
-
}
|
4533
|
-
}, {
|
4534
|
-
keys: [['ArrowUp', 'Control/Meta']],
|
4535
|
-
captureCtrl: true,
|
4536
|
-
callback: function callback() {
|
4537
|
-
selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1), instance.getSelectedRangeLast().highlight.col));
|
4538
|
-
}
|
4539
|
-
}, {
|
4540
|
-
keys: [['ArrowUp', 'Shift']],
|
4541
|
-
callback: function callback() {
|
4542
|
-
selection.transformEnd(-1, 0);
|
4543
|
-
}
|
4544
|
-
}, {
|
4545
|
-
keys: [['ArrowUp', 'Shift', 'Control/Meta']],
|
4546
|
-
captureCtrl: true,
|
4547
|
-
callback: function callback() {
|
4548
|
-
var _instance$getSelected = instance.getSelectedRangeLast(),
|
4549
|
-
from = _instance$getSelected.from,
|
4550
|
-
to = _instance$getSelected.to;
|
4551
|
-
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1);
|
4552
|
-
selection.setRangeStart(from.clone());
|
4553
|
-
selection.setRangeEnd(instance._createCellCoords(row, to.col));
|
4554
|
-
},
|
4555
|
-
runOnlyIf: function runOnlyIf() {
|
4556
|
-
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader());
|
4557
|
-
}
|
4558
|
-
}, {
|
4559
|
-
keys: [['ArrowDown']],
|
4560
|
-
callback: function callback() {
|
4561
|
-
selection.transformStart(1, 0);
|
4562
|
-
}
|
4563
|
-
}, {
|
4564
|
-
keys: [['ArrowDown', 'Control/Meta']],
|
4565
|
-
captureCtrl: true,
|
4566
|
-
callback: function callback() {
|
4567
|
-
selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1), instance.getSelectedRangeLast().highlight.col));
|
4568
|
-
}
|
4569
|
-
}, {
|
4570
|
-
keys: [['ArrowDown', 'Shift']],
|
4571
|
-
callback: function callback() {
|
4572
|
-
selection.transformEnd(1, 0);
|
4573
|
-
}
|
4574
|
-
}, {
|
4575
|
-
keys: [['ArrowDown', 'Shift', 'Control/Meta']],
|
4576
|
-
captureCtrl: true,
|
4577
|
-
callback: function callback() {
|
4578
|
-
var _instance$getSelected2 = instance.getSelectedRangeLast(),
|
4579
|
-
from = _instance$getSelected2.from,
|
4580
|
-
to = _instance$getSelected2.to;
|
4581
|
-
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1);
|
4582
|
-
selection.setRangeStart(from.clone());
|
4583
|
-
selection.setRangeEnd(instance._createCellCoords(row, to.col));
|
4584
|
-
},
|
4585
|
-
runOnlyIf: function runOnlyIf() {
|
4586
|
-
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader());
|
4587
|
-
}
|
4588
|
-
}, {
|
4589
|
-
keys: [['ArrowLeft']],
|
4590
|
-
callback: function callback() {
|
4591
|
-
selection.transformStart(0, -1 * instance.getDirectionFactor());
|
4592
|
-
}
|
4593
|
-
}, {
|
4594
|
-
keys: [['ArrowLeft', 'Control/Meta']],
|
4595
|
-
captureCtrl: true,
|
4596
|
-
callback: function callback() {
|
4597
|
-
var _instance$columnIndex;
|
4598
|
-
var row = instance.getSelectedRangeLast().highlight.row;
|
4599
|
-
var column = (_instance$columnIndex = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex, _toConsumableArray(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
|
4600
|
-
selection.setRangeStart(instance._createCellCoords(row, column));
|
4601
|
-
}
|
4602
|
-
}, {
|
4603
|
-
keys: [['ArrowLeft', 'Shift']],
|
4604
|
-
callback: function callback() {
|
4605
|
-
selection.transformEnd(0, -1 * instance.getDirectionFactor());
|
4606
|
-
}
|
4607
|
-
}, {
|
4608
|
-
keys: [['ArrowLeft', 'Shift', 'Control/Meta']],
|
4609
|
-
captureCtrl: true,
|
4610
|
-
callback: function callback() {
|
4611
|
-
var _instance$columnIndex2;
|
4612
|
-
var _instance$getSelected3 = instance.getSelectedRangeLast(),
|
4613
|
-
from = _instance$getSelected3.from,
|
4614
|
-
to = _instance$getSelected3.to;
|
4615
|
-
var column = (_instance$columnIndex2 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex2, _toConsumableArray(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
|
4616
|
-
selection.setRangeStart(from.clone());
|
4617
|
-
selection.setRangeEnd(instance._createCellCoords(to.row, column));
|
4618
|
-
},
|
4619
|
-
runOnlyIf: function runOnlyIf() {
|
4620
|
-
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader());
|
4621
|
-
}
|
4622
|
-
}, {
|
4623
|
-
keys: [['ArrowRight']],
|
4624
|
-
callback: function callback() {
|
4625
|
-
selection.transformStart(0, instance.getDirectionFactor());
|
4626
|
-
}
|
4627
|
-
}, {
|
4628
|
-
keys: [['ArrowRight', 'Control/Meta']],
|
4629
|
-
captureCtrl: true,
|
4630
|
-
callback: function callback() {
|
4631
|
-
var _instance$columnIndex3;
|
4632
|
-
var row = instance.getSelectedRangeLast().highlight.row;
|
4633
|
-
var column = (_instance$columnIndex3 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex3, _toConsumableArray(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
|
4634
|
-
selection.setRangeStart(instance._createCellCoords(row, column));
|
4635
|
-
}
|
4636
|
-
}, {
|
4637
|
-
keys: [['ArrowRight', 'Shift']],
|
4638
|
-
callback: function callback() {
|
4639
|
-
selection.transformEnd(0, instance.getDirectionFactor());
|
4640
|
-
}
|
4641
|
-
}, {
|
4642
|
-
keys: [['ArrowRight', 'Shift', 'Control/Meta']],
|
4643
|
-
captureCtrl: true,
|
4644
|
-
callback: function callback() {
|
4645
|
-
var _instance$columnIndex4;
|
4646
|
-
var _instance$getSelected4 = instance.getSelectedRangeLast(),
|
4647
|
-
from = _instance$getSelected4.from,
|
4648
|
-
to = _instance$getSelected4.to;
|
4649
|
-
var column = (_instance$columnIndex4 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex4, _toConsumableArray(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
|
4650
|
-
selection.setRangeStart(from.clone());
|
4651
|
-
selection.setRangeEnd(instance._createCellCoords(to.row, column));
|
4652
|
-
},
|
4653
|
-
runOnlyIf: function runOnlyIf() {
|
4654
|
-
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader());
|
4655
|
-
}
|
4656
|
-
}, {
|
4657
|
-
keys: [['Home']],
|
4658
|
-
captureCtrl: true,
|
4659
|
-
callback: function callback() {
|
4660
|
-
var fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
|
4661
|
-
var row = instance.getSelectedRangeLast().highlight.row;
|
4662
|
-
var column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
|
4663
|
-
selection.setRangeStart(instance._createCellCoords(row, column));
|
4664
|
-
},
|
4665
|
-
runOnlyIf: function runOnlyIf() {
|
4666
|
-
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4667
|
-
}
|
4668
|
-
}, {
|
4669
|
-
keys: [['Home', 'Shift']],
|
4670
|
-
callback: function callback() {
|
4671
|
-
selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(0, 1)));
|
4672
|
-
}
|
4673
|
-
}, {
|
4674
|
-
keys: [['Home', 'Control/Meta']],
|
4675
|
-
captureCtrl: true,
|
4676
|
-
callback: function callback() {
|
4677
|
-
var fixedRows = parseInt(instance.getSettings().fixedRowsTop, 10);
|
4678
|
-
var fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
|
4679
|
-
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(fixedRows, 1);
|
4680
|
-
var column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
|
4681
|
-
selection.setRangeStart(instance._createCellCoords(row, column));
|
4682
|
-
},
|
4683
|
-
runOnlyIf: function runOnlyIf() {
|
4684
|
-
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4685
|
-
}
|
4686
|
-
}, {
|
4687
|
-
keys: [['End']],
|
4688
|
-
captureCtrl: true,
|
4689
|
-
callback: function callback() {
|
4690
|
-
selection.setRangeStart(instance._createCellCoords(instance.getSelectedRangeLast().highlight.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
|
4691
|
-
},
|
4692
|
-
runOnlyIf: function runOnlyIf() {
|
4693
|
-
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4694
|
-
}
|
4695
|
-
}, {
|
4696
|
-
keys: [['End', 'Shift']],
|
4697
|
-
callback: function callback() {
|
4698
|
-
selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
|
4699
|
-
}
|
4700
|
-
}, {
|
4701
|
-
keys: [['End', 'Control/Meta']],
|
4702
|
-
captureCtrl: true,
|
4703
|
-
callback: function callback() {
|
4704
|
-
var fixedRows = parseInt(instance.getSettings().fixedRowsBottom, 10);
|
4705
|
-
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - fixedRows - 1, -1);
|
4706
|
-
var column = instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1);
|
4707
|
-
selection.setRangeStart(instance._createCellCoords(row, column));
|
4708
|
-
},
|
4709
|
-
runOnlyIf: function runOnlyIf() {
|
4710
|
-
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4711
|
-
}
|
4712
|
-
}, {
|
4713
|
-
keys: [['PageUp']],
|
4714
|
-
callback: function callback() {
|
4715
|
-
selection.transformStart(-instance.countVisibleRows(), 0);
|
4716
|
-
}
|
4717
|
-
}, {
|
4718
|
-
keys: [['PageUp', 'Shift']],
|
4719
|
-
callback: function callback() {
|
4720
|
-
var _instance$getSelected5 = instance.getSelectedRangeLast(),
|
4721
|
-
to = _instance$getSelected5.to;
|
4722
|
-
var nextRowIndexToSelect = Math.max(to.row - instance.countVisibleRows(), 0);
|
4723
|
-
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, 1);
|
4724
|
-
if (row !== null) {
|
4725
|
-
var coords = instance._createCellCoords(row, to.col);
|
4726
|
-
var scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
|
4727
|
-
var nextVerticalScroll = Math.max(coords.row - scrollPadding, 0);
|
4728
|
-
selection.setRangeEnd(coords);
|
4729
|
-
instance.scrollViewportTo(nextVerticalScroll);
|
4730
|
-
}
|
4731
|
-
}
|
4732
|
-
}, {
|
4733
|
-
keys: [['PageDown']],
|
4734
|
-
callback: function callback() {
|
4735
|
-
selection.transformStart(instance.countVisibleRows(), 0);
|
4736
|
-
}
|
4737
|
-
}, {
|
4738
|
-
keys: [['PageDown', 'Shift']],
|
4739
|
-
callback: function callback() {
|
4740
|
-
var _instance$getSelected6 = instance.getSelectedRangeLast(),
|
4741
|
-
to = _instance$getSelected6.to;
|
4742
|
-
var nextRowIndexToSelect = Math.min(to.row + instance.countVisibleRows(), instance.countRows() - 1);
|
4743
|
-
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, -1);
|
4744
|
-
if (row !== null) {
|
4745
|
-
var coords = instance._createCellCoords(row, to.col);
|
4746
|
-
var scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
|
4747
|
-
var nextVerticalScroll = Math.min(coords.row - scrollPadding, instance.countRows() - 1);
|
4748
|
-
selection.setRangeEnd(coords);
|
4749
|
-
instance.scrollViewportTo(nextVerticalScroll);
|
4750
|
-
}
|
4751
|
-
}
|
4752
|
-
}, {
|
4753
|
-
keys: [['Tab']],
|
4754
|
-
callback: function callback(event) {
|
4755
|
-
var tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
4756
|
-
selection.transformStart(tabMoves.row, tabMoves.col, true);
|
4757
|
-
}
|
4758
|
-
}, {
|
4759
|
-
keys: [['Shift', 'Tab']],
|
4760
|
-
callback: function callback(event) {
|
4761
|
-
var tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
4762
|
-
selection.transformStart(-tabMoves.row, -tabMoves.col);
|
4763
|
-
}
|
4764
|
-
}], gridConfig);
|
4765
4578
|
(0, _registry.getPluginsNames)().forEach(function (pluginName) {
|
4766
4579
|
var PluginClass = (0, _registry.getPlugin)(pluginName);
|
4767
4580
|
pluginsRegistry.addItem(pluginName, new PluginClass(_this));
|
4768
4581
|
});
|
4582
|
+
(0, _shortcutContexts.registerAllShortcutContexts)(instance);
|
4583
|
+
shortcutManager.setActiveContextName('grid');
|
4769
4584
|
_pluginHooks.default.getSingleton().run(instance, 'construct');
|
4770
4585
|
}
|