handsontable 0.0.0-next-200799f-20240311 → 0.0.0-next-bff5041-20240315
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 +12 -17
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +12 -17
- package/3rdparty/walkontable/src/calculator/viewportRows.js +10 -15
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +10 -15
- package/3rdparty/walkontable/src/cell/coords.js +12 -17
- package/3rdparty/walkontable/src/cell/coords.mjs +12 -17
- package/3rdparty/walkontable/src/cell/range.d.ts +0 -1
- package/3rdparty/walkontable/src/cell/range.js +23 -45
- package/3rdparty/walkontable/src/cell/range.mjs +23 -45
- package/3rdparty/walkontable/src/core/_base.js +1 -1
- package/3rdparty/walkontable/src/core/_base.mjs +1 -1
- package/3rdparty/walkontable/src/event.js +72 -104
- package/3rdparty/walkontable/src/event.mjs +72 -104
- package/3rdparty/walkontable/src/overlays.js +1 -1
- package/3rdparty/walkontable/src/overlays.mjs +1 -1
- package/3rdparty/walkontable/src/scroll.js +15 -17
- package/3rdparty/walkontable/src/scroll.mjs +15 -17
- package/3rdparty/walkontable/src/selection/manager.js +48 -69
- package/3rdparty/walkontable/src/selection/manager.mjs +48 -69
- package/3rdparty/walkontable/src/selection/scanner.js +33 -42
- package/3rdparty/walkontable/src/selection/scanner.mjs +33 -42
- package/3rdparty/walkontable/src/utils/columnStretching.js +27 -44
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +27 -44
- 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 -79
- package/core.mjs +22 -79
- 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/replaceData.js +1 -1
- package/dataMap/replaceData.mjs +1 -1
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +7620 -10327
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +277 -277
- package/dist/handsontable.js +5525 -7779
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +33 -33
- 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 +21 -27
- package/editorManager.mjs +21 -27
- package/editors/autocompleteEditor/autocompleteEditor.js +6 -10
- package/editors/autocompleteEditor/autocompleteEditor.mjs +6 -10
- package/eventManager.js +1 -1
- package/eventManager.mjs +1 -1
- package/focusManager.js +58 -82
- package/focusManager.mjs +58 -82
- 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 +10 -0
- package/package.json +2 -1
- package/pluginHooks.d.ts +0 -4
- package/pluginHooks.js +2 -44
- package/pluginHooks.mjs +2 -44
- package/plugins/autoColumnSize/autoColumnSize.js +49 -65
- package/plugins/autoColumnSize/autoColumnSize.mjs +49 -65
- package/plugins/autoRowSize/autoRowSize.js +28 -34
- package/plugins/autoRowSize/autoRowSize.mjs +28 -34
- package/plugins/autofill/autofill.js +30 -38
- package/plugins/autofill/autofill.mjs +30 -38
- package/plugins/base/base.js +12 -17
- package/plugins/base/base.mjs +12 -17
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
- package/plugins/collapsibleColumns/collapsibleColumns.js +36 -54
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +36 -54
- package/plugins/columnSorting/columnSorting.js +40 -46
- package/plugins/columnSorting/columnSorting.mjs +40 -46
- package/plugins/columnSummary/columnSummary.js +22 -26
- package/plugins/columnSummary/columnSummary.mjs +22 -26
- package/plugins/comments/comments.js +116 -158
- package/plugins/comments/comments.mjs +116 -158
- package/plugins/contextMenu/contextMenu.js +20 -26
- package/plugins/contextMenu/contextMenu.mjs +20 -26
- 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 +13 -21
- package/plugins/contextMenu/menu/menu.mjs +13 -21
- package/plugins/contextMenu/menu/positioner.js +41 -58
- package/plugins/contextMenu/menu/positioner.mjs +41 -58
- package/plugins/copyPaste/copyPaste.js +113 -154
- package/plugins/copyPaste/copyPaste.mjs +113 -154
- package/plugins/copyPaste/copyableRanges.js +43 -66
- package/plugins/copyPaste/copyableRanges.mjs +43 -66
- package/plugins/customBorders/customBorders.js +11 -13
- package/plugins/customBorders/customBorders.mjs +11 -13
- package/plugins/dragToScroll/dragToScroll.js +6 -6
- package/plugins/dragToScroll/dragToScroll.mjs +6 -6
- package/plugins/dropdownMenu/dropdownMenu.js +78 -100
- package/plugins/dropdownMenu/dropdownMenu.mjs +78 -100
- 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 +13 -15
- package/plugins/filters/component/condition.mjs +13 -15
- package/plugins/filters/component/operators.js +6 -6
- package/plugins/filters/component/operators.mjs +6 -6
- package/plugins/filters/component/value.js +24 -28
- package/plugins/filters/component/value.mjs +24 -28
- package/plugins/filters/conditionUpdateObserver.js +22 -24
- package/plugins/filters/conditionUpdateObserver.mjs +22 -24
- package/plugins/filters/dataFilter.js +1 -1
- package/plugins/filters/dataFilter.mjs +1 -1
- package/plugins/filters/filters.js +81 -95
- package/plugins/filters/filters.mjs +81 -95
- package/plugins/filters/ui/input.js +13 -19
- package/plugins/filters/ui/input.mjs +13 -19
- package/plugins/filters/ui/link.js +8 -13
- package/plugins/filters/ui/link.mjs +8 -13
- package/plugins/filters/ui/multipleSelect.js +85 -112
- package/plugins/filters/ui/multipleSelect.mjs +85 -112
- package/plugins/filters/ui/radioInput.js +12 -20
- package/plugins/filters/ui/radioInput.mjs +12 -20
- package/plugins/filters/ui/select.js +50 -72
- package/plugins/filters/ui/select.mjs +49 -71
- package/plugins/formulas/formulas.js +268 -326
- package/plugins/formulas/formulas.mjs +269 -327
- package/plugins/formulas/indexSyncer/axisSyncer.js +38 -61
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +38 -61
- package/plugins/formulas/indexSyncer/index.js +25 -48
- package/plugins/formulas/indexSyncer/index.mjs +25 -48
- package/plugins/hiddenColumns/hiddenColumns.js +64 -83
- package/plugins/hiddenColumns/hiddenColumns.mjs +64 -83
- package/plugins/hiddenRows/hiddenRows.js +63 -82
- package/plugins/hiddenRows/hiddenRows.mjs +63 -82
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +24 -32
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +25 -33
- package/plugins/manualColumnMove/manualColumnMove.js +126 -170
- package/plugins/manualColumnMove/manualColumnMove.mjs +126 -170
- package/plugins/manualColumnResize/manualColumnResize.js +169 -230
- package/plugins/manualColumnResize/manualColumnResize.mjs +169 -230
- package/plugins/manualRowMove/manualRowMove.js +99 -128
- package/plugins/manualRowMove/manualRowMove.mjs +99 -128
- package/plugins/manualRowResize/manualRowResize.js +150 -209
- package/plugins/manualRowResize/manualRowResize.mjs +150 -209
- 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 +355 -595
- package/plugins/mergeCells/mergeCells.mjs +355 -595
- package/plugins/multiColumnSorting/multiColumnSorting.js +0 -6
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +0 -6
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
- package/plugins/nestedHeaders/nestedHeaders.js +204 -254
- package/plugins/nestedHeaders/nestedHeaders.mjs +205 -255
- package/plugins/nestedHeaders/stateManager/headersTree.js +21 -32
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +21 -32
- package/plugins/nestedHeaders/stateManager/index.js +30 -41
- package/plugins/nestedHeaders/stateManager/index.mjs +30 -41
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +19 -30
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +19 -30
- package/plugins/nestedRows/data/dataManager.js +1 -1
- package/plugins/nestedRows/data/dataManager.mjs +1 -1
- package/plugins/nestedRows/nestedRows.js +138 -179
- package/plugins/nestedRows/nestedRows.mjs +139 -180
- package/plugins/nestedRows/ui/contextMenu.js +11 -15
- package/plugins/nestedRows/ui/contextMenu.mjs +10 -14
- 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 +15 -19
- package/plugins/touchScroll/touchScroll.mjs +16 -20
- package/plugins/trimRows/trimRows.js +6 -6
- package/plugins/trimRows/trimRows.mjs +6 -6
- package/renderers/checkboxRenderer/checkboxRenderer.js +4 -4
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +4 -4
- package/selection/highlight/highlight.js +14 -14
- package/selection/highlight/highlight.mjs +13 -13
- package/selection/highlight/visualSelection.js +2 -16
- package/selection/highlight/visualSelection.mjs +2 -16
- package/selection/selection.js +60 -252
- package/selection/selection.mjs +59 -251
- package/selection/transformation.js +101 -175
- package/selection/transformation.mjs +101 -175
- 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 +2 -2
- package/shortcutContexts/grid.mjs +2 -2
- package/shortcuts/context.js +1 -2
- package/shortcuts/context.mjs +1 -2
- package/tableView.js +52 -98
- package/tableView.mjs +52 -98
- package/translations/changesObservable/observable.js +21 -38
- package/translations/changesObservable/observable.mjs +21 -38
- package/translations/changesObservable/observer.js +7 -12
- package/translations/changesObservable/observer.mjs +6 -11
- 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 +26 -44
- package/utils/interval.mjs +26 -44
- package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
- package/plugins/mergeCells/focusOrder.js +0 -258
- package/plugins/mergeCells/focusOrder.mjs +0 -253
@@ -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 _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
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 _BindRowsWithHeaders_brand = /*#__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, _BindRowsWithHeaders_brand);
|
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 => _assertClassBrand(_BindRowsWithHeaders_brand, this, _onModifyRowHeader).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 _onModifyRowHeader(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,12 +16,9 @@ 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
|
23
|
-
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
24
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
25
|
-
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; } }
|
19
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
20
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
21
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
26
22
|
const PLUGIN_KEY = exports.PLUGIN_KEY = 'collapsibleColumns';
|
27
23
|
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 290;
|
28
24
|
const SETTING_KEYS = ['nestedHeaders'];
|
@@ -110,32 +106,10 @@ const actionDictionary = new Map([['collapse', {
|
|
110
106
|
* :::
|
111
107
|
*/
|
112
108
|
var _collapsedColumnsMap = /*#__PURE__*/new WeakMap();
|
113
|
-
var
|
114
|
-
var _onBeforeOnCellMouseDown = /*#__PURE__*/new WeakSet();
|
115
|
-
var _onInit = /*#__PURE__*/new WeakSet();
|
116
|
-
var _onAfterLoadData = /*#__PURE__*/new WeakSet();
|
109
|
+
var _CollapsibleColumns_brand = /*#__PURE__*/new WeakSet();
|
117
110
|
class CollapsibleColumns extends _base.BasePlugin {
|
118
111
|
constructor() {
|
119
112
|
super(...arguments);
|
120
|
-
/**
|
121
|
-
* Updates the plugin state after new dataset load.
|
122
|
-
*
|
123
|
-
* @param {Array[]} sourceData Array of arrays or array of objects containing data.
|
124
|
-
* @param {boolean} initialLoad Flag that determines whether the data has been loaded
|
125
|
-
* during the initialization.
|
126
|
-
*/
|
127
|
-
_classPrivateMethodInitSpec(this, _onAfterLoadData);
|
128
|
-
/**
|
129
|
-
* Updates the plugin state after HoT initialization.
|
130
|
-
*/
|
131
|
-
_classPrivateMethodInitSpec(this, _onInit);
|
132
|
-
/**
|
133
|
-
* Indicator mouse event callback.
|
134
|
-
*
|
135
|
-
* @param {object} event Mouse event.
|
136
|
-
* @param {object} coords Event coordinates.
|
137
|
-
*/
|
138
|
-
_classPrivateMethodInitSpec(this, _onBeforeOnCellMouseDown);
|
139
113
|
/**
|
140
114
|
* Adds the indicator to the headers.
|
141
115
|
*
|
@@ -144,7 +118,7 @@ class CollapsibleColumns extends _base.BasePlugin {
|
|
144
118
|
* @param {number} headerLevel The index of header level counting from the top (positive
|
145
119
|
* values counting from 0 to N).
|
146
120
|
*/
|
147
|
-
_classPrivateMethodInitSpec(this,
|
121
|
+
_classPrivateMethodInitSpec(this, _CollapsibleColumns_brand);
|
148
122
|
/**
|
149
123
|
* Cached reference to the NestedHeaders plugin.
|
150
124
|
*
|
@@ -165,10 +139,7 @@ class CollapsibleColumns extends _base.BasePlugin {
|
|
165
139
|
* @private
|
166
140
|
* @type {HidingMap|null}
|
167
141
|
*/
|
168
|
-
_classPrivateFieldInitSpec(this, _collapsedColumnsMap,
|
169
|
-
writable: true,
|
170
|
-
value: null
|
171
|
-
});
|
142
|
+
_classPrivateFieldInitSpec(this, _collapsedColumnsMap, null);
|
172
143
|
}
|
173
144
|
static get PLUGIN_KEY() {
|
174
145
|
return PLUGIN_KEY;
|
@@ -206,23 +177,23 @@ class CollapsibleColumns extends _base.BasePlugin {
|
|
206
177
|
if (!nestedHeaders) {
|
207
178
|
(0, _console.warn)('You need to configure the Nested Headers plugin in order to use collapsible headers.');
|
208
179
|
}
|
209
|
-
_classPrivateFieldSet(
|
180
|
+
_classPrivateFieldSet(_collapsedColumnsMap, this, this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName, 'hiding'));
|
210
181
|
this.nestedHeadersPlugin = this.hot.getPlugin('nestedHeaders');
|
211
182
|
this.headerStateManager = this.nestedHeadersPlugin.getStateManager();
|
212
|
-
this.addHook('init', () =>
|
183
|
+
this.addHook('init', () => _assertClassBrand(_CollapsibleColumns_brand, this, _onInit).call(this));
|
213
184
|
this.addHook('afterLoadData', function () {
|
214
185
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
215
186
|
args[_key] = arguments[_key];
|
216
187
|
}
|
217
|
-
return
|
188
|
+
return _assertClassBrand(_CollapsibleColumns_brand, _this, _onAfterLoadData).call(_this, ...args);
|
218
189
|
});
|
219
190
|
this.addHook('afterGetColHeader', function () {
|
220
191
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
221
192
|
args[_key2] = arguments[_key2];
|
222
193
|
}
|
223
|
-
return
|
194
|
+
return _assertClassBrand(_CollapsibleColumns_brand, _this, _onAfterGetColHeader).call(_this, ...args);
|
224
195
|
});
|
225
|
-
this.addHook('beforeOnCellMouseDown', (event, coords, TD) =>
|
196
|
+
this.addHook('beforeOnCellMouseDown', (event, coords, TD) => _assertClassBrand(_CollapsibleColumns_brand, this, _onBeforeOnCellMouseDown).call(this, event, coords, TD));
|
226
197
|
this.registerShortcuts();
|
227
198
|
super.enablePlugin();
|
228
199
|
// @TODO: Workaround for broken plugin initialization abstraction (#6806).
|
@@ -269,7 +240,7 @@ class CollapsibleColumns extends _base.BasePlugin {
|
|
269
240
|
*/
|
270
241
|
disablePlugin() {
|
271
242
|
this.hot.columnIndexMapper.unregisterMap(this.pluginName);
|
272
|
-
_classPrivateFieldSet(
|
243
|
+
_classPrivateFieldSet(_collapsedColumnsMap, this, null);
|
273
244
|
this.nestedHeadersPlugin = null;
|
274
245
|
this.unregisterShortcuts();
|
275
246
|
this.clearButtons();
|
@@ -309,17 +280,12 @@ class CollapsibleColumns extends _base.BasePlugin {
|
|
309
280
|
col: columnIndex
|
310
281
|
});
|
311
282
|
}
|
312
|
-
|
313
|
-
// prevent default Enter behavior (move to the next row within a selection range)
|
314
|
-
return false;
|
315
283
|
},
|
316
284
|
runOnlyIf: () => {
|
317
285
|
var _this$hot$getSelected;
|
318
286
|
return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
|
319
287
|
},
|
320
|
-
group: SHORTCUTS_GROUP
|
321
|
-
relativeToGroup: _shortcutContexts.EDITOR_EDIT_GROUP,
|
322
|
-
position: 'before'
|
288
|
+
group: SHORTCUTS_GROUP
|
323
289
|
});
|
324
290
|
}
|
325
291
|
|
@@ -503,7 +469,7 @@ class CollapsibleColumns extends _base.BasePlugin {
|
|
503
469
|
}
|
504
470
|
this.hot.batchExecution(() => {
|
505
471
|
(0, _array.arrayEach)(affectedColumnsIndexes, visualColumn => {
|
506
|
-
_classPrivateFieldGet(
|
472
|
+
_classPrivateFieldGet(_collapsedColumnsMap, this).setValueAtIndex(this.hot.toPhysicalColumn(visualColumn), actionTranslator.hideColumn);
|
507
473
|
});
|
508
474
|
}, true);
|
509
475
|
const isActionPerformed = this.getCollapsedColumns().length !== currentCollapsedColumns.length;
|
@@ -519,18 +485,18 @@ class CollapsibleColumns extends _base.BasePlugin {
|
|
519
485
|
* @returns {number[]}
|
520
486
|
*/
|
521
487
|
getCollapsedColumns() {
|
522
|
-
return _classPrivateFieldGet(
|
488
|
+
return _classPrivateFieldGet(_collapsedColumnsMap, this).getHiddenIndexes();
|
523
489
|
}
|
524
490
|
/**
|
525
491
|
* Destroys the plugin instance.
|
526
492
|
*/
|
527
493
|
destroy() {
|
528
|
-
_classPrivateFieldSet(
|
494
|
+
_classPrivateFieldSet(_collapsedColumnsMap, this, null);
|
529
495
|
super.destroy();
|
530
496
|
}
|
531
497
|
}
|
532
498
|
exports.CollapsibleColumns = CollapsibleColumns;
|
533
|
-
function
|
499
|
+
function _onAfterGetColHeader(column, TH, headerLevel) {
|
534
500
|
var _this$headerStateMana3;
|
535
501
|
const {
|
536
502
|
collapsible,
|
@@ -573,7 +539,13 @@ function _onAfterGetColHeader2(column, TH, headerLevel) {
|
|
573
539
|
(_collapsibleElement = collapsibleElement) === null || _collapsibleElement === void 0 || _collapsibleElement.remove();
|
574
540
|
}
|
575
541
|
}
|
576
|
-
|
542
|
+
/**
|
543
|
+
* Indicator mouse event callback.
|
544
|
+
*
|
545
|
+
* @param {object} event Mouse event.
|
546
|
+
* @param {object} coords Event coordinates.
|
547
|
+
*/
|
548
|
+
function _onBeforeOnCellMouseDown(event, coords) {
|
577
549
|
if ((0, _element.hasClass)(event.target, COLLAPSIBLE_ELEMENT_CLASS)) {
|
578
550
|
if ((0, _element.hasClass)(event.target, 'expanded')) {
|
579
551
|
this.eventManager.fireEvent(event.target, 'mouseup');
|
@@ -585,11 +557,21 @@ function _onBeforeOnCellMouseDown2(event, coords) {
|
|
585
557
|
(0, _event.stopImmediatePropagation)(event);
|
586
558
|
}
|
587
559
|
}
|
588
|
-
|
560
|
+
/**
|
561
|
+
* Updates the plugin state after HoT initialization.
|
562
|
+
*/
|
563
|
+
function _onInit() {
|
589
564
|
// @TODO: Workaround for broken plugin initialization abstraction (#6806).
|
590
565
|
this.updatePlugin();
|
591
566
|
}
|
592
|
-
|
567
|
+
/**
|
568
|
+
* Updates the plugin state after new dataset load.
|
569
|
+
*
|
570
|
+
* @param {Array[]} sourceData Array of arrays or array of objects containing data.
|
571
|
+
* @param {boolean} initialLoad Flag that determines whether the data has been loaded
|
572
|
+
* during the initialization.
|
573
|
+
*/
|
574
|
+
function _onAfterLoadData(sourceData, initialLoad) {
|
593
575
|
if (!initialLoad) {
|
594
576
|
this.updatePlugin();
|
595
577
|
}
|
@@ -6,19 +6,15 @@ 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 _classPrivateFieldGet(
|
10
|
-
function
|
11
|
-
function
|
12
|
-
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
13
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
14
|
-
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
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
10
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
11
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
15
12
|
import { BasePlugin } from "../base/index.mjs";
|
16
13
|
import { arrayEach, arrayFilter, arrayUnique } from "../../helpers/array.mjs";
|
17
14
|
import { rangeEach } from "../../helpers/number.mjs";
|
18
15
|
import { warn } from "../../helpers/console.mjs";
|
19
16
|
import { addClass, hasClass, removeClass, fastInnerText, removeAttribute, setAttribute } from "../../helpers/dom/element.mjs";
|
20
17
|
import { stopImmediatePropagation } from "../../helpers/dom/event.mjs";
|
21
|
-
import { EDITOR_EDIT_GROUP as SHORTCUTS_GROUP_EDITOR } from "../../shortcutContexts/index.mjs";
|
22
18
|
import { A11Y_EXPANDED, A11Y_HIDDEN } from "../../helpers/a11y.mjs";
|
23
19
|
export const PLUGIN_KEY = 'collapsibleColumns';
|
24
20
|
export const PLUGIN_PRIORITY = 290;
|
@@ -107,32 +103,10 @@ const actionDictionary = new Map([['collapse', {
|
|
107
103
|
* :::
|
108
104
|
*/
|
109
105
|
var _collapsedColumnsMap = /*#__PURE__*/new WeakMap();
|
110
|
-
var
|
111
|
-
var _onBeforeOnCellMouseDown = /*#__PURE__*/new WeakSet();
|
112
|
-
var _onInit = /*#__PURE__*/new WeakSet();
|
113
|
-
var _onAfterLoadData = /*#__PURE__*/new WeakSet();
|
106
|
+
var _CollapsibleColumns_brand = /*#__PURE__*/new WeakSet();
|
114
107
|
export class CollapsibleColumns extends BasePlugin {
|
115
108
|
constructor() {
|
116
109
|
super(...arguments);
|
117
|
-
/**
|
118
|
-
* Updates the plugin state after new dataset load.
|
119
|
-
*
|
120
|
-
* @param {Array[]} sourceData Array of arrays or array of objects containing data.
|
121
|
-
* @param {boolean} initialLoad Flag that determines whether the data has been loaded
|
122
|
-
* during the initialization.
|
123
|
-
*/
|
124
|
-
_classPrivateMethodInitSpec(this, _onAfterLoadData);
|
125
|
-
/**
|
126
|
-
* Updates the plugin state after HoT initialization.
|
127
|
-
*/
|
128
|
-
_classPrivateMethodInitSpec(this, _onInit);
|
129
|
-
/**
|
130
|
-
* Indicator mouse event callback.
|
131
|
-
*
|
132
|
-
* @param {object} event Mouse event.
|
133
|
-
* @param {object} coords Event coordinates.
|
134
|
-
*/
|
135
|
-
_classPrivateMethodInitSpec(this, _onBeforeOnCellMouseDown);
|
136
110
|
/**
|
137
111
|
* Adds the indicator to the headers.
|
138
112
|
*
|
@@ -141,7 +115,7 @@ export class CollapsibleColumns extends BasePlugin {
|
|
141
115
|
* @param {number} headerLevel The index of header level counting from the top (positive
|
142
116
|
* values counting from 0 to N).
|
143
117
|
*/
|
144
|
-
_classPrivateMethodInitSpec(this,
|
118
|
+
_classPrivateMethodInitSpec(this, _CollapsibleColumns_brand);
|
145
119
|
/**
|
146
120
|
* Cached reference to the NestedHeaders plugin.
|
147
121
|
*
|
@@ -162,10 +136,7 @@ export class CollapsibleColumns extends BasePlugin {
|
|
162
136
|
* @private
|
163
137
|
* @type {HidingMap|null}
|
164
138
|
*/
|
165
|
-
_classPrivateFieldInitSpec(this, _collapsedColumnsMap,
|
166
|
-
writable: true,
|
167
|
-
value: null
|
168
|
-
});
|
139
|
+
_classPrivateFieldInitSpec(this, _collapsedColumnsMap, null);
|
169
140
|
}
|
170
141
|
static get PLUGIN_KEY() {
|
171
142
|
return PLUGIN_KEY;
|
@@ -203,23 +174,23 @@ export class CollapsibleColumns extends BasePlugin {
|
|
203
174
|
if (!nestedHeaders) {
|
204
175
|
warn('You need to configure the Nested Headers plugin in order to use collapsible headers.');
|
205
176
|
}
|
206
|
-
_classPrivateFieldSet(
|
177
|
+
_classPrivateFieldSet(_collapsedColumnsMap, this, this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName, 'hiding'));
|
207
178
|
this.nestedHeadersPlugin = this.hot.getPlugin('nestedHeaders');
|
208
179
|
this.headerStateManager = this.nestedHeadersPlugin.getStateManager();
|
209
|
-
this.addHook('init', () =>
|
180
|
+
this.addHook('init', () => _assertClassBrand(_CollapsibleColumns_brand, this, _onInit).call(this));
|
210
181
|
this.addHook('afterLoadData', function () {
|
211
182
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
212
183
|
args[_key] = arguments[_key];
|
213
184
|
}
|
214
|
-
return
|
185
|
+
return _assertClassBrand(_CollapsibleColumns_brand, _this, _onAfterLoadData).call(_this, ...args);
|
215
186
|
});
|
216
187
|
this.addHook('afterGetColHeader', function () {
|
217
188
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
218
189
|
args[_key2] = arguments[_key2];
|
219
190
|
}
|
220
|
-
return
|
191
|
+
return _assertClassBrand(_CollapsibleColumns_brand, _this, _onAfterGetColHeader).call(_this, ...args);
|
221
192
|
});
|
222
|
-
this.addHook('beforeOnCellMouseDown', (event, coords, TD) =>
|
193
|
+
this.addHook('beforeOnCellMouseDown', (event, coords, TD) => _assertClassBrand(_CollapsibleColumns_brand, this, _onBeforeOnCellMouseDown).call(this, event, coords, TD));
|
223
194
|
this.registerShortcuts();
|
224
195
|
super.enablePlugin();
|
225
196
|
// @TODO: Workaround for broken plugin initialization abstraction (#6806).
|
@@ -266,7 +237,7 @@ export class CollapsibleColumns extends BasePlugin {
|
|
266
237
|
*/
|
267
238
|
disablePlugin() {
|
268
239
|
this.hot.columnIndexMapper.unregisterMap(this.pluginName);
|
269
|
-
_classPrivateFieldSet(
|
240
|
+
_classPrivateFieldSet(_collapsedColumnsMap, this, null);
|
270
241
|
this.nestedHeadersPlugin = null;
|
271
242
|
this.unregisterShortcuts();
|
272
243
|
this.clearButtons();
|
@@ -306,17 +277,12 @@ export class CollapsibleColumns extends BasePlugin {
|
|
306
277
|
col: columnIndex
|
307
278
|
});
|
308
279
|
}
|
309
|
-
|
310
|
-
// prevent default Enter behavior (move to the next row within a selection range)
|
311
|
-
return false;
|
312
280
|
},
|
313
281
|
runOnlyIf: () => {
|
314
282
|
var _this$hot$getSelected;
|
315
283
|
return (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight.isHeader();
|
316
284
|
},
|
317
|
-
group: SHORTCUTS_GROUP
|
318
|
-
relativeToGroup: SHORTCUTS_GROUP_EDITOR,
|
319
|
-
position: 'before'
|
285
|
+
group: SHORTCUTS_GROUP
|
320
286
|
});
|
321
287
|
}
|
322
288
|
|
@@ -500,7 +466,7 @@ export class CollapsibleColumns extends BasePlugin {
|
|
500
466
|
}
|
501
467
|
this.hot.batchExecution(() => {
|
502
468
|
arrayEach(affectedColumnsIndexes, visualColumn => {
|
503
|
-
_classPrivateFieldGet(
|
469
|
+
_classPrivateFieldGet(_collapsedColumnsMap, this).setValueAtIndex(this.hot.toPhysicalColumn(visualColumn), actionTranslator.hideColumn);
|
504
470
|
});
|
505
471
|
}, true);
|
506
472
|
const isActionPerformed = this.getCollapsedColumns().length !== currentCollapsedColumns.length;
|
@@ -516,17 +482,17 @@ export class CollapsibleColumns extends BasePlugin {
|
|
516
482
|
* @returns {number[]}
|
517
483
|
*/
|
518
484
|
getCollapsedColumns() {
|
519
|
-
return _classPrivateFieldGet(
|
485
|
+
return _classPrivateFieldGet(_collapsedColumnsMap, this).getHiddenIndexes();
|
520
486
|
}
|
521
487
|
/**
|
522
488
|
* Destroys the plugin instance.
|
523
489
|
*/
|
524
490
|
destroy() {
|
525
|
-
_classPrivateFieldSet(
|
491
|
+
_classPrivateFieldSet(_collapsedColumnsMap, this, null);
|
526
492
|
super.destroy();
|
527
493
|
}
|
528
494
|
}
|
529
|
-
function
|
495
|
+
function _onAfterGetColHeader(column, TH, headerLevel) {
|
530
496
|
var _this$headerStateMana3;
|
531
497
|
const {
|
532
498
|
collapsible,
|
@@ -569,7 +535,13 @@ function _onAfterGetColHeader2(column, TH, headerLevel) {
|
|
569
535
|
(_collapsibleElement = collapsibleElement) === null || _collapsibleElement === void 0 || _collapsibleElement.remove();
|
570
536
|
}
|
571
537
|
}
|
572
|
-
|
538
|
+
/**
|
539
|
+
* Indicator mouse event callback.
|
540
|
+
*
|
541
|
+
* @param {object} event Mouse event.
|
542
|
+
* @param {object} coords Event coordinates.
|
543
|
+
*/
|
544
|
+
function _onBeforeOnCellMouseDown(event, coords) {
|
573
545
|
if (hasClass(event.target, COLLAPSIBLE_ELEMENT_CLASS)) {
|
574
546
|
if (hasClass(event.target, 'expanded')) {
|
575
547
|
this.eventManager.fireEvent(event.target, 'mouseup');
|
@@ -581,11 +553,21 @@ function _onBeforeOnCellMouseDown2(event, coords) {
|
|
581
553
|
stopImmediatePropagation(event);
|
582
554
|
}
|
583
555
|
}
|
584
|
-
|
556
|
+
/**
|
557
|
+
* Updates the plugin state after HoT initialization.
|
558
|
+
*/
|
559
|
+
function _onInit() {
|
585
560
|
// @TODO: Workaround for broken plugin initialization abstraction (#6806).
|
586
561
|
this.updatePlugin();
|
587
562
|
}
|
588
|
-
|
563
|
+
/**
|
564
|
+
* Updates the plugin state after new dataset load.
|
565
|
+
*
|
566
|
+
* @param {Array[]} sourceData Array of arrays or array of objects containing data.
|
567
|
+
* @param {boolean} initialLoad Flag that determines whether the data has been loaded
|
568
|
+
* during the initialization.
|
569
|
+
*/
|
570
|
+
function _onAfterLoadData(sourceData, initialLoad) {
|
589
571
|
if (!initialLoad) {
|
590
572
|
this.updatePlugin();
|
591
573
|
}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
|
-
require("core-js/modules/es.array.push.js");
|
5
4
|
require("core-js/modules/es.error.cause.js");
|
5
|
+
require("core-js/modules/es.array.push.js");
|
6
6
|
var _element = require("../../helpers/dom/element");
|
7
7
|
var _mixed = require("../../helpers/mixed");
|
8
8
|
var _object = require("../../helpers/object");
|
@@ -12,7 +12,6 @@ var _base = require("../base");
|
|
12
12
|
var _translations = require("../../translations");
|
13
13
|
var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
|
14
14
|
var _columnStatesManager = require("./columnStatesManager");
|
15
|
-
var _shortcutContexts = require("../../shortcutContexts");
|
16
15
|
var _utils = require("./utils");
|
17
16
|
var _domHelpers = require("./domHelpers");
|
18
17
|
var _rootComparator = require("./rootComparator");
|
@@ -24,7 +23,7 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
24
23
|
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; }
|
25
24
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
26
25
|
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); }
|
27
|
-
function
|
26
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
28
27
|
const PLUGIN_KEY = exports.PLUGIN_KEY = 'columnSorting';
|
29
28
|
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 50;
|
30
29
|
const APPEND_COLUMN_CONFIG_STRATEGY = exports.APPEND_COLUMN_CONFIG_STRATEGY = 'append';
|
@@ -84,40 +83,14 @@ _pluginHooks.default.getSingleton().register('afterColumnSort');
|
|
84
83
|
* }]
|
85
84
|
* ```
|
86
85
|
*/
|
87
|
-
var
|
88
|
-
var _onAfterGetColHeader = /*#__PURE__*/new WeakSet();
|
89
|
-
var _onAfterLoadData = /*#__PURE__*/new WeakSet();
|
90
|
-
var _onBeforeOnCellMouseDown = /*#__PURE__*/new WeakSet();
|
86
|
+
var _ColumnSorting_brand = /*#__PURE__*/new WeakSet();
|
91
87
|
class ColumnSorting extends _base.BasePlugin {
|
92
88
|
constructor() {
|
93
89
|
super(...arguments);
|
94
|
-
/**
|
95
|
-
* Changes the behavior of selection / dragging.
|
96
|
-
*
|
97
|
-
* @param {MouseEvent} event The `mousedown` event.
|
98
|
-
* @param {CellCoords} coords Visual coordinates.
|
99
|
-
* @param {HTMLElement} TD The cell element.
|
100
|
-
* @param {object} controller An object with properties `row`, `column` and `cell`. Each property contains
|
101
|
-
* a boolean value that allows or disallows changing the selection for that particular area.
|
102
|
-
*/
|
103
|
-
_classPrivateMethodInitSpec(this, _onBeforeOnCellMouseDown);
|
104
|
-
/**
|
105
|
-
* Callback for the `afterLoadData` hook.
|
106
|
-
*
|
107
|
-
* @param {boolean} initialLoad Flag that determines whether the data has been loaded during the initialization.
|
108
|
-
*/
|
109
|
-
_classPrivateMethodInitSpec(this, _onAfterLoadData);
|
110
|
-
/**
|
111
|
-
* Callback for the `onAfterGetColHeader` hook. Adds column sorting CSS classes.
|
112
|
-
*
|
113
|
-
* @param {number} column Visual column index.
|
114
|
-
* @param {Element} TH TH HTML element.
|
115
|
-
*/
|
116
|
-
_classPrivateMethodInitSpec(this, _onAfterGetColHeader);
|
117
90
|
/**
|
118
91
|
* Load saved settings or sort by predefined plugin configuration.
|
119
92
|
*/
|
120
|
-
_classPrivateMethodInitSpec(this,
|
93
|
+
_classPrivateMethodInitSpec(this, _ColumnSorting_brand);
|
121
94
|
/**
|
122
95
|
* Instance of column state manager.
|
123
96
|
*
|
@@ -180,25 +153,25 @@ class ColumnSorting extends _base.BasePlugin {
|
|
180
153
|
return this.getMergedPluginSettings(visualIndex);
|
181
154
|
});
|
182
155
|
this.hot.columnIndexMapper.registerMap(`${this.pluginKey}.columnMeta`, this.columnMetaCache);
|
183
|
-
this.addHook('afterGetColHeader', (column, TH) =>
|
156
|
+
this.addHook('afterGetColHeader', (column, TH) => _assertClassBrand(_ColumnSorting_brand, this, _onAfterGetColHeader).call(this, column, TH));
|
184
157
|
this.addHook('beforeOnCellMouseDown', function () {
|
185
158
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
186
159
|
args[_key] = arguments[_key];
|
187
160
|
}
|
188
|
-
return
|
161
|
+
return _assertClassBrand(_ColumnSorting_brand, _this, _onBeforeOnCellMouseDown).call(_this, ...args);
|
189
162
|
});
|
190
163
|
this.addHook('afterOnCellMouseDown', (event, target) => this.onAfterOnCellMouseDown(event, target));
|
191
|
-
this.addHook('afterInit', () =>
|
164
|
+
this.addHook('afterInit', () => _assertClassBrand(_ColumnSorting_brand, this, _loadOrSortBySettings).call(this));
|
192
165
|
this.addHook('afterLoadData', function () {
|
193
166
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
194
167
|
args[_key2] = arguments[_key2];
|
195
168
|
}
|
196
|
-
return
|
169
|
+
return _assertClassBrand(_ColumnSorting_brand, _this, _onAfterLoadData).call(_this, ...args);
|
197
170
|
});
|
198
171
|
|
199
172
|
// TODO: Workaround? It should be refactored / described.
|
200
173
|
if (this.hot.view) {
|
201
|
-
|
174
|
+
_assertClassBrand(_ColumnSorting_brand, this, _loadOrSortBySettings).call(this);
|
202
175
|
}
|
203
176
|
this.registerShortcuts();
|
204
177
|
super.enablePlugin();
|
@@ -250,17 +223,12 @@ class ColumnSorting extends _base.BasePlugin {
|
|
250
223
|
if (highlight.row === -1 && highlight.col >= 0) {
|
251
224
|
this.sort(this.getColumnNextConfig(highlight.col));
|
252
225
|
}
|
253
|
-
|
254
|
-
// prevent default Enter behavior (move to the next row within a selection range)
|
255
|
-
return false;
|
256
226
|
},
|
257
227
|
runOnlyIf: () => {
|
258
228
|
var _this$hot$getSelected;
|
259
229
|
const highlight = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
|
260
230
|
return highlight && this.hot.selection.isCellVisible(highlight) && highlight.isHeader();
|
261
231
|
},
|
262
|
-
relativeToGroup: _shortcutContexts.EDITOR_EDIT_GROUP,
|
263
|
-
position: 'before',
|
264
232
|
group: SHORTCUTS_GROUP
|
265
233
|
});
|
266
234
|
}
|
@@ -660,6 +628,14 @@ class ColumnSorting extends _base.BasePlugin {
|
|
660
628
|
this.hot.render();
|
661
629
|
}
|
662
630
|
}
|
631
|
+
|
632
|
+
/**
|
633
|
+
* Callback for the `onAfterGetColHeader` hook. Adds column sorting CSS classes.
|
634
|
+
*
|
635
|
+
* @param {number} column Visual column index.
|
636
|
+
* @param {Element} TH TH HTML element.
|
637
|
+
*/
|
638
|
+
|
663
639
|
/**
|
664
640
|
* Update header classes.
|
665
641
|
*
|
@@ -694,6 +670,13 @@ class ColumnSorting extends _base.BasePlugin {
|
|
694
670
|
this.sortBySettings(newSettings[this.pluginKey]);
|
695
671
|
}
|
696
672
|
}
|
673
|
+
|
674
|
+
/**
|
675
|
+
* Callback for the `afterLoadData` hook.
|
676
|
+
*
|
677
|
+
* @param {boolean} initialLoad Flag that determines whether the data has been loaded during the initialization.
|
678
|
+
*/
|
679
|
+
|
697
680
|
/**
|
698
681
|
* Indicates if clickable header was clicked.
|
699
682
|
*
|
@@ -707,6 +690,17 @@ class ColumnSorting extends _base.BasePlugin {
|
|
707
690
|
const headerActionEnabled = pluginSettingsForColumn.headerAction;
|
708
691
|
return headerActionEnabled && (0, _element.hasClass)(event.target, _utils.HEADER_SPAN_CLASS);
|
709
692
|
}
|
693
|
+
|
694
|
+
/**
|
695
|
+
* Changes the behavior of selection / dragging.
|
696
|
+
*
|
697
|
+
* @param {MouseEvent} event The `mousedown` event.
|
698
|
+
* @param {CellCoords} coords Visual coordinates.
|
699
|
+
* @param {HTMLElement} TD The cell element.
|
700
|
+
* @param {object} controller An object with properties `row`, `column` and `cell`. Each property contains
|
701
|
+
* a boolean value that allows or disallows changing the selection for that particular area.
|
702
|
+
*/
|
703
|
+
|
710
704
|
/**
|
711
705
|
* Callback for the `onAfterOnCellMouseDown` hook.
|
712
706
|
*
|
@@ -739,7 +733,7 @@ class ColumnSorting extends _base.BasePlugin {
|
|
739
733
|
}
|
740
734
|
}
|
741
735
|
exports.ColumnSorting = ColumnSorting;
|
742
|
-
function
|
736
|
+
function _loadOrSortBySettings() {
|
743
737
|
const storedAllSortSettings = this.getAllSavedSortSettings();
|
744
738
|
if ((0, _object.isObject)(storedAllSortSettings)) {
|
745
739
|
this.sortBySettings(storedAllSortSettings);
|
@@ -748,7 +742,7 @@ function _loadOrSortBySettings2() {
|
|
748
742
|
this.sortBySettings(allSortSettings);
|
749
743
|
}
|
750
744
|
}
|
751
|
-
function
|
745
|
+
function _onAfterGetColHeader(column, TH) {
|
752
746
|
const headerSpanElement = (0, _utils.getHeaderSpanElement)(TH);
|
753
747
|
if ((0, _utils.isFirstLevelColumnHeader)(column, TH) === false || headerSpanElement === null) {
|
754
748
|
return;
|
@@ -762,15 +756,15 @@ function _onAfterGetColHeader2(column, TH) {
|
|
762
756
|
(0, _element.setAttribute)(TH, ...(0, _a11y.A11Y_SORT)(currentSortState ? `${currentSortState}ending` : 'none'));
|
763
757
|
}
|
764
758
|
}
|
765
|
-
function
|
759
|
+
function _onAfterLoadData(initialLoad) {
|
766
760
|
if (initialLoad === true) {
|
767
761
|
// TODO: Workaround? It should be refactored / described.
|
768
762
|
if (this.hot.view) {
|
769
|
-
|
763
|
+
_assertClassBrand(_ColumnSorting_brand, this, _loadOrSortBySettings).call(this);
|
770
764
|
}
|
771
765
|
}
|
772
766
|
}
|
773
|
-
function
|
767
|
+
function _onBeforeOnCellMouseDown(event, coords, TD, controller) {
|
774
768
|
if ((0, _utils.wasHeaderClickedProperly)(coords.row, coords.col, event) === false) {
|
775
769
|
return;
|
776
770
|
}
|