@ug666/ui-vue 0.1.0 → 0.2.0
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/aliases-CKe0wVQy.cjs +2 -0
- package/dist/aliases-CKe0wVQy.cjs.map +1 -0
- package/dist/aliases-u3xep8jx.js +2732 -0
- package/dist/aliases-u3xep8jx.js.map +1 -0
- package/dist/aliases.d.ts +49 -0
- package/dist/aliases.d.ts.map +1 -0
- package/dist/blocks/feature-grid.vue.d.ts +44 -0
- package/dist/blocks/feature-grid.vue.d.ts.map +1 -0
- package/dist/blocks/index.cjs +2 -0
- package/dist/blocks/index.cjs.map +1 -0
- package/dist/blocks/index.d.ts +10 -0
- package/dist/blocks/index.d.ts.map +1 -0
- package/dist/blocks/index.js +137 -0
- package/dist/blocks/index.js.map +1 -0
- package/dist/blocks/landing-hero.vue.d.ts +59 -0
- package/dist/blocks/landing-hero.vue.d.ts.map +1 -0
- package/dist/button-C10AiP5_.cjs +2 -0
- package/dist/button-C10AiP5_.cjs.map +1 -0
- package/dist/button-Sy9e0tiI.js +1742 -0
- package/dist/button-Sy9e0tiI.js.map +1 -0
- package/dist/component-layers.d.ts +199 -0
- package/dist/component-layers.d.ts.map +1 -0
- package/dist/components/card.vue.d.ts.map +1 -1
- package/dist/components/checkbox.vue.d.ts.map +1 -1
- package/dist/components/context-menu.vue.d.ts.map +1 -1
- package/dist/components/descriptions.vue.d.ts.map +1 -1
- package/dist/components/dropdown.vue.d.ts.map +1 -1
- package/dist/components/index.cjs +1 -0
- package/dist/components/index.d.ts +50 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +5 -0
- package/dist/components/pagination.vue.d.ts.map +1 -1
- package/dist/components/popover.vue.d.ts.map +1 -1
- package/dist/components/progress.vue.d.ts +4 -3
- package/dist/components/progress.vue.d.ts.map +1 -1
- package/dist/components/radio.vue.d.ts.map +1 -1
- package/dist/components/select.vue.d.ts +2 -0
- package/dist/components/select.vue.d.ts.map +1 -1
- package/dist/components/sidebar.vue.d.ts +39 -5
- package/dist/components/sidebar.vue.d.ts.map +1 -1
- package/dist/components/steps.vue.d.ts.map +1 -1
- package/dist/components/switch.vue.d.ts.map +1 -1
- package/dist/components/tag.vue.d.ts +1 -1
- package/dist/components/tag.vue.d.ts.map +1 -1
- package/dist/components/tooltip.vue.d.ts.map +1 -1
- package/dist/composables/index.cjs +1 -1
- package/dist/composables/index.d.ts.map +1 -1
- package/dist/composables/index.js +3 -2
- package/dist/composables-GXmQiqgg.cjs +2 -0
- package/dist/composables-GXmQiqgg.cjs.map +1 -0
- package/dist/{composables-BwdwEG7n.js → composables-YMNfao5g.js} +68 -113
- package/dist/composables-YMNfao5g.js.map +1 -0
- package/dist/global.cjs +1 -0
- package/dist/global.d.ts +107 -0
- package/dist/global.d.ts.map +1 -0
- package/dist/global.js +0 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +321 -2927
- package/dist/index.js.map +1 -1
- package/dist/internal/cn.d.ts +3 -0
- package/dist/internal/cn.d.ts.map +1 -0
- package/dist/labs/index.cjs +2 -0
- package/dist/labs/index.cjs.map +1 -0
- package/dist/labs/index.d.ts +10 -0
- package/dist/labs/index.d.ts.map +1 -0
- package/dist/labs/index.js +9 -0
- package/dist/labs/index.js.map +1 -0
- package/dist/patterns/admin-shell.vue.d.ts +73 -0
- package/dist/patterns/admin-shell.vue.d.ts.map +1 -0
- package/dist/patterns/confirm-dialog.vue.d.ts +62 -0
- package/dist/patterns/confirm-dialog.vue.d.ts.map +1 -0
- package/dist/patterns/copy-field.vue.d.ts +51 -0
- package/dist/patterns/copy-field.vue.d.ts.map +1 -0
- package/dist/patterns/index.cjs +2 -0
- package/dist/patterns/index.cjs.map +1 -0
- package/dist/patterns/index.d.ts +14 -0
- package/dist/patterns/index.d.ts.map +1 -0
- package/dist/patterns/index.js +295 -0
- package/dist/patterns/index.js.map +1 -0
- package/dist/patterns/page-header.vue.d.ts +46 -0
- package/dist/patterns/page-header.vue.d.ts.map +1 -0
- package/dist/plugin.d.ts +5 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/primitives/index.cjs +1 -0
- package/dist/primitives/index.d.ts +14 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +3 -0
- package/dist/resolver.cjs +2 -0
- package/dist/resolver.cjs.map +1 -0
- package/dist/resolver.d.ts +20 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/resolver.js +33 -0
- package/dist/resolver.js.map +1 -0
- package/dist/separator-BnNQAp6A.js +259 -0
- package/dist/separator-BnNQAp6A.js.map +1 -0
- package/dist/separator-Bynwn-we.cjs +2 -0
- package/dist/separator-Bynwn-we.cjs.map +1 -0
- package/dist/sidebar-BnZB7vlK.js +344 -0
- package/dist/sidebar-BnZB7vlK.js.map +1 -0
- package/dist/sidebar-xKPzL0NQ.cjs +2 -0
- package/dist/sidebar-xKPzL0NQ.cjs.map +1 -0
- package/dist/styles.css +2502 -0
- package/dist/theme.d.ts +77 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/toast-state-BBoVvR0u.cjs +2 -0
- package/dist/toast-state-BBoVvR0u.cjs.map +1 -0
- package/dist/toast-state-Crugc-IE.js +50 -0
- package/dist/toast-state-Crugc-IE.js.map +1 -0
- package/dist/tokens.css +86 -9
- package/package.json +46 -6
- package/dist/composables-BwdwEG7n.js.map +0 -1
- package/dist/composables-Cxcf-3ov.cjs +0 -2
- package/dist/composables-Cxcf-3ov.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,2941 +1,335 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
let r = e, i = n, a = U(e, "modelValue"), o = te(), s = H(), c = y(() => r.id ?? s), l = I(null), u = y(() => Y("flex h-9 w-full rounded-md border bg-surface-1 px-3 py-2 text-sm text-text-primary placeholder:text-text-tertiary", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1", "disabled:cursor-not-allowed disabled:opacity-50", r.error ? "border-danger focus-visible:ring-danger" : "border-border-strong focus-visible:ring-ring/30", r.class)), d = y(() => {
|
|
89
|
-
let e = { ...o };
|
|
90
|
-
return delete e.class, e;
|
|
91
|
-
});
|
|
92
|
-
function f(e) {
|
|
93
|
-
a.value = e.target.value, i("input", e);
|
|
94
|
-
}
|
|
95
|
-
function p(e) {
|
|
96
|
-
i("change", e);
|
|
97
|
-
}
|
|
98
|
-
function m(e) {
|
|
99
|
-
i("blur", e);
|
|
100
|
-
}
|
|
101
|
-
function h(e) {
|
|
102
|
-
i("focus", e);
|
|
103
|
-
}
|
|
104
|
-
function g() {
|
|
105
|
-
l.value?.focus();
|
|
106
|
-
}
|
|
107
|
-
function _() {
|
|
108
|
-
l.value?.blur();
|
|
109
|
-
}
|
|
110
|
-
function v() {
|
|
111
|
-
l.value?.select();
|
|
112
|
-
}
|
|
113
|
-
return t({
|
|
114
|
-
focus: g,
|
|
115
|
-
blur: _,
|
|
116
|
-
select: v,
|
|
117
|
-
el: l
|
|
118
|
-
}), (t, n) => (P(), S("div", ye, [
|
|
119
|
-
e.label ? (P(), S("label", {
|
|
120
|
-
key: 0,
|
|
121
|
-
for: c.value,
|
|
122
|
-
class: "text-sm font-medium text-text-primary"
|
|
123
|
-
}, B(e.label), 9, be)) : x("", !0),
|
|
124
|
-
C("input", ee({
|
|
125
|
-
id: c.value,
|
|
126
|
-
ref_key: "inputRef",
|
|
127
|
-
ref: l,
|
|
128
|
-
value: a.value ?? "",
|
|
129
|
-
type: e.type,
|
|
130
|
-
disabled: e.disabled,
|
|
131
|
-
placeholder: e.placeholder,
|
|
132
|
-
class: u.value
|
|
133
|
-
}, d.value, {
|
|
134
|
-
onInput: f,
|
|
135
|
-
onChange: p,
|
|
136
|
-
onBlur: m,
|
|
137
|
-
onFocus: h
|
|
138
|
-
}), null, 16, xe),
|
|
139
|
-
e.error ? (P(), S("p", Se, B(e.error), 1)) : e.helperText ? (P(), S("p", Ce, B(e.helperText), 1)) : x("", !0)
|
|
140
|
-
]));
|
|
141
|
-
}
|
|
142
|
-
}), Te = ["for"], Ee = {
|
|
143
|
-
key: 0,
|
|
144
|
-
class: "ml-0.5 text-danger",
|
|
145
|
-
"aria-hidden": "true"
|
|
146
|
-
}, De = /* @__PURE__ */ E({
|
|
147
|
-
name: "ULabel",
|
|
148
|
-
__name: "label",
|
|
149
|
-
props: {
|
|
150
|
-
for: { default: void 0 },
|
|
151
|
-
required: {
|
|
152
|
-
type: Boolean,
|
|
153
|
-
default: !1
|
|
154
|
-
},
|
|
155
|
-
class: { default: void 0 }
|
|
156
|
-
},
|
|
157
|
-
setup(e) {
|
|
158
|
-
let t = e, n = y(() => Y("text-sm font-medium leading-none text-text-primary peer-disabled:cursor-not-allowed peer-disabled:opacity-70", t.class));
|
|
159
|
-
return (e, r) => (P(), S("label", {
|
|
160
|
-
for: t.for,
|
|
161
|
-
class: j(n.value)
|
|
162
|
-
}, [R(e.$slots, "default"), t.required ? (P(), S("span", Ee, "*")) : x("", !0)], 10, Te));
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
//#endregion
|
|
166
|
-
//#region src/components/card.vue?vue&type=script&setup=true&lang.ts
|
|
167
|
-
function X(e, t, n) {
|
|
168
|
-
return E({
|
|
169
|
-
name: e,
|
|
170
|
-
props: { class: {
|
|
171
|
-
type: String,
|
|
172
|
-
default: void 0
|
|
173
|
-
} },
|
|
174
|
-
setup(e, { attrs: r, slots: i }) {
|
|
175
|
-
let a = y(() => Y(n, e.class));
|
|
176
|
-
return () => D(t, {
|
|
177
|
-
...r,
|
|
178
|
-
class: a.value
|
|
179
|
-
}, i.default?.());
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
var Oe = X("UCardHeader", "div", "flex flex-col gap-1.5 p-6"), ke = X("UCardTitle", "h3", "font-semibold leading-none tracking-tight text-text-primary"), Ae = X("UCardDescription", "p", "text-sm text-text-secondary"), je = X("UCardContent", "div", "p-6 pt-0"), Me = X("UCardFooter", "div", "flex items-center p-6 pt-0"), Ne = /* @__PURE__ */ E({
|
|
184
|
-
name: "UCard",
|
|
185
|
-
__name: "card",
|
|
186
|
-
props: { class: { default: void 0 } },
|
|
187
|
-
setup(e) {
|
|
188
|
-
let t = e, n = y(() => Y("rounded-lg border border-border-base bg-surface-1 shadow-sm", t.class));
|
|
189
|
-
return (e, t) => (P(), S("div", { class: j(n.value) }, [R(e.$slots, "default")], 2));
|
|
190
|
-
}
|
|
191
|
-
}), Pe = /* @__PURE__ */ E({
|
|
192
|
-
name: "UBadge",
|
|
193
|
-
__name: "badge",
|
|
194
|
-
props: {
|
|
195
|
-
variant: { default: "default" },
|
|
196
|
-
class: { default: void 0 }
|
|
197
|
-
},
|
|
198
|
-
setup(e) {
|
|
199
|
-
let t = e, n = {
|
|
200
|
-
default: "bg-primary text-primary-fg",
|
|
201
|
-
secondary: "bg-surface-3 text-text-primary",
|
|
202
|
-
destructive: "bg-danger-soft text-danger-soft-fg",
|
|
203
|
-
outline: "border border-border-strong bg-transparent text-text-primary",
|
|
204
|
-
success: "bg-success-soft text-success-soft-fg",
|
|
205
|
-
warning: "bg-warning-soft text-warning-soft-fg"
|
|
206
|
-
}, r = y(() => Y("inline-flex items-center rounded-md px-2.5 py-0.5 text-xs font-semibold transition-colors", n[t.variant], t.class));
|
|
207
|
-
return (e, t) => (P(), S("span", { class: j(r.value) }, [R(e.$slots, "default")], 2));
|
|
208
|
-
}
|
|
209
|
-
}), Fe = ["disabled"], Ie = /* @__PURE__ */ E({
|
|
210
|
-
name: "UTag",
|
|
211
|
-
__name: "tag",
|
|
212
|
-
props: {
|
|
213
|
-
variant: { default: "default" },
|
|
214
|
-
size: { default: "default" },
|
|
215
|
-
closable: {
|
|
216
|
-
type: Boolean,
|
|
217
|
-
default: !1
|
|
218
|
-
},
|
|
219
|
-
disabled: {
|
|
220
|
-
type: Boolean,
|
|
221
|
-
default: !1
|
|
222
|
-
},
|
|
223
|
-
color: { default: void 0 },
|
|
224
|
-
class: { default: void 0 }
|
|
225
|
-
},
|
|
226
|
-
emits: ["close"],
|
|
227
|
-
setup(e, { emit: t }) {
|
|
228
|
-
let n = e, r = t, i = {
|
|
229
|
-
default: "bg-surface-3 text-text-primary",
|
|
230
|
-
primary: "bg-success-soft text-success-soft-fg",
|
|
231
|
-
success: "bg-success-soft text-success-soft-fg",
|
|
232
|
-
warning: "bg-warning-soft text-warning-soft-fg",
|
|
233
|
-
destructive: "bg-danger-soft text-danger-soft-fg",
|
|
234
|
-
outline: "border border-border-strong bg-transparent text-text-primary"
|
|
235
|
-
}, a = {
|
|
236
|
-
sm: "px-1.5 py-0 text-xs",
|
|
237
|
-
default: "px-2 py-0.5 text-xs"
|
|
238
|
-
}, o = y(() => Y("inline-flex items-center gap-1 rounded font-medium transition-colors", i[n.variant], a[n.size], n.disabled && "cursor-not-allowed opacity-50", n.class)), s = y(() => n.color ? {
|
|
239
|
-
backgroundColor: n.color,
|
|
240
|
-
color: "#fff",
|
|
241
|
-
borderColor: n.color
|
|
242
|
-
} : void 0);
|
|
243
|
-
function c(e) {
|
|
244
|
-
n.disabled || r("close", e);
|
|
245
|
-
}
|
|
246
|
-
return (t, n) => (P(), S("span", {
|
|
247
|
-
class: j(o.value),
|
|
248
|
-
style: M(s.value)
|
|
249
|
-
}, [R(t.$slots, "default"), e.closable ? (P(), S("button", {
|
|
250
|
-
key: 0,
|
|
251
|
-
type: "button",
|
|
252
|
-
disabled: e.disabled,
|
|
253
|
-
class: "inline-flex items-center justify-center rounded-sm opacity-60 transition-opacity hover:opacity-100 focus-visible:outline-none disabled:pointer-events-none",
|
|
254
|
-
"aria-label": "关闭标签",
|
|
255
|
-
onClick: G(c, ["stop"])
|
|
256
|
-
}, [T(V(J), {
|
|
257
|
-
size: 10,
|
|
258
|
-
"stroke-width": 2.5
|
|
259
|
-
})], 8, Fe)) : x("", !0)], 6));
|
|
260
|
-
}
|
|
261
|
-
}), Le = {
|
|
262
|
-
key: 0,
|
|
263
|
-
class: "flex items-center justify-between border-b border-border-base px-6 py-4"
|
|
264
|
-
}, Re = {
|
|
265
|
-
key: 0,
|
|
266
|
-
class: "text-lg font-semibold text-text-primary"
|
|
267
|
-
}, ze = { key: 1 }, Be = { class: "px-6 py-4" }, Ve = {
|
|
268
|
-
key: 1,
|
|
269
|
-
class: "flex items-center justify-end gap-2 border-t border-border-base px-6 py-4"
|
|
270
|
-
}, He = /* @__PURE__ */ E({
|
|
271
|
-
name: "UModal",
|
|
272
|
-
__name: "modal",
|
|
273
|
-
props: /* @__PURE__ */ k({
|
|
274
|
-
title: { default: void 0 },
|
|
275
|
-
maxWidth: { default: "max-w-lg" },
|
|
276
|
-
closeOnOverlay: {
|
|
277
|
-
type: Boolean,
|
|
278
|
-
default: !0
|
|
279
|
-
},
|
|
280
|
-
closeOnEsc: {
|
|
281
|
-
type: Boolean,
|
|
282
|
-
default: !0
|
|
283
|
-
},
|
|
284
|
-
showCloseButton: {
|
|
285
|
-
type: Boolean,
|
|
286
|
-
default: !0
|
|
287
|
-
},
|
|
288
|
-
class: { default: void 0 }
|
|
289
|
-
}, {
|
|
290
|
-
open: {
|
|
291
|
-
type: Boolean,
|
|
292
|
-
default: !1
|
|
293
|
-
},
|
|
294
|
-
openModifiers: {}
|
|
295
|
-
}),
|
|
296
|
-
emits: /* @__PURE__ */ k(["close", "openChange"], ["update:open"]),
|
|
297
|
-
setup(e, { emit: t }) {
|
|
298
|
-
let n = e, r = t, i = U(e, "open"), a = y(() => Y("fixed inset-0 z-50 flex items-center justify-center p-4", n.class)), o = y(() => Y("relative z-10 w-full rounded-lg bg-surface-1 shadow-lg", n.maxWidth));
|
|
299
|
-
function s(e) {
|
|
300
|
-
typeof document > "u" || (document.body.style.overflow = e ? "hidden" : "");
|
|
301
|
-
}
|
|
302
|
-
function c() {
|
|
303
|
-
i.value = !1, r("openChange", !1), r("close");
|
|
304
|
-
}
|
|
305
|
-
function l() {
|
|
306
|
-
n.closeOnOverlay && c();
|
|
307
|
-
}
|
|
308
|
-
function u(e) {
|
|
309
|
-
e.key === "Escape" && n.closeOnEsc && i.value && c();
|
|
310
|
-
}
|
|
311
|
-
return W(i, (e) => {
|
|
312
|
-
if (s(e), e && typeof document < "u") {
|
|
313
|
-
document.addEventListener("keydown", u), r("openChange", !0);
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
typeof document < "u" && document.removeEventListener("keydown", u);
|
|
317
|
-
}, { immediate: !0 }), N(() => {
|
|
318
|
-
s(!1), typeof document < "u" && document.removeEventListener("keydown", u);
|
|
319
|
-
}), (t, n) => (P(), b(v, { to: "body" }, [i.value ? (P(), S("div", {
|
|
320
|
-
key: 0,
|
|
321
|
-
class: j(a.value),
|
|
322
|
-
role: "dialog",
|
|
323
|
-
"aria-modal": "true"
|
|
324
|
-
}, [C("div", {
|
|
325
|
-
class: "absolute inset-0 bg-overlay",
|
|
326
|
-
"aria-hidden": "true",
|
|
327
|
-
onClick: l
|
|
328
|
-
}), C("div", {
|
|
329
|
-
class: j(o.value),
|
|
330
|
-
onClick: n[0] || (n[0] = G(() => {}, ["stop"]))
|
|
331
|
-
}, [
|
|
332
|
-
e.title || t.$slots.header || e.showCloseButton ? (P(), S("div", Le, [R(t.$slots, "header", {}, () => [e.title ? (P(), S("h2", Re, B(e.title), 1)) : (P(), S("div", ze))]), e.showCloseButton ? (P(), S("button", {
|
|
333
|
-
key: 0,
|
|
334
|
-
type: "button",
|
|
335
|
-
class: "rounded-md p-1 text-text-tertiary transition-colors hover:bg-surface-3 hover:text-text-secondary",
|
|
336
|
-
"aria-label": "关闭",
|
|
337
|
-
onClick: c
|
|
338
|
-
}, [T(V(J), { size: 18 })])) : x("", !0)])) : x("", !0),
|
|
339
|
-
C("div", Be, [R(t.$slots, "default")]),
|
|
340
|
-
t.$slots.footer ? (P(), S("div", Ve, [R(t.$slots, "footer")])) : x("", !0)
|
|
341
|
-
], 2)], 2)) : x("", !0)]));
|
|
342
|
-
}
|
|
343
|
-
}), Ue = ["aria-describedby"], We = { class: "px-6 pt-6 pb-4" }, Ge = {
|
|
344
|
-
id: "dialog-title",
|
|
345
|
-
class: "text-base font-bold text-text-primary"
|
|
346
|
-
}, Ke = {
|
|
347
|
-
key: 0,
|
|
348
|
-
id: "dialog-description",
|
|
349
|
-
class: "mt-2 text-sm text-text-secondary"
|
|
350
|
-
}, qe = { class: "flex items-center justify-end gap-2 border-t border-border-subtle px-6 py-4" }, Je = /* @__PURE__ */ E({
|
|
351
|
-
name: "UDialog",
|
|
352
|
-
__name: "dialog",
|
|
353
|
-
props: /* @__PURE__ */ k({
|
|
354
|
-
title: {},
|
|
355
|
-
description: { default: void 0 },
|
|
356
|
-
variant: { default: "default" },
|
|
357
|
-
cancelText: { default: "取消" },
|
|
358
|
-
confirmText: { default: "确认" },
|
|
359
|
-
class: { default: void 0 }
|
|
360
|
-
}, {
|
|
361
|
-
open: {
|
|
362
|
-
type: Boolean,
|
|
363
|
-
default: !1
|
|
364
|
-
},
|
|
365
|
-
openModifiers: {}
|
|
366
|
-
}),
|
|
367
|
-
emits: /* @__PURE__ */ k(["confirm", "cancel"], ["update:open"]),
|
|
368
|
-
setup(e, { emit: t }) {
|
|
369
|
-
let n = e, r = t, i = U(e, "open"), a = {
|
|
370
|
-
default: "bg-primary text-primary-fg hover:bg-primary-hover focus-visible:ring-ring",
|
|
371
|
-
destructive: "bg-danger text-danger-fg hover:bg-danger-hover focus-visible:ring-danger"
|
|
372
|
-
}, o = y(() => Y("fixed inset-0 z-50 flex items-center justify-center p-4", n.class)), s = y(() => Y("inline-flex h-9 items-center justify-center rounded-md px-4 text-sm font-medium transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", a[n.variant]));
|
|
373
|
-
function c() {
|
|
374
|
-
r("cancel"), i.value = !1;
|
|
375
|
-
}
|
|
376
|
-
function l() {
|
|
377
|
-
r("confirm"), i.value = !1;
|
|
378
|
-
}
|
|
379
|
-
function u(e) {
|
|
380
|
-
e.key === "Escape" && i.value && c();
|
|
381
|
-
}
|
|
382
|
-
return W(i, (e) => {
|
|
383
|
-
typeof document > "u" || (e ? (document.body.style.overflow = "hidden", document.addEventListener("keydown", u)) : (document.body.style.overflow = "", document.removeEventListener("keydown", u)));
|
|
384
|
-
}, { immediate: !0 }), N(() => {
|
|
385
|
-
typeof document > "u" || (document.body.style.overflow = "", document.removeEventListener("keydown", u));
|
|
386
|
-
}), (t, n) => (P(), b(v, { to: "body" }, [i.value ? (P(), S("div", {
|
|
387
|
-
key: 0,
|
|
388
|
-
class: j(o.value),
|
|
389
|
-
role: "alertdialog",
|
|
390
|
-
"aria-modal": "true",
|
|
391
|
-
"aria-labelledby": "dialog-title",
|
|
392
|
-
"aria-describedby": e.description ? "dialog-description" : void 0
|
|
393
|
-
}, [C("div", {
|
|
394
|
-
class: "absolute inset-0 bg-overlay",
|
|
395
|
-
"aria-hidden": "true",
|
|
396
|
-
onClick: c
|
|
397
|
-
}), C("div", {
|
|
398
|
-
class: "relative z-10 w-full max-w-sm rounded-lg bg-surface-1 shadow-lg",
|
|
399
|
-
onClick: n[0] || (n[0] = G(() => {}, ["stop"]))
|
|
400
|
-
}, [C("div", We, [C("h2", Ge, B(e.title), 1), e.description ? (P(), S("p", Ke, B(e.description), 1)) : x("", !0)]), C("div", qe, [C("button", {
|
|
401
|
-
type: "button",
|
|
402
|
-
class: j(V(Y)("inline-flex h-9 items-center justify-center rounded-md border border-border-strong bg-surface-1 px-4 text-sm font-medium text-text-secondary transition-colors", "hover:bg-surface-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring/30")),
|
|
403
|
-
onClick: c
|
|
404
|
-
}, B(e.cancelText), 3), C("button", {
|
|
405
|
-
type: "button",
|
|
406
|
-
class: j(s.value),
|
|
407
|
-
onClick: l
|
|
408
|
-
}, B(e.confirmText), 3)])])], 10, Ue)) : x("", !0)]));
|
|
409
|
-
}
|
|
410
|
-
}), Ye = Symbol("ug-drawer-context");
|
|
411
|
-
//#endregion
|
|
412
|
-
//#region src/components/drawer.vue?vue&type=script&setup=true&lang.ts
|
|
413
|
-
function Xe() {
|
|
414
|
-
let e = O(Ye);
|
|
415
|
-
if (!e) throw Error("Drawer 子组件必须在 <UDrawer> 内使用");
|
|
416
|
-
return e;
|
|
417
|
-
}
|
|
418
|
-
var Ze = {
|
|
419
|
-
right: "inset-y-0 right-0 h-full w-80 max-w-full",
|
|
420
|
-
left: "inset-y-0 left-0 h-full w-80 max-w-full",
|
|
421
|
-
top: "inset-x-0 top-0 w-full max-h-[80vh]",
|
|
422
|
-
bottom: "inset-x-0 bottom-0 w-full max-h-[80vh]"
|
|
423
|
-
}, Qe = E({
|
|
424
|
-
name: "UDrawerContent",
|
|
425
|
-
props: { class: {
|
|
426
|
-
type: String,
|
|
427
|
-
default: void 0
|
|
428
|
-
} },
|
|
429
|
-
setup(e, { slots: t }) {
|
|
430
|
-
let n = Xe(), r = y(() => Y("absolute flex flex-col bg-surface-1 shadow-xl transition-transform duration-300 ease-in-out", Ze[n.side.value], e.class));
|
|
431
|
-
return () => n.open.value ? D(v, { to: "body" }, [D("div", {
|
|
432
|
-
class: "fixed inset-0 z-50",
|
|
433
|
-
role: "dialog",
|
|
434
|
-
"aria-modal": "true"
|
|
435
|
-
}, [D("div", {
|
|
436
|
-
class: "absolute inset-0 bg-overlay transition-opacity",
|
|
437
|
-
"aria-hidden": "true",
|
|
438
|
-
onClick: () => n.setOpen(!1)
|
|
439
|
-
}), D("div", {
|
|
440
|
-
class: r.value,
|
|
441
|
-
onClick: (e) => e.stopPropagation()
|
|
442
|
-
}, t.default?.())])]) : null;
|
|
443
|
-
}
|
|
444
|
-
}), $e = E({
|
|
445
|
-
name: "UDrawerHeader",
|
|
446
|
-
props: { class: {
|
|
447
|
-
type: String,
|
|
448
|
-
default: void 0
|
|
449
|
-
} },
|
|
450
|
-
setup(e, { slots: t }) {
|
|
451
|
-
let n = y(() => Y("flex flex-col gap-1.5 border-b border-border-base px-6 py-4", e.class));
|
|
452
|
-
return () => D("div", { class: n.value }, t.default?.());
|
|
453
|
-
}
|
|
454
|
-
}), et = E({
|
|
455
|
-
name: "UDrawerTitle",
|
|
456
|
-
props: { class: {
|
|
457
|
-
type: String,
|
|
458
|
-
default: void 0
|
|
459
|
-
} },
|
|
460
|
-
setup(e, { slots: t }) {
|
|
461
|
-
let n = y(() => Y("text-lg font-semibold text-text-primary", e.class));
|
|
462
|
-
return () => D("h2", { class: n.value }, t.default?.());
|
|
463
|
-
}
|
|
464
|
-
}), tt = E({
|
|
465
|
-
name: "UDrawerDescription",
|
|
466
|
-
props: { class: {
|
|
467
|
-
type: String,
|
|
468
|
-
default: void 0
|
|
469
|
-
} },
|
|
470
|
-
setup(e, { slots: t }) {
|
|
471
|
-
let n = y(() => Y("text-sm text-text-secondary", e.class));
|
|
472
|
-
return () => D("p", { class: n.value }, t.default?.());
|
|
473
|
-
}
|
|
474
|
-
}), nt = E({
|
|
475
|
-
name: "UDrawerFooter",
|
|
476
|
-
props: { class: {
|
|
477
|
-
type: String,
|
|
478
|
-
default: void 0
|
|
479
|
-
} },
|
|
480
|
-
setup(e, { slots: t }) {
|
|
481
|
-
let n = y(() => Y("mt-auto flex items-center justify-end gap-2 border-t border-border-base px-6 py-4", e.class));
|
|
482
|
-
return () => D("div", { class: n.value }, t.default?.());
|
|
483
|
-
}
|
|
484
|
-
}), rt = E({
|
|
485
|
-
name: "UDrawerClose",
|
|
486
|
-
props: { class: {
|
|
487
|
-
type: String,
|
|
488
|
-
default: void 0
|
|
489
|
-
} },
|
|
490
|
-
emits: { click: (e) => !0 },
|
|
491
|
-
setup(e, { emit: t, slots: n }) {
|
|
492
|
-
let r = Xe(), i = y(() => Y("inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium text-text-secondary transition-colors hover:bg-surface-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/30", e.class));
|
|
493
|
-
function a(e) {
|
|
494
|
-
r.setOpen(!1), t("click", e);
|
|
495
|
-
}
|
|
496
|
-
return () => D("button", {
|
|
497
|
-
type: "button",
|
|
498
|
-
class: i.value,
|
|
499
|
-
onClick: a
|
|
500
|
-
}, n.default?.() ?? [D(J, { size: 18 })]);
|
|
501
|
-
}
|
|
502
|
-
}), it = /* @__PURE__ */ E({
|
|
503
|
-
name: "UDrawer",
|
|
504
|
-
__name: "drawer",
|
|
505
|
-
props: /* @__PURE__ */ k({
|
|
506
|
-
side: { default: "right" },
|
|
507
|
-
class: { default: void 0 }
|
|
508
|
-
}, {
|
|
509
|
-
open: {
|
|
510
|
-
type: Boolean,
|
|
511
|
-
default: !1
|
|
512
|
-
},
|
|
513
|
-
openModifiers: {}
|
|
514
|
-
}),
|
|
515
|
-
emits: /* @__PURE__ */ k(["openChange"], ["update:open"]),
|
|
516
|
-
setup(e, { emit: t }) {
|
|
517
|
-
let n = e, r = t, i = U(e, "open"), a = y(() => n.side);
|
|
518
|
-
function o(e) {
|
|
519
|
-
i.value = e, r("openChange", e);
|
|
520
|
-
}
|
|
521
|
-
function s(e) {
|
|
522
|
-
e.key === "Escape" && i.value && o(!1);
|
|
523
|
-
}
|
|
524
|
-
return W(i, (e) => {
|
|
525
|
-
typeof document > "u" || (document.body.style.overflow = e ? "hidden" : "", e ? document.addEventListener("keydown", s) : document.removeEventListener("keydown", s));
|
|
526
|
-
}, { immediate: !0 }), N(() => {
|
|
527
|
-
typeof document > "u" || (document.body.style.overflow = "", document.removeEventListener("keydown", s));
|
|
528
|
-
}), F(Ye, {
|
|
529
|
-
open: i,
|
|
530
|
-
side: a,
|
|
531
|
-
setOpen: o
|
|
532
|
-
}), (e, t) => R(e.$slots, "default");
|
|
533
|
-
}
|
|
534
|
-
}), at = { class: "w-full overflow-auto" };
|
|
535
|
-
function Z(e, t, n) {
|
|
536
|
-
return E({
|
|
537
|
-
name: e,
|
|
538
|
-
props: { class: {
|
|
539
|
-
type: String,
|
|
540
|
-
default: void 0
|
|
541
|
-
} },
|
|
542
|
-
setup(e, { attrs: r, slots: i }) {
|
|
543
|
-
let a = y(() => Y(n, e.class));
|
|
544
|
-
return () => D(t, {
|
|
545
|
-
...r,
|
|
546
|
-
class: a.value
|
|
547
|
-
}, i.default?.());
|
|
548
|
-
}
|
|
549
|
-
});
|
|
550
|
-
}
|
|
551
|
-
var ot = Z("UTableHeader", "thead", "[&_tr]:border-b border-border-base"), st = Z("UTableBody", "tbody", "[&_tr:last-child]:border-0"), ct = Z("UTableRow", "tr", "border-b border-border-base transition-colors hover:bg-surface-2"), lt = Z("UTableHead", "th", "h-10 px-4 text-left align-middle font-medium text-text-secondary [&:has([role=checkbox])]:pr-0"), ut = Z("UTableCell", "td", "px-4 py-3 align-middle text-text-primary [&:has([role=checkbox])]:pr-0"), dt = /* @__PURE__ */ E({
|
|
552
|
-
name: "UTable",
|
|
553
|
-
__name: "table",
|
|
554
|
-
props: { class: { default: void 0 } },
|
|
555
|
-
setup(e) {
|
|
556
|
-
let t = e, n = y(() => Y("w-full caption-bottom text-sm", t.class));
|
|
557
|
-
return (e, t) => (P(), S("div", at, [C("table", { class: j(n.value) }, [R(e.$slots, "default")], 2)]));
|
|
558
|
-
}
|
|
559
|
-
}), ft = { class: "font-semibold" }, pt = ["onClick"], mt = /* @__PURE__ */ E({
|
|
560
|
-
name: "UToaster",
|
|
561
|
-
__name: "toast",
|
|
562
|
-
props: { class: { default: void 0 } },
|
|
563
|
-
setup(t) {
|
|
564
|
-
let n = t, r = {
|
|
565
|
-
success: "bg-success-soft border-success/30 text-success-soft-fg",
|
|
566
|
-
error: "bg-danger-soft border-danger/30 text-danger-soft-fg",
|
|
567
|
-
info: "bg-info-soft border-info/30 text-info-soft-fg"
|
|
568
|
-
}, i = {
|
|
569
|
-
success: "成功",
|
|
570
|
-
error: "错误",
|
|
571
|
-
info: "提示"
|
|
572
|
-
}, { items: a } = e(), s = y(() => Y("fixed right-4 top-4 z-[9999] flex w-80 flex-col gap-2", n.class));
|
|
573
|
-
return (e, t) => (P(), b(v, { to: "body" }, [V(a).length ? (P(), S("div", {
|
|
574
|
-
key: 0,
|
|
575
|
-
class: j(s.value),
|
|
576
|
-
role: "region",
|
|
577
|
-
"aria-label": "通知"
|
|
578
|
-
}, [(P(!0), S(_, null, L(V(a), (e) => (P(), S("div", {
|
|
579
|
-
key: e.id,
|
|
580
|
-
class: j(V(Y)("flex items-start justify-between gap-2 rounded-md border px-4 py-3 text-sm shadow-md", r[e.type])),
|
|
581
|
-
role: "alert"
|
|
582
|
-
}, [C("div", null, [C("span", ft, B(i[e.type]) + ":", 1), w(" " + B(e.message), 1)]), C("button", {
|
|
583
|
-
type: "button",
|
|
584
|
-
class: "mt-0.5 shrink-0 opacity-60 transition-opacity hover:opacity-100",
|
|
585
|
-
"aria-label": "关闭通知",
|
|
586
|
-
onClick: (t) => V(o)(e.id)
|
|
587
|
-
}, [T(V(J), { size: 14 })], 8, pt)], 2))), 128))], 2)) : x("", !0)]));
|
|
588
|
-
}
|
|
589
|
-
}), ht = ["for"], gt = { class: "relative inline-flex" }, _t = [
|
|
590
|
-
"id",
|
|
591
|
-
"checked",
|
|
592
|
-
"disabled"
|
|
593
|
-
], vt = {
|
|
594
|
-
key: 1,
|
|
595
|
-
class: "relative inline-flex"
|
|
596
|
-
}, yt = [
|
|
597
|
-
"id",
|
|
598
|
-
"checked",
|
|
599
|
-
"disabled"
|
|
600
|
-
], bt = "peer inline-flex shrink-0 items-center justify-center rounded border transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", xt = /* @__PURE__ */ E({
|
|
601
|
-
__name: "checkbox",
|
|
602
|
-
props: {
|
|
603
|
-
modelValue: {
|
|
604
|
-
type: Boolean,
|
|
605
|
-
default: !1
|
|
606
|
-
},
|
|
607
|
-
indeterminate: {
|
|
608
|
-
type: Boolean,
|
|
609
|
-
default: !1
|
|
610
|
-
},
|
|
611
|
-
size: { default: "default" },
|
|
612
|
-
disabled: {
|
|
613
|
-
type: Boolean,
|
|
614
|
-
default: !1
|
|
615
|
-
},
|
|
616
|
-
label: {},
|
|
617
|
-
id: {},
|
|
618
|
-
class: {},
|
|
619
|
-
labelClass: {}
|
|
620
|
-
},
|
|
621
|
-
emits: ["update:modelValue", "change"],
|
|
622
|
-
setup(e, { emit: t }) {
|
|
623
|
-
let n = e, r = t, i = I(null);
|
|
624
|
-
W(() => n.indeterminate, (e) => {
|
|
625
|
-
i.value && (i.value.indeterminate = e);
|
|
626
|
-
}, { immediate: !0 });
|
|
627
|
-
let a = {
|
|
628
|
-
sm: "h-3.5 w-3.5",
|
|
629
|
-
default: "h-4 w-4",
|
|
630
|
-
lg: "h-5 w-5"
|
|
631
|
-
}, o = {
|
|
632
|
-
unchecked: "border-border-strong bg-surface-1 hover:border-border-strong",
|
|
633
|
-
active: "border-primary bg-primary text-primary-fg focus-visible:ring-ring"
|
|
634
|
-
}, s = y(() => Y(bt, a[n.size], n.indeterminate || n.modelValue ? o.active : o.unchecked, n.class)), c = y(() => n.size === "sm" ? 10 : n.size === "lg" ? 14 : 12), l = y(() => Y("inline-flex cursor-pointer items-center gap-2 text-sm text-text-primary select-none", n.disabled && "cursor-not-allowed opacity-60", n.labelClass));
|
|
635
|
-
function u(e) {
|
|
636
|
-
let t = e.target;
|
|
637
|
-
r("update:modelValue", t.checked), r("change", t.checked);
|
|
638
|
-
}
|
|
639
|
-
return (t, n) => e.label === void 0 ? (P(), S("span", vt, [C("input", {
|
|
640
|
-
id: e.id,
|
|
641
|
-
ref_key: "inputRef",
|
|
642
|
-
ref: i,
|
|
643
|
-
type: "checkbox",
|
|
644
|
-
class: "peer sr-only",
|
|
645
|
-
checked: e.modelValue,
|
|
646
|
-
disabled: e.disabled,
|
|
647
|
-
onChange: u
|
|
648
|
-
}, null, 40, yt), C("span", {
|
|
649
|
-
"aria-hidden": "true",
|
|
650
|
-
class: j(s.value)
|
|
651
|
-
}, [e.indeterminate ? (P(), b(V(q), {
|
|
652
|
-
key: 0,
|
|
653
|
-
size: c.value
|
|
654
|
-
}, null, 8, ["size"])) : e.modelValue ? (P(), b(V(K), {
|
|
655
|
-
key: 1,
|
|
656
|
-
size: c.value
|
|
657
|
-
}, null, 8, ["size"])) : x("", !0)], 2)])) : (P(), S("label", {
|
|
658
|
-
key: 0,
|
|
659
|
-
for: e.id,
|
|
660
|
-
class: j(l.value)
|
|
661
|
-
}, [C("span", gt, [C("input", {
|
|
662
|
-
id: e.id,
|
|
663
|
-
ref_key: "inputRef",
|
|
664
|
-
ref: i,
|
|
665
|
-
type: "checkbox",
|
|
666
|
-
class: "peer sr-only",
|
|
667
|
-
checked: e.modelValue,
|
|
668
|
-
disabled: e.disabled,
|
|
669
|
-
onChange: u
|
|
670
|
-
}, null, 40, _t), C("span", {
|
|
671
|
-
"aria-hidden": "true",
|
|
672
|
-
class: j(s.value)
|
|
673
|
-
}, [e.indeterminate ? (P(), b(V(q), {
|
|
674
|
-
key: 0,
|
|
675
|
-
size: c.value
|
|
676
|
-
}, null, 8, ["size"])) : e.modelValue ? (P(), b(V(K), {
|
|
677
|
-
key: 1,
|
|
678
|
-
size: c.value
|
|
679
|
-
}, null, 8, ["size"])) : x("", !0)], 2)]), C("span", null, B(e.label), 1)], 10, ht));
|
|
680
|
-
}
|
|
681
|
-
}), St = Symbol("ug-radio-group-context"), Ct = ["for"], wt = { class: "relative inline-flex" }, Tt = [
|
|
682
|
-
"id",
|
|
683
|
-
"value",
|
|
684
|
-
"checked",
|
|
685
|
-
"disabled",
|
|
686
|
-
"name"
|
|
687
|
-
], Et = {
|
|
688
|
-
key: 1,
|
|
689
|
-
class: "relative inline-flex"
|
|
690
|
-
}, Dt = [
|
|
691
|
-
"id",
|
|
692
|
-
"value",
|
|
693
|
-
"checked",
|
|
694
|
-
"disabled",
|
|
695
|
-
"name"
|
|
696
|
-
], Ot = "relative inline-flex shrink-0 items-center justify-center rounded-full border transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", kt = /* @__PURE__ */ E({
|
|
697
|
-
name: "URadio",
|
|
698
|
-
__name: "radio",
|
|
699
|
-
props: {
|
|
700
|
-
value: {},
|
|
701
|
-
checked: {
|
|
702
|
-
type: Boolean,
|
|
703
|
-
default: !1
|
|
704
|
-
},
|
|
705
|
-
disabled: {
|
|
706
|
-
type: Boolean,
|
|
707
|
-
default: !1
|
|
708
|
-
},
|
|
709
|
-
size: { default: "default" },
|
|
710
|
-
label: {},
|
|
711
|
-
name: {},
|
|
712
|
-
class: {}
|
|
713
|
-
},
|
|
714
|
-
emits: ["change"],
|
|
715
|
-
setup(e, { emit: t }) {
|
|
716
|
-
let n = e, r = t, i = O(St, null), a = H(), o = y(() => i ? i.value.value === n.value : n.checked), s = y(() => i && i.disabled.value || n.disabled), c = y(() => i ? i.name.value : n.name);
|
|
717
|
-
function l() {
|
|
718
|
-
s.value || (i ? i.onValueChange(n.value) : r("change", n.value));
|
|
719
|
-
}
|
|
720
|
-
let u = {
|
|
721
|
-
sm: "h-3.5 w-3.5",
|
|
722
|
-
default: "h-4 w-4",
|
|
723
|
-
lg: "h-5 w-5"
|
|
724
|
-
}, d = {
|
|
725
|
-
sm: "h-1.5 w-1.5",
|
|
726
|
-
default: "h-2 w-2",
|
|
727
|
-
lg: "h-2.5 w-2.5"
|
|
728
|
-
}, f = y(() => Y(Ot, u[n.size], o.value ? "border-primary bg-primary focus-visible:ring-ring" : "border-border-strong bg-surface-1 hover:border-border-strong", s.value && "cursor-not-allowed opacity-50", n.class)), p = y(() => Y("inline-flex cursor-pointer items-center gap-2 text-sm text-text-primary select-none", s.value && "cursor-not-allowed opacity-60"));
|
|
729
|
-
return (t, n) => e.label === void 0 ? (P(), S("span", Et, [C("input", {
|
|
730
|
-
id: V(a),
|
|
731
|
-
type: "radio",
|
|
732
|
-
class: "peer sr-only",
|
|
733
|
-
value: e.value,
|
|
734
|
-
checked: o.value,
|
|
735
|
-
disabled: s.value,
|
|
736
|
-
name: c.value,
|
|
737
|
-
onChange: l
|
|
738
|
-
}, null, 40, Dt), C("span", {
|
|
739
|
-
"aria-hidden": "true",
|
|
740
|
-
class: j(f.value)
|
|
741
|
-
}, [o.value ? (P(), S("span", {
|
|
742
|
-
key: 0,
|
|
743
|
-
class: j(V(Y)("rounded-full bg-white", d[e.size]))
|
|
744
|
-
}, null, 2)) : x("", !0)], 2)])) : (P(), S("label", {
|
|
745
|
-
key: 0,
|
|
746
|
-
for: V(a),
|
|
747
|
-
class: j(p.value)
|
|
748
|
-
}, [C("span", wt, [C("input", {
|
|
749
|
-
id: V(a),
|
|
750
|
-
type: "radio",
|
|
751
|
-
class: "peer sr-only",
|
|
752
|
-
value: e.value,
|
|
753
|
-
checked: o.value,
|
|
754
|
-
disabled: s.value,
|
|
755
|
-
name: c.value,
|
|
756
|
-
onChange: l
|
|
757
|
-
}, null, 40, Tt), C("span", {
|
|
758
|
-
"aria-hidden": "true",
|
|
759
|
-
class: j(f.value)
|
|
760
|
-
}, [o.value ? (P(), S("span", {
|
|
761
|
-
key: 0,
|
|
762
|
-
class: j(V(Y)("rounded-full bg-white", d[e.size]))
|
|
763
|
-
}, null, 2)) : x("", !0)], 2)]), C("span", null, B(e.label), 1)], 10, Ct));
|
|
764
|
-
}
|
|
765
|
-
}), At = /* @__PURE__ */ E({
|
|
766
|
-
name: "URadioGroup",
|
|
767
|
-
__name: "radio-group",
|
|
768
|
-
props: {
|
|
769
|
-
modelValue: {},
|
|
770
|
-
defaultValue: {},
|
|
771
|
-
disabled: {
|
|
772
|
-
type: Boolean,
|
|
773
|
-
default: !1
|
|
774
|
-
},
|
|
775
|
-
name: {},
|
|
776
|
-
orientation: { default: "vertical" },
|
|
777
|
-
class: {}
|
|
778
|
-
},
|
|
779
|
-
emits: ["update:modelValue", "change"],
|
|
780
|
-
setup(e, { emit: t }) {
|
|
781
|
-
let n = e, r = t, i = y(() => n.modelValue !== void 0), a = I(n.defaultValue), o = y(() => i.value ? n.modelValue : a.value);
|
|
782
|
-
function s(e) {
|
|
783
|
-
i.value || (a.value = e), r("update:modelValue", e), r("change", e);
|
|
784
|
-
}
|
|
785
|
-
F(St, {
|
|
786
|
-
value: o,
|
|
787
|
-
onValueChange: s,
|
|
788
|
-
name: y(() => n.name),
|
|
789
|
-
disabled: y(() => n.disabled)
|
|
790
|
-
});
|
|
791
|
-
let c = y(() => Y("flex", n.orientation === "vertical" ? "flex-col gap-2" : "flex-row flex-wrap gap-4", n.class));
|
|
792
|
-
return (e, t) => (P(), S("div", {
|
|
793
|
-
role: "radiogroup",
|
|
794
|
-
class: j(c.value)
|
|
795
|
-
}, [R(e.$slots, "default")], 2));
|
|
796
|
-
}
|
|
797
|
-
}), jt = {
|
|
798
|
-
key: 0,
|
|
799
|
-
class: "self-start text-xs font-medium text-text-primary"
|
|
800
|
-
}, Mt = { class: "relative flex h-5 w-full items-center" }, Nt = { class: "pointer-events-none absolute h-1.5 w-full overflow-hidden rounded-full bg-surface-3" }, Pt = [
|
|
801
|
-
"min",
|
|
802
|
-
"max",
|
|
803
|
-
"step",
|
|
804
|
-
"value",
|
|
805
|
-
"disabled"
|
|
806
|
-
], Ft = /* @__PURE__ */ E({
|
|
807
|
-
name: "USlider",
|
|
808
|
-
__name: "slider",
|
|
809
|
-
props: {
|
|
810
|
-
modelValue: {},
|
|
811
|
-
defaultValue: { default: 0 },
|
|
812
|
-
min: { default: 0 },
|
|
813
|
-
max: { default: 100 },
|
|
814
|
-
step: { default: 1 },
|
|
815
|
-
disabled: {
|
|
816
|
-
type: Boolean,
|
|
817
|
-
default: !1
|
|
818
|
-
},
|
|
819
|
-
showValue: {
|
|
820
|
-
type: Boolean,
|
|
821
|
-
default: !1
|
|
822
|
-
},
|
|
823
|
-
class: {}
|
|
824
|
-
},
|
|
825
|
-
emits: ["update:modelValue", "change"],
|
|
826
|
-
setup(e, { emit: t }) {
|
|
827
|
-
let n = e, r = t, i = y(() => n.modelValue !== void 0), a = I(n.defaultValue), o = y(() => i.value ? n.modelValue : a.value), s = y(() => {
|
|
828
|
-
let e = n.max - n.min;
|
|
829
|
-
return e === 0 ? 0 : (o.value - n.min) / e * 100;
|
|
830
|
-
});
|
|
831
|
-
function c(e) {
|
|
832
|
-
let t = Number(e.target.value);
|
|
833
|
-
i.value || (a.value = t), r("update:modelValue", t), r("change", t);
|
|
834
|
-
}
|
|
835
|
-
let l = y(() => Y("flex flex-col gap-1", n.class));
|
|
836
|
-
return (t, n) => (P(), S("div", { class: j(l.value) }, [e.showValue ? (P(), S("span", jt, B(o.value), 1)) : x("", !0), C("div", Mt, [C("div", Nt, [C("div", {
|
|
837
|
-
class: "h-full rounded-full bg-primary transition-all",
|
|
838
|
-
style: M({ width: `${s.value}%` })
|
|
839
|
-
}, null, 4)]), C("input", {
|
|
840
|
-
type: "range",
|
|
841
|
-
min: e.min,
|
|
842
|
-
max: e.max,
|
|
843
|
-
step: e.step,
|
|
844
|
-
value: o.value,
|
|
845
|
-
disabled: e.disabled,
|
|
846
|
-
class: j(V(Y)("relative h-5 w-full cursor-pointer appearance-none bg-transparent", "[&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-border-strong [&::-webkit-slider-thumb]:bg-surface-1 [&::-webkit-slider-thumb]:shadow-sm [&::-webkit-slider-thumb]:transition-transform [&::-webkit-slider-thumb]:hover:scale-110", "[&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:appearance-none [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-border-strong [&::-moz-range-thumb]:bg-surface-1 [&::-moz-range-thumb]:shadow-sm", "[&::-webkit-slider-runnable-track]:bg-transparent", "[&::-moz-range-track]:bg-transparent", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", "disabled:cursor-not-allowed disabled:opacity-50")),
|
|
847
|
-
onInput: c,
|
|
848
|
-
onChange: c
|
|
849
|
-
}, null, 42, Pt)])], 2));
|
|
850
|
-
}
|
|
851
|
-
}), It = ["disabled"], Lt = [
|
|
852
|
-
"value",
|
|
853
|
-
"disabled",
|
|
854
|
-
"placeholder",
|
|
855
|
-
"min",
|
|
856
|
-
"max",
|
|
857
|
-
"step"
|
|
858
|
-
], Rt = ["disabled"], zt = "inline-flex shrink-0 items-center justify-center text-text-secondary transition-colors hover:bg-surface-3 hover:text-text-primary disabled:pointer-events-none disabled:opacity-40", Bt = /* @__PURE__ */ E({
|
|
859
|
-
name: "UNumberInput",
|
|
860
|
-
__name: "number-input",
|
|
861
|
-
props: {
|
|
862
|
-
modelValue: {},
|
|
863
|
-
defaultValue: { default: 0 },
|
|
864
|
-
min: {},
|
|
865
|
-
max: {},
|
|
866
|
-
step: { default: 1 },
|
|
867
|
-
precision: { default: 0 },
|
|
868
|
-
disabled: {
|
|
869
|
-
type: Boolean,
|
|
870
|
-
default: !1
|
|
871
|
-
},
|
|
872
|
-
placeholder: {},
|
|
873
|
-
size: { default: "default" },
|
|
874
|
-
class: {}
|
|
875
|
-
},
|
|
876
|
-
emits: ["update:modelValue", "change"],
|
|
877
|
-
setup(e, { emit: t }) {
|
|
878
|
-
let n = e, r = t, i = y(() => n.modelValue !== void 0), a = I(n.defaultValue), o = y(() => i.value ? n.modelValue : a.value);
|
|
879
|
-
function s(e) {
|
|
880
|
-
let t = e;
|
|
881
|
-
return n.min !== void 0 && (t = Math.max(n.min, t)), n.max !== void 0 && (t = Math.min(n.max, t)), t;
|
|
882
|
-
}
|
|
883
|
-
function c(e) {
|
|
884
|
-
let t = s(Number(e.toFixed(n.precision)));
|
|
885
|
-
i.value || (a.value = t), r("update:modelValue", t), r("change", t);
|
|
886
|
-
}
|
|
887
|
-
function l() {
|
|
888
|
-
n.disabled || c(o.value - n.step);
|
|
889
|
-
}
|
|
890
|
-
function u() {
|
|
891
|
-
n.disabled || c(o.value + n.step);
|
|
892
|
-
}
|
|
893
|
-
function d(e) {
|
|
894
|
-
let t = parseFloat(e.target.value);
|
|
895
|
-
Number.isNaN(t) || c(t);
|
|
896
|
-
}
|
|
897
|
-
function f(e) {
|
|
898
|
-
let t = parseFloat(e.target.value);
|
|
899
|
-
Number.isNaN(t) || c(t);
|
|
900
|
-
}
|
|
901
|
-
let p = y(() => n.min !== void 0 && o.value <= n.min), m = y(() => n.max !== void 0 && o.value >= n.max), h = y(() => o.value.toFixed(n.precision)), g = {
|
|
902
|
-
sm: "h-8 text-xs",
|
|
903
|
-
default: "h-9 text-sm",
|
|
904
|
-
lg: "h-11 text-base"
|
|
905
|
-
}, _ = {
|
|
906
|
-
sm: "h-8 w-7",
|
|
907
|
-
default: "h-9 w-8",
|
|
908
|
-
lg: "h-11 w-9"
|
|
909
|
-
}, v = {
|
|
910
|
-
sm: 12,
|
|
911
|
-
default: 14,
|
|
912
|
-
lg: 16
|
|
913
|
-
}, b = y(() => Y("inline-flex items-center rounded-md border border-border-strong bg-surface-1 transition-colors", "focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-1", n.disabled && "pointer-events-none opacity-50", g[n.size], n.class)), x = y(() => Y(zt, _[n.size]));
|
|
914
|
-
return (t, n) => (P(), S("div", { class: j(b.value) }, [
|
|
915
|
-
C("button", {
|
|
916
|
-
type: "button",
|
|
917
|
-
"aria-label": "减少数值",
|
|
918
|
-
disabled: e.disabled || p.value,
|
|
919
|
-
class: j(V(Y)(x.value, "rounded-l-md border-r border-border-base")),
|
|
920
|
-
tabindex: "-1",
|
|
921
|
-
onClick: l
|
|
922
|
-
}, [T(V(q), { size: v[e.size] }, null, 8, ["size"])], 10, It),
|
|
923
|
-
C("input", {
|
|
924
|
-
type: "number",
|
|
925
|
-
value: h.value,
|
|
926
|
-
disabled: e.disabled,
|
|
927
|
-
placeholder: e.placeholder,
|
|
928
|
-
min: e.min,
|
|
929
|
-
max: e.max,
|
|
930
|
-
step: e.step,
|
|
931
|
-
class: "min-w-0 flex-1 bg-transparent text-center text-text-primary outline-none placeholder:text-text-tertiary [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
|
|
932
|
-
onInput: d,
|
|
933
|
-
onBlur: f
|
|
934
|
-
}, null, 40, Lt),
|
|
935
|
-
C("button", {
|
|
936
|
-
type: "button",
|
|
937
|
-
"aria-label": "增加数值",
|
|
938
|
-
disabled: e.disabled || m.value,
|
|
939
|
-
class: j(V(Y)(x.value, "rounded-r-md border-l border-border-base")),
|
|
940
|
-
tabindex: "-1",
|
|
941
|
-
onClick: u
|
|
942
|
-
}, [T(V(de), { size: v[e.size] }, null, 8, ["size"])], 10, Rt)
|
|
943
|
-
], 2));
|
|
944
|
-
}
|
|
945
|
-
}), Vt = [
|
|
946
|
-
"value",
|
|
947
|
-
"disabled",
|
|
948
|
-
"aria-label",
|
|
949
|
-
"onInput",
|
|
950
|
-
"onKeydown"
|
|
951
|
-
], Ht = /* @__PURE__ */ E({
|
|
952
|
-
name: "UOTPInput",
|
|
953
|
-
__name: "otp-input",
|
|
954
|
-
props: /* @__PURE__ */ k({
|
|
955
|
-
length: { default: 6 },
|
|
956
|
-
disabled: {
|
|
957
|
-
type: Boolean,
|
|
958
|
-
default: !1
|
|
959
|
-
},
|
|
960
|
-
class: { default: void 0 }
|
|
961
|
-
}, {
|
|
962
|
-
modelValue: { default: "" },
|
|
963
|
-
modelModifiers: {}
|
|
964
|
-
}),
|
|
965
|
-
emits: /* @__PURE__ */ k(["complete"], ["update:modelValue"]),
|
|
966
|
-
setup(e, { emit: t }) {
|
|
967
|
-
let n = e, r = t, i = U(e, "modelValue"), a = I([]), o = y(() => {
|
|
968
|
-
let e = i.value.split("").slice(0, n.length);
|
|
969
|
-
for (; e.length < n.length;) e.push("");
|
|
970
|
-
return e;
|
|
971
|
-
});
|
|
972
|
-
function s(e) {
|
|
973
|
-
A(() => {
|
|
974
|
-
let t = a.value[e];
|
|
975
|
-
t && (t.focus(), t.setSelectionRange(t.value.length, t.value.length));
|
|
976
|
-
});
|
|
977
|
-
}
|
|
978
|
-
function c(e, t) {
|
|
979
|
-
let a = o.value.slice();
|
|
980
|
-
a[e] = t;
|
|
981
|
-
let s = a.join("");
|
|
982
|
-
i.value = s, s.replace(/\s/g, "").length === n.length && !s.includes("") && r("complete", s);
|
|
983
|
-
}
|
|
984
|
-
function l(e, t) {
|
|
985
|
-
let r = t.target, i = r.value.replace(/\D/g, "").slice(-1);
|
|
986
|
-
r.value = i, c(e, i), i && e < n.length - 1 && s(e + 1);
|
|
987
|
-
}
|
|
988
|
-
function u(e, t) {
|
|
989
|
-
t.key === "ArrowLeft" ? (t.preventDefault(), e > 0 && s(e - 1)) : t.key === "ArrowRight" ? (t.preventDefault(), e < n.length - 1 && s(e + 1)) : t.key === "Backspace" && (t.preventDefault(), o.value[e] ?? "" ? c(e, "") : e > 0 && (c(e - 1, ""), s(e - 1)));
|
|
990
|
-
}
|
|
991
|
-
function d(e) {
|
|
992
|
-
e.preventDefault();
|
|
993
|
-
let t = (e.clipboardData?.getData("text") ?? "").replace(/\D/g, "").slice(0, n.length);
|
|
994
|
-
if (!t) return;
|
|
995
|
-
let a = t.padEnd(n.length, "").split("").slice(0, n.length).join("");
|
|
996
|
-
i.value = a, s(Math.min(t.length, n.length - 1)), t.length === n.length && r("complete", a);
|
|
997
|
-
}
|
|
998
|
-
function f(e) {
|
|
999
|
-
e.target.select();
|
|
1000
|
-
}
|
|
1001
|
-
let p = y(() => Y("flex items-center gap-2", n.class));
|
|
1002
|
-
function m(e) {
|
|
1003
|
-
return Y("h-10 w-10 rounded-md border text-center text-sm font-medium text-text-primary transition-colors", "outline-none focus:border-primary focus:ring-2 focus:ring-ring/20", "disabled:cursor-not-allowed disabled:opacity-50", e ? "border-border-strong" : "border-border-base");
|
|
1004
|
-
}
|
|
1005
|
-
return (t, n) => (P(), S("div", {
|
|
1006
|
-
class: j(p.value),
|
|
1007
|
-
role: "group",
|
|
1008
|
-
"aria-label": "验证码输入"
|
|
1009
|
-
}, [(P(!0), S(_, null, L(o.value, (t, n) => (P(), S("input", {
|
|
1010
|
-
key: n,
|
|
1011
|
-
ref_for: !0,
|
|
1012
|
-
ref: (e) => {
|
|
1013
|
-
a.value[n] = e;
|
|
1
|
+
import { $ as e, A as t, B as n, C as r, Ct as i, D as a, Dt as o, E as s, Et as ee, F as c, G as l, H as u, I as d, J as f, K as p, L as m, M as h, N as g, O as _, P as v, Q as y, R as b, S as x, St as S, T as C, Tt as w, U as T, V as E, W as D, X as O, Y as k, Z as A, _ as j, _t as M, a as N, at as P, b as F, bt as I, c as L, ct as R, d as z, dt as B, et as V, f as H, ft as U, g as W, gt as G, h as K, ht as q, i as J, it as Y, j as X, k as Z, l as Q, lt as $, m as te, mt as ne, n as re, nt as ie, o as ae, ot as oe, p as se, pt as ce, q as le, r as ue, rt as de, s as fe, st as pe, t as me, tt as he, u as ge, ut as _e, v as ve, vt as ye, w as be, wt as xe, x as Se, xt as Ce, y as we, yt as Te, z as Ee } from "./aliases-u3xep8jx.js";
|
|
2
|
+
import { n as De, t as Oe } from "./button-Sy9e0tiI.js";
|
|
3
|
+
import { a as ke, c as Ae, d as je, f as Me, i as Ne, l as Pe, n as Fe, o as Ie, r as Le, s as Re, t as ze, u as Be } from "./separator-BnNQAp6A.js";
|
|
4
|
+
import { n as Ve, t as He } from "./sidebar-BnZB7vlK.js";
|
|
5
|
+
import { n as Ue } from "./toast-state-Crugc-IE.js";
|
|
6
|
+
import { a as We, c as Ge, d as Ke, f as qe, i as Je, l as Ye, m as Xe, n as Ze, o as Qe, p as $e, r as et, s as tt, t as nt, u as rt } from "./composables-YMNfao5g.js";
|
|
7
|
+
//#region src/plugin.ts
|
|
8
|
+
var it = Object.entries(me), at = (e) => {
|
|
9
|
+
for (let [t, n] of it) e.component(t, n);
|
|
10
|
+
}, ot = { install: at }, st = {
|
|
11
|
+
colors: {
|
|
12
|
+
primary: {
|
|
13
|
+
DEFAULT: "hsl(var(--primary))",
|
|
14
|
+
hover: "hsl(var(--primary-hover))",
|
|
15
|
+
active: "hsl(var(--primary-active))",
|
|
16
|
+
foreground: "hsl(var(--primary-fg))",
|
|
17
|
+
soft: "hsl(var(--primary-soft) / 0.12)",
|
|
18
|
+
softForeground: "hsl(var(--primary-soft-fg))"
|
|
19
|
+
},
|
|
20
|
+
success: {
|
|
21
|
+
DEFAULT: "hsl(var(--success))",
|
|
22
|
+
hover: "hsl(var(--success-hover))",
|
|
23
|
+
foreground: "hsl(var(--success-fg))",
|
|
24
|
+
soft: "hsl(var(--success-soft) / 0.12)",
|
|
25
|
+
softForeground: "hsl(var(--success-soft-fg))"
|
|
26
|
+
},
|
|
27
|
+
warning: {
|
|
28
|
+
DEFAULT: "hsl(var(--warning))",
|
|
29
|
+
hover: "hsl(var(--warning-hover))",
|
|
30
|
+
foreground: "hsl(var(--warning-fg))",
|
|
31
|
+
soft: "hsl(var(--warning-soft) / 0.12)",
|
|
32
|
+
softForeground: "hsl(var(--warning-soft-fg))"
|
|
33
|
+
},
|
|
34
|
+
danger: {
|
|
35
|
+
DEFAULT: "hsl(var(--danger))",
|
|
36
|
+
hover: "hsl(var(--danger-hover))",
|
|
37
|
+
foreground: "hsl(var(--danger-fg))",
|
|
38
|
+
soft: "hsl(var(--danger-soft) / 0.12)",
|
|
39
|
+
softForeground: "hsl(var(--danger-soft-fg))"
|
|
40
|
+
},
|
|
41
|
+
info: {
|
|
42
|
+
DEFAULT: "hsl(var(--info))",
|
|
43
|
+
hover: "hsl(var(--info-hover))",
|
|
44
|
+
foreground: "hsl(var(--info-fg))",
|
|
45
|
+
soft: "hsl(var(--info-soft) / 0.12)",
|
|
46
|
+
softForeground: "hsl(var(--info-soft-fg))"
|
|
47
|
+
},
|
|
48
|
+
surface: {
|
|
49
|
+
0: "hsl(var(--surface-0))",
|
|
50
|
+
1: "hsl(var(--surface-1))",
|
|
51
|
+
2: "hsl(var(--surface-2))",
|
|
52
|
+
3: "hsl(var(--surface-3))"
|
|
53
|
+
},
|
|
54
|
+
text: {
|
|
55
|
+
primary: "hsl(var(--text-primary))",
|
|
56
|
+
secondary: "hsl(var(--text-secondary))",
|
|
57
|
+
tertiary: "hsl(var(--text-tertiary))",
|
|
58
|
+
inverted: "hsl(var(--text-inverted))"
|
|
59
|
+
},
|
|
60
|
+
border: {
|
|
61
|
+
strong: "hsl(var(--border-strong))",
|
|
62
|
+
base: "hsl(var(--border-base))",
|
|
63
|
+
subtle: "hsl(var(--border-subtle))"
|
|
64
|
+
},
|
|
65
|
+
ring: "hsl(var(--ring))",
|
|
66
|
+
overlay: "hsl(var(--overlay) / var(--overlay-alpha))"
|
|
67
|
+
},
|
|
68
|
+
radius: {
|
|
69
|
+
sm: "var(--radius-sm)",
|
|
70
|
+
md: "var(--radius-md)",
|
|
71
|
+
lg: "var(--radius-lg)",
|
|
72
|
+
xl: "var(--radius-xl)",
|
|
73
|
+
full: "9999px"
|
|
74
|
+
},
|
|
75
|
+
fontFamily: {
|
|
76
|
+
sans: "var(--font-sans)",
|
|
77
|
+
mono: "var(--font-mono)"
|
|
78
|
+
}
|
|
79
|
+
}, ct = [
|
|
80
|
+
{
|
|
81
|
+
id: "primitives",
|
|
82
|
+
label: "基础组件",
|
|
83
|
+
description: "最小可复用视觉单元,负责按钮、容器、标签、分隔和加载基础状态。",
|
|
84
|
+
components: [
|
|
85
|
+
{
|
|
86
|
+
name: "UGButton",
|
|
87
|
+
route: "/vue/components/button"
|
|
1014
88
|
},
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
maxlength: 1,
|
|
1019
|
-
value: t,
|
|
1020
|
-
disabled: e.disabled,
|
|
1021
|
-
"aria-label": `验证码第 ${n + 1} 位`,
|
|
1022
|
-
class: j(m(t)),
|
|
1023
|
-
onInput: (e) => l(n, e),
|
|
1024
|
-
onKeydown: (e) => u(n, e),
|
|
1025
|
-
onPaste: d,
|
|
1026
|
-
onClick: f
|
|
1027
|
-
}, null, 42, Vt))), 128))], 2));
|
|
1028
|
-
}
|
|
1029
|
-
}), Ut = Symbol("ug-form-field-context");
|
|
1030
|
-
//#endregion
|
|
1031
|
-
//#region src/components/form.vue?vue&type=script&setup=true&lang.ts
|
|
1032
|
-
function Q() {
|
|
1033
|
-
let e = O(Ut);
|
|
1034
|
-
if (!e) throw Error("FormField 子组件必须在 <UFormField> 内使用");
|
|
1035
|
-
return e;
|
|
1036
|
-
}
|
|
1037
|
-
var Wt = E({
|
|
1038
|
-
name: "UFormField",
|
|
1039
|
-
props: {
|
|
1040
|
-
name: {
|
|
1041
|
-
type: String,
|
|
1042
|
-
required: !0
|
|
1043
|
-
},
|
|
1044
|
-
error: {
|
|
1045
|
-
type: String,
|
|
1046
|
-
default: void 0
|
|
1047
|
-
},
|
|
1048
|
-
class: {
|
|
1049
|
-
type: String,
|
|
1050
|
-
default: void 0
|
|
1051
|
-
}
|
|
1052
|
-
},
|
|
1053
|
-
setup(e, { slots: t }) {
|
|
1054
|
-
let n = H();
|
|
1055
|
-
return F(Ut, {
|
|
1056
|
-
name: y(() => e.name),
|
|
1057
|
-
error: y(() => e.error),
|
|
1058
|
-
id: y(() => `form-field-${n}`)
|
|
1059
|
-
}), () => D("div", { class: Y(e.class) }, t.default?.());
|
|
1060
|
-
}
|
|
1061
|
-
}), Gt = E({
|
|
1062
|
-
name: "UFormItem",
|
|
1063
|
-
props: { class: {
|
|
1064
|
-
type: String,
|
|
1065
|
-
default: void 0
|
|
1066
|
-
} },
|
|
1067
|
-
setup(e, { slots: t }) {
|
|
1068
|
-
let n = y(() => Y("flex flex-col gap-1.5", e.class));
|
|
1069
|
-
return () => D("div", { class: n.value }, t.default?.());
|
|
1070
|
-
}
|
|
1071
|
-
}), Kt = E({
|
|
1072
|
-
name: "UFormLabel",
|
|
1073
|
-
props: {
|
|
1074
|
-
required: {
|
|
1075
|
-
type: Boolean,
|
|
1076
|
-
default: !1
|
|
1077
|
-
},
|
|
1078
|
-
for: {
|
|
1079
|
-
type: String,
|
|
1080
|
-
default: void 0
|
|
1081
|
-
},
|
|
1082
|
-
class: {
|
|
1083
|
-
type: String,
|
|
1084
|
-
default: void 0
|
|
1085
|
-
}
|
|
1086
|
-
},
|
|
1087
|
-
setup(e, { slots: t }) {
|
|
1088
|
-
let n = Q(), r = y(() => Y("leading-none text-sm font-medium text-text-primary", e.class)), i = y(() => e.for ?? n.id.value);
|
|
1089
|
-
return () => D("label", {
|
|
1090
|
-
for: i.value,
|
|
1091
|
-
class: r.value
|
|
1092
|
-
}, [t.default?.(), e.required ? D("span", {
|
|
1093
|
-
class: "ml-0.5 text-danger",
|
|
1094
|
-
"aria-hidden": "true"
|
|
1095
|
-
}, "*") : null]);
|
|
1096
|
-
}
|
|
1097
|
-
}), qt = E({
|
|
1098
|
-
name: "UFormControl",
|
|
1099
|
-
props: { class: {
|
|
1100
|
-
type: String,
|
|
1101
|
-
default: void 0
|
|
1102
|
-
} },
|
|
1103
|
-
setup(e, { slots: t }) {
|
|
1104
|
-
let n = Q(), r = y(() => Y(e.class)), i = y(() => `${n.id.value}-description`), a = y(() => `${n.id.value}-message`), o = y(() => n.error.value ? `${i.value} ${a.value}` : i.value);
|
|
1105
|
-
return () => D("div", {
|
|
1106
|
-
id: n.id.value,
|
|
1107
|
-
class: r.value || void 0,
|
|
1108
|
-
"aria-describedby": o.value,
|
|
1109
|
-
"aria-invalid": n.error.value ? "true" : void 0
|
|
1110
|
-
}, t.default?.());
|
|
1111
|
-
}
|
|
1112
|
-
}), Jt = E({
|
|
1113
|
-
name: "UFormDescription",
|
|
1114
|
-
props: { class: {
|
|
1115
|
-
type: String,
|
|
1116
|
-
default: void 0
|
|
1117
|
-
} },
|
|
1118
|
-
setup(e, { slots: t }) {
|
|
1119
|
-
let n = Q(), r = y(() => Y("text-xs text-text-secondary", e.class)), i = y(() => `${n.id.value}-description`);
|
|
1120
|
-
return () => D("p", {
|
|
1121
|
-
id: i.value,
|
|
1122
|
-
class: r.value
|
|
1123
|
-
}, t.default?.());
|
|
1124
|
-
}
|
|
1125
|
-
}), Yt = E({
|
|
1126
|
-
name: "UFormMessage",
|
|
1127
|
-
props: { class: {
|
|
1128
|
-
type: String,
|
|
1129
|
-
default: void 0
|
|
1130
|
-
} },
|
|
1131
|
-
setup(e, { slots: t }) {
|
|
1132
|
-
let n = Q(), r = y(() => Y("text-xs text-danger-soft-fg", e.class)), i = y(() => `${n.id.value}-message`);
|
|
1133
|
-
return () => {
|
|
1134
|
-
let e = n.error.value, a = t.default?.(), o = a && a.length > 0;
|
|
1135
|
-
return !e && !o ? null : D("p", {
|
|
1136
|
-
id: i.value,
|
|
1137
|
-
class: r.value,
|
|
1138
|
-
role: "alert"
|
|
1139
|
-
}, e ?? a);
|
|
1140
|
-
};
|
|
1141
|
-
}
|
|
1142
|
-
}), Xt = /* @__PURE__ */ E({
|
|
1143
|
-
name: "UForm",
|
|
1144
|
-
__name: "form",
|
|
1145
|
-
props: { class: { default: void 0 } },
|
|
1146
|
-
emits: ["submit"],
|
|
1147
|
-
setup(e, { emit: t }) {
|
|
1148
|
-
let n = e, r = t, i = y(() => Y(n.class));
|
|
1149
|
-
function a(e) {
|
|
1150
|
-
r("submit", e);
|
|
1151
|
-
}
|
|
1152
|
-
return (e, t) => (P(), S("form", {
|
|
1153
|
-
class: j(i.value),
|
|
1154
|
-
onSubmit: G(a, ["prevent"])
|
|
1155
|
-
}, [R(e.$slots, "default")], 34));
|
|
1156
|
-
}
|
|
1157
|
-
}), Zt = Symbol("ug-tabs-context");
|
|
1158
|
-
//#endregion
|
|
1159
|
-
//#region src/components/tabs.vue?vue&type=script&setup=true&lang.ts
|
|
1160
|
-
function Qt() {
|
|
1161
|
-
let e = O(Zt);
|
|
1162
|
-
if (!e) throw Error("Tabs 子组件必须在 <UTabs> 内使用");
|
|
1163
|
-
return e;
|
|
1164
|
-
}
|
|
1165
|
-
var $t = E({
|
|
1166
|
-
name: "UTabsList",
|
|
1167
|
-
props: { class: {
|
|
1168
|
-
type: String,
|
|
1169
|
-
default: void 0
|
|
1170
|
-
} },
|
|
1171
|
-
setup(e, { slots: t }) {
|
|
1172
|
-
let n = y(() => Y("inline-flex w-full items-center gap-0 border-b border-border-base", e.class));
|
|
1173
|
-
return () => D("div", {
|
|
1174
|
-
role: "tablist",
|
|
1175
|
-
class: n.value
|
|
1176
|
-
}, t.default?.());
|
|
1177
|
-
}
|
|
1178
|
-
}), en = E({
|
|
1179
|
-
name: "UTabsTrigger",
|
|
1180
|
-
props: {
|
|
1181
|
-
value: {
|
|
1182
|
-
type: String,
|
|
1183
|
-
required: !0
|
|
1184
|
-
},
|
|
1185
|
-
disabled: {
|
|
1186
|
-
type: Boolean,
|
|
1187
|
-
default: !1
|
|
1188
|
-
},
|
|
1189
|
-
class: {
|
|
1190
|
-
type: String,
|
|
1191
|
-
default: void 0
|
|
1192
|
-
}
|
|
1193
|
-
},
|
|
1194
|
-
emits: { click: (e) => !0 },
|
|
1195
|
-
setup(e, { emit: t, slots: n }) {
|
|
1196
|
-
let r = Qt(), i = y(() => r.modelValue.value === e.value), a = y(() => Y("relative px-4 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/30 focus-visible:ring-offset-1 disabled:pointer-events-none disabled:opacity-50", "after:absolute after:bottom-0 after:left-0 after:h-0.5 after:w-full after:transition-colors", i.value ? "text-text-primary after:bg-primary" : "text-text-secondary hover:text-text-primary after:bg-transparent", e.class));
|
|
1197
|
-
function o(n) {
|
|
1198
|
-
e.disabled || (r.setValue(e.value), t("click", n));
|
|
1199
|
-
}
|
|
1200
|
-
return () => D("button", {
|
|
1201
|
-
type: "button",
|
|
1202
|
-
role: "tab",
|
|
1203
|
-
"aria-selected": i.value,
|
|
1204
|
-
tabindex: i.value ? 0 : -1,
|
|
1205
|
-
disabled: e.disabled,
|
|
1206
|
-
class: a.value,
|
|
1207
|
-
onClick: o
|
|
1208
|
-
}, n.default?.());
|
|
1209
|
-
}
|
|
1210
|
-
}), tn = E({
|
|
1211
|
-
name: "UTabsContent",
|
|
1212
|
-
props: {
|
|
1213
|
-
value: {
|
|
1214
|
-
type: String,
|
|
1215
|
-
required: !0
|
|
1216
|
-
},
|
|
1217
|
-
class: {
|
|
1218
|
-
type: String,
|
|
1219
|
-
default: void 0
|
|
1220
|
-
}
|
|
1221
|
-
},
|
|
1222
|
-
setup(e, { slots: t }) {
|
|
1223
|
-
let n = Qt(), r = y(() => n.modelValue.value === e.value), i = y(() => Y("mt-4 focus-visible:outline-none", e.class));
|
|
1224
|
-
return () => r.value ? D("div", {
|
|
1225
|
-
role: "tabpanel",
|
|
1226
|
-
tabindex: 0,
|
|
1227
|
-
class: i.value
|
|
1228
|
-
}, t.default?.()) : null;
|
|
1229
|
-
}
|
|
1230
|
-
}), nn = /* @__PURE__ */ E({
|
|
1231
|
-
name: "UTabs",
|
|
1232
|
-
__name: "tabs",
|
|
1233
|
-
props: /* @__PURE__ */ k({ class: { default: void 0 } }, {
|
|
1234
|
-
modelValue: { default: "" },
|
|
1235
|
-
modelModifiers: {}
|
|
1236
|
-
}),
|
|
1237
|
-
emits: /* @__PURE__ */ k(["valueChange"], ["update:modelValue"]),
|
|
1238
|
-
setup(e, { emit: t }) {
|
|
1239
|
-
let n = e, r = U(e, "modelValue"), i = t, a = y(() => Y("w-full", n.class));
|
|
1240
|
-
function o(e) {
|
|
1241
|
-
r.value = e, i("valueChange", e);
|
|
1242
|
-
}
|
|
1243
|
-
return F(Zt, {
|
|
1244
|
-
modelValue: r,
|
|
1245
|
-
setValue: o
|
|
1246
|
-
}), (e, t) => (P(), S("div", { class: j(a.value) }, [R(e.$slots, "default")], 2));
|
|
1247
|
-
}
|
|
1248
|
-
}), rn = Symbol("ug-accordion-context"), an = Symbol("ug-accordion-item-context");
|
|
1249
|
-
//#endregion
|
|
1250
|
-
//#region src/components/accordion.vue?vue&type=script&setup=true&lang.ts
|
|
1251
|
-
function on() {
|
|
1252
|
-
let e = O(rn);
|
|
1253
|
-
if (!e) throw Error("Accordion 子组件必须在 <UAccordion> 内使用");
|
|
1254
|
-
return e;
|
|
1255
|
-
}
|
|
1256
|
-
function sn() {
|
|
1257
|
-
let e = O(an);
|
|
1258
|
-
if (!e) throw Error("AccordionTrigger/AccordionContent 必须在 <UAccordionItem> 内使用");
|
|
1259
|
-
return e;
|
|
1260
|
-
}
|
|
1261
|
-
var cn = E({
|
|
1262
|
-
name: "UAccordionItem",
|
|
1263
|
-
props: {
|
|
1264
|
-
value: {
|
|
1265
|
-
type: String,
|
|
1266
|
-
required: !0
|
|
1267
|
-
},
|
|
1268
|
-
class: {
|
|
1269
|
-
type: String,
|
|
1270
|
-
default: void 0
|
|
1271
|
-
}
|
|
1272
|
-
},
|
|
1273
|
-
setup(e, { slots: t }) {
|
|
1274
|
-
let n = on(), r = y(() => n.type === "single" ? n.value.value === e.value : n.value.value.includes(e.value));
|
|
1275
|
-
F(an, {
|
|
1276
|
-
itemValue: e.value,
|
|
1277
|
-
isOpen: r
|
|
1278
|
-
});
|
|
1279
|
-
let i = y(() => Y("", e.class));
|
|
1280
|
-
return () => D("div", { class: i.value }, t.default?.());
|
|
1281
|
-
}
|
|
1282
|
-
}), ln = E({
|
|
1283
|
-
name: "UAccordionTrigger",
|
|
1284
|
-
props: { class: {
|
|
1285
|
-
type: String,
|
|
1286
|
-
default: void 0
|
|
1287
|
-
} },
|
|
1288
|
-
emits: { click: (e) => !0 },
|
|
1289
|
-
setup(e, { emit: t, slots: n }) {
|
|
1290
|
-
let r = on(), i = sn(), a = y(() => Y("flex w-full items-center justify-between px-4 py-3 text-left text-sm font-medium text-text-primary transition-colors hover:bg-surface-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/30 focus-visible:ring-inset", e.class)), o = y(() => Y("shrink-0 text-text-secondary transition-transform duration-200", i.isOpen.value ? "rotate-180" : ""));
|
|
1291
|
-
function s(e) {
|
|
1292
|
-
r.onValueChange(i.itemValue), t("click", e);
|
|
1293
|
-
}
|
|
1294
|
-
return () => D("button", {
|
|
1295
|
-
type: "button",
|
|
1296
|
-
"aria-expanded": i.isOpen.value,
|
|
1297
|
-
class: a.value,
|
|
1298
|
-
onClick: s
|
|
1299
|
-
}, [...n.default?.() ?? [], D(oe, {
|
|
1300
|
-
size: 16,
|
|
1301
|
-
class: o.value
|
|
1302
|
-
})]);
|
|
1303
|
-
}
|
|
1304
|
-
}), un = E({
|
|
1305
|
-
name: "UAccordionContent",
|
|
1306
|
-
props: { class: {
|
|
1307
|
-
type: String,
|
|
1308
|
-
default: void 0
|
|
1309
|
-
} },
|
|
1310
|
-
setup(e, { slots: t }) {
|
|
1311
|
-
let n = sn(), r = y(() => Y("px-4 pb-4 pt-1 text-sm text-text-secondary", e.class));
|
|
1312
|
-
return () => n.isOpen.value ? D("div", { class: r.value }, t.default?.()) : null;
|
|
1313
|
-
}
|
|
1314
|
-
}), dn = /* @__PURE__ */ E({
|
|
1315
|
-
name: "UAccordion",
|
|
1316
|
-
__name: "accordion",
|
|
1317
|
-
props: {
|
|
1318
|
-
type: { default: "single" },
|
|
1319
|
-
modelValue: { default: void 0 },
|
|
1320
|
-
defaultValue: { default: void 0 },
|
|
1321
|
-
collapsible: {
|
|
1322
|
-
type: Boolean,
|
|
1323
|
-
default: !1
|
|
1324
|
-
},
|
|
1325
|
-
class: { default: void 0 }
|
|
1326
|
-
},
|
|
1327
|
-
emits: ["update:modelValue"],
|
|
1328
|
-
setup(e, { emit: t }) {
|
|
1329
|
-
let n = e, r = t, i = I(n.defaultValue === void 0 ? n.type === "multiple" ? [] : "" : n.defaultValue), a = y(() => n.modelValue !== void 0), o = y(() => a.value ? n.modelValue : i.value), s = y(() => Y("w-full divide-y divide-border-base rounded-md border border-border-base", n.class));
|
|
1330
|
-
function c(e) {
|
|
1331
|
-
if (n.type === "single") {
|
|
1332
|
-
let t = o.value === e && n.collapsible ? "" : e;
|
|
1333
|
-
a.value || (i.value = t), r("update:modelValue", t);
|
|
1334
|
-
} else {
|
|
1335
|
-
let t = o.value, n = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
|
|
1336
|
-
a.value || (i.value = n), r("update:modelValue", n);
|
|
1337
|
-
}
|
|
1338
|
-
}
|
|
1339
|
-
return F(rn, {
|
|
1340
|
-
type: n.type,
|
|
1341
|
-
value: o,
|
|
1342
|
-
onValueChange: c,
|
|
1343
|
-
collapsible: n.collapsible
|
|
1344
|
-
}), (e, t) => (P(), S("div", { class: j(s.value) }, [R(e.$slots, "default")], 2));
|
|
1345
|
-
}
|
|
1346
|
-
}), fn = { key: 1 }, pn = /* @__PURE__ */ E({
|
|
1347
|
-
__name: "steps",
|
|
1348
|
-
props: {
|
|
1349
|
-
current: {},
|
|
1350
|
-
items: {},
|
|
1351
|
-
direction: { default: "horizontal" },
|
|
1352
|
-
status: { default: "process" },
|
|
1353
|
-
class: {}
|
|
1354
|
-
},
|
|
1355
|
-
setup(e) {
|
|
1356
|
-
let t = e, n = {
|
|
1357
|
-
horizontal: "flex items-start",
|
|
1358
|
-
vertical: "flex flex-col"
|
|
1359
|
-
}, r = y(() => Y(n[t.direction], t.class)), i = y(() => t.direction === "horizontal");
|
|
1360
|
-
function a(e) {
|
|
1361
|
-
return e < t.current || e === t.current && t.status === "finish";
|
|
1362
|
-
}
|
|
1363
|
-
function o(e) {
|
|
1364
|
-
return e === t.current && t.status !== "finish";
|
|
1365
|
-
}
|
|
1366
|
-
function s(e) {
|
|
1367
|
-
return e === t.current && t.status === "error";
|
|
1368
|
-
}
|
|
1369
|
-
function c(e) {
|
|
1370
|
-
return a(e) ? "border-primary bg-primary text-primary-fg" : s(e) ? "border-red-500 bg-surface-1 text-red-500" : o(e) ? "border-primary bg-surface-1 text-text-primary" : "border-border-strong bg-surface-1 text-text-tertiary";
|
|
1371
|
-
}
|
|
1372
|
-
function l(e) {
|
|
1373
|
-
return s(e) ? "text-red-500" : a(e) || o(e) ? "text-text-primary" : "text-text-tertiary";
|
|
1374
|
-
}
|
|
1375
|
-
function u(e) {
|
|
1376
|
-
return a(e) ? "bg-primary" : "bg-border-base";
|
|
1377
|
-
}
|
|
1378
|
-
return (t, n) => (P(), S("div", { class: j(r.value) }, [(P(!0), S(_, null, L(e.items, (t, n) => (P(), S("div", {
|
|
1379
|
-
key: n,
|
|
1380
|
-
class: j(V(Y)(i.value ? "flex flex-1 items-start" : "flex items-start"))
|
|
1381
|
-
}, [
|
|
1382
|
-
C("div", { class: j(V(Y)("flex", i.value ? "flex-col items-center" : "items-start")) }, [C("div", { class: j(V(Y)("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 text-sm font-semibold transition-colors", c(n))) }, [a(n) ? (P(), b(V(K), {
|
|
1383
|
-
key: 0,
|
|
1384
|
-
size: 16,
|
|
1385
|
-
"stroke-width": 2.5
|
|
1386
|
-
})) : (P(), S("span", fn, B(n + 1), 1))], 2), !i.value && n < e.items.length - 1 ? (P(), S("div", {
|
|
1387
|
-
key: 0,
|
|
1388
|
-
class: j(V(Y)("ml-[15px] mt-1 w-0.5 flex-1 self-stretch", u(n))),
|
|
1389
|
-
style: { "min-height": "24px" }
|
|
1390
|
-
}, null, 2)) : x("", !0)], 2),
|
|
1391
|
-
C("div", { class: j(V(Y)(i.value ? "mt-2 text-center" : "ml-3", !i.value && n < e.items.length - 1 ? "pb-6" : "")) }, [C("p", { class: j(V(Y)("text-sm font-medium", l(n))) }, B(t.title), 3), t.description ? (P(), S("p", {
|
|
1392
|
-
key: 0,
|
|
1393
|
-
class: j(V(Y)("mt-0.5 text-xs", s(n) ? "text-red-400" : "text-text-secondary"))
|
|
1394
|
-
}, B(t.description), 3)) : x("", !0)], 2),
|
|
1395
|
-
i.value && n < e.items.length - 1 ? (P(), S("div", {
|
|
1396
|
-
key: 0,
|
|
1397
|
-
class: j(V(Y)("mx-2 mt-4 h-0.5 flex-1", u(n)))
|
|
1398
|
-
}, null, 2)) : x("", !0)
|
|
1399
|
-
], 2))), 128))], 2));
|
|
1400
|
-
}
|
|
1401
|
-
}), mn = Symbol("ug-dropdown-context");
|
|
1402
|
-
//#endregion
|
|
1403
|
-
//#region src/components/dropdown.vue?vue&type=script&setup=true&lang.ts
|
|
1404
|
-
function hn() {
|
|
1405
|
-
let e = O(mn);
|
|
1406
|
-
if (!e) throw Error("Dropdown 子组件必须在 <UDropdown> 内使用");
|
|
1407
|
-
return e;
|
|
1408
|
-
}
|
|
1409
|
-
var gn = E({
|
|
1410
|
-
name: "UDropdownTrigger",
|
|
1411
|
-
props: { class: {
|
|
1412
|
-
type: String,
|
|
1413
|
-
default: void 0
|
|
1414
|
-
} },
|
|
1415
|
-
emits: { click: (e) => !0 },
|
|
1416
|
-
setup(e, { emit: t, slots: n }) {
|
|
1417
|
-
let r = hn(), i = y(() => Y("inline-flex", e.class));
|
|
1418
|
-
function a(e) {
|
|
1419
|
-
r.triggerRef.value = e;
|
|
1420
|
-
}
|
|
1421
|
-
function o(e) {
|
|
1422
|
-
r.toggleOpen(), t("click", e);
|
|
1423
|
-
}
|
|
1424
|
-
return () => D("span", {
|
|
1425
|
-
class: i.value,
|
|
1426
|
-
onClick: o,
|
|
1427
|
-
onVnodeMounted(e) {
|
|
1428
|
-
a(e.el);
|
|
89
|
+
{
|
|
90
|
+
name: "UGInput",
|
|
91
|
+
route: "/vue/components/input"
|
|
1429
92
|
},
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
}, n.default?.());
|
|
1434
|
-
}
|
|
1435
|
-
}), _n = E({
|
|
1436
|
-
name: "UDropdownContent",
|
|
1437
|
-
props: {
|
|
1438
|
-
align: {
|
|
1439
|
-
type: String,
|
|
1440
|
-
default: "start"
|
|
1441
|
-
},
|
|
1442
|
-
class: {
|
|
1443
|
-
type: String,
|
|
1444
|
-
default: void 0
|
|
1445
|
-
}
|
|
1446
|
-
},
|
|
1447
|
-
setup(e, { slots: t }) {
|
|
1448
|
-
let n = hn(), r = I(null), i = I({
|
|
1449
|
-
top: 0,
|
|
1450
|
-
left: 0
|
|
1451
|
-
}), a = y(() => Y("absolute z-50 min-w-40 rounded-md border border-border-base bg-surface-1 py-1 shadow-lg", e.class));
|
|
1452
|
-
function o() {
|
|
1453
|
-
if (!n.triggerRef.value || typeof window > "u") return;
|
|
1454
|
-
let t = n.triggerRef.value.getBoundingClientRect(), a = r.value?.offsetWidth ?? 0;
|
|
1455
|
-
i.value = {
|
|
1456
|
-
top: t.bottom + window.scrollY + 4,
|
|
1457
|
-
left: e.align === "end" ? t.right + window.scrollX - a : t.left + window.scrollX
|
|
1458
|
-
};
|
|
1459
|
-
}
|
|
1460
|
-
function s(e) {
|
|
1461
|
-
let t = e.target;
|
|
1462
|
-
r.value?.contains(t) || n.triggerRef.value?.contains(t) || n.setOpen(!1);
|
|
1463
|
-
}
|
|
1464
|
-
function c() {
|
|
1465
|
-
window.addEventListener("resize", o), window.addEventListener("scroll", o, !0), document.addEventListener("mousedown", s);
|
|
1466
|
-
}
|
|
1467
|
-
function l() {
|
|
1468
|
-
window.removeEventListener("resize", o), window.removeEventListener("scroll", o, !0), document.removeEventListener("mousedown", s);
|
|
1469
|
-
}
|
|
1470
|
-
return W(() => n.open.value, async (e) => {
|
|
1471
|
-
l(), !(!e || typeof window > "u") && (await A(), o(), c());
|
|
1472
|
-
}, { immediate: !0 }), N(() => {
|
|
1473
|
-
l();
|
|
1474
|
-
}), () => n.open.value ? D(v, { to: "body" }, [D("div", {
|
|
1475
|
-
ref: r,
|
|
1476
|
-
class: a.value,
|
|
1477
|
-
style: {
|
|
1478
|
-
top: `${i.value.top}px`,
|
|
1479
|
-
left: `${i.value.left}px`
|
|
1480
|
-
}
|
|
1481
|
-
}, t.default?.())]) : null;
|
|
1482
|
-
}
|
|
1483
|
-
}), vn = E({
|
|
1484
|
-
name: "UDropdownItem",
|
|
1485
|
-
props: {
|
|
1486
|
-
destructive: {
|
|
1487
|
-
type: Boolean,
|
|
1488
|
-
default: !1
|
|
1489
|
-
},
|
|
1490
|
-
disabled: {
|
|
1491
|
-
type: Boolean,
|
|
1492
|
-
default: !1
|
|
1493
|
-
},
|
|
1494
|
-
class: {
|
|
1495
|
-
type: String,
|
|
1496
|
-
default: void 0
|
|
1497
|
-
}
|
|
1498
|
-
},
|
|
1499
|
-
emits: { click: (e) => !0 },
|
|
1500
|
-
setup(e, { emit: t, slots: n }) {
|
|
1501
|
-
let r = hn(), i = y(() => Y("w-full px-3 py-1.5 text-left text-sm transition-colors focus-visible:bg-surface-3 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50", e.destructive ? "text-red-600 hover:bg-red-50" : "text-text-primary hover:bg-surface-3", e.class));
|
|
1502
|
-
function a(n) {
|
|
1503
|
-
e.disabled || (r.setOpen(!1), t("click", n));
|
|
1504
|
-
}
|
|
1505
|
-
return () => D("button", {
|
|
1506
|
-
type: "button",
|
|
1507
|
-
disabled: e.disabled,
|
|
1508
|
-
class: i.value,
|
|
1509
|
-
onClick: a
|
|
1510
|
-
}, n.default?.());
|
|
1511
|
-
}
|
|
1512
|
-
}), yn = E({
|
|
1513
|
-
name: "UDropdownSeparator",
|
|
1514
|
-
props: { class: {
|
|
1515
|
-
type: String,
|
|
1516
|
-
default: void 0
|
|
1517
|
-
} },
|
|
1518
|
-
setup(e, { attrs: t }) {
|
|
1519
|
-
let n = y(() => Y("my-1 h-px bg-border-base", e.class));
|
|
1520
|
-
return () => D("div", {
|
|
1521
|
-
...t,
|
|
1522
|
-
class: n.value
|
|
1523
|
-
});
|
|
1524
|
-
}
|
|
1525
|
-
}), bn = /* @__PURE__ */ E({
|
|
1526
|
-
name: "UDropdown",
|
|
1527
|
-
__name: "dropdown",
|
|
1528
|
-
props: /* @__PURE__ */ k({ class: { default: void 0 } }, {
|
|
1529
|
-
open: {
|
|
1530
|
-
type: Boolean,
|
|
1531
|
-
default: !1
|
|
1532
|
-
},
|
|
1533
|
-
openModifiers: {}
|
|
1534
|
-
}),
|
|
1535
|
-
emits: /* @__PURE__ */ k(["openChange"], ["update:open"]),
|
|
1536
|
-
setup(e, { emit: t }) {
|
|
1537
|
-
let n = e, r = U(e, "open"), i = t, a = I(null), o = y(() => Y("relative inline-block", n.class));
|
|
1538
|
-
function s(e) {
|
|
1539
|
-
r.value = e, i("openChange", e);
|
|
1540
|
-
}
|
|
1541
|
-
function c() {
|
|
1542
|
-
s(!r.value);
|
|
1543
|
-
}
|
|
1544
|
-
return F(mn, {
|
|
1545
|
-
open: r,
|
|
1546
|
-
triggerRef: a,
|
|
1547
|
-
setOpen: s,
|
|
1548
|
-
toggleOpen: c
|
|
1549
|
-
}), (e, t) => (P(), S("div", { class: j(o.value) }, [R(e.$slots, "default")], 2));
|
|
1550
|
-
}
|
|
1551
|
-
}), xn = Symbol("ug-popover-context");
|
|
1552
|
-
//#endregion
|
|
1553
|
-
//#region src/components/popover.vue?vue&type=script&setup=true&lang.ts
|
|
1554
|
-
function Sn() {
|
|
1555
|
-
let e = O(xn);
|
|
1556
|
-
if (!e) throw Error("Popover 子组件必须在 <UPopover> 内使用");
|
|
1557
|
-
return e;
|
|
1558
|
-
}
|
|
1559
|
-
function Cn(e, t, n, r, i) {
|
|
1560
|
-
let a = t.offsetWidth, o = t.offsetHeight, s = 0, c = 0;
|
|
1561
|
-
return n === "left" ? (s = e.top + window.scrollY + e.height / 2 - o / 2, c = e.left + window.scrollX - a - i, {
|
|
1562
|
-
top: s,
|
|
1563
|
-
left: c
|
|
1564
|
-
}) : n === "right" ? (s = e.top + window.scrollY + e.height / 2 - o / 2, c = e.right + window.scrollX + i, {
|
|
1565
|
-
top: s,
|
|
1566
|
-
left: c
|
|
1567
|
-
}) : (s = n === "top" ? e.top + window.scrollY - o - i : e.bottom + window.scrollY + i, c = r === "start" ? e.left + window.scrollX : r === "end" ? e.right + window.scrollX - a : e.left + window.scrollX + e.width / 2 - a / 2, {
|
|
1568
|
-
top: s,
|
|
1569
|
-
left: c
|
|
1570
|
-
});
|
|
1571
|
-
}
|
|
1572
|
-
var wn = E({
|
|
1573
|
-
name: "UPopoverTrigger",
|
|
1574
|
-
props: { class: {
|
|
1575
|
-
type: String,
|
|
1576
|
-
default: void 0
|
|
1577
|
-
} },
|
|
1578
|
-
emits: { click: (e) => !0 },
|
|
1579
|
-
setup(e, { emit: t, slots: n }) {
|
|
1580
|
-
let r = Sn(), i = y(() => Y("inline-flex", e.class));
|
|
1581
|
-
function a(e) {
|
|
1582
|
-
r.triggerRef.value = e;
|
|
1583
|
-
}
|
|
1584
|
-
function o(e) {
|
|
1585
|
-
r.toggleOpen(), t("click", e);
|
|
1586
|
-
}
|
|
1587
|
-
return () => D("span", {
|
|
1588
|
-
class: i.value,
|
|
1589
|
-
onClick: o,
|
|
1590
|
-
onVnodeMounted(e) {
|
|
1591
|
-
a(e.el);
|
|
93
|
+
{
|
|
94
|
+
name: "UGLabel",
|
|
95
|
+
route: "/vue/components/label"
|
|
1592
96
|
},
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
},
|
|
1613
|
-
class: {
|
|
1614
|
-
type: String,
|
|
1615
|
-
default: void 0
|
|
1616
|
-
}
|
|
1617
|
-
},
|
|
1618
|
-
setup(e, { slots: t }) {
|
|
1619
|
-
let n = Sn(), r = I(null), i = I({
|
|
1620
|
-
top: 0,
|
|
1621
|
-
left: 0
|
|
1622
|
-
}), a = y(() => Y("absolute z-50 min-w-40 rounded-md border border-border-base bg-surface-1 p-3 shadow-lg", e.class));
|
|
1623
|
-
function o() {
|
|
1624
|
-
!n.triggerRef.value || !r.value || typeof window > "u" || (i.value = Cn(n.triggerRef.value.getBoundingClientRect(), r.value, e.side, e.align, e.sideOffset));
|
|
1625
|
-
}
|
|
1626
|
-
function s(e) {
|
|
1627
|
-
let t = e.target;
|
|
1628
|
-
r.value?.contains(t) || n.triggerRef.value?.contains(t) || n.setOpen(!1);
|
|
1629
|
-
}
|
|
1630
|
-
function c() {
|
|
1631
|
-
window.addEventListener("resize", o), window.addEventListener("scroll", o, !0), document.addEventListener("mousedown", s);
|
|
1632
|
-
}
|
|
1633
|
-
function l() {
|
|
1634
|
-
window.removeEventListener("resize", o), window.removeEventListener("scroll", o, !0), document.removeEventListener("mousedown", s);
|
|
1635
|
-
}
|
|
1636
|
-
return W(() => n.open.value, async (e) => {
|
|
1637
|
-
l(), !(!e || typeof window > "u") && (await A(), o(), c());
|
|
1638
|
-
}, { immediate: !0 }), N(() => {
|
|
1639
|
-
l();
|
|
1640
|
-
}), () => n.open.value ? D(v, { to: "body" }, [D("div", {
|
|
1641
|
-
ref: r,
|
|
1642
|
-
class: a.value,
|
|
1643
|
-
style: {
|
|
1644
|
-
top: `${i.value.top}px`,
|
|
1645
|
-
left: `${i.value.left}px`
|
|
97
|
+
{
|
|
98
|
+
name: "UGCard",
|
|
99
|
+
route: "/vue/components/card"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "UGBadge",
|
|
103
|
+
route: "/vue/components/badge"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: "UGTag",
|
|
107
|
+
route: "/vue/components/tag"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: "UGSeparator",
|
|
111
|
+
route: "/vue/components/separator"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: "UGSpinner",
|
|
115
|
+
route: "/vue/components/spinner"
|
|
1646
116
|
}
|
|
1647
|
-
|
|
1648
|
-
}
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
setup(e, { slots: t }) {
|
|
1690
|
-
let n = On(), r = y(() => Y(e.class));
|
|
1691
|
-
function i(e) {
|
|
1692
|
-
e.preventDefault(), n.openAt({
|
|
1693
|
-
x: e.clientX,
|
|
1694
|
-
y: e.clientY
|
|
1695
|
-
});
|
|
1696
|
-
}
|
|
1697
|
-
return () => D("div", {
|
|
1698
|
-
class: r.value || void 0,
|
|
1699
|
-
onContextmenu: i
|
|
1700
|
-
}, t.default?.());
|
|
1701
|
-
}
|
|
1702
|
-
}), An = E({
|
|
1703
|
-
name: "UContextMenuContent",
|
|
1704
|
-
props: { class: {
|
|
1705
|
-
type: String,
|
|
1706
|
-
default: void 0
|
|
1707
|
-
} },
|
|
1708
|
-
setup(e, { slots: t }) {
|
|
1709
|
-
let n = On(), r = I(null), i = y(() => Y("fixed z-50 min-w-40 rounded-md border border-border-base bg-surface-1 py-1 shadow-lg", e.class));
|
|
1710
|
-
function a(e) {
|
|
1711
|
-
r.value && !r.value.contains(e.target) && n.setOpen(!1);
|
|
1712
|
-
}
|
|
1713
|
-
function o(e) {
|
|
1714
|
-
e.key === "Escape" && n.setOpen(!1);
|
|
1715
|
-
}
|
|
1716
|
-
function s() {
|
|
1717
|
-
document.addEventListener("mousedown", a), document.addEventListener("keydown", o);
|
|
1718
|
-
}
|
|
1719
|
-
function c() {
|
|
1720
|
-
document.removeEventListener("mousedown", a), document.removeEventListener("keydown", o);
|
|
1721
|
-
}
|
|
1722
|
-
return W(() => n.open.value, (e) => {
|
|
1723
|
-
c(), e && s();
|
|
1724
|
-
}, { immediate: !0 }), N(() => {
|
|
1725
|
-
c();
|
|
1726
|
-
}), () => n.open.value ? D(v, { to: "body" }, [D("div", {
|
|
1727
|
-
ref: r,
|
|
1728
|
-
class: i.value,
|
|
1729
|
-
style: {
|
|
1730
|
-
top: `${n.position.value.y}px`,
|
|
1731
|
-
left: `${n.position.value.x}px`
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: "forms",
|
|
121
|
+
label: "表单输入",
|
|
122
|
+
description: "收集、校验和编辑用户输入,要求标签、帮助文本、错误状态稳定对齐。",
|
|
123
|
+
components: [
|
|
124
|
+
{
|
|
125
|
+
name: "UGTextarea",
|
|
126
|
+
route: "/vue/components/textarea"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: "UGSelect",
|
|
130
|
+
route: "/vue/components/select"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: "UGCheckbox",
|
|
134
|
+
route: "/vue/components/checkbox"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: "UGRadio",
|
|
138
|
+
route: "/vue/components/radio"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: "UGSwitch",
|
|
142
|
+
route: "/vue/components/switch"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "UGSlider",
|
|
146
|
+
route: "/vue/components/slider"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "UGNumberInput",
|
|
150
|
+
route: "/vue/components/number-input"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: "UGOTPInput",
|
|
154
|
+
route: "/vue/components/otp-input"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: "UGForm",
|
|
158
|
+
route: "/vue/components/form"
|
|
1732
159
|
}
|
|
1733
|
-
|
|
1734
|
-
}
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
}
|
|
1764
|
-
}), Mn = E({
|
|
1765
|
-
name: "UContextMenuSeparator",
|
|
1766
|
-
props: { class: {
|
|
1767
|
-
type: String,
|
|
1768
|
-
default: void 0
|
|
1769
|
-
} },
|
|
1770
|
-
setup(e) {
|
|
1771
|
-
let t = y(() => Y("my-1 h-px bg-border-base", e.class));
|
|
1772
|
-
return () => D("div", { class: t.value });
|
|
1773
|
-
}
|
|
1774
|
-
}), Nn = /* @__PURE__ */ E({
|
|
1775
|
-
name: "UContextMenu",
|
|
1776
|
-
__name: "context-menu",
|
|
1777
|
-
props: { class: { default: void 0 } },
|
|
1778
|
-
setup(e) {
|
|
1779
|
-
let t = e, n = I(!1), r = I({
|
|
1780
|
-
x: 0,
|
|
1781
|
-
y: 0
|
|
1782
|
-
}), i = y(() => Y("relative", t.class));
|
|
1783
|
-
function a(e) {
|
|
1784
|
-
n.value = e;
|
|
1785
|
-
}
|
|
1786
|
-
function o(e) {
|
|
1787
|
-
r.value = e, n.value = !0;
|
|
1788
|
-
}
|
|
1789
|
-
return F(Dn, {
|
|
1790
|
-
open: n,
|
|
1791
|
-
position: r,
|
|
1792
|
-
setOpen: a,
|
|
1793
|
-
openAt: o
|
|
1794
|
-
}), (e, t) => (P(), S("div", { class: j(i.value) }, [R(e.$slots, "default")], 2));
|
|
1795
|
-
}
|
|
1796
|
-
}), Pn = Symbol("ug-navigation-menu-context"), Fn = Symbol("ug-navigation-menu-item-context");
|
|
1797
|
-
//#endregion
|
|
1798
|
-
//#region src/components/navigation-menu.vue?vue&type=script&setup=true&lang.ts
|
|
1799
|
-
function In() {
|
|
1800
|
-
let e = O(Pn);
|
|
1801
|
-
if (!e) throw Error("NavigationMenu 子组件必须在 <UNavigationMenu> 内使用");
|
|
1802
|
-
return e;
|
|
1803
|
-
}
|
|
1804
|
-
function Ln() {
|
|
1805
|
-
let e = O(Fn);
|
|
1806
|
-
if (!e) throw Error("UNavigationMenuTrigger/UNavigationMenuContent 必须在 <UNavigationMenuItem> 内使用");
|
|
1807
|
-
return e;
|
|
1808
|
-
}
|
|
1809
|
-
var Rn = 0, zn = E({
|
|
1810
|
-
name: "UNavigationMenuItem",
|
|
1811
|
-
props: { class: {
|
|
1812
|
-
type: String,
|
|
1813
|
-
default: void 0
|
|
1814
|
-
} },
|
|
1815
|
-
setup(e, { slots: t }) {
|
|
1816
|
-
let n = `nav-item-${++Rn}`, r = In(), i = y(() => r.activeItem.value === n), a = y(() => Y("relative", e.class));
|
|
1817
|
-
F(Fn, { itemId: n });
|
|
1818
|
-
function o() {
|
|
1819
|
-
r.setActiveItem(n);
|
|
1820
|
-
}
|
|
1821
|
-
function s() {
|
|
1822
|
-
r.setActiveItem(null);
|
|
1823
|
-
}
|
|
1824
|
-
return () => D("div", {
|
|
1825
|
-
class: a.value,
|
|
1826
|
-
"data-state": i.value ? "open" : "closed",
|
|
1827
|
-
onMouseenter: o,
|
|
1828
|
-
onMouseleave: s
|
|
1829
|
-
}, t.default?.());
|
|
1830
|
-
}
|
|
1831
|
-
}), Bn = E({
|
|
1832
|
-
name: "UNavigationMenuLink",
|
|
1833
|
-
props: {
|
|
1834
|
-
href: {
|
|
1835
|
-
type: String,
|
|
1836
|
-
default: void 0
|
|
1837
|
-
},
|
|
1838
|
-
active: {
|
|
1839
|
-
type: Boolean,
|
|
1840
|
-
default: !1
|
|
1841
|
-
},
|
|
1842
|
-
class: {
|
|
1843
|
-
type: String,
|
|
1844
|
-
default: void 0
|
|
1845
|
-
}
|
|
1846
|
-
},
|
|
1847
|
-
setup(e, { slots: t }) {
|
|
1848
|
-
let n = y(() => Y("inline-flex items-center rounded-md px-3 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/30 focus-visible:ring-offset-1", e.active ? "bg-surface-3 text-text-primary" : "text-text-secondary hover:bg-surface-3 hover:text-text-primary", e.class));
|
|
1849
|
-
return () => D("a", {
|
|
1850
|
-
href: e.href,
|
|
1851
|
-
class: n.value
|
|
1852
|
-
}, t.default?.());
|
|
1853
|
-
}
|
|
1854
|
-
}), Vn = E({
|
|
1855
|
-
name: "UNavigationMenuTrigger",
|
|
1856
|
-
props: { class: {
|
|
1857
|
-
type: String,
|
|
1858
|
-
default: void 0
|
|
1859
|
-
} },
|
|
1860
|
-
setup(e, { slots: t }) {
|
|
1861
|
-
let n = In(), r = Ln(), i = y(() => n.activeItem.value === r.itemId), a = y(() => Y("inline-flex items-center gap-1 rounded-md px-3 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/30 focus-visible:ring-offset-1", i.value ? "bg-surface-3 text-text-primary" : "text-text-secondary hover:bg-surface-3 hover:text-text-primary", e.class)), o = y(() => Y("transition-transform duration-200", i.value ? "rotate-180" : ""));
|
|
1862
|
-
return () => D("button", {
|
|
1863
|
-
type: "button",
|
|
1864
|
-
"aria-expanded": i.value,
|
|
1865
|
-
class: a.value
|
|
1866
|
-
}, [t.default?.(), D(oe, {
|
|
1867
|
-
size: 14,
|
|
1868
|
-
class: o.value
|
|
1869
|
-
})]);
|
|
1870
|
-
}
|
|
1871
|
-
}), Hn = E({
|
|
1872
|
-
name: "UNavigationMenuContent",
|
|
1873
|
-
props: { class: {
|
|
1874
|
-
type: String,
|
|
1875
|
-
default: void 0
|
|
1876
|
-
} },
|
|
1877
|
-
setup(e, { slots: t }) {
|
|
1878
|
-
let n = In(), r = Ln(), i = y(() => n.activeItem.value === r.itemId), a = y(() => Y("absolute left-0 top-full z-50 mt-1 min-w-40 rounded-md border border-border-base bg-surface-1 py-1 shadow-lg", e.class));
|
|
1879
|
-
return () => i.value ? D("div", { class: a.value }, t.default?.()) : null;
|
|
1880
|
-
}
|
|
1881
|
-
}), Un = /* @__PURE__ */ E({
|
|
1882
|
-
name: "UNavigationMenu",
|
|
1883
|
-
__name: "navigation-menu",
|
|
1884
|
-
props: { class: { default: void 0 } },
|
|
1885
|
-
setup(e) {
|
|
1886
|
-
let t = e, n = I(null), r = y(() => Y("relative flex items-center gap-1", t.class));
|
|
1887
|
-
function i(e) {
|
|
1888
|
-
n.value = e;
|
|
1889
|
-
}
|
|
1890
|
-
return F(Pn, {
|
|
1891
|
-
activeItem: n,
|
|
1892
|
-
setActiveItem: i
|
|
1893
|
-
}), (e, t) => (P(), S("nav", { class: j(r.value) }, [R(e.$slots, "default")], 2));
|
|
1894
|
-
}
|
|
1895
|
-
}), Wn = Symbol("AvatarContext");
|
|
1896
|
-
//#endregion
|
|
1897
|
-
//#region src/components/avatar.vue?vue&type=script&setup=true&lang.ts
|
|
1898
|
-
function Gn(e) {
|
|
1899
|
-
let t = O(Wn);
|
|
1900
|
-
if (!t) throw Error(`<${e}> 必须在 <UAvatar> 内使用`);
|
|
1901
|
-
return t;
|
|
1902
|
-
}
|
|
1903
|
-
var Kn = E({
|
|
1904
|
-
name: "UAvatarImage",
|
|
1905
|
-
inheritAttrs: !1,
|
|
1906
|
-
props: {
|
|
1907
|
-
src: {
|
|
1908
|
-
type: String,
|
|
1909
|
-
required: !0
|
|
1910
|
-
},
|
|
1911
|
-
alt: {
|
|
1912
|
-
type: String,
|
|
1913
|
-
default: ""
|
|
1914
|
-
},
|
|
1915
|
-
class: {
|
|
1916
|
-
type: String,
|
|
1917
|
-
default: void 0
|
|
1918
|
-
}
|
|
1919
|
-
},
|
|
1920
|
-
emits: {
|
|
1921
|
-
error: (e) => !0,
|
|
1922
|
-
load: (e) => !0
|
|
1923
|
-
},
|
|
1924
|
-
setup(e, { attrs: t, emit: n }) {
|
|
1925
|
-
let r = Gn("UAvatarImage");
|
|
1926
|
-
W(() => e.src, (e) => {
|
|
1927
|
-
r.setImageLoadingStatus(e ? "loading" : "error");
|
|
1928
|
-
}, { immediate: !0 });
|
|
1929
|
-
function i(e) {
|
|
1930
|
-
r.setImageLoadingStatus("error"), n("error", e);
|
|
1931
|
-
}
|
|
1932
|
-
function a(e) {
|
|
1933
|
-
r.setImageLoadingStatus("loaded"), n("load", e);
|
|
1934
|
-
}
|
|
1935
|
-
return () => {
|
|
1936
|
-
let n = r.imageLoadingStatus.value;
|
|
1937
|
-
return n !== "loaded" && n !== "loading" ? null : D("img", {
|
|
1938
|
-
...t,
|
|
1939
|
-
src: e.src,
|
|
1940
|
-
alt: e.alt,
|
|
1941
|
-
class: Y("h-full w-full object-cover", n === "loading" && "invisible", e.class),
|
|
1942
|
-
onError: i,
|
|
1943
|
-
onLoad: a
|
|
1944
|
-
});
|
|
1945
|
-
};
|
|
1946
|
-
}
|
|
1947
|
-
}), qn = E({
|
|
1948
|
-
name: "UAvatarFallback",
|
|
1949
|
-
props: { class: {
|
|
1950
|
-
type: String,
|
|
1951
|
-
default: void 0
|
|
1952
|
-
} },
|
|
1953
|
-
setup(e, { attrs: t, slots: n }) {
|
|
1954
|
-
let r = Gn("UAvatarFallback"), i = y(() => Y("absolute inset-0 flex items-center justify-center font-medium text-text-secondary", e.class));
|
|
1955
|
-
return () => r.imageLoadingStatus.value === "loaded" ? null : D("span", {
|
|
1956
|
-
...t,
|
|
1957
|
-
class: i.value
|
|
1958
|
-
}, n.default?.() ?? [D(me, { size: 16 })]);
|
|
1959
|
-
}
|
|
1960
|
-
}), Jn = /* @__PURE__ */ E({
|
|
1961
|
-
name: "UAvatar",
|
|
1962
|
-
__name: "avatar",
|
|
1963
|
-
props: {
|
|
1964
|
-
size: { default: "md" },
|
|
1965
|
-
class: { default: void 0 }
|
|
1966
|
-
},
|
|
1967
|
-
setup(e) {
|
|
1968
|
-
let t = e, n = {
|
|
1969
|
-
sm: "h-8 w-8 text-xs",
|
|
1970
|
-
md: "h-10 w-10 text-sm",
|
|
1971
|
-
lg: "h-14 w-14 text-base",
|
|
1972
|
-
xl: "h-20 w-20 text-xl"
|
|
1973
|
-
}, r = y(() => Y("relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-surface-3", n[t.size], t.class)), i = I("idle");
|
|
1974
|
-
return F(Wn, {
|
|
1975
|
-
imageLoadingStatus: i,
|
|
1976
|
-
setImageLoadingStatus: (e) => {
|
|
1977
|
-
i.value = e;
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
id: "navigation",
|
|
164
|
+
label: "导航流程",
|
|
165
|
+
description: "页面定位、区域切换、分页和流程表达,要求选中态明确且移动端不溢出。",
|
|
166
|
+
components: [
|
|
167
|
+
{
|
|
168
|
+
name: "UGTabs",
|
|
169
|
+
route: "/vue/components/tabs"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: "UGBreadcrumb",
|
|
173
|
+
route: "/vue/components/breadcrumb"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "UGPagination",
|
|
177
|
+
route: "/vue/components/pagination"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: "UGNavigationMenu",
|
|
181
|
+
route: "/vue/components/navigation-menu"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: "UGSidebar",
|
|
185
|
+
route: "/vue/components/sidebar"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: "UGSteps",
|
|
189
|
+
route: "/vue/components/steps"
|
|
1978
190
|
}
|
|
1979
|
-
|
|
1980
|
-
}
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
lg: "h-14 w-14 text-base"
|
|
2002
|
-
}, r = {
|
|
2003
|
-
sm: "ring-2",
|
|
2004
|
-
default: "ring-2",
|
|
2005
|
-
lg: "ring-[3px]"
|
|
2006
|
-
}, i = {
|
|
2007
|
-
sm: "-ml-2",
|
|
2008
|
-
default: "-ml-3",
|
|
2009
|
-
lg: "-ml-4"
|
|
2010
|
-
}, a = y(() => t.items.slice(0, t.max)), o = y(() => Math.max(0, t.items.length - t.max)), s = y(() => Y("flex items-center", t.class));
|
|
2011
|
-
function c(e) {
|
|
2012
|
-
return Y("relative inline-flex shrink-0 overflow-hidden rounded-full bg-surface-3 ring-surface-1", n[t.size], r[t.size], e > 0 && i[t.size]);
|
|
2013
|
-
}
|
|
2014
|
-
let l = y(() => Y("relative inline-flex shrink-0 items-center justify-center rounded-full bg-surface-3 font-medium text-text-secondary ring-surface-1", n[t.size], r[t.size], i[t.size])), u = /* @__PURE__ */ new Map();
|
|
2015
|
-
function d(e) {
|
|
2016
|
-
u.set(e, !0);
|
|
2017
|
-
}
|
|
2018
|
-
return (e, t) => (P(), S("div", { class: j(s.value) }, [(P(!0), S(_, null, L(a.value, (e, t) => (P(), S("span", {
|
|
2019
|
-
key: t,
|
|
2020
|
-
class: j(c(t))
|
|
2021
|
-
}, [e.src && !V(u).get(t) ? (P(), S("img", {
|
|
2022
|
-
key: 0,
|
|
2023
|
-
src: e.src,
|
|
2024
|
-
alt: e.alt ?? "",
|
|
2025
|
-
class: "h-full w-full object-cover",
|
|
2026
|
-
onError: (e) => d(t)
|
|
2027
|
-
}, null, 40, Yn)) : (P(), S("span", Xn, [e.fallback ? (P(), S(_, { key: 0 }, [w(B(e.fallback), 1)], 64)) : (P(), b(V(me), {
|
|
2028
|
-
key: 1,
|
|
2029
|
-
size: 16
|
|
2030
|
-
}))]))], 2))), 128)), o.value > 0 ? (P(), S("span", {
|
|
2031
|
-
key: 0,
|
|
2032
|
-
class: j(l.value),
|
|
2033
|
-
"aria-label": `还有 ${o.value} 人`
|
|
2034
|
-
}, " +" + B(o.value), 11, Zn)) : x("", !0)], 2));
|
|
2035
|
-
}
|
|
2036
|
-
}), $n = Symbol("ug-tooltip-context");
|
|
2037
|
-
//#endregion
|
|
2038
|
-
//#region src/components/tooltip.vue?vue&type=script&setup=true&lang.ts
|
|
2039
|
-
function er() {
|
|
2040
|
-
let e = O($n);
|
|
2041
|
-
if (!e) throw Error("Tooltip 子组件必须在 <UTooltip> 内使用");
|
|
2042
|
-
return e;
|
|
2043
|
-
}
|
|
2044
|
-
var tr = {
|
|
2045
|
-
top: "after:absolute after:left-1/2 after:top-full after:-translate-x-1/2 after:border-4 after:border-transparent after:border-t-text-primary",
|
|
2046
|
-
bottom: "after:absolute after:bottom-full after:left-1/2 after:-translate-x-1/2 after:border-4 after:border-transparent after:border-b-text-primary",
|
|
2047
|
-
left: "after:absolute after:left-full after:top-1/2 after:-translate-y-1/2 after:border-4 after:border-transparent after:border-l-text-primary",
|
|
2048
|
-
right: "after:absolute after:right-full after:top-1/2 after:-translate-y-1/2 after:border-4 after:border-transparent after:border-r-text-primary"
|
|
2049
|
-
}, nr = E({
|
|
2050
|
-
name: "UTooltipTrigger",
|
|
2051
|
-
props: { class: {
|
|
2052
|
-
type: String,
|
|
2053
|
-
default: void 0
|
|
2054
|
-
} },
|
|
2055
|
-
setup(e, { slots: t }) {
|
|
2056
|
-
let n = er(), r = y(() => Y("inline-flex", e.class));
|
|
2057
|
-
function i(e) {
|
|
2058
|
-
n.triggerRef.value = e;
|
|
2059
|
-
}
|
|
2060
|
-
function a() {
|
|
2061
|
-
typeof window > "u" || (n.delayTimer.value !== null && window.clearTimeout(n.delayTimer.value), n.delayTimer.value = window.setTimeout(() => {
|
|
2062
|
-
n.setOpen(!0);
|
|
2063
|
-
}, 200));
|
|
2064
|
-
}
|
|
2065
|
-
function o() {
|
|
2066
|
-
typeof window < "u" && n.delayTimer.value !== null && (window.clearTimeout(n.delayTimer.value), n.delayTimer.value = null), n.setOpen(!1);
|
|
2067
|
-
}
|
|
2068
|
-
return () => D("span", {
|
|
2069
|
-
class: r.value,
|
|
2070
|
-
onMouseenter: a,
|
|
2071
|
-
onMouseleave: o,
|
|
2072
|
-
onVnodeMounted(e) {
|
|
2073
|
-
i(e.el);
|
|
191
|
+
]
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
id: "overlays",
|
|
195
|
+
label: "浮层弹层",
|
|
196
|
+
description: "临时承载操作和上下文信息,要求定位、关闭、焦点和遮罩行为可靠。",
|
|
197
|
+
components: [
|
|
198
|
+
{
|
|
199
|
+
name: "UGModal",
|
|
200
|
+
route: "/vue/components/modal"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: "UGDialog",
|
|
204
|
+
route: "/vue/components/dialog"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: "UGDrawer",
|
|
208
|
+
route: "/vue/components/drawer"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "UGSheet",
|
|
212
|
+
route: "/vue/components/sheet"
|
|
2074
213
|
},
|
|
2075
|
-
|
|
2076
|
-
|
|
214
|
+
{
|
|
215
|
+
name: "UGDropdown",
|
|
216
|
+
route: "/vue/components/dropdown"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: "UGContextMenu",
|
|
220
|
+
route: "/vue/components/context-menu"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: "UGPopover",
|
|
224
|
+
route: "/vue/components/popover"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
name: "UGTooltip",
|
|
228
|
+
route: "/vue/components/tooltip"
|
|
2077
229
|
}
|
|
2078
|
-
|
|
2079
|
-
}
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
}
|
|
2105
|
-
function s() {
|
|
2106
|
-
window.addEventListener("resize", o), window.addEventListener("scroll", o, !0);
|
|
2107
|
-
}
|
|
2108
|
-
function c() {
|
|
2109
|
-
window.removeEventListener("resize", o), window.removeEventListener("scroll", o, !0);
|
|
2110
|
-
}
|
|
2111
|
-
return W(() => n.open.value, async (e) => {
|
|
2112
|
-
c(), !(!e || typeof window > "u") && (await A(), o(), s());
|
|
2113
|
-
}, { immediate: !0 }), N(() => {
|
|
2114
|
-
c();
|
|
2115
|
-
}), () => n.open.value ? D(v, { to: "body" }, [D("div", {
|
|
2116
|
-
ref: r,
|
|
2117
|
-
class: a.value,
|
|
2118
|
-
style: {
|
|
2119
|
-
top: `${i.value.top}px`,
|
|
2120
|
-
left: `${i.value.left}px`
|
|
230
|
+
]
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
id: "feedback",
|
|
234
|
+
label: "反馈状态",
|
|
235
|
+
description: "表达成功、警告、错误、空状态和加载过程,要求语义文案和视觉状态一致。",
|
|
236
|
+
components: [
|
|
237
|
+
{
|
|
238
|
+
name: "UGAlert",
|
|
239
|
+
route: "/vue/components/alert"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: "UGToaster",
|
|
243
|
+
route: "/vue/components/toast"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
name: "UGProgress",
|
|
247
|
+
route: "/vue/components/progress"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: "UGSkeleton",
|
|
251
|
+
route: "/vue/components/skeleton"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
name: "UGEmptyState",
|
|
255
|
+
route: "/vue/components/empty-state"
|
|
2121
256
|
}
|
|
2122
|
-
|
|
2123
|
-
}
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
}
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
class: a.value
|
|
2153
|
-
}, i.default?.());
|
|
2154
|
-
}
|
|
2155
|
-
});
|
|
2156
|
-
}
|
|
2157
|
-
var sr = or("UAlertTitle", "p", "text-sm font-semibold leading-5"), cr = or("UAlertDescription", "p", "text-sm leading-5 opacity-90"), lr = /* @__PURE__ */ E({
|
|
2158
|
-
name: "UAlert",
|
|
2159
|
-
__name: "alert",
|
|
2160
|
-
props: {
|
|
2161
|
-
variant: { default: "default" },
|
|
2162
|
-
class: { default: void 0 }
|
|
2163
|
-
},
|
|
2164
|
-
setup(e) {
|
|
2165
|
-
let t = e, n = {
|
|
2166
|
-
default: "border-l-primary bg-info-soft text-info-soft-fg",
|
|
2167
|
-
info: "border-l-info bg-info-soft text-info-soft-fg",
|
|
2168
|
-
success: "border-l-success bg-success-soft text-success-soft-fg",
|
|
2169
|
-
warning: "border-l-warning bg-warning-soft text-warning-soft-fg",
|
|
2170
|
-
destructive: "border-l-danger bg-danger-soft text-danger-soft-fg"
|
|
2171
|
-
}, r = {
|
|
2172
|
-
default: re,
|
|
2173
|
-
info: le,
|
|
2174
|
-
success: ae,
|
|
2175
|
-
warning: ie,
|
|
2176
|
-
destructive: re
|
|
2177
|
-
}, i = {
|
|
2178
|
-
default: "text-info",
|
|
2179
|
-
info: "text-info",
|
|
2180
|
-
success: "text-success",
|
|
2181
|
-
warning: "text-warning",
|
|
2182
|
-
destructive: "text-danger"
|
|
2183
|
-
}, a = y(() => Y("relative flex gap-3 rounded-md border-l-4 p-4", n[t.variant], t.class)), o = y(() => r[t.variant]), s = y(() => Y("mt-0.5 shrink-0", i[t.variant]));
|
|
2184
|
-
return (e, t) => (P(), S("div", {
|
|
2185
|
-
role: "alert",
|
|
2186
|
-
class: j(a.value)
|
|
2187
|
-
}, [(P(), b(z(o.value), {
|
|
2188
|
-
size: 18,
|
|
2189
|
-
class: j(s.value)
|
|
2190
|
-
}, null, 8, ["class"])), C("div", ar, [R(e.$slots, "default")])], 2));
|
|
2191
|
-
}
|
|
2192
|
-
}), ur = { class: "flex flex-wrap items-center gap-0 text-sm text-text-secondary" }, dr = E({
|
|
2193
|
-
name: "UBreadcrumbItem",
|
|
2194
|
-
props: { class: {
|
|
2195
|
-
type: String,
|
|
2196
|
-
default: void 0
|
|
2197
|
-
} },
|
|
2198
|
-
setup(e, { attrs: t, slots: n }) {
|
|
2199
|
-
let r = y(() => Y("flex items-center gap-1", e.class));
|
|
2200
|
-
return () => D("li", {
|
|
2201
|
-
...t,
|
|
2202
|
-
class: r.value
|
|
2203
|
-
}, n.default?.());
|
|
2204
|
-
}
|
|
2205
|
-
}), fr = E({
|
|
2206
|
-
name: "UBreadcrumbLink",
|
|
2207
|
-
inheritAttrs: !1,
|
|
2208
|
-
props: {
|
|
2209
|
-
current: {
|
|
2210
|
-
type: Boolean,
|
|
2211
|
-
default: !1
|
|
2212
|
-
},
|
|
2213
|
-
href: {
|
|
2214
|
-
type: String,
|
|
2215
|
-
default: void 0
|
|
2216
|
-
},
|
|
2217
|
-
class: {
|
|
2218
|
-
type: String,
|
|
2219
|
-
default: void 0
|
|
2220
|
-
}
|
|
2221
|
-
},
|
|
2222
|
-
setup(e, { attrs: t, slots: n }) {
|
|
2223
|
-
let r = y(() => Y(e.current ? "font-medium text-text-primary" : "transition-colors hover:text-text-primary", e.class));
|
|
2224
|
-
return () => e.current ? D("span", {
|
|
2225
|
-
...t,
|
|
2226
|
-
"aria-current": "page",
|
|
2227
|
-
class: r.value
|
|
2228
|
-
}, n.default?.()) : D("a", {
|
|
2229
|
-
...t,
|
|
2230
|
-
href: e.href,
|
|
2231
|
-
class: r.value
|
|
2232
|
-
}, n.default?.());
|
|
2233
|
-
}
|
|
2234
|
-
}), pr = E({
|
|
2235
|
-
name: "UBreadcrumbSeparator",
|
|
2236
|
-
props: { class: {
|
|
2237
|
-
type: String,
|
|
2238
|
-
default: void 0
|
|
2239
|
-
} },
|
|
2240
|
-
setup(e, { attrs: t, slots: n }) {
|
|
2241
|
-
let r = y(() => Y("text-text-tertiary", e.class));
|
|
2242
|
-
return () => D("li", {
|
|
2243
|
-
...t,
|
|
2244
|
-
role: "presentation",
|
|
2245
|
-
"aria-hidden": "true",
|
|
2246
|
-
class: r.value
|
|
2247
|
-
}, n.default?.() ?? [D(ce, { size: 14 })]);
|
|
2248
|
-
}
|
|
2249
|
-
}), mr = /* @__PURE__ */ E({
|
|
2250
|
-
name: "UBreadcrumb",
|
|
2251
|
-
__name: "breadcrumb",
|
|
2252
|
-
props: { class: { default: void 0 } },
|
|
2253
|
-
setup(e) {
|
|
2254
|
-
let t = e, n = y(() => Y(t.class));
|
|
2255
|
-
return (e, t) => (P(), S("nav", {
|
|
2256
|
-
"aria-label": "面包屑导航",
|
|
2257
|
-
class: j(n.value)
|
|
2258
|
-
}, [C("ol", ur, [R(e.$slots, "default")])], 2));
|
|
2259
|
-
}
|
|
2260
|
-
}), hr = ["for"], gr = {
|
|
2261
|
-
key: 0,
|
|
2262
|
-
class: "text-sm font-medium text-text-primary"
|
|
2263
|
-
}, _r = [
|
|
2264
|
-
"id",
|
|
2265
|
-
"aria-checked",
|
|
2266
|
-
"disabled"
|
|
2267
|
-
], vr = {
|
|
2268
|
-
key: 1,
|
|
2269
|
-
class: "text-sm font-medium text-text-primary"
|
|
2270
|
-
}, yr = [
|
|
2271
|
-
"id",
|
|
2272
|
-
"aria-checked",
|
|
2273
|
-
"disabled"
|
|
2274
|
-
], br = /* @__PURE__ */ E({
|
|
2275
|
-
name: "USwitch",
|
|
2276
|
-
__name: "switch",
|
|
2277
|
-
props: /* @__PURE__ */ k({
|
|
2278
|
-
disabled: {
|
|
2279
|
-
type: Boolean,
|
|
2280
|
-
default: !1
|
|
2281
|
-
},
|
|
2282
|
-
label: { default: void 0 },
|
|
2283
|
-
labelPlacement: { default: "right" },
|
|
2284
|
-
id: { default: void 0 },
|
|
2285
|
-
class: { default: void 0 }
|
|
2286
|
-
}, {
|
|
2287
|
-
checked: {
|
|
2288
|
-
type: Boolean,
|
|
2289
|
-
default: !1
|
|
2290
|
-
},
|
|
2291
|
-
checkedModifiers: {}
|
|
2292
|
-
}),
|
|
2293
|
-
emits: /* @__PURE__ */ k(["change"], ["update:checked"]),
|
|
2294
|
-
setup(e, { emit: t }) {
|
|
2295
|
-
let n = e, r = t, i = U(e, "checked"), a = H(), o = y(() => n.id ?? a), s = y(() => Y("relative inline-flex h-6 w-11 shrink-0 items-center rounded-full border-2 border-transparent transition-colors duration-200", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", "disabled:cursor-not-allowed disabled:opacity-50", i.value ? "bg-primary" : "bg-surface-3", n.class)), c = y(() => Y("inline-flex items-center gap-2", n.disabled && "cursor-not-allowed opacity-50"));
|
|
2296
|
-
function l() {
|
|
2297
|
-
n.disabled || (i.value = !i.value, r("change", i.value));
|
|
2298
|
-
}
|
|
2299
|
-
return (t, n) => e.label ? (P(), S("label", {
|
|
2300
|
-
key: 0,
|
|
2301
|
-
for: o.value,
|
|
2302
|
-
class: j(c.value)
|
|
2303
|
-
}, [
|
|
2304
|
-
e.labelPlacement === "left" ? (P(), S("span", gr, B(e.label), 1)) : x("", !0),
|
|
2305
|
-
C("button", {
|
|
2306
|
-
id: o.value,
|
|
2307
|
-
type: "button",
|
|
2308
|
-
role: "switch",
|
|
2309
|
-
"aria-checked": i.value,
|
|
2310
|
-
disabled: e.disabled,
|
|
2311
|
-
class: j(s.value),
|
|
2312
|
-
onClick: l
|
|
2313
|
-
}, [C("span", { class: j(V(Y)("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-sm ring-0 transition-transform duration-200", i.value ? "translate-x-5" : "translate-x-0")) }, null, 2)], 10, _r),
|
|
2314
|
-
e.labelPlacement === "right" ? (P(), S("span", vr, B(e.label), 1)) : x("", !0)
|
|
2315
|
-
], 10, hr)) : (P(), S("button", {
|
|
2316
|
-
key: 1,
|
|
2317
|
-
id: o.value,
|
|
2318
|
-
type: "button",
|
|
2319
|
-
role: "switch",
|
|
2320
|
-
"aria-checked": i.value,
|
|
2321
|
-
disabled: e.disabled,
|
|
2322
|
-
class: j(s.value),
|
|
2323
|
-
onClick: l
|
|
2324
|
-
}, [C("span", { class: j(V(Y)("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-sm ring-0 transition-transform duration-200", i.value ? "translate-x-5" : "translate-x-0")) }, null, 2)], 10, yr));
|
|
2325
|
-
}
|
|
2326
|
-
}), xr = { class: "flex flex-col gap-1" }, Sr = ["for"], Cr = [
|
|
2327
|
-
"id",
|
|
2328
|
-
"value",
|
|
2329
|
-
"rows",
|
|
2330
|
-
"disabled",
|
|
2331
|
-
"placeholder"
|
|
2332
|
-
], wr = {
|
|
2333
|
-
key: 1,
|
|
2334
|
-
class: "text-xs text-danger"
|
|
2335
|
-
}, Tr = {
|
|
2336
|
-
key: 2,
|
|
2337
|
-
class: "text-xs text-text-secondary"
|
|
2338
|
-
}, Er = /* @__PURE__ */ E({
|
|
2339
|
-
name: "UTextarea",
|
|
2340
|
-
inheritAttrs: !1,
|
|
2341
|
-
__name: "textarea",
|
|
2342
|
-
props: /* @__PURE__ */ k({
|
|
2343
|
-
label: { default: void 0 },
|
|
2344
|
-
error: { default: void 0 },
|
|
2345
|
-
helperText: { default: void 0 },
|
|
2346
|
-
id: { default: void 0 },
|
|
2347
|
-
rows: { default: 3 },
|
|
2348
|
-
disabled: {
|
|
2349
|
-
type: Boolean,
|
|
2350
|
-
default: !1
|
|
2351
|
-
},
|
|
2352
|
-
placeholder: { default: void 0 },
|
|
2353
|
-
class: { default: void 0 }
|
|
2354
|
-
}, {
|
|
2355
|
-
modelValue: {},
|
|
2356
|
-
modelModifiers: {}
|
|
2357
|
-
}),
|
|
2358
|
-
emits: /* @__PURE__ */ k([
|
|
2359
|
-
"blur",
|
|
2360
|
-
"focus",
|
|
2361
|
-
"input",
|
|
2362
|
-
"change"
|
|
2363
|
-
], ["update:modelValue"]),
|
|
2364
|
-
setup(e, { expose: t, emit: n }) {
|
|
2365
|
-
let r = e, i = n, a = U(e, "modelValue"), o = te(), s = H(), c = y(() => r.id ?? s), l = I(null), u = y(() => Y("w-full rounded-md border bg-surface-1 px-3 py-2 text-sm text-text-primary placeholder:text-text-tertiary", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1", "disabled:cursor-not-allowed disabled:opacity-50 resize-y", r.error ? "border-danger focus-visible:ring-danger" : "border-border-strong focus-visible:ring-ring/30", r.class)), d = y(() => {
|
|
2366
|
-
let e = { ...o };
|
|
2367
|
-
return delete e.class, e;
|
|
2368
|
-
});
|
|
2369
|
-
function f(e) {
|
|
2370
|
-
a.value = e.target.value, i("input", e);
|
|
2371
|
-
}
|
|
2372
|
-
function p(e) {
|
|
2373
|
-
i("change", e);
|
|
2374
|
-
}
|
|
2375
|
-
function m(e) {
|
|
2376
|
-
i("blur", e);
|
|
2377
|
-
}
|
|
2378
|
-
function h(e) {
|
|
2379
|
-
i("focus", e);
|
|
2380
|
-
}
|
|
2381
|
-
function g() {
|
|
2382
|
-
l.value?.focus();
|
|
2383
|
-
}
|
|
2384
|
-
function _() {
|
|
2385
|
-
l.value?.blur();
|
|
2386
|
-
}
|
|
2387
|
-
return t({
|
|
2388
|
-
focus: g,
|
|
2389
|
-
blur: _,
|
|
2390
|
-
el: l
|
|
2391
|
-
}), (t, n) => (P(), S("div", xr, [
|
|
2392
|
-
e.label ? (P(), S("label", {
|
|
2393
|
-
key: 0,
|
|
2394
|
-
for: c.value,
|
|
2395
|
-
class: "text-sm font-medium text-text-primary"
|
|
2396
|
-
}, B(e.label), 9, Sr)) : x("", !0),
|
|
2397
|
-
C("textarea", ee({
|
|
2398
|
-
id: c.value,
|
|
2399
|
-
ref_key: "textareaRef",
|
|
2400
|
-
ref: l,
|
|
2401
|
-
value: a.value ?? "",
|
|
2402
|
-
rows: e.rows,
|
|
2403
|
-
disabled: e.disabled,
|
|
2404
|
-
placeholder: e.placeholder,
|
|
2405
|
-
class: u.value
|
|
2406
|
-
}, d.value, {
|
|
2407
|
-
onInput: f,
|
|
2408
|
-
onChange: p,
|
|
2409
|
-
onBlur: m,
|
|
2410
|
-
onFocus: h
|
|
2411
|
-
}), null, 16, Cr),
|
|
2412
|
-
e.error ? (P(), S("p", wr, B(e.error), 1)) : e.helperText ? (P(), S("p", Tr, B(e.helperText), 1)) : x("", !0)
|
|
2413
|
-
]));
|
|
2414
|
-
}
|
|
2415
|
-
}), Dr = /* @__PURE__ */ E({
|
|
2416
|
-
name: "USkeleton",
|
|
2417
|
-
__name: "skeleton",
|
|
2418
|
-
props: {
|
|
2419
|
-
variant: { default: "rect" },
|
|
2420
|
-
class: { default: void 0 }
|
|
2421
|
-
},
|
|
2422
|
-
setup(e) {
|
|
2423
|
-
let t = e, n = {
|
|
2424
|
-
text: "h-4 w-full rounded",
|
|
2425
|
-
circle: "rounded-full",
|
|
2426
|
-
rect: "rounded-md"
|
|
2427
|
-
}, r = y(() => Y("animate-pulse bg-surface-3", n[t.variant], t.class));
|
|
2428
|
-
return (e, t) => (P(), S("div", {
|
|
2429
|
-
class: j(r.value),
|
|
2430
|
-
"aria-hidden": "true"
|
|
2431
|
-
}, null, 2));
|
|
2432
|
-
}
|
|
2433
|
-
}), Or = ["aria-valuenow", "aria-valuemax"], kr = {
|
|
2434
|
-
key: 0,
|
|
2435
|
-
class: "w-9 shrink-0 text-right text-xs font-medium tabular-nums text-text-secondary"
|
|
2436
|
-
}, Ar = /* @__PURE__ */ E({
|
|
2437
|
-
name: "UProgress",
|
|
2438
|
-
__name: "progress",
|
|
2439
|
-
props: {
|
|
2440
|
-
value: {},
|
|
2441
|
-
max: { default: 100 },
|
|
2442
|
-
showLabel: {
|
|
2443
|
-
type: Boolean,
|
|
2444
|
-
default: !1
|
|
2445
|
-
},
|
|
2446
|
-
color: { default: "bg-indigo-500" },
|
|
2447
|
-
class: { default: void 0 }
|
|
2448
|
-
},
|
|
2449
|
-
setup(e) {
|
|
2450
|
-
let t = e, n = y(() => Math.min(Math.max(t.value, 0), t.max)), r = y(() => Math.round(n.value / t.max * 100)), i = y(() => Y("flex items-center gap-3", t.class)), a = y(() => Y("h-full rounded-full transition-all duration-500 ease-out", t.color));
|
|
2451
|
-
return (t, o) => (P(), S("div", { class: j(i.value) }, [C("div", {
|
|
2452
|
-
role: "progressbar",
|
|
2453
|
-
"aria-valuenow": n.value,
|
|
2454
|
-
"aria-valuemin": "0",
|
|
2455
|
-
"aria-valuemax": e.max,
|
|
2456
|
-
class: "h-2 w-full overflow-hidden rounded-full bg-surface-2"
|
|
2457
|
-
}, [C("div", {
|
|
2458
|
-
class: j(a.value),
|
|
2459
|
-
style: M({ width: `${r.value}%` })
|
|
2460
|
-
}, null, 6)], 8, Or), e.showLabel ? (P(), S("span", kr, B(r.value) + "% ", 1)) : x("", !0)], 2));
|
|
2461
|
-
}
|
|
2462
|
-
}), jr = {
|
|
2463
|
-
key: 0,
|
|
2464
|
-
class: "fixed inset-0 z-50 flex",
|
|
2465
|
-
role: "dialog",
|
|
2466
|
-
"aria-modal": "true"
|
|
2467
|
-
}, Mr = {
|
|
2468
|
-
key: 0,
|
|
2469
|
-
class: "flex items-center justify-between border-b border-border-base px-5 py-4"
|
|
2470
|
-
}, Nr = {
|
|
2471
|
-
key: 0,
|
|
2472
|
-
class: "text-base font-semibold text-text-primary"
|
|
2473
|
-
}, Pr = { key: 1 }, Fr = { class: "flex-1 overflow-y-auto px-5 py-4" }, Ir = {
|
|
2474
|
-
key: 1,
|
|
2475
|
-
class: "border-t border-border-base px-5 py-4"
|
|
2476
|
-
}, Lr = /* @__PURE__ */ E({
|
|
2477
|
-
name: "USheet",
|
|
2478
|
-
__name: "sheet",
|
|
2479
|
-
props: /* @__PURE__ */ k({
|
|
2480
|
-
side: { default: "right" },
|
|
2481
|
-
title: { default: void 0 },
|
|
2482
|
-
closeOnOverlay: {
|
|
2483
|
-
type: Boolean,
|
|
2484
|
-
default: !0
|
|
2485
|
-
},
|
|
2486
|
-
closeOnEsc: {
|
|
2487
|
-
type: Boolean,
|
|
2488
|
-
default: !0
|
|
2489
|
-
},
|
|
2490
|
-
showCloseButton: {
|
|
2491
|
-
type: Boolean,
|
|
2492
|
-
default: !0
|
|
2493
|
-
},
|
|
2494
|
-
class: { default: void 0 }
|
|
2495
|
-
}, {
|
|
2496
|
-
open: {
|
|
2497
|
-
type: Boolean,
|
|
2498
|
-
default: !1
|
|
2499
|
-
},
|
|
2500
|
-
openModifiers: {}
|
|
2501
|
-
}),
|
|
2502
|
-
emits: /* @__PURE__ */ k(["close", "openChange"], ["update:open"]),
|
|
2503
|
-
setup(e, { emit: t }) {
|
|
2504
|
-
let n = e, r = t, i = U(e, "open"), a = y(() => Y("relative flex h-full w-80 max-w-full flex-col bg-surface-1 shadow-xl transition-transform duration-300 ease-in-out", n.side === "right" ? "ml-auto" : "mr-auto", n.class));
|
|
2505
|
-
function o(e) {
|
|
2506
|
-
typeof document > "u" || (document.body.style.overflow = e ? "hidden" : "");
|
|
2507
|
-
}
|
|
2508
|
-
function s() {
|
|
2509
|
-
i.value = !1, r("openChange", !1), r("close");
|
|
2510
|
-
}
|
|
2511
|
-
function c() {
|
|
2512
|
-
n.closeOnOverlay && s();
|
|
2513
|
-
}
|
|
2514
|
-
function l(e) {
|
|
2515
|
-
e.key === "Escape" && n.closeOnEsc && i.value && s();
|
|
2516
|
-
}
|
|
2517
|
-
return W(i, (e) => {
|
|
2518
|
-
if (o(e), e && typeof document < "u") {
|
|
2519
|
-
document.addEventListener("keydown", l), r("openChange", !0);
|
|
2520
|
-
return;
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
id: "data",
|
|
261
|
+
label: "数据展示",
|
|
262
|
+
description: "展示列表、对象详情、头像、指标和折叠信息,要求密度清晰且文本不挤出。",
|
|
263
|
+
components: [
|
|
264
|
+
{
|
|
265
|
+
name: "UGTable",
|
|
266
|
+
route: "/vue/components/table"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
name: "UGDescriptions",
|
|
270
|
+
route: "/vue/components/descriptions"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
name: "UGStatistic",
|
|
274
|
+
route: "/vue/components/statistic"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
name: "UGAvatar",
|
|
278
|
+
route: "/vue/components/avatar"
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
name: "UGAvatarGroup",
|
|
282
|
+
route: "/vue/components/avatar-group"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
name: "UGAccordion",
|
|
286
|
+
route: "/vue/components/accordion"
|
|
2521
287
|
}
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
}), Rr = {
|
|
2545
|
-
key: 0,
|
|
2546
|
-
class: "flex h-14 w-14 items-center justify-center rounded-full bg-surface-2"
|
|
2547
|
-
}, zr = { class: "flex flex-col gap-1" }, Br = {
|
|
2548
|
-
key: 0,
|
|
2549
|
-
class: "text-base font-semibold text-text-primary"
|
|
2550
|
-
}, Vr = {
|
|
2551
|
-
key: 0,
|
|
2552
|
-
class: "max-w-xs text-sm text-text-secondary"
|
|
2553
|
-
}, Hr = {
|
|
2554
|
-
key: 0,
|
|
2555
|
-
class: "mt-1"
|
|
2556
|
-
}, Ur = /* @__PURE__ */ E({
|
|
2557
|
-
name: "UEmptyState",
|
|
2558
|
-
__name: "empty-state",
|
|
2559
|
-
props: {
|
|
2560
|
-
icon: { default: void 0 },
|
|
2561
|
-
title: { default: void 0 },
|
|
2562
|
-
description: { default: void 0 },
|
|
2563
|
-
class: { default: void 0 }
|
|
2564
|
-
},
|
|
2565
|
-
setup(e) {
|
|
2566
|
-
let t = e, n = y(() => Y("flex flex-col items-center justify-center gap-3 py-16 text-center", t.class));
|
|
2567
|
-
return (t, r) => (P(), S("div", { class: j(n.value) }, [
|
|
2568
|
-
R(t.$slots, "icon", {}, () => [e.icon ? (P(), S("div", Rr, [(P(), b(z(e.icon), {
|
|
2569
|
-
size: 28,
|
|
2570
|
-
class: "text-text-tertiary"
|
|
2571
|
-
}))])) : x("", !0)]),
|
|
2572
|
-
C("div", zr, [R(t.$slots, "title", {}, () => [e.title ? (P(), S("p", Br, B(e.title), 1)) : x("", !0)]), R(t.$slots, "description", {}, () => [e.description ? (P(), S("p", Vr, B(e.description), 1)) : x("", !0)])]),
|
|
2573
|
-
t.$slots.action ? (P(), S("div", Hr, [R(t.$slots, "action")])) : x("", !0)
|
|
2574
|
-
], 2));
|
|
2575
|
-
}
|
|
2576
|
-
}), Wr = /* @__PURE__ */ E({
|
|
2577
|
-
name: "USpinner",
|
|
2578
|
-
__name: "spinner",
|
|
2579
|
-
props: {
|
|
2580
|
-
size: { default: "md" },
|
|
2581
|
-
label: { default: "加载中" },
|
|
2582
|
-
class: { default: void 0 }
|
|
2583
|
-
},
|
|
2584
|
-
setup(e) {
|
|
2585
|
-
let t = e, n = {
|
|
2586
|
-
sm: "h-4 w-4",
|
|
2587
|
-
md: "h-6 w-6",
|
|
2588
|
-
lg: "h-10 w-10"
|
|
2589
|
-
}, r = y(() => Y("animate-spin text-text-tertiary", n[t.size], t.class));
|
|
2590
|
-
return (t, n) => (P(), b(V(ue), {
|
|
2591
|
-
class: j(r.value),
|
|
2592
|
-
"aria-label": e.label,
|
|
2593
|
-
role: "status"
|
|
2594
|
-
}, null, 8, ["class", "aria-label"]));
|
|
2595
|
-
}
|
|
2596
|
-
}), Gr = ["disabled"], Kr = {
|
|
2597
|
-
key: 0,
|
|
2598
|
-
class: "select-none px-1 text-text-tertiary"
|
|
2599
|
-
}, qr = ["aria-current", "onClick"], Jr = ["disabled"], $ = 5, Yr = "inline-flex h-8 min-w-8 items-center justify-center rounded-md px-2 text-sm transition-colors disabled:pointer-events-none disabled:opacity-40", Xr = /* @__PURE__ */ E({
|
|
2600
|
-
name: "UPagination",
|
|
2601
|
-
__name: "pagination",
|
|
2602
|
-
props: /* @__PURE__ */ k({
|
|
2603
|
-
totalPages: {},
|
|
2604
|
-
class: { default: void 0 }
|
|
2605
|
-
}, {
|
|
2606
|
-
page: { default: 1 },
|
|
2607
|
-
pageModifiers: {}
|
|
2608
|
-
}),
|
|
2609
|
-
emits: /* @__PURE__ */ k(["pageChange"], ["update:page"]),
|
|
2610
|
-
setup(e, { emit: t }) {
|
|
2611
|
-
let n = e, r = t, i = U(e, "page"), a = y(() => Y("flex items-center gap-1", n.class)), o = y(() => {
|
|
2612
|
-
let e = i.value, t = n.totalPages;
|
|
2613
|
-
if (t <= $) return Array.from({ length: t }, (e, t) => t + 1);
|
|
2614
|
-
let r = Math.floor($ / 2), a = Math.max(1, e - r), o = Math.min(t, a + $ - 1);
|
|
2615
|
-
o - a < $ - 1 && (a = Math.max(1, o - $ + 1));
|
|
2616
|
-
let s = [];
|
|
2617
|
-
a > 1 && (s.push(1), a > 2 && s.push("..."));
|
|
2618
|
-
for (let e = a; e <= o; e += 1) s.push(e);
|
|
2619
|
-
return o < t && (o < t - 1 && s.push("..."), s.push(t)), s;
|
|
2620
|
-
});
|
|
2621
|
-
function s(e) {
|
|
2622
|
-
let t = Math.min(Math.max(e, 1), n.totalPages);
|
|
2623
|
-
t !== i.value && (i.value = t, r("pageChange", t));
|
|
2624
|
-
}
|
|
2625
|
-
return (t, n) => (P(), S("div", { class: j(a.value) }, [
|
|
2626
|
-
C("button", {
|
|
2627
|
-
type: "button",
|
|
2628
|
-
class: j(V(Y)(Yr, "border border-border-strong bg-surface-1 text-text-primary hover:bg-surface-3")),
|
|
2629
|
-
disabled: i.value <= 1,
|
|
2630
|
-
"aria-label": "上一页",
|
|
2631
|
-
onClick: n[0] || (n[0] = (e) => s(i.value - 1))
|
|
2632
|
-
}, [T(V(se), { size: 16 })], 10, Gr),
|
|
2633
|
-
(P(!0), S(_, null, L(o.value, (e, t) => (P(), S(_, { key: `${e}-${t}` }, [e === "..." ? (P(), S("span", Kr, "…")) : (P(), S("button", {
|
|
2634
|
-
key: 1,
|
|
2635
|
-
type: "button",
|
|
2636
|
-
class: j(V(Y)(Yr, e === i.value ? "bg-primary text-primary-fg" : "border border-border-strong bg-surface-1 text-text-primary hover:bg-surface-3")),
|
|
2637
|
-
"aria-current": e === i.value ? "page" : void 0,
|
|
2638
|
-
onClick: (t) => s(e)
|
|
2639
|
-
}, B(e), 11, qr))], 64))), 128)),
|
|
2640
|
-
C("button", {
|
|
2641
|
-
type: "button",
|
|
2642
|
-
class: j(V(Y)(Yr, "border border-border-strong bg-surface-1 text-text-primary hover:bg-surface-3")),
|
|
2643
|
-
disabled: i.value >= e.totalPages,
|
|
2644
|
-
"aria-label": "下一页",
|
|
2645
|
-
onClick: n[1] || (n[1] = (e) => s(i.value + 1))
|
|
2646
|
-
}, [T(V(ce), { size: 16 })], 10, Jr)
|
|
2647
|
-
], 2));
|
|
2648
|
-
}
|
|
2649
|
-
}), Zr = { class: "flex flex-col gap-1" }, Qr = ["for"], $r = [
|
|
2650
|
-
"id",
|
|
2651
|
-
"value",
|
|
2652
|
-
"disabled"
|
|
2653
|
-
], ei = {
|
|
2654
|
-
key: 0,
|
|
2655
|
-
value: "",
|
|
2656
|
-
disabled: ""
|
|
2657
|
-
}, ti = ["value"], ni = {
|
|
2658
|
-
key: 1,
|
|
2659
|
-
class: "text-xs text-danger"
|
|
2660
|
-
}, ri = {
|
|
2661
|
-
key: 2,
|
|
2662
|
-
class: "text-xs text-text-secondary"
|
|
2663
|
-
}, ii = /* @__PURE__ */ E({
|
|
2664
|
-
name: "USelect",
|
|
2665
|
-
inheritAttrs: !1,
|
|
2666
|
-
__name: "select",
|
|
2667
|
-
props: /* @__PURE__ */ k({
|
|
2668
|
-
label: { default: void 0 },
|
|
2669
|
-
error: { default: void 0 },
|
|
2670
|
-
helperText: { default: void 0 },
|
|
2671
|
-
options: {},
|
|
2672
|
-
placeholder: { default: void 0 },
|
|
2673
|
-
id: { default: void 0 },
|
|
2674
|
-
disabled: {
|
|
2675
|
-
type: Boolean,
|
|
2676
|
-
default: !1
|
|
2677
|
-
},
|
|
2678
|
-
class: { default: void 0 }
|
|
2679
|
-
}, {
|
|
2680
|
-
modelValue: {},
|
|
2681
|
-
modelModifiers: {}
|
|
2682
|
-
}),
|
|
2683
|
-
emits: /* @__PURE__ */ k([
|
|
2684
|
-
"blur",
|
|
2685
|
-
"focus",
|
|
2686
|
-
"change"
|
|
2687
|
-
], ["update:modelValue"]),
|
|
2688
|
-
setup(e, { expose: t, emit: n }) {
|
|
2689
|
-
let r = e, i = n, a = U(e, "modelValue"), o = te(), s = H(), c = y(() => r.id ?? s), l = I(null), u = y(() => Y("flex h-9 w-full rounded-md border bg-surface-1 px-3 py-1.5 text-sm text-text-primary", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1", "disabled:cursor-not-allowed disabled:opacity-50", r.error ? "border-red-400 focus-visible:ring-red-400" : "border-border-strong focus-visible:ring-ring/30", r.class)), d = y(() => {
|
|
2690
|
-
let e = { ...o };
|
|
2691
|
-
return delete e.class, e;
|
|
2692
|
-
});
|
|
2693
|
-
function f(e) {
|
|
2694
|
-
a.value = e.target.value, i("change", e);
|
|
2695
|
-
}
|
|
2696
|
-
function p(e) {
|
|
2697
|
-
i("focus", e);
|
|
2698
|
-
}
|
|
2699
|
-
function m(e) {
|
|
2700
|
-
i("blur", e);
|
|
2701
|
-
}
|
|
2702
|
-
function h() {
|
|
2703
|
-
l.value?.focus();
|
|
2704
|
-
}
|
|
2705
|
-
function g() {
|
|
2706
|
-
l.value?.blur();
|
|
2707
|
-
}
|
|
2708
|
-
return t({
|
|
2709
|
-
focus: h,
|
|
2710
|
-
blur: g,
|
|
2711
|
-
el: l
|
|
2712
|
-
}), (t, n) => (P(), S("div", Zr, [
|
|
2713
|
-
e.label ? (P(), S("label", {
|
|
2714
|
-
key: 0,
|
|
2715
|
-
for: c.value,
|
|
2716
|
-
class: "text-sm font-medium text-text-primary"
|
|
2717
|
-
}, B(e.label), 9, Qr)) : x("", !0),
|
|
2718
|
-
C("select", ee({
|
|
2719
|
-
id: c.value,
|
|
2720
|
-
ref_key: "selectRef",
|
|
2721
|
-
ref: l,
|
|
2722
|
-
value: a.value ?? "",
|
|
2723
|
-
disabled: e.disabled,
|
|
2724
|
-
class: u.value
|
|
2725
|
-
}, d.value, {
|
|
2726
|
-
onChange: f,
|
|
2727
|
-
onFocus: p,
|
|
2728
|
-
onBlur: m
|
|
2729
|
-
}), [e.placeholder ? (P(), S("option", ei, B(e.placeholder), 1)) : x("", !0), (P(!0), S(_, null, L(e.options, (e) => (P(), S("option", {
|
|
2730
|
-
key: String(e.value),
|
|
2731
|
-
value: e.value
|
|
2732
|
-
}, B(e.label), 9, ti))), 128))], 16, $r),
|
|
2733
|
-
e.error ? (P(), S("p", ni, B(e.error), 1)) : e.helperText ? (P(), S("p", ri, B(e.helperText), 1)) : x("", !0)
|
|
2734
|
-
]));
|
|
2735
|
-
}
|
|
2736
|
-
}), ai = { class: "flex-1 overflow-y-auto py-4" }, oi = { class: "flex flex-col gap-1 px-2" }, si = ["href", "title"], ci = {
|
|
2737
|
-
key: 0,
|
|
2738
|
-
class: "truncate"
|
|
2739
|
-
}, li = /* @__PURE__ */ E({
|
|
2740
|
-
name: "USidebar",
|
|
2741
|
-
__name: "sidebar",
|
|
2742
|
-
props: {
|
|
2743
|
-
items: {},
|
|
2744
|
-
collapsed: {
|
|
2745
|
-
type: Boolean,
|
|
2746
|
-
default: !1
|
|
2747
|
-
},
|
|
2748
|
-
class: { default: void 0 }
|
|
2749
|
-
},
|
|
2750
|
-
setup(e) {
|
|
2751
|
-
let t = e, n = y(() => Y("flex flex-col bg-primary text-primary-fg transition-all duration-300", t.collapsed ? "w-16" : "w-60", t.class));
|
|
2752
|
-
return (t, r) => (P(), S("aside", { class: j(n.value) }, [C("nav", ai, [C("ul", oi, [(P(!0), S(_, null, L(e.items, (t) => (P(), S("li", { key: t.href }, [C("a", {
|
|
2753
|
-
href: t.href,
|
|
2754
|
-
title: e.collapsed ? t.label : void 0,
|
|
2755
|
-
class: j(V(Y)("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors", t.active ? "bg-primary-active text-primary-fg font-medium" : "text-primary-fg/70 hover:bg-primary-hover hover:text-primary-fg"))
|
|
2756
|
-
}, [(P(), b(z(t.icon), {
|
|
2757
|
-
size: 18,
|
|
2758
|
-
class: "shrink-0"
|
|
2759
|
-
})), e.collapsed ? x("", !0) : (P(), S("span", ci, B(t.label), 1))], 10, si)]))), 128))])]), t.$slots.footer ? (P(), S("div", {
|
|
2760
|
-
key: 0,
|
|
2761
|
-
class: j(V(Y)("border-t border-primary-active px-2 py-4", e.collapsed && "flex justify-center"))
|
|
2762
|
-
}, [R(t.$slots, "footer")], 2)) : x("", !0)], 2));
|
|
2763
|
-
}
|
|
2764
|
-
}), ui = ["aria-orientation"], di = /* @__PURE__ */ E({
|
|
2765
|
-
name: "USeparator",
|
|
2766
|
-
__name: "separator",
|
|
2767
|
-
props: {
|
|
2768
|
-
orientation: { default: "horizontal" },
|
|
2769
|
-
class: { default: void 0 }
|
|
2770
|
-
},
|
|
2771
|
-
setup(e) {
|
|
2772
|
-
let t = {
|
|
2773
|
-
horizontal: "h-px w-full bg-border-base",
|
|
2774
|
-
vertical: "w-px h-full bg-border-base"
|
|
2775
|
-
}, n = e, r = y(() => Y(t[n.orientation], n.class));
|
|
2776
|
-
return (t, n) => (P(), S("div", {
|
|
2777
|
-
role: "separator",
|
|
2778
|
-
"aria-orientation": e.orientation,
|
|
2779
|
-
class: j(r.value)
|
|
2780
|
-
}, null, 10, ui));
|
|
2781
|
-
}
|
|
2782
|
-
}), fi = {
|
|
2783
|
-
key: 0,
|
|
2784
|
-
class: "mb-3 text-base font-semibold text-text-primary"
|
|
2785
|
-
}, pi = {
|
|
2786
|
-
key: 1,
|
|
2787
|
-
class: "w-full border-collapse border border-border-base"
|
|
2788
|
-
}, mi = ["colspan"], hi = E({
|
|
2789
|
-
name: "UDescriptionsItem",
|
|
2790
|
-
props: {
|
|
2791
|
-
label: {
|
|
2792
|
-
type: String,
|
|
2793
|
-
required: !0
|
|
2794
|
-
},
|
|
2795
|
-
span: {
|
|
2796
|
-
type: Number,
|
|
2797
|
-
default: 1
|
|
2798
|
-
},
|
|
2799
|
-
class: {
|
|
2800
|
-
type: String,
|
|
2801
|
-
default: void 0
|
|
2802
|
-
}
|
|
2803
|
-
},
|
|
2804
|
-
setup(e, { slots: t, attrs: n }) {
|
|
2805
|
-
return () => D("div", {
|
|
2806
|
-
...n,
|
|
2807
|
-
class: Y("flex flex-col gap-0.5", e.class)
|
|
2808
|
-
}, [D("span", { class: "text-xs font-medium text-text-secondary" }, e.label), D("span", { class: "text-sm text-text-primary" }, t.default?.())]);
|
|
2809
|
-
}
|
|
2810
|
-
}), gi = /* @__PURE__ */ E({
|
|
2811
|
-
name: "UDescriptions",
|
|
2812
|
-
__name: "descriptions",
|
|
2813
|
-
props: {
|
|
2814
|
-
column: { default: 2 },
|
|
2815
|
-
bordered: {
|
|
2816
|
-
type: Boolean,
|
|
2817
|
-
default: !1
|
|
2818
|
-
},
|
|
2819
|
-
size: { default: "default" },
|
|
2820
|
-
title: { default: void 0 },
|
|
2821
|
-
class: { default: void 0 }
|
|
2822
|
-
},
|
|
2823
|
-
setup(e) {
|
|
2824
|
-
let t = e, n = {
|
|
2825
|
-
1: "grid-cols-1",
|
|
2826
|
-
2: "grid-cols-2",
|
|
2827
|
-
3: "grid-cols-3",
|
|
2828
|
-
4: "grid-cols-4"
|
|
2829
|
-
}, r = {
|
|
2830
|
-
sm: "text-xs py-1 px-2",
|
|
2831
|
-
default: "text-sm py-2 px-3",
|
|
2832
|
-
lg: "text-base py-3 px-4"
|
|
2833
|
-
}, i = {
|
|
2834
|
-
sm: "text-xs py-1 px-2",
|
|
2835
|
-
default: "text-sm py-2 px-3",
|
|
2836
|
-
lg: "text-base py-3 px-4"
|
|
2837
|
-
}, a = y(() => Y("w-full", t.class)), o = y(() => Y("grid gap-x-6 gap-y-4", n[t.column])), s = y(() => Y("border border-border-base bg-surface-2 font-medium text-text-secondary", r[t.size])), c = y(() => Y("border border-border-base text-text-primary", i[t.size])), l = ne();
|
|
2838
|
-
function u() {
|
|
2839
|
-
let e = l.default?.({}) ?? [], t = [];
|
|
2840
|
-
for (let n of e) n.type?.name === "UDescriptionsItem" && t.push(n);
|
|
2841
|
-
return t;
|
|
2842
|
-
}
|
|
2843
|
-
let d = y(() => {
|
|
2844
|
-
let e = u(), n = [], r = [], i = 0;
|
|
2845
|
-
for (let a of e) {
|
|
2846
|
-
let e = a.props, o = e?.label ?? "", s = e?.span ?? 1;
|
|
2847
|
-
i + s > t.column && (n.push(r), r = [], i = 0), r.push({
|
|
2848
|
-
label: o,
|
|
2849
|
-
span: s,
|
|
2850
|
-
node: a
|
|
2851
|
-
}), i += s;
|
|
288
|
+
]
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
id: "patterns",
|
|
292
|
+
label: "框架模式",
|
|
293
|
+
description: "后台、工具型和跨业务通用模式,通过子入口 @ug666/ui-vue/patterns 使用。",
|
|
294
|
+
components: [
|
|
295
|
+
{
|
|
296
|
+
name: "UGAdminShell",
|
|
297
|
+
route: "/vue/patterns#adminshell"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: "UGPageHeader",
|
|
301
|
+
route: "/vue/patterns#pageheader"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
name: "UGCopyField",
|
|
305
|
+
route: "/vue/patterns#copyfield"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
name: "UGConfirmDialog",
|
|
309
|
+
route: "/vue/patterns#confirmdialog"
|
|
2852
310
|
}
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
}
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
value: {},
|
|
2875
|
-
precision: { default: void 0 },
|
|
2876
|
-
suffix: { default: void 0 },
|
|
2877
|
-
trend: { default: void 0 },
|
|
2878
|
-
change: { default: void 0 },
|
|
2879
|
-
size: { default: "default" },
|
|
2880
|
-
class: { default: void 0 }
|
|
2881
|
-
},
|
|
2882
|
-
setup(e) {
|
|
2883
|
-
let t = e, n = {
|
|
2884
|
-
sm: "text-xs",
|
|
2885
|
-
default: "text-sm",
|
|
2886
|
-
lg: "text-base"
|
|
2887
|
-
}, r = {
|
|
2888
|
-
sm: "text-2xl",
|
|
2889
|
-
default: "text-3xl",
|
|
2890
|
-
lg: "text-4xl"
|
|
2891
|
-
}, i = {
|
|
2892
|
-
sm: "text-xs",
|
|
2893
|
-
default: "text-sm",
|
|
2894
|
-
lg: "text-base"
|
|
2895
|
-
}, a = {
|
|
2896
|
-
up: "text-success",
|
|
2897
|
-
down: "text-danger",
|
|
2898
|
-
flat: "text-text-secondary"
|
|
2899
|
-
}, o = {
|
|
2900
|
-
up: "text-success",
|
|
2901
|
-
down: "text-danger",
|
|
2902
|
-
flat: "text-text-secondary"
|
|
2903
|
-
}, s = {
|
|
2904
|
-
up: pe,
|
|
2905
|
-
down: fe,
|
|
2906
|
-
flat: q
|
|
2907
|
-
}, c = y(() => Y("flex flex-col gap-1", t.class)), l = y(() => Y("font-medium text-text-secondary", n[t.size])), u = y(() => Y("font-bold tabular-nums text-text-primary", r[t.size])), d = y(() => Y("text-text-secondary", i[t.size])), f = y(() => Y("text-text-primary", i[t.size])), p = y(() => t.trend ? a[t.trend] : ""), m = y(() => t.trend ? Y("text-xs font-medium", o[t.trend]) : ""), h = y(() => t.size === "sm" ? 14 : t.size === "lg" ? 18 : 16), g = y(() => t.trend ? s[t.trend] : null), _ = y(() => typeof t.value == "string" ? t.value : new Intl.NumberFormat("zh-CN", {
|
|
2908
|
-
minimumFractionDigits: t.precision ?? 0,
|
|
2909
|
-
maximumFractionDigits: t.precision ?? 0
|
|
2910
|
-
}).format(t.value));
|
|
2911
|
-
return (t, n) => (P(), S("div", { class: j(c.value) }, [
|
|
2912
|
-
e.title ? (P(), S("span", {
|
|
2913
|
-
key: 0,
|
|
2914
|
-
class: j(l.value)
|
|
2915
|
-
}, B(e.title), 3)) : x("", !0),
|
|
2916
|
-
C("div", _i, [
|
|
2917
|
-
t.$slots.prefix ? (P(), S("span", {
|
|
2918
|
-
key: 0,
|
|
2919
|
-
class: j(f.value)
|
|
2920
|
-
}, [R(t.$slots, "prefix")], 2)) : x("", !0),
|
|
2921
|
-
C("span", { class: j(u.value) }, B(_.value), 3),
|
|
2922
|
-
t.$slots.suffix || e.suffix ? (P(), S("span", {
|
|
2923
|
-
key: 1,
|
|
2924
|
-
class: j(d.value)
|
|
2925
|
-
}, [R(t.$slots, "suffix", {}, () => [w(B(e.suffix), 1)])], 2)) : x("", !0)
|
|
2926
|
-
]),
|
|
2927
|
-
e.trend || e.change ? (P(), S("div", vi, [g.value ? (P(), b(z(g.value), {
|
|
2928
|
-
key: 0,
|
|
2929
|
-
size: h.value,
|
|
2930
|
-
class: j(p.value)
|
|
2931
|
-
}, null, 8, ["size", "class"])) : x("", !0), e.change && e.trend ? (P(), S("span", {
|
|
2932
|
-
key: 1,
|
|
2933
|
-
class: j(m.value)
|
|
2934
|
-
}, B(e.change), 3)) : x("", !0)])) : x("", !0)
|
|
2935
|
-
], 2));
|
|
2936
|
-
}
|
|
2937
|
-
});
|
|
311
|
+
]
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
id: "blocks",
|
|
315
|
+
label: "展示区块",
|
|
316
|
+
description: "展示页、产品页和介绍页区块,通过子入口 @ug666/ui-vue/blocks 使用。",
|
|
317
|
+
components: [{
|
|
318
|
+
name: "UGLandingHero",
|
|
319
|
+
route: "/vue/blocks#landinghero"
|
|
320
|
+
}, {
|
|
321
|
+
name: "UGFeatureGrid",
|
|
322
|
+
route: "/vue/blocks#featuregrid"
|
|
323
|
+
}]
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
id: "labs",
|
|
327
|
+
label: "实验组件",
|
|
328
|
+
description: "尚未稳定承诺的实验组件,通过子入口 @ug666/ui-vue/labs 使用。",
|
|
329
|
+
components: []
|
|
330
|
+
}
|
|
331
|
+
];
|
|
2938
332
|
//#endregion
|
|
2939
|
-
export {
|
|
333
|
+
export { p as UAccordion, p as UGAccordion, le as UAccordionContent, le as UGAccordionContent, f as UAccordionItem, f as UGAccordionItem, k as UAccordionTrigger, k as UGAccordionTrigger, j as UAlert, j as UGAlert, ve as UAlertDescription, ve as UGAlertDescription, we as UAlertTitle, we as UGAlertTitle, be as UAvatar, be as UGAvatar, C as UAvatarFallback, C as UGAvatarFallback, r as UAvatarGroup, r as UGAvatarGroup, s as UAvatarImage, s as UGAvatarImage, Ne as UBadge, Ne as UGBadge, se as UBreadcrumb, se as UGBreadcrumb, te as UBreadcrumbItem, te as UGBreadcrumbItem, K as UBreadcrumbLink, K as UGBreadcrumbLink, W as UBreadcrumbSeparator, W as UGBreadcrumbSeparator, Oe as UButton, Oe as UGButton, ke as UCard, ke as UGCard, Ie as UCardContent, Ie as UGCardContent, Re as UCardDescription, Re as UGCardDescription, Ae as UCardFooter, Ae as UGCardFooter, Pe as UCardHeader, Pe as UGCardHeader, Be as UCardTitle, Be as UGCardTitle, U as UCheckbox, U as UGCheckbox, h as UContextMenu, h as UGContextMenu, g as UContextMenuContent, g as UGContextMenuContent, v as UContextMenuItem, v as UGContextMenuItem, c as UContextMenuSeparator, c as UGContextMenuSeparator, d as UContextMenuTrigger, d as UGContextMenuTrigger, ue as UDescriptions, ue as UGDescriptions, J as UDescriptionsItem, J as UGDescriptionsItem, o as UDialog, o as UGDialog, I as UDrawer, I as UGDrawer, Ce as UDrawerClose, Ce as UGDrawerClose, S as UDrawerContent, S as UGDrawerContent, i as UDrawerDescription, i as UGDrawerDescription, xe as UDrawerFooter, xe as UGDrawerFooter, w as UDrawerHeader, w as UGDrawerHeader, ee as UDrawerTitle, ee as UGDrawerTitle, n as UDropdown, n as UGDropdown, n as UGDropdownMenu, E as UDropdownContent, E as UGDropdownContent, u as UDropdownItem, u as UGDropdownItem, T as UDropdownSeparator, T as UGDropdownSeparator, D as UDropdownTrigger, D as UGDropdownTrigger, fe as UEmptyState, fe as UGEmptyState, V as UForm, V as UGForm, he as UFormControl, he as UGFormControl, ie as UFormDescription, ie as UGFormDescription, de as UFormField, de as UGFormField, Y as UFormItem, Y as UGFormItem, P as UFormLabel, P as UGFormLabel, oe as UFormMessage, oe as UGFormMessage, Me as UGInput, Me as UInput, je as UGLabel, je as ULabel, Ve as UGModal, Ve as UModal, a as UGNavigationMenu, a as UNavigationMenu, _ as UGNavigationMenuContent, _ as UNavigationMenuContent, Z as UGNavigationMenuItem, Z as UNavigationMenuItem, t as UGNavigationMenuLink, t as UNavigationMenuLink, X as UGNavigationMenuTrigger, X as UNavigationMenuTrigger, R as UGNumberInput, R as UNumberInput, pe as UGOTPInput, pe as UOTPInput, ae as UGPagination, ae as UPagination, m as UGPopover, m as UPopover, b as UGPopoverContent, b as UPopoverContent, Ee as UGPopoverTrigger, Ee as UPopoverTrigger, Q as UGProgress, Q as UProgress, B as UGRadio, B as URadio, _e as UGRadioGroup, _e as URadioGroup, N as UGSelect, N as USelect, ze as UGSeparator, ze as USeparator, L as UGSheet, L as USheet, He as UGSidebar, He as USidebar, ge as UGSkeleton, ge as USkeleton, $ as UGSlider, $ as USlider, Fe as UGSpinner, Fe as USpinner, re as UGStatistic, re as UStatistic, l as UGSteps, l as USteps, H as UGSwitch, H as USwitch, ne as UGTable, ne as UTable, q as UGTableBody, q as UTableBody, G as UGTableCell, G as UTableCell, M as UGTableHead, M as UTableHead, ye as UGTableHeader, ye as UTableHeader, Te as UGTableRow, Te as UTableRow, O as UGTabs, O as UTabs, A as UGTabsContent, A as UTabsContent, y as UGTabsList, y as UTabsList, e as UGTabsTrigger, e as UTabsTrigger, Le as UGTag, Le as UTag, z as UGTextarea, z as UTextarea, ce as UGToaster, ce as UToaster, F as UGTooltip, F as UTooltip, Se as UGTooltipContent, Se as UTooltipContent, x as UGTooltipTrigger, x as UTooltipTrigger, De as cn, ot as default, at as install, st as theme, Ue as toast, Ke as useClickOutside, rt as useCopyToClipboard, Xe as useDebounce, nt as useEventListener, tt as useForm, Ze as useHotkeys, Je as useInterval, $e as useLocalStorage, qe as useMediaQuery, We as useMounted, Ge as usePagination, et as useTimeout, Qe as useToast, Ye as useToggle, ct as vueComponentLayers };
|
|
2940
334
|
|
|
2941
335
|
//# sourceMappingURL=index.js.map
|