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
@@ -7,9 +7,11 @@ var _tree = _interopRequireDefault(require("../../../utils/dataStructures/tree")
|
|
7
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
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
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
14
16
|
/**
|
15
17
|
* @private
|
@@ -58,7 +60,10 @@ class HeadersTree {
|
|
58
60
|
* @private
|
59
61
|
* @type {Map<number, TreeNode>}
|
60
62
|
*/
|
61
|
-
_classPrivateFieldInitSpec(this, _rootNodes,
|
63
|
+
_classPrivateFieldInitSpec(this, _rootNodes, {
|
64
|
+
writable: true,
|
65
|
+
value: new Map()
|
66
|
+
});
|
62
67
|
/**
|
63
68
|
* A map that translates the visual column indexes that intersect the range
|
64
69
|
* defined by the header colspan width to the root index.
|
@@ -66,15 +71,21 @@ class HeadersTree {
|
|
66
71
|
* @private
|
67
72
|
* @type {Map<number, number>}
|
68
73
|
*/
|
69
|
-
_classPrivateFieldInitSpec(this, _rootsIndex,
|
74
|
+
_classPrivateFieldInitSpec(this, _rootsIndex, {
|
75
|
+
writable: true,
|
76
|
+
value: new Map()
|
77
|
+
});
|
70
78
|
/**
|
71
79
|
* The instance of the SourceSettings class.
|
72
80
|
*
|
73
81
|
* @private
|
74
82
|
* @type {SourceSettings}
|
75
83
|
*/
|
76
|
-
_classPrivateFieldInitSpec(this, _sourceSettings,
|
77
|
-
|
84
|
+
_classPrivateFieldInitSpec(this, _sourceSettings, {
|
85
|
+
writable: true,
|
86
|
+
value: null
|
87
|
+
});
|
88
|
+
_classPrivateFieldSet(this, _sourceSettings, sourceSettings);
|
78
89
|
}
|
79
90
|
|
80
91
|
/**
|
@@ -83,7 +94,7 @@ class HeadersTree {
|
|
83
94
|
* @returns {TreeNode[]}
|
84
95
|
*/
|
85
96
|
getRoots() {
|
86
|
-
return Array.from(_classPrivateFieldGet(
|
97
|
+
return Array.from(_classPrivateFieldGet(this, _rootNodes).values());
|
87
98
|
}
|
88
99
|
|
89
100
|
/**
|
@@ -94,8 +105,8 @@ class HeadersTree {
|
|
94
105
|
*/
|
95
106
|
getRootByColumn(columnIndex) {
|
96
107
|
let node;
|
97
|
-
if (_classPrivateFieldGet(
|
98
|
-
node = _classPrivateFieldGet(
|
108
|
+
if (_classPrivateFieldGet(this, _rootsIndex).has(columnIndex)) {
|
109
|
+
node = _classPrivateFieldGet(this, _rootNodes).get(_classPrivateFieldGet(this, _rootsIndex).get(columnIndex));
|
99
110
|
}
|
100
111
|
return node;
|
101
112
|
}
|
@@ -115,7 +126,7 @@ class HeadersTree {
|
|
115
126
|
|
116
127
|
// Normalize the visual column index to a 0-based system for a specific "box" defined
|
117
128
|
// by root node colspan width.
|
118
|
-
const normColumnIndex = columnIndex - _classPrivateFieldGet(
|
129
|
+
const normColumnIndex = columnIndex - _classPrivateFieldGet(this, _rootsIndex).get(columnIndex);
|
119
130
|
let columnCursor = 0;
|
120
131
|
let treeNode;
|
121
132
|
|
@@ -144,8 +155,8 @@ class HeadersTree {
|
|
144
155
|
*/
|
145
156
|
rebuildTreeIndex() {
|
146
157
|
let columnIndex = 0;
|
147
|
-
_classPrivateFieldGet(
|
148
|
-
(0, _array.arrayEach)(_classPrivateFieldGet(
|
158
|
+
_classPrivateFieldGet(this, _rootsIndex).clear();
|
159
|
+
(0, _array.arrayEach)(_classPrivateFieldGet(this, _rootNodes), _ref => {
|
149
160
|
let [, {
|
150
161
|
data: {
|
151
162
|
colspan
|
@@ -153,7 +164,7 @@ class HeadersTree {
|
|
153
164
|
}] = _ref;
|
154
165
|
// Map tree range (colspan range/width) into visual column index of the root node.
|
155
166
|
for (let i = columnIndex; i < columnIndex + colspan; i++) {
|
156
|
-
_classPrivateFieldGet(
|
167
|
+
_classPrivateFieldGet(this, _rootsIndex).set(i, columnIndex);
|
157
168
|
}
|
158
169
|
columnIndex += colspan;
|
159
170
|
});
|
@@ -165,12 +176,12 @@ class HeadersTree {
|
|
165
176
|
*/
|
166
177
|
buildTree() {
|
167
178
|
this.clear();
|
168
|
-
const columnsCount = _classPrivateFieldGet(
|
179
|
+
const columnsCount = _classPrivateFieldGet(this, _sourceSettings).getColumnsCount();
|
169
180
|
let columnIndex = 0;
|
170
181
|
while (columnIndex < columnsCount) {
|
171
|
-
const columnSettings = _classPrivateFieldGet(
|
182
|
+
const columnSettings = _classPrivateFieldGet(this, _sourceSettings).getHeaderSettings(0, columnIndex);
|
172
183
|
const rootNode = new _tree.default();
|
173
|
-
_classPrivateFieldGet(
|
184
|
+
_classPrivateFieldGet(this, _rootNodes).set(columnIndex, rootNode);
|
174
185
|
this.buildLeaves(rootNode, columnIndex, 0, columnSettings.origColspan);
|
175
186
|
columnIndex += columnSettings.origColspan;
|
176
187
|
}
|
@@ -187,7 +198,7 @@ class HeadersTree {
|
|
187
198
|
*/
|
188
199
|
buildLeaves(parentNode, columnIndex, headerLevel) {
|
189
200
|
let extractionLength = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
190
|
-
const columnsSettings = _classPrivateFieldGet(
|
201
|
+
const columnsSettings = _classPrivateFieldGet(this, _sourceSettings).getHeadersSettings(headerLevel, columnIndex, extractionLength);
|
191
202
|
headerLevel += 1;
|
192
203
|
(0, _array.arrayEach)(columnsSettings, columnSettings => {
|
193
204
|
const nodeData = {
|
@@ -214,7 +225,7 @@ class HeadersTree {
|
|
214
225
|
node = new _tree.default(nodeData);
|
215
226
|
parentNode.addChild(node);
|
216
227
|
}
|
217
|
-
if (headerLevel < _classPrivateFieldGet(
|
228
|
+
if (headerLevel < _classPrivateFieldGet(this, _sourceSettings).getLayersCount()) {
|
218
229
|
this.buildLeaves(node, columnIndex, headerLevel, columnSettings.origColspan);
|
219
230
|
}
|
220
231
|
columnIndex += columnSettings.origColspan;
|
@@ -225,8 +236,8 @@ class HeadersTree {
|
|
225
236
|
* Clears the tree to the initial state.
|
226
237
|
*/
|
227
238
|
clear() {
|
228
|
-
_classPrivateFieldGet(
|
229
|
-
_classPrivateFieldGet(
|
239
|
+
_classPrivateFieldGet(this, _rootNodes).clear();
|
240
|
+
_classPrivateFieldGet(this, _rootsIndex).clear();
|
230
241
|
}
|
231
242
|
}
|
232
243
|
exports.default = HeadersTree;
|
@@ -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 { arrayEach } from "../../../helpers/array.mjs";
|
8
10
|
import TreeNode from "../../../utils/dataStructures/tree.mjs";
|
9
11
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
@@ -54,7 +56,10 @@ export default class HeadersTree {
|
|
54
56
|
* @private
|
55
57
|
* @type {Map<number, TreeNode>}
|
56
58
|
*/
|
57
|
-
_classPrivateFieldInitSpec(this, _rootNodes,
|
59
|
+
_classPrivateFieldInitSpec(this, _rootNodes, {
|
60
|
+
writable: true,
|
61
|
+
value: new Map()
|
62
|
+
});
|
58
63
|
/**
|
59
64
|
* A map that translates the visual column indexes that intersect the range
|
60
65
|
* defined by the header colspan width to the root index.
|
@@ -62,15 +67,21 @@ export default class HeadersTree {
|
|
62
67
|
* @private
|
63
68
|
* @type {Map<number, number>}
|
64
69
|
*/
|
65
|
-
_classPrivateFieldInitSpec(this, _rootsIndex,
|
70
|
+
_classPrivateFieldInitSpec(this, _rootsIndex, {
|
71
|
+
writable: true,
|
72
|
+
value: new Map()
|
73
|
+
});
|
66
74
|
/**
|
67
75
|
* The instance of the SourceSettings class.
|
68
76
|
*
|
69
77
|
* @private
|
70
78
|
* @type {SourceSettings}
|
71
79
|
*/
|
72
|
-
_classPrivateFieldInitSpec(this, _sourceSettings,
|
73
|
-
|
80
|
+
_classPrivateFieldInitSpec(this, _sourceSettings, {
|
81
|
+
writable: true,
|
82
|
+
value: null
|
83
|
+
});
|
84
|
+
_classPrivateFieldSet(this, _sourceSettings, sourceSettings);
|
74
85
|
}
|
75
86
|
|
76
87
|
/**
|
@@ -79,7 +90,7 @@ export default class HeadersTree {
|
|
79
90
|
* @returns {TreeNode[]}
|
80
91
|
*/
|
81
92
|
getRoots() {
|
82
|
-
return Array.from(_classPrivateFieldGet(
|
93
|
+
return Array.from(_classPrivateFieldGet(this, _rootNodes).values());
|
83
94
|
}
|
84
95
|
|
85
96
|
/**
|
@@ -90,8 +101,8 @@ export default class HeadersTree {
|
|
90
101
|
*/
|
91
102
|
getRootByColumn(columnIndex) {
|
92
103
|
let node;
|
93
|
-
if (_classPrivateFieldGet(
|
94
|
-
node = _classPrivateFieldGet(
|
104
|
+
if (_classPrivateFieldGet(this, _rootsIndex).has(columnIndex)) {
|
105
|
+
node = _classPrivateFieldGet(this, _rootNodes).get(_classPrivateFieldGet(this, _rootsIndex).get(columnIndex));
|
95
106
|
}
|
96
107
|
return node;
|
97
108
|
}
|
@@ -111,7 +122,7 @@ export default class HeadersTree {
|
|
111
122
|
|
112
123
|
// Normalize the visual column index to a 0-based system for a specific "box" defined
|
113
124
|
// by root node colspan width.
|
114
|
-
const normColumnIndex = columnIndex - _classPrivateFieldGet(
|
125
|
+
const normColumnIndex = columnIndex - _classPrivateFieldGet(this, _rootsIndex).get(columnIndex);
|
115
126
|
let columnCursor = 0;
|
116
127
|
let treeNode;
|
117
128
|
|
@@ -140,8 +151,8 @@ export default class HeadersTree {
|
|
140
151
|
*/
|
141
152
|
rebuildTreeIndex() {
|
142
153
|
let columnIndex = 0;
|
143
|
-
_classPrivateFieldGet(
|
144
|
-
arrayEach(_classPrivateFieldGet(
|
154
|
+
_classPrivateFieldGet(this, _rootsIndex).clear();
|
155
|
+
arrayEach(_classPrivateFieldGet(this, _rootNodes), _ref => {
|
145
156
|
let [, {
|
146
157
|
data: {
|
147
158
|
colspan
|
@@ -149,7 +160,7 @@ export default class HeadersTree {
|
|
149
160
|
}] = _ref;
|
150
161
|
// Map tree range (colspan range/width) into visual column index of the root node.
|
151
162
|
for (let i = columnIndex; i < columnIndex + colspan; i++) {
|
152
|
-
_classPrivateFieldGet(
|
163
|
+
_classPrivateFieldGet(this, _rootsIndex).set(i, columnIndex);
|
153
164
|
}
|
154
165
|
columnIndex += colspan;
|
155
166
|
});
|
@@ -161,12 +172,12 @@ export default class HeadersTree {
|
|
161
172
|
*/
|
162
173
|
buildTree() {
|
163
174
|
this.clear();
|
164
|
-
const columnsCount = _classPrivateFieldGet(
|
175
|
+
const columnsCount = _classPrivateFieldGet(this, _sourceSettings).getColumnsCount();
|
165
176
|
let columnIndex = 0;
|
166
177
|
while (columnIndex < columnsCount) {
|
167
|
-
const columnSettings = _classPrivateFieldGet(
|
178
|
+
const columnSettings = _classPrivateFieldGet(this, _sourceSettings).getHeaderSettings(0, columnIndex);
|
168
179
|
const rootNode = new TreeNode();
|
169
|
-
_classPrivateFieldGet(
|
180
|
+
_classPrivateFieldGet(this, _rootNodes).set(columnIndex, rootNode);
|
170
181
|
this.buildLeaves(rootNode, columnIndex, 0, columnSettings.origColspan);
|
171
182
|
columnIndex += columnSettings.origColspan;
|
172
183
|
}
|
@@ -183,7 +194,7 @@ export default class HeadersTree {
|
|
183
194
|
*/
|
184
195
|
buildLeaves(parentNode, columnIndex, headerLevel) {
|
185
196
|
let extractionLength = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
186
|
-
const columnsSettings = _classPrivateFieldGet(
|
197
|
+
const columnsSettings = _classPrivateFieldGet(this, _sourceSettings).getHeadersSettings(headerLevel, columnIndex, extractionLength);
|
187
198
|
headerLevel += 1;
|
188
199
|
arrayEach(columnsSettings, columnSettings => {
|
189
200
|
const nodeData = {
|
@@ -210,7 +221,7 @@ export default class HeadersTree {
|
|
210
221
|
node = new TreeNode(nodeData);
|
211
222
|
parentNode.addChild(node);
|
212
223
|
}
|
213
|
-
if (headerLevel < _classPrivateFieldGet(
|
224
|
+
if (headerLevel < _classPrivateFieldGet(this, _sourceSettings).getLayersCount()) {
|
214
225
|
this.buildLeaves(node, columnIndex, headerLevel, columnSettings.origColspan);
|
215
226
|
}
|
216
227
|
columnIndex += columnSettings.origColspan;
|
@@ -221,7 +232,7 @@ export default class HeadersTree {
|
|
221
232
|
* Clears the tree to the initial state.
|
222
233
|
*/
|
223
234
|
clear() {
|
224
|
-
_classPrivateFieldGet(
|
225
|
-
_classPrivateFieldGet(
|
235
|
+
_classPrivateFieldGet(this, _rootNodes).clear();
|
236
|
+
_classPrivateFieldGet(this, _rootsIndex).clear();
|
226
237
|
}
|
227
238
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
exports.__esModule = true;
|
4
3
|
require("core-js/modules/es.error.cause.js");
|
4
|
+
exports.__esModule = true;
|
5
5
|
require("core-js/modules/es.array.push.js");
|
6
6
|
var _array = require("../../../helpers/array");
|
7
7
|
var _sourceSettings2 = _interopRequireDefault(require("./sourceSettings"));
|
@@ -12,9 +12,11 @@ var _tree = require("../../../utils/dataStructures/tree");
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
13
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
14
14
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
15
|
-
function _classPrivateFieldSet(
|
16
|
-
function
|
17
|
-
function
|
15
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
16
|
+
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
17
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
18
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
19
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
18
20
|
/**
|
19
21
|
* The state manager is a source of truth for nested headers configuration.
|
20
22
|
* The state generation process is divided into three stages.
|
@@ -54,21 +56,30 @@ class StateManager {
|
|
54
56
|
* @private
|
55
57
|
* @type {SourceSettings}
|
56
58
|
*/
|
57
|
-
_classPrivateFieldInitSpec(this, _sourceSettings,
|
59
|
+
_classPrivateFieldInitSpec(this, _sourceSettings, {
|
60
|
+
writable: true,
|
61
|
+
value: new _sourceSettings2.default()
|
62
|
+
});
|
58
63
|
/**
|
59
64
|
* The instance of the headers tree. The tree is generated after setting new configuration data.
|
60
65
|
*
|
61
66
|
* @private
|
62
67
|
* @type {HeadersTree}
|
63
68
|
*/
|
64
|
-
_classPrivateFieldInitSpec(this, _headersTree,
|
69
|
+
_classPrivateFieldInitSpec(this, _headersTree, {
|
70
|
+
writable: true,
|
71
|
+
value: new _headersTree2.default(_classPrivateFieldGet(this, _sourceSettings))
|
72
|
+
});
|
65
73
|
/**
|
66
74
|
* Cached matrix which is generated from the tree structure.
|
67
75
|
*
|
68
76
|
* @private
|
69
77
|
* @type {Array[]}
|
70
78
|
*/
|
71
|
-
_classPrivateFieldInitSpec(this, _stateMatrix,
|
79
|
+
_classPrivateFieldInitSpec(this, _stateMatrix, {
|
80
|
+
writable: true,
|
81
|
+
value: [[]]
|
82
|
+
});
|
72
83
|
}
|
73
84
|
/**
|
74
85
|
* Sets a new state for the nested headers plugin based on settings passed
|
@@ -78,16 +89,16 @@ class StateManager {
|
|
78
89
|
* @returns {boolean} Returns `true` if the settings are processed correctly, `false` otherwise.
|
79
90
|
*/
|
80
91
|
setState(nestedHeadersSettings) {
|
81
|
-
_classPrivateFieldGet(
|
92
|
+
_classPrivateFieldGet(this, _sourceSettings).setData(nestedHeadersSettings);
|
82
93
|
let hasError = false;
|
83
94
|
try {
|
84
|
-
_classPrivateFieldGet(
|
95
|
+
_classPrivateFieldGet(this, _headersTree).buildTree();
|
85
96
|
} catch (ex) {
|
86
|
-
_classPrivateFieldGet(
|
87
|
-
_classPrivateFieldGet(
|
97
|
+
_classPrivateFieldGet(this, _headersTree).clear();
|
98
|
+
_classPrivateFieldGet(this, _sourceSettings).clear();
|
88
99
|
hasError = true;
|
89
100
|
}
|
90
|
-
_classPrivateFieldSet(
|
101
|
+
_classPrivateFieldSet(this, _stateMatrix, (0, _matrixGenerator.generateMatrix)(_classPrivateFieldGet(this, _headersTree).getRoots()));
|
91
102
|
return hasError;
|
92
103
|
}
|
93
104
|
|
@@ -98,7 +109,7 @@ class StateManager {
|
|
98
109
|
* @param {number} columnsCount The number of columns to limit to.
|
99
110
|
*/
|
100
111
|
setColumnsLimit(columnsCount) {
|
101
|
-
_classPrivateFieldGet(
|
112
|
+
_classPrivateFieldGet(this, _sourceSettings).setColumnsLimit(columnsCount);
|
102
113
|
}
|
103
114
|
|
104
115
|
/**
|
@@ -122,9 +133,9 @@ class StateManager {
|
|
122
133
|
...rest
|
123
134
|
};
|
124
135
|
});
|
125
|
-
_classPrivateFieldGet(
|
126
|
-
_classPrivateFieldGet(
|
127
|
-
_classPrivateFieldSet(
|
136
|
+
_classPrivateFieldGet(this, _sourceSettings).mergeWith(transformedSettings);
|
137
|
+
_classPrivateFieldGet(this, _headersTree).buildTree();
|
138
|
+
_classPrivateFieldSet(this, _stateMatrix, (0, _matrixGenerator.generateMatrix)(_classPrivateFieldGet(this, _headersTree).getRoots()));
|
128
139
|
}
|
129
140
|
|
130
141
|
/**
|
@@ -139,9 +150,9 @@ class StateManager {
|
|
139
150
|
* header settings.
|
140
151
|
*/
|
141
152
|
mapState(callback) {
|
142
|
-
_classPrivateFieldGet(
|
143
|
-
_classPrivateFieldGet(
|
144
|
-
_classPrivateFieldSet(
|
153
|
+
_classPrivateFieldGet(this, _sourceSettings).map(callback);
|
154
|
+
_classPrivateFieldGet(this, _headersTree).buildTree();
|
155
|
+
_classPrivateFieldSet(this, _stateMatrix, (0, _matrixGenerator.generateMatrix)(_classPrivateFieldGet(this, _headersTree).getRoots()));
|
145
156
|
}
|
146
157
|
|
147
158
|
/**
|
@@ -154,7 +165,7 @@ class StateManager {
|
|
154
165
|
* @returns {Array}
|
155
166
|
*/
|
156
167
|
mapNodes(callback) {
|
157
|
-
return (0, _array.arrayReduce)(_classPrivateFieldGet(
|
168
|
+
return (0, _array.arrayReduce)(_classPrivateFieldGet(this, _headersTree).getRoots(), (acc, rootNode) => {
|
158
169
|
rootNode.walkDown(node => {
|
159
170
|
const result = callback(node.data);
|
160
171
|
if (result !== undefined) {
|
@@ -179,13 +190,13 @@ class StateManager {
|
|
179
190
|
if (headerLevel < 0) {
|
180
191
|
headerLevel = this.rowCoordsToLevel(headerLevel);
|
181
192
|
}
|
182
|
-
const nodeToProcess = _classPrivateFieldGet(
|
193
|
+
const nodeToProcess = _classPrivateFieldGet(this, _headersTree).getNode(headerLevel, columnIndex);
|
183
194
|
let actionResult;
|
184
195
|
if (nodeToProcess) {
|
185
196
|
actionResult = (0, _nodeModifiers.triggerNodeModification)(action, nodeToProcess, columnIndex);
|
186
197
|
|
187
198
|
// TODO (perf-tip): Trigger matrix generation once after multiple node modifications.
|
188
|
-
_classPrivateFieldSet(
|
199
|
+
_classPrivateFieldSet(this, _stateMatrix, (0, _matrixGenerator.generateMatrix)(_classPrivateFieldGet(this, _headersTree).getRoots()));
|
189
200
|
}
|
190
201
|
return actionResult;
|
191
202
|
}
|
@@ -294,7 +305,7 @@ class StateManager {
|
|
294
305
|
if (headerLevel === null || headerLevel >= this.getLayersCount()) {
|
295
306
|
return null;
|
296
307
|
}
|
297
|
-
return (_classPrivateFieldGet2 = (_classPrivateFieldGet3 = _classPrivateFieldGet(
|
308
|
+
return (_classPrivateFieldGet2 = (_classPrivateFieldGet3 = _classPrivateFieldGet(this, _stateMatrix)[headerLevel]) === null || _classPrivateFieldGet3 === void 0 ? void 0 : _classPrivateFieldGet3[columnIndex]) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : null;
|
298
309
|
}
|
299
310
|
|
300
311
|
/**
|
@@ -330,7 +341,7 @@ class StateManager {
|
|
330
341
|
if (headerLevel === null || headerLevel >= this.getLayersCount()) {
|
331
342
|
return null;
|
332
343
|
}
|
333
|
-
const node = _classPrivateFieldGet(
|
344
|
+
const node = _classPrivateFieldGet(this, _headersTree).getNode(headerLevel, columnIndex);
|
334
345
|
if (!node) {
|
335
346
|
return null;
|
336
347
|
}
|
@@ -353,7 +364,7 @@ class StateManager {
|
|
353
364
|
let atLeastOneRootFound = false;
|
354
365
|
let headerLevel = null;
|
355
366
|
for (let columnIndex = columnIndexFrom; columnIndex <= columnIndexTo; columnIndex++) {
|
356
|
-
const rootNode = _classPrivateFieldGet(
|
367
|
+
const rootNode = _classPrivateFieldGet(this, _headersTree).getRootByColumn(columnIndex);
|
357
368
|
if (!rootNode) {
|
358
369
|
break;
|
359
370
|
}
|
@@ -461,7 +472,7 @@ class StateManager {
|
|
461
472
|
* @returns {number}
|
462
473
|
*/
|
463
474
|
getLayersCount() {
|
464
|
-
return _classPrivateFieldGet(
|
475
|
+
return _classPrivateFieldGet(this, _sourceSettings).getLayersCount();
|
465
476
|
}
|
466
477
|
|
467
478
|
/**
|
@@ -470,16 +481,16 @@ class StateManager {
|
|
470
481
|
* @returns {number}
|
471
482
|
*/
|
472
483
|
getColumnsCount() {
|
473
|
-
return _classPrivateFieldGet(
|
484
|
+
return _classPrivateFieldGet(this, _sourceSettings).getColumnsCount();
|
474
485
|
}
|
475
486
|
|
476
487
|
/**
|
477
488
|
* Clears the column state manager to the initial state.
|
478
489
|
*/
|
479
490
|
clear() {
|
480
|
-
_classPrivateFieldSet(
|
481
|
-
_classPrivateFieldGet(
|
482
|
-
_classPrivateFieldGet(
|
491
|
+
_classPrivateFieldSet(this, _stateMatrix, []);
|
492
|
+
_classPrivateFieldGet(this, _sourceSettings).clear();
|
493
|
+
_classPrivateFieldGet(this, _headersTree).clear();
|
483
494
|
}
|
484
495
|
}
|
485
496
|
exports.default = StateManager;
|