@oscarpalmer/oui 0.34.0 → 0.36.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.
Files changed (93) hide show
  1. package/dist/css/combobox.css +1 -1
  2. package/dist/css/listbox.css +152 -0
  3. package/dist/js/combobox/constants.combobox.d.mts +2 -2
  4. package/dist/js/combobox/constants.combobox.mjs +40 -33
  5. package/dist/js/combobox/dom.combobox.d.mts +8 -91
  6. package/dist/js/combobox/dom.combobox.mjs +204 -2
  7. package/dist/js/combobox/event.combobox.d.mts +14 -8
  8. package/dist/js/combobox/event.combobox.mjs +2 -2
  9. package/dist/js/combobox/index.d.mts +1 -1
  10. package/dist/js/combobox/index.mjs +21 -18
  11. package/dist/js/combobox/misc.combobox.d.mts +2 -14
  12. package/dist/js/combobox/misc.combobox.mjs +2 -2
  13. package/dist/js/combobox/models.combobox.d.mts +44 -2
  14. package/dist/js/combobox/state.combobox.d.mts +9 -8
  15. package/dist/js/combobox/state.combobox.mjs +2 -2
  16. package/dist/js/constants.combobox-DmRAMC64.d.mts +26 -0
  17. package/dist/js/constants.listbox-DRsXUxd3.d.mts +14 -0
  18. package/dist/js/index-EfkUSals.d.mts +139 -0
  19. package/dist/js/index.d.mts +4 -2
  20. package/dist/js/index.mjs +4 -2
  21. package/dist/js/internal/attributable.mjs +4 -3
  22. package/dist/js/internal/listbox/listbox.constants.d.mts +11 -0
  23. package/dist/js/internal/listbox/listbox.constants.mjs +23 -0
  24. package/dist/js/internal/listbox/listbox.data.d.mts +20 -0
  25. package/dist/js/internal/listbox/listbox.data.mjs +2 -0
  26. package/dist/js/internal/listbox/listbox.dom.d.mts +66 -0
  27. package/dist/js/internal/listbox/listbox.dom.mjs +2 -0
  28. package/dist/js/internal/listbox/listbox.event.d.mts +5 -0
  29. package/dist/js/internal/listbox/listbox.event.mjs +63 -0
  30. package/dist/js/internal/listbox/listbox.form.d.mts +6 -0
  31. package/dist/js/internal/listbox/listbox.form.mjs +52 -0
  32. package/dist/js/internal/listbox/listbox.misc.d.mts +12 -0
  33. package/dist/js/internal/listbox/listbox.misc.mjs +2 -0
  34. package/dist/js/internal/listbox/listbox.model.d.mts +2 -0
  35. package/dist/js/internal/listbox/listbox.model.mjs +1 -0
  36. package/dist/js/internal/listbox/listbox.state.d.mts +7 -0
  37. package/dist/js/internal/listbox/listbox.state.mjs +40 -0
  38. package/dist/js/internal/misc.d.mts +6 -0
  39. package/dist/js/internal/misc.mjs +13 -0
  40. package/dist/js/l10n-Bn-7RcwR.d.mts +20 -0
  41. package/dist/js/l10n.d.mts +2 -0
  42. package/dist/js/l10n.mjs +80 -0
  43. package/dist/js/listbox/constants.listbox.d.mts +2 -0
  44. package/dist/js/listbox/constants.listbox.mjs +40 -0
  45. package/dist/js/listbox/event.listbox.d.mts +8 -0
  46. package/dist/js/listbox/event.listbox.mjs +2 -0
  47. package/dist/js/listbox/index.d.mts +116 -0
  48. package/dist/js/listbox/index.mjs +189 -0
  49. package/dist/js/listbox/misc.listbox.d.mts +2 -0
  50. package/dist/js/listbox/misc.listbox.mjs +2 -0
  51. package/dist/js/listbox/state.listbox.d.mts +11 -0
  52. package/dist/js/listbox/state.listbox.mjs +2 -0
  53. package/dist/js/listbox.data-BWd0PCy7.mjs +424 -0
  54. package/dist/js/listbox.model-CRReGOmu.d.mts +125 -0
  55. package/dist/js/misc.listbox-BI-XsTOf.mjs +197 -0
  56. package/dist/js/misc.listbox-gnoJhrTr.d.mts +20 -0
  57. package/dist/js/sortable/sortable.embedded.mjs +4 -2
  58. package/dist/js/state.combobox-4xq0FPCF.mjs +365 -0
  59. package/package.json +7 -3
  60. package/src/css/combobox.scss +1 -1
  61. package/src/css/listbox.scss +149 -0
  62. package/src/js/combobox/constants.combobox.ts +46 -25
  63. package/src/js/combobox/dom.combobox.ts +65 -452
  64. package/src/js/combobox/event.combobox.ts +129 -218
  65. package/src/js/combobox/index.ts +43 -30
  66. package/src/js/combobox/misc.combobox.ts +60 -94
  67. package/src/js/combobox/models.combobox.ts +7 -47
  68. package/src/js/combobox/state.combobox.ts +136 -125
  69. package/src/js/index.ts +1 -0
  70. package/src/js/internal/listbox/listbox.constants.ts +25 -0
  71. package/src/js/{combobox/data.combobox.ts → internal/listbox/listbox.data.ts} +94 -43
  72. package/src/js/internal/listbox/listbox.dom.ts +445 -0
  73. package/src/js/internal/listbox/listbox.event.ts +129 -0
  74. package/src/js/{combobox/form.combobox.ts → internal/listbox/listbox.form.ts} +33 -33
  75. package/src/js/internal/listbox/listbox.misc.ts +135 -0
  76. package/src/js/internal/listbox/listbox.model.ts +169 -0
  77. package/src/js/internal/listbox/listbox.state.ts +82 -0
  78. package/src/js/internal/misc.ts +27 -0
  79. package/src/js/l10n.ts +192 -0
  80. package/src/js/listbox/constants.listbox.ts +61 -0
  81. package/src/js/listbox/event.listbox.ts +106 -0
  82. package/src/js/listbox/index.ts +302 -0
  83. package/src/js/listbox/misc.listbox.ts +70 -0
  84. package/src/js/listbox/state.listbox.ts +196 -0
  85. package/dist/js/combobox/data.combobox.d.mts +0 -18
  86. package/dist/js/combobox/data.combobox.mjs +0 -2
  87. package/dist/js/combobox/form.combobox.d.mts +0 -6
  88. package/dist/js/combobox/form.combobox.mjs +0 -2
  89. package/dist/js/combobox/i18n.combobox.d.mts +0 -2
  90. package/dist/js/combobox/i18n.combobox.mjs +0 -2
  91. package/dist/js/constants.combobox-DqNUGBLS.d.mts +0 -243
  92. package/dist/js/data.combobox-8RwBv5ey.mjs +0 -1077
  93. package/src/js/combobox/i18n.combobox.ts +0 -179
