@bridge-ui/vue 0.0.1-beta.2 → 0.0.1-beta.4
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/Components/Alert/alert.types.d.ts +1 -1
- package/dist/Components/Alert/alertDefaultIcons.d.ts +1 -1
- package/dist/Components/Alert/alertDefaultIcons.js +1 -1
- package/dist/Components/Alert/composables/useAlert.d.ts +1 -1
- package/dist/Components/Avatar/avatar.types.d.ts +1 -1
- package/dist/Components/Avatar/composables/useAvatar.d.ts +1 -1
- package/dist/Components/Avatar/composables/useAvatar.js +1 -1
- package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +3 -5
- package/dist/Components/Button/button.types.d.ts +1 -1
- package/dist/Components/Button/composables/useButton.js +52 -44
- package/dist/Components/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/Chip/Chip.js +5 -0
- package/dist/Components/Chip/Chip.vue.d.ts +20 -0
- package/dist/Components/Chip/Chip.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/Components/Chip/chip.types.d.ts +93 -0
- package/dist/Components/Chip/composables/useChip.d.ts +22 -0
- package/dist/Components/Chip/composables/useChip.js +66 -0
- package/dist/Components/Chip/index.d.ts +3 -0
- package/dist/Components/Chip/index.js +3 -0
- package/dist/Components/Divider/Divider.js +5 -0
- package/dist/Components/Divider/Divider.vue.d.ts +4 -0
- package/dist/Components/Divider/Divider.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/Components/Divider/composables/useDivider.d.ts +13 -0
- package/dist/Components/Divider/composables/useDivider.js +42 -0
- package/dist/Components/Divider/divider.types.d.ts +31 -0
- package/dist/Components/Divider/index.d.ts +3 -0
- package/dist/Components/Divider/index.js +3 -0
- package/dist/Components/FormField/composables/useFormField.d.ts +1 -1
- package/dist/Components/FormField/composables/useFormField.js +1 -1
- package/dist/Components/FormField/formField.types.d.ts +1 -1
- package/dist/Components/Icon/icon.types.d.ts +1 -1
- package/dist/Components/Link/link.types.d.ts +1 -1
- package/dist/Components/Listbox/Listbox.vue.d.ts +2 -0
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +51 -47
- package/dist/Components/Listbox/composables/useListbox.d.ts +10 -2
- package/dist/Components/Listbox/composables/useListbox.js +43 -28
- package/dist/Components/Listbox/listbox.types.d.ts +28 -3
- package/dist/Components/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/NumberField/composables/useNumberField.d.ts +2 -2
- package/dist/Components/PasswordField/PasswordField.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/PasswordField/composables/usePasswordField.d.ts +2 -2
- package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +69 -89
- package/dist/Components/Select/composables/useSelect.d.ts +27 -3
- package/dist/Components/Select/composables/useSelect.js +162 -140
- package/dist/Components/Select/select.types.d.ts +22 -1
- package/dist/Components/Skeleton/Skeleton.js +5 -0
- package/dist/Components/Skeleton/Skeleton.vue.d.ts +4 -0
- package/dist/Components/Skeleton/Skeleton.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/Components/Skeleton/composables/useSkeleton.d.ts +9 -0
- package/dist/Components/Skeleton/composables/useSkeleton.js +33 -0
- package/dist/Components/Skeleton/index.d.ts +3 -0
- package/dist/Components/Skeleton/index.js +3 -0
- package/dist/Components/Skeleton/skeleton.types.d.ts +24 -0
- package/dist/Components/Snackbar/Snackbar.vue.d.ts +1 -1
- package/dist/Components/Snackbar/Snackbar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/Snackbar/composables/useSnackbar.d.ts +1 -1
- package/dist/Components/Snackbar/snackbar.types.d.ts +1 -1
- package/dist/Components/Snackbar/snackbarDefaultIcons.d.ts +1 -1
- package/dist/Components/Snackbar/snackbarDefaultIcons.js +1 -1
- package/dist/Components/TextField/composables/useTextField.d.ts +2 -2
- package/dist/Components/Textarea/composables/useTextarea.d.ts +2 -2
- package/dist/augments.d.ts +15 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +43 -37
- package/dist/theme.css +14 -0
- package/package.json +4 -4
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { hasNamedSlot as e } from "../../../Utils/slotOrProp.js";
|
|
2
2
|
import { mergePartBind as t, resolveFieldAdornmentIconSize as n, useBridgeUIComponent as r, useBridgeUIMergedRegistryClasses as ee } from "../../../Utils/index.js";
|
|
3
|
-
import { formFieldBridgeKeys as te, useFormField as
|
|
4
|
-
import { useListboxNavigation as
|
|
5
|
-
import { computed as
|
|
6
|
-
import { get as
|
|
7
|
-
import { adjustAutosizeTextareaHeight as
|
|
8
|
-
import { ChevronsUpDown as
|
|
9
|
-
import { colorProps as
|
|
3
|
+
import { formFieldBridgeKeys as te, useFormField as i } from "../../FormField/composables/useFormField.js";
|
|
4
|
+
import { useListboxNavigation as ne } from "../../Listbox/composables/useListboxNavigation.js";
|
|
5
|
+
import { computed as a, nextTick as o, onBeforeUnmount as re, onMounted as ie, ref as s, useAttrs as ae, useId as oe, useSlots as se, watch as c } from "vue";
|
|
6
|
+
import { get as l, isNil as ce, omit as le } from "es-toolkit/compat";
|
|
7
|
+
import { adjustAutosizeTextareaHeight as ue, cn as u, createSelectAsyncSearch as de, mergeBridgeUILayeredClasses as d, normalizeSelectOptions as f, resolveSelectAsyncDebounce as fe, resolveSelectAsyncOptions as pe, selectValuesEqual as p, splitComponentProps as m } from "@bridge-ui/core";
|
|
8
|
+
import { ChevronsUpDown as me } from "@lucide/vue";
|
|
9
|
+
import { colorProps as he, invalidatedProps as ge } from "@bridge-ui/core/Components/Listbox";
|
|
10
10
|
//#region src/Components/Select/composables/useSelect.ts
|
|
11
|
-
var
|
|
11
|
+
var _e = [
|
|
12
12
|
"classes",
|
|
13
13
|
"loading",
|
|
14
14
|
"options",
|
|
@@ -23,146 +23,147 @@ var ve = [
|
|
|
23
23
|
"placeholder",
|
|
24
24
|
"defaultValue",
|
|
25
25
|
"emptyMessage",
|
|
26
|
+
"loadingMessage",
|
|
26
27
|
"disableMaxHeight",
|
|
27
28
|
"hideEmptyMessage",
|
|
28
29
|
"minItemsForSearch",
|
|
29
30
|
"optionDescription"
|
|
30
31
|
];
|
|
31
|
-
function
|
|
32
|
-
let
|
|
33
|
-
bridgeKeys:
|
|
32
|
+
function h(h, g, _, v, y) {
|
|
33
|
+
let ve = ae(), ye = se(), b = oe(), x = s(!1), S = s(""), C = s(-1), be = s(null), w = s(!1), T = s([]), E = null, D = s([]), O = a(() => m({
|
|
34
|
+
bridgeKeys: _e,
|
|
34
35
|
props: {
|
|
35
|
-
...
|
|
36
|
-
...
|
|
36
|
+
...ve,
|
|
37
|
+
...h
|
|
37
38
|
}
|
|
38
|
-
})),
|
|
39
|
+
})), k = a(() => O.value.componentProps), A = a(() => ({ classes: k.value.classes })), { components: j, entry: xe } = r({
|
|
39
40
|
componentName: "Select",
|
|
40
|
-
props: () =>
|
|
41
|
-
}),
|
|
42
|
-
entry:
|
|
43
|
-
props: () =>
|
|
44
|
-
}),
|
|
45
|
-
optionLabel:
|
|
46
|
-
optionValue:
|
|
47
|
-
optionDescription:
|
|
48
|
-
})),
|
|
49
|
-
let e =
|
|
50
|
-
return
|
|
51
|
-
}),
|
|
52
|
-
let e =
|
|
53
|
-
return
|
|
54
|
-
}),
|
|
41
|
+
props: () => A.value
|
|
42
|
+
}), M = ee({
|
|
43
|
+
entry: xe,
|
|
44
|
+
props: () => A.value
|
|
45
|
+
}), N = a(() => !!k.value.multiple), P = a(() => ({
|
|
46
|
+
optionLabel: k.value.optionLabel ?? "label",
|
|
47
|
+
optionValue: k.value.optionValue ?? "value",
|
|
48
|
+
optionDescription: k.value.optionDescription ?? "description"
|
|
49
|
+
})), F = a(() => y.value.length > 0 ? y.value : f(k.value.options, P.value)), I = a(() => {
|
|
50
|
+
let e = T.value.length > 0 ? T.value : F.value;
|
|
51
|
+
return k.value.flipOptions ? [...e].reverse() : e;
|
|
52
|
+
}), L = a(() => {
|
|
53
|
+
let e = g.value;
|
|
54
|
+
return N.value ? Array.isArray(e) ? e : [] : !ce(e) && e !== "" ? [e] : [];
|
|
55
|
+
}), R = a(() => {
|
|
55
56
|
let e = /* @__PURE__ */ new Map();
|
|
56
|
-
for (let t of [...
|
|
57
|
-
return
|
|
57
|
+
for (let t of [...I.value, ...D.value]) e.set(t.value, t);
|
|
58
|
+
return L.value.map((t) => e.get(t) ?? {
|
|
58
59
|
value: t,
|
|
59
60
|
label: String(t)
|
|
60
61
|
});
|
|
61
|
-
}),
|
|
62
|
-
if (
|
|
63
|
-
let e =
|
|
64
|
-
return
|
|
65
|
-
}),
|
|
66
|
-
if (!
|
|
62
|
+
}), z = a(() => L.value.length > 0), Se = a(() => k.value.clearable !== !1), B = a(() => !!k.value.asyncData), V = a(() => {
|
|
63
|
+
if (B.value || k.value.searchable) return !0;
|
|
64
|
+
let e = k.value.minItemsForSearch ?? 11;
|
|
65
|
+
return F.value.length >= e;
|
|
66
|
+
}), H = a(() => x.value && V.value), U = a(() => !!k.value.loading || w.value), W = a(() => {
|
|
67
|
+
if (!H.value || !S.value.trim()) return I.value;
|
|
67
68
|
let e = S.value.trim().toLowerCase();
|
|
68
|
-
return
|
|
69
|
-
}), G =
|
|
70
|
-
|
|
69
|
+
return I.value.filter((t) => t.label.toLowerCase().includes(e));
|
|
70
|
+
}), G = ne(() => W.value, C, b), Ce = a(() => h.readonly || h.disabled ? !0 : !H.value), we = a(() => H.value || N.value ? S.value : R.value[0]?.label ?? ""), Te = (e) => {
|
|
71
|
+
be.value = e instanceof HTMLElement ? e : null;
|
|
71
72
|
};
|
|
72
73
|
function Ee(e) {
|
|
73
74
|
e.preventDefault();
|
|
74
75
|
}
|
|
75
76
|
function De(e) {
|
|
76
|
-
if (
|
|
77
|
+
if (h.disabled || h.readonly) return;
|
|
77
78
|
let t = e.target;
|
|
78
79
|
if (!t.closest("[data-select-clear]") && !(t.closest(".wrapper-start-slot") || t.closest(".wrapper-end-slot"))) {
|
|
79
80
|
if (!x.value) {
|
|
80
81
|
Z();
|
|
81
82
|
return;
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
+
H.value || (Q(), _.value?.focus({ preventScroll: !0 }));
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
|
-
let Oe =
|
|
87
|
-
let n =
|
|
87
|
+
let Oe = a(() => {
|
|
88
|
+
let n = m({
|
|
88
89
|
bridgeKeys: te,
|
|
89
|
-
props:
|
|
90
|
-
}).componentProps, r = n.endIcon ?? (e(
|
|
90
|
+
props: le(O.value.inheritedAttrs, ["class"])
|
|
91
|
+
}).componentProps, r = n.endIcon ?? (e(ye, "end") ? void 0 : me), { listbox: ee, ...i } = n.customProps ?? {};
|
|
91
92
|
return {
|
|
92
93
|
...n,
|
|
93
94
|
endIcon: r,
|
|
94
|
-
classes:
|
|
95
|
+
classes: M.value,
|
|
95
96
|
customProps: {
|
|
96
|
-
...
|
|
97
|
-
container: t(
|
|
97
|
+
...i,
|
|
98
|
+
container: t(i.container, {}, {
|
|
98
99
|
ref: Te,
|
|
99
100
|
onClick: De,
|
|
100
|
-
class:
|
|
101
|
+
class: u({ "cursor-pointer": !h.disabled && !h.readonly && !H.value })
|
|
101
102
|
})
|
|
102
103
|
}
|
|
103
104
|
};
|
|
104
|
-
}), K =
|
|
105
|
+
}), ke = a(() => h.customProps?.listbox), K = i(() => Oe.value, {
|
|
105
106
|
size: "md",
|
|
106
107
|
rounded: "md",
|
|
107
108
|
color: "primary",
|
|
108
109
|
variant: "outline",
|
|
109
110
|
withErrorIcon: !0
|
|
110
111
|
}, {
|
|
111
|
-
likeInput: () =>
|
|
112
|
-
control: () =>
|
|
112
|
+
likeInput: () => N.value,
|
|
113
|
+
control: () => N.value ? "textarea" : "input"
|
|
113
114
|
}), q = (e) => {
|
|
114
|
-
!e || !
|
|
115
|
+
!e || !N.value || ue(e);
|
|
115
116
|
};
|
|
116
117
|
function J(e) {
|
|
117
|
-
return
|
|
118
|
+
return L.value.some((t) => p(t, e));
|
|
118
119
|
}
|
|
119
120
|
function Y(e) {
|
|
120
|
-
|
|
121
|
+
g.value = e;
|
|
121
122
|
}
|
|
122
123
|
function X(e) {
|
|
123
|
-
if (
|
|
124
|
+
if (N.value) {
|
|
124
125
|
let t = Array.isArray(e) ? e : [];
|
|
125
|
-
|
|
126
|
+
v("update:modelValue", t), v("change", t);
|
|
126
127
|
return;
|
|
127
128
|
}
|
|
128
129
|
let t = e ?? "";
|
|
129
|
-
|
|
130
|
+
v("update:modelValue", t), v("change", t);
|
|
130
131
|
}
|
|
131
132
|
function Z() {
|
|
132
|
-
|
|
133
|
+
h.disabled || h.readonly || x.value || (x.value = !0, S.value = "", G.highlightCurrentSelection(J), v("open"), B.value && k.value.asyncData && E?.searchImmediate(""));
|
|
133
134
|
}
|
|
134
135
|
function Q() {
|
|
135
|
-
|
|
136
|
+
E?.cancel(), x.value && (x.value = !1, S.value = "", C.value = -1, v("close"));
|
|
136
137
|
}
|
|
137
|
-
function
|
|
138
|
+
function Ae(e) {
|
|
138
139
|
if (!e.disabled) {
|
|
139
|
-
if (
|
|
140
|
-
let t = [...
|
|
141
|
-
n >= 0 ? (t.splice(n, 1),
|
|
142
|
-
q(
|
|
140
|
+
if (N.value) {
|
|
141
|
+
let t = [...L.value], n = t.findIndex((t) => p(t, e.value));
|
|
142
|
+
n >= 0 ? (t.splice(n, 1), v("deselect", e)) : (t.push(e.value), v("select", e)), Y(t), X(t), S.value = "", C.value = -1, o(() => {
|
|
143
|
+
q(_.value), _.value?.focus({ preventScroll: !0 });
|
|
143
144
|
});
|
|
144
145
|
return;
|
|
145
146
|
}
|
|
146
|
-
Y(e.value), X(e.value),
|
|
147
|
+
Y(e.value), X(e.value), v("select", e), Q();
|
|
147
148
|
}
|
|
148
149
|
}
|
|
149
|
-
function
|
|
150
|
-
e?.preventDefault(), e?.stopPropagation(),
|
|
150
|
+
function je(e) {
|
|
151
|
+
e?.preventDefault(), e?.stopPropagation(), N.value ? (Y([]), X([])) : (Y(null), X(null)), v("clear"), Q();
|
|
151
152
|
}
|
|
152
|
-
function
|
|
153
|
-
if (t.preventDefault(), t.stopPropagation(), !
|
|
154
|
-
let n =
|
|
155
|
-
Y(n), X(n),
|
|
153
|
+
function Me(e, t) {
|
|
154
|
+
if (t.preventDefault(), t.stopPropagation(), !N.value) return;
|
|
155
|
+
let n = L.value.filter((t) => !p(t, e.value));
|
|
156
|
+
Y(n), X(n), v("deselect", e), o(() => q(_.value));
|
|
156
157
|
}
|
|
157
|
-
function
|
|
158
|
+
function Ne() {
|
|
158
159
|
let e = G.getHighlightedOption();
|
|
159
|
-
e &&
|
|
160
|
-
}
|
|
161
|
-
function Ne(e) {
|
|
162
|
-
S.value = e.target.value, _("search", S.value), x.value || Z(), G.resetHighlight(), V.value && D?.searchDebounced(S.value);
|
|
160
|
+
e && Ae(e);
|
|
163
161
|
}
|
|
164
162
|
function Pe(e) {
|
|
165
|
-
|
|
163
|
+
S.value = e.target.value, v("search", S.value), x.value || Z(), G.resetHighlight(), B.value && E?.searchDebounced(S.value);
|
|
164
|
+
}
|
|
165
|
+
function Fe(e) {
|
|
166
|
+
if (!(h.disabled || h.readonly)) switch (e.key) {
|
|
166
167
|
case "ArrowDown":
|
|
167
168
|
e.preventDefault(), x.value ? G.moveHighlight(1) : Z();
|
|
168
169
|
break;
|
|
@@ -170,7 +171,7 @@ function m(m, h, g, _, v) {
|
|
|
170
171
|
e.preventDefault(), x.value ? G.moveHighlight(-1) : Z();
|
|
171
172
|
break;
|
|
172
173
|
case "Enter":
|
|
173
|
-
e.preventDefault(), x.value ?
|
|
174
|
+
e.preventDefault(), x.value ? Ne() : Z();
|
|
174
175
|
break;
|
|
175
176
|
case "Escape":
|
|
176
177
|
e.preventDefault(), Q();
|
|
@@ -182,10 +183,10 @@ function m(m, h, g, _, v) {
|
|
|
182
183
|
x.value && (e.preventDefault(), G.highlightLast());
|
|
183
184
|
break;
|
|
184
185
|
case "Backspace":
|
|
185
|
-
if (
|
|
186
|
+
if (N.value && !S.value && R.value.length > 0) {
|
|
186
187
|
e.preventDefault();
|
|
187
|
-
let t =
|
|
188
|
-
t &&
|
|
188
|
+
let t = R.value.at(-1);
|
|
189
|
+
t && Me(t, e);
|
|
189
190
|
}
|
|
190
191
|
break;
|
|
191
192
|
case "Tab":
|
|
@@ -194,112 +195,133 @@ function m(m, h, g, _, v) {
|
|
|
194
195
|
default: break;
|
|
195
196
|
}
|
|
196
197
|
}
|
|
197
|
-
async function
|
|
198
|
-
let t =
|
|
198
|
+
async function Ie(e) {
|
|
199
|
+
let t = k.value.asyncData;
|
|
199
200
|
if (t) {
|
|
200
|
-
|
|
201
|
+
w.value = !0;
|
|
201
202
|
try {
|
|
202
|
-
let { options: n, resolvedSelected: r } = await
|
|
203
|
-
r.length > 0 && (
|
|
203
|
+
let { options: n, resolvedSelected: r } = await pe(t, e, L.value, (e) => f(e, P.value));
|
|
204
|
+
r.length > 0 && (D.value = r), T.value = n;
|
|
204
205
|
} finally {
|
|
205
|
-
|
|
206
|
+
w.value = !1;
|
|
206
207
|
}
|
|
207
208
|
}
|
|
208
209
|
}
|
|
209
|
-
async function
|
|
210
|
-
let e =
|
|
211
|
-
!e?.resolve ||
|
|
210
|
+
async function Le() {
|
|
211
|
+
let e = k.value.asyncData;
|
|
212
|
+
!e?.resolve || L.value.length === 0 || (D.value = f(await e.resolve(L.value), P.value));
|
|
212
213
|
}
|
|
213
|
-
let $ =
|
|
214
|
-
let e =
|
|
214
|
+
let $ = a(() => {
|
|
215
|
+
let e = l(d(he, l(j.value, [
|
|
215
216
|
"Listbox",
|
|
216
217
|
"customProps",
|
|
217
218
|
"color"
|
|
218
219
|
])), K.merged.value.color ?? "primary");
|
|
219
|
-
return K.invalidated.value ?
|
|
220
|
+
return K.invalidated.value ? d(ge, l(j.value, [
|
|
220
221
|
"Listbox",
|
|
221
222
|
"customProps",
|
|
222
223
|
"invalidated"
|
|
223
224
|
])) : e;
|
|
224
|
-
}),
|
|
225
|
-
let e = !
|
|
225
|
+
}), Re = a(() => $.value?.value), ze = a(() => {
|
|
226
|
+
let e = !h.disabled && !h.readonly && !H.value, n = !h.disabled && !h.readonly && H.value && V.value, r = z.value && !N.value && !H.value;
|
|
226
227
|
return t({
|
|
227
228
|
role: "combobox",
|
|
228
229
|
value: we.value,
|
|
229
230
|
"aria-controls": b,
|
|
230
231
|
"aria-expanded": x.value,
|
|
231
232
|
readonly: Ce.value,
|
|
232
|
-
onKeydown:
|
|
233
|
-
placeholder:
|
|
234
|
-
"aria-autocomplete":
|
|
233
|
+
onKeydown: Fe,
|
|
234
|
+
placeholder: k.value.placeholder,
|
|
235
|
+
"aria-autocomplete": V.value ? "list" : void 0,
|
|
235
236
|
"aria-activedescendant": x.value ? G.activeDescendantId.value : void 0,
|
|
236
|
-
...
|
|
237
|
+
...N.value ? {
|
|
237
238
|
rows: 1,
|
|
238
239
|
onInput: (e) => {
|
|
239
|
-
|
|
240
|
+
Pe(e), q(e.target);
|
|
240
241
|
}
|
|
241
|
-
} : { onInput:
|
|
242
|
-
}, K.inputBind.value,
|
|
242
|
+
} : { onInput: Pe }
|
|
243
|
+
}, K.inputBind.value, u({
|
|
243
244
|
"cursor-text": n,
|
|
244
245
|
"cursor-pointer": e,
|
|
245
|
-
"resize-none overflow-hidden":
|
|
246
|
-
[
|
|
246
|
+
"resize-none overflow-hidden": N.value,
|
|
247
|
+
[u(Re.value, M.value.value) ?? ""]: r
|
|
247
248
|
}));
|
|
248
249
|
});
|
|
249
|
-
|
|
250
|
+
c(() => [
|
|
250
251
|
x.value,
|
|
251
|
-
|
|
252
|
-
|
|
252
|
+
N.value,
|
|
253
|
+
_.value
|
|
253
254
|
], () => {
|
|
254
|
-
q(
|
|
255
|
-
}, { immediate: !0 }),
|
|
256
|
-
|
|
257
|
-
}, { immediate: !0 }),
|
|
258
|
-
if (
|
|
259
|
-
|
|
255
|
+
q(_.value);
|
|
256
|
+
}, { immediate: !0 }), c(() => g.value, () => {
|
|
257
|
+
Le();
|
|
258
|
+
}, { immediate: !0 }), c(() => k.value.asyncData, (e) => {
|
|
259
|
+
if (E?.cancel(), T.value = [], Le(), !e) {
|
|
260
|
+
E = null;
|
|
260
261
|
return;
|
|
261
262
|
}
|
|
262
|
-
|
|
263
|
-
}, { immediate: !0 }),
|
|
264
|
-
|
|
265
|
-
}),
|
|
266
|
-
q(
|
|
263
|
+
E = de((e) => void Ie(e), fe(e));
|
|
264
|
+
}, { immediate: !0 }), re(() => {
|
|
265
|
+
E?.cancel();
|
|
266
|
+
}), ie(() => {
|
|
267
|
+
q(_.value);
|
|
267
268
|
});
|
|
268
|
-
let
|
|
269
|
+
let Be = a(() => n(K.merged.value.size));
|
|
269
270
|
return {
|
|
270
271
|
open: x,
|
|
271
|
-
slots:
|
|
272
|
-
hasValue:
|
|
273
|
-
multiple:
|
|
272
|
+
slots: ye,
|
|
273
|
+
hasValue: z,
|
|
274
|
+
multiple: N,
|
|
274
275
|
listboxId: b,
|
|
275
276
|
formField: K,
|
|
276
|
-
isLoading:
|
|
277
|
-
clearable:
|
|
278
|
-
clearBind:
|
|
277
|
+
isLoading: U,
|
|
278
|
+
clearable: Se,
|
|
279
|
+
clearBind: a(() => t({}, {}, {
|
|
279
280
|
tabindex: 0,
|
|
280
281
|
role: "button",
|
|
281
282
|
"data-select-clear": !0,
|
|
282
283
|
onMousedown: Ee,
|
|
283
|
-
class:
|
|
284
|
+
class: u({
|
|
284
285
|
"inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm transition-colors duration-150": !0,
|
|
285
286
|
[$.value?.clear ?? ""]: !0,
|
|
286
|
-
[
|
|
287
|
+
[M.value.clear ?? ""]: !0
|
|
287
288
|
})
|
|
288
289
|
})),
|
|
289
290
|
isSelected: J,
|
|
290
|
-
clearValue:
|
|
291
|
-
removeChip:
|
|
292
|
-
triggerBind:
|
|
293
|
-
selectOption:
|
|
294
|
-
containerRef:
|
|
295
|
-
|
|
291
|
+
clearValue: je,
|
|
292
|
+
removeChip: Me,
|
|
293
|
+
triggerBind: ze,
|
|
294
|
+
selectOption: Ae,
|
|
295
|
+
containerRef: be,
|
|
296
|
+
listboxProps: a(() => ({
|
|
297
|
+
disableAutoFocus: !0,
|
|
298
|
+
maxHeight: h.maxHeight,
|
|
299
|
+
size: K.merged.value.size,
|
|
300
|
+
color: K.merged.value.color,
|
|
301
|
+
disableMaxHeight: h.disableMaxHeight === !0,
|
|
302
|
+
emptyMessage: k.value.emptyMessage ?? "No options",
|
|
303
|
+
hideEmptyMessage: k.value.hideEmptyMessage === !0,
|
|
304
|
+
loadingMessage: k.value.loadingMessage ?? "Loading...",
|
|
305
|
+
...ke.value,
|
|
306
|
+
listboxId: b,
|
|
307
|
+
isSelected: J,
|
|
308
|
+
loading: U.value,
|
|
309
|
+
multiple: N.value,
|
|
310
|
+
options: W.value,
|
|
311
|
+
labelledBy: K.controlId.value,
|
|
312
|
+
highlightedIndex: C.value,
|
|
313
|
+
invalidated: K.invalidated.value
|
|
314
|
+
})),
|
|
315
|
+
clearIconSize: Be,
|
|
316
|
+
mergedClasses: M,
|
|
296
317
|
visibleOptions: W,
|
|
297
|
-
isSearchActive:
|
|
298
|
-
selectedOptions:
|
|
318
|
+
isSearchActive: H,
|
|
319
|
+
selectedOptions: R,
|
|
299
320
|
highlightedIndex: C,
|
|
300
|
-
emptyMessage:
|
|
301
|
-
hideEmptyMessage:
|
|
321
|
+
emptyMessage: a(() => k.value.emptyMessage ?? "No options"),
|
|
322
|
+
hideEmptyMessage: a(() => k.value.hideEmptyMessage === !0),
|
|
323
|
+
loadingMessage: a(() => k.value.loadingMessage ?? "Loading...")
|
|
302
324
|
};
|
|
303
325
|
}
|
|
304
326
|
//#endregion
|
|
305
|
-
export {
|
|
327
|
+
export { h as useSelect };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { InputHTMLAttributes, Slot, TextareaHTMLAttributes } from 'vue';
|
|
2
2
|
import { MergeHtmlProps, SelectAsyncData, SelectModel, SelectOption, SelectOptionInput, SelectValue } from '@bridge-ui/core';
|
|
3
3
|
import { FormFieldClasses, FormFieldCustomProps, FormFieldOwnProps, FormFieldSlots } from '../FormField/formField.types';
|
|
4
|
+
import { ListboxOwnProps } from '../Listbox/listbox.types';
|
|
4
5
|
export type { SelectAsyncData, SelectModel, SelectOption, SelectOptionInput, SelectOptionLike, SelectValue, } from '@bridge-ui/core';
|
|
5
6
|
export interface SelectClasses extends FormFieldClasses {
|
|
6
7
|
/**
|
|
@@ -24,7 +25,15 @@ export interface SelectClasses extends FormFieldClasses {
|
|
|
24
25
|
*/
|
|
25
26
|
value?: string;
|
|
26
27
|
}
|
|
27
|
-
export interface SelectCustomProps extends FormFieldCustomProps {
|
|
28
|
+
export interface SelectCustomProps extends FormFieldCustomProps {
|
|
29
|
+
/**
|
|
30
|
+
* Props forwarded to the internal `Listbox`.
|
|
31
|
+
* Open state, options, and selection handlers stay owned by `Select`.
|
|
32
|
+
*
|
|
33
|
+
* @default undefined
|
|
34
|
+
*/
|
|
35
|
+
listbox?: Partial<Omit<ListboxOwnProps, "options" | "anchorEl" | "listboxId" | "isSelected" | "highlightedIndex">>;
|
|
36
|
+
}
|
|
28
37
|
export interface SelectEmits {
|
|
29
38
|
/**
|
|
30
39
|
* Emitted when the selection changes.
|
|
@@ -88,6 +97,12 @@ export interface SelectOwnProps extends Omit<FormFieldOwnProps, "field"> {
|
|
|
88
97
|
* @default true
|
|
89
98
|
*/
|
|
90
99
|
clearable?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Extra props for FormField parts and the internal `Listbox`.
|
|
102
|
+
*
|
|
103
|
+
* @default undefined
|
|
104
|
+
*/
|
|
105
|
+
customProps?: SelectCustomProps;
|
|
91
106
|
/**
|
|
92
107
|
* Initial value when uncontrolled.
|
|
93
108
|
*/
|
|
@@ -121,6 +136,12 @@ export interface SelectOwnProps extends Omit<FormFieldOwnProps, "field"> {
|
|
|
121
136
|
* External or async loading state.
|
|
122
137
|
*/
|
|
123
138
|
loading?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Message shown in the dropdown while loading.
|
|
141
|
+
*
|
|
142
|
+
* @default "Loading..."
|
|
143
|
+
*/
|
|
144
|
+
loadingMessage?: string;
|
|
124
145
|
/**
|
|
125
146
|
* Tailwind max-height class for the dropdown options area.
|
|
126
147
|
* Forwarded to the internal `Listbox`.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SkeletonOwnProps } from './skeleton.types';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<SkeletonOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SkeletonOwnProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useSkeleton as e } from "./composables/useSkeleton.js";
|
|
2
|
+
import { createElementBlock as t, defineComponent as n, guardReactiveProps as r, normalizeProps as i, openBlock as a, unref as o } from "vue";
|
|
3
|
+
//#region src/Components/Skeleton/Skeleton.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var s = /* @__PURE__ */ n({
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "Skeleton",
|
|
7
|
+
props: {
|
|
8
|
+
classes: {},
|
|
9
|
+
rounded: {}
|
|
10
|
+
},
|
|
11
|
+
setup(n) {
|
|
12
|
+
let { rootBind: s } = e(n, { rounded: "md" });
|
|
13
|
+
return (e, n) => (a(), t("div", i(r(o(s))), null, 16));
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
//#endregion
|
|
17
|
+
export { s as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core';
|
|
2
|
+
import { SkeletonOwnProps, SkeletonProps } from '../skeleton.types';
|
|
3
|
+
type SkeletonLibDefaults = LibDefaultsShape<SkeletonOwnProps, "rounded">;
|
|
4
|
+
type SkeletonMerged = MergeLibDefaults<SkeletonOwnProps, SkeletonLibDefaults>;
|
|
5
|
+
export declare function useSkeleton(props: SkeletonOwnProps, libDefaults: SkeletonLibDefaults): {
|
|
6
|
+
merged: import('vue').ComputedRef<SkeletonMerged>;
|
|
7
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", {}, Omit<SkeletonProps, "classes" | "rounded">>>;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
|
|
2
|
+
import { computed as r, useAttrs as i } from "vue";
|
|
3
|
+
import { get as a } from "es-toolkit/compat";
|
|
4
|
+
import { cn as o, mergeBridgeUILayeredClasses as s, splitComponentProps as c } from "@bridge-ui/core";
|
|
5
|
+
import { roundedProps as l } from "@bridge-ui/core/Components/Skeleton";
|
|
6
|
+
//#region src/Components/Skeleton/composables/useSkeleton.ts
|
|
7
|
+
var u = ["classes", "rounded"];
|
|
8
|
+
function d(d, f) {
|
|
9
|
+
let p = i(), m = r(() => c({
|
|
10
|
+
props: {
|
|
11
|
+
...p,
|
|
12
|
+
...d
|
|
13
|
+
},
|
|
14
|
+
bridgeKeys: u
|
|
15
|
+
})), { merged: h, entry: g } = t({
|
|
16
|
+
libDefaults: f,
|
|
17
|
+
componentName: "Skeleton",
|
|
18
|
+
props: () => m.value.componentProps
|
|
19
|
+
}), _ = n({
|
|
20
|
+
entry: g,
|
|
21
|
+
props: () => m.value.componentProps
|
|
22
|
+
}), v = r(() => a(s(l, g.value?.customProps?.rounded), h.value.rounded));
|
|
23
|
+
return {
|
|
24
|
+
merged: h,
|
|
25
|
+
rootBind: r(() => e({}, m.value.inheritedAttrs, o({
|
|
26
|
+
"block animate-pulse bg-gray-200 dark:bg-gray-700": !0,
|
|
27
|
+
[v.value ?? ""]: !0,
|
|
28
|
+
[_.value.root ?? ""]: !0
|
|
29
|
+
})))
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { d as useSkeleton };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
import { MergeHtmlProps, MergeProps, SkeletonRounded } from '@bridge-ui/core';
|
|
3
|
+
export interface SkeletonRoundedOverrides {}
|
|
4
|
+
export interface SkeletonClasses {
|
|
5
|
+
/**
|
|
6
|
+
* The classes to apply to the root.
|
|
7
|
+
*/
|
|
8
|
+
root?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SkeletonOwnProps {
|
|
11
|
+
/**
|
|
12
|
+
* The classes to apply to the skeleton.
|
|
13
|
+
*
|
|
14
|
+
* @default undefined
|
|
15
|
+
*/
|
|
16
|
+
classes?: SkeletonClasses;
|
|
17
|
+
/**
|
|
18
|
+
* The roundedness of the skeleton.
|
|
19
|
+
*
|
|
20
|
+
* @default "md"
|
|
21
|
+
*/
|
|
22
|
+
rounded?: MergeProps<SkeletonRounded, SkeletonRoundedOverrides>;
|
|
23
|
+
}
|
|
24
|
+
export type SkeletonProps = MergeHtmlProps<SkeletonOwnProps, HTMLAttributes>;
|
|
@@ -17,10 +17,10 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
|
|
|
17
17
|
"onLeave-complete"?: (() => any) | undefined;
|
|
18
18
|
}>, {
|
|
19
19
|
teleportTo: false | string;
|
|
20
|
+
progressbar: boolean;
|
|
20
21
|
closeButton: boolean;
|
|
21
22
|
duration: false | number;
|
|
22
23
|
position: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').SnackbarPosition, import('./snackbar.types').SnackbarPositionOverrides>;
|
|
23
|
-
progressbar: boolean;
|
|
24
24
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
25
25
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
26
26
|
declare const _default: typeof __VLS_export;
|
|
@@ -2,7 +2,7 @@ import e from "../Icon/Icon.js";
|
|
|
2
2
|
import { useSnackbar as t } from "./composables/useSnackbar.js";
|
|
3
3
|
import { Teleport as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, mergeModels as f, mergeProps as p, normalizeClass as m, normalizeProps as h, openBlock as g, renderSlot as _, toDisplayString as v, unref as y, useModel as b, useSlots as x } from "vue";
|
|
4
4
|
import { cn as S } from "@bridge-ui/core";
|
|
5
|
-
import { X as C } from "lucide
|
|
5
|
+
import { X as C } from "@lucide/vue";
|
|
6
6
|
//#region src/Components/Snackbar/Snackbar.vue?vue&type=script&setup=true&lang.ts
|
|
7
7
|
var w = { class: "w-full max-w-sm pointer-events-auto" }, T = ["src"], E = { class: "flex ml-4 shrink-0" }, D = ["src"], O = { class: "flex ml-4 shrink-0" }, k = /* @__PURE__ */ u({
|
|
8
8
|
inheritAttrs: !1,
|