handsontable 0.0.0-next-2becb78-20240313 → 0.0.0-next-bff5041-20240315
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +12 -17
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +12 -17
- package/3rdparty/walkontable/src/calculator/viewportRows.js +10 -15
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +10 -15
- package/3rdparty/walkontable/src/cell/coords.js +12 -17
- package/3rdparty/walkontable/src/cell/coords.mjs +12 -17
- package/3rdparty/walkontable/src/cell/range.d.ts +0 -1
- package/3rdparty/walkontable/src/cell/range.js +23 -45
- package/3rdparty/walkontable/src/cell/range.mjs +23 -45
- package/3rdparty/walkontable/src/core/_base.js +1 -1
- package/3rdparty/walkontable/src/core/_base.mjs +1 -1
- package/3rdparty/walkontable/src/event.js +72 -104
- package/3rdparty/walkontable/src/event.mjs +72 -104
- package/3rdparty/walkontable/src/overlays.js +1 -1
- package/3rdparty/walkontable/src/overlays.mjs +1 -1
- package/3rdparty/walkontable/src/scroll.js +15 -17
- package/3rdparty/walkontable/src/scroll.mjs +15 -17
- package/3rdparty/walkontable/src/selection/manager.js +48 -69
- package/3rdparty/walkontable/src/selection/manager.mjs +48 -69
- package/3rdparty/walkontable/src/selection/scanner.js +33 -42
- package/3rdparty/walkontable/src/selection/scanner.mjs +33 -42
- package/3rdparty/walkontable/src/utils/columnStretching.js +27 -44
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +27 -44
- package/3rdparty/walkontable/src/utils/orderView/view.js +1 -1
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +1 -1
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/viewportScroll/index.js +1 -4
- package/core/viewportScroll/index.mjs +1 -4
- package/core.d.ts +3 -4
- package/core.js +22 -82
- package/core.mjs +22 -82
- package/dataMap/dataSource.js +1 -1
- package/dataMap/dataSource.mjs +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +1 -1
- package/dataMap/replaceData.js +1 -1
- package/dataMap/replaceData.mjs +1 -1
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +7619 -10404
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +277 -277
- package/dist/handsontable.js +5525 -7857
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +33 -33
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +21 -27
- package/editorManager.mjs +21 -27
- package/editors/autocompleteEditor/autocompleteEditor.js +6 -10
- package/editors/autocompleteEditor/autocompleteEditor.mjs +6 -10
- package/eventManager.js +1 -1
- package/eventManager.mjs +1 -1
- package/focusManager.js +58 -82
- package/focusManager.mjs +58 -82
- package/helpers/dom/element.js +1 -1
- package/helpers/dom/element.mjs +1 -1
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/object.js +2 -2
- package/helpers/object.mjs +2 -2
- package/index.d.ts +10 -0
- package/package.json +2 -1
- package/pluginHooks.d.ts +0 -4
- package/pluginHooks.js +2 -44
- package/pluginHooks.mjs +2 -44
- package/plugins/autoColumnSize/autoColumnSize.js +49 -65
- package/plugins/autoColumnSize/autoColumnSize.mjs +49 -65
- package/plugins/autoRowSize/autoRowSize.js +28 -34
- package/plugins/autoRowSize/autoRowSize.mjs +28 -34
- package/plugins/autofill/autofill.js +30 -38
- package/plugins/autofill/autofill.mjs +30 -38
- package/plugins/base/base.js +12 -17
- package/plugins/base/base.mjs +12 -17
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
- package/plugins/collapsibleColumns/collapsibleColumns.js +36 -54
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +36 -54
- package/plugins/columnSorting/columnSorting.js +40 -46
- package/plugins/columnSorting/columnSorting.mjs +40 -46
- package/plugins/columnSummary/columnSummary.js +22 -26
- package/plugins/columnSummary/columnSummary.mjs +22 -26
- package/plugins/comments/comments.js +116 -158
- package/plugins/comments/comments.mjs +116 -158
- package/plugins/contextMenu/contextMenu.js +20 -26
- package/plugins/contextMenu/contextMenu.mjs +20 -26
- package/plugins/contextMenu/itemsFactory.js +1 -1
- package/plugins/contextMenu/itemsFactory.mjs +1 -1
- package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
- package/plugins/contextMenu/menu/menu.js +13 -21
- package/plugins/contextMenu/menu/menu.mjs +13 -21
- package/plugins/contextMenu/menu/positioner.js +41 -58
- package/plugins/contextMenu/menu/positioner.mjs +41 -58
- package/plugins/copyPaste/copyPaste.js +113 -154
- package/plugins/copyPaste/copyPaste.mjs +113 -154
- package/plugins/copyPaste/copyableRanges.js +43 -66
- package/plugins/copyPaste/copyableRanges.mjs +43 -66
- package/plugins/customBorders/customBorders.js +11 -13
- package/plugins/customBorders/customBorders.mjs +11 -13
- package/plugins/dragToScroll/dragToScroll.js +6 -6
- package/plugins/dragToScroll/dragToScroll.mjs +6 -6
- package/plugins/dropdownMenu/dropdownMenu.js +78 -100
- package/plugins/dropdownMenu/dropdownMenu.mjs +78 -100
- package/plugins/exportFile/dataProvider.js +1 -1
- package/plugins/exportFile/dataProvider.mjs +1 -1
- package/plugins/filters/component/actionBar.js +9 -9
- package/plugins/filters/component/actionBar.mjs +8 -8
- package/plugins/filters/component/condition.js +13 -15
- package/plugins/filters/component/condition.mjs +13 -15
- package/plugins/filters/component/operators.js +6 -6
- package/plugins/filters/component/operators.mjs +6 -6
- package/plugins/filters/component/value.js +24 -28
- package/plugins/filters/component/value.mjs +24 -28
- package/plugins/filters/conditionUpdateObserver.js +22 -24
- package/plugins/filters/conditionUpdateObserver.mjs +22 -24
- package/plugins/filters/dataFilter.js +1 -1
- package/plugins/filters/dataFilter.mjs +1 -1
- package/plugins/filters/filters.js +81 -95
- package/plugins/filters/filters.mjs +81 -95
- package/plugins/filters/ui/input.js +13 -19
- package/plugins/filters/ui/input.mjs +13 -19
- package/plugins/filters/ui/link.js +8 -13
- package/plugins/filters/ui/link.mjs +8 -13
- package/plugins/filters/ui/multipleSelect.js +85 -112
- package/plugins/filters/ui/multipleSelect.mjs +85 -112
- package/plugins/filters/ui/radioInput.js +12 -20
- package/plugins/filters/ui/radioInput.mjs +12 -20
- package/plugins/filters/ui/select.js +50 -72
- package/plugins/filters/ui/select.mjs +49 -71
- package/plugins/formulas/formulas.js +268 -326
- package/plugins/formulas/formulas.mjs +269 -327
- package/plugins/formulas/indexSyncer/axisSyncer.js +38 -61
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +38 -61
- package/plugins/formulas/indexSyncer/index.js +25 -48
- package/plugins/formulas/indexSyncer/index.mjs +25 -48
- package/plugins/hiddenColumns/hiddenColumns.js +64 -83
- package/plugins/hiddenColumns/hiddenColumns.mjs +64 -83
- package/plugins/hiddenRows/hiddenRows.js +63 -82
- package/plugins/hiddenRows/hiddenRows.mjs +63 -82
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +24 -32
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +25 -33
- package/plugins/manualColumnMove/manualColumnMove.js +126 -170
- package/plugins/manualColumnMove/manualColumnMove.mjs +126 -170
- package/plugins/manualColumnResize/manualColumnResize.js +169 -230
- package/plugins/manualColumnResize/manualColumnResize.mjs +169 -230
- package/plugins/manualRowMove/manualRowMove.js +99 -128
- package/plugins/manualRowMove/manualRowMove.mjs +99 -128
- package/plugins/manualRowResize/manualRowResize.js +150 -209
- package/plugins/manualRowResize/manualRowResize.mjs +150 -209
- package/plugins/mergeCells/calculations/selection.js +71 -2
- package/plugins/mergeCells/calculations/selection.mjs +71 -2
- package/plugins/mergeCells/cellsCollection.js +1 -117
- package/plugins/mergeCells/cellsCollection.mjs +1 -117
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
- package/plugins/mergeCells/mergeCells.js +353 -593
- package/plugins/mergeCells/mergeCells.mjs +353 -593
- package/plugins/multiColumnSorting/multiColumnSorting.js +0 -6
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +0 -6
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
- package/plugins/nestedHeaders/nestedHeaders.js +204 -254
- package/plugins/nestedHeaders/nestedHeaders.mjs +205 -255
- package/plugins/nestedHeaders/stateManager/headersTree.js +21 -32
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +21 -32
- package/plugins/nestedHeaders/stateManager/index.js +30 -41
- package/plugins/nestedHeaders/stateManager/index.mjs +30 -41
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +19 -30
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +19 -30
- package/plugins/nestedRows/data/dataManager.js +1 -1
- package/plugins/nestedRows/data/dataManager.mjs +1 -1
- package/plugins/nestedRows/nestedRows.js +138 -179
- package/plugins/nestedRows/nestedRows.mjs +139 -180
- package/plugins/nestedRows/ui/contextMenu.js +11 -15
- package/plugins/nestedRows/ui/contextMenu.mjs +10 -14
- package/plugins/nestedRows/utils/rowMoveController.js +1 -1
- package/plugins/nestedRows/utils/rowMoveController.mjs +1 -1
- package/plugins/persistentState/storage.js +2 -2
- package/plugins/persistentState/storage.mjs +2 -2
- package/plugins/search/search.js +7 -7
- package/plugins/search/search.mjs +7 -7
- package/plugins/touchScroll/touchScroll.js +15 -19
- package/plugins/touchScroll/touchScroll.mjs +16 -20
- package/plugins/trimRows/trimRows.js +6 -6
- package/plugins/trimRows/trimRows.mjs +6 -6
- package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
- package/selection/highlight/highlight.js +14 -14
- package/selection/highlight/highlight.mjs +13 -13
- package/selection/highlight/visualSelection.js +2 -16
- package/selection/highlight/visualSelection.mjs +2 -16
- package/selection/selection.js +60 -255
- package/selection/selection.mjs +59 -254
- package/selection/transformation.js +101 -175
- package/selection/transformation.mjs +101 -175
- package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
- package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
- package/shortcutContexts/commands/editor/open.js +3 -18
- package/shortcutContexts/commands/editor/open.mjs +3 -18
- package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
- package/shortcutContexts/grid.js +2 -2
- package/shortcutContexts/grid.mjs +2 -2
- package/shortcuts/context.js +1 -2
- package/shortcuts/context.mjs +1 -2
- package/tableView.js +52 -98
- package/tableView.mjs +52 -98
- package/translations/changesObservable/observable.js +21 -38
- package/translations/changesObservable/observable.mjs +21 -38
- package/translations/changesObservable/observer.js +7 -12
- package/translations/changesObservable/observer.mjs +6 -11
- package/translations/mapCollections/aggregatedCollection.js +1 -1
- package/translations/mapCollections/aggregatedCollection.mjs +1 -1
- package/translations/maps/indexMap.js +1 -1
- package/translations/maps/indexMap.mjs +1 -1
- package/utils/dataStructures/linkedList.js +1 -6
- package/utils/dataStructures/linkedList.mjs +1 -6
- package/utils/dataStructures/tree.js +1 -1
- package/utils/dataStructures/tree.mjs +1 -1
- package/utils/interval.js +26 -44
- package/utils/interval.mjs +26 -44
- package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
- package/plugins/mergeCells/focusOrder.js +0 -327
- package/plugins/mergeCells/focusOrder.mjs +0 -322
@@ -19,12 +19,9 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
19
19
|
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); }
|
20
20
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
21
21
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
22
|
-
function _classPrivateFieldSet(
|
23
|
-
function
|
24
|
-
function
|
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 _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
27
|
-
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
22
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
23
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
24
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
28
25
|
const PLUGIN_KEY = exports.PLUGIN_KEY = 'nestedHeaders';
|
29
26
|
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 280;
|
30
27
|
|
@@ -77,203 +74,40 @@ var _stateManager = /*#__PURE__*/new WeakMap();
|
|
77
74
|
var _hidingIndexMapObserver = /*#__PURE__*/new WeakMap();
|
78
75
|
var _focusInitialCoords = /*#__PURE__*/new WeakMap();
|
79
76
|
var _isColumnsSelectionInProgress = /*#__PURE__*/new WeakMap();
|
80
|
-
var
|
81
|
-
var _onBeforeViewportScrollHorizontally = /*#__PURE__*/new WeakSet();
|
82
|
-
var _onBeforeHighlightingColumnHeader = /*#__PURE__*/new WeakSet();
|
83
|
-
var _onBeforeCopy = /*#__PURE__*/new WeakSet();
|
84
|
-
var _onBeforeOnCellMouseDown = /*#__PURE__*/new WeakSet();
|
85
|
-
var _onAfterOnCellMouseDown = /*#__PURE__*/new WeakSet();
|
86
|
-
var _onBeforeOnCellMouseOver = /*#__PURE__*/new WeakSet();
|
87
|
-
var _onBeforeOnCellMouseUp = /*#__PURE__*/new WeakSet();
|
88
|
-
var _onBeforeSelectionHighlightSet = /*#__PURE__*/new WeakSet();
|
89
|
-
var _onModifyTransformStart = /*#__PURE__*/new WeakSet();
|
90
|
-
var _onBeforeSelectColumns = /*#__PURE__*/new WeakSet();
|
91
|
-
var _onAfterGetColumnHeaderRenderers = /*#__PURE__*/new WeakSet();
|
92
|
-
var _onAfterViewportColumnCalculatorOverride = /*#__PURE__*/new WeakSet();
|
93
|
-
var _onModifyColWidth = /*#__PURE__*/new WeakSet();
|
94
|
-
var _onModifyColumnHeaderValue = /*#__PURE__*/new WeakSet();
|
95
|
-
var _onModifyFocusedElement = /*#__PURE__*/new WeakSet();
|
96
|
-
var _onInit = /*#__PURE__*/new WeakSet();
|
97
|
-
var _onAfterLoadData = /*#__PURE__*/new WeakSet();
|
77
|
+
var _NestedHeaders_brand = /*#__PURE__*/new WeakSet();
|
98
78
|
class NestedHeaders extends _base.BasePlugin {
|
99
79
|
constructor() {
|
100
80
|
super(...arguments);
|
101
|
-
/**
|
102
|
-
* Updates the plugin state after new dataset load.
|
103
|
-
*
|
104
|
-
* @param {Array[]} sourceData Array of arrays or array of objects containing data.
|
105
|
-
* @param {boolean} initialLoad Flag that determines whether the data has been loaded
|
106
|
-
* during the initialization.
|
107
|
-
*/
|
108
|
-
_classPrivateMethodInitSpec(this, _onAfterLoadData);
|
109
|
-
/**
|
110
|
-
* Updates the plugin state after HoT initialization.
|
111
|
-
*/
|
112
|
-
_classPrivateMethodInitSpec(this, _onInit);
|
113
|
-
/**
|
114
|
-
* `modifyFocusedElement` hook callback.
|
115
|
-
*
|
116
|
-
* @param {number} row Row index.
|
117
|
-
* @param {number} column Column index.
|
118
|
-
* @returns {HTMLTableCellElement} The `TH` element to be focused.
|
119
|
-
*/
|
120
|
-
_classPrivateMethodInitSpec(this, _onModifyFocusedElement);
|
121
|
-
/**
|
122
|
-
* Listens the `modifyColumnHeaderValue` hook that overwrites the column headers values based on
|
123
|
-
* the internal state and settings of the plugin.
|
124
|
-
*
|
125
|
-
* @param {string} value The column header value.
|
126
|
-
* @param {number} visualColumnIndex The visual column index.
|
127
|
-
* @param {number} headerLevel The index of header level. The header level accepts positive (0 to N)
|
128
|
-
* and negative (-1 to -N) values. For positive values, 0 points to the
|
129
|
-
* top most header, and for negative direction, -1 points to the most bottom
|
130
|
-
* header (the header closest to the cells).
|
131
|
-
* @returns {string} Returns the column header value to update.
|
132
|
-
*/
|
133
|
-
_classPrivateMethodInitSpec(this, _onModifyColumnHeaderValue);
|
134
|
-
/**
|
135
|
-
* `modifyColWidth` hook callback - returns width from cache, when is greater than incoming from hook.
|
136
|
-
*
|
137
|
-
* @param {number} width Width from hook.
|
138
|
-
* @param {number} column Visual index of an column.
|
139
|
-
* @returns {number}
|
140
|
-
*/
|
141
|
-
_classPrivateMethodInitSpec(this, _onModifyColWidth);
|
142
|
-
/**
|
143
|
-
* Make the renderer render the first nested column in its entirety.
|
144
|
-
*
|
145
|
-
* @param {object} calc Viewport column calculator.
|
146
|
-
*/
|
147
|
-
_classPrivateMethodInitSpec(this, _onAfterViewportColumnCalculatorOverride);
|
148
|
-
/**
|
149
|
-
* `afterGetColumnHeader` hook callback - prepares the header structure.
|
150
|
-
*
|
151
|
-
* @param {Array} renderersArray Array of renderers.
|
152
|
-
*/
|
153
|
-
_classPrivateMethodInitSpec(this, _onAfterGetColumnHeaderRenderers);
|
154
|
-
/**
|
155
|
-
* The hook observes the column selection from the Selection API and modifies the column range to
|
156
|
-
* ensure that the whole nested column will be covered.
|
157
|
-
*
|
158
|
-
* @param {CellCoords} from The coords object where the selection starts.
|
159
|
-
* @param {CellCoords} to The coords object where the selection ends.
|
160
|
-
*/
|
161
|
-
_classPrivateMethodInitSpec(this, _onBeforeSelectColumns);
|
162
|
-
/**
|
163
|
-
* `modifyTransformStart` hook is called every time the keyboard navigation is used.
|
164
|
-
*
|
165
|
-
* @param {object} delta The transformation delta.
|
166
|
-
*/
|
167
|
-
_classPrivateMethodInitSpec(this, _onModifyTransformStart);
|
168
|
-
/**
|
169
|
-
* The hook checks and ensures that the focus position that depends on the selected columns
|
170
|
-
* range is always positioned within the range.
|
171
|
-
*/
|
172
|
-
_classPrivateMethodInitSpec(this, _onBeforeSelectionHighlightSet);
|
173
|
-
/**
|
174
|
-
* Switches internal flag about selection progress to `false`.
|
175
|
-
*/
|
176
|
-
_classPrivateMethodInitSpec(this, _onBeforeOnCellMouseUp);
|
177
|
-
/**
|
178
|
-
* Makes the header-selection properly select the nested headers.
|
179
|
-
*
|
180
|
-
* @param {MouseEvent} event Mouse event.
|
181
|
-
* @param {CellCoords} coords Cell coords object containing the visual coordinates of the clicked cell.
|
182
|
-
* @param {HTMLElement} TD The cell element.
|
183
|
-
* @param {object} controller An object with properties `row`, `column` and `cell`. Each property contains
|
184
|
-
* a boolean value that allows or disallows changing the selection for that particular area.
|
185
|
-
*/
|
186
|
-
_classPrivateMethodInitSpec(this, _onBeforeOnCellMouseOver);
|
187
|
-
/**
|
188
|
-
* Allows to control how the column selection based on the coordinates and the nested headers is made.
|
189
|
-
*
|
190
|
-
* @param {MouseEvent} event Mouse event.
|
191
|
-
* @param {CellCoords} coords Cell coords object containing the visual coordinates of the clicked cell.
|
192
|
-
*/
|
193
|
-
_classPrivateMethodInitSpec(this, _onAfterOnCellMouseDown);
|
194
|
-
/**
|
195
|
-
* Allows blocking the column selection that is controlled by the core Selection module.
|
196
|
-
*
|
197
|
-
* @param {MouseEvent} event Mouse event.
|
198
|
-
* @param {CellCoords} coords Cell coords object containing the visual coordinates of the clicked cell.
|
199
|
-
* @param {CellCoords} TD The table cell or header element.
|
200
|
-
* @param {object} controller An object with properties `row`, `column` and `cell`. Each property contains
|
201
|
-
* a boolean value that allows or disallows changing the selection for that particular area.
|
202
|
-
*/
|
203
|
-
_classPrivateMethodInitSpec(this, _onBeforeOnCellMouseDown);
|
204
|
-
/**
|
205
|
-
* Listens the `beforeCopy` hook that allows processing the copied column headers so that the
|
206
|
-
* merged column headers do not propagate the value for each column but only once at the beginning
|
207
|
-
* of the column.
|
208
|
-
*
|
209
|
-
* @private
|
210
|
-
* @param {Array[]} data An array of arrays which contains data to copied.
|
211
|
-
* @param {object[]} copyableRanges An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
212
|
-
* which will copied.
|
213
|
-
* @param {{ columnHeadersCount: number }} copiedHeadersCount An object with keys that holds information with
|
214
|
-
* the number of copied headers.
|
215
|
-
*/
|
216
|
-
_classPrivateMethodInitSpec(this, _onBeforeCopy);
|
217
|
-
/**
|
218
|
-
* Allows to control which header DOM element will be used to highlight.
|
219
|
-
*
|
220
|
-
* @param {number} visualColumn A visual column index of the highlighted row header.
|
221
|
-
* @param {number} headerLevel A row header level that is currently highlighted.
|
222
|
-
* @param {object} highlightMeta An object with meta data that describes the highlight state.
|
223
|
-
* @returns {number}
|
224
|
-
*/
|
225
|
-
_classPrivateMethodInitSpec(this, _onBeforeHighlightingColumnHeader);
|
226
|
-
/**
|
227
|
-
* Allows to control to which column index the viewport will be scrolled. To ensure that the viewport
|
228
|
-
* is scrolled to the correct column for the nested header the most left and the most right visual column
|
229
|
-
* indexes are used.
|
230
|
-
*
|
231
|
-
* @param {number} visualColumn A visual column index to which the viewport will be scrolled.
|
232
|
-
* @returns {number}
|
233
|
-
*/
|
234
|
-
_classPrivateMethodInitSpec(this, _onBeforeViewportScrollHorizontally);
|
235
81
|
/**
|
236
82
|
* Updates the selection focus highlight position to point to the nested header root element (TH)
|
237
83
|
* even when the logical coordinates point in-between the header.
|
238
84
|
*/
|
239
|
-
_classPrivateMethodInitSpec(this,
|
85
|
+
_classPrivateMethodInitSpec(this, _NestedHeaders_brand);
|
240
86
|
/**
|
241
87
|
* The state manager for the nested headers.
|
242
88
|
*
|
243
89
|
* @type {StateManager}
|
244
90
|
*/
|
245
|
-
_classPrivateFieldInitSpec(this, _stateManager,
|
246
|
-
writable: true,
|
247
|
-
value: new _stateManager2.default()
|
248
|
-
});
|
91
|
+
_classPrivateFieldInitSpec(this, _stateManager, new _stateManager2.default());
|
249
92
|
/**
|
250
93
|
* The instance of the ChangesObservable class that allows track the changes that happens in the
|
251
94
|
* column indexes.
|
252
95
|
*
|
253
96
|
* @type {ChangesObservable}
|
254
97
|
*/
|
255
|
-
_classPrivateFieldInitSpec(this, _hidingIndexMapObserver,
|
256
|
-
writable: true,
|
257
|
-
value: null
|
258
|
-
});
|
98
|
+
_classPrivateFieldInitSpec(this, _hidingIndexMapObserver, null);
|
259
99
|
/**
|
260
100
|
* Holds the coords that points to the place where the column selection starts.
|
261
101
|
*
|
262
102
|
* @type {number|null}
|
263
103
|
*/
|
264
|
-
_classPrivateFieldInitSpec(this, _focusInitialCoords,
|
265
|
-
writable: true,
|
266
|
-
value: null
|
267
|
-
});
|
104
|
+
_classPrivateFieldInitSpec(this, _focusInitialCoords, null);
|
268
105
|
/**
|
269
106
|
* Determines if there is performed the column selection.
|
270
107
|
*
|
271
108
|
* @type {boolean}
|
272
109
|
*/
|
273
|
-
_classPrivateFieldInitSpec(this, _isColumnsSelectionInProgress,
|
274
|
-
writable: true,
|
275
|
-
value: false
|
276
|
-
});
|
110
|
+
_classPrivateFieldInitSpec(this, _isColumnsSelectionInProgress, false);
|
277
111
|
/**
|
278
112
|
* Custom helper for getting widths of the nested headers.
|
279
113
|
*
|
@@ -320,102 +154,101 @@ class NestedHeaders extends _base.BasePlugin {
|
|
320
154
|
(0, _console.warn)((0, _templateLiteralTag.toSingleLine)`Your Nested Headers plugin configuration is invalid. The settings has to be\x20
|
321
155
|
passed as an array of arrays e.q. [['A1', { label: 'A2', colspan: 2 }]]`);
|
322
156
|
}
|
323
|
-
this.addHook('init', () =>
|
157
|
+
this.addHook('init', () => _assertClassBrand(_NestedHeaders_brand, this, _onInit).call(this));
|
324
158
|
this.addHook('afterLoadData', function () {
|
325
159
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
326
160
|
args[_key] = arguments[_key];
|
327
161
|
}
|
328
|
-
return
|
162
|
+
return _assertClassBrand(_NestedHeaders_brand, _this, _onAfterLoadData).call(_this, ...args);
|
329
163
|
});
|
330
164
|
this.addHook('beforeOnCellMouseDown', function () {
|
331
165
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
332
166
|
args[_key2] = arguments[_key2];
|
333
167
|
}
|
334
|
-
return
|
168
|
+
return _assertClassBrand(_NestedHeaders_brand, _this, _onBeforeOnCellMouseDown).call(_this, ...args);
|
335
169
|
});
|
336
170
|
this.addHook('afterOnCellMouseDown', function () {
|
337
171
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
338
172
|
args[_key3] = arguments[_key3];
|
339
173
|
}
|
340
|
-
return
|
174
|
+
return _assertClassBrand(_NestedHeaders_brand, _this, _onAfterOnCellMouseDown).call(_this, ...args);
|
341
175
|
});
|
342
176
|
this.addHook('beforeOnCellMouseOver', function () {
|
343
177
|
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
344
178
|
args[_key4] = arguments[_key4];
|
345
179
|
}
|
346
|
-
return
|
180
|
+
return _assertClassBrand(_NestedHeaders_brand, _this, _onBeforeOnCellMouseOver).call(_this, ...args);
|
347
181
|
});
|
348
182
|
this.addHook('beforeOnCellMouseUp', function () {
|
349
183
|
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
350
184
|
args[_key5] = arguments[_key5];
|
351
185
|
}
|
352
|
-
return
|
186
|
+
return _assertClassBrand(_NestedHeaders_brand, _this, _onBeforeOnCellMouseUp).call(_this, ...args);
|
353
187
|
});
|
354
188
|
this.addHook('beforeSelectionHighlightSet', function () {
|
355
189
|
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
356
190
|
args[_key6] = arguments[_key6];
|
357
191
|
}
|
358
|
-
return
|
192
|
+
return _assertClassBrand(_NestedHeaders_brand, _this, _onBeforeSelectionHighlightSet).call(_this, ...args);
|
359
193
|
});
|
360
194
|
this.addHook('modifyTransformStart', function () {
|
361
195
|
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
362
196
|
args[_key7] = arguments[_key7];
|
363
197
|
}
|
364
|
-
return
|
198
|
+
return _assertClassBrand(_NestedHeaders_brand, _this, _onModifyTransformStart).call(_this, ...args);
|
365
199
|
});
|
366
|
-
this.addHook('afterSelection', () =>
|
367
|
-
this.addHook('afterSelectionFocusSet', () => _classPrivateMethodGet(this, _updateFocusHighlightPosition, _updateFocusHighlightPosition2).call(this));
|
200
|
+
this.addHook('afterSelection', () => _assertClassBrand(_NestedHeaders_brand, this, _updateFocusHighlightPosition).call(this));
|
368
201
|
this.addHook('beforeViewportScrollHorizontally', function () {
|
369
202
|
for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
|
370
203
|
args[_key8] = arguments[_key8];
|
371
204
|
}
|
372
|
-
return
|
205
|
+
return _assertClassBrand(_NestedHeaders_brand, _this, _onBeforeViewportScrollHorizontally).call(_this, ...args);
|
373
206
|
});
|
374
|
-
this.addHook('afterGetColumnHeaderRenderers', array =>
|
207
|
+
this.addHook('afterGetColumnHeaderRenderers', array => _assertClassBrand(_NestedHeaders_brand, this, _onAfterGetColumnHeaderRenderers).call(this, array));
|
375
208
|
this.addHook('modifyColWidth', function () {
|
376
209
|
for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
|
377
210
|
args[_key9] = arguments[_key9];
|
378
211
|
}
|
379
|
-
return
|
212
|
+
return _assertClassBrand(_NestedHeaders_brand, _this, _onModifyColWidth).call(_this, ...args);
|
380
213
|
});
|
381
214
|
this.addHook('modifyColumnHeaderValue', function () {
|
382
215
|
for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
|
383
216
|
args[_key10] = arguments[_key10];
|
384
217
|
}
|
385
|
-
return
|
218
|
+
return _assertClassBrand(_NestedHeaders_brand, _this, _onModifyColumnHeaderValue).call(_this, ...args);
|
386
219
|
});
|
387
220
|
this.addHook('beforeHighlightingColumnHeader', function () {
|
388
221
|
for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
|
389
222
|
args[_key11] = arguments[_key11];
|
390
223
|
}
|
391
|
-
return
|
224
|
+
return _assertClassBrand(_NestedHeaders_brand, _this, _onBeforeHighlightingColumnHeader).call(_this, ...args);
|
392
225
|
});
|
393
226
|
this.addHook('beforeCopy', function () {
|
394
227
|
for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
|
395
228
|
args[_key12] = arguments[_key12];
|
396
229
|
}
|
397
|
-
return
|
230
|
+
return _assertClassBrand(_NestedHeaders_brand, _this, _onBeforeCopy).call(_this, ...args);
|
398
231
|
});
|
399
232
|
this.addHook('beforeSelectColumns', function () {
|
400
233
|
for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
|
401
234
|
args[_key13] = arguments[_key13];
|
402
235
|
}
|
403
|
-
return
|
236
|
+
return _assertClassBrand(_NestedHeaders_brand, _this, _onBeforeSelectColumns).call(_this, ...args);
|
404
237
|
});
|
405
238
|
this.addHook('afterViewportColumnCalculatorOverride', function () {
|
406
239
|
for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) {
|
407
240
|
args[_key14] = arguments[_key14];
|
408
241
|
}
|
409
|
-
return
|
242
|
+
return _assertClassBrand(_NestedHeaders_brand, _this, _onAfterViewportColumnCalculatorOverride).call(_this, ...args);
|
410
243
|
});
|
411
244
|
this.addHook('modifyFocusedElement', function () {
|
412
245
|
for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {
|
413
246
|
args[_key15] = arguments[_key15];
|
414
247
|
}
|
415
|
-
return
|
248
|
+
return _assertClassBrand(_NestedHeaders_brand, _this, _onModifyFocusedElement).call(_this, ...args);
|
416
249
|
});
|
417
|
-
this.hot.columnIndexMapper.addLocalHook('cacheUpdated', () =>
|
418
|
-
this.hot.rowIndexMapper.addLocalHook('cacheUpdated', () =>
|
250
|
+
this.hot.columnIndexMapper.addLocalHook('cacheUpdated', () => _assertClassBrand(_NestedHeaders_brand, this, _updateFocusHighlightPosition).call(this));
|
251
|
+
this.hot.rowIndexMapper.addLocalHook('cacheUpdated', () => _assertClassBrand(_NestedHeaders_brand, this, _updateFocusHighlightPosition).call(this));
|
419
252
|
super.enablePlugin();
|
420
253
|
this.updatePlugin(); // @TODO: Workaround for broken plugin initialization abstraction.
|
421
254
|
}
|
@@ -434,9 +267,9 @@ class NestedHeaders extends _base.BasePlugin {
|
|
434
267
|
const {
|
435
268
|
nestedHeaders
|
436
269
|
} = this.hot.getSettings();
|
437
|
-
_classPrivateFieldGet(
|
270
|
+
_classPrivateFieldGet(_stateManager, this).setColumnsLimit(this.hot.countCols());
|
438
271
|
if (Array.isArray(nestedHeaders)) {
|
439
|
-
this.detectedOverlappedHeaders = _classPrivateFieldGet(
|
272
|
+
this.detectedOverlappedHeaders = _classPrivateFieldGet(_stateManager, this).setState(nestedHeaders);
|
440
273
|
}
|
441
274
|
if (this.detectedOverlappedHeaders) {
|
442
275
|
(0, _console.warn)((0, _templateLiteralTag.toSingleLine)`Your Nested Headers plugin setup contains overlapping headers. This kind of configuration\x20
|
@@ -448,11 +281,11 @@ class NestedHeaders extends _base.BasePlugin {
|
|
448
281
|
// as if all the columns are visible, needs to be modified to be in sync with a dataset.
|
449
282
|
this.hot.columnIndexMapper.hidingMapsCollection.getMergedValues().forEach((isColumnHidden, physicalColumnIndex) => {
|
450
283
|
const actionName = isColumnHidden === true ? 'hide-column' : 'show-column';
|
451
|
-
_classPrivateFieldGet(
|
284
|
+
_classPrivateFieldGet(_stateManager, this).triggerColumnModification(actionName, physicalColumnIndex);
|
452
285
|
});
|
453
286
|
}
|
454
|
-
if (!_classPrivateFieldGet(
|
455
|
-
_classPrivateFieldSet(
|
287
|
+
if (!_classPrivateFieldGet(_hidingIndexMapObserver, this) && this.enabled) {
|
288
|
+
_classPrivateFieldSet(_hidingIndexMapObserver, this, this.hot.columnIndexMapper.createChangesObserver('hiding').subscribe(changes => {
|
456
289
|
changes.forEach(_ref => {
|
457
290
|
let {
|
458
291
|
op,
|
@@ -461,7 +294,7 @@ class NestedHeaders extends _base.BasePlugin {
|
|
461
294
|
} = _ref;
|
462
295
|
if (op === 'replace') {
|
463
296
|
const actionName = newValue === true ? 'hide-column' : 'show-column';
|
464
|
-
_classPrivateFieldGet(
|
297
|
+
_classPrivateFieldGet(_stateManager, this).triggerColumnModification(actionName, columnIndex);
|
465
298
|
}
|
466
299
|
});
|
467
300
|
this.ghostTable.buildWidthsMap();
|
@@ -476,9 +309,9 @@ class NestedHeaders extends _base.BasePlugin {
|
|
476
309
|
*/
|
477
310
|
disablePlugin() {
|
478
311
|
this.clearColspans();
|
479
|
-
_classPrivateFieldGet(
|
480
|
-
_classPrivateFieldGet(
|
481
|
-
_classPrivateFieldSet(
|
312
|
+
_classPrivateFieldGet(_stateManager, this).clear();
|
313
|
+
_classPrivateFieldGet(_hidingIndexMapObserver, this).unsubscribe();
|
314
|
+
_classPrivateFieldSet(_hidingIndexMapObserver, this, null);
|
482
315
|
this.ghostTable.clear();
|
483
316
|
super.disablePlugin();
|
484
317
|
}
|
@@ -490,7 +323,7 @@ class NestedHeaders extends _base.BasePlugin {
|
|
490
323
|
* @returns {StateManager}
|
491
324
|
*/
|
492
325
|
getStateManager() {
|
493
|
-
return _classPrivateFieldGet(
|
326
|
+
return _classPrivateFieldGet(_stateManager, this);
|
494
327
|
}
|
495
328
|
|
496
329
|
/**
|
@@ -500,7 +333,7 @@ class NestedHeaders extends _base.BasePlugin {
|
|
500
333
|
* @returns {number}
|
501
334
|
*/
|
502
335
|
getLayersCount() {
|
503
|
-
return _classPrivateFieldGet(
|
336
|
+
return _classPrivateFieldGet(_stateManager, this).getLayersCount();
|
504
337
|
}
|
505
338
|
|
506
339
|
/**
|
@@ -514,7 +347,7 @@ class NestedHeaders extends _base.BasePlugin {
|
|
514
347
|
* @returns {object}
|
515
348
|
*/
|
516
349
|
getHeaderSettings(headerLevel, columnIndex) {
|
517
|
-
return _classPrivateFieldGet(
|
350
|
+
return _classPrivateFieldGet(_stateManager, this).getHeaderSettings(headerLevel, columnIndex);
|
518
351
|
}
|
519
352
|
|
520
353
|
/**
|
@@ -583,7 +416,7 @@ class NestedHeaders extends _base.BasePlugin {
|
|
583
416
|
colspan,
|
584
417
|
isHidden,
|
585
418
|
isPlaceholder
|
586
|
-
} = (_classPrivateFieldGet2 = _classPrivateFieldGet(
|
419
|
+
} = (_classPrivateFieldGet2 = _classPrivateFieldGet(_stateManager, this).getHeaderSettings(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet2 !== void 0 ? _classPrivateFieldGet2 : {
|
587
420
|
label: ''
|
588
421
|
};
|
589
422
|
if (isPlaceholder || isHidden) {
|
@@ -624,7 +457,7 @@ class NestedHeaders extends _base.BasePlugin {
|
|
624
457
|
const {
|
625
458
|
isHidden,
|
626
459
|
isPlaceholder
|
627
|
-
} = (_classPrivateFieldGet3 = _classPrivateFieldGet(
|
460
|
+
} = (_classPrivateFieldGet3 = _classPrivateFieldGet(_stateManager, this).getHeaderSettings(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet3 !== void 0 ? _classPrivateFieldGet3 : {};
|
628
461
|
if (isPlaceholder || isHidden) {
|
629
462
|
return '';
|
630
463
|
}
|
@@ -634,10 +467,10 @@ class NestedHeaders extends _base.BasePlugin {
|
|
634
467
|
* Destroys the plugin instance.
|
635
468
|
*/
|
636
469
|
destroy() {
|
637
|
-
_classPrivateFieldSet(
|
638
|
-
if (_classPrivateFieldGet(
|
639
|
-
_classPrivateFieldGet(
|
640
|
-
_classPrivateFieldSet(
|
470
|
+
_classPrivateFieldSet(_stateManager, this, null);
|
471
|
+
if (_classPrivateFieldGet(_hidingIndexMapObserver, this) !== null) {
|
472
|
+
_classPrivateFieldGet(_hidingIndexMapObserver, this).unsubscribe();
|
473
|
+
_classPrivateFieldSet(_hidingIndexMapObserver, this, null);
|
641
474
|
}
|
642
475
|
super.destroy();
|
643
476
|
}
|
@@ -653,11 +486,11 @@ class NestedHeaders extends _base.BasePlugin {
|
|
653
486
|
if (coords.row >= 0 || coords.col < 0) {
|
654
487
|
return;
|
655
488
|
}
|
656
|
-
return _classPrivateFieldGet(
|
489
|
+
return _classPrivateFieldGet(_stateManager, this).getHeaderTreeNodeData(coords.row, coords.col);
|
657
490
|
}
|
658
491
|
}
|
659
492
|
exports.NestedHeaders = NestedHeaders;
|
660
|
-
function
|
493
|
+
function _updateFocusHighlightPosition() {
|
661
494
|
var _this$hot;
|
662
495
|
const selection = (_this$hot = this.hot) === null || _this$hot === void 0 ? void 0 : _this$hot.getSelectedRangeLast();
|
663
496
|
if (!selection) {
|
@@ -668,7 +501,7 @@ function _updateFocusHighlightPosition2() {
|
|
668
501
|
} = selection;
|
669
502
|
const isNestedHeadersRange = highlight.isHeader() && highlight.col >= 0;
|
670
503
|
if (isNestedHeadersRange) {
|
671
|
-
const columnIndex = _classPrivateFieldGet(
|
504
|
+
const columnIndex = _classPrivateFieldGet(_stateManager, this).findLeftMostColumnIndex(highlight.row, highlight.col);
|
672
505
|
const focusHighlight = this.hot.selection.highlight.getFocus();
|
673
506
|
|
674
507
|
// Correct the highlight/focus selection to highlight the correct TH element
|
@@ -678,7 +511,15 @@ function _updateFocusHighlightPosition2() {
|
|
678
511
|
focusHighlight.commit();
|
679
512
|
}
|
680
513
|
}
|
681
|
-
|
514
|
+
/**
|
515
|
+
* Allows to control to which column index the viewport will be scrolled. To ensure that the viewport
|
516
|
+
* is scrolled to the correct column for the nested header the most left and the most right visual column
|
517
|
+
* indexes are used.
|
518
|
+
*
|
519
|
+
* @param {number} visualColumn A visual column index to which the viewport will be scrolled.
|
520
|
+
* @returns {number}
|
521
|
+
*/
|
522
|
+
function _onBeforeViewportScrollHorizontally(visualColumn) {
|
682
523
|
const selection = this.hot.getSelectedRangeLast();
|
683
524
|
if (!selection) {
|
684
525
|
return visualColumn;
|
@@ -692,8 +533,8 @@ function _onBeforeViewportScrollHorizontally2(visualColumn) {
|
|
692
533
|
}
|
693
534
|
const firstColumn = this.hot.view.getFirstFullyVisibleColumn();
|
694
535
|
const lastColumn = this.hot.view.getLastFullyVisibleColumn();
|
695
|
-
const mostLeftColumnIndex = _classPrivateFieldGet(
|
696
|
-
const mostRightColumnIndex = _classPrivateFieldGet(
|
536
|
+
const mostLeftColumnIndex = _classPrivateFieldGet(_stateManager, this).findLeftMostColumnIndex(highlight.row, highlight.col);
|
537
|
+
const mostRightColumnIndex = _classPrivateFieldGet(_stateManager, this).findRightMostColumnIndex(highlight.row, highlight.col);
|
697
538
|
|
698
539
|
// do not scroll the viewport when the header is wider than the viewport
|
699
540
|
if (mostLeftColumnIndex < firstColumn && mostRightColumnIndex > lastColumn) {
|
@@ -701,8 +542,16 @@ function _onBeforeViewportScrollHorizontally2(visualColumn) {
|
|
701
542
|
}
|
702
543
|
return mostLeftColumnIndex < firstColumn ? mostLeftColumnIndex : mostRightColumnIndex;
|
703
544
|
}
|
704
|
-
|
705
|
-
|
545
|
+
/**
|
546
|
+
* Allows to control which header DOM element will be used to highlight.
|
547
|
+
*
|
548
|
+
* @param {number} visualColumn A visual column index of the highlighted row header.
|
549
|
+
* @param {number} headerLevel A row header level that is currently highlighted.
|
550
|
+
* @param {object} highlightMeta An object with meta data that describes the highlight state.
|
551
|
+
* @returns {number}
|
552
|
+
*/
|
553
|
+
function _onBeforeHighlightingColumnHeader(visualColumn, headerLevel, highlightMeta) {
|
554
|
+
const headerNodeData = _classPrivateFieldGet(_stateManager, this).getHeaderTreeNodeData(headerLevel, visualColumn);
|
706
555
|
if (!headerNodeData) {
|
707
556
|
return visualColumn;
|
708
557
|
}
|
@@ -714,7 +563,7 @@ function _onBeforeHighlightingColumnHeader2(visualColumn, headerLevel, highlight
|
|
714
563
|
const {
|
715
564
|
isRoot,
|
716
565
|
colspan
|
717
|
-
} = _classPrivateFieldGet(
|
566
|
+
} = _classPrivateFieldGet(_stateManager, this).getHeaderSettings(headerLevel, visualColumn);
|
718
567
|
if (selectionType === _selection.HEADER_TYPE) {
|
719
568
|
if (!isRoot) {
|
720
569
|
return headerNodeData.columnIndex;
|
@@ -727,7 +576,19 @@ function _onBeforeHighlightingColumnHeader2(visualColumn, headerLevel, highlight
|
|
727
576
|
}
|
728
577
|
return visualColumn;
|
729
578
|
}
|
730
|
-
|
579
|
+
/**
|
580
|
+
* Listens the `beforeCopy` hook that allows processing the copied column headers so that the
|
581
|
+
* merged column headers do not propagate the value for each column but only once at the beginning
|
582
|
+
* of the column.
|
583
|
+
*
|
584
|
+
* @private
|
585
|
+
* @param {Array[]} data An array of arrays which contains data to copied.
|
586
|
+
* @param {object[]} copyableRanges An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
587
|
+
* which will copied.
|
588
|
+
* @param {{ columnHeadersCount: number }} copiedHeadersCount An object with keys that holds information with
|
589
|
+
* the number of copied headers.
|
590
|
+
*/
|
591
|
+
function _onBeforeCopy(data, copyableRanges, _ref2) {
|
731
592
|
let {
|
732
593
|
columnHeadersCount
|
733
594
|
} = _ref2;
|
@@ -756,7 +617,7 @@ function _onBeforeCopy2(data, copyableRanges, _ref2) {
|
|
756
617
|
if (zeroBasedColumnIndex === 0) {
|
757
618
|
continue; // eslint-disable-line no-continue
|
758
619
|
}
|
759
|
-
const isRoot = (_classPrivateFieldGet4 = _classPrivateFieldGet(
|
620
|
+
const isRoot = (_classPrivateFieldGet4 = _classPrivateFieldGet(_stateManager, this).getHeaderTreeNodeData(row, column)) === null || _classPrivateFieldGet4 === void 0 ? void 0 : _classPrivateFieldGet4.isRoot;
|
760
621
|
if (isRoot === false) {
|
761
622
|
data[zeroBasedColumnHeaderLevel][zeroBasedColumnIndex] = '';
|
762
623
|
}
|
@@ -764,7 +625,16 @@ function _onBeforeCopy2(data, copyableRanges, _ref2) {
|
|
764
625
|
}
|
765
626
|
}
|
766
627
|
}
|
767
|
-
|
628
|
+
/**
|
629
|
+
* Allows blocking the column selection that is controlled by the core Selection module.
|
630
|
+
*
|
631
|
+
* @param {MouseEvent} event Mouse event.
|
632
|
+
* @param {CellCoords} coords Cell coords object containing the visual coordinates of the clicked cell.
|
633
|
+
* @param {CellCoords} TD The table cell or header element.
|
634
|
+
* @param {object} controller An object with properties `row`, `column` and `cell`. Each property contains
|
635
|
+
* a boolean value that allows or disallows changing the selection for that particular area.
|
636
|
+
*/
|
637
|
+
function _onBeforeOnCellMouseDown(event, coords, TD, controller) {
|
768
638
|
const headerNodeData = this._getHeaderTreeNodeDataByCoords(coords);
|
769
639
|
if (headerNodeData) {
|
770
640
|
// Block the Selection module in controlling how the columns are selected. Pass the
|
@@ -772,13 +642,19 @@ function _onBeforeOnCellMouseDown2(event, coords, TD, controller) {
|
|
772
642
|
controller.column = true;
|
773
643
|
}
|
774
644
|
}
|
775
|
-
|
645
|
+
/**
|
646
|
+
* Allows to control how the column selection based on the coordinates and the nested headers is made.
|
647
|
+
*
|
648
|
+
* @param {MouseEvent} event Mouse event.
|
649
|
+
* @param {CellCoords} coords Cell coords object containing the visual coordinates of the clicked cell.
|
650
|
+
*/
|
651
|
+
function _onAfterOnCellMouseDown(event, coords) {
|
776
652
|
const headerNodeData = this._getHeaderTreeNodeDataByCoords(coords);
|
777
653
|
if (!headerNodeData) {
|
778
654
|
return;
|
779
655
|
}
|
780
|
-
_classPrivateFieldSet(
|
781
|
-
_classPrivateFieldSet(
|
656
|
+
_classPrivateFieldSet(_focusInitialCoords, this, coords.clone());
|
657
|
+
_classPrivateFieldSet(_isColumnsSelectionInProgress, this, true);
|
782
658
|
const {
|
783
659
|
selection
|
784
660
|
} = this.hot;
|
@@ -809,7 +685,16 @@ function _onAfterOnCellMouseDown2(event, coords) {
|
|
809
685
|
// The plugin takes control of how the columns are selected.
|
810
686
|
selection.selectColumns(...columnsToSelect);
|
811
687
|
}
|
812
|
-
|
688
|
+
/**
|
689
|
+
* Makes the header-selection properly select the nested headers.
|
690
|
+
*
|
691
|
+
* @param {MouseEvent} event Mouse event.
|
692
|
+
* @param {CellCoords} coords Cell coords object containing the visual coordinates of the clicked cell.
|
693
|
+
* @param {HTMLElement} TD The cell element.
|
694
|
+
* @param {object} controller An object with properties `row`, `column` and `cell`. Each property contains
|
695
|
+
* a boolean value that allows or disallows changing the selection for that particular area.
|
696
|
+
*/
|
697
|
+
function _onBeforeOnCellMouseOver(event, coords, TD, controller) {
|
813
698
|
if (!this.hot.view.isMouseDown()) {
|
814
699
|
return;
|
815
700
|
}
|
@@ -843,14 +728,21 @@ function _onBeforeOnCellMouseOver2(event, coords, TD, controller) {
|
|
843
728
|
}
|
844
729
|
this.hot.selection.selectColumns(...columnsToSelect);
|
845
730
|
}
|
846
|
-
|
847
|
-
|
731
|
+
/**
|
732
|
+
* Switches internal flag about selection progress to `false`.
|
733
|
+
*/
|
734
|
+
function _onBeforeOnCellMouseUp() {
|
735
|
+
_classPrivateFieldSet(_isColumnsSelectionInProgress, this, false);
|
848
736
|
}
|
849
|
-
|
737
|
+
/**
|
738
|
+
* The hook checks and ensures that the focus position that depends on the selected columns
|
739
|
+
* range is always positioned within the range.
|
740
|
+
*/
|
741
|
+
function _onBeforeSelectionHighlightSet() {
|
850
742
|
const {
|
851
743
|
navigableHeaders
|
852
744
|
} = this.hot.getSettings();
|
853
|
-
if (!this.hot.view.isMouseDown() || !_classPrivateFieldGet(
|
745
|
+
if (!this.hot.view.isMouseDown() || !_classPrivateFieldGet(_isColumnsSelectionInProgress, this) || !navigableHeaders) {
|
854
746
|
return;
|
855
747
|
}
|
856
748
|
const selectedRange = this.hot.getSelectedRangeLast();
|
@@ -859,15 +751,20 @@ function _onBeforeSelectionHighlightSet2() {
|
|
859
751
|
const {
|
860
752
|
columnIndex,
|
861
753
|
origColspan
|
862
|
-
} = _classPrivateFieldGet(
|
863
|
-
selectedRange.setHighlight(_classPrivateFieldGet(
|
754
|
+
} = _classPrivateFieldGet(_stateManager, this).getHeaderTreeNodeData(_classPrivateFieldGet(_focusInitialCoords, this).row, _classPrivateFieldGet(_focusInitialCoords, this).col);
|
755
|
+
selectedRange.setHighlight(_classPrivateFieldGet(_focusInitialCoords, this));
|
864
756
|
if (origColspan > selectedRange.getWidth() || columnIndex < columnStart || columnIndex + origColspan - 1 > columnEnd) {
|
865
|
-
const headerLevel = _classPrivateFieldGet(
|
757
|
+
const headerLevel = _classPrivateFieldGet(_stateManager, this).findTopMostEntireHeaderLevel((0, _number.clamp)(columnStart, columnIndex, columnIndex + origColspan - 1), (0, _number.clamp)(columnEnd, columnIndex, columnIndex + origColspan - 1));
|
866
758
|
selectedRange.highlight.row = headerLevel;
|
867
759
|
selectedRange.highlight.col = selectedRange.from.col;
|
868
760
|
}
|
869
761
|
}
|
870
|
-
|
762
|
+
/**
|
763
|
+
* `modifyTransformStart` hook is called every time the keyboard navigation is used.
|
764
|
+
*
|
765
|
+
* @param {object} delta The transformation delta.
|
766
|
+
*/
|
767
|
+
function _onModifyTransformStart(delta) {
|
871
768
|
const {
|
872
769
|
highlight
|
873
770
|
} = this.hot.getSelectedRangeLast();
|
@@ -876,8 +773,8 @@ function _onModifyTransformStart2(delta) {
|
|
876
773
|
if (!isNestedHeadersRange) {
|
877
774
|
return;
|
878
775
|
}
|
879
|
-
const visualColumnIndexStart = _classPrivateFieldGet(
|
880
|
-
const visualColumnIndexEnd = _classPrivateFieldGet(
|
776
|
+
const visualColumnIndexStart = _classPrivateFieldGet(_stateManager, this).findLeftMostColumnIndex(nextCoords.row, nextCoords.col);
|
777
|
+
const visualColumnIndexEnd = _classPrivateFieldGet(_stateManager, this).findRightMostColumnIndex(nextCoords.row, nextCoords.col);
|
881
778
|
if (delta.col < 0) {
|
882
779
|
const nextColumn = highlight.col >= visualColumnIndexStart && highlight.col <= visualColumnIndexEnd ? visualColumnIndexStart - 1 : visualColumnIndexEnd;
|
883
780
|
const notHiddenColumnIndex = this.hot.columnIndexMapper.getNearestNotHiddenIndex(nextColumn, -1);
|
@@ -900,7 +797,14 @@ function _onModifyTransformStart2(delta) {
|
|
900
797
|
}
|
901
798
|
}
|
902
799
|
}
|
903
|
-
|
800
|
+
/**
|
801
|
+
* The hook observes the column selection from the Selection API and modifies the column range to
|
802
|
+
* ensure that the whole nested column will be covered.
|
803
|
+
*
|
804
|
+
* @param {CellCoords} from The coords object where the selection starts.
|
805
|
+
* @param {CellCoords} to The coords object where the selection ends.
|
806
|
+
*/
|
807
|
+
function _onBeforeSelectColumns(from, to) {
|
904
808
|
const headerLevel = from.row;
|
905
809
|
const startNodeData = this._getHeaderTreeNodeDataByCoords({
|
906
810
|
row: headerLevel,
|
@@ -928,18 +832,28 @@ function _onBeforeSelectColumns2(from, to) {
|
|
928
832
|
}
|
929
833
|
}
|
930
834
|
}
|
931
|
-
|
835
|
+
/**
|
836
|
+
* `afterGetColumnHeader` hook callback - prepares the header structure.
|
837
|
+
*
|
838
|
+
* @param {Array} renderersArray Array of renderers.
|
839
|
+
*/
|
840
|
+
function _onAfterGetColumnHeaderRenderers(renderersArray) {
|
932
841
|
renderersArray.length = 0;
|
933
|
-
for (let headerLayer = 0; headerLayer < _classPrivateFieldGet(
|
842
|
+
for (let headerLayer = 0; headerLayer < _classPrivateFieldGet(_stateManager, this).getLayersCount(); headerLayer++) {
|
934
843
|
renderersArray.push(this.headerRendererFactory(headerLayer));
|
935
844
|
}
|
936
845
|
}
|
937
|
-
|
938
|
-
|
846
|
+
/**
|
847
|
+
* Make the renderer render the first nested column in its entirety.
|
848
|
+
*
|
849
|
+
* @param {object} calc Viewport column calculator.
|
850
|
+
*/
|
851
|
+
function _onAfterViewportColumnCalculatorOverride(calc) {
|
852
|
+
const headerLayersCount = _classPrivateFieldGet(_stateManager, this).getLayersCount();
|
939
853
|
let newStartColumn = calc.startColumn;
|
940
854
|
let nonRenderable = !!headerLayersCount;
|
941
855
|
for (let headerLayer = 0; headerLayer < headerLayersCount; headerLayer++) {
|
942
|
-
const startColumn = _classPrivateFieldGet(
|
856
|
+
const startColumn = _classPrivateFieldGet(_stateManager, this).findLeftMostColumnIndex(headerLayer, calc.startColumn);
|
943
857
|
const renderedStartColumn = this.hot.columnIndexMapper.getRenderableFromVisualIndex(startColumn);
|
944
858
|
|
945
859
|
// If any of the headers for that column index is rendered, all of them should be rendered properly, see
|
@@ -958,31 +872,67 @@ function _onAfterViewportColumnCalculatorOverride2(calc) {
|
|
958
872
|
|
959
873
|
// If no headers for the provided column index are renderable, start rendering from the beginning of the upmost
|
960
874
|
// header for that position.
|
961
|
-
calc.startColumn = nonRenderable ? _classPrivateFieldGet(
|
875
|
+
calc.startColumn = nonRenderable ? _classPrivateFieldGet(_stateManager, this).getHeaderTreeNodeData(0, newStartColumn).columnIndex : newStartColumn;
|
962
876
|
}
|
963
|
-
|
877
|
+
/**
|
878
|
+
* `modifyColWidth` hook callback - returns width from cache, when is greater than incoming from hook.
|
879
|
+
*
|
880
|
+
* @param {number} width Width from hook.
|
881
|
+
* @param {number} column Visual index of an column.
|
882
|
+
* @returns {number}
|
883
|
+
*/
|
884
|
+
function _onModifyColWidth(width, column) {
|
964
885
|
const cachedWidth = this.ghostTable.getWidth(column);
|
965
886
|
return width > cachedWidth ? width : cachedWidth;
|
966
887
|
}
|
967
|
-
|
888
|
+
/**
|
889
|
+
* Listens the `modifyColumnHeaderValue` hook that overwrites the column headers values based on
|
890
|
+
* the internal state and settings of the plugin.
|
891
|
+
*
|
892
|
+
* @param {string} value The column header value.
|
893
|
+
* @param {number} visualColumnIndex The visual column index.
|
894
|
+
* @param {number} headerLevel The index of header level. The header level accepts positive (0 to N)
|
895
|
+
* and negative (-1 to -N) values. For positive values, 0 points to the
|
896
|
+
* top most header, and for negative direction, -1 points to the most bottom
|
897
|
+
* header (the header closest to the cells).
|
898
|
+
* @returns {string} Returns the column header value to update.
|
899
|
+
*/
|
900
|
+
function _onModifyColumnHeaderValue(value, visualColumnIndex, headerLevel) {
|
968
901
|
var _classPrivateFieldGet5;
|
969
902
|
const {
|
970
903
|
label
|
971
|
-
} = (_classPrivateFieldGet5 = _classPrivateFieldGet(
|
904
|
+
} = (_classPrivateFieldGet5 = _classPrivateFieldGet(_stateManager, this).getHeaderTreeNodeData(headerLevel, visualColumnIndex)) !== null && _classPrivateFieldGet5 !== void 0 ? _classPrivateFieldGet5 : {
|
972
905
|
label: ''
|
973
906
|
};
|
974
907
|
return label;
|
975
908
|
}
|
976
|
-
|
909
|
+
/**
|
910
|
+
* `modifyFocusedElement` hook callback.
|
911
|
+
*
|
912
|
+
* @param {number} row Row index.
|
913
|
+
* @param {number} column Column index.
|
914
|
+
* @returns {HTMLTableCellElement} The `TH` element to be focused.
|
915
|
+
*/
|
916
|
+
function _onModifyFocusedElement(row, column) {
|
977
917
|
if (row < 0) {
|
978
|
-
return this.hot.getCell(row, _classPrivateFieldGet(
|
918
|
+
return this.hot.getCell(row, _classPrivateFieldGet(_stateManager, this).findLeftMostColumnIndex(row, column), true);
|
979
919
|
}
|
980
920
|
}
|
981
|
-
|
921
|
+
/**
|
922
|
+
* Updates the plugin state after HoT initialization.
|
923
|
+
*/
|
924
|
+
function _onInit() {
|
982
925
|
// @TODO: Workaround for broken plugin initialization abstraction.
|
983
926
|
this.updatePlugin();
|
984
927
|
}
|
985
|
-
|
928
|
+
/**
|
929
|
+
* Updates the plugin state after new dataset load.
|
930
|
+
*
|
931
|
+
* @param {Array[]} sourceData Array of arrays or array of objects containing data.
|
932
|
+
* @param {boolean} initialLoad Flag that determines whether the data has been loaded
|
933
|
+
* during the initialization.
|
934
|
+
*/
|
935
|
+
function _onAfterLoadData(sourceData, initialLoad) {
|
986
936
|
if (!initialLoad) {
|
987
937
|
this.updatePlugin();
|
988
938
|
}
|