@bridge-ui/vue 0.0.1-beta.5 → 0.0.1-beta.7
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/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 +3 -6
- package/dist/Components/ListItem/composables/useListItem.d.ts +12 -18
- package/dist/Components/ListItem/composables/useListItem.js +97 -75
- package/dist/Components/ListItem/index.d.ts +1 -1
- package/dist/Components/ListItem/listItem.types.d.ts +7 -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 +107 -56
- package/dist/Components/Listbox/composables/useListbox.d.ts +0 -5
- package/dist/Components/Listbox/composables/useListbox.js +10 -19
- 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 +23 -6
- 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 +3 -3
- package/dist/Components/Modal/composables/useModal.d.ts +1 -1
- package/dist/Components/Progress/Progress.js +5 -0
- package/dist/Components/Progress/Progress.vue.d.ts +4 -0
- package/dist/Components/Progress/Progress.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/Components/Progress/composables/useProgress.d.ts +29 -0
- package/dist/Components/Progress/composables/useProgress.js +75 -0
- package/dist/Components/Progress/index.d.ts +3 -0
- package/dist/Components/Progress/index.js +3 -0
- package/dist/Components/Progress/progress.types.d.ts +94 -0
- 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/Components/Spinner/Spinner.js +5 -0
- package/dist/Components/Spinner/Spinner.vue.d.ts +4 -0
- package/dist/Components/Spinner/Spinner.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/Components/Spinner/composables/useSpinner.d.ts +58 -0
- package/dist/Components/Spinner/composables/useSpinner.js +97 -0
- package/dist/Components/Spinner/index.d.ts +3 -0
- package/dist/Components/Spinner/index.js +3 -0
- package/dist/Components/Spinner/spinner.types.d.ts +99 -0
- package/dist/augments.d.ts +12 -3
- package/dist/index.d.ts +6 -2
- package/dist/index.js +32 -28
- package/dist/theme.css +46 -3
- package/package.json +2 -2
|
@@ -1,15 +1,18 @@
|
|
|
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 a from "../
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
4
|
+
import { LISTBOX_INJECTION_KEY as i } from "./listboxInjectionKey.js";
|
|
5
|
+
import a from "../ListItem/ListItem.js";
|
|
6
|
+
import o from "../ListSection/ListSection.js";
|
|
7
|
+
import s from "../Menu/Menu.js";
|
|
8
|
+
import ee from "../Progress/Progress.js";
|
|
9
|
+
import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createSlots as te, createVNode as m, defineComponent as h, guardReactiveProps as g, mergeModels as _, mergeProps as v, normalizeClass as y, normalizeProps as b, openBlock as x, provide as S, ref as C, renderList as ne, renderSlot as w, resolveDynamicComponent as T, toDisplayString as E, unref as D, useModel as O, useSlots as k, watch as A, withCtx as j } from "vue";
|
|
10
|
+
import { cn as M, entriesFromListboxOptions as re, flattenListboxOptions as ie, mapListboxEntriesToRows as ae } from "@bridge-ui/core";
|
|
11
|
+
import { Check as oe } from "@lucide/vue";
|
|
9
12
|
//#region src/Components/Listbox/Listbox.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
13
|
+
var se = { key: 1 }, N = /* @__PURE__ */ h({
|
|
11
14
|
__name: "Listbox",
|
|
12
|
-
props: /* @__PURE__ */
|
|
15
|
+
props: /* @__PURE__ */ _({
|
|
13
16
|
anchorEl: {},
|
|
14
17
|
classes: {},
|
|
15
18
|
color: { default: "primary" },
|
|
@@ -20,6 +23,7 @@ var M = { key: 1 }, N = /* @__PURE__ */ m({
|
|
|
20
23
|
},
|
|
21
24
|
disableMaxHeight: { type: Boolean },
|
|
22
25
|
emptyMessage: { default: "No options" },
|
|
26
|
+
entries: {},
|
|
23
27
|
hideEmptyMessage: {
|
|
24
28
|
type: Boolean,
|
|
25
29
|
default: !1
|
|
@@ -53,99 +57,146 @@ var M = { key: 1 }, N = /* @__PURE__ */ m({
|
|
|
53
57
|
},
|
|
54
58
|
modelModifiers: {}
|
|
55
59
|
}),
|
|
56
|
-
emits: /* @__PURE__ */
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
emits: /* @__PURE__ */ _([
|
|
61
|
+
"registered-options-change",
|
|
62
|
+
"select",
|
|
63
|
+
"show-change"
|
|
64
|
+
], ["update:modelValue"]),
|
|
65
|
+
setup(h, { emit: _ }) {
|
|
66
|
+
let N = k(), P = _, F = O(h, "modelValue");
|
|
67
|
+
A(F, (e) => {
|
|
60
68
|
P("show-change", e);
|
|
61
69
|
});
|
|
62
|
-
let I =
|
|
70
|
+
let I = h, { merged: L, checkClass: R, scrollBind: z, messageBind: B, sizeClasses: V, mergedClasses: H, optionSelectedClass: U, optionHighlightedClass: W } = r(I, {
|
|
63
71
|
size: "md",
|
|
64
72
|
color: "primary"
|
|
65
|
-
}), q =
|
|
66
|
-
function
|
|
73
|
+
}), G = l(() => I.options ?? []), K = l(() => I.entries ? I.entries : re(G.value)), q = l(() => ie(K.value)), J = l(() => e(N, "default")), Y = l(() => !I.loading && !J.value && q.value.length === 0 && I.hideEmptyMessage !== !0), X = l(() => M(R.value, H.value.check)), Z = C([]);
|
|
74
|
+
function Q(e) {
|
|
67
75
|
return I.isSelected?.(e) ?? !1;
|
|
68
76
|
}
|
|
69
|
-
function
|
|
77
|
+
function ce(e) {
|
|
70
78
|
return I.highlightedIndex === e;
|
|
71
79
|
}
|
|
72
|
-
function
|
|
80
|
+
function le(e) {
|
|
73
81
|
e.preventDefault();
|
|
74
82
|
}
|
|
75
|
-
function
|
|
83
|
+
function ue(e, t) {
|
|
76
84
|
let n = {
|
|
77
85
|
tabindex: -1,
|
|
78
|
-
onMousedown:
|
|
79
|
-
class:
|
|
86
|
+
onMousedown: le,
|
|
87
|
+
class: M(V.value?.option)
|
|
80
88
|
};
|
|
81
|
-
return
|
|
89
|
+
return Q(e.value) ? n.class = M(n.class, U.value, H.value.optionSelected) : ce(t) && (n.class = M(n.class, W.value, H.value.optionHighlighted)), {
|
|
82
90
|
interactive: n,
|
|
83
|
-
primary: { class:
|
|
84
|
-
secondary: { class:
|
|
91
|
+
primary: { class: V.value?.primary },
|
|
92
|
+
secondary: { class: V.value?.secondary }
|
|
85
93
|
};
|
|
86
94
|
}
|
|
87
95
|
function $(e) {
|
|
88
96
|
e.disabled || P("select", e);
|
|
89
97
|
}
|
|
90
|
-
|
|
98
|
+
function de(e) {
|
|
99
|
+
return Z.value.some((t) => String(t.value) === String(e.value)) || (Z.value = [...Z.value, e]), () => {
|
|
100
|
+
Z.value = Z.value.filter((t) => String(t.value) !== String(e.value));
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function fe(e) {
|
|
104
|
+
return (J.value ? Z.value : q.value).findIndex((t) => String(t.value) === String(e));
|
|
105
|
+
}
|
|
106
|
+
A(Z, (e) => {
|
|
107
|
+
J.value && P("registered-options-change", e);
|
|
108
|
+
}, { deep: !0 }), S(i, l(() => ({
|
|
109
|
+
getOptionIndex: fe,
|
|
110
|
+
registerOption: de,
|
|
111
|
+
onSelect: $,
|
|
112
|
+
listboxId: I.listboxId,
|
|
113
|
+
isSelected: Q,
|
|
114
|
+
sizeClasses: V.value,
|
|
115
|
+
showCheckmark: I.showCheckmark,
|
|
116
|
+
checkClass: X.value,
|
|
117
|
+
highlightedIndex: I.highlightedIndex,
|
|
118
|
+
optionSelectedClass: U.value,
|
|
119
|
+
optionHighlightedClass: W.value,
|
|
120
|
+
mergedClasses: {
|
|
121
|
+
optionSelected: H.value.optionSelected,
|
|
122
|
+
optionHighlighted: H.value.optionHighlighted
|
|
123
|
+
}
|
|
124
|
+
})));
|
|
125
|
+
let pe = l(() => ae(K.value, Q));
|
|
126
|
+
return (r, i) => (x(), u(D(s), {
|
|
91
127
|
modelValue: F.value,
|
|
92
|
-
"onUpdate:modelValue":
|
|
93
|
-
"anchor-el":
|
|
94
|
-
placement:
|
|
128
|
+
"onUpdate:modelValue": i[0] ||= (e) => F.value = e,
|
|
129
|
+
"anchor-el": h.anchorEl,
|
|
130
|
+
placement: h.placement,
|
|
95
131
|
"close-on-click-away": !0,
|
|
96
|
-
"disable-auto-focus":
|
|
97
|
-
"custom-props": { content:
|
|
132
|
+
"disable-auto-focus": h.disableAutoFocus,
|
|
133
|
+
"custom-props": { content: D(L).customProps?.content }
|
|
98
134
|
}, {
|
|
99
|
-
default:
|
|
100
|
-
|
|
101
|
-
|
|
135
|
+
default: j(() => [
|
|
136
|
+
D(e)(D(N), "beforeOptions") ? (x(), u(T(D(t)(D(N), "beforeOptions")), { key: 0 })) : d("", !0),
|
|
137
|
+
h.loading ? (x(), f(c, { key: 1 }, [m(D(ee), {
|
|
138
|
+
size: "xs",
|
|
139
|
+
"aria-hidden": "",
|
|
140
|
+
class: "shrink-0",
|
|
141
|
+
color: D(L).color,
|
|
142
|
+
classes: { bar: D(H).loading },
|
|
143
|
+
"custom-props": { bar: D(L).customProps?.loading }
|
|
144
|
+
}, null, 8, [
|
|
145
|
+
"color",
|
|
146
|
+
"classes",
|
|
147
|
+
"custom-props"
|
|
148
|
+
]), p("div", b(g(D(B))), [D(e)(D(N), "loading") ? (x(), u(T(D(t)(D(N), "loading")), { key: 0 })) : (x(), f("span", se, E(h.loadingMessage), 1))], 16)], 64)) : (x(), f("div", b(v({ key: 2 }, D(z))), [m(D(n), {
|
|
102
149
|
dense: "",
|
|
150
|
+
class: "p-0",
|
|
103
151
|
role: "listbox",
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
"aria-
|
|
107
|
-
"aria-multiselectable": m.multiple || void 0
|
|
152
|
+
id: h.listboxId,
|
|
153
|
+
"aria-labelledby": h.labelledBy,
|
|
154
|
+
"aria-multiselectable": h.multiple || void 0
|
|
108
155
|
}, {
|
|
109
|
-
default:
|
|
156
|
+
default: j(() => [J.value ? w(r.$slots, "default", { key: 0 }) : (x(!0), f(c, { key: 1 }, ne(pe.value, (t) => (x(), f(c, { key: t.key }, [t.kind === "section" ? (x(), u(D(o), {
|
|
157
|
+
key: 0,
|
|
158
|
+
title: t.title,
|
|
159
|
+
sticky: t.sticky
|
|
160
|
+
}, null, 8, ["title", "sticky"])) : (x(), u(D(a), {
|
|
161
|
+
key: 1,
|
|
110
162
|
interactive: "",
|
|
111
163
|
role: "option",
|
|
112
164
|
selected: !1,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
"
|
|
120
|
-
|
|
121
|
-
}, f({ _: 2 }, [T(e)(T(N), "option") ? {
|
|
165
|
+
"aria-selected": t.selected,
|
|
166
|
+
disabled: t.option.disabled,
|
|
167
|
+
secondary: t.option.description,
|
|
168
|
+
onClick: (e) => $(t.option),
|
|
169
|
+
id: `${h.listboxId}-option-${t.index}`,
|
|
170
|
+
"custom-props": ue(t.option, t.index),
|
|
171
|
+
primary: D(e)(D(N), "option") ? void 0 : t.option.label
|
|
172
|
+
}, te({ _: 2 }, [D(e)(D(N), "option") ? {
|
|
122
173
|
name: "default",
|
|
123
|
-
fn:
|
|
124
|
-
option: t,
|
|
125
|
-
selected:
|
|
174
|
+
fn: j(() => [w(r.$slots, "option", {
|
|
175
|
+
option: t.option,
|
|
176
|
+
selected: t.selected
|
|
126
177
|
})]),
|
|
127
178
|
key: "0"
|
|
128
|
-
} : void 0,
|
|
179
|
+
} : void 0, h.showCheckmark && t.selected ? {
|
|
129
180
|
name: "end",
|
|
130
|
-
fn:
|
|
181
|
+
fn: j(() => [m(D(oe), { class: y(X.value) }, null, 8, ["class"])]),
|
|
131
182
|
key: "1"
|
|
132
183
|
} : void 0]), 1032, [
|
|
133
|
-
"
|
|
184
|
+
"aria-selected",
|
|
134
185
|
"disabled",
|
|
135
186
|
"secondary",
|
|
136
187
|
"onClick",
|
|
137
188
|
"id",
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
]))), 128))]),
|
|
189
|
+
"custom-props",
|
|
190
|
+
"primary"
|
|
191
|
+
]))], 64))), 128))]),
|
|
141
192
|
_: 3
|
|
142
193
|
}, 8, [
|
|
143
194
|
"id",
|
|
144
195
|
"aria-labelledby",
|
|
145
196
|
"aria-multiselectable"
|
|
146
197
|
])], 16)),
|
|
147
|
-
|
|
148
|
-
|
|
198
|
+
Y.value && !D(e)(D(N), "empty") ? (x(), f("div", b(v({ key: 3 }, D(B))), E(h.emptyMessage), 17)) : Y.value && D(e)(D(N), "empty") ? (x(), u(T(D(t)(D(N), "empty")), { key: 4 })) : d("", !0),
|
|
199
|
+
D(e)(D(N), "afterOptions") ? (x(), u(T(D(t)(D(N), "afterOptions")), { key: 5 })) : d("", !0)
|
|
149
200
|
]),
|
|
150
201
|
_: 3
|
|
151
202
|
}, 8, [
|
|
@@ -8,13 +8,8 @@ export declare function useListbox(props: ListboxOwnProps, libDefaults: ListboxL
|
|
|
8
8
|
checkClass: import('vue').ComputedRef<string>;
|
|
9
9
|
scrollBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
10
10
|
messageBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", {}, {}>>;
|
|
11
|
-
loadingBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
12
11
|
sizeClasses: import('vue').ComputedRef<import('@bridge-ui/core').ListboxSizeItem | undefined>;
|
|
13
12
|
mergedClasses: import('vue').ComputedRef<Partial<ListboxClasses>>;
|
|
14
|
-
loadingTrackBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", {}, {
|
|
15
|
-
role: string;
|
|
16
|
-
"aria-hidden": boolean;
|
|
17
|
-
}>>;
|
|
18
13
|
optionSelectedClass: import('vue').ComputedRef<string | undefined>;
|
|
19
14
|
optionHighlightedClass: import('vue').ComputedRef<string | undefined>;
|
|
20
15
|
};
|
|
@@ -27,33 +27,24 @@ function p(p, m) {
|
|
|
27
27
|
}), y = n({
|
|
28
28
|
entry: v,
|
|
29
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)
|
|
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
|
-
}), O = r(() => e({}, {
|
|
38
|
-
role: "progressbar",
|
|
39
|
-
"aria-hidden": !0
|
|
40
|
-
}, o({ "h-0.5 w-full shrink-0 overflow-hidden": !0 }))), k = 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
|
+
}), 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);
|
|
45
31
|
return {
|
|
46
32
|
merged: _,
|
|
47
|
-
checkClass:
|
|
48
|
-
scrollBind:
|
|
33
|
+
checkClass: r(() => o(C.value?.check, S.value?.check)),
|
|
34
|
+
scrollBind: r(() => {
|
|
35
|
+
let t = _.value.maxHeight ?? "max-h-60", n = _.value.disableMaxHeight === !0;
|
|
36
|
+
return e(_.value.customProps?.scroll, {}, o({
|
|
37
|
+
"overflow-y-auto overscroll-contain": !n,
|
|
38
|
+
[t]: !n,
|
|
39
|
+
[y.value.scroll ?? ""]: !0
|
|
40
|
+
}));
|
|
41
|
+
}),
|
|
49
42
|
messageBind: r(() => e({}, {}, o({
|
|
50
43
|
"text-gray-500": !0,
|
|
51
44
|
[C.value?.message ?? ""]: !0
|
|
52
45
|
}))),
|
|
53
|
-
loadingBind: k,
|
|
54
46
|
sizeClasses: C,
|
|
55
47
|
mergedClasses: y,
|
|
56
|
-
loadingTrackBind: O,
|
|
57
48
|
optionSelectedClass: w,
|
|
58
49
|
optionHighlightedClass: T
|
|
59
50
|
};
|
|
@@ -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 {
|
|
@@ -8,7 +8,7 @@ export interface ListboxClasses {
|
|
|
8
8
|
*/
|
|
9
9
|
check?: string;
|
|
10
10
|
/**
|
|
11
|
-
* Classes
|
|
11
|
+
* Classes forwarded to the loading `Progress` bar.
|
|
12
12
|
*/
|
|
13
13
|
loading?: string;
|
|
14
14
|
/**
|
|
@@ -30,7 +30,7 @@ export interface ListboxCustomProps {
|
|
|
30
30
|
*/
|
|
31
31
|
content?: HTMLAttributes;
|
|
32
32
|
/**
|
|
33
|
-
* Props forwarded to the
|
|
33
|
+
* Props forwarded to the loading `Progress` bar.
|
|
34
34
|
*/
|
|
35
35
|
loading?: HTMLAttributes;
|
|
36
36
|
/**
|
|
@@ -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,
|
|
@@ -161,7 +161,7 @@ function y(y, le, b = {}) {
|
|
|
161
161
|
style: { zIndex: N.value },
|
|
162
162
|
"aria-hidden": V.value ? !0 : void 0,
|
|
163
163
|
class: f({
|
|
164
|
-
"bg-white ring-1 ring-black/5 outline-hidden overflow-hidden min-w-32 w-max max-w-[calc(100vw-16px)]": !0,
|
|
164
|
+
"bg-white text-dark-900 dark:bg-dark-800 dark:text-dark-100 ring-1 ring-black/5 dark:ring-white/10 outline-hidden overflow-hidden min-w-32 w-max max-w-[calc(100vw-16px)]": !0,
|
|
165
165
|
"invisible pointer-events-none": V.value,
|
|
166
166
|
[de.value ?? ""]: !0,
|
|
167
167
|
[fe.value ?? ""]: !0,
|
|
@@ -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";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ProgressOwnProps } from './progress.types';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<ProgressOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ProgressOwnProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useProgress as e } from "./composables/useProgress.js";
|
|
2
|
+
import { createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, guardReactiveProps as a, mergeProps as o, normalizeProps as s, openBlock as c, unref as l } from "vue";
|
|
3
|
+
//#region src/Components/Progress/Progress.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var u = /* @__PURE__ */ i({
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "Progress",
|
|
7
|
+
props: {
|
|
8
|
+
classes: {},
|
|
9
|
+
color: {},
|
|
10
|
+
customProps: {},
|
|
11
|
+
rounded: {},
|
|
12
|
+
size: {},
|
|
13
|
+
value: {},
|
|
14
|
+
valueBuffer: {},
|
|
15
|
+
variant: {}
|
|
16
|
+
},
|
|
17
|
+
setup(i) {
|
|
18
|
+
let { barBind: u, isBuffer: d, rootBind: f, trackBind: p, bufferBind: m } = e(i, {
|
|
19
|
+
size: "md",
|
|
20
|
+
rounded: "full",
|
|
21
|
+
color: "primary",
|
|
22
|
+
variant: "indeterminate"
|
|
23
|
+
});
|
|
24
|
+
return (e, i) => (c(), n("div", s(a(l(f))), [
|
|
25
|
+
r("div", s(a(l(p))), null, 16),
|
|
26
|
+
l(d) && l(m) ? (c(), n("div", s(o({ key: 0 }, l(m))), null, 16)) : t("", !0),
|
|
27
|
+
r("div", s(a(l(u))), null, 16)
|
|
28
|
+
], 16));
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
//#endregion
|
|
32
|
+
export { u as default };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core';
|
|
2
|
+
import { ProgressOwnProps, ProgressProps } from '../progress.types';
|
|
3
|
+
type ProgressLibDefaults = LibDefaultsShape<ProgressOwnProps, "size" | "color" | "rounded" | "variant">;
|
|
4
|
+
type ProgressMerged = MergeLibDefaults<ProgressOwnProps, ProgressLibDefaults>;
|
|
5
|
+
export declare function useProgress(props: ProgressOwnProps, libDefaults: ProgressLibDefaults): {
|
|
6
|
+
merged: import('vue').ComputedRef<ProgressMerged>;
|
|
7
|
+
barBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {
|
|
8
|
+
style: {
|
|
9
|
+
width: string;
|
|
10
|
+
};
|
|
11
|
+
} | {
|
|
12
|
+
style?: undefined;
|
|
13
|
+
}>>;
|
|
14
|
+
isBuffer: import('vue').ComputedRef<boolean>;
|
|
15
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
16
|
+
class: string;
|
|
17
|
+
"aria-valuemin"?: number | undefined;
|
|
18
|
+
"aria-valuemax"?: number | undefined;
|
|
19
|
+
"aria-valuenow"?: number | undefined;
|
|
20
|
+
role: string;
|
|
21
|
+
}, "class", import('vue').HTMLAttributes | undefined, Omit<ProgressProps, "color" | "size" | "value" | "classes" | "customProps" | "rounded" | "variant" | "valueBuffer">>>;
|
|
22
|
+
trackBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
23
|
+
bufferBind: import('vue').ComputedRef<(object & {
|
|
24
|
+
style: {
|
|
25
|
+
width: string;
|
|
26
|
+
};
|
|
27
|
+
} & Record<"class", string>) | null>;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
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, isNil as o } from "es-toolkit/compat";
|
|
4
|
+
import { cn as s, mergeBridgeUILayeredClasses as c, splitComponentProps as l } from "@bridge-ui/core";
|
|
5
|
+
import { colorProps as u, roundedProps as d, sizeProps as f, variantProps as p } from "@bridge-ui/core/Components/Progress";
|
|
6
|
+
//#region src/Components/Progress/composables/useProgress.ts
|
|
7
|
+
var m = [
|
|
8
|
+
"size",
|
|
9
|
+
"color",
|
|
10
|
+
"value",
|
|
11
|
+
"classes",
|
|
12
|
+
"rounded",
|
|
13
|
+
"variant",
|
|
14
|
+
"customProps",
|
|
15
|
+
"valueBuffer"
|
|
16
|
+
];
|
|
17
|
+
function h(e) {
|
|
18
|
+
return o(e) || Number.isNaN(e) ? 0 : Math.min(100, Math.max(0, e));
|
|
19
|
+
}
|
|
20
|
+
function g(o, g) {
|
|
21
|
+
let _ = i(), v = r(() => l({
|
|
22
|
+
props: {
|
|
23
|
+
..._,
|
|
24
|
+
...o
|
|
25
|
+
},
|
|
26
|
+
bridgeKeys: m
|
|
27
|
+
})), { merged: y, entry: b } = t({
|
|
28
|
+
libDefaults: g,
|
|
29
|
+
componentName: "Progress",
|
|
30
|
+
props: () => v.value.componentProps
|
|
31
|
+
}), x = n({
|
|
32
|
+
entry: b,
|
|
33
|
+
props: () => v.value.componentProps
|
|
34
|
+
}), S = r(() => y.value.customProps), C = r(() => a(c(u, b.value?.customProps?.color), y.value.color)), w = r(() => a(c(f, b.value?.customProps?.size), y.value.size)), T = r(() => a(c(d, b.value?.customProps?.rounded), y.value.rounded)), E = r(() => a(c(p, b.value?.customProps?.variant), y.value.variant)), D = r(() => y.value.variant === "buffer"), O = r(() => y.value.variant === "determinate" || y.value.variant === "buffer"), k = r(() => y.value.variant === "indeterminate" || y.value.variant === "query"), A = r(() => h(y.value.value)), j = r(() => h(y.value.valueBuffer)), M = r(() => e(S.value?.root, v.value.inheritedAttrs, {
|
|
35
|
+
role: "progressbar",
|
|
36
|
+
...O.value ? {
|
|
37
|
+
"aria-valuemin": 0,
|
|
38
|
+
"aria-valuemax": 100,
|
|
39
|
+
"aria-valuenow": A.value
|
|
40
|
+
} : {},
|
|
41
|
+
class: s({
|
|
42
|
+
"relative w-full overflow-hidden": !0,
|
|
43
|
+
[w.value ?? ""]: !0,
|
|
44
|
+
[T.value ?? ""]: !0,
|
|
45
|
+
[x.value.root ?? ""]: !0
|
|
46
|
+
})
|
|
47
|
+
})), N = r(() => e(S.value?.track, {}, s({
|
|
48
|
+
"absolute inset-0": !0,
|
|
49
|
+
[C.value?.track ?? ""]: !0,
|
|
50
|
+
[T.value ?? ""]: !0,
|
|
51
|
+
[x.value.track ?? ""]: !0
|
|
52
|
+
}))), P = r(() => D.value ? e(S.value?.buffer, { style: { width: `${j.value}%` } }, s({
|
|
53
|
+
"absolute top-0 left-0 h-full transition-[width] duration-200 ease-linear": !0,
|
|
54
|
+
[C.value?.buffer ?? ""]: !0,
|
|
55
|
+
[T.value ?? ""]: !0,
|
|
56
|
+
[x.value.buffer ?? ""]: !0
|
|
57
|
+
})) : null);
|
|
58
|
+
return {
|
|
59
|
+
merged: y,
|
|
60
|
+
barBind: r(() => e(S.value?.bar, O.value ? { style: { width: `${A.value}%` } } : {}, s({
|
|
61
|
+
"absolute top-0 left-0 h-full": !0,
|
|
62
|
+
"transition-[width] duration-200 ease-linear": O.value,
|
|
63
|
+
[E.value ?? ""]: k.value,
|
|
64
|
+
[C.value?.bar ?? ""]: !0,
|
|
65
|
+
[T.value ?? ""]: !0,
|
|
66
|
+
[x.value.bar ?? ""]: !0
|
|
67
|
+
}))),
|
|
68
|
+
isBuffer: D,
|
|
69
|
+
rootBind: M,
|
|
70
|
+
trackBind: N,
|
|
71
|
+
bufferBind: P
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { g as useProgress };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { useProgress } from './composables/useProgress';
|
|
2
|
+
export type { ProgressClasses, ProgressColorOverrides, ProgressCustomProps, ProgressOwnProps, ProgressProps, ProgressRoundedOverrides, ProgressSizeOverrides, ProgressVariantOverrides, } from './progress.types';
|
|
3
|
+
export { default as Progress } from './Progress.vue';
|