handsontable 14.0.0-next-c080457-20231107 → 14.0.0-next-bfad250-20231108
Sign up to get free protection for your applications and to get access to all the features.
- package/3rdparty/SheetClip/SheetClip.js +2 -2
- package/3rdparty/SheetClip/SheetClip.mjs +2 -2
- package/3rdparty/autoResize/autoResize.js +2 -2
- package/3rdparty/autoResize/autoResize.mjs +2 -2
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +108 -85
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +108 -85
- package/3rdparty/walkontable/src/calculator/viewportRows.js +60 -52
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +60 -52
- package/3rdparty/walkontable/src/cell/coords.js +7 -5
- package/3rdparty/walkontable/src/cell/coords.mjs +7 -5
- package/3rdparty/walkontable/src/core/clone.js +6 -0
- package/3rdparty/walkontable/src/core/clone.mjs +6 -0
- package/3rdparty/walkontable/src/event.js +125 -74
- package/3rdparty/walkontable/src/event.mjs +125 -74
- package/3rdparty/walkontable/src/filter/column.js +16 -0
- package/3rdparty/walkontable/src/filter/column.mjs +16 -0
- package/3rdparty/walkontable/src/filter/row.js +16 -0
- package/3rdparty/walkontable/src/filter/row.mjs +16 -0
- package/3rdparty/walkontable/src/overlay/bottom.js +1 -1
- package/3rdparty/walkontable/src/overlay/bottom.mjs +1 -1
- package/3rdparty/walkontable/src/overlay/top.js +1 -1
- package/3rdparty/walkontable/src/overlay/top.mjs +1 -1
- package/3rdparty/walkontable/src/renderer/_base.js +12 -5
- package/3rdparty/walkontable/src/renderer/_base.mjs +12 -5
- package/3rdparty/walkontable/src/renderer/cells.js +6 -2
- package/3rdparty/walkontable/src/renderer/cells.mjs +6 -2
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +6 -2
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +6 -2
- package/3rdparty/walkontable/src/renderer/rows.js +5 -0
- package/3rdparty/walkontable/src/renderer/rows.mjs +5 -0
- package/3rdparty/walkontable/src/renderer/table.js +24 -17
- package/3rdparty/walkontable/src/renderer/table.mjs +24 -17
- package/3rdparty/walkontable/src/scroll.js +2 -2
- package/3rdparty/walkontable/src/scroll.mjs +2 -2
- package/3rdparty/walkontable/src/selection/border/border.js +1 -1
- package/3rdparty/walkontable/src/selection/border/border.mjs +1 -1
- package/3rdparty/walkontable/src/settings.js +10 -10
- package/3rdparty/walkontable/src/settings.mjs +10 -10
- package/3rdparty/walkontable/src/table.js +3 -3
- package/3rdparty/walkontable/src/table.mjs +3 -3
- package/3rdparty/walkontable/src/utils/column.js +19 -4
- package/3rdparty/walkontable/src/utils/column.mjs +19 -4
- package/3rdparty/walkontable/src/utils/nodesPool.js +5 -0
- package/3rdparty/walkontable/src/utils/nodesPool.mjs +5 -0
- package/3rdparty/walkontable/src/utils/orderView/view.js +13 -6
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +13 -6
- package/3rdparty/walkontable/src/utils/orderView/viewSize.js +9 -6
- package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +9 -6
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.js +7 -4
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.mjs +7 -4
- package/3rdparty/walkontable/src/utils/row.js +14 -2
- package/3rdparty/walkontable/src/utils/row.mjs +14 -2
- package/3rdparty/walkontable/src/viewport.js +9 -9
- package/3rdparty/walkontable/src/viewport.mjs +9 -9
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.js +25 -25
- package/core.mjs +25 -25
- package/dataMap/dataMap.js +99 -90
- package/dataMap/dataMap.mjs +99 -90
- package/dataMap/dataSource.js +14 -8
- package/dataMap/dataSource.mjs +14 -8
- package/dataMap/metaManager/lazyFactoryMap.js +19 -7
- package/dataMap/metaManager/lazyFactoryMap.mjs +19 -7
- package/dataMap/metaManager/metaLayers/cellMeta.js +8 -3
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +8 -3
- package/dataMap/metaManager/metaLayers/columnMeta.js +7 -1
- package/dataMap/metaManager/metaLayers/columnMeta.mjs +7 -1
- package/dataMap/metaManager/metaLayers/globalMeta.js +6 -1
- package/dataMap/metaManager/metaLayers/globalMeta.mjs +6 -1
- package/dataMap/metaManager/metaLayers/tableMeta.js +6 -2
- package/dataMap/metaManager/metaLayers/tableMeta.mjs +6 -2
- package/dataMap/metaManager/metaSchema.js +55 -55
- package/dataMap/metaManager/metaSchema.mjs +55 -55
- package/dataMap/metaManager/mods/dynamicCellMeta.js +7 -2
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +7 -2
- package/dataMap/metaManager/mods/extendMetaProperties.js +8 -4
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +8 -4
- package/dataMap/metaManager/utils.js +2 -2
- package/dataMap/metaManager/utils.mjs +2 -2
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +7337 -6389
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +154 -154
- package/dist/handsontable.js +7336 -6388
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +28 -28
- package/editorManager.js +105 -95
- package/editorManager.mjs +105 -95
- package/editors/autocompleteEditor/autocompleteEditor.js +47 -46
- package/editors/autocompleteEditor/autocompleteEditor.mjs +46 -45
- package/editors/baseEditor/baseEditor.js +23 -26
- package/editors/baseEditor/baseEditor.mjs +23 -26
- package/editors/dateEditor/dateEditor.js +24 -15
- package/editors/dateEditor/dateEditor.mjs +24 -15
- package/editors/dropdownEditor/dropdownEditor.js +1 -1
- package/editors/dropdownEditor/dropdownEditor.mjs +1 -1
- package/editors/handsontableEditor/handsontableEditor.js +4 -4
- package/editors/handsontableEditor/handsontableEditor.mjs +4 -4
- package/editors/textEditor/textEditor.js +23 -17
- package/editors/textEditor/textEditor.mjs +24 -18
- package/eventManager.js +8 -0
- package/eventManager.mjs +8 -0
- package/helpers/array.js +2 -2
- package/helpers/array.mjs +2 -2
- package/helpers/dom/element.js +7 -7
- package/helpers/dom/element.mjs +7 -7
- package/helpers/function.js +1 -1
- package/helpers/function.mjs +1 -1
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/object.js +4 -4
- package/helpers/object.mjs +4 -4
- package/helpers/string.js +1 -1
- package/helpers/string.mjs +1 -1
- package/package.json +1 -1
- package/pluginHooks.d.ts +0 -2
- package/pluginHooks.js +12 -3
- package/pluginHooks.mjs +12 -3
- package/plugins/autoColumnSize/autoColumnSize.js +141 -130
- package/plugins/autoColumnSize/autoColumnSize.mjs +140 -129
- package/plugins/autoRowSize/autoRowSize.js +112 -125
- package/plugins/autoRowSize/autoRowSize.mjs +110 -123
- package/plugins/autofill/autofill.d.ts +0 -1
- package/plugins/autofill/autofill.js +98 -102
- package/plugins/autofill/autofill.mjs +97 -101
- package/plugins/base/base.js +61 -28
- package/plugins/base/base.mjs +60 -28
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +29 -24
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +28 -23
- package/plugins/collapsibleColumns/collapsibleColumns.js +104 -107
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +102 -104
- package/plugins/columnSorting/columnSorting.js +107 -99
- package/plugins/columnSorting/columnSorting.mjs +106 -98
- package/plugins/columnSorting/columnStatesManager.js +12 -6
- package/plugins/columnSorting/columnStatesManager.mjs +12 -6
- package/plugins/columnSummary/columnSummary.js +71 -58
- package/plugins/columnSummary/columnSummary.mjs +70 -57
- package/plugins/columnSummary/endpoints.js +20 -14
- package/plugins/columnSummary/endpoints.mjs +20 -14
- package/plugins/comments/commentEditor.js +30 -2
- package/plugins/comments/commentEditor.mjs +30 -2
- package/plugins/comments/comments.js +158 -169
- package/plugins/comments/comments.mjs +157 -168
- package/plugins/comments/displaySwitch.js +7 -3
- package/plugins/comments/displaySwitch.mjs +7 -3
- package/plugins/contextMenu/commandExecutor.js +15 -2
- package/plugins/contextMenu/commandExecutor.mjs +15 -2
- package/plugins/contextMenu/contextMenu.js +96 -102
- package/plugins/contextMenu/contextMenu.mjs +95 -101
- package/plugins/contextMenu/itemsFactory.js +19 -4
- package/plugins/contextMenu/itemsFactory.mjs +19 -4
- package/plugins/contextMenu/menu/cursor.js +36 -0
- package/plugins/contextMenu/menu/cursor.mjs +36 -0
- package/plugins/contextMenu/menu/menu.js +57 -5
- package/plugins/contextMenu/menu/menu.mjs +57 -5
- package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +1 -1
- package/plugins/copyPaste/copyPaste.js +74 -75
- package/plugins/copyPaste/copyPaste.mjs +74 -75
- package/plugins/customBorders/customBorders.js +57 -50
- package/plugins/customBorders/customBorders.mjs +56 -49
- package/plugins/dragToScroll/dragToScroll.js +50 -54
- package/plugins/dragToScroll/dragToScroll.mjs +49 -52
- package/plugins/dropdownMenu/dropdownMenu.js +136 -131
- package/plugins/dropdownMenu/dropdownMenu.mjs +136 -131
- package/plugins/exportFile/dataProvider.js +7 -2
- package/plugins/exportFile/dataProvider.mjs +7 -2
- package/plugins/exportFile/exportFile.js +1 -1
- package/plugins/exportFile/exportFile.mjs +1 -1
- package/plugins/exportFile/types/_base.js +14 -6
- package/plugins/exportFile/types/_base.mjs +14 -6
- package/plugins/filters/component/actionBar.js +9 -0
- package/plugins/filters/component/actionBar.mjs +9 -0
- package/plugins/filters/component/condition.js +13 -0
- package/plugins/filters/component/condition.mjs +13 -0
- package/plugins/filters/component/operators.js +9 -0
- package/plugins/filters/component/operators.mjs +9 -0
- package/plugins/filters/component/value.js +9 -0
- package/plugins/filters/component/value.mjs +9 -0
- package/plugins/filters/conditionCollection.js +9 -4
- package/plugins/filters/conditionCollection.mjs +9 -4
- package/plugins/filters/conditionUpdateObserver.js +53 -42
- package/plugins/filters/conditionUpdateObserver.mjs +53 -42
- package/plugins/filters/dataFilter.js +9 -3
- package/plugins/filters/dataFilter.mjs +9 -3
- package/plugins/filters/filters.js +184 -189
- package/plugins/filters/filters.mjs +182 -187
- package/plugins/filters/ui/_base.js +1 -1
- package/plugins/filters/ui/_base.mjs +1 -1
- package/plugins/filters/utils.js +1 -1
- package/plugins/filters/utils.mjs +1 -1
- package/plugins/formulas/engine/settings.js +1 -1
- package/plugins/formulas/engine/settings.mjs +1 -1
- package/plugins/formulas/formulas.js +684 -602
- package/plugins/formulas/formulas.mjs +682 -600
- package/plugins/hiddenColumns/hiddenColumns.js +174 -169
- package/plugins/hiddenColumns/hiddenColumns.mjs +173 -168
- package/plugins/hiddenRows/hiddenRows.js +170 -165
- package/plugins/hiddenRows/hiddenRows.mjs +169 -164
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +66 -53
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +64 -51
- package/plugins/manualColumnMove/manualColumnMove.js +287 -232
- package/plugins/manualColumnMove/manualColumnMove.mjs +286 -231
- package/plugins/manualColumnMove/ui/_base.js +9 -3
- package/plugins/manualColumnMove/ui/_base.mjs +9 -3
- package/plugins/manualColumnResize/manualColumnResize.js +291 -246
- package/plugins/manualColumnResize/manualColumnResize.mjs +290 -244
- package/plugins/manualRowMove/manualRowMove.js +223 -208
- package/plugins/manualRowMove/manualRowMove.mjs +222 -207
- package/plugins/manualRowMove/ui/_base.js +10 -5
- package/plugins/manualRowMove/ui/_base.mjs +10 -5
- package/plugins/manualRowResize/manualRowResize.js +254 -209
- package/plugins/manualRowResize/manualRowResize.mjs +253 -207
- package/plugins/mergeCells/calculations/autofill.js +9 -3
- package/plugins/mergeCells/calculations/autofill.mjs +9 -3
- package/plugins/mergeCells/calculations/selection.js +10 -4
- package/plugins/mergeCells/calculations/selection.mjs +10 -4
- package/plugins/mergeCells/cellCoords.js +16 -6
- package/plugins/mergeCells/cellCoords.mjs +16 -6
- package/plugins/mergeCells/cellsCollection.js +10 -4
- package/plugins/mergeCells/cellsCollection.mjs +10 -4
- package/plugins/mergeCells/mergeCells.js +582 -502
- package/plugins/mergeCells/mergeCells.mjs +580 -500
- package/plugins/multiColumnSorting/multiColumnSorting.js +15 -11
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +15 -11
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +16 -28
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +16 -27
- package/plugins/nestedHeaders/nestedHeaders.js +542 -499
- package/plugins/nestedHeaders/nestedHeaders.mjs +554 -511
- package/plugins/nestedHeaders/stateManager/index.js +1 -1
- package/plugins/nestedHeaders/stateManager/index.mjs +1 -1
- package/plugins/nestedRows/data/dataManager.js +21 -15
- package/plugins/nestedRows/data/dataManager.mjs +21 -15
- package/plugins/nestedRows/nestedRows.js +335 -279
- package/plugins/nestedRows/nestedRows.mjs +334 -278
- package/plugins/nestedRows/ui/_base.js +7 -1
- package/plugins/nestedRows/ui/_base.mjs +7 -1
- package/plugins/nestedRows/ui/collapsing.js +2 -2
- package/plugins/nestedRows/ui/collapsing.mjs +2 -2
- package/plugins/nestedRows/ui/contextMenu.js +28 -18
- package/plugins/nestedRows/ui/contextMenu.mjs +28 -18
- package/plugins/nestedRows/utils/rowMoveController.js +12 -4
- package/plugins/nestedRows/utils/rowMoveController.mjs +12 -4
- package/plugins/persistentState/persistentState.js +14 -11
- package/plugins/persistentState/persistentState.mjs +14 -11
- package/plugins/persistentState/storage.js +11 -6
- package/plugins/persistentState/storage.mjs +11 -6
- package/plugins/registry.js +2 -2
- package/plugins/registry.mjs +2 -2
- package/plugins/search/search.js +57 -46
- package/plugins/search/search.mjs +56 -45
- package/plugins/touchScroll/touchScroll.js +102 -100
- package/plugins/touchScroll/touchScroll.mjs +100 -98
- package/plugins/trimRows/trimRows.js +33 -28
- package/plugins/trimRows/trimRows.mjs +32 -27
- package/plugins/undoRedo/undoRedo.js +2 -2
- package/plugins/undoRedo/undoRedo.mjs +2 -2
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +11 -11
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +11 -11
- package/renderers/baseRenderer/baseRenderer.js +2 -2
- package/renderers/baseRenderer/baseRenderer.mjs +2 -2
- package/renderers/checkboxRenderer/checkboxRenderer.js +23 -23
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +23 -23
- package/renderers/dateRenderer/dateRenderer.js +4 -4
- package/renderers/dateRenderer/dateRenderer.mjs +4 -4
- package/renderers/handsontableRenderer/handsontableRenderer.js +4 -4
- package/renderers/handsontableRenderer/handsontableRenderer.mjs +4 -4
- package/renderers/htmlRenderer/htmlRenderer.js +4 -4
- package/renderers/htmlRenderer/htmlRenderer.mjs +4 -4
- package/renderers/numericRenderer/numericRenderer.js +3 -3
- package/renderers/numericRenderer/numericRenderer.mjs +3 -3
- package/renderers/passwordRenderer/passwordRenderer.js +3 -3
- package/renderers/passwordRenderer/passwordRenderer.mjs +3 -3
- package/renderers/selectRenderer/selectRenderer.js +4 -4
- package/renderers/selectRenderer/selectRenderer.mjs +4 -4
- package/renderers/textRenderer/textRenderer.js +5 -5
- package/renderers/textRenderer/textRenderer.mjs +5 -5
- package/renderers/timeRenderer/timeRenderer.js +3 -3
- package/renderers/timeRenderer/timeRenderer.mjs +3 -3
- package/selection/range.js +12 -2
- package/selection/range.mjs +12 -2
- package/selection/selection.js +28 -10
- package/selection/selection.mjs +28 -10
- package/selection/utils.js +24 -14
- package/selection/utils.mjs +25 -15
- package/shortcuts/manager.js +1 -1
- package/shortcuts/manager.mjs +1 -1
- package/tableView.js +208 -200
- package/tableView.mjs +208 -200
- package/translations/changesObservable/utils.js +2 -2
- package/translations/changesObservable/utils.mjs +2 -2
- package/translations/indexMapper.js +25 -22
- package/translations/indexMapper.mjs +25 -22
- package/translations/mapCollections/aggregatedCollection.js +8 -2
- package/translations/mapCollections/aggregatedCollection.mjs +8 -2
- package/translations/mapCollections/mapCollection.js +5 -2
- package/translations/mapCollections/mapCollection.mjs +5 -2
- package/translations/maps/indexMap.js +6 -1
- package/translations/maps/indexMap.mjs +6 -1
- package/translations/maps/utils/physicallyIndexed.js +2 -2
- package/translations/maps/utils/physicallyIndexed.mjs +2 -2
- package/utils/dataStructures/linkedList.js +10 -6
- package/utils/dataStructures/linkedList.mjs +10 -6
- package/utils/dataStructures/queue.js +1 -1
- package/utils/dataStructures/queue.mjs +1 -1
- package/utils/dataStructures/stack.js +1 -1
- package/utils/dataStructures/stack.mjs +1 -1
- package/utils/ghostTable.js +2 -2
- package/utils/ghostTable.mjs +2 -2
- package/utils/interval.js +73 -36
- package/utils/interval.mjs +73 -36
- package/utils/parseTable.js +1 -1
- package/utils/parseTable.mjs +1 -1
- package/validators/autocompleteValidator/autocompleteValidator.js +1 -1
- package/validators/autocompleteValidator/autocompleteValidator.mjs +1 -1
- package/validators/dateValidator/dateValidator.js +1 -1
- package/validators/dateValidator/dateValidator.mjs +1 -1
- package/validators/numericValidator/numericValidator.js +1 -1
- package/validators/numericValidator/numericValidator.mjs +1 -1
@@ -1,4 +1,17 @@
|
|
1
1
|
import "core-js/modules/es.array.push.js";
|
2
|
+
import "core-js/modules/es.error.cause.js";
|
3
|
+
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
4
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
5
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
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
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
8
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
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; }
|
2
15
|
import { BasePlugin } from "../base/index.mjs";
|
3
16
|
import DataManager from "./data/dataManager.mjs";
|
4
17
|
import CollapsingUI from "./ui/collapsing.mjs";
|
@@ -11,10 +24,8 @@ import RowMoveController from "./utils/rowMoveController.mjs";
|
|
11
24
|
export const PLUGIN_KEY = 'nestedRows';
|
12
25
|
export const PLUGIN_PRIORITY = 300;
|
13
26
|
const SHORTCUTS_GROUP = PLUGIN_KEY;
|
14
|
-
const privatePool = new WeakMap();
|
15
27
|
|
16
28
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
17
|
-
|
18
29
|
/**
|
19
30
|
* Error message for the wrong data type error.
|
20
31
|
*/
|
@@ -27,44 +38,188 @@ const WRONG_DATA_TYPE_ERROR = 'The Nested Rows plugin requires an Array of Objec
|
|
27
38
|
* @description
|
28
39
|
* Plugin responsible for displaying and operating on data sources with nested structures.
|
29
40
|
*/
|
41
|
+
var _skipRender = /*#__PURE__*/new WeakMap();
|
42
|
+
var _skipCoreAPIModifiers = /*#__PURE__*/new WeakMap();
|
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();
|
30
59
|
export class NestedRows extends BasePlugin {
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
60
|
+
constructor() {
|
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);
|
162
|
+
/**
|
163
|
+
* `beforeRowMove` hook callback.
|
164
|
+
*
|
165
|
+
* @param {Array} rows Array of visual row indexes to be moved.
|
166
|
+
* @param {number} finalIndex Visual row index, being a start index for the moved rows. Points to where the elements
|
167
|
+
* will be placed after the moving action. To check the visualization of the final index, please take a look at
|
168
|
+
* [documentation](@/guides/rows/row-summary.md).
|
169
|
+
* @param {undefined|number} dropIndex Visual row index, being a drop index for the moved rows. Points to where we
|
170
|
+
* are going to drop the moved elements. To check visualization of drop index please take a look at
|
171
|
+
* [documentation](@/guides/rows/row-summary.md).
|
172
|
+
* @param {boolean} movePossible Indicates if it's possible to move rows to the desired position.
|
173
|
+
* @fires Hooks#afterRowMove
|
174
|
+
* @returns {boolean}
|
175
|
+
*/
|
176
|
+
_classPrivateMethodInitSpec(this, _onBeforeRowMove);
|
39
177
|
/**
|
40
178
|
* Reference to the DataManager instance.
|
41
179
|
*
|
42
180
|
* @private
|
43
181
|
* @type {object}
|
44
182
|
*/
|
45
|
-
this
|
46
|
-
|
183
|
+
_defineProperty(this, "dataManager", null);
|
47
184
|
/**
|
48
185
|
* Reference to the HeadersUI instance.
|
49
186
|
*
|
50
187
|
* @private
|
51
188
|
* @type {object}
|
52
189
|
*/
|
53
|
-
this
|
190
|
+
_defineProperty(this, "headersUI", null);
|
54
191
|
/**
|
55
192
|
* Map of skipped rows by plugin.
|
56
193
|
*
|
57
194
|
* @private
|
58
195
|
* @type {null|TrimmingMap}
|
59
196
|
*/
|
60
|
-
this
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
197
|
+
_defineProperty(this, "collapsedRowsMap", null);
|
198
|
+
/**
|
199
|
+
* Allows skipping the render cycle if set as `true`.
|
200
|
+
*
|
201
|
+
* @type {boolean}
|
202
|
+
*/
|
203
|
+
_classPrivateFieldInitSpec(this, _skipRender, {
|
204
|
+
writable: true,
|
205
|
+
value: false
|
206
|
+
});
|
207
|
+
/**
|
208
|
+
* Allows skipping the internal Core methods call if set as `true`.
|
209
|
+
*
|
210
|
+
* @type {boolean}
|
211
|
+
*/
|
212
|
+
_classPrivateFieldInitSpec(this, _skipCoreAPIModifiers, {
|
213
|
+
writable: true,
|
214
|
+
value: false
|
65
215
|
});
|
66
216
|
}
|
67
|
-
|
217
|
+
static get PLUGIN_KEY() {
|
218
|
+
return PLUGIN_KEY;
|
219
|
+
}
|
220
|
+
static get PLUGIN_PRIORITY() {
|
221
|
+
return PLUGIN_PRIORITY;
|
222
|
+
}
|
68
223
|
/**
|
69
224
|
* Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit}
|
70
225
|
* hook and if it returns `true` then the {@link NestedRows#enablePlugin} method is called.
|
@@ -90,10 +245,16 @@ export class NestedRows extends BasePlugin {
|
|
90
245
|
this.contextMenuUI = new ContextMenuUI(this, this.hot);
|
91
246
|
this.rowMoveController = new RowMoveController(this);
|
92
247
|
this.addHook('afterInit', function () {
|
93
|
-
|
248
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
249
|
+
args[_key] = arguments[_key];
|
250
|
+
}
|
251
|
+
return _classPrivateMethodGet(_this, _onAfterInit, _onAfterInit2).call(_this, ...args);
|
94
252
|
});
|
95
253
|
this.addHook('beforeViewRender', function () {
|
96
|
-
|
254
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
255
|
+
args[_key2] = arguments[_key2];
|
256
|
+
}
|
257
|
+
return _classPrivateMethodGet(_this, _onBeforeViewRender, _onBeforeViewRender2).call(_this, ...args);
|
97
258
|
});
|
98
259
|
this.addHook('modifyRowData', function () {
|
99
260
|
return _this.onModifyRowData(...arguments);
|
@@ -105,46 +266,85 @@ export class NestedRows extends BasePlugin {
|
|
105
266
|
return _this.onBeforeDataSplice(...arguments);
|
106
267
|
});
|
107
268
|
this.addHook('filterData', function () {
|
108
|
-
|
269
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
270
|
+
args[_key3] = arguments[_key3];
|
271
|
+
}
|
272
|
+
return _classPrivateMethodGet(_this, _onFilterData, _onFilterData2).call(_this, ...args);
|
109
273
|
});
|
110
274
|
this.addHook('afterContextMenuDefaultOptions', function () {
|
111
|
-
|
275
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
276
|
+
args[_key4] = arguments[_key4];
|
277
|
+
}
|
278
|
+
return _classPrivateMethodGet(_this, _onAfterContextMenuDefaultOptions, _onAfterContextMenuDefaultOptions2).call(_this, ...args);
|
112
279
|
});
|
113
280
|
this.addHook('afterGetRowHeader', function () {
|
114
|
-
|
281
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
282
|
+
args[_key5] = arguments[_key5];
|
283
|
+
}
|
284
|
+
return _classPrivateMethodGet(_this, _onAfterGetRowHeader, _onAfterGetRowHeader2).call(_this, ...args);
|
115
285
|
});
|
116
286
|
this.addHook('beforeOnCellMouseDown', function () {
|
117
|
-
|
287
|
+
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
288
|
+
args[_key6] = arguments[_key6];
|
289
|
+
}
|
290
|
+
return _classPrivateMethodGet(_this, _onBeforeOnCellMouseDown, _onBeforeOnCellMouseDown2).call(_this, ...args);
|
118
291
|
});
|
119
292
|
this.addHook('beforeRemoveRow', function () {
|
120
|
-
|
293
|
+
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
294
|
+
args[_key7] = arguments[_key7];
|
295
|
+
}
|
296
|
+
return _classPrivateMethodGet(_this, _onBeforeRemoveRow, _onBeforeRemoveRow2).call(_this, ...args);
|
121
297
|
});
|
122
298
|
this.addHook('afterRemoveRow', function () {
|
123
|
-
|
299
|
+
for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
|
300
|
+
args[_key8] = arguments[_key8];
|
301
|
+
}
|
302
|
+
return _classPrivateMethodGet(_this, _onAfterRemoveRow, _onAfterRemoveRow2).call(_this, ...args);
|
124
303
|
});
|
125
304
|
this.addHook('beforeAddChild', function () {
|
126
|
-
|
305
|
+
for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
|
306
|
+
args[_key9] = arguments[_key9];
|
307
|
+
}
|
308
|
+
return _classPrivateMethodGet(_this, _onBeforeAddChild, _onBeforeAddChild2).call(_this, ...args);
|
127
309
|
});
|
128
310
|
this.addHook('afterAddChild', function () {
|
129
|
-
|
311
|
+
for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
|
312
|
+
args[_key10] = arguments[_key10];
|
313
|
+
}
|
314
|
+
return _classPrivateMethodGet(_this, _onAfterAddChild, _onAfterAddChild2).call(_this, ...args);
|
130
315
|
});
|
131
316
|
this.addHook('beforeDetachChild', function () {
|
132
|
-
|
317
|
+
for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
|
318
|
+
args[_key11] = arguments[_key11];
|
319
|
+
}
|
320
|
+
return _classPrivateMethodGet(_this, _onBeforeDetachChild, _onBeforeDetachChild2).call(_this, ...args);
|
133
321
|
});
|
134
322
|
this.addHook('afterDetachChild', function () {
|
135
|
-
|
323
|
+
for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
|
324
|
+
args[_key12] = arguments[_key12];
|
325
|
+
}
|
326
|
+
return _classPrivateMethodGet(_this, _onAfterDetachChild, _onAfterDetachChild2).call(_this, ...args);
|
136
327
|
});
|
137
328
|
this.addHook('modifyRowHeaderWidth', function () {
|
138
|
-
|
329
|
+
for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
|
330
|
+
args[_key13] = arguments[_key13];
|
331
|
+
}
|
332
|
+
return _classPrivateMethodGet(_this, _onModifyRowHeaderWidth, _onModifyRowHeaderWidth2).call(_this, ...args);
|
139
333
|
});
|
140
334
|
this.addHook('afterCreateRow', function () {
|
141
|
-
|
335
|
+
for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) {
|
336
|
+
args[_key14] = arguments[_key14];
|
337
|
+
}
|
338
|
+
return _classPrivateMethodGet(_this, _onAfterCreateRow, _onAfterCreateRow2).call(_this, ...args);
|
142
339
|
});
|
143
340
|
this.addHook('beforeRowMove', function () {
|
144
|
-
|
341
|
+
for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {
|
342
|
+
args[_key15] = arguments[_key15];
|
343
|
+
}
|
344
|
+
return _classPrivateMethodGet(_this, _onBeforeRowMove, _onBeforeRowMove2).call(_this, ...args);
|
145
345
|
});
|
146
|
-
this.addHook('beforeLoadData', data => this.
|
147
|
-
this.addHook('beforeUpdateData', data => this.
|
346
|
+
this.addHook('beforeLoadData', data => _classPrivateMethodGet(this, _onBeforeLoadData, _onBeforeLoadData2).call(this, data));
|
347
|
+
this.addHook('beforeUpdateData', data => _classPrivateMethodGet(this, _onBeforeLoadData, _onBeforeLoadData2).call(this, data));
|
148
348
|
this.registerShortcuts();
|
149
349
|
super.enablePlugin();
|
150
350
|
}
|
@@ -200,7 +400,8 @@ export class NestedRows extends BasePlugin {
|
|
200
400
|
},
|
201
401
|
runOnlyIf: () => {
|
202
402
|
var _this$hot$getSelected;
|
203
|
-
|
403
|
+
const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
|
404
|
+
return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isHeader();
|
204
405
|
},
|
205
406
|
group: SHORTCUTS_GROUP
|
206
407
|
});
|
@@ -214,65 +415,32 @@ export class NestedRows extends BasePlugin {
|
|
214
415
|
unregisterShortcuts() {
|
215
416
|
this.hot.getShortcutManager().getContext('grid').removeShortcutsByGroup(SHORTCUTS_GROUP);
|
216
417
|
}
|
217
|
-
|
218
|
-
/**
|
219
|
-
* `beforeRowMove` hook callback.
|
220
|
-
*
|
221
|
-
* @private
|
222
|
-
* @param {Array} rows Array of visual row indexes to be moved.
|
223
|
-
* @param {number} finalIndex Visual row index, being a start index for the moved rows. Points to where the elements
|
224
|
-
* will be placed after the moving action. To check the visualization of the final index, please take a look at
|
225
|
-
* [documentation](@/guides/rows/row-summary.md).
|
226
|
-
* @param {undefined|number} dropIndex Visual row index, being a drop index for the moved rows. Points to where we
|
227
|
-
* are going to drop the moved elements. To check visualization of drop index please take a look at
|
228
|
-
* [documentation](@/guides/rows/row-summary.md).
|
229
|
-
* @param {boolean} movePossible Indicates if it's possible to move rows to the desired position.
|
230
|
-
* @fires Hooks#afterRowMove
|
231
|
-
* @returns {boolean}
|
232
|
-
*/
|
233
|
-
onBeforeRowMove(rows, finalIndex, dropIndex, movePossible) {
|
234
|
-
return this.rowMoveController.onBeforeRowMove(rows, finalIndex, dropIndex, movePossible);
|
235
|
-
}
|
236
|
-
|
237
418
|
/**
|
238
419
|
* Enable the modify hook skipping flag - allows retrieving the data from Handsontable without this plugin's
|
239
420
|
* modifications.
|
421
|
+
*
|
422
|
+
* @private
|
240
423
|
*/
|
241
424
|
disableCoreAPIModifiers() {
|
242
|
-
|
243
|
-
priv.skipCoreAPIModifiers = true;
|
425
|
+
_classPrivateFieldSet(this, _skipCoreAPIModifiers, true);
|
244
426
|
}
|
245
427
|
|
246
428
|
/**
|
247
429
|
* Disable the modify hook skipping flag.
|
248
|
-
*/
|
249
|
-
enableCoreAPIModifiers() {
|
250
|
-
const priv = privatePool.get(this);
|
251
|
-
priv.skipCoreAPIModifiers = false;
|
252
|
-
}
|
253
|
-
|
254
|
-
/**
|
255
|
-
* `beforeOnCellMousedown` hook callback.
|
256
430
|
*
|
257
431
|
* @private
|
258
|
-
* @param {MouseEvent} event Mousedown event.
|
259
|
-
* @param {object} coords Cell coords.
|
260
|
-
* @param {HTMLElement} TD Clicked cell.
|
261
432
|
*/
|
262
|
-
|
263
|
-
this
|
433
|
+
enableCoreAPIModifiers() {
|
434
|
+
_classPrivateFieldSet(this, _skipCoreAPIModifiers, false);
|
264
435
|
}
|
265
|
-
|
266
436
|
/**
|
267
437
|
* The modifyRowData hook callback.
|
268
438
|
*
|
269
|
-
* @private
|
270
439
|
* @param {number} row Visual row index.
|
271
440
|
* @returns {boolean}
|
272
441
|
*/
|
273
442
|
onModifyRowData(row) {
|
274
|
-
|
275
|
-
if (priv.skipCoreAPIModifiers) {
|
443
|
+
if (_classPrivateFieldGet(this, _skipCoreAPIModifiers)) {
|
276
444
|
return;
|
277
445
|
}
|
278
446
|
return this.dataManager.getDataObject(row);
|
@@ -281,236 +449,124 @@ export class NestedRows extends BasePlugin {
|
|
281
449
|
/**
|
282
450
|
* Modify the source data length to match the length of the nested structure.
|
283
451
|
*
|
284
|
-
* @private
|
285
452
|
* @returns {number}
|
286
453
|
*/
|
287
454
|
onModifySourceLength() {
|
288
|
-
|
289
|
-
if (priv.skipCoreAPIModifiers) {
|
455
|
+
if (_classPrivateFieldGet(this, _skipCoreAPIModifiers)) {
|
290
456
|
return;
|
291
457
|
}
|
292
458
|
return this.dataManager.countAllRows();
|
293
459
|
}
|
294
460
|
|
295
461
|
/**
|
296
|
-
* @private
|
297
462
|
* @param {number} index The index where the data was spliced.
|
298
463
|
* @param {number} amount An amount of items to remove.
|
299
464
|
* @param {object} element An element to add.
|
300
465
|
* @returns {boolean}
|
301
466
|
*/
|
302
467
|
onBeforeDataSplice(index, amount, element) {
|
303
|
-
|
304
|
-
if (priv.skipCoreAPIModifiers || this.dataManager.isRowHighestLevel(index)) {
|
468
|
+
if (_classPrivateFieldGet(this, _skipCoreAPIModifiers) || this.dataManager.isRowHighestLevel(index)) {
|
305
469
|
return true;
|
306
470
|
}
|
307
471
|
this.dataManager.spliceData(index, amount, element);
|
308
472
|
return false;
|
309
473
|
}
|
310
|
-
|
311
|
-
/**
|
312
|
-
* Provide custom source data filtering. It's handled by core method and replaces the native filtering.
|
313
|
-
*
|
314
|
-
* @private
|
315
|
-
* @param {number} index The index where the data filtering starts.
|
316
|
-
* @param {number} amount An amount of rows which filtering applies to.
|
317
|
-
* @param {number} physicalRows Physical row indexes.
|
318
|
-
* @returns {Array}
|
319
|
-
*/
|
320
|
-
onFilterData(index, amount, physicalRows) {
|
321
|
-
const priv = privatePool.get(this);
|
322
|
-
this.collapsingUI.collapsedRowsStash.stash();
|
323
|
-
this.collapsingUI.collapsedRowsStash.trimStash(physicalRows[0], amount);
|
324
|
-
this.collapsingUI.collapsedRowsStash.shiftStash(physicalRows[0], null, -1 * amount);
|
325
|
-
this.dataManager.filterData(index, amount, physicalRows);
|
326
|
-
priv.skipRender = true;
|
327
|
-
return this.dataManager.getData().slice(); // Data contains reference sometimes.
|
328
|
-
}
|
329
|
-
|
330
|
-
/**
|
331
|
-
* `afterContextMenuDefaultOptions` hook callback.
|
332
|
-
*
|
333
|
-
* @private
|
334
|
-
* @param {object} defaultOptions The default context menu items order.
|
335
|
-
* @returns {boolean}
|
336
|
-
*/
|
337
|
-
onAfterContextMenuDefaultOptions(defaultOptions) {
|
338
|
-
return this.contextMenuUI.appendOptions(defaultOptions);
|
339
|
-
}
|
340
|
-
|
341
|
-
/**
|
342
|
-
* `afterGetRowHeader` hook callback.
|
343
|
-
*
|
344
|
-
* @private
|
345
|
-
* @param {number} row Row index.
|
346
|
-
* @param {HTMLElement} TH Row header element.
|
347
|
-
*/
|
348
|
-
onAfterGetRowHeader(row, TH) {
|
349
|
-
this.headersUI.appendLevelIndicators(row, TH);
|
350
|
-
}
|
351
|
-
|
352
|
-
/**
|
353
|
-
* `modifyRowHeaderWidth` hook callback.
|
354
|
-
*
|
355
|
-
* @private
|
356
|
-
* @param {number} rowHeaderWidth The initial row header width(s).
|
357
|
-
* @returns {number}
|
358
|
-
*/
|
359
|
-
onModifyRowHeaderWidth(rowHeaderWidth) {
|
360
|
-
return this.headersUI.rowHeaderWidthCache || rowHeaderWidth;
|
361
|
-
}
|
362
|
-
|
363
474
|
/**
|
364
|
-
*
|
365
|
-
*
|
366
|
-
* @private
|
367
|
-
* @param {number} index Removed row.
|
368
|
-
* @param {number} amount Amount of removed rows.
|
369
|
-
* @param {Array} logicRows An array of the removed physical rows.
|
370
|
-
* @param {string} source Source of action.
|
371
|
-
*/
|
372
|
-
onAfterRemoveRow(index, amount, logicRows, source) {
|
373
|
-
if (source === this.pluginName) {
|
374
|
-
return;
|
375
|
-
}
|
376
|
-
const priv = privatePool.get(this);
|
377
|
-
setTimeout(() => {
|
378
|
-
priv.skipRender = null;
|
379
|
-
this.headersUI.updateRowHeaderWidth();
|
380
|
-
this.collapsingUI.collapsedRowsStash.applyStash();
|
381
|
-
}, 0);
|
382
|
-
}
|
383
|
-
|
384
|
-
/**
|
385
|
-
* Callback for the `beforeRemoveRow` change list of removed physical indexes by reference. Removing parent node
|
386
|
-
* has effect in removing children nodes.
|
387
|
-
*
|
388
|
-
* @private
|
389
|
-
* @param {number} index Visual index of starter row.
|
390
|
-
* @param {number} amount Amount of rows to be removed.
|
391
|
-
* @param {Array} physicalRows List of physical indexes.
|
475
|
+
* Destroys the plugin instance.
|
392
476
|
*/
|
393
|
-
|
394
|
-
|
395
|
-
if (this.dataManager.isParent(physicalIndex)) {
|
396
|
-
const children = this.dataManager.getDataObject(physicalIndex).__children;
|
397
|
-
|
398
|
-
// Preserve a parent in the list of removed rows.
|
399
|
-
removedRows.add(physicalIndex);
|
400
|
-
if (Array.isArray(children)) {
|
401
|
-
// Add a children to the list of removed rows.
|
402
|
-
children.forEach(child => removedRows.add(this.dataManager.getRowIndex(child)));
|
403
|
-
}
|
404
|
-
return removedRows;
|
405
|
-
}
|
406
|
-
|
407
|
-
// Don't modify list of removed rows when already checked element isn't a parent.
|
408
|
-
return removedRows.add(physicalIndex);
|
409
|
-
}, new Set()));
|
410
|
-
|
411
|
-
// Modifying hook's argument by the reference.
|
412
|
-
physicalRows.length = 0;
|
413
|
-
physicalRows.push(...modifiedPhysicalRows);
|
477
|
+
destroy() {
|
478
|
+
super.destroy();
|
414
479
|
}
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
480
|
+
}
|
481
|
+
function _onBeforeRowMove2(rows, finalIndex, dropIndex, movePossible) {
|
482
|
+
return this.rowMoveController.onBeforeRowMove(rows, finalIndex, dropIndex, movePossible);
|
483
|
+
}
|
484
|
+
function _onBeforeOnCellMouseDown2(event, coords, TD) {
|
485
|
+
this.collapsingUI.toggleState(event, coords, TD);
|
486
|
+
}
|
487
|
+
function _onFilterData2(index, amount, physicalRows) {
|
488
|
+
this.collapsingUI.collapsedRowsStash.stash();
|
489
|
+
this.collapsingUI.collapsedRowsStash.trimStash(physicalRows[0], amount);
|
490
|
+
this.collapsingUI.collapsedRowsStash.shiftStash(physicalRows[0], null, -1 * amount);
|
491
|
+
this.dataManager.filterData(index, amount, physicalRows);
|
492
|
+
_classPrivateFieldSet(this, _skipRender, true);
|
493
|
+
return this.dataManager.getData().slice(); // Data contains reference sometimes.
|
494
|
+
}
|
495
|
+
function _onAfterContextMenuDefaultOptions2(defaultOptions) {
|
496
|
+
return this.contextMenuUI.appendOptions(defaultOptions);
|
497
|
+
}
|
498
|
+
function _onAfterGetRowHeader2(row, TH) {
|
499
|
+
this.headersUI.appendLevelIndicators(row, TH);
|
500
|
+
}
|
501
|
+
function _onModifyRowHeaderWidth2(rowHeaderWidth) {
|
502
|
+
return Math.max(this.headersUI.rowHeaderWidthCache, rowHeaderWidth);
|
503
|
+
}
|
504
|
+
function _onAfterRemoveRow2(index, amount, logicRows, source) {
|
505
|
+
if (source === this.pluginName) {
|
506
|
+
return;
|
423
507
|
}
|
424
|
-
|
425
|
-
|
426
|
-
* `afterAddChild` hook callback.
|
427
|
-
*
|
428
|
-
* @private
|
429
|
-
* @param {object} parent Parent element.
|
430
|
-
* @param {object} element New child element.
|
431
|
-
*/
|
432
|
-
onAfterAddChild(parent, element) {
|
433
|
-
this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(element));
|
434
|
-
this.collapsingUI.collapsedRowsStash.applyStash();
|
508
|
+
this.hot._registerTimeout(() => {
|
509
|
+
_classPrivateFieldSet(this, _skipRender, false);
|
435
510
|
this.headersUI.updateRowHeaderWidth();
|
436
|
-
}
|
437
|
-
|
438
|
-
/**
|
439
|
-
* `beforeDetachChild` hook callback.
|
440
|
-
*
|
441
|
-
* @private
|
442
|
-
*/
|
443
|
-
onBeforeDetachChild() {
|
444
|
-
this.collapsingUI.collapsedRowsStash.stash();
|
445
|
-
}
|
446
|
-
|
447
|
-
/**
|
448
|
-
* `afterDetachChild` hook callback.
|
449
|
-
*
|
450
|
-
* @private
|
451
|
-
* @param {object} parent Parent element.
|
452
|
-
* @param {object} element New child element.
|
453
|
-
* @param {number} finalElementRowIndex The final row index of the detached element.
|
454
|
-
*/
|
455
|
-
onAfterDetachChild(parent, element, finalElementRowIndex) {
|
456
|
-
this.collapsingUI.collapsedRowsStash.shiftStash(finalElementRowIndex, null, -1);
|
457
511
|
this.collapsingUI.collapsedRowsStash.applyStash();
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
*
|
473
|
-
* @private
|
474
|
-
*/
|
475
|
-
onAfterInit() {
|
476
|
-
this.headersUI.updateRowHeaderWidth();
|
477
|
-
}
|
478
|
-
|
479
|
-
/**
|
480
|
-
* `beforeViewRender` hook callback.
|
481
|
-
*
|
482
|
-
* @param {boolean} force Indicates if the render call was triggered by a change of settings or data.
|
483
|
-
* @param {object} skipRender An object, holder for skipRender functionality.
|
484
|
-
* @private
|
485
|
-
*/
|
486
|
-
onBeforeViewRender(force, skipRender) {
|
487
|
-
const priv = privatePool.get(this);
|
488
|
-
if (priv.skipRender) {
|
489
|
-
skipRender.skipRender = true;
|
512
|
+
});
|
513
|
+
}
|
514
|
+
function _onBeforeRemoveRow2(index, amount, physicalRows) {
|
515
|
+
const modifiedPhysicalRows = Array.from(physicalRows.reduce((removedRows, physicalIndex) => {
|
516
|
+
if (this.dataManager.isParent(physicalIndex)) {
|
517
|
+
const children = this.dataManager.getDataObject(physicalIndex).__children;
|
518
|
+
|
519
|
+
// Preserve a parent in the list of removed rows.
|
520
|
+
removedRows.add(physicalIndex);
|
521
|
+
if (Array.isArray(children)) {
|
522
|
+
// Add a children to the list of removed rows.
|
523
|
+
children.forEach(child => removedRows.add(this.dataManager.getRowIndex(child)));
|
524
|
+
}
|
525
|
+
return removedRows;
|
490
526
|
}
|
491
|
-
}
|
492
527
|
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
528
|
+
// Don't modify list of removed rows when already checked element isn't a parent.
|
529
|
+
return removedRows.add(physicalIndex);
|
530
|
+
}, new Set()));
|
531
|
+
|
532
|
+
// Modifying hook's argument by the reference.
|
533
|
+
physicalRows.length = 0;
|
534
|
+
physicalRows.push(...modifiedPhysicalRows);
|
535
|
+
}
|
536
|
+
function _onBeforeAddChild2() {
|
537
|
+
this.collapsingUI.collapsedRowsStash.stash();
|
538
|
+
}
|
539
|
+
function _onAfterAddChild2(parent, element) {
|
540
|
+
this.collapsingUI.collapsedRowsStash.shiftStash(this.dataManager.getRowIndex(element));
|
541
|
+
this.collapsingUI.collapsedRowsStash.applyStash();
|
542
|
+
this.headersUI.updateRowHeaderWidth();
|
543
|
+
}
|
544
|
+
function _onBeforeDetachChild2() {
|
545
|
+
this.collapsingUI.collapsedRowsStash.stash();
|
546
|
+
}
|
547
|
+
function _onAfterDetachChild2(parent, element, finalElementRowIndex) {
|
548
|
+
this.collapsingUI.collapsedRowsStash.shiftStash(finalElementRowIndex, null, -1);
|
549
|
+
this.collapsingUI.collapsedRowsStash.applyStash();
|
550
|
+
this.headersUI.updateRowHeaderWidth();
|
551
|
+
}
|
552
|
+
function _onAfterCreateRow2() {
|
553
|
+
this.dataManager.rewriteCache();
|
554
|
+
}
|
555
|
+
function _onAfterInit2() {
|
556
|
+
this.headersUI.updateRowHeaderWidth();
|
557
|
+
}
|
558
|
+
function _onBeforeViewRender2(force, skipRender) {
|
559
|
+
if (_classPrivateFieldGet(this, _skipRender)) {
|
560
|
+
skipRender.skipRender = true;
|
498
561
|
}
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
onBeforeLoadData(data) {
|
507
|
-
if (!isArrayOfObjects(data)) {
|
508
|
-
error(WRONG_DATA_TYPE_ERROR);
|
509
|
-
this.hot.getSettings()[PLUGIN_KEY] = false;
|
510
|
-
this.disablePlugin();
|
511
|
-
return;
|
512
|
-
}
|
513
|
-
this.dataManager.setData(data);
|
514
|
-
this.dataManager.rewriteCache();
|
562
|
+
}
|
563
|
+
function _onBeforeLoadData2(data) {
|
564
|
+
if (!isArrayOfObjects(data)) {
|
565
|
+
error(WRONG_DATA_TYPE_ERROR);
|
566
|
+
this.hot.getSettings()[PLUGIN_KEY] = false;
|
567
|
+
this.disablePlugin();
|
568
|
+
return;
|
515
569
|
}
|
570
|
+
this.dataManager.setData(data);
|
571
|
+
this.dataManager.rewriteCache();
|
516
572
|
}
|