@oscarpalmer/oui 0.39.0 → 0.41.0
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.
- package/README.md +1 -1
- package/dist/css/color-picker.css +80 -69
- package/dist/css/listbox.css +169 -0
- package/dist/js/color-picker/color-picker.constants.d.mts +2 -0
- package/dist/js/color-picker/{constants.color-picker.mjs → color-picker.constants.mjs} +7 -4
- package/dist/js/color-picker/{dom.color-picker.d.mts → color-picker.dom.d.mts} +2 -2
- package/dist/js/color-picker/{dom.color-picker.mjs → color-picker.dom.mjs} +33 -16
- package/dist/js/color-picker/{event.color-picker.d.mts → color-picker.event.d.mts} +3 -3
- package/dist/js/color-picker/color-picker.event.mjs +233 -0
- package/dist/js/color-picker/{form.color-picker.d.mts → color-picker.form.d.mts} +2 -2
- package/dist/js/color-picker/{form.color-picker.mjs → color-picker.form.mjs} +9 -8
- package/dist/js/color-picker/color-picker.misc.d.mts +2 -0
- package/dist/js/color-picker/color-picker.misc.mjs +104 -0
- package/dist/js/color-picker/color-picker.model.d.mts +2 -0
- package/dist/js/color-picker/{models.color-picker.mjs → color-picker.model.mjs} +1 -1
- package/dist/js/color-picker/{output.color-picker.d.mts → color-picker.output.d.mts} +2 -2
- package/dist/js/color-picker/{output.color-picker.mjs → color-picker.output.mjs} +19 -18
- package/dist/js/color-picker/color-picker.state.d.mts +8 -0
- package/dist/js/color-picker/color-picker.state.mjs +168 -0
- package/dist/js/color-picker/index.d.mts +172 -2
- package/dist/js/color-picker/index.mjs +66 -59
- package/dist/js/color-picker.constants-BZgXQr5o.d.mts +177 -0
- package/dist/js/color-picker.misc-BIS3R6jk.d.mts +31 -0
- package/dist/js/combobox/combobox.constants.d.mts +2 -0
- package/dist/js/combobox/{constants.combobox.mjs → combobox.constants.mjs} +21 -21
- package/dist/js/combobox/combobox.dom.d.mts +25 -0
- package/dist/js/combobox/{dom.combobox.mjs → combobox.dom.mjs} +51 -49
- package/dist/js/combobox/{event.combobox.d.mts → combobox.event.d.mts} +9 -9
- package/dist/js/combobox/{event.combobox.mjs → combobox.event.mjs} +1 -1
- package/dist/js/combobox/combobox.misc.d.mts +2 -0
- package/dist/js/combobox/combobox.misc.mjs +2 -0
- package/dist/js/combobox/combobox.model.d.mts +2 -0
- package/dist/js/combobox/combobox.state.d.mts +9 -0
- package/dist/js/combobox/combobox.state.mjs +2 -0
- package/dist/js/combobox/index.d.mts +152 -2
- package/dist/js/combobox/index.mjs +54 -55
- package/dist/js/combobox.constants-Hb3bqqQJ.d.mts +19 -0
- package/dist/js/combobox.misc-DRDFk6X8.d.mts +26 -0
- package/dist/js/combobox.model-gjEI2VqZ.d.mts +46 -0
- package/dist/js/{state.combobox-BWDFHwoi.mjs → combobox.state-AstCICiH.mjs} +109 -106
- package/dist/js/dialog/dialog.model.d.mts +2 -0
- package/dist/js/dialog/dialog.model.mjs +11 -0
- package/dist/js/dialog/index.d.mts +12 -0
- package/dist/js/dialog/index.mjs +123 -0
- package/dist/js/dialog.model-HVzYWoDo.d.mts +45 -0
- package/dist/js/floatable/floatable.embedded.d.mts +2 -2
- package/dist/js/floatable/floatable.embedded.mjs +64 -92
- package/dist/js/floatable/floatable.model.d.mts +2 -0
- package/dist/js/floatable/floatable.model.mjs +23 -0
- package/dist/js/floatable/floatable.standalone.d.mts +2 -1
- package/dist/js/floatable.embedded-ncshL3Sa.d.mts +17 -0
- package/dist/js/{floatable.embedded-DQYkXt8X.d.mts → floatable.model-DXsQgoU7.d.mts} +13 -20
- package/dist/js/focus-trap/focus-trap.embedded.d.mts +2 -2
- package/dist/js/focus-trap/focus-trap.embedded.mjs +117 -138
- package/dist/js/focus-trap/focus-trap.model.d.mts +2 -0
- package/dist/js/focus-trap/focus-trap.model.mjs +15 -0
- package/dist/js/focus-trap/focus-trap.standalone.d.mts +2 -1
- package/dist/js/focus-trap.embedded-DpcPkP7c.d.mts +13 -0
- package/dist/js/{focus-trap.embedded-CjyFQYow.d.mts → focus-trap.model-CpltX5B5.d.mts} +16 -18
- package/dist/js/index.d.mts +26 -14
- package/dist/js/index.mjs +18 -17
- package/dist/js/internal/attributable.d.mts +1 -1
- package/dist/js/internal/attributable.mjs +3 -2
- package/dist/js/internal/draggable/draggable.model.d.mts +2 -0
- package/dist/js/internal/draggable/draggable.model.mjs +37 -0
- package/dist/js/internal/draggable/index.d.mts +13 -0
- package/dist/js/internal/draggable/index.mjs +243 -0
- package/dist/js/internal/l10n/index.d.mts +5 -0
- package/dist/js/internal/l10n/index.mjs +147 -0
- package/dist/js/internal/l10n/l10n.model.d.mts +2 -0
- package/dist/js/internal/l10n/l10n.model.mjs +12 -0
- package/dist/js/internal/misc.d.mts +3 -2
- package/dist/js/internal/misc.mjs +4 -6
- package/dist/js/internal/navigable/index.d.mts +6 -0
- package/dist/js/internal/navigable/index.mjs +125 -0
- package/dist/js/internal/navigable/navigable.model.d.mts +2 -0
- package/dist/js/internal/navigable/navigable.model.mjs +18 -0
- package/dist/js/internal/option-list/option-list.constants.d.mts +8 -0
- package/dist/js/internal/option-list/option-list.constants.mjs +22 -0
- package/dist/js/internal/option-list/option-list.data.d.mts +21 -0
- package/dist/js/internal/option-list/option-list.data.mjs +2 -0
- package/dist/js/internal/option-list/option-list.dom.d.mts +18 -0
- package/dist/js/internal/option-list/option-list.dom.mjs +2 -0
- package/dist/js/internal/option-list/option-list.event.d.mts +6 -0
- package/dist/js/internal/option-list/option-list.event.mjs +66 -0
- package/dist/js/internal/option-list/option-list.form.d.mts +7 -0
- package/dist/js/internal/option-list/option-list.form.mjs +53 -0
- package/dist/js/internal/option-list/option-list.misc.d.mts +13 -0
- package/dist/js/internal/option-list/option-list.misc.mjs +2 -0
- package/dist/js/internal/option-list/option-list.model.d.mts +2 -0
- package/dist/js/internal/option-list/option-list.state.d.mts +8 -0
- package/dist/js/internal/option-list/option-list.state.mjs +39 -0
- package/dist/js/l10n/index.d.mts +3 -0
- package/dist/js/l10n/index.mjs +2 -0
- package/dist/js/l10n.model-D1E1u35L.d.mts +54 -0
- package/dist/js/listbox/index.d.mts +9 -18
- package/dist/js/listbox/index.mjs +49 -52
- package/dist/js/listbox/listbox.constants.d.mts +2 -0
- package/dist/js/listbox/{constants.listbox.mjs → listbox.constants.mjs} +11 -15
- package/dist/js/listbox/listbox.dom.d.mts +5 -0
- package/dist/js/listbox/listbox.dom.mjs +2 -0
- package/dist/js/listbox/listbox.event.d.mts +9 -0
- package/dist/js/listbox/listbox.event.mjs +2 -0
- package/dist/js/listbox/listbox.misc.d.mts +2 -0
- package/dist/js/listbox/listbox.misc.mjs +2 -0
- package/dist/js/listbox/listbox.model.d.mts +2 -0
- package/dist/js/listbox/listbox.model.mjs +1 -0
- package/dist/js/listbox/listbox.state.d.mts +9 -0
- package/dist/js/listbox/listbox.state.mjs +2 -0
- package/dist/js/listbox.constants-DOBMwKup.d.mts +9 -0
- package/dist/js/listbox.misc-DwfB4Mu_.d.mts +24 -0
- package/dist/js/listbox.model-C0MYWXZe.d.mts +20 -0
- package/dist/js/listbox.state-BrN296BM.mjs +240 -0
- package/dist/js/menu/index.mjs +171 -0
- package/dist/js/menu/menu.model.d.mts +33 -0
- package/dist/js/menu/menu.model.mjs +15 -0
- package/dist/js/movable/movable.embedded.d.mts +2 -2
- package/dist/js/movable/movable.embedded.mjs +77 -86
- package/dist/js/movable/movable.model.d.mts +2 -0
- package/dist/js/movable/movable.model.mjs +12 -0
- package/dist/js/movable/movable.standalone.d.mts +2 -1
- package/dist/js/movable.embedded-C1bDTLGs.d.mts +11 -0
- package/dist/js/movable.model-D9nnPWKk.d.mts +186 -0
- package/dist/js/navigable.model-BqoR6iBv.d.mts +44 -0
- package/dist/js/option-list.data-CgMyUwPc.mjs +441 -0
- package/dist/js/option-list.model-CCPUlPeX.d.mts +169 -0
- package/dist/js/popover/index.d.mts +12 -0
- package/dist/js/{popover.mjs → popover/index.mjs} +41 -51
- package/dist/js/popover/popover.model.d.mts +2 -0
- package/dist/js/popover/popover.model.mjs +12 -0
- package/dist/js/popover.model-DiLdz0Hc.d.mts +38 -0
- package/dist/js/resizable/resizable.embedded.d.mts +2 -2
- package/dist/js/resizable/resizable.embedded.mjs +43 -58
- package/dist/js/resizable/resizable.model.d.mts +2 -0
- package/dist/js/resizable/resizable.model.mjs +21 -0
- package/dist/js/resizable/resizable.standalone.d.mts +2 -1
- package/dist/js/resizable.embedded-BemH-7Re.d.mts +11 -0
- package/dist/js/resizable.model-YEtcC9li.d.mts +46 -0
- package/dist/js/sortable/sortable.embedded.d.mts +2 -2
- package/dist/js/sortable/sortable.embedded.mjs +111 -116
- package/dist/js/sortable/sortable.model.d.mts +2 -0
- package/dist/js/sortable/sortable.model.mjs +24 -0
- package/dist/js/sortable/sortable.standalone.d.mts +2 -1
- package/dist/js/sortable.embedded-CrEGff9k.d.mts +11 -0
- package/dist/js/{splitter.d.mts → splitter/index.d.mts} +6 -4
- package/dist/js/{splitter.mjs → splitter/index.mjs} +90 -128
- package/dist/js/splitter/splitter.model.d.mts +2 -0
- package/dist/js/splitter/splitter.model.mjs +37 -0
- package/dist/js/splitter.model-C24W6eZ7.d.mts +57 -0
- package/dist/js/{tabs.d.mts → tabs/index.d.mts} +8 -8
- package/dist/js/{tabs.mjs → tabs/index.mjs} +58 -58
- package/dist/js/tabs/tabs.model.d.mts +2 -0
- package/dist/js/tabs/tabs.model.mjs +18 -0
- package/dist/js/tabs.model-BHPy7fPo.d.mts +40 -0
- package/dist/js/toolbar/index.mjs +27 -0
- package/dist/js/toolbar/toolbar.model.d.mts +11 -0
- package/dist/js/toolbar/toolbar.model.mjs +7 -0
- package/dist/js/tooltip/index.d.mts +19 -0
- package/dist/js/{tooltip.mjs → tooltip/index.mjs} +61 -86
- package/dist/js/tooltip/tooltip.model.d.mts +2 -0
- package/dist/js/tooltip/tooltip.model.mjs +15 -0
- package/dist/js/tooltip.model-BpNStw5z.d.mts +37 -0
- package/package.json +30 -24
- package/dist/js/color-picker/constants.color-picker.d.mts +0 -2
- package/dist/js/color-picker/event.color-picker.mjs +0 -2
- package/dist/js/color-picker/misc.color-picker.d.mts +0 -2
- package/dist/js/color-picker/misc.color-picker.mjs +0 -2
- package/dist/js/color-picker/models.color-picker.d.mts +0 -2
- package/dist/js/color-picker/state.color-picker.d.mts +0 -8
- package/dist/js/color-picker/state.color-picker.mjs +0 -2
- package/dist/js/combobox/constants.combobox.d.mts +0 -2
- package/dist/js/combobox/dom.combobox.d.mts +0 -26
- package/dist/js/combobox/misc.combobox.d.mts +0 -2
- package/dist/js/combobox/misc.combobox.mjs +0 -2
- package/dist/js/combobox/models.combobox.d.mts +0 -43
- package/dist/js/combobox/state.combobox.d.mts +0 -11
- package/dist/js/combobox/state.combobox.mjs +0 -2
- package/dist/js/constants.color-picker-B-gFjL8m.d.mts +0 -364
- package/dist/js/constants.combobox-8EMRmv09.d.mts +0 -18
- package/dist/js/constants.listbox-DGnX32kv.d.mts +0 -8
- package/dist/js/dialog.d.mts +0 -47
- package/dist/js/dialog.mjs +0 -131
- package/dist/js/draggable-B5-70SZm.d.mts +0 -155
- package/dist/js/event.color-picker-BEpq0Adu.mjs +0 -485
- package/dist/js/index-C5D3-oiI.d.mts +0 -177
- package/dist/js/internal/draggable.d.mts +0 -2
- package/dist/js/internal/draggable.mjs +0 -265
- package/dist/js/internal/listbox/listbox.constants.d.mts +0 -8
- package/dist/js/internal/listbox/listbox.constants.mjs +0 -22
- package/dist/js/internal/listbox/listbox.data.d.mts +0 -19
- package/dist/js/internal/listbox/listbox.data.mjs +0 -2
- package/dist/js/internal/listbox/listbox.dom.d.mts +0 -65
- package/dist/js/internal/listbox/listbox.dom.mjs +0 -2
- package/dist/js/internal/listbox/listbox.event.d.mts +0 -4
- package/dist/js/internal/listbox/listbox.event.mjs +0 -63
- package/dist/js/internal/listbox/listbox.form.d.mts +0 -5
- package/dist/js/internal/listbox/listbox.form.mjs +0 -53
- package/dist/js/internal/listbox/listbox.misc.d.mts +0 -11
- package/dist/js/internal/listbox/listbox.misc.mjs +0 -2
- package/dist/js/internal/listbox/listbox.model.d.mts +0 -2
- package/dist/js/internal/listbox/listbox.state.d.mts +0 -6
- package/dist/js/internal/listbox/listbox.state.mjs +0 -40
- package/dist/js/internal/navigable.d.mts +0 -36
- package/dist/js/internal/navigable.mjs +0 -135
- package/dist/js/l10n-Bn-7RcwR.d.mts +0 -20
- package/dist/js/l10n.d.mts +0 -2
- package/dist/js/l10n.mjs +0 -80
- package/dist/js/listbox/constants.listbox.d.mts +0 -2
- package/dist/js/listbox/event.listbox.d.mts +0 -7
- package/dist/js/listbox/event.listbox.mjs +0 -2
- package/dist/js/listbox/misc.listbox.d.mts +0 -2
- package/dist/js/listbox/misc.listbox.mjs +0 -2
- package/dist/js/listbox/state.listbox.d.mts +0 -10
- package/dist/js/listbox/state.listbox.mjs +0 -2
- package/dist/js/listbox.data-DQ7-x2uY.mjs +0 -425
- package/dist/js/listbox.model-BHPA7GM4.d.mts +0 -125
- package/dist/js/menu.mjs +0 -172
- package/dist/js/misc.listbox-DKB-j0UK.mjs +0 -196
- package/dist/js/misc.listbox-mZMuYOxg.d.mts +0 -20
- package/dist/js/popover.d.mts +0 -38
- package/dist/js/resizable.embedded-dvhdfQgt.d.mts +0 -34
- package/dist/js/toolbar.mjs +0 -31
- package/dist/js/tooltip.d.mts +0 -45
- /package/dist/js/combobox/{models.combobox.mjs → combobox.model.mjs} +0 -0
- /package/dist/js/internal/{listbox/listbox.model.mjs → option-list/option-list.model.mjs} +0 -0
- /package/dist/js/{menu.d.mts → menu/index.d.mts} +0 -0
- /package/dist/js/{toolbar.d.mts → toolbar/index.d.mts} +0 -0
|
@@ -1,2 +1,152 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { p as OuiLocalizations } from "../l10n.model-D1E1u35L.mjs";
|
|
2
|
+
import { _ as OptionListType } from "../option-list.model-CCPUlPeX.mjs";
|
|
3
|
+
import { a as COMBOBOX_SYMBOL, o as COMBOBOX_TAGNAME } from "../combobox.constants-Hb3bqqQJ.mjs";
|
|
4
|
+
import { a as OuiComboboxLocalizations, l as OuiComboboxState } from "../combobox.model-gjEI2VqZ.mjs";
|
|
5
|
+
import { i as setComboboxLocalizations } from "../combobox.misc-DRDFk6X8.mjs";
|
|
6
|
+
//#region src/js/combobox/index.d.ts
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
[COMBOBOX_TAGNAME]: OuiComboboxElement & {
|
|
10
|
+
[COMBOBOX_SYMBOL]: OuiComboboxState;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export interface OuiComboboxElement {
|
|
15
|
+
[COMBOBOX_SYMBOL]: OuiComboboxState;
|
|
16
|
+
}
|
|
17
|
+
export declare class OuiComboboxElement extends HTMLElement {
|
|
18
|
+
static formAssociated: boolean;
|
|
19
|
+
static observedAttributes: string[];
|
|
20
|
+
/**
|
|
21
|
+
* Is the combobox disabled?
|
|
22
|
+
*/
|
|
23
|
+
get disabled(): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Should the combobox be disabled?
|
|
26
|
+
*/
|
|
27
|
+
set disabled(value: boolean);
|
|
28
|
+
/**
|
|
29
|
+
* Current filter value
|
|
30
|
+
*/
|
|
31
|
+
get filter(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Set the filter value
|
|
34
|
+
*/
|
|
35
|
+
set filter(value: string);
|
|
36
|
+
/**
|
|
37
|
+
* Form element associated with the combobox
|
|
38
|
+
*/
|
|
39
|
+
get form(): HTMLFormElement | null;
|
|
40
|
+
/**
|
|
41
|
+
* Label elements associated with the combobox
|
|
42
|
+
*/
|
|
43
|
+
get labels(): NodeList;
|
|
44
|
+
get localizations(): OuiLocalizations<OuiComboboxLocalizations>;
|
|
45
|
+
/**
|
|
46
|
+
* Maximum number of selected options
|
|
47
|
+
*/
|
|
48
|
+
get max(): number | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Set the maximum number of selected options
|
|
51
|
+
*/
|
|
52
|
+
set max(value: number);
|
|
53
|
+
/**
|
|
54
|
+
* Minimum number of selected options
|
|
55
|
+
*/
|
|
56
|
+
get min(): number | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Set the minimum number of selected options
|
|
59
|
+
*/
|
|
60
|
+
set min(value: number);
|
|
61
|
+
/**
|
|
62
|
+
* Does the combobox allow multiple values?
|
|
63
|
+
*/
|
|
64
|
+
get multiple(): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Name of the combobox
|
|
67
|
+
*/
|
|
68
|
+
get name(): string;
|
|
69
|
+
/**
|
|
70
|
+
* Is the combobox readonly?
|
|
71
|
+
*/
|
|
72
|
+
get readonly(): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Should the combobox be readonly?
|
|
75
|
+
*/
|
|
76
|
+
set readonly(value: boolean);
|
|
77
|
+
/**
|
|
78
|
+
* Is the combobox required?
|
|
79
|
+
*/
|
|
80
|
+
get required(): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Should the combobox be required?
|
|
83
|
+
*/
|
|
84
|
+
set required(value: boolean);
|
|
85
|
+
/**
|
|
86
|
+
* Selected options
|
|
87
|
+
*/
|
|
88
|
+
get selected(): Element[];
|
|
89
|
+
/**
|
|
90
|
+
* Type of combobox
|
|
91
|
+
*/
|
|
92
|
+
get type(): OptionListType;
|
|
93
|
+
/**
|
|
94
|
+
* Validation message for the combobox
|
|
95
|
+
*/
|
|
96
|
+
get validationMessage(): string;
|
|
97
|
+
/**
|
|
98
|
+
* Validity state for the combobox
|
|
99
|
+
*/
|
|
100
|
+
get validity(): ValidityState;
|
|
101
|
+
/**
|
|
102
|
+
* Current value
|
|
103
|
+
*/
|
|
104
|
+
get value(): string;
|
|
105
|
+
/**
|
|
106
|
+
* Set the value
|
|
107
|
+
*/
|
|
108
|
+
set value(value: unknown);
|
|
109
|
+
/**
|
|
110
|
+
* Current values
|
|
111
|
+
*/
|
|
112
|
+
get values(): string[];
|
|
113
|
+
/**
|
|
114
|
+
* Set the values
|
|
115
|
+
*/
|
|
116
|
+
set values(values: unknown[]);
|
|
117
|
+
/**
|
|
118
|
+
* Can the combobox be validated?
|
|
119
|
+
*/
|
|
120
|
+
get willValidate(): boolean;
|
|
121
|
+
constructor();
|
|
122
|
+
attributeChangedCallback(name: string, _: string | null, value: string | null): void;
|
|
123
|
+
/**
|
|
124
|
+
* Check if the combobox is valid
|
|
125
|
+
*
|
|
126
|
+
* @returns `true` if the combobox is valid, otherwise `false`
|
|
127
|
+
*/
|
|
128
|
+
checkValidity(): boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Clear all selected options
|
|
131
|
+
*/
|
|
132
|
+
clear(): void;
|
|
133
|
+
connectedCallback(): void;
|
|
134
|
+
disconnectedCallback(): void;
|
|
135
|
+
formDisabledCallback(disabled: boolean): void;
|
|
136
|
+
formResetCallback(): void;
|
|
137
|
+
formStateRestoreCallback(state: unknown, reason: unknown): void;
|
|
138
|
+
/**
|
|
139
|
+
* Check if the combobox is valid and report any validation errors
|
|
140
|
+
*
|
|
141
|
+
* @returns `true` if the combobox is valid, otherwise `false`
|
|
142
|
+
*/
|
|
143
|
+
reportValidity(): boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Set a custom validation message for the combobox
|
|
146
|
+
*
|
|
147
|
+
* @param message Validation message
|
|
148
|
+
*/
|
|
149
|
+
setCustomValidity(message: string): void;
|
|
150
|
+
}
|
|
151
|
+
//#endregion
|
|
152
|
+
export { setComboboxLocalizations };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { D as setComboboxLocalizations, a as onDetachCombobox, i as onAttachCombobox, n as comboboxStates, r as createComboboxState } from "../state.combobox-BWDFHwoi.mjs";
|
|
1
|
+
import { C as setOptionListDisabled, D as setOptionListReadonly, O as setOptionListRequired, T as setOptionListLimit, a as setOptionListValue, o as setOptionListValues, w as setOptionListFilter } from "../option-list.data-CgMyUwPc.mjs";
|
|
2
|
+
import { attachOptionList, detachOptionList } from "../internal/option-list/option-list.state.mjs";
|
|
3
|
+
import { COMBOBOX_SYMBOL, COMBOBOX_TAGNAME } from "./combobox.constants.mjs";
|
|
4
|
+
import { D as setComboboxLocalizations, a as onDetachCombobox, i as onAttachCombobox, n as comboboxes, r as initializeCombobox } from "../combobox.state-AstCICiH.mjs";
|
|
6
5
|
import { getAttribute } from "@oscarpalmer/toretto/attribute";
|
|
7
6
|
import { parse } from "@oscarpalmer/atoms/string";
|
|
8
7
|
//#region src/js/combobox/index.ts
|
|
@@ -14,68 +13,68 @@ var OuiComboboxElement = class extends HTMLElement {
|
|
|
14
13
|
"required",
|
|
15
14
|
"value"
|
|
16
15
|
];
|
|
17
|
-
#internals;
|
|
18
|
-
#restored;
|
|
19
|
-
#state;
|
|
20
16
|
/**
|
|
21
17
|
* Is the combobox disabled?
|
|
22
18
|
*/
|
|
23
19
|
get disabled() {
|
|
24
|
-
return this
|
|
20
|
+
return this[COMBOBOX_SYMBOL].component?.disabled ?? false;
|
|
25
21
|
}
|
|
26
22
|
/**
|
|
27
23
|
* Should the combobox be disabled?
|
|
28
24
|
*/
|
|
29
25
|
set disabled(value) {
|
|
30
|
-
if (typeof value === "boolean" && value !== this.disabled)
|
|
26
|
+
if (typeof value === "boolean" && value !== this.disabled) setOptionListDisabled(this[COMBOBOX_SYMBOL], value);
|
|
31
27
|
}
|
|
32
28
|
/**
|
|
33
29
|
* Current filter value
|
|
34
30
|
*/
|
|
35
31
|
get filter() {
|
|
36
|
-
return this
|
|
32
|
+
return this[COMBOBOX_SYMBOL].component?.filter.element.value ?? "";
|
|
37
33
|
}
|
|
38
34
|
/**
|
|
39
35
|
* Set the filter value
|
|
40
36
|
*/
|
|
41
37
|
set filter(value) {
|
|
42
|
-
|
|
38
|
+
setOptionListFilter(this[COMBOBOX_SYMBOL], value);
|
|
43
39
|
}
|
|
44
40
|
/**
|
|
45
41
|
* Form element associated with the combobox
|
|
46
42
|
*/
|
|
47
43
|
get form() {
|
|
48
|
-
return this
|
|
44
|
+
return this[COMBOBOX_SYMBOL].form.internals.form;
|
|
49
45
|
}
|
|
50
46
|
/**
|
|
51
47
|
* Label elements associated with the combobox
|
|
52
48
|
*/
|
|
53
49
|
get labels() {
|
|
54
|
-
return this
|
|
50
|
+
return this[COMBOBOX_SYMBOL].form.internals.labels;
|
|
51
|
+
}
|
|
52
|
+
get localizations() {
|
|
53
|
+
return this[COMBOBOX_SYMBOL].component?.localizations;
|
|
55
54
|
}
|
|
56
55
|
/**
|
|
57
56
|
* Maximum number of selected options
|
|
58
57
|
*/
|
|
59
58
|
get max() {
|
|
60
|
-
return this
|
|
59
|
+
return this[COMBOBOX_SYMBOL].component?.max;
|
|
61
60
|
}
|
|
62
61
|
/**
|
|
63
62
|
* Set the maximum number of selected options
|
|
64
63
|
*/
|
|
65
64
|
set max(value) {
|
|
66
|
-
|
|
65
|
+
setOptionListLimit("max", this[COMBOBOX_SYMBOL], value);
|
|
67
66
|
}
|
|
68
67
|
/**
|
|
69
68
|
* Minimum number of selected options
|
|
70
69
|
*/
|
|
71
70
|
get min() {
|
|
72
|
-
return this
|
|
71
|
+
return this[COMBOBOX_SYMBOL].component?.min;
|
|
73
72
|
}
|
|
74
73
|
/**
|
|
75
74
|
* Set the minimum number of selected options
|
|
76
75
|
*/
|
|
77
76
|
set min(value) {
|
|
78
|
-
|
|
77
|
+
setOptionListLimit("min", this[COMBOBOX_SYMBOL], value);
|
|
79
78
|
}
|
|
80
79
|
/**
|
|
81
80
|
* Does the combobox allow multiple values?
|
|
@@ -93,93 +92,97 @@ var OuiComboboxElement = class extends HTMLElement {
|
|
|
93
92
|
* Is the combobox readonly?
|
|
94
93
|
*/
|
|
95
94
|
get readonly() {
|
|
96
|
-
return this
|
|
95
|
+
return this[COMBOBOX_SYMBOL].component?.readonly ?? false;
|
|
97
96
|
}
|
|
98
97
|
/**
|
|
99
98
|
* Should the combobox be readonly?
|
|
100
99
|
*/
|
|
101
100
|
set readonly(value) {
|
|
102
|
-
if (typeof value === "boolean" && value !== this.readonly)
|
|
101
|
+
if (typeof value === "boolean" && value !== this.readonly) setOptionListReadonly(this[COMBOBOX_SYMBOL], value);
|
|
103
102
|
}
|
|
104
103
|
/**
|
|
105
104
|
* Is the combobox required?
|
|
106
105
|
*/
|
|
107
106
|
get required() {
|
|
108
|
-
return this
|
|
107
|
+
return this[COMBOBOX_SYMBOL].component?.required ?? false;
|
|
109
108
|
}
|
|
110
109
|
/**
|
|
111
110
|
* Should the combobox be required?
|
|
112
111
|
*/
|
|
113
112
|
set required(value) {
|
|
114
|
-
if (typeof value === "boolean" && value !== this.required)
|
|
113
|
+
if (typeof value === "boolean" && value !== this.required) setOptionListRequired(this[COMBOBOX_SYMBOL], value);
|
|
115
114
|
}
|
|
116
115
|
/**
|
|
117
116
|
* Selected options
|
|
118
117
|
*/
|
|
119
118
|
get selected() {
|
|
120
|
-
return this
|
|
119
|
+
return this[COMBOBOX_SYMBOL].component?.options.selected.slice() ?? [];
|
|
121
120
|
}
|
|
122
121
|
/**
|
|
123
122
|
* Type of combobox
|
|
124
123
|
*/
|
|
125
124
|
get type() {
|
|
126
|
-
return this
|
|
125
|
+
return this[COMBOBOX_SYMBOL].component?.type;
|
|
127
126
|
}
|
|
128
127
|
/**
|
|
129
128
|
* Validation message for the combobox
|
|
130
129
|
*/
|
|
131
130
|
get validationMessage() {
|
|
132
|
-
return this
|
|
131
|
+
return this[COMBOBOX_SYMBOL].form.internals.validationMessage;
|
|
133
132
|
}
|
|
134
133
|
/**
|
|
135
134
|
* Validity state for the combobox
|
|
136
135
|
*/
|
|
137
136
|
get validity() {
|
|
138
|
-
return this
|
|
137
|
+
return this[COMBOBOX_SYMBOL].form.internals.validity;
|
|
139
138
|
}
|
|
140
139
|
/**
|
|
141
140
|
* Current value
|
|
142
141
|
*/
|
|
143
142
|
get value() {
|
|
144
|
-
return this
|
|
143
|
+
return this[COMBOBOX_SYMBOL].component?.values.current[0] ?? "";
|
|
145
144
|
}
|
|
146
145
|
/**
|
|
147
146
|
* Set the value
|
|
148
147
|
*/
|
|
149
148
|
set value(value) {
|
|
150
|
-
|
|
149
|
+
setOptionListValue(this[COMBOBOX_SYMBOL], value);
|
|
151
150
|
}
|
|
152
151
|
/**
|
|
153
152
|
* Current values
|
|
154
153
|
*/
|
|
155
154
|
get values() {
|
|
156
|
-
return this
|
|
155
|
+
return this[COMBOBOX_SYMBOL].component?.values.current.slice() ?? [];
|
|
157
156
|
}
|
|
158
157
|
/**
|
|
159
158
|
* Set the values
|
|
160
159
|
*/
|
|
161
160
|
set values(values) {
|
|
162
|
-
|
|
161
|
+
setOptionListValues(this[COMBOBOX_SYMBOL], values);
|
|
163
162
|
}
|
|
164
163
|
/**
|
|
165
164
|
* Can the combobox be validated?
|
|
166
165
|
*/
|
|
167
166
|
get willValidate() {
|
|
168
|
-
return this
|
|
167
|
+
return this[COMBOBOX_SYMBOL].form.internals.willValidate;
|
|
169
168
|
}
|
|
170
169
|
constructor() {
|
|
171
170
|
super();
|
|
172
|
-
this
|
|
171
|
+
this[COMBOBOX_SYMBOL] = {
|
|
172
|
+
component: void 0,
|
|
173
|
+
form: { internals: this.attachInternals() }
|
|
174
|
+
};
|
|
173
175
|
}
|
|
174
176
|
attributeChangedCallback(name, _, value) {
|
|
175
|
-
|
|
177
|
+
const state = this[COMBOBOX_SYMBOL];
|
|
178
|
+
if (state == null) return;
|
|
176
179
|
switch (name) {
|
|
177
180
|
case "required":
|
|
178
181
|
this[name] = this.hasAttribute(name);
|
|
179
182
|
break;
|
|
180
183
|
case "max":
|
|
181
184
|
case "min":
|
|
182
|
-
|
|
185
|
+
setOptionListLimit(name, state, value);
|
|
183
186
|
break;
|
|
184
187
|
case "value": this.value = value ?? "";
|
|
185
188
|
}
|
|
@@ -190,33 +193,40 @@ var OuiComboboxElement = class extends HTMLElement {
|
|
|
190
193
|
* @returns `true` if the combobox is valid, otherwise `false`
|
|
191
194
|
*/
|
|
192
195
|
checkValidity() {
|
|
193
|
-
return this
|
|
196
|
+
return this[COMBOBOX_SYMBOL].form.internals.checkValidity();
|
|
194
197
|
}
|
|
195
198
|
/**
|
|
196
199
|
* Clear all selected options
|
|
197
200
|
*/
|
|
198
201
|
clear() {
|
|
199
|
-
|
|
202
|
+
setOptionListValues(this[COMBOBOX_SYMBOL], []);
|
|
200
203
|
}
|
|
201
204
|
connectedCallback() {
|
|
202
|
-
|
|
203
|
-
|
|
205
|
+
const state = this[COMBOBOX_SYMBOL];
|
|
206
|
+
if (state.component == null) initializeCombobox(this, state);
|
|
207
|
+
else attachOptionList(state, comboboxes, onAttachCombobox);
|
|
204
208
|
}
|
|
205
209
|
disconnectedCallback() {
|
|
206
|
-
|
|
210
|
+
const state = this[COMBOBOX_SYMBOL];
|
|
211
|
+
if (state.component != null) detachOptionList(state, comboboxes, onDetachCombobox);
|
|
207
212
|
}
|
|
208
213
|
formDisabledCallback(disabled) {
|
|
209
214
|
this.disabled = disabled;
|
|
210
215
|
}
|
|
211
216
|
formResetCallback() {
|
|
212
|
-
|
|
217
|
+
const state = this[COMBOBOX_SYMBOL];
|
|
218
|
+
if (state.component != null) setOptionListValues(state, state.component.values.initial);
|
|
213
219
|
}
|
|
214
220
|
formStateRestoreCallback(state, reason) {
|
|
215
221
|
if (reason !== "restore") return;
|
|
216
222
|
const parsed = typeof state === "string" ? parse(state) : void 0;
|
|
217
223
|
if (!Array.isArray(parsed)) return;
|
|
218
|
-
|
|
219
|
-
|
|
224
|
+
const { component, form } = this[COMBOBOX_SYMBOL];
|
|
225
|
+
if (component == null) form.restored = parsed;
|
|
226
|
+
else setOptionListValues({
|
|
227
|
+
component,
|
|
228
|
+
form
|
|
229
|
+
}, parsed);
|
|
220
230
|
}
|
|
221
231
|
/**
|
|
222
232
|
* Check if the combobox is valid and report any validation errors
|
|
@@ -224,7 +234,7 @@ var OuiComboboxElement = class extends HTMLElement {
|
|
|
224
234
|
* @returns `true` if the combobox is valid, otherwise `false`
|
|
225
235
|
*/
|
|
226
236
|
reportValidity() {
|
|
227
|
-
return this
|
|
237
|
+
return this[COMBOBOX_SYMBOL].form.internals.reportValidity();
|
|
228
238
|
}
|
|
229
239
|
/**
|
|
230
240
|
* Set a custom validation message for the combobox
|
|
@@ -232,18 +242,7 @@ var OuiComboboxElement = class extends HTMLElement {
|
|
|
232
242
|
* @param message Validation message
|
|
233
243
|
*/
|
|
234
244
|
setCustomValidity(message) {
|
|
235
|
-
this
|
|
236
|
-
}
|
|
237
|
-
setLocalizations(first, second) {
|
|
238
|
-
updateLocalizations(this.#state.localizations.global, typeof first === "string" ? { [first]: second } : first, this.#state.localizations.component);
|
|
239
|
-
}
|
|
240
|
-
#initialize() {
|
|
241
|
-
this.tabIndex = -1;
|
|
242
|
-
this.#state = createComboboxState(this, this.#internals);
|
|
243
|
-
if (this.#restored != null) {
|
|
244
|
-
setListboxValues(this.#state, this.#restored);
|
|
245
|
-
this.#restored = void 0;
|
|
246
|
-
}
|
|
245
|
+
this[COMBOBOX_SYMBOL].form.internals.setValidity({ customError: message !== "" }, message, this);
|
|
247
246
|
}
|
|
248
247
|
};
|
|
249
248
|
customElements.define(COMBOBOX_TAGNAME, OuiComboboxElement);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { c as OptionListAttributes, u as OptionListAutoCompleteType } from "./option-list.model-CCPUlPeX.mjs";
|
|
2
|
+
//#region src/js/combobox/combobox.constants.d.ts
|
|
3
|
+
declare const COMBOBOX_TAGNAME = "oui-combobox";
|
|
4
|
+
declare const COMBOBOX_ATTRIBUTE_ANCHOR: string;
|
|
5
|
+
declare const COMBOBOX_ATTRIBUTE_SELECTION: string;
|
|
6
|
+
declare const COMBOBOX_ATTRIBUTE_SELECTION_ITEM: string;
|
|
7
|
+
declare const COMBOBOX_AUTOCOMPLETES: Set<OptionListAutoCompleteType>;
|
|
8
|
+
declare const COMBOBOX_SYMBOL: unique symbol;
|
|
9
|
+
declare const comboboxAttributes: OptionListAttributes;
|
|
10
|
+
declare const messageLabel: string;
|
|
11
|
+
declare const messageSelect: string;
|
|
12
|
+
declare const comboboxMessages: Record<string, string>;
|
|
13
|
+
declare const selectorAnchor: string;
|
|
14
|
+
declare const selectorContent: string;
|
|
15
|
+
declare const selectorOption: string;
|
|
16
|
+
declare const selectorSelectionItem: string;
|
|
17
|
+
declare const comboboxSelectors: Record<string, string>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { COMBOBOX_SYMBOL as a, comboboxMessages as c, messageSelect as d, selectorAnchor as f, selectorSelectionItem as h, COMBOBOX_AUTOCOMPLETES as i, comboboxSelectors as l, selectorOption as m, COMBOBOX_ATTRIBUTE_SELECTION as n, COMBOBOX_TAGNAME as o, selectorContent as p, COMBOBOX_ATTRIBUTE_SELECTION_ITEM as r, comboboxAttributes as s, COMBOBOX_ATTRIBUTE_ANCHOR as t, messageLabel as u };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { l as OptionListAutoComplete, p as OptionListLocalizationValues } from "./option-list.model-CCPUlPeX.mjs";
|
|
2
|
+
//#region src/js/combobox/combobox.misc.d.ts
|
|
3
|
+
declare function getComboboxAutoComplete(element: Element, select: boolean): OptionListAutoComplete;
|
|
4
|
+
declare function getComboboxId(): string;
|
|
5
|
+
declare function hasTextSelection(element: Element): element is HTMLInputElement;
|
|
6
|
+
/**
|
|
7
|
+
* Set combobox localizations for a specific language
|
|
8
|
+
*
|
|
9
|
+
* @param language Language code
|
|
10
|
+
* @param localizations Localizations for language
|
|
11
|
+
*/
|
|
12
|
+
declare function setComboboxLocalizations(language: string, localizations: Partial<OptionListLocalizationValues>): void;
|
|
13
|
+
/**
|
|
14
|
+
* Set default combobox localizations
|
|
15
|
+
*
|
|
16
|
+
* @param localizations Default localizations
|
|
17
|
+
*/
|
|
18
|
+
declare function setComboboxLocalizations(localizations: Partial<OptionListLocalizationValues>, defaults: true): void;
|
|
19
|
+
/**
|
|
20
|
+
* Set combobox localizations for one or more languages
|
|
21
|
+
*
|
|
22
|
+
* @param localizations Localizations for one or more languages
|
|
23
|
+
*/
|
|
24
|
+
declare function setComboboxLocalizations(localizations: Record<string, Partial<OptionListLocalizationValues>>): void;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { setComboboxLocalizations as i, getComboboxId as n, hasTextSelection as r, getComboboxAutoComplete as t };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { c as OuiFloatable } from "./floatable.model-DXsQgoU7.mjs";
|
|
2
|
+
import { _ as OptionListType, g as OptionListState, p as OptionListLocalizationValues } from "./option-list.model-CCPUlPeX.mjs";
|
|
3
|
+
//#region src/js/combobox/combobox.model.d.ts
|
|
4
|
+
type OuiComboboxAnchor = {
|
|
5
|
+
container?: Element;
|
|
6
|
+
element: HTMLElement;
|
|
7
|
+
};
|
|
8
|
+
type OuiComboboxFilter = {
|
|
9
|
+
element: HTMLInputElement;
|
|
10
|
+
value: string;
|
|
11
|
+
};
|
|
12
|
+
type OuiComboboxGroup = {
|
|
13
|
+
element: Element;
|
|
14
|
+
header: Element;
|
|
15
|
+
options: Element[];
|
|
16
|
+
};
|
|
17
|
+
type OuiComboboxLabel = {
|
|
18
|
+
element: HTMLLabelElement;
|
|
19
|
+
id: string;
|
|
20
|
+
};
|
|
21
|
+
type OuiComboboxLocalizations = OptionListLocalizationValues;
|
|
22
|
+
type OuiComboboxOptions = {
|
|
23
|
+
all: Element[];
|
|
24
|
+
selected: Element[];
|
|
25
|
+
};
|
|
26
|
+
type OuiComboboxSelection = {
|
|
27
|
+
container: Element;
|
|
28
|
+
items: OuiComboboxSelectionItem[];
|
|
29
|
+
};
|
|
30
|
+
type OuiComboboxSelectionItem = {
|
|
31
|
+
button: HTMLButtonElement;
|
|
32
|
+
element: Element;
|
|
33
|
+
};
|
|
34
|
+
type OuiComboboxState = OptionListState<OuiComboboxStateExtras, OuiComboboxLocalizations>;
|
|
35
|
+
type OuiComboboxStateExtras = {
|
|
36
|
+
anchor: OuiComboboxAnchor;
|
|
37
|
+
floatable: OuiFloatable;
|
|
38
|
+
selection?: OuiComboboxSelection;
|
|
39
|
+
type: OptionListType;
|
|
40
|
+
};
|
|
41
|
+
type OuiComboboxValues = {
|
|
42
|
+
current: string[];
|
|
43
|
+
initial: string[];
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { OuiComboboxLocalizations as a, OuiComboboxSelectionItem as c, OuiComboboxValues as d, OuiComboboxLabel as i, OuiComboboxState as l, OuiComboboxFilter as n, OuiComboboxOptions as o, OuiComboboxGroup as r, OuiComboboxSelection as s, OuiComboboxAnchor as t, OuiComboboxStateExtras as u };
|