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
@@ -1,15 +1,17 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
5
4
|
require("core-js/modules/es.array.push.js");
|
5
|
+
require("core-js/modules/es.error.cause.js");
|
6
6
|
var _string = require("../../../helpers/string");
|
7
7
|
var _moves = require("../../../helpers/moves");
|
8
8
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
9
9
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
10
|
-
function _classPrivateFieldGet(
|
11
|
-
function
|
12
|
-
function
|
10
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
11
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
12
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
13
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
14
|
+
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; } }
|
13
15
|
/**
|
14
16
|
* @private
|
15
17
|
* @class IndexSyncer
|
@@ -34,52 +36,73 @@ class AxisSyncer {
|
|
34
36
|
* @private
|
35
37
|
* @type {'row'|'column'}
|
36
38
|
*/
|
37
|
-
_classPrivateFieldInitSpec(this, _axis,
|
39
|
+
_classPrivateFieldInitSpec(this, _axis, {
|
40
|
+
writable: true,
|
41
|
+
value: void 0
|
42
|
+
});
|
38
43
|
/**
|
39
44
|
* Reference to index mapper.
|
40
45
|
*
|
41
46
|
* @private
|
42
47
|
* @type {IndexMapper}
|
43
48
|
*/
|
44
|
-
_classPrivateFieldInitSpec(this, _indexMapper,
|
49
|
+
_classPrivateFieldInitSpec(this, _indexMapper, {
|
50
|
+
writable: true,
|
51
|
+
value: void 0
|
52
|
+
});
|
45
53
|
/**
|
46
54
|
* The index synchronizer for both axis (is storing some more general information).
|
47
55
|
*
|
48
56
|
* @private
|
49
57
|
* @type {IndexSyncer}
|
50
58
|
*/
|
51
|
-
_classPrivateFieldInitSpec(this, _indexSyncer,
|
59
|
+
_classPrivateFieldInitSpec(this, _indexSyncer, {
|
60
|
+
writable: true,
|
61
|
+
value: void 0
|
62
|
+
});
|
52
63
|
/**
|
53
64
|
* Sequence of physical indexes stored for watching changes and calculating some transformations.
|
54
65
|
*
|
55
66
|
* @private
|
56
67
|
* @type {Array<number>}
|
57
68
|
*/
|
58
|
-
_classPrivateFieldInitSpec(this, _indexesSequence,
|
69
|
+
_classPrivateFieldInitSpec(this, _indexesSequence, {
|
70
|
+
writable: true,
|
71
|
+
value: []
|
72
|
+
});
|
59
73
|
/**
|
60
74
|
* List of moved HF indexes, stored before performing move on HOT to calculate transformation needed on HF's engine.
|
61
75
|
*
|
62
76
|
* @private
|
63
77
|
* @type {Array<number>}
|
64
78
|
*/
|
65
|
-
_classPrivateFieldInitSpec(this, _movedIndexes,
|
79
|
+
_classPrivateFieldInitSpec(this, _movedIndexes, {
|
80
|
+
writable: true,
|
81
|
+
value: []
|
82
|
+
});
|
66
83
|
/**
|
67
84
|
* Final HF's place where to move indexes, stored before performing move on HOT to calculate transformation needed on HF's engine.
|
68
85
|
*
|
69
86
|
* @private
|
70
87
|
* @type {number|undefined}
|
71
88
|
*/
|
72
|
-
_classPrivateFieldInitSpec(this, _finalIndex,
|
89
|
+
_classPrivateFieldInitSpec(this, _finalIndex, {
|
90
|
+
writable: true,
|
91
|
+
value: void 0
|
92
|
+
});
|
73
93
|
/**
|
74
94
|
* List of removed HF indexes, stored before performing removal on HOT to calculate transformation needed on HF's engine.
|
75
95
|
*
|
76
96
|
* @private
|
77
97
|
* @type {Array<number>}
|
78
98
|
*/
|
79
|
-
_classPrivateFieldInitSpec(this, _removedIndexes,
|
80
|
-
|
81
|
-
|
82
|
-
|
99
|
+
_classPrivateFieldInitSpec(this, _removedIndexes, {
|
100
|
+
writable: true,
|
101
|
+
value: []
|
102
|
+
});
|
103
|
+
_classPrivateFieldSet(this, _axis, axis);
|
104
|
+
_classPrivateFieldSet(this, _indexMapper, indexMapper);
|
105
|
+
_classPrivateFieldSet(this, _indexSyncer, indexSyncer);
|
83
106
|
}
|
84
107
|
|
85
108
|
/**
|
@@ -89,11 +112,11 @@ class AxisSyncer {
|
|
89
112
|
* @returns {Array<number>} List of removed visual indexes.
|
90
113
|
*/
|
91
114
|
setRemovedHfIndexes(removedIndexes) {
|
92
|
-
_classPrivateFieldSet(
|
93
|
-
const visualIndex = _classPrivateFieldGet(
|
115
|
+
_classPrivateFieldSet(this, _removedIndexes, removedIndexes.map(physicalIndex => {
|
116
|
+
const visualIndex = _classPrivateFieldGet(this, _indexMapper).getVisualFromPhysicalIndex(physicalIndex);
|
94
117
|
return this.getHfIndexFromVisualIndex(visualIndex);
|
95
118
|
}));
|
96
|
-
return _classPrivateFieldGet(
|
119
|
+
return _classPrivateFieldGet(this, _removedIndexes);
|
97
120
|
}
|
98
121
|
|
99
122
|
/**
|
@@ -102,7 +125,7 @@ class AxisSyncer {
|
|
102
125
|
* @returns {Array<number>} List of removed HF indexes.
|
103
126
|
*/
|
104
127
|
getRemovedHfIndexes() {
|
105
|
-
return _classPrivateFieldGet(
|
128
|
+
return _classPrivateFieldGet(this, _removedIndexes);
|
106
129
|
}
|
107
130
|
|
108
131
|
/**
|
@@ -113,8 +136,8 @@ class AxisSyncer {
|
|
113
136
|
* @returns {number}
|
114
137
|
*/
|
115
138
|
getHfIndexFromVisualIndex(visualIndex) {
|
116
|
-
const indexesSequence = _classPrivateFieldGet(
|
117
|
-
const notTrimmedIndexes = _classPrivateFieldGet(
|
139
|
+
const indexesSequence = _classPrivateFieldGet(this, _indexMapper).getIndexesSequence();
|
140
|
+
const notTrimmedIndexes = _classPrivateFieldGet(this, _indexMapper).getNotTrimmedIndexes();
|
118
141
|
return indexesSequence.indexOf(notTrimmedIndexes[visualIndex]);
|
119
142
|
}
|
120
143
|
|
@@ -126,14 +149,14 @@ class AxisSyncer {
|
|
126
149
|
*/
|
127
150
|
syncMoves(moves) {
|
128
151
|
const NUMBER_OF_MOVED_INDEXES = 1;
|
129
|
-
const SYNC_MOVE_METHOD_NAME = `move${(0, _string.toUpperCaseFirst)(_classPrivateFieldGet(
|
130
|
-
_classPrivateFieldGet(
|
152
|
+
const SYNC_MOVE_METHOD_NAME = `move${(0, _string.toUpperCaseFirst)(_classPrivateFieldGet(this, _axis))}s`;
|
153
|
+
_classPrivateFieldGet(this, _indexSyncer).getEngine().batch(() => {
|
131
154
|
moves.forEach(move => {
|
132
155
|
const moveToTheSamePosition = move.from !== move.to;
|
133
156
|
// Moving from left to right (or top to bottom) to a line (drop index) right after already moved element.
|
134
157
|
const anotherMoveWithoutEffect = move.from + 1 !== move.to;
|
135
158
|
if (moveToTheSamePosition && anotherMoveWithoutEffect) {
|
136
|
-
_classPrivateFieldGet(
|
159
|
+
_classPrivateFieldGet(this, _indexSyncer).getEngine()[SYNC_MOVE_METHOD_NAME](_classPrivateFieldGet(this, _indexSyncer).getSheetId(), move.from, NUMBER_OF_MOVED_INDEXES, move.to);
|
137
160
|
}
|
138
161
|
});
|
139
162
|
});
|
@@ -150,8 +173,8 @@ class AxisSyncer {
|
|
150
173
|
if (movePossible === false) {
|
151
174
|
return;
|
152
175
|
}
|
153
|
-
_classPrivateFieldSet(
|
154
|
-
_classPrivateFieldSet(
|
176
|
+
_classPrivateFieldSet(this, _movedIndexes, movedVisualIndexes.map(index => this.getHfIndexFromVisualIndex(index)));
|
177
|
+
_classPrivateFieldSet(this, _finalIndex, this.getHfIndexFromVisualIndex(visualFinalIndex));
|
155
178
|
}
|
156
179
|
|
157
180
|
/**
|
@@ -161,15 +184,15 @@ class AxisSyncer {
|
|
161
184
|
* @param {boolean} orderChanged Indicates if order of HOT indexes was changed by move.
|
162
185
|
*/
|
163
186
|
calculateAndSyncMoves(movePossible, orderChanged) {
|
164
|
-
if (_classPrivateFieldGet(
|
187
|
+
if (_classPrivateFieldGet(this, _indexSyncer).isPerformingUndoRedo()) {
|
165
188
|
return;
|
166
189
|
}
|
167
190
|
if (movePossible === false || orderChanged === false) {
|
168
191
|
return;
|
169
192
|
}
|
170
|
-
const calculatedMoves = (0, _moves.getMoves)(_classPrivateFieldGet(
|
171
|
-
if (_classPrivateFieldGet(
|
172
|
-
_classPrivateFieldGet(
|
193
|
+
const calculatedMoves = (0, _moves.getMoves)(_classPrivateFieldGet(this, _movedIndexes), _classPrivateFieldGet(this, _finalIndex), _classPrivateFieldGet(this, _indexMapper).getNumberOfIndexes());
|
194
|
+
if (_classPrivateFieldGet(this, _indexSyncer).getSheetId() === null) {
|
195
|
+
_classPrivateFieldGet(this, _indexSyncer).getPostponeAction(() => this.syncMoves(calculatedMoves));
|
173
196
|
} else {
|
174
197
|
this.syncMoves(calculatedMoves);
|
175
198
|
}
|
@@ -181,17 +204,17 @@ class AxisSyncer {
|
|
181
204
|
* @returns {Function}
|
182
205
|
*/
|
183
206
|
getIndexesChangeSyncMethod() {
|
184
|
-
const SYNC_ORDER_CHANGE_METHOD_NAME = `set${(0, _string.toUpperCaseFirst)(_classPrivateFieldGet(
|
207
|
+
const SYNC_ORDER_CHANGE_METHOD_NAME = `set${(0, _string.toUpperCaseFirst)(_classPrivateFieldGet(this, _axis))}Order`;
|
185
208
|
return source => {
|
186
|
-
if (_classPrivateFieldGet(
|
209
|
+
if (_classPrivateFieldGet(this, _indexSyncer).isPerformingUndoRedo()) {
|
187
210
|
return;
|
188
211
|
}
|
189
|
-
const newSequence = _classPrivateFieldGet(
|
212
|
+
const newSequence = _classPrivateFieldGet(this, _indexMapper).getIndexesSequence();
|
190
213
|
if (source === 'update' && newSequence.length > 0) {
|
191
|
-
const relativeTransformation = _classPrivateFieldGet(
|
192
|
-
const sheetDimensions = _classPrivateFieldGet(
|
214
|
+
const relativeTransformation = _classPrivateFieldGet(this, _indexesSequence).map(index => newSequence.indexOf(index));
|
215
|
+
const sheetDimensions = _classPrivateFieldGet(this, _indexSyncer).getEngine().getSheetDimensions(_classPrivateFieldGet(this, _indexSyncer).getSheetId());
|
193
216
|
let sizeForAxis;
|
194
|
-
if (_classPrivateFieldGet(
|
217
|
+
if (_classPrivateFieldGet(this, _axis) === 'row') {
|
195
218
|
sizeForAxis = sheetDimensions.height;
|
196
219
|
} else {
|
197
220
|
sizeForAxis = sheetDimensions.width;
|
@@ -204,9 +227,9 @@ class AxisSyncer {
|
|
204
227
|
for (let i = numberOfReorganisedIndexes; i < sizeForAxis; i += 1) {
|
205
228
|
relativeTransformation.push(i);
|
206
229
|
}
|
207
|
-
_classPrivateFieldGet(
|
230
|
+
_classPrivateFieldGet(this, _indexSyncer).getEngine()[SYNC_ORDER_CHANGE_METHOD_NAME](_classPrivateFieldGet(this, _indexSyncer).getSheetId(), relativeTransformation);
|
208
231
|
}
|
209
|
-
_classPrivateFieldSet(
|
232
|
+
_classPrivateFieldSet(this, _indexesSequence, newSequence);
|
210
233
|
};
|
211
234
|
}
|
212
235
|
|
@@ -214,7 +237,7 @@ class AxisSyncer {
|
|
214
237
|
* Initialize the AxisSyncer.
|
215
238
|
*/
|
216
239
|
init() {
|
217
|
-
_classPrivateFieldSet(
|
240
|
+
_classPrivateFieldSet(this, _indexesSequence, _classPrivateFieldGet(this, _indexMapper).getIndexesSequence());
|
218
241
|
}
|
219
242
|
}
|
220
243
|
var _default = exports.default = AxisSyncer;
|
@@ -1,10 +1,12 @@
|
|
1
|
-
import "core-js/modules/es.error.cause.js";
|
2
1
|
import "core-js/modules/es.array.push.js";
|
2
|
+
import "core-js/modules/es.error.cause.js";
|
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 _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
8
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
9
|
+
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
10
|
import { toUpperCaseFirst } from "../../../helpers/string.mjs";
|
9
11
|
import { getMoves } from "../../../helpers/moves.mjs";
|
10
12
|
/**
|
@@ -31,52 +33,73 @@ class AxisSyncer {
|
|
31
33
|
* @private
|
32
34
|
* @type {'row'|'column'}
|
33
35
|
*/
|
34
|
-
_classPrivateFieldInitSpec(this, _axis,
|
36
|
+
_classPrivateFieldInitSpec(this, _axis, {
|
37
|
+
writable: true,
|
38
|
+
value: void 0
|
39
|
+
});
|
35
40
|
/**
|
36
41
|
* Reference to index mapper.
|
37
42
|
*
|
38
43
|
* @private
|
39
44
|
* @type {IndexMapper}
|
40
45
|
*/
|
41
|
-
_classPrivateFieldInitSpec(this, _indexMapper,
|
46
|
+
_classPrivateFieldInitSpec(this, _indexMapper, {
|
47
|
+
writable: true,
|
48
|
+
value: void 0
|
49
|
+
});
|
42
50
|
/**
|
43
51
|
* The index synchronizer for both axis (is storing some more general information).
|
44
52
|
*
|
45
53
|
* @private
|
46
54
|
* @type {IndexSyncer}
|
47
55
|
*/
|
48
|
-
_classPrivateFieldInitSpec(this, _indexSyncer,
|
56
|
+
_classPrivateFieldInitSpec(this, _indexSyncer, {
|
57
|
+
writable: true,
|
58
|
+
value: void 0
|
59
|
+
});
|
49
60
|
/**
|
50
61
|
* Sequence of physical indexes stored for watching changes and calculating some transformations.
|
51
62
|
*
|
52
63
|
* @private
|
53
64
|
* @type {Array<number>}
|
54
65
|
*/
|
55
|
-
_classPrivateFieldInitSpec(this, _indexesSequence,
|
66
|
+
_classPrivateFieldInitSpec(this, _indexesSequence, {
|
67
|
+
writable: true,
|
68
|
+
value: []
|
69
|
+
});
|
56
70
|
/**
|
57
71
|
* List of moved HF indexes, stored before performing move on HOT to calculate transformation needed on HF's engine.
|
58
72
|
*
|
59
73
|
* @private
|
60
74
|
* @type {Array<number>}
|
61
75
|
*/
|
62
|
-
_classPrivateFieldInitSpec(this, _movedIndexes,
|
76
|
+
_classPrivateFieldInitSpec(this, _movedIndexes, {
|
77
|
+
writable: true,
|
78
|
+
value: []
|
79
|
+
});
|
63
80
|
/**
|
64
81
|
* Final HF's place where to move indexes, stored before performing move on HOT to calculate transformation needed on HF's engine.
|
65
82
|
*
|
66
83
|
* @private
|
67
84
|
* @type {number|undefined}
|
68
85
|
*/
|
69
|
-
_classPrivateFieldInitSpec(this, _finalIndex,
|
86
|
+
_classPrivateFieldInitSpec(this, _finalIndex, {
|
87
|
+
writable: true,
|
88
|
+
value: void 0
|
89
|
+
});
|
70
90
|
/**
|
71
91
|
* List of removed HF indexes, stored before performing removal on HOT to calculate transformation needed on HF's engine.
|
72
92
|
*
|
73
93
|
* @private
|
74
94
|
* @type {Array<number>}
|
75
95
|
*/
|
76
|
-
_classPrivateFieldInitSpec(this, _removedIndexes,
|
77
|
-
|
78
|
-
|
79
|
-
|
96
|
+
_classPrivateFieldInitSpec(this, _removedIndexes, {
|
97
|
+
writable: true,
|
98
|
+
value: []
|
99
|
+
});
|
100
|
+
_classPrivateFieldSet(this, _axis, axis);
|
101
|
+
_classPrivateFieldSet(this, _indexMapper, indexMapper);
|
102
|
+
_classPrivateFieldSet(this, _indexSyncer, indexSyncer);
|
80
103
|
}
|
81
104
|
|
82
105
|
/**
|
@@ -86,11 +109,11 @@ class AxisSyncer {
|
|
86
109
|
* @returns {Array<number>} List of removed visual indexes.
|
87
110
|
*/
|
88
111
|
setRemovedHfIndexes(removedIndexes) {
|
89
|
-
_classPrivateFieldSet(
|
90
|
-
const visualIndex = _classPrivateFieldGet(
|
112
|
+
_classPrivateFieldSet(this, _removedIndexes, removedIndexes.map(physicalIndex => {
|
113
|
+
const visualIndex = _classPrivateFieldGet(this, _indexMapper).getVisualFromPhysicalIndex(physicalIndex);
|
91
114
|
return this.getHfIndexFromVisualIndex(visualIndex);
|
92
115
|
}));
|
93
|
-
return _classPrivateFieldGet(
|
116
|
+
return _classPrivateFieldGet(this, _removedIndexes);
|
94
117
|
}
|
95
118
|
|
96
119
|
/**
|
@@ -99,7 +122,7 @@ class AxisSyncer {
|
|
99
122
|
* @returns {Array<number>} List of removed HF indexes.
|
100
123
|
*/
|
101
124
|
getRemovedHfIndexes() {
|
102
|
-
return _classPrivateFieldGet(
|
125
|
+
return _classPrivateFieldGet(this, _removedIndexes);
|
103
126
|
}
|
104
127
|
|
105
128
|
/**
|
@@ -110,8 +133,8 @@ class AxisSyncer {
|
|
110
133
|
* @returns {number}
|
111
134
|
*/
|
112
135
|
getHfIndexFromVisualIndex(visualIndex) {
|
113
|
-
const indexesSequence = _classPrivateFieldGet(
|
114
|
-
const notTrimmedIndexes = _classPrivateFieldGet(
|
136
|
+
const indexesSequence = _classPrivateFieldGet(this, _indexMapper).getIndexesSequence();
|
137
|
+
const notTrimmedIndexes = _classPrivateFieldGet(this, _indexMapper).getNotTrimmedIndexes();
|
115
138
|
return indexesSequence.indexOf(notTrimmedIndexes[visualIndex]);
|
116
139
|
}
|
117
140
|
|
@@ -123,14 +146,14 @@ class AxisSyncer {
|
|
123
146
|
*/
|
124
147
|
syncMoves(moves) {
|
125
148
|
const NUMBER_OF_MOVED_INDEXES = 1;
|
126
|
-
const SYNC_MOVE_METHOD_NAME = `move${toUpperCaseFirst(_classPrivateFieldGet(
|
127
|
-
_classPrivateFieldGet(
|
149
|
+
const SYNC_MOVE_METHOD_NAME = `move${toUpperCaseFirst(_classPrivateFieldGet(this, _axis))}s`;
|
150
|
+
_classPrivateFieldGet(this, _indexSyncer).getEngine().batch(() => {
|
128
151
|
moves.forEach(move => {
|
129
152
|
const moveToTheSamePosition = move.from !== move.to;
|
130
153
|
// Moving from left to right (or top to bottom) to a line (drop index) right after already moved element.
|
131
154
|
const anotherMoveWithoutEffect = move.from + 1 !== move.to;
|
132
155
|
if (moveToTheSamePosition && anotherMoveWithoutEffect) {
|
133
|
-
_classPrivateFieldGet(
|
156
|
+
_classPrivateFieldGet(this, _indexSyncer).getEngine()[SYNC_MOVE_METHOD_NAME](_classPrivateFieldGet(this, _indexSyncer).getSheetId(), move.from, NUMBER_OF_MOVED_INDEXES, move.to);
|
134
157
|
}
|
135
158
|
});
|
136
159
|
});
|
@@ -147,8 +170,8 @@ class AxisSyncer {
|
|
147
170
|
if (movePossible === false) {
|
148
171
|
return;
|
149
172
|
}
|
150
|
-
_classPrivateFieldSet(
|
151
|
-
_classPrivateFieldSet(
|
173
|
+
_classPrivateFieldSet(this, _movedIndexes, movedVisualIndexes.map(index => this.getHfIndexFromVisualIndex(index)));
|
174
|
+
_classPrivateFieldSet(this, _finalIndex, this.getHfIndexFromVisualIndex(visualFinalIndex));
|
152
175
|
}
|
153
176
|
|
154
177
|
/**
|
@@ -158,15 +181,15 @@ class AxisSyncer {
|
|
158
181
|
* @param {boolean} orderChanged Indicates if order of HOT indexes was changed by move.
|
159
182
|
*/
|
160
183
|
calculateAndSyncMoves(movePossible, orderChanged) {
|
161
|
-
if (_classPrivateFieldGet(
|
184
|
+
if (_classPrivateFieldGet(this, _indexSyncer).isPerformingUndoRedo()) {
|
162
185
|
return;
|
163
186
|
}
|
164
187
|
if (movePossible === false || orderChanged === false) {
|
165
188
|
return;
|
166
189
|
}
|
167
|
-
const calculatedMoves = getMoves(_classPrivateFieldGet(
|
168
|
-
if (_classPrivateFieldGet(
|
169
|
-
_classPrivateFieldGet(
|
190
|
+
const calculatedMoves = getMoves(_classPrivateFieldGet(this, _movedIndexes), _classPrivateFieldGet(this, _finalIndex), _classPrivateFieldGet(this, _indexMapper).getNumberOfIndexes());
|
191
|
+
if (_classPrivateFieldGet(this, _indexSyncer).getSheetId() === null) {
|
192
|
+
_classPrivateFieldGet(this, _indexSyncer).getPostponeAction(() => this.syncMoves(calculatedMoves));
|
170
193
|
} else {
|
171
194
|
this.syncMoves(calculatedMoves);
|
172
195
|
}
|
@@ -178,17 +201,17 @@ class AxisSyncer {
|
|
178
201
|
* @returns {Function}
|
179
202
|
*/
|
180
203
|
getIndexesChangeSyncMethod() {
|
181
|
-
const SYNC_ORDER_CHANGE_METHOD_NAME = `set${toUpperCaseFirst(_classPrivateFieldGet(
|
204
|
+
const SYNC_ORDER_CHANGE_METHOD_NAME = `set${toUpperCaseFirst(_classPrivateFieldGet(this, _axis))}Order`;
|
182
205
|
return source => {
|
183
|
-
if (_classPrivateFieldGet(
|
206
|
+
if (_classPrivateFieldGet(this, _indexSyncer).isPerformingUndoRedo()) {
|
184
207
|
return;
|
185
208
|
}
|
186
|
-
const newSequence = _classPrivateFieldGet(
|
209
|
+
const newSequence = _classPrivateFieldGet(this, _indexMapper).getIndexesSequence();
|
187
210
|
if (source === 'update' && newSequence.length > 0) {
|
188
|
-
const relativeTransformation = _classPrivateFieldGet(
|
189
|
-
const sheetDimensions = _classPrivateFieldGet(
|
211
|
+
const relativeTransformation = _classPrivateFieldGet(this, _indexesSequence).map(index => newSequence.indexOf(index));
|
212
|
+
const sheetDimensions = _classPrivateFieldGet(this, _indexSyncer).getEngine().getSheetDimensions(_classPrivateFieldGet(this, _indexSyncer).getSheetId());
|
190
213
|
let sizeForAxis;
|
191
|
-
if (_classPrivateFieldGet(
|
214
|
+
if (_classPrivateFieldGet(this, _axis) === 'row') {
|
192
215
|
sizeForAxis = sheetDimensions.height;
|
193
216
|
} else {
|
194
217
|
sizeForAxis = sheetDimensions.width;
|
@@ -201,9 +224,9 @@ class AxisSyncer {
|
|
201
224
|
for (let i = numberOfReorganisedIndexes; i < sizeForAxis; i += 1) {
|
202
225
|
relativeTransformation.push(i);
|
203
226
|
}
|
204
|
-
_classPrivateFieldGet(
|
227
|
+
_classPrivateFieldGet(this, _indexSyncer).getEngine()[SYNC_ORDER_CHANGE_METHOD_NAME](_classPrivateFieldGet(this, _indexSyncer).getSheetId(), relativeTransformation);
|
205
228
|
}
|
206
|
-
_classPrivateFieldSet(
|
229
|
+
_classPrivateFieldSet(this, _indexesSequence, newSequence);
|
207
230
|
};
|
208
231
|
}
|
209
232
|
|
@@ -211,7 +234,7 @@ class AxisSyncer {
|
|
211
234
|
* Initialize the AxisSyncer.
|
212
235
|
*/
|
213
236
|
init() {
|
214
|
-
_classPrivateFieldSet(
|
237
|
+
_classPrivateFieldSet(this, _indexesSequence, _classPrivateFieldGet(this, _indexMapper).getIndexesSequence());
|
215
238
|
}
|
216
239
|
}
|
217
240
|
export default AxisSyncer;
|
@@ -6,9 +6,11 @@ var _axisSyncer = _interopRequireDefault(require("./axisSyncer"));
|
|
6
6
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
7
7
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
8
8
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
9
|
-
function _classPrivateFieldGet(
|
10
|
-
function
|
11
|
-
function
|
9
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
10
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
11
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
12
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
13
|
+
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; } }
|
12
14
|
/**
|
13
15
|
* @private
|
14
16
|
* @class IndexSyncer
|
@@ -33,52 +35,73 @@ class IndexSyncer {
|
|
33
35
|
* @private
|
34
36
|
* @type {AxisSyncer}
|
35
37
|
*/
|
36
|
-
_classPrivateFieldInitSpec(this, _rowIndexSyncer,
|
38
|
+
_classPrivateFieldInitSpec(this, _rowIndexSyncer, {
|
39
|
+
writable: true,
|
40
|
+
value: void 0
|
41
|
+
});
|
37
42
|
/**
|
38
43
|
* Indexes synchronizer for the axis of the columns.
|
39
44
|
*
|
40
45
|
* @private
|
41
46
|
* @type {AxisSyncer}
|
42
47
|
*/
|
43
|
-
_classPrivateFieldInitSpec(this, _columnIndexSyncer,
|
48
|
+
_classPrivateFieldInitSpec(this, _columnIndexSyncer, {
|
49
|
+
writable: true,
|
50
|
+
value: void 0
|
51
|
+
});
|
44
52
|
/**
|
45
53
|
* Method which will postpone execution of some action (needed when synchronization endpoint isn't setup yet).
|
46
54
|
*
|
47
55
|
* @private
|
48
56
|
* @type {Function}
|
49
57
|
*/
|
50
|
-
_classPrivateFieldInitSpec(this, _postponeAction,
|
58
|
+
_classPrivateFieldInitSpec(this, _postponeAction, {
|
59
|
+
writable: true,
|
60
|
+
value: void 0
|
61
|
+
});
|
51
62
|
/**
|
52
63
|
* Flag informing whether undo is already performed (we don't perform synchronization in such case).
|
53
64
|
*
|
54
65
|
* @private
|
55
66
|
* @type {boolean}
|
56
67
|
*/
|
57
|
-
_classPrivateFieldInitSpec(this, _isPerformingUndo,
|
68
|
+
_classPrivateFieldInitSpec(this, _isPerformingUndo, {
|
69
|
+
writable: true,
|
70
|
+
value: false
|
71
|
+
});
|
58
72
|
/**
|
59
73
|
* Flag informing whether redo is already performed (we don't perform synchronization in such case).
|
60
74
|
*
|
61
75
|
* @private
|
62
76
|
* @type {boolean}
|
63
77
|
*/
|
64
|
-
_classPrivateFieldInitSpec(this, _isPerformingRedo,
|
78
|
+
_classPrivateFieldInitSpec(this, _isPerformingRedo, {
|
79
|
+
writable: true,
|
80
|
+
value: false
|
81
|
+
});
|
65
82
|
/**
|
66
83
|
* The HF's engine instance which will be synced.
|
67
84
|
*
|
68
85
|
* @private
|
69
86
|
* @type {HyperFormula|null}
|
70
87
|
*/
|
71
|
-
_classPrivateFieldInitSpec(this, _engine,
|
88
|
+
_classPrivateFieldInitSpec(this, _engine, {
|
89
|
+
writable: true,
|
90
|
+
value: null
|
91
|
+
});
|
72
92
|
/**
|
73
93
|
* HyperFormula's sheet name.
|
74
94
|
*
|
75
95
|
* @private
|
76
96
|
* @type {string|null}
|
77
97
|
*/
|
78
|
-
_classPrivateFieldInitSpec(this, _sheetId,
|
79
|
-
|
80
|
-
|
81
|
-
|
98
|
+
_classPrivateFieldInitSpec(this, _sheetId, {
|
99
|
+
writable: true,
|
100
|
+
value: null
|
101
|
+
});
|
102
|
+
_classPrivateFieldSet(this, _rowIndexSyncer, new _axisSyncer.default('row', rowIndexMapper, this));
|
103
|
+
_classPrivateFieldSet(this, _columnIndexSyncer, new _axisSyncer.default('column', columnIndexMapper, this));
|
104
|
+
_classPrivateFieldSet(this, _postponeAction, postponeAction);
|
82
105
|
}
|
83
106
|
|
84
107
|
/**
|
@@ -89,9 +112,9 @@ class IndexSyncer {
|
|
89
112
|
*/
|
90
113
|
getForAxis(indexType) {
|
91
114
|
if (indexType === 'row') {
|
92
|
-
return _classPrivateFieldGet(
|
115
|
+
return _classPrivateFieldGet(this, _rowIndexSyncer);
|
93
116
|
}
|
94
|
-
return _classPrivateFieldGet(
|
117
|
+
return _classPrivateFieldGet(this, _columnIndexSyncer);
|
95
118
|
}
|
96
119
|
|
97
120
|
/**
|
@@ -100,7 +123,7 @@ class IndexSyncer {
|
|
100
123
|
* @param {boolean} flagValue Boolean value for the flag.
|
101
124
|
*/
|
102
125
|
setPerformUndo(flagValue) {
|
103
|
-
_classPrivateFieldSet(
|
126
|
+
_classPrivateFieldSet(this, _isPerformingUndo, flagValue);
|
104
127
|
}
|
105
128
|
|
106
129
|
/**
|
@@ -109,7 +132,7 @@ class IndexSyncer {
|
|
109
132
|
* @param {boolean} flagValue Boolean value for the flag.
|
110
133
|
*/
|
111
134
|
setPerformRedo(flagValue) {
|
112
|
-
_classPrivateFieldSet(
|
135
|
+
_classPrivateFieldSet(this, _isPerformingRedo, flagValue);
|
113
136
|
}
|
114
137
|
|
115
138
|
/**
|
@@ -119,7 +142,7 @@ class IndexSyncer {
|
|
119
142
|
* @returns {boolean}
|
120
143
|
*/
|
121
144
|
isPerformingUndoRedo() {
|
122
|
-
return _classPrivateFieldGet(
|
145
|
+
return _classPrivateFieldGet(this, _isPerformingUndo) || _classPrivateFieldGet(this, _isPerformingRedo);
|
123
146
|
}
|
124
147
|
|
125
148
|
/**
|
@@ -128,7 +151,7 @@ class IndexSyncer {
|
|
128
151
|
* @returns {string|null}
|
129
152
|
*/
|
130
153
|
getSheetId() {
|
131
|
-
return _classPrivateFieldGet(
|
154
|
+
return _classPrivateFieldGet(this, _sheetId);
|
132
155
|
}
|
133
156
|
|
134
157
|
/**
|
@@ -137,7 +160,7 @@ class IndexSyncer {
|
|
137
160
|
* @type {HyperFormula|null}
|
138
161
|
*/
|
139
162
|
getEngine() {
|
140
|
-
return _classPrivateFieldGet(
|
163
|
+
return _classPrivateFieldGet(this, _engine);
|
141
164
|
}
|
142
165
|
|
143
166
|
/**
|
@@ -146,7 +169,7 @@ class IndexSyncer {
|
|
146
169
|
* @returns {Function}
|
147
170
|
*/
|
148
171
|
getPostponeAction() {
|
149
|
-
return _classPrivateFieldGet(
|
172
|
+
return _classPrivateFieldGet(this, _postponeAction);
|
150
173
|
}
|
151
174
|
|
152
175
|
/**
|
@@ -156,10 +179,10 @@ class IndexSyncer {
|
|
156
179
|
* @param {string|null} sheetId HyperFormula's sheet name.
|
157
180
|
*/
|
158
181
|
setupSyncEndpoint(engine, sheetId) {
|
159
|
-
_classPrivateFieldSet(
|
160
|
-
_classPrivateFieldSet(
|
161
|
-
_classPrivateFieldGet(
|
162
|
-
_classPrivateFieldGet(
|
182
|
+
_classPrivateFieldSet(this, _engine, engine);
|
183
|
+
_classPrivateFieldSet(this, _sheetId, sheetId);
|
184
|
+
_classPrivateFieldGet(this, _rowIndexSyncer).init();
|
185
|
+
_classPrivateFieldGet(this, _columnIndexSyncer).init();
|
163
186
|
}
|
164
187
|
}
|
165
188
|
var _default = exports.default = IndexSyncer;
|