handsontable 0.0.0-next-bfb0e3a-20240403 → 0.0.0-next-5a535ed-20240403
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +17 -12
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +17 -12
- package/3rdparty/walkontable/src/calculator/viewportRows.js +15 -10
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +15 -10
- package/3rdparty/walkontable/src/cell/coords.js +17 -12
- package/3rdparty/walkontable/src/cell/coords.mjs +17 -12
- package/3rdparty/walkontable/src/cell/range.d.ts +1 -2
- package/3rdparty/walkontable/src/cell/range.js +28 -40
- package/3rdparty/walkontable/src/cell/range.mjs +28 -40
- package/3rdparty/walkontable/src/core/_base.js +1 -1
- package/3rdparty/walkontable/src/core/_base.mjs +1 -1
- package/3rdparty/walkontable/src/event.js +104 -72
- package/3rdparty/walkontable/src/event.mjs +104 -72
- package/3rdparty/walkontable/src/overlays.js +1 -1
- package/3rdparty/walkontable/src/overlays.mjs +1 -1
- package/3rdparty/walkontable/src/scroll.js +17 -15
- package/3rdparty/walkontable/src/scroll.mjs +17 -15
- package/3rdparty/walkontable/src/selection/manager.js +69 -48
- package/3rdparty/walkontable/src/selection/manager.mjs +69 -48
- package/3rdparty/walkontable/src/selection/scanner.js +42 -33
- package/3rdparty/walkontable/src/selection/scanner.mjs +42 -33
- package/3rdparty/walkontable/src/utils/columnStretching.js +44 -27
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +44 -27
- package/3rdparty/walkontable/src/utils/orderView/view.js +1 -1
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +1 -1
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/viewportScroll/index.js +1 -4
- package/core/viewportScroll/index.mjs +1 -4
- package/core.d.ts +3 -4
- package/core.js +22 -77
- package/core.mjs +22 -77
- package/dataMap/dataSource.js +1 -1
- package/dataMap/dataSource.mjs +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +1 -1
- package/dataMap/metaManager/metaSchema.js +1 -1
- package/dataMap/metaManager/metaSchema.mjs +1 -1
- package/dataMap/replaceData.js +1 -1
- package/dataMap/replaceData.mjs +1 -1
- package/dist/handsontable.css +4 -4
- package/dist/handsontable.full.css +4 -4
- package/dist/handsontable.full.js +9117 -8969
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +292 -292
- package/dist/handsontable.js +6569 -6874
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +25 -25
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +23 -25
- package/editorManager.mjs +23 -25
- package/editors/autocompleteEditor/autocompleteEditor.js +10 -6
- package/editors/autocompleteEditor/autocompleteEditor.mjs +10 -6
- package/editors/selectEditor/selectEditor.js +19 -20
- package/editors/selectEditor/selectEditor.mjs +19 -20
- package/eventManager.js +1 -1
- package/eventManager.mjs +1 -1
- package/focusManager.js +82 -64
- package/focusManager.mjs +82 -64
- package/helpers/dom/element.js +1 -1
- package/helpers/dom/element.mjs +1 -1
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/object.js +2 -2
- package/helpers/object.mjs +2 -2
- package/index.d.ts +0 -10
- package/package.json +2 -7
- package/pluginHooks.d.ts +3 -4
- package/pluginHooks.js +38 -99
- package/pluginHooks.mjs +38 -99
- package/plugins/autoColumnSize/autoColumnSize.js +65 -49
- package/plugins/autoColumnSize/autoColumnSize.mjs +65 -49
- package/plugins/autoRowSize/autoRowSize.js +34 -28
- package/plugins/autoRowSize/autoRowSize.mjs +34 -28
- package/plugins/autofill/autofill.js +38 -30
- package/plugins/autofill/autofill.mjs +38 -30
- package/plugins/base/base.js +17 -12
- package/plugins/base/base.mjs +17 -12
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +5 -5
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +5 -5
- package/plugins/collapsibleColumns/collapsibleColumns.js +50 -59
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +50 -59
- package/plugins/columnSorting/columnSorting.js +45 -49
- package/plugins/columnSorting/columnSorting.mjs +45 -49
- package/plugins/columnSummary/columnSummary.js +26 -22
- package/plugins/columnSummary/columnSummary.mjs +26 -22
- package/plugins/comments/comments.js +158 -116
- package/plugins/comments/comments.mjs +158 -116
- package/plugins/contextMenu/contextMenu.js +26 -20
- package/plugins/contextMenu/contextMenu.mjs +26 -20
- package/plugins/contextMenu/itemsFactory.js +1 -1
- package/plugins/contextMenu/itemsFactory.mjs +1 -1
- package/plugins/contextMenu/menu/defaultShortcutsList.js +10 -26
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +10 -26
- package/plugins/contextMenu/menu/menu.js +21 -13
- package/plugins/contextMenu/menu/menu.mjs +21 -13
- package/plugins/contextMenu/menu/positioner.js +58 -41
- package/plugins/contextMenu/menu/positioner.mjs +58 -41
- package/plugins/copyPaste/copyPaste.js +157 -116
- package/plugins/copyPaste/copyPaste.mjs +157 -116
- package/plugins/copyPaste/copyableRanges.js +66 -43
- package/plugins/copyPaste/copyableRanges.mjs +66 -43
- package/plugins/customBorders/customBorders.js +13 -11
- package/plugins/customBorders/customBorders.mjs +13 -11
- package/plugins/dragToScroll/dragToScroll.js +6 -6
- package/plugins/dragToScroll/dragToScroll.mjs +6 -6
- package/plugins/dropdownMenu/dropdownMenu.js +106 -80
- package/plugins/dropdownMenu/dropdownMenu.mjs +106 -80
- package/plugins/exportFile/dataProvider.js +1 -1
- package/plugins/exportFile/dataProvider.mjs +1 -1
- package/plugins/filters/component/actionBar.js +9 -9
- package/plugins/filters/component/actionBar.mjs +8 -8
- package/plugins/filters/component/condition.js +15 -13
- package/plugins/filters/component/condition.mjs +15 -13
- package/plugins/filters/component/operators.js +6 -6
- package/plugins/filters/component/operators.mjs +6 -6
- package/plugins/filters/component/value.js +28 -24
- package/plugins/filters/component/value.mjs +28 -24
- package/plugins/filters/conditionUpdateObserver.js +24 -22
- package/plugins/filters/conditionUpdateObserver.mjs +24 -22
- package/plugins/filters/dataFilter.js +1 -1
- package/plugins/filters/dataFilter.mjs +1 -1
- package/plugins/filters/filters.js +95 -81
- package/plugins/filters/filters.mjs +95 -81
- package/plugins/filters/ui/input.js +19 -13
- package/plugins/filters/ui/input.mjs +19 -13
- package/plugins/filters/ui/link.js +13 -8
- package/plugins/filters/ui/link.mjs +13 -8
- package/plugins/filters/ui/multipleSelect.js +112 -85
- package/plugins/filters/ui/multipleSelect.mjs +112 -85
- package/plugins/filters/ui/radioInput.js +20 -12
- package/plugins/filters/ui/radioInput.mjs +20 -12
- package/plugins/filters/ui/select.js +72 -50
- package/plugins/filters/ui/select.mjs +71 -49
- package/plugins/formulas/formulas.js +326 -268
- package/plugins/formulas/formulas.mjs +327 -269
- package/plugins/formulas/indexSyncer/axisSyncer.js +61 -38
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +61 -38
- package/plugins/formulas/indexSyncer/index.js +48 -25
- package/plugins/formulas/indexSyncer/index.mjs +48 -25
- package/plugins/hiddenColumns/hiddenColumns.js +83 -64
- package/plugins/hiddenColumns/hiddenColumns.mjs +83 -64
- package/plugins/hiddenRows/hiddenRows.js +82 -63
- package/plugins/hiddenRows/hiddenRows.mjs +82 -63
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +32 -24
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +33 -25
- package/plugins/manualColumnMove/manualColumnMove.js +170 -126
- package/plugins/manualColumnMove/manualColumnMove.mjs +170 -126
- package/plugins/manualColumnResize/manualColumnResize.js +230 -169
- package/plugins/manualColumnResize/manualColumnResize.mjs +230 -169
- package/plugins/manualRowMove/manualRowMove.js +128 -99
- package/plugins/manualRowMove/manualRowMove.mjs +128 -99
- package/plugins/manualRowResize/manualRowResize.js +209 -150
- package/plugins/manualRowResize/manualRowResize.mjs +209 -150
- package/plugins/mergeCells/calculations/selection.js +71 -2
- package/plugins/mergeCells/calculations/selection.mjs +71 -2
- package/plugins/mergeCells/cellsCollection.js +1 -117
- package/plugins/mergeCells/cellsCollection.mjs +1 -117
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -11
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +1 -11
- package/plugins/mergeCells/mergeCells.js +397 -499
- package/plugins/mergeCells/mergeCells.mjs +397 -499
- package/plugins/multiColumnSorting/multiColumnSorting.js +2 -8
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -8
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +1 -1
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +1 -1
- package/plugins/nestedHeaders/nestedHeaders.js +253 -205
- package/plugins/nestedHeaders/nestedHeaders.mjs +254 -206
- package/plugins/nestedHeaders/stateManager/headersTree.js +32 -21
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +32 -21
- package/plugins/nestedHeaders/stateManager/index.js +41 -30
- package/plugins/nestedHeaders/stateManager/index.mjs +41 -30
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +30 -19
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +30 -19
- package/plugins/nestedRows/data/dataManager.js +1 -1
- package/plugins/nestedRows/data/dataManager.mjs +1 -1
- package/plugins/nestedRows/nestedRows.js +182 -151
- package/plugins/nestedRows/nestedRows.mjs +183 -152
- package/plugins/nestedRows/ui/contextMenu.js +15 -11
- package/plugins/nestedRows/ui/contextMenu.mjs +14 -10
- package/plugins/nestedRows/utils/rowMoveController.js +1 -1
- package/plugins/nestedRows/utils/rowMoveController.mjs +1 -1
- package/plugins/persistentState/storage.js +2 -2
- package/plugins/persistentState/storage.mjs +2 -2
- package/plugins/search/search.js +7 -7
- package/plugins/search/search.mjs +7 -7
- package/plugins/touchScroll/touchScroll.js +19 -15
- package/plugins/touchScroll/touchScroll.mjs +20 -16
- package/plugins/trimRows/trimRows.js +6 -6
- package/plugins/trimRows/trimRows.mjs +6 -6
- package/renderers/checkboxRenderer/checkboxRenderer.js +5 -8
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +5 -8
- package/selection/highlight/highlight.js +14 -14
- package/selection/highlight/highlight.mjs +13 -13
- package/selection/highlight/visualSelection.js +0 -2
- package/selection/highlight/visualSelection.mjs +0 -2
- package/selection/selection.js +67 -225
- package/selection/selection.mjs +66 -224
- package/selection/transformation.js +118 -149
- package/selection/transformation.mjs +118 -149
- package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
- package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
- package/shortcutContexts/commands/editor/open.js +3 -18
- package/shortcutContexts/commands/editor/open.mjs +3 -18
- package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -9
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -10
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +1 -3
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -6
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -6
- package/shortcutContexts/grid.js +3 -9
- package/shortcutContexts/grid.mjs +3 -9
- package/shortcuts/context.js +1 -2
- package/shortcuts/context.mjs +1 -2
- package/tableView.js +78 -52
- package/tableView.mjs +78 -52
- package/translations/changesObservable/observable.js +38 -21
- package/translations/changesObservable/observable.mjs +38 -21
- package/translations/changesObservable/observer.js +12 -7
- package/translations/changesObservable/observer.mjs +11 -6
- package/translations/mapCollections/aggregatedCollection.js +1 -1
- package/translations/mapCollections/aggregatedCollection.mjs +1 -1
- package/translations/maps/indexMap.js +1 -1
- package/translations/maps/indexMap.mjs +1 -1
- package/utils/dataStructures/linkedList.js +1 -6
- package/utils/dataStructures/linkedList.mjs +1 -6
- package/utils/dataStructures/tree.js +1 -1
- package/utils/dataStructures/tree.mjs +1 -1
- package/utils/interval.js +44 -26
- package/utils/interval.mjs +44 -26
- package/core/viewportScroll/scrollStrategies/focusScroll.js +0 -15
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +0 -11
- package/i18n/languages/ar-AR.d.ts +0 -5
- package/i18n/languages/cs-CZ.d.ts +0 -5
- package/i18n/languages/hr-HR.d.ts +0 -5
- package/i18n/languages/sr-SP.d.ts +0 -5
- package/plugins/mergeCells/focusOrder.js +0 -305
- package/plugins/mergeCells/focusOrder.mjs +0 -300
@@ -1,11 +1,14 @@
|
|
1
|
-
import "core-js/modules/es.error.cause.js";
|
2
1
|
import "core-js/modules/es.array.push.js";
|
2
|
+
import "core-js/modules/es.error.cause.js";
|
3
3
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
4
4
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
5
5
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
6
|
-
function
|
7
|
-
function
|
8
|
-
function
|
6
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
7
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
8
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
9
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
10
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
11
|
+
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
9
12
|
import { addClass, getScrollbarWidth } from "../../../helpers/dom/element.mjs";
|
10
13
|
import { clone, extend } from "../../../helpers/object.mjs";
|
11
14
|
import { arrayFilter, arrayMap, arrayEach } from "../../../helpers/array.mjs";
|
@@ -30,7 +33,10 @@ var _locale = /*#__PURE__*/new WeakMap();
|
|
30
33
|
var _searchInput = /*#__PURE__*/new WeakMap();
|
31
34
|
var _selectAllUI = /*#__PURE__*/new WeakMap();
|
32
35
|
var _clearAllUI = /*#__PURE__*/new WeakMap();
|
33
|
-
var
|
36
|
+
var _onInput = /*#__PURE__*/new WeakSet();
|
37
|
+
var _onInputKeyDown = /*#__PURE__*/new WeakSet();
|
38
|
+
var _onSelectAllClick = /*#__PURE__*/new WeakSet();
|
39
|
+
var _onClearAllClick = /*#__PURE__*/new WeakSet();
|
34
40
|
export class MultipleSelectUI extends BaseUI {
|
35
41
|
static get DEFAULTS() {
|
36
42
|
return clone({
|
@@ -47,52 +53,88 @@ export class MultipleSelectUI extends BaseUI {
|
|
47
53
|
|
48
54
|
constructor(hotInstance, options) {
|
49
55
|
super(hotInstance, extend(MultipleSelectUI.DEFAULTS, options));
|
56
|
+
/**
|
57
|
+
* On click listener for "Clear" link.
|
58
|
+
*
|
59
|
+
* @param {DOMEvent} event The mouse event object.
|
60
|
+
*/
|
61
|
+
_classPrivateMethodInitSpec(this, _onClearAllClick);
|
62
|
+
/**
|
63
|
+
* On click listener for "Select all" link.
|
64
|
+
*
|
65
|
+
* @param {DOMEvent} event The mouse event object.
|
66
|
+
*/
|
67
|
+
_classPrivateMethodInitSpec(this, _onSelectAllClick);
|
68
|
+
/**
|
69
|
+
* 'keydown' event listener for input element.
|
70
|
+
*
|
71
|
+
* @param {Event} event DOM event.
|
72
|
+
*/
|
73
|
+
_classPrivateMethodInitSpec(this, _onInputKeyDown);
|
50
74
|
/**
|
51
75
|
* 'input' event listener for input element.
|
52
76
|
*
|
53
77
|
* @param {Event} event DOM event.
|
54
78
|
*/
|
55
|
-
_classPrivateMethodInitSpec(this,
|
56
|
-
_classPrivateFieldInitSpec(this, _items,
|
79
|
+
_classPrivateMethodInitSpec(this, _onInput);
|
80
|
+
_classPrivateFieldInitSpec(this, _items, {
|
81
|
+
writable: true,
|
82
|
+
value: []
|
83
|
+
});
|
57
84
|
/**
|
58
85
|
* Handsontable instance used as items list element.
|
59
86
|
*
|
60
87
|
* @type {Handsontable}
|
61
88
|
*/
|
62
|
-
_classPrivateFieldInitSpec(this, _itemsBox,
|
89
|
+
_classPrivateFieldInitSpec(this, _itemsBox, {
|
90
|
+
writable: true,
|
91
|
+
value: void 0
|
92
|
+
});
|
63
93
|
/**
|
64
94
|
* A locale for the component used to compare filtered values.
|
65
95
|
*
|
66
96
|
* @type {string}
|
67
97
|
*/
|
68
|
-
_classPrivateFieldInitSpec(this, _locale,
|
98
|
+
_classPrivateFieldInitSpec(this, _locale, {
|
99
|
+
writable: true,
|
100
|
+
value: void 0
|
101
|
+
});
|
69
102
|
/**
|
70
103
|
* Input element.
|
71
104
|
*
|
72
105
|
* @type {InputUI}
|
73
106
|
*/
|
74
|
-
_classPrivateFieldInitSpec(this, _searchInput,
|
107
|
+
_classPrivateFieldInitSpec(this, _searchInput, {
|
108
|
+
writable: true,
|
109
|
+
value: void 0
|
110
|
+
});
|
75
111
|
/**
|
76
112
|
* "Select all" UI element.
|
77
113
|
*
|
78
114
|
* @type {LinkUI}
|
79
115
|
*/
|
80
|
-
_classPrivateFieldInitSpec(this, _selectAllUI,
|
116
|
+
_classPrivateFieldInitSpec(this, _selectAllUI, {
|
117
|
+
writable: true,
|
118
|
+
value: void 0
|
119
|
+
});
|
81
120
|
/**
|
82
121
|
* "Clear" UI element.
|
83
122
|
*
|
84
123
|
* @type {LinkUI}
|
85
124
|
*/
|
86
|
-
_classPrivateFieldInitSpec(this, _clearAllUI,
|
87
|
-
|
125
|
+
_classPrivateFieldInitSpec(this, _clearAllUI, {
|
126
|
+
writable: true,
|
127
|
+
value: void 0
|
128
|
+
});
|
129
|
+
_classPrivateFieldSet(this, _searchInput, new InputUI(this.hot, {
|
88
130
|
placeholder: C.FILTERS_BUTTONS_PLACEHOLDER_SEARCH,
|
89
131
|
className: 'htUIMultipleSelectSearch'
|
90
132
|
}));
|
91
|
-
_classPrivateFieldSet(
|
133
|
+
_classPrivateFieldSet(this, _selectAllUI, new LinkUI(this.hot, {
|
92
134
|
textContent: C.FILTERS_BUTTONS_SELECT_ALL,
|
93
135
|
className: 'htUISelectAll'
|
94
136
|
}));
|
95
|
-
_classPrivateFieldSet(
|
137
|
+
_classPrivateFieldSet(this, _clearAllUI, new LinkUI(this.hot, {
|
96
138
|
textContent: C.FILTERS_BUTTONS_CLEAR,
|
97
139
|
className: 'htUIClearAll'
|
98
140
|
}));
|
@@ -105,17 +147,17 @@ export class MultipleSelectUI extends BaseUI {
|
|
105
147
|
* @returns {Handsontable}
|
106
148
|
*/
|
107
149
|
getItemsBox() {
|
108
|
-
return _classPrivateFieldGet(
|
150
|
+
return _classPrivateFieldGet(this, _itemsBox);
|
109
151
|
}
|
110
152
|
|
111
153
|
/**
|
112
154
|
* Register all necessary hooks.
|
113
155
|
*/
|
114
156
|
registerHooks() {
|
115
|
-
_classPrivateFieldGet(
|
116
|
-
_classPrivateFieldGet(
|
117
|
-
_classPrivateFieldGet(
|
118
|
-
_classPrivateFieldGet(
|
157
|
+
_classPrivateFieldGet(this, _searchInput).addLocalHook('keydown', event => _classPrivateMethodGet(this, _onInputKeyDown, _onInputKeyDown2).call(this, event));
|
158
|
+
_classPrivateFieldGet(this, _searchInput).addLocalHook('input', event => _classPrivateMethodGet(this, _onInput, _onInput2).call(this, event));
|
159
|
+
_classPrivateFieldGet(this, _selectAllUI).addLocalHook('click', event => _classPrivateMethodGet(this, _onSelectAllClick, _onSelectAllClick2).call(this, event));
|
160
|
+
_classPrivateFieldGet(this, _clearAllUI).addLocalHook('click', event => _classPrivateMethodGet(this, _onClearAllClick, _onClearAllClick2).call(this, event));
|
119
161
|
}
|
120
162
|
|
121
163
|
/**
|
@@ -124,9 +166,9 @@ export class MultipleSelectUI extends BaseUI {
|
|
124
166
|
* @param {Array} items Array of objects with `checked` and `label` property.
|
125
167
|
*/
|
126
168
|
setItems(items) {
|
127
|
-
_classPrivateFieldSet(
|
128
|
-
if (_classPrivateFieldGet(
|
129
|
-
_classPrivateFieldGet(
|
169
|
+
_classPrivateFieldSet(this, _items, items);
|
170
|
+
if (_classPrivateFieldGet(this, _itemsBox)) {
|
171
|
+
_classPrivateFieldGet(this, _itemsBox).loadData(_classPrivateFieldGet(this, _items));
|
130
172
|
}
|
131
173
|
}
|
132
174
|
|
@@ -136,7 +178,7 @@ export class MultipleSelectUI extends BaseUI {
|
|
136
178
|
* @param {string} locale Locale used for filter actions performed on data, ie. `en-US`.
|
137
179
|
*/
|
138
180
|
setLocale(locale) {
|
139
|
-
_classPrivateFieldSet(
|
181
|
+
_classPrivateFieldSet(this, _locale, locale);
|
140
182
|
}
|
141
183
|
|
142
184
|
/**
|
@@ -145,7 +187,7 @@ export class MultipleSelectUI extends BaseUI {
|
|
145
187
|
* @returns {string}
|
146
188
|
*/
|
147
189
|
getLocale() {
|
148
|
-
return _classPrivateFieldGet(
|
190
|
+
return _classPrivateFieldGet(this, _locale);
|
149
191
|
}
|
150
192
|
|
151
193
|
/**
|
@@ -154,7 +196,7 @@ export class MultipleSelectUI extends BaseUI {
|
|
154
196
|
* @returns {Array}
|
155
197
|
*/
|
156
198
|
getItems() {
|
157
|
-
return [..._classPrivateFieldGet(
|
199
|
+
return [..._classPrivateFieldGet(this, _items)];
|
158
200
|
}
|
159
201
|
|
160
202
|
/**
|
@@ -163,7 +205,7 @@ export class MultipleSelectUI extends BaseUI {
|
|
163
205
|
* @returns {Array} Array of selected values.
|
164
206
|
*/
|
165
207
|
getValue() {
|
166
|
-
return itemsToValue(_classPrivateFieldGet(
|
208
|
+
return itemsToValue(_classPrivateFieldGet(this, _items));
|
167
209
|
}
|
168
210
|
|
169
211
|
/**
|
@@ -172,7 +214,7 @@ export class MultipleSelectUI extends BaseUI {
|
|
172
214
|
* @returns {InputUI}
|
173
215
|
*/
|
174
216
|
getSearchInputElement() {
|
175
|
-
return _classPrivateFieldGet(
|
217
|
+
return _classPrivateFieldGet(this, _searchInput);
|
176
218
|
}
|
177
219
|
|
178
220
|
/**
|
@@ -181,7 +223,7 @@ export class MultipleSelectUI extends BaseUI {
|
|
181
223
|
* @returns {LinkUI}
|
182
224
|
*/
|
183
225
|
getSelectAllElement() {
|
184
|
-
return _classPrivateFieldGet(
|
226
|
+
return _classPrivateFieldGet(this, _selectAllUI);
|
185
227
|
}
|
186
228
|
|
187
229
|
/**
|
@@ -190,7 +232,7 @@ export class MultipleSelectUI extends BaseUI {
|
|
190
232
|
* @returns {LinkUI}
|
191
233
|
*/
|
192
234
|
getClearAllElement() {
|
193
|
-
return _classPrivateFieldGet(
|
235
|
+
return _classPrivateFieldGet(this, _clearAllUI);
|
194
236
|
}
|
195
237
|
|
196
238
|
/**
|
@@ -199,7 +241,7 @@ export class MultipleSelectUI extends BaseUI {
|
|
199
241
|
* @returns {boolean}
|
200
242
|
*/
|
201
243
|
isSelectedAllValues() {
|
202
|
-
return _classPrivateFieldGet(
|
244
|
+
return _classPrivateFieldGet(this, _items).length === this.getValue().length;
|
203
245
|
}
|
204
246
|
|
205
247
|
/**
|
@@ -213,22 +255,22 @@ export class MultipleSelectUI extends BaseUI {
|
|
213
255
|
const itemsBoxWrapper = rootDocument.createElement('div');
|
214
256
|
const selectionControl = new BaseUI(this.hot, {
|
215
257
|
className: 'htUISelectionControls',
|
216
|
-
children: [_classPrivateFieldGet(
|
258
|
+
children: [_classPrivateFieldGet(this, _selectAllUI), _classPrivateFieldGet(this, _clearAllUI)]
|
217
259
|
});
|
218
|
-
this._element.appendChild(_classPrivateFieldGet(
|
260
|
+
this._element.appendChild(_classPrivateFieldGet(this, _searchInput).element);
|
219
261
|
this._element.appendChild(selectionControl.element);
|
220
262
|
this._element.appendChild(itemsBoxWrapper);
|
221
263
|
const hotInitializer = wrapper => {
|
222
264
|
if (!this._element) {
|
223
265
|
return;
|
224
266
|
}
|
225
|
-
if (_classPrivateFieldGet(
|
226
|
-
_classPrivateFieldGet(
|
267
|
+
if (_classPrivateFieldGet(this, _itemsBox)) {
|
268
|
+
_classPrivateFieldGet(this, _itemsBox).destroy();
|
227
269
|
}
|
228
270
|
addClass(wrapper, 'htUIMultipleSelectHot');
|
229
271
|
// Constructs and initializes a new Handsontable instance
|
230
|
-
_classPrivateFieldSet(
|
231
|
-
data: _classPrivateFieldGet(
|
272
|
+
_classPrivateFieldSet(this, _itemsBox, new this.hot.constructor(wrapper, {
|
273
|
+
data: _classPrivateFieldGet(this, _items),
|
232
274
|
columns: [{
|
233
275
|
data: 'checked',
|
234
276
|
type: 'checkbox',
|
@@ -244,13 +286,13 @@ export class MultipleSelectUI extends BaseUI {
|
|
244
286
|
this.runLocalHooks('focus', this);
|
245
287
|
},
|
246
288
|
beforeOnCellMouseUp: () => {
|
247
|
-
_classPrivateFieldGet(
|
289
|
+
_classPrivateFieldGet(this, _itemsBox).listen();
|
248
290
|
},
|
249
291
|
maxCols: 1,
|
250
292
|
autoWrapCol: true,
|
251
293
|
height: 110,
|
252
294
|
// Workaround for #151.
|
253
|
-
colWidths: () => _classPrivateFieldGet(
|
295
|
+
colWidths: () => _classPrivateFieldGet(this, _itemsBox).container.scrollWidth - getScrollbarWidth(rootDocument),
|
254
296
|
copyPaste: false,
|
255
297
|
disableVisualSelection: 'area',
|
256
298
|
fillHandle: false,
|
@@ -261,8 +303,8 @@ export class MultipleSelectUI extends BaseUI {
|
|
261
303
|
},
|
262
304
|
layoutDirection: this.hot.isRtl() ? 'rtl' : 'ltr'
|
263
305
|
}));
|
264
|
-
_classPrivateFieldGet(
|
265
|
-
const shortcutManager = _classPrivateFieldGet(
|
306
|
+
_classPrivateFieldGet(this, _itemsBox).init();
|
307
|
+
const shortcutManager = _classPrivateFieldGet(this, _itemsBox).getShortcutManager();
|
266
308
|
const gridContext = shortcutManager.getContext('grid');
|
267
309
|
gridContext.removeShortcutsByKeys(['Tab']);
|
268
310
|
gridContext.removeShortcutsByKeys(['Shift', 'Tab']);
|
@@ -276,7 +318,7 @@ export class MultipleSelectUI extends BaseUI {
|
|
276
318
|
gridContext.addShortcut({
|
277
319
|
keys: [['Tab'], ['Shift', 'Tab']],
|
278
320
|
callback: event => {
|
279
|
-
_classPrivateFieldGet(
|
321
|
+
_classPrivateFieldGet(this, _itemsBox).deselectCell();
|
280
322
|
this.runLocalHooks('keydown', event, this);
|
281
323
|
this.runLocalHooks('listTabKeydown', event, this);
|
282
324
|
},
|
@@ -292,7 +334,7 @@ export class MultipleSelectUI extends BaseUI {
|
|
292
334
|
*/
|
293
335
|
focus() {
|
294
336
|
if (this.isBuilt()) {
|
295
|
-
_classPrivateFieldGet(
|
337
|
+
_classPrivateFieldGet(this, _itemsBox).listen();
|
296
338
|
}
|
297
339
|
}
|
298
340
|
|
@@ -300,9 +342,9 @@ export class MultipleSelectUI extends BaseUI {
|
|
300
342
|
* Reset DOM structure.
|
301
343
|
*/
|
302
344
|
reset() {
|
303
|
-
_classPrivateFieldGet(
|
304
|
-
_classPrivateFieldGet(
|
305
|
-
_classPrivateFieldGet(
|
345
|
+
_classPrivateFieldGet(this, _searchInput).reset();
|
346
|
+
_classPrivateFieldGet(this, _selectAllUI).reset();
|
347
|
+
_classPrivateFieldGet(this, _clearAllUI).reset();
|
306
348
|
}
|
307
349
|
|
308
350
|
/**
|
@@ -312,7 +354,7 @@ export class MultipleSelectUI extends BaseUI {
|
|
312
354
|
if (!this.isBuilt()) {
|
313
355
|
return;
|
314
356
|
}
|
315
|
-
_classPrivateFieldGet(
|
357
|
+
_classPrivateFieldGet(this, _itemsBox).loadData(valueToItems(_classPrivateFieldGet(this, _items), this.options.value));
|
316
358
|
super.update();
|
317
359
|
}
|
318
360
|
|
@@ -320,72 +362,57 @@ export class MultipleSelectUI extends BaseUI {
|
|
320
362
|
* Destroy instance.
|
321
363
|
*/
|
322
364
|
destroy() {
|
323
|
-
if (_classPrivateFieldGet(
|
324
|
-
_classPrivateFieldGet(
|
365
|
+
if (_classPrivateFieldGet(this, _itemsBox)) {
|
366
|
+
_classPrivateFieldGet(this, _itemsBox).destroy();
|
325
367
|
}
|
326
|
-
_classPrivateFieldGet(
|
327
|
-
_classPrivateFieldGet(
|
328
|
-
_classPrivateFieldGet(
|
329
|
-
_classPrivateFieldSet(
|
330
|
-
_classPrivateFieldSet(
|
331
|
-
_classPrivateFieldSet(
|
332
|
-
_classPrivateFieldSet(
|
333
|
-
_classPrivateFieldSet(
|
368
|
+
_classPrivateFieldGet(this, _searchInput).destroy();
|
369
|
+
_classPrivateFieldGet(this, _clearAllUI).destroy();
|
370
|
+
_classPrivateFieldGet(this, _selectAllUI).destroy();
|
371
|
+
_classPrivateFieldSet(this, _searchInput, null);
|
372
|
+
_classPrivateFieldSet(this, _clearAllUI, null);
|
373
|
+
_classPrivateFieldSet(this, _selectAllUI, null);
|
374
|
+
_classPrivateFieldSet(this, _itemsBox, null);
|
375
|
+
_classPrivateFieldSet(this, _items, null);
|
334
376
|
super.destroy();
|
335
377
|
}
|
336
378
|
}
|
337
|
-
function
|
379
|
+
function _onInput2(event) {
|
338
380
|
const value = event.target.value.toLocaleLowerCase(this.getLocale());
|
339
381
|
let filteredItems;
|
340
382
|
if (value === '') {
|
341
|
-
filteredItems = [..._classPrivateFieldGet(
|
383
|
+
filteredItems = [..._classPrivateFieldGet(this, _items)];
|
342
384
|
} else {
|
343
|
-
filteredItems = arrayFilter(_classPrivateFieldGet(
|
385
|
+
filteredItems = arrayFilter(_classPrivateFieldGet(this, _items), item => `${item.value}`.toLocaleLowerCase(this.getLocale()).indexOf(value) >= 0);
|
344
386
|
}
|
345
|
-
_classPrivateFieldGet(
|
387
|
+
_classPrivateFieldGet(this, _itemsBox).loadData(filteredItems);
|
346
388
|
}
|
347
|
-
|
348
|
-
* 'keydown' event listener for input element.
|
349
|
-
*
|
350
|
-
* @param {Event} event DOM event.
|
351
|
-
*/
|
352
|
-
function _onInputKeyDown(event) {
|
389
|
+
function _onInputKeyDown2(event) {
|
353
390
|
this.runLocalHooks('keydown', event, this);
|
354
391
|
const isKeyCode = partial(isKey, event.keyCode);
|
355
392
|
if (isKeyCode('ARROW_DOWN')) {
|
356
393
|
event.preventDefault();
|
357
394
|
stopImmediatePropagation(event);
|
358
|
-
_classPrivateFieldGet(
|
359
|
-
_classPrivateFieldGet(
|
395
|
+
_classPrivateFieldGet(this, _itemsBox).listen();
|
396
|
+
_classPrivateFieldGet(this, _itemsBox).selectCell(0, 0);
|
360
397
|
}
|
361
398
|
}
|
362
|
-
|
363
|
-
* On click listener for "Select all" link.
|
364
|
-
*
|
365
|
-
* @param {DOMEvent} event The mouse event object.
|
366
|
-
*/
|
367
|
-
function _onSelectAllClick(event) {
|
399
|
+
function _onSelectAllClick2(event) {
|
368
400
|
const changes = [];
|
369
401
|
event.preventDefault();
|
370
|
-
arrayEach(_classPrivateFieldGet(
|
402
|
+
arrayEach(_classPrivateFieldGet(this, _itemsBox).getSourceData(), (row, rowIndex) => {
|
371
403
|
row.checked = true;
|
372
404
|
changes.push(dataRowToChangesArray(row, rowIndex)[0]);
|
373
405
|
});
|
374
|
-
_classPrivateFieldGet(
|
406
|
+
_classPrivateFieldGet(this, _itemsBox).setSourceDataAtCell(changes);
|
375
407
|
}
|
376
|
-
|
377
|
-
* On click listener for "Clear" link.
|
378
|
-
*
|
379
|
-
* @param {DOMEvent} event The mouse event object.
|
380
|
-
*/
|
381
|
-
function _onClearAllClick(event) {
|
408
|
+
function _onClearAllClick2(event) {
|
382
409
|
const changes = [];
|
383
410
|
event.preventDefault();
|
384
|
-
arrayEach(_classPrivateFieldGet(
|
411
|
+
arrayEach(_classPrivateFieldGet(this, _itemsBox).getSourceData(), (row, rowIndex) => {
|
385
412
|
row.checked = false;
|
386
413
|
changes.push(dataRowToChangesArray(row, rowIndex)[0]);
|
387
414
|
});
|
388
|
-
_classPrivateFieldGet(
|
415
|
+
_classPrivateFieldGet(this, _itemsBox).setSourceDataAtCell(changes);
|
389
416
|
}
|
390
417
|
export default MultipleSelectUI;
|
391
418
|
|
@@ -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 RadioInputUI
|
@@ -33,13 +35,19 @@ class RadioInputUI extends _base.BaseUI {
|
|
33
35
|
|
34
36
|
constructor(hotInstance, options) {
|
35
37
|
super(hotInstance, (0, _object.extend)(RadioInputUI.DEFAULTS, options));
|
36
|
-
_classPrivateFieldInitSpec(this, _input,
|
38
|
+
_classPrivateFieldInitSpec(this, _input, {
|
39
|
+
writable: true,
|
40
|
+
value: void 0
|
41
|
+
});
|
37
42
|
/**
|
38
43
|
* The reference to the label element.
|
39
44
|
*
|
40
45
|
* @type {HTMLLabelElement}
|
41
46
|
*/
|
42
|
-
_classPrivateFieldInitSpec(this, _label,
|
47
|
+
_classPrivateFieldInitSpec(this, _label, {
|
48
|
+
writable: true,
|
49
|
+
value: void 0
|
50
|
+
});
|
43
51
|
}
|
44
52
|
|
45
53
|
/**
|
@@ -50,9 +58,9 @@ class RadioInputUI extends _base.BaseUI {
|
|
50
58
|
const label = this.hot.rootDocument.createElement('label');
|
51
59
|
label.textContent = this.translateIfPossible(this.options.label.textContent);
|
52
60
|
label.htmlFor = this.translateIfPossible(this.options.label.htmlFor);
|
53
|
-
_classPrivateFieldSet(
|
54
|
-
_classPrivateFieldSet(
|
55
|
-
_classPrivateFieldGet(
|
61
|
+
_classPrivateFieldSet(this, _label, label);
|
62
|
+
_classPrivateFieldSet(this, _input, this._element.firstChild);
|
63
|
+
_classPrivateFieldGet(this, _input).checked = this.options.checked;
|
56
64
|
this._element.appendChild(label);
|
57
65
|
this.update();
|
58
66
|
}
|
@@ -64,7 +72,7 @@ class RadioInputUI extends _base.BaseUI {
|
|
64
72
|
if (!this.isBuilt()) {
|
65
73
|
return;
|
66
74
|
}
|
67
|
-
_classPrivateFieldGet(
|
75
|
+
_classPrivateFieldGet(this, _label).textContent = this.translateIfPossible(this.options.label.textContent);
|
68
76
|
}
|
69
77
|
|
70
78
|
/**
|
@@ -73,7 +81,7 @@ class RadioInputUI extends _base.BaseUI {
|
|
73
81
|
* @returns {boolean}
|
74
82
|
*/
|
75
83
|
isChecked() {
|
76
|
-
return this.isBuilt() ? _classPrivateFieldGet(
|
84
|
+
return this.isBuilt() ? _classPrivateFieldGet(this, _input).checked : false;
|
77
85
|
}
|
78
86
|
|
79
87
|
/**
|
@@ -84,7 +92,7 @@ class RadioInputUI extends _base.BaseUI {
|
|
84
92
|
setChecked() {
|
85
93
|
let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
86
94
|
if (this.isBuilt()) {
|
87
|
-
_classPrivateFieldGet(
|
95
|
+
_classPrivateFieldGet(this, _input).checked = value;
|
88
96
|
}
|
89
97
|
}
|
90
98
|
|
@@ -93,7 +101,7 @@ class RadioInputUI extends _base.BaseUI {
|
|
93
101
|
*/
|
94
102
|
focus() {
|
95
103
|
if (this.isBuilt()) {
|
96
|
-
_classPrivateFieldGet(
|
104
|
+
_classPrivateFieldGet(this, _input).focus();
|
97
105
|
}
|
98
106
|
}
|
99
107
|
}
|
@@ -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
|
/**
|
@@ -30,13 +32,19 @@ export class RadioInputUI extends BaseUI {
|
|
30
32
|
|
31
33
|
constructor(hotInstance, options) {
|
32
34
|
super(hotInstance, extend(RadioInputUI.DEFAULTS, options));
|
33
|
-
_classPrivateFieldInitSpec(this, _input,
|
35
|
+
_classPrivateFieldInitSpec(this, _input, {
|
36
|
+
writable: true,
|
37
|
+
value: void 0
|
38
|
+
});
|
34
39
|
/**
|
35
40
|
* The reference to the label element.
|
36
41
|
*
|
37
42
|
* @type {HTMLLabelElement}
|
38
43
|
*/
|
39
|
-
_classPrivateFieldInitSpec(this, _label,
|
44
|
+
_classPrivateFieldInitSpec(this, _label, {
|
45
|
+
writable: true,
|
46
|
+
value: void 0
|
47
|
+
});
|
40
48
|
}
|
41
49
|
|
42
50
|
/**
|
@@ -47,9 +55,9 @@ export class RadioInputUI extends BaseUI {
|
|
47
55
|
const label = this.hot.rootDocument.createElement('label');
|
48
56
|
label.textContent = this.translateIfPossible(this.options.label.textContent);
|
49
57
|
label.htmlFor = this.translateIfPossible(this.options.label.htmlFor);
|
50
|
-
_classPrivateFieldSet(
|
51
|
-
_classPrivateFieldSet(
|
52
|
-
_classPrivateFieldGet(
|
58
|
+
_classPrivateFieldSet(this, _label, label);
|
59
|
+
_classPrivateFieldSet(this, _input, this._element.firstChild);
|
60
|
+
_classPrivateFieldGet(this, _input).checked = this.options.checked;
|
53
61
|
this._element.appendChild(label);
|
54
62
|
this.update();
|
55
63
|
}
|
@@ -61,7 +69,7 @@ export class RadioInputUI extends BaseUI {
|
|
61
69
|
if (!this.isBuilt()) {
|
62
70
|
return;
|
63
71
|
}
|
64
|
-
_classPrivateFieldGet(
|
72
|
+
_classPrivateFieldGet(this, _label).textContent = this.translateIfPossible(this.options.label.textContent);
|
65
73
|
}
|
66
74
|
|
67
75
|
/**
|
@@ -70,7 +78,7 @@ export class RadioInputUI extends BaseUI {
|
|
70
78
|
* @returns {boolean}
|
71
79
|
*/
|
72
80
|
isChecked() {
|
73
|
-
return this.isBuilt() ? _classPrivateFieldGet(
|
81
|
+
return this.isBuilt() ? _classPrivateFieldGet(this, _input).checked : false;
|
74
82
|
}
|
75
83
|
|
76
84
|
/**
|
@@ -81,7 +89,7 @@ export class RadioInputUI extends BaseUI {
|
|
81
89
|
setChecked() {
|
82
90
|
let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
83
91
|
if (this.isBuilt()) {
|
84
|
-
_classPrivateFieldGet(
|
92
|
+
_classPrivateFieldGet(this, _input).checked = value;
|
85
93
|
}
|
86
94
|
}
|
87
95
|
|
@@ -90,7 +98,7 @@ export class RadioInputUI extends BaseUI {
|
|
90
98
|
*/
|
91
99
|
focus() {
|
92
100
|
if (this.isBuilt()) {
|
93
|
-
_classPrivateFieldGet(
|
101
|
+
_classPrivateFieldGet(this, _input).focus();
|
94
102
|
}
|
95
103
|
}
|
96
104
|
}
|