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,9 +1,11 @@
|
|
1
1
|
import "core-js/modules/es.error.cause.js";
|
2
2
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
3
3
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
4
|
-
function _classPrivateFieldGet(
|
5
|
-
function
|
6
|
-
function
|
4
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
5
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
6
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
7
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
8
|
+
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; } }
|
7
9
|
import AxisSyncer from "./axisSyncer.mjs";
|
8
10
|
/**
|
9
11
|
* @private
|
@@ -29,52 +31,73 @@ class IndexSyncer {
|
|
29
31
|
* @private
|
30
32
|
* @type {AxisSyncer}
|
31
33
|
*/
|
32
|
-
_classPrivateFieldInitSpec(this, _rowIndexSyncer,
|
34
|
+
_classPrivateFieldInitSpec(this, _rowIndexSyncer, {
|
35
|
+
writable: true,
|
36
|
+
value: void 0
|
37
|
+
});
|
33
38
|
/**
|
34
39
|
* Indexes synchronizer for the axis of the columns.
|
35
40
|
*
|
36
41
|
* @private
|
37
42
|
* @type {AxisSyncer}
|
38
43
|
*/
|
39
|
-
_classPrivateFieldInitSpec(this, _columnIndexSyncer,
|
44
|
+
_classPrivateFieldInitSpec(this, _columnIndexSyncer, {
|
45
|
+
writable: true,
|
46
|
+
value: void 0
|
47
|
+
});
|
40
48
|
/**
|
41
49
|
* Method which will postpone execution of some action (needed when synchronization endpoint isn't setup yet).
|
42
50
|
*
|
43
51
|
* @private
|
44
52
|
* @type {Function}
|
45
53
|
*/
|
46
|
-
_classPrivateFieldInitSpec(this, _postponeAction,
|
54
|
+
_classPrivateFieldInitSpec(this, _postponeAction, {
|
55
|
+
writable: true,
|
56
|
+
value: void 0
|
57
|
+
});
|
47
58
|
/**
|
48
59
|
* Flag informing whether undo is already performed (we don't perform synchronization in such case).
|
49
60
|
*
|
50
61
|
* @private
|
51
62
|
* @type {boolean}
|
52
63
|
*/
|
53
|
-
_classPrivateFieldInitSpec(this, _isPerformingUndo,
|
64
|
+
_classPrivateFieldInitSpec(this, _isPerformingUndo, {
|
65
|
+
writable: true,
|
66
|
+
value: false
|
67
|
+
});
|
54
68
|
/**
|
55
69
|
* Flag informing whether redo is already performed (we don't perform synchronization in such case).
|
56
70
|
*
|
57
71
|
* @private
|
58
72
|
* @type {boolean}
|
59
73
|
*/
|
60
|
-
_classPrivateFieldInitSpec(this, _isPerformingRedo,
|
74
|
+
_classPrivateFieldInitSpec(this, _isPerformingRedo, {
|
75
|
+
writable: true,
|
76
|
+
value: false
|
77
|
+
});
|
61
78
|
/**
|
62
79
|
* The HF's engine instance which will be synced.
|
63
80
|
*
|
64
81
|
* @private
|
65
82
|
* @type {HyperFormula|null}
|
66
83
|
*/
|
67
|
-
_classPrivateFieldInitSpec(this, _engine,
|
84
|
+
_classPrivateFieldInitSpec(this, _engine, {
|
85
|
+
writable: true,
|
86
|
+
value: null
|
87
|
+
});
|
68
88
|
/**
|
69
89
|
* HyperFormula's sheet name.
|
70
90
|
*
|
71
91
|
* @private
|
72
92
|
* @type {string|null}
|
73
93
|
*/
|
74
|
-
_classPrivateFieldInitSpec(this, _sheetId,
|
75
|
-
|
76
|
-
|
77
|
-
|
94
|
+
_classPrivateFieldInitSpec(this, _sheetId, {
|
95
|
+
writable: true,
|
96
|
+
value: null
|
97
|
+
});
|
98
|
+
_classPrivateFieldSet(this, _rowIndexSyncer, new AxisSyncer('row', rowIndexMapper, this));
|
99
|
+
_classPrivateFieldSet(this, _columnIndexSyncer, new AxisSyncer('column', columnIndexMapper, this));
|
100
|
+
_classPrivateFieldSet(this, _postponeAction, postponeAction);
|
78
101
|
}
|
79
102
|
|
80
103
|
/**
|
@@ -85,9 +108,9 @@ class IndexSyncer {
|
|
85
108
|
*/
|
86
109
|
getForAxis(indexType) {
|
87
110
|
if (indexType === 'row') {
|
88
|
-
return _classPrivateFieldGet(
|
111
|
+
return _classPrivateFieldGet(this, _rowIndexSyncer);
|
89
112
|
}
|
90
|
-
return _classPrivateFieldGet(
|
113
|
+
return _classPrivateFieldGet(this, _columnIndexSyncer);
|
91
114
|
}
|
92
115
|
|
93
116
|
/**
|
@@ -96,7 +119,7 @@ class IndexSyncer {
|
|
96
119
|
* @param {boolean} flagValue Boolean value for the flag.
|
97
120
|
*/
|
98
121
|
setPerformUndo(flagValue) {
|
99
|
-
_classPrivateFieldSet(
|
122
|
+
_classPrivateFieldSet(this, _isPerformingUndo, flagValue);
|
100
123
|
}
|
101
124
|
|
102
125
|
/**
|
@@ -105,7 +128,7 @@ class IndexSyncer {
|
|
105
128
|
* @param {boolean} flagValue Boolean value for the flag.
|
106
129
|
*/
|
107
130
|
setPerformRedo(flagValue) {
|
108
|
-
_classPrivateFieldSet(
|
131
|
+
_classPrivateFieldSet(this, _isPerformingRedo, flagValue);
|
109
132
|
}
|
110
133
|
|
111
134
|
/**
|
@@ -115,7 +138,7 @@ class IndexSyncer {
|
|
115
138
|
* @returns {boolean}
|
116
139
|
*/
|
117
140
|
isPerformingUndoRedo() {
|
118
|
-
return _classPrivateFieldGet(
|
141
|
+
return _classPrivateFieldGet(this, _isPerformingUndo) || _classPrivateFieldGet(this, _isPerformingRedo);
|
119
142
|
}
|
120
143
|
|
121
144
|
/**
|
@@ -124,7 +147,7 @@ class IndexSyncer {
|
|
124
147
|
* @returns {string|null}
|
125
148
|
*/
|
126
149
|
getSheetId() {
|
127
|
-
return _classPrivateFieldGet(
|
150
|
+
return _classPrivateFieldGet(this, _sheetId);
|
128
151
|
}
|
129
152
|
|
130
153
|
/**
|
@@ -133,7 +156,7 @@ class IndexSyncer {
|
|
133
156
|
* @type {HyperFormula|null}
|
134
157
|
*/
|
135
158
|
getEngine() {
|
136
|
-
return _classPrivateFieldGet(
|
159
|
+
return _classPrivateFieldGet(this, _engine);
|
137
160
|
}
|
138
161
|
|
139
162
|
/**
|
@@ -142,7 +165,7 @@ class IndexSyncer {
|
|
142
165
|
* @returns {Function}
|
143
166
|
*/
|
144
167
|
getPostponeAction() {
|
145
|
-
return _classPrivateFieldGet(
|
168
|
+
return _classPrivateFieldGet(this, _postponeAction);
|
146
169
|
}
|
147
170
|
|
148
171
|
/**
|
@@ -152,10 +175,10 @@ class IndexSyncer {
|
|
152
175
|
* @param {string|null} sheetId HyperFormula's sheet name.
|
153
176
|
*/
|
154
177
|
setupSyncEndpoint(engine, sheetId) {
|
155
|
-
_classPrivateFieldSet(
|
156
|
-
_classPrivateFieldSet(
|
157
|
-
_classPrivateFieldGet(
|
158
|
-
_classPrivateFieldGet(
|
178
|
+
_classPrivateFieldSet(this, _engine, engine);
|
179
|
+
_classPrivateFieldSet(this, _sheetId, sheetId);
|
180
|
+
_classPrivateFieldGet(this, _rowIndexSyncer).init();
|
181
|
+
_classPrivateFieldGet(this, _columnIndexSyncer).init();
|
159
182
|
}
|
160
183
|
}
|
161
184
|
export default IndexSyncer;
|
@@ -1,8 +1,8 @@
|
|
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 _base = require("../base");
|
7
7
|
var _element = require("../../helpers/dom/element");
|
8
8
|
var _number = require("../../helpers/number");
|
@@ -18,9 +18,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
18
18
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
19
19
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
20
20
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
21
|
-
function
|
22
|
-
function
|
23
|
-
function
|
21
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
22
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
23
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
24
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
25
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
26
|
+
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
24
27
|
_pluginHooks.default.getSingleton().register('beforeHideColumns');
|
25
28
|
_pluginHooks.default.getSingleton().register('afterHideColumns');
|
26
29
|
_pluginHooks.default.getSingleton().register('beforeUnhideColumns');
|
@@ -136,10 +139,47 @@ const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 310;
|
|
136
139
|
*/
|
137
140
|
var _settings = /*#__PURE__*/new WeakMap();
|
138
141
|
var _hiddenColumnsMap = /*#__PURE__*/new WeakMap();
|
139
|
-
var
|
142
|
+
var _onModifyColWidth = /*#__PURE__*/new WeakSet();
|
143
|
+
var _onAfterGetCellMeta = /*#__PURE__*/new WeakSet();
|
144
|
+
var _onModifyCopyableRange = /*#__PURE__*/new WeakSet();
|
145
|
+
var _onAfterGetColHeader = /*#__PURE__*/new WeakSet();
|
146
|
+
var _onAfterContextMenuDefaultOptions = /*#__PURE__*/new WeakSet();
|
147
|
+
var _onMapInit = /*#__PURE__*/new WeakSet();
|
140
148
|
class HiddenColumns extends _base.BasePlugin {
|
141
149
|
constructor() {
|
142
150
|
super(...arguments);
|
151
|
+
/**
|
152
|
+
* On map initialized hook callback.
|
153
|
+
*/
|
154
|
+
_classPrivateMethodInitSpec(this, _onMapInit);
|
155
|
+
/**
|
156
|
+
* Add Show-hide columns to context menu.
|
157
|
+
*
|
158
|
+
* @param {object} options An array of objects containing information about the pre-defined Context Menu items.
|
159
|
+
*/
|
160
|
+
_classPrivateMethodInitSpec(this, _onAfterContextMenuDefaultOptions);
|
161
|
+
/**
|
162
|
+
* Adds the needed classes to the headers.
|
163
|
+
*
|
164
|
+
* @param {number} column Visual column index.
|
165
|
+
* @param {HTMLElement} TH Header's TH element.
|
166
|
+
*/
|
167
|
+
_classPrivateMethodInitSpec(this, _onAfterGetColHeader);
|
168
|
+
/**
|
169
|
+
* Modifies the copyable range, accordingly to the provided config.
|
170
|
+
*
|
171
|
+
* @param {Array} ranges An array of objects defining copyable cells.
|
172
|
+
* @returns {Array}
|
173
|
+
*/
|
174
|
+
_classPrivateMethodInitSpec(this, _onModifyCopyableRange);
|
175
|
+
/**
|
176
|
+
* Sets the copy-related cell meta.
|
177
|
+
*
|
178
|
+
* @param {number} row Visual row index.
|
179
|
+
* @param {number} column Visual column index.
|
180
|
+
* @param {object} cellProperties Object containing the cell properties.
|
181
|
+
*/
|
182
|
+
_classPrivateMethodInitSpec(this, _onAfterGetCellMeta);
|
143
183
|
/**
|
144
184
|
* Adds the additional column width for the hidden column indicators.
|
145
185
|
*
|
@@ -147,21 +187,27 @@ class HiddenColumns extends _base.BasePlugin {
|
|
147
187
|
* @param {number} column Visual column index.
|
148
188
|
* @returns {number}
|
149
189
|
*/
|
150
|
-
_classPrivateMethodInitSpec(this,
|
190
|
+
_classPrivateMethodInitSpec(this, _onModifyColWidth);
|
151
191
|
/**
|
152
192
|
* Cached plugin settings.
|
153
193
|
*
|
154
194
|
* @private
|
155
195
|
* @type {object}
|
156
196
|
*/
|
157
|
-
_classPrivateFieldInitSpec(this, _settings, {
|
197
|
+
_classPrivateFieldInitSpec(this, _settings, {
|
198
|
+
writable: true,
|
199
|
+
value: {}
|
200
|
+
});
|
158
201
|
/**
|
159
202
|
* Map of hidden columns by the plugin.
|
160
203
|
*
|
161
204
|
* @private
|
162
205
|
* @type {null|HidingMap}
|
163
206
|
*/
|
164
|
-
_classPrivateFieldInitSpec(this, _hiddenColumnsMap,
|
207
|
+
_classPrivateFieldInitSpec(this, _hiddenColumnsMap, {
|
208
|
+
writable: true,
|
209
|
+
value: null
|
210
|
+
});
|
165
211
|
}
|
166
212
|
static get PLUGIN_KEY() {
|
167
213
|
return PLUGIN_KEY;
|
@@ -189,29 +235,29 @@ class HiddenColumns extends _base.BasePlugin {
|
|
189
235
|
}
|
190
236
|
const pluginSettings = this.hot.getSettings()[PLUGIN_KEY];
|
191
237
|
if ((0, _object.isObject)(pluginSettings)) {
|
192
|
-
_classPrivateFieldSet(
|
238
|
+
_classPrivateFieldSet(this, _settings, pluginSettings);
|
193
239
|
if ((0, _mixed.isUndefined)(pluginSettings.copyPasteEnabled)) {
|
194
240
|
pluginSettings.copyPasteEnabled = true;
|
195
241
|
}
|
196
242
|
}
|
197
|
-
_classPrivateFieldSet(
|
198
|
-
_classPrivateFieldGet(
|
199
|
-
this.hot.columnIndexMapper.registerMap(this.pluginName, _classPrivateFieldGet(
|
243
|
+
_classPrivateFieldSet(this, _hiddenColumnsMap, new _translations.HidingMap());
|
244
|
+
_classPrivateFieldGet(this, _hiddenColumnsMap).addLocalHook('init', () => _classPrivateMethodGet(this, _onMapInit, _onMapInit2).call(this));
|
245
|
+
this.hot.columnIndexMapper.registerMap(this.pluginName, _classPrivateFieldGet(this, _hiddenColumnsMap));
|
200
246
|
this.addHook('afterContextMenuDefaultOptions', function () {
|
201
247
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
202
248
|
args[_key] = arguments[_key];
|
203
249
|
}
|
204
|
-
return
|
250
|
+
return _classPrivateMethodGet(_this, _onAfterContextMenuDefaultOptions, _onAfterContextMenuDefaultOptions2).call(_this, ...args);
|
205
251
|
});
|
206
|
-
this.addHook('afterGetCellMeta', (row, col, cellProperties) =>
|
207
|
-
this.addHook('modifyColWidth', (width, col) =>
|
252
|
+
this.addHook('afterGetCellMeta', (row, col, cellProperties) => _classPrivateMethodGet(this, _onAfterGetCellMeta, _onAfterGetCellMeta2).call(this, row, col, cellProperties));
|
253
|
+
this.addHook('modifyColWidth', (width, col) => _classPrivateMethodGet(this, _onModifyColWidth, _onModifyColWidth2).call(this, width, col));
|
208
254
|
this.addHook('afterGetColHeader', function () {
|
209
255
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
210
256
|
args[_key2] = arguments[_key2];
|
211
257
|
}
|
212
|
-
return
|
258
|
+
return _classPrivateMethodGet(_this, _onAfterGetColHeader, _onAfterGetColHeader2).call(_this, ...args);
|
213
259
|
});
|
214
|
-
this.addHook('modifyCopyableRange', ranges =>
|
260
|
+
this.addHook('modifyCopyableRange', ranges => _classPrivateMethodGet(this, _onModifyCopyableRange, _onModifyCopyableRange2).call(this, ranges));
|
215
261
|
super.enablePlugin();
|
216
262
|
}
|
217
263
|
|
@@ -232,7 +278,7 @@ class HiddenColumns extends _base.BasePlugin {
|
|
232
278
|
*/
|
233
279
|
disablePlugin() {
|
234
280
|
this.hot.columnIndexMapper.unregisterMap(this.pluginName);
|
235
|
-
_classPrivateFieldSet(
|
281
|
+
_classPrivateFieldSet(this, _settings, {});
|
236
282
|
super.disablePlugin();
|
237
283
|
this.resetCellsMeta();
|
238
284
|
}
|
@@ -246,7 +292,7 @@ class HiddenColumns extends _base.BasePlugin {
|
|
246
292
|
const currentHideConfig = this.getHiddenColumns();
|
247
293
|
const isValidConfig = this.isValidConfig(columns);
|
248
294
|
let destinationHideConfig = currentHideConfig;
|
249
|
-
const hidingMapValues = _classPrivateFieldGet(
|
295
|
+
const hidingMapValues = _classPrivateFieldGet(this, _hiddenColumnsMap).getValues().slice();
|
250
296
|
const isAnyColumnShowed = columns.length > 0;
|
251
297
|
if (isValidConfig && isAnyColumnShowed) {
|
252
298
|
const physicalColumns = columns.map(visualColumn => this.hot.toPhysicalColumn(visualColumn));
|
@@ -269,7 +315,7 @@ class HiddenColumns extends _base.BasePlugin {
|
|
269
315
|
return;
|
270
316
|
}
|
271
317
|
if (isValidConfig && isAnyColumnShowed) {
|
272
|
-
_classPrivateFieldGet(
|
318
|
+
_classPrivateFieldGet(this, _hiddenColumnsMap).setValues(hidingMapValues);
|
273
319
|
}
|
274
320
|
|
275
321
|
// @TODO Should call once per render cycle, currently fired separately in different plugins
|
@@ -308,7 +354,7 @@ class HiddenColumns extends _base.BasePlugin {
|
|
308
354
|
if (isConfigValid) {
|
309
355
|
this.hot.batchExecution(() => {
|
310
356
|
(0, _array.arrayEach)(columns, visualColumn => {
|
311
|
-
_classPrivateFieldGet(
|
357
|
+
_classPrivateFieldGet(this, _hiddenColumnsMap).setValueAtIndex(this.hot.toPhysicalColumn(visualColumn), true);
|
312
358
|
});
|
313
359
|
}, true);
|
314
360
|
}
|
@@ -333,7 +379,7 @@ class HiddenColumns extends _base.BasePlugin {
|
|
333
379
|
* @returns {number[]}
|
334
380
|
*/
|
335
381
|
getHiddenColumns() {
|
336
|
-
return (0, _array.arrayMap)(_classPrivateFieldGet(
|
382
|
+
return (0, _array.arrayMap)(_classPrivateFieldGet(this, _hiddenColumnsMap).getHiddenIndexes(), physicalColumnIndex => {
|
337
383
|
return this.hot.toVisualColumn(physicalColumnIndex);
|
338
384
|
});
|
339
385
|
}
|
@@ -345,7 +391,7 @@ class HiddenColumns extends _base.BasePlugin {
|
|
345
391
|
* @returns {boolean}
|
346
392
|
*/
|
347
393
|
isHidden(column) {
|
348
|
-
return _classPrivateFieldGet(
|
394
|
+
return _classPrivateFieldGet(this, _hiddenColumnsMap).getValueAtIndex(this.hot.toPhysicalColumn(column)) || false;
|
349
395
|
}
|
350
396
|
|
351
397
|
/**
|
@@ -378,34 +424,27 @@ class HiddenColumns extends _base.BasePlugin {
|
|
378
424
|
* Destroys the plugin instance.
|
379
425
|
*/
|
380
426
|
destroy() {
|
381
|
-
_classPrivateFieldSet(
|
382
|
-
_classPrivateFieldSet(
|
427
|
+
_classPrivateFieldSet(this, _settings, null);
|
428
|
+
_classPrivateFieldSet(this, _hiddenColumnsMap, null);
|
383
429
|
super.destroy();
|
384
430
|
}
|
385
431
|
}
|
386
432
|
exports.HiddenColumns = HiddenColumns;
|
387
|
-
function
|
433
|
+
function _onModifyColWidth2(width, column) {
|
388
434
|
// Hook is triggered internally only for the visible columns. Conditional will be handled for the API
|
389
435
|
// calls of the `getColWidth` function on not visible indexes.
|
390
436
|
if (this.isHidden(column)) {
|
391
437
|
return 0;
|
392
438
|
}
|
393
|
-
if (_classPrivateFieldGet(
|
439
|
+
if (_classPrivateFieldGet(this, _settings).indicators && (this.isHidden(column + 1) || this.isHidden(column - 1))) {
|
394
440
|
// Add additional space for hidden column indicator.
|
395
441
|
if (typeof width === 'number' && this.hot.hasColHeaders()) {
|
396
442
|
return width + 15;
|
397
443
|
}
|
398
444
|
}
|
399
445
|
}
|
400
|
-
|
401
|
-
|
402
|
-
*
|
403
|
-
* @param {number} row Visual row index.
|
404
|
-
* @param {number} column Visual column index.
|
405
|
-
* @param {object} cellProperties Object containing the cell properties.
|
406
|
-
*/
|
407
|
-
function _onAfterGetCellMeta(row, column, cellProperties) {
|
408
|
-
if (_classPrivateFieldGet(_settings, this).copyPasteEnabled === false && this.isHidden(column)) {
|
446
|
+
function _onAfterGetCellMeta2(row, column, cellProperties) {
|
447
|
+
if (_classPrivateFieldGet(this, _settings).copyPasteEnabled === false && this.isHidden(column)) {
|
409
448
|
// Cell property handled by the `Autofill` and the `CopyPaste` plugins.
|
410
449
|
cellProperties.skipColumnOnPaste = true;
|
411
450
|
}
|
@@ -425,15 +464,9 @@ function _onAfterGetCellMeta(row, column, cellProperties) {
|
|
425
464
|
}
|
426
465
|
}
|
427
466
|
}
|
428
|
-
|
429
|
-
* Modifies the copyable range, accordingly to the provided config.
|
430
|
-
*
|
431
|
-
* @param {Array} ranges An array of objects defining copyable cells.
|
432
|
-
* @returns {Array}
|
433
|
-
*/
|
434
|
-
function _onModifyCopyableRange(ranges) {
|
467
|
+
function _onModifyCopyableRange2(ranges) {
|
435
468
|
// Ranges shouldn't be modified when `copyPasteEnabled` option is set to `true` (by default).
|
436
|
-
if (_classPrivateFieldGet(
|
469
|
+
if (_classPrivateFieldGet(this, _settings).copyPasteEnabled) {
|
437
470
|
return ranges;
|
438
471
|
}
|
439
472
|
const newRanges = [];
|
@@ -467,14 +500,8 @@ function _onModifyCopyableRange(ranges) {
|
|
467
500
|
});
|
468
501
|
return newRanges;
|
469
502
|
}
|
470
|
-
|
471
|
-
|
472
|
-
*
|
473
|
-
* @param {number} column Visual column index.
|
474
|
-
* @param {HTMLElement} TH Header's TH element.
|
475
|
-
*/
|
476
|
-
function _onAfterGetColHeader(column, TH) {
|
477
|
-
if (!_classPrivateFieldGet(_settings, this).indicators || column < 0) {
|
503
|
+
function _onAfterGetColHeader2(column, TH) {
|
504
|
+
if (!_classPrivateFieldGet(this, _settings).indicators || column < 0) {
|
478
505
|
return;
|
479
506
|
}
|
480
507
|
const classList = [];
|
@@ -486,21 +513,13 @@ function _onAfterGetColHeader(column, TH) {
|
|
486
513
|
}
|
487
514
|
(0, _element.addClass)(TH, classList);
|
488
515
|
}
|
489
|
-
|
490
|
-
* Add Show-hide columns to context menu.
|
491
|
-
*
|
492
|
-
* @param {object} options An array of objects containing information about the pre-defined Context Menu items.
|
493
|
-
*/
|
494
|
-
function _onAfterContextMenuDefaultOptions(options) {
|
516
|
+
function _onAfterContextMenuDefaultOptions2(options) {
|
495
517
|
options.items.push({
|
496
518
|
name: _predefinedItems.SEPARATOR
|
497
519
|
}, (0, _hideColumn.default)(this), (0, _showColumn.default)(this));
|
498
520
|
}
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
function _onMapInit() {
|
503
|
-
if (Array.isArray(_classPrivateFieldGet(_settings, this).columns)) {
|
504
|
-
this.hideColumns(_classPrivateFieldGet(_settings, this).columns);
|
521
|
+
function _onMapInit2() {
|
522
|
+
if (Array.isArray(_classPrivateFieldGet(this, _settings).columns)) {
|
523
|
+
this.hideColumns(_classPrivateFieldGet(this, _settings).columns);
|
505
524
|
}
|
506
525
|
}
|