@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
|
@@ -1,7 +1,23 @@
|
|
|
1
|
-
import { r as registerInstance,
|
|
1
|
+
import { r as registerInstance, h, H as Host, c as createEvent, g as getElement } from './index-8BGiMGQ0.js';
|
|
2
2
|
import { a as createAnchoredSurface } from './positioning-Bu0dmLBE.js';
|
|
3
3
|
import { c as closeOverlay, o as openOverlay } from './manager-C-0syqXZ.js';
|
|
4
4
|
|
|
5
|
+
const uiChipCss = () => `:host{--ui-chip-surface:var(--ui-surface-subtle);--ui-chip-text:var(--ui-text-secondary);--ui-chip-border:var(--ui-border-default);--ui-chip-font-size:var(--ui-font-size-xs);--ui-chip-font-weight:var(--ui-font-normal);--ui-chip-line-height:var(--ui-line-height-tight);--ui-chip-padding-block:var(--ui-space-0-5);--ui-chip-padding-inline:var(--ui-space-2);--ui-chip-notch:var(--ui-space-1);display:inline-flex;max-width:100%}:host([data-size='sm']){--ui-chip-font-size:var(--ui-font-size-sm)}.chip__surface{display:inline-flex;align-items:center;max-width:100%;padding:var(--ui-chip-padding-block) var(--ui-chip-padding-inline);border:1px solid var(--ui-chip-border);background:var(--ui-chip-surface);color:var(--ui-chip-text) !important;font-family:var(--ui-font-family-sans) !important;font-size:var(--ui-chip-font-size) !important;font-weight:var(--ui-chip-font-weight) !important;line-height:var(--ui-chip-line-height) !important;white-space:nowrap}:host([data-appearance='pill']) .chip__surface{border-radius:var(--ui-radius-round)}:host([data-appearance='tag']) .chip__surface{border:0;padding-inline-end:calc(var(--ui-chip-padding-inline) + var(--ui-chip-notch));clip-path:polygon(0 0, calc(100% - var(--ui-chip-notch)) 0, 100% 50%, calc(100% - var(--ui-chip-notch)) 100%, 0 100%)}`;
|
|
6
|
+
|
|
7
|
+
const UIChip = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
}
|
|
11
|
+
/** `tag` has a square leading edge and an angled trailing edge; `pill` is fully rounded. */
|
|
12
|
+
appearance = 'tag';
|
|
13
|
+
/** Compact typography size. */
|
|
14
|
+
size = 'xs';
|
|
15
|
+
render() {
|
|
16
|
+
return (h(Host, { key: '970cb48cf8d70c47feaab90fe428c09f0d052a03', "data-appearance": this.appearance, "data-size": this.size }, h("span", { key: '6d8c6104d2869520097a2a61bd2a887b363b4912', class: "chip__surface" }, h("slot", { key: 'b61c50a8060d8a2684aed6f87dc859b1c9e99858' }))));
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
UIChip.style = uiChipCss();
|
|
20
|
+
|
|
5
21
|
/** Formatting is additive: every original character must survive in order.
|
|
6
22
|
* Normalization belongs to submitted output, never the visible editing buffer. */
|
|
7
23
|
function formatEditingValue(raw, selection, format) {
|
|
@@ -95,6 +111,8 @@ const UICombobox = class {
|
|
|
95
111
|
readOnly = false;
|
|
96
112
|
required = false;
|
|
97
113
|
size = 'md';
|
|
114
|
+
/** Keep the native label accessible while allowing compact composed controls. */
|
|
115
|
+
labelVisibility = 'visible';
|
|
98
116
|
disclosure = false;
|
|
99
117
|
clearable = false;
|
|
100
118
|
/** Optional description shown by the connected question-mark button. */
|
|
@@ -316,8 +334,9 @@ const UICombobox = class {
|
|
|
316
334
|
}, reason === 'disclosure' ? 0 : Math.max(0, config.debounce ?? 200));
|
|
317
335
|
}
|
|
318
336
|
get canCreate() {
|
|
337
|
+
const candidates = this.config.options ? [...this.config.options, ...this.rows] : this.rows;
|
|
319
338
|
return Boolean(this.config.allowCreate && this.raw.trim() && !this.loading && !this.lookupError
|
|
320
|
-
&& !
|
|
339
|
+
&& !candidates.some(row => row.label.toLocaleLowerCase() === this.raw.toLocaleLowerCase()));
|
|
321
340
|
}
|
|
322
341
|
format(timing) {
|
|
323
342
|
if ((this.config.formatOn ?? 'blur') !== timing || !this.input)
|
|
@@ -502,19 +521,24 @@ const UICombobox = class {
|
|
|
502
521
|
catch { /* Aborted work never becomes current field state. */ }
|
|
503
522
|
return this.validation;
|
|
504
523
|
}
|
|
524
|
+
/** Focus the native editing input from a composed control. */
|
|
525
|
+
async focusInput() { this.input?.focus(); }
|
|
505
526
|
render() {
|
|
506
527
|
const description = [this.helpOpen ? 'help-text' : '', this.validation.issues.length ? 'validation' : ''].filter(Boolean).join(' ') || undefined;
|
|
507
528
|
const status = this.loading ? 'Loading suggestions…' : this.lookupError || (this.expanded ? `${this.rows.length} suggestions available.` : '');
|
|
508
529
|
const groups = [...new Set(this.rows.map(row => row.group ?? ''))];
|
|
509
|
-
return h(Host, { key: '
|
|
530
|
+
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 => {
|
|
531
|
+
if (!event.composedPath().some(node => node instanceof HTMLButtonElement))
|
|
532
|
+
this.input?.focus();
|
|
533
|
+
} }, 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: () => {
|
|
510
534
|
if (this.expanded)
|
|
511
535
|
this.close();
|
|
512
536
|
else
|
|
513
537
|
this.open('disclosure');
|
|
514
538
|
this.input?.focus();
|
|
515
|
-
} }, h("span", { key: '
|
|
539
|
+
} }, 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"))
|
|
516
540
|
: this.lookupError ? h("div", { class: "message" }, h("slot", { name: "error" }, this.lookupError))
|
|
517
|
-
: !this.rows.length && !this.canCreate ? h("div", { class: "message" }, h("slot", { name: "empty" }, "No suggestions.")) : null), h("div", { key: '
|
|
541
|
+
: !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(' ')));
|
|
518
542
|
}
|
|
519
543
|
static get watchers() { return {
|
|
520
544
|
"value": [{
|
|
@@ -536,4 +560,4 @@ const UICombobox = class {
|
|
|
536
560
|
};
|
|
537
561
|
UICombobox.style = uiComboboxCss();
|
|
538
562
|
|
|
539
|
-
export { UICombobox as ui_combobox };
|
|
563
|
+
export { UIChip as ui_chip, UICombobox as ui_combobox };
|
|
@@ -218,7 +218,7 @@ const UIContextMenu = class {
|
|
|
218
218
|
this.closeMenu('action', 'pointer');
|
|
219
219
|
};
|
|
220
220
|
render() {
|
|
221
|
-
return (h(Host, { key: '
|
|
221
|
+
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' })))));
|
|
222
222
|
}
|
|
223
223
|
static get watchers() { return {
|
|
224
224
|
"open": [{
|
|
@@ -110,7 +110,7 @@ const UIDialog = class {
|
|
|
110
110
|
this.accessibleLabel = nextLabel;
|
|
111
111
|
};
|
|
112
112
|
render() {
|
|
113
|
-
return (h(Host, { key: '
|
|
113
|
+
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' }))));
|
|
114
114
|
}
|
|
115
115
|
static get watchers() { return {
|
|
116
116
|
"open": [{
|
|
@@ -94,7 +94,7 @@ const UIDisclosure = class {
|
|
|
94
94
|
this.setOpen(!this.internalOpen, { reason: 'action', trigger: 'keyboard' });
|
|
95
95
|
};
|
|
96
96
|
render() {
|
|
97
|
-
return (h(Host, { key: '
|
|
97
|
+
return (h(Host, { key: '55f998f8e47ebe01fd5832d6c3dac310dda34b8d' }, h("slot", { key: '0d88728151901e1e412d7f5a3ae78b06aa7548fb' })));
|
|
98
98
|
}
|
|
99
99
|
static get watchers() { return {
|
|
100
100
|
"open": [{
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, g as getElement, h, H as Host } from './index-8BGiMGQ0.js';
|
|
2
|
+
import { i as isControlled, c as controlledOrDefault } from './controlled-state-BnGhGgTH.js';
|
|
3
|
+
|
|
4
|
+
const uiEditableCss = () => `:host{display:block;min-inline-size:0}[hidden]{display:none !important}`;
|
|
5
|
+
|
|
6
|
+
const UIEditable = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.editChange = createEvent(this, "edit-change");
|
|
10
|
+
}
|
|
11
|
+
get host() { return getElement(this); }
|
|
12
|
+
/** Controlled edit state. Omit it to use defaultEdit and local interaction state. */
|
|
13
|
+
edit;
|
|
14
|
+
defaultEdit = false;
|
|
15
|
+
disabled = false;
|
|
16
|
+
editChange;
|
|
17
|
+
internalEdit = false;
|
|
18
|
+
trigger = null;
|
|
19
|
+
syncFromProp() {
|
|
20
|
+
if (isControlled(this.edit))
|
|
21
|
+
this.internalEdit = this.edit;
|
|
22
|
+
}
|
|
23
|
+
componentWillLoad() {
|
|
24
|
+
this.internalEdit = controlledOrDefault(this.edit, this.defaultEdit);
|
|
25
|
+
}
|
|
26
|
+
componentDidLoad() {
|
|
27
|
+
this.host.ownerDocument.addEventListener('pointerdown', this.onDocumentPointerDown, true);
|
|
28
|
+
}
|
|
29
|
+
disconnectedCallback() {
|
|
30
|
+
this.host.ownerDocument.removeEventListener('pointerdown', this.onDocumentPointerDown, true);
|
|
31
|
+
}
|
|
32
|
+
requestEdit(next, reason, trigger) {
|
|
33
|
+
if (this.disabled || this.internalEdit === next)
|
|
34
|
+
return;
|
|
35
|
+
if (!isControlled(this.edit))
|
|
36
|
+
this.internalEdit = next;
|
|
37
|
+
this.editChange.emit({ edit: next, reason, trigger });
|
|
38
|
+
if (next)
|
|
39
|
+
requestAnimationFrame(() => this.focusEditor());
|
|
40
|
+
else
|
|
41
|
+
requestAnimationFrame(() => this.trigger?.focus());
|
|
42
|
+
}
|
|
43
|
+
focusEditor() {
|
|
44
|
+
const editRoot = this.host.querySelector('[slot="edit"]');
|
|
45
|
+
const candidate = editRoot?.matches('input, textarea, select, button, [tabindex], ui-combobox, ui-multi-combobox')
|
|
46
|
+
? editRoot
|
|
47
|
+
: editRoot?.querySelector('input, textarea, select, button, [tabindex], ui-combobox, ui-multi-combobox');
|
|
48
|
+
const focusInput = candidate?.focusInput;
|
|
49
|
+
if (typeof focusInput === 'function')
|
|
50
|
+
void focusInput.call(candidate);
|
|
51
|
+
else
|
|
52
|
+
candidate?.focus();
|
|
53
|
+
}
|
|
54
|
+
eventTrigger(event) {
|
|
55
|
+
return event.composedPath().find(node => node instanceof HTMLElement && node.hasAttribute('data-ui-editable-trigger'));
|
|
56
|
+
}
|
|
57
|
+
onClick = (event) => {
|
|
58
|
+
if (this.internalEdit || this.disabled)
|
|
59
|
+
return;
|
|
60
|
+
const trigger = this.eventTrigger(event);
|
|
61
|
+
if (!trigger)
|
|
62
|
+
return;
|
|
63
|
+
this.trigger = trigger;
|
|
64
|
+
this.requestEdit(true, 'activate', 'pointer');
|
|
65
|
+
};
|
|
66
|
+
onKeyDown = (event) => {
|
|
67
|
+
if (this.internalEdit && event.key === 'Escape') {
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
event.stopPropagation();
|
|
70
|
+
this.requestEdit(false, 'escape', 'keyboard');
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (this.internalEdit || !['Enter', ' '].includes(event.key))
|
|
74
|
+
return;
|
|
75
|
+
const trigger = this.eventTrigger(event);
|
|
76
|
+
if (!trigger)
|
|
77
|
+
return;
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
this.trigger = trigger;
|
|
80
|
+
this.requestEdit(true, 'activate', 'keyboard');
|
|
81
|
+
};
|
|
82
|
+
onDocumentPointerDown = (event) => {
|
|
83
|
+
if (!this.internalEdit || event.composedPath().includes(this.host))
|
|
84
|
+
return;
|
|
85
|
+
this.requestEdit(false, 'light-dismiss', 'pointer');
|
|
86
|
+
};
|
|
87
|
+
render() {
|
|
88
|
+
return h(Host, { key: 'f350400d4ebf897fb657b83b7cba9d309c5067bd', "data-edit": this.internalEdit ? '' : undefined, "data-disabled": this.disabled ? '' : undefined, onClick: this.onClick, onKeyDown: this.onKeyDown }, h("div", { key: 'f365ac61f59e9aaa1516121e3d6e2a42187e1d7b', part: "preview", hidden: this.internalEdit }, h("slot", { key: 'ea234b437cc4eb530f2994d695429be91d874ef7', name: "preview" })), h("div", { key: 'dacf0e74e72c47868986c80aaa60f55942fd9505', part: "edit", hidden: !this.internalEdit }, h("slot", { key: '54a943bc290335181a23b4cfa6055e4acfd8a62b', name: "edit" })));
|
|
89
|
+
}
|
|
90
|
+
static get watchers() { return {
|
|
91
|
+
"edit": [{
|
|
92
|
+
"syncFromProp": 0
|
|
93
|
+
}]
|
|
94
|
+
}; }
|
|
95
|
+
};
|
|
96
|
+
UIEditable.style = uiEditableCss();
|
|
97
|
+
|
|
98
|
+
export { UIEditable as ui_editable };
|
|
@@ -10,7 +10,7 @@ const UIFloatingActionButton = class {
|
|
|
10
10
|
mobileOnly = false;
|
|
11
11
|
label = '';
|
|
12
12
|
render() {
|
|
13
|
-
return (h(Host, { key: '
|
|
13
|
+
return (h(Host, { key: '9e917e07efcef5c0a96b8b09af8934f336a521bd', "data-disabled": this.disabled ? '' : undefined }, h("button", { key: '940daac4c2ff1144d7e82b36727205f286325a8e', type: "button", "aria-label": this.label || undefined, disabled: this.disabled }, h("slot", { key: '382c70aa4836f6e799f98e1f0e4bc6e3104430fc' }))));
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
UIFloatingActionButton.style = uiFloatingActionButtonCss();
|
|
@@ -104,7 +104,7 @@ const UIFormField = class {
|
|
|
104
104
|
input.setAttribute('aria-invalid', this.invalid ? 'true' : 'false');
|
|
105
105
|
}
|
|
106
106
|
render() {
|
|
107
|
-
return (h(Host, { key: '
|
|
107
|
+
return (h(Host, { key: 'ac01e2be489b9c907169417dc5064061bd74ff7c', "data-invalid": this.invalid ? '' : undefined, "data-disabled": this.disabled ? '' : undefined, "data-required": this.required ? '' : undefined }, h("slot", { key: 'c739f9b2c948bc1d3db4316871c2293bf75cf520', onSlotchange: this.scheduleWire })));
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
110
|
UIFormField.style = uiFormFieldCss();
|
|
@@ -13,7 +13,7 @@ const UIIconButton = class {
|
|
|
13
13
|
/** Reveals this control through a surrounding ui-affordance-scope. */
|
|
14
14
|
anticipatory = false;
|
|
15
15
|
render() {
|
|
16
|
-
return (h(Host, { key: '
|
|
16
|
+
return (h(Host, { key: '225e147d184109d39a2e6f9236ba3ba3c5864c31', "data-disabled": this.disabled ? '' : undefined, "data-ui-affordance": this.anticipatory ? 'button' : undefined }, h("button", { key: '7e54fab4520ae6641c974abf19e975e8eec7a3df', type: "button", "aria-label": this.label || undefined, disabled: this.disabled }, h("slot", { key: '54f9ba27c5a2ca896267f07ad1055907e74a64bc' }))));
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
UIIconButton.style = uiIconButtonCss();
|
|
@@ -76,7 +76,7 @@ const UIInput = class {
|
|
|
76
76
|
});
|
|
77
77
|
};
|
|
78
78
|
render() {
|
|
79
|
-
return (h(Host, { key: '
|
|
79
|
+
return (h(Host, { key: '0d8676e8458476681653ef4600dcb0f3b56d1ed1', "data-invalid": this.invalid ? '' : undefined }, h("slot", { key: 'd3585c07b6985d9090002f7a9c0eea1227517e0f', ref: (el) => (this.slotRef = el) })));
|
|
80
80
|
}
|
|
81
81
|
static get watchers() { return {
|
|
82
82
|
"value": [{
|
|
@@ -9,7 +9,7 @@ const UIMenuItem = class {
|
|
|
9
9
|
disabled = false;
|
|
10
10
|
value = '';
|
|
11
11
|
render() {
|
|
12
|
-
return (h(Host, { key: '
|
|
12
|
+
return (h(Host, { key: '711e7f70268d23969e40073cd47b065afadc22c9', role: "menuitem", tabIndex: this.disabled ? -1 : 0, "aria-disabled": this.disabled ? 'true' : undefined, "data-value": this.value || undefined }, h("span", { key: 'd0c0aff983bdbc48666fcd652b39340bfd92c790', class: "menu-item__surface" }, h("slot", { key: '3fc6111848142b388529a9cdb5f6134bffe8fa42' }))));
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
UIMenuItem.style = uiMenuItemCss();
|
|
@@ -158,7 +158,7 @@ const UIMenu = class {
|
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
160
|
render() {
|
|
161
|
-
return (h(Host, { key: '
|
|
161
|
+
return (h(Host, { key: 'afba5a7f63238afdb6f71a3636c1f294d3e8ac6f', role: "menu", "aria-orientation": "vertical", "data-open": this.internalOpen ? '' : undefined }, h("div", { key: '50d770efd27dddca436b804f10f1cc40bc604cb5', class: "menu__surface" }, h("slot", { key: '5014fc43a0ee2d66168bbcc1d52b20bd5120acb9' }))));
|
|
162
162
|
}
|
|
163
163
|
static get watchers() { return {
|
|
164
164
|
"open": [{
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, g as getElement, h, H as Host } from './index-8BGiMGQ0.js';
|
|
2
|
+
|
|
3
|
+
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}`;
|
|
4
|
+
|
|
5
|
+
const UIMultiCombobox = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.queryChange = createEvent(this, "query-change");
|
|
9
|
+
this.addItem = createEvent(this, "add-item");
|
|
10
|
+
this.removeItem = createEvent(this, "remove-item");
|
|
11
|
+
this.createItem = createEvent(this, "create-item");
|
|
12
|
+
this.optionsChange = createEvent(this, "options-change");
|
|
13
|
+
}
|
|
14
|
+
get host() { return getElement(this); }
|
|
15
|
+
label = '';
|
|
16
|
+
placeholder = '';
|
|
17
|
+
items = [];
|
|
18
|
+
config = {};
|
|
19
|
+
query;
|
|
20
|
+
defaultQuery = '';
|
|
21
|
+
/** Characters that commit the current query and leave the input ready for the next item. */
|
|
22
|
+
tokenSeparators = [];
|
|
23
|
+
disabled = false;
|
|
24
|
+
readOnly = false;
|
|
25
|
+
required = false;
|
|
26
|
+
name = '';
|
|
27
|
+
queryChange;
|
|
28
|
+
addItem;
|
|
29
|
+
removeItem;
|
|
30
|
+
createItem;
|
|
31
|
+
optionsChange;
|
|
32
|
+
raw = '';
|
|
33
|
+
rows = [];
|
|
34
|
+
combobox;
|
|
35
|
+
filteredConfig;
|
|
36
|
+
filteredConfigSource;
|
|
37
|
+
filteredSelection = '';
|
|
38
|
+
componentWillLoad() { this.raw = this.query ?? this.defaultQuery; }
|
|
39
|
+
syncQuery() {
|
|
40
|
+
if (this.query !== undefined)
|
|
41
|
+
this.raw = this.query;
|
|
42
|
+
}
|
|
43
|
+
get selectedValues() { return new Set(this.items.map(item => item.value)); }
|
|
44
|
+
get comboboxConfig() {
|
|
45
|
+
const selectionKey = this.items.map(item => item.value).join('\u0000');
|
|
46
|
+
if (this.filteredConfig && this.filteredConfigSource === this.config && this.filteredSelection === selectionKey) {
|
|
47
|
+
return this.filteredConfig;
|
|
48
|
+
}
|
|
49
|
+
const ownerFilter = this.config.filter;
|
|
50
|
+
const selected = this.selectedValues;
|
|
51
|
+
this.filteredConfigSource = this.config;
|
|
52
|
+
this.filteredSelection = selectionKey;
|
|
53
|
+
this.filteredConfig = {
|
|
54
|
+
...this.config,
|
|
55
|
+
filter: (option, query, context) => !selected.has(option.value)
|
|
56
|
+
&& (ownerFilter ? ownerFilter(option, query, context) : option.label.toLocaleLowerCase().includes(query.toLocaleLowerCase())),
|
|
57
|
+
};
|
|
58
|
+
return this.filteredConfig;
|
|
59
|
+
}
|
|
60
|
+
setQuery(query, trigger) {
|
|
61
|
+
if (this.query === undefined)
|
|
62
|
+
this.raw = query;
|
|
63
|
+
this.queryChange.emit({ query, display: query, trigger });
|
|
64
|
+
}
|
|
65
|
+
clearCommittedQuery(input, trigger) {
|
|
66
|
+
// Clear the native control before another key can arrive. Controlled adapters
|
|
67
|
+
// still receive query-change, but do not need to round-trip before typing resumes.
|
|
68
|
+
input.value = '';
|
|
69
|
+
this.raw = '';
|
|
70
|
+
this.setQuery('', trigger);
|
|
71
|
+
}
|
|
72
|
+
onQueryChange = (event) => {
|
|
73
|
+
event.stopPropagation();
|
|
74
|
+
this.setQuery(event.detail.query, event.detail.trigger);
|
|
75
|
+
};
|
|
76
|
+
onOptionsChange = (event) => {
|
|
77
|
+
event.stopPropagation();
|
|
78
|
+
this.rows = event.detail;
|
|
79
|
+
this.optionsChange.emit(event.detail);
|
|
80
|
+
};
|
|
81
|
+
onValueChange = (event) => {
|
|
82
|
+
event.stopPropagation();
|
|
83
|
+
if (event.detail.kind !== 'selection' || !event.detail.option)
|
|
84
|
+
return;
|
|
85
|
+
const item = event.detail.option;
|
|
86
|
+
this.addItem.emit({ item, index: this.items.length, trigger: event.detail.trigger });
|
|
87
|
+
// ui-combobox emits its selection value before the matching label query.
|
|
88
|
+
// Clear after both owner notifications so the stale label cannot win.
|
|
89
|
+
queueMicrotask(() => this.setQuery('', event.detail.trigger));
|
|
90
|
+
};
|
|
91
|
+
onCreateEntry = (event) => {
|
|
92
|
+
event.stopPropagation();
|
|
93
|
+
const query = event.detail.query.trim();
|
|
94
|
+
if (!query)
|
|
95
|
+
return;
|
|
96
|
+
this.setQuery('', event.detail.trigger);
|
|
97
|
+
this.createItem.emit({ query, trigger: event.detail.trigger });
|
|
98
|
+
};
|
|
99
|
+
commitQuery(input, trigger) {
|
|
100
|
+
const query = this.raw.trim();
|
|
101
|
+
if (!query)
|
|
102
|
+
return;
|
|
103
|
+
const normalizedQuery = query.toLocaleLowerCase();
|
|
104
|
+
const option = this.rows.find(row => row.label.trim().toLocaleLowerCase() === normalizedQuery);
|
|
105
|
+
if (option) {
|
|
106
|
+
this.clearCommittedQuery(input, trigger);
|
|
107
|
+
this.addItem.emit({ item: option, index: this.items.length, trigger });
|
|
108
|
+
}
|
|
109
|
+
else if (this.config.allowCreate) {
|
|
110
|
+
this.clearCommittedQuery(input, trigger);
|
|
111
|
+
this.createItem.emit({ query, trigger });
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
remove(index, trigger) {
|
|
115
|
+
const item = this.items[index];
|
|
116
|
+
if (!item || item.disabled || this.disabled || this.readOnly)
|
|
117
|
+
return;
|
|
118
|
+
this.removeItem.emit({ item, index, trigger });
|
|
119
|
+
requestAnimationFrame(() => {
|
|
120
|
+
const buttons = this.host.shadowRoot?.querySelectorAll('[part="item"]') ?? [];
|
|
121
|
+
const next = buttons[Math.min(index, buttons.length - 1)] ?? buttons[index - 1];
|
|
122
|
+
if (next && next.dataset.value !== item.value)
|
|
123
|
+
next.focus();
|
|
124
|
+
else
|
|
125
|
+
void this.focusInput();
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
focusItem(index) {
|
|
129
|
+
this.host.shadowRoot?.querySelectorAll('[part="item"]')[index]?.focus();
|
|
130
|
+
}
|
|
131
|
+
onItemKeyDown = (event, index) => {
|
|
132
|
+
if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
|
|
133
|
+
return;
|
|
134
|
+
if (event.key === 'ArrowLeft') {
|
|
135
|
+
event.preventDefault();
|
|
136
|
+
event.stopPropagation();
|
|
137
|
+
this.focusItem(Math.max(0, index - 1));
|
|
138
|
+
}
|
|
139
|
+
else if (event.key === 'ArrowRight') {
|
|
140
|
+
event.preventDefault();
|
|
141
|
+
event.stopPropagation();
|
|
142
|
+
if (index === this.items.length - 1)
|
|
143
|
+
void this.focusInput();
|
|
144
|
+
else
|
|
145
|
+
this.focusItem(index + 1);
|
|
146
|
+
}
|
|
147
|
+
else if (event.key === 'Backspace' || event.key === 'Delete') {
|
|
148
|
+
event.preventDefault();
|
|
149
|
+
event.stopPropagation();
|
|
150
|
+
this.remove(index, 'keyboard');
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
onKeyDown = (event) => {
|
|
154
|
+
if (event.defaultPrevented || event.isComposing || this.disabled || this.readOnly || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
|
|
155
|
+
return;
|
|
156
|
+
const input = event.composedPath().find(node => node instanceof HTMLInputElement);
|
|
157
|
+
if (!input)
|
|
158
|
+
return;
|
|
159
|
+
if (this.tokenSeparators.includes(event.key)) {
|
|
160
|
+
event.preventDefault();
|
|
161
|
+
event.stopPropagation();
|
|
162
|
+
this.commitQuery(input, 'keyboard');
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (this.raw || (input.selectionStart ?? 0) > 0)
|
|
166
|
+
return;
|
|
167
|
+
if (event.key === 'ArrowLeft' && this.items.length) {
|
|
168
|
+
event.preventDefault();
|
|
169
|
+
this.focusItem(this.items.length - 1);
|
|
170
|
+
}
|
|
171
|
+
else if (event.key === 'Backspace' && this.items.length) {
|
|
172
|
+
event.preventDefault();
|
|
173
|
+
this.remove(this.items.length - 1, 'keyboard');
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
async focusInput() { await this.combobox?.focusInput(); }
|
|
177
|
+
render() {
|
|
178
|
+
return h(Host, { key: 'c1acc758a2856e5bd022e076030798c9d63ff416', onKeyDown: this.onKeyDown }, 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 }, h("div", { key: 'f4f0849c145d9bcc4d47103d3dc4fdce8009aeab', slot: "start", class: "items", role: "group", "aria-label": `Selected ${this.label}` }, this.items.map((item, 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) }, h("slot", { name: `item-${item.id}` }, h("ui-chip", { appearance: "pill" }, item.label))))), this.rows.map(option => h("span", { slot: `option-${option.id}` }, h("slot", { name: `option-${option.id}` }, option.label))), h("span", { key: '3cf42f492bd946ca130321a2c3fcf976602c6566', slot: "create" }, h("slot", { key: '6f158cb1d96c0d0401fe5302cabffd052498f651', name: "create" }, "Create \u201C", this.raw, "\u201D")), h("span", { key: '0f436aca38aecf9485963d6588c27ab3288ced55', slot: "loading" }, h("slot", { key: '6c079ac5bbf6fff57aa7fa6f0022a939c96a5cd0', name: "loading" }, "Loading suggestions\u2026")), h("span", { key: 'a7893e0ff0a1922a404e7c072338858d9e7fdf12', slot: "empty" }, h("slot", { key: 'd6831db76cc1252aa942ccdcfba36c8cf4c60d22', name: "empty" }, "No suggestions.")), h("span", { key: 'a096a393a167256cff11f77110ae29ac58a33779', slot: "error" }, h("slot", { key: '1bf52c85e911d9965b9b691d6ebf0b89bbea2d58', name: "error" }, "Unable to load suggestions.")), h("div", { key: 'b7d88c9b427305da8b986eb993b49e5c581c1445', slot: "footer" }, h("slot", { key: 'f84fdf78c3e373f4735ed88574af06f1ca3cc1b5', name: "footer" }))));
|
|
179
|
+
}
|
|
180
|
+
static get watchers() { return {
|
|
181
|
+
"query": [{
|
|
182
|
+
"syncQuery": 0
|
|
183
|
+
}]
|
|
184
|
+
}; }
|
|
185
|
+
};
|
|
186
|
+
UIMultiCombobox.style = uiMultiComboboxCss();
|
|
187
|
+
|
|
188
|
+
export { UIMultiCombobox as ui_multi_combobox };
|
|
@@ -111,7 +111,7 @@ const UIPopover = class {
|
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
113
|
render() {
|
|
114
|
-
return (h(Host, { key: '
|
|
114
|
+
return (h(Host, { key: 'a4986ace0f3c586774a549cb844287b28ccd0531', "data-open": this.internalOpen ? '' : undefined, onKeyDown: this.onKeydown }, h("div", { key: '8f2c589916d06138ef72bfe0d039893b3c59a7cc', class: "popover__surface" }, h("slot", { key: 'ee70e7dcc53a99b5c80e56862a6eb00edcfcf912' }))));
|
|
115
115
|
}
|
|
116
116
|
static get watchers() { return {
|
|
117
117
|
"open": [{
|
|
@@ -107,7 +107,7 @@ const UIRadioGroup = class {
|
|
|
107
107
|
}
|
|
108
108
|
};
|
|
109
109
|
render() {
|
|
110
|
-
return (h(Host, { key: '
|
|
110
|
+
return (h(Host, { key: '1882ad7c092c6a138eab2a52c19beb9a950a8d5a', role: "radiogroup", "aria-orientation": this.orientation, "data-orientation": this.orientation, "data-disabled": this.disabled ? '' : undefined }, h("slot", { key: 'd5abade3d23963410cfbac17e80aa16dd21ccc6e' })));
|
|
111
111
|
}
|
|
112
112
|
static get watchers() { return {
|
|
113
113
|
"value": [{
|
|
@@ -67,7 +67,7 @@ const UIRadio = class {
|
|
|
67
67
|
});
|
|
68
68
|
};
|
|
69
69
|
render() {
|
|
70
|
-
return (h(Host, { key: '
|
|
70
|
+
return (h(Host, { key: 'f4700b43790accd29a6bcc55fcc862072e29c335', role: "radio", "aria-checked": String(this.internalChecked), "aria-disabled": String(this.disabled), "data-disabled": this.disabled ? '' : undefined }, h("slot", { key: 'ed32c35f8f68c662a8b95e58b74c8c76c959ea49', ref: (el) => (this.slotRef = el) })));
|
|
71
71
|
}
|
|
72
72
|
static get watchers() { return {
|
|
73
73
|
"checked": [{
|
|
@@ -37,7 +37,7 @@ const UISearchResultRow = class {
|
|
|
37
37
|
this.hasTrailing = slotHasContent(this.trailingSlot);
|
|
38
38
|
};
|
|
39
39
|
render() {
|
|
40
|
-
return (h(Host, { key: '
|
|
40
|
+
return (h(Host, { key: 'eeda041dbcf8841cd53be9c532df208eb3be3d3b' }, h("button", { key: '71d3db6d2eca4f8d7796429f68ef73bf2c7b62f7', class: "search-result-row", type: "button", disabled: this.disabled, part: "button" }, h("span", { key: 'f2260cab9f654e7f5e96a5e7e2a1cbbb5a55fde3', class: "search-result-row__leading", part: "leading", hidden: !this.hasLeading }, h("slot", { key: '824fffc19c2b5712dae0c000f12cc36a0043a370', name: "leading", ref: (el) => (this.leadingSlot = el), onSlotchange: this.syncSlots })), h("span", { key: '4e3728ea7d363f256f1b3283df6eb984cf3f570f', class: "search-result-row__content", part: "content" }, h("span", { key: '95009b1ce569fb4251df62334a5dd88f1de561af', class: "search-result-row__title", part: "title" }, h("slot", { key: '132beecf36471ae0db68d686829428225699c534', name: "title" })), h("span", { key: '0ad7c8d52aa40ccf62667d3ecca4d48b49917a9a', class: "search-result-row__meta", part: "meta", hidden: !this.hasMeta }, h("slot", { key: '4b97129504571a676839287bd87e68d803f8bc99', name: "meta", ref: (el) => (this.metaSlot = el), onSlotchange: this.syncSlots })), h("span", { key: 'e6c73e653fb7dc213866a15870281f3f6d95a86b', class: "search-result-row__excerpt", part: "excerpt", hidden: !this.hasExcerpt }, h("slot", { key: '49deae8194485304380b8b4b3d4fe96cd6623f4d', name: "excerpt", ref: (el) => (this.excerptSlot = el), onSlotchange: this.syncSlots }))), h("span", { key: 'c7c6f0b57668644a28d3c4c981b4db79a0e3c42a', class: "search-result-row__trailing", part: "trailing", hidden: !this.hasTrailing }, h("slot", { key: 'e6cbceeb41d23c9b7514f53663438069499d1a4d', name: "trailing", ref: (el) => (this.trailingSlot = el), onSlotchange: this.syncSlots })))));
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
UISearchResultRow.style = uiSearchResultRowCss();
|
|
@@ -29,7 +29,7 @@ const UISearchShell = class {
|
|
|
29
29
|
this.hasFooter = slotHasContent(this.footerSlot);
|
|
30
30
|
};
|
|
31
31
|
render() {
|
|
32
|
-
return (h("div", { key: '
|
|
32
|
+
return (h("div", { key: 'ae5baf1fae88f3c0ff8c98e68e1c31d7f19d7b6a', class: "search-shell", part: "base" }, h("slot", { key: '192d10867902bc4618762ab3ce1ca8a44229ec11', name: "backdrop" }), h("div", { key: '72bafd3ba7aadebcb011fb27f56793a9079bb2e1', class: "search-shell__panel", part: "panel" }, h("div", { key: 'c2d46c9099699cc1c2f357cb51d11ab0e6cf6c69', class: "search-shell__search", part: "search" }, h("slot", { key: '21f4ed690247fa794bd9322c75cee1721926087a', name: "search" })), h("div", { key: '84baba674456aa2a5878d5858d0e6531251440ce', class: "search-shell__status", part: "status", hidden: !this.hasStatus }, h("slot", { key: '6e7b6533a29231ebbcd41529d8120649ca4a1dd1', name: "status", ref: (el) => (this.statusSlot = el), onSlotchange: this.syncSlots })), h("div", { key: '710d51d450132ad0f528b2eb2cd6f0312dbced2f', class: "search-shell__body", part: "body" }, h("slot", { key: '2c380ff4ad33ead6ca8c2611ebc024f125f0da48', name: "body" })), h("div", { key: '6923984a31c7bc23bae3ecee08d7acad14703a02', class: "search-shell__footer", part: "footer", hidden: !this.hasFooter }, h("slot", { key: '57c2eab7a3f46558ada8d1aa70d64f434bb8cdd6', name: "footer", ref: (el) => (this.footerSlot = el), onSlotchange: this.syncSlots })))));
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
UISearchShell.style = uiSearchShellCss();
|
|
@@ -78,7 +78,7 @@ const UISelect = class {
|
|
|
78
78
|
});
|
|
79
79
|
};
|
|
80
80
|
render() {
|
|
81
|
-
return (h(Host, { key: '
|
|
81
|
+
return (h(Host, { key: '74cbe4a76a23af415c202c61951ad513b0ed6cb8', "data-invalid": this.invalid ? '' : undefined }, h("slot", { key: 'e86eb0cfb0d379cb3f8b2ea5ce3c69639d0cdda4', ref: (el) => (this.slotRef = el) })));
|
|
82
82
|
}
|
|
83
83
|
static get watchers() { return {
|
|
84
84
|
"value": [{
|
|
@@ -47,7 +47,7 @@ const UISwitch = class {
|
|
|
47
47
|
this.toggle('pointer');
|
|
48
48
|
};
|
|
49
49
|
render() {
|
|
50
|
-
return (h(Host, { key: '
|
|
50
|
+
return (h(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 }, 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) => {
|
|
51
51
|
const input = e.target;
|
|
52
52
|
const checked = input.checked;
|
|
53
53
|
if (!isControlled(this.checked))
|
|
@@ -59,7 +59,7 @@ const UISwitch = class {
|
|
|
59
59
|
});
|
|
60
60
|
if (isControlled(this.checked))
|
|
61
61
|
input.checked = this.internalChecked;
|
|
62
|
-
} }), h("slot", { key: '
|
|
62
|
+
} }), h("slot", { key: 'b3b2b5afae622d1ae79cadd84f60c6b6c2df55a4' })));
|
|
63
63
|
}
|
|
64
64
|
static get watchers() { return {
|
|
65
65
|
"checked": [{
|
|
@@ -97,7 +97,7 @@ const UITabs = class {
|
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
render() {
|
|
100
|
-
return (h(Host, { key: '
|
|
100
|
+
return (h(Host, { key: '19207153c7b7a6ea5f5ffb50439e99af70984b44', orientation: this.orientation, "data-orientation": this.orientation }, h("slot", { key: '5045cd040eeccd028c00328206d47f7d17b622de' })));
|
|
101
101
|
}
|
|
102
102
|
static get watchers() { return {
|
|
103
103
|
"value": [{
|
|
@@ -77,7 +77,7 @@ const UITextarea = class {
|
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
79
|
render() {
|
|
80
|
-
return (h(Host, { key: '
|
|
80
|
+
return (h(Host, { key: '020adfed4a177ef5d07852ff2e6ffb66b6f80742', "data-invalid": this.invalid ? '' : undefined }, h("slot", { key: '2e9bd0e071e24fcf248eadf38f16484321359503', ref: (el) => (this.slotRef = el) })));
|
|
81
81
|
}
|
|
82
82
|
static get watchers() { return {
|
|
83
83
|
"value": [{
|
|
@@ -75,7 +75,7 @@ const UIToastRegion = class {
|
|
|
75
75
|
});
|
|
76
76
|
};
|
|
77
77
|
render() {
|
|
78
|
-
return (h(Host, { key: '
|
|
78
|
+
return (h(Host, { key: '8a3546bcd59e12f21393ea55fa4d232d3907a34e', role: "region", "aria-label": "Notifications", "aria-live": "polite", "data-open": this.internalOpen ? '' : undefined }, h("slot", { key: 'a4a4525a1ca768d65ff36b3889a821b8dda8b6f7' })));
|
|
79
79
|
}
|
|
80
80
|
static get watchers() { return {
|
|
81
81
|
"open": [{
|