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
@@ -8,12 +8,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
8
8
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
9
9
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
10
10
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
11
|
-
function
|
12
|
-
function
|
13
|
-
function
|
14
|
-
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
15
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
16
|
-
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; } }
|
11
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
12
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
13
|
+
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"); }
|
17
14
|
/**
|
18
15
|
* The Transformation class implements algorithms for transforming coordinates based on current settings
|
19
16
|
* passed to the Handsontable. The class performs the calculations based on the renderable indexes.
|
@@ -32,77 +29,29 @@ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.
|
|
32
29
|
var _range = /*#__PURE__*/new WeakMap();
|
33
30
|
var _options = /*#__PURE__*/new WeakMap();
|
34
31
|
var _offset = /*#__PURE__*/new WeakMap();
|
35
|
-
var
|
36
|
-
var _getTableSize = /*#__PURE__*/new WeakSet();
|
37
|
-
var _findFirstNonHiddenZeroBasedRow = /*#__PURE__*/new WeakSet();
|
38
|
-
var _findFirstNonHiddenZeroBasedColumn = /*#__PURE__*/new WeakSet();
|
39
|
-
var _visualToZeroBasedCoords = /*#__PURE__*/new WeakSet();
|
40
|
-
var _zeroBasedToVisualCoords = /*#__PURE__*/new WeakSet();
|
32
|
+
var _Transformation_brand = /*#__PURE__*/new WeakSet();
|
41
33
|
class Transformation {
|
42
34
|
constructor(range, options) {
|
43
35
|
/**
|
44
|
-
*
|
36
|
+
* Sets the additional offset in table size that may occur when the `navigableHeaders` option
|
37
|
+
* is enabled.
|
45
38
|
*
|
46
|
-
* @param {
|
47
|
-
* @returns {CellCoords}
|
39
|
+
* @param {{x: number, y: number}} offset Offset as x and y properties.
|
48
40
|
*/
|
49
|
-
_classPrivateMethodInitSpec(this,
|
50
|
-
/**
|
51
|
-
* Translates the visual coordinates to zero-based ones.
|
52
|
-
*
|
53
|
-
* @param {CellCoords} visualCoords The visual coords to process.
|
54
|
-
* @returns {CellCoords}
|
55
|
-
*/
|
56
|
-
_classPrivateMethodInitSpec(this, _visualToZeroBasedCoords);
|
57
|
-
/**
|
58
|
-
* Finds the first non-hidden zero-based column in the table range.
|
59
|
-
*
|
60
|
-
* @param {number} visualColumnFrom The visual column from which the search should start.
|
61
|
-
* @param {number} visualColumnTo The visual column to which the search should end.
|
62
|
-
* @returns {number | null}
|
63
|
-
*/
|
64
|
-
_classPrivateMethodInitSpec(this, _findFirstNonHiddenZeroBasedColumn);
|
65
|
-
/**
|
66
|
-
* Finds the first non-hidden zero-based row in the table range.
|
67
|
-
*
|
68
|
-
* @param {number} visualRowFrom The visual row from which the search should start.
|
69
|
-
* @param {number} visualRowTo The visual row to which the search should end.
|
70
|
-
* @returns {number | null}
|
71
|
-
*/
|
72
|
-
_classPrivateMethodInitSpec(this, _findFirstNonHiddenZeroBasedRow);
|
73
|
-
/**
|
74
|
-
* Gets the table size in number of rows with headers as "height" and number of columns with
|
75
|
-
* headers as "width".
|
76
|
-
*
|
77
|
-
* @returns {{width: number, height: number}}
|
78
|
-
*/
|
79
|
-
_classPrivateMethodInitSpec(this, _getTableSize);
|
80
|
-
/**
|
81
|
-
* Clamps the coords to make sure they points to the cell (or header) in the table range.
|
82
|
-
*
|
83
|
-
* @param {CellCoords} zeroBasedCoords The coords object to clamp.
|
84
|
-
* @returns {{rowDir: 1|0|-1, colDir: 1|0|-1}}
|
85
|
-
*/
|
86
|
-
_classPrivateMethodInitSpec(this, _clampCoords);
|
41
|
+
_classPrivateMethodInitSpec(this, _Transformation_brand);
|
87
42
|
/**
|
88
43
|
* Instance of the SelectionRange, holder for visual coordinates applied to the table.
|
89
44
|
*
|
90
45
|
* @type {SelectionRange}
|
91
46
|
*/
|
92
|
-
_classPrivateFieldInitSpec(this, _range,
|
93
|
-
writable: true,
|
94
|
-
value: void 0
|
95
|
-
});
|
47
|
+
_classPrivateFieldInitSpec(this, _range, void 0);
|
96
48
|
/**
|
97
49
|
* Additional options which define the state of the settings which can infer transformation and
|
98
50
|
* give the possibility to translate indexes.
|
99
51
|
*
|
100
52
|
* @type {object}
|
101
53
|
*/
|
102
|
-
_classPrivateFieldInitSpec(this, _options,
|
103
|
-
writable: true,
|
104
|
-
value: void 0
|
105
|
-
});
|
54
|
+
_classPrivateFieldInitSpec(this, _options, void 0);
|
106
55
|
/**
|
107
56
|
* Increases the table size by applying the offsets. The option is used by the `navigableHeaders`
|
108
57
|
* option.
|
@@ -110,14 +59,11 @@ class Transformation {
|
|
110
59
|
* @type {{ x: number, y: number }}
|
111
60
|
*/
|
112
61
|
_classPrivateFieldInitSpec(this, _offset, {
|
113
|
-
|
114
|
-
|
115
|
-
x: 0,
|
116
|
-
y: 0
|
117
|
-
}
|
62
|
+
x: 0,
|
63
|
+
y: 0
|
118
64
|
});
|
119
|
-
_classPrivateFieldSet(
|
120
|
-
_classPrivateFieldSet(
|
65
|
+
_classPrivateFieldSet(_range, this, range);
|
66
|
+
_classPrivateFieldSet(_options, this, options);
|
121
67
|
}
|
122
68
|
|
123
69
|
/**
|
@@ -131,9 +77,13 @@ class Transformation {
|
|
131
77
|
*/
|
132
78
|
transformStart(rowDelta, colDelta) {
|
133
79
|
let createMissingRecords = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
134
|
-
|
135
|
-
|
136
|
-
|
80
|
+
_assertClassBrand(_Transformation_brand, this, _setOffsetSize).call(this, {
|
81
|
+
x: _classPrivateFieldGet(_options, this).navigableHeaders() ? _classPrivateFieldGet(_options, this).countRowHeaders() : 0,
|
82
|
+
y: _classPrivateFieldGet(_options, this).navigableHeaders() ? _classPrivateFieldGet(_options, this).countColHeaders() : 0
|
83
|
+
});
|
84
|
+
const delta = _classPrivateFieldGet(_options, this).createCellCoords(rowDelta, colDelta);
|
85
|
+
let visualCoords = _classPrivateFieldGet(_range, this).current().highlight;
|
86
|
+
const highlightRenderableCoords = _classPrivateFieldGet(_options, this).visualToRenderableCoords(visualCoords);
|
137
87
|
let rowTransformDir = 0;
|
138
88
|
let colTransformDir = 0;
|
139
89
|
this.runLocalHooks('beforeTransformStart', delta);
|
@@ -141,32 +91,32 @@ class Transformation {
|
|
141
91
|
const {
|
142
92
|
width,
|
143
93
|
height
|
144
|
-
} =
|
94
|
+
} = _assertClassBrand(_Transformation_brand, this, _getTableSize).call(this);
|
145
95
|
const {
|
146
96
|
row,
|
147
97
|
col
|
148
|
-
} =
|
149
|
-
const fixedRowsBottom = _classPrivateFieldGet(
|
150
|
-
const minSpareRows = _classPrivateFieldGet(
|
151
|
-
const minSpareCols = _classPrivateFieldGet(
|
152
|
-
const autoWrapRow = _classPrivateFieldGet(
|
153
|
-
const autoWrapCol = _classPrivateFieldGet(
|
154
|
-
const zeroBasedCoords = _classPrivateFieldGet(
|
98
|
+
} = _assertClassBrand(_Transformation_brand, this, _visualToZeroBasedCoords).call(this, visualCoords);
|
99
|
+
const fixedRowsBottom = _classPrivateFieldGet(_options, this).fixedRowsBottom();
|
100
|
+
const minSpareRows = _classPrivateFieldGet(_options, this).minSpareRows();
|
101
|
+
const minSpareCols = _classPrivateFieldGet(_options, this).minSpareCols();
|
102
|
+
const autoWrapRow = _classPrivateFieldGet(_options, this).autoWrapRow();
|
103
|
+
const autoWrapCol = _classPrivateFieldGet(_options, this).autoWrapCol();
|
104
|
+
const zeroBasedCoords = _classPrivateFieldGet(_options, this).createCellCoords(row + delta.row, col + delta.col);
|
155
105
|
if (zeroBasedCoords.row >= height) {
|
156
106
|
const isActionInterrupted = (0, _object.createObjectPropListener)(createMissingRecords && minSpareRows > 0 && fixedRowsBottom === 0);
|
157
107
|
const nextColumn = zeroBasedCoords.col + 1;
|
158
|
-
const newCoords = _classPrivateFieldGet(
|
159
|
-
this.runLocalHooks('beforeColumnWrap', isActionInterrupted,
|
108
|
+
const newCoords = _classPrivateFieldGet(_options, this).createCellCoords(zeroBasedCoords.row - height, nextColumn >= width ? nextColumn - width : nextColumn);
|
109
|
+
this.runLocalHooks('beforeColumnWrap', isActionInterrupted, _assertClassBrand(_Transformation_brand, this, _zeroBasedToVisualCoords).call(this, newCoords), nextColumn >= width);
|
160
110
|
if (isActionInterrupted.value) {
|
161
|
-
this.runLocalHooks('insertRowRequire', _classPrivateFieldGet(
|
111
|
+
this.runLocalHooks('insertRowRequire', _classPrivateFieldGet(_options, this).countRenderableRows());
|
162
112
|
} else if (autoWrapCol) {
|
163
113
|
zeroBasedCoords.assign(newCoords);
|
164
114
|
}
|
165
115
|
} else if (zeroBasedCoords.row < 0) {
|
166
116
|
const isActionInterrupted = (0, _object.createObjectPropListener)(autoWrapCol);
|
167
117
|
const previousColumn = zeroBasedCoords.col - 1;
|
168
|
-
const newCoords = _classPrivateFieldGet(
|
169
|
-
this.runLocalHooks('beforeColumnWrap', isActionInterrupted,
|
118
|
+
const newCoords = _classPrivateFieldGet(_options, this).createCellCoords(height + zeroBasedCoords.row, previousColumn < 0 ? width + previousColumn : previousColumn);
|
119
|
+
this.runLocalHooks('beforeColumnWrap', isActionInterrupted, _assertClassBrand(_Transformation_brand, this, _zeroBasedToVisualCoords).call(this, newCoords), previousColumn < 0);
|
170
120
|
if (autoWrapCol) {
|
171
121
|
zeroBasedCoords.assign(newCoords);
|
172
122
|
}
|
@@ -174,18 +124,18 @@ class Transformation {
|
|
174
124
|
if (zeroBasedCoords.col >= width) {
|
175
125
|
const isActionInterrupted = (0, _object.createObjectPropListener)(createMissingRecords && minSpareCols > 0);
|
176
126
|
const nextRow = zeroBasedCoords.row + 1;
|
177
|
-
const newCoords = _classPrivateFieldGet(
|
178
|
-
this.runLocalHooks('beforeRowWrap', isActionInterrupted,
|
127
|
+
const newCoords = _classPrivateFieldGet(_options, this).createCellCoords(nextRow >= height ? nextRow - height : nextRow, zeroBasedCoords.col - width);
|
128
|
+
this.runLocalHooks('beforeRowWrap', isActionInterrupted, _assertClassBrand(_Transformation_brand, this, _zeroBasedToVisualCoords).call(this, newCoords), nextRow >= height);
|
179
129
|
if (isActionInterrupted.value) {
|
180
|
-
this.runLocalHooks('insertColRequire', _classPrivateFieldGet(
|
130
|
+
this.runLocalHooks('insertColRequire', _classPrivateFieldGet(_options, this).countRenderableColumns());
|
181
131
|
} else if (autoWrapRow) {
|
182
132
|
zeroBasedCoords.assign(newCoords);
|
183
133
|
}
|
184
134
|
} else if (zeroBasedCoords.col < 0) {
|
185
135
|
const isActionInterrupted = (0, _object.createObjectPropListener)(autoWrapRow);
|
186
136
|
const previousRow = zeroBasedCoords.row - 1;
|
187
|
-
const newCoords = _classPrivateFieldGet(
|
188
|
-
this.runLocalHooks('beforeRowWrap', isActionInterrupted,
|
137
|
+
const newCoords = _classPrivateFieldGet(_options, this).createCellCoords(previousRow < 0 ? height + previousRow : previousRow, width + zeroBasedCoords.col);
|
138
|
+
this.runLocalHooks('beforeRowWrap', isActionInterrupted, _assertClassBrand(_Transformation_brand, this, _zeroBasedToVisualCoords).call(this, newCoords), previousRow < 0);
|
189
139
|
if (autoWrapRow) {
|
190
140
|
zeroBasedCoords.assign(newCoords);
|
191
141
|
}
|
@@ -193,10 +143,10 @@ class Transformation {
|
|
193
143
|
const {
|
194
144
|
rowDir,
|
195
145
|
colDir
|
196
|
-
} =
|
146
|
+
} = _assertClassBrand(_Transformation_brand, this, _clampCoords).call(this, zeroBasedCoords);
|
197
147
|
rowTransformDir = rowDir;
|
198
148
|
colTransformDir = colDir;
|
199
|
-
visualCoords =
|
149
|
+
visualCoords = _assertClassBrand(_Transformation_brand, this, _zeroBasedToVisualCoords).call(this, zeroBasedCoords);
|
200
150
|
}
|
201
151
|
this.runLocalHooks('afterTransformStart', visualCoords, rowTransformDir, colTransformDir);
|
202
152
|
return visualCoords;
|
@@ -210,54 +160,30 @@ class Transformation {
|
|
210
160
|
* @returns {CellCoords} Visual coordinates after transformation.
|
211
161
|
*/
|
212
162
|
transformEnd(rowDelta, colDelta) {
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
const
|
163
|
+
_assertClassBrand(_Transformation_brand, this, _setOffsetSize).call(this, {
|
164
|
+
x: _classPrivateFieldGet(_options, this).navigableHeaders() ? _classPrivateFieldGet(_options, this).countRowHeaders() : 0,
|
165
|
+
y: _classPrivateFieldGet(_options, this).navigableHeaders() ? _classPrivateFieldGet(_options, this).countColHeaders() : 0
|
166
|
+
});
|
167
|
+
const delta = _classPrivateFieldGet(_options, this).createCellCoords(rowDelta, colDelta);
|
168
|
+
const cellRange = _classPrivateFieldGet(_range, this).current();
|
169
|
+
const highlightRenderableCoords = _classPrivateFieldGet(_options, this).visualToRenderableCoords(cellRange.highlight);
|
218
170
|
const visualCoords = cellRange.to.clone();
|
219
171
|
let rowTransformDir = 0;
|
220
172
|
let colTransformDir = 0;
|
221
173
|
this.runLocalHooks('beforeTransformEnd', delta);
|
222
|
-
if (highlightRenderableCoords.row !== null && highlightRenderableCoords.col !== null
|
174
|
+
if (highlightRenderableCoords.row !== null && highlightRenderableCoords.col !== null) {
|
223
175
|
const {
|
224
|
-
row
|
225
|
-
col
|
226
|
-
} =
|
227
|
-
const coords = _classPrivateFieldGet(
|
228
|
-
const restDelta = {
|
229
|
-
row: coords.row - highlightRow,
|
230
|
-
col: coords.col - highlightColumn
|
231
|
-
};
|
232
|
-
this.runLocalHooks('modifyTransformEndRestDelta', restDelta, delta, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, coords));
|
233
|
-
const topStartCorner = cellRange.getTopStartCorner();
|
234
|
-
const topEndCorner = cellRange.getTopEndCorner();
|
235
|
-
const bottomEndCorner = cellRange.getBottomEndCorner();
|
236
|
-
if (delta.col < 0) {
|
237
|
-
if (toColumn >= highlightColumn && coords.col < highlightColumn) {
|
238
|
-
coords.col = _classPrivateMethodGet(this, _findFirstNonHiddenZeroBasedColumn, _findFirstNonHiddenZeroBasedColumn2).call(this, topStartCorner.col, topEndCorner.col) + restDelta.col;
|
239
|
-
}
|
240
|
-
} else if (delta.col > 0) {
|
241
|
-
if (toColumn <= highlightColumn && coords.col > highlightColumn) {
|
242
|
-
coords.col = _classPrivateMethodGet(this, _findFirstNonHiddenZeroBasedColumn, _findFirstNonHiddenZeroBasedColumn2).call(this, topEndCorner.col, topStartCorner.col) + restDelta.col;
|
243
|
-
}
|
244
|
-
}
|
245
|
-
if (delta.row < 0) {
|
246
|
-
if (toRow >= highlightRow && coords.row < highlightRow) {
|
247
|
-
coords.row = _classPrivateMethodGet(this, _findFirstNonHiddenZeroBasedRow, _findFirstNonHiddenZeroBasedRow2).call(this, topStartCorner.row, bottomEndCorner.row) + restDelta.row;
|
248
|
-
}
|
249
|
-
} else if (delta.row > 0) {
|
250
|
-
if (toRow <= highlightRow && coords.row > highlightRow) {
|
251
|
-
coords.row = _classPrivateMethodGet(this, _findFirstNonHiddenZeroBasedRow, _findFirstNonHiddenZeroBasedRow2).call(this, bottomEndCorner.row, topStartCorner.row) + restDelta.row;
|
252
|
-
}
|
253
|
-
}
|
176
|
+
row,
|
177
|
+
col
|
178
|
+
} = _assertClassBrand(_Transformation_brand, this, _visualToZeroBasedCoords).call(this, cellRange.to);
|
179
|
+
const coords = _classPrivateFieldGet(_options, this).createCellCoords(row + delta.row, col + delta.col);
|
254
180
|
const {
|
255
181
|
rowDir,
|
256
182
|
colDir
|
257
|
-
} =
|
183
|
+
} = _assertClassBrand(_Transformation_brand, this, _clampCoords).call(this, coords);
|
258
184
|
rowTransformDir = rowDir;
|
259
185
|
colTransformDir = colDir;
|
260
|
-
const newVisualCoords =
|
186
|
+
const newVisualCoords = _assertClassBrand(_Transformation_brand, this, _zeroBasedToVisualCoords).call(this, coords);
|
261
187
|
if (delta.row === 0 && delta.col !== 0) {
|
262
188
|
visualCoords.col = newVisualCoords.col;
|
263
189
|
} else if (delta.row !== 0 && delta.col === 0) {
|
@@ -270,29 +196,28 @@ class Transformation {
|
|
270
196
|
this.runLocalHooks('afterTransformEnd', visualCoords, rowTransformDir, colTransformDir);
|
271
197
|
return visualCoords;
|
272
198
|
}
|
273
|
-
|
274
|
-
/**
|
275
|
-
* Sets the additional offset in table size that may occur when the `navigableHeaders` option
|
276
|
-
* is enabled.
|
277
|
-
*
|
278
|
-
* @param {{x: number, y: number}} offset Offset as x and y properties.
|
279
|
-
*/
|
280
|
-
setOffsetSize(_ref) {
|
281
|
-
let {
|
282
|
-
x,
|
283
|
-
y
|
284
|
-
} = _ref;
|
285
|
-
_classPrivateFieldSet(this, _offset, {
|
286
|
-
x,
|
287
|
-
y
|
288
|
-
});
|
289
|
-
}
|
290
199
|
}
|
291
|
-
function
|
200
|
+
function _setOffsetSize(_ref) {
|
201
|
+
let {
|
202
|
+
x,
|
203
|
+
y
|
204
|
+
} = _ref;
|
205
|
+
_classPrivateFieldSet(_offset, this, {
|
206
|
+
x,
|
207
|
+
y
|
208
|
+
});
|
209
|
+
}
|
210
|
+
/**
|
211
|
+
* Clamps the coords to make sure they points to the cell (or header) in the table range.
|
212
|
+
*
|
213
|
+
* @param {CellCoords} zeroBasedCoords The coords object to clamp.
|
214
|
+
* @returns {{rowDir: 1|0|-1, colDir: 1|0|-1}}
|
215
|
+
*/
|
216
|
+
function _clampCoords(zeroBasedCoords) {
|
292
217
|
const {
|
293
218
|
width,
|
294
219
|
height
|
295
|
-
} =
|
220
|
+
} = _assertClassBrand(_Transformation_brand, this, _getTableSize).call(this);
|
296
221
|
let rowDir = 0;
|
297
222
|
let colDir = 0;
|
298
223
|
if (zeroBasedCoords.row < 0) {
|
@@ -314,41 +239,42 @@ function _clampCoords2(zeroBasedCoords) {
|
|
314
239
|
colDir
|
315
240
|
};
|
316
241
|
}
|
317
|
-
|
242
|
+
/**
|
243
|
+
* Gets the table size in number of rows with headers as "height" and number of columns with
|
244
|
+
* headers as "width".
|
245
|
+
*
|
246
|
+
* @returns {{width: number, height: number}}
|
247
|
+
*/
|
248
|
+
function _getTableSize() {
|
318
249
|
return {
|
319
|
-
width: _classPrivateFieldGet(
|
320
|
-
height: _classPrivateFieldGet(
|
250
|
+
width: _classPrivateFieldGet(_offset, this).x + _classPrivateFieldGet(_options, this).countRenderableColumns(),
|
251
|
+
height: _classPrivateFieldGet(_offset, this).y + _classPrivateFieldGet(_options, this).countRenderableRows()
|
321
252
|
};
|
322
253
|
}
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
function _findFirstNonHiddenZeroBasedColumn2(visualColumnFrom, visualColumnTo) {
|
331
|
-
const column = _classPrivateFieldGet(this, _options).findFirstNonHiddenRenderableColumn(visualColumnFrom, visualColumnTo);
|
332
|
-
if (column === null) {
|
333
|
-
return null;
|
334
|
-
}
|
335
|
-
return _classPrivateFieldGet(this, _offset).x + column;
|
336
|
-
}
|
337
|
-
function _visualToZeroBasedCoords2(visualCoords) {
|
254
|
+
/**
|
255
|
+
* Translates the visual coordinates to zero-based ones.
|
256
|
+
*
|
257
|
+
* @param {CellCoords} visualCoords The visual coords to process.
|
258
|
+
* @returns {CellCoords}
|
259
|
+
*/
|
260
|
+
function _visualToZeroBasedCoords(visualCoords) {
|
338
261
|
const {
|
339
262
|
row,
|
340
263
|
col
|
341
|
-
} = _classPrivateFieldGet(
|
342
|
-
|
343
|
-
throw new Error('Renderable coords are not visible.');
|
344
|
-
}
|
345
|
-
return _classPrivateFieldGet(this, _options).createCellCoords(_classPrivateFieldGet(this, _offset).y + row, _classPrivateFieldGet(this, _offset).x + col);
|
264
|
+
} = _classPrivateFieldGet(_options, this).visualToRenderableCoords(visualCoords);
|
265
|
+
return _classPrivateFieldGet(_options, this).createCellCoords(_classPrivateFieldGet(_offset, this).y + row, _classPrivateFieldGet(_offset, this).x + col);
|
346
266
|
}
|
347
|
-
|
267
|
+
/**
|
268
|
+
* Translates the zero-based coordinates to visual ones.
|
269
|
+
*
|
270
|
+
* @param {CellCoords} zeroBasedCoords The coordinates to process.
|
271
|
+
* @returns {CellCoords}
|
272
|
+
*/
|
273
|
+
function _zeroBasedToVisualCoords(zeroBasedCoords) {
|
348
274
|
const coords = zeroBasedCoords.clone();
|
349
|
-
coords.col = zeroBasedCoords.col - _classPrivateFieldGet(
|
350
|
-
coords.row = zeroBasedCoords.row - _classPrivateFieldGet(
|
351
|
-
return _classPrivateFieldGet(
|
275
|
+
coords.col = zeroBasedCoords.col - _classPrivateFieldGet(_offset, this).x;
|
276
|
+
coords.row = zeroBasedCoords.row - _classPrivateFieldGet(_offset, this).y;
|
277
|
+
return _classPrivateFieldGet(_options, this).renderableToVisualCoords(coords);
|
352
278
|
}
|
353
279
|
(0, _object.mixin)(Transformation, _localHooks.default);
|
354
280
|
var _default = exports.default = Transformation;
|