@threadlabs/looma 0.1.24 → 0.1.26
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/dist/{chunk-IMHSPETJ.js → chunk-XRJRF3MM.js} +33 -32
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/looma.cjs.js +1 -1
- package/dist/cjs/{ui-combobox.cjs.entry.js → ui-chip_2.cjs.entry.js} +29 -4
- package/dist/cjs/ui-context-menu.cjs.entry.js +1 -1
- package/dist/cjs/ui-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ui-disclosure.cjs.entry.js +1 -1
- package/dist/cjs/ui-editable.cjs.entry.js +100 -0
- package/dist/cjs/ui-floating-action-button.cjs.entry.js +1 -1
- package/dist/cjs/ui-form-field.cjs.entry.js +1 -1
- package/dist/cjs/ui-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/ui-input.cjs.entry.js +1 -1
- package/dist/cjs/ui-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/ui-menu.cjs.entry.js +1 -1
- package/dist/cjs/ui-multi-combobox.cjs.entry.js +190 -0
- package/dist/cjs/ui-popover.cjs.entry.js +1 -1
- package/dist/cjs/ui-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/ui-radio.cjs.entry.js +1 -1
- package/dist/cjs/ui-search-result-row.cjs.entry.js +1 -1
- package/dist/cjs/ui-search-shell.cjs.entry.js +1 -1
- package/dist/cjs/ui-select.cjs.entry.js +1 -1
- package/dist/cjs/ui-switch.cjs.entry.js +2 -2
- package/dist/cjs/ui-tabs.cjs.entry.js +1 -1
- package/dist/cjs/ui-textarea.cjs.entry.js +1 -1
- package/dist/cjs/ui-toast-region.cjs.entry.js +1 -1
- package/dist/cjs/ui-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/ui-top-bar.cjs.entry.js +1 -1
- package/dist/cjs/ui-tree-item.cjs.entry.js +2 -2
- package/dist/cjs/ui-tree.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/ui-chip/ui-chip.css +4 -0
- package/dist/collection/components/ui-chip/ui-chip.js +23 -1
- package/dist/collection/components/ui-combobox/ui-combobox.js +49 -4
- package/dist/collection/components/ui-context-menu/ui-context-menu.js +1 -1
- package/dist/collection/components/ui-dialog/ui-dialog.js +1 -1
- package/dist/collection/components/ui-disclosure/ui-disclosure.js +1 -1
- package/dist/collection/components/ui-editable/ui-editable.css +2 -0
- package/dist/collection/components/ui-editable/ui-editable.js +196 -0
- package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +1 -1
- package/dist/collection/components/ui-form-field/ui-form-field.js +1 -1
- package/dist/collection/components/ui-icon-button/ui-icon-button.js +1 -1
- package/dist/collection/components/ui-input/ui-input.js +1 -1
- package/dist/collection/components/ui-menu/ui-menu.js +1 -1
- package/dist/collection/components/ui-menu-item/ui-menu-item.js +1 -1
- package/dist/collection/components/ui-multi-combobox/ui-multi-combobox.css +29 -0
- package/dist/collection/components/ui-multi-combobox/ui-multi-combobox.js +553 -0
- package/dist/collection/components/ui-popover/ui-popover.js +1 -1
- package/dist/collection/components/ui-radio/ui-radio.js +1 -1
- package/dist/collection/components/ui-radio-group/ui-radio-group.js +1 -1
- package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +1 -1
- package/dist/collection/components/ui-search-shell/ui-search-shell.js +1 -1
- package/dist/collection/components/ui-select/ui-select.js +1 -1
- package/dist/collection/components/ui-switch/ui-switch.js +2 -2
- package/dist/collection/components/ui-tabs/ui-tabs.js +1 -1
- package/dist/collection/components/ui-textarea/ui-textarea.js +1 -1
- package/dist/collection/components/ui-toast-region/ui-toast-region.js +1 -1
- package/dist/collection/components/ui-tooltip/ui-tooltip.js +1 -1
- package/dist/collection/components/ui-top-bar/ui-top-bar.js +1 -1
- package/dist/collection/components/ui-tree/ui-tree.js +1 -1
- package/dist/collection/components/ui-tree-item/ui-tree-item.js +2 -2
- package/dist/collection/field/editable.js +1 -0
- package/dist/collection/field/multi-combobox.js +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +1 -1
- package/dist/components/{p-DIGcRYAW.js → p-B9CzOHvE.js} +1 -1
- package/dist/components/p-BMgIcOh-.js +1 -0
- package/dist/components/p-BVteuP_d.js +1 -0
- package/dist/components/{p-Bk55QiUK.js → p-C6p-ygxq.js} +1 -1
- package/dist/components/ui-chip.js +1 -1
- package/dist/components/ui-combobox.js +1 -1
- package/dist/components/ui-context-menu.js +1 -1
- package/dist/components/ui-dialog.js +1 -1
- package/dist/components/ui-disclosure.js +1 -1
- package/dist/components/ui-editable.d.ts +11 -0
- package/dist/components/ui-editable.js +1 -0
- package/dist/components/ui-floating-action-button.js +1 -1
- package/dist/components/ui-form-field.js +1 -1
- package/dist/components/ui-icon-button.js +1 -1
- package/dist/components/ui-input.js +1 -1
- package/dist/components/ui-menu-item.js +1 -1
- package/dist/components/ui-menu.js +1 -1
- package/dist/components/ui-multi-combobox.d.ts +11 -0
- package/dist/components/ui-multi-combobox.js +1 -0
- package/dist/components/ui-popover.js +1 -1
- package/dist/components/ui-radio-group.js +1 -1
- package/dist/components/ui-radio.js +1 -1
- package/dist/components/ui-search-result-row.js +1 -1
- package/dist/components/ui-search-shell.js +1 -1
- package/dist/components/ui-select.js +1 -1
- package/dist/components/ui-switch.js +1 -1
- package/dist/components/ui-tabs.js +1 -1
- package/dist/components/ui-textarea.js +1 -1
- package/dist/components/ui-toast-region.js +1 -1
- package/dist/components/ui-tooltip.js +1 -1
- package/dist/components/ui-top-bar.js +1 -1
- package/dist/components/ui-tree-item.js +1 -1
- package/dist/components/ui-tree.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/looma.js +1 -1
- package/dist/esm/{ui-combobox.entry.js → ui-chip_2.entry.js} +30 -6
- package/dist/esm/ui-context-menu.entry.js +1 -1
- package/dist/esm/ui-dialog.entry.js +1 -1
- package/dist/esm/ui-disclosure.entry.js +1 -1
- package/dist/esm/ui-editable.entry.js +98 -0
- package/dist/esm/ui-floating-action-button.entry.js +1 -1
- package/dist/esm/ui-form-field.entry.js +1 -1
- package/dist/esm/ui-icon-button.entry.js +1 -1
- package/dist/esm/ui-input.entry.js +1 -1
- package/dist/esm/ui-menu-item.entry.js +1 -1
- package/dist/esm/ui-menu.entry.js +1 -1
- package/dist/esm/ui-multi-combobox.entry.js +188 -0
- package/dist/esm/ui-popover.entry.js +1 -1
- package/dist/esm/ui-radio-group.entry.js +1 -1
- package/dist/esm/ui-radio.entry.js +1 -1
- package/dist/esm/ui-search-result-row.entry.js +1 -1
- package/dist/esm/ui-search-shell.entry.js +1 -1
- package/dist/esm/ui-select.entry.js +1 -1
- package/dist/esm/ui-switch.entry.js +2 -2
- package/dist/esm/ui-tabs.entry.js +1 -1
- package/dist/esm/ui-textarea.entry.js +1 -1
- package/dist/esm/ui-toast-region.entry.js +1 -1
- package/dist/esm/ui-tooltip.entry.js +1 -1
- package/dist/esm/ui-top-bar.entry.js +1 -1
- package/dist/esm/ui-tree-item.entry.js +2 -2
- package/dist/esm/ui-tree.entry.js +1 -1
- package/dist/index.cjs +368 -63
- package/dist/index.d.cts +18 -1
- package/dist/index.d.ts +18 -1
- package/dist/index.js +2 -2
- package/dist/looma/looma.esm.js +1 -1
- package/dist/looma/p-05592219.entry.js +1 -0
- package/dist/looma/{p-314d5c7c.entry.js → p-0e1741cb.entry.js} +1 -1
- package/dist/looma/{p-bd00d4e8.entry.js → p-0ef4bf13.entry.js} +1 -1
- package/dist/looma/{p-8e254bc4.entry.js → p-166f8593.entry.js} +1 -1
- package/dist/looma/p-262a542c.entry.js +1 -0
- package/dist/looma/{p-672e3d16.entry.js → p-26d357ae.entry.js} +1 -1
- package/dist/looma/{p-b63f6d4f.entry.js → p-30f01909.entry.js} +1 -1
- package/dist/looma/p-393e3e02.entry.js +1 -0
- package/dist/looma/p-3a44b9f9.entry.js +1 -0
- package/dist/looma/{p-fd1e4d22.entry.js → p-558d4f5b.entry.js} +1 -1
- package/dist/looma/{p-25e18ad6.entry.js → p-5780cefa.entry.js} +1 -1
- package/dist/looma/p-5a7261e1.entry.js +1 -0
- package/dist/looma/{p-03f44c45.entry.js → p-7319c147.entry.js} +1 -1
- package/dist/looma/{p-f1750fd7.entry.js → p-78b7e466.entry.js} +1 -1
- package/dist/looma/{p-7c4a225f.entry.js → p-7eb04f09.entry.js} +1 -1
- package/dist/looma/{p-e0f241ab.entry.js → p-81c533f5.entry.js} +1 -1
- package/dist/looma/{p-8e6b1001.entry.js → p-87f501cf.entry.js} +1 -1
- package/dist/looma/{p-cc915913.entry.js → p-89e71bbb.entry.js} +1 -1
- package/dist/looma/{p-a63e2561.entry.js → p-92cd1841.entry.js} +1 -1
- package/dist/looma/{p-5a900d89.entry.js → p-95eb3b58.entry.js} +1 -1
- package/dist/looma/{p-839faf55.entry.js → p-96ec4d7a.entry.js} +1 -1
- package/dist/looma/{p-2c03fa73.entry.js → p-bcb1b47b.entry.js} +1 -1
- package/dist/looma/{p-68430534.entry.js → p-d62da01d.entry.js} +1 -1
- package/dist/looma/{p-13f8195a.entry.js → p-dbcb479c.entry.js} +1 -1
- package/dist/looma/{p-920656cf.entry.js → p-e14024bf.entry.js} +1 -1
- package/dist/looma/{p-3ef2a21b.entry.js → p-fc180770.entry.js} +1 -1
- package/dist/types/components/ui-chip/ui-chip.d.ts +2 -0
- package/dist/types/components/ui-combobox/ui-combobox.d.ts +4 -0
- package/dist/types/components/ui-editable/ui-editable.d.ts +24 -0
- package/dist/types/components/ui-multi-combobox/ui-multi-combobox.d.ts +51 -0
- package/dist/types/components.d.ts +244 -0
- package/dist/types/field/editable.d.ts +5 -0
- package/dist/types/field/multi-combobox.d.ts +11 -0
- package/dist/{ui-affordance-scope.entry-3TUZ6GLW.js → ui-affordance-scope.entry-6N4ZQ5FM.js} +1 -1
- package/dist/{ui-avatar-group.entry-XGJKN25W.js → ui-avatar-group.entry-FTZVEFGI.js} +1 -1
- package/dist/{ui-avatar.entry-SN3G44HW.js → ui-avatar.entry-SST735OH.js} +1 -1
- package/dist/{ui-badge.entry-B6WDCWJX.js → ui-badge.entry-DZGS7MUT.js} +1 -1
- package/dist/{ui-button.entry-AZYUELLV.js → ui-button.entry-5WX56ARJ.js} +1 -1
- package/dist/{ui-callout.entry-QRPWRMPC.js → ui-callout.entry-OI5RNRXV.js} +1 -1
- package/dist/{ui-checkbox.entry-OB6GFC4M.js → ui-checkbox.entry-HCGIQPSE.js} +1 -1
- package/dist/{ui-combobox.entry-IIMMUJF7.js → ui-chip_2.entry-G2IGWJTL.js} +32 -7
- package/dist/{ui-context-menu.entry-AIULIE5Y.js → ui-context-menu.entry-K2LRT2WV.js} +2 -2
- package/dist/{ui-dialog.entry-QSYWYHLY.js → ui-dialog.entry-4W2T27R6.js} +2 -2
- package/dist/{ui-disclosure.entry-3BJEYU3U.js → ui-disclosure.entry-ONYMXRKR.js} +2 -2
- package/dist/ui-editable.entry-4ZHXIOER.js +110 -0
- package/dist/{ui-floating-action-button.entry-JEVNV6FI.js → ui-floating-action-button.entry-XU4JO2ZV.js} +2 -2
- package/dist/{ui-form-field.entry-PKSY7UU4.js → ui-form-field.entry-BZSEWR4A.js} +2 -2
- package/dist/{ui-icon-button.entry-TPX7BE7R.js → ui-icon-button.entry-MHJKL5OZ.js} +2 -2
- package/dist/{ui-input.entry-6NCLNW4E.js → ui-input.entry-BL6EX3GC.js} +2 -2
- package/dist/{ui-menu-item.entry-KA2K3PKV.js → ui-menu-item.entry-LERF3A4G.js} +2 -2
- package/dist/{ui-menu.entry-7GDO5L2T.js → ui-menu.entry-WXDYGFJE.js} +2 -2
- package/dist/ui-multi-combobox.entry-WSNWVRXE.js +196 -0
- package/dist/{ui-popover.entry-FR6YRNK6.js → ui-popover.entry-P6STTQVS.js} +2 -2
- package/dist/{ui-radio-group.entry-7QHXQSNO.js → ui-radio-group.entry-GZLHOY2M.js} +2 -2
- package/dist/{ui-radio.entry-YNMXKLDW.js → ui-radio.entry-4PXIRDKT.js} +2 -2
- package/dist/{ui-search-result-row.entry-AHVVAAIO.js → ui-search-result-row.entry-LHNOT7MK.js} +2 -2
- package/dist/{ui-search-shell.entry-CNBEAMEZ.js → ui-search-shell.entry-GQCMEU2Z.js} +2 -2
- package/dist/{ui-select.entry-TUY6TCTC.js → ui-select.entry-TZU7XX4U.js} +2 -2
- package/dist/{ui-switch.entry-26LFI7B5.js → ui-switch.entry-QFH3YDYP.js} +3 -3
- package/dist/{ui-tabs.entry-LXB62RJJ.js → ui-tabs.entry-A57JVDT2.js} +2 -2
- package/dist/{ui-textarea.entry-JYGMGPX2.js → ui-textarea.entry-L3RLZIGO.js} +2 -2
- package/dist/{ui-toast-region.entry-TOW4KZLZ.js → ui-toast-region.entry-XKKEY4K7.js} +2 -2
- package/dist/{ui-tooltip.entry-SKFNYXPH.js → ui-tooltip.entry-5WQTX7XF.js} +2 -2
- package/dist/{ui-top-bar.entry-S3YP52EA.js → ui-top-bar.entry-KMJEFYOM.js} +2 -2
- package/dist/{ui-tree-item.entry-LWYIPYLC.js → ui-tree-item.entry-TUBC57FI.js} +3 -3
- package/dist/{ui-tree.entry-LXKUQFRU.js → ui-tree.entry-Y75CRURL.js} +2 -2
- package/package.json +1 -1
- package/vue/{chunk-D4AJULDE.js → chunk-2DDIBSFD.js} +87 -1
- package/vue/editor/index.js +1 -1
- package/vue/index.d.ts +127 -2
- package/vue/index.js +5 -1
- package/dist/cjs/ui-chip.cjs.entry.js +0 -19
- package/dist/esm/ui-chip.entry.js +0 -17
- package/dist/looma/p-82f2fa3d.entry.js +0 -1
- package/dist/looma/p-97e8cb0e.entry.js +0 -1
- package/dist/looma/p-9e1c4020.entry.js +0 -1
- package/dist/looma/p-cfba8f7c.entry.js +0 -1
- package/dist/ui-chip.entry-XSNPJXX3.js +0 -22
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-BHG9Rpil.js');
|
|
4
|
+
|
|
5
|
+
const uiMultiComboboxCss = () => `:host{display:block;min-inline-size:0;color:var(--ui-text-primary);font:inherit}ui-combobox::part(field){flex-wrap:wrap;align-items:center;gap:var(--ui-space-1);min-block-size:var(--ui-multi-combobox-min-block-size, 2.5rem);padding:var(--ui-space-1)}ui-combobox::part(input){flex:1 0 var(--ui-multi-combobox-input-min-inline-size, 5rem);width:auto;min-block-size:1.75rem;padding:var(--ui-space-0-5) var(--ui-space-1)}.items{display:contents}.item{appearance:none;display:inline-flex;max-inline-size:100%;padding:0;border:0;border-radius:var(--ui-radius-1);background:transparent;color:inherit;font:inherit;cursor:default}.item:focus-visible{outline:2px solid var(--ui-focus-ring);outline-offset:1px}.item:disabled{opacity:.6}`;
|
|
6
|
+
|
|
7
|
+
const UIMultiCombobox = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
this.queryChange = index.createEvent(this, "query-change");
|
|
11
|
+
this.addItem = index.createEvent(this, "add-item");
|
|
12
|
+
this.removeItem = index.createEvent(this, "remove-item");
|
|
13
|
+
this.createItem = index.createEvent(this, "create-item");
|
|
14
|
+
this.optionsChange = index.createEvent(this, "options-change");
|
|
15
|
+
}
|
|
16
|
+
get host() { return index.getElement(this); }
|
|
17
|
+
label = '';
|
|
18
|
+
placeholder = '';
|
|
19
|
+
items = [];
|
|
20
|
+
config = {};
|
|
21
|
+
query;
|
|
22
|
+
defaultQuery = '';
|
|
23
|
+
/** Characters that commit the current query and leave the input ready for the next item. */
|
|
24
|
+
tokenSeparators = [];
|
|
25
|
+
disabled = false;
|
|
26
|
+
readOnly = false;
|
|
27
|
+
required = false;
|
|
28
|
+
name = '';
|
|
29
|
+
queryChange;
|
|
30
|
+
addItem;
|
|
31
|
+
removeItem;
|
|
32
|
+
createItem;
|
|
33
|
+
optionsChange;
|
|
34
|
+
raw = '';
|
|
35
|
+
rows = [];
|
|
36
|
+
combobox;
|
|
37
|
+
filteredConfig;
|
|
38
|
+
filteredConfigSource;
|
|
39
|
+
filteredSelection = '';
|
|
40
|
+
componentWillLoad() { this.raw = this.query ?? this.defaultQuery; }
|
|
41
|
+
syncQuery() {
|
|
42
|
+
if (this.query !== undefined)
|
|
43
|
+
this.raw = this.query;
|
|
44
|
+
}
|
|
45
|
+
get selectedValues() { return new Set(this.items.map(item => item.value)); }
|
|
46
|
+
get comboboxConfig() {
|
|
47
|
+
const selectionKey = this.items.map(item => item.value).join('\u0000');
|
|
48
|
+
if (this.filteredConfig && this.filteredConfigSource === this.config && this.filteredSelection === selectionKey) {
|
|
49
|
+
return this.filteredConfig;
|
|
50
|
+
}
|
|
51
|
+
const ownerFilter = this.config.filter;
|
|
52
|
+
const selected = this.selectedValues;
|
|
53
|
+
this.filteredConfigSource = this.config;
|
|
54
|
+
this.filteredSelection = selectionKey;
|
|
55
|
+
this.filteredConfig = {
|
|
56
|
+
...this.config,
|
|
57
|
+
filter: (option, query, context) => !selected.has(option.value)
|
|
58
|
+
&& (ownerFilter ? ownerFilter(option, query, context) : option.label.toLocaleLowerCase().includes(query.toLocaleLowerCase())),
|
|
59
|
+
};
|
|
60
|
+
return this.filteredConfig;
|
|
61
|
+
}
|
|
62
|
+
setQuery(query, trigger) {
|
|
63
|
+
if (this.query === undefined)
|
|
64
|
+
this.raw = query;
|
|
65
|
+
this.queryChange.emit({ query, display: query, trigger });
|
|
66
|
+
}
|
|
67
|
+
clearCommittedQuery(input, trigger) {
|
|
68
|
+
// Clear the native control before another key can arrive. Controlled adapters
|
|
69
|
+
// still receive query-change, but do not need to round-trip before typing resumes.
|
|
70
|
+
input.value = '';
|
|
71
|
+
this.raw = '';
|
|
72
|
+
this.setQuery('', trigger);
|
|
73
|
+
}
|
|
74
|
+
onQueryChange = (event) => {
|
|
75
|
+
event.stopPropagation();
|
|
76
|
+
this.setQuery(event.detail.query, event.detail.trigger);
|
|
77
|
+
};
|
|
78
|
+
onOptionsChange = (event) => {
|
|
79
|
+
event.stopPropagation();
|
|
80
|
+
this.rows = event.detail;
|
|
81
|
+
this.optionsChange.emit(event.detail);
|
|
82
|
+
};
|
|
83
|
+
onValueChange = (event) => {
|
|
84
|
+
event.stopPropagation();
|
|
85
|
+
if (event.detail.kind !== 'selection' || !event.detail.option)
|
|
86
|
+
return;
|
|
87
|
+
const item = event.detail.option;
|
|
88
|
+
this.addItem.emit({ item, index: this.items.length, trigger: event.detail.trigger });
|
|
89
|
+
// ui-combobox emits its selection value before the matching label query.
|
|
90
|
+
// Clear after both owner notifications so the stale label cannot win.
|
|
91
|
+
queueMicrotask(() => this.setQuery('', event.detail.trigger));
|
|
92
|
+
};
|
|
93
|
+
onCreateEntry = (event) => {
|
|
94
|
+
event.stopPropagation();
|
|
95
|
+
const query = event.detail.query.trim();
|
|
96
|
+
if (!query)
|
|
97
|
+
return;
|
|
98
|
+
this.setQuery('', event.detail.trigger);
|
|
99
|
+
this.createItem.emit({ query, trigger: event.detail.trigger });
|
|
100
|
+
};
|
|
101
|
+
commitQuery(input, trigger) {
|
|
102
|
+
const query = this.raw.trim();
|
|
103
|
+
if (!query)
|
|
104
|
+
return;
|
|
105
|
+
const normalizedQuery = query.toLocaleLowerCase();
|
|
106
|
+
const option = this.rows.find(row => row.label.trim().toLocaleLowerCase() === normalizedQuery);
|
|
107
|
+
if (option) {
|
|
108
|
+
this.clearCommittedQuery(input, trigger);
|
|
109
|
+
this.addItem.emit({ item: option, index: this.items.length, trigger });
|
|
110
|
+
}
|
|
111
|
+
else if (this.config.allowCreate) {
|
|
112
|
+
this.clearCommittedQuery(input, trigger);
|
|
113
|
+
this.createItem.emit({ query, trigger });
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
remove(index, trigger) {
|
|
117
|
+
const item = this.items[index];
|
|
118
|
+
if (!item || item.disabled || this.disabled || this.readOnly)
|
|
119
|
+
return;
|
|
120
|
+
this.removeItem.emit({ item, index, trigger });
|
|
121
|
+
requestAnimationFrame(() => {
|
|
122
|
+
const buttons = this.host.shadowRoot?.querySelectorAll('[part="item"]') ?? [];
|
|
123
|
+
const next = buttons[Math.min(index, buttons.length - 1)] ?? buttons[index - 1];
|
|
124
|
+
if (next && next.dataset.value !== item.value)
|
|
125
|
+
next.focus();
|
|
126
|
+
else
|
|
127
|
+
void this.focusInput();
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
focusItem(index) {
|
|
131
|
+
this.host.shadowRoot?.querySelectorAll('[part="item"]')[index]?.focus();
|
|
132
|
+
}
|
|
133
|
+
onItemKeyDown = (event, index) => {
|
|
134
|
+
if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
|
|
135
|
+
return;
|
|
136
|
+
if (event.key === 'ArrowLeft') {
|
|
137
|
+
event.preventDefault();
|
|
138
|
+
event.stopPropagation();
|
|
139
|
+
this.focusItem(Math.max(0, index - 1));
|
|
140
|
+
}
|
|
141
|
+
else if (event.key === 'ArrowRight') {
|
|
142
|
+
event.preventDefault();
|
|
143
|
+
event.stopPropagation();
|
|
144
|
+
if (index === this.items.length - 1)
|
|
145
|
+
void this.focusInput();
|
|
146
|
+
else
|
|
147
|
+
this.focusItem(index + 1);
|
|
148
|
+
}
|
|
149
|
+
else if (event.key === 'Backspace' || event.key === 'Delete') {
|
|
150
|
+
event.preventDefault();
|
|
151
|
+
event.stopPropagation();
|
|
152
|
+
this.remove(index, 'keyboard');
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
onKeyDown = (event) => {
|
|
156
|
+
if (event.defaultPrevented || event.isComposing || this.disabled || this.readOnly || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
|
|
157
|
+
return;
|
|
158
|
+
const input = event.composedPath().find(node => node instanceof HTMLInputElement);
|
|
159
|
+
if (!input)
|
|
160
|
+
return;
|
|
161
|
+
if (this.tokenSeparators.includes(event.key)) {
|
|
162
|
+
event.preventDefault();
|
|
163
|
+
event.stopPropagation();
|
|
164
|
+
this.commitQuery(input, 'keyboard');
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
if (this.raw || (input.selectionStart ?? 0) > 0)
|
|
168
|
+
return;
|
|
169
|
+
if (event.key === 'ArrowLeft' && this.items.length) {
|
|
170
|
+
event.preventDefault();
|
|
171
|
+
this.focusItem(this.items.length - 1);
|
|
172
|
+
}
|
|
173
|
+
else if (event.key === 'Backspace' && this.items.length) {
|
|
174
|
+
event.preventDefault();
|
|
175
|
+
this.remove(this.items.length - 1, 'keyboard');
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
async focusInput() { await this.combobox?.focusInput(); }
|
|
179
|
+
render() {
|
|
180
|
+
return index.h(index.Host, { key: 'c1acc758a2856e5bd022e076030798c9d63ff416', onKeyDown: this.onKeyDown }, index.h("ui-combobox", { key: '8f77d28aa1d228dd809f86695429328decaf7468', ref: element => this.combobox = element, label: this.label, "label-visibility": "sr-only", placeholder: this.placeholder, name: this.name, value: null, query: this.raw, config: this.comboboxConfig, size: "sm", disabled: this.disabled, readOnly: this.readOnly, required: this.required, "onQuery-change": this.onQueryChange, "onValue-change": this.onValueChange, "onCreate-entry": this.onCreateEntry, "onOptions-change": this.onOptionsChange }, index.h("div", { key: 'f4f0849c145d9bcc4d47103d3dc4fdce8009aeab', slot: "start", class: "items", role: "group", "aria-label": `Selected ${this.label}` }, this.items.map((item, index$1) => index.h("button", { type: "button", part: "item", class: "item", "data-value": item.value, tabIndex: -1, disabled: this.disabled || this.readOnly || item.disabled, "aria-label": `${item.label}, press Delete or Backspace to remove`, onKeyDown: event => this.onItemKeyDown(event, index$1) }, index.h("slot", { name: `item-${item.id}` }, index.h("ui-chip", { appearance: "pill" }, item.label))))), this.rows.map(option => index.h("span", { slot: `option-${option.id}` }, index.h("slot", { name: `option-${option.id}` }, option.label))), index.h("span", { key: '3cf42f492bd946ca130321a2c3fcf976602c6566', slot: "create" }, index.h("slot", { key: '6f158cb1d96c0d0401fe5302cabffd052498f651', name: "create" }, "Create \u201C", this.raw, "\u201D")), index.h("span", { key: '0f436aca38aecf9485963d6588c27ab3288ced55', slot: "loading" }, index.h("slot", { key: '6c079ac5bbf6fff57aa7fa6f0022a939c96a5cd0', name: "loading" }, "Loading suggestions\u2026")), index.h("span", { key: 'a7893e0ff0a1922a404e7c072338858d9e7fdf12', slot: "empty" }, index.h("slot", { key: 'd6831db76cc1252aa942ccdcfba36c8cf4c60d22', name: "empty" }, "No suggestions.")), index.h("span", { key: 'a096a393a167256cff11f77110ae29ac58a33779', slot: "error" }, index.h("slot", { key: '1bf52c85e911d9965b9b691d6ebf0b89bbea2d58', name: "error" }, "Unable to load suggestions.")), index.h("div", { key: 'b7d88c9b427305da8b986eb993b49e5c581c1445', slot: "footer" }, index.h("slot", { key: 'f84fdf78c3e373f4735ed88574af06f1ca3cc1b5', name: "footer" }))));
|
|
181
|
+
}
|
|
182
|
+
static get watchers() { return {
|
|
183
|
+
"query": [{
|
|
184
|
+
"syncQuery": 0
|
|
185
|
+
}]
|
|
186
|
+
}; }
|
|
187
|
+
};
|
|
188
|
+
UIMultiCombobox.style = uiMultiComboboxCss();
|
|
189
|
+
|
|
190
|
+
exports.ui_multi_combobox = UIMultiCombobox;
|
|
@@ -113,7 +113,7 @@ const UIPopover = class {
|
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
115
|
render() {
|
|
116
|
-
return (index.h(index.Host, { key: '
|
|
116
|
+
return (index.h(index.Host, { key: 'a4986ace0f3c586774a549cb844287b28ccd0531', "data-open": this.internalOpen ? '' : undefined, onKeyDown: this.onKeydown }, index.h("div", { key: '8f2c589916d06138ef72bfe0d039893b3c59a7cc', class: "popover__surface" }, index.h("slot", { key: 'ee70e7dcc53a99b5c80e56862a6eb00edcfcf912' }))));
|
|
117
117
|
}
|
|
118
118
|
static get watchers() { return {
|
|
119
119
|
"open": [{
|
|
@@ -109,7 +109,7 @@ const UIRadioGroup = class {
|
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
111
|
render() {
|
|
112
|
-
return (index.h(index.Host, { key: '
|
|
112
|
+
return (index.h(index.Host, { key: '1882ad7c092c6a138eab2a52c19beb9a950a8d5a', role: "radiogroup", "aria-orientation": this.orientation, "data-orientation": this.orientation, "data-disabled": this.disabled ? '' : undefined }, index.h("slot", { key: 'd5abade3d23963410cfbac17e80aa16dd21ccc6e' })));
|
|
113
113
|
}
|
|
114
114
|
static get watchers() { return {
|
|
115
115
|
"value": [{
|
|
@@ -69,7 +69,7 @@ const UIRadio = class {
|
|
|
69
69
|
});
|
|
70
70
|
};
|
|
71
71
|
render() {
|
|
72
|
-
return (index.h(index.Host, { key: '
|
|
72
|
+
return (index.h(index.Host, { key: 'f4700b43790accd29a6bcc55fcc862072e29c335', role: "radio", "aria-checked": String(this.internalChecked), "aria-disabled": String(this.disabled), "data-disabled": this.disabled ? '' : undefined }, index.h("slot", { key: 'ed32c35f8f68c662a8b95e58b74c8c76c959ea49', ref: (el) => (this.slotRef = el) })));
|
|
73
73
|
}
|
|
74
74
|
static get watchers() { return {
|
|
75
75
|
"checked": [{
|
|
@@ -39,7 +39,7 @@ const UISearchResultRow = class {
|
|
|
39
39
|
this.hasTrailing = slotHasContent(this.trailingSlot);
|
|
40
40
|
};
|
|
41
41
|
render() {
|
|
42
|
-
return (index.h(index.Host, { key: '
|
|
42
|
+
return (index.h(index.Host, { key: 'eeda041dbcf8841cd53be9c532df208eb3be3d3b' }, index.h("button", { key: '71d3db6d2eca4f8d7796429f68ef73bf2c7b62f7', class: "search-result-row", type: "button", disabled: this.disabled, part: "button" }, index.h("span", { key: 'f2260cab9f654e7f5e96a5e7e2a1cbbb5a55fde3', class: "search-result-row__leading", part: "leading", hidden: !this.hasLeading }, index.h("slot", { key: '824fffc19c2b5712dae0c000f12cc36a0043a370', name: "leading", ref: (el) => (this.leadingSlot = el), onSlotchange: this.syncSlots })), index.h("span", { key: '4e3728ea7d363f256f1b3283df6eb984cf3f570f', class: "search-result-row__content", part: "content" }, index.h("span", { key: '95009b1ce569fb4251df62334a5dd88f1de561af', class: "search-result-row__title", part: "title" }, index.h("slot", { key: '132beecf36471ae0db68d686829428225699c534', name: "title" })), index.h("span", { key: '0ad7c8d52aa40ccf62667d3ecca4d48b49917a9a', class: "search-result-row__meta", part: "meta", hidden: !this.hasMeta }, index.h("slot", { key: '4b97129504571a676839287bd87e68d803f8bc99', name: "meta", ref: (el) => (this.metaSlot = el), onSlotchange: this.syncSlots })), index.h("span", { key: 'e6c73e653fb7dc213866a15870281f3f6d95a86b', class: "search-result-row__excerpt", part: "excerpt", hidden: !this.hasExcerpt }, index.h("slot", { key: '49deae8194485304380b8b4b3d4fe96cd6623f4d', name: "excerpt", ref: (el) => (this.excerptSlot = el), onSlotchange: this.syncSlots }))), index.h("span", { key: 'c7c6f0b57668644a28d3c4c981b4db79a0e3c42a', class: "search-result-row__trailing", part: "trailing", hidden: !this.hasTrailing }, index.h("slot", { key: 'e6cbceeb41d23c9b7514f53663438069499d1a4d', name: "trailing", ref: (el) => (this.trailingSlot = el), onSlotchange: this.syncSlots })))));
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
UISearchResultRow.style = uiSearchResultRowCss();
|
|
@@ -31,7 +31,7 @@ const UISearchShell = class {
|
|
|
31
31
|
this.hasFooter = slotHasContent(this.footerSlot);
|
|
32
32
|
};
|
|
33
33
|
render() {
|
|
34
|
-
return (index.h("div", { key: '
|
|
34
|
+
return (index.h("div", { key: 'ae5baf1fae88f3c0ff8c98e68e1c31d7f19d7b6a', class: "search-shell", part: "base" }, index.h("slot", { key: '192d10867902bc4618762ab3ce1ca8a44229ec11', name: "backdrop" }), index.h("div", { key: '72bafd3ba7aadebcb011fb27f56793a9079bb2e1', class: "search-shell__panel", part: "panel" }, index.h("div", { key: 'c2d46c9099699cc1c2f357cb51d11ab0e6cf6c69', class: "search-shell__search", part: "search" }, index.h("slot", { key: '21f4ed690247fa794bd9322c75cee1721926087a', name: "search" })), index.h("div", { key: '84baba674456aa2a5878d5858d0e6531251440ce', class: "search-shell__status", part: "status", hidden: !this.hasStatus }, index.h("slot", { key: '6e7b6533a29231ebbcd41529d8120649ca4a1dd1', name: "status", ref: (el) => (this.statusSlot = el), onSlotchange: this.syncSlots })), index.h("div", { key: '710d51d450132ad0f528b2eb2cd6f0312dbced2f', class: "search-shell__body", part: "body" }, index.h("slot", { key: '2c380ff4ad33ead6ca8c2611ebc024f125f0da48', name: "body" })), index.h("div", { key: '6923984a31c7bc23bae3ecee08d7acad14703a02', class: "search-shell__footer", part: "footer", hidden: !this.hasFooter }, index.h("slot", { key: '57c2eab7a3f46558ada8d1aa70d64f434bb8cdd6', name: "footer", ref: (el) => (this.footerSlot = el), onSlotchange: this.syncSlots })))));
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
UISearchShell.style = uiSearchShellCss();
|
|
@@ -80,7 +80,7 @@ const UISelect = class {
|
|
|
80
80
|
});
|
|
81
81
|
};
|
|
82
82
|
render() {
|
|
83
|
-
return (index.h(index.Host, { key: '
|
|
83
|
+
return (index.h(index.Host, { key: '74cbe4a76a23af415c202c61951ad513b0ed6cb8', "data-invalid": this.invalid ? '' : undefined }, index.h("slot", { key: 'e86eb0cfb0d379cb3f8b2ea5ce3c69639d0cdda4', ref: (el) => (this.slotRef = el) })));
|
|
84
84
|
}
|
|
85
85
|
static get watchers() { return {
|
|
86
86
|
"value": [{
|
|
@@ -49,7 +49,7 @@ const UISwitch = class {
|
|
|
49
49
|
this.toggle('pointer');
|
|
50
50
|
};
|
|
51
51
|
render() {
|
|
52
|
-
return (index.h(index.Host, { key: '
|
|
52
|
+
return (index.h(index.Host, { key: 'a37ded5259d71a57308cba6dd158ae4ae81e4e8b', role: "switch", "aria-checked": String(this.internalChecked), "aria-disabled": String(this.disabled), "data-disabled": this.disabled ? '' : undefined, tabIndex: this.disabled ? -1 : 0, onKeyDown: this.onKeydown, onClick: this.onClick }, index.h("input", { key: '882f81f39d752430f1de1554a5d83176416f4617', type: "checkbox", checked: this.internalChecked, disabled: this.disabled, required: this.required, value: this.value, "aria-hidden": "true", tabIndex: -1, onChange: (e) => {
|
|
53
53
|
const input = e.target;
|
|
54
54
|
const checked = input.checked;
|
|
55
55
|
if (!controlledState.isControlled(this.checked))
|
|
@@ -61,7 +61,7 @@ const UISwitch = class {
|
|
|
61
61
|
});
|
|
62
62
|
if (controlledState.isControlled(this.checked))
|
|
63
63
|
input.checked = this.internalChecked;
|
|
64
|
-
} }), index.h("slot", { key: '
|
|
64
|
+
} }), index.h("slot", { key: 'b3b2b5afae622d1ae79cadd84f60c6b6c2df55a4' })));
|
|
65
65
|
}
|
|
66
66
|
static get watchers() { return {
|
|
67
67
|
"checked": [{
|
|
@@ -99,7 +99,7 @@ const UITabs = class {
|
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
render() {
|
|
102
|
-
return (index.h(index.Host, { key: '
|
|
102
|
+
return (index.h(index.Host, { key: '19207153c7b7a6ea5f5ffb50439e99af70984b44', orientation: this.orientation, "data-orientation": this.orientation }, index.h("slot", { key: '5045cd040eeccd028c00328206d47f7d17b622de' })));
|
|
103
103
|
}
|
|
104
104
|
static get watchers() { return {
|
|
105
105
|
"value": [{
|
|
@@ -79,7 +79,7 @@ const UITextarea = class {
|
|
|
79
79
|
});
|
|
80
80
|
};
|
|
81
81
|
render() {
|
|
82
|
-
return (index.h(index.Host, { key: '
|
|
82
|
+
return (index.h(index.Host, { key: '020adfed4a177ef5d07852ff2e6ffb66b6f80742', "data-invalid": this.invalid ? '' : undefined }, index.h("slot", { key: '2e9bd0e071e24fcf248eadf38f16484321359503', ref: (el) => (this.slotRef = el) })));
|
|
83
83
|
}
|
|
84
84
|
static get watchers() { return {
|
|
85
85
|
"value": [{
|
|
@@ -77,7 +77,7 @@ const UIToastRegion = class {
|
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
79
|
render() {
|
|
80
|
-
return (index.h(index.Host, { key: '
|
|
80
|
+
return (index.h(index.Host, { key: '8a3546bcd59e12f21393ea55fa4d232d3907a34e', role: "region", "aria-label": "Notifications", "aria-live": "polite", "data-open": this.internalOpen ? '' : undefined }, index.h("slot", { key: 'a4a4525a1ca768d65ff36b3889a821b8dda8b6f7' })));
|
|
81
81
|
}
|
|
82
82
|
static get watchers() { return {
|
|
83
83
|
"open": [{
|
|
@@ -219,7 +219,7 @@ const UITooltip = class {
|
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
render() {
|
|
222
|
-
return (index.h(index.Host, { key: '
|
|
222
|
+
return (index.h(index.Host, { key: '6c70f235889d6f1c425f0a51fcfc04e06a96dea4', role: "tooltip", hidden: !this.internalOpen, "data-open": this.internalOpen ? '' : undefined }, index.h("div", { key: '5c4f1d264e32d308f5b26af4e967e13369c4238a', class: "tooltip__surface" }, index.h("slot", { key: '52b5900d67ffa7590b0ff97511f99718d2e8c311' }))));
|
|
223
223
|
}
|
|
224
224
|
static get watchers() { return {
|
|
225
225
|
"open": [{
|
|
@@ -35,7 +35,7 @@ const UITopBar = class {
|
|
|
35
35
|
this.hasActions = slotHasContent(this.actionsSlot);
|
|
36
36
|
};
|
|
37
37
|
render() {
|
|
38
|
-
return (index.h(index.Host, { key: '
|
|
38
|
+
return (index.h(index.Host, { key: 'ef7cf644a8e8381d7d1f8d093bcfefcdc4620682' }, index.h("header", { key: '5055594a179d86efefd43529e070a582c51cb1d8', class: "top-bar", part: "base" }, index.h("div", { key: 'bd6ec069ae9d7820a6992250ba1aa997b4cc6754', class: "top-bar__leading", hidden: !this.hasLeading }, index.h("slot", { key: '3b9b1b73fb455ad720e1db46757555eb3713c0b8', name: "leading", ref: (el) => (this.leadingSlot = el), onSlotchange: this.syncSlots })), index.h("div", { key: 'e402cc0cb7ec4418460182f8f32cb161c6139221', class: "top-bar__title" }, index.h("slot", { key: 'fce0cfc11da269167853f591742b1369023864ae' })), index.h("div", { key: '6861bb04f399076378aa1fa9be24b35db277106a', class: "top-bar__search", hidden: !this.hasSearch }, index.h("slot", { key: '3857f37d53ec99b36a52cb7830e634afdee29d2e', name: "search", ref: (el) => (this.searchSlot = el), onSlotchange: this.syncSlots })), index.h("div", { key: '538f6297078b6d5aa85906e902066e8809f52540', class: "top-bar__actions", hidden: !this.hasActions }, index.h("slot", { key: '3c45ff59c4b48673e796c6e93842cb11fceb652f', name: "actions", ref: (el) => (this.actionsSlot = el), onSlotchange: this.syncSlots })))));
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
UITopBar.style = uiTopBarCss();
|
|
@@ -119,10 +119,10 @@ const UITreeItem = class {
|
|
|
119
119
|
const expanded = this.isExpanded();
|
|
120
120
|
const disclosureLabel = `${expanded ? 'Collapse' : 'Expand'} ${this.label || 'item'}`;
|
|
121
121
|
const dragLabel = `Drag ${this.label || 'item'} to reorder`;
|
|
122
|
-
return (index.h(index.Host, { key: '
|
|
122
|
+
return (index.h(index.Host, { key: 'f092fa9586a39aba1a9629ba42e52f8fbc10de05', role: "treeitem", "aria-label": this.label || undefined, "aria-level": String(level), "aria-expanded": this.container ? String(expanded) : undefined, "aria-selected": String(this.selected), "aria-disabled": this.disabled ? 'true' : undefined, "data-container": this.container ? '' : undefined, "data-selected": this.selected ? '' : undefined, "data-disabled": this.disabled ? '' : undefined, "data-drag-type": this.dragType || 'item', "data-drop-scope": this.dropScope || undefined, "data-accepts": this.accepts || undefined, tabIndex: this.disabled || !this.tabStop ? -1 : 0, style: {
|
|
123
123
|
'--ui-tree-item-depth': String(level - 1),
|
|
124
124
|
'margin-inline-start': level > 1 ? 'var(--ui-tree-indent, 16px)' : '0px',
|
|
125
|
-
} }, index.h("div", { key: '
|
|
125
|
+
} }, index.h("div", { key: '2f16d97219ba9ec9e37688d97ad9144508aa1ed5', class: "row", part: "row", onClick: this.onRowClick }, this.sortable && !this.disabled ? (index.h("button", { class: "drag-handle", part: "drag-handle", type: "button", draggable: true, "aria-label": dragLabel, title: dragLabel }, index.h("span", { innerHTML: icons.loomaIconMarkup('grip-vertical') }))) : null, this.container ? (index.h("button", { class: "disclosure", part: "disclosure", type: "button", "aria-label": disclosureLabel, "aria-expanded": String(expanded), disabled: this.disabled, onClick: this.onDisclosureClick, onKeyDown: this.onDisclosureKeydown }, index.h("span", { class: { 'disclosure-icon': true, 'disclosure-icon--expanded': expanded }, innerHTML: icons.loomaIconMarkup('chevron-down') }))) : index.h("span", { class: "disclosure-spacer", "aria-hidden": "true" }), index.h("span", { key: 'd984631c891df304edb3e1dc5bcd19af3ad8e20d', class: "leading", part: "leading" }, index.h("slot", { key: '81a0e055859df5d4daaa6dac39013b23dcc2831b', name: "leading" })), index.h("span", { key: '3ae295523d5a3b9feaa9bfaa16d807349e37d78b', class: "label", part: "label" }, index.h("slot", { key: 'db8503a41d087d283074a41e76fa872ff4b2a707' })), index.h("span", { key: 'ac5b5db7128b31a9263b912bd64cd90ac640eaeb', class: "actions", part: "actions" }, index.h("slot", { key: 'c8842a5d80215ec297688c86f6bfe9b4d9bed333', name: "actions" })), index.h("span", { key: 'b7f239bc16867678291850ad61a5cd752d6a7425', class: "drop-indicator row-drop-indicator", part: "drop-indicator", "aria-hidden": "true" })), this.container ? (index.h("div", { class: "children", part: "children", role: "group", hidden: !expanded }, index.h("slot", { name: "children" }))) : null, index.h("span", { key: '2a5f448db2f4f363a34a1a950785e0ee12cc9938', class: "drop-indicator subtree-drop-indicator", part: "drop-indicator", "aria-hidden": "true" })));
|
|
126
126
|
}
|
|
127
127
|
static get watchers() { return {
|
|
128
128
|
"expanded": [{
|
|
@@ -492,7 +492,7 @@ const UITree = class {
|
|
|
492
492
|
}
|
|
493
493
|
};
|
|
494
494
|
render() {
|
|
495
|
-
return (index.h(index.Host, { key: '
|
|
495
|
+
return (index.h(index.Host, { key: '7efbf793fe63471006df57f0045a5fe995c81440', role: "tree", "aria-label": this.label || 'Tree' }, index.h("slot", { key: '1804e391796e7451c93cb58258e0e23ec3ad98c7' })));
|
|
496
496
|
}
|
|
497
497
|
};
|
|
498
498
|
UITree.style = uiTreeCss();
|
|
@@ -12,12 +12,14 @@
|
|
|
12
12
|
"components/ui-context-menu/ui-context-menu.js",
|
|
13
13
|
"components/ui-dialog/ui-dialog.js",
|
|
14
14
|
"components/ui-disclosure/ui-disclosure.js",
|
|
15
|
+
"components/ui-editable/ui-editable.js",
|
|
15
16
|
"components/ui-floating-action-button/ui-floating-action-button.js",
|
|
16
17
|
"components/ui-form-field/ui-form-field.js",
|
|
17
18
|
"components/ui-icon-button/ui-icon-button.js",
|
|
18
19
|
"components/ui-input/ui-input.js",
|
|
19
20
|
"components/ui-menu/ui-menu.js",
|
|
20
21
|
"components/ui-menu-item/ui-menu-item.js",
|
|
22
|
+
"components/ui-multi-combobox/ui-multi-combobox.js",
|
|
21
23
|
"components/ui-popover/ui-popover.js",
|
|
22
24
|
"components/ui-radio/ui-radio.js",
|
|
23
25
|
"components/ui-radio-group/ui-radio-group.js",
|
|
@@ -3,8 +3,10 @@ import { Host, h } from "@stencil/core";
|
|
|
3
3
|
export class UIChip {
|
|
4
4
|
/** `tag` has a square leading edge and an angled trailing edge; `pill` is fully rounded. */
|
|
5
5
|
appearance = 'tag';
|
|
6
|
+
/** Compact typography size. */
|
|
7
|
+
size = 'xs';
|
|
6
8
|
render() {
|
|
7
|
-
return (h(Host, { key: '
|
|
9
|
+
return (h(Host, { key: '970cb48cf8d70c47feaab90fe428c09f0d052a03', "data-appearance": this.appearance, "data-size": this.size }, h("span", { key: '6d8c6104d2869520097a2a61bd2a887b363b4912', class: "chip__surface" }, h("slot", { key: 'b61c50a8060d8a2684aed6f87dc859b1c9e99858' }))));
|
|
8
10
|
}
|
|
9
11
|
static get is() { return "ui-chip"; }
|
|
10
12
|
static get encapsulation() { return "shadow"; }
|
|
@@ -39,6 +41,26 @@ export class UIChip {
|
|
|
39
41
|
"reflect": false,
|
|
40
42
|
"attribute": "appearance",
|
|
41
43
|
"defaultValue": "'tag'"
|
|
44
|
+
},
|
|
45
|
+
"size": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"mutable": false,
|
|
48
|
+
"complexType": {
|
|
49
|
+
"original": "'xs' | 'sm'",
|
|
50
|
+
"resolved": "\"sm\" | \"xs\"",
|
|
51
|
+
"references": {}
|
|
52
|
+
},
|
|
53
|
+
"required": false,
|
|
54
|
+
"optional": false,
|
|
55
|
+
"docs": {
|
|
56
|
+
"tags": [],
|
|
57
|
+
"text": "Compact typography size."
|
|
58
|
+
},
|
|
59
|
+
"getter": false,
|
|
60
|
+
"setter": false,
|
|
61
|
+
"reflect": false,
|
|
62
|
+
"attribute": "size",
|
|
63
|
+
"defaultValue": "'xs'"
|
|
42
64
|
}
|
|
43
65
|
};
|
|
44
66
|
}
|
|
@@ -21,6 +21,8 @@ export class UICombobox {
|
|
|
21
21
|
readOnly = false;
|
|
22
22
|
required = false;
|
|
23
23
|
size = 'md';
|
|
24
|
+
/** Keep the native label accessible while allowing compact composed controls. */
|
|
25
|
+
labelVisibility = 'visible';
|
|
24
26
|
disclosure = false;
|
|
25
27
|
clearable = false;
|
|
26
28
|
/** Optional description shown by the connected question-mark button. */
|
|
@@ -242,8 +244,9 @@ export class UICombobox {
|
|
|
242
244
|
}, reason === 'disclosure' ? 0 : Math.max(0, config.debounce ?? 200));
|
|
243
245
|
}
|
|
244
246
|
get canCreate() {
|
|
247
|
+
const candidates = this.config.options ? [...this.config.options, ...this.rows] : this.rows;
|
|
245
248
|
return Boolean(this.config.allowCreate && this.raw.trim() && !this.loading && !this.lookupError
|
|
246
|
-
&& !
|
|
249
|
+
&& !candidates.some(row => row.label.toLocaleLowerCase() === this.raw.toLocaleLowerCase()));
|
|
247
250
|
}
|
|
248
251
|
format(timing) {
|
|
249
252
|
if ((this.config.formatOn ?? 'blur') !== timing || !this.input)
|
|
@@ -428,19 +431,24 @@ export class UICombobox {
|
|
|
428
431
|
catch { /* Aborted work never becomes current field state. */ }
|
|
429
432
|
return this.validation;
|
|
430
433
|
}
|
|
434
|
+
/** Focus the native editing input from a composed control. */
|
|
435
|
+
async focusInput() { this.input?.focus(); }
|
|
431
436
|
render() {
|
|
432
437
|
const description = [this.helpOpen ? 'help-text' : '', this.validation.issues.length ? 'validation' : ''].filter(Boolean).join(' ') || undefined;
|
|
433
438
|
const status = this.loading ? 'Loading suggestions…' : this.lookupError || (this.expanded ? `${this.rows.length} suggestions available.` : '');
|
|
434
439
|
const groups = [...new Set(this.rows.map(row => row.group ?? ''))];
|
|
435
|
-
return h(Host, { key: '
|
|
440
|
+
return h(Host, { key: 'a33890c2824f29dfea5e22edddca4480a6d1d032', "data-size": this.size, "data-validation": this.validation.status, onFocusout: this.onFocusOut }, h("label", { key: 'c936530cf696c1d14245fd83895e9c58c908df12', htmlFor: "input", part: "label", class: this.labelVisibility === 'sr-only' ? 'sr-only' : undefined }, this.label, this.required ? ' *' : ''), h("div", { key: '0fe0ed9b15a3e256867e071ca7e4fa3abc66f27c', class: "field", part: "field", ref: element => this.field = element, onClick: event => {
|
|
441
|
+
if (!event.composedPath().some(node => node instanceof HTMLButtonElement))
|
|
442
|
+
this.input?.focus();
|
|
443
|
+
} }, h("slot", { key: '9cc4c22eb7776e415792fbdf3c17c962c7107f70', name: "start" }), h("input", { key: '0898e8ec5af57c7ba8ad227164f7955ef4011729', id: "input", ref: element => this.input = element, role: "combobox", "aria-autocomplete": "list", "aria-expanded": String(this.expanded), "aria-controls": "listbox", "aria-activedescendant": this.expanded && this.active >= 0 ? `option-${this.active}` : undefined, "aria-describedby": description, "aria-invalid": String(this.validation.status === 'error'), "aria-busy": String(this.validation.status === 'pending'), value: this.display, placeholder: this.placeholder, name: this.name || undefined, disabled: this.disabled, readOnly: this.readOnly, required: this.required, autoComplete: "off", part: "input", onInput: this.onInput, onKeyDown: this.onKeydown, onCompositionstart: () => this.composing = true, onCompositionend: () => { this.composing = false; this.onInput(new InputEvent('input')); } }), this.clearable && h("button", { key: 'f9a49484ae9bcc4ace72a46d0c59202040ff39d8', type: "button", part: "affordance", "aria-label": `Clear ${this.label}`, disabled: this.disabled || this.readOnly, onClick: () => { this.commit(null, '', null, 'clear', 'pointer'); this.close(); this.input?.focus(); } }, "\u00D7"), this.help && h("button", { key: '597106eda4dcc68aa9fb2eaa99c1edad0d68a892', id: "help", type: "button", part: "affordance", "aria-label": `Help for ${this.label}`, disabled: this.disabled }, h("span", { key: 'd26085a52b16d65e26dc20ef8afacb5defec5f7b', "aria-hidden": "true" }, "?")), this.disclosure && h("button", { key: '391d1c987eb8e868b2846eafd0627cfc78ab7478', type: "button", part: "affordance", "aria-label": `Suggestions for ${this.label}`, "aria-controls": "listbox", "aria-expanded": String(this.expanded), disabled: this.disabled || this.readOnly, onClick: () => {
|
|
436
444
|
if (this.expanded)
|
|
437
445
|
this.close();
|
|
438
446
|
else
|
|
439
447
|
this.open('disclosure');
|
|
440
448
|
this.input?.focus();
|
|
441
|
-
} }, h("span", { key: '
|
|
449
|
+
} }, h("span", { key: '45678ce468fd7944306d4542e3c6af0fe211af14', "aria-hidden": "true" }, "\u2304"))), this.help && h("ui-tooltip", { key: 'a8dc037639a60aff5a12b4651ffa10fc5ccd33eb', id: "help-text", for: "help", toggleOnClick: true, onOpen: () => this.helpOpen = true, onClose: () => this.helpOpen = false }, this.help), h("div", { key: 'f13fc7a11c3d22995035b6701ea24637a048a5b8', class: "popup", part: "popup", hidden: !this.expanded, ref: element => this.popup = element }, h("div", { key: '9d2bdfcc558f8e7de87f2915ea5607a8f32c1762', id: "listbox", role: "listbox", "aria-label": `${this.label} suggestions`, "aria-busy": String(this.loading) }, groups.map(group => h("div", { role: group ? 'group' : 'presentation', "aria-label": group || undefined }, group && h("div", { class: "group", part: "group" }, group), this.rows.map((row, index) => (row.group ?? '') !== group ? null : h("div", { id: `option-${index}`, role: "option", "aria-selected": String(this.selected === row.value), "aria-disabled": String(Boolean(row.disabled)), "data-active": this.active === index ? '' : undefined, part: "option", class: "option", onPointerDown: event => event.preventDefault(), onClick: () => this.choose(index, 'pointer') }, h("slot", { name: `option-${row.id}` }, h("span", { class: "primary", part: "option-primary" }, row.label), row.description && h("span", { class: "secondary", part: "option-secondary" }, row.description)))))), this.canCreate && h("div", { key: '9495fd43a721c84621b8083cb8eac776f843ab59', id: `option-${this.rows.length}`, role: "option", "aria-selected": "false", class: "option", part: "option", "data-active": this.active === this.rows.length ? '' : undefined, onPointerDown: event => event.preventDefault(), onClick: () => this.choose(this.rows.length, 'pointer') }, h("slot", { key: 'f0407c5622dcf3b325985c136657f8b9ac8a4ab5', name: "create" }, "Create \u201C", this.raw, "\u201D"))), this.loading ? h("div", { class: "message" }, h("slot", { name: "loading" }, "Loading suggestions\u2026"))
|
|
442
450
|
: this.lookupError ? h("div", { class: "message" }, h("slot", { name: "error" }, this.lookupError))
|
|
443
|
-
: !this.rows.length && !this.canCreate ? h("div", { class: "message" }, h("slot", { name: "empty" }, "No suggestions.")) : null), h("div", { key: '
|
|
451
|
+
: !this.rows.length && !this.canCreate ? h("div", { class: "message" }, h("slot", { name: "empty" }, "No suggestions.")) : null, h("slot", { key: 'efcaee3efb029a9e0bb4e033ab61b251331c1c93', name: "footer" })), h("div", { key: 'b44ccb319f94ebc9e6ac3204a8c1771d49485a58', id: "validation", class: "message", part: "validation", hidden: !this.validation.issues.length }, this.validation.issues.map(issue => h("div", null, issue.message))), h("div", { key: 'c3cb51dd4603734af4c7a02d8fe0bb42ac69083a', class: "sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true" }, status, " ", this.validation.status === 'pending' ? 'Checking value…' : this.validation.issues.map(issue => issue.message).join(' ')));
|
|
444
452
|
}
|
|
445
453
|
static get is() { return "ui-combobox"; }
|
|
446
454
|
static get encapsulation() { return "shadow"; }
|
|
@@ -698,6 +706,26 @@ export class UICombobox {
|
|
|
698
706
|
"attribute": "size",
|
|
699
707
|
"defaultValue": "'md'"
|
|
700
708
|
},
|
|
709
|
+
"labelVisibility": {
|
|
710
|
+
"type": "string",
|
|
711
|
+
"mutable": false,
|
|
712
|
+
"complexType": {
|
|
713
|
+
"original": "'visible' | 'sr-only'",
|
|
714
|
+
"resolved": "\"sr-only\" | \"visible\"",
|
|
715
|
+
"references": {}
|
|
716
|
+
},
|
|
717
|
+
"required": false,
|
|
718
|
+
"optional": false,
|
|
719
|
+
"docs": {
|
|
720
|
+
"tags": [],
|
|
721
|
+
"text": "Keep the native label accessible while allowing compact composed controls."
|
|
722
|
+
},
|
|
723
|
+
"getter": false,
|
|
724
|
+
"setter": false,
|
|
725
|
+
"reflect": false,
|
|
726
|
+
"attribute": "label-visibility",
|
|
727
|
+
"defaultValue": "'visible'"
|
|
728
|
+
},
|
|
701
729
|
"disclosure": {
|
|
702
730
|
"type": "boolean",
|
|
703
731
|
"mutable": false,
|
|
@@ -948,6 +976,23 @@ export class UICombobox {
|
|
|
948
976
|
"text": "Validate for submission. Caller submits only non-pending, non-error output.",
|
|
949
977
|
"tags": []
|
|
950
978
|
}
|
|
979
|
+
},
|
|
980
|
+
"focusInput": {
|
|
981
|
+
"complexType": {
|
|
982
|
+
"signature": "() => Promise<void>",
|
|
983
|
+
"parameters": [],
|
|
984
|
+
"references": {
|
|
985
|
+
"Promise": {
|
|
986
|
+
"location": "global",
|
|
987
|
+
"id": "global::Promise"
|
|
988
|
+
}
|
|
989
|
+
},
|
|
990
|
+
"return": "Promise<void>"
|
|
991
|
+
},
|
|
992
|
+
"docs": {
|
|
993
|
+
"text": "Focus the native editing input from a composed control.",
|
|
994
|
+
"tags": []
|
|
995
|
+
}
|
|
951
996
|
}
|
|
952
997
|
};
|
|
953
998
|
}
|
|
@@ -212,7 +212,7 @@ export class UIContextMenu {
|
|
|
212
212
|
this.closeMenu('action', 'pointer');
|
|
213
213
|
};
|
|
214
214
|
render() {
|
|
215
|
-
return (h(Host, { key: '
|
|
215
|
+
return (h(Host, { key: '171e647667bab4a9f905f2b531aa2db182fc426f', "data-open": this.internalOpen ? '' : undefined, "data-focus-trigger": this.internalOpen ? this.focusTrigger : undefined, onKeyDown: this.onKeydown, onClick: this.onItemClick }, h("slot", { key: 'f1a15e54ab3b14515553e05b4b3cf60ed7a99f8b', name: "trigger" }), h("div", { key: '450aaacf3f75a71ecce86300c0d824452ceec4a0', class: "menu", "data-open": this.internalOpen ? '' : undefined }, h("ui-menu", { key: '667003b7c6ab3ccbaa888b25cb87d921036ab827', open: this.internalOpen }, h("slot", { key: 'c0731115bc3dbd02c4125ef8208269dd97e124bf' })))));
|
|
216
216
|
}
|
|
217
217
|
static get is() { return "ui-context-menu"; }
|
|
218
218
|
static get encapsulation() { return "shadow"; }
|
|
@@ -104,7 +104,7 @@ export class UIDialog {
|
|
|
104
104
|
this.accessibleLabel = nextLabel;
|
|
105
105
|
};
|
|
106
106
|
render() {
|
|
107
|
-
return (h(Host, { key: '
|
|
107
|
+
return (h(Host, { key: '6e12a287866c76305c791c0ae538dcde63da3044', "data-open": this.internalOpen ? '' : undefined, onKeyDown: this.onKeydown }, h("dialog", { key: '99ba3815e8a8c70ce50ff08d9a8b162aa9c1011f', ref: (el) => (this.dialogRef = el), open: this.internalOpen, "aria-label": this.accessibleLabel }, h("slot", { key: 'e72b001877d2dfad1bcee9af87167c66d77fc952' }))));
|
|
108
108
|
}
|
|
109
109
|
static get is() { return "ui-dialog"; }
|
|
110
110
|
static get encapsulation() { return "shadow"; }
|
|
@@ -88,7 +88,7 @@ export class UIDisclosure {
|
|
|
88
88
|
this.setOpen(!this.internalOpen, { reason: 'action', trigger: 'keyboard' });
|
|
89
89
|
};
|
|
90
90
|
render() {
|
|
91
|
-
return (h(Host, { key: '
|
|
91
|
+
return (h(Host, { key: '55f998f8e47ebe01fd5832d6c3dac310dda34b8d' }, h("slot", { key: '0d88728151901e1e412d7f5a3ae78b06aa7548fb' })));
|
|
92
92
|
}
|
|
93
93
|
static get is() { return "ui-disclosure"; }
|
|
94
94
|
static get encapsulation() { return "shadow"; }
|