handsontable 0.0.0-next-53a190b-20240403 → 0.0.0-next-5a535ed-20240403
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +17 -12
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +17 -12
- package/3rdparty/walkontable/src/calculator/viewportRows.js +15 -10
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +15 -10
- package/3rdparty/walkontable/src/cell/coords.js +17 -12
- package/3rdparty/walkontable/src/cell/coords.mjs +17 -12
- package/3rdparty/walkontable/src/cell/range.d.ts +1 -2
- package/3rdparty/walkontable/src/cell/range.js +28 -40
- package/3rdparty/walkontable/src/cell/range.mjs +28 -40
- package/3rdparty/walkontable/src/core/_base.js +1 -1
- package/3rdparty/walkontable/src/core/_base.mjs +1 -1
- package/3rdparty/walkontable/src/event.js +104 -72
- package/3rdparty/walkontable/src/event.mjs +104 -72
- package/3rdparty/walkontable/src/overlay/inlineStart.js +1 -15
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -16
- package/3rdparty/walkontable/src/overlay/top.js +0 -11
- package/3rdparty/walkontable/src/overlay/top.mjs +1 -12
- package/3rdparty/walkontable/src/overlays.js +4 -46
- package/3rdparty/walkontable/src/overlays.mjs +4 -46
- package/3rdparty/walkontable/src/scroll.js +17 -15
- package/3rdparty/walkontable/src/scroll.mjs +17 -15
- package/3rdparty/walkontable/src/selection/manager.js +69 -48
- package/3rdparty/walkontable/src/selection/manager.mjs +69 -48
- package/3rdparty/walkontable/src/selection/scanner.js +42 -33
- package/3rdparty/walkontable/src/selection/scanner.mjs +42 -33
- package/3rdparty/walkontable/src/utils/columnStretching.js +44 -27
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +44 -27
- package/3rdparty/walkontable/src/utils/orderView/view.js +1 -1
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +1 -1
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/viewportScroll/index.js +1 -4
- package/core/viewportScroll/index.mjs +1 -4
- package/core.d.ts +3 -4
- package/core.js +22 -77
- package/core.mjs +22 -77
- package/dataMap/dataSource.js +1 -1
- package/dataMap/dataSource.mjs +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +1 -1
- package/dataMap/metaManager/metaSchema.js +1 -1
- package/dataMap/metaManager/metaSchema.mjs +1 -1
- package/dataMap/replaceData.js +1 -1
- package/dataMap/replaceData.mjs +1 -1
- package/dist/handsontable.css +4 -4
- package/dist/handsontable.full.css +4 -4
- package/dist/handsontable.full.js +9121 -9062
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +292 -292
- package/dist/handsontable.js +6573 -6967
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +25 -25
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +23 -25
- package/editorManager.mjs +23 -25
- package/editors/autocompleteEditor/autocompleteEditor.js +10 -6
- package/editors/autocompleteEditor/autocompleteEditor.mjs +10 -6
- package/editors/selectEditor/selectEditor.js +19 -20
- package/editors/selectEditor/selectEditor.mjs +19 -20
- package/eventManager.js +1 -1
- package/eventManager.mjs +1 -1
- package/focusManager.js +82 -64
- package/focusManager.mjs +82 -64
- package/helpers/dom/element.js +1 -23
- package/helpers/dom/element.mjs +1 -21
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/object.js +2 -2
- package/helpers/object.mjs +2 -2
- package/index.d.ts +0 -10
- package/package.json +2 -7
- package/pluginHooks.d.ts +3 -4
- package/pluginHooks.js +38 -99
- package/pluginHooks.mjs +38 -99
- package/plugins/autoColumnSize/autoColumnSize.js +65 -49
- package/plugins/autoColumnSize/autoColumnSize.mjs +65 -49
- package/plugins/autoRowSize/autoRowSize.js +34 -28
- package/plugins/autoRowSize/autoRowSize.mjs +34 -28
- package/plugins/autofill/autofill.js +38 -30
- package/plugins/autofill/autofill.mjs +38 -30
- package/plugins/base/base.js +17 -12
- package/plugins/base/base.mjs +17 -12
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
- package/plugins/collapsibleColumns/collapsibleColumns.js +50 -59
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +50 -59
- package/plugins/columnSorting/columnSorting.js +45 -49
- package/plugins/columnSorting/columnSorting.mjs +45 -49
- package/plugins/columnSummary/columnSummary.js +26 -22
- package/plugins/columnSummary/columnSummary.mjs +26 -22
- package/plugins/comments/comments.js +158 -116
- package/plugins/comments/comments.mjs +158 -116
- package/plugins/contextMenu/contextMenu.js +26 -20
- package/plugins/contextMenu/contextMenu.mjs +26 -20
- package/plugins/contextMenu/itemsFactory.js +1 -1
- package/plugins/contextMenu/itemsFactory.mjs +1 -1
- package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
- package/plugins/contextMenu/menu/menu.js +21 -13
- package/plugins/contextMenu/menu/menu.mjs +21 -13
- package/plugins/contextMenu/menu/positioner.js +58 -41
- package/plugins/contextMenu/menu/positioner.mjs +58 -41
- package/plugins/copyPaste/copyPaste.js +157 -116
- package/plugins/copyPaste/copyPaste.mjs +157 -116
- package/plugins/copyPaste/copyableRanges.js +66 -43
- package/plugins/copyPaste/copyableRanges.mjs +66 -43
- package/plugins/customBorders/customBorders.js +13 -11
- package/plugins/customBorders/customBorders.mjs +13 -11
- package/plugins/dragToScroll/dragToScroll.js +6 -6
- package/plugins/dragToScroll/dragToScroll.mjs +6 -6
- package/plugins/dropdownMenu/dropdownMenu.js +106 -80
- package/plugins/dropdownMenu/dropdownMenu.mjs +106 -80
- package/plugins/exportFile/dataProvider.js +1 -1
- package/plugins/exportFile/dataProvider.mjs +1 -1
- package/plugins/filters/component/actionBar.js +9 -9
- package/plugins/filters/component/actionBar.mjs +8 -8
- package/plugins/filters/component/condition.js +15 -13
- package/plugins/filters/component/condition.mjs +15 -13
- package/plugins/filters/component/operators.js +6 -6
- package/plugins/filters/component/operators.mjs +6 -6
- package/plugins/filters/component/value.js +28 -24
- package/plugins/filters/component/value.mjs +28 -24
- package/plugins/filters/conditionUpdateObserver.js +24 -22
- package/plugins/filters/conditionUpdateObserver.mjs +24 -22
- package/plugins/filters/dataFilter.js +1 -1
- package/plugins/filters/dataFilter.mjs +1 -1
- package/plugins/filters/filters.js +95 -81
- package/plugins/filters/filters.mjs +95 -81
- package/plugins/filters/ui/input.js +19 -13
- package/plugins/filters/ui/input.mjs +19 -13
- package/plugins/filters/ui/link.js +13 -8
- package/plugins/filters/ui/link.mjs +13 -8
- package/plugins/filters/ui/multipleSelect.js +112 -85
- package/plugins/filters/ui/multipleSelect.mjs +112 -85
- package/plugins/filters/ui/radioInput.js +20 -12
- package/plugins/filters/ui/radioInput.mjs +20 -12
- package/plugins/filters/ui/select.js +72 -50
- package/plugins/filters/ui/select.mjs +71 -49
- package/plugins/formulas/formulas.js +326 -268
- package/plugins/formulas/formulas.mjs +327 -269
- package/plugins/formulas/indexSyncer/axisSyncer.js +61 -38
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +61 -38
- package/plugins/formulas/indexSyncer/index.js +48 -25
- package/plugins/formulas/indexSyncer/index.mjs +48 -25
- package/plugins/hiddenColumns/hiddenColumns.js +83 -64
- package/plugins/hiddenColumns/hiddenColumns.mjs +83 -64
- package/plugins/hiddenRows/hiddenRows.js +82 -63
- package/plugins/hiddenRows/hiddenRows.mjs +82 -63
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +32 -24
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +33 -25
- package/plugins/manualColumnMove/manualColumnMove.js +170 -126
- package/plugins/manualColumnMove/manualColumnMove.mjs +170 -126
- package/plugins/manualColumnResize/manualColumnResize.js +230 -169
- package/plugins/manualColumnResize/manualColumnResize.mjs +230 -169
- package/plugins/manualRowMove/manualRowMove.js +128 -99
- package/plugins/manualRowMove/manualRowMove.mjs +128 -99
- package/plugins/manualRowResize/manualRowResize.js +209 -150
- package/plugins/manualRowResize/manualRowResize.mjs +209 -150
- package/plugins/mergeCells/calculations/selection.js +71 -2
- package/plugins/mergeCells/calculations/selection.mjs +71 -2
- package/plugins/mergeCells/cellsCollection.js +1 -117
- package/plugins/mergeCells/cellsCollection.mjs +1 -117
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
- package/plugins/mergeCells/mergeCells.js +397 -499
- package/plugins/mergeCells/mergeCells.mjs +397 -499
- package/plugins/multiColumnSorting/multiColumnSorting.js +2 -8
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -8
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
- package/plugins/nestedHeaders/nestedHeaders.js +253 -205
- package/plugins/nestedHeaders/nestedHeaders.mjs +254 -206
- package/plugins/nestedHeaders/stateManager/headersTree.js +32 -21
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +32 -21
- package/plugins/nestedHeaders/stateManager/index.js +41 -30
- package/plugins/nestedHeaders/stateManager/index.mjs +41 -30
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +30 -19
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +30 -19
- package/plugins/nestedRows/data/dataManager.js +1 -1
- package/plugins/nestedRows/data/dataManager.mjs +1 -1
- package/plugins/nestedRows/nestedRows.js +182 -151
- package/plugins/nestedRows/nestedRows.mjs +183 -152
- package/plugins/nestedRows/ui/contextMenu.js +15 -11
- package/plugins/nestedRows/ui/contextMenu.mjs +14 -10
- package/plugins/nestedRows/utils/rowMoveController.js +1 -1
- package/plugins/nestedRows/utils/rowMoveController.mjs +1 -1
- package/plugins/persistentState/storage.js +2 -2
- package/plugins/persistentState/storage.mjs +2 -2
- package/plugins/search/search.js +7 -7
- package/plugins/search/search.mjs +7 -7
- package/plugins/touchScroll/touchScroll.js +19 -15
- package/plugins/touchScroll/touchScroll.mjs +20 -16
- package/plugins/trimRows/trimRows.js +6 -6
- package/plugins/trimRows/trimRows.mjs +6 -6
- package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
- package/selection/highlight/highlight.js +14 -14
- package/selection/highlight/highlight.mjs +13 -13
- package/selection/highlight/visualSelection.js +0 -2
- package/selection/highlight/visualSelection.mjs +0 -2
- package/selection/selection.js +67 -225
- package/selection/selection.mjs +66 -224
- package/selection/transformation.js +118 -149
- package/selection/transformation.mjs +118 -149
- package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
- package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
- package/shortcutContexts/commands/editor/open.js +3 -18
- package/shortcutContexts/commands/editor/open.mjs +3 -18
- package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
- package/shortcutContexts/grid.js +3 -9
- package/shortcutContexts/grid.mjs +3 -9
- package/shortcuts/context.js +1 -2
- package/shortcuts/context.mjs +1 -2
- package/tableView.js +78 -52
- package/tableView.mjs +78 -52
- package/translations/changesObservable/observable.js +38 -21
- package/translations/changesObservable/observable.mjs +38 -21
- package/translations/changesObservable/observer.js +12 -7
- package/translations/changesObservable/observer.mjs +11 -6
- package/translations/mapCollections/aggregatedCollection.js +1 -1
- package/translations/mapCollections/aggregatedCollection.mjs +1 -1
- package/translations/maps/indexMap.js +1 -1
- package/translations/maps/indexMap.mjs +1 -1
- package/utils/dataStructures/linkedList.js +1 -6
- package/utils/dataStructures/linkedList.mjs +1 -6
- package/utils/dataStructures/tree.js +1 -1
- package/utils/dataStructures/tree.mjs +1 -1
- package/utils/interval.js +44 -26
- package/utils/interval.mjs +44 -26
- package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
- package/i18n/languages/ar-AR.d.ts +0 -5
- package/i18n/languages/cs-CZ.d.ts +0 -5
- package/i18n/languages/hr-HR.d.ts +0 -5
- package/i18n/languages/sr-SP.d.ts +0 -5
- package/plugins/mergeCells/focusOrder.js +0 -305
- package/plugins/mergeCells/focusOrder.mjs +0 -300
@@ -1,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 _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
5
5
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
6
6
|
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; }
|
7
7
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
8
8
|
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); }
|
9
|
-
function _classPrivateFieldGet(
|
10
|
-
function
|
11
|
-
function
|
9
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
10
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
11
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
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 _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
14
|
+
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 { BasePlugin } from "../base/index.mjs";
|
13
16
|
import DataManager from "./data/dataManager.mjs";
|
14
17
|
import CollapsingUI from "./ui/collapsing.mjs";
|
@@ -17,7 +20,6 @@ import ContextMenuUI from "./ui/contextMenu.mjs";
|
|
17
20
|
import { error } from "../../helpers/console.mjs";
|
18
21
|
import { isArrayOfObjects } from "../../helpers/data.mjs";
|
19
22
|
import { TrimmingMap } from "../../translations/index.mjs";
|
20
|
-
import { EDITOR_EDIT_GROUP as SHORTCUTS_GROUP_EDITOR } from "../../shortcutContexts/index.mjs";
|
21
23
|
import RowMoveController from "./utils/rowMoveController.mjs";
|
22
24
|
export const PLUGIN_KEY = 'nestedRows';
|
23
25
|
export const PLUGIN_PRIORITY = 300;
|
@@ -38,10 +40,125 @@ const WRONG_DATA_TYPE_ERROR = 'The Nested Rows plugin requires an Array of Objec
|
|
38
40
|
*/
|
39
41
|
var _skipRender = /*#__PURE__*/new WeakMap();
|
40
42
|
var _skipCoreAPIModifiers = /*#__PURE__*/new WeakMap();
|
41
|
-
var
|
43
|
+
var _onBeforeRowMove = /*#__PURE__*/new WeakSet();
|
44
|
+
var _onBeforeOnCellMouseDown = /*#__PURE__*/new WeakSet();
|
45
|
+
var _onFilterData = /*#__PURE__*/new WeakSet();
|
46
|
+
var _onAfterContextMenuDefaultOptions = /*#__PURE__*/new WeakSet();
|
47
|
+
var _onAfterGetRowHeader = /*#__PURE__*/new WeakSet();
|
48
|
+
var _onModifyRowHeaderWidth = /*#__PURE__*/new WeakSet();
|
49
|
+
var _onAfterRemoveRow = /*#__PURE__*/new WeakSet();
|
50
|
+
var _onBeforeRemoveRow = /*#__PURE__*/new WeakSet();
|
51
|
+
var _onBeforeAddChild = /*#__PURE__*/new WeakSet();
|
52
|
+
var _onAfterAddChild = /*#__PURE__*/new WeakSet();
|
53
|
+
var _onBeforeDetachChild = /*#__PURE__*/new WeakSet();
|
54
|
+
var _onAfterDetachChild = /*#__PURE__*/new WeakSet();
|
55
|
+
var _onAfterCreateRow = /*#__PURE__*/new WeakSet();
|
56
|
+
var _onAfterInit = /*#__PURE__*/new WeakSet();
|
57
|
+
var _onBeforeViewRender = /*#__PURE__*/new WeakSet();
|
58
|
+
var _onBeforeLoadData = /*#__PURE__*/new WeakSet();
|
42
59
|
export class NestedRows extends BasePlugin {
|
43
60
|
constructor() {
|
44
61
|
super(...arguments);
|
62
|
+
/**
|
63
|
+
* `beforeLoadData` hook callback.
|
64
|
+
*
|
65
|
+
* @param {Array} data The source data.
|
66
|
+
*/
|
67
|
+
_classPrivateMethodInitSpec(this, _onBeforeLoadData);
|
68
|
+
/**
|
69
|
+
* `beforeViewRender` hook callback.
|
70
|
+
*
|
71
|
+
* @param {boolean} force Indicates if the render call was triggered by a change of settings or data.
|
72
|
+
* @param {object} skipRender An object, holder for skipRender functionality.
|
73
|
+
*/
|
74
|
+
_classPrivateMethodInitSpec(this, _onBeforeViewRender);
|
75
|
+
/**
|
76
|
+
* `afterInit` hook callback.
|
77
|
+
*/
|
78
|
+
_classPrivateMethodInitSpec(this, _onAfterInit);
|
79
|
+
/**
|
80
|
+
* `afterCreateRow` hook callback.
|
81
|
+
*/
|
82
|
+
_classPrivateMethodInitSpec(this, _onAfterCreateRow);
|
83
|
+
/**
|
84
|
+
* `afterDetachChild` hook callback.
|
85
|
+
*
|
86
|
+
* @param {object} parent Parent element.
|
87
|
+
* @param {object} element New child element.
|
88
|
+
* @param {number} finalElementRowIndex The final row index of the detached element.
|
89
|
+
*/
|
90
|
+
_classPrivateMethodInitSpec(this, _onAfterDetachChild);
|
91
|
+
/**
|
92
|
+
* `beforeDetachChild` hook callback.
|
93
|
+
*/
|
94
|
+
_classPrivateMethodInitSpec(this, _onBeforeDetachChild);
|
95
|
+
/**
|
96
|
+
* `afterAddChild` hook callback.
|
97
|
+
*
|
98
|
+
* @param {object} parent Parent element.
|
99
|
+
* @param {object} element New child element.
|
100
|
+
*/
|
101
|
+
_classPrivateMethodInitSpec(this, _onAfterAddChild);
|
102
|
+
/**
|
103
|
+
* `beforeAddChild` hook callback.
|
104
|
+
*/
|
105
|
+
_classPrivateMethodInitSpec(this, _onBeforeAddChild);
|
106
|
+
/**
|
107
|
+
* Callback for the `beforeRemoveRow` change list of removed physical indexes by reference. Removing parent node
|
108
|
+
* has effect in removing children nodes.
|
109
|
+
*
|
110
|
+
* @param {number} index Visual index of starter row.
|
111
|
+
* @param {number} amount Amount of rows to be removed.
|
112
|
+
* @param {Array} physicalRows List of physical indexes.
|
113
|
+
*/
|
114
|
+
_classPrivateMethodInitSpec(this, _onBeforeRemoveRow);
|
115
|
+
/**
|
116
|
+
* `onAfterRemoveRow` hook callback.
|
117
|
+
*
|
118
|
+
* @param {number} index Removed row.
|
119
|
+
* @param {number} amount Amount of removed rows.
|
120
|
+
* @param {Array} logicRows An array of the removed physical rows.
|
121
|
+
* @param {string} source Source of action.
|
122
|
+
*/
|
123
|
+
_classPrivateMethodInitSpec(this, _onAfterRemoveRow);
|
124
|
+
/**
|
125
|
+
* `modifyRowHeaderWidth` hook callback.
|
126
|
+
*
|
127
|
+
* @param {number} rowHeaderWidth The initial row header width(s).
|
128
|
+
* @returns {number}
|
129
|
+
*/
|
130
|
+
_classPrivateMethodInitSpec(this, _onModifyRowHeaderWidth);
|
131
|
+
/**
|
132
|
+
* `afterGetRowHeader` hook callback.
|
133
|
+
*
|
134
|
+
* @param {number} row Row index.
|
135
|
+
* @param {HTMLElement} TH Row header element.
|
136
|
+
*/
|
137
|
+
_classPrivateMethodInitSpec(this, _onAfterGetRowHeader);
|
138
|
+
/**
|
139
|
+
* `afterContextMenuDefaultOptions` hook callback.
|
140
|
+
*
|
141
|
+
* @param {object} defaultOptions The default context menu items order.
|
142
|
+
* @returns {boolean}
|
143
|
+
*/
|
144
|
+
_classPrivateMethodInitSpec(this, _onAfterContextMenuDefaultOptions);
|
145
|
+
/**
|
146
|
+
* Provide custom source data filtering. It's handled by core method and replaces the native filtering.
|
147
|
+
*
|
148
|
+
* @param {number} index The index where the data filtering starts.
|
149
|
+
* @param {number} amount An amount of rows which filtering applies to.
|
150
|
+
* @param {number} physicalRows Physical row indexes.
|
151
|
+
* @returns {Array}
|
152
|
+
*/
|
153
|
+
_classPrivateMethodInitSpec(this, _onFilterData);
|
154
|
+
/**
|
155
|
+
* `beforeOnCellMousedown` hook callback.
|
156
|
+
*
|
157
|
+
* @param {MouseEvent} event Mousedown event.
|
158
|
+
* @param {object} coords Cell coords.
|
159
|
+
* @param {HTMLElement} TD Clicked cell.
|
160
|
+
*/
|
161
|
+
_classPrivateMethodInitSpec(this, _onBeforeOnCellMouseDown);
|
45
162
|
/**
|
46
163
|
* `beforeRowMove` hook callback.
|
47
164
|
*
|
@@ -56,7 +173,7 @@ export class NestedRows extends BasePlugin {
|
|
56
173
|
* @fires Hooks#afterRowMove
|
57
174
|
* @returns {boolean}
|
58
175
|
*/
|
59
|
-
_classPrivateMethodInitSpec(this,
|
176
|
+
_classPrivateMethodInitSpec(this, _onBeforeRowMove);
|
60
177
|
/**
|
61
178
|
* Reference to the DataManager instance.
|
62
179
|
*
|
@@ -83,13 +200,19 @@ export class NestedRows extends BasePlugin {
|
|
83
200
|
*
|
84
201
|
* @type {boolean}
|
85
202
|
*/
|
86
|
-
_classPrivateFieldInitSpec(this, _skipRender,
|
203
|
+
_classPrivateFieldInitSpec(this, _skipRender, {
|
204
|
+
writable: true,
|
205
|
+
value: false
|
206
|
+
});
|
87
207
|
/**
|
88
208
|
* Allows skipping the internal Core methods call if set as `true`.
|
89
209
|
*
|
90
210
|
* @type {boolean}
|
91
211
|
*/
|
92
|
-
_classPrivateFieldInitSpec(this, _skipCoreAPIModifiers,
|
212
|
+
_classPrivateFieldInitSpec(this, _skipCoreAPIModifiers, {
|
213
|
+
writable: true,
|
214
|
+
value: false
|
215
|
+
});
|
93
216
|
}
|
94
217
|
static get PLUGIN_KEY() {
|
95
218
|
return PLUGIN_KEY;
|
@@ -125,13 +248,13 @@ export class NestedRows extends BasePlugin {
|
|
125
248
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
126
249
|
args[_key] = arguments[_key];
|
127
250
|
}
|
128
|
-
return
|
251
|
+
return _classPrivateMethodGet(_this, _onAfterInit, _onAfterInit2).call(_this, ...args);
|
129
252
|
});
|
130
253
|
this.addHook('beforeViewRender', function () {
|
131
254
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
132
255
|
args[_key2] = arguments[_key2];
|
133
256
|
}
|
134
|
-
return
|
257
|
+
return _classPrivateMethodGet(_this, _onBeforeViewRender, _onBeforeViewRender2).call(_this, ...args);
|
135
258
|
});
|
136
259
|
this.addHook('modifyRowData', function () {
|
137
260
|
return _this.onModifyRowData(...arguments);
|
@@ -146,82 +269,82 @@ export class NestedRows extends BasePlugin {
|
|
146
269
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
147
270
|
args[_key3] = arguments[_key3];
|
148
271
|
}
|
149
|
-
return
|
272
|
+
return _classPrivateMethodGet(_this, _onFilterData, _onFilterData2).call(_this, ...args);
|
150
273
|
});
|
151
274
|
this.addHook('afterContextMenuDefaultOptions', function () {
|
152
275
|
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
153
276
|
args[_key4] = arguments[_key4];
|
154
277
|
}
|
155
|
-
return
|
278
|
+
return _classPrivateMethodGet(_this, _onAfterContextMenuDefaultOptions, _onAfterContextMenuDefaultOptions2).call(_this, ...args);
|
156
279
|
});
|
157
280
|
this.addHook('afterGetRowHeader', function () {
|
158
281
|
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
159
282
|
args[_key5] = arguments[_key5];
|
160
283
|
}
|
161
|
-
return
|
284
|
+
return _classPrivateMethodGet(_this, _onAfterGetRowHeader, _onAfterGetRowHeader2).call(_this, ...args);
|
162
285
|
});
|
163
286
|
this.addHook('beforeOnCellMouseDown', function () {
|
164
287
|
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
165
288
|
args[_key6] = arguments[_key6];
|
166
289
|
}
|
167
|
-
return
|
290
|
+
return _classPrivateMethodGet(_this, _onBeforeOnCellMouseDown, _onBeforeOnCellMouseDown2).call(_this, ...args);
|
168
291
|
});
|
169
292
|
this.addHook('beforeRemoveRow', function () {
|
170
293
|
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
171
294
|
args[_key7] = arguments[_key7];
|
172
295
|
}
|
173
|
-
return
|
296
|
+
return _classPrivateMethodGet(_this, _onBeforeRemoveRow, _onBeforeRemoveRow2).call(_this, ...args);
|
174
297
|
});
|
175
298
|
this.addHook('afterRemoveRow', function () {
|
176
299
|
for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
|
177
300
|
args[_key8] = arguments[_key8];
|
178
301
|
}
|
179
|
-
return
|
302
|
+
return _classPrivateMethodGet(_this, _onAfterRemoveRow, _onAfterRemoveRow2).call(_this, ...args);
|
180
303
|
});
|
181
304
|
this.addHook('beforeAddChild', function () {
|
182
305
|
for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
|
183
306
|
args[_key9] = arguments[_key9];
|
184
307
|
}
|
185
|
-
return
|
308
|
+
return _classPrivateMethodGet(_this, _onBeforeAddChild, _onBeforeAddChild2).call(_this, ...args);
|
186
309
|
});
|
187
310
|
this.addHook('afterAddChild', function () {
|
188
311
|
for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
|
189
312
|
args[_key10] = arguments[_key10];
|
190
313
|
}
|
191
|
-
return
|
314
|
+
return _classPrivateMethodGet(_this, _onAfterAddChild, _onAfterAddChild2).call(_this, ...args);
|
192
315
|
});
|
193
316
|
this.addHook('beforeDetachChild', function () {
|
194
317
|
for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
|
195
318
|
args[_key11] = arguments[_key11];
|
196
319
|
}
|
197
|
-
return
|
320
|
+
return _classPrivateMethodGet(_this, _onBeforeDetachChild, _onBeforeDetachChild2).call(_this, ...args);
|
198
321
|
});
|
199
322
|
this.addHook('afterDetachChild', function () {
|
200
323
|
for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
|
201
324
|
args[_key12] = arguments[_key12];
|
202
325
|
}
|
203
|
-
return
|
326
|
+
return _classPrivateMethodGet(_this, _onAfterDetachChild, _onAfterDetachChild2).call(_this, ...args);
|
204
327
|
});
|
205
328
|
this.addHook('modifyRowHeaderWidth', function () {
|
206
329
|
for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
|
207
330
|
args[_key13] = arguments[_key13];
|
208
331
|
}
|
209
|
-
return
|
332
|
+
return _classPrivateMethodGet(_this, _onModifyRowHeaderWidth, _onModifyRowHeaderWidth2).call(_this, ...args);
|
210
333
|
});
|
211
334
|
this.addHook('afterCreateRow', function () {
|
212
335
|
for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) {
|
213
336
|
args[_key14] = arguments[_key14];
|
214
337
|
}
|
215
|
-
return
|
338
|
+
return _classPrivateMethodGet(_this, _onAfterCreateRow, _onAfterCreateRow2).call(_this, ...args);
|
216
339
|
});
|
217
340
|
this.addHook('beforeRowMove', function () {
|
218
341
|
for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {
|
219
342
|
args[_key15] = arguments[_key15];
|
220
343
|
}
|
221
|
-
return
|
344
|
+
return _classPrivateMethodGet(_this, _onBeforeRowMove, _onBeforeRowMove2).call(_this, ...args);
|
222
345
|
});
|
223
|
-
this.addHook('beforeLoadData', data =>
|
224
|
-
this.addHook('beforeUpdateData', data =>
|
346
|
+
this.addHook('beforeLoadData', data => _classPrivateMethodGet(this, _onBeforeLoadData, _onBeforeLoadData2).call(this, data));
|
347
|
+
this.addHook('beforeUpdateData', data => _classPrivateMethodGet(this, _onBeforeLoadData, _onBeforeLoadData2).call(this, data));
|
225
348
|
this.registerShortcuts();
|
226
349
|
super.enablePlugin();
|
227
350
|
}
|
@@ -265,24 +388,21 @@ export class NestedRows extends BasePlugin {
|
|
265
388
|
const {
|
266
389
|
highlight
|
267
390
|
} = this.hot.getSelectedRangeLast();
|
268
|
-
|
269
|
-
|
270
|
-
this.collapsingUI.
|
271
|
-
|
272
|
-
|
391
|
+
if (highlight.col === -1 && highlight.row >= 0) {
|
392
|
+
const row = this.collapsingUI.translateTrimmedRow(highlight.row);
|
393
|
+
if (this.collapsingUI.areChildrenCollapsed(row)) {
|
394
|
+
this.collapsingUI.expandChildren(row);
|
395
|
+
} else {
|
396
|
+
this.collapsingUI.collapseChildren(row);
|
397
|
+
}
|
273
398
|
}
|
274
|
-
|
275
|
-
// prevent default Enter behavior (move to the next row within a selection range)
|
276
|
-
return false;
|
277
399
|
},
|
278
400
|
runOnlyIf: () => {
|
279
|
-
var _this$hot$getSelected
|
401
|
+
var _this$hot$getSelected;
|
280
402
|
const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
|
281
|
-
return highlight &&
|
403
|
+
return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isHeader();
|
282
404
|
},
|
283
|
-
group: SHORTCUTS_GROUP
|
284
|
-
relativeToGroup: SHORTCUTS_GROUP_EDITOR,
|
285
|
-
position: 'before'
|
405
|
+
group: SHORTCUTS_GROUP
|
286
406
|
});
|
287
407
|
}
|
288
408
|
|
@@ -301,7 +421,7 @@ export class NestedRows extends BasePlugin {
|
|
301
421
|
* @private
|
302
422
|
*/
|
303
423
|
disableCoreAPIModifiers() {
|
304
|
-
_classPrivateFieldSet(
|
424
|
+
_classPrivateFieldSet(this, _skipCoreAPIModifiers, true);
|
305
425
|
}
|
306
426
|
|
307
427
|
/**
|
@@ -310,17 +430,8 @@ export class NestedRows extends BasePlugin {
|
|
310
430
|
* @private
|
311
431
|
*/
|
312
432
|
enableCoreAPIModifiers() {
|
313
|
-
_classPrivateFieldSet(
|
433
|
+
_classPrivateFieldSet(this, _skipCoreAPIModifiers, false);
|
314
434
|
}
|
315
|
-
|
316
|
-
/**
|
317
|
-
* `beforeOnCellMousedown` hook callback.
|
318
|
-
*
|
319
|
-
* @param {MouseEvent} event Mousedown event.
|
320
|
-
* @param {object} coords Cell coords.
|
321
|
-
* @param {HTMLElement} TD Clicked cell.
|
322
|
-
*/
|
323
|
-
|
324
435
|
/**
|
325
436
|
* The modifyRowData hook callback.
|
326
437
|
*
|
@@ -329,7 +440,7 @@ export class NestedRows extends BasePlugin {
|
|
329
440
|
* @returns {boolean}
|
330
441
|
*/
|
331
442
|
onModifyRowData(row) {
|
332
|
-
if (_classPrivateFieldGet(
|
443
|
+
if (_classPrivateFieldGet(this, _skipCoreAPIModifiers)) {
|
333
444
|
return;
|
334
445
|
}
|
335
446
|
return this.dataManager.getDataObject(row);
|
@@ -342,7 +453,7 @@ export class NestedRows extends BasePlugin {
|
|
342
453
|
* @returns {number}
|
343
454
|
*/
|
344
455
|
onModifySourceLength() {
|
345
|
-
if (_classPrivateFieldGet(
|
456
|
+
if (_classPrivateFieldGet(this, _skipCoreAPIModifiers)) {
|
346
457
|
return;
|
347
458
|
}
|
348
459
|
return this.dataManager.countAllRows();
|
@@ -356,22 +467,12 @@ export class NestedRows extends BasePlugin {
|
|
356
467
|
* @returns {boolean}
|
357
468
|
*/
|
358
469
|
onBeforeDataSplice(index, amount, element) {
|
359
|
-
if (_classPrivateFieldGet(
|
470
|
+
if (_classPrivateFieldGet(this, _skipCoreAPIModifiers) || this.dataManager.isRowHighestLevel(index)) {
|
360
471
|
return true;
|
361
472
|
}
|
362
473
|
this.dataManager.spliceData(index, amount, element);
|
363
474
|
return false;
|
364
475
|
}
|
365
|
-
|
366
|
-
/**
|
367
|
-
* Provide custom source data filtering. It's handled by core method and replaces the native filtering.
|
368
|
-
*
|
369
|
-
* @param {number} index The index where the data filtering starts.
|
370
|
-
* @param {number} amount An amount of rows which filtering applies to.
|
371
|
-
* @param {number} physicalRows Physical row indexes.
|
372
|
-
* @returns {Array}
|
373
|
-
*/
|
374
|
-
|
375
476
|
/**
|
376
477
|
* Destroys the plugin instance.
|
377
478
|
*/
|
@@ -379,74 +480,40 @@ export class NestedRows extends BasePlugin {
|
|
379
480
|
super.destroy();
|
380
481
|
}
|
381
482
|
}
|
382
|
-
function
|
483
|
+
function _onBeforeRowMove2(rows, finalIndex, dropIndex, movePossible) {
|
383
484
|
return this.rowMoveController.onBeforeRowMove(rows, finalIndex, dropIndex, movePossible);
|
384
485
|
}
|
385
|
-
function
|
486
|
+
function _onBeforeOnCellMouseDown2(event, coords, TD) {
|
386
487
|
this.collapsingUI.toggleState(event, coords, TD);
|
387
488
|
}
|
388
|
-
function
|
489
|
+
function _onFilterData2(index, amount, physicalRows) {
|
389
490
|
this.collapsingUI.collapsedRowsStash.stash();
|
390
491
|
this.collapsingUI.collapsedRowsStash.trimStash(physicalRows[0], amount);
|
391
492
|
this.collapsingUI.collapsedRowsStash.shiftStash(physicalRows[0], null, -1 * amount);
|
392
493
|
this.dataManager.filterData(index, amount, physicalRows);
|
393
|
-
_classPrivateFieldSet(
|
494
|
+
_classPrivateFieldSet(this, _skipRender, true);
|
394
495
|
return this.dataManager.getData().slice(); // Data contains reference sometimes.
|
395
496
|
}
|
396
|
-
|
397
|
-
* `afterContextMenuDefaultOptions` hook callback.
|
398
|
-
*
|
399
|
-
* @param {object} defaultOptions The default context menu items order.
|
400
|
-
* @returns {boolean}
|
401
|
-
*/
|
402
|
-
function _onAfterContextMenuDefaultOptions(defaultOptions) {
|
497
|
+
function _onAfterContextMenuDefaultOptions2(defaultOptions) {
|
403
498
|
return this.contextMenuUI.appendOptions(defaultOptions);
|
404
499
|
}
|
405
|
-
|
406
|
-
* `afterGetRowHeader` hook callback.
|
407
|
-
*
|
408
|
-
* @param {number} row Row index.
|
409
|
-
* @param {HTMLElement} TH Row header element.
|
410
|
-
*/
|
411
|
-
function _onAfterGetRowHeader(row, TH) {
|
500
|
+
function _onAfterGetRowHeader2(row, TH) {
|
412
501
|
this.headersUI.appendLevelIndicators(row, TH);
|
413
502
|
}
|
414
|
-
|
415
|
-
* `modifyRowHeaderWidth` hook callback.
|
416
|
-
*
|
417
|
-
* @param {number} rowHeaderWidth The initial row header width(s).
|
418
|
-
* @returns {number}
|
419
|
-
*/
|
420
|
-
function _onModifyRowHeaderWidth(rowHeaderWidth) {
|
503
|
+
function _onModifyRowHeaderWidth2(rowHeaderWidth) {
|
421
504
|
return Math.max(this.headersUI.rowHeaderWidthCache, rowHeaderWidth);
|
422
505
|
}
|
423
|
-
|
424
|
-
* `onAfterRemoveRow` hook callback.
|
425
|
-
*
|
426
|
-
* @param {number} index Removed row.
|
427
|
-
* @param {number} amount Amount of removed rows.
|
428
|
-
* @param {Array} logicRows An array of the removed physical rows.
|
429
|
-
* @param {string} source Source of action.
|
430
|
-
*/
|
431
|
-
function _onAfterRemoveRow(index, amount, logicRows, source) {
|
506
|
+
function _onAfterRemoveRow2(index, amount, logicRows, source) {
|
432
507
|
if (source === this.pluginName) {
|
433
508
|
return;
|
434
509
|
}
|
435
510
|
this.hot._registerTimeout(() => {
|
436
|
-
_classPrivateFieldSet(
|
511
|
+
_classPrivateFieldSet(this, _skipRender, false);
|
437
512
|
this.headersUI.updateRowHeaderWidth();
|
438
513
|
this.collapsingUI.collapsedRowsStash.applyStash();
|
439
514
|
});
|
440
515
|
}
|
441
|
-
|
442
|
-
* Callback for the `beforeRemoveRow` change list of removed physical indexes by reference. Removing parent node
|
443
|
-
* has effect in removing children nodes.
|
444
|
-
*
|
445
|
-
* @param {number} index Visual index of starter row.
|
446
|
-
* @param {number} amount Amount of rows to be removed.
|
447
|
-
* @param {Array} physicalRows List of physical indexes.
|
448
|
-
*/
|
449
|
-
function _onBeforeRemoveRow(index, amount, physicalRows) {
|
516
|
+
function _onBeforeRemoveRow2(index, amount, physicalRows) {
|
450
517
|
const modifiedPhysicalRows = Array.from(physicalRows.reduce((removedRows, physicalIndex) => {
|
451
518
|
if (this.dataManager.isParent(physicalIndex)) {
|
452
519
|
const children = this.dataManager.getDataObject(physicalIndex).__children;
|
@@ -468,70 +535,34 @@ function _onBeforeRemoveRow(index, amount, physicalRows) {
|
|
468
535
|
physicalRows.length = 0;
|
469
536
|
physicalRows.push(...modifiedPhysicalRows);
|
470
537
|
}
|
471
|
-
|
472
|
-
* `beforeAddChild` hook callback.
|
473
|
-
*/
|
474
|
-
function _onBeforeAddChild() {
|
538
|
+
function _onBeforeAddChild2() {
|
475
539
|
this.collapsingUI.collapsedRowsStash.stash();
|
476
540
|
}
|
477
|
-
|
478
|
-
* `afterAddChild` hook callback.
|
479
|
-
*
|
480
|
-
* @param {object} parent Parent element.
|
481
|
-
* @param {object} element New child element.
|
482
|
-
*/
|
483
|
-
function _onAfterAddChild(parent, element) {
|
541
|
+
function _onAfterAddChild2(parent, element) {
|
484
542
|
this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(element));
|
485
543
|
this.collapsingUI.collapsedRowsStash.applyStash();
|
486
544
|
this.headersUI.updateRowHeaderWidth();
|
487
545
|
}
|
488
|
-
|
489
|
-
* `beforeDetachChild` hook callback.
|
490
|
-
*/
|
491
|
-
function _onBeforeDetachChild() {
|
546
|
+
function _onBeforeDetachChild2() {
|
492
547
|
this.collapsingUI.collapsedRowsStash.stash();
|
493
548
|
}
|
494
|
-
|
495
|
-
* `afterDetachChild` hook callback.
|
496
|
-
*
|
497
|
-
* @param {object} parent Parent element.
|
498
|
-
* @param {object} element New child element.
|
499
|
-
* @param {number} finalElementRowIndex The final row index of the detached element.
|
500
|
-
*/
|
501
|
-
function _onAfterDetachChild(parent, element, finalElementRowIndex) {
|
549
|
+
function _onAfterDetachChild2(parent, element, finalElementRowIndex) {
|
502
550
|
this.collapsingUI.collapsedRowsStash.shiftStash(finalElementRowIndex, null, -1);
|
503
551
|
this.collapsingUI.collapsedRowsStash.applyStash();
|
504
552
|
this.headersUI.updateRowHeaderWidth();
|
505
553
|
}
|
506
|
-
|
507
|
-
* `afterCreateRow` hook callback.
|
508
|
-
*/
|
509
|
-
function _onAfterCreateRow() {
|
554
|
+
function _onAfterCreateRow2() {
|
510
555
|
this.dataManager.rewriteCache();
|
511
556
|
}
|
512
|
-
|
513
|
-
* `afterInit` hook callback.
|
514
|
-
*/
|
515
|
-
function _onAfterInit() {
|
557
|
+
function _onAfterInit2() {
|
516
558
|
this.headersUI.updateRowHeaderWidth();
|
517
559
|
}
|
518
|
-
|
519
|
-
|
520
|
-
*
|
521
|
-
* @param {boolean} force Indicates if the render call was triggered by a change of settings or data.
|
522
|
-
* @param {object} skipRender An object, holder for skipRender functionality.
|
523
|
-
*/
|
524
|
-
function _onBeforeViewRender(force, skipRender) {
|
525
|
-
if (_classPrivateFieldGet(_skipRender, this)) {
|
560
|
+
function _onBeforeViewRender2(force, skipRender) {
|
561
|
+
if (_classPrivateFieldGet(this, _skipRender)) {
|
526
562
|
skipRender.skipRender = true;
|
527
563
|
}
|
528
564
|
}
|
529
|
-
|
530
|
-
* `beforeLoadData` hook callback.
|
531
|
-
*
|
532
|
-
* @param {Array} data The source data.
|
533
|
-
*/
|
534
|
-
function _onBeforeLoadData(data) {
|
565
|
+
function _onBeforeLoadData2(data) {
|
535
566
|
if (!isArrayOfObjects(data)) {
|
536
567
|
error(WRONG_DATA_TYPE_ERROR);
|
537
568
|
this.hot.getSettings()[PLUGIN_KEY] = false;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
exports.__esModule = true;
|
4
3
|
require("core-js/modules/es.error.cause.js");
|
4
|
+
exports.__esModule = true;
|
5
5
|
var _number = require("../../../helpers/number");
|
6
6
|
var _array = require("../../../helpers/array");
|
7
7
|
var C = _interopRequireWildcard(require("../../../i18n/constants"));
|
@@ -14,8 +14,9 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
14
14
|
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; }
|
15
15
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
16
16
|
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); }
|
17
|
-
function _classPrivateFieldGet(
|
18
|
-
function
|
17
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
18
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
19
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
19
20
|
/**
|
20
21
|
* Class responsible for the Context Menu entries for the Nested Rows plugin.
|
21
22
|
*
|
@@ -34,13 +35,16 @@ class ContextMenuUI extends _base.default {
|
|
34
35
|
*/
|
35
36
|
_defineProperty(this, "dataManager", this.plugin.dataManager);
|
36
37
|
_classPrivateFieldInitSpec(this, _menuEntries, {
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
38
|
+
writable: true,
|
39
|
+
value: {
|
40
|
+
row_above: (key, selection) => {
|
41
|
+
const lastSelection = selection[selection.length - 1];
|
42
|
+
this.dataManager.addSibling(lastSelection.start.row, 'above');
|
43
|
+
},
|
44
|
+
row_below: (key, selection) => {
|
45
|
+
const lastSelection = selection[selection.length - 1];
|
46
|
+
this.dataManager.addSibling(lastSelection.start.row, 'below');
|
47
|
+
}
|
44
48
|
}
|
45
49
|
});
|
46
50
|
}
|
@@ -104,7 +108,7 @@ class ContextMenuUI extends _base.default {
|
|
104
108
|
*/
|
105
109
|
modifyRowInsertingOptions(defaultOptions) {
|
106
110
|
(0, _number.rangeEach)(0, defaultOptions.items.length - 1, i => {
|
107
|
-
const option = _classPrivateFieldGet(
|
111
|
+
const option = _classPrivateFieldGet(this, _menuEntries)[defaultOptions.items[i].key];
|
108
112
|
if (option !== null && option !== undefined) {
|
109
113
|
defaultOptions.items[i].callback = option;
|
110
114
|
}
|