handsontable 0.0.0-next-53a190b-20240403 → 0.0.0-next-5a535ed-20240403
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 +17 -12
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +17 -12
- package/3rdparty/walkontable/src/calculator/viewportRows.js +15 -10
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +15 -10
- package/3rdparty/walkontable/src/cell/coords.js +17 -12
- package/3rdparty/walkontable/src/cell/coords.mjs +17 -12
- package/3rdparty/walkontable/src/cell/range.d.ts +1 -2
- package/3rdparty/walkontable/src/cell/range.js +28 -40
- package/3rdparty/walkontable/src/cell/range.mjs +28 -40
- package/3rdparty/walkontable/src/core/_base.js +1 -1
- package/3rdparty/walkontable/src/core/_base.mjs +1 -1
- package/3rdparty/walkontable/src/event.js +104 -72
- package/3rdparty/walkontable/src/event.mjs +104 -72
- package/3rdparty/walkontable/src/overlay/inlineStart.js +1 -15
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -16
- package/3rdparty/walkontable/src/overlay/top.js +0 -11
- package/3rdparty/walkontable/src/overlay/top.mjs +1 -12
- package/3rdparty/walkontable/src/overlays.js +4 -46
- package/3rdparty/walkontable/src/overlays.mjs +4 -46
- package/3rdparty/walkontable/src/scroll.js +17 -15
- package/3rdparty/walkontable/src/scroll.mjs +17 -15
- package/3rdparty/walkontable/src/selection/manager.js +69 -48
- package/3rdparty/walkontable/src/selection/manager.mjs +69 -48
- package/3rdparty/walkontable/src/selection/scanner.js +42 -33
- package/3rdparty/walkontable/src/selection/scanner.mjs +42 -33
- package/3rdparty/walkontable/src/utils/columnStretching.js +44 -27
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +44 -27
- 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 -77
- package/core.mjs +22 -77
- 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/metaManager/metaSchema.js +1 -1
- package/dataMap/metaManager/metaSchema.mjs +1 -1
- package/dataMap/replaceData.js +1 -1
- package/dataMap/replaceData.mjs +1 -1
- package/dist/handsontable.css +4 -4
- package/dist/handsontable.full.css +4 -4
- package/dist/handsontable.full.js +9121 -9062
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +292 -292
- package/dist/handsontable.js +6573 -6967
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +25 -25
- 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 +23 -25
- package/editorManager.mjs +23 -25
- package/editors/autocompleteEditor/autocompleteEditor.js +10 -6
- package/editors/autocompleteEditor/autocompleteEditor.mjs +10 -6
- package/editors/selectEditor/selectEditor.js +19 -20
- package/editors/selectEditor/selectEditor.mjs +19 -20
- package/eventManager.js +1 -1
- package/eventManager.mjs +1 -1
- package/focusManager.js +82 -64
- package/focusManager.mjs +82 -64
- package/helpers/dom/element.js +1 -23
- package/helpers/dom/element.mjs +1 -21
- 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 +0 -10
- package/package.json +2 -7
- package/pluginHooks.d.ts +3 -4
- package/pluginHooks.js +38 -99
- package/pluginHooks.mjs +38 -99
- package/plugins/autoColumnSize/autoColumnSize.js +65 -49
- package/plugins/autoColumnSize/autoColumnSize.mjs +65 -49
- package/plugins/autoRowSize/autoRowSize.js +34 -28
- package/plugins/autoRowSize/autoRowSize.mjs +34 -28
- package/plugins/autofill/autofill.js +38 -30
- package/plugins/autofill/autofill.mjs +38 -30
- package/plugins/base/base.js +17 -12
- package/plugins/base/base.mjs +17 -12
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
- package/plugins/collapsibleColumns/collapsibleColumns.js +50 -59
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +50 -59
- package/plugins/columnSorting/columnSorting.js +45 -49
- package/plugins/columnSorting/columnSorting.mjs +45 -49
- package/plugins/columnSummary/columnSummary.js +26 -22
- package/plugins/columnSummary/columnSummary.mjs +26 -22
- package/plugins/comments/comments.js +158 -116
- package/plugins/comments/comments.mjs +158 -116
- package/plugins/contextMenu/contextMenu.js +26 -20
- package/plugins/contextMenu/contextMenu.mjs +26 -20
- 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 +21 -13
- package/plugins/contextMenu/menu/menu.mjs +21 -13
- package/plugins/contextMenu/menu/positioner.js +58 -41
- package/plugins/contextMenu/menu/positioner.mjs +58 -41
- package/plugins/copyPaste/copyPaste.js +157 -116
- package/plugins/copyPaste/copyPaste.mjs +157 -116
- package/plugins/copyPaste/copyableRanges.js +66 -43
- package/plugins/copyPaste/copyableRanges.mjs +66 -43
- package/plugins/customBorders/customBorders.js +13 -11
- package/plugins/customBorders/customBorders.mjs +13 -11
- package/plugins/dragToScroll/dragToScroll.js +6 -6
- package/plugins/dragToScroll/dragToScroll.mjs +6 -6
- package/plugins/dropdownMenu/dropdownMenu.js +106 -80
- package/plugins/dropdownMenu/dropdownMenu.mjs +106 -80
- 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 +15 -13
- package/plugins/filters/component/condition.mjs +15 -13
- package/plugins/filters/component/operators.js +6 -6
- package/plugins/filters/component/operators.mjs +6 -6
- package/plugins/filters/component/value.js +28 -24
- package/plugins/filters/component/value.mjs +28 -24
- package/plugins/filters/conditionUpdateObserver.js +24 -22
- package/plugins/filters/conditionUpdateObserver.mjs +24 -22
- package/plugins/filters/dataFilter.js +1 -1
- package/plugins/filters/dataFilter.mjs +1 -1
- package/plugins/filters/filters.js +95 -81
- package/plugins/filters/filters.mjs +95 -81
- package/plugins/filters/ui/input.js +19 -13
- package/plugins/filters/ui/input.mjs +19 -13
- package/plugins/filters/ui/link.js +13 -8
- package/plugins/filters/ui/link.mjs +13 -8
- package/plugins/filters/ui/multipleSelect.js +112 -85
- package/plugins/filters/ui/multipleSelect.mjs +112 -85
- package/plugins/filters/ui/radioInput.js +20 -12
- package/plugins/filters/ui/radioInput.mjs +20 -12
- package/plugins/filters/ui/select.js +72 -50
- package/plugins/filters/ui/select.mjs +71 -49
- package/plugins/formulas/formulas.js +326 -268
- package/plugins/formulas/formulas.mjs +327 -269
- package/plugins/formulas/indexSyncer/axisSyncer.js +61 -38
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +61 -38
- package/plugins/formulas/indexSyncer/index.js +48 -25
- package/plugins/formulas/indexSyncer/index.mjs +48 -25
- package/plugins/hiddenColumns/hiddenColumns.js +83 -64
- package/plugins/hiddenColumns/hiddenColumns.mjs +83 -64
- package/plugins/hiddenRows/hiddenRows.js +82 -63
- package/plugins/hiddenRows/hiddenRows.mjs +82 -63
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +32 -24
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +33 -25
- package/plugins/manualColumnMove/manualColumnMove.js +170 -126
- package/plugins/manualColumnMove/manualColumnMove.mjs +170 -126
- package/plugins/manualColumnResize/manualColumnResize.js +230 -169
- package/plugins/manualColumnResize/manualColumnResize.mjs +230 -169
- package/plugins/manualRowMove/manualRowMove.js +128 -99
- package/plugins/manualRowMove/manualRowMove.mjs +128 -99
- package/plugins/manualRowResize/manualRowResize.js +209 -150
- package/plugins/manualRowResize/manualRowResize.mjs +209 -150
- 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 +397 -499
- package/plugins/mergeCells/mergeCells.mjs +397 -499
- package/plugins/multiColumnSorting/multiColumnSorting.js +2 -8
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -8
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
- package/plugins/nestedHeaders/nestedHeaders.js +253 -205
- package/plugins/nestedHeaders/nestedHeaders.mjs +254 -206
- package/plugins/nestedHeaders/stateManager/headersTree.js +32 -21
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +32 -21
- package/plugins/nestedHeaders/stateManager/index.js +41 -30
- package/plugins/nestedHeaders/stateManager/index.mjs +41 -30
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +30 -19
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +30 -19
- package/plugins/nestedRows/data/dataManager.js +1 -1
- package/plugins/nestedRows/data/dataManager.mjs +1 -1
- package/plugins/nestedRows/nestedRows.js +182 -151
- package/plugins/nestedRows/nestedRows.mjs +183 -152
- package/plugins/nestedRows/ui/contextMenu.js +15 -11
- package/plugins/nestedRows/ui/contextMenu.mjs +14 -10
- 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 +19 -15
- package/plugins/touchScroll/touchScroll.mjs +20 -16
- 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 +0 -2
- package/selection/highlight/visualSelection.mjs +0 -2
- package/selection/selection.js +67 -225
- package/selection/selection.mjs +66 -224
- package/selection/transformation.js +118 -149
- package/selection/transformation.mjs +118 -149
- 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 +3 -9
- package/shortcutContexts/grid.mjs +3 -9
- package/shortcuts/context.js +1 -2
- package/shortcuts/context.mjs +1 -2
- package/tableView.js +78 -52
- package/tableView.mjs +78 -52
- package/translations/changesObservable/observable.js +38 -21
- package/translations/changesObservable/observable.mjs +38 -21
- package/translations/changesObservable/observer.js +12 -7
- package/translations/changesObservable/observer.mjs +11 -6
- 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 +44 -26
- package/utils/interval.mjs +44 -26
- package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
- package/i18n/languages/ar-AR.d.ts +0 -5
- package/i18n/languages/cs-CZ.d.ts +0 -5
- package/i18n/languages/hr-HR.d.ts +0 -5
- package/i18n/languages/sr-SP.d.ts +0 -5
- package/plugins/mergeCells/focusOrder.js +0 -305
- package/plugins/mergeCells/focusOrder.mjs +0 -300
@@ -2,9 +2,12 @@ import "core-js/modules/es.error.cause.js";
|
|
2
2
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
3
3
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
4
4
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
5
|
-
function _classPrivateFieldGet(
|
6
|
-
function
|
7
|
-
function
|
5
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
6
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
7
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
8
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
9
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
10
|
+
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; } }
|
8
11
|
import { mixin, createObjectPropListener } from "../helpers/object.mjs";
|
9
12
|
import localHooks from "./../mixins/localHooks.mjs";
|
10
13
|
/**
|
@@ -25,29 +28,67 @@ import localHooks from "./../mixins/localHooks.mjs";
|
|
25
28
|
var _range = /*#__PURE__*/new WeakMap();
|
26
29
|
var _options = /*#__PURE__*/new WeakMap();
|
27
30
|
var _offset = /*#__PURE__*/new WeakMap();
|
28
|
-
var
|
31
|
+
var _setOffsetSize = /*#__PURE__*/new WeakSet();
|
32
|
+
var _clampCoords = /*#__PURE__*/new WeakSet();
|
33
|
+
var _getTableSize = /*#__PURE__*/new WeakSet();
|
34
|
+
var _visualToZeroBasedCoords = /*#__PURE__*/new WeakSet();
|
35
|
+
var _zeroBasedToVisualCoords = /*#__PURE__*/new WeakSet();
|
29
36
|
class Transformation {
|
30
37
|
constructor(range, options) {
|
38
|
+
/**
|
39
|
+
* Translates the zero-based coordinates to visual ones.
|
40
|
+
*
|
41
|
+
* @param {CellCoords} zeroBasedCoords The coordinates to process.
|
42
|
+
* @returns {CellCoords}
|
43
|
+
*/
|
44
|
+
_classPrivateMethodInitSpec(this, _zeroBasedToVisualCoords);
|
45
|
+
/**
|
46
|
+
* Translates the visual coordinates to zero-based ones.
|
47
|
+
*
|
48
|
+
* @param {CellCoords} visualCoords The visual coords to process.
|
49
|
+
* @returns {CellCoords}
|
50
|
+
*/
|
51
|
+
_classPrivateMethodInitSpec(this, _visualToZeroBasedCoords);
|
52
|
+
/**
|
53
|
+
* Gets the table size in number of rows with headers as "height" and number of columns with
|
54
|
+
* headers as "width".
|
55
|
+
*
|
56
|
+
* @returns {{width: number, height: number}}
|
57
|
+
*/
|
58
|
+
_classPrivateMethodInitSpec(this, _getTableSize);
|
31
59
|
/**
|
32
60
|
* Clamps the coords to make sure they points to the cell (or header) in the table range.
|
33
61
|
*
|
34
62
|
* @param {CellCoords} zeroBasedCoords The coords object to clamp.
|
35
63
|
* @returns {{rowDir: 1|0|-1, colDir: 1|0|-1}}
|
36
64
|
*/
|
37
|
-
_classPrivateMethodInitSpec(this,
|
65
|
+
_classPrivateMethodInitSpec(this, _clampCoords);
|
66
|
+
/**
|
67
|
+
* Sets the additional offset in table size that may occur when the `navigableHeaders` option
|
68
|
+
* is enabled.
|
69
|
+
*
|
70
|
+
* @param {{x: number, y: number}} offset Offset as x and y properties.
|
71
|
+
*/
|
72
|
+
_classPrivateMethodInitSpec(this, _setOffsetSize);
|
38
73
|
/**
|
39
74
|
* Instance of the SelectionRange, holder for visual coordinates applied to the table.
|
40
75
|
*
|
41
76
|
* @type {SelectionRange}
|
42
77
|
*/
|
43
|
-
_classPrivateFieldInitSpec(this, _range,
|
78
|
+
_classPrivateFieldInitSpec(this, _range, {
|
79
|
+
writable: true,
|
80
|
+
value: void 0
|
81
|
+
});
|
44
82
|
/**
|
45
83
|
* Additional options which define the state of the settings which can infer transformation and
|
46
84
|
* give the possibility to translate indexes.
|
47
85
|
*
|
48
86
|
* @type {object}
|
49
87
|
*/
|
50
|
-
_classPrivateFieldInitSpec(this, _options,
|
88
|
+
_classPrivateFieldInitSpec(this, _options, {
|
89
|
+
writable: true,
|
90
|
+
value: void 0
|
91
|
+
});
|
51
92
|
/**
|
52
93
|
* Increases the table size by applying the offsets. The option is used by the `navigableHeaders`
|
53
94
|
* option.
|
@@ -55,11 +96,14 @@ class Transformation {
|
|
55
96
|
* @type {{ x: number, y: number }}
|
56
97
|
*/
|
57
98
|
_classPrivateFieldInitSpec(this, _offset, {
|
58
|
-
|
59
|
-
|
99
|
+
writable: true,
|
100
|
+
value: {
|
101
|
+
x: 0,
|
102
|
+
y: 0
|
103
|
+
}
|
60
104
|
});
|
61
|
-
_classPrivateFieldSet(
|
62
|
-
_classPrivateFieldSet(
|
105
|
+
_classPrivateFieldSet(this, _range, range);
|
106
|
+
_classPrivateFieldSet(this, _options, options);
|
63
107
|
}
|
64
108
|
|
65
109
|
/**
|
@@ -73,9 +117,13 @@ class Transformation {
|
|
73
117
|
*/
|
74
118
|
transformStart(rowDelta, colDelta) {
|
75
119
|
let createMissingRecords = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
76
|
-
|
77
|
-
|
78
|
-
|
120
|
+
_classPrivateMethodGet(this, _setOffsetSize, _setOffsetSize2).call(this, {
|
121
|
+
x: _classPrivateFieldGet(this, _options).navigableHeaders() ? _classPrivateFieldGet(this, _options).countRowHeaders() : 0,
|
122
|
+
y: _classPrivateFieldGet(this, _options).navigableHeaders() ? _classPrivateFieldGet(this, _options).countColHeaders() : 0
|
123
|
+
});
|
124
|
+
const delta = _classPrivateFieldGet(this, _options).createCellCoords(rowDelta, colDelta);
|
125
|
+
let visualCoords = _classPrivateFieldGet(this, _range).current().highlight;
|
126
|
+
const highlightRenderableCoords = _classPrivateFieldGet(this, _options).visualToRenderableCoords(visualCoords);
|
79
127
|
let rowTransformDir = 0;
|
80
128
|
let colTransformDir = 0;
|
81
129
|
this.runLocalHooks('beforeTransformStart', delta);
|
@@ -83,32 +131,32 @@ class Transformation {
|
|
83
131
|
const {
|
84
132
|
width,
|
85
133
|
height
|
86
|
-
} =
|
134
|
+
} = _classPrivateMethodGet(this, _getTableSize, _getTableSize2).call(this);
|
87
135
|
const {
|
88
136
|
row,
|
89
137
|
col
|
90
|
-
} =
|
91
|
-
const fixedRowsBottom = _classPrivateFieldGet(
|
92
|
-
const minSpareRows = _classPrivateFieldGet(
|
93
|
-
const minSpareCols = _classPrivateFieldGet(
|
94
|
-
const autoWrapRow = _classPrivateFieldGet(
|
95
|
-
const autoWrapCol = _classPrivateFieldGet(
|
96
|
-
const zeroBasedCoords = _classPrivateFieldGet(
|
138
|
+
} = _classPrivateMethodGet(this, _visualToZeroBasedCoords, _visualToZeroBasedCoords2).call(this, visualCoords);
|
139
|
+
const fixedRowsBottom = _classPrivateFieldGet(this, _options).fixedRowsBottom();
|
140
|
+
const minSpareRows = _classPrivateFieldGet(this, _options).minSpareRows();
|
141
|
+
const minSpareCols = _classPrivateFieldGet(this, _options).minSpareCols();
|
142
|
+
const autoWrapRow = _classPrivateFieldGet(this, _options).autoWrapRow();
|
143
|
+
const autoWrapCol = _classPrivateFieldGet(this, _options).autoWrapCol();
|
144
|
+
const zeroBasedCoords = _classPrivateFieldGet(this, _options).createCellCoords(row + delta.row, col + delta.col);
|
97
145
|
if (zeroBasedCoords.row >= height) {
|
98
146
|
const isActionInterrupted = createObjectPropListener(createMissingRecords && minSpareRows > 0 && fixedRowsBottom === 0);
|
99
147
|
const nextColumn = zeroBasedCoords.col + 1;
|
100
|
-
const newCoords = _classPrivateFieldGet(
|
101
|
-
this.runLocalHooks('beforeColumnWrap', isActionInterrupted,
|
148
|
+
const newCoords = _classPrivateFieldGet(this, _options).createCellCoords(zeroBasedCoords.row - height, nextColumn >= width ? nextColumn - width : nextColumn);
|
149
|
+
this.runLocalHooks('beforeColumnWrap', isActionInterrupted, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), nextColumn >= width);
|
102
150
|
if (isActionInterrupted.value) {
|
103
|
-
this.runLocalHooks('insertRowRequire', _classPrivateFieldGet(
|
151
|
+
this.runLocalHooks('insertRowRequire', _classPrivateFieldGet(this, _options).countRenderableRows());
|
104
152
|
} else if (autoWrapCol) {
|
105
153
|
zeroBasedCoords.assign(newCoords);
|
106
154
|
}
|
107
155
|
} else if (zeroBasedCoords.row < 0) {
|
108
156
|
const isActionInterrupted = createObjectPropListener(autoWrapCol);
|
109
157
|
const previousColumn = zeroBasedCoords.col - 1;
|
110
|
-
const newCoords = _classPrivateFieldGet(
|
111
|
-
this.runLocalHooks('beforeColumnWrap', isActionInterrupted,
|
158
|
+
const newCoords = _classPrivateFieldGet(this, _options).createCellCoords(height + zeroBasedCoords.row, previousColumn < 0 ? width + previousColumn : previousColumn);
|
159
|
+
this.runLocalHooks('beforeColumnWrap', isActionInterrupted, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), previousColumn < 0);
|
112
160
|
if (autoWrapCol) {
|
113
161
|
zeroBasedCoords.assign(newCoords);
|
114
162
|
}
|
@@ -116,18 +164,18 @@ class Transformation {
|
|
116
164
|
if (zeroBasedCoords.col >= width) {
|
117
165
|
const isActionInterrupted = createObjectPropListener(createMissingRecords && minSpareCols > 0);
|
118
166
|
const nextRow = zeroBasedCoords.row + 1;
|
119
|
-
const newCoords = _classPrivateFieldGet(
|
120
|
-
this.runLocalHooks('beforeRowWrap', isActionInterrupted,
|
167
|
+
const newCoords = _classPrivateFieldGet(this, _options).createCellCoords(nextRow >= height ? nextRow - height : nextRow, zeroBasedCoords.col - width);
|
168
|
+
this.runLocalHooks('beforeRowWrap', isActionInterrupted, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), nextRow >= height);
|
121
169
|
if (isActionInterrupted.value) {
|
122
|
-
this.runLocalHooks('insertColRequire', _classPrivateFieldGet(
|
170
|
+
this.runLocalHooks('insertColRequire', _classPrivateFieldGet(this, _options).countRenderableColumns());
|
123
171
|
} else if (autoWrapRow) {
|
124
172
|
zeroBasedCoords.assign(newCoords);
|
125
173
|
}
|
126
174
|
} else if (zeroBasedCoords.col < 0) {
|
127
175
|
const isActionInterrupted = createObjectPropListener(autoWrapRow);
|
128
176
|
const previousRow = zeroBasedCoords.row - 1;
|
129
|
-
const newCoords = _classPrivateFieldGet(
|
130
|
-
this.runLocalHooks('beforeRowWrap', isActionInterrupted,
|
177
|
+
const newCoords = _classPrivateFieldGet(this, _options).createCellCoords(previousRow < 0 ? height + previousRow : previousRow, width + zeroBasedCoords.col);
|
178
|
+
this.runLocalHooks('beforeRowWrap', isActionInterrupted, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), previousRow < 0);
|
131
179
|
if (autoWrapRow) {
|
132
180
|
zeroBasedCoords.assign(newCoords);
|
133
181
|
}
|
@@ -135,10 +183,10 @@ class Transformation {
|
|
135
183
|
const {
|
136
184
|
rowDir,
|
137
185
|
colDir
|
138
|
-
} =
|
186
|
+
} = _classPrivateMethodGet(this, _clampCoords, _clampCoords2).call(this, zeroBasedCoords);
|
139
187
|
rowTransformDir = rowDir;
|
140
188
|
colTransformDir = colDir;
|
141
|
-
visualCoords =
|
189
|
+
visualCoords = _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, zeroBasedCoords);
|
142
190
|
}
|
143
191
|
this.runLocalHooks('afterTransformStart', visualCoords, rowTransformDir, colTransformDir);
|
144
192
|
return visualCoords;
|
@@ -152,53 +200,30 @@ class Transformation {
|
|
152
200
|
* @returns {CellCoords} Visual coordinates after transformation.
|
153
201
|
*/
|
154
202
|
transformEnd(rowDelta, colDelta) {
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
const
|
203
|
+
_classPrivateMethodGet(this, _setOffsetSize, _setOffsetSize2).call(this, {
|
204
|
+
x: _classPrivateFieldGet(this, _options).navigableHeaders() ? _classPrivateFieldGet(this, _options).countRowHeaders() : 0,
|
205
|
+
y: _classPrivateFieldGet(this, _options).navigableHeaders() ? _classPrivateFieldGet(this, _options).countColHeaders() : 0
|
206
|
+
});
|
207
|
+
const delta = _classPrivateFieldGet(this, _options).createCellCoords(rowDelta, colDelta);
|
208
|
+
const cellRange = _classPrivateFieldGet(this, _range).current();
|
209
|
+
const highlightRenderableCoords = _classPrivateFieldGet(this, _options).visualToRenderableCoords(cellRange.highlight);
|
160
210
|
const visualCoords = cellRange.to.clone();
|
161
211
|
let rowTransformDir = 0;
|
162
212
|
let colTransformDir = 0;
|
163
213
|
this.runLocalHooks('beforeTransformEnd', delta);
|
164
|
-
if (highlightRenderableCoords.row !== null && highlightRenderableCoords.col !== null
|
214
|
+
if (highlightRenderableCoords.row !== null && highlightRenderableCoords.col !== null) {
|
165
215
|
const {
|
166
|
-
row
|
167
|
-
col
|
168
|
-
} =
|
169
|
-
const coords = _classPrivateFieldGet(
|
170
|
-
const topStartCorner = cellRange.getTopStartCorner();
|
171
|
-
const topEndCorner = cellRange.getTopEndCorner();
|
172
|
-
const bottomEndCorner = cellRange.getBottomEndCorner();
|
173
|
-
const restDelta = {
|
174
|
-
row: coords.row - highlightRow,
|
175
|
-
col: coords.col - highlightColumn
|
176
|
-
};
|
177
|
-
if (delta.col < 0) {
|
178
|
-
if (toColumn >= highlightColumn && coords.col < highlightColumn) {
|
179
|
-
coords.col = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedColumn).call(this, topStartCorner.col, topEndCorner.col) + restDelta.col;
|
180
|
-
}
|
181
|
-
} else if (delta.col > 0) {
|
182
|
-
if (toColumn <= highlightColumn && coords.col > highlightColumn) {
|
183
|
-
coords.col = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedColumn).call(this, topEndCorner.col, topStartCorner.col) + restDelta.col;
|
184
|
-
}
|
185
|
-
}
|
186
|
-
if (delta.row < 0) {
|
187
|
-
if (toRow >= highlightRow && coords.row < highlightRow) {
|
188
|
-
coords.row = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedRow).call(this, topStartCorner.row, bottomEndCorner.row) + restDelta.row;
|
189
|
-
}
|
190
|
-
} else if (delta.row > 0) {
|
191
|
-
if (toRow <= highlightRow && coords.row > highlightRow) {
|
192
|
-
coords.row = _assertClassBrand(_Transformation_brand, this, _findFirstNonHiddenZeroBasedRow).call(this, bottomEndCorner.row, topStartCorner.row) + restDelta.row;
|
193
|
-
}
|
194
|
-
}
|
216
|
+
row,
|
217
|
+
col
|
218
|
+
} = _classPrivateMethodGet(this, _visualToZeroBasedCoords, _visualToZeroBasedCoords2).call(this, cellRange.to);
|
219
|
+
const coords = _classPrivateFieldGet(this, _options).createCellCoords(row + delta.row, col + delta.col);
|
195
220
|
const {
|
196
221
|
rowDir,
|
197
222
|
colDir
|
198
|
-
} =
|
223
|
+
} = _classPrivateMethodGet(this, _clampCoords, _clampCoords2).call(this, coords);
|
199
224
|
rowTransformDir = rowDir;
|
200
225
|
colTransformDir = colDir;
|
201
|
-
const newVisualCoords =
|
226
|
+
const newVisualCoords = _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, coords);
|
202
227
|
if (delta.row === 0 && delta.col !== 0) {
|
203
228
|
visualCoords.col = newVisualCoords.col;
|
204
229
|
} else if (delta.row !== 0 && delta.col === 0) {
|
@@ -211,29 +236,22 @@ class Transformation {
|
|
211
236
|
this.runLocalHooks('afterTransformEnd', visualCoords, rowTransformDir, colTransformDir);
|
212
237
|
return visualCoords;
|
213
238
|
}
|
214
|
-
|
215
|
-
/**
|
216
|
-
* Sets the additional offset in table size that may occur when the `navigableHeaders` option
|
217
|
-
* is enabled.
|
218
|
-
*
|
219
|
-
* @param {{x: number, y: number}} offset Offset as x and y properties.
|
220
|
-
*/
|
221
|
-
setOffsetSize(_ref) {
|
222
|
-
let {
|
223
|
-
x,
|
224
|
-
y
|
225
|
-
} = _ref;
|
226
|
-
_classPrivateFieldSet(_offset, this, {
|
227
|
-
x,
|
228
|
-
y
|
229
|
-
});
|
230
|
-
}
|
231
239
|
}
|
232
|
-
function
|
240
|
+
function _setOffsetSize2(_ref) {
|
241
|
+
let {
|
242
|
+
x,
|
243
|
+
y
|
244
|
+
} = _ref;
|
245
|
+
_classPrivateFieldSet(this, _offset, {
|
246
|
+
x,
|
247
|
+
y
|
248
|
+
});
|
249
|
+
}
|
250
|
+
function _clampCoords2(zeroBasedCoords) {
|
233
251
|
const {
|
234
252
|
width,
|
235
253
|
height
|
236
|
-
} =
|
254
|
+
} = _classPrivateMethodGet(this, _getTableSize, _getTableSize2).call(this);
|
237
255
|
let rowDir = 0;
|
238
256
|
let colDir = 0;
|
239
257
|
if (zeroBasedCoords.row < 0) {
|
@@ -255,73 +273,24 @@ function _clampCoords(zeroBasedCoords) {
|
|
255
273
|
colDir
|
256
274
|
};
|
257
275
|
}
|
258
|
-
|
259
|
-
* Gets the table size in number of rows with headers as "height" and number of columns with
|
260
|
-
* headers as "width".
|
261
|
-
*
|
262
|
-
* @returns {{width: number, height: number}}
|
263
|
-
*/
|
264
|
-
function _getTableSize() {
|
276
|
+
function _getTableSize2() {
|
265
277
|
return {
|
266
|
-
width: _classPrivateFieldGet(
|
267
|
-
height: _classPrivateFieldGet(
|
278
|
+
width: _classPrivateFieldGet(this, _offset).x + _classPrivateFieldGet(this, _options).countRenderableColumns(),
|
279
|
+
height: _classPrivateFieldGet(this, _offset).y + _classPrivateFieldGet(this, _options).countRenderableRows()
|
268
280
|
};
|
269
281
|
}
|
270
|
-
|
271
|
-
* Finds the first non-hidden zero-based row in the table range.
|
272
|
-
*
|
273
|
-
* @param {number} visualRowFrom The visual row from which the search should start.
|
274
|
-
* @param {number} visualRowTo The visual row to which the search should end.
|
275
|
-
* @returns {number | null}
|
276
|
-
*/
|
277
|
-
function _findFirstNonHiddenZeroBasedRow(visualRowFrom, visualRowTo) {
|
278
|
-
const row = _classPrivateFieldGet(_options, this).findFirstNonHiddenRenderableRow(visualRowFrom, visualRowTo);
|
279
|
-
if (row === null) {
|
280
|
-
return null;
|
281
|
-
}
|
282
|
-
return _classPrivateFieldGet(_offset, this).y + row;
|
283
|
-
}
|
284
|
-
/**
|
285
|
-
* Finds the first non-hidden zero-based column in the table range.
|
286
|
-
*
|
287
|
-
* @param {number} visualColumnFrom The visual column from which the search should start.
|
288
|
-
* @param {number} visualColumnTo The visual column to which the search should end.
|
289
|
-
* @returns {number | null}
|
290
|
-
*/
|
291
|
-
function _findFirstNonHiddenZeroBasedColumn(visualColumnFrom, visualColumnTo) {
|
292
|
-
const column = _classPrivateFieldGet(_options, this).findFirstNonHiddenRenderableColumn(visualColumnFrom, visualColumnTo);
|
293
|
-
if (column === null) {
|
294
|
-
return null;
|
295
|
-
}
|
296
|
-
return _classPrivateFieldGet(_offset, this).x + column;
|
297
|
-
}
|
298
|
-
/**
|
299
|
-
* Translates the visual coordinates to zero-based ones.
|
300
|
-
*
|
301
|
-
* @param {CellCoords} visualCoords The visual coords to process.
|
302
|
-
* @returns {CellCoords}
|
303
|
-
*/
|
304
|
-
function _visualToZeroBasedCoords(visualCoords) {
|
282
|
+
function _visualToZeroBasedCoords2(visualCoords) {
|
305
283
|
const {
|
306
284
|
row,
|
307
285
|
col
|
308
|
-
} = _classPrivateFieldGet(
|
309
|
-
|
310
|
-
throw new Error('Renderable coords are not visible.');
|
311
|
-
}
|
312
|
-
return _classPrivateFieldGet(_options, this).createCellCoords(_classPrivateFieldGet(_offset, this).y + row, _classPrivateFieldGet(_offset, this).x + col);
|
286
|
+
} = _classPrivateFieldGet(this, _options).visualToRenderableCoords(visualCoords);
|
287
|
+
return _classPrivateFieldGet(this, _options).createCellCoords(_classPrivateFieldGet(this, _offset).y + row, _classPrivateFieldGet(this, _offset).x + col);
|
313
288
|
}
|
314
|
-
|
315
|
-
* Translates the zero-based coordinates to visual ones.
|
316
|
-
*
|
317
|
-
* @param {CellCoords} zeroBasedCoords The coordinates to process.
|
318
|
-
* @returns {CellCoords}
|
319
|
-
*/
|
320
|
-
function _zeroBasedToVisualCoords(zeroBasedCoords) {
|
289
|
+
function _zeroBasedToVisualCoords2(zeroBasedCoords) {
|
321
290
|
const coords = zeroBasedCoords.clone();
|
322
|
-
coords.col = zeroBasedCoords.col - _classPrivateFieldGet(
|
323
|
-
coords.row = zeroBasedCoords.row - _classPrivateFieldGet(
|
324
|
-
return _classPrivateFieldGet(
|
291
|
+
coords.col = zeroBasedCoords.col - _classPrivateFieldGet(this, _offset).x;
|
292
|
+
coords.row = zeroBasedCoords.row - _classPrivateFieldGet(this, _offset).y;
|
293
|
+
return _classPrivateFieldGet(this, _options).renderableToVisualCoords(coords);
|
325
294
|
}
|
326
295
|
mixin(Transformation, localHooks);
|
327
296
|
export default Transformation;
|
@@ -3,9 +3,9 @@
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
const command = exports.command = {
|
5
5
|
name: 'editorCloseAndSave',
|
6
|
-
callback(hot, event) {
|
6
|
+
callback(hot, event, keys) {
|
7
7
|
const editorManager = hot._getEditorManager();
|
8
8
|
editorManager.closeEditorAndSaveChanges(event.ctrlKey || event.metaKey);
|
9
|
-
editorManager.moveSelectionAfterEnter(
|
9
|
+
editorManager.moveSelectionAfterEnter(keys.includes('shift'));
|
10
10
|
}
|
11
11
|
};
|
@@ -1,8 +1,8 @@
|
|
1
1
|
export const command = {
|
2
2
|
name: 'editorCloseAndSave',
|
3
|
-
callback(hot, event) {
|
3
|
+
callback(hot, event, keys) {
|
4
4
|
const editorManager = hot._getEditorManager();
|
5
5
|
editorManager.closeEditorAndSaveChanges(event.ctrlKey || event.metaKey);
|
6
|
-
editorManager.moveSelectionAfterEnter(
|
6
|
+
editorManager.moveSelectionAfterEnter(keys.includes('shift'));
|
7
7
|
}
|
8
8
|
};
|
@@ -6,35 +6,20 @@ const command = exports.command = {
|
|
6
6
|
name: 'editorOpen',
|
7
7
|
callback(hot, event, keys) {
|
8
8
|
const editorManager = hot._getEditorManager();
|
9
|
-
const selectedRange = hot.getSelectedRangeLast();
|
10
9
|
const {
|
11
10
|
highlight
|
12
|
-
} =
|
13
|
-
|
14
|
-
// supports for navigating with enter key when multiple cells are selected
|
15
|
-
if (hot.selection.isMultiple() && !selectedRange.isHeader() && hot.countRenderedCols() > 0 && hot.countRenderedRows() > 0) {
|
16
|
-
const settings = hot.getSettings();
|
17
|
-
const enterMoves = typeof settings.enterMoves === 'function' ? settings.enterMoves(event) : settings.enterMoves;
|
18
|
-
if (keys.includes('shift')) {
|
19
|
-
hot.selection.transformFocus(-enterMoves.row, -enterMoves.col);
|
20
|
-
} else {
|
21
|
-
hot.selection.transformFocus(enterMoves.row, enterMoves.col);
|
22
|
-
}
|
23
|
-
return;
|
24
|
-
}
|
11
|
+
} = hot.getSelectedRangeLast();
|
25
12
|
if (highlight.isHeader()) {
|
26
13
|
return;
|
27
14
|
}
|
28
|
-
|
29
|
-
// supports editor opening with enter key
|
30
15
|
if (hot.getSettings().enterBeginsEditing) {
|
31
16
|
if (editorManager.cellProperties.readOnly) {
|
32
|
-
editorManager.moveSelectionAfterEnter(
|
17
|
+
editorManager.moveSelectionAfterEnter();
|
33
18
|
} else {
|
34
19
|
editorManager.openEditor(null, event, true);
|
35
20
|
}
|
36
21
|
} else {
|
37
|
-
editorManager.moveSelectionAfterEnter(
|
22
|
+
editorManager.moveSelectionAfterEnter(keys.includes('shift'));
|
38
23
|
}
|
39
24
|
(0, _event.stopImmediatePropagation)(event); // required by HandsontableEditor
|
40
25
|
}
|
@@ -3,35 +3,20 @@ export const command = {
|
|
3
3
|
name: 'editorOpen',
|
4
4
|
callback(hot, event, keys) {
|
5
5
|
const editorManager = hot._getEditorManager();
|
6
|
-
const selectedRange = hot.getSelectedRangeLast();
|
7
6
|
const {
|
8
7
|
highlight
|
9
|
-
} =
|
10
|
-
|
11
|
-
// supports for navigating with enter key when multiple cells are selected
|
12
|
-
if (hot.selection.isMultiple() && !selectedRange.isHeader() && hot.countRenderedCols() > 0 && hot.countRenderedRows() > 0) {
|
13
|
-
const settings = hot.getSettings();
|
14
|
-
const enterMoves = typeof settings.enterMoves === 'function' ? settings.enterMoves(event) : settings.enterMoves;
|
15
|
-
if (keys.includes('shift')) {
|
16
|
-
hot.selection.transformFocus(-enterMoves.row, -enterMoves.col);
|
17
|
-
} else {
|
18
|
-
hot.selection.transformFocus(enterMoves.row, enterMoves.col);
|
19
|
-
}
|
20
|
-
return;
|
21
|
-
}
|
8
|
+
} = hot.getSelectedRangeLast();
|
22
9
|
if (highlight.isHeader()) {
|
23
10
|
return;
|
24
11
|
}
|
25
|
-
|
26
|
-
// supports editor opening with enter key
|
27
12
|
if (hot.getSettings().enterBeginsEditing) {
|
28
13
|
if (editorManager.cellProperties.readOnly) {
|
29
|
-
editorManager.moveSelectionAfterEnter(
|
14
|
+
editorManager.moveSelectionAfterEnter();
|
30
15
|
} else {
|
31
16
|
editorManager.openEditor(null, event, true);
|
32
17
|
}
|
33
18
|
} else {
|
34
|
-
editorManager.moveSelectionAfterEnter(
|
19
|
+
editorManager.moveSelectionAfterEnter(keys.includes('shift'));
|
35
20
|
}
|
36
21
|
stopImmediatePropagation(event); // required by HandsontableEditor
|
37
22
|
}
|
@@ -7,7 +7,7 @@ const command = exports.command = {
|
|
7
7
|
const {
|
8
8
|
highlight
|
9
9
|
} = hot.getSelectedRangeLast();
|
10
|
-
if (
|
10
|
+
if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
|
11
11
|
hot.selection.transformEnd(1, 0);
|
12
12
|
}
|
13
13
|
}
|
@@ -4,7 +4,7 @@ export const command = {
|
|
4
4
|
const {
|
5
5
|
highlight
|
6
6
|
} = hot.getSelectedRangeLast();
|
7
|
-
if (
|
7
|
+
if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
|
8
8
|
hot.selection.transformEnd(1, 0);
|
9
9
|
}
|
10
10
|
}
|
@@ -7,7 +7,7 @@ const command = exports.command = {
|
|
7
7
|
const {
|
8
8
|
highlight
|
9
9
|
} = hot.getSelectedRangeLast();
|
10
|
-
if (
|
10
|
+
if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
|
11
11
|
hot.selection.transformEnd(0, -1 * hot.getDirectionFactor());
|
12
12
|
}
|
13
13
|
}
|
@@ -4,7 +4,7 @@ export const command = {
|
|
4
4
|
const {
|
5
5
|
highlight
|
6
6
|
} = hot.getSelectedRangeLast();
|
7
|
-
if (
|
7
|
+
if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
|
8
8
|
hot.selection.transformEnd(0, -1 * hot.getDirectionFactor());
|
9
9
|
}
|
10
10
|
}
|
@@ -7,7 +7,7 @@ const command = exports.command = {
|
|
7
7
|
const {
|
8
8
|
highlight
|
9
9
|
} = hot.getSelectedRangeLast();
|
10
|
-
if (
|
10
|
+
if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
|
11
11
|
hot.selection.transformEnd(0, hot.getDirectionFactor());
|
12
12
|
}
|
13
13
|
}
|
@@ -4,7 +4,7 @@ export const command = {
|
|
4
4
|
const {
|
5
5
|
highlight
|
6
6
|
} = hot.getSelectedRangeLast();
|
7
|
-
if (
|
7
|
+
if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
|
8
8
|
hot.selection.transformEnd(0, hot.getDirectionFactor());
|
9
9
|
}
|
10
10
|
}
|
@@ -16,9 +16,7 @@ const command = exports.command = {
|
|
16
16
|
const isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByRowHeader();
|
17
17
|
if (highlight.isCell() || isFocusHighlightedByHeader) {
|
18
18
|
const row = rowIndexMapper.getNearestNotHiddenIndex(hot.countRows() - 1, -1);
|
19
|
-
|
20
|
-
newFrom.row = highlight.row;
|
21
|
-
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
19
|
+
selection.setRangeStart(from.clone());
|
22
20
|
|
23
21
|
// Restore the row highlight by header flag after setting up a new selection.
|
24
22
|
if (isFocusHighlightedByHeader) {
|
@@ -13,9 +13,7 @@ export const command = {
|
|
13
13
|
const isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByRowHeader();
|
14
14
|
if (highlight.isCell() || isFocusHighlightedByHeader) {
|
15
15
|
const row = rowIndexMapper.getNearestNotHiddenIndex(hot.countRows() - 1, -1);
|
16
|
-
|
17
|
-
newFrom.row = highlight.row;
|
18
|
-
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
16
|
+
selection.setRangeStart(from.clone());
|
19
17
|
|
20
18
|
// Restore the row highlight by header flag after setting up a new selection.
|
21
19
|
if (isFocusHighlightedByHeader) {
|
@@ -9,16 +9,10 @@ const command = exports.command = {
|
|
9
9
|
columnIndexMapper
|
10
10
|
} = hot;
|
11
11
|
const {
|
12
|
-
highlight
|
13
|
-
from,
|
14
|
-
to
|
12
|
+
highlight
|
15
13
|
} = hot.getSelectedRangeLast();
|
16
|
-
if (
|
17
|
-
|
18
|
-
const newFrom = from.clone();
|
19
|
-
newFrom.col = highlight.col;
|
20
|
-
selection.setRangeStart(newFrom, undefined, false, highlight.clone());
|
21
|
-
selection.setRangeEnd(hot._createCellCoords(to.row, column));
|
14
|
+
if (highlight.isCell()) {
|
15
|
+
selection.setRangeEnd(hot._createCellCoords(selection.selectedRange.current().from.row, columnIndexMapper.getNearestNotHiddenIndex(hot.countCols() - 1, -1)));
|
22
16
|
}
|
23
17
|
}
|
24
18
|
};
|