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,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 _classPrivateFieldSet(
|
6
|
-
function
|
7
|
-
function
|
5
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
6
|
+
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
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
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 _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
8
10
|
import { arrayMap, arrayReduce } from "../../../helpers/array.mjs";
|
9
11
|
import SourceSettings from "./sourceSettings.mjs";
|
10
12
|
import HeadersTree from "./headersTree.mjs";
|
@@ -50,21 +52,30 @@ export default class StateManager {
|
|
50
52
|
* @private
|
51
53
|
* @type {SourceSettings}
|
52
54
|
*/
|
53
|
-
_classPrivateFieldInitSpec(this, _sourceSettings,
|
55
|
+
_classPrivateFieldInitSpec(this, _sourceSettings, {
|
56
|
+
writable: true,
|
57
|
+
value: new SourceSettings()
|
58
|
+
});
|
54
59
|
/**
|
55
60
|
* The instance of the headers tree. The tree is generated after setting new configuration data.
|
56
61
|
*
|
57
62
|
* @private
|
58
63
|
* @type {HeadersTree}
|
59
64
|
*/
|
60
|
-
_classPrivateFieldInitSpec(this, _headersTree,
|
65
|
+
_classPrivateFieldInitSpec(this, _headersTree, {
|
66
|
+
writable: true,
|
67
|
+
value: new HeadersTree(_classPrivateFieldGet(this, _sourceSettings))
|
68
|
+
});
|
61
69
|
/**
|
62
70
|
* Cached matrix which is generated from the tree structure.
|
63
71
|
*
|
64
72
|
* @private
|
65
73
|
* @type {Array[]}
|
66
74
|
*/
|
67
|
-
_classPrivateFieldInitSpec(this, _stateMatrix,
|
75
|
+
_classPrivateFieldInitSpec(this, _stateMatrix, {
|
76
|
+
writable: true,
|
77
|
+
value: [[]]
|
78
|
+
});
|
68
79
|
}
|
69
80
|
/**
|
70
81
|
* Sets a new state for the nested headers plugin based on settings passed
|
@@ -74,16 +85,16 @@ export default class StateManager {
|
|
74
85
|
* @returns {boolean} Returns `true` if the settings are processed correctly, `false` otherwise.
|
75
86
|
*/
|
76
87
|
setState(nestedHeadersSettings) {
|
77
|
-
_classPrivateFieldGet(
|
88
|
+
_classPrivateFieldGet(this, _sourceSettings).setData(nestedHeadersSettings);
|
78
89
|
let hasError = false;
|
79
90
|
try {
|
80
|
-
_classPrivateFieldGet(
|
91
|
+
_classPrivateFieldGet(this, _headersTree).buildTree();
|
81
92
|
} catch (ex) {
|
82
|
-
_classPrivateFieldGet(
|
83
|
-
_classPrivateFieldGet(
|
93
|
+
_classPrivateFieldGet(this, _headersTree).clear();
|
94
|
+
_classPrivateFieldGet(this, _sourceSettings).clear();
|
84
95
|
hasError = true;
|
85
96
|
}
|
86
|
-
_classPrivateFieldSet(
|
97
|
+
_classPrivateFieldSet(this, _stateMatrix, generateMatrix(_classPrivateFieldGet(this, _headersTree).getRoots()));
|
87
98
|
return hasError;
|
88
99
|
}
|
89
100
|
|
@@ -94,7 +105,7 @@ export default class StateManager {
|
|
94
105
|
* @param {number} columnsCount The number of columns to limit to.
|
95
106
|
*/
|
96
107
|
setColumnsLimit(columnsCount) {
|
97
|
-
_classPrivateFieldGet(
|
108
|
+
_classPrivateFieldGet(this, _sourceSettings).setColumnsLimit(columnsCount);
|
98
109
|
}
|
99
110
|
|
100
111
|
/**
|
@@ -118,9 +129,9 @@ export default class StateManager {
|
|
118
129
|
...rest
|
119
130
|
};
|
120
131
|
});
|
121
|
-
_classPrivateFieldGet(
|
122
|
-
_classPrivateFieldGet(
|
123
|
-
_classPrivateFieldSet(
|
132
|
+
_classPrivateFieldGet(this, _sourceSettings).mergeWith(transformedSettings);
|
133
|
+
_classPrivateFieldGet(this, _headersTree).buildTree();
|
134
|
+
_classPrivateFieldSet(this, _stateMatrix, generateMatrix(_classPrivateFieldGet(this, _headersTree).getRoots()));
|
124
135
|
}
|
125
136
|
|
126
137
|
/**
|
@@ -135,9 +146,9 @@ export default class StateManager {
|
|
135
146
|
* header settings.
|
136
147
|
*/
|
137
148
|
mapState(callback) {
|
138
|
-
_classPrivateFieldGet(
|
139
|
-
_classPrivateFieldGet(
|
140
|
-
_classPrivateFieldSet(
|
149
|
+
_classPrivateFieldGet(this, _sourceSettings).map(callback);
|
150
|
+
_classPrivateFieldGet(this, _headersTree).buildTree();
|
151
|
+
_classPrivateFieldSet(this, _stateMatrix, generateMatrix(_classPrivateFieldGet(this, _headersTree).getRoots()));
|
141
152
|
}
|
142
153
|
|
143
154
|
/**
|
@@ -150,7 +161,7 @@ export default class StateManager {
|
|
150
161
|
* @returns {Array}
|
151
162
|
*/
|
152
163
|
mapNodes(callback) {
|
153
|
-
return arrayReduce(_classPrivateFieldGet(
|
164
|
+
return arrayReduce(_classPrivateFieldGet(this, _headersTree).getRoots(), (acc, rootNode) => {
|
154
165
|
rootNode.walkDown(node => {
|
155
166
|
const result = callback(node.data);
|
156
167
|
if (result !== undefined) {
|
@@ -175,13 +186,13 @@ export default class StateManager {
|
|
175
186
|
if (headerLevel < 0) {
|
176
187
|
headerLevel = this.rowCoordsToLevel(headerLevel);
|
177
188
|
}
|
178
|
-
const nodeToProcess = _classPrivateFieldGet(
|
189
|
+
const nodeToProcess = _classPrivateFieldGet(this, _headersTree).getNode(headerLevel, columnIndex);
|
179
190
|
let actionResult;
|
180
191
|
if (nodeToProcess) {
|
181
192
|
actionResult = triggerNodeModification(action, nodeToProcess, columnIndex);
|
182
193
|
|
183
194
|
// TODO (perf-tip): Trigger matrix generation once after multiple node modifications.
|
184
|
-
_classPrivateFieldSet(
|
195
|
+
_classPrivateFieldSet(this, _stateMatrix, generateMatrix(_classPrivateFieldGet(this, _headersTree).getRoots()));
|
185
196
|
}
|
186
197
|
return actionResult;
|
187
198
|
}
|
@@ -290,7 +301,7 @@ export default class StateManager {
|
|
290
301
|
if (headerLevel === null || headerLevel >= this.getLayersCount()) {
|
291
302
|
return null;
|
292
303
|
}
|
293
|
-
return (_classPrivateFieldGet2 = (_classPrivateFieldGet3 = _classPrivateFieldGet(
|
304
|
+
return (_classPrivateFieldGet2 = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _stateMatrix)[headerLevel]) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3[columnIndex]) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : null;
|
294
305
|
}
|
295
306
|
|
296
307
|
/**
|
@@ -326,7 +337,7 @@ export default class StateManager {
|
|
326
337
|
if (headerLevel === null || headerLevel >= this.getLayersCount()) {
|
327
338
|
return null;
|
328
339
|
}
|
329
|
-
const node = _classPrivateFieldGet(
|
340
|
+
const node = _classPrivateFieldGet(this, _headersTree).getNode(headerLevel, columnIndex);
|
330
341
|
if (!node) {
|
331
342
|
return null;
|
332
343
|
}
|
@@ -349,7 +360,7 @@ export default class StateManager {
|
|
349
360
|
let atLeastOneRootFound = false;
|
350
361
|
let headerLevel = null;
|
351
362
|
for (let columnIndex = columnIndexFrom; columnIndex <= columnIndexTo; columnIndex++) {
|
352
|
-
const rootNode = _classPrivateFieldGet(
|
363
|
+
const rootNode = _classPrivateFieldGet(this, _headersTree).getRootByColumn(columnIndex);
|
353
364
|
if (!rootNode) {
|
354
365
|
break;
|
355
366
|
}
|
@@ -457,7 +468,7 @@ export default class StateManager {
|
|
457
468
|
* @returns {number}
|
458
469
|
*/
|
459
470
|
getLayersCount() {
|
460
|
-
return _classPrivateFieldGet(
|
471
|
+
return _classPrivateFieldGet(this, _sourceSettings).getLayersCount();
|
461
472
|
}
|
462
473
|
|
463
474
|
/**
|
@@ -466,15 +477,15 @@ export default class StateManager {
|
|
466
477
|
* @returns {number}
|
467
478
|
*/
|
468
479
|
getColumnsCount() {
|
469
|
-
return _classPrivateFieldGet(
|
480
|
+
return _classPrivateFieldGet(this, _sourceSettings).getColumnsCount();
|
470
481
|
}
|
471
482
|
|
472
483
|
/**
|
473
484
|
* Clears the column state manager to the initial state.
|
474
485
|
*/
|
475
486
|
clear() {
|
476
|
-
_classPrivateFieldSet(
|
477
|
-
_classPrivateFieldGet(
|
478
|
-
_classPrivateFieldGet(
|
487
|
+
_classPrivateFieldSet(this, _stateMatrix, []);
|
488
|
+
_classPrivateFieldGet(this, _sourceSettings).clear();
|
489
|
+
_classPrivateFieldGet(this, _headersTree).clear();
|
479
490
|
}
|
480
491
|
}
|
@@ -8,9 +8,11 @@ var _array = require("../../../helpers/array");
|
|
8
8
|
var _settingsNormalizer = require("./settingsNormalizer");
|
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 _classPrivateFieldGet(
|
12
|
-
function
|
13
|
-
function
|
11
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
12
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
13
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
14
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
15
|
+
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; } }
|
14
16
|
/**
|
15
17
|
* List of properties which are configurable. That properties can be changed using public API.
|
16
18
|
*
|
@@ -37,14 +39,20 @@ class SourceSettings {
|
|
37
39
|
* @private
|
38
40
|
* @type {Array[]}
|
39
41
|
*/
|
40
|
-
_classPrivateFieldInitSpec(this, _data,
|
42
|
+
_classPrivateFieldInitSpec(this, _data, {
|
43
|
+
writable: true,
|
44
|
+
value: []
|
45
|
+
});
|
41
46
|
/**
|
42
47
|
* The total length of the nested header layers.
|
43
48
|
*
|
44
49
|
* @private
|
45
50
|
* @type {number}
|
46
51
|
*/
|
47
|
-
_classPrivateFieldInitSpec(this, _dataLength,
|
52
|
+
_classPrivateFieldInitSpec(this, _dataLength, {
|
53
|
+
writable: true,
|
54
|
+
value: 0
|
55
|
+
});
|
48
56
|
/**
|
49
57
|
* Columns count limit value trims source settings to that value. If columns
|
50
58
|
* count limit intersects nested header, the header's colspan value is reduced
|
@@ -52,7 +60,10 @@ class SourceSettings {
|
|
52
60
|
*
|
53
61
|
* @type {number}
|
54
62
|
*/
|
55
|
-
_classPrivateFieldInitSpec(this, _columnsLimit,
|
63
|
+
_classPrivateFieldInitSpec(this, _columnsLimit, {
|
64
|
+
writable: true,
|
65
|
+
value: Infinity
|
66
|
+
});
|
56
67
|
}
|
57
68
|
/**
|
58
69
|
* Sets columns limit to the source settings will be trimmed. All headers which
|
@@ -61,7 +72,7 @@ class SourceSettings {
|
|
61
72
|
* @param {number} columnsCount The number of columns to limit to.
|
62
73
|
*/
|
63
74
|
setColumnsLimit(columnsCount) {
|
64
|
-
_classPrivateFieldSet(
|
75
|
+
_classPrivateFieldSet(this, _columnsLimit, columnsCount);
|
65
76
|
}
|
66
77
|
|
67
78
|
/**
|
@@ -71,8 +82,8 @@ class SourceSettings {
|
|
71
82
|
*/
|
72
83
|
setData() {
|
73
84
|
let nestedHeadersSettings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
74
|
-
_classPrivateFieldSet(
|
75
|
-
_classPrivateFieldSet(
|
85
|
+
_classPrivateFieldSet(this, _data, (0, _settingsNormalizer.normalizeSettings)(nestedHeadersSettings, _classPrivateFieldGet(this, _columnsLimit)));
|
86
|
+
_classPrivateFieldSet(this, _dataLength, _classPrivateFieldGet(this, _data).length);
|
76
87
|
}
|
77
88
|
|
78
89
|
/**
|
@@ -81,7 +92,7 @@ class SourceSettings {
|
|
81
92
|
* @returns {Array[]}
|
82
93
|
*/
|
83
94
|
getData() {
|
84
|
-
return _classPrivateFieldGet(
|
95
|
+
return _classPrivateFieldGet(this, _data);
|
85
96
|
}
|
86
97
|
|
87
98
|
/**
|
@@ -113,7 +124,7 @@ class SourceSettings {
|
|
113
124
|
* header settings.
|
114
125
|
*/
|
115
126
|
map(callback) {
|
116
|
-
(0, _array.arrayEach)(_classPrivateFieldGet(
|
127
|
+
(0, _array.arrayEach)(_classPrivateFieldGet(this, _data), header => {
|
117
128
|
(0, _array.arrayEach)(header, headerSettings => {
|
118
129
|
const propsToExtend = callback({
|
119
130
|
...headerSettings
|
@@ -136,10 +147,10 @@ class SourceSettings {
|
|
136
147
|
*/
|
137
148
|
getHeaderSettings(headerLevel, columnIndex) {
|
138
149
|
var _headersSettings$colu;
|
139
|
-
if (headerLevel >= _classPrivateFieldGet(
|
150
|
+
if (headerLevel >= _classPrivateFieldGet(this, _dataLength) || headerLevel < 0) {
|
140
151
|
return null;
|
141
152
|
}
|
142
|
-
const headersSettings = _classPrivateFieldGet(
|
153
|
+
const headersSettings = _classPrivateFieldGet(this, _data)[headerLevel];
|
143
154
|
if (Array.isArray(headersSettings) === false || columnIndex >= headersSettings.length) {
|
144
155
|
return null;
|
145
156
|
}
|
@@ -159,10 +170,10 @@ class SourceSettings {
|
|
159
170
|
getHeadersSettings(headerLevel, columnIndex) {
|
160
171
|
let columnsLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
161
172
|
const headersSettingsChunks = [];
|
162
|
-
if (headerLevel >= _classPrivateFieldGet(
|
173
|
+
if (headerLevel >= _classPrivateFieldGet(this, _dataLength) || headerLevel < 0) {
|
163
174
|
return headersSettingsChunks;
|
164
175
|
}
|
165
|
-
const headersSettings = _classPrivateFieldGet(
|
176
|
+
const headersSettings = _classPrivateFieldGet(this, _data)[headerLevel];
|
166
177
|
let currentLength = 0;
|
167
178
|
for (let i = columnIndex; i < headersSettings.length; i++) {
|
168
179
|
const headerSettings = headersSettings[i];
|
@@ -193,7 +204,7 @@ class SourceSettings {
|
|
193
204
|
* @returns {number}
|
194
205
|
*/
|
195
206
|
getLayersCount() {
|
196
|
-
return _classPrivateFieldGet(
|
207
|
+
return _classPrivateFieldGet(this, _dataLength);
|
197
208
|
}
|
198
209
|
|
199
210
|
/**
|
@@ -202,15 +213,15 @@ class SourceSettings {
|
|
202
213
|
* @returns {number}
|
203
214
|
*/
|
204
215
|
getColumnsCount() {
|
205
|
-
return _classPrivateFieldGet(
|
216
|
+
return _classPrivateFieldGet(this, _dataLength) > 0 ? _classPrivateFieldGet(this, _data)[0].length : 0;
|
206
217
|
}
|
207
218
|
|
208
219
|
/**
|
209
220
|
* Clears the data.
|
210
221
|
*/
|
211
222
|
clear() {
|
212
|
-
_classPrivateFieldSet(
|
213
|
-
_classPrivateFieldSet(
|
223
|
+
_classPrivateFieldSet(this, _data, []);
|
224
|
+
_classPrivateFieldSet(this, _dataLength, 0);
|
214
225
|
}
|
215
226
|
}
|
216
227
|
exports.default = SourceSettings;
|
@@ -2,9 +2,11 @@ import "core-js/modules/es.error.cause.js";
|
|
2
2
|
import "core-js/modules/es.array.push.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 { extend, isObject } from "../../../helpers/object.mjs";
|
9
11
|
import { arrayEach } from "../../../helpers/array.mjs";
|
10
12
|
import { normalizeSettings } from "./settingsNormalizer.mjs";
|
@@ -34,14 +36,20 @@ export default class SourceSettings {
|
|
34
36
|
* @private
|
35
37
|
* @type {Array[]}
|
36
38
|
*/
|
37
|
-
_classPrivateFieldInitSpec(this, _data,
|
39
|
+
_classPrivateFieldInitSpec(this, _data, {
|
40
|
+
writable: true,
|
41
|
+
value: []
|
42
|
+
});
|
38
43
|
/**
|
39
44
|
* The total length of the nested header layers.
|
40
45
|
*
|
41
46
|
* @private
|
42
47
|
* @type {number}
|
43
48
|
*/
|
44
|
-
_classPrivateFieldInitSpec(this, _dataLength,
|
49
|
+
_classPrivateFieldInitSpec(this, _dataLength, {
|
50
|
+
writable: true,
|
51
|
+
value: 0
|
52
|
+
});
|
45
53
|
/**
|
46
54
|
* Columns count limit value trims source settings to that value. If columns
|
47
55
|
* count limit intersects nested header, the header's colspan value is reduced
|
@@ -49,7 +57,10 @@ export default class SourceSettings {
|
|
49
57
|
*
|
50
58
|
* @type {number}
|
51
59
|
*/
|
52
|
-
_classPrivateFieldInitSpec(this, _columnsLimit,
|
60
|
+
_classPrivateFieldInitSpec(this, _columnsLimit, {
|
61
|
+
writable: true,
|
62
|
+
value: Infinity
|
63
|
+
});
|
53
64
|
}
|
54
65
|
/**
|
55
66
|
* Sets columns limit to the source settings will be trimmed. All headers which
|
@@ -58,7 +69,7 @@ export default class SourceSettings {
|
|
58
69
|
* @param {number} columnsCount The number of columns to limit to.
|
59
70
|
*/
|
60
71
|
setColumnsLimit(columnsCount) {
|
61
|
-
_classPrivateFieldSet(
|
72
|
+
_classPrivateFieldSet(this, _columnsLimit, columnsCount);
|
62
73
|
}
|
63
74
|
|
64
75
|
/**
|
@@ -68,8 +79,8 @@ export default class SourceSettings {
|
|
68
79
|
*/
|
69
80
|
setData() {
|
70
81
|
let nestedHeadersSettings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
71
|
-
_classPrivateFieldSet(
|
72
|
-
_classPrivateFieldSet(
|
82
|
+
_classPrivateFieldSet(this, _data, normalizeSettings(nestedHeadersSettings, _classPrivateFieldGet(this, _columnsLimit)));
|
83
|
+
_classPrivateFieldSet(this, _dataLength, _classPrivateFieldGet(this, _data).length);
|
73
84
|
}
|
74
85
|
|
75
86
|
/**
|
@@ -78,7 +89,7 @@ export default class SourceSettings {
|
|
78
89
|
* @returns {Array[]}
|
79
90
|
*/
|
80
91
|
getData() {
|
81
|
-
return _classPrivateFieldGet(
|
92
|
+
return _classPrivateFieldGet(this, _data);
|
82
93
|
}
|
83
94
|
|
84
95
|
/**
|
@@ -110,7 +121,7 @@ export default class SourceSettings {
|
|
110
121
|
* header settings.
|
111
122
|
*/
|
112
123
|
map(callback) {
|
113
|
-
arrayEach(_classPrivateFieldGet(
|
124
|
+
arrayEach(_classPrivateFieldGet(this, _data), header => {
|
114
125
|
arrayEach(header, headerSettings => {
|
115
126
|
const propsToExtend = callback({
|
116
127
|
...headerSettings
|
@@ -133,10 +144,10 @@ export default class SourceSettings {
|
|
133
144
|
*/
|
134
145
|
getHeaderSettings(headerLevel, columnIndex) {
|
135
146
|
var _headersSettings$colu;
|
136
|
-
if (headerLevel >= _classPrivateFieldGet(
|
147
|
+
if (headerLevel >= _classPrivateFieldGet(this, _dataLength) || headerLevel < 0) {
|
137
148
|
return null;
|
138
149
|
}
|
139
|
-
const headersSettings = _classPrivateFieldGet(
|
150
|
+
const headersSettings = _classPrivateFieldGet(this, _data)[headerLevel];
|
140
151
|
if (Array.isArray(headersSettings) === false || columnIndex >= headersSettings.length) {
|
141
152
|
return null;
|
142
153
|
}
|
@@ -156,10 +167,10 @@ export default class SourceSettings {
|
|
156
167
|
getHeadersSettings(headerLevel, columnIndex) {
|
157
168
|
let columnsLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
158
169
|
const headersSettingsChunks = [];
|
159
|
-
if (headerLevel >= _classPrivateFieldGet(
|
170
|
+
if (headerLevel >= _classPrivateFieldGet(this, _dataLength) || headerLevel < 0) {
|
160
171
|
return headersSettingsChunks;
|
161
172
|
}
|
162
|
-
const headersSettings = _classPrivateFieldGet(
|
173
|
+
const headersSettings = _classPrivateFieldGet(this, _data)[headerLevel];
|
163
174
|
let currentLength = 0;
|
164
175
|
for (let i = columnIndex; i < headersSettings.length; i++) {
|
165
176
|
const headerSettings = headersSettings[i];
|
@@ -190,7 +201,7 @@ export default class SourceSettings {
|
|
190
201
|
* @returns {number}
|
191
202
|
*/
|
192
203
|
getLayersCount() {
|
193
|
-
return _classPrivateFieldGet(
|
204
|
+
return _classPrivateFieldGet(this, _dataLength);
|
194
205
|
}
|
195
206
|
|
196
207
|
/**
|
@@ -199,14 +210,14 @@ export default class SourceSettings {
|
|
199
210
|
* @returns {number}
|
200
211
|
*/
|
201
212
|
getColumnsCount() {
|
202
|
-
return _classPrivateFieldGet(
|
213
|
+
return _classPrivateFieldGet(this, _dataLength) > 0 ? _classPrivateFieldGet(this, _data)[0].length : 0;
|
203
214
|
}
|
204
215
|
|
205
216
|
/**
|
206
217
|
* Clears the data.
|
207
218
|
*/
|
208
219
|
clear() {
|
209
|
-
_classPrivateFieldSet(
|
210
|
-
_classPrivateFieldSet(
|
220
|
+
_classPrivateFieldSet(this, _data, []);
|
221
|
+
_classPrivateFieldSet(this, _dataLength, 0);
|
211
222
|
}
|
212
223
|
}
|
@@ -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 _number = require("../../../helpers/number");
|
7
7
|
var _object = require("../../../helpers/object");
|
8
8
|
var _array = require("../../../helpers/array");
|
@@ -1,5 +1,5 @@
|
|
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 _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
4
4
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
5
5
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|