@bridge-ui/vue 0.0.1-beta.4 → 0.0.1-beta.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/Components/Divider/composables/useDivider.js +1 -1
- package/dist/Components/List/List.vue.d.ts +0 -1
- package/dist/Components/List/List.vue_vue_type_script_setup_true_lang.js +2 -3
- package/dist/Components/List/composables/useList.d.ts +3 -9
- package/dist/Components/List/composables/useList.js +21 -25
- package/dist/Components/List/index.d.ts +1 -1
- package/dist/Components/List/list.types.d.ts +1 -8
- package/dist/Components/ListItem/ListItem.vue.d.ts +0 -1
- package/dist/Components/ListItem/ListItem.vue_vue_type_script_setup_true_lang.js +21 -22
- package/dist/Components/ListItem/composables/useListItem.d.ts +18 -18
- package/dist/Components/ListItem/composables/useListItem.js +100 -68
- package/dist/Components/ListItem/index.d.ts +1 -1
- package/dist/Components/ListItem/listItem.types.d.ts +24 -8
- package/dist/Components/ListSection/composables/useListSection.d.ts +1 -3
- package/dist/Components/ListSection/composables/useListSection.js +6 -5
- package/dist/Components/Listbox/Listbox.vue.d.ts +5 -2
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +101 -62
- package/dist/Components/Listbox/index.d.ts +2 -1
- package/dist/Components/Listbox/index.js +3 -2
- package/dist/Components/Listbox/listbox.types.d.ts +21 -4
- package/dist/Components/Listbox/listboxInjectionKey.d.ts +23 -0
- package/dist/Components/Listbox/listboxInjectionKey.js +4 -0
- package/dist/Components/Menu/Menu.vue.d.ts +2 -2
- package/dist/Components/Menu/composables/useMenu.d.ts +1 -3
- package/dist/Components/Menu/composables/useMenu.js +2 -2
- package/dist/Components/Modal/composables/useModal.d.ts +1 -1
- package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +68 -57
- package/dist/Components/Select/SelectOption.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/Select/composables/useSelect.d.ts +5 -1
- package/dist/Components/Select/composables/useSelect.js +187 -154
- package/dist/Components/Select/select.types.d.ts +12 -5
- package/dist/augments.d.ts +2 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -5
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ListboxOption
|
|
1
|
+
import { ListboxOption } from '@bridge-ui/core';
|
|
2
|
+
import { ListboxOwnProps, ListboxSlots } from './listbox.types';
|
|
2
3
|
type __VLS_Slots = ListboxSlots;
|
|
3
4
|
type __VLS_Props = ListboxOwnProps;
|
|
4
5
|
type __VLS_ModelProps = {
|
|
@@ -9,21 +10,23 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
|
|
|
9
10
|
select: (option: ListboxOption) => any;
|
|
10
11
|
"update:modelValue": (value: boolean) => any;
|
|
11
12
|
"show-change": (show: boolean) => any;
|
|
13
|
+
"registered-options-change": (options: ListboxOption[]) => any;
|
|
12
14
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
13
15
|
onSelect?: ((option: ListboxOption) => any) | undefined;
|
|
14
16
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
15
17
|
"onShow-change"?: ((show: boolean) => any) | undefined;
|
|
18
|
+
"onRegistered-options-change"?: ((options: ListboxOption[]) => any) | undefined;
|
|
16
19
|
}>, {
|
|
17
20
|
color: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').ListboxColor, import('./listbox.types').ListboxColorOverrides>;
|
|
18
21
|
size: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').ListboxSize, import('./listbox.types').ListboxSizeOverrides>;
|
|
19
22
|
loading: boolean;
|
|
20
23
|
multiple: boolean;
|
|
21
24
|
disableAutoFocus: boolean;
|
|
22
|
-
placement: import('@floating-ui/utils').Placement;
|
|
23
25
|
emptyMessage: string;
|
|
24
26
|
hideEmptyMessage: boolean;
|
|
25
27
|
highlightedIndex: number;
|
|
26
28
|
loadingMessage: string;
|
|
29
|
+
placement: import('@floating-ui/utils').Placement;
|
|
27
30
|
showCheckmark: boolean;
|
|
28
31
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
29
32
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { hasNamedSlot as e, resolveNamedSlot as t } from "../../Utils/slotOrProp.js";
|
|
2
2
|
import n from "../List/List.js";
|
|
3
3
|
import { useListbox as r } from "./composables/useListbox.js";
|
|
4
|
-
import i from "
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
4
|
+
import { LISTBOX_INJECTION_KEY as i } from "./listboxInjectionKey.js";
|
|
5
|
+
import ee from "../ListItem/ListItem.js";
|
|
6
|
+
import a from "../ListSection/ListSection.js";
|
|
7
|
+
import te from "../Menu/Menu.js";
|
|
8
|
+
import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createSlots as ne, createVNode as f, defineComponent as p, guardReactiveProps as m, mergeModels as h, mergeProps as g, normalizeClass as re, normalizeProps as _, openBlock as v, provide as ie, ref as y, renderList as b, renderSlot as x, resolveDynamicComponent as S, toDisplayString as C, unref as w, useModel as T, useSlots as E, watch as D, withCtx as O } from "vue";
|
|
9
|
+
import { cn as k, entriesFromListboxOptions as A, flattenListboxOptions as j, mapListboxEntriesToRows as ae } from "@bridge-ui/core";
|
|
10
|
+
import { Check as oe } from "@lucide/vue";
|
|
9
11
|
//#region src/Components/Listbox/Listbox.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
12
|
+
var se = { key: 1 }, M = /* @__PURE__ */ p({
|
|
11
13
|
__name: "Listbox",
|
|
12
|
-
props: /* @__PURE__ */
|
|
14
|
+
props: /* @__PURE__ */ h({
|
|
13
15
|
anchorEl: {},
|
|
14
16
|
classes: {},
|
|
15
17
|
color: { default: "primary" },
|
|
@@ -20,6 +22,7 @@ var M = { key: 1 }, N = /* @__PURE__ */ m({
|
|
|
20
22
|
},
|
|
21
23
|
disableMaxHeight: { type: Boolean },
|
|
22
24
|
emptyMessage: { default: "No options" },
|
|
25
|
+
entries: {},
|
|
23
26
|
hideEmptyMessage: {
|
|
24
27
|
type: Boolean,
|
|
25
28
|
default: !1
|
|
@@ -53,99 +56,135 @@ var M = { key: 1 }, N = /* @__PURE__ */ m({
|
|
|
53
56
|
},
|
|
54
57
|
modelModifiers: {}
|
|
55
58
|
}),
|
|
56
|
-
emits: /* @__PURE__ */
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
emits: /* @__PURE__ */ h([
|
|
60
|
+
"registered-options-change",
|
|
61
|
+
"select",
|
|
62
|
+
"show-change"
|
|
63
|
+
], ["update:modelValue"]),
|
|
64
|
+
setup(p, { emit: h }) {
|
|
65
|
+
let M = E(), N = h, P = T(p, "modelValue");
|
|
66
|
+
D(P, (e) => {
|
|
67
|
+
N("show-change", e);
|
|
61
68
|
});
|
|
62
|
-
let
|
|
69
|
+
let F = p, { merged: I, checkClass: L, scrollBind: R, messageBind: z, loadingBind: B, sizeClasses: V, mergedClasses: H, loadingTrackBind: U, optionSelectedClass: W, optionHighlightedClass: G } = r(F, {
|
|
63
70
|
size: "md",
|
|
64
71
|
color: "primary"
|
|
65
|
-
}), q = s(() => !
|
|
66
|
-
function
|
|
67
|
-
return
|
|
72
|
+
}), ce = s(() => F.options ?? []), K = s(() => F.entries ? F.entries : A(ce.value)), q = s(() => j(K.value)), J = s(() => e(M, "default")), Y = s(() => !F.loading && !J.value && q.value.length === 0 && F.hideEmptyMessage !== !0), X = s(() => k(L.value, H.value.check)), Z = y([]);
|
|
73
|
+
function Q(e) {
|
|
74
|
+
return F.isSelected?.(e) ?? !1;
|
|
68
75
|
}
|
|
69
|
-
function
|
|
70
|
-
return
|
|
76
|
+
function le(e) {
|
|
77
|
+
return F.highlightedIndex === e;
|
|
71
78
|
}
|
|
72
|
-
function
|
|
79
|
+
function ue(e) {
|
|
73
80
|
e.preventDefault();
|
|
74
81
|
}
|
|
75
|
-
function
|
|
82
|
+
function de(e, t) {
|
|
76
83
|
let n = {
|
|
77
84
|
tabindex: -1,
|
|
78
|
-
onMousedown:
|
|
79
|
-
class:
|
|
85
|
+
onMousedown: ue,
|
|
86
|
+
class: k(V.value?.option)
|
|
80
87
|
};
|
|
81
|
-
return
|
|
88
|
+
return Q(e.value) ? n.class = k(n.class, W.value, H.value.optionSelected) : le(t) && (n.class = k(n.class, G.value, H.value.optionHighlighted)), {
|
|
82
89
|
interactive: n,
|
|
83
|
-
primary: { class:
|
|
84
|
-
secondary: { class:
|
|
90
|
+
primary: { class: V.value?.primary },
|
|
91
|
+
secondary: { class: V.value?.secondary }
|
|
85
92
|
};
|
|
86
93
|
}
|
|
87
94
|
function $(e) {
|
|
88
|
-
e.disabled ||
|
|
95
|
+
e.disabled || N("select", e);
|
|
89
96
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
97
|
+
function fe(e) {
|
|
98
|
+
return Z.value.some((t) => String(t.value) === String(e.value)) || (Z.value = [...Z.value, e]), () => {
|
|
99
|
+
Z.value = Z.value.filter((t) => String(t.value) !== String(e.value));
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function pe(e) {
|
|
103
|
+
return (J.value ? Z.value : q.value).findIndex((t) => String(t.value) === String(e));
|
|
104
|
+
}
|
|
105
|
+
D(Z, (e) => {
|
|
106
|
+
J.value && N("registered-options-change", e);
|
|
107
|
+
}, { deep: !0 }), ie(i, s(() => ({
|
|
108
|
+
getOptionIndex: pe,
|
|
109
|
+
registerOption: fe,
|
|
110
|
+
onSelect: $,
|
|
111
|
+
listboxId: F.listboxId,
|
|
112
|
+
isSelected: Q,
|
|
113
|
+
sizeClasses: V.value,
|
|
114
|
+
showCheckmark: F.showCheckmark,
|
|
115
|
+
checkClass: X.value,
|
|
116
|
+
highlightedIndex: F.highlightedIndex,
|
|
117
|
+
optionSelectedClass: W.value,
|
|
118
|
+
optionHighlightedClass: G.value,
|
|
119
|
+
mergedClasses: {
|
|
120
|
+
optionSelected: H.value.optionSelected,
|
|
121
|
+
optionHighlighted: H.value.optionHighlighted
|
|
122
|
+
}
|
|
123
|
+
})));
|
|
124
|
+
let me = s(() => ae(K.value, Q));
|
|
125
|
+
return (r, i) => (v(), c(w(te), {
|
|
126
|
+
modelValue: P.value,
|
|
127
|
+
"onUpdate:modelValue": i[0] ||= (e) => P.value = e,
|
|
128
|
+
"anchor-el": p.anchorEl,
|
|
129
|
+
placement: p.placement,
|
|
95
130
|
"close-on-click-away": !0,
|
|
96
|
-
"disable-auto-focus":
|
|
97
|
-
"custom-props": { content:
|
|
131
|
+
"disable-auto-focus": p.disableAutoFocus,
|
|
132
|
+
"custom-props": { content: w(I).customProps?.content }
|
|
98
133
|
}, {
|
|
99
|
-
default:
|
|
100
|
-
|
|
101
|
-
|
|
134
|
+
default: O(() => [
|
|
135
|
+
w(e)(w(M), "beforeOptions") ? (v(), c(S(w(t)(w(M), "beforeOptions")), { key: 0 })) : l("", !0),
|
|
136
|
+
p.loading ? (v(), u(o, { key: 1 }, [d("div", _(m(w(U))), [d("div", _(m(w(B))), null, 16)], 16), d("div", _(m(w(z))), [w(e)(w(M), "loading") ? (v(), c(S(w(t)(w(M), "loading")), { key: 0 })) : (v(), u("span", se, C(p.loadingMessage), 1))], 16)], 64)) : (v(), u("div", _(g({ key: 2 }, w(R))), [f(w(n), {
|
|
102
137
|
dense: "",
|
|
138
|
+
class: "p-0",
|
|
103
139
|
role: "listbox",
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
"aria-
|
|
107
|
-
"aria-multiselectable": m.multiple || void 0
|
|
140
|
+
id: p.listboxId,
|
|
141
|
+
"aria-labelledby": p.labelledBy,
|
|
142
|
+
"aria-multiselectable": p.multiple || void 0
|
|
108
143
|
}, {
|
|
109
|
-
default:
|
|
144
|
+
default: O(() => [J.value ? x(r.$slots, "default", { key: 0 }) : (v(!0), u(o, { key: 1 }, b(me.value, (t) => (v(), u(o, { key: t.key }, [t.kind === "section" ? (v(), c(w(a), {
|
|
145
|
+
key: 0,
|
|
146
|
+
title: t.title,
|
|
147
|
+
sticky: t.sticky
|
|
148
|
+
}, null, 8, ["title", "sticky"])) : (v(), c(w(ee), {
|
|
149
|
+
key: 1,
|
|
110
150
|
interactive: "",
|
|
111
151
|
role: "option",
|
|
112
152
|
selected: !1,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
"
|
|
120
|
-
|
|
121
|
-
}, f({ _: 2 }, [T(e)(T(N), "option") ? {
|
|
153
|
+
"aria-selected": t.selected,
|
|
154
|
+
disabled: t.option.disabled,
|
|
155
|
+
secondary: t.option.description,
|
|
156
|
+
onClick: (e) => $(t.option),
|
|
157
|
+
id: `${p.listboxId}-option-${t.index}`,
|
|
158
|
+
"custom-props": de(t.option, t.index),
|
|
159
|
+
primary: w(e)(w(M), "option") ? void 0 : t.option.label
|
|
160
|
+
}, ne({ _: 2 }, [w(e)(w(M), "option") ? {
|
|
122
161
|
name: "default",
|
|
123
|
-
fn:
|
|
124
|
-
option: t,
|
|
125
|
-
selected:
|
|
162
|
+
fn: O(() => [x(r.$slots, "option", {
|
|
163
|
+
option: t.option,
|
|
164
|
+
selected: t.selected
|
|
126
165
|
})]),
|
|
127
166
|
key: "0"
|
|
128
|
-
} : void 0,
|
|
167
|
+
} : void 0, p.showCheckmark && t.selected ? {
|
|
129
168
|
name: "end",
|
|
130
|
-
fn:
|
|
169
|
+
fn: O(() => [f(w(oe), { class: re(X.value) }, null, 8, ["class"])]),
|
|
131
170
|
key: "1"
|
|
132
171
|
} : void 0]), 1032, [
|
|
133
|
-
"
|
|
172
|
+
"aria-selected",
|
|
134
173
|
"disabled",
|
|
135
174
|
"secondary",
|
|
136
175
|
"onClick",
|
|
137
176
|
"id",
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
]))), 128))]),
|
|
177
|
+
"custom-props",
|
|
178
|
+
"primary"
|
|
179
|
+
]))], 64))), 128))]),
|
|
141
180
|
_: 3
|
|
142
181
|
}, 8, [
|
|
143
182
|
"id",
|
|
144
183
|
"aria-labelledby",
|
|
145
184
|
"aria-multiselectable"
|
|
146
185
|
])], 16)),
|
|
147
|
-
|
|
148
|
-
|
|
186
|
+
Y.value && !w(e)(w(M), "empty") ? (v(), u("div", _(g({ key: 3 }, w(z))), C(p.emptyMessage), 17)) : Y.value && w(e)(w(M), "empty") ? (v(), c(S(w(t)(w(M), "empty")), { key: 4 })) : l("", !0),
|
|
187
|
+
w(e)(w(M), "afterOptions") ? (v(), c(S(w(t)(w(M), "afterOptions")), { key: 5 })) : l("", !0)
|
|
149
188
|
]),
|
|
150
189
|
_: 3
|
|
151
190
|
}, 8, [
|
|
@@ -158,4 +197,4 @@ var M = { key: 1 }, N = /* @__PURE__ */ m({
|
|
|
158
197
|
}
|
|
159
198
|
});
|
|
160
199
|
//#endregion
|
|
161
|
-
export {
|
|
200
|
+
export { M as default };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { useListbox } from './composables/useListbox';
|
|
2
2
|
export { findFirstEnabledOptionIndex, findLastEnabledOptionIndex, getListboxActiveDescendantId, getListboxOptionId, moveListboxHighlight, useListboxNavigation, } from './composables/useListboxNavigation';
|
|
3
|
-
export type { ListboxClasses, ListboxColorOverrides, ListboxCustomProps, ListboxEmits, ListboxOption, ListboxOwnProps, ListboxProps, ListboxSlots, ListboxValue, } from './listbox.types';
|
|
3
|
+
export type { ListboxClasses, ListboxColorOverrides, ListboxCustomProps, ListboxEmits, ListboxEntry, ListboxOption, ListboxOwnProps, ListboxProps, ListboxSlots, ListboxValue, } from './listbox.types';
|
|
4
4
|
export { default as Listbox } from './Listbox.vue';
|
|
5
|
+
export { LISTBOX_INJECTION_KEY, type ListboxContextValue, } from './listboxInjectionKey';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useListbox as e } from "./composables/useListbox.js";
|
|
2
2
|
import { findFirstEnabledOptionIndex as t, findLastEnabledOptionIndex as n, getListboxActiveDescendantId as r, getListboxOptionId as i, moveListboxHighlight as a, useListboxNavigation as o } from "./composables/useListboxNavigation.js";
|
|
3
|
-
import s from "./
|
|
4
|
-
|
|
3
|
+
import { LISTBOX_INJECTION_KEY as s } from "./listboxInjectionKey.js";
|
|
4
|
+
import c from "./Listbox.js";
|
|
5
|
+
export { s as LISTBOX_INJECTION_KEY, c as Listbox, t as findFirstEnabledOptionIndex, n as findLastEnabledOptionIndex, r as getListboxActiveDescendantId, i as getListboxOptionId, a as moveListboxHighlight, e as useListbox, o as useListboxNavigation };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, Slot } from 'vue';
|
|
2
|
-
import { ListboxColor, ListboxOption, ListboxSize, ListboxValue, MergeHtmlProps, MergeProps, PositionPlacement } from '@bridge-ui/core';
|
|
2
|
+
import { ListboxColor, ListboxEntry, ListboxOption, ListboxSize, ListboxValue, MergeHtmlProps, MergeProps, PositionPlacement } from '@bridge-ui/core';
|
|
3
3
|
export interface ListboxSizeOverrides {}
|
|
4
4
|
export interface ListboxColorOverrides {}
|
|
5
5
|
export interface ListboxClasses {
|
|
@@ -38,8 +38,12 @@ export interface ListboxCustomProps {
|
|
|
38
38
|
*/
|
|
39
39
|
scroll?: HTMLAttributes;
|
|
40
40
|
}
|
|
41
|
-
export type { ListboxOption, ListboxValue } from '@bridge-ui/core';
|
|
41
|
+
export type { ListboxEntry, ListboxOption, ListboxValue, } from '@bridge-ui/core';
|
|
42
42
|
export interface ListboxEmits {
|
|
43
|
+
/**
|
|
44
|
+
* Emitted when composed `ListItem` options register or unregister.
|
|
45
|
+
*/
|
|
46
|
+
"registered-options-change": [options: ListboxOption[]];
|
|
43
47
|
/**
|
|
44
48
|
* Emitted when the user activates an option.
|
|
45
49
|
*/
|
|
@@ -88,6 +92,11 @@ export interface ListboxOwnProps {
|
|
|
88
92
|
* @default "No options"
|
|
89
93
|
*/
|
|
90
94
|
emptyMessage?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Structured entries (sections + options). When set, preferred over a flat
|
|
97
|
+
* `options` map for rendering section headers.
|
|
98
|
+
*/
|
|
99
|
+
entries?: ListboxEntry[];
|
|
91
100
|
/**
|
|
92
101
|
* Hides the empty-state message.
|
|
93
102
|
*
|
|
@@ -144,9 +153,12 @@ export interface ListboxOwnProps {
|
|
|
144
153
|
*/
|
|
145
154
|
multiple?: boolean;
|
|
146
155
|
/**
|
|
147
|
-
* Options to render.
|
|
156
|
+
* Options to render. Used for empty-state and as a flat fallback when
|
|
157
|
+
* `entries` is omitted. Ignored for list body when the default slot is set.
|
|
158
|
+
*
|
|
159
|
+
* @default []
|
|
148
160
|
*/
|
|
149
|
-
options
|
|
161
|
+
options?: ListboxOption[];
|
|
150
162
|
/**
|
|
151
163
|
* Preferred placement of the panel relative to the anchor.
|
|
152
164
|
*
|
|
@@ -175,6 +187,11 @@ export interface ListboxSlots {
|
|
|
175
187
|
* Content above the list.
|
|
176
188
|
*/
|
|
177
189
|
beforeOptions?: Slot;
|
|
190
|
+
/**
|
|
191
|
+
* Composed list content (`ListSection` / `ListItem`). When set, replaces the
|
|
192
|
+
* mapped `options` / `entries` render inside the list.
|
|
193
|
+
*/
|
|
194
|
+
default?: Slot;
|
|
178
195
|
/**
|
|
179
196
|
* Custom empty-state content.
|
|
180
197
|
*/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
import { ListboxOption, ListboxSizeItem, ListboxValue } from '@bridge-ui/core';
|
|
3
|
+
/**
|
|
4
|
+
* Shared listbox state for composed `ListItem` children with `value`.
|
|
5
|
+
*/
|
|
6
|
+
export type ListboxContextValue = {
|
|
7
|
+
checkClass?: string;
|
|
8
|
+
getOptionIndex: (value: ListboxValue) => number;
|
|
9
|
+
highlightedIndex: number;
|
|
10
|
+
isSelected: (value: ListboxValue) => boolean;
|
|
11
|
+
listboxId?: string;
|
|
12
|
+
mergedClasses: {
|
|
13
|
+
optionHighlighted?: string;
|
|
14
|
+
optionSelected?: string;
|
|
15
|
+
};
|
|
16
|
+
onSelect: (option: ListboxOption) => void;
|
|
17
|
+
optionHighlightedClass?: string;
|
|
18
|
+
optionSelectedClass?: string;
|
|
19
|
+
registerOption: (option: ListboxOption) => () => void;
|
|
20
|
+
showCheckmark: boolean;
|
|
21
|
+
sizeClasses?: ListboxSizeItem;
|
|
22
|
+
};
|
|
23
|
+
export declare const LISTBOX_INJECTION_KEY: InjectionKey<ComputedRef<ListboxContextValue>>;
|
|
@@ -16,13 +16,13 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
|
|
|
16
16
|
rounded: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').MenuRounded, import('./menu.types').MenuRoundedOverrides>;
|
|
17
17
|
shadow: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').MenuShadow, import('./menu.types').MenuShadowOverrides>;
|
|
18
18
|
anchorEl: null | HTMLElement;
|
|
19
|
+
disableAutoFocus: boolean;
|
|
20
|
+
placement: import('@floating-ui/utils').Placement;
|
|
19
21
|
closeOnClickAway: boolean;
|
|
20
22
|
closeOnEscape: boolean;
|
|
21
|
-
disableAutoFocus: boolean;
|
|
22
23
|
disableScrollLock: boolean;
|
|
23
24
|
keepMounted: boolean;
|
|
24
25
|
persistent: boolean;
|
|
25
|
-
placement: import('@floating-ui/utils').Placement;
|
|
26
26
|
strategy: import('@bridge-ui/core').PositionStrategy;
|
|
27
27
|
teleportTo: false | string;
|
|
28
28
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -24,9 +24,7 @@ export declare function useMenu(props: MenuOwnProps, libDefaults: MenuLibDefault
|
|
|
24
24
|
merged: import('vue').ComputedRef<MenuMerged>;
|
|
25
25
|
menuId: string;
|
|
26
26
|
mounted: Ref<boolean, boolean>;
|
|
27
|
-
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<
|
|
28
|
-
class: string;
|
|
29
|
-
}, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<MenuProps, "offset" | "classes" | "customProps" | "rounded" | "shadow" | "closeOnClickAway" | "closeOnEscape" | "disableAutoFocus" | "disableScrollLock" | "keepMounted" | "persistent" | "placement" | "strategy" | "teleportTo">, "anchorEl" | "onShowChange">>>;
|
|
27
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<MenuProps, "offset" | "classes" | "customProps" | "rounded" | "shadow" | "disableAutoFocus" | "placement" | "closeOnClickAway" | "closeOnEscape" | "disableScrollLock" | "keepMounted" | "persistent" | "strategy" | "teleportTo">, "anchorEl" | "onShowChange">>>;
|
|
30
28
|
isPortaled: import('vue').ComputedRef<boolean>;
|
|
31
29
|
triggerBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
32
30
|
tabindex: number;
|
|
@@ -139,10 +139,10 @@ function y(y, le, b = {}) {
|
|
|
139
139
|
function $() {
|
|
140
140
|
j?.(), j = null, A?.(), A = null, O?.(), O = null, D?.release(), D = null, E = null, C.value = "", N.value = u, Y();
|
|
141
141
|
}
|
|
142
|
-
let xe = r(() => e(z.value?.root, pe.value,
|
|
142
|
+
let xe = r(() => e(z.value?.root, pe.value, f({
|
|
143
143
|
"relative inline-block text-left": !0,
|
|
144
144
|
[c(B.value, "root") ?? ""]: !0
|
|
145
|
-
})
|
|
145
|
+
}))), Se = r(() => e(z.value?.trigger, {}, {
|
|
146
146
|
tabindex: 0,
|
|
147
147
|
role: "button",
|
|
148
148
|
"aria-expanded": P.value,
|
|
@@ -34,7 +34,7 @@ export declare function useModal(props: ModalOwnProps, libDefaults: ModalLibDefa
|
|
|
34
34
|
};
|
|
35
35
|
"aria-hidden": boolean | undefined;
|
|
36
36
|
class: string;
|
|
37
|
-
}, "class", import('vue').HTMLAttributes | undefined, Omit<ModalProps, "size" | "classes" | "customProps" | "
|
|
37
|
+
}, "class", import('vue').HTMLAttributes | undefined, Omit<ModalProps, "size" | "classes" | "customProps" | "closeOnEscape" | "disableScrollLock" | "keepMounted" | "persistent" | "teleportTo" | "blur" | "scroll" | "align" | "autoFocus" | "closeOnOverlay" | "disableEnforceFocus" | "disableRestoreFocus" | "hideBackdrop" | "stackId" | "transition">>>;
|
|
38
38
|
panelBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
39
39
|
"data-modal-part": string;
|
|
40
40
|
"data-state": "open" | "closed";
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
import { hasNamedSlot as e, resolveNamedSlot as t } from "../../Utils/slotOrProp.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useSelect as
|
|
7
|
-
import { SELECT_OPTION_KEY as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { X as
|
|
2
|
+
import ee from "../Icon/Icon.js";
|
|
3
|
+
import n from "../Chip/Chip.js";
|
|
4
|
+
import r from "../FormField/FormField.js";
|
|
5
|
+
import i from "../Listbox/Listbox.js";
|
|
6
|
+
import { useSelect as a } from "./composables/useSelect.js";
|
|
7
|
+
import { SELECT_OPTION_KEY as o } from "./selectInjectionKey.js";
|
|
8
|
+
import { Fragment as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createSlots as f, createTextVNode as p, createVNode as m, defineComponent as h, guardReactiveProps as g, isRef as _, mergeModels as v, mergeProps as y, normalizeProps as b, openBlock as x, provide as S, ref as C, renderList as w, renderSlot as T, resolveDynamicComponent as E, toDisplayString as D, unref as O, useModel as k, useTemplateRef as A, withCtx as j, withKeys as M, withModifiers as N } from "vue";
|
|
9
|
+
import { X as P } from "@lucide/vue";
|
|
10
10
|
//#region src/Components/Select/Select.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
-
var
|
|
11
|
+
var F = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "flex min-w-0 flex-1 flex-wrap items-center gap-0.5"
|
|
14
|
-
},
|
|
14
|
+
}, I = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "flex min-w-0 flex-1 items-center gap-1"
|
|
17
|
-
},
|
|
17
|
+
}, L = {
|
|
18
|
+
key: 0,
|
|
19
|
+
hidden: "",
|
|
20
|
+
"aria-hidden": "true"
|
|
21
|
+
}, R = /* @__PURE__ */ h({
|
|
18
22
|
inheritAttrs: !1,
|
|
19
23
|
__name: "Select",
|
|
20
|
-
props: /* @__PURE__ */
|
|
24
|
+
props: /* @__PURE__ */ v({
|
|
21
25
|
asyncData: {},
|
|
22
26
|
clearable: {
|
|
23
27
|
type: Boolean,
|
|
@@ -72,7 +76,7 @@ var I = {
|
|
|
72
76
|
modelValue: {},
|
|
73
77
|
modelModifiers: {}
|
|
74
78
|
}),
|
|
75
|
-
emits: /* @__PURE__ */
|
|
79
|
+
emits: /* @__PURE__ */ v([
|
|
76
80
|
"change",
|
|
77
81
|
"clear",
|
|
78
82
|
"close",
|
|
@@ -82,9 +86,9 @@ var I = {
|
|
|
82
86
|
"select",
|
|
83
87
|
"update:modelValue"
|
|
84
88
|
], ["update:modelValue"]),
|
|
85
|
-
setup(
|
|
86
|
-
let R =
|
|
87
|
-
|
|
89
|
+
setup(h, { emit: v }) {
|
|
90
|
+
let R = k(h, "modelValue"), z = h, B = v, V = A("trigger"), H = C([]);
|
|
91
|
+
S(o, {
|
|
88
92
|
unregister(e) {
|
|
89
93
|
H.value = H.value.filter((t) => String(t.value) !== String(e));
|
|
90
94
|
},
|
|
@@ -92,20 +96,20 @@ var I = {
|
|
|
92
96
|
H.value.some((t) => String(t.value) === String(e.value)) || (H.value = [...H.value, e]);
|
|
93
97
|
}
|
|
94
98
|
});
|
|
95
|
-
let { open: U, slots: W, hasValue: G, multiple: K, formField: q, clearable: J, clearBind: Y, clearValue: X, removeChip: Z, triggerBind: Q, selectOption:
|
|
96
|
-
return (
|
|
97
|
-
|
|
98
|
-
default:
|
|
99
|
+
let { open: U, slots: W, hasValue: G, multiple: K, formField: q, clearable: J, clearBind: Y, clearValue: X, removeChip: Z, triggerBind: Q, selectOption: te, containerRef: ne, listboxProps: re, clearIconSize: ie, mergedClasses: ae, selectedOptions: oe, hasComposedList: $, handleRegisteredOptionsChange: se } = a(z, R, V, B, H);
|
|
100
|
+
return (a, o) => (x(), u(s, null, [
|
|
101
|
+
m(O(r), { field: O(q) }, {
|
|
102
|
+
default: j(() => [O(K) ? (x(), u("div", F, [(x(!0), u(s, null, w(O(oe), (e) => (x(), c(O(n), {
|
|
99
103
|
dismissible: "",
|
|
100
104
|
key: String(e.value),
|
|
101
|
-
size:
|
|
102
|
-
"custom-props": { clear:
|
|
103
|
-
disabled:
|
|
105
|
+
size: O(q).merged.value.size,
|
|
106
|
+
"custom-props": { clear: O(Y) },
|
|
107
|
+
disabled: O(q).isDisabled.value,
|
|
104
108
|
"clear-label": `Remove ${e.label}`,
|
|
105
|
-
classes: { root:
|
|
106
|
-
onDismiss: (t) =>
|
|
109
|
+
classes: { root: O(ae).chip },
|
|
110
|
+
onDismiss: (t) => O(Z)(e, t)
|
|
107
111
|
}, {
|
|
108
|
-
default:
|
|
112
|
+
default: j(() => [T(a.$slots, "chip", { option: e }, () => [p(D(e.label), 1)])]),
|
|
109
113
|
_: 2
|
|
110
114
|
}, 1032, [
|
|
111
115
|
"size",
|
|
@@ -114,56 +118,63 @@ var I = {
|
|
|
114
118
|
"clear-label",
|
|
115
119
|
"classes",
|
|
116
120
|
"onDismiss"
|
|
117
|
-
]))), 128)),
|
|
121
|
+
]))), 128)), d("textarea", y({ ref: "trigger" }, O(Q)), null, 16)])) : (x(), u("div", I, [d("input", y({
|
|
118
122
|
ref: "trigger",
|
|
119
123
|
class: "min-w-0 flex-1"
|
|
120
|
-
},
|
|
121
|
-
onClick:
|
|
124
|
+
}, O(Q)), null, 16), O(J) && O(G) && !O(q).isDisabled.value ? (x(), u("span", y({ key: 0 }, O(Y), {
|
|
125
|
+
onClick: o[0] ||= (...e) => O(X) && O(X)(...e),
|
|
122
126
|
"aria-label": "Clear selection",
|
|
123
|
-
onKeydown: [
|
|
124
|
-
}), [
|
|
125
|
-
icon:
|
|
126
|
-
size:
|
|
127
|
-
}, null, 8, ["icon", "size"])], 16)) :
|
|
127
|
+
onKeydown: [o[1] ||= M(N((...e) => O(X) && O(X)(...e), ["prevent"]), ["enter"]), o[2] ||= M(N((...e) => O(X) && O(X)(...e), ["prevent"]), ["space"])]
|
|
128
|
+
}), [m(O(ee), {
|
|
129
|
+
icon: O(P),
|
|
130
|
+
size: O(ie)
|
|
131
|
+
}, null, 8, ["icon", "size"])], 16)) : l("", !0)]))]),
|
|
128
132
|
_: 3
|
|
129
133
|
}, 8, ["field"]),
|
|
130
|
-
|
|
131
|
-
modelValue:
|
|
132
|
-
"onUpdate:modelValue":
|
|
133
|
-
"anchor-el":
|
|
134
|
-
onSelect:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
134
|
+
m(O(i), y(O(re), {
|
|
135
|
+
modelValue: O(U),
|
|
136
|
+
"onUpdate:modelValue": o[3] ||= (e) => _(U) ? U.value = e : null,
|
|
137
|
+
"anchor-el": O(ne),
|
|
138
|
+
onSelect: O(te),
|
|
139
|
+
onRegisteredOptionsChange: O(se)
|
|
140
|
+
}), f({ _: 2 }, [
|
|
141
|
+
O($) ? {
|
|
142
|
+
name: "default",
|
|
143
|
+
fn: j(() => [T(a.$slots, "default")]),
|
|
139
144
|
key: "0"
|
|
140
145
|
} : void 0,
|
|
141
|
-
|
|
142
|
-
name: "
|
|
143
|
-
fn:
|
|
146
|
+
O(e)(O(W), "beforeOptions") ? {
|
|
147
|
+
name: "beforeOptions",
|
|
148
|
+
fn: j(() => [(x(), c(E(O(t)(O(W), "beforeOptions"))))]),
|
|
144
149
|
key: "1"
|
|
145
150
|
} : void 0,
|
|
146
|
-
|
|
147
|
-
name: "
|
|
148
|
-
fn:
|
|
151
|
+
O(e)(O(W), "loading") ? {
|
|
152
|
+
name: "loading",
|
|
153
|
+
fn: j(() => [(x(), c(E(O(t)(O(W), "loading"))))]),
|
|
149
154
|
key: "2"
|
|
150
155
|
} : void 0,
|
|
151
|
-
|
|
152
|
-
name: "
|
|
153
|
-
fn:
|
|
156
|
+
O(e)(O(W), "option") ? {
|
|
157
|
+
name: "option",
|
|
158
|
+
fn: j((e) => [T(a.$slots, "option", b(g(e)))]),
|
|
154
159
|
key: "3"
|
|
155
160
|
} : void 0,
|
|
156
|
-
|
|
157
|
-
name: "
|
|
158
|
-
fn:
|
|
161
|
+
O(e)(O(W), "empty") ? {
|
|
162
|
+
name: "empty",
|
|
163
|
+
fn: j(() => [(x(), c(E(O(t)(O(W), "empty"))))]),
|
|
159
164
|
key: "4"
|
|
165
|
+
} : void 0,
|
|
166
|
+
O(e)(O(W), "afterOptions") ? {
|
|
167
|
+
name: "afterOptions",
|
|
168
|
+
fn: j(() => [(x(), c(E(O(t)(O(W), "afterOptions"))))]),
|
|
169
|
+
key: "5"
|
|
160
170
|
} : void 0
|
|
161
171
|
]), 1040, [
|
|
162
172
|
"modelValue",
|
|
163
173
|
"anchor-el",
|
|
164
|
-
"onSelect"
|
|
174
|
+
"onSelect",
|
|
175
|
+
"onRegisteredOptionsChange"
|
|
165
176
|
]),
|
|
166
|
-
|
|
177
|
+
O($) ? l("", !0) : (x(), u("div", L, [T(a.$slots, "default")]))
|
|
167
178
|
], 64));
|
|
168
179
|
}
|
|
169
180
|
});
|