handsontable 0.0.0-next-bfaf0f9-20230613 → 0.0.0-next-ea1e0b3-20230620
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/common.d.ts +1 -1
- package/core.d.ts +6 -9
- package/core.js +390 -235
- package/core.mjs +395 -240
- 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 +9243 -11930
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +107 -107
- package/dist/handsontable.js +12402 -15089
- 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 -6
- package/pluginHooks.js +1 -100
- package/pluginHooks.mjs +1 -100
- package/plugins/autofill/autofill.js +1 -2
- package/plugins/autofill/autofill.mjs +2 -3
- package/plugins/autofill/utils.js +1 -39
- package/plugins/autofill/utils.mjs +0 -37
- 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/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 +7 -56
- package/translations/indexMapper.mjs +8 -56
- 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
@@ -5,7 +5,6 @@ require("core-js/modules/es.symbol.description.js");
|
|
5
5
|
require("core-js/modules/es.symbol.iterator.js");
|
6
6
|
require("core-js/modules/es.regexp.to-string.js");
|
7
7
|
require("core-js/modules/es.function.name.js");
|
8
|
-
require("core-js/modules/es.object.freeze.js");
|
9
8
|
exports.__esModule = true;
|
10
9
|
exports.default = Core;
|
11
10
|
require("core-js/modules/es.array.iterator.js");
|
@@ -14,28 +13,28 @@ require("core-js/modules/es.set.js");
|
|
14
13
|
require("core-js/modules/es.string.iterator.js");
|
15
14
|
require("core-js/modules/web.dom-collections.iterator.js");
|
16
15
|
require("core-js/modules/es.array.includes.js");
|
17
|
-
require("core-js/modules/es.array.concat.js");
|
18
16
|
require("core-js/modules/es.array.sort.js");
|
19
17
|
require("core-js/modules/es.array.splice.js");
|
20
18
|
require("core-js/modules/es.number.is-integer.js");
|
21
19
|
require("core-js/modules/es.number.constructor.js");
|
22
20
|
require("core-js/modules/es.array.slice.js");
|
21
|
+
require("core-js/modules/es.array.concat.js");
|
23
22
|
require("core-js/modules/es.array.fill.js");
|
24
23
|
require("core-js/modules/es.array.map.js");
|
25
24
|
require("core-js/modules/es.regexp.exec.js");
|
26
25
|
require("core-js/modules/es.string.replace.js");
|
26
|
+
require("core-js/modules/es.array.filter.js");
|
27
27
|
require("core-js/modules/es.array.from.js");
|
28
28
|
require("core-js/modules/es.array.index-of.js");
|
29
29
|
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");
|
36
37
|
var _browser = require("./helpers/browser");
|
37
|
-
var _console = require("./helpers/console");
|
38
|
-
var _templateLiteralTag = require("./helpers/templateLiteralTag");
|
39
38
|
var _editorManager = _interopRequireDefault(require("./editorManager"));
|
40
39
|
var _eventManager = _interopRequireDefault(require("./eventManager"));
|
41
40
|
var _object = require("./helpers/object");
|
@@ -60,11 +59,8 @@ var _selection = require("./selection");
|
|
60
59
|
var _dataMap = require("./dataMap");
|
61
60
|
var _uniqueMap = require("./utils/dataStructures/uniqueMap");
|
62
61
|
var _shortcuts = require("./shortcuts");
|
63
|
-
var _shortcutContexts = require("./shortcutContexts");
|
64
|
-
var _templateObject, _templateObject2;
|
65
62
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
66
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); }
|
67
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
68
64
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
69
65
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
70
66
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
@@ -75,7 +71,15 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
75
71
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
76
72
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
77
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';
|
78
75
|
var activeGuid = null;
|
76
|
+
|
77
|
+
/**
|
78
|
+
* A set of deprecated feature names.
|
79
|
+
*
|
80
|
+
* @type {Set<string>}
|
81
|
+
*/
|
82
|
+
// eslint-disable-next-line no-unused-vars
|
79
83
|
var deprecationWarns = new Set();
|
80
84
|
|
81
85
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
@@ -291,8 +295,12 @@ function Core(rootElement, userSettings) {
|
|
291
295
|
};
|
292
296
|
|
293
297
|
var selection = new _selection.Selection(tableMeta, {
|
294
|
-
rowIndexMapper:
|
295
|
-
|
298
|
+
rowIndexMapper: function rowIndexMapper() {
|
299
|
+
return instance.rowIndexMapper;
|
300
|
+
},
|
301
|
+
columnIndexMapper: function columnIndexMapper() {
|
302
|
+
return instance.columnIndexMapper;
|
303
|
+
},
|
296
304
|
countCols: function countCols() {
|
297
305
|
return instance.countCols();
|
298
306
|
},
|
@@ -305,18 +313,12 @@ function Core(rootElement, userSettings) {
|
|
305
313
|
isEditorOpened: function isEditorOpened() {
|
306
314
|
return instance.getActiveEditor() ? instance.getActiveEditor().isOpened() : false;
|
307
315
|
},
|
308
|
-
|
316
|
+
countColsTranslated: function countColsTranslated() {
|
309
317
|
return _this.view.countRenderableColumns();
|
310
318
|
},
|
311
|
-
|
319
|
+
countRowsTranslated: function countRowsTranslated() {
|
312
320
|
return _this.view.countRenderableRows();
|
313
321
|
},
|
314
|
-
countRowHeaders: function countRowHeaders() {
|
315
|
-
return _this.countRowHeaders();
|
316
|
-
},
|
317
|
-
countColHeaders: function countColHeaders() {
|
318
|
-
return _this.countColHeaders();
|
319
|
-
},
|
320
322
|
getShortcutManager: function getShortcutManager() {
|
321
323
|
return instance.getShortcutManager();
|
322
324
|
},
|
@@ -349,6 +351,12 @@ function Core(rootElement, userSettings) {
|
|
349
351
|
});
|
350
352
|
this.selection.addLocalHook('beforeSetRangeEnd', function (cellCoords) {
|
351
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
|
+
}
|
352
360
|
});
|
353
361
|
this.selection.addLocalHook('afterSetRangeEnd', function (cellCoords) {
|
354
362
|
var preventScrolling = (0, _object.createObjectPropListener)(false);
|
@@ -374,14 +382,7 @@ function Core(rootElement, userSettings) {
|
|
374
382
|
if (scrollToCell !== false) {
|
375
383
|
if (!isSelectedByAnyHeader) {
|
376
384
|
if (currentSelectedRange && !_this.selection.isMultiple()) {
|
377
|
-
|
378
|
-
if (renderableCoords.row < 0 && renderableCoords.col >= 0) {
|
379
|
-
_this.view.scrollViewportHorizontally(renderableCoords.col);
|
380
|
-
} else if (renderableCoords.col < 0 && renderableCoords.row >= 0) {
|
381
|
-
_this.view.scrollViewportVertically(renderableCoords.row);
|
382
|
-
} else {
|
383
|
-
_this.view.scrollViewport(renderableCoords);
|
384
|
-
}
|
385
|
+
_this.view.scrollViewport(visualToRenderableCoords(currentSelectedRange.from));
|
385
386
|
} else {
|
386
387
|
_this.view.scrollViewport(visualToRenderableCoords(cellCoords));
|
387
388
|
}
|
@@ -422,30 +423,6 @@ function Core(rootElement, userSettings) {
|
|
422
423
|
isMultiple.value = changedIsMultiple;
|
423
424
|
}
|
424
425
|
});
|
425
|
-
this.selection.addLocalHook('beforeSelectColumns', function () {
|
426
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
427
|
-
args[_key] = arguments[_key];
|
428
|
-
}
|
429
|
-
return _this.runHooks.apply(_this, ['beforeSelectColumns'].concat(args));
|
430
|
-
});
|
431
|
-
this.selection.addLocalHook('afterSelectColumns', function () {
|
432
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
433
|
-
args[_key2] = arguments[_key2];
|
434
|
-
}
|
435
|
-
return _this.runHooks.apply(_this, ['afterSelectColumns'].concat(args));
|
436
|
-
});
|
437
|
-
this.selection.addLocalHook('beforeSelectRows', function () {
|
438
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
439
|
-
args[_key3] = arguments[_key3];
|
440
|
-
}
|
441
|
-
return _this.runHooks.apply(_this, ['beforeSelectRows'].concat(args));
|
442
|
-
});
|
443
|
-
this.selection.addLocalHook('afterSelectRows', function () {
|
444
|
-
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
445
|
-
args[_key4] = arguments[_key4];
|
446
|
-
}
|
447
|
-
return _this.runHooks.apply(_this, ['afterSelectRows'].concat(args));
|
448
|
-
});
|
449
426
|
this.selection.addLocalHook('beforeModifyTransformStart', function (cellCoordsDelta) {
|
450
427
|
_this.runHooks('modifyTransformStart', cellCoordsDelta);
|
451
428
|
});
|
@@ -531,13 +508,6 @@ function Core(rootElement, userSettings) {
|
|
531
508
|
|
532
509
|
/* eslint-disable no-case-declarations */
|
533
510
|
switch (action) {
|
534
|
-
case 'insert_row':
|
535
|
-
// backward compatibility
|
536
|
-
if (!deprecationWarns.has(action)) {
|
537
|
-
deprecationWarns.add(action);
|
538
|
-
(0, _console.warn)((0, _templateLiteralTag.toSingleLine)(_templateObject || (_templateObject = _taggedTemplateLiteral(["The `", "` action of the `alter()` method is deprecated and will be removed \n in the next major release of Handsontable. Use the `insert_row_above` action instead."], ["The \\`", "\\` action of the \\`alter()\\` method is deprecated and will be removed\\x20\n in the next major release of Handsontable. Use the \\`insert_row_above\\` action instead."])), action));
|
539
|
-
}
|
540
|
-
// falls through
|
541
511
|
case 'insert_row_below':
|
542
512
|
case 'insert_row_above':
|
543
513
|
var numberOfSourceRows = instance.countSourceRows();
|
@@ -548,11 +518,9 @@ function Core(rootElement, userSettings) {
|
|
548
518
|
// `above` is the default behavior for creating new rows
|
549
519
|
var insertRowMode = action === 'insert_row_below' ? 'below' : 'above';
|
550
520
|
|
551
|
-
// The line below ensures backward compatibility of the `alter()` method's `insert_row` action.
|
552
|
-
// Calling the `insert_row` action with no arguments adds a new row at the end of the data set.
|
553
521
|
// Calling the `insert_row_above` action adds a new row at the beginning of the data set.
|
554
522
|
// eslint-disable-next-line no-param-reassign
|
555
|
-
index = (_index = index) !== null && _index !== void 0 ? _index :
|
523
|
+
index = (_index = index) !== null && _index !== void 0 ? _index : insertRowMode === 'below' ? numberOfSourceRows : 0;
|
556
524
|
var _datamap$createRow = datamap.createRow(index, amount, {
|
557
525
|
source: source,
|
558
526
|
mode: insertRowMode
|
@@ -591,23 +559,14 @@ function Core(rootElement, userSettings) {
|
|
591
559
|
}
|
592
560
|
|
593
561
|
break;
|
594
|
-
case 'insert_col':
|
595
|
-
// backward compatibility
|
596
|
-
if (!deprecationWarns.has(action)) {
|
597
|
-
deprecationWarns.add(action);
|
598
|
-
(0, _console.warn)((0, _templateLiteralTag.toSingleLine)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["The `", "` action of the `alter()` method is deprecated and will be removed \n in the next major release of Handsontable. Use the `insert_col_start` action instead."], ["The \\`", "\\` action of the \\`alter()\\` method is deprecated and will be removed\\x20\n in the next major release of Handsontable. Use the \\`insert_col_start\\` action instead."])), action));
|
599
|
-
}
|
600
|
-
// falls through
|
601
562
|
case 'insert_col_start':
|
602
563
|
case 'insert_col_end':
|
603
564
|
// "start" is a default behavior for creating new columns
|
604
565
|
var insertColumnMode = action === 'insert_col_end' ? 'end' : 'start';
|
605
566
|
|
606
|
-
// The line below ensures backward compatibility of the `alter()` method's `insert_col` action.
|
607
|
-
// Calling the `insert_col` action with no arguments adds a new column to the right of the data set.
|
608
567
|
// Calling the `insert_col_start` action adds a new column to the left of the data set.
|
609
568
|
// eslint-disable-next-line no-param-reassign
|
610
|
-
index = (_index2 = index) !== null && _index2 !== void 0 ? _index2 :
|
569
|
+
index = (_index2 = index) !== null && _index2 !== void 0 ? _index2 : insertColumnMode === 'end' ? instance.countSourceCols() : 0;
|
611
570
|
var _datamap$createCol = datamap.createCol(index, amount, {
|
612
571
|
source: source,
|
613
572
|
mode: insertColumnMode
|
@@ -878,13 +837,9 @@ function Core(rootElement, userSettings) {
|
|
878
837
|
* @param {object} [end] End selection position (only for drag-down mode). Visual indexes.
|
879
838
|
* @param {string} [source="populateFromArray"] Source information string.
|
880
839
|
* @param {string} [method="overwrite"] Populate method. Possible options: `shift_down`, `shift_right`, `overwrite`.
|
881
|
-
* @param {string} direction (left|right|up|down) String specifying the direction.
|
882
|
-
* @param {Array} deltas The deltas array. A difference between values of adjacent cells.
|
883
|
-
* Useful **only** when the type of handled cells is `numeric`.
|
884
840
|
* @returns {object|undefined} Ending td in pasted area (only if any cell was changed).
|
885
841
|
*/
|
886
|
-
populateFromArray: function populateFromArray(start, input, end, source, method
|
887
|
-
// TODO: either remove or implement the `direction` argument. Currently it's not working at all.
|
842
|
+
populateFromArray: function populateFromArray(start, input, end, source, method) {
|
888
843
|
var r;
|
889
844
|
var rlen;
|
890
845
|
var c;
|
@@ -972,11 +927,6 @@ function Core(rootElement, userSettings) {
|
|
972
927
|
// overwrite and other not specified options
|
973
928
|
current.row = start.row;
|
974
929
|
current.col = start.col;
|
975
|
-
var selected = {
|
976
|
-
// selected range
|
977
|
-
row: end && start ? end.row - start.row + 1 : 1,
|
978
|
-
col: end && start ? end.col - start.col + 1 : 1
|
979
|
-
};
|
980
930
|
var skippedRow = 0;
|
981
931
|
var skippedColumn = 0;
|
982
932
|
var pushData = true;
|
@@ -1037,16 +987,6 @@ function Core(rootElement, userSettings) {
|
|
1037
987
|
var visualColumn = c - skippedColumn;
|
1038
988
|
var value = getInputValue(visualRow, visualColumn);
|
1039
989
|
var orgValue = instance.getDataAtCell(current.row, current.col);
|
1040
|
-
var index = {
|
1041
|
-
row: visualRow,
|
1042
|
-
col: visualColumn
|
1043
|
-
};
|
1044
|
-
if (source === 'Autofill.fill') {
|
1045
|
-
var result = instance.runHooks('beforeAutofillInsidePopulate', index, direction, input, deltas, {}, selected);
|
1046
|
-
if (result) {
|
1047
|
-
value = (0, _mixed.isUndefined)(result.value) ? value : result.value;
|
1048
|
-
}
|
1049
|
-
}
|
1050
990
|
if (value !== null && _typeof(value) === 'object') {
|
1051
991
|
// when 'value' is array and 'orgValue' is null, set 'orgValue' to
|
1052
992
|
// an empty array so that the null value can be compared to 'value'
|
@@ -1216,15 +1156,8 @@ function Core(rootElement, userSettings) {
|
|
1216
1156
|
return;
|
1217
1157
|
}
|
1218
1158
|
var activeEditor = instance.getActiveEditor();
|
1219
|
-
var beforeChangeResult = instance.runHooks('beforeChange', changes, source || 'edit');
|
1220
|
-
var shouldBeCanceled = true;
|
1221
|
-
if (beforeChangeResult === false) {
|
1222
|
-
if (activeEditor) {
|
1223
|
-
activeEditor.cancelChanges();
|
1224
|
-
}
|
1225
|
-
return;
|
1226
|
-
}
|
1227
1159
|
var waitingForValidator = new ValidatorsQueue();
|
1160
|
+
var shouldBeCanceled = true;
|
1228
1161
|
waitingForValidator.onQueueEmpty = function (isValid) {
|
1229
1162
|
if (activeEditor && shouldBeCanceled) {
|
1230
1163
|
activeEditor.cancelChanges();
|
@@ -1233,43 +1166,37 @@ function Core(rootElement, userSettings) {
|
|
1233
1166
|
};
|
1234
1167
|
|
1235
1168
|
for (var i = changes.length - 1; i >= 0; i--) {
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
if (cellProperties.type === 'numeric' && typeof newValue === 'string' && (0, _number.isNumericLike)(newValue)) {
|
1246
|
-
changes[i][3] = getParsedNumber(newValue);
|
1247
|
-
}
|
1169
|
+
var _changes$i = _slicedToArray(changes[i], 4),
|
1170
|
+
row = _changes$i[0],
|
1171
|
+
prop = _changes$i[1],
|
1172
|
+
newValue = _changes$i[3];
|
1173
|
+
var col = datamap.propToCol(prop);
|
1174
|
+
var cellProperties = instance.getCellMeta(row, col);
|
1175
|
+
if (cellProperties.type === 'numeric' && typeof newValue === 'string' && (0, _number.isNumericLike)(newValue)) {
|
1176
|
+
changes[i][3] = getParsedNumber(newValue);
|
1177
|
+
}
|
1248
1178
|
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
1264
|
-
|
1265
|
-
}
|
1266
|
-
// index -= 1;
|
1179
|
+
/* eslint-disable no-loop-func */
|
1180
|
+
if (instance.getCellValidator(cellProperties)) {
|
1181
|
+
waitingForValidator.addValidatorToQueue();
|
1182
|
+
instance.validateCell(changes[i][3], cellProperties, function (index, cellPropertiesReference) {
|
1183
|
+
return function (result) {
|
1184
|
+
if (typeof result !== 'boolean') {
|
1185
|
+
throw new Error('Validation error: result is not boolean');
|
1186
|
+
}
|
1187
|
+
if (result === false && cellPropertiesReference.allowInvalid === false) {
|
1188
|
+
shouldBeCanceled = false;
|
1189
|
+
changes.splice(index, 1); // cancel the change
|
1190
|
+
cellPropertiesReference.valid = true; // we cancelled the change, so cell value is still valid
|
1191
|
+
|
1192
|
+
var cell = instance.getCell(cellPropertiesReference.visualRow, cellPropertiesReference.visualCol);
|
1193
|
+
if (cell !== null) {
|
1194
|
+
(0, _element.removeClass)(cell, tableMeta.invalidCellClassName);
|
1267
1195
|
}
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
}
|
1196
|
+
}
|
1197
|
+
waitingForValidator.removeValidatorFormQueue();
|
1198
|
+
};
|
1199
|
+
}(i, cellProperties), source);
|
1273
1200
|
}
|
1274
1201
|
}
|
1275
1202
|
waitingForValidator.checkIfQueueIsEmpty();
|
@@ -1459,6 +1386,31 @@ function Core(rootElement, userSettings) {
|
|
1459
1386
|
return [[row, propOrCol, value]];
|
1460
1387
|
}
|
1461
1388
|
|
1389
|
+
/**
|
1390
|
+
* Process changes prepared for applying to the dataset (unifying list of changes, closing an editor - when needed,
|
1391
|
+
* calling a hook).
|
1392
|
+
*
|
1393
|
+
* @private
|
1394
|
+
* @param {Array} changes Array of changes in format `[[row, col, value],...]`.
|
1395
|
+
* @param {string} [source] String that identifies how this change will be described in the changes array (useful in afterChange or beforeChange callback). Set to 'edit' if left empty.
|
1396
|
+
* @returns {Array} List of changes finally applied to the dataset.
|
1397
|
+
*/
|
1398
|
+
function processChanges(changes, source) {
|
1399
|
+
var activeEditor = instance.getActiveEditor();
|
1400
|
+
var beforeChangeResult = instance.runHooks('beforeChange', changes, source || 'edit');
|
1401
|
+
// The `beforeChange` hook could add a `null` for purpose of cancelling some dataset's change.
|
1402
|
+
var filteredChanges = changes.filter(function (change) {
|
1403
|
+
return change !== null;
|
1404
|
+
});
|
1405
|
+
if (beforeChangeResult === false || filteredChanges.length === 0) {
|
1406
|
+
if (activeEditor) {
|
1407
|
+
activeEditor.cancelChanges();
|
1408
|
+
}
|
1409
|
+
return [];
|
1410
|
+
}
|
1411
|
+
return filteredChanges;
|
1412
|
+
}
|
1413
|
+
|
1462
1414
|
/**
|
1463
1415
|
* @description
|
1464
1416
|
* Set new value to a cell. To change many cells at once (recommended way), pass an array of `changes` in format
|
@@ -1496,9 +1448,10 @@ function Core(rootElement, userSettings) {
|
|
1496
1448
|
if (!changeSource && _typeof(row) === 'object') {
|
1497
1449
|
changeSource = column;
|
1498
1450
|
}
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1451
|
+
var processedChanges = processChanges(changes, source);
|
1452
|
+
instance.runHooks('afterSetDataAtCell', processedChanges, changeSource);
|
1453
|
+
validateChanges(processedChanges, changeSource, function () {
|
1454
|
+
applyChanges(processedChanges, changeSource);
|
1502
1455
|
});
|
1503
1456
|
};
|
1504
1457
|
|
@@ -1526,9 +1479,10 @@ function Core(rootElement, userSettings) {
|
|
1526
1479
|
if (!changeSource && _typeof(row) === 'object') {
|
1527
1480
|
changeSource = prop;
|
1528
1481
|
}
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1482
|
+
var processedChanges = processChanges(changes, source);
|
1483
|
+
instance.runHooks('afterSetDataAtRowProp', processedChanges, changeSource);
|
1484
|
+
validateChanges(processedChanges, changeSource, function () {
|
1485
|
+
applyChanges(processedChanges, changeSource);
|
1532
1486
|
});
|
1533
1487
|
};
|
1534
1488
|
|
@@ -1603,18 +1557,15 @@ function Core(rootElement, userSettings) {
|
|
1603
1557
|
* @param {number} [endCol] End visual column index (use when you want to cut input when certain column is reached).
|
1604
1558
|
* @param {string} [source=populateFromArray] Used to identify this call in the resulting events (beforeChange, afterChange).
|
1605
1559
|
* @param {string} [method=overwrite] Populate method, possible values: `'shift_down'`, `'shift_right'`, `'overwrite'`.
|
1606
|
-
* @param {string} direction Populate direction, possible values: `'left'`, `'right'`, `'up'`, `'down'`.
|
1607
|
-
* @param {Array} deltas The deltas array. A difference between values of adjacent cells.
|
1608
|
-
* Useful **only** when the type of handled cells is `numeric`.
|
1609
1560
|
* @returns {object|undefined} Ending td in pasted area (only if any cell was changed).
|
1610
1561
|
*/
|
1611
|
-
this.populateFromArray = function (row, column, input, endRow, endCol, source, method
|
1562
|
+
this.populateFromArray = function (row, column, input, endRow, endCol, source, method) {
|
1612
1563
|
if (!(_typeof(input) === 'object' && _typeof(input[0]) === 'object')) {
|
1613
1564
|
throw new Error('populateFromArray parameter `input` must be an array of arrays'); // API changed in 0.9-beta2, let's check if you use it correctly
|
1614
1565
|
}
|
1615
1566
|
|
1616
1567
|
var c = typeof endRow === 'number' ? instance._createCellCoords(endRow, endCol) : null;
|
1617
|
-
return grid.populateFromArray(instance._createCellCoords(row, column), input, c, source, method
|
1568
|
+
return grid.populateFromArray(instance._createCellCoords(row, column), input, c, source, method);
|
1618
1569
|
};
|
1619
1570
|
|
1620
1571
|
/**
|
@@ -1630,8 +1581,8 @@ function Core(rootElement, userSettings) {
|
|
1630
1581
|
*/
|
1631
1582
|
this.spliceCol = function (column, index, amount) {
|
1632
1583
|
var _datamap;
|
1633
|
-
for (var
|
1634
|
-
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];
|
1635
1586
|
}
|
1636
1587
|
return (_datamap = datamap).spliceCol.apply(_datamap, [column, index, amount].concat(elements));
|
1637
1588
|
};
|
@@ -1649,8 +1600,8 @@ function Core(rootElement, userSettings) {
|
|
1649
1600
|
*/
|
1650
1601
|
this.spliceRow = function (row, index, amount) {
|
1651
1602
|
var _datamap2;
|
1652
|
-
for (var
|
1653
|
-
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];
|
1654
1605
|
}
|
1655
1606
|
return (_datamap2 = datamap).spliceRow.apply(_datamap2, [row, index, amount].concat(elements));
|
1656
1607
|
};
|
@@ -1746,9 +1697,6 @@ function Core(rootElement, userSettings) {
|
|
1746
1697
|
}
|
1747
1698
|
var changes = [];
|
1748
1699
|
(0, _array.arrayEach)(selection.getSelectedRange(), function (cellRange) {
|
1749
|
-
if (cellRange.isSingleHeader()) {
|
1750
|
-
return;
|
1751
|
-
}
|
1752
1700
|
var topStart = cellRange.getTopStartCorner();
|
1753
1701
|
var bottomEnd = cellRange.getBottomEndCorner();
|
1754
1702
|
(0, _number.rangeEach)(topStart.row, bottomEnd.row, function (row) {
|
@@ -2537,16 +2485,14 @@ function Core(rootElement, userSettings) {
|
|
2537
2485
|
*
|
2538
2486
|
* | Action | With `index` | Without `index` |
|
2539
2487
|
* | -------------------- | ------------ | --------------- |
|
2540
|
-
* | `'insert_row_above'` | Inserts rows above the `index` row
|
2541
|
-
* | `'insert_row_below'` | Inserts rows below the `index` row. | Inserts rows below the last row
|
2488
|
+
* | `'insert_row_above'` | Inserts rows above the `index` row. | Inserts rows above the first row. |
|
2489
|
+
* | `'insert_row_below'` | Inserts rows below the `index` row. | Inserts rows below the last row. |
|
2542
2490
|
* | `'remove_row'` | Removes rows, starting from the `index` row. | Removes rows, starting from the last row. |
|
2543
|
-
* | `'insert_col_start'` | Inserts columns before the `index` column
|
2544
|
-
* | `'insert_col_end'` | Inserts columns after the `index` column. | Inserts columns after the last column
|
2491
|
+
* | `'insert_col_start'` | Inserts columns before the `index` column. | Inserts columns before the first column. |
|
2492
|
+
* | `'insert_col_end'` | Inserts columns after the `index` column. | Inserts columns after the last column. |
|
2545
2493
|
* | `'remove_col'` | Removes columns, starting from the `index` column. | Removes columns, starting from the last column. |
|
2546
|
-
* | `'insert_row'` (<b>Deprecated</b>) | Inserts rows above the `index` row.<br><br>Works the same as `insert_row_above` with an `index`. | Inserts rows below the last row.<br><br>Works the same as `insert_row_below` with no `index`. |
|
2547
|
-
* | `'insert_col'` (<b>Deprecated</b>) | Inserts columns before the `index` column.<br><br>Works the same as `insert_col_start` with an `index`.| Inserts columns after the last column.<br><br>Works the same as `insert_col_end` with no `index`. |
|
2548
2494
|
*
|
2549
|
-
* Additional information about `'insert_col_start'
|
2495
|
+
* Additional information about `'insert_col_start'` and `'insert_col_end'`:
|
2550
2496
|
* - Their behavior depends on your [`layoutDirection`](@/api/options.md#layoutdirection).
|
2551
2497
|
* - If the provided `index` is higher than the actual number of columns, Handsontable doesn't generate
|
2552
2498
|
* the columns missing in between. Instead, the new columns are inserted next to the last column.
|
@@ -2561,8 +2507,6 @@ function Core(rootElement, userSettings) {
|
|
2561
2507
|
* <li> `'insert_col_start'` </li>
|
2562
2508
|
* <li> `'insert_col_end'` </li>
|
2563
2509
|
* <li> `'remove_col'` </li>
|
2564
|
-
* <li> `'insert_row'` (<b>Deprecated</b>) </li>
|
2565
|
-
* <li> `'insert_col'` (<b>Deprecated</b>) </li>
|
2566
2510
|
* </ul>
|
2567
2511
|
* @param {number|number[]} [index] A visual index of the row/column before or after which the new row/column will be
|
2568
2512
|
* inserted or removed. Can also be an array of arrays, in format `[[index, amount],...]`.
|
@@ -3067,8 +3011,8 @@ function Core(rootElement, userSettings) {
|
|
3067
3011
|
this.spliceCellsMeta = function (visualIndex) {
|
3068
3012
|
var _this5 = this;
|
3069
3013
|
var deleteAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
3070
|
-
for (var
|
3071
|
-
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];
|
3072
3016
|
}
|
3073
3017
|
if (cellMetaRows.length > 0 && !Array.isArray(cellMetaRows[0])) {
|
3074
3018
|
throw new Error('The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.');
|
@@ -3762,30 +3706,6 @@ function Core(rootElement, userSettings) {
|
|
3762
3706
|
return instance.view._wt.drawn ? instance.view._wt.wtTable.getVisibleColumnsCount() : -1;
|
3763
3707
|
};
|
3764
3708
|
|
3765
|
-
/**
|
3766
|
-
* Returns the number of rendered row headers.
|
3767
|
-
*
|
3768
|
-
* @since 13.0.0
|
3769
|
-
* @memberof Core#
|
3770
|
-
* @function countRowHeaders
|
3771
|
-
* @returns {number} Number of row headers.
|
3772
|
-
*/
|
3773
|
-
this.countRowHeaders = function () {
|
3774
|
-
return this.view.getRowHeadersCount();
|
3775
|
-
};
|
3776
|
-
|
3777
|
-
/**
|
3778
|
-
* Returns the number of rendered column headers.
|
3779
|
-
*
|
3780
|
-
* @since 13.0.0
|
3781
|
-
* @memberof Core#
|
3782
|
-
* @function countColHeaders
|
3783
|
-
* @returns {number} Number of column headers.
|
3784
|
-
*/
|
3785
|
-
this.countColHeaders = function () {
|
3786
|
-
return this.view.getColumnHeadersCount();
|
3787
|
-
};
|
3788
|
-
|
3789
3709
|
/**
|
3790
3710
|
* Returns the number of empty rows. If the optional ending parameter is `true`, returns the
|
3791
3711
|
* number of empty rows at the bottom of the table.
|
@@ -3990,10 +3910,6 @@ function Core(rootElement, userSettings) {
|
|
3990
3910
|
* hot.selectColumns('id');
|
3991
3911
|
* // Select range of columns using visual indexes.
|
3992
3912
|
* hot.selectColumns(1, 4);
|
3993
|
-
* // Select range of columns using visual indexes and mark the first header as highlighted.
|
3994
|
-
* hot.selectColumns(1, 2, -1);
|
3995
|
-
* // Select range of columns using visual indexes and mark the second cell as highlighted.
|
3996
|
-
* hot.selectColumns(2, 1, 1);
|
3997
3913
|
* // Select range of columns using column properties.
|
3998
3914
|
* hot.selectColumns('id', 'last_name');
|
3999
3915
|
* ```
|
@@ -4004,15 +3920,11 @@ function Core(rootElement, userSettings) {
|
|
4004
3920
|
* @param {number} startColumn The visual column index from which the selection starts.
|
4005
3921
|
* @param {number} [endColumn=startColumn] The visual column index to which the selection finishes. If `endColumn`
|
4006
3922
|
* is not defined the column defined by `startColumn` will be selected.
|
4007
|
-
* @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
|
4008
|
-
* The value can take visual row index from -N to N, where negative values
|
4009
|
-
* point to the headers and positive values point to the cell range.
|
4010
3923
|
* @returns {boolean} `true` if selection was successful, `false` otherwise.
|
4011
3924
|
*/
|
4012
3925
|
this.selectColumns = function (startColumn) {
|
4013
3926
|
var endColumn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startColumn;
|
4014
|
-
|
4015
|
-
return selection.selectColumns(startColumn, endColumn, focusPosition);
|
3927
|
+
return selection.selectColumns(startColumn, endColumn);
|
4016
3928
|
};
|
4017
3929
|
|
4018
3930
|
/**
|
@@ -4022,12 +3934,8 @@ function Core(rootElement, userSettings) {
|
|
4022
3934
|
* ```js
|
4023
3935
|
* // Select row using visual index.
|
4024
3936
|
* hot.selectRows(1);
|
4025
|
-
* //
|
3937
|
+
* // Select range of rows using visual indexes.
|
4026
3938
|
* hot.selectRows(1, 4);
|
4027
|
-
* // select a range of rows, using visual indexes, and mark the header as highlighted.
|
4028
|
-
* hot.selectRows(1, 2, -1);
|
4029
|
-
* // Select range of rows using visual indexes and mark the second cell as highlighted.
|
4030
|
-
* hot.selectRows(2, 1, 1);
|
4031
3939
|
* ```
|
4032
3940
|
*
|
4033
3941
|
* @memberof Core#
|
@@ -4036,15 +3944,11 @@ function Core(rootElement, userSettings) {
|
|
4036
3944
|
* @param {number} startRow The visual row index from which the selection starts.
|
4037
3945
|
* @param {number} [endRow=startRow] The visual row index to which the selection finishes. If `endRow`
|
4038
3946
|
* is not defined the row defined by `startRow` will be selected.
|
4039
|
-
* @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
|
4040
|
-
* The value can take visual column index from -N to N, where negative values
|
4041
|
-
* point to the headers and positive values point to the cell range.
|
4042
3947
|
* @returns {boolean} `true` if selection was successful, `false` otherwise.
|
4043
3948
|
*/
|
4044
3949
|
this.selectRows = function (startRow) {
|
4045
3950
|
var endRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startRow;
|
4046
|
-
|
4047
|
-
return selection.selectRows(startRow, endRow, focusPosition);
|
3951
|
+
return selection.selectRows(startRow, endRow);
|
4048
3952
|
};
|
4049
3953
|
|
4050
3954
|
/**
|
@@ -4063,16 +3967,9 @@ function Core(rootElement, userSettings) {
|
|
4063
3967
|
* The previous selection is overwritten.
|
4064
3968
|
*
|
4065
3969
|
* ```js
|
4066
|
-
* // select all cells in the table, including all headers
|
3970
|
+
* // select all cells in the table, including all headers
|
4067
3971
|
* hot.selectAll();
|
4068
3972
|
*
|
4069
|
-
* // select all cells in the table, including row headers but excluding the corner cell
|
4070
|
-
* hot.selectAll(true, false);
|
4071
|
-
*
|
4072
|
-
* // select all cells in the table, including all headers and the corner cell, but move the focus
|
4073
|
-
* // highlight to position -2, -1
|
4074
|
-
* hot.selectAll(-2, -1);
|
4075
|
-
*
|
4076
3973
|
* // select all cells in the table, without headers
|
4077
3974
|
* hot.selectAll(false);
|
4078
3975
|
* ```
|
@@ -4080,20 +3977,15 @@ function Core(rootElement, userSettings) {
|
|
4080
3977
|
* @since 0.38.2
|
4081
3978
|
* @memberof Core#
|
4082
3979
|
* @function selectAll
|
4083
|
-
* @param {boolean} [
|
4084
|
-
* `false
|
4085
|
-
* @param {boolean} [includeColumnHeaders=false] `true` If the selection should include the column
|
4086
|
-
* headers, `false` otherwise.
|
4087
|
-
* @param {{row: number, col: number}} [focusPosition] The argument allows changing the cell/header
|
4088
|
-
* focus position. The value takes an object with a `row` and `col` properties (visual indexes)
|
4089
|
-
* 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.
|
4090
3982
|
*/
|
4091
3983
|
this.selectAll = function () {
|
4092
|
-
var
|
4093
|
-
var
|
4094
|
-
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();
|
4095
3987
|
preventScrollingToCell = true;
|
4096
|
-
selection.selectAll(includeRowHeaders, includeColumnHeaders
|
3988
|
+
selection.selectAll(includeRowHeaders, includeColumnHeaders);
|
4097
3989
|
preventScrollingToCell = false;
|
4098
3990
|
};
|
4099
3991
|
var getIndexToScroll = function getIndexToScroll(indexMapper, visualIndex) {
|
@@ -4497,16 +4389,6 @@ function Core(rootElement, userSettings) {
|
|
4497
4389
|
}
|
4498
4390
|
};
|
4499
4391
|
|
4500
|
-
/**
|
4501
|
-
* Gets the instance of the EditorManager.
|
4502
|
-
*
|
4503
|
-
* @private
|
4504
|
-
* @returns {EditorManager}
|
4505
|
-
*/
|
4506
|
-
this._getEditorManager = function () {
|
4507
|
-
return editorManager;
|
4508
|
-
};
|
4509
|
-
|
4510
4392
|
/**
|
4511
4393
|
* Check if currently it is RTL direction.
|
4512
4394
|
*
|
@@ -4579,11 +4461,284 @@ function Core(rootElement, userSettings) {
|
|
4579
4461
|
this.getShortcutManager = function () {
|
4580
4462
|
return shortcutManager;
|
4581
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);
|
4582
4739
|
(0, _registry.getPluginsNames)().forEach(function (pluginName) {
|
4583
4740
|
var PluginClass = (0, _registry.getPlugin)(pluginName);
|
4584
4741
|
pluginsRegistry.addItem(pluginName, new PluginClass(_this));
|
4585
4742
|
});
|
4586
|
-
(0, _shortcutContexts.registerAllShortcutContexts)(instance);
|
4587
|
-
shortcutManager.setActiveContextName('grid');
|
4588
4743
|
_pluginHooks.default.getSingleton().run(instance, 'construct');
|
4589
4744
|
}
|