@bridge-ui/vue 0.0.1-beta.2 → 0.0.1-beta.3
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 +1 -1
- package/dist/Components/Button/button.types.d.ts +1 -1
- 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/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 +53 -49
- package/dist/Components/Listbox/composables/useListbox.d.ts +11 -2
- package/dist/Components/Listbox/composables/useListbox.js +44 -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/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 +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -37
- package/dist/theme.css +14 -0
- package/package.json +4 -4
|
@@ -2,9 +2,10 @@ import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistr
|
|
|
2
2
|
import { computed as r, useAttrs as i } from "vue";
|
|
3
3
|
import { get as a } from "es-toolkit/compat";
|
|
4
4
|
import { cn as o, mergeBridgeUILayeredClasses as s, splitComponentProps as c } from "@bridge-ui/core";
|
|
5
|
-
import { colorProps as l, invalidatedProps as u } from "@bridge-ui/core/Components/Listbox";
|
|
5
|
+
import { colorProps as l, invalidatedProps as u, sizeProps as d } from "@bridge-ui/core/Components/Listbox";
|
|
6
6
|
//#region src/Components/Listbox/composables/useListbox.ts
|
|
7
|
-
var
|
|
7
|
+
var f = [
|
|
8
|
+
"size",
|
|
8
9
|
"color",
|
|
9
10
|
"classes",
|
|
10
11
|
"maxHeight",
|
|
@@ -12,36 +13,51 @@ var d = [
|
|
|
12
13
|
"invalidated",
|
|
13
14
|
"disableMaxHeight"
|
|
14
15
|
];
|
|
15
|
-
function
|
|
16
|
-
let
|
|
16
|
+
function p(p, m) {
|
|
17
|
+
let h = i(), g = r(() => c({
|
|
17
18
|
props: {
|
|
18
|
-
...
|
|
19
|
-
...
|
|
19
|
+
...h,
|
|
20
|
+
...p
|
|
20
21
|
},
|
|
21
|
-
bridgeKeys:
|
|
22
|
-
})), { merged:
|
|
23
|
-
libDefaults:
|
|
22
|
+
bridgeKeys: f
|
|
23
|
+
})), { merged: _, entry: v } = t({
|
|
24
|
+
libDefaults: m,
|
|
24
25
|
componentName: "Listbox",
|
|
25
|
-
props: () =>
|
|
26
|
-
}),
|
|
27
|
-
entry:
|
|
28
|
-
props: () =>
|
|
29
|
-
}),
|
|
26
|
+
props: () => g.value.componentProps
|
|
27
|
+
}), y = n({
|
|
28
|
+
entry: v,
|
|
29
|
+
props: () => g.value.componentProps
|
|
30
|
+
}), b = r(() => a(s(l, v.value?.customProps?.color), _.value.color ?? "primary")), x = r(() => s(u, v.value?.customProps?.invalidated)), S = r(() => _.value.invalidated ? x.value : b.value), C = r(() => a(s(d, v.value?.customProps?.size), _.value.size ?? "md")), w = r(() => S.value?.selected), T = r(() => S.value?.highlighted), E = r(() => o(C.value?.check, S.value?.check)), D = r(() => e(_.value.customProps?.content, {}, o({ relative: !0 }))), O = r(() => {
|
|
31
|
+
let t = _.value.maxHeight ?? "max-h-60", n = _.value.disableMaxHeight === !0;
|
|
32
|
+
return e(_.value.customProps?.scroll, {}, o({
|
|
33
|
+
"overflow-y-auto overscroll-contain": !n,
|
|
34
|
+
[t]: !n,
|
|
35
|
+
[y.value.scroll ?? ""]: !0
|
|
36
|
+
}));
|
|
37
|
+
}), k = r(() => e({}, {
|
|
38
|
+
role: "progressbar",
|
|
39
|
+
"aria-hidden": !0
|
|
40
|
+
}, o({ "h-0.5 w-full shrink-0 overflow-hidden": !0 }))), A = r(() => e(_.value.customProps?.loading, {}, o({
|
|
41
|
+
"h-full w-1/3 animate-bridge-listbox-indeterminate": !0,
|
|
42
|
+
[b.value?.progressColor ?? ""]: !0,
|
|
43
|
+
[y.value.loading ?? ""]: !0
|
|
44
|
+
})));
|
|
30
45
|
return {
|
|
31
|
-
merged:
|
|
32
|
-
checkClass:
|
|
33
|
-
scrollBind:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
mergedClasses:
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
merged: _,
|
|
47
|
+
checkClass: E,
|
|
48
|
+
scrollBind: O,
|
|
49
|
+
contentBind: D,
|
|
50
|
+
messageBind: r(() => e({}, {}, o({
|
|
51
|
+
"text-gray-500": !0,
|
|
52
|
+
[C.value?.message ?? ""]: !0
|
|
53
|
+
}))),
|
|
54
|
+
loadingBind: A,
|
|
55
|
+
sizeClasses: C,
|
|
56
|
+
mergedClasses: y,
|
|
57
|
+
loadingTrackBind: k,
|
|
58
|
+
optionSelectedClass: w,
|
|
59
|
+
optionHighlightedClass: T
|
|
44
60
|
};
|
|
45
61
|
}
|
|
46
62
|
//#endregion
|
|
47
|
-
export {
|
|
63
|
+
export { p as useListbox };
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { HTMLAttributes, Slot } from 'vue';
|
|
2
|
-
import { ListboxColor, ListboxOption, ListboxValue, MergeHtmlProps, MergeProps, PositionPlacement } from '@bridge-ui/core';
|
|
2
|
+
import { ListboxColor, ListboxOption, ListboxSize, ListboxValue, MergeHtmlProps, MergeProps, PositionPlacement } from '@bridge-ui/core';
|
|
3
|
+
export interface ListboxSizeOverrides {}
|
|
3
4
|
export interface ListboxColorOverrides {}
|
|
4
5
|
export interface ListboxClasses {
|
|
5
6
|
/**
|
|
6
7
|
* Classes merged onto the check icon.
|
|
7
8
|
*/
|
|
8
9
|
check?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Classes merged onto the indeterminate loading progress bar.
|
|
12
|
+
*/
|
|
13
|
+
loading?: string;
|
|
9
14
|
/**
|
|
10
15
|
* Classes merged onto keyboard-highlighted options.
|
|
11
16
|
*/
|
|
@@ -24,6 +29,10 @@ export interface ListboxCustomProps {
|
|
|
24
29
|
* Props forwarded to the floating menu panel.
|
|
25
30
|
*/
|
|
26
31
|
content?: HTMLAttributes;
|
|
32
|
+
/**
|
|
33
|
+
* Props forwarded to the indeterminate loading progress bar.
|
|
34
|
+
*/
|
|
35
|
+
loading?: HTMLAttributes;
|
|
27
36
|
/**
|
|
28
37
|
* Props forwarded to the scrollable options container.
|
|
29
38
|
*/
|
|
@@ -110,9 +119,18 @@ export interface ListboxOwnProps {
|
|
|
110
119
|
*/
|
|
111
120
|
listboxId: string;
|
|
112
121
|
/**
|
|
113
|
-
*
|
|
122
|
+
* When `true`, shows an indeterminate progress bar and loading text in the
|
|
123
|
+
* panel (options are hidden while loading).
|
|
124
|
+
*
|
|
125
|
+
* @default false
|
|
114
126
|
*/
|
|
115
127
|
loading?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Message shown while `loading` is true (ignored when the `loading` slot is set).
|
|
130
|
+
*
|
|
131
|
+
* @default "Loading..."
|
|
132
|
+
*/
|
|
133
|
+
loadingMessage?: string;
|
|
116
134
|
/**
|
|
117
135
|
* Tailwind max-height class for the options scroll area (e.g. `max-h-80`).
|
|
118
136
|
*
|
|
@@ -141,6 +159,12 @@ export interface ListboxOwnProps {
|
|
|
141
159
|
* @default true
|
|
142
160
|
*/
|
|
143
161
|
showCheckmark?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Typography and option padding scale, aligned with `FormField` / `Select`.
|
|
164
|
+
*
|
|
165
|
+
* @default "md"
|
|
166
|
+
*/
|
|
167
|
+
size?: MergeProps<ListboxSize, ListboxSizeOverrides>;
|
|
144
168
|
}
|
|
145
169
|
export interface ListboxSlots {
|
|
146
170
|
/**
|
|
@@ -156,7 +180,8 @@ export interface ListboxSlots {
|
|
|
156
180
|
*/
|
|
157
181
|
empty?: Slot;
|
|
158
182
|
/**
|
|
159
|
-
* Custom loading content.
|
|
183
|
+
* Custom loading content. Replaces the default `loadingMessage` when set.
|
|
184
|
+
* The progress bar still renders above this content.
|
|
160
185
|
*/
|
|
161
186
|
loading?: Slot;
|
|
162
187
|
/**
|
|
@@ -5,7 +5,7 @@ import r from "../FormField/FormField.js";
|
|
|
5
5
|
import { useNumberField as i } from "./composables/useNumberField.js";
|
|
6
6
|
import { computed as a, createBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, isRef as u, mergeModels as d, mergeProps as f, normalizeClass as p, openBlock as m, unref as h, useModel as g, vModelDynamic as _, withCtx as v, withDirectives as y } from "vue";
|
|
7
7
|
import { cn as b } from "@bridge-ui/core";
|
|
8
|
-
import { ChevronDown as x, ChevronUp as S } from "lucide
|
|
8
|
+
import { ChevronDown as x, ChevronUp as S } from "@lucide/vue";
|
|
9
9
|
//#region src/Components/NumberField/NumberField.vue?vue&type=script&setup=true&lang.ts
|
|
10
10
|
var C = { class: "bridge-end-adornment flex h-full min-w-9 flex-col gap-px overflow-hidden" }, w = ["disabled"], T = ["disabled"], E = /* @__PURE__ */ l({
|
|
11
11
|
inheritAttrs: !1,
|
|
@@ -17,7 +17,7 @@ export declare function useNumberField(props: NumberFieldOwnProps, model: Ref<nu
|
|
|
17
17
|
size: NonNullable<keyof import('@bridge-ui/core').FormFieldSize | undefined>;
|
|
18
18
|
rounded: NonNullable<keyof import('@bridge-ui/core').FormFieldRounded | undefined>;
|
|
19
19
|
variant: NonNullable<keyof import('@bridge-ui/core').FormFieldVariant | undefined>;
|
|
20
|
-
errorIcon: import('lucide
|
|
20
|
+
errorIcon: import('@lucide/vue').LucideIcon;
|
|
21
21
|
withErrorIcon: NonNullable<boolean | undefined>;
|
|
22
22
|
}>;
|
|
23
23
|
control: import('vue').ComputedRef<string>;
|
|
@@ -213,7 +213,7 @@ export declare function useNumberField(props: NumberFieldOwnProps, model: Ref<nu
|
|
|
213
213
|
}>>;
|
|
214
214
|
controlId: import('vue').ComputedRef<string>;
|
|
215
215
|
errorBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
216
|
-
errorIcon: import('vue').ComputedRef<import('lucide
|
|
216
|
+
errorIcon: import('vue').ComputedRef<import('@lucide/vue').LucideIcon>;
|
|
217
217
|
inputBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", {
|
|
218
218
|
id: string;
|
|
219
219
|
disabled: boolean;
|
|
@@ -4,7 +4,7 @@ import n from "../FormField/FormField.js";
|
|
|
4
4
|
import { usePasswordField as r } from "./composables/usePasswordField.js";
|
|
5
5
|
import { computed as i, createBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, mergeModels as l, mergeProps as u, normalizeClass as d, openBlock as f, unref as p, useModel as m, vModelDynamic as h, withCtx as g, withDirectives as _ } from "vue";
|
|
6
6
|
import { cn as v } from "@bridge-ui/core";
|
|
7
|
-
import { Eye as y, EyeOff as b } from "lucide
|
|
7
|
+
import { Eye as y, EyeOff as b } from "@lucide/vue";
|
|
8
8
|
//#region src/Components/PasswordField/PasswordField.vue?vue&type=script&setup=true&lang.ts
|
|
9
9
|
var x = ["disabled", "aria-label"], S = /* @__PURE__ */ c({
|
|
10
10
|
inheritAttrs: !1,
|
|
@@ -15,7 +15,7 @@ export declare function usePasswordField(props: PasswordFieldOwnProps, options?:
|
|
|
15
15
|
size: NonNullable<keyof import('@bridge-ui/core').FormFieldSize | undefined>;
|
|
16
16
|
rounded: NonNullable<keyof import('@bridge-ui/core').FormFieldRounded | undefined>;
|
|
17
17
|
variant: NonNullable<keyof import('@bridge-ui/core').FormFieldVariant | undefined>;
|
|
18
|
-
errorIcon: import('lucide
|
|
18
|
+
errorIcon: import('@lucide/vue').LucideIcon;
|
|
19
19
|
withErrorIcon: NonNullable<boolean | undefined>;
|
|
20
20
|
}>;
|
|
21
21
|
control: import('vue').ComputedRef<string>;
|
|
@@ -211,7 +211,7 @@ export declare function usePasswordField(props: PasswordFieldOwnProps, options?:
|
|
|
211
211
|
}>>;
|
|
212
212
|
controlId: import('vue').ComputedRef<string>;
|
|
213
213
|
errorBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
214
|
-
errorIcon: import('vue').ComputedRef<import('lucide
|
|
214
|
+
errorIcon: import('vue').ComputedRef<import('@lucide/vue').LucideIcon>;
|
|
215
215
|
inputBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", {
|
|
216
216
|
id: string;
|
|
217
217
|
disabled: boolean;
|
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
import { hasNamedSlot as e, resolveNamedSlot as t } from "../../Utils/slotOrProp.js";
|
|
2
2
|
import n from "../Icon/Icon.js";
|
|
3
|
-
import r from "../
|
|
4
|
-
import i from "../
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import r from "../Chip/Chip.js";
|
|
4
|
+
import i from "../FormField/FormField.js";
|
|
5
|
+
import a from "../Listbox/Listbox.js";
|
|
6
|
+
import { useSelect as o } from "./composables/useSelect.js";
|
|
7
|
+
import { SELECT_OPTION_KEY as s } from "./selectInjectionKey.js";
|
|
8
|
+
import { Fragment as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createSlots as p, createTextVNode as m, createVNode as h, defineComponent as g, guardReactiveProps as _, isRef as v, mergeModels as y, mergeProps as b, normalizeProps as x, openBlock as S, provide as C, ref as w, renderList as T, renderSlot as E, resolveDynamicComponent as D, toDisplayString as O, unref as k, useModel as A, useTemplateRef as j, withCtx as M, withKeys as N, withModifiers as P } from "vue";
|
|
9
|
+
import { X as F } from "@lucide/vue";
|
|
9
10
|
//#region src/Components/Select/Select.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
11
|
+
var I = {
|
|
11
12
|
key: 0,
|
|
12
|
-
class: "flex min-w-0 flex-1 flex-wrap items-center gap-
|
|
13
|
-
},
|
|
14
|
-
"aria-label",
|
|
15
|
-
"onClick",
|
|
16
|
-
"onKeydown"
|
|
17
|
-
], P = {
|
|
13
|
+
class: "flex min-w-0 flex-1 flex-wrap items-center gap-0.5"
|
|
14
|
+
}, L = {
|
|
18
15
|
key: 1,
|
|
19
16
|
class: "flex min-w-0 flex-1 items-center gap-1"
|
|
20
|
-
},
|
|
17
|
+
}, R = /* @__PURE__ */ g({
|
|
21
18
|
inheritAttrs: !1,
|
|
22
19
|
__name: "Select",
|
|
23
|
-
props: /* @__PURE__ */
|
|
20
|
+
props: /* @__PURE__ */ y({
|
|
24
21
|
asyncData: {},
|
|
25
22
|
clearable: {
|
|
26
23
|
type: Boolean,
|
|
27
24
|
default: !0
|
|
28
25
|
},
|
|
26
|
+
customProps: {},
|
|
29
27
|
defaultValue: {},
|
|
30
28
|
disableMaxHeight: { type: Boolean },
|
|
31
29
|
emptyMessage: { default: "No options" },
|
|
32
30
|
flipOptions: { type: Boolean },
|
|
33
31
|
hideEmptyMessage: { type: Boolean },
|
|
34
32
|
loading: { type: Boolean },
|
|
33
|
+
loadingMessage: {},
|
|
35
34
|
maxHeight: {},
|
|
36
35
|
minItemsForSearch: { default: 11 },
|
|
37
36
|
multiple: { type: Boolean },
|
|
@@ -48,7 +47,6 @@ var ne = {
|
|
|
48
47
|
color: {},
|
|
49
48
|
controlId: {},
|
|
50
49
|
corner: {},
|
|
51
|
-
customProps: {},
|
|
52
50
|
description: {},
|
|
53
51
|
disabled: { type: Boolean },
|
|
54
52
|
end: {},
|
|
@@ -74,7 +72,7 @@ var ne = {
|
|
|
74
72
|
modelValue: {},
|
|
75
73
|
modelModifiers: {}
|
|
76
74
|
}),
|
|
77
|
-
emits: /* @__PURE__ */
|
|
75
|
+
emits: /* @__PURE__ */ y([
|
|
78
76
|
"change",
|
|
79
77
|
"clear",
|
|
80
78
|
"close",
|
|
@@ -84,108 +82,90 @@ var ne = {
|
|
|
84
82
|
"select",
|
|
85
83
|
"update:modelValue"
|
|
86
84
|
], ["update:modelValue"]),
|
|
87
|
-
setup(
|
|
88
|
-
let
|
|
89
|
-
|
|
85
|
+
setup(g, { emit: y }) {
|
|
86
|
+
let R = A(g, "modelValue"), z = g, B = y, V = j("trigger"), H = w([]);
|
|
87
|
+
C(s, {
|
|
90
88
|
unregister(e) {
|
|
91
|
-
|
|
89
|
+
H.value = H.value.filter((t) => String(t.value) !== String(e));
|
|
92
90
|
},
|
|
93
91
|
register(e) {
|
|
94
|
-
|
|
92
|
+
H.value.some((t) => String(t.value) === String(e.value)) || (H.value = [...H.value, e]);
|
|
95
93
|
}
|
|
96
94
|
});
|
|
97
|
-
let { open:
|
|
98
|
-
return (
|
|
99
|
-
|
|
100
|
-
default:
|
|
95
|
+
let { open: U, slots: W, hasValue: G, multiple: K, formField: q, clearable: J, clearBind: Y, clearValue: X, removeChip: Z, triggerBind: Q, selectOption: $, containerRef: ee, listboxProps: te, clearIconSize: ne, mergedClasses: re, selectedOptions: ie } = o(z, R, V, B, H);
|
|
96
|
+
return (o, s) => (S(), d(c, null, [
|
|
97
|
+
h(k(i), { field: k(q) }, {
|
|
98
|
+
default: M(() => [k(K) ? (S(), d("div", I, [(S(!0), d(c, null, T(k(ie), (e) => (S(), l(k(r), {
|
|
99
|
+
dismissible: "",
|
|
101
100
|
key: String(e.value),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
101
|
+
size: k(q).merged.value.size,
|
|
102
|
+
"custom-props": { clear: k(Y) },
|
|
103
|
+
disabled: k(q).isDisabled.value,
|
|
104
|
+
"clear-label": `Remove ${e.label}`,
|
|
105
|
+
classes: { root: k(re).chip },
|
|
106
|
+
onDismiss: (t) => k(Z)(e, t)
|
|
107
|
+
}, {
|
|
108
|
+
default: M(() => [E(o.$slots, "chip", { option: e }, () => [m(O(e.label), 1)])]),
|
|
109
|
+
_: 2
|
|
110
|
+
}, 1032, [
|
|
111
|
+
"size",
|
|
112
|
+
"custom-props",
|
|
113
|
+
"disabled",
|
|
114
|
+
"clear-label",
|
|
115
|
+
"classes",
|
|
116
|
+
"onDismiss"
|
|
117
|
+
]))), 128)), f("textarea", b({ ref: "trigger" }, k(Q)), null, 16)])) : (S(), d("div", L, [f("input", b({
|
|
111
118
|
ref: "trigger",
|
|
112
119
|
class: "min-w-0 flex-1"
|
|
113
|
-
},
|
|
114
|
-
onClick:
|
|
120
|
+
}, k(Q)), null, 16), k(J) && k(G) && !k(q).isDisabled.value ? (S(), d("span", b({ key: 0 }, k(Y), {
|
|
121
|
+
onClick: s[0] ||= (...e) => k(X) && k(X)(...e),
|
|
115
122
|
"aria-label": "Clear selection",
|
|
116
|
-
onKeydown: [
|
|
117
|
-
}), [
|
|
118
|
-
icon:
|
|
119
|
-
size:
|
|
120
|
-
}, null, 8, ["icon", "size"])], 16)) :
|
|
123
|
+
onKeydown: [s[1] ||= N(P((...e) => k(X) && k(X)(...e), ["prevent"]), ["enter"]), s[2] ||= N(P((...e) => k(X) && k(X)(...e), ["prevent"]), ["space"])]
|
|
124
|
+
}), [h(k(n), {
|
|
125
|
+
icon: k(F),
|
|
126
|
+
size: k(ne)
|
|
127
|
+
}, null, 8, ["icon", "size"])], 16)) : u("", !0)]))]),
|
|
121
128
|
_: 3
|
|
122
129
|
}, 8, ["field"]),
|
|
123
|
-
|
|
124
|
-
modelValue:
|
|
125
|
-
"onUpdate:modelValue":
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
"
|
|
130
|
-
options: E(oe),
|
|
131
|
-
"is-selected": E(Y),
|
|
132
|
-
onSelect: E(re),
|
|
133
|
-
"disable-auto-focus": !0,
|
|
134
|
-
"empty-message": E(ae),
|
|
135
|
-
"max-height": I.maxHeight,
|
|
136
|
-
color: E(G).merged.value.color,
|
|
137
|
-
"highlighted-index": E(ce),
|
|
138
|
-
"hide-empty-message": E(le),
|
|
139
|
-
"labelled-by": E(G).controlId.value,
|
|
140
|
-
invalidated: E(G).invalidated.value,
|
|
141
|
-
"disable-max-height": I.disableMaxHeight
|
|
142
|
-
}, d({ _: 2 }, [
|
|
143
|
-
E(e)(E(V), "beforeOptions") ? {
|
|
130
|
+
h(k(a), b(k(te), {
|
|
131
|
+
modelValue: k(U),
|
|
132
|
+
"onUpdate:modelValue": s[3] ||= (e) => v(U) ? U.value = e : null,
|
|
133
|
+
"anchor-el": k(ee),
|
|
134
|
+
onSelect: k($)
|
|
135
|
+
}), p({ _: 2 }, [
|
|
136
|
+
k(e)(k(W), "beforeOptions") ? {
|
|
144
137
|
name: "beforeOptions",
|
|
145
|
-
fn:
|
|
138
|
+
fn: M(() => [(S(), l(D(k(t)(k(W), "beforeOptions"))))]),
|
|
146
139
|
key: "0"
|
|
147
140
|
} : void 0,
|
|
148
|
-
|
|
141
|
+
k(e)(k(W), "loading") ? {
|
|
149
142
|
name: "loading",
|
|
150
|
-
fn:
|
|
143
|
+
fn: M(() => [(S(), l(D(k(t)(k(W), "loading"))))]),
|
|
151
144
|
key: "1"
|
|
152
145
|
} : void 0,
|
|
153
|
-
|
|
146
|
+
k(e)(k(W), "option") ? {
|
|
154
147
|
name: "option",
|
|
155
|
-
fn:
|
|
148
|
+
fn: M((e) => [E(o.$slots, "option", x(_(e)))]),
|
|
156
149
|
key: "2"
|
|
157
150
|
} : void 0,
|
|
158
|
-
|
|
151
|
+
k(e)(k(W), "empty") ? {
|
|
159
152
|
name: "empty",
|
|
160
|
-
fn:
|
|
153
|
+
fn: M(() => [(S(), l(D(k(t)(k(W), "empty"))))]),
|
|
161
154
|
key: "3"
|
|
162
155
|
} : void 0,
|
|
163
|
-
|
|
156
|
+
k(e)(k(W), "afterOptions") ? {
|
|
164
157
|
name: "afterOptions",
|
|
165
|
-
fn:
|
|
158
|
+
fn: M(() => [(S(), l(D(k(t)(k(W), "afterOptions"))))]),
|
|
166
159
|
key: "4"
|
|
167
160
|
} : void 0
|
|
168
|
-
]),
|
|
161
|
+
]), 1040, [
|
|
169
162
|
"modelValue",
|
|
170
|
-
"loading",
|
|
171
|
-
"multiple",
|
|
172
|
-
"listbox-id",
|
|
173
163
|
"anchor-el",
|
|
174
|
-
"
|
|
175
|
-
"is-selected",
|
|
176
|
-
"onSelect",
|
|
177
|
-
"empty-message",
|
|
178
|
-
"max-height",
|
|
179
|
-
"color",
|
|
180
|
-
"highlighted-index",
|
|
181
|
-
"hide-empty-message",
|
|
182
|
-
"labelled-by",
|
|
183
|
-
"invalidated",
|
|
184
|
-
"disable-max-height"
|
|
164
|
+
"onSelect"
|
|
185
165
|
]),
|
|
186
|
-
|
|
166
|
+
E(o.$slots, "default")
|
|
187
167
|
], 64));
|
|
188
168
|
}
|
|
189
169
|
});
|
|
190
170
|
//#endregion
|
|
191
|
-
export {
|
|
171
|
+
export { R as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref, SetupContext } from 'vue';
|
|
2
2
|
import { FormFieldOwnProps } from '../../FormField/formField.types';
|
|
3
|
-
import { SelectEmits, SelectOption, SelectOwnProps, SelectValue } from '../select.types';
|
|
3
|
+
import { SelectClasses, SelectEmits, SelectOption, SelectOwnProps, SelectValue } from '../select.types';
|
|
4
4
|
export declare function useSelect(props: SelectOwnProps, model: Ref<null | undefined | SelectValue | SelectValue[]>, triggerRef: Ref<null | HTMLInputElement | HTMLTextAreaElement>, emit: SetupContext<SelectEmits>["emit"], declarativeOptions: Ref<SelectOption[]>): {
|
|
5
5
|
open: Ref<boolean, boolean>;
|
|
6
6
|
slots: Readonly<{
|
|
@@ -18,7 +18,7 @@ export declare function useSelect(props: SelectOwnProps, model: Ref<null | undef
|
|
|
18
18
|
size: NonNullable<keyof import('@bridge-ui/core').FormFieldSize | undefined>;
|
|
19
19
|
rounded: NonNullable<keyof import('@bridge-ui/core').FormFieldRounded | undefined>;
|
|
20
20
|
variant: NonNullable<keyof import('@bridge-ui/core').FormFieldVariant | undefined>;
|
|
21
|
-
errorIcon: import('lucide
|
|
21
|
+
errorIcon: import('@lucide/vue').LucideIcon;
|
|
22
22
|
withErrorIcon: NonNullable<boolean | undefined>;
|
|
23
23
|
}>;
|
|
24
24
|
control: import('vue').ComputedRef<string>;
|
|
@@ -214,7 +214,7 @@ export declare function useSelect(props: SelectOwnProps, model: Ref<null | undef
|
|
|
214
214
|
}>>;
|
|
215
215
|
controlId: import('vue').ComputedRef<string>;
|
|
216
216
|
errorBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
217
|
-
errorIcon: import('vue').ComputedRef<import('lucide
|
|
217
|
+
errorIcon: import('vue').ComputedRef<import('@lucide/vue').LucideIcon>;
|
|
218
218
|
inputBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", {
|
|
219
219
|
id: string;
|
|
220
220
|
disabled: boolean;
|
|
@@ -723,11 +723,35 @@ export declare function useSelect(props: SelectOwnProps, model: Ref<null | undef
|
|
|
723
723
|
}, Partial<Omit<Omit<FormFieldOwnProps, "field">, "color" | "end" | "size" | "classes" | "customProps" | "error" | "rounded" | "variant" | "label" | "disabled" | "endIcon" | "startIcon" | "start" | "description" | "errorMessage" | "readonly" | "required" | "withoutErrorMessage" | "errorIcon" | "withErrorIcon" | "corner">>>>>;
|
|
724
724
|
selectOption: (option: SelectOption) => void;
|
|
725
725
|
containerRef: Ref<HTMLElement | null, HTMLElement | null>;
|
|
726
|
+
listboxProps: import('vue').ComputedRef<{
|
|
727
|
+
listboxId: string;
|
|
728
|
+
isSelected: (value: SelectValue) => boolean;
|
|
729
|
+
loading: boolean;
|
|
730
|
+
multiple: boolean;
|
|
731
|
+
options: import('@bridge-ui/core').ListboxOption[];
|
|
732
|
+
labelledBy: string;
|
|
733
|
+
highlightedIndex: number;
|
|
734
|
+
invalidated: boolean;
|
|
735
|
+
color: "dark" | "error" | "info" | "primary" | "secondary" | "success" | "warning";
|
|
736
|
+
size: "2xl" | "2xs" | "lg" | "md" | "sm" | "xl" | "xs";
|
|
737
|
+
classes?: import('../../Listbox').ListboxClasses;
|
|
738
|
+
customProps?: import('../../Listbox').ListboxCustomProps;
|
|
739
|
+
disableAutoFocus: boolean;
|
|
740
|
+
placement?: import('@floating-ui/utils').Placement;
|
|
741
|
+
disableMaxHeight: boolean;
|
|
742
|
+
emptyMessage: string;
|
|
743
|
+
hideEmptyMessage: boolean;
|
|
744
|
+
loadingMessage: string;
|
|
745
|
+
maxHeight: string;
|
|
746
|
+
showCheckmark?: boolean;
|
|
747
|
+
}>;
|
|
726
748
|
clearIconSize: import('vue').ComputedRef<keyof import('@bridge-ui/core').IconSize>;
|
|
749
|
+
mergedClasses: import('vue').ComputedRef<Partial<SelectClasses>>;
|
|
727
750
|
visibleOptions: import('vue').ComputedRef<import('@bridge-ui/core').ListboxOption[]>;
|
|
728
751
|
isSearchActive: import('vue').ComputedRef<boolean>;
|
|
729
752
|
selectedOptions: import('vue').ComputedRef<import('@bridge-ui/core').ListboxOption[]>;
|
|
730
753
|
highlightedIndex: Ref<number, number>;
|
|
731
754
|
emptyMessage: import('vue').ComputedRef<string>;
|
|
732
755
|
hideEmptyMessage: import('vue').ComputedRef<boolean>;
|
|
756
|
+
loadingMessage: import('vue').ComputedRef<string>;
|
|
733
757
|
};
|