handsontable 0.0.0-next-93e34dc-20230601 → 0.0.0-next-b7cca45-20230605
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 +354 -0
- package/3rdparty/walkontable/src/selection.mjs +348 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +0 -9
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +0 -9
- package/3rdparty/walkontable/src/table.js +79 -7
- package/3rdparty/walkontable/src/table.mjs +80 -8
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.d.ts +3 -5
- package/core.js +300 -82
- package/core.mjs +300 -82
- package/dataMap/metaManager/metaSchema.js +0 -15
- package/dataMap/metaManager/metaSchema.mjs +0 -15
- package/dist/handsontable.css +3 -8
- package/dist/handsontable.full.css +3 -8
- package/dist/handsontable.full.js +9926 -12218
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +120 -120
- package/dist/handsontable.js +14628 -16920
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +4 -4
- package/editorManager.js +82 -20
- package/editorManager.mjs +86 -25
- 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.js +1 -1
- package/pluginHooks.mjs +1 -1
- package/plugins/copyPaste/copyPaste.js +1 -5
- package/plugins/copyPaste/copyPaste.mjs +1 -5
- package/plugins/customBorders/customBorders.js +52 -18
- package/plugins/customBorders/customBorders.mjs +53 -19
- package/plugins/mergeCells/mergeCells.js +18 -5
- package/plugins/mergeCells/mergeCells.mjs +18 -5
- package/plugins/nestedHeaders/nestedHeaders.js +9 -89
- package/plugins/nestedHeaders/nestedHeaders.mjs +9 -89
- package/plugins/nestedHeaders/stateManager/index.js +0 -37
- package/plugins/nestedHeaders/stateManager/index.mjs +0 -37
- 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 +88 -311
- package/selection/highlight/highlight.mjs +84 -301
- 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 +28 -23
- package/selection/highlight/visualSelection.mjs +28 -23
- 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 +180 -296
- package/selection/selection.mjs +179 -291
- package/selection/transformation.js +96 -233
- package/selection/transformation.mjs +93 -230
- package/selection/utils.js +35 -12
- package/selection/utils.mjs +35 -13
- package/settings.d.ts +0 -1
- package/tableView.js +9 -58
- package/tableView.mjs +9 -58
- 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 -328
- package/3rdparty/walkontable/src/selection/manager.mjs +0 -322
- package/3rdparty/walkontable/src/selection/scanner.js +0 -363
- package/3rdparty/walkontable/src/selection/scanner.mjs +0 -359
- 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 -24
- package/shortcutContexts/commands/extendCellsSelection/index.mjs +0 -20
- 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/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 -39
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +0 -34
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +0 -39
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +0 -34
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +0 -22
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +0 -17
- 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 -51
- package/shortcutContexts/commands/index.mjs +0 -47
- package/shortcutContexts/commands/moveCellSelection/down.js +0 -12
- package/shortcutContexts/commands/moveCellSelection/down.mjs +0 -7
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +0 -11
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +0 -6
- 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 -35
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +0 -30
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +0 -35
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +0 -30
- 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 -11
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +0 -6
- 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 -232
- package/shortcutContexts/grid.mjs +0 -228
- package/shortcutContexts/index.js +0 -29
- package/shortcutContexts/index.mjs +0 -15
@@ -1,217 +1,132 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
require("core-js/modules/es.symbol.iterator.js");
|
4
|
+
require("core-js/modules/es.array.iterator.js");
|
5
|
+
require("core-js/modules/es.string.iterator.js");
|
6
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
7
|
+
exports.__esModule = true;
|
8
|
+
exports.default = void 0;
|
3
9
|
require("core-js/modules/es.symbol.to-primitive.js");
|
4
10
|
require("core-js/modules/es.date.to-primitive.js");
|
5
11
|
require("core-js/modules/es.symbol.js");
|
6
12
|
require("core-js/modules/es.symbol.description.js");
|
7
|
-
require("core-js/modules/es.number.constructor.js");
|
8
|
-
require("core-js/modules/es.symbol.iterator.js");
|
9
|
-
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); }
|
10
|
-
exports.__esModule = true;
|
11
|
-
exports.default = void 0;
|
12
|
-
require("core-js/modules/es.array.iterator.js");
|
13
13
|
require("core-js/modules/es.object.to-string.js");
|
14
|
-
require("core-js/modules/es.
|
15
|
-
require("core-js/modules/es.weak-map.js");
|
16
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
17
|
-
require("core-js/modules/es.weak-set.js");
|
14
|
+
require("core-js/modules/es.number.constructor.js");
|
18
15
|
var _object = require("../helpers/object");
|
19
16
|
var _localHooks = _interopRequireDefault(require("./../mixins/localHooks"));
|
20
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
18
|
+
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); }
|
21
19
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
22
20
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
23
21
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
24
22
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
25
23
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
26
|
-
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
27
|
-
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
28
|
-
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
29
|
-
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
30
|
-
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
31
|
-
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
32
|
-
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
33
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
34
|
-
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
35
24
|
/**
|
36
25
|
* The Transformation class implements algorithms for transforming coordinates based on current settings
|
37
|
-
* passed to the Handsontable.
|
26
|
+
* passed to the Handsontable.
|
38
27
|
*
|
39
28
|
* Transformation is always applied relative to the current selection.
|
40
29
|
*
|
41
|
-
* The class operates on a table size defined by the renderable indexes. If the `navigableHeaders`
|
42
|
-
* option is enabled, the table size is increased by the number of row and/or column headers.
|
43
|
-
* Because the headers are treated as cells as part of the table size (indexes always go from 0 to N),
|
44
|
-
* the algorithm can be written as simply as possible (without new if's that distinguish the headers
|
45
|
-
* logic).
|
46
|
-
*
|
47
30
|
* @class Transformation
|
48
31
|
* @util
|
49
32
|
*/
|
50
|
-
var _range = /*#__PURE__*/new WeakMap();
|
51
|
-
var _options = /*#__PURE__*/new WeakMap();
|
52
|
-
var _offset = /*#__PURE__*/new WeakMap();
|
53
|
-
var _setOffsetSize = /*#__PURE__*/new WeakSet();
|
54
|
-
var _clampCoords = /*#__PURE__*/new WeakSet();
|
55
|
-
var _getTableSize = /*#__PURE__*/new WeakSet();
|
56
|
-
var _visualToZeroBasedCoords = /*#__PURE__*/new WeakSet();
|
57
|
-
var _zeroBasedToVisualCoords = /*#__PURE__*/new WeakSet();
|
58
33
|
var Transformation = /*#__PURE__*/function () {
|
59
34
|
function Transformation(range, options) {
|
60
35
|
_classCallCheck(this, Transformation);
|
61
|
-
/**
|
62
|
-
* Translates the zero-based coordinates to visual ones.
|
63
|
-
*
|
64
|
-
* @param {CellCoords} zeroBasedCoords The coordinates to process.
|
65
|
-
* @returns {CellCoords}
|
66
|
-
*/
|
67
|
-
_classPrivateMethodInitSpec(this, _zeroBasedToVisualCoords);
|
68
|
-
/**
|
69
|
-
* Translates the visual coordinates to zero-based ones.
|
70
|
-
*
|
71
|
-
* @param {CellCoords} visualCoords The visual coords to process.
|
72
|
-
* @returns {{x: number, y: number}}
|
73
|
-
*/
|
74
|
-
_classPrivateMethodInitSpec(this, _visualToZeroBasedCoords);
|
75
|
-
/**
|
76
|
-
* Gets the table size in number of rows with headers as "height" and number of columns with
|
77
|
-
* headers as "width".
|
78
|
-
*
|
79
|
-
* @returns {{width: number, height: number}}
|
80
|
-
*/
|
81
|
-
_classPrivateMethodInitSpec(this, _getTableSize);
|
82
|
-
/**
|
83
|
-
* Clamps the coords to make sure they points to the cell (or header) in the table range.
|
84
|
-
*
|
85
|
-
* @param {CellCoords} zeroBasedCoords The coords object to clamp.
|
86
|
-
* @returns {{rowDir: 1|0|-1, colDir: 1|0|-1}}
|
87
|
-
*/
|
88
|
-
_classPrivateMethodInitSpec(this, _clampCoords);
|
89
|
-
/**
|
90
|
-
* Sets the additional offset in table size that may occur when the `navigableHeaders` option
|
91
|
-
* is enabled.
|
92
|
-
*
|
93
|
-
* @param {{x: number, y: number}} offset Offset as x and y properties.
|
94
|
-
*/
|
95
|
-
_classPrivateMethodInitSpec(this, _setOffsetSize);
|
96
36
|
/**
|
97
37
|
* Instance of the SelectionRange, holder for visual coordinates applied to the table.
|
98
38
|
*
|
99
39
|
* @type {SelectionRange}
|
100
40
|
*/
|
101
|
-
|
102
|
-
writable: true,
|
103
|
-
value: void 0
|
104
|
-
});
|
41
|
+
this.range = range;
|
105
42
|
/**
|
106
43
|
* Additional options which define the state of the settings which can infer transformation and
|
107
44
|
* give the possibility to translate indexes.
|
108
45
|
*
|
109
46
|
* @type {object}
|
110
47
|
*/
|
111
|
-
|
112
|
-
writable: true,
|
113
|
-
value: void 0
|
114
|
-
});
|
115
|
-
/**
|
116
|
-
* Increases the table size by applying the offsets. The option is used by the `navigableHeaders`
|
117
|
-
* option.
|
118
|
-
*
|
119
|
-
* @type {{ x: number, y: number }}
|
120
|
-
*/
|
121
|
-
_classPrivateFieldInitSpec(this, _offset, {
|
122
|
-
writable: true,
|
123
|
-
value: {
|
124
|
-
x: 0,
|
125
|
-
y: 0
|
126
|
-
}
|
127
|
-
});
|
128
|
-
_classPrivateFieldSet(this, _range, range);
|
129
|
-
_classPrivateFieldSet(this, _options, options);
|
48
|
+
this.options = options;
|
130
49
|
}
|
131
50
|
|
132
51
|
/**
|
133
|
-
* Selects cell relative to
|
52
|
+
* Selects cell relative to current cell (if possible).
|
134
53
|
*
|
135
54
|
* @param {number} rowDelta Rows number to move, value can be passed as negative number.
|
136
55
|
* @param {number} colDelta Columns number to move, value can be passed as negative number.
|
137
|
-
* @param {boolean} [
|
56
|
+
* @param {boolean} [force=false] If `true` the new rows/columns will be created if necessary. Otherwise, row/column will
|
138
57
|
* be created according to `minSpareRows/minSpareCols` settings of Handsontable.
|
139
58
|
* @returns {CellCoords} Visual coordinates after transformation.
|
140
59
|
*/
|
141
60
|
_createClass(Transformation, [{
|
142
61
|
key: "transformStart",
|
143
62
|
value: function transformStart(rowDelta, colDelta) {
|
144
|
-
var
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
var visualCoords =
|
151
|
-
var highlightRenderableCoords = _classPrivateFieldGet(this, _options).visualToRenderableCoords(visualCoords);
|
63
|
+
var force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
64
|
+
var delta = this.options.createCellCoords(rowDelta, colDelta);
|
65
|
+
var highlightCoords = this.range.current().highlight;
|
66
|
+
var _this$options$visualT = this.options.visualToRenderableCoords(highlightCoords),
|
67
|
+
renderableRow = _this$options$visualT.row,
|
68
|
+
renderableColumn = _this$options$visualT.col;
|
69
|
+
var visualCoords = highlightCoords;
|
152
70
|
var rowTransformDir = 0;
|
153
71
|
var colTransformDir = 0;
|
154
72
|
this.runLocalHooks('beforeTransformStart', delta);
|
155
|
-
if (
|
156
|
-
var
|
157
|
-
|
158
|
-
|
159
|
-
var
|
160
|
-
|
161
|
-
|
162
|
-
var
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
var rawCoords = {
|
168
|
-
row: y + delta.row,
|
169
|
-
col: x + delta.col
|
170
|
-
};
|
171
|
-
if (rawCoords.row >= height) {
|
172
|
-
if (createMissingRecords && minSpareRows > 0 && fixedRowsBottom === 0) {
|
173
|
-
this.runLocalHooks('insertRowRequire', _classPrivateFieldGet(this, _options).countRenderableRows());
|
73
|
+
if (renderableRow !== null && renderableColumn !== null) {
|
74
|
+
var totalRows = this.options.countRows();
|
75
|
+
var totalCols = this.options.countCols();
|
76
|
+
var fixedRowsBottom = this.options.fixedRowsBottom();
|
77
|
+
var minSpareRows = this.options.minSpareRows();
|
78
|
+
var minSpareCols = this.options.minSpareCols();
|
79
|
+
var autoWrapRow = this.options.autoWrapRow();
|
80
|
+
var autoWrapCol = this.options.autoWrapCol();
|
81
|
+
if (renderableRow + rowDelta > totalRows - 1) {
|
82
|
+
if (force && minSpareRows > 0 && !(fixedRowsBottom && renderableRow >= totalRows - fixedRowsBottom - 1)) {
|
83
|
+
this.runLocalHooks('insertRowRequire', totalRows);
|
84
|
+
totalRows = this.options.countRows();
|
174
85
|
} else if (autoWrapCol) {
|
175
|
-
|
176
|
-
|
177
|
-
rawCoords.col = nextColumn >= width ? nextColumn - width : nextColumn;
|
178
|
-
}
|
179
|
-
} else if (rawCoords.row < 0) {
|
180
|
-
if (autoWrapCol) {
|
181
|
-
var previousColumn = rawCoords.col - 1;
|
182
|
-
rawCoords.row = height + rawCoords.row;
|
183
|
-
rawCoords.col = previousColumn < 0 ? width + previousColumn : previousColumn;
|
86
|
+
delta.row = 1 - totalRows;
|
87
|
+
delta.col = renderableColumn + delta.col === totalCols - 1 ? 1 - totalCols : 1;
|
184
88
|
}
|
89
|
+
} else if (autoWrapCol && renderableRow + delta.row < 0 && renderableColumn + delta.col >= 0) {
|
90
|
+
delta.row = totalRows - 1;
|
91
|
+
delta.col = renderableColumn + delta.col === 0 ? totalCols - 1 : -1;
|
185
92
|
}
|
186
|
-
if (
|
187
|
-
if (
|
188
|
-
this.runLocalHooks('insertColRequire',
|
93
|
+
if (renderableColumn + delta.col > totalCols - 1) {
|
94
|
+
if (force && minSpareCols > 0) {
|
95
|
+
this.runLocalHooks('insertColRequire', totalCols);
|
96
|
+
totalCols = this.options.countCols();
|
189
97
|
} else if (autoWrapRow) {
|
190
|
-
|
191
|
-
|
192
|
-
rawCoords.col = rawCoords.col - width;
|
193
|
-
}
|
194
|
-
} else if (rawCoords.col < 0) {
|
195
|
-
if (autoWrapRow) {
|
196
|
-
var previousRow = rawCoords.row - 1;
|
197
|
-
rawCoords.row = previousRow < 0 ? height + previousRow : previousRow;
|
198
|
-
rawCoords.col = width + rawCoords.col;
|
98
|
+
delta.row = renderableRow + delta.row === totalRows - 1 ? 1 - totalRows : 1;
|
99
|
+
delta.col = 1 - totalCols;
|
199
100
|
}
|
101
|
+
} else if (autoWrapRow && renderableColumn + delta.col < 0 && renderableRow + delta.row >= 0) {
|
102
|
+
delta.row = renderableRow + delta.row === 0 ? totalRows - 1 : -1;
|
103
|
+
delta.col = totalCols - 1;
|
104
|
+
}
|
105
|
+
var coords = this.options.createCellCoords(renderableRow + delta.row, renderableColumn + delta.col);
|
106
|
+
rowTransformDir = 0;
|
107
|
+
colTransformDir = 0;
|
108
|
+
if (coords.row < 0) {
|
109
|
+
rowTransformDir = -1;
|
110
|
+
coords.row = 0;
|
111
|
+
} else if (coords.row > 0 && coords.row >= totalRows) {
|
112
|
+
rowTransformDir = 1;
|
113
|
+
coords.row = totalRows - 1;
|
200
114
|
}
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
115
|
+
if (coords.col < 0) {
|
116
|
+
colTransformDir = -1;
|
117
|
+
coords.col = 0;
|
118
|
+
} else if (coords.col > 0 && coords.col >= totalCols) {
|
119
|
+
colTransformDir = 1;
|
120
|
+
coords.col = totalCols - 1;
|
121
|
+
}
|
122
|
+
visualCoords = this.options.renderableToVisualCoords(coords);
|
208
123
|
}
|
209
124
|
this.runLocalHooks('afterTransformStart', visualCoords, rowTransformDir, colTransformDir);
|
210
125
|
return visualCoords;
|
211
126
|
}
|
212
127
|
|
213
128
|
/**
|
214
|
-
* Sets selection end cell relative to
|
129
|
+
* Sets selection end cell relative to current selection end cell (if possible).
|
215
130
|
*
|
216
131
|
* @param {number} rowDelta Rows number to move, value can be passed as negative number.
|
217
132
|
* @param {number} colDelta Columns number to move, value can be passed as negative number.
|
@@ -220,40 +135,41 @@ var Transformation = /*#__PURE__*/function () {
|
|
220
135
|
}, {
|
221
136
|
key: "transformEnd",
|
222
137
|
value: function transformEnd(rowDelta, colDelta) {
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
});
|
227
|
-
var delta = _classPrivateFieldGet(this, _options).createCellCoords(rowDelta, colDelta);
|
228
|
-
var cellRange = _classPrivateFieldGet(this, _range).current();
|
229
|
-
var highlightRenderableCoords = _classPrivateFieldGet(this, _options).visualToRenderableCoords(cellRange.highlight);
|
230
|
-
var visualCoords = cellRange.to.clone();
|
138
|
+
var delta = this.options.createCellCoords(rowDelta, colDelta);
|
139
|
+
var cellRange = this.range.current();
|
140
|
+
var visualCoords = cellRange.to;
|
231
141
|
var rowTransformDir = 0;
|
232
142
|
var colTransformDir = 0;
|
233
143
|
this.runLocalHooks('beforeTransformEnd', delta);
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
var
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
rowTransformDir =
|
247
|
-
colTransformDir =
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
} else if (
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
144
|
+
var _this$options$visualT2 = this.options.visualToRenderableCoords(cellRange.highlight),
|
145
|
+
rowHighlight = _this$options$visualT2.row,
|
146
|
+
colHighlight = _this$options$visualT2.col;
|
147
|
+
|
148
|
+
// We have highlight (start point for the selection).
|
149
|
+
if (rowHighlight !== null && colHighlight !== null) {
|
150
|
+
var totalRows = this.options.countRows();
|
151
|
+
var totalCols = this.options.countCols();
|
152
|
+
var _this$options$visualT3 = this.options.visualToRenderableCoords(cellRange.to),
|
153
|
+
rowTo = _this$options$visualT3.row,
|
154
|
+
colTo = _this$options$visualT3.col;
|
155
|
+
var coords = this.options.createCellCoords(rowTo + delta.row, colTo + delta.col);
|
156
|
+
rowTransformDir = 0;
|
157
|
+
colTransformDir = 0;
|
158
|
+
if (coords.row < 0) {
|
159
|
+
rowTransformDir = -1;
|
160
|
+
coords.row = 0;
|
161
|
+
} else if (coords.row > 0 && coords.row >= totalRows) {
|
162
|
+
rowTransformDir = 1;
|
163
|
+
coords.row = totalRows - 1;
|
164
|
+
}
|
165
|
+
if (coords.col < 0) {
|
166
|
+
colTransformDir = -1;
|
167
|
+
coords.col = 0;
|
168
|
+
} else if (coords.col > 0 && coords.col >= totalCols) {
|
169
|
+
colTransformDir = 1;
|
170
|
+
coords.col = totalCols - 1;
|
256
171
|
}
|
172
|
+
visualCoords = this.options.renderableToVisualCoords(coords);
|
257
173
|
}
|
258
174
|
this.runLocalHooks('afterTransformEnd', visualCoords, rowTransformDir, colTransformDir);
|
259
175
|
return visualCoords;
|
@@ -261,59 +177,6 @@ var Transformation = /*#__PURE__*/function () {
|
|
261
177
|
}]);
|
262
178
|
return Transformation;
|
263
179
|
}();
|
264
|
-
function _setOffsetSize2(_ref) {
|
265
|
-
var x = _ref.x,
|
266
|
-
y = _ref.y;
|
267
|
-
_classPrivateFieldSet(this, _offset, {
|
268
|
-
x: x,
|
269
|
-
y: y
|
270
|
-
});
|
271
|
-
}
|
272
|
-
function _clampCoords2(zeroBasedCoords) {
|
273
|
-
var _classPrivateMethodGe6 = _classPrivateMethodGet(this, _getTableSize, _getTableSize2).call(this),
|
274
|
-
width = _classPrivateMethodGe6.width,
|
275
|
-
height = _classPrivateMethodGe6.height;
|
276
|
-
var rowDir = 0;
|
277
|
-
var colDir = 0;
|
278
|
-
if (zeroBasedCoords.row < 0) {
|
279
|
-
rowDir = -1;
|
280
|
-
zeroBasedCoords.row = 0;
|
281
|
-
} else if (zeroBasedCoords.row > 0 && zeroBasedCoords.row >= height) {
|
282
|
-
rowDir = 1;
|
283
|
-
zeroBasedCoords.row = height - 1;
|
284
|
-
}
|
285
|
-
if (zeroBasedCoords.col < 0) {
|
286
|
-
colDir = -1;
|
287
|
-
zeroBasedCoords.col = 0;
|
288
|
-
} else if (zeroBasedCoords.col > 0 && zeroBasedCoords.col >= width) {
|
289
|
-
colDir = 1;
|
290
|
-
zeroBasedCoords.col = width - 1;
|
291
|
-
}
|
292
|
-
return {
|
293
|
-
rowDir: rowDir,
|
294
|
-
colDir: colDir
|
295
|
-
};
|
296
|
-
}
|
297
|
-
function _getTableSize2() {
|
298
|
-
return {
|
299
|
-
width: _classPrivateFieldGet(this, _offset).x + _classPrivateFieldGet(this, _options).countRenderableColumns(),
|
300
|
-
height: _classPrivateFieldGet(this, _offset).y + _classPrivateFieldGet(this, _options).countRenderableRows()
|
301
|
-
};
|
302
|
-
}
|
303
|
-
function _visualToZeroBasedCoords2(visualCoords) {
|
304
|
-
var _classPrivateFieldGet2 = _classPrivateFieldGet(this, _options).visualToRenderableCoords(visualCoords),
|
305
|
-
row = _classPrivateFieldGet2.row,
|
306
|
-
col = _classPrivateFieldGet2.col;
|
307
|
-
return {
|
308
|
-
x: _classPrivateFieldGet(this, _offset).x + (col !== null && col !== void 0 ? col : visualCoords.col),
|
309
|
-
y: _classPrivateFieldGet(this, _offset).y + (row !== null && row !== void 0 ? row : visualCoords.row)
|
310
|
-
};
|
311
|
-
}
|
312
|
-
function _zeroBasedToVisualCoords2(zeroBasedCoords) {
|
313
|
-
zeroBasedCoords.col = zeroBasedCoords.col - _classPrivateFieldGet(this, _offset).x;
|
314
|
-
zeroBasedCoords.row = zeroBasedCoords.row - _classPrivateFieldGet(this, _offset).y;
|
315
|
-
return _classPrivateFieldGet(this, _options).renderableToVisualCoords(zeroBasedCoords);
|
316
|
-
}
|
317
180
|
(0, _object.mixin)(Transformation, _localHooks.default);
|
318
181
|
var _default = Transformation;
|
319
182
|
exports.default = _default;
|