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.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");
|
17
16
|
require("core-js/modules/es.array.sort.js");
|
18
17
|
require("core-js/modules/es.array.splice.js");
|
19
18
|
require("core-js/modules/es.number.is-integer.js");
|
20
19
|
require("core-js/modules/es.number.constructor.js");
|
21
20
|
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");
|
@@ -30,6 +30,7 @@ require("core-js/modules/es.array.reverse.js");
|
|
30
30
|
require("core-js/modules/web.dom-collections.for-each.js");
|
31
31
|
require("core-js/modules/web.timers.js");
|
32
32
|
require("core-js/modules/web.immediate.js");
|
33
|
+
require("core-js/modules/es.map.js");
|
33
34
|
var _element = require("./helpers/dom/element");
|
34
35
|
var _function = require("./helpers/function");
|
35
36
|
var _mixed = require("./helpers/mixed");
|
@@ -58,7 +59,6 @@ var _selection = require("./selection");
|
|
58
59
|
var _dataMap = require("./dataMap");
|
59
60
|
var _uniqueMap = require("./utils/dataStructures/uniqueMap");
|
60
61
|
var _shortcuts = require("./shortcuts");
|
61
|
-
var _shortcutContexts = require("./shortcutContexts");
|
62
62
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
63
63
|
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); }
|
64
64
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
@@ -71,6 +71,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
71
71
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
72
72
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
73
73
|
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; }
|
74
|
+
var SHORTCUTS_GROUP = 'gridDefault';
|
74
75
|
var activeGuid = null;
|
75
76
|
|
76
77
|
/**
|
@@ -294,8 +295,12 @@ function Core(rootElement, userSettings) {
|
|
294
295
|
};
|
295
296
|
|
296
297
|
var selection = new _selection.Selection(tableMeta, {
|
297
|
-
rowIndexMapper:
|
298
|
-
|
298
|
+
rowIndexMapper: function rowIndexMapper() {
|
299
|
+
return instance.rowIndexMapper;
|
300
|
+
},
|
301
|
+
columnIndexMapper: function columnIndexMapper() {
|
302
|
+
return instance.columnIndexMapper;
|
303
|
+
},
|
299
304
|
countCols: function countCols() {
|
300
305
|
return instance.countCols();
|
301
306
|
},
|
@@ -308,18 +313,12 @@ function Core(rootElement, userSettings) {
|
|
308
313
|
isEditorOpened: function isEditorOpened() {
|
309
314
|
return instance.getActiveEditor() ? instance.getActiveEditor().isOpened() : false;
|
310
315
|
},
|
311
|
-
|
316
|
+
countColsTranslated: function countColsTranslated() {
|
312
317
|
return _this.view.countRenderableColumns();
|
313
318
|
},
|
314
|
-
|
319
|
+
countRowsTranslated: function countRowsTranslated() {
|
315
320
|
return _this.view.countRenderableRows();
|
316
321
|
},
|
317
|
-
countRowHeaders: function countRowHeaders() {
|
318
|
-
return _this.countRowHeaders();
|
319
|
-
},
|
320
|
-
countColHeaders: function countColHeaders() {
|
321
|
-
return _this.countColHeaders();
|
322
|
-
},
|
323
322
|
getShortcutManager: function getShortcutManager() {
|
324
323
|
return instance.getShortcutManager();
|
325
324
|
},
|
@@ -352,6 +351,12 @@ function Core(rootElement, userSettings) {
|
|
352
351
|
});
|
353
352
|
this.selection.addLocalHook('beforeSetRangeEnd', function (cellCoords) {
|
354
353
|
_this.runHooks('beforeSetRangeEnd', cellCoords);
|
354
|
+
if (cellCoords.row < 0) {
|
355
|
+
cellCoords.row = _this.view._wt.wtTable.getFirstVisibleRow();
|
356
|
+
}
|
357
|
+
if (cellCoords.col < 0) {
|
358
|
+
cellCoords.col = _this.view._wt.wtTable.getFirstVisibleColumn();
|
359
|
+
}
|
355
360
|
});
|
356
361
|
this.selection.addLocalHook('afterSetRangeEnd', function (cellCoords) {
|
357
362
|
var preventScrolling = (0, _object.createObjectPropListener)(false);
|
@@ -377,14 +382,7 @@ function Core(rootElement, userSettings) {
|
|
377
382
|
if (scrollToCell !== false) {
|
378
383
|
if (!isSelectedByAnyHeader) {
|
379
384
|
if (currentSelectedRange && !_this.selection.isMultiple()) {
|
380
|
-
|
381
|
-
if (renderableCoords.row < 0 && renderableCoords.col >= 0) {
|
382
|
-
_this.view.scrollViewportHorizontally(renderableCoords.col);
|
383
|
-
} else if (renderableCoords.col < 0 && renderableCoords.row >= 0) {
|
384
|
-
_this.view.scrollViewportVertically(renderableCoords.row);
|
385
|
-
} else {
|
386
|
-
_this.view.scrollViewport(renderableCoords);
|
387
|
-
}
|
385
|
+
_this.view.scrollViewport(visualToRenderableCoords(currentSelectedRange.from));
|
388
386
|
} else {
|
389
387
|
_this.view.scrollViewport(visualToRenderableCoords(cellCoords));
|
390
388
|
}
|
@@ -425,30 +423,6 @@ function Core(rootElement, userSettings) {
|
|
425
423
|
isMultiple.value = changedIsMultiple;
|
426
424
|
}
|
427
425
|
});
|
428
|
-
this.selection.addLocalHook('beforeSelectColumns', function () {
|
429
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
430
|
-
args[_key] = arguments[_key];
|
431
|
-
}
|
432
|
-
return _this.runHooks.apply(_this, ['beforeSelectColumns'].concat(args));
|
433
|
-
});
|
434
|
-
this.selection.addLocalHook('afterSelectColumns', function () {
|
435
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
436
|
-
args[_key2] = arguments[_key2];
|
437
|
-
}
|
438
|
-
return _this.runHooks.apply(_this, ['afterSelectColumns'].concat(args));
|
439
|
-
});
|
440
|
-
this.selection.addLocalHook('beforeSelectRows', function () {
|
441
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
442
|
-
args[_key3] = arguments[_key3];
|
443
|
-
}
|
444
|
-
return _this.runHooks.apply(_this, ['beforeSelectRows'].concat(args));
|
445
|
-
});
|
446
|
-
this.selection.addLocalHook('afterSelectRows', function () {
|
447
|
-
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
448
|
-
args[_key4] = arguments[_key4];
|
449
|
-
}
|
450
|
-
return _this.runHooks.apply(_this, ['afterSelectRows'].concat(args));
|
451
|
-
});
|
452
426
|
this.selection.addLocalHook('beforeModifyTransformStart', function (cellCoordsDelta) {
|
453
427
|
_this.runHooks('modifyTransformStart', cellCoordsDelta);
|
454
428
|
});
|
@@ -1607,8 +1581,8 @@ function Core(rootElement, userSettings) {
|
|
1607
1581
|
*/
|
1608
1582
|
this.spliceCol = function (column, index, amount) {
|
1609
1583
|
var _datamap;
|
1610
|
-
for (var
|
1611
|
-
elements[
|
1584
|
+
for (var _len = arguments.length, elements = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
1585
|
+
elements[_key - 3] = arguments[_key];
|
1612
1586
|
}
|
1613
1587
|
return (_datamap = datamap).spliceCol.apply(_datamap, [column, index, amount].concat(elements));
|
1614
1588
|
};
|
@@ -1626,8 +1600,8 @@ function Core(rootElement, userSettings) {
|
|
1626
1600
|
*/
|
1627
1601
|
this.spliceRow = function (row, index, amount) {
|
1628
1602
|
var _datamap2;
|
1629
|
-
for (var
|
1630
|
-
elements[
|
1603
|
+
for (var _len2 = arguments.length, elements = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
|
1604
|
+
elements[_key2 - 3] = arguments[_key2];
|
1631
1605
|
}
|
1632
1606
|
return (_datamap2 = datamap).spliceRow.apply(_datamap2, [row, index, amount].concat(elements));
|
1633
1607
|
};
|
@@ -1723,9 +1697,6 @@ function Core(rootElement, userSettings) {
|
|
1723
1697
|
}
|
1724
1698
|
var changes = [];
|
1725
1699
|
(0, _array.arrayEach)(selection.getSelectedRange(), function (cellRange) {
|
1726
|
-
if (cellRange.isSingleHeader()) {
|
1727
|
-
return;
|
1728
|
-
}
|
1729
1700
|
var topStart = cellRange.getTopStartCorner();
|
1730
1701
|
var bottomEnd = cellRange.getBottomEndCorner();
|
1731
1702
|
(0, _number.rangeEach)(topStart.row, bottomEnd.row, function (row) {
|
@@ -3040,8 +3011,8 @@ function Core(rootElement, userSettings) {
|
|
3040
3011
|
this.spliceCellsMeta = function (visualIndex) {
|
3041
3012
|
var _this5 = this;
|
3042
3013
|
var deleteAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
3043
|
-
for (var
|
3044
|
-
cellMetaRows[
|
3014
|
+
for (var _len3 = arguments.length, cellMetaRows = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
|
3015
|
+
cellMetaRows[_key3 - 2] = arguments[_key3];
|
3045
3016
|
}
|
3046
3017
|
if (cellMetaRows.length > 0 && !Array.isArray(cellMetaRows[0])) {
|
3047
3018
|
throw new Error('The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.');
|
@@ -3735,30 +3706,6 @@ function Core(rootElement, userSettings) {
|
|
3735
3706
|
return instance.view._wt.drawn ? instance.view._wt.wtTable.getVisibleColumnsCount() : -1;
|
3736
3707
|
};
|
3737
3708
|
|
3738
|
-
/**
|
3739
|
-
* Returns the number of rendered row headers.
|
3740
|
-
*
|
3741
|
-
* @since 13.0.0
|
3742
|
-
* @memberof Core#
|
3743
|
-
* @function countRowHeaders
|
3744
|
-
* @returns {number} Number of row headers.
|
3745
|
-
*/
|
3746
|
-
this.countRowHeaders = function () {
|
3747
|
-
return this.view.getRowHeadersCount();
|
3748
|
-
};
|
3749
|
-
|
3750
|
-
/**
|
3751
|
-
* Returns the number of rendered column headers.
|
3752
|
-
*
|
3753
|
-
* @since 13.0.0
|
3754
|
-
* @memberof Core#
|
3755
|
-
* @function countColHeaders
|
3756
|
-
* @returns {number} Number of column headers.
|
3757
|
-
*/
|
3758
|
-
this.countColHeaders = function () {
|
3759
|
-
return this.view.getColumnHeadersCount();
|
3760
|
-
};
|
3761
|
-
|
3762
3709
|
/**
|
3763
3710
|
* Returns the number of empty rows. If the optional ending parameter is `true`, returns the
|
3764
3711
|
* number of empty rows at the bottom of the table.
|
@@ -3963,10 +3910,6 @@ function Core(rootElement, userSettings) {
|
|
3963
3910
|
* hot.selectColumns('id');
|
3964
3911
|
* // Select range of columns using visual indexes.
|
3965
3912
|
* hot.selectColumns(1, 4);
|
3966
|
-
* // Select range of columns using visual indexes and mark the first header as highlighted.
|
3967
|
-
* hot.selectColumns(1, 2, -1);
|
3968
|
-
* // Select range of columns using visual indexes and mark the second cell as highlighted.
|
3969
|
-
* hot.selectColumns(2, 1, 1);
|
3970
3913
|
* // Select range of columns using column properties.
|
3971
3914
|
* hot.selectColumns('id', 'last_name');
|
3972
3915
|
* ```
|
@@ -3977,15 +3920,11 @@ function Core(rootElement, userSettings) {
|
|
3977
3920
|
* @param {number} startColumn The visual column index from which the selection starts.
|
3978
3921
|
* @param {number} [endColumn=startColumn] The visual column index to which the selection finishes. If `endColumn`
|
3979
3922
|
* is not defined the column defined by `startColumn` will be selected.
|
3980
|
-
* @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
|
3981
|
-
* The value can take visual row index from -N to N, where negative values
|
3982
|
-
* point to the headers and positive values point to the cell range.
|
3983
3923
|
* @returns {boolean} `true` if selection was successful, `false` otherwise.
|
3984
3924
|
*/
|
3985
3925
|
this.selectColumns = function (startColumn) {
|
3986
3926
|
var endColumn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startColumn;
|
3987
|
-
|
3988
|
-
return selection.selectColumns(startColumn, endColumn, focusPosition);
|
3927
|
+
return selection.selectColumns(startColumn, endColumn);
|
3989
3928
|
};
|
3990
3929
|
|
3991
3930
|
/**
|
@@ -3995,12 +3934,8 @@ function Core(rootElement, userSettings) {
|
|
3995
3934
|
* ```js
|
3996
3935
|
* // Select row using visual index.
|
3997
3936
|
* hot.selectRows(1);
|
3998
|
-
* //
|
3937
|
+
* // Select range of rows using visual indexes.
|
3999
3938
|
* hot.selectRows(1, 4);
|
4000
|
-
* // select a range of rows, using visual indexes, and mark the header as highlighted.
|
4001
|
-
* hot.selectRows(1, 2, -1);
|
4002
|
-
* // Select range of rows using visual indexes and mark the second cell as highlighted.
|
4003
|
-
* hot.selectRows(2, 1, 1);
|
4004
3939
|
* ```
|
4005
3940
|
*
|
4006
3941
|
* @memberof Core#
|
@@ -4009,15 +3944,11 @@ function Core(rootElement, userSettings) {
|
|
4009
3944
|
* @param {number} startRow The visual row index from which the selection starts.
|
4010
3945
|
* @param {number} [endRow=startRow] The visual row index to which the selection finishes. If `endRow`
|
4011
3946
|
* is not defined the row defined by `startRow` will be selected.
|
4012
|
-
* @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
|
4013
|
-
* The value can take visual column index from -N to N, where negative values
|
4014
|
-
* point to the headers and positive values point to the cell range.
|
4015
3947
|
* @returns {boolean} `true` if selection was successful, `false` otherwise.
|
4016
3948
|
*/
|
4017
3949
|
this.selectRows = function (startRow) {
|
4018
3950
|
var endRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startRow;
|
4019
|
-
|
4020
|
-
return selection.selectRows(startRow, endRow, focusPosition);
|
3951
|
+
return selection.selectRows(startRow, endRow);
|
4021
3952
|
};
|
4022
3953
|
|
4023
3954
|
/**
|
@@ -4036,16 +3967,9 @@ function Core(rootElement, userSettings) {
|
|
4036
3967
|
* The previous selection is overwritten.
|
4037
3968
|
*
|
4038
3969
|
* ```js
|
4039
|
-
* // select all cells in the table, including all headers
|
3970
|
+
* // select all cells in the table, including all headers
|
4040
3971
|
* hot.selectAll();
|
4041
3972
|
*
|
4042
|
-
* // select all cells in the table, including row headers but excluding the corner cell
|
4043
|
-
* hot.selectAll(true, false);
|
4044
|
-
*
|
4045
|
-
* // select all cells in the table, including all headers and the corner cell, but move the focus
|
4046
|
-
* // highlight to position -2, -1
|
4047
|
-
* hot.selectAll(-2, -1);
|
4048
|
-
*
|
4049
3973
|
* // select all cells in the table, without headers
|
4050
3974
|
* hot.selectAll(false);
|
4051
3975
|
* ```
|
@@ -4053,20 +3977,15 @@ function Core(rootElement, userSettings) {
|
|
4053
3977
|
* @since 0.38.2
|
4054
3978
|
* @memberof Core#
|
4055
3979
|
* @function selectAll
|
4056
|
-
* @param {boolean} [
|
4057
|
-
* `false
|
4058
|
-
* @param {boolean} [includeColumnHeaders=false] `true` If the selection should include the column
|
4059
|
-
* headers, `false` otherwise.
|
4060
|
-
* @param {{row: number, col: number}} [focusPosition] The argument allows changing the cell/header
|
4061
|
-
* focus position. The value takes an object with a `row` and `col` properties (visual indexes)
|
4062
|
-
* from -N to N, where negative values point to the headers and positive values point to the cell range.
|
3980
|
+
* @param {boolean} [includeHeaders=true] `true`: include all row, column and corner headers.
|
3981
|
+
* `false`: don't include any headers.
|
4063
3982
|
*/
|
4064
3983
|
this.selectAll = function () {
|
4065
|
-
var
|
4066
|
-
var
|
4067
|
-
var
|
3984
|
+
var includeHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
3985
|
+
var includeRowHeaders = includeHeaders && this.hasRowHeaders();
|
3986
|
+
var includeColumnHeaders = includeHeaders && this.hasColHeaders();
|
4068
3987
|
preventScrollingToCell = true;
|
4069
|
-
selection.selectAll(includeRowHeaders, includeColumnHeaders
|
3988
|
+
selection.selectAll(includeRowHeaders, includeColumnHeaders);
|
4070
3989
|
preventScrollingToCell = false;
|
4071
3990
|
};
|
4072
3991
|
var getIndexToScroll = function getIndexToScroll(indexMapper, visualIndex) {
|
@@ -4470,16 +4389,6 @@ function Core(rootElement, userSettings) {
|
|
4470
4389
|
}
|
4471
4390
|
};
|
4472
4391
|
|
4473
|
-
/**
|
4474
|
-
* Gets the instance of the EditorManager.
|
4475
|
-
*
|
4476
|
-
* @private
|
4477
|
-
* @returns {EditorManager}
|
4478
|
-
*/
|
4479
|
-
this._getEditorManager = function () {
|
4480
|
-
return editorManager;
|
4481
|
-
};
|
4482
|
-
|
4483
4392
|
/**
|
4484
4393
|
* Check if currently it is RTL direction.
|
4485
4394
|
*
|
@@ -4552,11 +4461,284 @@ function Core(rootElement, userSettings) {
|
|
4552
4461
|
this.getShortcutManager = function () {
|
4553
4462
|
return shortcutManager;
|
4554
4463
|
};
|
4464
|
+
var gridContext = shortcutManager.addContext('grid');
|
4465
|
+
var gridConfig = {
|
4466
|
+
runOnlyIf: function runOnlyIf() {
|
4467
|
+
return (0, _mixed.isDefined)(instance.getSelected()) && instance.countRenderedRows() > 0 && instance.countRenderedCols() > 0;
|
4468
|
+
},
|
4469
|
+
group: SHORTCUTS_GROUP
|
4470
|
+
};
|
4471
|
+
shortcutManager.setActiveContextName('grid');
|
4472
|
+
gridContext.addShortcuts([{
|
4473
|
+
keys: [['Control/Meta', 'A']],
|
4474
|
+
callback: function callback() {
|
4475
|
+
instance.selectAll();
|
4476
|
+
}
|
4477
|
+
}, {
|
4478
|
+
keys: [['Control/Meta', 'Enter']],
|
4479
|
+
callback: function callback() {
|
4480
|
+
var selectedRange = instance.getSelectedRange();
|
4481
|
+
var _selectedRange$highli = selectedRange[selectedRange.length - 1].highlight,
|
4482
|
+
highlightRow = _selectedRange$highli.row,
|
4483
|
+
highlightColumn = _selectedRange$highli.col;
|
4484
|
+
var valueToPopulate = instance.getDataAtCell(highlightRow, highlightColumn);
|
4485
|
+
var cellValues = new Map();
|
4486
|
+
for (var i = 0; i < selectedRange.length; i++) {
|
4487
|
+
selectedRange[i].forAll(function (row, column) {
|
4488
|
+
if (row >= 0 && column >= 0 && (row !== highlightRow || column !== highlightColumn)) {
|
4489
|
+
var _instance$getCellMeta = instance.getCellMeta(row, column),
|
4490
|
+
readOnly = _instance$getCellMeta.readOnly;
|
4491
|
+
if (!readOnly) {
|
4492
|
+
cellValues.set("".concat(row, "x").concat(column), [row, column, valueToPopulate]);
|
4493
|
+
}
|
4494
|
+
}
|
4495
|
+
});
|
4496
|
+
}
|
4497
|
+
instance.setDataAtCell(Array.from(cellValues.values()));
|
4498
|
+
},
|
4499
|
+
runOnlyIf: function runOnlyIf() {
|
4500
|
+
return instance.getSelectedRangeLast().getCellsCount() > 1;
|
4501
|
+
}
|
4502
|
+
}, {
|
4503
|
+
keys: [['ArrowUp']],
|
4504
|
+
callback: function callback() {
|
4505
|
+
selection.transformStart(-1, 0);
|
4506
|
+
}
|
4507
|
+
}, {
|
4508
|
+
keys: [['ArrowUp', 'Control/Meta']],
|
4509
|
+
captureCtrl: true,
|
4510
|
+
callback: function callback() {
|
4511
|
+
selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1), instance.getSelectedRangeLast().highlight.col));
|
4512
|
+
}
|
4513
|
+
}, {
|
4514
|
+
keys: [['ArrowUp', 'Shift']],
|
4515
|
+
callback: function callback() {
|
4516
|
+
selection.transformEnd(-1, 0);
|
4517
|
+
}
|
4518
|
+
}, {
|
4519
|
+
keys: [['ArrowUp', 'Shift', 'Control/Meta']],
|
4520
|
+
captureCtrl: true,
|
4521
|
+
callback: function callback() {
|
4522
|
+
var _instance$getSelected = instance.getSelectedRangeLast(),
|
4523
|
+
from = _instance$getSelected.from,
|
4524
|
+
to = _instance$getSelected.to;
|
4525
|
+
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1);
|
4526
|
+
selection.setRangeStart(from.clone());
|
4527
|
+
selection.setRangeEnd(instance._createCellCoords(row, to.col));
|
4528
|
+
},
|
4529
|
+
runOnlyIf: function runOnlyIf() {
|
4530
|
+
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader());
|
4531
|
+
}
|
4532
|
+
}, {
|
4533
|
+
keys: [['ArrowDown']],
|
4534
|
+
callback: function callback() {
|
4535
|
+
selection.transformStart(1, 0);
|
4536
|
+
}
|
4537
|
+
}, {
|
4538
|
+
keys: [['ArrowDown', 'Control/Meta']],
|
4539
|
+
captureCtrl: true,
|
4540
|
+
callback: function callback() {
|
4541
|
+
selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1), instance.getSelectedRangeLast().highlight.col));
|
4542
|
+
}
|
4543
|
+
}, {
|
4544
|
+
keys: [['ArrowDown', 'Shift']],
|
4545
|
+
callback: function callback() {
|
4546
|
+
selection.transformEnd(1, 0);
|
4547
|
+
}
|
4548
|
+
}, {
|
4549
|
+
keys: [['ArrowDown', 'Shift', 'Control/Meta']],
|
4550
|
+
captureCtrl: true,
|
4551
|
+
callback: function callback() {
|
4552
|
+
var _instance$getSelected2 = instance.getSelectedRangeLast(),
|
4553
|
+
from = _instance$getSelected2.from,
|
4554
|
+
to = _instance$getSelected2.to;
|
4555
|
+
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1);
|
4556
|
+
selection.setRangeStart(from.clone());
|
4557
|
+
selection.setRangeEnd(instance._createCellCoords(row, to.col));
|
4558
|
+
},
|
4559
|
+
runOnlyIf: function runOnlyIf() {
|
4560
|
+
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader());
|
4561
|
+
}
|
4562
|
+
}, {
|
4563
|
+
keys: [['ArrowLeft']],
|
4564
|
+
callback: function callback() {
|
4565
|
+
selection.transformStart(0, -1 * instance.getDirectionFactor());
|
4566
|
+
}
|
4567
|
+
}, {
|
4568
|
+
keys: [['ArrowLeft', 'Control/Meta']],
|
4569
|
+
captureCtrl: true,
|
4570
|
+
callback: function callback() {
|
4571
|
+
var _instance$columnIndex;
|
4572
|
+
var row = instance.getSelectedRangeLast().highlight.row;
|
4573
|
+
var column = (_instance$columnIndex = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex, _toConsumableArray(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
|
4574
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4575
|
+
}
|
4576
|
+
}, {
|
4577
|
+
keys: [['ArrowLeft', 'Shift']],
|
4578
|
+
callback: function callback() {
|
4579
|
+
selection.transformEnd(0, -1 * instance.getDirectionFactor());
|
4580
|
+
}
|
4581
|
+
}, {
|
4582
|
+
keys: [['ArrowLeft', 'Shift', 'Control/Meta']],
|
4583
|
+
captureCtrl: true,
|
4584
|
+
callback: function callback() {
|
4585
|
+
var _instance$columnIndex2;
|
4586
|
+
var _instance$getSelected3 = instance.getSelectedRangeLast(),
|
4587
|
+
from = _instance$getSelected3.from,
|
4588
|
+
to = _instance$getSelected3.to;
|
4589
|
+
var column = (_instance$columnIndex2 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex2, _toConsumableArray(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
|
4590
|
+
selection.setRangeStart(from.clone());
|
4591
|
+
selection.setRangeEnd(instance._createCellCoords(to.row, column));
|
4592
|
+
},
|
4593
|
+
runOnlyIf: function runOnlyIf() {
|
4594
|
+
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader());
|
4595
|
+
}
|
4596
|
+
}, {
|
4597
|
+
keys: [['ArrowRight']],
|
4598
|
+
callback: function callback() {
|
4599
|
+
selection.transformStart(0, instance.getDirectionFactor());
|
4600
|
+
}
|
4601
|
+
}, {
|
4602
|
+
keys: [['ArrowRight', 'Control/Meta']],
|
4603
|
+
captureCtrl: true,
|
4604
|
+
callback: function callback() {
|
4605
|
+
var _instance$columnIndex3;
|
4606
|
+
var row = instance.getSelectedRangeLast().highlight.row;
|
4607
|
+
var column = (_instance$columnIndex3 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex3, _toConsumableArray(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
|
4608
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4609
|
+
}
|
4610
|
+
}, {
|
4611
|
+
keys: [['ArrowRight', 'Shift']],
|
4612
|
+
callback: function callback() {
|
4613
|
+
selection.transformEnd(0, instance.getDirectionFactor());
|
4614
|
+
}
|
4615
|
+
}, {
|
4616
|
+
keys: [['ArrowRight', 'Shift', 'Control/Meta']],
|
4617
|
+
captureCtrl: true,
|
4618
|
+
callback: function callback() {
|
4619
|
+
var _instance$columnIndex4;
|
4620
|
+
var _instance$getSelected4 = instance.getSelectedRangeLast(),
|
4621
|
+
from = _instance$getSelected4.from,
|
4622
|
+
to = _instance$getSelected4.to;
|
4623
|
+
var column = (_instance$columnIndex4 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex4, _toConsumableArray(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
|
4624
|
+
selection.setRangeStart(from.clone());
|
4625
|
+
selection.setRangeEnd(instance._createCellCoords(to.row, column));
|
4626
|
+
},
|
4627
|
+
runOnlyIf: function runOnlyIf() {
|
4628
|
+
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader());
|
4629
|
+
}
|
4630
|
+
}, {
|
4631
|
+
keys: [['Home']],
|
4632
|
+
captureCtrl: true,
|
4633
|
+
callback: function callback() {
|
4634
|
+
var fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
|
4635
|
+
var row = instance.getSelectedRangeLast().highlight.row;
|
4636
|
+
var column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
|
4637
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4638
|
+
},
|
4639
|
+
runOnlyIf: function runOnlyIf() {
|
4640
|
+
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4641
|
+
}
|
4642
|
+
}, {
|
4643
|
+
keys: [['Home', 'Shift']],
|
4644
|
+
callback: function callback() {
|
4645
|
+
selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(0, 1)));
|
4646
|
+
}
|
4647
|
+
}, {
|
4648
|
+
keys: [['Home', 'Control/Meta']],
|
4649
|
+
captureCtrl: true,
|
4650
|
+
callback: function callback() {
|
4651
|
+
var fixedRows = parseInt(instance.getSettings().fixedRowsTop, 10);
|
4652
|
+
var fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
|
4653
|
+
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(fixedRows, 1);
|
4654
|
+
var column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
|
4655
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4656
|
+
},
|
4657
|
+
runOnlyIf: function runOnlyIf() {
|
4658
|
+
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4659
|
+
}
|
4660
|
+
}, {
|
4661
|
+
keys: [['End']],
|
4662
|
+
captureCtrl: true,
|
4663
|
+
callback: function callback() {
|
4664
|
+
selection.setRangeStart(instance._createCellCoords(instance.getSelectedRangeLast().highlight.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
|
4665
|
+
},
|
4666
|
+
runOnlyIf: function runOnlyIf() {
|
4667
|
+
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4668
|
+
}
|
4669
|
+
}, {
|
4670
|
+
keys: [['End', 'Shift']],
|
4671
|
+
callback: function callback() {
|
4672
|
+
selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
|
4673
|
+
}
|
4674
|
+
}, {
|
4675
|
+
keys: [['End', 'Control/Meta']],
|
4676
|
+
captureCtrl: true,
|
4677
|
+
callback: function callback() {
|
4678
|
+
var fixedRows = parseInt(instance.getSettings().fixedRowsBottom, 10);
|
4679
|
+
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - fixedRows - 1, -1);
|
4680
|
+
var column = instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1);
|
4681
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4682
|
+
},
|
4683
|
+
runOnlyIf: function runOnlyIf() {
|
4684
|
+
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4685
|
+
}
|
4686
|
+
}, {
|
4687
|
+
keys: [['PageUp']],
|
4688
|
+
callback: function callback() {
|
4689
|
+
selection.transformStart(-instance.countVisibleRows(), 0);
|
4690
|
+
}
|
4691
|
+
}, {
|
4692
|
+
keys: [['PageUp', 'Shift']],
|
4693
|
+
callback: function callback() {
|
4694
|
+
var _instance$getSelected5 = instance.getSelectedRangeLast(),
|
4695
|
+
to = _instance$getSelected5.to;
|
4696
|
+
var nextRowIndexToSelect = Math.max(to.row - instance.countVisibleRows(), 0);
|
4697
|
+
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, 1);
|
4698
|
+
if (row !== null) {
|
4699
|
+
var coords = instance._createCellCoords(row, to.col);
|
4700
|
+
var scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
|
4701
|
+
var nextVerticalScroll = Math.max(coords.row - scrollPadding, 0);
|
4702
|
+
selection.setRangeEnd(coords);
|
4703
|
+
instance.scrollViewportTo(nextVerticalScroll);
|
4704
|
+
}
|
4705
|
+
}
|
4706
|
+
}, {
|
4707
|
+
keys: [['PageDown']],
|
4708
|
+
callback: function callback() {
|
4709
|
+
selection.transformStart(instance.countVisibleRows(), 0);
|
4710
|
+
}
|
4711
|
+
}, {
|
4712
|
+
keys: [['PageDown', 'Shift']],
|
4713
|
+
callback: function callback() {
|
4714
|
+
var _instance$getSelected6 = instance.getSelectedRangeLast(),
|
4715
|
+
to = _instance$getSelected6.to;
|
4716
|
+
var nextRowIndexToSelect = Math.min(to.row + instance.countVisibleRows(), instance.countRows() - 1);
|
4717
|
+
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, -1);
|
4718
|
+
if (row !== null) {
|
4719
|
+
var coords = instance._createCellCoords(row, to.col);
|
4720
|
+
var scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
|
4721
|
+
var nextVerticalScroll = Math.min(coords.row - scrollPadding, instance.countRows() - 1);
|
4722
|
+
selection.setRangeEnd(coords);
|
4723
|
+
instance.scrollViewportTo(nextVerticalScroll);
|
4724
|
+
}
|
4725
|
+
}
|
4726
|
+
}, {
|
4727
|
+
keys: [['Tab']],
|
4728
|
+
callback: function callback(event) {
|
4729
|
+
var tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
4730
|
+
selection.transformStart(tabMoves.row, tabMoves.col, true);
|
4731
|
+
}
|
4732
|
+
}, {
|
4733
|
+
keys: [['Shift', 'Tab']],
|
4734
|
+
callback: function callback(event) {
|
4735
|
+
var tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
4736
|
+
selection.transformStart(-tabMoves.row, -tabMoves.col);
|
4737
|
+
}
|
4738
|
+
}], gridConfig);
|
4555
4739
|
(0, _registry.getPluginsNames)().forEach(function (pluginName) {
|
4556
4740
|
var PluginClass = (0, _registry.getPlugin)(pluginName);
|
4557
4741
|
pluginsRegistry.addItem(pluginName, new PluginClass(_this));
|
4558
4742
|
});
|
4559
|
-
(0, _shortcutContexts.registerAllShortcutContexts)(instance);
|
4560
|
-
shortcutManager.setActiveContextName('grid');
|
4561
4743
|
_pluginHooks.default.getSingleton().run(instance, 'construct');
|
4562
4744
|
}
|