handsontable 0.0.0-next-bfb0e3a-20240403 → 0.0.0-next-5a535ed-20240403
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +17 -12
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +17 -12
- package/3rdparty/walkontable/src/calculator/viewportRows.js +15 -10
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +15 -10
- package/3rdparty/walkontable/src/cell/coords.js +17 -12
- package/3rdparty/walkontable/src/cell/coords.mjs +17 -12
- package/3rdparty/walkontable/src/cell/range.d.ts +1 -2
- package/3rdparty/walkontable/src/cell/range.js +28 -40
- package/3rdparty/walkontable/src/cell/range.mjs +28 -40
- package/3rdparty/walkontable/src/core/_base.js +1 -1
- package/3rdparty/walkontable/src/core/_base.mjs +1 -1
- package/3rdparty/walkontable/src/event.js +104 -72
- package/3rdparty/walkontable/src/event.mjs +104 -72
- package/3rdparty/walkontable/src/overlays.js +1 -1
- package/3rdparty/walkontable/src/overlays.mjs +1 -1
- package/3rdparty/walkontable/src/scroll.js +17 -15
- package/3rdparty/walkontable/src/scroll.mjs +17 -15
- package/3rdparty/walkontable/src/selection/manager.js +69 -48
- package/3rdparty/walkontable/src/selection/manager.mjs +69 -48
- package/3rdparty/walkontable/src/selection/scanner.js +42 -33
- package/3rdparty/walkontable/src/selection/scanner.mjs +42 -33
- package/3rdparty/walkontable/src/utils/columnStretching.js +44 -27
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +44 -27
- package/3rdparty/walkontable/src/utils/orderView/view.js +1 -1
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +1 -1
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/viewportScroll/index.js +1 -4
- package/core/viewportScroll/index.mjs +1 -4
- package/core.d.ts +3 -4
- package/core.js +22 -77
- package/core.mjs +22 -77
- package/dataMap/dataSource.js +1 -1
- package/dataMap/dataSource.mjs +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +1 -1
- package/dataMap/metaManager/metaSchema.js +1 -1
- package/dataMap/metaManager/metaSchema.mjs +1 -1
- package/dataMap/replaceData.js +1 -1
- package/dataMap/replaceData.mjs +1 -1
- package/dist/handsontable.css +4 -4
- package/dist/handsontable.full.css +4 -4
- package/dist/handsontable.full.js +9117 -8969
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +292 -292
- package/dist/handsontable.js +6569 -6874
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +25 -25
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +23 -25
- package/editorManager.mjs +23 -25
- package/editors/autocompleteEditor/autocompleteEditor.js +10 -6
- package/editors/autocompleteEditor/autocompleteEditor.mjs +10 -6
- package/editors/selectEditor/selectEditor.js +19 -20
- package/editors/selectEditor/selectEditor.mjs +19 -20
- package/eventManager.js +1 -1
- package/eventManager.mjs +1 -1
- package/focusManager.js +82 -64
- package/focusManager.mjs +82 -64
- package/helpers/dom/element.js +1 -1
- package/helpers/dom/element.mjs +1 -1
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/object.js +2 -2
- package/helpers/object.mjs +2 -2
- package/index.d.ts +0 -10
- package/package.json +2 -7
- package/pluginHooks.d.ts +3 -4
- package/pluginHooks.js +38 -99
- package/pluginHooks.mjs +38 -99
- package/plugins/autoColumnSize/autoColumnSize.js +65 -49
- package/plugins/autoColumnSize/autoColumnSize.mjs +65 -49
- package/plugins/autoRowSize/autoRowSize.js +34 -28
- package/plugins/autoRowSize/autoRowSize.mjs +34 -28
- package/plugins/autofill/autofill.js +38 -30
- package/plugins/autofill/autofill.mjs +38 -30
- package/plugins/base/base.js +17 -12
- package/plugins/base/base.mjs +17 -12
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
- package/plugins/collapsibleColumns/collapsibleColumns.js +50 -59
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +50 -59
- package/plugins/columnSorting/columnSorting.js +45 -49
- package/plugins/columnSorting/columnSorting.mjs +45 -49
- package/plugins/columnSummary/columnSummary.js +26 -22
- package/plugins/columnSummary/columnSummary.mjs +26 -22
- package/plugins/comments/comments.js +158 -116
- package/plugins/comments/comments.mjs +158 -116
- package/plugins/contextMenu/contextMenu.js +26 -20
- package/plugins/contextMenu/contextMenu.mjs +26 -20
- package/plugins/contextMenu/itemsFactory.js +1 -1
- package/plugins/contextMenu/itemsFactory.mjs +1 -1
- package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
- package/plugins/contextMenu/menu/menu.js +21 -13
- package/plugins/contextMenu/menu/menu.mjs +21 -13
- package/plugins/contextMenu/menu/positioner.js +58 -41
- package/plugins/contextMenu/menu/positioner.mjs +58 -41
- package/plugins/copyPaste/copyPaste.js +157 -116
- package/plugins/copyPaste/copyPaste.mjs +157 -116
- package/plugins/copyPaste/copyableRanges.js +66 -43
- package/plugins/copyPaste/copyableRanges.mjs +66 -43
- package/plugins/customBorders/customBorders.js +13 -11
- package/plugins/customBorders/customBorders.mjs +13 -11
- package/plugins/dragToScroll/dragToScroll.js +6 -6
- package/plugins/dragToScroll/dragToScroll.mjs +6 -6
- package/plugins/dropdownMenu/dropdownMenu.js +106 -80
- package/plugins/dropdownMenu/dropdownMenu.mjs +106 -80
- package/plugins/exportFile/dataProvider.js +1 -1
- package/plugins/exportFile/dataProvider.mjs +1 -1
- package/plugins/filters/component/actionBar.js +9 -9
- package/plugins/filters/component/actionBar.mjs +8 -8
- package/plugins/filters/component/condition.js +15 -13
- package/plugins/filters/component/condition.mjs +15 -13
- package/plugins/filters/component/operators.js +6 -6
- package/plugins/filters/component/operators.mjs +6 -6
- package/plugins/filters/component/value.js +28 -24
- package/plugins/filters/component/value.mjs +28 -24
- package/plugins/filters/conditionUpdateObserver.js +24 -22
- package/plugins/filters/conditionUpdateObserver.mjs +24 -22
- package/plugins/filters/dataFilter.js +1 -1
- package/plugins/filters/dataFilter.mjs +1 -1
- package/plugins/filters/filters.js +95 -81
- package/plugins/filters/filters.mjs +95 -81
- package/plugins/filters/ui/input.js +19 -13
- package/plugins/filters/ui/input.mjs +19 -13
- package/plugins/filters/ui/link.js +13 -8
- package/plugins/filters/ui/link.mjs +13 -8
- package/plugins/filters/ui/multipleSelect.js +112 -85
- package/plugins/filters/ui/multipleSelect.mjs +112 -85
- package/plugins/filters/ui/radioInput.js +20 -12
- package/plugins/filters/ui/radioInput.mjs +20 -12
- package/plugins/filters/ui/select.js +72 -50
- package/plugins/filters/ui/select.mjs +71 -49
- package/plugins/formulas/formulas.js +326 -268
- package/plugins/formulas/formulas.mjs +327 -269
- package/plugins/formulas/indexSyncer/axisSyncer.js +61 -38
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +61 -38
- package/plugins/formulas/indexSyncer/index.js +48 -25
- package/plugins/formulas/indexSyncer/index.mjs +48 -25
- package/plugins/hiddenColumns/hiddenColumns.js +83 -64
- package/plugins/hiddenColumns/hiddenColumns.mjs +83 -64
- package/plugins/hiddenRows/hiddenRows.js +82 -63
- package/plugins/hiddenRows/hiddenRows.mjs +82 -63
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +32 -24
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +33 -25
- package/plugins/manualColumnMove/manualColumnMove.js +170 -126
- package/plugins/manualColumnMove/manualColumnMove.mjs +170 -126
- package/plugins/manualColumnResize/manualColumnResize.js +230 -169
- package/plugins/manualColumnResize/manualColumnResize.mjs +230 -169
- package/plugins/manualRowMove/manualRowMove.js +128 -99
- package/plugins/manualRowMove/manualRowMove.mjs +128 -99
- package/plugins/manualRowResize/manualRowResize.js +209 -150
- package/plugins/manualRowResize/manualRowResize.mjs +209 -150
- package/plugins/mergeCells/calculations/selection.js +71 -2
- package/plugins/mergeCells/calculations/selection.mjs +71 -2
- package/plugins/mergeCells/cellsCollection.js +1 -117
- package/plugins/mergeCells/cellsCollection.mjs +1 -117
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
- package/plugins/mergeCells/mergeCells.js +397 -499
- package/plugins/mergeCells/mergeCells.mjs +397 -499
- package/plugins/multiColumnSorting/multiColumnSorting.js +2 -8
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -8
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
- package/plugins/nestedHeaders/nestedHeaders.js +253 -205
- package/plugins/nestedHeaders/nestedHeaders.mjs +254 -206
- package/plugins/nestedHeaders/stateManager/headersTree.js +32 -21
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +32 -21
- package/plugins/nestedHeaders/stateManager/index.js +41 -30
- package/plugins/nestedHeaders/stateManager/index.mjs +41 -30
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +30 -19
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +30 -19
- package/plugins/nestedRows/data/dataManager.js +1 -1
- package/plugins/nestedRows/data/dataManager.mjs +1 -1
- package/plugins/nestedRows/nestedRows.js +182 -151
- package/plugins/nestedRows/nestedRows.mjs +183 -152
- package/plugins/nestedRows/ui/contextMenu.js +15 -11
- package/plugins/nestedRows/ui/contextMenu.mjs +14 -10
- package/plugins/nestedRows/utils/rowMoveController.js +1 -1
- package/plugins/nestedRows/utils/rowMoveController.mjs +1 -1
- package/plugins/persistentState/storage.js +2 -2
- package/plugins/persistentState/storage.mjs +2 -2
- package/plugins/search/search.js +7 -7
- package/plugins/search/search.mjs +7 -7
- package/plugins/touchScroll/touchScroll.js +19 -15
- package/plugins/touchScroll/touchScroll.mjs +20 -16
- package/plugins/trimRows/trimRows.js +6 -6
- package/plugins/trimRows/trimRows.mjs +6 -6
- package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
- package/selection/highlight/highlight.js +14 -14
- package/selection/highlight/highlight.mjs +13 -13
- package/selection/highlight/visualSelection.js +0 -2
- package/selection/highlight/visualSelection.mjs +0 -2
- package/selection/selection.js +67 -225
- package/selection/selection.mjs +66 -224
- package/selection/transformation.js +118 -149
- package/selection/transformation.mjs +118 -149
- package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
- package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
- package/shortcutContexts/commands/editor/open.js +3 -18
- package/shortcutContexts/commands/editor/open.mjs +3 -18
- package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
- package/shortcutContexts/grid.js +3 -9
- package/shortcutContexts/grid.mjs +3 -9
- package/shortcuts/context.js +1 -2
- package/shortcuts/context.mjs +1 -2
- package/tableView.js +78 -52
- package/tableView.mjs +78 -52
- package/translations/changesObservable/observable.js +38 -21
- package/translations/changesObservable/observable.mjs +38 -21
- package/translations/changesObservable/observer.js +12 -7
- package/translations/changesObservable/observer.mjs +11 -6
- package/translations/mapCollections/aggregatedCollection.js +1 -1
- package/translations/mapCollections/aggregatedCollection.mjs +1 -1
- package/translations/maps/indexMap.js +1 -1
- package/translations/maps/indexMap.mjs +1 -1
- package/utils/dataStructures/linkedList.js +1 -6
- package/utils/dataStructures/linkedList.mjs +1 -6
- package/utils/dataStructures/tree.js +1 -1
- package/utils/dataStructures/tree.mjs +1 -1
- package/utils/interval.js +44 -26
- package/utils/interval.mjs +44 -26
- package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
- package/i18n/languages/ar-AR.d.ts +0 -5
- package/i18n/languages/cs-CZ.d.ts +0 -5
- package/i18n/languages/hr-HR.d.ts +0 -5
- package/i18n/languages/sr-SP.d.ts +0 -5
- package/plugins/mergeCells/focusOrder.js +0 -305
- package/plugins/mergeCells/focusOrder.mjs +0 -300
@@ -1,11 +1,11 @@
|
|
1
|
-
import "core-js/modules/es.error.cause.js";
|
2
1
|
import "core-js/modules/es.array.push.js";
|
2
|
+
import "core-js/modules/es.error.cause.js";
|
3
3
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
4
4
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
5
5
|
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; }
|
6
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
7
7
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
8
|
-
function
|
8
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
9
9
|
import { BasePlugin } from "../base/index.mjs";
|
10
10
|
import Hooks from "../../pluginHooks.mjs";
|
11
11
|
import { offset, outerHeight, outerWidth } from "../../helpers/dom/element.mjs";
|
@@ -35,16 +35,40 @@ const INTERVAL_FOR_ADDING_ROW = 200;
|
|
35
35
|
* @class Autofill
|
36
36
|
* @plugin Autofill
|
37
37
|
*/
|
38
|
-
var
|
38
|
+
var _onCellCornerDblClick = /*#__PURE__*/new WeakSet();
|
39
|
+
var _onAfterCellCornerMouseDown = /*#__PURE__*/new WeakSet();
|
40
|
+
var _onBeforeCellMouseOver = /*#__PURE__*/new WeakSet();
|
41
|
+
var _onMouseUp = /*#__PURE__*/new WeakSet();
|
42
|
+
var _onMouseMove = /*#__PURE__*/new WeakSet();
|
39
43
|
export class Autofill extends BasePlugin {
|
40
44
|
constructor() {
|
41
45
|
super(...arguments);
|
46
|
+
/**
|
47
|
+
* On mouse move listener.
|
48
|
+
*
|
49
|
+
* @param {MouseEvent} event `mousemove` event properties.
|
50
|
+
*/
|
51
|
+
_classPrivateMethodInitSpec(this, _onMouseMove);
|
52
|
+
/**
|
53
|
+
* On mouse up listener.
|
54
|
+
*/
|
55
|
+
_classPrivateMethodInitSpec(this, _onMouseUp);
|
56
|
+
/**
|
57
|
+
* On before cell mouse over listener.
|
58
|
+
*
|
59
|
+
* @param {CellCoords} coords `CellCoords` coord object.
|
60
|
+
*/
|
61
|
+
_classPrivateMethodInitSpec(this, _onBeforeCellMouseOver);
|
62
|
+
/**
|
63
|
+
* On after cell corner mouse down listener.
|
64
|
+
*/
|
65
|
+
_classPrivateMethodInitSpec(this, _onAfterCellCornerMouseDown);
|
42
66
|
/**
|
43
67
|
* On cell corner double click callback.
|
44
68
|
*
|
45
69
|
* @private
|
46
70
|
*/
|
47
|
-
_classPrivateMethodInitSpec(this,
|
71
|
+
_classPrivateMethodInitSpec(this, _onCellCornerDblClick);
|
48
72
|
/**
|
49
73
|
* Specifies if adding new row started.
|
50
74
|
*
|
@@ -115,9 +139,9 @@ export class Autofill extends BasePlugin {
|
|
115
139
|
}
|
116
140
|
this.mapSettings();
|
117
141
|
this.registerEvents();
|
118
|
-
this.addHook('afterOnCellCornerMouseDown', event =>
|
119
|
-
this.addHook('afterOnCellCornerDblClick', event =>
|
120
|
-
this.addHook('beforeOnCellMouseOver', (_, coords) =>
|
142
|
+
this.addHook('afterOnCellCornerMouseDown', event => _classPrivateMethodGet(this, _onAfterCellCornerMouseDown, _onAfterCellCornerMouseDown2).call(this, event));
|
143
|
+
this.addHook('afterOnCellCornerDblClick', event => _classPrivateMethodGet(this, _onCellCornerDblClick, _onCellCornerDblClick2).call(this, event));
|
144
|
+
this.addHook('beforeOnCellMouseOver', (_, coords) => _classPrivateMethodGet(this, _onBeforeCellMouseOver, _onBeforeCellMouseOver2).call(this, coords));
|
121
145
|
super.enablePlugin();
|
122
146
|
}
|
123
147
|
|
@@ -461,8 +485,8 @@ export class Autofill extends BasePlugin {
|
|
461
485
|
const {
|
462
486
|
documentElement
|
463
487
|
} = this.hot.rootDocument;
|
464
|
-
this.eventManager.addEventListener(documentElement, 'mouseup', () =>
|
465
|
-
this.eventManager.addEventListener(documentElement, 'mousemove', event =>
|
488
|
+
this.eventManager.addEventListener(documentElement, 'mouseup', () => _classPrivateMethodGet(this, _onMouseUp, _onMouseUp2).call(this));
|
489
|
+
this.eventManager.addEventListener(documentElement, 'mousemove', event => _classPrivateMethodGet(this, _onMouseMove, _onMouseMove2).call(this, event));
|
466
490
|
}
|
467
491
|
/**
|
468
492
|
* Clears mapped settings.
|
@@ -492,35 +516,24 @@ export class Autofill extends BasePlugin {
|
|
492
516
|
super.destroy();
|
493
517
|
}
|
494
518
|
}
|
495
|
-
function
|
519
|
+
function _onCellCornerDblClick2() {
|
496
520
|
const selectionApplied = this.selectAdjacent();
|
497
521
|
if (selectionApplied) {
|
498
522
|
this.fillIn();
|
499
523
|
}
|
500
524
|
}
|
501
|
-
|
502
|
-
* On after cell corner mouse down listener.
|
503
|
-
*/
|
504
|
-
function _onAfterCellCornerMouseDown() {
|
525
|
+
function _onAfterCellCornerMouseDown2() {
|
505
526
|
this.handleDraggedCells = 1;
|
506
527
|
this.mouseDownOnCellCorner = true;
|
507
528
|
}
|
508
|
-
|
509
|
-
* On before cell mouse over listener.
|
510
|
-
*
|
511
|
-
* @param {CellCoords} coords `CellCoords` coord object.
|
512
|
-
*/
|
513
|
-
function _onBeforeCellMouseOver(coords) {
|
529
|
+
function _onBeforeCellMouseOver2(coords) {
|
514
530
|
if (this.mouseDownOnCellCorner && !this.hot.view.isMouseDown() && this.handleDraggedCells) {
|
515
531
|
this.handleDraggedCells += 1;
|
516
532
|
this.showBorder(coords);
|
517
533
|
this.addNewRowIfNeeded();
|
518
534
|
}
|
519
535
|
}
|
520
|
-
|
521
|
-
* On mouse up listener.
|
522
|
-
*/
|
523
|
-
function _onMouseUp() {
|
536
|
+
function _onMouseUp2() {
|
524
537
|
if (this.handleDraggedCells) {
|
525
538
|
if (this.handleDraggedCells > 1) {
|
526
539
|
this.fillIn();
|
@@ -529,12 +542,7 @@ function _onMouseUp() {
|
|
529
542
|
this.mouseDownOnCellCorner = false;
|
530
543
|
}
|
531
544
|
}
|
532
|
-
|
533
|
-
* On mouse move listener.
|
534
|
-
*
|
535
|
-
* @param {MouseEvent} event `mousemove` event properties.
|
536
|
-
*/
|
537
|
-
function _onMouseMove(event) {
|
545
|
+
function _onMouseMove2(event) {
|
538
546
|
const mouseWasDraggedOutside = this.getIfMouseWasDraggedOutside(event);
|
539
547
|
if (this.addingStarted === false && this.handleDraggedCells > 0 && mouseWasDraggedOutside) {
|
540
548
|
this.mouseDragOutside = true;
|
package/plugins/base/base.js
CHANGED
@@ -18,8 +18,10 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
18
18
|
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; }
|
19
19
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
20
20
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
21
|
-
function
|
22
|
-
function
|
21
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
22
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
23
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
24
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
23
25
|
const DEPS_TYPE_CHECKERS = new Map([['plugin', _registry.hasPlugin], ['cell-type', _registry2.hasCellType], ['editor', _registry3.hasEditor], ['renderer', _registry4.hasRenderer], ['validator', _registry5.hasValidator]]);
|
24
26
|
const PLUGIN_KEY = exports.PLUGIN_KEY = 'base';
|
25
27
|
const missingDepsMsgs = [];
|
@@ -30,7 +32,7 @@ let initializedPlugins = null;
|
|
30
32
|
* @property {Core} hot Handsontable instance.
|
31
33
|
*/
|
32
34
|
var _hooks = /*#__PURE__*/new WeakMap();
|
33
|
-
var
|
35
|
+
var _isRelevantToSettings = /*#__PURE__*/new WeakSet();
|
34
36
|
class BasePlugin {
|
35
37
|
static get PLUGIN_KEY() {
|
36
38
|
return PLUGIN_KEY;
|
@@ -68,7 +70,7 @@ class BasePlugin {
|
|
68
70
|
* @param {Handsontable.DefaultSettings} settings The config object passed to `updateSettings`.
|
69
71
|
* @returns {boolean}
|
70
72
|
*/
|
71
|
-
_classPrivateMethodInitSpec(this,
|
73
|
+
_classPrivateMethodInitSpec(this, _isRelevantToSettings);
|
72
74
|
_defineProperty(this, "eventManager", new _eventManager.default(this));
|
73
75
|
/**
|
74
76
|
* @type {string}
|
@@ -93,7 +95,10 @@ class BasePlugin {
|
|
93
95
|
/**
|
94
96
|
* Collection of the reference to the plugins hooks.
|
95
97
|
*/
|
96
|
-
_classPrivateFieldInitSpec(this, _hooks, {
|
98
|
+
_classPrivateFieldInitSpec(this, _hooks, {
|
99
|
+
writable: true,
|
100
|
+
value: {}
|
101
|
+
});
|
97
102
|
/**
|
98
103
|
* Handsontable instance.
|
99
104
|
*
|
@@ -180,11 +185,11 @@ class BasePlugin {
|
|
180
185
|
* @param {Function} callback The listener function to add.
|
181
186
|
*/
|
182
187
|
addHook(name, callback) {
|
183
|
-
_classPrivateFieldGet(
|
184
|
-
const hooks = _classPrivateFieldGet(
|
188
|
+
_classPrivateFieldGet(this, _hooks)[name] = _classPrivateFieldGet(this, _hooks)[name] || [];
|
189
|
+
const hooks = _classPrivateFieldGet(this, _hooks)[name];
|
185
190
|
this.hot.addHook(name, callback);
|
186
191
|
hooks.push(callback);
|
187
|
-
_classPrivateFieldGet(
|
192
|
+
_classPrivateFieldGet(this, _hooks)[name] = hooks;
|
188
193
|
}
|
189
194
|
|
190
195
|
/**
|
@@ -193,7 +198,7 @@ class BasePlugin {
|
|
193
198
|
* @param {string} name The hook name.
|
194
199
|
*/
|
195
200
|
removeHooks(name) {
|
196
|
-
(0, _array.arrayEach)(_classPrivateFieldGet(
|
201
|
+
(0, _array.arrayEach)(_classPrivateFieldGet(this, _hooks)[name] || [], callback => {
|
197
202
|
this.hot.removeHook(name, callback);
|
198
203
|
});
|
199
204
|
}
|
@@ -202,7 +207,7 @@ class BasePlugin {
|
|
202
207
|
* Clear all hooks.
|
203
208
|
*/
|
204
209
|
clearHooks() {
|
205
|
-
const hooks = _classPrivateFieldGet(
|
210
|
+
const hooks = _classPrivateFieldGet(this, _hooks);
|
206
211
|
(0, _object.objectEach)(hooks, (callbacks, name) => this.removeHooks(name));
|
207
212
|
hooks.length = 0;
|
208
213
|
}
|
@@ -237,7 +242,7 @@ class BasePlugin {
|
|
237
242
|
* @param {object} newSettings New set of settings passed to the `updateSettings` method.
|
238
243
|
*/
|
239
244
|
onUpdateSettings(newSettings) {
|
240
|
-
const relevantToSettings =
|
245
|
+
const relevantToSettings = _classPrivateMethodGet(this, _isRelevantToSettings, _isRelevantToSettings2).call(this, newSettings);
|
241
246
|
if (this.isEnabled) {
|
242
247
|
if (this.enabled && !this.isEnabled()) {
|
243
248
|
this.disablePlugin();
|
@@ -275,7 +280,7 @@ class BasePlugin {
|
|
275
280
|
}
|
276
281
|
}
|
277
282
|
exports.BasePlugin = BasePlugin;
|
278
|
-
function
|
283
|
+
function _isRelevantToSettings2(settings) {
|
279
284
|
if (!settings) {
|
280
285
|
return false;
|
281
286
|
}
|
package/plugins/base/base.mjs
CHANGED
@@ -6,8 +6,10 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
6
6
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
7
7
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
8
8
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
9
|
-
function
|
10
|
-
function
|
9
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
10
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
11
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
12
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
11
13
|
import { defineGetter, objectEach } from "../../helpers/object.mjs";
|
12
14
|
import { arrayEach } from "../../helpers/array.mjs";
|
13
15
|
import { getPluginsNames, hasPlugin } from "../registry.mjs";
|
@@ -26,7 +28,7 @@ let initializedPlugins = null;
|
|
26
28
|
* @property {Core} hot Handsontable instance.
|
27
29
|
*/
|
28
30
|
var _hooks = /*#__PURE__*/new WeakMap();
|
29
|
-
var
|
31
|
+
var _isRelevantToSettings = /*#__PURE__*/new WeakSet();
|
30
32
|
export class BasePlugin {
|
31
33
|
static get PLUGIN_KEY() {
|
32
34
|
return PLUGIN_KEY;
|
@@ -64,7 +66,7 @@ export class BasePlugin {
|
|
64
66
|
* @param {Handsontable.DefaultSettings} settings The config object passed to `updateSettings`.
|
65
67
|
* @returns {boolean}
|
66
68
|
*/
|
67
|
-
_classPrivateMethodInitSpec(this,
|
69
|
+
_classPrivateMethodInitSpec(this, _isRelevantToSettings);
|
68
70
|
_defineProperty(this, "eventManager", new EventManager(this));
|
69
71
|
/**
|
70
72
|
* @type {string}
|
@@ -89,7 +91,10 @@ export class BasePlugin {
|
|
89
91
|
/**
|
90
92
|
* Collection of the reference to the plugins hooks.
|
91
93
|
*/
|
92
|
-
_classPrivateFieldInitSpec(this, _hooks, {
|
94
|
+
_classPrivateFieldInitSpec(this, _hooks, {
|
95
|
+
writable: true,
|
96
|
+
value: {}
|
97
|
+
});
|
93
98
|
/**
|
94
99
|
* Handsontable instance.
|
95
100
|
*
|
@@ -176,11 +181,11 @@ export class BasePlugin {
|
|
176
181
|
* @param {Function} callback The listener function to add.
|
177
182
|
*/
|
178
183
|
addHook(name, callback) {
|
179
|
-
_classPrivateFieldGet(
|
180
|
-
const hooks = _classPrivateFieldGet(
|
184
|
+
_classPrivateFieldGet(this, _hooks)[name] = _classPrivateFieldGet(this, _hooks)[name] || [];
|
185
|
+
const hooks = _classPrivateFieldGet(this, _hooks)[name];
|
181
186
|
this.hot.addHook(name, callback);
|
182
187
|
hooks.push(callback);
|
183
|
-
_classPrivateFieldGet(
|
188
|
+
_classPrivateFieldGet(this, _hooks)[name] = hooks;
|
184
189
|
}
|
185
190
|
|
186
191
|
/**
|
@@ -189,7 +194,7 @@ export class BasePlugin {
|
|
189
194
|
* @param {string} name The hook name.
|
190
195
|
*/
|
191
196
|
removeHooks(name) {
|
192
|
-
arrayEach(_classPrivateFieldGet(
|
197
|
+
arrayEach(_classPrivateFieldGet(this, _hooks)[name] || [], callback => {
|
193
198
|
this.hot.removeHook(name, callback);
|
194
199
|
});
|
195
200
|
}
|
@@ -198,7 +203,7 @@ export class BasePlugin {
|
|
198
203
|
* Clear all hooks.
|
199
204
|
*/
|
200
205
|
clearHooks() {
|
201
|
-
const hooks = _classPrivateFieldGet(
|
206
|
+
const hooks = _classPrivateFieldGet(this, _hooks);
|
202
207
|
objectEach(hooks, (callbacks, name) => this.removeHooks(name));
|
203
208
|
hooks.length = 0;
|
204
209
|
}
|
@@ -233,7 +238,7 @@ export class BasePlugin {
|
|
233
238
|
* @param {object} newSettings New set of settings passed to the `updateSettings` method.
|
234
239
|
*/
|
235
240
|
onUpdateSettings(newSettings) {
|
236
|
-
const relevantToSettings =
|
241
|
+
const relevantToSettings = _classPrivateMethodGet(this, _isRelevantToSettings, _isRelevantToSettings2).call(this, newSettings);
|
237
242
|
if (this.isEnabled) {
|
238
243
|
if (this.enabled && !this.isEnabled()) {
|
239
244
|
this.disablePlugin();
|
@@ -270,7 +275,7 @@ export class BasePlugin {
|
|
270
275
|
delete this.hot;
|
271
276
|
}
|
272
277
|
}
|
273
|
-
function
|
278
|
+
function _isRelevantToSettings2(settings) {
|
274
279
|
if (!settings) {
|
275
280
|
return false;
|
276
281
|
}
|
@@ -11,7 +11,7 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
11
11
|
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; }
|
12
12
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
13
13
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
14
|
-
function
|
14
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
15
15
|
const PLUGIN_KEY = exports.PLUGIN_KEY = 'bindRowsWithHeaders';
|
16
16
|
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 210;
|
17
17
|
const DEFAULT_BIND = 'loose';
|
@@ -49,7 +49,7 @@ const bindTypeToMapStrategy = new Map([['loose', _looseBindsMap.default], ['stri
|
|
49
49
|
* ```
|
50
50
|
* :::
|
51
51
|
*/
|
52
|
-
var
|
52
|
+
var _onModifyRowHeader = /*#__PURE__*/new WeakSet();
|
53
53
|
class BindRowsWithHeaders extends _base.BasePlugin {
|
54
54
|
constructor() {
|
55
55
|
super(...arguments);
|
@@ -59,7 +59,7 @@ class BindRowsWithHeaders extends _base.BasePlugin {
|
|
59
59
|
* @param {number} row Row index.
|
60
60
|
* @returns {number}
|
61
61
|
*/
|
62
|
-
_classPrivateMethodInitSpec(this,
|
62
|
+
_classPrivateMethodInitSpec(this, _onModifyRowHeader);
|
63
63
|
/**
|
64
64
|
* Plugin indexes cache.
|
65
65
|
*
|
@@ -97,7 +97,7 @@ class BindRowsWithHeaders extends _base.BasePlugin {
|
|
97
97
|
}
|
98
98
|
const MapStrategy = bindTypeToMapStrategy.get(bindType);
|
99
99
|
this.headerIndexes = this.hot.rowIndexMapper.registerMap('bindRowsWithHeaders', new MapStrategy());
|
100
|
-
this.addHook('modifyRowHeader', row =>
|
100
|
+
this.addHook('modifyRowHeader', row => _classPrivateMethodGet(this, _onModifyRowHeader, _onModifyRowHeader2).call(this, row));
|
101
101
|
super.enablePlugin();
|
102
102
|
}
|
103
103
|
|
@@ -116,6 +116,6 @@ class BindRowsWithHeaders extends _base.BasePlugin {
|
|
116
116
|
}
|
117
117
|
}
|
118
118
|
exports.BindRowsWithHeaders = BindRowsWithHeaders;
|
119
|
-
function
|
119
|
+
function _onModifyRowHeader2(row) {
|
120
120
|
return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(row));
|
121
121
|
}
|
@@ -4,7 +4,7 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
6
6
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
7
|
-
function
|
7
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
8
8
|
import { BasePlugin } from "../base/index.mjs";
|
9
9
|
import LooseBindsMap from "./maps/looseBindsMap.mjs";
|
10
10
|
import StrictBindsMap from "./maps/strictBindsMap.mjs";
|
@@ -45,7 +45,7 @@ const bindTypeToMapStrategy = new Map([['loose', LooseBindsMap], ['strict', Stri
|
|
45
45
|
* ```
|
46
46
|
* :::
|
47
47
|
*/
|
48
|
-
var
|
48
|
+
var _onModifyRowHeader = /*#__PURE__*/new WeakSet();
|
49
49
|
export class BindRowsWithHeaders extends BasePlugin {
|
50
50
|
constructor() {
|
51
51
|
super(...arguments);
|
@@ -55,7 +55,7 @@ export class BindRowsWithHeaders extends BasePlugin {
|
|
55
55
|
* @param {number} row Row index.
|
56
56
|
* @returns {number}
|
57
57
|
*/
|
58
|
-
_classPrivateMethodInitSpec(this,
|
58
|
+
_classPrivateMethodInitSpec(this, _onModifyRowHeader);
|
59
59
|
/**
|
60
60
|
* Plugin indexes cache.
|
61
61
|
*
|
@@ -93,7 +93,7 @@ export class BindRowsWithHeaders extends BasePlugin {
|
|
93
93
|
}
|
94
94
|
const MapStrategy = bindTypeToMapStrategy.get(bindType);
|
95
95
|
this.headerIndexes = this.hot.rowIndexMapper.registerMap('bindRowsWithHeaders', new MapStrategy());
|
96
|
-
this.addHook('modifyRowHeader', row =>
|
96
|
+
this.addHook('modifyRowHeader', row => _classPrivateMethodGet(this, _onModifyRowHeader, _onModifyRowHeader2).call(this, row));
|
97
97
|
super.enablePlugin();
|
98
98
|
}
|
99
99
|
|
@@ -111,6 +111,6 @@ export class BindRowsWithHeaders extends BasePlugin {
|
|
111
111
|
super.destroy();
|
112
112
|
}
|
113
113
|
}
|
114
|
-
function
|
114
|
+
function _onModifyRowHeader2(row) {
|
115
115
|
return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(row));
|
116
116
|
}
|
@@ -9,7 +9,6 @@ var _number = require("../../helpers/number");
|
|
9
9
|
var _console = require("../../helpers/console");
|
10
10
|
var _element = require("../../helpers/dom/element");
|
11
11
|
var _event = require("../../helpers/dom/event");
|
12
|
-
var _shortcutContexts = require("../../shortcutContexts");
|
13
12
|
var _a11y = require("../../helpers/a11y");
|
14
13
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
15
14
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
@@ -17,9 +16,12 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
17
16
|
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; }
|
18
17
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
19
18
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
20
|
-
function _classPrivateFieldGet(
|
21
|
-
function
|
22
|
-
function
|
19
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
20
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
21
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
22
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
23
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
24
|
+
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; } }
|
23
25
|
const PLUGIN_KEY = exports.PLUGIN_KEY = 'collapsibleColumns';
|
24
26
|
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 290;
|
25
27
|
const SETTING_KEYS = ['nestedHeaders'];
|
@@ -107,10 +109,32 @@ const actionDictionary = new Map([['collapse', {
|
|
107
109
|
* :::
|
108
110
|
*/
|
109
111
|
var _collapsedColumnsMap = /*#__PURE__*/new WeakMap();
|
110
|
-
var
|
112
|
+
var _onAfterGetColHeader = /*#__PURE__*/new WeakSet();
|
113
|
+
var _onBeforeOnCellMouseDown = /*#__PURE__*/new WeakSet();
|
114
|
+
var _onInit = /*#__PURE__*/new WeakSet();
|
115
|
+
var _onAfterLoadData = /*#__PURE__*/new WeakSet();
|
111
116
|
class CollapsibleColumns extends _base.BasePlugin {
|
112
117
|
constructor() {
|
113
118
|
super(...arguments);
|
119
|
+
/**
|
120
|
+
* Updates the plugin state after new dataset load.
|
121
|
+
*
|
122
|
+
* @param {Array[]} sourceData Array of arrays or array of objects containing data.
|
123
|
+
* @param {boolean} initialLoad Flag that determines whether the data has been loaded
|
124
|
+
* during the initialization.
|
125
|
+
*/
|
126
|
+
_classPrivateMethodInitSpec(this, _onAfterLoadData);
|
127
|
+
/**
|
128
|
+
* Updates the plugin state after HoT initialization.
|
129
|
+
*/
|
130
|
+
_classPrivateMethodInitSpec(this, _onInit);
|
131
|
+
/**
|
132
|
+
* Indicator mouse event callback.
|
133
|
+
*
|
134
|
+
* @param {object} event Mouse event.
|
135
|
+
* @param {object} coords Event coordinates.
|
136
|
+
*/
|
137
|
+
_classPrivateMethodInitSpec(this, _onBeforeOnCellMouseDown);
|
114
138
|
/**
|
115
139
|
* Adds the indicator to the headers.
|
116
140
|
*
|
@@ -119,7 +143,7 @@ class CollapsibleColumns extends _base.BasePlugin {
|
|
119
143
|
* @param {number} headerLevel The index of header level counting from the top (positive
|
120
144
|
* values counting from 0 to N).
|
121
145
|
*/
|
122
|
-
_classPrivateMethodInitSpec(this,
|
146
|
+
_classPrivateMethodInitSpec(this, _onAfterGetColHeader);
|
123
147
|
/**
|
124
148
|
* Cached reference to the NestedHeaders plugin.
|
125
149
|
*
|
@@ -140,7 +164,10 @@ class CollapsibleColumns extends _base.BasePlugin {
|
|
140
164
|
* @private
|
141
165
|
* @type {HidingMap|null}
|
142
166
|
*/
|
143
|
-
_classPrivateFieldInitSpec(this, _collapsedColumnsMap,
|
167
|
+
_classPrivateFieldInitSpec(this, _collapsedColumnsMap, {
|
168
|
+
writable: true,
|
169
|
+
value: null
|
170
|
+
});
|
144
171
|
}
|
145
172
|
static get PLUGIN_KEY() {
|
146
173
|
return PLUGIN_KEY;
|
@@ -178,23 +205,23 @@ class CollapsibleColumns extends _base.BasePlugin {
|
|
178
205
|
if (!nestedHeaders) {
|
179
206
|
(0, _console.warn)('You need to configure the Nested Headers plugin in order to use collapsible headers.');
|
180
207
|
}
|
181
|
-
_classPrivateFieldSet(
|
208
|
+
_classPrivateFieldSet(this, _collapsedColumnsMap, this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName, 'hiding'));
|
182
209
|
this.nestedHeadersPlugin = this.hot.getPlugin('nestedHeaders');
|
183
210
|
this.headerStateManager = this.nestedHeadersPlugin.getStateManager();
|
184
|
-
this.addHook('init', () =>
|
211
|
+
this.addHook('init', () => _classPrivateMethodGet(this, _onInit, _onInit2).call(this));
|
185
212
|
this.addHook('afterLoadData', function () {
|
186
213
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
187
214
|
args[_key] = arguments[_key];
|
188
215
|
}
|
189
|
-
return
|
216
|
+
return _classPrivateMethodGet(_this, _onAfterLoadData, _onAfterLoadData2).call(_this, ...args);
|
190
217
|
});
|
191
218
|
this.addHook('afterGetColHeader', function () {
|
192
219
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
193
220
|
args[_key2] = arguments[_key2];
|
194
221
|
}
|
195
|
-
return
|
222
|
+
return _classPrivateMethodGet(_this, _onAfterGetColHeader, _onAfterGetColHeader2).call(_this, ...args);
|
196
223
|
});
|
197
|
-
this.addHook('beforeOnCellMouseDown', (event, coords, TD) =>
|
224
|
+
this.addHook('beforeOnCellMouseDown', (event, coords, TD) => _classPrivateMethodGet(this, _onBeforeOnCellMouseDown, _onBeforeOnCellMouseDown2).call(this, event, coords, TD));
|
198
225
|
this.registerShortcuts();
|
199
226
|
super.enablePlugin();
|
200
227
|
// @TODO: Workaround for broken plugin initialization abstraction (#6806).
|
@@ -241,7 +268,7 @@ class CollapsibleColumns extends _base.BasePlugin {
|
|
241
268
|
*/
|
242
269
|
disablePlugin() {
|
243
270
|
this.hot.columnIndexMapper.unregisterMap(this.pluginName);
|
244
|
-
_classPrivateFieldSet(
|
271
|
+
_classPrivateFieldSet(this, _collapsedColumnsMap, null);
|
245
272
|
this.nestedHeadersPlugin = null;
|
246
273
|
this.unregisterShortcuts();
|
247
274
|
this.clearButtons();
|
@@ -281,17 +308,12 @@ class CollapsibleColumns extends _base.BasePlugin {
|
|
281
308
|
col: columnIndex
|
282
309
|
});
|
283
310
|
}
|
284
|
-
|
285
|
-
// prevent default Enter behavior (move to the next row within a selection range)
|
286
|
-
return false;
|
287
311
|
},
|
288
312
|
runOnlyIf: () => {
|
289
|
-
var _this$hot$getSelected
|
290
|
-
return (
|
313
|
+
var _this$hot$getSelected;
|
314
|
+
return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
|
291
315
|
},
|
292
|
-
group: SHORTCUTS_GROUP
|
293
|
-
relativeToGroup: _shortcutContexts.EDITOR_EDIT_GROUP,
|
294
|
-
position: 'before'
|
316
|
+
group: SHORTCUTS_GROUP
|
295
317
|
});
|
296
318
|
}
|
297
319
|
|
@@ -475,25 +497,10 @@ class CollapsibleColumns extends _base.BasePlugin {
|
|
475
497
|
}
|
476
498
|
this.hot.batchExecution(() => {
|
477
499
|
(0, _array.arrayEach)(affectedColumnsIndexes, visualColumn => {
|
478
|
-
_classPrivateFieldGet(
|
500
|
+
_classPrivateFieldGet(this, _collapsedColumnsMap).setValueAtIndex(this.hot.toPhysicalColumn(visualColumn), actionTranslator.hideColumn);
|
479
501
|
});
|
480
502
|
}, true);
|
481
503
|
const isActionPerformed = this.getCollapsedColumns().length !== currentCollapsedColumns.length;
|
482
|
-
const selectionRange = this.hot.getSelectedRangeLast();
|
483
|
-
if (action === 'collapse' && isActionPerformed && selectionRange) {
|
484
|
-
const {
|
485
|
-
row,
|
486
|
-
col
|
487
|
-
} = selectionRange.highlight;
|
488
|
-
const isHidden = this.hot.rowIndexMapper.isHidden(row) || this.hot.columnIndexMapper.isHidden(col);
|
489
|
-
if (isHidden && affectedColumnsIndexes.includes(col)) {
|
490
|
-
const nextRow = row >= 0 ? this.hot.rowIndexMapper.getNearestNotHiddenIndex(row, 1, true) : row;
|
491
|
-
const nextColumn = col >= 0 ? this.hot.columnIndexMapper.getNearestNotHiddenIndex(col, 1, true) : col;
|
492
|
-
if (nextRow !== null && nextColumn !== null) {
|
493
|
-
this.hot.selectCell(nextRow, nextColumn);
|
494
|
-
}
|
495
|
-
}
|
496
|
-
}
|
497
504
|
this.hot.runHooks(actionTranslator.afterHook, currentCollapsedColumns, destinationCollapsedColumns, isActionPossible, isActionPerformed);
|
498
505
|
this.hot.render();
|
499
506
|
this.hot.view.adjustElementsSize(true);
|
@@ -506,18 +513,18 @@ class CollapsibleColumns extends _base.BasePlugin {
|
|
506
513
|
* @returns {number[]}
|
507
514
|
*/
|
508
515
|
getCollapsedColumns() {
|
509
|
-
return _classPrivateFieldGet(
|
516
|
+
return _classPrivateFieldGet(this, _collapsedColumnsMap).getHiddenIndexes();
|
510
517
|
}
|
511
518
|
/**
|
512
519
|
* Destroys the plugin instance.
|
513
520
|
*/
|
514
521
|
destroy() {
|
515
|
-
_classPrivateFieldSet(
|
522
|
+
_classPrivateFieldSet(this, _collapsedColumnsMap, null);
|
516
523
|
super.destroy();
|
517
524
|
}
|
518
525
|
}
|
519
526
|
exports.CollapsibleColumns = CollapsibleColumns;
|
520
|
-
function
|
527
|
+
function _onAfterGetColHeader2(column, TH, headerLevel) {
|
521
528
|
var _this$headerStateMana3;
|
522
529
|
const {
|
523
530
|
collapsible,
|
@@ -560,13 +567,7 @@ function _onAfterGetColHeader(column, TH, headerLevel) {
|
|
560
567
|
(_collapsibleElement = collapsibleElement) === null || _collapsibleElement === void 0 || _collapsibleElement.remove();
|
561
568
|
}
|
562
569
|
}
|
563
|
-
|
564
|
-
* Indicator mouse event callback.
|
565
|
-
*
|
566
|
-
* @param {object} event Mouse event.
|
567
|
-
* @param {object} coords Event coordinates.
|
568
|
-
*/
|
569
|
-
function _onBeforeOnCellMouseDown(event, coords) {
|
570
|
+
function _onBeforeOnCellMouseDown2(event, coords) {
|
570
571
|
if ((0, _element.hasClass)(event.target, COLLAPSIBLE_ELEMENT_CLASS)) {
|
571
572
|
if ((0, _element.hasClass)(event.target, 'expanded')) {
|
572
573
|
this.eventManager.fireEvent(event.target, 'mouseup');
|
@@ -578,21 +579,11 @@ function _onBeforeOnCellMouseDown(event, coords) {
|
|
578
579
|
(0, _event.stopImmediatePropagation)(event);
|
579
580
|
}
|
580
581
|
}
|
581
|
-
|
582
|
-
* Updates the plugin state after HoT initialization.
|
583
|
-
*/
|
584
|
-
function _onInit() {
|
582
|
+
function _onInit2() {
|
585
583
|
// @TODO: Workaround for broken plugin initialization abstraction (#6806).
|
586
584
|
this.updatePlugin();
|
587
585
|
}
|
588
|
-
|
589
|
-
* Updates the plugin state after new dataset load.
|
590
|
-
*
|
591
|
-
* @param {Array[]} sourceData Array of arrays or array of objects containing data.
|
592
|
-
* @param {boolean} initialLoad Flag that determines whether the data has been loaded
|
593
|
-
* during the initialization.
|
594
|
-
*/
|
595
|
-
function _onAfterLoadData(sourceData, initialLoad) {
|
586
|
+
function _onAfterLoadData2(sourceData, initialLoad) {
|
596
587
|
if (!initialLoad) {
|
597
588
|
this.updatePlugin();
|
598
589
|
}
|