handsontable 0.0.0-next-53a190b-20240403 → 0.0.0-next-5a535ed-20240403
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +17 -12
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +17 -12
- package/3rdparty/walkontable/src/calculator/viewportRows.js +15 -10
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +15 -10
- package/3rdparty/walkontable/src/cell/coords.js +17 -12
- package/3rdparty/walkontable/src/cell/coords.mjs +17 -12
- package/3rdparty/walkontable/src/cell/range.d.ts +1 -2
- package/3rdparty/walkontable/src/cell/range.js +28 -40
- package/3rdparty/walkontable/src/cell/range.mjs +28 -40
- package/3rdparty/walkontable/src/core/_base.js +1 -1
- package/3rdparty/walkontable/src/core/_base.mjs +1 -1
- package/3rdparty/walkontable/src/event.js +104 -72
- package/3rdparty/walkontable/src/event.mjs +104 -72
- package/3rdparty/walkontable/src/overlay/inlineStart.js +1 -15
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -16
- package/3rdparty/walkontable/src/overlay/top.js +0 -11
- package/3rdparty/walkontable/src/overlay/top.mjs +1 -12
- package/3rdparty/walkontable/src/overlays.js +4 -46
- package/3rdparty/walkontable/src/overlays.mjs +4 -46
- package/3rdparty/walkontable/src/scroll.js +17 -15
- package/3rdparty/walkontable/src/scroll.mjs +17 -15
- package/3rdparty/walkontable/src/selection/manager.js +69 -48
- package/3rdparty/walkontable/src/selection/manager.mjs +69 -48
- package/3rdparty/walkontable/src/selection/scanner.js +42 -33
- package/3rdparty/walkontable/src/selection/scanner.mjs +42 -33
- package/3rdparty/walkontable/src/utils/columnStretching.js +44 -27
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +44 -27
- package/3rdparty/walkontable/src/utils/orderView/view.js +1 -1
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +1 -1
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/viewportScroll/index.js +1 -4
- package/core/viewportScroll/index.mjs +1 -4
- package/core.d.ts +3 -4
- package/core.js +22 -77
- package/core.mjs +22 -77
- package/dataMap/dataSource.js +1 -1
- package/dataMap/dataSource.mjs +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +1 -1
- package/dataMap/metaManager/metaSchema.js +1 -1
- package/dataMap/metaManager/metaSchema.mjs +1 -1
- package/dataMap/replaceData.js +1 -1
- package/dataMap/replaceData.mjs +1 -1
- package/dist/handsontable.css +4 -4
- package/dist/handsontable.full.css +4 -4
- package/dist/handsontable.full.js +9121 -9062
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +292 -292
- package/dist/handsontable.js +6573 -6967
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +25 -25
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +23 -25
- package/editorManager.mjs +23 -25
- package/editors/autocompleteEditor/autocompleteEditor.js +10 -6
- package/editors/autocompleteEditor/autocompleteEditor.mjs +10 -6
- package/editors/selectEditor/selectEditor.js +19 -20
- package/editors/selectEditor/selectEditor.mjs +19 -20
- package/eventManager.js +1 -1
- package/eventManager.mjs +1 -1
- package/focusManager.js +82 -64
- package/focusManager.mjs +82 -64
- package/helpers/dom/element.js +1 -23
- package/helpers/dom/element.mjs +1 -21
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/object.js +2 -2
- package/helpers/object.mjs +2 -2
- package/index.d.ts +0 -10
- package/package.json +2 -7
- package/pluginHooks.d.ts +3 -4
- package/pluginHooks.js +38 -99
- package/pluginHooks.mjs +38 -99
- package/plugins/autoColumnSize/autoColumnSize.js +65 -49
- package/plugins/autoColumnSize/autoColumnSize.mjs +65 -49
- package/plugins/autoRowSize/autoRowSize.js +34 -28
- package/plugins/autoRowSize/autoRowSize.mjs +34 -28
- package/plugins/autofill/autofill.js +38 -30
- package/plugins/autofill/autofill.mjs +38 -30
- package/plugins/base/base.js +17 -12
- package/plugins/base/base.mjs +17 -12
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
- package/plugins/collapsibleColumns/collapsibleColumns.js +50 -59
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +50 -59
- package/plugins/columnSorting/columnSorting.js +45 -49
- package/plugins/columnSorting/columnSorting.mjs +45 -49
- package/plugins/columnSummary/columnSummary.js +26 -22
- package/plugins/columnSummary/columnSummary.mjs +26 -22
- package/plugins/comments/comments.js +158 -116
- package/plugins/comments/comments.mjs +158 -116
- package/plugins/contextMenu/contextMenu.js +26 -20
- package/plugins/contextMenu/contextMenu.mjs +26 -20
- package/plugins/contextMenu/itemsFactory.js +1 -1
- package/plugins/contextMenu/itemsFactory.mjs +1 -1
- package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
- package/plugins/contextMenu/menu/menu.js +21 -13
- package/plugins/contextMenu/menu/menu.mjs +21 -13
- package/plugins/contextMenu/menu/positioner.js +58 -41
- package/plugins/contextMenu/menu/positioner.mjs +58 -41
- package/plugins/copyPaste/copyPaste.js +157 -116
- package/plugins/copyPaste/copyPaste.mjs +157 -116
- package/plugins/copyPaste/copyableRanges.js +66 -43
- package/plugins/copyPaste/copyableRanges.mjs +66 -43
- package/plugins/customBorders/customBorders.js +13 -11
- package/plugins/customBorders/customBorders.mjs +13 -11
- package/plugins/dragToScroll/dragToScroll.js +6 -6
- package/plugins/dragToScroll/dragToScroll.mjs +6 -6
- package/plugins/dropdownMenu/dropdownMenu.js +106 -80
- package/plugins/dropdownMenu/dropdownMenu.mjs +106 -80
- package/plugins/exportFile/dataProvider.js +1 -1
- package/plugins/exportFile/dataProvider.mjs +1 -1
- package/plugins/filters/component/actionBar.js +9 -9
- package/plugins/filters/component/actionBar.mjs +8 -8
- package/plugins/filters/component/condition.js +15 -13
- package/plugins/filters/component/condition.mjs +15 -13
- package/plugins/filters/component/operators.js +6 -6
- package/plugins/filters/component/operators.mjs +6 -6
- package/plugins/filters/component/value.js +28 -24
- package/plugins/filters/component/value.mjs +28 -24
- package/plugins/filters/conditionUpdateObserver.js +24 -22
- package/plugins/filters/conditionUpdateObserver.mjs +24 -22
- package/plugins/filters/dataFilter.js +1 -1
- package/plugins/filters/dataFilter.mjs +1 -1
- package/plugins/filters/filters.js +95 -81
- package/plugins/filters/filters.mjs +95 -81
- package/plugins/filters/ui/input.js +19 -13
- package/plugins/filters/ui/input.mjs +19 -13
- package/plugins/filters/ui/link.js +13 -8
- package/plugins/filters/ui/link.mjs +13 -8
- package/plugins/filters/ui/multipleSelect.js +112 -85
- package/plugins/filters/ui/multipleSelect.mjs +112 -85
- package/plugins/filters/ui/radioInput.js +20 -12
- package/plugins/filters/ui/radioInput.mjs +20 -12
- package/plugins/filters/ui/select.js +72 -50
- package/plugins/filters/ui/select.mjs +71 -49
- package/plugins/formulas/formulas.js +326 -268
- package/plugins/formulas/formulas.mjs +327 -269
- package/plugins/formulas/indexSyncer/axisSyncer.js +61 -38
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +61 -38
- package/plugins/formulas/indexSyncer/index.js +48 -25
- package/plugins/formulas/indexSyncer/index.mjs +48 -25
- package/plugins/hiddenColumns/hiddenColumns.js +83 -64
- package/plugins/hiddenColumns/hiddenColumns.mjs +83 -64
- package/plugins/hiddenRows/hiddenRows.js +82 -63
- package/plugins/hiddenRows/hiddenRows.mjs +82 -63
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +32 -24
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +33 -25
- package/plugins/manualColumnMove/manualColumnMove.js +170 -126
- package/plugins/manualColumnMove/manualColumnMove.mjs +170 -126
- package/plugins/manualColumnResize/manualColumnResize.js +230 -169
- package/plugins/manualColumnResize/manualColumnResize.mjs +230 -169
- package/plugins/manualRowMove/manualRowMove.js +128 -99
- package/plugins/manualRowMove/manualRowMove.mjs +128 -99
- package/plugins/manualRowResize/manualRowResize.js +209 -150
- package/plugins/manualRowResize/manualRowResize.mjs +209 -150
- package/plugins/mergeCells/calculations/selection.js +71 -2
- package/plugins/mergeCells/calculations/selection.mjs +71 -2
- package/plugins/mergeCells/cellsCollection.js +1 -117
- package/plugins/mergeCells/cellsCollection.mjs +1 -117
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
- package/plugins/mergeCells/mergeCells.js +397 -499
- package/plugins/mergeCells/mergeCells.mjs +397 -499
- package/plugins/multiColumnSorting/multiColumnSorting.js +2 -8
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -8
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
- package/plugins/nestedHeaders/nestedHeaders.js +253 -205
- package/plugins/nestedHeaders/nestedHeaders.mjs +254 -206
- package/plugins/nestedHeaders/stateManager/headersTree.js +32 -21
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +32 -21
- package/plugins/nestedHeaders/stateManager/index.js +41 -30
- package/plugins/nestedHeaders/stateManager/index.mjs +41 -30
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +30 -19
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +30 -19
- package/plugins/nestedRows/data/dataManager.js +1 -1
- package/plugins/nestedRows/data/dataManager.mjs +1 -1
- package/plugins/nestedRows/nestedRows.js +182 -151
- package/plugins/nestedRows/nestedRows.mjs +183 -152
- package/plugins/nestedRows/ui/contextMenu.js +15 -11
- package/plugins/nestedRows/ui/contextMenu.mjs +14 -10
- package/plugins/nestedRows/utils/rowMoveController.js +1 -1
- package/plugins/nestedRows/utils/rowMoveController.mjs +1 -1
- package/plugins/persistentState/storage.js +2 -2
- package/plugins/persistentState/storage.mjs +2 -2
- package/plugins/search/search.js +7 -7
- package/plugins/search/search.mjs +7 -7
- package/plugins/touchScroll/touchScroll.js +19 -15
- package/plugins/touchScroll/touchScroll.mjs +20 -16
- package/plugins/trimRows/trimRows.js +6 -6
- package/plugins/trimRows/trimRows.mjs +6 -6
- package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
- package/selection/highlight/highlight.js +14 -14
- package/selection/highlight/highlight.mjs +13 -13
- package/selection/highlight/visualSelection.js +0 -2
- package/selection/highlight/visualSelection.mjs +0 -2
- package/selection/selection.js +67 -225
- package/selection/selection.mjs +66 -224
- package/selection/transformation.js +118 -149
- package/selection/transformation.mjs +118 -149
- package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
- package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
- package/shortcutContexts/commands/editor/open.js +3 -18
- package/shortcutContexts/commands/editor/open.mjs +3 -18
- package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
- package/shortcutContexts/grid.js +3 -9
- package/shortcutContexts/grid.mjs +3 -9
- package/shortcuts/context.js +1 -2
- package/shortcuts/context.mjs +1 -2
- package/tableView.js +78 -52
- package/tableView.mjs +78 -52
- package/translations/changesObservable/observable.js +38 -21
- package/translations/changesObservable/observable.mjs +38 -21
- package/translations/changesObservable/observer.js +12 -7
- package/translations/changesObservable/observer.mjs +11 -6
- package/translations/mapCollections/aggregatedCollection.js +1 -1
- package/translations/mapCollections/aggregatedCollection.mjs +1 -1
- package/translations/maps/indexMap.js +1 -1
- package/translations/maps/indexMap.mjs +1 -1
- package/utils/dataStructures/linkedList.js +1 -6
- package/utils/dataStructures/linkedList.mjs +1 -6
- package/utils/dataStructures/tree.js +1 -1
- package/utils/dataStructures/tree.mjs +1 -1
- package/utils/interval.js +44 -26
- package/utils/interval.mjs +44 -26
- package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
- package/i18n/languages/ar-AR.d.ts +0 -5
- package/i18n/languages/cs-CZ.d.ts +0 -5
- package/i18n/languages/hr-HR.d.ts +0 -5
- package/i18n/languages/sr-SP.d.ts +0 -5
- package/plugins/mergeCells/focusOrder.js +0 -305
- package/plugins/mergeCells/focusOrder.mjs +0 -300
@@ -2,16 +2,19 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
exports.normalizeRanges = normalizeRanges;
|
5
|
-
require("core-js/modules/es.error.cause.js");
|
6
5
|
require("core-js/modules/es.array.push.js");
|
6
|
+
require("core-js/modules/es.error.cause.js");
|
7
7
|
var _array = require("../../helpers/array");
|
8
8
|
var _number = require("../../helpers/number");
|
9
9
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
10
10
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
11
11
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
12
|
-
function
|
13
|
-
function
|
14
|
-
function
|
12
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
13
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
14
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
15
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
16
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
17
|
+
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; } }
|
15
18
|
/**
|
16
19
|
* The utils class produces the selection ranges in the `{startRow, startCol, endRow, endCol}` format
|
17
20
|
* based on the current table selection. The CopyPaste plugin consumes that ranges to generate
|
@@ -25,7 +28,8 @@ var _countColumns = /*#__PURE__*/new WeakMap();
|
|
25
28
|
var _rowsLimit = /*#__PURE__*/new WeakMap();
|
26
29
|
var _columnsLimit = /*#__PURE__*/new WeakMap();
|
27
30
|
var _countColumnHeaders = /*#__PURE__*/new WeakMap();
|
28
|
-
var
|
31
|
+
var _trimColumnsRange = /*#__PURE__*/new WeakSet();
|
32
|
+
var _trimRowsRange = /*#__PURE__*/new WeakSet();
|
29
33
|
class CopyableRangesFactory {
|
30
34
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
31
35
|
/**
|
@@ -45,6 +49,14 @@ class CopyableRangesFactory {
|
|
45
49
|
columnsLimit,
|
46
50
|
countColumnHeaders
|
47
51
|
} = _ref;
|
52
|
+
/**
|
53
|
+
* Trimmed the rows range to the limit.
|
54
|
+
*
|
55
|
+
* @param {*} startRow The lowest row index in the range.
|
56
|
+
* @param {*} endRow The highest row index in the range.
|
57
|
+
* @returns {number} Returns trimmed row index if it exceeds the limit.
|
58
|
+
*/
|
59
|
+
_classPrivateMethodInitSpec(this, _trimRowsRange);
|
48
60
|
/**
|
49
61
|
* Trimmed the columns range to the limit.
|
50
62
|
*
|
@@ -52,36 +64,54 @@ class CopyableRangesFactory {
|
|
52
64
|
* @param {*} endColumn The highest column index in the range.
|
53
65
|
* @returns {number} Returns trimmed column index if it exceeds the limit.
|
54
66
|
*/
|
55
|
-
_classPrivateMethodInitSpec(this,
|
67
|
+
_classPrivateMethodInitSpec(this, _trimColumnsRange);
|
56
68
|
/**
|
57
69
|
* @type {CellRange}
|
58
70
|
*/
|
59
|
-
_classPrivateFieldInitSpec(this, _selectedRange,
|
71
|
+
_classPrivateFieldInitSpec(this, _selectedRange, {
|
72
|
+
writable: true,
|
73
|
+
value: void 0
|
74
|
+
});
|
60
75
|
/**
|
61
76
|
* @type {function(): number}
|
62
77
|
*/
|
63
|
-
_classPrivateFieldInitSpec(this, _countRows,
|
78
|
+
_classPrivateFieldInitSpec(this, _countRows, {
|
79
|
+
writable: true,
|
80
|
+
value: void 0
|
81
|
+
});
|
64
82
|
/**
|
65
83
|
* @type {function(): number}
|
66
84
|
*/
|
67
|
-
_classPrivateFieldInitSpec(this, _countColumns,
|
85
|
+
_classPrivateFieldInitSpec(this, _countColumns, {
|
86
|
+
writable: true,
|
87
|
+
value: void 0
|
88
|
+
});
|
68
89
|
/**
|
69
90
|
* @type {function(): number}
|
70
91
|
*/
|
71
|
-
_classPrivateFieldInitSpec(this, _rowsLimit,
|
92
|
+
_classPrivateFieldInitSpec(this, _rowsLimit, {
|
93
|
+
writable: true,
|
94
|
+
value: void 0
|
95
|
+
});
|
72
96
|
/**
|
73
97
|
* @type {function(): number}
|
74
98
|
*/
|
75
|
-
_classPrivateFieldInitSpec(this, _columnsLimit,
|
99
|
+
_classPrivateFieldInitSpec(this, _columnsLimit, {
|
100
|
+
writable: true,
|
101
|
+
value: void 0
|
102
|
+
});
|
76
103
|
/**
|
77
104
|
* @type {function(): number}
|
78
105
|
*/
|
79
|
-
_classPrivateFieldInitSpec(this, _countColumnHeaders,
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
_classPrivateFieldSet(
|
84
|
-
_classPrivateFieldSet(
|
106
|
+
_classPrivateFieldInitSpec(this, _countColumnHeaders, {
|
107
|
+
writable: true,
|
108
|
+
value: void 0
|
109
|
+
});
|
110
|
+
_classPrivateFieldSet(this, _countRows, countRows);
|
111
|
+
_classPrivateFieldSet(this, _countColumns, countColumns);
|
112
|
+
_classPrivateFieldSet(this, _rowsLimit, rowsLimit);
|
113
|
+
_classPrivateFieldSet(this, _columnsLimit, columnsLimit);
|
114
|
+
_classPrivateFieldSet(this, _countColumnHeaders, countColumnHeaders);
|
85
115
|
}
|
86
116
|
/* eslint-enable jsdoc/require-description-complete-sentence */
|
87
117
|
|
@@ -91,7 +121,7 @@ class CopyableRangesFactory {
|
|
91
121
|
* @param {CellRange} selectedRange The selection range represented by the CellRange class.
|
92
122
|
*/
|
93
123
|
setSelectedRange(selectedRange) {
|
94
|
-
_classPrivateFieldSet(
|
124
|
+
_classPrivateFieldSet(this, _selectedRange, selectedRange);
|
95
125
|
}
|
96
126
|
|
97
127
|
/**
|
@@ -101,19 +131,19 @@ class CopyableRangesFactory {
|
|
101
131
|
* @returns {{startRow: number, startCol: number, endRow: number, endCol: number} | null}
|
102
132
|
*/
|
103
133
|
getCellsRange() {
|
104
|
-
if (_classPrivateFieldGet(
|
134
|
+
if (_classPrivateFieldGet(this, _countRows).call(this) === 0 || _classPrivateFieldGet(this, _countColumns).call(this) === 0) {
|
105
135
|
return null;
|
106
136
|
}
|
107
137
|
const {
|
108
138
|
row: startRow,
|
109
139
|
col: startCol
|
110
|
-
} = _classPrivateFieldGet(
|
140
|
+
} = _classPrivateFieldGet(this, _selectedRange).getTopStartCorner();
|
111
141
|
const {
|
112
142
|
row: endRow,
|
113
143
|
col: endCol
|
114
|
-
} = _classPrivateFieldGet(
|
115
|
-
const finalEndRow =
|
116
|
-
const finalEndCol =
|
144
|
+
} = _classPrivateFieldGet(this, _selectedRange).getBottomEndCorner();
|
145
|
+
const finalEndRow = _classPrivateMethodGet(this, _trimRowsRange, _trimRowsRange2).call(this, startRow, endRow);
|
146
|
+
const finalEndCol = _classPrivateMethodGet(this, _trimColumnsRange, _trimColumnsRange2).call(this, startCol, endCol);
|
117
147
|
const isRangeTrimmed = endRow !== finalEndRow || endCol !== finalEndCol;
|
118
148
|
return {
|
119
149
|
isRangeTrimmed,
|
@@ -131,16 +161,16 @@ class CopyableRangesFactory {
|
|
131
161
|
* @returns {{startRow: number, startCol: number, endRow: number, endCol: number} | null}
|
132
162
|
*/
|
133
163
|
getMostBottomColumnHeadersRange() {
|
134
|
-
if (_classPrivateFieldGet(
|
164
|
+
if (_classPrivateFieldGet(this, _countColumns).call(this) === 0 || _classPrivateFieldGet(this, _countColumnHeaders).call(this) === 0) {
|
135
165
|
return null;
|
136
166
|
}
|
137
167
|
const {
|
138
168
|
col: startCol
|
139
|
-
} = _classPrivateFieldGet(
|
169
|
+
} = _classPrivateFieldGet(this, _selectedRange).getTopStartCorner();
|
140
170
|
const {
|
141
171
|
col: endCol
|
142
|
-
} = _classPrivateFieldGet(
|
143
|
-
const finalEndCol =
|
172
|
+
} = _classPrivateFieldGet(this, _selectedRange).getBottomEndCorner();
|
173
|
+
const finalEndCol = _classPrivateMethodGet(this, _trimColumnsRange, _trimColumnsRange2).call(this, startCol, endCol);
|
144
174
|
const isRangeTrimmed = endCol !== finalEndCol;
|
145
175
|
return {
|
146
176
|
isRangeTrimmed,
|
@@ -158,20 +188,20 @@ class CopyableRangesFactory {
|
|
158
188
|
* @returns {{startRow: number, startCol: number, endRow: number, endCol: number} | null}
|
159
189
|
*/
|
160
190
|
getAllColumnHeadersRange() {
|
161
|
-
if (_classPrivateFieldGet(
|
191
|
+
if (_classPrivateFieldGet(this, _countColumns).call(this) === 0 || _classPrivateFieldGet(this, _countColumnHeaders).call(this) === 0) {
|
162
192
|
return null;
|
163
193
|
}
|
164
194
|
const {
|
165
195
|
col: startCol
|
166
|
-
} = _classPrivateFieldGet(
|
196
|
+
} = _classPrivateFieldGet(this, _selectedRange).getTopStartCorner();
|
167
197
|
const {
|
168
198
|
col: endCol
|
169
|
-
} = _classPrivateFieldGet(
|
170
|
-
const finalEndCol =
|
199
|
+
} = _classPrivateFieldGet(this, _selectedRange).getBottomEndCorner();
|
200
|
+
const finalEndCol = _classPrivateMethodGet(this, _trimColumnsRange, _trimColumnsRange2).call(this, startCol, endCol);
|
171
201
|
const isRangeTrimmed = endCol !== finalEndCol;
|
172
202
|
return {
|
173
203
|
isRangeTrimmed,
|
174
|
-
startRow: -_classPrivateFieldGet(
|
204
|
+
startRow: -_classPrivateFieldGet(this, _countColumnHeaders).call(this),
|
175
205
|
startCol,
|
176
206
|
endRow: -1,
|
177
207
|
endCol: finalEndCol
|
@@ -187,18 +217,11 @@ class CopyableRangesFactory {
|
|
187
217
|
* @returns {{rows: number[], columns: number[]}}
|
188
218
|
*/
|
189
219
|
exports.CopyableRangesFactory = CopyableRangesFactory;
|
190
|
-
function
|
191
|
-
return Math.min(endColumn, Math.max(startColumn + _classPrivateFieldGet(
|
220
|
+
function _trimColumnsRange2(startColumn, endColumn) {
|
221
|
+
return Math.min(endColumn, Math.max(startColumn + _classPrivateFieldGet(this, _columnsLimit).call(this) - 1, startColumn));
|
192
222
|
}
|
193
|
-
|
194
|
-
|
195
|
-
*
|
196
|
-
* @param {*} startRow The lowest row index in the range.
|
197
|
-
* @param {*} endRow The highest row index in the range.
|
198
|
-
* @returns {number} Returns trimmed row index if it exceeds the limit.
|
199
|
-
*/
|
200
|
-
function _trimRowsRange(startRow, endRow) {
|
201
|
-
return Math.min(endRow, Math.max(startRow + _classPrivateFieldGet(_rowsLimit, this).call(this) - 1, startRow));
|
223
|
+
function _trimRowsRange2(startRow, endRow) {
|
224
|
+
return Math.min(endRow, Math.max(startRow + _classPrivateFieldGet(this, _rowsLimit).call(this) - 1, startRow));
|
202
225
|
}
|
203
226
|
function normalizeRanges(ranges) {
|
204
227
|
const rows = [];
|
@@ -1,11 +1,14 @@
|
|
1
|
-
import "core-js/modules/es.error.cause.js";
|
2
1
|
import "core-js/modules/es.array.push.js";
|
2
|
+
import "core-js/modules/es.error.cause.js";
|
3
3
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
4
4
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
5
5
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
6
|
-
function
|
7
|
-
function
|
8
|
-
function
|
6
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
7
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
8
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
9
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
10
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
11
|
+
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; } }
|
9
12
|
import { arrayEach } from "../../helpers/array.mjs";
|
10
13
|
import { rangeEach } from "../../helpers/number.mjs";
|
11
14
|
/**
|
@@ -21,7 +24,8 @@ var _countColumns = /*#__PURE__*/new WeakMap();
|
|
21
24
|
var _rowsLimit = /*#__PURE__*/new WeakMap();
|
22
25
|
var _columnsLimit = /*#__PURE__*/new WeakMap();
|
23
26
|
var _countColumnHeaders = /*#__PURE__*/new WeakMap();
|
24
|
-
var
|
27
|
+
var _trimColumnsRange = /*#__PURE__*/new WeakSet();
|
28
|
+
var _trimRowsRange = /*#__PURE__*/new WeakSet();
|
25
29
|
export class CopyableRangesFactory {
|
26
30
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
27
31
|
/**
|
@@ -41,6 +45,14 @@ export class CopyableRangesFactory {
|
|
41
45
|
columnsLimit,
|
42
46
|
countColumnHeaders
|
43
47
|
} = _ref;
|
48
|
+
/**
|
49
|
+
* Trimmed the rows range to the limit.
|
50
|
+
*
|
51
|
+
* @param {*} startRow The lowest row index in the range.
|
52
|
+
* @param {*} endRow The highest row index in the range.
|
53
|
+
* @returns {number} Returns trimmed row index if it exceeds the limit.
|
54
|
+
*/
|
55
|
+
_classPrivateMethodInitSpec(this, _trimRowsRange);
|
44
56
|
/**
|
45
57
|
* Trimmed the columns range to the limit.
|
46
58
|
*
|
@@ -48,36 +60,54 @@ export class CopyableRangesFactory {
|
|
48
60
|
* @param {*} endColumn The highest column index in the range.
|
49
61
|
* @returns {number} Returns trimmed column index if it exceeds the limit.
|
50
62
|
*/
|
51
|
-
_classPrivateMethodInitSpec(this,
|
63
|
+
_classPrivateMethodInitSpec(this, _trimColumnsRange);
|
52
64
|
/**
|
53
65
|
* @type {CellRange}
|
54
66
|
*/
|
55
|
-
_classPrivateFieldInitSpec(this, _selectedRange,
|
67
|
+
_classPrivateFieldInitSpec(this, _selectedRange, {
|
68
|
+
writable: true,
|
69
|
+
value: void 0
|
70
|
+
});
|
56
71
|
/**
|
57
72
|
* @type {function(): number}
|
58
73
|
*/
|
59
|
-
_classPrivateFieldInitSpec(this, _countRows,
|
74
|
+
_classPrivateFieldInitSpec(this, _countRows, {
|
75
|
+
writable: true,
|
76
|
+
value: void 0
|
77
|
+
});
|
60
78
|
/**
|
61
79
|
* @type {function(): number}
|
62
80
|
*/
|
63
|
-
_classPrivateFieldInitSpec(this, _countColumns,
|
81
|
+
_classPrivateFieldInitSpec(this, _countColumns, {
|
82
|
+
writable: true,
|
83
|
+
value: void 0
|
84
|
+
});
|
64
85
|
/**
|
65
86
|
* @type {function(): number}
|
66
87
|
*/
|
67
|
-
_classPrivateFieldInitSpec(this, _rowsLimit,
|
88
|
+
_classPrivateFieldInitSpec(this, _rowsLimit, {
|
89
|
+
writable: true,
|
90
|
+
value: void 0
|
91
|
+
});
|
68
92
|
/**
|
69
93
|
* @type {function(): number}
|
70
94
|
*/
|
71
|
-
_classPrivateFieldInitSpec(this, _columnsLimit,
|
95
|
+
_classPrivateFieldInitSpec(this, _columnsLimit, {
|
96
|
+
writable: true,
|
97
|
+
value: void 0
|
98
|
+
});
|
72
99
|
/**
|
73
100
|
* @type {function(): number}
|
74
101
|
*/
|
75
|
-
_classPrivateFieldInitSpec(this, _countColumnHeaders,
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
_classPrivateFieldSet(
|
80
|
-
_classPrivateFieldSet(
|
102
|
+
_classPrivateFieldInitSpec(this, _countColumnHeaders, {
|
103
|
+
writable: true,
|
104
|
+
value: void 0
|
105
|
+
});
|
106
|
+
_classPrivateFieldSet(this, _countRows, countRows);
|
107
|
+
_classPrivateFieldSet(this, _countColumns, countColumns);
|
108
|
+
_classPrivateFieldSet(this, _rowsLimit, rowsLimit);
|
109
|
+
_classPrivateFieldSet(this, _columnsLimit, columnsLimit);
|
110
|
+
_classPrivateFieldSet(this, _countColumnHeaders, countColumnHeaders);
|
81
111
|
}
|
82
112
|
/* eslint-enable jsdoc/require-description-complete-sentence */
|
83
113
|
|
@@ -87,7 +117,7 @@ export class CopyableRangesFactory {
|
|
87
117
|
* @param {CellRange} selectedRange The selection range represented by the CellRange class.
|
88
118
|
*/
|
89
119
|
setSelectedRange(selectedRange) {
|
90
|
-
_classPrivateFieldSet(
|
120
|
+
_classPrivateFieldSet(this, _selectedRange, selectedRange);
|
91
121
|
}
|
92
122
|
|
93
123
|
/**
|
@@ -97,19 +127,19 @@ export class CopyableRangesFactory {
|
|
97
127
|
* @returns {{startRow: number, startCol: number, endRow: number, endCol: number} | null}
|
98
128
|
*/
|
99
129
|
getCellsRange() {
|
100
|
-
if (_classPrivateFieldGet(
|
130
|
+
if (_classPrivateFieldGet(this, _countRows).call(this) === 0 || _classPrivateFieldGet(this, _countColumns).call(this) === 0) {
|
101
131
|
return null;
|
102
132
|
}
|
103
133
|
const {
|
104
134
|
row: startRow,
|
105
135
|
col: startCol
|
106
|
-
} = _classPrivateFieldGet(
|
136
|
+
} = _classPrivateFieldGet(this, _selectedRange).getTopStartCorner();
|
107
137
|
const {
|
108
138
|
row: endRow,
|
109
139
|
col: endCol
|
110
|
-
} = _classPrivateFieldGet(
|
111
|
-
const finalEndRow =
|
112
|
-
const finalEndCol =
|
140
|
+
} = _classPrivateFieldGet(this, _selectedRange).getBottomEndCorner();
|
141
|
+
const finalEndRow = _classPrivateMethodGet(this, _trimRowsRange, _trimRowsRange2).call(this, startRow, endRow);
|
142
|
+
const finalEndCol = _classPrivateMethodGet(this, _trimColumnsRange, _trimColumnsRange2).call(this, startCol, endCol);
|
113
143
|
const isRangeTrimmed = endRow !== finalEndRow || endCol !== finalEndCol;
|
114
144
|
return {
|
115
145
|
isRangeTrimmed,
|
@@ -127,16 +157,16 @@ export class CopyableRangesFactory {
|
|
127
157
|
* @returns {{startRow: number, startCol: number, endRow: number, endCol: number} | null}
|
128
158
|
*/
|
129
159
|
getMostBottomColumnHeadersRange() {
|
130
|
-
if (_classPrivateFieldGet(
|
160
|
+
if (_classPrivateFieldGet(this, _countColumns).call(this) === 0 || _classPrivateFieldGet(this, _countColumnHeaders).call(this) === 0) {
|
131
161
|
return null;
|
132
162
|
}
|
133
163
|
const {
|
134
164
|
col: startCol
|
135
|
-
} = _classPrivateFieldGet(
|
165
|
+
} = _classPrivateFieldGet(this, _selectedRange).getTopStartCorner();
|
136
166
|
const {
|
137
167
|
col: endCol
|
138
|
-
} = _classPrivateFieldGet(
|
139
|
-
const finalEndCol =
|
168
|
+
} = _classPrivateFieldGet(this, _selectedRange).getBottomEndCorner();
|
169
|
+
const finalEndCol = _classPrivateMethodGet(this, _trimColumnsRange, _trimColumnsRange2).call(this, startCol, endCol);
|
140
170
|
const isRangeTrimmed = endCol !== finalEndCol;
|
141
171
|
return {
|
142
172
|
isRangeTrimmed,
|
@@ -154,20 +184,20 @@ export class CopyableRangesFactory {
|
|
154
184
|
* @returns {{startRow: number, startCol: number, endRow: number, endCol: number} | null}
|
155
185
|
*/
|
156
186
|
getAllColumnHeadersRange() {
|
157
|
-
if (_classPrivateFieldGet(
|
187
|
+
if (_classPrivateFieldGet(this, _countColumns).call(this) === 0 || _classPrivateFieldGet(this, _countColumnHeaders).call(this) === 0) {
|
158
188
|
return null;
|
159
189
|
}
|
160
190
|
const {
|
161
191
|
col: startCol
|
162
|
-
} = _classPrivateFieldGet(
|
192
|
+
} = _classPrivateFieldGet(this, _selectedRange).getTopStartCorner();
|
163
193
|
const {
|
164
194
|
col: endCol
|
165
|
-
} = _classPrivateFieldGet(
|
166
|
-
const finalEndCol =
|
195
|
+
} = _classPrivateFieldGet(this, _selectedRange).getBottomEndCorner();
|
196
|
+
const finalEndCol = _classPrivateMethodGet(this, _trimColumnsRange, _trimColumnsRange2).call(this, startCol, endCol);
|
167
197
|
const isRangeTrimmed = endCol !== finalEndCol;
|
168
198
|
return {
|
169
199
|
isRangeTrimmed,
|
170
|
-
startRow: -_classPrivateFieldGet(
|
200
|
+
startRow: -_classPrivateFieldGet(this, _countColumnHeaders).call(this),
|
171
201
|
startCol,
|
172
202
|
endRow: -1,
|
173
203
|
endCol: finalEndCol
|
@@ -182,18 +212,11 @@ export class CopyableRangesFactory {
|
|
182
212
|
* @param {Array<{startRow: number, startCol: number, endRow: number, endCol: number}>} ranges The range to process.
|
183
213
|
* @returns {{rows: number[], columns: number[]}}
|
184
214
|
*/
|
185
|
-
function
|
186
|
-
return Math.min(endColumn, Math.max(startColumn + _classPrivateFieldGet(
|
215
|
+
function _trimColumnsRange2(startColumn, endColumn) {
|
216
|
+
return Math.min(endColumn, Math.max(startColumn + _classPrivateFieldGet(this, _columnsLimit).call(this) - 1, startColumn));
|
187
217
|
}
|
188
|
-
|
189
|
-
|
190
|
-
*
|
191
|
-
* @param {*} startRow The lowest row index in the range.
|
192
|
-
* @param {*} endRow The highest row index in the range.
|
193
|
-
* @returns {number} Returns trimmed row index if it exceeds the limit.
|
194
|
-
*/
|
195
|
-
function _trimRowsRange(startRow, endRow) {
|
196
|
-
return Math.min(endRow, Math.max(startRow + _classPrivateFieldGet(_rowsLimit, this).call(this) - 1, startRow));
|
218
|
+
function _trimRowsRange2(startRow, endRow) {
|
219
|
+
return Math.min(endRow, Math.max(startRow + _classPrivateFieldGet(this, _rowsLimit).call(this) - 1, startRow));
|
197
220
|
}
|
198
221
|
export function normalizeRanges(ranges) {
|
199
222
|
const rows = [];
|
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
5
4
|
require("core-js/modules/es.array.push.js");
|
5
|
+
require("core-js/modules/es.error.cause.js");
|
6
6
|
var _base = require("../base");
|
7
7
|
var _object = require("../../helpers/object");
|
8
8
|
var _number = require("../../helpers/number");
|
@@ -18,7 +18,7 @@ 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
|
21
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
22
22
|
const PLUGIN_KEY = exports.PLUGIN_KEY = 'customBorders';
|
23
23
|
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 90;
|
24
24
|
|
@@ -77,16 +77,21 @@ const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 90;
|
|
77
77
|
* ],
|
78
78
|
* ```
|
79
79
|
*/
|
80
|
-
var
|
80
|
+
var _onAfterContextMenuDefaultOptions = /*#__PURE__*/new WeakSet();
|
81
|
+
var _onAfterInit = /*#__PURE__*/new WeakSet();
|
81
82
|
class CustomBorders extends _base.BasePlugin {
|
82
83
|
constructor() {
|
83
84
|
super(...arguments);
|
85
|
+
/**
|
86
|
+
* `afterInit` hook callback.
|
87
|
+
*/
|
88
|
+
_classPrivateMethodInitSpec(this, _onAfterInit);
|
84
89
|
/**
|
85
90
|
* Add border options to context menu.
|
86
91
|
*
|
87
92
|
* @param {object} defaultOptions Context menu items.
|
88
93
|
*/
|
89
|
-
_classPrivateMethodInitSpec(this,
|
94
|
+
_classPrivateMethodInitSpec(this, _onAfterContextMenuDefaultOptions);
|
90
95
|
/**
|
91
96
|
* Saved borders.
|
92
97
|
*
|
@@ -118,8 +123,8 @@ class CustomBorders extends _base.BasePlugin {
|
|
118
123
|
if (this.enabled) {
|
119
124
|
return;
|
120
125
|
}
|
121
|
-
this.addHook('afterContextMenuDefaultOptions', options =>
|
122
|
-
this.addHook('init', () =>
|
126
|
+
this.addHook('afterContextMenuDefaultOptions', options => _classPrivateMethodGet(this, _onAfterContextMenuDefaultOptions, _onAfterContextMenuDefaultOptions2).call(this, options));
|
127
|
+
this.addHook('init', () => _classPrivateMethodGet(this, _onAfterInit, _onAfterInit2).call(this));
|
123
128
|
super.enablePlugin();
|
124
129
|
}
|
125
130
|
|
@@ -710,7 +715,7 @@ class CustomBorders extends _base.BasePlugin {
|
|
710
715
|
}
|
711
716
|
}
|
712
717
|
exports.CustomBorders = CustomBorders;
|
713
|
-
function
|
718
|
+
function _onAfterContextMenuDefaultOptions2(defaultOptions) {
|
714
719
|
if (!this.hot.getSettings()[PLUGIN_KEY]) {
|
715
720
|
return;
|
716
721
|
}
|
@@ -736,9 +741,6 @@ function _onAfterContextMenuDefaultOptions(defaultOptions) {
|
|
736
741
|
}
|
737
742
|
});
|
738
743
|
}
|
739
|
-
|
740
|
-
* `afterInit` hook callback.
|
741
|
-
*/
|
742
|
-
function _onAfterInit() {
|
744
|
+
function _onAfterInit2() {
|
743
745
|
this.changeBorderSettings();
|
744
746
|
}
|
@@ -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 { hasOwnProperty, deepClone } from "../../helpers/object.mjs";
|
11
11
|
import { rangeEach } from "../../helpers/number.mjs";
|
@@ -72,16 +72,21 @@ export const PLUGIN_PRIORITY = 90;
|
|
72
72
|
* ],
|
73
73
|
* ```
|
74
74
|
*/
|
75
|
-
var
|
75
|
+
var _onAfterContextMenuDefaultOptions = /*#__PURE__*/new WeakSet();
|
76
|
+
var _onAfterInit = /*#__PURE__*/new WeakSet();
|
76
77
|
export class CustomBorders extends BasePlugin {
|
77
78
|
constructor() {
|
78
79
|
super(...arguments);
|
80
|
+
/**
|
81
|
+
* `afterInit` hook callback.
|
82
|
+
*/
|
83
|
+
_classPrivateMethodInitSpec(this, _onAfterInit);
|
79
84
|
/**
|
80
85
|
* Add border options to context menu.
|
81
86
|
*
|
82
87
|
* @param {object} defaultOptions Context menu items.
|
83
88
|
*/
|
84
|
-
_classPrivateMethodInitSpec(this,
|
89
|
+
_classPrivateMethodInitSpec(this, _onAfterContextMenuDefaultOptions);
|
85
90
|
/**
|
86
91
|
* Saved borders.
|
87
92
|
*
|
@@ -113,8 +118,8 @@ export class CustomBorders extends BasePlugin {
|
|
113
118
|
if (this.enabled) {
|
114
119
|
return;
|
115
120
|
}
|
116
|
-
this.addHook('afterContextMenuDefaultOptions', options =>
|
117
|
-
this.addHook('init', () =>
|
121
|
+
this.addHook('afterContextMenuDefaultOptions', options => _classPrivateMethodGet(this, _onAfterContextMenuDefaultOptions, _onAfterContextMenuDefaultOptions2).call(this, options));
|
122
|
+
this.addHook('init', () => _classPrivateMethodGet(this, _onAfterInit, _onAfterInit2).call(this));
|
118
123
|
super.enablePlugin();
|
119
124
|
}
|
120
125
|
|
@@ -704,7 +709,7 @@ export class CustomBorders extends BasePlugin {
|
|
704
709
|
super.destroy();
|
705
710
|
}
|
706
711
|
}
|
707
|
-
function
|
712
|
+
function _onAfterContextMenuDefaultOptions2(defaultOptions) {
|
708
713
|
if (!this.hot.getSettings()[PLUGIN_KEY]) {
|
709
714
|
return;
|
710
715
|
}
|
@@ -730,9 +735,6 @@ function _onAfterContextMenuDefaultOptions(defaultOptions) {
|
|
730
735
|
}
|
731
736
|
});
|
732
737
|
}
|
733
|
-
|
734
|
-
* `afterInit` hook callback.
|
735
|
-
*/
|
736
|
-
function _onAfterInit() {
|
738
|
+
function _onAfterInit2() {
|
737
739
|
this.changeBorderSettings();
|
738
740
|
}
|
@@ -10,7 +10,7 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
10
10
|
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; }
|
11
11
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
12
12
|
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); }
|
13
|
-
function
|
13
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
14
14
|
const PLUGIN_KEY = exports.PLUGIN_KEY = 'dragToScroll';
|
15
15
|
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 100;
|
16
16
|
|
@@ -24,7 +24,7 @@ const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 100;
|
|
24
24
|
* @class DragToScroll
|
25
25
|
* @plugin DragToScroll
|
26
26
|
*/
|
27
|
-
var
|
27
|
+
var _setupListening = /*#__PURE__*/new WeakSet();
|
28
28
|
class DragToScroll extends _base.BasePlugin {
|
29
29
|
constructor() {
|
30
30
|
super(...arguments);
|
@@ -33,7 +33,7 @@ class DragToScroll extends _base.BasePlugin {
|
|
33
33
|
*
|
34
34
|
* @param {MouseEvent} event The mouse event object.
|
35
35
|
*/
|
36
|
-
_classPrivateMethodInitSpec(this,
|
36
|
+
_classPrivateMethodInitSpec(this, _setupListening);
|
37
37
|
/**
|
38
38
|
* Size of an element and its position relative to the viewport,
|
39
39
|
* e.g. {bottom: 449, height: 441, left: 8, right: 814, top: 8, width: 806, x: 8, y:8}.
|
@@ -79,8 +79,8 @@ class DragToScroll extends _base.BasePlugin {
|
|
79
79
|
if (this.enabled) {
|
80
80
|
return;
|
81
81
|
}
|
82
|
-
this.addHook('afterOnCellMouseDown', event =>
|
83
|
-
this.addHook('afterOnCellCornerMouseDown', event =>
|
82
|
+
this.addHook('afterOnCellMouseDown', event => _classPrivateMethodGet(this, _setupListening, _setupListening2).call(this, event));
|
83
|
+
this.addHook('afterOnCellCornerMouseDown', event => _classPrivateMethodGet(this, _setupListening, _setupListening2).call(this, event));
|
84
84
|
this.registerEvents();
|
85
85
|
super.enablePlugin();
|
86
86
|
}
|
@@ -232,7 +232,7 @@ class DragToScroll extends _base.BasePlugin {
|
|
232
232
|
}
|
233
233
|
}
|
234
234
|
exports.DragToScroll = DragToScroll;
|
235
|
-
function
|
235
|
+
function _setupListening2(event) {
|
236
236
|
if ((0, _event.isRightClick)(event)) {
|
237
237
|
return;
|
238
238
|
}
|