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