@bridge-ui/vue 0.0.4 → 0.0.6
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/Adapters/I18n/index.d.ts +1 -0
- package/dist/Adapters/I18n/index.js +2 -0
- package/dist/Adapters/I18n/useI18nAdapter.d.ts +12 -0
- package/dist/Adapters/I18n/useI18nAdapter.js +13 -0
- package/dist/Adapters/Icon/iconSource.types.d.ts +11 -0
- package/dist/Adapters/Icon/index.d.ts +2 -0
- package/dist/Adapters/Icon/index.js +2 -0
- package/dist/Adapters/Icon/useIconAdapter.d.ts +11 -0
- package/dist/Adapters/Icon/useIconAdapter.js +13 -0
- package/dist/Adapters/index.d.ts +3 -0
- package/dist/Adapters/index.js +3 -0
- package/dist/Components/Alert/Alert.vue_vue_type_script_setup_true_lang.js +1 -5
- package/dist/Components/Alert/alert.types.d.ts +2 -2
- package/dist/Components/Alert/alertDefaultIcons.d.ts +2 -2
- package/dist/Components/Alert/alertDefaultIcons.js +9 -10
- package/dist/Components/Alert/composables/useAlert.d.ts +2 -2
- package/dist/Components/Avatar/Avatar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/Avatar/avatar.types.d.ts +2 -2
- package/dist/Components/Avatar/composables/useAvatar.d.ts +1 -1
- package/dist/Components/Avatar/composables/useAvatar.js +43 -44
- package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +24 -25
- package/dist/Components/Button/button.types.d.ts +4 -4
- package/dist/Components/Button/composables/useButton.d.ts +1 -1
- package/dist/Components/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +25 -25
- package/dist/Components/Checkbox/composables/useCheckbox.d.ts +3 -3
- package/dist/Components/Chip/Chip.vue_vue_type_script_setup_true_lang.js +8 -9
- package/dist/Components/FormControl/composables/useFormControl.d.ts +1 -1
- package/dist/Components/FormField/composables/useFormField.d.ts +4 -4
- package/dist/Components/FormField/composables/useFormField.js +98 -99
- package/dist/Components/FormField/formField.types.d.ts +5 -5
- package/dist/Components/Icon/Icon.vue_vue_type_script_setup_true_lang.js +7 -7
- package/dist/Components/Icon/composables/useIcon.d.ts +2 -0
- package/dist/Components/Icon/composables/useIcon.js +20 -18
- package/dist/Components/Icon/icon.types.d.ts +3 -3
- package/dist/Components/Label/composables/useLabel.d.ts +1 -1
- package/dist/Components/Link/Link.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Link/link.types.d.ts +3 -3
- package/dist/Components/ListItem/composables/useListItem.d.ts +2 -2
- package/dist/Components/ListItem/composables/useListItem.js +75 -76
- package/dist/Components/ListItem/listItem.types.d.ts +2 -2
- package/dist/Components/Listbox/Listbox.vue.d.ts +0 -2
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +73 -72
- package/dist/Components/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +40 -40
- package/dist/Components/NumberField/composables/useNumberField.d.ts +6 -6
- package/dist/Components/PasswordField/PasswordField.vue_vue_type_script_setup_true_lang.js +24 -24
- package/dist/Components/PasswordField/composables/usePasswordField.d.ts +6 -6
- package/dist/Components/Radio/composables/useRadio.d.ts +3 -3
- package/dist/Components/Select/Select.vue.d.ts +0 -1
- package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +62 -61
- package/dist/Components/Select/composables/useSelect.d.ts +8 -8
- package/dist/Components/Select/composables/useSelect.js +214 -214
- package/dist/Components/Snackbar/Snackbar.vue_vue_type_script_setup_true_lang.js +81 -75
- package/dist/Components/Snackbar/composables/useSnackbar.d.ts +4 -4
- package/dist/Components/Snackbar/snackbar.types.d.ts +3 -3
- package/dist/Components/Snackbar/snackbarDefaultIcons.d.ts +3 -3
- package/dist/Components/Snackbar/snackbarDefaultIcons.js +9 -10
- package/dist/Components/Switch/composables/useSwitch.d.ts +3 -3
- package/dist/Components/Tab/Tab.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Tab/tab.types.d.ts +3 -3
- package/dist/Components/TabItem/TabItem.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/TabItem/tabItem.types.d.ts +3 -3
- package/dist/Components/Tabs/composables/useTabs.d.ts +468 -4
- package/dist/Components/Tabs/tabsInjectionKey.d.ts +5 -5
- package/dist/Components/TextField/composables/useTextField.d.ts +6 -6
- package/dist/Components/Textarea/composables/useTextarea.d.ts +6 -6
- package/dist/Components/Tooltip/Tooltip.js +5 -0
- package/dist/Components/Tooltip/Tooltip.vue.d.ts +35 -0
- package/dist/Components/Tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +73 -0
- package/dist/Components/Tooltip/composables/useTooltip.d.ts +50 -0
- package/dist/Components/Tooltip/composables/useTooltip.js +208 -0
- package/dist/Components/Tooltip/index.d.ts +4 -0
- package/dist/Components/Tooltip/index.js +3 -0
- package/dist/Components/Tooltip/tooltip.types.d.ts +166 -0
- package/dist/Provider/createBridgeUIApi.js +2 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +80 -76
- package/dist/theme.css +12 -12
- package/package.json +20 -3
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { colorProps as
|
|
1
|
+
import { useI18nAdapter as e } from "../../../Adapters/I18n/useI18nAdapter.js";
|
|
2
|
+
import { hasNamedSlot as t } from "../../../Utils/slotOrProp.js";
|
|
3
|
+
import { mergePartBind as n, resolveFieldAdornmentIconSize as r, useBridgeUIComponent as ee, useBridgeUIMergedRegistryClasses as i } from "../../../Utils/index.js";
|
|
4
|
+
import { formFieldBridgeKeys as te, useFormField as ne } from "../../FormField/composables/useFormField.js";
|
|
5
|
+
import { useListboxNavigation as re } from "../../Listbox/composables/useListboxNavigation.js";
|
|
6
|
+
import { Comment as ie, Text as ae, computed as a, nextTick as o, onBeforeUnmount as oe, onMounted as se, ref as s, useAttrs as ce, useId as le, useSlots as ue, watch as c } from "vue";
|
|
7
|
+
import { get as l, isNil as de, omit as fe } from "es-toolkit/compat";
|
|
8
|
+
import { adjustAutosizeTextareaHeight as pe, cn as u, createSelectAsyncSearch as me, filterListboxEntries as he, flattenListboxOptions as d, mergeBridgeUILayeredClasses as f, normalizeListboxEntries as p, normalizeSelectOptions as ge, resolveMessage as m, resolveSelectAsyncDebounce as _e, resolveSelectAsyncOptions as ve, selectValuesEqual as h, splitComponentProps as ye } from "@bridge-ui/core";
|
|
9
|
+
import { colorProps as be, invalidatedProps as xe } from "@bridge-ui/core/Tokens/Listbox";
|
|
10
10
|
//#region src/Components/Select/composables/useSelect.ts
|
|
11
|
-
var
|
|
11
|
+
var Se = [
|
|
12
12
|
"classes",
|
|
13
13
|
"loading",
|
|
14
14
|
"options",
|
|
@@ -29,333 +29,333 @@ var Ce = [
|
|
|
29
29
|
"minItemsForSearch",
|
|
30
30
|
"optionDescription"
|
|
31
31
|
];
|
|
32
|
-
function
|
|
33
|
-
let
|
|
34
|
-
bridgeKeys:
|
|
32
|
+
function g(g, _, v, y, b) {
|
|
33
|
+
let Ce = ce(), x = ue(), S = e(), C = le(), w = s(!1), T = s(""), E = s(-1), we = s(null), D = s(!1), O = s([]), k = null, A = s([]), Te = a(() => ye({
|
|
34
|
+
bridgeKeys: Se,
|
|
35
35
|
props: {
|
|
36
|
-
...
|
|
37
|
-
...
|
|
36
|
+
...Ce,
|
|
37
|
+
...g
|
|
38
38
|
}
|
|
39
|
-
})),
|
|
39
|
+
})), j = a(() => Te.value.componentProps), Ee = a(() => ({ classes: j.value.classes })), { components: M, entry: De } = ee({
|
|
40
40
|
componentName: "Select",
|
|
41
|
-
props: () =>
|
|
42
|
-
}),
|
|
43
|
-
entry:
|
|
44
|
-
props: () =>
|
|
45
|
-
}),
|
|
46
|
-
optionLabel:
|
|
47
|
-
optionValue:
|
|
48
|
-
optionDescription:
|
|
49
|
-
})),
|
|
41
|
+
props: () => Ee.value
|
|
42
|
+
}), N = i({
|
|
43
|
+
entry: De,
|
|
44
|
+
props: () => Ee.value
|
|
45
|
+
}), P = a(() => !!j.value.multiple), F = a(() => ({
|
|
46
|
+
optionLabel: j.value.optionLabel ?? "label",
|
|
47
|
+
optionValue: j.value.optionValue ?? "value",
|
|
48
|
+
optionDescription: j.value.optionDescription ?? "description"
|
|
49
|
+
})), I = a(() => b.value.length > 0 ? b.value.map((e) => ({
|
|
50
50
|
option: e,
|
|
51
51
|
type: "option"
|
|
52
|
-
})) :
|
|
53
|
-
function
|
|
52
|
+
})) : p(j.value.options, F.value)), Oe = a(() => d(I.value)), L = s([]);
|
|
53
|
+
function ke(e) {
|
|
54
54
|
if (!e || typeof e != "object") return !1;
|
|
55
55
|
let t = e.type;
|
|
56
56
|
if (!t || typeof t != "object") return !1;
|
|
57
57
|
let n = t.name, r = t.__name;
|
|
58
58
|
return n === "SelectOption" || r === "SelectOption";
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
return
|
|
60
|
+
function Ae() {
|
|
61
|
+
return t(x, "default") ? (x.default?.({}) ?? []).some((e) => {
|
|
62
62
|
if (!e || typeof e != "object") return !1;
|
|
63
63
|
let t = e.type;
|
|
64
|
-
return t ===
|
|
64
|
+
return t === ie || t === ae || t === void 0 || typeof t == "symbol" ? !1 : !ke(e);
|
|
65
65
|
}) : !1;
|
|
66
66
|
}
|
|
67
|
-
let
|
|
68
|
-
if (
|
|
69
|
-
if (
|
|
70
|
-
let e =
|
|
71
|
-
return
|
|
67
|
+
let R = a(() => Ae() && !j.value.options?.length), z = a(() => {
|
|
68
|
+
if (R.value) return [];
|
|
69
|
+
if (O.value.length > 0) {
|
|
70
|
+
let e = p(O.value, F.value);
|
|
71
|
+
return j.value.flipOptions ? [...e].reverse() : e;
|
|
72
72
|
}
|
|
73
|
-
return
|
|
73
|
+
return j.value.flipOptions ? [...I.value].reverse().map((e) => e.type === "section" ? {
|
|
74
74
|
...e,
|
|
75
75
|
options: [...e.options].reverse()
|
|
76
|
-
} : e) :
|
|
77
|
-
}),
|
|
78
|
-
let e =
|
|
79
|
-
return
|
|
80
|
-
}),
|
|
76
|
+
} : e) : I.value;
|
|
77
|
+
}), je = a(() => R.value ? L.value : d(z.value)), B = a(() => {
|
|
78
|
+
let e = _.value;
|
|
79
|
+
return P.value ? Array.isArray(e) ? e : [] : !de(e) && e !== "" ? [e] : [];
|
|
80
|
+
}), V = a(() => {
|
|
81
81
|
let e = /* @__PURE__ */ new Map();
|
|
82
|
-
for (let t of [...
|
|
83
|
-
return
|
|
82
|
+
for (let t of [...je.value, ...A.value]) e.set(t.value, t);
|
|
83
|
+
return B.value.map((t) => e.get(t) ?? {
|
|
84
84
|
value: t,
|
|
85
85
|
label: String(t)
|
|
86
86
|
});
|
|
87
|
-
}),
|
|
88
|
-
if (
|
|
89
|
-
let e =
|
|
90
|
-
return
|
|
91
|
-
}),
|
|
92
|
-
if (
|
|
93
|
-
if (!
|
|
94
|
-
let e =
|
|
95
|
-
return he(
|
|
96
|
-
}),
|
|
97
|
-
|
|
87
|
+
}), Me = a(() => B.value.length > 0), Ne = a(() => j.value.clearable !== !1), H = a(() => !!j.value.asyncData), U = a(() => {
|
|
88
|
+
if (H.value || j.value.searchable) return !0;
|
|
89
|
+
let e = j.value.minItemsForSearch ?? 11;
|
|
90
|
+
return Oe.value.length >= e;
|
|
91
|
+
}), W = a(() => w.value && U.value), Pe = a(() => !!j.value.loading || D.value), Fe = a(() => {
|
|
92
|
+
if (R.value) return [];
|
|
93
|
+
if (!W.value || !T.value.trim()) return z.value;
|
|
94
|
+
let e = T.value.trim().toLowerCase();
|
|
95
|
+
return he(z.value, (t) => t.label.toLowerCase().includes(e));
|
|
96
|
+
}), G = a(() => R.value ? L.value : d(Fe.value)), K = re(() => G.value, E, C), Ie = a(() => g.readonly || g.disabled ? !0 : !W.value), Le = a(() => W.value || P.value ? T.value : V.value[0]?.label ?? ""), Re = (e) => {
|
|
97
|
+
we.value = e instanceof HTMLElement ? e : null;
|
|
98
98
|
};
|
|
99
|
-
function
|
|
99
|
+
function ze(e) {
|
|
100
100
|
e.preventDefault();
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
if (
|
|
102
|
+
function Be(e) {
|
|
103
|
+
if (g.disabled || g.readonly) return;
|
|
104
104
|
let t = e.target;
|
|
105
105
|
if (!t.closest("[data-select-clear]") && !(t.closest(".wrapper-start-slot") || t.closest(".wrapper-end-slot"))) {
|
|
106
|
-
if (!
|
|
107
|
-
|
|
106
|
+
if (!w.value) {
|
|
107
|
+
Q();
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
W.value || ($(), v.value?.focus({ preventScroll: !0 }));
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
let
|
|
114
|
-
let
|
|
113
|
+
let Ve = a(() => {
|
|
114
|
+
let e = ye({
|
|
115
115
|
bridgeKeys: te,
|
|
116
|
-
props: fe(
|
|
117
|
-
}).componentProps, r =
|
|
116
|
+
props: fe(Te.value.inheritedAttrs, ["class"])
|
|
117
|
+
}).componentProps, r = e.endIcon ?? (t(x, "end") ? void 0 : "chevronUpDown"), { listbox: ee, ...i } = e.customProps ?? {};
|
|
118
118
|
return {
|
|
119
|
-
...
|
|
119
|
+
...e,
|
|
120
120
|
endIcon: r,
|
|
121
|
-
classes:
|
|
121
|
+
classes: N.value,
|
|
122
122
|
customProps: {
|
|
123
123
|
...i,
|
|
124
|
-
container:
|
|
125
|
-
ref:
|
|
126
|
-
onClick:
|
|
127
|
-
class:
|
|
124
|
+
container: n(i.container, {}, {
|
|
125
|
+
ref: Re,
|
|
126
|
+
onClick: Be,
|
|
127
|
+
class: u({ "cursor-pointer": !g.disabled && !g.readonly && !W.value })
|
|
128
128
|
})
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
|
-
}),
|
|
131
|
+
}), He = a(() => g.customProps?.listbox), q = ne(() => Ve.value, {
|
|
132
132
|
size: "md",
|
|
133
133
|
rounded: "md",
|
|
134
134
|
color: "primary",
|
|
135
135
|
variant: "outline",
|
|
136
136
|
withErrorIcon: !0
|
|
137
137
|
}, {
|
|
138
|
-
likeInput: () =>
|
|
139
|
-
control: () =>
|
|
140
|
-
}),
|
|
141
|
-
!e || !
|
|
138
|
+
likeInput: () => P.value,
|
|
139
|
+
control: () => P.value ? "textarea" : "input"
|
|
140
|
+
}), J = (e) => {
|
|
141
|
+
!e || !P.value || pe(e);
|
|
142
142
|
};
|
|
143
|
-
function J(e) {
|
|
144
|
-
return z.value.some((t) => p(t, e));
|
|
145
|
-
}
|
|
146
143
|
function Y(e) {
|
|
147
|
-
|
|
144
|
+
return B.value.some((t) => h(t, e));
|
|
148
145
|
}
|
|
149
146
|
function X(e) {
|
|
150
|
-
|
|
147
|
+
_.value = e;
|
|
148
|
+
}
|
|
149
|
+
function Z(e) {
|
|
150
|
+
if (P.value) {
|
|
151
151
|
let t = Array.isArray(e) ? e : [];
|
|
152
|
-
|
|
152
|
+
y("update:modelValue", t), y("change", t);
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
155
|
let t = e ?? "";
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
function Z() {
|
|
159
|
-
m.disabled || m.readonly || b.value || (b.value = !0, x.value = "", G.highlightCurrentSelection(J), _("open"), V.value && k.value.asyncData && E?.searchImmediate(""));
|
|
156
|
+
y("update:modelValue", t), y("change", t);
|
|
160
157
|
}
|
|
161
158
|
function Q() {
|
|
162
|
-
|
|
159
|
+
g.disabled || g.readonly || w.value || (w.value = !0, T.value = "", K.highlightCurrentSelection(Y), y("open"), H.value && j.value.asyncData && k?.searchImmediate(""));
|
|
163
160
|
}
|
|
164
|
-
function $(
|
|
161
|
+
function $() {
|
|
162
|
+
k?.cancel(), w.value && (w.value = !1, T.value = "", E.value = -1, y("close"));
|
|
163
|
+
}
|
|
164
|
+
function Ue(e) {
|
|
165
165
|
if (!e.disabled) {
|
|
166
|
-
if (
|
|
167
|
-
let t = [...
|
|
168
|
-
n >= 0 ? (t.splice(n, 1),
|
|
169
|
-
|
|
166
|
+
if (P.value) {
|
|
167
|
+
let t = [...B.value], n = t.findIndex((t) => h(t, e.value));
|
|
168
|
+
n >= 0 ? (t.splice(n, 1), y("deselect", e)) : (t.push(e.value), y("select", e)), X(t), Z(t), T.value = "", E.value = -1, o(() => {
|
|
169
|
+
J(v.value), v.value?.focus({ preventScroll: !0 });
|
|
170
170
|
});
|
|
171
171
|
return;
|
|
172
172
|
}
|
|
173
|
-
|
|
173
|
+
X(e.value), Z(e.value), y("select", e), $();
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
e?.preventDefault(), e?.stopPropagation(),
|
|
176
|
+
function We(e) {
|
|
177
|
+
e?.preventDefault(), e?.stopPropagation(), P.value ? (X([]), Z([])) : (X(null), Z(null)), y("clear"), $();
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
if (t.preventDefault(), t.stopPropagation(), !
|
|
181
|
-
let n =
|
|
182
|
-
|
|
179
|
+
function Ge(e, t) {
|
|
180
|
+
if (t.preventDefault(), t.stopPropagation(), !P.value) return;
|
|
181
|
+
let n = B.value.filter((t) => !h(t, e.value));
|
|
182
|
+
X(n), Z(n), y("deselect", e), o(() => J(v.value));
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
let e =
|
|
186
|
-
e &&
|
|
184
|
+
function Ke() {
|
|
185
|
+
let e = K.getHighlightedOption();
|
|
186
|
+
e && Ue(e);
|
|
187
187
|
}
|
|
188
|
-
function
|
|
189
|
-
|
|
188
|
+
function qe(e) {
|
|
189
|
+
T.value = e.target.value, y("search", T.value), w.value || Q(), K.resetHighlight(), H.value && k?.searchDebounced(T.value);
|
|
190
190
|
}
|
|
191
|
-
function
|
|
192
|
-
if (!(
|
|
191
|
+
function Je(e) {
|
|
192
|
+
if (!(g.disabled || g.readonly)) switch (e.key) {
|
|
193
193
|
case "ArrowDown":
|
|
194
|
-
e.preventDefault(),
|
|
194
|
+
e.preventDefault(), w.value ? K.moveHighlight(1) : Q();
|
|
195
195
|
break;
|
|
196
196
|
case "ArrowUp":
|
|
197
|
-
e.preventDefault(),
|
|
197
|
+
e.preventDefault(), w.value ? K.moveHighlight(-1) : Q();
|
|
198
198
|
break;
|
|
199
199
|
case "Enter":
|
|
200
|
-
e.preventDefault(),
|
|
200
|
+
e.preventDefault(), w.value ? Ke() : Q();
|
|
201
201
|
break;
|
|
202
202
|
case "Escape":
|
|
203
|
-
e.preventDefault(),
|
|
203
|
+
e.preventDefault(), $();
|
|
204
204
|
break;
|
|
205
205
|
case "Home":
|
|
206
|
-
|
|
206
|
+
w.value && (e.preventDefault(), K.highlightFirst());
|
|
207
207
|
break;
|
|
208
208
|
case "End":
|
|
209
|
-
|
|
209
|
+
w.value && (e.preventDefault(), K.highlightLast());
|
|
210
210
|
break;
|
|
211
211
|
case "Backspace":
|
|
212
|
-
if (
|
|
212
|
+
if (P.value && !T.value && V.value.length > 0) {
|
|
213
213
|
e.preventDefault();
|
|
214
|
-
let t =
|
|
215
|
-
t &&
|
|
214
|
+
let t = V.value.at(-1);
|
|
215
|
+
t && Ge(t, e);
|
|
216
216
|
}
|
|
217
217
|
break;
|
|
218
218
|
case "Tab":
|
|
219
|
-
|
|
219
|
+
$();
|
|
220
220
|
break;
|
|
221
221
|
default: break;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
async function
|
|
225
|
-
let t =
|
|
224
|
+
async function Ye(e) {
|
|
225
|
+
let t = j.value.asyncData;
|
|
226
226
|
if (t) {
|
|
227
|
-
|
|
227
|
+
D.value = !0;
|
|
228
228
|
try {
|
|
229
|
-
let { options: n, resolvedSelected: r } = await ve(t, e,
|
|
230
|
-
r.length > 0 && (
|
|
229
|
+
let { options: n, resolvedSelected: r } = await ve(t, e, B.value, (e) => ge(e, F.value));
|
|
230
|
+
r.length > 0 && (A.value = r), O.value = n;
|
|
231
231
|
} finally {
|
|
232
|
-
|
|
232
|
+
D.value = !1;
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
async function
|
|
237
|
-
let e =
|
|
238
|
-
!e?.resolve ||
|
|
236
|
+
async function Xe() {
|
|
237
|
+
let e = j.value.asyncData;
|
|
238
|
+
!e?.resolve || B.value.length === 0 || (A.value = ge(await e.resolve(B.value), F.value));
|
|
239
239
|
}
|
|
240
|
-
let
|
|
241
|
-
let e =
|
|
240
|
+
let Ze = a(() => {
|
|
241
|
+
let e = l(f(be, l(M.value, [
|
|
242
242
|
"Listbox",
|
|
243
243
|
"tokens",
|
|
244
244
|
"color"
|
|
245
|
-
])),
|
|
246
|
-
return
|
|
245
|
+
])), q.merged.value.color ?? "primary");
|
|
246
|
+
return q.invalidated.value ? f(xe, l(M.value, [
|
|
247
247
|
"Listbox",
|
|
248
248
|
"tokens",
|
|
249
249
|
"invalidated"
|
|
250
250
|
])) : e;
|
|
251
|
-
}),
|
|
252
|
-
let e = !
|
|
253
|
-
return
|
|
251
|
+
}), Qe = a(() => Ze.value?.value), $e = a(() => {
|
|
252
|
+
let e = !g.disabled && !g.readonly && !W.value, t = !g.disabled && !g.readonly && W.value && U.value, r = Me.value && !P.value && !W.value;
|
|
253
|
+
return n({
|
|
254
254
|
role: "combobox",
|
|
255
|
-
value:
|
|
256
|
-
"aria-controls":
|
|
257
|
-
"aria-expanded":
|
|
258
|
-
readonly:
|
|
259
|
-
onKeydown:
|
|
260
|
-
placeholder:
|
|
261
|
-
"aria-autocomplete":
|
|
262
|
-
"aria-activedescendant":
|
|
263
|
-
...
|
|
255
|
+
value: Le.value,
|
|
256
|
+
"aria-controls": C,
|
|
257
|
+
"aria-expanded": w.value,
|
|
258
|
+
readonly: Ie.value,
|
|
259
|
+
onKeydown: Je,
|
|
260
|
+
placeholder: j.value.placeholder,
|
|
261
|
+
"aria-autocomplete": U.value ? "list" : void 0,
|
|
262
|
+
"aria-activedescendant": w.value ? K.activeDescendantId.value : void 0,
|
|
263
|
+
...P.value ? {
|
|
264
264
|
rows: 1,
|
|
265
265
|
onInput: (e) => {
|
|
266
|
-
|
|
266
|
+
qe(e), J(e.target);
|
|
267
267
|
}
|
|
268
|
-
} : { onInput:
|
|
269
|
-
},
|
|
270
|
-
"cursor-text":
|
|
268
|
+
} : { onInput: qe }
|
|
269
|
+
}, q.inputBind.value, u({
|
|
270
|
+
"cursor-text": t,
|
|
271
271
|
"cursor-pointer": e,
|
|
272
|
-
"resize-none overflow-hidden":
|
|
273
|
-
[
|
|
272
|
+
"resize-none overflow-hidden": P.value,
|
|
273
|
+
[u(Qe.value, N.value.value) ?? ""]: r
|
|
274
274
|
}));
|
|
275
275
|
});
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
276
|
+
c(() => [
|
|
277
|
+
w.value,
|
|
278
|
+
P.value,
|
|
279
|
+
v.value
|
|
280
280
|
], () => {
|
|
281
|
-
|
|
282
|
-
}, { immediate: !0 }),
|
|
283
|
-
|
|
284
|
-
}, { immediate: !0 }),
|
|
285
|
-
if (
|
|
286
|
-
|
|
281
|
+
J(v.value);
|
|
282
|
+
}, { immediate: !0 }), c(() => _.value, () => {
|
|
283
|
+
Xe();
|
|
284
|
+
}, { immediate: !0 }), c(() => j.value.asyncData, (e) => {
|
|
285
|
+
if (k?.cancel(), O.value = [], Xe(), !e) {
|
|
286
|
+
k = null;
|
|
287
287
|
return;
|
|
288
288
|
}
|
|
289
|
-
|
|
289
|
+
k = me((e) => void Ye(e), _e(e));
|
|
290
290
|
}, { immediate: !0 }), oe(() => {
|
|
291
|
-
|
|
291
|
+
k?.cancel();
|
|
292
292
|
}), se(() => {
|
|
293
|
-
|
|
293
|
+
J(v.value);
|
|
294
294
|
});
|
|
295
|
-
let
|
|
295
|
+
let et = a(() => r(q.merged.value.size)), tt = a(() => n({}, {}, {
|
|
296
296
|
tabindex: 0,
|
|
297
297
|
role: "button",
|
|
298
298
|
"data-select-clear": !0,
|
|
299
|
-
onMousedown:
|
|
300
|
-
class:
|
|
299
|
+
onMousedown: ze,
|
|
300
|
+
class: u({
|
|
301
301
|
"inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm transition-colors duration-150": !0,
|
|
302
|
-
[
|
|
303
|
-
[
|
|
302
|
+
[Ze.value?.clear ?? ""]: !0,
|
|
303
|
+
[N.value.clear ?? ""]: !0
|
|
304
304
|
})
|
|
305
|
-
})),
|
|
306
|
-
listboxId:
|
|
307
|
-
isSelected:
|
|
305
|
+
})), nt = a(() => ({
|
|
306
|
+
listboxId: C,
|
|
307
|
+
isSelected: Y,
|
|
308
308
|
disableAutoFocus: !0,
|
|
309
|
-
loading:
|
|
310
|
-
multiple:
|
|
311
|
-
maxHeight:
|
|
312
|
-
entries:
|
|
313
|
-
options:
|
|
314
|
-
size:
|
|
315
|
-
color:
|
|
316
|
-
labelledBy:
|
|
317
|
-
rounded:
|
|
318
|
-
invalidated:
|
|
319
|
-
highlightedIndex:
|
|
320
|
-
disableMaxHeight:
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
loadingMessage:
|
|
324
|
-
...
|
|
309
|
+
loading: Pe.value,
|
|
310
|
+
multiple: P.value,
|
|
311
|
+
maxHeight: g.maxHeight,
|
|
312
|
+
entries: Fe.value,
|
|
313
|
+
options: G.value,
|
|
314
|
+
size: q.merged.value.size,
|
|
315
|
+
color: q.merged.value.color,
|
|
316
|
+
labelledBy: q.controlId.value,
|
|
317
|
+
rounded: q.merged.value.rounded,
|
|
318
|
+
invalidated: q.invalidated.value,
|
|
319
|
+
highlightedIndex: E.value,
|
|
320
|
+
disableMaxHeight: g.disableMaxHeight === !0,
|
|
321
|
+
hideEmptyMessage: j.value.hideEmptyMessage === !0,
|
|
322
|
+
emptyMessage: j.value.emptyMessage ?? m("No options", S.value),
|
|
323
|
+
loadingMessage: j.value.loadingMessage ?? m("Loading...", S.value),
|
|
324
|
+
...He.value
|
|
325
325
|
}));
|
|
326
|
-
function
|
|
327
|
-
let t =
|
|
328
|
-
t.length === e.length && t.every((t, n) => String(t.value) === String(e[n]?.value)) || (
|
|
326
|
+
function rt(e) {
|
|
327
|
+
let t = L.value;
|
|
328
|
+
t.length === e.length && t.every((t, n) => String(t.value) === String(e[n]?.value)) || (L.value = e);
|
|
329
329
|
}
|
|
330
330
|
return {
|
|
331
|
-
open:
|
|
332
|
-
slots:
|
|
333
|
-
hasValue:
|
|
334
|
-
multiple:
|
|
335
|
-
listboxId:
|
|
336
|
-
formField:
|
|
337
|
-
isLoading:
|
|
338
|
-
clearable:
|
|
339
|
-
clearBind:
|
|
340
|
-
isSelected:
|
|
341
|
-
clearValue:
|
|
342
|
-
removeChip:
|
|
343
|
-
triggerBind:
|
|
344
|
-
selectOption:
|
|
345
|
-
containerRef:
|
|
346
|
-
listboxProps:
|
|
347
|
-
clearIconSize:
|
|
348
|
-
mergedClasses:
|
|
349
|
-
visibleOptions:
|
|
350
|
-
isSearchActive:
|
|
351
|
-
selectedOptions:
|
|
352
|
-
hasComposedList:
|
|
353
|
-
highlightedIndex:
|
|
354
|
-
handleRegisteredOptionsChange:
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
loadingMessage: a(() =>
|
|
331
|
+
open: w,
|
|
332
|
+
slots: x,
|
|
333
|
+
hasValue: Me,
|
|
334
|
+
multiple: P,
|
|
335
|
+
listboxId: C,
|
|
336
|
+
formField: q,
|
|
337
|
+
isLoading: Pe,
|
|
338
|
+
clearable: Ne,
|
|
339
|
+
clearBind: tt,
|
|
340
|
+
isSelected: Y,
|
|
341
|
+
clearValue: We,
|
|
342
|
+
removeChip: Ge,
|
|
343
|
+
triggerBind: $e,
|
|
344
|
+
selectOption: Ue,
|
|
345
|
+
containerRef: we,
|
|
346
|
+
listboxProps: nt,
|
|
347
|
+
clearIconSize: et,
|
|
348
|
+
mergedClasses: N,
|
|
349
|
+
visibleOptions: G,
|
|
350
|
+
isSearchActive: W,
|
|
351
|
+
selectedOptions: V,
|
|
352
|
+
hasComposedList: R,
|
|
353
|
+
highlightedIndex: E,
|
|
354
|
+
handleRegisteredOptionsChange: rt,
|
|
355
|
+
hideEmptyMessage: a(() => j.value.hideEmptyMessage === !0),
|
|
356
|
+
emptyMessage: a(() => j.value.emptyMessage ?? m("No options", S.value)),
|
|
357
|
+
loadingMessage: a(() => j.value.loadingMessage ?? m("Loading...", S.value))
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
360
|
//#endregion
|
|
361
|
-
export {
|
|
361
|
+
export { g as useSelect };
|