handsontable 0.0.0-next-2becb78-20240313 → 0.0.0-next-bff5041-20240315
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +12 -17
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +12 -17
- package/3rdparty/walkontable/src/calculator/viewportRows.js +10 -15
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +10 -15
- package/3rdparty/walkontable/src/cell/coords.js +12 -17
- package/3rdparty/walkontable/src/cell/coords.mjs +12 -17
- package/3rdparty/walkontable/src/cell/range.d.ts +0 -1
- package/3rdparty/walkontable/src/cell/range.js +23 -45
- package/3rdparty/walkontable/src/cell/range.mjs +23 -45
- package/3rdparty/walkontable/src/core/_base.js +1 -1
- package/3rdparty/walkontable/src/core/_base.mjs +1 -1
- package/3rdparty/walkontable/src/event.js +72 -104
- package/3rdparty/walkontable/src/event.mjs +72 -104
- package/3rdparty/walkontable/src/overlays.js +1 -1
- package/3rdparty/walkontable/src/overlays.mjs +1 -1
- package/3rdparty/walkontable/src/scroll.js +15 -17
- package/3rdparty/walkontable/src/scroll.mjs +15 -17
- package/3rdparty/walkontable/src/selection/manager.js +48 -69
- package/3rdparty/walkontable/src/selection/manager.mjs +48 -69
- package/3rdparty/walkontable/src/selection/scanner.js +33 -42
- package/3rdparty/walkontable/src/selection/scanner.mjs +33 -42
- package/3rdparty/walkontable/src/utils/columnStretching.js +27 -44
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +27 -44
- package/3rdparty/walkontable/src/utils/orderView/view.js +1 -1
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +1 -1
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/viewportScroll/index.js +1 -4
- package/core/viewportScroll/index.mjs +1 -4
- package/core.d.ts +3 -4
- package/core.js +22 -82
- package/core.mjs +22 -82
- package/dataMap/dataSource.js +1 -1
- package/dataMap/dataSource.mjs +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +1 -1
- package/dataMap/replaceData.js +1 -1
- package/dataMap/replaceData.mjs +1 -1
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +7619 -10404
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +277 -277
- package/dist/handsontable.js +5525 -7857
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +33 -33
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +21 -27
- package/editorManager.mjs +21 -27
- package/editors/autocompleteEditor/autocompleteEditor.js +6 -10
- package/editors/autocompleteEditor/autocompleteEditor.mjs +6 -10
- package/eventManager.js +1 -1
- package/eventManager.mjs +1 -1
- package/focusManager.js +58 -82
- package/focusManager.mjs +58 -82
- package/helpers/dom/element.js +1 -1
- package/helpers/dom/element.mjs +1 -1
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/object.js +2 -2
- package/helpers/object.mjs +2 -2
- package/index.d.ts +10 -0
- package/package.json +2 -1
- package/pluginHooks.d.ts +0 -4
- package/pluginHooks.js +2 -44
- package/pluginHooks.mjs +2 -44
- package/plugins/autoColumnSize/autoColumnSize.js +49 -65
- package/plugins/autoColumnSize/autoColumnSize.mjs +49 -65
- package/plugins/autoRowSize/autoRowSize.js +28 -34
- package/plugins/autoRowSize/autoRowSize.mjs +28 -34
- package/plugins/autofill/autofill.js +30 -38
- package/plugins/autofill/autofill.mjs +30 -38
- package/plugins/base/base.js +12 -17
- package/plugins/base/base.mjs +12 -17
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
- package/plugins/collapsibleColumns/collapsibleColumns.js +36 -54
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +36 -54
- package/plugins/columnSorting/columnSorting.js +40 -46
- package/plugins/columnSorting/columnSorting.mjs +40 -46
- package/plugins/columnSummary/columnSummary.js +22 -26
- package/plugins/columnSummary/columnSummary.mjs +22 -26
- package/plugins/comments/comments.js +116 -158
- package/plugins/comments/comments.mjs +116 -158
- package/plugins/contextMenu/contextMenu.js +20 -26
- package/plugins/contextMenu/contextMenu.mjs +20 -26
- package/plugins/contextMenu/itemsFactory.js +1 -1
- package/plugins/contextMenu/itemsFactory.mjs +1 -1
- package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
- package/plugins/contextMenu/menu/menu.js +13 -21
- package/plugins/contextMenu/menu/menu.mjs +13 -21
- package/plugins/contextMenu/menu/positioner.js +41 -58
- package/plugins/contextMenu/menu/positioner.mjs +41 -58
- package/plugins/copyPaste/copyPaste.js +113 -154
- package/plugins/copyPaste/copyPaste.mjs +113 -154
- package/plugins/copyPaste/copyableRanges.js +43 -66
- package/plugins/copyPaste/copyableRanges.mjs +43 -66
- package/plugins/customBorders/customBorders.js +11 -13
- package/plugins/customBorders/customBorders.mjs +11 -13
- package/plugins/dragToScroll/dragToScroll.js +6 -6
- package/plugins/dragToScroll/dragToScroll.mjs +6 -6
- package/plugins/dropdownMenu/dropdownMenu.js +78 -100
- package/plugins/dropdownMenu/dropdownMenu.mjs +78 -100
- package/plugins/exportFile/dataProvider.js +1 -1
- package/plugins/exportFile/dataProvider.mjs +1 -1
- package/plugins/filters/component/actionBar.js +9 -9
- package/plugins/filters/component/actionBar.mjs +8 -8
- package/plugins/filters/component/condition.js +13 -15
- package/plugins/filters/component/condition.mjs +13 -15
- package/plugins/filters/component/operators.js +6 -6
- package/plugins/filters/component/operators.mjs +6 -6
- package/plugins/filters/component/value.js +24 -28
- package/plugins/filters/component/value.mjs +24 -28
- package/plugins/filters/conditionUpdateObserver.js +22 -24
- package/plugins/filters/conditionUpdateObserver.mjs +22 -24
- package/plugins/filters/dataFilter.js +1 -1
- package/plugins/filters/dataFilter.mjs +1 -1
- package/plugins/filters/filters.js +81 -95
- package/plugins/filters/filters.mjs +81 -95
- package/plugins/filters/ui/input.js +13 -19
- package/plugins/filters/ui/input.mjs +13 -19
- package/plugins/filters/ui/link.js +8 -13
- package/plugins/filters/ui/link.mjs +8 -13
- package/plugins/filters/ui/multipleSelect.js +85 -112
- package/plugins/filters/ui/multipleSelect.mjs +85 -112
- package/plugins/filters/ui/radioInput.js +12 -20
- package/plugins/filters/ui/radioInput.mjs +12 -20
- package/plugins/filters/ui/select.js +50 -72
- package/plugins/filters/ui/select.mjs +49 -71
- package/plugins/formulas/formulas.js +268 -326
- package/plugins/formulas/formulas.mjs +269 -327
- package/plugins/formulas/indexSyncer/axisSyncer.js +38 -61
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +38 -61
- package/plugins/formulas/indexSyncer/index.js +25 -48
- package/plugins/formulas/indexSyncer/index.mjs +25 -48
- package/plugins/hiddenColumns/hiddenColumns.js +64 -83
- package/plugins/hiddenColumns/hiddenColumns.mjs +64 -83
- package/plugins/hiddenRows/hiddenRows.js +63 -82
- package/plugins/hiddenRows/hiddenRows.mjs +63 -82
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +24 -32
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +25 -33
- package/plugins/manualColumnMove/manualColumnMove.js +126 -170
- package/plugins/manualColumnMove/manualColumnMove.mjs +126 -170
- package/plugins/manualColumnResize/manualColumnResize.js +169 -230
- package/plugins/manualColumnResize/manualColumnResize.mjs +169 -230
- package/plugins/manualRowMove/manualRowMove.js +99 -128
- package/plugins/manualRowMove/manualRowMove.mjs +99 -128
- package/plugins/manualRowResize/manualRowResize.js +150 -209
- package/plugins/manualRowResize/manualRowResize.mjs +150 -209
- package/plugins/mergeCells/calculations/selection.js +71 -2
- package/plugins/mergeCells/calculations/selection.mjs +71 -2
- package/plugins/mergeCells/cellsCollection.js +1 -117
- package/plugins/mergeCells/cellsCollection.mjs +1 -117
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
- package/plugins/mergeCells/mergeCells.js +353 -593
- package/plugins/mergeCells/mergeCells.mjs +353 -593
- package/plugins/multiColumnSorting/multiColumnSorting.js +0 -6
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +0 -6
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
- package/plugins/nestedHeaders/nestedHeaders.js +204 -254
- package/plugins/nestedHeaders/nestedHeaders.mjs +205 -255
- package/plugins/nestedHeaders/stateManager/headersTree.js +21 -32
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +21 -32
- package/plugins/nestedHeaders/stateManager/index.js +30 -41
- package/plugins/nestedHeaders/stateManager/index.mjs +30 -41
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +19 -30
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +19 -30
- package/plugins/nestedRows/data/dataManager.js +1 -1
- package/plugins/nestedRows/data/dataManager.mjs +1 -1
- package/plugins/nestedRows/nestedRows.js +138 -179
- package/plugins/nestedRows/nestedRows.mjs +139 -180
- package/plugins/nestedRows/ui/contextMenu.js +11 -15
- package/plugins/nestedRows/ui/contextMenu.mjs +10 -14
- package/plugins/nestedRows/utils/rowMoveController.js +1 -1
- package/plugins/nestedRows/utils/rowMoveController.mjs +1 -1
- package/plugins/persistentState/storage.js +2 -2
- package/plugins/persistentState/storage.mjs +2 -2
- package/plugins/search/search.js +7 -7
- package/plugins/search/search.mjs +7 -7
- package/plugins/touchScroll/touchScroll.js +15 -19
- package/plugins/touchScroll/touchScroll.mjs +16 -20
- package/plugins/trimRows/trimRows.js +6 -6
- package/plugins/trimRows/trimRows.mjs +6 -6
- package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
- package/selection/highlight/highlight.js +14 -14
- package/selection/highlight/highlight.mjs +13 -13
- package/selection/highlight/visualSelection.js +2 -16
- package/selection/highlight/visualSelection.mjs +2 -16
- package/selection/selection.js +60 -255
- package/selection/selection.mjs +59 -254
- package/selection/transformation.js +101 -175
- package/selection/transformation.mjs +101 -175
- package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
- package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
- package/shortcutContexts/commands/editor/open.js +3 -18
- package/shortcutContexts/commands/editor/open.mjs +3 -18
- package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
- package/shortcutContexts/grid.js +2 -2
- package/shortcutContexts/grid.mjs +2 -2
- package/shortcuts/context.js +1 -2
- package/shortcuts/context.mjs +1 -2
- package/tableView.js +52 -98
- package/tableView.mjs +52 -98
- package/translations/changesObservable/observable.js +21 -38
- package/translations/changesObservable/observable.mjs +21 -38
- package/translations/changesObservable/observer.js +7 -12
- package/translations/changesObservable/observer.mjs +6 -11
- package/translations/mapCollections/aggregatedCollection.js +1 -1
- package/translations/mapCollections/aggregatedCollection.mjs +1 -1
- package/translations/maps/indexMap.js +1 -1
- package/translations/maps/indexMap.mjs +1 -1
- package/utils/dataStructures/linkedList.js +1 -6
- package/utils/dataStructures/linkedList.mjs +1 -6
- package/utils/dataStructures/tree.js +1 -1
- package/utils/dataStructures/tree.mjs +1 -1
- package/utils/interval.js +26 -44
- package/utils/interval.mjs +26 -44
- package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
- package/plugins/mergeCells/focusOrder.js +0 -327
- package/plugins/mergeCells/focusOrder.mjs +0 -322
package/selection/selection.js
CHANGED
@@ -9,7 +9,7 @@ var _mixed = require("./../helpers/mixed");
|
|
9
9
|
var _number = require("./../helpers/number");
|
10
10
|
var _array = require("./../helpers/array");
|
11
11
|
var _localHooks = _interopRequireDefault(require("./../mixins/localHooks"));
|
12
|
-
var
|
12
|
+
var _transformation = _interopRequireDefault(require("./transformation"));
|
13
13
|
var _utils = require("./utils");
|
14
14
|
var _templateLiteralTag = require("./../helpers/templateLiteralTag");
|
15
15
|
var _a11y = require("../helpers/a11y");
|
@@ -21,18 +21,13 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
21
21
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
22
22
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
23
23
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
24
|
-
function _classPrivateFieldGet(
|
25
|
-
function
|
26
|
-
function
|
27
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
28
|
-
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; } }
|
24
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
25
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
26
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
29
27
|
/**
|
30
28
|
* @class Selection
|
31
29
|
* @util
|
32
30
|
*/
|
33
|
-
var _transformation = /*#__PURE__*/new WeakMap();
|
34
|
-
var _focusTransformation = /*#__PURE__*/new WeakMap();
|
35
|
-
var _isFocusSelectionChanged = /*#__PURE__*/new WeakMap();
|
36
31
|
var _disableHeadersHighlight = /*#__PURE__*/new WeakMap();
|
37
32
|
var _selectionSource = /*#__PURE__*/new WeakMap();
|
38
33
|
var _expectedLayersCount = /*#__PURE__*/new WeakMap();
|
@@ -72,23 +67,11 @@ class Selection {
|
|
72
67
|
*/
|
73
68
|
_defineProperty(this, "highlight", void 0);
|
74
69
|
/**
|
75
|
-
* The module for modifying coordinates
|
70
|
+
* The module for modifying coordinates.
|
76
71
|
*
|
77
72
|
* @type {Transformation}
|
78
73
|
*/
|
79
|
-
|
80
|
-
writable: true,
|
81
|
-
value: void 0
|
82
|
-
});
|
83
|
-
/**
|
84
|
-
* The module for modifying coordinates of the focus selection.
|
85
|
-
*
|
86
|
-
* @type {Transformation}
|
87
|
-
*/
|
88
|
-
_classPrivateFieldInitSpec(this, _focusTransformation, {
|
89
|
-
writable: true,
|
90
|
-
value: void 0
|
91
|
-
});
|
74
|
+
_defineProperty(this, "transformation", void 0);
|
92
75
|
/**
|
93
76
|
* The collection of the selection layer levels where the whole row was selected using the row header or
|
94
77
|
* the corner header.
|
@@ -103,43 +86,25 @@ class Selection {
|
|
103
86
|
* @type {Set<number>}
|
104
87
|
*/
|
105
88
|
_defineProperty(this, "selectedByColumnHeader", new Set());
|
106
|
-
/**
|
107
|
-
* The flag which determines if the focus selection was changed.
|
108
|
-
*
|
109
|
-
* @type {boolean}
|
110
|
-
*/
|
111
|
-
_classPrivateFieldInitSpec(this, _isFocusSelectionChanged, {
|
112
|
-
writable: true,
|
113
|
-
value: false
|
114
|
-
});
|
115
89
|
/**
|
116
90
|
* When sets disable highlighting the headers even when the logical coordinates points on them.
|
117
91
|
*
|
118
92
|
* @type {boolean}
|
119
93
|
*/
|
120
|
-
_classPrivateFieldInitSpec(this, _disableHeadersHighlight,
|
121
|
-
writable: true,
|
122
|
-
value: false
|
123
|
-
});
|
94
|
+
_classPrivateFieldInitSpec(this, _disableHeadersHighlight, false);
|
124
95
|
/**
|
125
96
|
* The source of the selection. It can be one of the following values: `mouse`, `unknown` or any other string.
|
126
97
|
*
|
127
98
|
* @type {'mouse' | 'unknown' | string}
|
128
99
|
*/
|
129
|
-
_classPrivateFieldInitSpec(this, _selectionSource,
|
130
|
-
writable: true,
|
131
|
-
value: 'unknown'
|
132
|
-
});
|
100
|
+
_classPrivateFieldInitSpec(this, _selectionSource, 'unknown');
|
133
101
|
/**
|
134
102
|
* The number of expected layers. It is used mostly to track when the last selection layer of non-contiguous
|
135
103
|
* selection is applied, thus the viewport scroll is triggered.
|
136
104
|
*
|
137
105
|
* @param {number}
|
138
106
|
*/
|
139
|
-
_classPrivateFieldInitSpec(this, _expectedLayersCount,
|
140
|
-
writable: true,
|
141
|
-
value: -1
|
142
|
-
});
|
107
|
+
_classPrivateFieldInitSpec(this, _expectedLayersCount, -1);
|
143
108
|
this.settings = settings;
|
144
109
|
this.tableProps = tableProps;
|
145
110
|
this.highlight = new _highlight.default({
|
@@ -162,118 +127,71 @@ class Selection {
|
|
162
127
|
createCellCoords: (row, column) => this.tableProps.createCellCoords(row, column),
|
163
128
|
createCellRange: (highlight, from, to) => this.tableProps.createCellRange(highlight, from, to)
|
164
129
|
});
|
165
|
-
|
130
|
+
this.transformation = new _transformation.default(this.selectedRange, {
|
166
131
|
rowIndexMapper: this.tableProps.rowIndexMapper,
|
167
132
|
columnIndexMapper: this.tableProps.columnIndexMapper,
|
168
133
|
countRenderableRows: () => this.tableProps.countRenderableRows(),
|
169
134
|
countRenderableColumns: () => this.tableProps.countRenderableColumns(),
|
135
|
+
countRowHeaders: () => this.tableProps.countRowHeaders(),
|
136
|
+
countColHeaders: () => this.tableProps.countColHeaders(),
|
170
137
|
visualToRenderableCoords: coords => this.tableProps.visualToRenderableCoords(coords),
|
171
138
|
renderableToVisualCoords: coords => this.tableProps.renderableToVisualCoords(coords),
|
172
|
-
findFirstNonHiddenRenderableRow: function () {
|
173
|
-
return _this.tableProps.findFirstNonHiddenRenderableRow(...arguments);
|
174
|
-
},
|
175
|
-
findFirstNonHiddenRenderableColumn: function () {
|
176
|
-
return _this.tableProps.findFirstNonHiddenRenderableColumn(...arguments);
|
177
|
-
},
|
178
139
|
createCellCoords: (row, column) => this.tableProps.createCellCoords(row, column),
|
140
|
+
navigableHeaders: () => settings.navigableHeaders,
|
179
141
|
fixedRowsBottom: () => settings.fixedRowsBottom,
|
180
142
|
minSpareRows: () => settings.minSpareRows,
|
181
143
|
minSpareCols: () => settings.minSpareCols,
|
182
144
|
autoWrapRow: () => settings.autoWrapRow,
|
183
145
|
autoWrapCol: () => settings.autoWrapCol
|
184
|
-
})
|
185
|
-
|
186
|
-
rowIndexMapper: this.tableProps.rowIndexMapper,
|
187
|
-
columnIndexMapper: this.tableProps.columnIndexMapper,
|
188
|
-
countRenderableRows: () => {
|
189
|
-
const range = this.selectedRange.current();
|
190
|
-
return this.tableProps.countRenderableRowsInRange(0, range.getOuterBottomEndCorner().row);
|
191
|
-
},
|
192
|
-
countRenderableColumns: () => {
|
193
|
-
const range = this.selectedRange.current();
|
194
|
-
return this.tableProps.countRenderableColumnsInRange(0, range.getOuterBottomEndCorner().col);
|
195
|
-
},
|
196
|
-
visualToRenderableCoords: coords => this.tableProps.visualToRenderableCoords(coords),
|
197
|
-
renderableToVisualCoords: coords => this.tableProps.renderableToVisualCoords(coords),
|
198
|
-
findFirstNonHiddenRenderableRow: function () {
|
199
|
-
return _this.tableProps.findFirstNonHiddenRenderableRow(...arguments);
|
200
|
-
},
|
201
|
-
findFirstNonHiddenRenderableColumn: function () {
|
202
|
-
return _this.tableProps.findFirstNonHiddenRenderableColumn(...arguments);
|
203
|
-
},
|
204
|
-
createCellCoords: (row, column) => this.tableProps.createCellCoords(row, column),
|
205
|
-
fixedRowsBottom: () => 0,
|
206
|
-
minSpareRows: () => 0,
|
207
|
-
minSpareCols: () => 0,
|
208
|
-
autoWrapRow: () => true,
|
209
|
-
autoWrapCol: () => true
|
210
|
-
}));
|
211
|
-
_classPrivateFieldGet(this, _transformation).addLocalHook('beforeTransformStart', function () {
|
146
|
+
});
|
147
|
+
this.transformation.addLocalHook('beforeTransformStart', function () {
|
212
148
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
213
149
|
args[_key] = arguments[_key];
|
214
150
|
}
|
215
151
|
return _this.runLocalHooks('beforeModifyTransformStart', ...args);
|
216
152
|
});
|
217
|
-
|
153
|
+
this.transformation.addLocalHook('afterTransformStart', function () {
|
218
154
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
219
155
|
args[_key2] = arguments[_key2];
|
220
156
|
}
|
221
157
|
return _this.runLocalHooks('afterModifyTransformStart', ...args);
|
222
158
|
});
|
223
|
-
|
159
|
+
this.transformation.addLocalHook('beforeTransformEnd', function () {
|
224
160
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
225
161
|
args[_key3] = arguments[_key3];
|
226
162
|
}
|
227
163
|
return _this.runLocalHooks('beforeModifyTransformEnd', ...args);
|
228
164
|
});
|
229
|
-
|
165
|
+
this.transformation.addLocalHook('afterTransformEnd', function () {
|
230
166
|
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
231
167
|
args[_key4] = arguments[_key4];
|
232
168
|
}
|
233
|
-
return _this.runLocalHooks('
|
169
|
+
return _this.runLocalHooks('afterModifyTransformEnd', ...args);
|
234
170
|
});
|
235
|
-
|
171
|
+
this.transformation.addLocalHook('insertRowRequire', function () {
|
236
172
|
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
237
173
|
args[_key5] = arguments[_key5];
|
238
174
|
}
|
239
|
-
return _this.runLocalHooks('
|
175
|
+
return _this.runLocalHooks('insertRowRequire', ...args);
|
240
176
|
});
|
241
|
-
|
177
|
+
this.transformation.addLocalHook('insertColRequire', function () {
|
242
178
|
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
243
179
|
args[_key6] = arguments[_key6];
|
244
180
|
}
|
245
|
-
return _this.runLocalHooks('
|
181
|
+
return _this.runLocalHooks('insertColRequire', ...args);
|
246
182
|
});
|
247
|
-
|
183
|
+
this.transformation.addLocalHook('beforeRowWrap', function () {
|
248
184
|
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
249
185
|
args[_key7] = arguments[_key7];
|
250
186
|
}
|
251
|
-
return _this.runLocalHooks('
|
187
|
+
return _this.runLocalHooks('beforeRowWrap', ...args);
|
252
188
|
});
|
253
|
-
|
189
|
+
this.transformation.addLocalHook('beforeColumnWrap', function () {
|
254
190
|
for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
|
255
191
|
args[_key8] = arguments[_key8];
|
256
192
|
}
|
257
|
-
return _this.runLocalHooks('beforeRowWrap', ...args);
|
258
|
-
});
|
259
|
-
_classPrivateFieldGet(this, _transformation).addLocalHook('beforeColumnWrap', function () {
|
260
|
-
for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
|
261
|
-
args[_key9] = arguments[_key9];
|
262
|
-
}
|
263
193
|
return _this.runLocalHooks('beforeColumnWrap', ...args);
|
264
194
|
});
|
265
|
-
_classPrivateFieldGet(this, _focusTransformation).addLocalHook('beforeTransformStart', function () {
|
266
|
-
for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
|
267
|
-
args[_key10] = arguments[_key10];
|
268
|
-
}
|
269
|
-
return _this.runLocalHooks('beforeModifyTransformFocus', ...args);
|
270
|
-
});
|
271
|
-
_classPrivateFieldGet(this, _focusTransformation).addLocalHook('afterTransformStart', function () {
|
272
|
-
for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
|
273
|
-
args[_key11] = arguments[_key11];
|
274
|
-
}
|
275
|
-
return _this.runLocalHooks('afterModifyTransformFocus', ...args);
|
276
|
-
});
|
277
195
|
}
|
278
196
|
|
279
197
|
/**
|
@@ -291,14 +209,14 @@ class Selection {
|
|
291
209
|
* @param {'mouse' | 'unknown' | string} sourceName The source name.
|
292
210
|
*/
|
293
211
|
markSource(sourceName) {
|
294
|
-
_classPrivateFieldSet(
|
212
|
+
_classPrivateFieldSet(_selectionSource, this, sourceName);
|
295
213
|
}
|
296
214
|
|
297
215
|
/**
|
298
216
|
* Marks end of the selection source. It restores the selection source to default value which is 'unknown'.
|
299
217
|
*/
|
300
218
|
markEndSource() {
|
301
|
-
_classPrivateFieldSet(
|
219
|
+
_classPrivateFieldSet(_selectionSource, this, 'unknown');
|
302
220
|
}
|
303
221
|
|
304
222
|
/**
|
@@ -307,7 +225,7 @@ class Selection {
|
|
307
225
|
* @returns {'mouse' | 'unknown' | string}
|
308
226
|
*/
|
309
227
|
getSelectionSource() {
|
310
|
-
return _classPrivateFieldGet(
|
228
|
+
return _classPrivateFieldGet(_selectionSource, this);
|
311
229
|
}
|
312
230
|
|
313
231
|
/**
|
@@ -317,7 +235,7 @@ class Selection {
|
|
317
235
|
* @param {number} layersCount The number of expected layers.
|
318
236
|
*/
|
319
237
|
setExpectedLayers(layersCount) {
|
320
|
-
_classPrivateFieldSet(
|
238
|
+
_classPrivateFieldSet(_expectedLayersCount, this, layersCount);
|
321
239
|
}
|
322
240
|
|
323
241
|
/**
|
@@ -333,7 +251,7 @@ class Selection {
|
|
333
251
|
finish() {
|
334
252
|
this.runLocalHooks('afterSelectionFinished', Array.from(this.selectedRange));
|
335
253
|
this.inProgress = false;
|
336
|
-
_classPrivateFieldSet(
|
254
|
+
_classPrivateFieldSet(_expectedLayersCount, this, -1);
|
337
255
|
}
|
338
256
|
|
339
257
|
/**
|
@@ -364,7 +282,6 @@ class Selection {
|
|
364
282
|
// We are creating copy. We would like to modify just the start of the selection by below hook. Then original coords
|
365
283
|
// should be handled by next methods.
|
366
284
|
const coordsClone = coords.clone();
|
367
|
-
_classPrivateFieldSet(this, _isFocusSelectionChanged, false);
|
368
285
|
this.runLocalHooks(`beforeSetRangeStart${fragment ? 'Only' : ''}`, coordsClone);
|
369
286
|
if (!isMultipleMode || isMultipleMode && !isMultipleSelection && (0, _mixed.isUndefined)(multipleSelection)) {
|
370
287
|
this.selectedRange.clear();
|
@@ -422,20 +339,7 @@ class Selection {
|
|
422
339
|
cellRange.setFrom(cellRange.highlight);
|
423
340
|
cellRange.setTo(cellRange.highlight);
|
424
341
|
} else {
|
425
|
-
const horizontalDir = cellRange.getHorizontalDirection();
|
426
|
-
const verticalDir = cellRange.getVerticalDirection();
|
427
|
-
const isMultiple = this.isMultiple();
|
428
342
|
cellRange.setTo(coordsClone);
|
429
|
-
if (isMultiple && horizontalDir !== cellRange.getHorizontalDirection()) {
|
430
|
-
cellRange.from.assign({
|
431
|
-
col: cellRange.highlight.col
|
432
|
-
});
|
433
|
-
}
|
434
|
-
if (isMultiple && verticalDir !== cellRange.getVerticalDirection()) {
|
435
|
-
cellRange.from.assign({
|
436
|
-
row: cellRange.highlight.row
|
437
|
-
});
|
438
|
-
}
|
439
343
|
}
|
440
344
|
|
441
345
|
// Prevent creating "area" selection that overlaps headers.
|
@@ -445,7 +349,11 @@ class Selection {
|
|
445
349
|
}
|
446
350
|
}
|
447
351
|
this.runLocalHooks('beforeHighlightSet');
|
448
|
-
this.
|
352
|
+
const focusHighlight = this.highlight.getFocus();
|
353
|
+
focusHighlight.clear();
|
354
|
+
if (this.highlight.isEnabledFor(_highlight.FOCUS_TYPE, cellRange.highlight)) {
|
355
|
+
focusHighlight.add(this.selectedRange.current().highlight).commit().syncWith(cellRange);
|
356
|
+
}
|
449
357
|
const layerLevel = this.getLayerLevel();
|
450
358
|
|
451
359
|
// If the next layer level is lower than previous then clear all area and header highlights. This is the
|
@@ -516,8 +424,8 @@ class Selection {
|
|
516
424
|
columnHighlight.add(columnCoordsFrom).add(columnCoordsTo).commit();
|
517
425
|
}
|
518
426
|
}
|
519
|
-
const highlightRowHeaders = !_classPrivateFieldGet(
|
520
|
-
const highlightColumnHeaders = !_classPrivateFieldGet(
|
427
|
+
const highlightRowHeaders = !_classPrivateFieldGet(_disableHeadersHighlight, this) && this.isEntireRowSelected() && (countCols > 0 && countCols === cellRange.getWidth() || countCols === 0 && this.isSelectedByRowHeader());
|
428
|
+
const highlightColumnHeaders = !_classPrivateFieldGet(_disableHeadersHighlight, this) && this.isEntireColumnSelected() && (countRows > 0 && countRows === cellRange.getHeight() || countRows === 0 && this.isSelectedByColumnHeader());
|
521
429
|
if (highlightRowHeaders) {
|
522
430
|
activeRowHeaderHighlight.add(this.tableProps.createCellCoords(Math.max(cellRange.from.row, 0), Math.min(-this.tableProps.countRowHeaders(), -1))).add(this.tableProps.createCellCoords(Math.max(cellRange.to.row, 0), -1)).commit();
|
523
431
|
}
|
@@ -528,36 +436,20 @@ class Selection {
|
|
528
436
|
activeCornerHeaderHighlight.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(), -this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1, -1)).commit();
|
529
437
|
}
|
530
438
|
}
|
531
|
-
const isLastLayer = _classPrivateFieldGet(
|
439
|
+
const isLastLayer = _classPrivateFieldGet(_expectedLayersCount, this) === -1 || this.selectedRange.size() === _classPrivateFieldGet(_expectedLayersCount, this);
|
532
440
|
this.runLocalHooks('afterSetRangeEnd', coords, isLastLayer);
|
533
441
|
}
|
534
442
|
|
535
443
|
/**
|
536
|
-
*
|
444
|
+
* Returns information if we have a multiselection. This method check multiselection only on the latest layer of
|
445
|
+
* the selection.
|
537
446
|
*
|
538
|
-
* @
|
447
|
+
* @returns {boolean}
|
539
448
|
*/
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
const cellRange = this.selectedRange.current();
|
545
|
-
if (!this.inProgress) {
|
546
|
-
this.runLocalHooks('beforeSetFocus', coords);
|
547
|
-
}
|
548
|
-
const focusHighlight = this.highlight.getFocus();
|
549
|
-
focusHighlight.clear();
|
550
|
-
cellRange.setHighlight(coords);
|
551
|
-
if (!this.inProgress) {
|
552
|
-
this.runLocalHooks('beforeHighlightSet');
|
553
|
-
}
|
554
|
-
if (this.highlight.isEnabledFor(_highlight.FOCUS_TYPE, cellRange.highlight)) {
|
555
|
-
focusHighlight.add(cellRange.highlight).commit().syncWith(cellRange);
|
556
|
-
}
|
557
|
-
if (!this.inProgress) {
|
558
|
-
_classPrivateFieldSet(this, _isFocusSelectionChanged, true);
|
559
|
-
this.runLocalHooks('afterSetFocus', cellRange.highlight);
|
560
|
-
}
|
449
|
+
isMultiple() {
|
450
|
+
const isMultipleListener = (0, _object.createObjectPropListener)(!this.selectedRange.current().isSingle());
|
451
|
+
this.runLocalHooks('afterIsMultipleSelection', isMultipleListener);
|
452
|
+
return isMultipleListener.value;
|
561
453
|
}
|
562
454
|
|
563
455
|
/**
|
@@ -570,13 +462,7 @@ class Selection {
|
|
570
462
|
*/
|
571
463
|
transformStart(rowDelta, colDelta) {
|
572
464
|
let createMissingRecords = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
573
|
-
|
574
|
-
_classPrivateFieldGet(this, _transformation).setOffsetSize({
|
575
|
-
x: this.tableProps.countRowHeaders(),
|
576
|
-
y: this.tableProps.countColHeaders()
|
577
|
-
});
|
578
|
-
}
|
579
|
-
this.setRangeStart(_classPrivateFieldGet(this, _transformation).transformStart(rowDelta, colDelta, createMissingRecords));
|
465
|
+
this.setRangeStart(this.transformation.transformStart(rowDelta, colDelta, createMissingRecords));
|
580
466
|
}
|
581
467
|
|
582
468
|
/**
|
@@ -586,44 +472,7 @@ class Selection {
|
|
586
472
|
* @param {number} colDelta Columns number to move, value can be passed as negative number.
|
587
473
|
*/
|
588
474
|
transformEnd(rowDelta, colDelta) {
|
589
|
-
|
590
|
-
_classPrivateFieldGet(this, _transformation).setOffsetSize({
|
591
|
-
x: this.tableProps.countRowHeaders(),
|
592
|
-
y: this.tableProps.countColHeaders()
|
593
|
-
});
|
594
|
-
}
|
595
|
-
this.setRangeEnd(_classPrivateFieldGet(this, _transformation).transformEnd(rowDelta, colDelta));
|
596
|
-
}
|
597
|
-
|
598
|
-
/**
|
599
|
-
* Transforms the focus cell selection relative to the current focus position.
|
600
|
-
*
|
601
|
-
* @param {number} rowDelta Rows number to move, value can be passed as negative number.
|
602
|
-
* @param {number} colDelta Columns number to move, value can be passed as negative number.
|
603
|
-
*/
|
604
|
-
transformFocus(rowDelta, colDelta) {
|
605
|
-
const range = this.selectedRange.current();
|
606
|
-
const {
|
607
|
-
row,
|
608
|
-
col
|
609
|
-
} = range.getOuterTopStartCorner();
|
610
|
-
const columnsInRange = this.tableProps.countRenderableColumnsInRange(0, col - 1);
|
611
|
-
const rowsInRange = this.tableProps.countRenderableRowsInRange(0, row - 1);
|
612
|
-
if (range.highlight.isHeader()) {
|
613
|
-
// for header focus selection calculate the new coords based on the selection including headers
|
614
|
-
_classPrivateFieldGet(this, _focusTransformation).setOffsetSize({
|
615
|
-
x: col < 0 ? Math.abs(col) : -columnsInRange,
|
616
|
-
y: row < 0 ? Math.abs(row) : -rowsInRange
|
617
|
-
});
|
618
|
-
} else {
|
619
|
-
// for focus selection in cells calculate the new coords only based on the selected cells
|
620
|
-
_classPrivateFieldGet(this, _focusTransformation).setOffsetSize({
|
621
|
-
x: col < 0 ? 0 : -columnsInRange,
|
622
|
-
y: row < 0 ? 0 : -rowsInRange
|
623
|
-
});
|
624
|
-
}
|
625
|
-
const focusCoords = _classPrivateFieldGet(this, _focusTransformation).transformStart(rowDelta, colDelta);
|
626
|
-
this.setRangeFocus(focusCoords.normalize());
|
475
|
+
this.setRangeEnd(this.transformation.transformEnd(rowDelta, colDelta));
|
627
476
|
}
|
628
477
|
|
629
478
|
/**
|
@@ -644,30 +493,6 @@ class Selection {
|
|
644
493
|
return !this.selectedRange.isEmpty();
|
645
494
|
}
|
646
495
|
|
647
|
-
/**
|
648
|
-
* Returns information if we have a multi-selection. This method check multi-selection only on the latest layer of
|
649
|
-
* the selection.
|
650
|
-
*
|
651
|
-
* @returns {boolean}
|
652
|
-
*/
|
653
|
-
isMultiple() {
|
654
|
-
if (!this.isSelected()) {
|
655
|
-
return false;
|
656
|
-
}
|
657
|
-
const isMultipleListener = (0, _object.createObjectPropListener)(!this.selectedRange.current().isSingle());
|
658
|
-
this.runLocalHooks('afterIsMultipleSelection', isMultipleListener);
|
659
|
-
return isMultipleListener.value;
|
660
|
-
}
|
661
|
-
|
662
|
-
/**
|
663
|
-
* Checks if the last selection involves changing the focus cell position only.
|
664
|
-
*
|
665
|
-
* @returns {boolean}
|
666
|
-
*/
|
667
|
-
isFocusSelectionChanged() {
|
668
|
-
return this.isSelected() && _classPrivateFieldGet(this, _isFocusSelectionChanged);
|
669
|
-
}
|
670
|
-
|
671
496
|
/**
|
672
497
|
* Returns `true` if the selection was applied by clicking to the row header. If the `layerLevel`
|
673
498
|
* argument is passed then only that layer will be checked. Otherwise, it checks if any row header
|
@@ -866,7 +691,7 @@ class Selection {
|
|
866
691
|
focusPosition,
|
867
692
|
disableHeadersHighlight
|
868
693
|
} = options;
|
869
|
-
_classPrivateFieldSet(
|
694
|
+
_classPrivateFieldSet(_disableHeadersHighlight, this, disableHeadersHighlight);
|
870
695
|
if (focusPosition && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.row) && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.col)) {
|
871
696
|
highlight = this.tableProps.createCellCoords((0, _number.clamp)(focusPosition.row, rowFrom, nrOfRows - 1), (0, _number.clamp)(focusPosition.col, columnFrom, nrOfColumns - 1));
|
872
697
|
}
|
@@ -882,7 +707,7 @@ class Selection {
|
|
882
707
|
}
|
883
708
|
this.setRangeEnd(endCoords);
|
884
709
|
this.finish();
|
885
|
-
_classPrivateFieldSet(
|
710
|
+
_classPrivateFieldSet(_disableHeadersHighlight, this, false);
|
886
711
|
}
|
887
712
|
|
888
713
|
/**
|
@@ -950,10 +775,9 @@ class Selection {
|
|
950
775
|
*
|
951
776
|
* @param {number|string} startColumn Visual column index or column property from which the selection starts.
|
952
777
|
* @param {number|string} [endColumn] Visual column index or column property from to the selection finishes.
|
953
|
-
* @param {number
|
954
|
-
*
|
955
|
-
*
|
956
|
-
* position horizontally.
|
778
|
+
* @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
|
779
|
+
* The value can take visual row index from -N to N, where negative values
|
780
|
+
* point to the headers and positive values point to the cell range.
|
957
781
|
* @returns {boolean} Returns `true` if selection was successful, `false` otherwise.
|
958
782
|
*/
|
959
783
|
selectColumns(startColumn) {
|
@@ -974,20 +798,11 @@ class Selection {
|
|
974
798
|
countColHeaders
|
975
799
|
});
|
976
800
|
if (isValid) {
|
977
|
-
|
978
|
-
let highlightColumn = 0;
|
979
|
-
if (Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.row) && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.col)) {
|
980
|
-
highlightRow = (0, _number.clamp)(focusPosition.row, columnHeaderLastIndex, countRows - 1);
|
981
|
-
highlightColumn = (0, _number.clamp)(focusPosition.col, Math.min(start, end), Math.max(start, end));
|
982
|
-
} else {
|
983
|
-
highlightRow = (0, _number.clamp)(focusPosition, columnHeaderLastIndex, countRows - 1);
|
984
|
-
highlightColumn = start;
|
985
|
-
}
|
986
|
-
const highlight = this.tableProps.createCellCoords(highlightRow, highlightColumn);
|
987
|
-
const fromRow = countColHeaders === 0 ? 0 : (0, _number.clamp)(highlight.row, columnHeaderLastIndex, -1);
|
801
|
+
const fromRow = countColHeaders === 0 ? 0 : (0, _number.clamp)(focusPosition, columnHeaderLastIndex, -1);
|
988
802
|
const toRow = countRows - 1;
|
989
803
|
const from = this.tableProps.createCellCoords(fromRow, start);
|
990
804
|
const to = this.tableProps.createCellCoords(toRow, end);
|
805
|
+
const highlight = this.tableProps.createCellCoords((0, _number.clamp)(focusPosition, columnHeaderLastIndex, countRows - 1), start);
|
991
806
|
this.runLocalHooks('beforeSelectColumns', from, to, highlight);
|
992
807
|
|
993
808
|
// disallow modifying row axis for that hooks
|
@@ -1007,10 +822,9 @@ class Selection {
|
|
1007
822
|
*
|
1008
823
|
* @param {number} startRow Visual row index from which the selection starts.
|
1009
824
|
* @param {number} [endRow] Visual row index from to the selection finishes.
|
1010
|
-
* @param {number
|
1011
|
-
*
|
1012
|
-
*
|
1013
|
-
* position horizontally.
|
825
|
+
* @param {number} [focusPosition=0] The argument allows changing the cell/header focus position.
|
826
|
+
* The value can take visual column index from -N to N, where negative values
|
827
|
+
* point to the headers and positive values point to the cell range.
|
1014
828
|
* @returns {boolean} Returns `true` if selection was successful, `false` otherwise.
|
1015
829
|
*/
|
1016
830
|
selectRows(startRow) {
|
@@ -1029,20 +843,11 @@ class Selection {
|
|
1029
843
|
countColHeaders: 0
|
1030
844
|
});
|
1031
845
|
if (isValid) {
|
1032
|
-
|
1033
|
-
let highlightColumn = 0;
|
1034
|
-
if (Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.row) && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.col)) {
|
1035
|
-
highlightRow = (0, _number.clamp)(focusPosition.row, Math.min(startRow, endRow), Math.max(startRow, endRow));
|
1036
|
-
highlightColumn = (0, _number.clamp)(focusPosition.col, rowHeaderLastIndex, countCols - 1);
|
1037
|
-
} else {
|
1038
|
-
highlightRow = startRow;
|
1039
|
-
highlightColumn = (0, _number.clamp)(focusPosition, rowHeaderLastIndex, countCols - 1);
|
1040
|
-
}
|
1041
|
-
const highlight = this.tableProps.createCellCoords(highlightRow, highlightColumn);
|
1042
|
-
const fromColumn = countRowHeaders === 0 ? 0 : (0, _number.clamp)(highlight.col, rowHeaderLastIndex, -1);
|
846
|
+
const fromColumn = countRowHeaders === 0 ? 0 : (0, _number.clamp)(focusPosition, rowHeaderLastIndex, -1);
|
1043
847
|
const toColumn = countCols - 1;
|
1044
848
|
const from = this.tableProps.createCellCoords(startRow, fromColumn);
|
1045
849
|
const to = this.tableProps.createCellCoords(endRow, toColumn);
|
850
|
+
const highlight = this.tableProps.createCellCoords(startRow, (0, _number.clamp)(focusPosition, rowHeaderLastIndex, countCols - 1));
|
1046
851
|
this.runLocalHooks('beforeSelectRows', from, to, highlight);
|
1047
852
|
|
1048
853
|
// disallow modifying column axis for that hooks
|