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