handsontable 0.0.0-next-03bda88-20230622 → 0.0.0-next-c3d199b-20230626
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/cell/coords.d.ts +6 -1
- package/3rdparty/walkontable/src/cell/coords.js +61 -12
- package/3rdparty/walkontable/src/cell/coords.mjs +61 -12
- package/3rdparty/walkontable/src/cell/range.d.ts +9 -2
- package/3rdparty/walkontable/src/cell/range.js +44 -7
- package/3rdparty/walkontable/src/cell/range.mjs +44 -7
- package/3rdparty/walkontable/src/core/_base.js +9 -3
- package/3rdparty/walkontable/src/core/_base.mjs +9 -3
- package/3rdparty/walkontable/src/core/clone.js +2 -2
- package/3rdparty/walkontable/src/core/clone.mjs +2 -2
- package/3rdparty/walkontable/src/core/core.js +3 -2
- package/3rdparty/walkontable/src/core/core.mjs +3 -2
- package/3rdparty/walkontable/src/event.js +7 -7
- package/3rdparty/walkontable/src/event.mjs +7 -7
- package/3rdparty/walkontable/src/facade/core.js +2 -2
- package/3rdparty/walkontable/src/facade/core.mjs +2 -2
- package/3rdparty/walkontable/src/index.js +10 -2
- package/3rdparty/walkontable/src/index.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/_base.js +1 -1
- package/3rdparty/walkontable/src/overlay/_base.mjs +1 -1
- package/3rdparty/walkontable/src/overlay/inlineStart.js +2 -4
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -4
- package/3rdparty/walkontable/src/overlay/top.js +2 -4
- package/3rdparty/walkontable/src/overlay/top.mjs +2 -4
- package/3rdparty/walkontable/src/{border.js → selection/border/border.js} +7 -12
- package/3rdparty/walkontable/src/{border.mjs → selection/border/border.mjs} +7 -12
- package/3rdparty/walkontable/src/selection/border/constants.js +18 -0
- package/3rdparty/walkontable/src/selection/border/constants.mjs +13 -0
- package/3rdparty/walkontable/src/selection/constants.js +63 -0
- package/3rdparty/walkontable/src/selection/constants.mjs +51 -0
- package/3rdparty/walkontable/src/selection/index.js +30 -0
- package/3rdparty/walkontable/src/selection/index.mjs +5 -0
- package/3rdparty/walkontable/src/selection/manager.js +329 -0
- package/3rdparty/walkontable/src/selection/manager.mjs +323 -0
- package/3rdparty/walkontable/src/selection/scanner.js +364 -0
- package/3rdparty/walkontable/src/selection/scanner.mjs +360 -0
- package/3rdparty/walkontable/src/selection/selection.js +133 -0
- package/3rdparty/walkontable/src/selection/selection.mjs +127 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +9 -0
- package/3rdparty/walkontable/src/table.js +7 -79
- package/3rdparty/walkontable/src/table.mjs +8 -80
- package/CHANGELOG.md +0 -31
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.d.ts +5 -3
- package/core.js +127 -309
- package/core.mjs +127 -309
- package/dataMap/metaManager/metaSchema.js +19 -0
- package/dataMap/metaManager/metaSchema.mjs +19 -0
- package/dist/handsontable.css +8 -3
- package/dist/handsontable.full.css +8 -3
- package/dist/handsontable.full.js +15283 -12109
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +115 -115
- package/dist/handsontable.js +23364 -20190
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +4 -4
- package/editorManager.js +21 -94
- package/editorManager.mjs +26 -98
- package/editors/textEditor/textEditor.js +3 -11
- package/editors/textEditor/textEditor.mjs +4 -12
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/helpers/number.d.ts +1 -0
- package/helpers/number.js +18 -0
- package/helpers/number.mjs +17 -0
- package/package.json +1 -1
- package/pluginHooks.d.ts +5 -1
- package/pluginHooks.js +89 -1
- package/pluginHooks.mjs +89 -1
- package/plugins/collapsibleColumns/collapsibleColumns.js +81 -24
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +81 -24
- package/plugins/columnSorting/columnSorting.js +50 -8
- package/plugins/columnSorting/columnSorting.mjs +49 -9
- package/plugins/columnSorting/index.js +4 -2
- package/plugins/columnSorting/index.mjs +1 -1
- package/plugins/comments/commentEditor.js +1 -0
- package/plugins/comments/commentEditor.mjs +1 -0
- package/plugins/comments/comments.js +263 -224
- package/plugins/comments/comments.mjs +271 -234
- package/plugins/comments/contextMenuItem/addEditComment.js +51 -0
- package/plugins/comments/contextMenuItem/addEditComment.mjs +35 -0
- package/plugins/comments/contextMenuItem/readOnlyComment.js +63 -0
- package/plugins/comments/contextMenuItem/readOnlyComment.mjs +55 -0
- package/plugins/comments/contextMenuItem/removeComment.js +48 -0
- package/plugins/comments/contextMenuItem/removeComment.mjs +32 -0
- package/plugins/contextMenu/contextMenu.d.ts +1 -1
- package/plugins/contextMenu/contextMenu.js +80 -29
- package/plugins/contextMenu/contextMenu.mjs +81 -30
- package/plugins/contextMenu/predefinedItems/alignment.js +7 -0
- package/plugins/contextMenu/predefinedItems/alignment.mjs +7 -0
- package/plugins/contextMenu/predefinedItems/clearColumn.js +5 -3
- package/plugins/contextMenu/predefinedItems/clearColumn.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.js +5 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/columnRight.js +5 -3
- package/plugins/contextMenu/predefinedItems/columnRight.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/readOnly.js +7 -0
- package/plugins/contextMenu/predefinedItems/readOnly.mjs +7 -0
- package/plugins/contextMenu/predefinedItems/removeColumn.js +7 -5
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/removeRow.js +7 -5
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.js +5 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.js +5 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.mjs +5 -3
- package/plugins/contextMenu/utils.js +25 -16
- package/plugins/contextMenu/utils.mjs +24 -15
- package/plugins/copyPaste/contextMenuItem/copy.js +7 -0
- package/plugins/copyPaste/contextMenuItem/copy.mjs +7 -0
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/cut.js +7 -0
- package/plugins/copyPaste/contextMenuItem/cut.mjs +7 -0
- package/plugins/copyPaste/copyPaste.js +6 -2
- package/plugins/copyPaste/copyPaste.mjs +6 -2
- package/plugins/customBorders/customBorders.js +25 -53
- package/plugins/customBorders/customBorders.mjs +26 -54
- package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
- package/plugins/dropdownMenu/dropdownMenu.js +94 -30
- package/plugins/dropdownMenu/dropdownMenu.mjs +94 -30
- package/plugins/mergeCells/mergeCells.js +5 -18
- package/plugins/mergeCells/mergeCells.mjs +5 -18
- package/plugins/multiColumnSorting/multiColumnSorting.js +42 -3
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +42 -3
- package/plugins/nestedHeaders/nestedHeaders.js +132 -10
- package/plugins/nestedHeaders/nestedHeaders.mjs +132 -10
- package/plugins/nestedHeaders/stateManager/index.js +37 -0
- package/plugins/nestedHeaders/stateManager/index.mjs +37 -0
- package/plugins/nestedRows/nestedRows.js +52 -7
- package/plugins/nestedRows/nestedRows.mjs +52 -7
- package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
- package/selection/highlight/highlight.js +312 -89
- package/selection/highlight/highlight.mjs +302 -85
- package/selection/highlight/types/activeHeader.js +10 -9
- package/selection/highlight/types/activeHeader.mjs +10 -8
- package/selection/highlight/types/area.js +12 -27
- package/selection/highlight/types/area.mjs +16 -30
- package/selection/highlight/types/areaLayered.js +54 -0
- package/selection/highlight/types/areaLayered.mjs +49 -0
- package/selection/highlight/types/column.js +50 -0
- package/selection/highlight/types/column.mjs +45 -0
- package/selection/highlight/types/customSelection.js +7 -10
- package/selection/highlight/types/customSelection.mjs +7 -9
- package/selection/highlight/types/fill.js +5 -8
- package/selection/highlight/types/fill.mjs +5 -7
- package/selection/highlight/types/{cell.js → focus.js} +5 -8
- package/selection/highlight/types/{cell.mjs → focus.mjs} +5 -7
- package/selection/highlight/types/header.js +10 -20
- package/selection/highlight/types/header.mjs +10 -19
- package/selection/highlight/types/{index.js → row.js} +27 -31
- package/selection/highlight/types/{index.mjs → row.mjs} +24 -29
- package/selection/highlight/visualSelection.js +31 -27
- package/selection/highlight/visualSelection.mjs +31 -27
- package/selection/index.js +4 -7
- package/selection/index.mjs +2 -3
- package/selection/mouseEventHandler.js +1 -1
- package/selection/mouseEventHandler.mjs +1 -1
- package/selection/range.js +8 -8
- package/selection/range.mjs +8 -8
- package/selection/selection.js +315 -181
- package/selection/selection.mjs +310 -180
- package/selection/transformation.js +233 -96
- package/selection/transformation.mjs +230 -93
- package/selection/utils.js +12 -36
- package/selection/utils.mjs +13 -36
- package/settings.d.ts +1 -0
- package/shortcutContexts/commands/editor/closeAndSave.js +15 -0
- package/shortcutContexts/commands/editor/closeAndSave.mjs +10 -0
- package/shortcutContexts/commands/editor/closeWithoutSaving.js +13 -0
- package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +8 -0
- package/shortcutContexts/commands/editor/fastOpen.js +16 -0
- package/shortcutContexts/commands/editor/fastOpen.mjs +11 -0
- package/shortcutContexts/commands/editor/index.js +16 -0
- package/shortcutContexts/commands/editor/index.mjs +12 -0
- package/shortcutContexts/commands/editor/open.js +29 -0
- package/shortcutContexts/commands/editor/open.mjs +24 -0
- package/shortcutContexts/commands/emptySelectedCells.js +12 -0
- package/shortcutContexts/commands/emptySelectedCells.mjs +7 -0
- package/shortcutContexts/commands/extendCellsSelection/down.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +10 -0
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +21 -0
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +16 -0
- package/shortcutContexts/commands/extendCellsSelection/index.js +26 -0
- package/shortcutContexts/commands/extendCellsSelection/index.mjs +22 -0
- package/shortcutContexts/commands/extendCellsSelection/left.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +10 -0
- package/shortcutContexts/commands/extendCellsSelection/right.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +10 -0
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +14 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +22 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +17 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +17 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +12 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +17 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +12 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +40 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +35 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +40 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +35 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +22 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +17 -0
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +14 -0
- package/shortcutContexts/commands/extendCellsSelection/up.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +10 -0
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +21 -0
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +16 -0
- package/shortcutContexts/commands/index.js +52 -0
- package/shortcutContexts/commands/index.mjs +48 -0
- package/shortcutContexts/commands/moveCellSelection/down.js +12 -0
- package/shortcutContexts/commands/moveCellSelection/down.mjs +7 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +29 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +24 -0
- package/shortcutContexts/commands/moveCellSelection/index.js +28 -0
- package/shortcutContexts/commands/moveCellSelection/index.mjs +24 -0
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/left.js +11 -0
- package/shortcutContexts/commands/moveCellSelection/left.mjs +6 -0
- package/shortcutContexts/commands/moveCellSelection/right.js +11 -0
- package/shortcutContexts/commands/moveCellSelection/right.mjs +6 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +16 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +11 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +12 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +16 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +11 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +36 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +31 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +36 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +31 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +16 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +11 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +18 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +13 -0
- package/shortcutContexts/commands/moveCellSelection/up.js +12 -0
- package/shortcutContexts/commands/moveCellSelection/up.mjs +7 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +29 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +24 -0
- package/shortcutContexts/commands/populateSelectedCellsData.js +35 -0
- package/shortcutContexts/commands/populateSelectedCellsData.mjs +30 -0
- package/shortcutContexts/commands/selectAll.js +11 -0
- package/shortcutContexts/commands/selectAll.mjs +6 -0
- package/shortcutContexts/constants.js +19 -0
- package/shortcutContexts/constants.mjs +12 -0
- package/shortcutContexts/editor.js +29 -0
- package/shortcutContexts/editor.mjs +25 -0
- package/shortcutContexts/grid.js +247 -0
- package/shortcutContexts/grid.mjs +243 -0
- package/shortcutContexts/index.js +29 -0
- package/shortcutContexts/index.mjs +15 -0
- package/shortcuts/manager.js +2 -0
- package/shortcuts/manager.mjs +2 -0
- package/shortcuts/recorder.js +2 -2
- package/shortcuts/recorder.mjs +2 -2
- package/shortcuts/utils.js +21 -5
- package/shortcuts/utils.mjs +20 -4
- package/tableView.js +63 -11
- package/tableView.mjs +63 -11
- package/3rdparty/walkontable/src/selection.js +0 -355
- package/3rdparty/walkontable/src/selection.mjs +0 -349
- package/selection/highlight/constants.js +0 -16
- package/selection/highlight/constants.mjs +0 -6
package/core.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");
|
@@ -30,7 +30,6 @@ 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");
|
34
33
|
var _element = require("./helpers/dom/element");
|
35
34
|
var _function = require("./helpers/function");
|
36
35
|
var _mixed = require("./helpers/mixed");
|
@@ -59,6 +58,7 @@ var _selection = require("./selection");
|
|
59
58
|
var _dataMap = require("./dataMap");
|
60
59
|
var _uniqueMap = require("./utils/dataStructures/uniqueMap");
|
61
60
|
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,7 +71,6 @@ 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';
|
75
74
|
var activeGuid = null;
|
76
75
|
|
77
76
|
/**
|
@@ -295,12 +294,8 @@ function Core(rootElement, userSettings) {
|
|
295
294
|
};
|
296
295
|
|
297
296
|
var selection = new _selection.Selection(tableMeta, {
|
298
|
-
rowIndexMapper:
|
299
|
-
|
300
|
-
},
|
301
|
-
columnIndexMapper: function columnIndexMapper() {
|
302
|
-
return instance.columnIndexMapper;
|
303
|
-
},
|
297
|
+
rowIndexMapper: instance.rowIndexMapper,
|
298
|
+
columnIndexMapper: instance.columnIndexMapper,
|
304
299
|
countCols: function countCols() {
|
305
300
|
return instance.countCols();
|
306
301
|
},
|
@@ -313,12 +308,18 @@ function Core(rootElement, userSettings) {
|
|
313
308
|
isEditorOpened: function isEditorOpened() {
|
314
309
|
return instance.getActiveEditor() ? instance.getActiveEditor().isOpened() : false;
|
315
310
|
},
|
316
|
-
|
311
|
+
countRenderableColumns: function countRenderableColumns() {
|
317
312
|
return _this.view.countRenderableColumns();
|
318
313
|
},
|
319
|
-
|
314
|
+
countRenderableRows: function countRenderableRows() {
|
320
315
|
return _this.view.countRenderableRows();
|
321
316
|
},
|
317
|
+
countRowHeaders: function countRowHeaders() {
|
318
|
+
return _this.countRowHeaders();
|
319
|
+
},
|
320
|
+
countColHeaders: function countColHeaders() {
|
321
|
+
return _this.countColHeaders();
|
322
|
+
},
|
322
323
|
getShortcutManager: function getShortcutManager() {
|
323
324
|
return instance.getShortcutManager();
|
324
325
|
},
|
@@ -351,12 +352,6 @@ function Core(rootElement, userSettings) {
|
|
351
352
|
});
|
352
353
|
this.selection.addLocalHook('beforeSetRangeEnd', function (cellCoords) {
|
353
354
|
_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
|
-
}
|
360
355
|
});
|
361
356
|
this.selection.addLocalHook('afterSetRangeEnd', function (cellCoords) {
|
362
357
|
var preventScrolling = (0, _object.createObjectPropListener)(false);
|
@@ -382,7 +377,14 @@ function Core(rootElement, userSettings) {
|
|
382
377
|
if (scrollToCell !== false) {
|
383
378
|
if (!isSelectedByAnyHeader) {
|
384
379
|
if (currentSelectedRange && !_this.selection.isMultiple()) {
|
385
|
-
|
380
|
+
var renderableCoords = visualToRenderableCoords(currentSelectedRange.from);
|
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
|
+
}
|
386
388
|
} else {
|
387
389
|
_this.view.scrollViewport(visualToRenderableCoords(cellCoords));
|
388
390
|
}
|
@@ -423,6 +425,30 @@ function Core(rootElement, userSettings) {
|
|
423
425
|
isMultiple.value = changedIsMultiple;
|
424
426
|
}
|
425
427
|
});
|
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
|
+
});
|
426
452
|
this.selection.addLocalHook('beforeModifyTransformStart', function (cellCoordsDelta) {
|
427
453
|
_this.runHooks('modifyTransformStart', cellCoordsDelta);
|
428
454
|
});
|
@@ -1581,8 +1607,8 @@ function Core(rootElement, userSettings) {
|
|
1581
1607
|
*/
|
1582
1608
|
this.spliceCol = function (column, index, amount) {
|
1583
1609
|
var _datamap;
|
1584
|
-
for (var
|
1585
|
-
elements[
|
1610
|
+
for (var _len5 = arguments.length, elements = new Array(_len5 > 3 ? _len5 - 3 : 0), _key5 = 3; _key5 < _len5; _key5++) {
|
1611
|
+
elements[_key5 - 3] = arguments[_key5];
|
1586
1612
|
}
|
1587
1613
|
return (_datamap = datamap).spliceCol.apply(_datamap, [column, index, amount].concat(elements));
|
1588
1614
|
};
|
@@ -1600,8 +1626,8 @@ function Core(rootElement, userSettings) {
|
|
1600
1626
|
*/
|
1601
1627
|
this.spliceRow = function (row, index, amount) {
|
1602
1628
|
var _datamap2;
|
1603
|
-
for (var
|
1604
|
-
elements[
|
1629
|
+
for (var _len6 = arguments.length, elements = new Array(_len6 > 3 ? _len6 - 3 : 0), _key6 = 3; _key6 < _len6; _key6++) {
|
1630
|
+
elements[_key6 - 3] = arguments[_key6];
|
1605
1631
|
}
|
1606
1632
|
return (_datamap2 = datamap).spliceRow.apply(_datamap2, [row, index, amount].concat(elements));
|
1607
1633
|
};
|
@@ -1697,6 +1723,9 @@ function Core(rootElement, userSettings) {
|
|
1697
1723
|
}
|
1698
1724
|
var changes = [];
|
1699
1725
|
(0, _array.arrayEach)(selection.getSelectedRange(), function (cellRange) {
|
1726
|
+
if (cellRange.isSingleHeader()) {
|
1727
|
+
return;
|
1728
|
+
}
|
1700
1729
|
var topStart = cellRange.getTopStartCorner();
|
1701
1730
|
var bottomEnd = cellRange.getBottomEndCorner();
|
1702
1731
|
(0, _number.rangeEach)(topStart.row, bottomEnd.row, function (row) {
|
@@ -3011,8 +3040,8 @@ function Core(rootElement, userSettings) {
|
|
3011
3040
|
this.spliceCellsMeta = function (visualIndex) {
|
3012
3041
|
var _this5 = this;
|
3013
3042
|
var deleteAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
3014
|
-
for (var
|
3015
|
-
cellMetaRows[
|
3043
|
+
for (var _len7 = arguments.length, cellMetaRows = new Array(_len7 > 2 ? _len7 - 2 : 0), _key7 = 2; _key7 < _len7; _key7++) {
|
3044
|
+
cellMetaRows[_key7 - 2] = arguments[_key7];
|
3016
3045
|
}
|
3017
3046
|
if (cellMetaRows.length > 0 && !Array.isArray(cellMetaRows[0])) {
|
3018
3047
|
throw new Error('The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.');
|
@@ -3706,6 +3735,30 @@ function Core(rootElement, userSettings) {
|
|
3706
3735
|
return instance.view._wt.drawn ? instance.view._wt.wtTable.getVisibleColumnsCount() : -1;
|
3707
3736
|
};
|
3708
3737
|
|
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
|
+
|
3709
3762
|
/**
|
3710
3763
|
* Returns the number of empty rows. If the optional ending parameter is `true`, returns the
|
3711
3764
|
* number of empty rows at the bottom of the table.
|
@@ -3910,6 +3963,10 @@ function Core(rootElement, userSettings) {
|
|
3910
3963
|
* hot.selectColumns('id');
|
3911
3964
|
* // Select range of columns using visual indexes.
|
3912
3965
|
* 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);
|
3913
3970
|
* // Select range of columns using column properties.
|
3914
3971
|
* hot.selectColumns('id', 'last_name');
|
3915
3972
|
* ```
|
@@ -3920,11 +3977,15 @@ function Core(rootElement, userSettings) {
|
|
3920
3977
|
* @param {number} startColumn The visual column index from which the selection starts.
|
3921
3978
|
* @param {number} [endColumn=startColumn] The visual column index to which the selection finishes. If `endColumn`
|
3922
3979
|
* 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.
|
3923
3983
|
* @returns {boolean} `true` if selection was successful, `false` otherwise.
|
3924
3984
|
*/
|
3925
3985
|
this.selectColumns = function (startColumn) {
|
3926
3986
|
var endColumn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startColumn;
|
3927
|
-
|
3987
|
+
var focusPosition = arguments.length > 2 ? arguments[2] : undefined;
|
3988
|
+
return selection.selectColumns(startColumn, endColumn, focusPosition);
|
3928
3989
|
};
|
3929
3990
|
|
3930
3991
|
/**
|
@@ -3934,8 +3995,12 @@ function Core(rootElement, userSettings) {
|
|
3934
3995
|
* ```js
|
3935
3996
|
* // Select row using visual index.
|
3936
3997
|
* hot.selectRows(1);
|
3937
|
-
* //
|
3998
|
+
* // select a range of rows, using visual indexes.
|
3938
3999
|
* 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);
|
3939
4004
|
* ```
|
3940
4005
|
*
|
3941
4006
|
* @memberof Core#
|
@@ -3944,11 +4009,15 @@ function Core(rootElement, userSettings) {
|
|
3944
4009
|
* @param {number} startRow The visual row index from which the selection starts.
|
3945
4010
|
* @param {number} [endRow=startRow] The visual row index to which the selection finishes. If `endRow`
|
3946
4011
|
* 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.
|
3947
4015
|
* @returns {boolean} `true` if selection was successful, `false` otherwise.
|
3948
4016
|
*/
|
3949
4017
|
this.selectRows = function (startRow) {
|
3950
4018
|
var endRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startRow;
|
3951
|
-
|
4019
|
+
var focusPosition = arguments.length > 2 ? arguments[2] : undefined;
|
4020
|
+
return selection.selectRows(startRow, endRow, focusPosition);
|
3952
4021
|
};
|
3953
4022
|
|
3954
4023
|
/**
|
@@ -3967,9 +4036,16 @@ function Core(rootElement, userSettings) {
|
|
3967
4036
|
* The previous selection is overwritten.
|
3968
4037
|
*
|
3969
4038
|
* ```js
|
3970
|
-
* // select all cells in the table, including all headers
|
4039
|
+
* // select all cells in the table, including all headers and the corner cell
|
3971
4040
|
* hot.selectAll();
|
3972
4041
|
*
|
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
|
+
*
|
3973
4049
|
* // select all cells in the table, without headers
|
3974
4050
|
* hot.selectAll(false);
|
3975
4051
|
* ```
|
@@ -3977,15 +4053,20 @@ function Core(rootElement, userSettings) {
|
|
3977
4053
|
* @since 0.38.2
|
3978
4054
|
* @memberof Core#
|
3979
4055
|
* @function selectAll
|
3980
|
-
* @param {boolean} [
|
3981
|
-
* `false
|
4056
|
+
* @param {boolean} [includeRowHeaders=false] `true` If the selection should include the row headers,
|
4057
|
+
* `false` otherwise.
|
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.
|
3982
4063
|
*/
|
3983
4064
|
this.selectAll = function () {
|
3984
|
-
var
|
3985
|
-
var
|
3986
|
-
var
|
4065
|
+
var includeRowHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
4066
|
+
var includeColumnHeaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : includeRowHeaders;
|
4067
|
+
var focusPosition = arguments.length > 2 ? arguments[2] : undefined;
|
3987
4068
|
preventScrollingToCell = true;
|
3988
|
-
selection.selectAll(includeRowHeaders, includeColumnHeaders);
|
4069
|
+
selection.selectAll(includeRowHeaders, includeColumnHeaders, focusPosition);
|
3989
4070
|
preventScrollingToCell = false;
|
3990
4071
|
};
|
3991
4072
|
var getIndexToScroll = function getIndexToScroll(indexMapper, visualIndex) {
|
@@ -4389,6 +4470,16 @@ function Core(rootElement, userSettings) {
|
|
4389
4470
|
}
|
4390
4471
|
};
|
4391
4472
|
|
4473
|
+
/**
|
4474
|
+
* Gets the instance of the EditorManager.
|
4475
|
+
*
|
4476
|
+
* @private
|
4477
|
+
* @returns {EditorManager}
|
4478
|
+
*/
|
4479
|
+
this._getEditorManager = function () {
|
4480
|
+
return editorManager;
|
4481
|
+
};
|
4482
|
+
|
4392
4483
|
/**
|
4393
4484
|
* Check if currently it is RTL direction.
|
4394
4485
|
*
|
@@ -4461,284 +4552,11 @@ function Core(rootElement, userSettings) {
|
|
4461
4552
|
this.getShortcutManager = function () {
|
4462
4553
|
return shortcutManager;
|
4463
4554
|
};
|
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);
|
4739
4555
|
(0, _registry.getPluginsNames)().forEach(function (pluginName) {
|
4740
4556
|
var PluginClass = (0, _registry.getPlugin)(pluginName);
|
4741
4557
|
pluginsRegistry.addItem(pluginName, new PluginClass(_this));
|
4742
4558
|
});
|
4559
|
+
(0, _shortcutContexts.registerAllShortcutContexts)(instance);
|
4560
|
+
shortcutManager.setActiveContextName('grid');
|
4743
4561
|
_pluginHooks.default.getSingleton().run(instance, 'construct');
|
4744
4562
|
}
|