html-combobox-element 0.0.1

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 (34) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/combobox/Boolean.attribute.value.normalizer.js +11 -0
  3. package/dist/cjs/combobox/Combobox.markup.js +371 -0
  4. package/dist/cjs/combobox/HTML.combobox.element.js +365 -0
  5. package/dist/cjs/combobox/HTML.combobox.option.element.js +65 -0
  6. package/dist/cjs/combobox/HTML.combobox.tag.element.js +22 -0
  7. package/dist/cjs/combobox/index.js +17 -0
  8. package/dist/cjs/index.js +83 -0
  9. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -0
  10. package/dist/esm/combobox/Boolean.attribute.value.normalizer.js +8 -0
  11. package/dist/esm/combobox/Combobox.markup.js +367 -0
  12. package/dist/esm/combobox/HTML.combobox.element.js +359 -0
  13. package/dist/esm/combobox/HTML.combobox.option.element.js +59 -0
  14. package/dist/esm/combobox/HTML.combobox.tag.element.js +18 -0
  15. package/dist/esm/combobox/index.js +1 -0
  16. package/dist/esm/index.js +67 -0
  17. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -0
  18. package/dist/types/combobox/Boolean.attribute.value.normalizer.d.ts +3 -0
  19. package/dist/types/combobox/Boolean.attribute.value.normalizer.d.ts.map +1 -0
  20. package/dist/types/combobox/Combobox.markup.d.ts +31 -0
  21. package/dist/types/combobox/Combobox.markup.d.ts.map +1 -0
  22. package/dist/types/combobox/HTML.combobox.element.d.ts +55 -0
  23. package/dist/types/combobox/HTML.combobox.element.d.ts.map +1 -0
  24. package/dist/types/combobox/HTML.combobox.option.element.d.ts +14 -0
  25. package/dist/types/combobox/HTML.combobox.option.element.d.ts.map +1 -0
  26. package/dist/types/combobox/HTML.combobox.tag.element.d.ts +5 -0
  27. package/dist/types/combobox/HTML.combobox.tag.element.d.ts.map +1 -0
  28. package/dist/types/combobox/index.d.ts +2 -0
  29. package/dist/types/combobox/index.d.ts.map +1 -0
  30. package/dist/types/index.d.ts +214 -0
  31. package/dist/types/index.d.ts.map +1 -0
  32. package/dist/types/tsconfig.types.tsbuildinfo +1 -0
  33. package/dist/types/types.d.ts +198 -0
  34. package/package.json +45 -0
