@threadlabs/looma 0.1.22 → 0.1.23
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-NIPNHZ5W.js → chunk-GDMQKT5F.js} +63 -31
- package/dist/{chunk-SZJQ3NPX.js → chunk-TL4FIE7X.js} +4 -8
- package/dist/cjs/{index-D07f6BOw.js → index-BHG9Rpil.js} +33 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/looma.cjs.js +2 -2
- package/dist/cjs/{manager-C9j3HZay.js → manager-Ce25WRtl.js} +6 -7
- package/dist/cjs/ui-affordance-scope.cjs.entry.js +1 -1
- package/dist/cjs/ui-avatar-group.cjs.entry.js +1 -1
- package/dist/cjs/ui-avatar.cjs.entry.js +1 -1
- package/dist/cjs/ui-badge.cjs.entry.js +1 -1
- package/dist/cjs/ui-button.cjs.entry.js +16 -5
- package/dist/cjs/ui-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/ui-combobox.cjs.entry.js +541 -0
- package/dist/cjs/ui-context-menu.cjs.entry.js +3 -3
- package/dist/cjs/ui-dialog.cjs.entry.js +3 -3
- package/dist/cjs/ui-disclosure.cjs.entry.js +2 -2
- package/dist/cjs/ui-floating-action-button.cjs.entry.js +2 -2
- package/dist/cjs/ui-form-field.cjs.entry.js +3 -3
- package/dist/cjs/ui-icon-button.cjs.entry.js +2 -2
- package/dist/cjs/ui-input.cjs.entry.js +11 -6
- package/dist/cjs/ui-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/ui-menu.cjs.entry.js +3 -3
- package/dist/cjs/ui-popover.cjs.entry.js +3 -3
- package/dist/cjs/ui-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/ui-radio.cjs.entry.js +3 -3
- package/dist/cjs/ui-search-result-row.cjs.entry.js +2 -2
- package/dist/cjs/ui-search-shell.cjs.entry.js +2 -2
- package/dist/cjs/ui-select.cjs.entry.js +15 -7
- package/dist/cjs/ui-switch.cjs.entry.js +3 -3
- package/dist/cjs/ui-tabs.cjs.entry.js +2 -2
- package/dist/cjs/ui-textarea.cjs.entry.js +10 -6
- package/dist/cjs/ui-toast-region.cjs.entry.js +2 -2
- package/dist/cjs/ui-tooltip.cjs.entry.js +52 -16
- package/dist/cjs/ui-top-bar.cjs.entry.js +2 -2
- package/dist/cjs/ui-tree-item.cjs.entry.js +7 -3
- package/dist/cjs/ui-tree.cjs.entry.js +81 -9
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ui-button/ui-button.css +36 -26
- package/dist/collection/components/ui-button/ui-button.js +14 -3
- package/dist/collection/components/ui-combobox/ui-combobox.css +24 -0
- package/dist/collection/components/ui-combobox/ui-combobox.js +973 -0
- 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-floating-action-button/ui-floating-action-button.js +1 -1
- package/dist/collection/components/ui-form-field/ui-form-field.css +4 -0
- 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.css +8 -6
- package/dist/collection/components/ui-input/ui-input.js +11 -7
- 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-popover/ui-popover.js +1 -1
- package/dist/collection/components/ui-radio/ui-radio.js +2 -2
- 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.css +8 -6
- package/dist/collection/components/ui-select/ui-select.js +17 -11
- 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.css +7 -6
- package/dist/collection/components/ui-textarea/ui-textarea.js +10 -7
- package/dist/collection/components/ui-toast-region/ui-toast-region.js +1 -1
- package/dist/collection/components/ui-tooltip/ui-tooltip.js +102 -15
- package/dist/collection/components/ui-top-bar/ui-top-bar.js +1 -1
- package/dist/collection/components/ui-tree/ui-tree.js +100 -8
- package/dist/collection/components/ui-tree-item/ui-tree-item.js +44 -2
- package/dist/collection/field/combobox.js +4 -0
- package/dist/collection/field/valibot.js +5 -0
- package/dist/collection/field/validation.js +62 -0
- package/dist/collection/overlay/manager.js +6 -7
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -1
- package/dist/components/p-Bh_1GxOD.js +1 -0
- package/dist/components/p-C-0syqXZ.js +1 -0
- package/dist/components/p-CaietZcq.js +1 -0
- package/dist/components/p-DHd18bK7.js +1 -0
- package/dist/components/ui-affordance-scope.js +1 -1
- package/dist/components/ui-avatar-group.js +1 -1
- package/dist/components/ui-avatar.js +1 -1
- package/dist/components/ui-badge.js +1 -1
- package/dist/components/ui-button.js +1 -1
- package/dist/components/ui-checkbox.js +1 -1
- package/dist/components/ui-combobox.d.ts +11 -0
- package/dist/components/ui-combobox.js +1 -0
- 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-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-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 +2 -2
- package/dist/components/ui-tree.js +1 -1
- package/dist/esm/{index-CEeiinfk.js → index-8BGiMGQ0.js} +33 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/looma.js +3 -3
- package/dist/esm/{manager-PM9a74r7.js → manager-C-0syqXZ.js} +6 -7
- package/dist/esm/ui-affordance-scope.entry.js +1 -1
- package/dist/esm/ui-avatar-group.entry.js +1 -1
- package/dist/esm/ui-avatar.entry.js +1 -1
- package/dist/esm/ui-badge.entry.js +1 -1
- package/dist/esm/ui-button.entry.js +16 -5
- package/dist/esm/ui-checkbox.entry.js +1 -1
- package/dist/esm/ui-combobox.entry.js +539 -0
- package/dist/esm/ui-context-menu.entry.js +3 -3
- package/dist/esm/ui-dialog.entry.js +3 -3
- package/dist/esm/ui-disclosure.entry.js +2 -2
- package/dist/esm/ui-floating-action-button.entry.js +2 -2
- package/dist/esm/ui-form-field.entry.js +3 -3
- package/dist/esm/ui-icon-button.entry.js +2 -2
- package/dist/esm/ui-input.entry.js +11 -6
- package/dist/esm/ui-menu-item.entry.js +2 -2
- package/dist/esm/ui-menu.entry.js +3 -3
- package/dist/esm/ui-popover.entry.js +3 -3
- package/dist/esm/ui-radio-group.entry.js +2 -2
- package/dist/esm/ui-radio.entry.js +3 -3
- package/dist/esm/ui-search-result-row.entry.js +2 -2
- package/dist/esm/ui-search-shell.entry.js +2 -2
- package/dist/esm/ui-select.entry.js +15 -7
- package/dist/esm/ui-switch.entry.js +3 -3
- package/dist/esm/ui-tabs.entry.js +2 -2
- package/dist/esm/ui-textarea.entry.js +10 -6
- package/dist/esm/ui-toast-region.entry.js +2 -2
- package/dist/esm/ui-tooltip.entry.js +52 -16
- package/dist/esm/ui-top-bar.entry.js +2 -2
- package/dist/esm/ui-tree-item.entry.js +7 -3
- package/dist/esm/ui-tree.entry.js +81 -9
- package/dist/index.cjs +883 -123
- package/dist/index.d.cts +104 -1
- package/dist/index.d.ts +104 -1
- package/dist/index.js +62 -8
- package/dist/looma/looma.esm.js +1 -1
- package/dist/looma/{p-0198bb21.entry.js → p-13347631.entry.js} +1 -1
- package/dist/looma/p-14c081cf.entry.js +1 -0
- package/dist/looma/{p-0f45c5f0.entry.js → p-25366205.entry.js} +1 -1
- package/dist/looma/{p-a9f46811.entry.js → p-2e3aa869.entry.js} +1 -1
- package/dist/looma/p-40fe7fee.entry.js +1 -0
- package/dist/looma/p-446cda76.entry.js +1 -0
- package/dist/looma/p-4fc1b005.entry.js +13 -0
- package/dist/looma/p-582973b5.entry.js +1 -0
- package/dist/looma/{p-d273b857.entry.js → p-5a87b59d.entry.js} +1 -1
- package/dist/looma/{p-2ed7e241.entry.js → p-5da09f47.entry.js} +1 -1
- package/dist/looma/{p-7e94d90d.entry.js → p-69a5557b.entry.js} +1 -1
- package/dist/looma/p-6a8a4736.entry.js +1 -0
- package/dist/looma/{p-caa8fc7b.entry.js → p-6bf4038b.entry.js} +1 -1
- package/dist/looma/p-7e0bb7f6.entry.js +1 -0
- package/dist/looma/{p-ed5abf6d.entry.js → p-8204fee6.entry.js} +1 -1
- package/dist/looma/{p-5ba9d496.entry.js → p-8238e0dc.entry.js} +1 -1
- package/dist/looma/p-8BGiMGQ0.js +2 -0
- package/dist/looma/{p-051f578c.entry.js → p-8b8840b8.entry.js} +1 -1
- package/dist/looma/{p-1674cda4.entry.js → p-99d88efb.entry.js} +1 -1
- package/dist/looma/p-C-0syqXZ.js +1 -0
- package/dist/looma/p-a27669b1.entry.js +1 -0
- package/dist/looma/{p-11083743.entry.js → p-a6ee76b7.entry.js} +1 -1
- package/dist/looma/p-a90d2821.entry.js +1 -0
- package/dist/looma/{p-2e6f791e.entry.js → p-add36e74.entry.js} +1 -1
- package/dist/looma/{p-0584a051.entry.js → p-b6398a6b.entry.js} +1 -1
- package/dist/looma/{p-078f9fb8.entry.js → p-d50faaff.entry.js} +1 -1
- package/dist/looma/{p-b7aa4488.entry.js → p-d77278ce.entry.js} +1 -1
- package/dist/looma/p-d9ec13b7.entry.js +1 -0
- package/dist/looma/{p-1681b218.entry.js → p-ecf8005f.entry.js} +1 -1
- package/dist/looma/p-ed368426.entry.js +1 -0
- package/dist/looma/{p-063f5a89.entry.js → p-f0487ff3.entry.js} +1 -1
- package/dist/looma/p-f74e5546.entry.js +1 -0
- package/dist/types/components/ui-combobox/ui-combobox.d.ts +93 -0
- package/dist/types/components/ui-input/ui-input.d.ts +1 -1
- package/dist/types/components/ui-select/ui-select.d.ts +3 -2
- package/dist/types/components/ui-textarea/ui-textarea.d.ts +1 -1
- package/dist/types/components/ui-tooltip/ui-tooltip.d.ts +18 -1
- package/dist/types/components/ui-tree/ui-tree.d.ts +9 -1
- package/dist/types/components/ui-tree-item/ui-tree-item.d.ts +4 -0
- package/dist/types/components.d.ts +260 -28
- package/dist/types/field/combobox.d.ts +46 -0
- package/dist/types/field/valibot.d.ts +7 -0
- package/dist/types/field/validation.d.ts +56 -0
- package/dist/{ui-affordance-scope.entry-L533MECG.js → ui-affordance-scope.entry-VO4C2MZX.js} +1 -1
- package/dist/{ui-avatar-group.entry-BWS7E2CM.js → ui-avatar-group.entry-TAXJRIIU.js} +1 -1
- package/dist/{ui-avatar.entry-3INAY3XP.js → ui-avatar.entry-T6FU6ZYM.js} +1 -1
- package/dist/{ui-badge.entry-2WOBVOYP.js → ui-badge.entry-MZFYNBMJ.js} +1 -1
- package/dist/ui-button.entry-7UXMUGHN.js +80 -0
- package/dist/{ui-checkbox.entry-2PTBHSCQ.js → ui-checkbox.entry-DMZJB3RE.js} +1 -1
- package/dist/ui-combobox.entry-ZCTPXEES.js +553 -0
- package/dist/{ui-context-menu.entry-AYDDCIZS.js → ui-context-menu.entry-2WMCBGCP.js} +6 -6
- package/dist/{ui-dialog.entry-I2XI3ZTZ.js → ui-dialog.entry-WO23XOSW.js} +6 -6
- package/dist/{ui-disclosure.entry-5LY2BT7B.js → ui-disclosure.entry-USX7OUEW.js} +2 -2
- package/dist/{ui-floating-action-button.entry-EJAMR5AM.js → ui-floating-action-button.entry-MXDIN7MV.js} +2 -2
- package/dist/{ui-form-field.entry-SJ6NNFXB.js → ui-form-field.entry-7ZCMEHPY.js} +3 -3
- package/dist/{ui-icon-button.entry-7SD2LVXE.js → ui-icon-button.entry-MJUNXHBU.js} +2 -2
- package/dist/{ui-input.entry-7MM7GEQW.js → ui-input.entry-AWG63YIG.js} +8 -6
- package/dist/{ui-menu-item.entry-V3HIMR75.js → ui-menu-item.entry-HFTWG62N.js} +2 -2
- package/dist/{ui-menu.entry-R4WK5QSX.js → ui-menu.entry-IT3GW5TL.js} +7 -7
- package/dist/{ui-popover.entry-ZRJRTXA7.js → ui-popover.entry-ZQQB4N6E.js} +6 -6
- package/dist/{ui-radio-group.entry-S6RXHFSN.js → ui-radio-group.entry-V7PCTS7I.js} +2 -2
- package/dist/{ui-radio.entry-B73QZK2M.js → ui-radio.entry-JYH6TQBI.js} +3 -3
- package/dist/{ui-search-result-row.entry-DR2Y5S7P.js → ui-search-result-row.entry-JBNYXXUN.js} +2 -2
- package/dist/{ui-search-shell.entry-ST5IKJBC.js → ui-search-shell.entry-TEAWE76O.js} +2 -2
- package/dist/{ui-select.entry-7GPRFV67.js → ui-select.entry-F3A6TE2U.js} +13 -7
- package/dist/{ui-switch.entry-XQ5IRJRH.js → ui-switch.entry-MJIICMP2.js} +3 -3
- package/dist/{ui-tabs.entry-HPW5L5CY.js → ui-tabs.entry-6REFIUHV.js} +2 -2
- package/dist/{ui-textarea.entry-W2PSRYVS.js → ui-textarea.entry-OJTXCED7.js} +8 -6
- package/dist/{ui-toast-region.entry-FJUHFXKZ.js → ui-toast-region.entry-NOFXLKPS.js} +5 -5
- package/dist/{ui-tooltip.entry-G5WHQW7K.js → ui-tooltip.entry-COWTWVHX.js} +57 -21
- package/dist/{ui-top-bar.entry-3NCHFC4Y.js → ui-top-bar.entry-PIAWXJNV.js} +2 -2
- package/dist/{ui-tree-item.entry-45RR3CMP.js → ui-tree-item.entry-BSEWNL2O.js} +7 -3
- package/dist/{ui-tree.entry-SZW4Q5PY.js → ui-tree.entry-XYI3ZFAZ.js} +77 -8
- package/dist/valibot.d.ts +52 -0
- package/dist/valibot.js +7 -0
- package/package.json +11 -3
- package/styles.css +36 -20
- package/theme-high-contrast.css +12 -0
- package/tokens.css +23 -0
- package/vue/{chunk-5KWCMTXB.js → chunk-JLW23USW.js} +88 -1
- package/vue/editor/index.js +1 -1
- package/vue/index.d.ts +123 -1
- package/vue/index.js +3 -1
- package/dist/components/p-CEYIKqYc.js +0 -1
- package/dist/components/p-CIA4RyEp.js +0 -1
- package/dist/components/p-PM9a74r7.js +0 -1
- package/dist/looma/p-34417499.entry.js +0 -1
- package/dist/looma/p-4b422d40.entry.js +0 -1
- package/dist/looma/p-54722713.entry.js +0 -13
- package/dist/looma/p-54c41576.entry.js +0 -1
- package/dist/looma/p-5d4713a6.entry.js +0 -1
- package/dist/looma/p-624ba086.entry.js +0 -1
- package/dist/looma/p-8d5adb17.entry.js +0 -1
- package/dist/looma/p-9194a99d.entry.js +0 -1
- package/dist/looma/p-CEeiinfk.js +0 -2
- package/dist/looma/p-PM9a74r7.js +0 -1
- package/dist/looma/p-a33522a2.entry.js +0 -1
- package/dist/looma/p-a5127c7d.entry.js +0 -1
- package/dist/looma/p-e3f99a24.entry.js +0 -1
- package/dist/ui-button.entry-VCGSEONK.js +0 -71
|
@@ -0,0 +1,973 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
import { createAnchoredSurface } from "../../overlay/positioning";
|
|
3
|
+
import { openOverlay, closeOverlay } from "../../overlay/manager";
|
|
4
|
+
import { formatEditingValue, validateField } from "../../field/validation";
|
|
5
|
+
/** A single editable field with contextual suggestions, optional help and field validation. */
|
|
6
|
+
export class UICombobox {
|
|
7
|
+
host;
|
|
8
|
+
/** Accessible visible label, associated with the native text input. */
|
|
9
|
+
label = '';
|
|
10
|
+
placeholder = '';
|
|
11
|
+
name = '';
|
|
12
|
+
/** Controlled canonical value. Undefined selects uncontrolled mode; null means no selection. */
|
|
13
|
+
value;
|
|
14
|
+
defaultValue;
|
|
15
|
+
/** Controlled raw editing text; independent of canonical selection. */
|
|
16
|
+
query;
|
|
17
|
+
defaultQuery = '';
|
|
18
|
+
/** Immutable configuration; replace the object/context when dependencies change. */
|
|
19
|
+
config = {};
|
|
20
|
+
disabled = false;
|
|
21
|
+
readOnly = false;
|
|
22
|
+
required = false;
|
|
23
|
+
size = 'md';
|
|
24
|
+
disclosure = false;
|
|
25
|
+
clearable = false;
|
|
26
|
+
/** Optional description shown by the connected question-mark button. */
|
|
27
|
+
help = '';
|
|
28
|
+
queryChange;
|
|
29
|
+
valueChange;
|
|
30
|
+
freeEntry;
|
|
31
|
+
createEntry;
|
|
32
|
+
dependencyInvalidate;
|
|
33
|
+
validationChange;
|
|
34
|
+
/** Supplies the current result rows for framework-owned rich slots. */
|
|
35
|
+
optionsChange;
|
|
36
|
+
raw = '';
|
|
37
|
+
display = '';
|
|
38
|
+
selected = null;
|
|
39
|
+
expanded = false;
|
|
40
|
+
rows = [];
|
|
41
|
+
active = -1;
|
|
42
|
+
loading = false;
|
|
43
|
+
helpOpen = false;
|
|
44
|
+
lookupError = '';
|
|
45
|
+
validation = { status: 'pristine', touched: false, dirty: false, issues: [] };
|
|
46
|
+
input;
|
|
47
|
+
popup;
|
|
48
|
+
field;
|
|
49
|
+
surface;
|
|
50
|
+
lookup;
|
|
51
|
+
validationRun;
|
|
52
|
+
lookupTimer;
|
|
53
|
+
composing = false;
|
|
54
|
+
initialRaw = '';
|
|
55
|
+
overlayId = `ui-combobox-${Math.random().toString(36).slice(2)}`;
|
|
56
|
+
alive = false;
|
|
57
|
+
fullSet = false;
|
|
58
|
+
knownOptions = new Map();
|
|
59
|
+
awaitingLabel = null;
|
|
60
|
+
proposedChange;
|
|
61
|
+
formattedRaw;
|
|
62
|
+
formattedWith;
|
|
63
|
+
componentWillLoad() {
|
|
64
|
+
this.selected = this.value !== undefined ? this.value : this.defaultValue ?? null;
|
|
65
|
+
this.raw = this.query ?? this.defaultQuery;
|
|
66
|
+
if (this.query === undefined && !this.raw && this.selected !== null) {
|
|
67
|
+
this.raw = this.config.options?.find(row => row.value === this.selected)?.label ?? this.selected;
|
|
68
|
+
}
|
|
69
|
+
if (this.query === undefined && this.selected !== null && this.raw === this.selected)
|
|
70
|
+
this.awaitingLabel = this.selected;
|
|
71
|
+
this.display = this.raw;
|
|
72
|
+
this.initialRaw = this.raw;
|
|
73
|
+
this.applyServerIssues();
|
|
74
|
+
}
|
|
75
|
+
connectedCallback() { this.alive = true; this.setupSurface(); }
|
|
76
|
+
componentDidLoad() { this.setupSurface(); }
|
|
77
|
+
componentDidUpdate() {
|
|
78
|
+
if (this.input && !this.composing && this.input.value !== this.display)
|
|
79
|
+
this.input.value = this.display;
|
|
80
|
+
if (this.expanded)
|
|
81
|
+
this.surface?.refresh();
|
|
82
|
+
}
|
|
83
|
+
disconnectedCallback() {
|
|
84
|
+
this.alive = false;
|
|
85
|
+
this.close();
|
|
86
|
+
this.validationRun?.abort();
|
|
87
|
+
this.surface?.destroy();
|
|
88
|
+
this.surface = undefined;
|
|
89
|
+
}
|
|
90
|
+
setupSurface() {
|
|
91
|
+
if (!this.surface && this.popup && this.field)
|
|
92
|
+
this.surface = createAnchoredSurface(this.popup, { anchor: this.field, placement: 'bottom-start' });
|
|
93
|
+
}
|
|
94
|
+
syncValue() {
|
|
95
|
+
if (this.value === undefined)
|
|
96
|
+
return;
|
|
97
|
+
this.selected = this.value;
|
|
98
|
+
if (this.query === undefined) {
|
|
99
|
+
const proposal = this.proposedChange;
|
|
100
|
+
const option = this.config.options?.find(row => row.value === this.selected)
|
|
101
|
+
?? (this.selected === null ? undefined : this.knownOptions.get(this.selected));
|
|
102
|
+
const nextRaw = proposal?.value === this.selected ? proposal.query : option?.label ?? this.selected ?? '';
|
|
103
|
+
if (proposal?.value !== this.selected || nextRaw !== this.raw) {
|
|
104
|
+
this.raw = nextRaw;
|
|
105
|
+
this.display = this.raw;
|
|
106
|
+
this.formattedRaw = undefined;
|
|
107
|
+
}
|
|
108
|
+
this.awaitingLabel = !option && this.selected !== null ? this.selected : null;
|
|
109
|
+
}
|
|
110
|
+
this.resetValidation();
|
|
111
|
+
}
|
|
112
|
+
syncQuery() {
|
|
113
|
+
if (this.query === undefined || this.query === this.raw)
|
|
114
|
+
return;
|
|
115
|
+
// Only a selection proposal's query echo retains an uncontrolled identity.
|
|
116
|
+
// Other owner text replacements are edits, just like native input.
|
|
117
|
+
if (this.value === undefined && this.proposedChange?.query !== this.query)
|
|
118
|
+
this.selected = null;
|
|
119
|
+
this.awaitingLabel = null;
|
|
120
|
+
this.formattedRaw = undefined;
|
|
121
|
+
this.raw = this.query;
|
|
122
|
+
this.display = this.raw;
|
|
123
|
+
this.resetValidation();
|
|
124
|
+
if (this.expanded)
|
|
125
|
+
this.search('input');
|
|
126
|
+
}
|
|
127
|
+
syncDisabled() {
|
|
128
|
+
if (this.disabled || this.readOnly) {
|
|
129
|
+
this.close();
|
|
130
|
+
this.resetValidation();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
syncConfig(next, previous) {
|
|
134
|
+
this.validationRun?.abort();
|
|
135
|
+
if (next.provider !== previous?.provider || next.context !== previous?.context)
|
|
136
|
+
this.knownOptions.clear();
|
|
137
|
+
if (next.context !== previous?.context) {
|
|
138
|
+
this.close();
|
|
139
|
+
const policy = next.invalidation ?? 'retain-query';
|
|
140
|
+
const value = policy === 'retain' ? this.selected : null;
|
|
141
|
+
const query = policy === 'clear' ? '' : this.raw;
|
|
142
|
+
this.commit(value, query, null, 'invalidation', 'programmatic');
|
|
143
|
+
this.validation = { status: 'pristine', touched: false, dirty: this.raw !== this.initialRaw, issues: [] };
|
|
144
|
+
}
|
|
145
|
+
this.applyServerIssues();
|
|
146
|
+
if (this.expanded)
|
|
147
|
+
this.search('context');
|
|
148
|
+
}
|
|
149
|
+
applyServerIssues() {
|
|
150
|
+
const issues = this.config.issues ?? [];
|
|
151
|
+
if (issues.length)
|
|
152
|
+
this.setValidation({ issues }, this.validation.touched);
|
|
153
|
+
else
|
|
154
|
+
this.resetValidation();
|
|
155
|
+
}
|
|
156
|
+
resetValidation() {
|
|
157
|
+
this.validationRun?.abort();
|
|
158
|
+
this.validation = { status: 'pristine', touched: this.validation.touched, dirty: this.raw !== this.initialRaw, issues: [] };
|
|
159
|
+
this.validationChange?.emit(this.validation);
|
|
160
|
+
}
|
|
161
|
+
cancelLookup() {
|
|
162
|
+
clearTimeout(this.lookupTimer);
|
|
163
|
+
this.lookup?.abort();
|
|
164
|
+
this.lookup = undefined;
|
|
165
|
+
this.loading = false;
|
|
166
|
+
}
|
|
167
|
+
close() {
|
|
168
|
+
this.expanded = false;
|
|
169
|
+
this.active = -1;
|
|
170
|
+
this.cancelLookup();
|
|
171
|
+
this.surface?.hide();
|
|
172
|
+
closeOverlay(this.overlayId);
|
|
173
|
+
}
|
|
174
|
+
open(reason = 'input') {
|
|
175
|
+
if (this.disabled || this.readOnly)
|
|
176
|
+
return;
|
|
177
|
+
this.expanded = true;
|
|
178
|
+
if (this.popup && this.field)
|
|
179
|
+
this.popup.style.minWidth = `${this.field.getBoundingClientRect().width}px`;
|
|
180
|
+
this.surface?.show();
|
|
181
|
+
openOverlay({ id: this.overlayId, element: this.popup, relatedElements: [this.host], modal: false,
|
|
182
|
+
requestClose: () => this.close() });
|
|
183
|
+
this.search(reason);
|
|
184
|
+
}
|
|
185
|
+
search(reason) {
|
|
186
|
+
this.cancelLookup();
|
|
187
|
+
this.fullSet = reason === 'disclosure';
|
|
188
|
+
this.active = -1;
|
|
189
|
+
this.lookupError = '';
|
|
190
|
+
const config = this.config;
|
|
191
|
+
const query = this.fullSet ? '' : this.raw;
|
|
192
|
+
const controller = new AbortController();
|
|
193
|
+
this.lookup = controller;
|
|
194
|
+
const apply = (options) => {
|
|
195
|
+
if (controller.signal.aborted || !this.alive)
|
|
196
|
+
return;
|
|
197
|
+
for (const option of options)
|
|
198
|
+
this.knownOptions.set(option.value, option);
|
|
199
|
+
const selectedOption = this.selected === null ? undefined : this.knownOptions.get(this.selected);
|
|
200
|
+
if (this.query === undefined && this.awaitingLabel === this.selected && selectedOption) {
|
|
201
|
+
this.raw = selectedOption.label;
|
|
202
|
+
this.display = this.raw;
|
|
203
|
+
this.awaitingLabel = null;
|
|
204
|
+
this.formattedRaw = undefined;
|
|
205
|
+
this.resetValidation();
|
|
206
|
+
}
|
|
207
|
+
const ids = new Set();
|
|
208
|
+
this.rows = options.filter(option => {
|
|
209
|
+
if (ids.has(option.id))
|
|
210
|
+
return false;
|
|
211
|
+
ids.add(option.id);
|
|
212
|
+
return this.fullSet || (config.filter ? config.filter(option, query, config.context)
|
|
213
|
+
: config.provider ? true : option.label.toLocaleLowerCase().includes(query.toLocaleLowerCase()));
|
|
214
|
+
});
|
|
215
|
+
const groups = new Map();
|
|
216
|
+
for (const row of this.rows) {
|
|
217
|
+
const group = row.group ?? '';
|
|
218
|
+
if (!groups.has(group))
|
|
219
|
+
groups.set(group, []);
|
|
220
|
+
groups.get(group).push(row);
|
|
221
|
+
}
|
|
222
|
+
this.rows = [...groups.values()].flat();
|
|
223
|
+
this.loading = false;
|
|
224
|
+
this.optionsChange.emit(this.rows);
|
|
225
|
+
};
|
|
226
|
+
if (!config.provider) {
|
|
227
|
+
apply(config.options ?? []);
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
this.rows = [];
|
|
231
|
+
this.loading = true;
|
|
232
|
+
this.lookupTimer = setTimeout(async () => {
|
|
233
|
+
try {
|
|
234
|
+
apply(await config.provider({ query, context: config.context, signal: controller.signal, reason }));
|
|
235
|
+
}
|
|
236
|
+
catch (error) {
|
|
237
|
+
if (controller.signal.aborted || !this.alive)
|
|
238
|
+
return;
|
|
239
|
+
this.loading = false;
|
|
240
|
+
this.lookupError = error instanceof Error ? error.message : 'Unable to load suggestions.';
|
|
241
|
+
}
|
|
242
|
+
}, reason === 'disclosure' ? 0 : Math.max(0, config.debounce ?? 200));
|
|
243
|
+
}
|
|
244
|
+
get canCreate() {
|
|
245
|
+
return Boolean(this.config.allowCreate && this.raw.trim() && !this.loading && !this.lookupError
|
|
246
|
+
&& !this.rows.some(row => row.label.toLocaleLowerCase() === this.raw.toLocaleLowerCase()));
|
|
247
|
+
}
|
|
248
|
+
format(timing) {
|
|
249
|
+
if ((this.config.formatOn ?? 'blur') !== timing || !this.input)
|
|
250
|
+
return;
|
|
251
|
+
// Selection is now in display coordinates; do not map it as raw a second time.
|
|
252
|
+
if (this.formattedRaw === this.raw && this.formattedWith === this.config.format)
|
|
253
|
+
return;
|
|
254
|
+
const result = formatEditingValue(this.raw, {
|
|
255
|
+
start: this.input.selectionStart ?? this.raw.length, end: this.input.selectionEnd ?? this.raw.length,
|
|
256
|
+
direction: this.input.selectionDirection ?? 'none',
|
|
257
|
+
}, this.config.format);
|
|
258
|
+
this.formattedRaw = this.raw;
|
|
259
|
+
this.formattedWith = this.config.format;
|
|
260
|
+
this.display = result.display;
|
|
261
|
+
if (this.input.value !== result.display) {
|
|
262
|
+
this.input.value = result.display;
|
|
263
|
+
this.input.setSelectionRange(result.selection.start, result.selection.end, result.selection.direction);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
onInput = (event) => {
|
|
267
|
+
// Composition updates remain entirely native until compositionend.
|
|
268
|
+
if (this.composing || event.isComposing)
|
|
269
|
+
return;
|
|
270
|
+
this.awaitingLabel = null;
|
|
271
|
+
this.formattedRaw = undefined;
|
|
272
|
+
this.raw = this.input.value;
|
|
273
|
+
this.display = this.raw;
|
|
274
|
+
this.resetValidation();
|
|
275
|
+
this.format('input');
|
|
276
|
+
this.queryChange.emit({ query: this.raw, display: this.display, trigger: 'keyboard' });
|
|
277
|
+
if (this.selected !== null)
|
|
278
|
+
this.commit(null, this.raw, null, 'clear', 'keyboard');
|
|
279
|
+
this.open();
|
|
280
|
+
if (this.config.validateOn === 'input')
|
|
281
|
+
void this.validate();
|
|
282
|
+
queueMicrotask(() => {
|
|
283
|
+
if (this.query !== undefined && this.query !== this.raw)
|
|
284
|
+
this.syncQuery();
|
|
285
|
+
});
|
|
286
|
+
};
|
|
287
|
+
commit(value, query, option, kind, trigger) {
|
|
288
|
+
this.awaitingLabel = null;
|
|
289
|
+
const queryChanged = query !== this.raw;
|
|
290
|
+
if (this.value === undefined)
|
|
291
|
+
this.selected = value;
|
|
292
|
+
if (this.query === undefined && queryChanged) {
|
|
293
|
+
this.raw = query;
|
|
294
|
+
this.display = query;
|
|
295
|
+
this.formattedRaw = undefined;
|
|
296
|
+
}
|
|
297
|
+
this.resetValidation();
|
|
298
|
+
const detail = { value, query, option, kind, trigger };
|
|
299
|
+
const proposal = { value, query };
|
|
300
|
+
this.proposedChange = proposal;
|
|
301
|
+
this.valueChange.emit(detail);
|
|
302
|
+
if (queryChanged)
|
|
303
|
+
this.queryChange.emit({ query, display: query, trigger });
|
|
304
|
+
if (kind === 'create')
|
|
305
|
+
this.createEntry.emit(detail);
|
|
306
|
+
if (kind === 'free-entry')
|
|
307
|
+
this.freeEntry.emit(detail);
|
|
308
|
+
if (kind === 'invalidation')
|
|
309
|
+
this.dependencyInvalidate.emit(detail);
|
|
310
|
+
// Settle after all owner notifications (including Vue's queued update).
|
|
311
|
+
// A retained prop does not fire a Stencil watcher, so rejection must be
|
|
312
|
+
// reconciled explicitly while the proposal still identifies an edit echo.
|
|
313
|
+
queueMicrotask(() => {
|
|
314
|
+
if (this.proposedChange !== proposal)
|
|
315
|
+
return;
|
|
316
|
+
if (this.value !== undefined && this.value !== proposal.value)
|
|
317
|
+
this.syncValue();
|
|
318
|
+
if (this.query !== undefined && this.query !== proposal.query) {
|
|
319
|
+
if (this.value === undefined) {
|
|
320
|
+
this.selected = null;
|
|
321
|
+
this.resetValidation();
|
|
322
|
+
}
|
|
323
|
+
this.syncQuery();
|
|
324
|
+
}
|
|
325
|
+
this.proposedChange = undefined;
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
choose(index, trigger) {
|
|
329
|
+
const option = this.rows[index];
|
|
330
|
+
if (option?.disabled)
|
|
331
|
+
return;
|
|
332
|
+
if (option)
|
|
333
|
+
this.commit(option.value, option.label, option, 'selection', trigger);
|
|
334
|
+
else if (this.canCreate && index === this.rows.length)
|
|
335
|
+
this.commit(null, this.raw, null, 'create', trigger);
|
|
336
|
+
else
|
|
337
|
+
return;
|
|
338
|
+
this.close();
|
|
339
|
+
this.input?.focus();
|
|
340
|
+
if (this.config.validateOn !== 'submit')
|
|
341
|
+
queueMicrotask(() => void this.validate());
|
|
342
|
+
}
|
|
343
|
+
move(key) {
|
|
344
|
+
const indices = this.rows.flatMap((row, index) => row.disabled ? [] : [index]);
|
|
345
|
+
if (this.canCreate)
|
|
346
|
+
indices.push(this.rows.length);
|
|
347
|
+
if (!indices.length)
|
|
348
|
+
return;
|
|
349
|
+
const current = indices.indexOf(this.active);
|
|
350
|
+
const next = key === 'Home' ? 0 : key === 'End' ? indices.length - 1
|
|
351
|
+
: key === 'ArrowDown' ? Math.min(current + 1, indices.length - 1)
|
|
352
|
+
: current < 0 ? indices.length - 1 : Math.max(0, current - 1);
|
|
353
|
+
this.active = indices[next];
|
|
354
|
+
requestAnimationFrame(() => this.host.shadowRoot?.getElementById(`option-${this.active}`)?.scrollIntoView({ block: 'nearest' }));
|
|
355
|
+
}
|
|
356
|
+
onKeydown = (event) => {
|
|
357
|
+
if (this.composing || event.isComposing || this.disabled || this.readOnly)
|
|
358
|
+
return;
|
|
359
|
+
if (event.key === 'Escape' && this.expanded) {
|
|
360
|
+
event.preventDefault();
|
|
361
|
+
event.stopPropagation();
|
|
362
|
+
this.close();
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
if (event.key === 'Tab') {
|
|
366
|
+
this.close();
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
|
|
370
|
+
return;
|
|
371
|
+
if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
372
|
+
event.preventDefault();
|
|
373
|
+
if (!this.expanded)
|
|
374
|
+
this.open('disclosure');
|
|
375
|
+
this.move(event.key);
|
|
376
|
+
}
|
|
377
|
+
else if ((event.key === 'Home' || event.key === 'End') && this.expanded && this.active >= 0) {
|
|
378
|
+
event.preventDefault();
|
|
379
|
+
this.move(event.key);
|
|
380
|
+
}
|
|
381
|
+
else if (event.key === 'Enter' && this.expanded) {
|
|
382
|
+
if (this.active >= 0) {
|
|
383
|
+
event.preventDefault();
|
|
384
|
+
this.choose(this.active, 'keyboard');
|
|
385
|
+
}
|
|
386
|
+
else if (this.config.allowFreeText) {
|
|
387
|
+
event.preventDefault();
|
|
388
|
+
this.commit(null, this.raw, null, 'free-entry', 'keyboard');
|
|
389
|
+
this.close();
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
onFocusOut = (event) => {
|
|
394
|
+
if (event.relatedTarget instanceof Node && this.host.shadowRoot?.contains(event.relatedTarget))
|
|
395
|
+
return;
|
|
396
|
+
this.close();
|
|
397
|
+
this.format('blur');
|
|
398
|
+
this.validation = { ...this.validation, touched: true };
|
|
399
|
+
if (this.config.allowFreeText && this.selected === null)
|
|
400
|
+
this.commit(null, this.raw, null, 'free-entry', 'keyboard');
|
|
401
|
+
if ((this.config.validateOn ?? 'blur') === 'blur')
|
|
402
|
+
void this.validate();
|
|
403
|
+
};
|
|
404
|
+
setValidation(result, touched = this.validation.touched) {
|
|
405
|
+
const blocking = result.issues.some(issue => issue.severity !== 'warning');
|
|
406
|
+
this.validation = { status: blocking ? 'error' : result.issues.length ? 'warning' : 'valid',
|
|
407
|
+
touched, dirty: this.raw !== this.initialRaw, ...result };
|
|
408
|
+
this.validationChange?.emit(this.validation);
|
|
409
|
+
}
|
|
410
|
+
/** Validate for submission. Caller submits only non-pending, non-error output. */
|
|
411
|
+
async validate() {
|
|
412
|
+
this.validationRun?.abort();
|
|
413
|
+
const run = new AbortController();
|
|
414
|
+
this.validationRun = run;
|
|
415
|
+
this.validation = { ...this.validation, status: 'pending', output: undefined };
|
|
416
|
+
this.validationChange.emit(this.validation);
|
|
417
|
+
try {
|
|
418
|
+
const result = await validateField({ raw: this.raw, value: this.selected, context: this.config.context, signal: run.signal }, this.config);
|
|
419
|
+
if (this.required && !this.raw.trim())
|
|
420
|
+
result.issues = [...result.issues, { message: 'A value is required.' }];
|
|
421
|
+
else if (this.raw && this.selected === null && !this.config.allowFreeText && !this.config.allowCreate)
|
|
422
|
+
result.issues = [...result.issues, { message: 'Choose a suggestion.' }];
|
|
423
|
+
if (result.issues.some(issue => issue.severity !== 'warning'))
|
|
424
|
+
result.output = undefined;
|
|
425
|
+
if (!run.signal.aborted && this.alive)
|
|
426
|
+
this.setValidation(result);
|
|
427
|
+
}
|
|
428
|
+
catch { /* Aborted work never becomes current field state. */ }
|
|
429
|
+
return this.validation;
|
|
430
|
+
}
|
|
431
|
+
render() {
|
|
432
|
+
const description = [this.helpOpen ? 'help-text' : '', this.validation.issues.length ? 'validation' : ''].filter(Boolean).join(' ') || undefined;
|
|
433
|
+
const status = this.loading ? 'Loading suggestions…' : this.lookupError || (this.expanded ? `${this.rows.length} suggestions available.` : '');
|
|
434
|
+
const groups = [...new Set(this.rows.map(row => row.group ?? ''))];
|
|
435
|
+
return h(Host, { key: '2378bfd8473852642fef21898f4a756eb3b092ba', "data-size": this.size, "data-validation": this.validation.status, onFocusout: this.onFocusOut }, h("label", { key: '7aba65aeb336d490ddeaf5db9bba9db8ab8b9dbb', htmlFor: "input", part: "label" }, this.label, this.required ? ' *' : ''), h("div", { key: 'ee87156259d0fe1e2e56c4b36667e8daf5e1e2c1', class: "field", part: "field", ref: element => this.field = element }, h("input", { key: '35c5b85ff9a4bcba9bddaf85ff1f118a94aa077b', 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: '74e4f44836b751ab5e9f794a39b480602e0c106d', 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: 'c870ced139fb22baa50a1795ab78f14c38647d34', id: "help", type: "button", part: "affordance", "aria-label": `Help for ${this.label}`, disabled: this.disabled }, h("span", { key: 'ba3dc5128c1941b21b53a5ba78a27017b3df5ec8', "aria-hidden": "true" }, "?")), this.disclosure && h("button", { key: 'eced588e3fa7958dd6185173faaef01219c30243', 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
|
+
if (this.expanded)
|
|
437
|
+
this.close();
|
|
438
|
+
else
|
|
439
|
+
this.open('disclosure');
|
|
440
|
+
this.input?.focus();
|
|
441
|
+
} }, h("span", { key: '7cb9f7f2bb15246dcdd2348ea0ca656d1d0c8c33', "aria-hidden": "true" }, "\u2304"))), this.help && h("ui-tooltip", { key: 'b1b5d42ca457f9b951758bb5e816c8dbbcd1087d', id: "help-text", for: "help", toggleOnClick: true, onOpen: () => this.helpOpen = true, onClose: () => this.helpOpen = false }, this.help), h("div", { key: '9eca2df66c72917e6bfda21205c2a4ef97dd91d5', class: "popup", part: "popup", hidden: !this.expanded, ref: element => this.popup = element }, h("div", { key: '641e1f137c9cfef5d08ec99f6178e59487a20bf1', 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: '38a3aa6b2ffae30e6f81e1f89d10c9966dd31b10', 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: 'dd3e895ef363f6d30a0c25e4b5092a8feacc63e5', name: "create" }, "Create \u201C", this.raw, "\u201D"))), this.loading ? h("div", { class: "message" }, h("slot", { name: "loading" }, "Loading suggestions\u2026"))
|
|
442
|
+
: 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: '9cf12a8fde7d9cfb9e2d2a77669ac4708c7fded6', id: "validation", class: "message", part: "validation", hidden: !this.validation.issues.length }, this.validation.issues.map(issue => h("div", null, issue.message))), h("div", { key: '1c7b1d3f658e500cbf5f5004a76a39511cc79c49', 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
|
+
}
|
|
445
|
+
static get is() { return "ui-combobox"; }
|
|
446
|
+
static get encapsulation() { return "shadow"; }
|
|
447
|
+
static get originalStyleUrls() {
|
|
448
|
+
return {
|
|
449
|
+
"$": ["ui-combobox.css"]
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
static get styleUrls() {
|
|
453
|
+
return {
|
|
454
|
+
"$": ["ui-combobox.css"]
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
static get properties() {
|
|
458
|
+
return {
|
|
459
|
+
"label": {
|
|
460
|
+
"type": "string",
|
|
461
|
+
"mutable": false,
|
|
462
|
+
"complexType": {
|
|
463
|
+
"original": "string",
|
|
464
|
+
"resolved": "string",
|
|
465
|
+
"references": {}
|
|
466
|
+
},
|
|
467
|
+
"required": false,
|
|
468
|
+
"optional": false,
|
|
469
|
+
"docs": {
|
|
470
|
+
"tags": [],
|
|
471
|
+
"text": "Accessible visible label, associated with the native text input."
|
|
472
|
+
},
|
|
473
|
+
"getter": false,
|
|
474
|
+
"setter": false,
|
|
475
|
+
"reflect": false,
|
|
476
|
+
"attribute": "label",
|
|
477
|
+
"defaultValue": "''"
|
|
478
|
+
},
|
|
479
|
+
"placeholder": {
|
|
480
|
+
"type": "string",
|
|
481
|
+
"mutable": false,
|
|
482
|
+
"complexType": {
|
|
483
|
+
"original": "string",
|
|
484
|
+
"resolved": "string",
|
|
485
|
+
"references": {}
|
|
486
|
+
},
|
|
487
|
+
"required": false,
|
|
488
|
+
"optional": false,
|
|
489
|
+
"docs": {
|
|
490
|
+
"tags": [],
|
|
491
|
+
"text": ""
|
|
492
|
+
},
|
|
493
|
+
"getter": false,
|
|
494
|
+
"setter": false,
|
|
495
|
+
"reflect": false,
|
|
496
|
+
"attribute": "placeholder",
|
|
497
|
+
"defaultValue": "''"
|
|
498
|
+
},
|
|
499
|
+
"name": {
|
|
500
|
+
"type": "string",
|
|
501
|
+
"mutable": false,
|
|
502
|
+
"complexType": {
|
|
503
|
+
"original": "string",
|
|
504
|
+
"resolved": "string",
|
|
505
|
+
"references": {}
|
|
506
|
+
},
|
|
507
|
+
"required": false,
|
|
508
|
+
"optional": false,
|
|
509
|
+
"docs": {
|
|
510
|
+
"tags": [],
|
|
511
|
+
"text": ""
|
|
512
|
+
},
|
|
513
|
+
"getter": false,
|
|
514
|
+
"setter": false,
|
|
515
|
+
"reflect": false,
|
|
516
|
+
"attribute": "name",
|
|
517
|
+
"defaultValue": "''"
|
|
518
|
+
},
|
|
519
|
+
"value": {
|
|
520
|
+
"type": "string",
|
|
521
|
+
"mutable": false,
|
|
522
|
+
"complexType": {
|
|
523
|
+
"original": "string | null",
|
|
524
|
+
"resolved": "string",
|
|
525
|
+
"references": {}
|
|
526
|
+
},
|
|
527
|
+
"required": false,
|
|
528
|
+
"optional": true,
|
|
529
|
+
"docs": {
|
|
530
|
+
"tags": [],
|
|
531
|
+
"text": "Controlled canonical value. Undefined selects uncontrolled mode; null means no selection."
|
|
532
|
+
},
|
|
533
|
+
"getter": false,
|
|
534
|
+
"setter": false,
|
|
535
|
+
"reflect": false,
|
|
536
|
+
"attribute": "value"
|
|
537
|
+
},
|
|
538
|
+
"defaultValue": {
|
|
539
|
+
"type": "string",
|
|
540
|
+
"mutable": false,
|
|
541
|
+
"complexType": {
|
|
542
|
+
"original": "string",
|
|
543
|
+
"resolved": "string",
|
|
544
|
+
"references": {}
|
|
545
|
+
},
|
|
546
|
+
"required": false,
|
|
547
|
+
"optional": true,
|
|
548
|
+
"docs": {
|
|
549
|
+
"tags": [],
|
|
550
|
+
"text": ""
|
|
551
|
+
},
|
|
552
|
+
"getter": false,
|
|
553
|
+
"setter": false,
|
|
554
|
+
"reflect": false,
|
|
555
|
+
"attribute": "default-value"
|
|
556
|
+
},
|
|
557
|
+
"query": {
|
|
558
|
+
"type": "string",
|
|
559
|
+
"mutable": false,
|
|
560
|
+
"complexType": {
|
|
561
|
+
"original": "string",
|
|
562
|
+
"resolved": "string",
|
|
563
|
+
"references": {}
|
|
564
|
+
},
|
|
565
|
+
"required": false,
|
|
566
|
+
"optional": true,
|
|
567
|
+
"docs": {
|
|
568
|
+
"tags": [],
|
|
569
|
+
"text": "Controlled raw editing text; independent of canonical selection."
|
|
570
|
+
},
|
|
571
|
+
"getter": false,
|
|
572
|
+
"setter": false,
|
|
573
|
+
"reflect": false,
|
|
574
|
+
"attribute": "query"
|
|
575
|
+
},
|
|
576
|
+
"defaultQuery": {
|
|
577
|
+
"type": "string",
|
|
578
|
+
"mutable": false,
|
|
579
|
+
"complexType": {
|
|
580
|
+
"original": "string",
|
|
581
|
+
"resolved": "string",
|
|
582
|
+
"references": {}
|
|
583
|
+
},
|
|
584
|
+
"required": false,
|
|
585
|
+
"optional": false,
|
|
586
|
+
"docs": {
|
|
587
|
+
"tags": [],
|
|
588
|
+
"text": ""
|
|
589
|
+
},
|
|
590
|
+
"getter": false,
|
|
591
|
+
"setter": false,
|
|
592
|
+
"reflect": false,
|
|
593
|
+
"attribute": "default-query",
|
|
594
|
+
"defaultValue": "''"
|
|
595
|
+
},
|
|
596
|
+
"config": {
|
|
597
|
+
"type": "unknown",
|
|
598
|
+
"mutable": false,
|
|
599
|
+
"complexType": {
|
|
600
|
+
"original": "ComboboxConfig",
|
|
601
|
+
"resolved": "ComboboxConfig",
|
|
602
|
+
"references": {
|
|
603
|
+
"ComboboxConfig": {
|
|
604
|
+
"location": "import",
|
|
605
|
+
"path": "../../field/combobox",
|
|
606
|
+
"id": "src/field/combobox.ts::ComboboxConfig",
|
|
607
|
+
"referenceLocation": "ComboboxConfig"
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
"required": false,
|
|
612
|
+
"optional": false,
|
|
613
|
+
"docs": {
|
|
614
|
+
"tags": [],
|
|
615
|
+
"text": "Immutable configuration; replace the object/context when dependencies change."
|
|
616
|
+
},
|
|
617
|
+
"getter": false,
|
|
618
|
+
"setter": false,
|
|
619
|
+
"defaultValue": "{}"
|
|
620
|
+
},
|
|
621
|
+
"disabled": {
|
|
622
|
+
"type": "boolean",
|
|
623
|
+
"mutable": false,
|
|
624
|
+
"complexType": {
|
|
625
|
+
"original": "boolean",
|
|
626
|
+
"resolved": "boolean",
|
|
627
|
+
"references": {}
|
|
628
|
+
},
|
|
629
|
+
"required": false,
|
|
630
|
+
"optional": false,
|
|
631
|
+
"docs": {
|
|
632
|
+
"tags": [],
|
|
633
|
+
"text": ""
|
|
634
|
+
},
|
|
635
|
+
"getter": false,
|
|
636
|
+
"setter": false,
|
|
637
|
+
"reflect": false,
|
|
638
|
+
"attribute": "disabled",
|
|
639
|
+
"defaultValue": "false"
|
|
640
|
+
},
|
|
641
|
+
"readOnly": {
|
|
642
|
+
"type": "boolean",
|
|
643
|
+
"mutable": false,
|
|
644
|
+
"complexType": {
|
|
645
|
+
"original": "boolean",
|
|
646
|
+
"resolved": "boolean",
|
|
647
|
+
"references": {}
|
|
648
|
+
},
|
|
649
|
+
"required": false,
|
|
650
|
+
"optional": false,
|
|
651
|
+
"docs": {
|
|
652
|
+
"tags": [],
|
|
653
|
+
"text": ""
|
|
654
|
+
},
|
|
655
|
+
"getter": false,
|
|
656
|
+
"setter": false,
|
|
657
|
+
"reflect": false,
|
|
658
|
+
"attribute": "readonly",
|
|
659
|
+
"defaultValue": "false"
|
|
660
|
+
},
|
|
661
|
+
"required": {
|
|
662
|
+
"type": "boolean",
|
|
663
|
+
"mutable": false,
|
|
664
|
+
"complexType": {
|
|
665
|
+
"original": "boolean",
|
|
666
|
+
"resolved": "boolean",
|
|
667
|
+
"references": {}
|
|
668
|
+
},
|
|
669
|
+
"required": false,
|
|
670
|
+
"optional": false,
|
|
671
|
+
"docs": {
|
|
672
|
+
"tags": [],
|
|
673
|
+
"text": ""
|
|
674
|
+
},
|
|
675
|
+
"getter": false,
|
|
676
|
+
"setter": false,
|
|
677
|
+
"reflect": false,
|
|
678
|
+
"attribute": "required",
|
|
679
|
+
"defaultValue": "false"
|
|
680
|
+
},
|
|
681
|
+
"size": {
|
|
682
|
+
"type": "string",
|
|
683
|
+
"mutable": false,
|
|
684
|
+
"complexType": {
|
|
685
|
+
"original": "'sm' | 'md'",
|
|
686
|
+
"resolved": "\"md\" | \"sm\"",
|
|
687
|
+
"references": {}
|
|
688
|
+
},
|
|
689
|
+
"required": false,
|
|
690
|
+
"optional": false,
|
|
691
|
+
"docs": {
|
|
692
|
+
"tags": [],
|
|
693
|
+
"text": ""
|
|
694
|
+
},
|
|
695
|
+
"getter": false,
|
|
696
|
+
"setter": false,
|
|
697
|
+
"reflect": false,
|
|
698
|
+
"attribute": "size",
|
|
699
|
+
"defaultValue": "'md'"
|
|
700
|
+
},
|
|
701
|
+
"disclosure": {
|
|
702
|
+
"type": "boolean",
|
|
703
|
+
"mutable": false,
|
|
704
|
+
"complexType": {
|
|
705
|
+
"original": "boolean",
|
|
706
|
+
"resolved": "boolean",
|
|
707
|
+
"references": {}
|
|
708
|
+
},
|
|
709
|
+
"required": false,
|
|
710
|
+
"optional": false,
|
|
711
|
+
"docs": {
|
|
712
|
+
"tags": [],
|
|
713
|
+
"text": ""
|
|
714
|
+
},
|
|
715
|
+
"getter": false,
|
|
716
|
+
"setter": false,
|
|
717
|
+
"reflect": false,
|
|
718
|
+
"attribute": "disclosure",
|
|
719
|
+
"defaultValue": "false"
|
|
720
|
+
},
|
|
721
|
+
"clearable": {
|
|
722
|
+
"type": "boolean",
|
|
723
|
+
"mutable": false,
|
|
724
|
+
"complexType": {
|
|
725
|
+
"original": "boolean",
|
|
726
|
+
"resolved": "boolean",
|
|
727
|
+
"references": {}
|
|
728
|
+
},
|
|
729
|
+
"required": false,
|
|
730
|
+
"optional": false,
|
|
731
|
+
"docs": {
|
|
732
|
+
"tags": [],
|
|
733
|
+
"text": ""
|
|
734
|
+
},
|
|
735
|
+
"getter": false,
|
|
736
|
+
"setter": false,
|
|
737
|
+
"reflect": false,
|
|
738
|
+
"attribute": "clearable",
|
|
739
|
+
"defaultValue": "false"
|
|
740
|
+
},
|
|
741
|
+
"help": {
|
|
742
|
+
"type": "string",
|
|
743
|
+
"mutable": false,
|
|
744
|
+
"complexType": {
|
|
745
|
+
"original": "string",
|
|
746
|
+
"resolved": "string",
|
|
747
|
+
"references": {}
|
|
748
|
+
},
|
|
749
|
+
"required": false,
|
|
750
|
+
"optional": false,
|
|
751
|
+
"docs": {
|
|
752
|
+
"tags": [],
|
|
753
|
+
"text": "Optional description shown by the connected question-mark button."
|
|
754
|
+
},
|
|
755
|
+
"getter": false,
|
|
756
|
+
"setter": false,
|
|
757
|
+
"reflect": false,
|
|
758
|
+
"attribute": "help",
|
|
759
|
+
"defaultValue": "''"
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
static get states() {
|
|
764
|
+
return {
|
|
765
|
+
"raw": {},
|
|
766
|
+
"display": {},
|
|
767
|
+
"selected": {},
|
|
768
|
+
"expanded": {},
|
|
769
|
+
"rows": {},
|
|
770
|
+
"active": {},
|
|
771
|
+
"loading": {},
|
|
772
|
+
"helpOpen": {},
|
|
773
|
+
"lookupError": {},
|
|
774
|
+
"validation": {}
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
static get events() {
|
|
778
|
+
return [{
|
|
779
|
+
"method": "queryChange",
|
|
780
|
+
"name": "query-change",
|
|
781
|
+
"bubbles": true,
|
|
782
|
+
"cancelable": true,
|
|
783
|
+
"composed": true,
|
|
784
|
+
"docs": {
|
|
785
|
+
"tags": [],
|
|
786
|
+
"text": ""
|
|
787
|
+
},
|
|
788
|
+
"complexType": {
|
|
789
|
+
"original": "{ query: string; display: string; trigger: 'keyboard' | 'pointer' | 'programmatic' }",
|
|
790
|
+
"resolved": "{ query: string; display: string; trigger: \"keyboard\" | \"pointer\" | \"programmatic\"; }",
|
|
791
|
+
"references": {}
|
|
792
|
+
}
|
|
793
|
+
}, {
|
|
794
|
+
"method": "valueChange",
|
|
795
|
+
"name": "value-change",
|
|
796
|
+
"bubbles": true,
|
|
797
|
+
"cancelable": true,
|
|
798
|
+
"composed": true,
|
|
799
|
+
"docs": {
|
|
800
|
+
"tags": [],
|
|
801
|
+
"text": ""
|
|
802
|
+
},
|
|
803
|
+
"complexType": {
|
|
804
|
+
"original": "ComboboxChange",
|
|
805
|
+
"resolved": "ComboboxChange",
|
|
806
|
+
"references": {
|
|
807
|
+
"ComboboxChange": {
|
|
808
|
+
"location": "import",
|
|
809
|
+
"path": "../../field/combobox",
|
|
810
|
+
"id": "src/field/combobox.ts::ComboboxChange",
|
|
811
|
+
"referenceLocation": "ComboboxChange"
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
}, {
|
|
816
|
+
"method": "freeEntry",
|
|
817
|
+
"name": "free-entry",
|
|
818
|
+
"bubbles": true,
|
|
819
|
+
"cancelable": true,
|
|
820
|
+
"composed": true,
|
|
821
|
+
"docs": {
|
|
822
|
+
"tags": [],
|
|
823
|
+
"text": ""
|
|
824
|
+
},
|
|
825
|
+
"complexType": {
|
|
826
|
+
"original": "ComboboxChange",
|
|
827
|
+
"resolved": "ComboboxChange",
|
|
828
|
+
"references": {
|
|
829
|
+
"ComboboxChange": {
|
|
830
|
+
"location": "import",
|
|
831
|
+
"path": "../../field/combobox",
|
|
832
|
+
"id": "src/field/combobox.ts::ComboboxChange",
|
|
833
|
+
"referenceLocation": "ComboboxChange"
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
}, {
|
|
838
|
+
"method": "createEntry",
|
|
839
|
+
"name": "create-entry",
|
|
840
|
+
"bubbles": true,
|
|
841
|
+
"cancelable": true,
|
|
842
|
+
"composed": true,
|
|
843
|
+
"docs": {
|
|
844
|
+
"tags": [],
|
|
845
|
+
"text": ""
|
|
846
|
+
},
|
|
847
|
+
"complexType": {
|
|
848
|
+
"original": "ComboboxChange",
|
|
849
|
+
"resolved": "ComboboxChange",
|
|
850
|
+
"references": {
|
|
851
|
+
"ComboboxChange": {
|
|
852
|
+
"location": "import",
|
|
853
|
+
"path": "../../field/combobox",
|
|
854
|
+
"id": "src/field/combobox.ts::ComboboxChange",
|
|
855
|
+
"referenceLocation": "ComboboxChange"
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
}, {
|
|
860
|
+
"method": "dependencyInvalidate",
|
|
861
|
+
"name": "dependency-invalidate",
|
|
862
|
+
"bubbles": true,
|
|
863
|
+
"cancelable": true,
|
|
864
|
+
"composed": true,
|
|
865
|
+
"docs": {
|
|
866
|
+
"tags": [],
|
|
867
|
+
"text": ""
|
|
868
|
+
},
|
|
869
|
+
"complexType": {
|
|
870
|
+
"original": "ComboboxChange",
|
|
871
|
+
"resolved": "ComboboxChange",
|
|
872
|
+
"references": {
|
|
873
|
+
"ComboboxChange": {
|
|
874
|
+
"location": "import",
|
|
875
|
+
"path": "../../field/combobox",
|
|
876
|
+
"id": "src/field/combobox.ts::ComboboxChange",
|
|
877
|
+
"referenceLocation": "ComboboxChange"
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
}, {
|
|
882
|
+
"method": "validationChange",
|
|
883
|
+
"name": "validation-change",
|
|
884
|
+
"bubbles": true,
|
|
885
|
+
"cancelable": true,
|
|
886
|
+
"composed": true,
|
|
887
|
+
"docs": {
|
|
888
|
+
"tags": [],
|
|
889
|
+
"text": ""
|
|
890
|
+
},
|
|
891
|
+
"complexType": {
|
|
892
|
+
"original": "ComboboxValidationState",
|
|
893
|
+
"resolved": "ComboboxValidationState",
|
|
894
|
+
"references": {
|
|
895
|
+
"ComboboxValidationState": {
|
|
896
|
+
"location": "import",
|
|
897
|
+
"path": "../../field/combobox",
|
|
898
|
+
"id": "src/field/combobox.ts::ComboboxValidationState",
|
|
899
|
+
"referenceLocation": "ComboboxValidationState"
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
}, {
|
|
904
|
+
"method": "optionsChange",
|
|
905
|
+
"name": "options-change",
|
|
906
|
+
"bubbles": true,
|
|
907
|
+
"cancelable": true,
|
|
908
|
+
"composed": true,
|
|
909
|
+
"docs": {
|
|
910
|
+
"tags": [],
|
|
911
|
+
"text": "Supplies the current result rows for framework-owned rich slots."
|
|
912
|
+
},
|
|
913
|
+
"complexType": {
|
|
914
|
+
"original": "readonly ComboboxOption[]",
|
|
915
|
+
"resolved": "readonly ComboboxOption<unknown>[]",
|
|
916
|
+
"references": {
|
|
917
|
+
"ComboboxOption": {
|
|
918
|
+
"location": "import",
|
|
919
|
+
"path": "../../field/combobox",
|
|
920
|
+
"id": "src/field/combobox.ts::ComboboxOption",
|
|
921
|
+
"referenceLocation": "ComboboxOption"
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
}];
|
|
926
|
+
}
|
|
927
|
+
static get methods() {
|
|
928
|
+
return {
|
|
929
|
+
"validate": {
|
|
930
|
+
"complexType": {
|
|
931
|
+
"signature": "() => Promise<ComboboxValidationState>",
|
|
932
|
+
"parameters": [],
|
|
933
|
+
"references": {
|
|
934
|
+
"Promise": {
|
|
935
|
+
"location": "global",
|
|
936
|
+
"id": "global::Promise"
|
|
937
|
+
},
|
|
938
|
+
"ComboboxValidationState": {
|
|
939
|
+
"location": "import",
|
|
940
|
+
"path": "../../field/combobox",
|
|
941
|
+
"id": "src/field/combobox.ts::ComboboxValidationState",
|
|
942
|
+
"referenceLocation": "ComboboxValidationState"
|
|
943
|
+
}
|
|
944
|
+
},
|
|
945
|
+
"return": "Promise<ComboboxValidationState>"
|
|
946
|
+
},
|
|
947
|
+
"docs": {
|
|
948
|
+
"text": "Validate for submission. Caller submits only non-pending, non-error output.",
|
|
949
|
+
"tags": []
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
};
|
|
953
|
+
}
|
|
954
|
+
static get elementRef() { return "host"; }
|
|
955
|
+
static get watchers() {
|
|
956
|
+
return [{
|
|
957
|
+
"propName": "value",
|
|
958
|
+
"methodName": "syncValue"
|
|
959
|
+
}, {
|
|
960
|
+
"propName": "query",
|
|
961
|
+
"methodName": "syncQuery"
|
|
962
|
+
}, {
|
|
963
|
+
"propName": "disabled",
|
|
964
|
+
"methodName": "syncDisabled"
|
|
965
|
+
}, {
|
|
966
|
+
"propName": "readOnly",
|
|
967
|
+
"methodName": "syncDisabled"
|
|
968
|
+
}, {
|
|
969
|
+
"propName": "config",
|
|
970
|
+
"methodName": "syncConfig"
|
|
971
|
+
}];
|
|
972
|
+
}
|
|
973
|
+
}
|