handsontable 0.0.0-next-bfb0e3a-20240403 → 0.0.0-next-5a535ed-20240403
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +17 -12
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +17 -12
- package/3rdparty/walkontable/src/calculator/viewportRows.js +15 -10
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +15 -10
- package/3rdparty/walkontable/src/cell/coords.js +17 -12
- package/3rdparty/walkontable/src/cell/coords.mjs +17 -12
- package/3rdparty/walkontable/src/cell/range.d.ts +1 -2
- package/3rdparty/walkontable/src/cell/range.js +28 -40
- package/3rdparty/walkontable/src/cell/range.mjs +28 -40
- package/3rdparty/walkontable/src/core/_base.js +1 -1
- package/3rdparty/walkontable/src/core/_base.mjs +1 -1
- package/3rdparty/walkontable/src/event.js +104 -72
- package/3rdparty/walkontable/src/event.mjs +104 -72
- package/3rdparty/walkontable/src/overlays.js +1 -1
- package/3rdparty/walkontable/src/overlays.mjs +1 -1
- package/3rdparty/walkontable/src/scroll.js +17 -15
- package/3rdparty/walkontable/src/scroll.mjs +17 -15
- package/3rdparty/walkontable/src/selection/manager.js +69 -48
- package/3rdparty/walkontable/src/selection/manager.mjs +69 -48
- package/3rdparty/walkontable/src/selection/scanner.js +42 -33
- package/3rdparty/walkontable/src/selection/scanner.mjs +42 -33
- package/3rdparty/walkontable/src/utils/columnStretching.js +44 -27
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +44 -27
- package/3rdparty/walkontable/src/utils/orderView/view.js +1 -1
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +1 -1
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/viewportScroll/index.js +1 -4
- package/core/viewportScroll/index.mjs +1 -4
- package/core.d.ts +3 -4
- package/core.js +22 -77
- package/core.mjs +22 -77
- package/dataMap/dataSource.js +1 -1
- package/dataMap/dataSource.mjs +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +1 -1
- package/dataMap/metaManager/metaSchema.js +1 -1
- package/dataMap/metaManager/metaSchema.mjs +1 -1
- package/dataMap/replaceData.js +1 -1
- package/dataMap/replaceData.mjs +1 -1
- package/dist/handsontable.css +4 -4
- package/dist/handsontable.full.css +4 -4
- package/dist/handsontable.full.js +9117 -8969
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +292 -292
- package/dist/handsontable.js +6569 -6874
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +25 -25
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +23 -25
- package/editorManager.mjs +23 -25
- package/editors/autocompleteEditor/autocompleteEditor.js +10 -6
- package/editors/autocompleteEditor/autocompleteEditor.mjs +10 -6
- package/editors/selectEditor/selectEditor.js +19 -20
- package/editors/selectEditor/selectEditor.mjs +19 -20
- package/eventManager.js +1 -1
- package/eventManager.mjs +1 -1
- package/focusManager.js +82 -64
- package/focusManager.mjs +82 -64
- package/helpers/dom/element.js +1 -1
- package/helpers/dom/element.mjs +1 -1
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/object.js +2 -2
- package/helpers/object.mjs +2 -2
- package/index.d.ts +0 -10
- package/package.json +2 -7
- package/pluginHooks.d.ts +3 -4
- package/pluginHooks.js +38 -99
- package/pluginHooks.mjs +38 -99
- package/plugins/autoColumnSize/autoColumnSize.js +65 -49
- package/plugins/autoColumnSize/autoColumnSize.mjs +65 -49
- package/plugins/autoRowSize/autoRowSize.js +34 -28
- package/plugins/autoRowSize/autoRowSize.mjs +34 -28
- package/plugins/autofill/autofill.js +38 -30
- package/plugins/autofill/autofill.mjs +38 -30
- package/plugins/base/base.js +17 -12
- package/plugins/base/base.mjs +17 -12
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
- package/plugins/collapsibleColumns/collapsibleColumns.js +50 -59
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +50 -59
- package/plugins/columnSorting/columnSorting.js +45 -49
- package/plugins/columnSorting/columnSorting.mjs +45 -49
- package/plugins/columnSummary/columnSummary.js +26 -22
- package/plugins/columnSummary/columnSummary.mjs +26 -22
- package/plugins/comments/comments.js +158 -116
- package/plugins/comments/comments.mjs +158 -116
- package/plugins/contextMenu/contextMenu.js +26 -20
- package/plugins/contextMenu/contextMenu.mjs +26 -20
- package/plugins/contextMenu/itemsFactory.js +1 -1
- package/plugins/contextMenu/itemsFactory.mjs +1 -1
- package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
- package/plugins/contextMenu/menu/menu.js +21 -13
- package/plugins/contextMenu/menu/menu.mjs +21 -13
- package/plugins/contextMenu/menu/positioner.js +58 -41
- package/plugins/contextMenu/menu/positioner.mjs +58 -41
- package/plugins/copyPaste/copyPaste.js +157 -116
- package/plugins/copyPaste/copyPaste.mjs +157 -116
- package/plugins/copyPaste/copyableRanges.js +66 -43
- package/plugins/copyPaste/copyableRanges.mjs +66 -43
- package/plugins/customBorders/customBorders.js +13 -11
- package/plugins/customBorders/customBorders.mjs +13 -11
- package/plugins/dragToScroll/dragToScroll.js +6 -6
- package/plugins/dragToScroll/dragToScroll.mjs +6 -6
- package/plugins/dropdownMenu/dropdownMenu.js +106 -80
- package/plugins/dropdownMenu/dropdownMenu.mjs +106 -80
- package/plugins/exportFile/dataProvider.js +1 -1
- package/plugins/exportFile/dataProvider.mjs +1 -1
- package/plugins/filters/component/actionBar.js +9 -9
- package/plugins/filters/component/actionBar.mjs +8 -8
- package/plugins/filters/component/condition.js +15 -13
- package/plugins/filters/component/condition.mjs +15 -13
- package/plugins/filters/component/operators.js +6 -6
- package/plugins/filters/component/operators.mjs +6 -6
- package/plugins/filters/component/value.js +28 -24
- package/plugins/filters/component/value.mjs +28 -24
- package/plugins/filters/conditionUpdateObserver.js +24 -22
- package/plugins/filters/conditionUpdateObserver.mjs +24 -22
- package/plugins/filters/dataFilter.js +1 -1
- package/plugins/filters/dataFilter.mjs +1 -1
- package/plugins/filters/filters.js +95 -81
- package/plugins/filters/filters.mjs +95 -81
- package/plugins/filters/ui/input.js +19 -13
- package/plugins/filters/ui/input.mjs +19 -13
- package/plugins/filters/ui/link.js +13 -8
- package/plugins/filters/ui/link.mjs +13 -8
- package/plugins/filters/ui/multipleSelect.js +112 -85
- package/plugins/filters/ui/multipleSelect.mjs +112 -85
- package/plugins/filters/ui/radioInput.js +20 -12
- package/plugins/filters/ui/radioInput.mjs +20 -12
- package/plugins/filters/ui/select.js +72 -50
- package/plugins/filters/ui/select.mjs +71 -49
- package/plugins/formulas/formulas.js +326 -268
- package/plugins/formulas/formulas.mjs +327 -269
- package/plugins/formulas/indexSyncer/axisSyncer.js +61 -38
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +61 -38
- package/plugins/formulas/indexSyncer/index.js +48 -25
- package/plugins/formulas/indexSyncer/index.mjs +48 -25
- package/plugins/hiddenColumns/hiddenColumns.js +83 -64
- package/plugins/hiddenColumns/hiddenColumns.mjs +83 -64
- package/plugins/hiddenRows/hiddenRows.js +82 -63
- package/plugins/hiddenRows/hiddenRows.mjs +82 -63
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +32 -24
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +33 -25
- package/plugins/manualColumnMove/manualColumnMove.js +170 -126
- package/plugins/manualColumnMove/manualColumnMove.mjs +170 -126
- package/plugins/manualColumnResize/manualColumnResize.js +230 -169
- package/plugins/manualColumnResize/manualColumnResize.mjs +230 -169
- package/plugins/manualRowMove/manualRowMove.js +128 -99
- package/plugins/manualRowMove/manualRowMove.mjs +128 -99
- package/plugins/manualRowResize/manualRowResize.js +209 -150
- package/plugins/manualRowResize/manualRowResize.mjs +209 -150
- package/plugins/mergeCells/calculations/selection.js +71 -2
- package/plugins/mergeCells/calculations/selection.mjs +71 -2
- package/plugins/mergeCells/cellsCollection.js +1 -117
- package/plugins/mergeCells/cellsCollection.mjs +1 -117
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
- package/plugins/mergeCells/mergeCells.js +397 -499
- package/plugins/mergeCells/mergeCells.mjs +397 -499
- package/plugins/multiColumnSorting/multiColumnSorting.js +2 -8
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -8
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
- package/plugins/nestedHeaders/nestedHeaders.js +253 -205
- package/plugins/nestedHeaders/nestedHeaders.mjs +254 -206
- package/plugins/nestedHeaders/stateManager/headersTree.js +32 -21
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +32 -21
- package/plugins/nestedHeaders/stateManager/index.js +41 -30
- package/plugins/nestedHeaders/stateManager/index.mjs +41 -30
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +30 -19
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +30 -19
- package/plugins/nestedRows/data/dataManager.js +1 -1
- package/plugins/nestedRows/data/dataManager.mjs +1 -1
- package/plugins/nestedRows/nestedRows.js +182 -151
- package/plugins/nestedRows/nestedRows.mjs +183 -152
- package/plugins/nestedRows/ui/contextMenu.js +15 -11
- package/plugins/nestedRows/ui/contextMenu.mjs +14 -10
- package/plugins/nestedRows/utils/rowMoveController.js +1 -1
- package/plugins/nestedRows/utils/rowMoveController.mjs +1 -1
- package/plugins/persistentState/storage.js +2 -2
- package/plugins/persistentState/storage.mjs +2 -2
- package/plugins/search/search.js +7 -7
- package/plugins/search/search.mjs +7 -7
- package/plugins/touchScroll/touchScroll.js +19 -15
- package/plugins/touchScroll/touchScroll.mjs +20 -16
- package/plugins/trimRows/trimRows.js +6 -6
- package/plugins/trimRows/trimRows.mjs +6 -6
- package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
- package/selection/highlight/highlight.js +14 -14
- package/selection/highlight/highlight.mjs +13 -13
- package/selection/highlight/visualSelection.js +0 -2
- package/selection/highlight/visualSelection.mjs +0 -2
- package/selection/selection.js +67 -225
- package/selection/selection.mjs +66 -224
- package/selection/transformation.js +118 -149
- package/selection/transformation.mjs +118 -149
- package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
- package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
- package/shortcutContexts/commands/editor/open.js +3 -18
- package/shortcutContexts/commands/editor/open.mjs +3 -18
- package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
- package/shortcutContexts/grid.js +3 -9
- package/shortcutContexts/grid.mjs +3 -9
- package/shortcuts/context.js +1 -2
- package/shortcuts/context.mjs +1 -2
- package/tableView.js +78 -52
- package/tableView.mjs +78 -52
- package/translations/changesObservable/observable.js +38 -21
- package/translations/changesObservable/observable.mjs +38 -21
- package/translations/changesObservable/observer.js +12 -7
- package/translations/changesObservable/observer.mjs +11 -6
- package/translations/mapCollections/aggregatedCollection.js +1 -1
- package/translations/mapCollections/aggregatedCollection.mjs +1 -1
- package/translations/maps/indexMap.js +1 -1
- package/translations/maps/indexMap.mjs +1 -1
- package/utils/dataStructures/linkedList.js +1 -6
- package/utils/dataStructures/linkedList.mjs +1 -6
- package/utils/dataStructures/tree.js +1 -1
- package/utils/dataStructures/tree.mjs +1 -1
- package/utils/interval.js +44 -26
- package/utils/interval.mjs +44 -26
- package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
- package/i18n/languages/ar-AR.d.ts +0 -5
- package/i18n/languages/cs-CZ.d.ts +0 -5
- package/i18n/languages/hr-HR.d.ts +0 -5
- package/i18n/languages/sr-SP.d.ts +0 -5
- package/plugins/mergeCells/focusOrder.js +0 -305
- package/plugins/mergeCells/focusOrder.mjs +0 -300
@@ -1,15 +1,18 @@
|
|
1
|
-
import "core-js/modules/es.error.cause.js";
|
2
|
-
import "core-js/modules/es.array.push.js";
|
3
1
|
import "core-js/modules/es.array.unscopables.flat.js";
|
2
|
+
import "core-js/modules/es.array.push.js";
|
3
|
+
import "core-js/modules/es.error.cause.js";
|
4
4
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
5
5
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
6
6
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
7
7
|
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; }
|
8
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
9
9
|
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); }
|
10
|
-
function _classPrivateFieldSet(
|
11
|
-
function
|
12
|
-
function
|
10
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
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; } }
|
12
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
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 _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
15
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
13
16
|
import { BasePlugin } from "../base/index.mjs";
|
14
17
|
import { arrayEach, arrayMap } from "../../helpers/array.mjs";
|
15
18
|
import { toSingleLine } from "../../helpers/templateLiteralTag.mjs";
|
@@ -70,7 +73,15 @@ const SHORTCUTS_GROUP = PLUGIN_KEY;
|
|
70
73
|
* :::
|
71
74
|
*/
|
72
75
|
var _menuFocusNavigator = /*#__PURE__*/new WeakMap();
|
73
|
-
var
|
76
|
+
var _onAfterChange = /*#__PURE__*/new WeakSet();
|
77
|
+
var _onAfterDropdownMenuShow = /*#__PURE__*/new WeakSet();
|
78
|
+
var _onAfterDropdownMenuHide = /*#__PURE__*/new WeakSet();
|
79
|
+
var _onAfterDropdownMenuDefaultOptions = /*#__PURE__*/new WeakSet();
|
80
|
+
var _onActionBarSubmit = /*#__PURE__*/new WeakSet();
|
81
|
+
var _onComponentChange = /*#__PURE__*/new WeakSet();
|
82
|
+
var _onSelectUIClosed = /*#__PURE__*/new WeakSet();
|
83
|
+
var _onAfterGetColHeader = /*#__PURE__*/new WeakSet();
|
84
|
+
var _updateComponents = /*#__PURE__*/new WeakSet();
|
74
85
|
export class Filters extends BasePlugin {
|
75
86
|
static get PLUGIN_KEY() {
|
76
87
|
return PLUGIN_KEY;
|
@@ -92,12 +103,59 @@ export class Filters extends BasePlugin {
|
|
92
103
|
constructor(hotInstance) {
|
93
104
|
super(hotInstance);
|
94
105
|
// One listener for the enable/disable functionality
|
106
|
+
/**
|
107
|
+
* It updates the components state. The state is triggered by ConditionUpdateObserver, which
|
108
|
+
* reacts to any condition added to the condition collection. It may be added through the UI
|
109
|
+
* components or by API call.
|
110
|
+
*
|
111
|
+
* @param {object} conditionsState An object with the state generated by UI components.
|
112
|
+
*/
|
113
|
+
_classPrivateMethodInitSpec(this, _updateComponents);
|
114
|
+
/**
|
115
|
+
* On after get column header listener.
|
116
|
+
*
|
117
|
+
* @param {number} col Visual column index.
|
118
|
+
* @param {HTMLTableCellElement} TH Header's TH element.
|
119
|
+
*/
|
120
|
+
_classPrivateMethodInitSpec(this, _onAfterGetColHeader);
|
121
|
+
/**
|
122
|
+
* On component SelectUI closed listener.
|
123
|
+
*/
|
124
|
+
_classPrivateMethodInitSpec(this, _onSelectUIClosed);
|
125
|
+
/**
|
126
|
+
* On component change listener.
|
127
|
+
*
|
128
|
+
* @param {BaseComponent} component Component inheriting BaseComponent.
|
129
|
+
* @param {object} command Menu item object (command).
|
130
|
+
*/
|
131
|
+
_classPrivateMethodInitSpec(this, _onComponentChange);
|
132
|
+
/**
|
133
|
+
* On action bar submit listener.
|
134
|
+
*
|
135
|
+
* @private
|
136
|
+
* @param {string} submitType The submit type.
|
137
|
+
*/
|
138
|
+
_classPrivateMethodInitSpec(this, _onActionBarSubmit);
|
139
|
+
/**
|
140
|
+
* After dropdown menu default options listener.
|
141
|
+
*
|
142
|
+
* @param {object} defaultOptions ContextMenu default item options.
|
143
|
+
*/
|
144
|
+
_classPrivateMethodInitSpec(this, _onAfterDropdownMenuDefaultOptions);
|
145
|
+
/**
|
146
|
+
* After dropdown menu hide listener.
|
147
|
+
*/
|
148
|
+
_classPrivateMethodInitSpec(this, _onAfterDropdownMenuHide);
|
149
|
+
/**
|
150
|
+
* After dropdown menu show listener.
|
151
|
+
*/
|
152
|
+
_classPrivateMethodInitSpec(this, _onAfterDropdownMenuShow);
|
95
153
|
/**
|
96
154
|
* `afterChange` listener.
|
97
155
|
*
|
98
156
|
* @param {Array} changes Array of changes.
|
99
157
|
*/
|
100
|
-
_classPrivateMethodInitSpec(this,
|
158
|
+
_classPrivateMethodInitSpec(this, _onAfterChange);
|
101
159
|
_defineProperty(this, "dropdownMenuPlugin", null);
|
102
160
|
/**
|
103
161
|
* Instance of {@link ConditionCollection}.
|
@@ -132,8 +190,11 @@ export class Filters extends BasePlugin {
|
|
132
190
|
*
|
133
191
|
* @type {MenuFocusNavigator|undefined}
|
134
192
|
*/
|
135
|
-
_classPrivateFieldInitSpec(this, _menuFocusNavigator,
|
136
|
-
|
193
|
+
_classPrivateFieldInitSpec(this, _menuFocusNavigator, {
|
194
|
+
writable: true,
|
195
|
+
value: void 0
|
196
|
+
});
|
197
|
+
this.hot.addHook('afterGetColHeader', (col, TH) => _classPrivateMethodGet(this, _onAfterGetColHeader, _onAfterGetColHeader2).call(this, col, TH));
|
137
198
|
}
|
138
199
|
|
139
200
|
/**
|
@@ -159,9 +220,9 @@ export class Filters extends BasePlugin {
|
|
159
220
|
const dropdownSettings = this.hot.getSettings().dropdownMenu;
|
160
221
|
const menuContainer = dropdownSettings && dropdownSettings.uiContainer || this.hot.rootDocument.body;
|
161
222
|
const addConfirmationHooks = component => {
|
162
|
-
component.addLocalHook('accept', () =>
|
163
|
-
component.addLocalHook('cancel', () =>
|
164
|
-
component.addLocalHook('change', command =>
|
223
|
+
component.addLocalHook('accept', () => _classPrivateMethodGet(this, _onActionBarSubmit, _onActionBarSubmit2).call(this, 'accept'));
|
224
|
+
component.addLocalHook('cancel', () => _classPrivateMethodGet(this, _onActionBarSubmit, _onActionBarSubmit2).call(this, 'cancel'));
|
225
|
+
component.addLocalHook('change', command => _classPrivateMethodGet(this, _onComponentChange, _onComponentChange2).call(this, component, command));
|
165
226
|
return component;
|
166
227
|
};
|
167
228
|
const filterByConditionLabel = () => `${this.hot.getTranslatedPhrase(constants.FILTERS_DIVS_FILTER_BY_CONDITION)}:`;
|
@@ -173,7 +234,7 @@ export class Filters extends BasePlugin {
|
|
173
234
|
addSeparator: false,
|
174
235
|
menuContainer
|
175
236
|
});
|
176
|
-
conditionComponent.addLocalHook('afterClose', () =>
|
237
|
+
conditionComponent.addLocalHook('afterClose', () => _classPrivateMethodGet(this, _onSelectUIClosed, _onSelectUIClosed2).call(this));
|
177
238
|
this.components.set('filter_by_condition', addConfirmationHooks(conditionComponent));
|
178
239
|
}
|
179
240
|
if (!this.components.get('filter_operators')) {
|
@@ -189,7 +250,7 @@ export class Filters extends BasePlugin {
|
|
189
250
|
addSeparator: true,
|
190
251
|
menuContainer
|
191
252
|
});
|
192
|
-
conditionComponent.addLocalHook('afterClose', () =>
|
253
|
+
conditionComponent.addLocalHook('afterClose', () => _classPrivateMethodGet(this, _onSelectUIClosed, _onSelectUIClosed2).call(this));
|
193
254
|
this.components.set('filter_by_condition2', addConfirmationHooks(conditionComponent));
|
194
255
|
}
|
195
256
|
if (!this.components.get('filter_by_value')) {
|
@@ -209,20 +270,20 @@ export class Filters extends BasePlugin {
|
|
209
270
|
}
|
210
271
|
if (!this.conditionUpdateObserver) {
|
211
272
|
this.conditionUpdateObserver = new ConditionUpdateObserver(this.hot, this.conditionCollection, physicalColumn => this.getDataMapAtColumn(physicalColumn));
|
212
|
-
this.conditionUpdateObserver.addLocalHook('update', conditionState =>
|
273
|
+
this.conditionUpdateObserver.addLocalHook('update', conditionState => _classPrivateMethodGet(this, _updateComponents, _updateComponents2).call(this, conditionState));
|
213
274
|
}
|
214
275
|
this.components.forEach(component => component.show());
|
215
|
-
this.addHook('afterDropdownMenuDefaultOptions', defaultOptions =>
|
216
|
-
this.addHook('afterDropdownMenuShow', () =>
|
217
|
-
this.addHook('afterDropdownMenuHide', () =>
|
218
|
-
this.addHook('afterChange', changes =>
|
276
|
+
this.addHook('afterDropdownMenuDefaultOptions', defaultOptions => _classPrivateMethodGet(this, _onAfterDropdownMenuDefaultOptions, _onAfterDropdownMenuDefaultOptions2).call(this, defaultOptions));
|
277
|
+
this.addHook('afterDropdownMenuShow', () => _classPrivateMethodGet(this, _onAfterDropdownMenuShow, _onAfterDropdownMenuShow2).call(this));
|
278
|
+
this.addHook('afterDropdownMenuHide', () => _classPrivateMethodGet(this, _onAfterDropdownMenuHide, _onAfterDropdownMenuHide2).call(this));
|
279
|
+
this.addHook('afterChange', changes => _classPrivateMethodGet(this, _onAfterChange, _onAfterChange2).call(this, changes));
|
219
280
|
|
220
281
|
// Temp. solution (extending menu items bug in contextMenu/dropdownMenu)
|
221
282
|
if (this.hot.getSettings().dropdownMenu && this.dropdownMenuPlugin) {
|
222
283
|
this.dropdownMenuPlugin.disablePlugin();
|
223
284
|
this.dropdownMenuPlugin.enablePlugin();
|
224
285
|
}
|
225
|
-
if (!_classPrivateFieldGet(
|
286
|
+
if (!_classPrivateFieldGet(this, _menuFocusNavigator) && this.dropdownMenuPlugin.enabled) {
|
226
287
|
const mainMenu = this.dropdownMenuPlugin.menu;
|
227
288
|
const focusableItems = [
|
228
289
|
// A fake menu item that once focused allows escaping from the focus navigation (using Tab keys)
|
@@ -230,7 +291,7 @@ export class Filters extends BasePlugin {
|
|
230
291
|
{
|
231
292
|
focus: () => {
|
232
293
|
const menuNavigator = mainMenu.getNavigator();
|
233
|
-
const lastSelectedMenuItem = _classPrivateFieldGet(
|
294
|
+
const lastSelectedMenuItem = _classPrivateFieldGet(this, _menuFocusNavigator).getLastMenuPage();
|
234
295
|
mainMenu.focus();
|
235
296
|
if (lastSelectedMenuItem > 0) {
|
236
297
|
menuNavigator.setCurrentPage(lastSelectedMenuItem);
|
@@ -242,15 +303,15 @@ export class Filters extends BasePlugin {
|
|
242
303
|
let [, component] = _ref;
|
243
304
|
return component.getElements();
|
244
305
|
}).flat()];
|
245
|
-
_classPrivateFieldSet(
|
306
|
+
_classPrivateFieldSet(this, _menuFocusNavigator, createMenuFocusController(mainMenu, focusableItems));
|
246
307
|
const forwardToFocusNavigation = event => {
|
247
|
-
_classPrivateFieldGet(
|
308
|
+
_classPrivateFieldGet(this, _menuFocusNavigator).listen();
|
248
309
|
event.preventDefault();
|
249
310
|
if (isKey(event.keyCode, 'TAB')) {
|
250
311
|
if (event.shiftKey) {
|
251
|
-
_classPrivateFieldGet(
|
312
|
+
_classPrivateFieldGet(this, _menuFocusNavigator).toPreviousItem();
|
252
313
|
} else {
|
253
|
-
_classPrivateFieldGet(
|
314
|
+
_classPrivateFieldGet(this, _menuFocusNavigator).toNextItem();
|
254
315
|
}
|
255
316
|
}
|
256
317
|
};
|
@@ -595,11 +656,6 @@ export class Filters extends BasePlugin {
|
|
595
656
|
});
|
596
657
|
this.updateDependentComponentsVisibility();
|
597
658
|
}
|
598
|
-
|
599
|
-
/**
|
600
|
-
* After dropdown menu show listener.
|
601
|
-
*/
|
602
|
-
|
603
659
|
/**
|
604
660
|
* Get an operation, based on the number and types of arguments (where arguments are states of components).
|
605
661
|
*
|
@@ -621,14 +677,6 @@ export class Filters extends BasePlugin {
|
|
621
677
|
}
|
622
678
|
return operation;
|
623
679
|
}
|
624
|
-
|
625
|
-
/**
|
626
|
-
* On action bar submit listener.
|
627
|
-
*
|
628
|
-
* @private
|
629
|
-
* @param {string} submitType The submit type.
|
630
|
-
*/
|
631
|
-
|
632
680
|
/**
|
633
681
|
* Listen to the keyboard input on document body and forward events to instance of Handsontable
|
634
682
|
* created by DropdownMenu plugin.
|
@@ -658,14 +706,6 @@ export class Filters extends BasePlugin {
|
|
658
706
|
this.hideComponents(...componentsToShow);
|
659
707
|
}
|
660
708
|
}
|
661
|
-
|
662
|
-
/**
|
663
|
-
* On after get column header listener.
|
664
|
-
*
|
665
|
-
* @param {number} col Visual column index.
|
666
|
-
* @param {HTMLTableCellElement} TH Header's TH element.
|
667
|
-
*/
|
668
|
-
|
669
709
|
/**
|
670
710
|
* Creates DataFilter instance based on condition collection.
|
671
711
|
*
|
@@ -677,15 +717,6 @@ export class Filters extends BasePlugin {
|
|
677
717
|
let conditionCollection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.conditionCollection;
|
678
718
|
return new DataFilter(conditionCollection, physicalColumn => this.getDataMapAtColumn(physicalColumn));
|
679
719
|
}
|
680
|
-
|
681
|
-
/**
|
682
|
-
* It updates the components state. The state is triggered by ConditionUpdateObserver, which
|
683
|
-
* reacts to any condition added to the condition collection. It may be added through the UI
|
684
|
-
* components or by API call.
|
685
|
-
*
|
686
|
-
* @param {object} conditionsState An object with the state generated by UI components.
|
687
|
-
*/
|
688
|
-
|
689
720
|
/**
|
690
721
|
* Returns indexes of passed components inside list of `dropdownMenu` items.
|
691
722
|
*
|
@@ -783,7 +814,7 @@ export class Filters extends BasePlugin {
|
|
783
814
|
super.destroy();
|
784
815
|
}
|
785
816
|
}
|
786
|
-
function
|
817
|
+
function _onAfterChange2(changes) {
|
787
818
|
if (changes) {
|
788
819
|
arrayEach(changes, change => {
|
789
820
|
const [, prop] = change;
|
@@ -794,22 +825,14 @@ function _onAfterChange(changes) {
|
|
794
825
|
});
|
795
826
|
}
|
796
827
|
}
|
797
|
-
function
|
828
|
+
function _onAfterDropdownMenuShow2() {
|
798
829
|
this.restoreComponents(Array.from(this.components.values()));
|
799
830
|
}
|
800
|
-
|
801
|
-
* After dropdown menu hide listener.
|
802
|
-
*/
|
803
|
-
function _onAfterDropdownMenuHide() {
|
831
|
+
function _onAfterDropdownMenuHide2() {
|
804
832
|
this.components.get('filter_by_condition').getSelectElement().closeOptions();
|
805
833
|
this.components.get('filter_by_condition2').getSelectElement().closeOptions();
|
806
834
|
}
|
807
|
-
|
808
|
-
* After dropdown menu default options listener.
|
809
|
-
*
|
810
|
-
* @param {object} defaultOptions ContextMenu default item options.
|
811
|
-
*/
|
812
|
-
function _onAfterDropdownMenuDefaultOptions(defaultOptions) {
|
835
|
+
function _onAfterDropdownMenuDefaultOptions2(defaultOptions) {
|
813
836
|
defaultOptions.items.push({
|
814
837
|
name: SEPARATOR
|
815
838
|
});
|
@@ -817,7 +840,7 @@ function _onAfterDropdownMenuDefaultOptions(defaultOptions) {
|
|
817
840
|
defaultOptions.items.push(component.getMenuItemDescriptor());
|
818
841
|
});
|
819
842
|
}
|
820
|
-
function
|
843
|
+
function _onActionBarSubmit2(submitType) {
|
821
844
|
var _this$dropdownMenuPlu3;
|
822
845
|
if (submitType === 'accept') {
|
823
846
|
const selectedColumn = this.getSelectedColumn();
|
@@ -855,25 +878,16 @@ function _onActionBarSubmit(submitType) {
|
|
855
878
|
}
|
856
879
|
(_this$dropdownMenuPlu3 = this.dropdownMenuPlugin) === null || _this$dropdownMenuPlu3 === void 0 || _this$dropdownMenuPlu3.close();
|
857
880
|
}
|
858
|
-
|
859
|
-
* On component change listener.
|
860
|
-
*
|
861
|
-
* @param {BaseComponent} component Component inheriting BaseComponent.
|
862
|
-
* @param {object} command Menu item object (command).
|
863
|
-
*/
|
864
|
-
function _onComponentChange(component, command) {
|
881
|
+
function _onComponentChange2(component, command) {
|
865
882
|
this.updateDependentComponentsVisibility();
|
866
883
|
if (component.constructor === ConditionComponent && !command.inputsCount) {
|
867
884
|
this.setListeningDropdownMenu();
|
868
885
|
}
|
869
886
|
}
|
870
|
-
|
871
|
-
* On component SelectUI closed listener.
|
872
|
-
*/
|
873
|
-
function _onSelectUIClosed() {
|
887
|
+
function _onSelectUIClosed2() {
|
874
888
|
this.setListeningDropdownMenu();
|
875
889
|
}
|
876
|
-
function
|
890
|
+
function _onAfterGetColHeader2(col, TH) {
|
877
891
|
const physicalColumn = this.hot.toPhysicalColumn(col);
|
878
892
|
if (this.enabled && this.conditionCollection.hasConditions(physicalColumn)) {
|
879
893
|
addClass(TH, 'htFiltersActive');
|
@@ -881,7 +895,7 @@ function _onAfterGetColHeader(col, TH) {
|
|
881
895
|
removeClass(TH, 'htFiltersActive');
|
882
896
|
}
|
883
897
|
}
|
884
|
-
function
|
898
|
+
function _updateComponents2(conditionsState) {
|
885
899
|
var _this$dropdownMenuPlu4;
|
886
900
|
if (!((_this$dropdownMenuPlu4 = this.dropdownMenuPlugin) !== null && _this$dropdownMenuPlu4 !== void 0 && _this$dropdownMenuPlu4.enabled)) {
|
887
901
|
return;
|
@@ -8,15 +8,18 @@ var _base = require("./_base");
|
|
8
8
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
9
9
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
10
10
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
11
|
-
function _classPrivateFieldGet(
|
12
|
-
function
|
13
|
-
function
|
11
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
12
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
13
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
14
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
15
|
+
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; } }
|
16
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
14
17
|
/**
|
15
18
|
* @private
|
16
19
|
* @class InputUI
|
17
20
|
*/
|
18
21
|
var _input = /*#__PURE__*/new WeakMap();
|
19
|
-
var
|
22
|
+
var _onKeyup = /*#__PURE__*/new WeakSet();
|
20
23
|
class InputUI extends _base.BaseUI {
|
21
24
|
static get DEFAULTS() {
|
22
25
|
return (0, _object.clone)({
|
@@ -40,8 +43,11 @@ class InputUI extends _base.BaseUI {
|
|
40
43
|
*
|
41
44
|
* @param {Event} event The mouse event object.
|
42
45
|
*/
|
43
|
-
_classPrivateMethodInitSpec(this,
|
44
|
-
_classPrivateFieldInitSpec(this, _input,
|
46
|
+
_classPrivateMethodInitSpec(this, _onKeyup);
|
47
|
+
_classPrivateFieldInitSpec(this, _input, {
|
48
|
+
writable: true,
|
49
|
+
value: void 0
|
50
|
+
});
|
45
51
|
this.registerHooks();
|
46
52
|
}
|
47
53
|
|
@@ -49,7 +55,7 @@ class InputUI extends _base.BaseUI {
|
|
49
55
|
* Register all necessary hooks.
|
50
56
|
*/
|
51
57
|
registerHooks() {
|
52
|
-
this.addLocalHook('keyup', event =>
|
58
|
+
this.addLocalHook('keyup', event => _classPrivateMethodGet(this, _onKeyup, _onKeyup2).call(this, event));
|
53
59
|
}
|
54
60
|
|
55
61
|
/**
|
@@ -58,7 +64,7 @@ class InputUI extends _base.BaseUI {
|
|
58
64
|
build() {
|
59
65
|
super.build();
|
60
66
|
const icon = this.hot.rootDocument.createElement('div');
|
61
|
-
_classPrivateFieldSet(
|
67
|
+
_classPrivateFieldSet(this, _input, this._element.firstChild);
|
62
68
|
(0, _element.addClass)(this._element, 'htUIInput');
|
63
69
|
(0, _element.addClass)(icon, 'htUIInputIcon');
|
64
70
|
this._element.appendChild(icon);
|
@@ -72,9 +78,9 @@ class InputUI extends _base.BaseUI {
|
|
72
78
|
if (!this.isBuilt()) {
|
73
79
|
return;
|
74
80
|
}
|
75
|
-
_classPrivateFieldGet(
|
76
|
-
_classPrivateFieldGet(
|
77
|
-
_classPrivateFieldGet(
|
81
|
+
_classPrivateFieldGet(this, _input).type = this.options.type;
|
82
|
+
_classPrivateFieldGet(this, _input).placeholder = this.translateIfPossible(this.options.placeholder);
|
83
|
+
_classPrivateFieldGet(this, _input).value = this.translateIfPossible(this.options.value);
|
78
84
|
}
|
79
85
|
|
80
86
|
/**
|
@@ -82,11 +88,11 @@ class InputUI extends _base.BaseUI {
|
|
82
88
|
*/
|
83
89
|
focus() {
|
84
90
|
if (this.isBuilt()) {
|
85
|
-
_classPrivateFieldGet(
|
91
|
+
_classPrivateFieldGet(this, _input).focus();
|
86
92
|
}
|
87
93
|
}
|
88
94
|
}
|
89
95
|
exports.InputUI = InputUI;
|
90
|
-
function
|
96
|
+
function _onKeyup2(event) {
|
91
97
|
this.options.value = event.target.value;
|
92
98
|
}
|
@@ -2,9 +2,12 @@ import "core-js/modules/es.error.cause.js";
|
|
2
2
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
3
3
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
4
4
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
5
|
-
function _classPrivateFieldGet(
|
6
|
-
function
|
7
|
-
function
|
5
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
6
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
7
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
8
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
9
|
+
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; } }
|
10
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
8
11
|
import { addClass } from "../../../helpers/dom/element.mjs";
|
9
12
|
import { clone, extend } from "../../../helpers/object.mjs";
|
10
13
|
import { BaseUI } from "./_base.mjs";
|
@@ -13,7 +16,7 @@ import { BaseUI } from "./_base.mjs";
|
|
13
16
|
* @class InputUI
|
14
17
|
*/
|
15
18
|
var _input = /*#__PURE__*/new WeakMap();
|
16
|
-
var
|
19
|
+
var _onKeyup = /*#__PURE__*/new WeakSet();
|
17
20
|
export class InputUI extends BaseUI {
|
18
21
|
static get DEFAULTS() {
|
19
22
|
return clone({
|
@@ -37,8 +40,11 @@ export class InputUI extends BaseUI {
|
|
37
40
|
*
|
38
41
|
* @param {Event} event The mouse event object.
|
39
42
|
*/
|
40
|
-
_classPrivateMethodInitSpec(this,
|
41
|
-
_classPrivateFieldInitSpec(this, _input,
|
43
|
+
_classPrivateMethodInitSpec(this, _onKeyup);
|
44
|
+
_classPrivateFieldInitSpec(this, _input, {
|
45
|
+
writable: true,
|
46
|
+
value: void 0
|
47
|
+
});
|
42
48
|
this.registerHooks();
|
43
49
|
}
|
44
50
|
|
@@ -46,7 +52,7 @@ export class InputUI extends BaseUI {
|
|
46
52
|
* Register all necessary hooks.
|
47
53
|
*/
|
48
54
|
registerHooks() {
|
49
|
-
this.addLocalHook('keyup', event =>
|
55
|
+
this.addLocalHook('keyup', event => _classPrivateMethodGet(this, _onKeyup, _onKeyup2).call(this, event));
|
50
56
|
}
|
51
57
|
|
52
58
|
/**
|
@@ -55,7 +61,7 @@ export class InputUI extends BaseUI {
|
|
55
61
|
build() {
|
56
62
|
super.build();
|
57
63
|
const icon = this.hot.rootDocument.createElement('div');
|
58
|
-
_classPrivateFieldSet(
|
64
|
+
_classPrivateFieldSet(this, _input, this._element.firstChild);
|
59
65
|
addClass(this._element, 'htUIInput');
|
60
66
|
addClass(icon, 'htUIInputIcon');
|
61
67
|
this._element.appendChild(icon);
|
@@ -69,9 +75,9 @@ export class InputUI extends BaseUI {
|
|
69
75
|
if (!this.isBuilt()) {
|
70
76
|
return;
|
71
77
|
}
|
72
|
-
_classPrivateFieldGet(
|
73
|
-
_classPrivateFieldGet(
|
74
|
-
_classPrivateFieldGet(
|
78
|
+
_classPrivateFieldGet(this, _input).type = this.options.type;
|
79
|
+
_classPrivateFieldGet(this, _input).placeholder = this.translateIfPossible(this.options.placeholder);
|
80
|
+
_classPrivateFieldGet(this, _input).value = this.translateIfPossible(this.options.value);
|
75
81
|
}
|
76
82
|
|
77
83
|
/**
|
@@ -79,10 +85,10 @@ export class InputUI extends BaseUI {
|
|
79
85
|
*/
|
80
86
|
focus() {
|
81
87
|
if (this.isBuilt()) {
|
82
|
-
_classPrivateFieldGet(
|
88
|
+
_classPrivateFieldGet(this, _input).focus();
|
83
89
|
}
|
84
90
|
}
|
85
91
|
}
|
86
|
-
function
|
92
|
+
function _onKeyup2(event) {
|
87
93
|
this.options.value = event.target.value;
|
88
94
|
}
|
@@ -6,9 +6,11 @@ var _object = require("../../../helpers/object");
|
|
6
6
|
var _base = require("./_base");
|
7
7
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
8
8
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
9
|
-
function _classPrivateFieldGet(
|
10
|
-
function
|
11
|
-
function
|
9
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
10
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
11
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
12
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
13
|
+
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
12
14
|
/**
|
13
15
|
* @private
|
14
16
|
* @class LinkUI
|
@@ -32,7 +34,10 @@ class LinkUI extends _base.BaseUI {
|
|
32
34
|
|
33
35
|
constructor(hotInstance, options) {
|
34
36
|
super(hotInstance, (0, _object.extend)(LinkUI.DEFAULTS, options));
|
35
|
-
_classPrivateFieldInitSpec(this, _link,
|
37
|
+
_classPrivateFieldInitSpec(this, _link, {
|
38
|
+
writable: true,
|
39
|
+
value: void 0
|
40
|
+
});
|
36
41
|
}
|
37
42
|
|
38
43
|
/**
|
@@ -40,7 +45,7 @@ class LinkUI extends _base.BaseUI {
|
|
40
45
|
*/
|
41
46
|
build() {
|
42
47
|
super.build();
|
43
|
-
_classPrivateFieldSet(
|
48
|
+
_classPrivateFieldSet(this, _link, this._element.firstChild);
|
44
49
|
}
|
45
50
|
|
46
51
|
/**
|
@@ -50,7 +55,7 @@ class LinkUI extends _base.BaseUI {
|
|
50
55
|
if (!this.isBuilt()) {
|
51
56
|
return;
|
52
57
|
}
|
53
|
-
_classPrivateFieldGet(
|
58
|
+
_classPrivateFieldGet(this, _link).textContent = this.translateIfPossible(this.options.textContent);
|
54
59
|
}
|
55
60
|
|
56
61
|
/**
|
@@ -58,7 +63,7 @@ class LinkUI extends _base.BaseUI {
|
|
58
63
|
*/
|
59
64
|
focus() {
|
60
65
|
if (this.isBuilt()) {
|
61
|
-
_classPrivateFieldGet(
|
66
|
+
_classPrivateFieldGet(this, _link).focus();
|
62
67
|
}
|
63
68
|
}
|
64
69
|
|
@@ -66,7 +71,7 @@ class LinkUI extends _base.BaseUI {
|
|
66
71
|
* Activate the element.
|
67
72
|
*/
|
68
73
|
activate() {
|
69
|
-
_classPrivateFieldGet(
|
74
|
+
_classPrivateFieldGet(this, _link).click();
|
70
75
|
}
|
71
76
|
}
|
72
77
|
exports.LinkUI = LinkUI;
|
@@ -1,9 +1,11 @@
|
|
1
1
|
import "core-js/modules/es.error.cause.js";
|
2
2
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
3
3
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
4
|
-
function _classPrivateFieldGet(
|
5
|
-
function
|
6
|
-
function
|
4
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
5
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
6
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
7
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
8
|
+
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; } }
|
7
9
|
import { clone, extend } from "../../../helpers/object.mjs";
|
8
10
|
import { BaseUI } from "./_base.mjs";
|
9
11
|
/**
|
@@ -29,7 +31,10 @@ export class LinkUI extends BaseUI {
|
|
29
31
|
|
30
32
|
constructor(hotInstance, options) {
|
31
33
|
super(hotInstance, extend(LinkUI.DEFAULTS, options));
|
32
|
-
_classPrivateFieldInitSpec(this, _link,
|
34
|
+
_classPrivateFieldInitSpec(this, _link, {
|
35
|
+
writable: true,
|
36
|
+
value: void 0
|
37
|
+
});
|
33
38
|
}
|
34
39
|
|
35
40
|
/**
|
@@ -37,7 +42,7 @@ export class LinkUI extends BaseUI {
|
|
37
42
|
*/
|
38
43
|
build() {
|
39
44
|
super.build();
|
40
|
-
_classPrivateFieldSet(
|
45
|
+
_classPrivateFieldSet(this, _link, this._element.firstChild);
|
41
46
|
}
|
42
47
|
|
43
48
|
/**
|
@@ -47,7 +52,7 @@ export class LinkUI extends BaseUI {
|
|
47
52
|
if (!this.isBuilt()) {
|
48
53
|
return;
|
49
54
|
}
|
50
|
-
_classPrivateFieldGet(
|
55
|
+
_classPrivateFieldGet(this, _link).textContent = this.translateIfPossible(this.options.textContent);
|
51
56
|
}
|
52
57
|
|
53
58
|
/**
|
@@ -55,7 +60,7 @@ export class LinkUI extends BaseUI {
|
|
55
60
|
*/
|
56
61
|
focus() {
|
57
62
|
if (this.isBuilt()) {
|
58
|
-
_classPrivateFieldGet(
|
63
|
+
_classPrivateFieldGet(this, _link).focus();
|
59
64
|
}
|
60
65
|
}
|
61
66
|
|
@@ -63,6 +68,6 @@ export class LinkUI extends BaseUI {
|
|
63
68
|
* Activate the element.
|
64
69
|
*/
|
65
70
|
activate() {
|
66
|
-
_classPrivateFieldGet(
|
71
|
+
_classPrivateFieldGet(this, _link).click();
|
67
72
|
}
|
68
73
|
}
|