@@ -0,0 +1,359 @@
1
+ import { ComboboxMarkup } from './Combobox.markup.js';
2
+ import { HTMLComboboxOptionElement } from './HTML.combobox.option.element.js';
3
+ import { toBoolean } from './Boolean.attribute.value.normalizer.js';
4
+ export class HTMLComboboxElement extends HTMLElement {
5
+ static OWN_IDL = new Set(['required', 'disabled', 'clearable', 'multiple', 'filterable', 'searchable', 'value', 'placeholder', 'query']);
6
+ static observerOptions = { childList: true, attributes: false, subtree: false };
7
+ static styleSheet = [new CSSStyleSheet];
8
+ static formAssociated = true;
9
+ shadowRoot;
10
+ #internals;
11
+ #observer;
12
+ #markup;
13
+ #values = new Set;
14
+ constructor() {
15
+ super();
16
+ this.#internals = this.attachInternals();
17
+ this.#internals.role = "combobox";
18
+ this.#internals.ariaHasPopup = "dialog";
19
+ this.shadowRoot = this.attachShadow({ mode: 'closed', delegatesFocus: true });
20
+ this.#markup = new ComboboxMarkup(this.shadowRoot, this.#internals);
21
+ this.shadowRoot.innerHTML = ComboboxMarkup.template;
22
+ this.shadowRoot.adoptedStyleSheets = HTMLComboboxElement.styleSheet;
23
+ this.#observer = new MutationObserver(this.#onOptionsChanges);
24
+ }
25
+ // Lifecycle callbacks
26
+ connectedCallback() {
27
+ this.#markup.connect();
28
+ this.#initialAttributesSynchronization();
29
+ this.#onOptionsChanges([{ addedNodes: Array.from(this.children) }]);
30
+ this.#observer.observe(this, HTMLComboboxElement.observerOptions);
31
+ this.#markup.clearAllButton.addEventListener('click', this.#onClear);
32
+ this.#markup.searchInput.addEventListener('input', this.#onInput);
33
+ }
34
+ disconnectedCallback() {
35
+ this.#observer.disconnect();
36
+ this.#markup.disconnect();
37
+ this.#markup.clearAllButton.removeEventListener('click', this.#onClear);
38
+ this.#markup.searchInput.removeEventListener('input', this.#onInput);
39
+ }
40
+ formResetCallback() {
41
+ this.#values = new Set;
42
+ this.selectedOptions.forEach(option => option.selected = false);
43
+ this.#markup.tagsContainer.replaceChildren();
44
+ this.#setValidityAndFormValue();
45
+ this.dispatchEvent(new Event('change'));
46
+ }
47
+ formDisabledCallback(isDisabled) {
48
+ this.disabled = isDisabled;
49
+ }
50
+ // Instance properties
51
+ // <combo-box> specific properties
52
+ get valueAsArray() {
53
+ return Array.from(this.#values);
54
+ }
55
+ get query() {
56
+ return this.getAttribute('query');
57
+ }
58
+ set query(value) {
59
+ if (value === this.query)
60
+ return;
61
+ if (value == null)
62
+ value = '';
63
+ value = String(value);
64
+ super.setAttribute('query', value);
65
+ if (this.#markup.connected) {
66
+ this.#markup.searchInput.value = value;
67
+ }
68
+ }
69
+ get placeholder() {
70
+ return this.getAttribute('placeholder');
71
+ }
72
+ set placeholder(value) {
73
+ if (value == null)
74
+ value = '';
75
+ value = String(value);
76
+ super.setAttribute('placeholder', value);
77
+ if (this.#markup.connected) {
78
+ this.#markup.placeholder.innerText = value;
79
+ this.#markup.searchInput.placeholder = value;
80
+ }
81
+ }
82
+ get clearable() {
83
+ return this.hasAttribute('clearable');
84
+ }
85
+ set clearable(value) {
86
+ super.toggleAttribute('clearable', toBoolean(value));
87
+ }
88
+ get filterable() {
89
+ return this.hasAttribute('filterable');
90
+ }
91
+ set filterable(value) {
92
+ super.toggleAttribute('filterable', toBoolean(value));
93
+ }
94
+ get searchable() {
95
+ return this.hasAttribute('searchable');
96
+ }
97
+ set searchable(value) {
98
+ super.toggleAttribute('searchable', toBoolean(value));
99
+ }
100
+ // <select> specific properties (implements HTMLSelectElement)
101
+ get disabled() {
102
+ return this.hasAttribute('disabled');
103
+ }
104
+ set disabled(value) {
105
+ this.#internals.ariaDisabled = String(value);
106
+ super.toggleAttribute('disabled', toBoolean(value));
107
+ }
108
+ get form() {
109
+ return this.#internals.form;
110
+ }
111
+ get labels() {
112
+ return this.#internals.labels;
113
+ }
114
+ get length() {
115
+ return this.#markup.options.length;
116
+ }
117
+ get multiple() {
118
+ return this.hasAttribute('multiple');
119
+ }
120
+ set multiple(value) {
121
+ super.toggleAttribute('multiple', toBoolean(value));
122
+ }
123
+ // get options
124
+ // (there is no constructor of HTMLOptionsCollection, need to implement)
125
+ get required() {
126
+ return this.hasAttribute('required');
127
+ }
128
+ set required(value) {
129
+ this.#internals.ariaRequired = String(value);
130
+ super.toggleAttribute('required', toBoolean(value));
131
+ }
132
+ // selected index is part of HTMLOptionsCollection, see option above
133
+ get selectedOptions() {
134
+ return this.#markup.selectedOptions;
135
+ }
136
+ // get/set size
137
+ // for the original select, this is the same as rowsCount of textarea
138
+ // probably, there are no reasons to this one, but it should be implemented for interface compatibility
139
+ get type() {
140
+ return this.multiple ? "select-multiple" : "select-one";
141
+ }
142
+ get validationMessage() {
143
+ return this.#internals.validationMessage;
144
+ }
145
+ get validity() {
146
+ return this.#internals.validity;
147
+ }
148
+ get willValidate() {
149
+ return this.#internals.willValidate;
150
+ }
151
+ get value() {
152
+ return this.valueAsArray.join(',');
153
+ }
154
+ set value(value) {
155
+ if (this.value === value || typeof value !== 'string')
156
+ return;
157
+ const prevValue = new Set(this.#values);
158
+ this.#values = new Set;
159
+ const values = value.split(',').filter(Boolean);
160
+ Promise.resolve(values)
161
+ .then(values => {
162
+ if (values.length) {
163
+ if (!this.multiple) {
164
+ if (this.#values.size === 0) {
165
+ values.length = 1;
166
+ }
167
+ else {
168
+ values.length = 0;
169
+ }
170
+ }
171
+ for (const key of values) {
172
+ const option = this.#markup.getOptionByValue(key);
173
+ if (option)
174
+ this.#selectOption(option);
175
+ }
176
+ }
177
+ for (const key of prevValue) {
178
+ if (this.#values.has(key))
179
+ continue;
180
+ const option = this.#markup.getOptionByValue(key);
181
+ const tag = this.#markup.getTagByValue(key);
182
+ tag?.remove();
183
+ option?.toggleAttribute('selected', false);
184
+ }
185
+ });
186
+ }
187
+ // Instance methods
188
+ // <select> specific methods (implements HTMLSelectElement)
189
+ // add()
190
+ checkValidity() {
191
+ this.#internals.checkValidity();
192
+ }
193
+ item(index) {
194
+ return this.#markup.options.item(index);
195
+ }
196
+ // namedItem()
197
+ // !!! Conflicts with node.remove()
198
+ // remove(index: number)
199
+ reportValidity() {
200
+ this.#internals.reportValidity();
201
+ }
202
+ setCustomValidity(message) {
203
+ if (message === '') {
204
+ this.#internals.setValidity({});
205
+ }
206
+ else {
207
+ this.#internals.setValidity({ customError: true }, message);
208
+ }
209
+ }
210
+ showPicker() {
211
+ this.#markup.showDropdown();
212
+ }
213
+ // Overwritten methods
214
+ setAttribute(name, value) {
215
+ if (HTMLComboboxElement.OWN_IDL.has(name)) {
216
+ Reflect.set(this, name, value);
217
+ }
218
+ else {
219
+ super.setAttribute(name, value);
220
+ }
221
+ }
222
+ removeAttribute(name) {
223
+ if (HTMLComboboxElement.OWN_IDL.has(name)) {
224
+ Reflect.set(this, name, false);
225
+ }
226
+ else {
227
+ super.removeAttribute(name);
228
+ }
229
+ }
230
+ // Internal
231
+ #onInput = (event) => {
232
+ if (!this.searchable && this.filterable) {
233
+ if (event.target && event.target instanceof HTMLInputElement) {
234
+ this.#markup.sort(event.target.value);
235
+ }
236
+ }
237
+ };
238
+ #onOptionsChanges = (records) => {
239
+ records.forEach(record => {
240
+ record.addedNodes.forEach(node => {
241
+ if (node instanceof HTMLComboboxOptionElement) {
242
+ node.addEventListener('click', this.#onSelectOption);
243
+ if (node.selected) {
244
+ if (this.multiple) {
245
+ this.#selectOption(node);
246
+ }
247
+ else if (this.#values.size === 0) {
248
+ this.#selectOption(node);
249
+ }
250
+ }
251
+ }
252
+ if (node instanceof HTMLComboboxOptionElement || node instanceof HTMLOptGroupElement) {
253
+ this.#markup.optionsContainer.append(node);
254
+ }
255
+ });
256
+ });
257
+ this.#markup.invalidateOptionsCache();
258
+ this.#setValidityAndFormValue();
259
+ };
260
+ #selectOption(option) {
261
+ if (this.#values.has(option.value))
262
+ return;
263
+ const value = option.value;
264
+ this.#values.add(value);
265
+ option.toggleAttribute('selected', true);
266
+ const control = this.#markup.createAndAppendTag(option);
267
+ control?.addEventListener('click', this.#onClearTag);
268
+ if (!this.multiple) {
269
+ this.#markup.closeDropdown();
270
+ }
271
+ }
272
+ #onSelectOption = (event) => {
273
+ const target = event.target;
274
+ if (target && target instanceof HTMLElement) {
275
+ const option = target.closest('box-option');
276
+ if (option) {
277
+ if (this.#values.has(option.value))
278
+ return;
279
+ if (!this.multiple) {
280
+ event.stopPropagation();
281
+ this.#values.forEach(value => {
282
+ this.#markup.getTagByValue(value)?.remove();
283
+ this.#markup.getOptionByValue(value)?.toggleAttribute('selected', false);
284
+ });
285
+ this.#values.clear();
286
+ this.#markup.tagsContainer.replaceChildren();
287
+ }
288
+ this.#selectOption(option);
289
+ this.#setValidityAndFormValue();
290
+ this.dispatchEvent(new Event('change'));
291
+ }
292
+ }
293
+ };
294
+ #onClearTag = (event) => {
295
+ const target = event.target;
296
+ if (target && target instanceof HTMLElement) {
297
+ const tag = target.closest('box-tag');
298
+ if (tag) {
299
+ const value = tag.getAttribute('value');
300
+ const option = this.#markup.getOptionByValue(value);
301
+ option.removeAttribute('selected');
302
+ this.#values.delete(value);
303
+ tag.remove();
304
+ this.#setValidityAndFormValue();
305
+ this.dispatchEvent(new Event('change'));
306
+ }
307
+ }
308
+ };
309
+ #onClear = () => {
310
+ this.formResetCallback();
311
+ };
312
+ #setValidityAndFormValue() {
313
+ this.#internals.setFormValue(this.value);
314
+ if (this.required && this.value === '') {
315
+ this.#internals.setValidity({ valueMissing: true });
316
+ }
317
+ else {
318
+ this.#internals.setValidity({});
319
+ }
320
+ }
321
+ #initialAttributesSynchronization() {
322
+ for (const key of HTMLComboboxElement.OWN_IDL) {
323
+ this[key] = this.getAttribute(key);
324
+ }
325
+ }
326
+ static loadCssFromUrls(urls) {
327
+ ComboboxMarkup.importCSS(urls);
328
+ }
329
+ static loadCssFromDocumentStyleSheets() {
330
+ if (document.readyState === 'complete') {
331
+ HTMLComboboxElement.#loadDocumentStyleSheets();
332
+ }
333
+ if (document.readyState === 'loading') {
334
+ document.addEventListener('DOMContentLoaded', HTMLComboboxElement.#loadDocumentStyleSheets);
335
+ }
336
+ if (document.readyState === 'interactive') {
337
+ queueMicrotask(HTMLComboboxElement.#loadDocumentStyleSheets);
338
+ }
339
+ }
340
+ static #loadDocumentStyleSheets() {
341
+ const [innerSheet] = HTMLComboboxElement.styleSheet;
342
+ for (const outerSheet of document.styleSheets) {
343
+ for (const rule of outerSheet.cssRules) {
344
+ innerSheet.insertRule(rule.cssText, innerSheet.cssRules.length);
345
+ }
346
+ }
347
+ }
348
+ }
349
+ document.addEventListener('keypress', (event) => {
350
+ if (document.activeElement instanceof HTMLComboboxElement) {
351
+ const maybeHost = document.activeElement.shadowRoot.activeElement;
352
+ if (maybeHost instanceof HTMLComboboxOptionElement) {
353
+ maybeHost.click();
354
+ }
355
+ }
356
+ });
357
+ if (!window.customElements.get('combo-box')) {
358
+ window.customElements.define('combo-box', HTMLComboboxElement);
359
+ }
@@ -0,0 +1,59 @@
1
+ import { toBoolean } from './Boolean.attribute.value.normalizer.js';
2
+ export class HTMLComboboxOptionElement extends HTMLElement {
3
+ static OWN_IDL = new Set(['value', 'label', 'selected']);
4
+ connectedCallback() {
5
+ this.#initialAttributesSynchronization();
6
+ this.part.add('option');
7
+ super.setAttribute('tabindex', "0");
8
+ super.setAttribute('role', "option");
9
+ if (!this.value) {
10
+ this.value = this.textContent;
11
+ }
12
+ }
13
+ get value() {
14
+ return this.getAttribute('value');
15
+ }
16
+ set value(value) {
17
+ if (value == null)
18
+ return;
19
+ super.setAttribute('value', String(value));
20
+ }
21
+ get label() {
22
+ return this.getAttribute('label');
23
+ }
24
+ set label(value) {
25
+ if (value == null)
26
+ return;
27
+ super.setAttribute('label', String(value));
28
+ }
29
+ get selected() {
30
+ return this.hasAttribute('selected');
31
+ }
32
+ set selected(value) {
33
+ super.toggleAttribute('selected', toBoolean(value));
34
+ }
35
+ #initialAttributesSynchronization() {
36
+ for (const key of HTMLComboboxOptionElement.OWN_IDL) {
37
+ this[key] = this.getAttribute(key);
38
+ }
39
+ }
40
+ setAttribute(name, value) {
41
+ if (HTMLComboboxOptionElement.OWN_IDL.has(name)) {
42
+ this[name] = value;
43
+ }
44
+ else {
45
+ super.setAttribute(name, value);
46
+ }
47
+ }
48
+ removeAttribute(name) {
49
+ if (HTMLComboboxOptionElement.OWN_IDL.has(name)) {
50
+ this[name] = null;
51
+ }
52
+ else {
53
+ super.removeAttribute(name);
54
+ }
55
+ }
56
+ }
57
+ if (!window.customElements.get('box-option')) {
58
+ window.customElements.define('box-option', HTMLComboboxOptionElement);
59
+ }
@@ -0,0 +1,18 @@
1
+ export class HTMLComboboxTagElement extends HTMLElement {
2
+ constructor() {
3
+ super();
4
+ }
5
+ connectedCallback() {
6
+ this.part.add('tag');
7
+ if (this.parentElement) {
8
+ if (this.parentElement.hasAttribute('multiple')) {
9
+ if (!this.querySelector('[part*="clear-tag"]')) {
10
+ throw new Error(`A <button> with part="clear-tag" is required for <combo-box> with multiple attribute`);
11
+ }
12
+ }
13
+ }
14
+ }
15
+ }
16
+ if (!window.customElements.get('box-tag')) {
17
+ window.customElements.define('box-tag', HTMLComboboxTagElement);
18
+ }
@@ -0,0 +1 @@
1
+ export * from './HTML.combobox.element.js';
@@ -0,0 +1,67 @@
1
+ /// <reference types="solid-js" />
2
+ /// <reference types="preact" />
3
+ /// <reference types="react" />
4
+ /// <reference types="vue" />
5
+ export * from './combobox/index.js';
6
+ // declare global {
7
+ // namespace React {
8
+ // namespace JSX {
9
+ // interface IntrinsicElements {
10
+ // 'combo-box': React.DetailedHTMLProps<Omit<React.HTMLAttributes<HTMLComboboxElement>, 'defaultValue'>,
11
+ // HTMLComboboxElement
12
+ // > & ComboboxJsxAttributes;
13
+ //
14
+ // 'box-option': React.DetailedHTMLProps<
15
+ // React.HTMLAttributes<HTMLComboboxOptionElement>,
16
+ // HTMLComboboxOptionElement>
17
+ // & ComboboxOptionJsxAttributes;
18
+ //
19
+ // 'box-tag': React.DetailedHTMLProps<React.HTMLAttributes<HTMLComboboxTagElement>, HTMLComboboxTagElement>;
20
+ // }
21
+ // }
22
+ // }
23
+ //
24
+ //
25
+ // namespace preact {
26
+ // namespace JSX {
27
+ // interface IntrinsicElements {
28
+ // 'combo-box': preact.HTMLAttributes<HTMLComboboxElement> & ComboboxJsxAttributes;
29
+ // 'box-option': preact.HTMLAttributes<HTMLComboboxOptionElement> & ComboboxOptionJsxAttributes;
30
+ // 'box-tag': preact.HTMLAttributes<HTMLComboboxTagElement>;
31
+ // }
32
+ // }
33
+ // }
34
+ //
35
+ // }
36
+ //
37
+ // declare module 'preact' {
38
+ // namespace JSX {
39
+ // interface IntrinsicElements {
40
+ // 'combo-box': preact.HTMLAttributes<HTMLComboboxElement> & ComboboxJsxAttributes;
41
+ // 'box-option': preact.HTMLAttributes<HTMLComboboxOptionElement> & ComboboxOptionJsxAttributes;
42
+ // 'box-tag': preact.HTMLAttributes<HTMLComboboxTagElement>;
43
+ // }
44
+ // }
45
+ // }
46
+ //
47
+ // // Solid
48
+ // declare module 'solid-js' {
49
+ // namespace JSX {
50
+ // interface IntrinsicElements {
51
+ // 'combo-box': HTMLAttributes<HTMLComboboxElement> & ComboboxJsxAttributes
52
+ // 'box-option': HTMLAttributes<HTMLComboboxOptionElement> & ComboboxOptionJsxAttributes
53
+ // 'box-tag': HTMLAttributes<HTMLElement>
54
+ // }
55
+ // }
56
+ // }
57
+ //
58
+ //
59
+ // declare global {
60
+ // namespace JSX {
61
+ // interface IntrinsicElements {
62
+ // 'combo-box': ComboboxJsxAttributes;
63
+ // 'box-option': ComboboxOptionJsxAttributes;
64
+ // 'box-tag': HTMLElement;
65
+ // }
66
+ // }
67
+ // }
@@ -0,0 +1 @@
1
+ {"root":["../../src/index.ts","../../src/combobox/boolean.attribute.value.normalizer.ts","../../src/combobox/combobox.markup.ts","../../src/combobox/html.combobox.element.ts","../../src/combobox/html.combobox.option.element.ts","../../src/combobox/html.combobox.tag.element.ts","../../src/combobox/index.ts"],"version":"5.9.3"}
@@ -0,0 +1,3 @@
1
+ /** Transform invalid (nullish or stringed) values to correct boolean value */
2
+ export declare function toBoolean(value: any): boolean;
3
+ //# sourceMappingURL=Boolean.attribute.value.normalizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Boolean.attribute.value.normalizer.d.ts","sourceRoot":"","sources":["../../../src/combobox/Boolean.attribute.value.normalizer.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,WAInC"}
@@ -0,0 +1,31 @@
1
+ import { HTMLComboboxTagElement } from './HTML.combobox.tag.element.js';
2
+ import { HTMLComboboxOptionElement } from './HTML.combobox.option.element.js';
3
+ export declare class ComboboxMarkup {
4
+ #private;
5
+ tagsContainer: HTMLDivElement | null;
6
+ optionsContainer: HTMLDivElement | null;
7
+ clearAllButton: HTMLButtonElement | null;
8
+ dropdown: HTMLDivElement | null;
9
+ placeholder: HTMLDivElement | null;
10
+ searchInput: HTMLInputElement | null;
11
+ tagTemplate: HTMLComboboxTagElement | null;
12
+ options: NodeListOf<HTMLComboboxOptionElement> | null;
13
+ connected: boolean;
14
+ constructor(shadowRoot: ShadowRoot, internals: ElementInternals);
15
+ connect(): void;
16
+ invalidateOptionsCache(): void;
17
+ sort(query: string): void;
18
+ disconnect(): void;
19
+ onPageScroll: () => void;
20
+ setDropdownPosition(rect: DOMRect): void;
21
+ showDropdown: () => void;
22
+ closeDropdown(): void;
23
+ hideDropdown: (event: Event) => void;
24
+ createAndAppendTag(option: HTMLComboboxOptionElement): HTMLButtonElement;
25
+ getTagByValue(value: string): HTMLComboboxTagElement;
26
+ getOptionByValue(value: string): HTMLComboboxOptionElement;
27
+ get selectedOptions(): NodeListOf<HTMLComboboxOptionElement>;
28
+ static importCSS(urls: string[]): void;
29
+ static template: string;
30
+ }
31
+ //# sourceMappingURL=Combobox.markup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Combobox.markup.d.ts","sourceRoot":"","sources":["../../../src/combobox/Combobox.markup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAE9E,qBAAa,cAAc;;IAGzB,aAAa,EAAE,cAAc,GAAG,IAAI,CAAQ;IAC5C,gBAAgB,EAAE,cAAc,GAAG,IAAI,CAAQ;IAC/C,cAAc,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IAChD,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAQ;IACvC,WAAW,EAAE,cAAc,GAAG,IAAI,CAAQ;IAC1C,WAAW,EAAE,gBAAgB,GAAG,IAAI,CAAQ;IAC5C,WAAW,EAAE,sBAAsB,GAAG,IAAI,CAAQ;IAClD,OAAO,EAAE,UAAU,CAAC,yBAAyB,CAAC,GAAG,IAAI,CAAC;IACtD,SAAS,UAAS;gBAEN,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB;IAU/D,OAAO;IAiBP,sBAAsB;IAMtB,IAAI,CAAC,KAAK,EAAE,MAAM;IAelB,UAAU;IASV,YAAY,aAIX;IAED,mBAAmB,CAAC,IAAI,EAAE,OAAO;IAmBjC,YAAY,aAaX;IAED,aAAa;IAWb,YAAY,GAAI,OAAO,KAAK,UAG3B;IAED,kBAAkB,CAAC,MAAM,EAAE,yBAAyB;IAsCpD,aAAa,CAAC,KAAK,EAAE,MAAM;IAI3B,gBAAgB,CAAC,KAAK,EAAE,MAAM;IAI9B,IAAI,eAAe,0CAGlB;IAED,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE;IAQ/B,MAAM,CAAC,QAAQ,SAkMhB;CACA"}
@@ -0,0 +1,55 @@
1
+ import { HTMLComboboxOptionElement } from './HTML.combobox.option.element.js';
2
+ export declare class HTMLComboboxElement extends HTMLElement {
3
+ #private;
4
+ static OWN_IDL: Set<string>;
5
+ static observerOptions: {
6
+ childList: boolean;
7
+ attributes: boolean;
8
+ subtree: boolean;
9
+ };
10
+ static styleSheet: CSSStyleSheet[];
11
+ static formAssociated: boolean;
12
+ shadowRoot: ShadowRoot;
13
+ constructor();
14
+ connectedCallback(): void;
15
+ disconnectedCallback(): void;
16
+ formResetCallback(): void;
17
+ formDisabledCallback(isDisabled: boolean): void;
18
+ get valueAsArray(): string[];
19
+ get query(): string;
20
+ set query(value: string);
21
+ get placeholder(): string;
22
+ set placeholder(value: string);
23
+ get clearable(): boolean;
24
+ set clearable(value: boolean);
25
+ get filterable(): boolean;
26
+ set filterable(value: boolean);
27
+ get searchable(): boolean;
28
+ set searchable(value: boolean);
29
+ get disabled(): boolean;
30
+ set disabled(value: boolean);
31
+ get form(): HTMLFormElement;
32
+ get labels(): NodeList;
33
+ get length(): number;
34
+ get multiple(): boolean;
35
+ set multiple(value: boolean);
36
+ get required(): boolean;
37
+ set required(value: boolean);
38
+ get selectedOptions(): NodeListOf<HTMLComboboxOptionElement>;
39
+ get type(): "select-one" | "select-multiple";
40
+ get validationMessage(): string;
41
+ get validity(): ValidityState;
42
+ get willValidate(): boolean;
43
+ get value(): string;
44
+ set value(value: string);
45
+ checkValidity(): void;
46
+ item(index: number): HTMLComboboxOptionElement;
47
+ reportValidity(): void;
48
+ setCustomValidity(message: string): void;
49
+ showPicker(): void;
50
+ setAttribute(name: string, value: any): void;
51
+ removeAttribute(name: string): void;
52
+ static loadCssFromUrls(urls: string[]): void;
53
+ static loadCssFromDocumentStyleSheets(): void;
54
+ }
55
+ //# sourceMappingURL=HTML.combobox.element.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HTML.combobox.element.d.ts","sourceRoot":"","sources":["../../../src/combobox/HTML.combobox.element.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAI9E,qBAAa,mBAAoB,SAAQ,WAAW;;IAClD,MAAM,CAAC,OAAO,cAA0H;IACxI,MAAM,CAAC,eAAe;;;;MAA0D;IAChF,MAAM,CAAC,UAAU,kBAAuB;IACxC,MAAM,CAAC,cAAc,UAAQ;IAE7B,UAAU,EAAE,UAAU,CAAC;;IAoBvB,iBAAiB;IASjB,oBAAoB;IAOpB,iBAAiB;IAQjB,oBAAoB,CAAC,UAAU,EAAE,OAAO;IAOxC,IAAI,YAAY,aAEf;IAED,IAAI,KAAK,IAGQ,MAAM,CADtB;IACD,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAQtB;IAED,IAAI,WAAW,WAEd;IACD,IAAI,WAAW,CAAC,KAAK,QAAA,EAQpB;IAED,IAAI,SAAS,YAEZ;IACD,IAAI,SAAS,CAAC,KAAK,SAAA,EAElB;IAED,IAAI,UAAU,YAEb;IACD,IAAI,UAAU,CAAC,KAAK,SAAA,EAEnB;IAED,IAAI,UAAU,YAEb;IACD,IAAI,UAAU,CAAC,KAAK,SAAA,EAEnB;IAGD,IAAI,QAAQ,YAEX;IACD,IAAI,QAAQ,CAAC,KAAK,SAAA,EAGjB;IAED,IAAI,IAAI,oBAEP;IAED,IAAI,MAAM,aAET;IAED,IAAI,MAAM,WAET;IAED,IAAI,QAAQ,YAEX;IACD,IAAI,QAAQ,CAAC,KAAK,SAAA,EAEjB;IAKD,IAAI,QAAQ,YAEX;IACD,IAAI,QAAQ,CAAC,KAAK,SAAA,EAGjB;IAID,IAAI,eAAe,0CAElB;IAMD,IAAI,IAAI,qCAEP;IAED,IAAI,iBAAiB,WAEpB;IAED,IAAI,QAAQ,kBAEX;IAED,IAAI,YAAY,YAEf;IAED,IAAI,KAAK,IAGQ,MAAM,CADtB;IACD,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,EAgCtB;IAQD,aAAa;IAIb,IAAI,CAAC,KAAK,EAAE,MAAM;IASlB,cAAc;IAId,iBAAiB,CAAC,OAAO,EAAE,MAAM;IAQjC,UAAU;IAKV,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG;IAQrC,eAAe,CAAC,IAAI,EAAE,MAAM;IA4G5B,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE;IAIrC,MAAM,CAAC,8BAA8B;CAoBtC"}
@@ -0,0 +1,14 @@
1
+ export declare class HTMLComboboxOptionElement extends HTMLElement {
2
+ #private;
3
+ static OWN_IDL: Set<string>;
4
+ connectedCallback(): void;
5
+ get value(): string;
6
+ set value(value: string);
7
+ get label(): string;
8
+ set label(value: string);
9
+ get selected(): boolean;
10
+ set selected(value: boolean);
11
+ setAttribute(name: string, value: string): void;
12
+ removeAttribute(name: string): void;
13
+ }
14
+ //# sourceMappingURL=HTML.combobox.option.element.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HTML.combobox.option.element.d.ts","sourceRoot":"","sources":["../../../src/combobox/HTML.combobox.option.element.ts"],"names":[],"mappings":"AAEA,qBAAa,yBAA0B,SAAQ,WAAW;;IACxD,MAAM,CAAC,OAAO,cAA2C;IAEzD,iBAAiB;IAWjB,IAAI,KAAK,WAER;IACD,IAAI,KAAK,CAAC,KAAK,QAAA,EAGd;IAED,IAAI,KAAK,WAER;IACD,IAAI,KAAK,CAAC,KAAK,QAAA,EAGd;IAED,IAAI,QAAQ,YAEX;IACD,IAAI,QAAQ,CAAC,KAAK,SAAA,EAEjB;IAQD,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAQxC,eAAe,CAAC,IAAI,EAAE,MAAM;CAO7B"}
@@ -0,0 +1,5 @@
1
+ export declare class HTMLComboboxTagElement extends HTMLElement {
2
+ constructor();
3
+ connectedCallback(): void;
4
+ }
5
+ //# sourceMappingURL=HTML.combobox.tag.element.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HTML.combobox.tag.element.d.ts","sourceRoot":"","sources":["../../../src/combobox/HTML.combobox.tag.element.ts"],"names":[],"mappings":"AAAA,qBAAa,sBAAuB,SAAQ,WAAW;;IAKrD,iBAAiB;CAUlB"}
@@ -0,0 +1,2 @@
1
+ export * from './HTML.combobox.element.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/combobox/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC"}