@@ -0,0 +1,70 @@
1
+ import {updateListboxMessage, updateListboxValueLabel} from '../internal/listbox/listbox.dom';
2
+ import type {OuiListboxLocalizations} from '../internal/listbox/listbox.model';
3
+ import {OuiLocalizations, updateLocalizations} from '../l10n';
4
+ import {listboxLocalizations, listboxStates} from './state.listbox';
5
+
6
+ // #region Functions
7
+
8
+ export function getListboxId(): string {
9
+ index += 1;
10
+
11
+ return `oui_listbox_${index}`;
12
+ }
13
+
14
+ /**
15
+ * Set listbox localizations for a specific language
16
+ *
17
+ * @param language Language code
18
+ * @param localizations Localizations for language
19
+ */
20
+ export function setListboxLocalizations(
21
+ language: string,
22
+ localizations: Partial<OuiListboxLocalizations>,
23
+ ): void;
24
+
25
+ /**
26
+ * Set listbox localizations for one or more languages
27
+ *
28
+ * @param localizations Localizations for one or more languages
29
+ */
30
+ export function setListboxLocalizations(
31
+ localizations: Record<string, Partial<OuiListboxLocalizations>>,
32
+ ): void;
33
+
34
+ export function setListboxLocalizations(
35
+ first: string | Record<string, Partial<OuiListboxLocalizations>>,
36
+ second?: Partial<OuiListboxLocalizations>,
37
+ ): void {
38
+ updateListboxLocalizations(listboxLocalizations, listboxLocalizations.values, first, second);
39
+ }
40
+
41
+ export function updateListboxLocalizations(
42
+ instance: OuiLocalizations<OuiListboxLocalizations>,
43
+ destination: Record<string, Partial<OuiListboxLocalizations>>,
44
+ first: string | Record<string, Partial<OuiListboxLocalizations>>,
45
+ second?: Partial<OuiListboxLocalizations>,
46
+ ): void {
47
+ updateLocalizations(
48
+ instance,
49
+ typeof first === 'string'
50
+ ? {
51
+ [first]: second!,
52
+ }
53
+ : first,
54
+ destination,
55
+ () => {
56
+ for (const state of listboxStates.set) {
57
+ updateListboxMessage(state);
58
+ updateListboxValueLabel(state);
59
+ }
60
+ },
61
+ );
62
+ }
63
+
64
+ // #endregion
65
+
66
+ // #region Variables
67
+
68
+ let index = 0;
69
+
70
+ // #endregion
@@ -0,0 +1,196 @@
1
+ import {noop} from '@oscarpalmer/atoms/function';
2
+ import {setAttribute, setAttributes} from '@oscarpalmer/toretto/attribute';
3
+ import {getData} from '@oscarpalmer/toretto/data';
4
+ import {createListboxContent} from '../internal/listbox/listbox.dom';
5
+ import {generateListboxIds} from '../internal/listbox/listbox.misc';
6
+ import type {
7
+ OuiListboxAutoCompleteType,
8
+ OuiListboxCallbacks,
9
+ OuiListboxLocalizations,
10
+ OuiListboxState,
11
+ OuiListboxStates,
12
+ } from '../internal/listbox/listbox.model';
13
+ import {initializeListboxState} from '../internal/listbox/listbox.state';
14
+ import {getBooleanAriaValue} from '../internal/misc';
15
+ import {getLocalizations} from '../l10n';
16
+ import {LISTBOX_ATTRIBUTES, LISTBOX_MESSAGES} from './constants.listbox';
17
+ import {
18
+ onListboxEnter,
19
+ onListboxFilter,
20
+ onListboxNavigation,
21
+ onListboxToggle,
22
+ } from './event.listbox';
23
+ import type {OuiListboxElement} from './index';
24
+ import {getListboxId} from './misc.listbox';
25
+
26
+ // #region Functions
27
+
28
+ export function createListboxState(
29
+ element: OuiListboxElement,
30
+ internals: ElementInternals,
31
+ ): OuiListboxState {
32
+ const select = element.querySelector('select');
33
+
34
+ if (select == null) {
35
+ throw new Error(LISTBOX_MESSAGES.select);
36
+ }
37
+
38
+ const label = element.querySelector(`label[for="${select.id}"]`) as HTMLLabelElement;
39
+
40
+ if (label == null) {
41
+ throw new Error(LISTBOX_MESSAGES.label);
42
+ }
43
+
44
+ element.id = select.id;
45
+
46
+ setAttribute(element, 'name', select.name === '' ? select.id : select.name);
47
+
48
+ const disabled = getBooleanAriaValue(element, 'disabled') || select.disabled;
49
+ const multiple = element.multiple || select.multiple;
50
+ const readonly = getBooleanAriaValue(element, 'readonly');
51
+ const required = getBooleanAriaValue(element, 'required') || select.required;
52
+
53
+ setAttributes(element, {
54
+ autocomplete: 'none',
55
+ name: select.name === '' ? select.id : select.name,
56
+ });
57
+
58
+ const id = getListboxId();
59
+
60
+ const labelId = label.id;
61
+
62
+ label.htmlFor = id;
63
+ label.id = `${id}_label`;
64
+
65
+ generateListboxIds(id, select);
66
+
67
+ const type = 'select';
68
+
69
+ const content = createListboxContent({
70
+ element,
71
+ id,
72
+ label,
73
+ multiple,
74
+ select,
75
+ type,
76
+ attributes: LISTBOX_ATTRIBUTES,
77
+ autocomplete: listboxAutoComplete,
78
+ listbox: true,
79
+ });
80
+
81
+ const {selected} = content.list.options;
82
+
83
+ const values =
84
+ selected.length === 0 ? [''] : selected.map(option => getData(option, 'value', false) ?? '');
85
+
86
+ const state: OuiListboxState = {
87
+ disabled,
88
+ id,
89
+ internals,
90
+ message: content.message,
91
+ multiple,
92
+ readonly,
93
+ required,
94
+ select,
95
+ type,
96
+ active: selected[0],
97
+ attributes: LISTBOX_ATTRIBUTES,
98
+ autocomplete: listboxAutoComplete,
99
+ callbacks: listboxCallbacks,
100
+ content: content.element,
101
+ elements: [element, content.filter!.element],
102
+ filter: {
103
+ element: content.filter!.element,
104
+ value: '',
105
+ },
106
+ host: element,
107
+ label: {
108
+ id: labelId,
109
+ element: label,
110
+ },
111
+ list: content.list.element,
112
+ listeners: [],
113
+ listbox: true,
114
+ localizations: {
115
+ component: {},
116
+ global: listboxLocalizations,
117
+ },
118
+ name: element.name,
119
+ options: content.list.options,
120
+ values: {
121
+ current: values.slice(),
122
+ initial: values.slice(),
123
+ label: content.value,
124
+ },
125
+ };
126
+
127
+ return initializeListboxState(state, listboxStates, onAttachListbox);
128
+ }
129
+
130
+ // #endregion
131
+
132
+ // #region Functions
133
+
134
+ export function onAttachListbox(state: OuiListboxState): void {
135
+ const {content, select} = state;
136
+
137
+ select.hidden = true;
138
+
139
+ select.insertAdjacentElement('afterend', content);
140
+
141
+ select.remove();
142
+ }
143
+
144
+ export function onDetachListbox(state: OuiListboxState): void {
145
+ const {content, select} = state;
146
+
147
+ content.insertAdjacentElement('beforebegin', select);
148
+
149
+ content.remove();
150
+
151
+ select.hidden = false;
152
+ }
153
+
154
+ // #endregion
155
+
156
+ // #region Variables
157
+
158
+ const listboxAutoComplete: Record<OuiListboxAutoCompleteType, boolean> = {
159
+ both: false,
160
+ inline: false,
161
+ list: false,
162
+ none: true,
163
+ };
164
+
165
+ const listboxCallbacks: OuiListboxCallbacks = {
166
+ data: {
167
+ onApply: noop,
168
+ onFilter: onListboxFilter,
169
+ onForm: noop,
170
+ onPreview: noop,
171
+ onToggle: onListboxToggle,
172
+ },
173
+ keydown: {
174
+ onEnter: onListboxEnter,
175
+ onNavigation: onListboxNavigation,
176
+ onToggle: onListboxToggle,
177
+ },
178
+ };
179
+
180
+ export const listboxLocalizations = getLocalizations<OuiListboxLocalizations>({
181
+ empty: 'No results found',
182
+ input: '',
183
+ invalid: 'Please select an option from the list',
184
+ max: max => `Please select fewer options (maximum is ${max})`,
185
+ min: min => `Please select more options (minimum is ${min})`,
186
+ remove: '',
187
+ results: amount => `${amount} results available`,
188
+ selected: amount => `${amount} selected`,
189
+ });
190
+
191
+ export const listboxStates: OuiListboxStates = {
192
+ map: new WeakMap(),
193
+ set: new Set(),
194
+ };
195
+
196
+ // #endregion
@@ -1,18 +0,0 @@
1
- import { I as OuiComboboxState } from "../constants.combobox-DqNUGBLS.mjs";
2
- //#region src/js/combobox/data.combobox.d.ts
3
- type ApplySelectionParameters = {
4
- added: boolean;
5
- emit?: boolean;
6
- option?: HTMLElement;
7
- selected?: HTMLElement[];
8
- state: OuiComboboxState;
9
- values?: string[];
10
- };
11
- declare function applyComboboxSelection(parameters: ApplySelectionParameters): void;
12
- declare function filterComboboxOption(state: OuiComboboxState, value: unknown, textContent?: boolean): HTMLElement | undefined;
13
- declare function filterComboboxOptions(state: OuiComboboxState): HTMLElement | undefined;
14
- declare function setComboboxValue(state: OuiComboboxState, value: unknown, emit?: boolean): void;
15
- declare function setComboboxValues(state: OuiComboboxState, value: unknown, emit?: boolean): void;
16
- declare function toggleComboboxOption(state: OuiComboboxState, option?: HTMLElement): void;
17
- //#endregion
18
- export { applyComboboxSelection, filterComboboxOption, filterComboboxOptions, setComboboxValue, setComboboxValues, toggleComboboxOption };
@@ -1,2 +0,0 @@
1
- import { a as setComboboxValues, i as setComboboxValue, n as filterComboboxOption, o as toggleComboboxOption, r as filterComboboxOptions, t as applyComboboxSelection } from "../data.combobox-8RwBv5ey.mjs";
2
- export { applyComboboxSelection, filterComboboxOption, filterComboboxOptions, setComboboxValue, setComboboxValues, toggleComboboxOption };
@@ -1,6 +0,0 @@
1
- import { I as OuiComboboxState } from "../constants.combobox-DqNUGBLS.mjs";
2
- //#region src/js/combobox/form.combobox.d.ts
3
- declare function updateComboboxForm(state: OuiComboboxState, values: string[], emit?: boolean): void;
4
- declare function updateComboboxValidity(state: OuiComboboxState): void;
5
- //#endregion
6
- export { updateComboboxForm, updateComboboxValidity };
@@ -1,2 +0,0 @@
1
- import { M as updateComboboxValidity, j as updateComboboxForm } from "../data.combobox-8RwBv5ey.mjs";
2
- export { updateComboboxForm, updateComboboxValidity };
@@ -1,2 +0,0 @@
1
- import { B as getComboboxLanguage, H as setComboboxLocalizations, U as updateComboboxLocalizations, V as getComboboxLocalization } from "../constants.combobox-DqNUGBLS.mjs";
2
- export { getComboboxLanguage, getComboboxLocalization, setComboboxLocalizations, updateComboboxLocalizations };
@@ -1,2 +0,0 @@
1
- import { F as setComboboxLocalizations, I as updateComboboxLocalizations, N as getComboboxLanguage, P as getComboboxLocalization } from "../data.combobox-8RwBv5ey.mjs";
2
- export { getComboboxLanguage, getComboboxLocalization, setComboboxLocalizations, updateComboboxLocalizations };
@@ -1,243 +0,0 @@
1
- import { r as OuiFloatable } from "./floatable.embedded-Bct4U5Dm.mjs";
2
- import { RemovableEventListener } from "@oscarpalmer/toretto/models";
3
- import { GenericCallback } from "@oscarpalmer/atoms/models";
4
- //#region src/js/combobox/i18n.combobox.d.ts
5
- declare function getComboboxLanguage(state: OuiComboboxState): string;
6
- declare function getComboboxLocalization<Key extends keyof OuiComboboxLocalizations>(key: Key, state: OuiComboboxState): OuiComboboxLocalizations[Key];
7
- /**
8
- * Set combobox localizations for a specific language
9
- *
10
- * @param language Language code
11
- * @param localizations Localizations for language
12
- */
13
- declare function setComboboxLocalizations(language: string, localizations: Partial<OuiComboboxLocalizations>): void;
14
- /**
15
- * Set combobox localizations for one or more languages
16
- *
17
- * @param localizations Localizations for one or more languages
18
- */
19
- declare function setComboboxLocalizations(localizations: Record<string, Partial<OuiComboboxLocalizations>>): void;
20
- declare function updateComboboxLocalizations(values: Record<string, Partial<Record<string, string | GenericCallback>>>, destination?: Record<string, Partial<OuiComboboxLocalizations>>): void;
21
- //#endregion
22
- //#region src/js/combobox/index.d.ts
23
- declare global {
24
- interface HTMLElementTagNameMap {
25
- [COMBOBOX_TAGNAME]: OuiComboboxElement;
26
- }
27
- }
28
- declare class OuiComboboxElement extends HTMLElement {
29
- #private;
30
- static formAssociated: boolean;
31
- static observedAttributes: string[];
32
- /**
33
- * Is the combobox disabled?
34
- */
35
- get disabled(): boolean;
36
- /**
37
- * Should the combobox be disabled?
38
- */
39
- set disabled(value: boolean);
40
- /**
41
- * Current filter value
42
- */
43
- get filter(): string;
44
- /**
45
- * Set the filter value
46
- */
47
- set filter(value: string);
48
- /**
49
- * Maximum number of selected options
50
- */
51
- get max(): number | undefined;
52
- /**
53
- * Set the maximum number of selected options
54
- */
55
- set max(value: number);
56
- /**
57
- * Minimum number of selected options
58
- */
59
- get min(): number | undefined;
60
- /**
61
- * Set the minimum number of selected options
62
- */
63
- set min(value: number);
64
- /**
65
- * Does the combobox allow multiple values?
66
- */
67
- get multiple(): boolean;
68
- /**
69
- * Name of the combobox
70
- */
71
- get name(): string;
72
- /**
73
- * Is the combobox readonly?
74
- */
75
- get readonly(): boolean;
76
- /**
77
- * Should the combobox be readonly?
78
- */
79
- set readonly(value: boolean);
80
- /**
81
- * Is the combobox required?
82
- */
83
- get required(): boolean;
84
- /**
85
- * Should the combobox be required?
86
- */
87
- set required(value: boolean);
88
- /**
89
- * Selected options
90
- */
91
- get selected(): HTMLElement[];
92
- /**
93
- * Type of combobox
94
- */
95
- get type(): OuiComboboxType;
96
- /**
97
- * Current value
98
- */
99
- get value(): string;
100
- /**
101
- * Set the value
102
- */
103
- set value(value: unknown);
104
- /**
105
- * Current values
106
- */
107
- get values(): string[];
108
- /**
109
- * Set the values
110
- */
111
- set values(value: unknown[]);
112
- constructor();
113
- attributeChangedCallback(name: string, _: string | null, value: string | null): void;
114
- /**
115
- * Clear all selected options
116
- */
117
- clear(): void;
118
- connectedCallback(): void;
119
- disconnectedCallback(): void;
120
- formDisabledCallback(disabled: boolean): void;
121
- formResetCallback(): void;
122
- formStateRestoreCallback(state: string | File | FormData, reason: unknown): void;
123
- /**
124
- * Set combobox localizations for a specific language
125
- *
126
- * @param language Language code
127
- * @param localizations Localizations for language
128
- */
129
- setLocalizations(language: string, localizations: Partial<OuiComboboxLocalizations>): void;
130
- /**
131
- * Set combobox localizations for one or more languages
132
- *
133
- * @param localizations Localizations for one or more languages
134
- */
135
- setLocalizations(localizations: Record<string, Partial<OuiComboboxLocalizations>>): void;
136
- }
137
- //#endregion
138
- //#region src/js/combobox/models.combobox.d.ts
139
- type OuiComboboxAnchor = {
140
- container?: HTMLElement;
141
- element: HTMLElement;
142
- };
143
- type OuiComboboxAutoComplete = Record<OuiComboboxAutoCompleteType, boolean> & {
144
- value: OuiComboboxAutoCompleteType;
145
- };
146
- type OuiComboboxAutoCompleteType = 'both' | 'inline' | 'list' | 'none';
147
- type OuiComboboxFilter = {
148
- element: HTMLInputElement;
149
- value: string;
150
- };
151
- type OuiComboboxGroup = {
152
- element: HTMLElement;
153
- header: HTMLElement;
154
- options: HTMLElement[];
155
- };
156
- type OuiComboboxLabel = {
157
- element: HTMLLabelElement;
158
- id: string;
159
- };
160
- type OuiComboboxLocalizations = {
161
- empty: string | (() => string);
162
- input: string | (() => string);
163
- invalid: string | (() => string);
164
- max: string | ((max: number) => string);
165
- min: string | ((min: number) => string);
166
- remove: string | ((label: string, value: string) => string);
167
- results: string | ((amount: number) => string);
168
- selected: string | ((amount: number) => string);
169
- };
170
- type OuiComboboxOptions = {
171
- all: HTMLElement[];
172
- selected: HTMLElement[];
173
- };
174
- type OuiComboboxPreview = 'none' | 'set' | 'typed';
175
- type OuiComboboxSelection = {
176
- container: HTMLElement;
177
- items: OuiComboboxSelectionItem[];
178
- };
179
- type OuiComboboxSelectionItem = {
180
- button: HTMLButtonElement;
181
- element: HTMLElement;
182
- };
183
- type OuiComboboxState = {
184
- active?: HTMLElement;
185
- anchor: OuiComboboxAnchor;
186
- autocomplete: OuiComboboxAutoComplete;
187
- content: HTMLElement;
188
- disabled: boolean;
189
- filter: OuiComboboxFilter;
190
- floatable: OuiFloatable;
191
- groups?: OuiComboboxGroup[];
192
- host: OuiComboboxElement;
193
- id: string;
194
- internals: ElementInternals;
195
- label: OuiComboboxLabel;
196
- listeners: RemovableEventListener[];
197
- localizations: Record<string, Partial<OuiComboboxLocalizations>>;
198
- max?: number;
199
- min?: number;
200
- message: HTMLElement;
201
- name: string;
202
- multiple: boolean;
203
- options: OuiComboboxOptions;
204
- readonly: boolean;
205
- required: boolean;
206
- select: HTMLSelectElement;
207
- selection?: OuiComboboxSelection;
208
- type: OuiComboboxType;
209
- values: OuiComboboxValues;
210
- };
211
- type OuiComboboxType = 'autocomplete' | 'select';
212
- type OuiComboboxValues = {
213
- current: string[];
214
- initial: string[];
215
- };
216
- //#endregion
217
- //#region src/js/combobox/constants.combobox.d.ts
218
- declare const COMBOBOX_TAGNAME = "oui-combobox";
219
- declare const COMBOBOX_ATTRIBUTE_ANCHOR = "oui-combobox-anchor";
220
- declare const COMBOBOX_ATTRIBUTE_CONTENT = "oui-combobox-content";
221
- declare const COMBOBOX_ATTRIBUTE_FILTER = "oui-combobox-filter";
222
- declare const COMBOBOX_ATTRIBUTE_FILTER_INPUT = "oui-combobox-filter-input";
223
- declare const COMBOBOX_ATTRIBUTE_HEADER = "oui-combobox-header";
224
- declare const COMBOBOX_ATTRIBUTE_HIDDEN = "oui-combobox-hidden";
225
- declare const COMBOBOX_ATTRIBUTE_LIST = "oui-combobox-list";
226
- declare const COMBOBOX_ATTRIBUTE_MESSAGE = "oui-combobox-message";
227
- declare const COMBOBOX_ATTRIBUTE_OPTION = "oui-combobox-option";
228
- declare const COMBOBOX_ATTRIBUTE_OPTION_ACTIVE = "oui-combobox-option-active";
229
- declare const COMBOBOX_ATTRIBUTE_SELECTION = "oui-combobox-selection";
230
- declare const COMBOBOX_ATTRIBUTE_SELECTION_ITEM = "oui-combobox-selection-item";
231
- declare const COMBOBOX_AUTOCOMPLETES: Set<OuiComboboxAutoCompleteType>;
232
- declare const COMBOBOX_KEYS_ACTIVATION: Set<string>;
233
- declare const COMBOBOX_KEYS_NAVIGATION: Set<string>;
234
- declare const COMBOBOX_KEYS_SELECTION: Set<string>;
235
- declare const COMBOBOX_MESSAGE_LABEL = "<oui-combobox> must contain a <label> element for the <select> element";
236
- declare const COMBOBOX_MESSAGE_SELECT = "<oui-combobox> must contain a valid <select> element";
237
- declare const COMBOBOX_SELECTOR_ANCHOR = "[oui-combobox-anchor]";
238
- declare const COMBOBOX_SELECTOR_SELECTION_ITEM = "[oui-combobox-selection-item]";
239
- declare const COMBOBOX_SELECTOR_OPTION = "[oui-combobox-option]";
240
- declare const COMBOBOX_TYPES: Set<OuiComboboxType>;
241
- declare const comboboxScrollOptions: ScrollIntoViewOptions;
242
- //#endregion
243
- export { OuiComboboxLabel as A, getComboboxLanguage as B, COMBOBOX_TYPES as C, OuiComboboxAutoCompleteType as D, OuiComboboxAutoComplete as E, OuiComboboxSelectionItem as F, setComboboxLocalizations as H, OuiComboboxState as I, OuiComboboxType as L, OuiComboboxOptions as M, OuiComboboxPreview as N, OuiComboboxFilter as O, OuiComboboxSelection as P, OuiComboboxValues as R, COMBOBOX_TAGNAME as S, OuiComboboxAnchor as T, updateComboboxLocalizations as U, getComboboxLocalization as V, COMBOBOX_MESSAGE_LABEL as _, COMBOBOX_ATTRIBUTE_HEADER as a, COMBOBOX_SELECTOR_OPTION as b, COMBOBOX_ATTRIBUTE_MESSAGE as c, COMBOBOX_ATTRIBUTE_SELECTION as d, COMBOBOX_ATTRIBUTE_SELECTION_ITEM as f, COMBOBOX_KEYS_SELECTION as g, COMBOBOX_KEYS_NAVIGATION as h, COMBOBOX_ATTRIBUTE_FILTER_INPUT as i, OuiComboboxLocalizations as j, OuiComboboxGroup as k, COMBOBOX_ATTRIBUTE_OPTION as l, COMBOBOX_KEYS_ACTIVATION as m, COMBOBOX_ATTRIBUTE_CONTENT as n, COMBOBOX_ATTRIBUTE_HIDDEN as o, COMBOBOX_AUTOCOMPLETES as p, COMBOBOX_ATTRIBUTE_FILTER as r, COMBOBOX_ATTRIBUTE_LIST as s, COMBOBOX_ATTRIBUTE_ANCHOR as t, COMBOBOX_ATTRIBUTE_OPTION_ACTIVE as u, COMBOBOX_MESSAGE_SELECT as v, comboboxScrollOptions as w, COMBOBOX_SELECTOR_SELECTION_ITEM as x, COMBOBOX_SELECTOR_ANCHOR as y, OuiComboboxElement as z };