@bridge-ui/vue 0.0.1-beta.6 → 0.0.1
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/Actions/BridgeUIHosts.vue.d.ts +3 -2
- package/dist/Actions/BridgeUIHosts.vue_vue_type_script_setup_true_lang.js +15 -10
- package/dist/Actions/Drawer/BridgeDrawerHost.js +5 -0
- package/dist/Actions/Drawer/BridgeDrawerHost.vue.d.ts +14 -0
- package/dist/Actions/Drawer/BridgeDrawerHost.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/Actions/Drawer/bridgeDrawer.types.d.ts +44 -0
- package/dist/Actions/Drawer/bridgeDrawerInjectionKey.d.ts +3 -0
- package/dist/Actions/Drawer/bridgeDrawerInjectionKey.js +4 -0
- package/dist/Actions/Drawer/createBridgeDrawerApi.d.ts +2 -0
- package/dist/Actions/Drawer/createBridgeDrawerApi.js +49 -0
- package/dist/Actions/Drawer/index.d.ts +3 -0
- package/dist/Actions/Drawer/index.js +3 -0
- package/dist/Actions/Drawer/useDrawerAction.d.ts +5 -0
- package/dist/Actions/Drawer/useDrawerAction.js +26 -0
- package/dist/Actions/bridgeUIHosts.types.d.ts +5 -0
- package/dist/Actions/index.d.ts +2 -0
- package/dist/Actions/index.js +8 -6
- package/dist/Components/Badge/badge.types.d.ts +1 -1
- package/dist/Components/Chip/chip.types.d.ts +1 -1
- package/dist/Components/Drawer/Drawer.js +5 -0
- package/dist/Components/Drawer/Drawer.vue.d.ts +39 -0
- package/dist/Components/Drawer/Drawer.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/Components/Drawer/composables/useDrawer.d.ts +63 -0
- package/dist/Components/Drawer/composables/useDrawer.js +208 -0
- package/dist/Components/Drawer/drawer.types.d.ts +188 -0
- package/dist/Components/Drawer/index.d.ts +4 -0
- package/dist/Components/Drawer/index.js +3 -0
- package/dist/Components/FormControl/formControl.types.d.ts +6 -6
- package/dist/Components/FormField/formField.types.d.ts +7 -7
- package/dist/Components/Label/label.types.d.ts +1 -1
- package/dist/Components/Link/link.types.d.ts +3 -3
- package/dist/Components/List/composables/useList.js +1 -1
- package/dist/Components/List/list.types.d.ts +1 -1
- package/dist/Components/ListItem/composables/useListItem.js +7 -7
- package/dist/Components/ListItem/listItem.types.d.ts +1 -1
- package/dist/Components/ListSection/composables/useListSection.js +2 -2
- package/dist/Components/ListSection/listSection.types.d.ts +1 -1
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +73 -61
- package/dist/Components/Listbox/composables/useListbox.d.ts +0 -5
- package/dist/Components/Listbox/composables/useListbox.js +10 -19
- package/dist/Components/Listbox/listbox.types.d.ts +7 -7
- package/dist/Components/Menu/composables/useMenu.js +1 -1
- package/dist/Components/Menu/menu.types.d.ts +3 -3
- package/dist/Components/Modal/composables/useModal.js +0 -1
- package/dist/Components/Modal/modal.types.d.ts +3 -2
- 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.d.ts +2 -2
- package/dist/Components/Select/select.types.d.ts +5 -5
- package/dist/Components/Snackbar/composables/useSnackbar.js +1 -1
- package/dist/Components/Snackbar/snackbar.types.d.ts +7 -7
- 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/Components/Tab/Tab.js +5 -0
- package/dist/Components/Tab/Tab.vue.d.ts +11 -0
- package/dist/Components/Tab/Tab.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/Components/Tab/composables/useTab.d.ts +23 -0
- package/dist/Components/Tab/composables/useTab.js +88 -0
- package/dist/Components/Tab/index.d.ts +3 -0
- package/dist/Components/Tab/index.js +3 -0
- package/dist/Components/Tab/tab.types.d.ts +94 -0
- package/dist/Components/TabItem/TabItem.js +5 -0
- package/dist/Components/TabItem/TabItem.vue.d.ts +11 -0
- package/dist/Components/TabItem/TabItem.vue_vue_type_script_setup_true_lang.js +25 -0
- package/dist/Components/TabItem/composables/useTabItem.d.ts +3 -0
- package/dist/Components/TabItem/composables/useTabItem.js +39 -0
- package/dist/Components/TabItem/index.d.ts +3 -0
- package/dist/Components/TabItem/index.js +3 -0
- package/dist/Components/TabItem/tabItem.types.d.ts +72 -0
- package/dist/Components/TabList/TabList.js +5 -0
- package/dist/Components/TabList/TabList.vue.d.ts +11 -0
- package/dist/Components/TabList/TabList.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/Components/TabList/composables/useTabList.d.ts +10 -0
- package/dist/Components/TabList/composables/useTabList.js +65 -0
- package/dist/Components/TabList/index.d.ts +3 -0
- package/dist/Components/TabList/index.js +3 -0
- package/dist/Components/TabList/tabList.types.d.ts +38 -0
- package/dist/Components/TabPanel/TabPanel.js +5 -0
- package/dist/Components/TabPanel/TabPanel.vue.d.ts +11 -0
- package/dist/Components/TabPanel/TabPanel.vue_vue_type_script_setup_true_lang.js +20 -0
- package/dist/Components/TabPanel/composables/useTabPanel.d.ts +14 -0
- package/dist/Components/TabPanel/composables/useTabPanel.js +51 -0
- package/dist/Components/TabPanel/index.d.ts +3 -0
- package/dist/Components/TabPanel/index.js +3 -0
- package/dist/Components/TabPanel/tabPanel.types.d.ts +48 -0
- package/dist/Components/Tabs/Tabs.js +5 -0
- package/dist/Components/Tabs/Tabs.vue.d.ts +24 -0
- package/dist/Components/Tabs/Tabs.vue_vue_type_script_setup_true_lang.js +73 -0
- package/dist/Components/Tabs/composables/useTabs.d.ts +39 -0
- package/dist/Components/Tabs/composables/useTabs.js +99 -0
- package/dist/Components/Tabs/index.d.ts +4 -0
- package/dist/Components/Tabs/index.js +4 -0
- package/dist/Components/Tabs/tabs.types.d.ts +93 -0
- package/dist/Components/Tabs/tabsInjectionKey.d.ts +121 -0
- package/dist/Components/Tabs/tabsInjectionKey.js +4 -0
- package/dist/Utils/index.d.ts +2 -0
- package/dist/Utils/index.js +20 -19
- package/dist/Utils/useBreakpoint.d.ts +19 -0
- package/dist/Utils/useBreakpoint.js +35 -0
- package/dist/augments.d.ts +10 -0
- package/dist/index.d.ts +18 -1
- package/dist/index.js +76 -58
- package/dist/theme.css +55 -3
- package/package.json +2 -2
|
@@ -2,16 +2,17 @@ import { hasNamedSlot as e, resolveNamedSlot as t } from "../../Utils/slotOrProp
|
|
|
2
2
|
import n from "../List/List.js";
|
|
3
3
|
import { useListbox as r } from "./composables/useListbox.js";
|
|
4
4
|
import { LISTBOX_INJECTION_KEY as i } from "./listboxInjectionKey.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
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";
|
|
10
11
|
import { Check as oe } from "@lucide/vue";
|
|
11
12
|
//#region src/Components/Listbox/Listbox.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
-
var se = { key: 1 },
|
|
13
|
+
var se = { key: 1 }, N = /* @__PURE__ */ h({
|
|
13
14
|
__name: "Listbox",
|
|
14
|
-
props: /* @__PURE__ */
|
|
15
|
+
props: /* @__PURE__ */ _({
|
|
15
16
|
anchorEl: {},
|
|
16
17
|
classes: {},
|
|
17
18
|
color: { default: "primary" },
|
|
@@ -56,96 +57,107 @@ var se = { key: 1 }, M = /* @__PURE__ */ p({
|
|
|
56
57
|
},
|
|
57
58
|
modelModifiers: {}
|
|
58
59
|
}),
|
|
59
|
-
emits: /* @__PURE__ */
|
|
60
|
+
emits: /* @__PURE__ */ _([
|
|
60
61
|
"registered-options-change",
|
|
61
62
|
"select",
|
|
62
63
|
"show-change"
|
|
63
64
|
], ["update:modelValue"]),
|
|
64
|
-
setup(
|
|
65
|
-
let
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
setup(h, { emit: _ }) {
|
|
66
|
+
let N = k(), P = _, F = O(h, "modelValue");
|
|
67
|
+
A(F, (e) => {
|
|
68
|
+
P("show-change", e);
|
|
68
69
|
});
|
|
69
|
-
let
|
|
70
|
+
let I = h, { merged: L, checkClass: R, scrollBind: z, messageBind: B, sizeClasses: V, mergedClasses: H, optionSelectedClass: U, optionHighlightedClass: W } = r(I, {
|
|
70
71
|
size: "md",
|
|
71
72
|
color: "primary"
|
|
72
|
-
}),
|
|
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([]);
|
|
73
74
|
function Q(e) {
|
|
74
|
-
return
|
|
75
|
+
return I.isSelected?.(e) ?? !1;
|
|
75
76
|
}
|
|
76
|
-
function
|
|
77
|
-
return
|
|
77
|
+
function ce(e) {
|
|
78
|
+
return I.highlightedIndex === e;
|
|
78
79
|
}
|
|
79
|
-
function
|
|
80
|
+
function le(e) {
|
|
80
81
|
e.preventDefault();
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
+
function ue(e, t) {
|
|
83
84
|
let n = {
|
|
84
85
|
tabindex: -1,
|
|
85
|
-
onMousedown:
|
|
86
|
-
class:
|
|
86
|
+
onMousedown: le,
|
|
87
|
+
class: M(V.value?.option)
|
|
87
88
|
};
|
|
88
|
-
return Q(e.value) ? n.class =
|
|
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)), {
|
|
89
90
|
interactive: n,
|
|
90
91
|
primary: { class: V.value?.primary },
|
|
91
92
|
secondary: { class: V.value?.secondary }
|
|
92
93
|
};
|
|
93
94
|
}
|
|
94
95
|
function $(e) {
|
|
95
|
-
e.disabled ||
|
|
96
|
+
e.disabled || P("select", e);
|
|
96
97
|
}
|
|
97
|
-
function
|
|
98
|
+
function de(e) {
|
|
98
99
|
return Z.value.some((t) => String(t.value) === String(e.value)) || (Z.value = [...Z.value, e]), () => {
|
|
99
100
|
Z.value = Z.value.filter((t) => String(t.value) !== String(e.value));
|
|
100
101
|
};
|
|
101
102
|
}
|
|
102
|
-
function
|
|
103
|
+
function fe(e) {
|
|
103
104
|
return (J.value ? Z.value : q.value).findIndex((t) => String(t.value) === String(e));
|
|
104
105
|
}
|
|
105
|
-
|
|
106
|
-
J.value &&
|
|
107
|
-
}, { deep: !0 }),
|
|
108
|
-
getOptionIndex:
|
|
109
|
-
registerOption:
|
|
106
|
+
A(Z, (e) => {
|
|
107
|
+
J.value && P("registered-options-change", e);
|
|
108
|
+
}, { deep: !0 }), S(i, l(() => ({
|
|
109
|
+
getOptionIndex: fe,
|
|
110
|
+
registerOption: de,
|
|
110
111
|
onSelect: $,
|
|
111
|
-
listboxId:
|
|
112
|
+
listboxId: I.listboxId,
|
|
112
113
|
isSelected: Q,
|
|
113
114
|
sizeClasses: V.value,
|
|
114
|
-
showCheckmark:
|
|
115
|
+
showCheckmark: I.showCheckmark,
|
|
115
116
|
checkClass: X.value,
|
|
116
|
-
highlightedIndex:
|
|
117
|
-
optionSelectedClass:
|
|
118
|
-
optionHighlightedClass:
|
|
117
|
+
highlightedIndex: I.highlightedIndex,
|
|
118
|
+
optionSelectedClass: U.value,
|
|
119
|
+
optionHighlightedClass: W.value,
|
|
119
120
|
mergedClasses: {
|
|
120
121
|
optionSelected: H.value.optionSelected,
|
|
121
122
|
optionHighlighted: H.value.optionHighlighted
|
|
122
123
|
}
|
|
123
124
|
})));
|
|
124
|
-
let
|
|
125
|
-
return (r, i) => (
|
|
126
|
-
modelValue:
|
|
127
|
-
"onUpdate:modelValue": i[0] ||= (e) =>
|
|
128
|
-
"anchor-el":
|
|
129
|
-
placement:
|
|
125
|
+
let pe = l(() => ae(K.value, Q));
|
|
126
|
+
return (r, i) => (x(), u(D(s), {
|
|
127
|
+
modelValue: F.value,
|
|
128
|
+
"onUpdate:modelValue": i[0] ||= (e) => F.value = e,
|
|
129
|
+
"anchor-el": h.anchorEl,
|
|
130
|
+
placement: h.placement,
|
|
130
131
|
"close-on-click-away": !0,
|
|
131
|
-
"disable-auto-focus":
|
|
132
|
-
"custom-props": { content:
|
|
132
|
+
"disable-auto-focus": h.disableAutoFocus,
|
|
133
|
+
"custom-props": { content: D(L).customProps?.content }
|
|
133
134
|
}, {
|
|
134
|
-
default:
|
|
135
|
-
|
|
136
|
-
|
|
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), {
|
|
137
149
|
dense: "",
|
|
138
150
|
class: "p-0",
|
|
139
151
|
role: "listbox",
|
|
140
|
-
id:
|
|
141
|
-
"aria-labelledby":
|
|
142
|
-
"aria-multiselectable":
|
|
152
|
+
id: h.listboxId,
|
|
153
|
+
"aria-labelledby": h.labelledBy,
|
|
154
|
+
"aria-multiselectable": h.multiple || void 0
|
|
143
155
|
}, {
|
|
144
|
-
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), {
|
|
145
157
|
key: 0,
|
|
146
158
|
title: t.title,
|
|
147
159
|
sticky: t.sticky
|
|
148
|
-
}, null, 8, ["title", "sticky"])) : (
|
|
160
|
+
}, null, 8, ["title", "sticky"])) : (x(), u(D(a), {
|
|
149
161
|
key: 1,
|
|
150
162
|
interactive: "",
|
|
151
163
|
role: "option",
|
|
@@ -154,19 +166,19 @@ var se = { key: 1 }, M = /* @__PURE__ */ p({
|
|
|
154
166
|
disabled: t.option.disabled,
|
|
155
167
|
secondary: t.option.description,
|
|
156
168
|
onClick: (e) => $(t.option),
|
|
157
|
-
id: `${
|
|
158
|
-
"custom-props":
|
|
159
|
-
primary:
|
|
160
|
-
},
|
|
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") ? {
|
|
161
173
|
name: "default",
|
|
162
|
-
fn:
|
|
174
|
+
fn: j(() => [w(r.$slots, "option", {
|
|
163
175
|
option: t.option,
|
|
164
176
|
selected: t.selected
|
|
165
177
|
})]),
|
|
166
178
|
key: "0"
|
|
167
|
-
} : void 0,
|
|
179
|
+
} : void 0, h.showCheckmark && t.selected ? {
|
|
168
180
|
name: "end",
|
|
169
|
-
fn:
|
|
181
|
+
fn: j(() => [m(D(oe), { class: y(X.value) }, null, 8, ["class"])]),
|
|
170
182
|
key: "1"
|
|
171
183
|
} : void 0]), 1032, [
|
|
172
184
|
"aria-selected",
|
|
@@ -183,8 +195,8 @@ var se = { key: 1 }, M = /* @__PURE__ */ p({
|
|
|
183
195
|
"aria-labelledby",
|
|
184
196
|
"aria-multiselectable"
|
|
185
197
|
])], 16)),
|
|
186
|
-
Y.value && !
|
|
187
|
-
|
|
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)
|
|
188
200
|
]),
|
|
189
201
|
_: 3
|
|
190
202
|
}, 8, [
|
|
@@ -197,4 +209,4 @@ var se = { key: 1 }, M = /* @__PURE__ */ p({
|
|
|
197
209
|
}
|
|
198
210
|
});
|
|
199
211
|
//#endregion
|
|
200
|
-
export {
|
|
212
|
+
export { N as default };
|
|
@@ -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
|
};
|
|
@@ -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
|
/**
|
|
@@ -182,25 +182,25 @@ export interface ListboxSlots {
|
|
|
182
182
|
/**
|
|
183
183
|
* Content below the list.
|
|
184
184
|
*/
|
|
185
|
-
afterOptions?: Slot
|
|
185
|
+
afterOptions?: Slot<undefined>;
|
|
186
186
|
/**
|
|
187
187
|
* Content above the list.
|
|
188
188
|
*/
|
|
189
|
-
beforeOptions?: Slot
|
|
189
|
+
beforeOptions?: Slot<undefined>;
|
|
190
190
|
/**
|
|
191
191
|
* Composed list content (`ListSection` / `ListItem`). When set, replaces the
|
|
192
192
|
* mapped `options` / `entries` render inside the list.
|
|
193
193
|
*/
|
|
194
|
-
default?: Slot
|
|
194
|
+
default?: Slot<undefined>;
|
|
195
195
|
/**
|
|
196
196
|
* Custom empty-state content.
|
|
197
197
|
*/
|
|
198
|
-
empty?: Slot
|
|
198
|
+
empty?: Slot<undefined>;
|
|
199
199
|
/**
|
|
200
200
|
* Custom loading content. Replaces the default `loadingMessage` when set.
|
|
201
201
|
* The progress bar still renders above this content.
|
|
202
202
|
*/
|
|
203
|
-
loading?: Slot
|
|
203
|
+
loading?: Slot<undefined>;
|
|
204
204
|
/**
|
|
205
205
|
* Custom option item content.
|
|
206
206
|
*/
|
|
@@ -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,
|
|
@@ -54,13 +54,13 @@ export interface MenuEmits {
|
|
|
54
54
|
close: [];
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
|
-
* Anchored menu panel
|
|
58
|
-
* (not listed here — `defineModel` handles it). Anchor with `anchorEl`
|
|
57
|
+
* Anchored menu panel. Visibility is controlled with `v-model`
|
|
58
|
+
* (not listed here — `defineModel` handles it). Anchor with `anchorEl`
|
|
59
59
|
* or put the opener in the `trigger` slot; menu items go in the default slot.
|
|
60
60
|
*/
|
|
61
61
|
export interface MenuOwnProps {
|
|
62
62
|
/**
|
|
63
|
-
* Element that anchors the menu panel
|
|
63
|
+
* Element that anchors the menu panel. When set, it is used
|
|
64
64
|
* for positioning and click-away instead of the `trigger` slot wrapper.
|
|
65
65
|
* Prefer this when the opener lives outside the `Menu` or is controlled manually.
|
|
66
66
|
* Not merged into Bridge defaults (DOM nodes must not be deep-merged).
|
|
@@ -65,7 +65,6 @@ function x(x, ue, S = {}) {
|
|
|
65
65
|
})
|
|
66
66
|
})), be = n(() => e(z.value?.wrapper, { onClick: Q }, l({
|
|
67
67
|
"flex min-h-full w-full transform p-4": !0,
|
|
68
|
-
"items-end justify-center": !0,
|
|
69
68
|
[fe.value ?? ""]: !0,
|
|
70
69
|
[s(B.value, "wrapper") ?? ""]: !0
|
|
71
70
|
}))), xe = n(() => e(z.value?.panel, {
|
|
@@ -59,8 +59,9 @@ export interface ModalEmits {
|
|
|
59
59
|
*/
|
|
60
60
|
export interface ModalOwnProps {
|
|
61
61
|
/**
|
|
62
|
-
* Panel position
|
|
63
|
-
*
|
|
62
|
+
* Panel position on all breakpoints (`{row}-{column}` grid).
|
|
63
|
+
* Use `useBreakpoint` if you need a different align per viewport
|
|
64
|
+
* (e.g. bottom sheet on mobile, centered on desktop).
|
|
64
65
|
*
|
|
65
66
|
* @default "middle-center"
|
|
66
67
|
*/
|
|
@@ -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';
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
import { MergeHtmlProps, MergeProps, ProgressColor, ProgressRounded, ProgressSize, ProgressVariant } from '@bridge-ui/core';
|
|
3
|
+
export interface ProgressSizeOverrides {}
|
|
4
|
+
export interface ProgressColorOverrides {}
|
|
5
|
+
export interface ProgressRoundedOverrides {}
|
|
6
|
+
export interface ProgressVariantOverrides {}
|
|
7
|
+
export interface ProgressClasses {
|
|
8
|
+
/**
|
|
9
|
+
* The classes to apply to the primary progress bar.
|
|
10
|
+
*/
|
|
11
|
+
bar?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The classes to apply to the buffer bar.
|
|
14
|
+
*/
|
|
15
|
+
buffer?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The classes to apply to the root.
|
|
18
|
+
*/
|
|
19
|
+
root?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The classes to apply to the track.
|
|
22
|
+
*/
|
|
23
|
+
track?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ProgressCustomProps {
|
|
26
|
+
/**
|
|
27
|
+
* Props forwarded to the primary progress bar.
|
|
28
|
+
*/
|
|
29
|
+
bar?: HTMLAttributes;
|
|
30
|
+
/**
|
|
31
|
+
* Props forwarded to the buffer bar.
|
|
32
|
+
*/
|
|
33
|
+
buffer?: HTMLAttributes;
|
|
34
|
+
/**
|
|
35
|
+
* Props forwarded to the root element.
|
|
36
|
+
*/
|
|
37
|
+
root?: HTMLAttributes;
|
|
38
|
+
/**
|
|
39
|
+
* Props forwarded to the track element.
|
|
40
|
+
*/
|
|
41
|
+
track?: HTMLAttributes;
|
|
42
|
+
}
|
|
43
|
+
export interface ProgressOwnProps {
|
|
44
|
+
/**
|
|
45
|
+
* The classes to apply to progress parts.
|
|
46
|
+
*
|
|
47
|
+
* @default undefined
|
|
48
|
+
*/
|
|
49
|
+
classes?: ProgressClasses;
|
|
50
|
+
/**
|
|
51
|
+
* The color of the progress indicator.
|
|
52
|
+
*
|
|
53
|
+
* @default "primary"
|
|
54
|
+
*/
|
|
55
|
+
color?: MergeProps<ProgressColor, ProgressColorOverrides>;
|
|
56
|
+
/**
|
|
57
|
+
* Extra props for internal parts (`root`, `track`, `bar`, `buffer`).
|
|
58
|
+
* Root HTML attributes stay on the component top level.
|
|
59
|
+
*
|
|
60
|
+
* @default undefined
|
|
61
|
+
*/
|
|
62
|
+
customProps?: ProgressCustomProps;
|
|
63
|
+
/**
|
|
64
|
+
* The roundedness of the progress bar.
|
|
65
|
+
*
|
|
66
|
+
* @default "full"
|
|
67
|
+
*/
|
|
68
|
+
rounded?: MergeProps<ProgressRounded, ProgressRoundedOverrides>;
|
|
69
|
+
/**
|
|
70
|
+
* The height size of the progress bar.
|
|
71
|
+
*
|
|
72
|
+
* @default "md"
|
|
73
|
+
*/
|
|
74
|
+
size?: MergeProps<ProgressSize, ProgressSizeOverrides>;
|
|
75
|
+
/**
|
|
76
|
+
* Progress value from 0 to 100. Used by `determinate` and `buffer` variants.
|
|
77
|
+
*
|
|
78
|
+
* @default undefined
|
|
79
|
+
*/
|
|
80
|
+
value?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Buffer value from 0 to 100. Used by the `buffer` variant; should be ≥ `value`.
|
|
83
|
+
*
|
|
84
|
+
* @default undefined
|
|
85
|
+
*/
|
|
86
|
+
valueBuffer?: number;
|
|
87
|
+
/**
|
|
88
|
+
* Visual variant of the progress indicator.
|
|
89
|
+
*
|
|
90
|
+
* @default "indeterminate"
|
|
91
|
+
*/
|
|
92
|
+
variant?: MergeProps<ProgressVariant, ProgressVariantOverrides>;
|
|
93
|
+
}
|
|
94
|
+
export type ProgressProps = MergeHtmlProps<ProgressOwnProps, HTMLAttributes>;
|