@mureka-fe/ui 2.0.0 → 3.0.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/llms.txt +30 -1
- package/dist/src/components/badge/Badge.vue.d.ts +13 -0
- package/dist/src/components/badge/Badge.vue.d.ts.map +1 -0
- package/dist/src/components/badge/__docs__/demos/content.demo.vue.d.ts +3 -0
- package/dist/src/components/badge/__docs__/demos/content.demo.vue.d.ts.map +1 -0
- package/dist/src/components/badge/__docs__/demos/preset.demo.vue.d.ts +3 -0
- package/dist/src/components/badge/__docs__/demos/preset.demo.vue.d.ts.map +1 -0
- package/dist/src/components/badge/__docs__/demos/variant.demo.vue.d.ts +3 -0
- package/dist/src/components/badge/__docs__/demos/variant.demo.vue.d.ts.map +1 -0
- package/dist/src/components/badge/__docs__/meta.d.ts +4 -0
- package/dist/src/components/badge/__docs__/meta.d.ts.map +1 -0
- package/dist/src/components/badge/badge.spec.d.ts +2 -0
- package/dist/src/components/badge/badge.spec.d.ts.map +1 -0
- package/dist/src/components/badge/badge.types.d.ts +24 -0
- package/dist/src/components/badge/badge.types.d.ts.map +1 -0
- package/dist/src/components/badge/index.d.ts +3 -0
- package/dist/src/components/badge/index.d.ts.map +1 -0
- package/dist/src/components/modal/Modal.vue.d.ts +2 -2
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/ui.js +616 -471
- package/dist/ui.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/ui.js
CHANGED
|
@@ -1,5 +1,154 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
1
|
+
import { defineComponent as H, computed as n, openBlock as v, createElementBlock as h, normalizeClass as K, Fragment as Y, createElementVNode as f, createCommentVNode as T, renderSlot as C, createTextVNode as D, toDisplayString as I, useSlots as X, useAttrs as R, normalizeStyle as ve, reactive as Se, h as me, createVNode as Le, TransitionGroup as Pe, withCtx as ee, renderList as He, createBlock as Z, resolveDynamicComponent as Ne, unref as z, onMounted as se, onBeforeUnmount as ne, watch as oe, Teleport as Ie, mergeProps as A, ref as P, createApp as ze, inject as he, nextTick as q, provide as pe } from "vue";
|
|
2
|
+
const Oe = [
|
|
3
|
+
"new",
|
|
4
|
+
"new-mini",
|
|
5
|
+
"premier",
|
|
6
|
+
"pro",
|
|
7
|
+
"beta",
|
|
8
|
+
"free",
|
|
9
|
+
"studio",
|
|
10
|
+
"upload",
|
|
11
|
+
"publish",
|
|
12
|
+
"published",
|
|
13
|
+
"details",
|
|
14
|
+
"bpm"
|
|
15
|
+
], Ae = ["outline", "solid", "soft"], Re = {
|
|
16
|
+
new: { isSvgPreset: !0 },
|
|
17
|
+
"new-mini": { isSvgPreset: !0 },
|
|
18
|
+
premier: { defaultContent: "Premier" },
|
|
19
|
+
pro: { defaultContent: "Pro" },
|
|
20
|
+
beta: { defaultContent: "Beta" },
|
|
21
|
+
free: { defaultContent: "1 Free" },
|
|
22
|
+
studio: { defaultContent: "Studio" },
|
|
23
|
+
upload: { defaultContent: "Upload" },
|
|
24
|
+
publish: { defaultContent: "Publish" },
|
|
25
|
+
published: { defaultContent: "Published" },
|
|
26
|
+
details: { defaultContent: "Details" },
|
|
27
|
+
bpm: { defaultContent: "62 BPM" }
|
|
28
|
+
};
|
|
29
|
+
function ge(e, t) {
|
|
30
|
+
return typeof t == "string" && e.includes(t);
|
|
31
|
+
}
|
|
32
|
+
function De(e) {
|
|
33
|
+
return ge(Ae, e);
|
|
34
|
+
}
|
|
35
|
+
function Ee(e) {
|
|
36
|
+
return ge(Oe, e);
|
|
37
|
+
}
|
|
38
|
+
function be(e = {}) {
|
|
39
|
+
if (Ee(e.preset)) {
|
|
40
|
+
const t = Re[e.preset];
|
|
41
|
+
return {
|
|
42
|
+
preset: e.preset,
|
|
43
|
+
defaultContent: t.defaultContent,
|
|
44
|
+
isSvgPreset: t.isSvgPreset ?? !1
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
variant: De(e.variant) ? e.variant : "outline",
|
|
49
|
+
paid: e.paid ?? !1,
|
|
50
|
+
isSvgPreset: !1
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function Ge(e = {}) {
|
|
54
|
+
const t = be(e), a = ["mu-badge"];
|
|
55
|
+
return t.preset ? (a.push(`mu-badge--preset-${t.preset}`), t.isSvgPreset && a.push("mu-badge--svg"), t.preset === "details" && a.push("mu-badge--with-default-icon"), a) : (a.push(`mu-badge--variant-${t.variant}`, t.paid ? "is-paid" : "is-free"), a);
|
|
56
|
+
}
|
|
57
|
+
const Ue = ["role", "aria-label"], Ze = {
|
|
58
|
+
key: 0,
|
|
59
|
+
"data-test": "new-wordmark",
|
|
60
|
+
class: "mu-badge__new-wordmark",
|
|
61
|
+
viewBox: "0 0 20 8",
|
|
62
|
+
fill: "none",
|
|
63
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
64
|
+
"aria-hidden": "true"
|
|
65
|
+
}, je = {
|
|
66
|
+
key: 1,
|
|
67
|
+
"data-test": "new-mini-wordmark",
|
|
68
|
+
class: "mu-badge__new-wordmark",
|
|
69
|
+
viewBox: "0 0 15 6",
|
|
70
|
+
fill: "none",
|
|
71
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
72
|
+
"aria-hidden": "true"
|
|
73
|
+
}, Fe = {
|
|
74
|
+
key: 0,
|
|
75
|
+
class: "mu-badge__prefix",
|
|
76
|
+
"aria-hidden": "true"
|
|
77
|
+
}, qe = { class: "mu-badge__content" }, Ke = /* @__PURE__ */ H({
|
|
78
|
+
__name: "Badge",
|
|
79
|
+
props: {
|
|
80
|
+
variant: {},
|
|
81
|
+
paid: { type: Boolean },
|
|
82
|
+
preset: {}
|
|
83
|
+
},
|
|
84
|
+
setup(e) {
|
|
85
|
+
const t = e, a = n(() => be(t)), o = n(() => Ge(t)), r = n(() => a.value.isSvgPreset ? "img" : void 0), s = n(() => a.value.isSvgPreset ? "NEW" : void 0), l = n(() => a.value.preset === "details");
|
|
86
|
+
return (d, i) => (v(), h("span", {
|
|
87
|
+
class: K(o.value),
|
|
88
|
+
role: r.value,
|
|
89
|
+
"aria-label": s.value
|
|
90
|
+
}, [
|
|
91
|
+
a.value.isSvgPreset ? (v(), h(Y, { key: 0 }, [
|
|
92
|
+
a.value.preset === "new" ? (v(), h("svg", Ze, [...i[0] || (i[0] = [
|
|
93
|
+
f("path", {
|
|
94
|
+
d: "M0 8V0H1.49679L3.84103 6.65205C3.82636 6.44018 3.80802 6.18813 3.78601 5.89589C3.76399 5.60365 3.74565 5.30046 3.73098 4.9863C3.72364 4.67215 3.71997 4.38721 3.71997 4.13151V0H4.82055V8H3.32376L0.990525 1.34794C1.0052 1.5379 1.01987 1.77534 1.03455 2.06027C1.05656 2.34521 1.07123 2.6411 1.07857 2.94795C1.09325 3.25479 1.10058 3.53973 1.10058 3.80274V8H0Z",
|
|
95
|
+
fill: "currentColor"
|
|
96
|
+
}, null, -1),
|
|
97
|
+
f("path", {
|
|
98
|
+
d: "M7.40262 8V0H12.1241V1.05205H8.56924V3.32055H11.7389V4.36164H8.56924V6.94795H12.1241V8H7.40262Z",
|
|
99
|
+
fill: "currentColor"
|
|
100
|
+
}, null, -1),
|
|
101
|
+
f("path", {
|
|
102
|
+
d: "M14.7282 8L13.8587 0H14.9263L15.4656 5.74247C15.4803 5.88858 15.4913 6.04932 15.4986 6.22466C15.5133 6.4 15.5243 6.57169 15.5316 6.73973C15.5463 6.90776 15.5536 7.05388 15.5536 7.17808C15.5683 7.05388 15.583 6.90776 15.5977 6.73973C15.6123 6.57169 15.627 6.4 15.6417 6.22466C15.6637 6.04932 15.6857 5.88858 15.7077 5.74247L16.4011 0H17.5017L18.151 5.74247C18.1657 5.88858 18.1804 6.04932 18.195 6.22466C18.2171 6.4 18.2391 6.57169 18.2611 6.73973C18.2831 6.90776 18.2978 7.05388 18.3051 7.17808C18.3124 7.05388 18.3198 6.90776 18.3271 6.73973C18.3418 6.57169 18.3565 6.4 18.3711 6.22466C18.3858 6.04932 18.4005 5.88858 18.4152 5.74247L18.9655 0H20L19.0975 8H17.7218L17.0724 2.18082C17.0578 2.0274 17.0431 1.86667 17.0284 1.69863C17.0138 1.52329 16.9991 1.35525 16.9844 1.19452C16.9697 1.02648 16.9551 0.887671 16.9404 0.778082C16.933 0.887671 16.922 1.02648 16.9074 1.19452C16.8927 1.35525 16.878 1.52329 16.8633 1.69863C16.8487 1.86667 16.8303 2.0274 16.8083 2.18082L16.1149 8H14.7282Z",
|
|
103
|
+
fill: "currentColor"
|
|
104
|
+
}, null, -1)
|
|
105
|
+
])])) : a.value.preset === "new-mini" ? (v(), h("svg", je, [...i[1] || (i[1] = [
|
|
106
|
+
f("path", {
|
|
107
|
+
d: "M0 6V0H1.12259L2.88078 4.98904C2.86977 4.83014 2.85601 4.6411 2.8395 4.42192C2.823 4.20274 2.80924 3.97534 2.79823 3.73973C2.79273 3.50411 2.78998 3.29041 2.78998 3.09863V0H3.61542V6H2.49282L0.742893 1.01096C0.753899 1.15342 0.764905 1.33151 0.775911 1.54521C0.79242 1.7589 0.803426 1.98082 0.808928 2.21096C0.819934 2.4411 0.825437 2.65479 0.825437 2.85205V6H0Z",
|
|
108
|
+
fill: "currentColor"
|
|
109
|
+
}, null, -1),
|
|
110
|
+
f("path", {
|
|
111
|
+
d: "M5.55197 6V0H9.09309V0.789041H6.42693V2.49041H8.80419V3.27123H6.42693V5.21096H9.09309V6H5.55197Z",
|
|
112
|
+
fill: "currentColor"
|
|
113
|
+
}, null, -1),
|
|
114
|
+
f("path", {
|
|
115
|
+
d: "M11.0462 6L10.3941 0H11.1947L11.5992 4.30685C11.6102 4.41644 11.6185 4.53699 11.624 4.66849C11.635 4.8 11.6432 4.92877 11.6487 5.05479C11.6597 5.18082 11.6652 5.29041 11.6652 5.38356C11.6762 5.29041 11.6872 5.18082 11.6982 5.05479C11.7093 4.92877 11.7203 4.8 11.7313 4.66849C11.7478 4.53699 11.7643 4.41644 11.7808 4.30685L12.3008 0H13.1263L13.6133 4.30685C13.6243 4.41644 13.6353 4.53699 13.6463 4.66849C13.6628 4.8 13.6793 4.92877 13.6958 5.05479C13.7123 5.18082 13.7233 5.29041 13.7288 5.38356C13.7343 5.29041 13.7398 5.18082 13.7453 5.05479C13.7563 4.92877 13.7673 4.8 13.7784 4.66849C13.7894 4.53699 13.8004 4.41644 13.8114 4.30685L14.2241 0H15L14.3231 6H13.2913L12.8043 1.63562C12.7933 1.52055 12.7823 1.4 12.7713 1.27397C12.7603 1.14247 12.7493 1.01644 12.7383 0.89589C12.7273 0.769863 12.7163 0.665753 12.7053 0.583561C12.6998 0.665753 12.6915 0.769863 12.6805 0.89589C12.6695 1.01644 12.6585 1.14247 12.6475 1.27397C12.6365 1.4 12.6227 1.52055 12.6062 1.63562L12.0862 6H11.0462Z",
|
|
116
|
+
fill: "currentColor"
|
|
117
|
+
}, null, -1)
|
|
118
|
+
])])) : T("", !0)
|
|
119
|
+
], 64)) : (v(), h(Y, { key: 1 }, [
|
|
120
|
+
l.value ? (v(), h("span", Fe, [...i[2] || (i[2] = [
|
|
121
|
+
f("svg", {
|
|
122
|
+
"data-test": "details-icon",
|
|
123
|
+
viewBox: "0 0 12 12",
|
|
124
|
+
fill: "none",
|
|
125
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
126
|
+
"aria-hidden": "true"
|
|
127
|
+
}, [
|
|
128
|
+
f("path", {
|
|
129
|
+
d: "M1.5 3.5V2.5C1.5 2.23478 1.60536 1.98043 1.79289 1.79289C1.98043 1.60536 2.23478 1.5 2.5 1.5H3.5M8.5 1.5H9.5C9.76522 1.5 10.0196 1.60536 10.2071 1.79289C10.3946 1.98043 10.5 2.23478 10.5 2.5V3.5M10.5 8.5V9.5C10.5 9.76522 10.3946 10.0196 10.2071 10.2071C10.0196 10.3946 9.76522 10.5 9.5 10.5H8.5M3.5 10.5H2.5C2.23478 10.5 1.98043 10.3946 1.79289 10.2071C1.60536 10.0196 1.5 9.76522 1.5 9.5V8.5M3.5 4H7.5M3.5 6H8.5M3.5 8H6.5",
|
|
130
|
+
stroke: "currentColor",
|
|
131
|
+
"stroke-opacity": "0.9",
|
|
132
|
+
"stroke-linecap": "round",
|
|
133
|
+
"stroke-linejoin": "round"
|
|
134
|
+
})
|
|
135
|
+
], -1)
|
|
136
|
+
])])) : T("", !0),
|
|
137
|
+
f("span", qe, [
|
|
138
|
+
C(d.$slots, "default", {}, () => [
|
|
139
|
+
D(I(a.value.defaultContent), 1)
|
|
140
|
+
], !0)
|
|
141
|
+
])
|
|
142
|
+
], 64))
|
|
143
|
+
], 10, Ue));
|
|
144
|
+
}
|
|
145
|
+
}), N = (e, t) => {
|
|
146
|
+
const a = e.__vccOpts || e;
|
|
147
|
+
for (const [o, r] of t)
|
|
148
|
+
a[o] = r;
|
|
149
|
+
return a;
|
|
150
|
+
}, La = /* @__PURE__ */ N(Ke, [["__scopeId", "data-v-aa9886ca"]]);
|
|
151
|
+
function le(e = {}) {
|
|
3
152
|
return {
|
|
4
153
|
type: e.type ?? "primary",
|
|
5
154
|
status: e.status,
|
|
@@ -13,8 +162,8 @@ function oe(e = {}) {
|
|
|
13
162
|
nativeType: e.nativeType ?? "button"
|
|
14
163
|
};
|
|
15
164
|
}
|
|
16
|
-
function
|
|
17
|
-
const t =
|
|
165
|
+
function Xe(e = {}) {
|
|
166
|
+
const t = le(e), a = [
|
|
18
167
|
"mu-button",
|
|
19
168
|
`mu-button--${t.type}`,
|
|
20
169
|
`mu-button--appearance-${t.appearance}`,
|
|
@@ -22,29 +171,29 @@ function Le(e = {}) {
|
|
|
22
171
|
];
|
|
23
172
|
return t.type === "ghost" && t.ghostTextTone === "primary" && a.push(`mu-button--ghost-text-${t.ghostTextTone}`), t.shape === "pill" && a.push("mu-button--shape-pill"), t.status && a.push(`mu-button--status-${t.status}`), t.iconOnly && a.push("mu-button--icon-only"), t.disabled && a.push("is-disabled"), t.loading && a.push("is-loading"), a;
|
|
24
173
|
}
|
|
25
|
-
function
|
|
26
|
-
const t =
|
|
174
|
+
function We(e = {}) {
|
|
175
|
+
const t = le(e);
|
|
27
176
|
return !t.disabled && !t.loading;
|
|
28
177
|
}
|
|
29
|
-
function
|
|
30
|
-
const t = e.iconOnly ?? !1, a = e.hasPrefix ?? !1,
|
|
178
|
+
function Je(e = {}) {
|
|
179
|
+
const t = e.iconOnly ?? !1, a = e.hasPrefix ?? !1, o = e.hasSuffix ?? !1, r = e.loading ?? !1, s = e.hasAriaLabel ?? !1;
|
|
31
180
|
return {
|
|
32
181
|
showPrefixSlot: !t && !r && a,
|
|
33
|
-
showSuffixSlot: !t &&
|
|
182
|
+
showSuffixSlot: !t && o,
|
|
34
183
|
showLoadingIndicator: r,
|
|
35
184
|
requiresAriaLabel: t && !s,
|
|
36
|
-
isInvalidIconOnlyCombination: t && (a ||
|
|
185
|
+
isInvalidIconOnlyCombination: t && (a || o)
|
|
37
186
|
};
|
|
38
187
|
}
|
|
39
|
-
const
|
|
188
|
+
const Qe = ["type", "disabled", "aria-busy"], Ye = {
|
|
40
189
|
key: 0,
|
|
41
190
|
class: "mu-button__prefix",
|
|
42
191
|
"aria-hidden": "true"
|
|
43
|
-
},
|
|
192
|
+
}, et = { class: "mu-button__content" }, tt = {
|
|
44
193
|
key: 1,
|
|
45
194
|
class: "mu-button__suffix",
|
|
46
195
|
"aria-hidden": "true"
|
|
47
|
-
},
|
|
196
|
+
}, at = /* @__PURE__ */ H({
|
|
48
197
|
__name: "Button",
|
|
49
198
|
props: {
|
|
50
199
|
type: { default: "primary" },
|
|
@@ -60,7 +209,7 @@ const Re = ["type", "disabled", "aria-busy"], De = {
|
|
|
60
209
|
},
|
|
61
210
|
emits: ["click"],
|
|
62
211
|
setup(e, { emit: t }) {
|
|
63
|
-
const a = e,
|
|
212
|
+
const a = e, o = t, r = X(), s = R(), l = {
|
|
64
213
|
small: {
|
|
65
214
|
width: "var(--mu-button-icon-size-small)",
|
|
66
215
|
height: "var(--mu-button-icon-size-small)"
|
|
@@ -73,8 +222,8 @@ const Re = ["type", "disabled", "aria-busy"], De = {
|
|
|
73
222
|
width: "var(--mu-button-icon-size-large)",
|
|
74
223
|
height: "var(--mu-button-icon-size-large)"
|
|
75
224
|
}
|
|
76
|
-
}, d =
|
|
77
|
-
() =>
|
|
225
|
+
}, d = n(() => le(a)), i = n(() => Xe(d.value)), u = n(() => l[d.value.size]), c = n(
|
|
226
|
+
() => Je({
|
|
78
227
|
iconOnly: d.value.iconOnly,
|
|
79
228
|
hasPrefix: !!r.prefix,
|
|
80
229
|
hasSuffix: !!r.suffix,
|
|
@@ -83,57 +232,52 @@ const Re = ["type", "disabled", "aria-busy"], De = {
|
|
|
83
232
|
hasAriaLabel: typeof s["aria-label"] == "string" && s["aria-label"].trim().length > 0
|
|
84
233
|
})
|
|
85
234
|
);
|
|
86
|
-
function
|
|
87
|
-
if (!
|
|
235
|
+
function w(b) {
|
|
236
|
+
if (!We(d.value)) {
|
|
88
237
|
b.preventDefault(), b.stopPropagation();
|
|
89
238
|
return;
|
|
90
239
|
}
|
|
91
|
-
|
|
240
|
+
o("click", b);
|
|
92
241
|
}
|
|
93
|
-
return (b, k) => (v(),
|
|
242
|
+
return (b, k) => (v(), h("button", {
|
|
94
243
|
type: d.value.nativeType,
|
|
95
|
-
class:
|
|
244
|
+
class: K(["mu-button", i.value]),
|
|
96
245
|
disabled: d.value.disabled || d.value.loading,
|
|
97
246
|
"aria-busy": d.value.loading ? "true" : void 0,
|
|
98
|
-
onClick:
|
|
247
|
+
onClick: w
|
|
99
248
|
}, [
|
|
100
|
-
c.value.showLoadingIndicator || c.value.showPrefixSlot ? (v(),
|
|
101
|
-
c.value.showLoadingIndicator ? (v(),
|
|
249
|
+
c.value.showLoadingIndicator || c.value.showPrefixSlot ? (v(), h("span", Ye, [
|
|
250
|
+
c.value.showLoadingIndicator ? (v(), h("svg", {
|
|
102
251
|
key: 0,
|
|
103
252
|
class: "mu-button__loading-icon",
|
|
104
|
-
style:
|
|
253
|
+
style: ve(u.value),
|
|
105
254
|
viewBox: "0 0 24 24",
|
|
106
255
|
fill: "none",
|
|
107
256
|
xmlns: "http://www.w3.org/2000/svg"
|
|
108
257
|
}, [...k[0] || (k[0] = [
|
|
109
|
-
|
|
258
|
+
f("path", {
|
|
110
259
|
d: "M2.00293 12C2.00293 6.47853 6.47853 2.00293 12 2.00293C12.5509 2.00293 12.9971 2.4491 12.9971 3C12.9971 3.5509 12.5509 3.99707 12 3.99707C7.58034 3.99707 3.99707 7.58034 3.99707 12C3.99707 16.4197 7.58034 20.0029 12 20.0029C16.4197 20.0029 20.0029 16.4197 20.0029 12C20.0029 11.4491 20.4491 11.0029 21 11.0029C21.5509 11.0029 21.9971 11.4491 21.9971 12C21.9971 17.5215 17.5215 21.9971 12 21.9971C6.47853 21.9971 2.00293 17.5215 2.00293 12Z",
|
|
111
260
|
fill: "currentColor"
|
|
112
261
|
}, null, -1)
|
|
113
|
-
])], 4)) :
|
|
114
|
-
])) :
|
|
115
|
-
|
|
116
|
-
|
|
262
|
+
])], 4)) : C(b.$slots, "prefix", { key: 1 }, void 0, !0)
|
|
263
|
+
])) : T("", !0),
|
|
264
|
+
f("span", et, [
|
|
265
|
+
C(b.$slots, "default", {}, void 0, !0)
|
|
117
266
|
]),
|
|
118
|
-
c.value.showSuffixSlot ? (v(),
|
|
119
|
-
|
|
120
|
-
])) :
|
|
121
|
-
], 10,
|
|
267
|
+
c.value.showSuffixSlot ? (v(), h("span", tt, [
|
|
268
|
+
C(b.$slots, "suffix", {}, void 0, !0)
|
|
269
|
+
])) : T("", !0)
|
|
270
|
+
], 10, Qe));
|
|
122
271
|
}
|
|
123
|
-
}),
|
|
124
|
-
const a = e.__vccOpts || e;
|
|
125
|
-
for (const [n, r] of t)
|
|
126
|
-
a[n] = r;
|
|
127
|
-
return a;
|
|
128
|
-
}, de = /* @__PURE__ */ P(Ge, [["__scopeId", "data-v-42de128c"]]), Ue = 3e3, je = {
|
|
272
|
+
}), fe = /* @__PURE__ */ N(at, [["__scopeId", "data-v-42de128c"]]), st = 3e3, nt = {
|
|
129
273
|
close: () => {
|
|
130
274
|
}
|
|
131
|
-
},
|
|
275
|
+
}, j = Se({
|
|
132
276
|
items: []
|
|
133
277
|
});
|
|
134
|
-
let
|
|
278
|
+
let ot = 1;
|
|
135
279
|
const E = /* @__PURE__ */ new Map();
|
|
136
|
-
function
|
|
280
|
+
function lt(e) {
|
|
137
281
|
return typeof e == "string" ? { title: e } : {
|
|
138
282
|
title: e.title,
|
|
139
283
|
description: e.description,
|
|
@@ -143,92 +287,92 @@ function qe(e) {
|
|
|
143
287
|
icon: e.icon
|
|
144
288
|
};
|
|
145
289
|
}
|
|
146
|
-
function
|
|
290
|
+
function ie(e) {
|
|
147
291
|
return e.duration > 0;
|
|
148
292
|
}
|
|
149
|
-
function
|
|
150
|
-
return
|
|
293
|
+
function it(e) {
|
|
294
|
+
return j.items.findIndex((t) => t.id === e);
|
|
151
295
|
}
|
|
152
|
-
function
|
|
153
|
-
return
|
|
296
|
+
function ke(e) {
|
|
297
|
+
return j.items.find((t) => t.id === e);
|
|
154
298
|
}
|
|
155
|
-
function
|
|
299
|
+
function ue(e) {
|
|
156
300
|
const t = E.get(e);
|
|
157
301
|
t && t.timer !== null && (globalThis.clearTimeout(t.timer), t.timer = null);
|
|
158
302
|
}
|
|
159
|
-
function
|
|
160
|
-
const t =
|
|
161
|
-
t < 0 || (
|
|
303
|
+
function re(e) {
|
|
304
|
+
const t = it(e);
|
|
305
|
+
t < 0 || (ue(e), E.delete(e), j.items.splice(t, 1));
|
|
162
306
|
}
|
|
163
|
-
function
|
|
307
|
+
function _e(e, t) {
|
|
164
308
|
const a = E.get(e);
|
|
165
|
-
a && (
|
|
166
|
-
|
|
309
|
+
a && (ue(e), a.remainingDuration = t, a.deadline = Date.now() + t, a.isPaused = !1, a.timer = globalThis.setTimeout(() => {
|
|
310
|
+
re(e);
|
|
167
311
|
}, t));
|
|
168
312
|
}
|
|
169
|
-
function
|
|
313
|
+
function ut(e, t) {
|
|
170
314
|
return {
|
|
171
|
-
id:
|
|
315
|
+
id: ot++,
|
|
172
316
|
type: e,
|
|
173
317
|
title: t.title,
|
|
174
318
|
description: t.description,
|
|
175
|
-
duration: t.duration ??
|
|
319
|
+
duration: t.duration ?? st,
|
|
176
320
|
closable: t.closable ?? !1,
|
|
177
321
|
resetOnHover: t.resetOnHover ?? !1,
|
|
178
322
|
icon: t.icon
|
|
179
323
|
};
|
|
180
324
|
}
|
|
181
|
-
function
|
|
325
|
+
function rt() {
|
|
182
326
|
return typeof globalThis.window < "u" && typeof globalThis.document < "u";
|
|
183
327
|
}
|
|
184
|
-
function
|
|
185
|
-
if (!
|
|
186
|
-
return
|
|
187
|
-
const a =
|
|
188
|
-
return
|
|
328
|
+
function ct(e, t) {
|
|
329
|
+
if (!rt())
|
|
330
|
+
return nt;
|
|
331
|
+
const a = lt(t), o = ut(e, a);
|
|
332
|
+
return j.items.push(o), E.set(o.id, {
|
|
189
333
|
timer: null,
|
|
190
334
|
deadline: 0,
|
|
191
|
-
remainingDuration:
|
|
335
|
+
remainingDuration: o.duration,
|
|
192
336
|
isPaused: !1
|
|
193
|
-
}),
|
|
194
|
-
close: () =>
|
|
337
|
+
}), ie(o) && _e(o.id, o.duration), {
|
|
338
|
+
close: () => re(o.id)
|
|
195
339
|
};
|
|
196
340
|
}
|
|
197
|
-
function
|
|
198
|
-
return (t) =>
|
|
341
|
+
function U(e) {
|
|
342
|
+
return (t) => ct(e, t);
|
|
199
343
|
}
|
|
200
|
-
const
|
|
201
|
-
success:
|
|
202
|
-
warning:
|
|
203
|
-
loading:
|
|
204
|
-
error:
|
|
205
|
-
danger:
|
|
344
|
+
const Pa = {
|
|
345
|
+
success: U("success"),
|
|
346
|
+
warning: U("warning"),
|
|
347
|
+
loading: U("loading"),
|
|
348
|
+
error: U("error"),
|
|
349
|
+
danger: U("danger")
|
|
206
350
|
};
|
|
207
|
-
function
|
|
208
|
-
|
|
351
|
+
function dt(e) {
|
|
352
|
+
re(e);
|
|
209
353
|
}
|
|
210
|
-
function
|
|
211
|
-
const t = E.get(e), a =
|
|
212
|
-
!t || !a || t.isPaused || !a.resetOnHover || !
|
|
354
|
+
function ft(e) {
|
|
355
|
+
const t = E.get(e), a = ke(e);
|
|
356
|
+
!t || !a || t.isPaused || !a.resetOnHover || !ie(a) || (t.remainingDuration = Math.max(t.deadline - Date.now(), 0), ue(e), t.isPaused = !0);
|
|
213
357
|
}
|
|
214
|
-
function
|
|
215
|
-
const t = E.get(e), a =
|
|
216
|
-
!t || !a || !t.isPaused || !a.resetOnHover || !
|
|
358
|
+
function vt(e) {
|
|
359
|
+
const t = E.get(e), a = ke(e);
|
|
360
|
+
!t || !a || !t.isPaused || !a.resetOnHover || !ie(a) || _e(e, t.remainingDuration || a.duration);
|
|
217
361
|
}
|
|
218
|
-
const
|
|
362
|
+
const mt = {
|
|
219
363
|
class: "mu-message-list",
|
|
220
364
|
"aria-live": "polite",
|
|
221
365
|
"aria-atomic": "true"
|
|
222
|
-
},
|
|
366
|
+
}, ht = ["onMouseenter", "onMouseleave"], pt = {
|
|
223
367
|
class: "mu-message__icon",
|
|
224
368
|
"aria-hidden": "true"
|
|
225
|
-
},
|
|
369
|
+
}, gt = { class: "mu-message__content" }, bt = { class: "mu-message__title" }, kt = {
|
|
226
370
|
key: 0,
|
|
227
371
|
class: "mu-message__description"
|
|
228
|
-
},
|
|
372
|
+
}, _t = ["onClick"], Ct = /* @__PURE__ */ H({
|
|
229
373
|
__name: "MessageList",
|
|
230
374
|
setup(e) {
|
|
231
|
-
const t =
|
|
375
|
+
const t = n(() => j.items), a = H({
|
|
232
376
|
name: "MarkupIcon",
|
|
233
377
|
props: {
|
|
234
378
|
markup: {
|
|
@@ -236,24 +380,24 @@ const et = {
|
|
|
236
380
|
required: !0
|
|
237
381
|
}
|
|
238
382
|
},
|
|
239
|
-
setup(
|
|
240
|
-
return () =>
|
|
383
|
+
setup(i) {
|
|
384
|
+
return () => me("span", { class: "mu-message__icon-markup", innerHTML: i.markup });
|
|
241
385
|
}
|
|
242
386
|
});
|
|
243
|
-
function
|
|
244
|
-
return typeof
|
|
387
|
+
function o(i) {
|
|
388
|
+
return typeof i != "string";
|
|
245
389
|
}
|
|
246
|
-
function r(
|
|
247
|
-
|
|
390
|
+
function r(i) {
|
|
391
|
+
ft(i);
|
|
248
392
|
}
|
|
249
|
-
function s(
|
|
250
|
-
|
|
393
|
+
function s(i) {
|
|
394
|
+
vt(i);
|
|
251
395
|
}
|
|
252
|
-
function l(
|
|
253
|
-
if (!(
|
|
396
|
+
function l(i) {
|
|
397
|
+
if (!(i instanceof globalThis.HTMLElement))
|
|
254
398
|
return;
|
|
255
|
-
const
|
|
256
|
-
|
|
399
|
+
const u = i.getBoundingClientRect();
|
|
400
|
+
i.style.width = `${u.width}px`, i.style.height = `${u.height}px`;
|
|
257
401
|
}
|
|
258
402
|
const d = {
|
|
259
403
|
success: '<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 6.5L9.5 17L4 11.5" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',
|
|
@@ -262,58 +406,58 @@ const et = {
|
|
|
262
406
|
error: '<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="8" stroke="currentColor" stroke-width="2"/><path d="M12 9V12.5" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><circle cx="12" cy="15.5" r="1" fill="currentColor"/></svg>',
|
|
263
407
|
danger: '<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="8" stroke="currentColor" stroke-width="2"/><path d="M9 9L15 15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M15 9L9 15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>'
|
|
264
408
|
};
|
|
265
|
-
return (
|
|
266
|
-
|
|
409
|
+
return (i, u) => (v(), h("div", mt, [
|
|
410
|
+
Le(Pe, {
|
|
267
411
|
name: "mu-message-fade",
|
|
268
412
|
tag: "div",
|
|
269
413
|
class: "mu-message-list__stack",
|
|
270
414
|
onBeforeLeave: l
|
|
271
415
|
}, {
|
|
272
|
-
default:
|
|
273
|
-
(v(!0),
|
|
416
|
+
default: ee(() => [
|
|
417
|
+
(v(!0), h(Y, null, He(t.value, (c) => (v(), h("div", {
|
|
274
418
|
key: c.id,
|
|
275
|
-
class:
|
|
419
|
+
class: K(["mu-message", [`mu-message--${c.type}`, { "mu-message--compact": !c.description }]]),
|
|
276
420
|
role: "status",
|
|
277
|
-
onMouseenter: (
|
|
278
|
-
onMouseleave: (
|
|
421
|
+
onMouseenter: (w) => r(c.id),
|
|
422
|
+
onMouseleave: (w) => s(c.id)
|
|
279
423
|
}, [
|
|
280
|
-
|
|
281
|
-
c.icon &&
|
|
424
|
+
f("span", pt, [
|
|
425
|
+
c.icon && o(c.icon) ? (v(), Z(Ne(c.icon), { key: 0 })) : (v(), Z(z(a), {
|
|
282
426
|
key: 1,
|
|
283
427
|
markup: typeof c.icon == "string" ? c.icon : d[c.type]
|
|
284
428
|
}, null, 8, ["markup"]))
|
|
285
429
|
]),
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
c.description ? (v(),
|
|
430
|
+
f("div", gt, [
|
|
431
|
+
f("div", bt, I(c.title), 1),
|
|
432
|
+
c.description ? (v(), h("p", kt, I(c.description), 1)) : T("", !0)
|
|
289
433
|
]),
|
|
290
|
-
c.closable ? (v(),
|
|
434
|
+
c.closable ? (v(), h("button", {
|
|
291
435
|
key: 0,
|
|
292
436
|
type: "button",
|
|
293
437
|
class: "mu-message__close",
|
|
294
438
|
"aria-label": "Close message",
|
|
295
|
-
onClick: (
|
|
296
|
-
}, [...
|
|
297
|
-
|
|
439
|
+
onClick: (w) => z(dt)(c.id)
|
|
440
|
+
}, [...u[0] || (u[0] = [
|
|
441
|
+
f("svg", {
|
|
298
442
|
viewBox: "0 0 24 24",
|
|
299
443
|
fill: "none",
|
|
300
444
|
xmlns: "http://www.w3.org/2000/svg"
|
|
301
445
|
}, [
|
|
302
|
-
|
|
446
|
+
f("path", {
|
|
303
447
|
d: "M5 5L19 19M19 5L5 19",
|
|
304
448
|
stroke: "white",
|
|
305
449
|
"stroke-width": "1.8",
|
|
306
450
|
"stroke-linecap": "round"
|
|
307
451
|
})
|
|
308
452
|
], -1)
|
|
309
|
-
])], 8,
|
|
310
|
-
], 42,
|
|
453
|
+
])], 8, _t)) : T("", !0)
|
|
454
|
+
], 42, ht))), 128))
|
|
311
455
|
]),
|
|
312
456
|
_: 1
|
|
313
457
|
})
|
|
314
458
|
]));
|
|
315
459
|
}
|
|
316
|
-
}),
|
|
460
|
+
}), Ha = /* @__PURE__ */ N(Ct, [["__scopeId", "data-v-debf98d8"]]), yt = {
|
|
317
461
|
medium: {
|
|
318
462
|
width: "548px",
|
|
319
463
|
minHeight: "228px"
|
|
@@ -323,13 +467,13 @@ const et = {
|
|
|
323
467
|
minHeight: "500px"
|
|
324
468
|
}
|
|
325
469
|
};
|
|
326
|
-
function
|
|
327
|
-
const t = e.size ?? "medium", a =
|
|
470
|
+
function ce(e = {}) {
|
|
471
|
+
const t = e.size ?? "medium", a = yt[t], o = e.variant ?? "form";
|
|
328
472
|
return {
|
|
329
473
|
visible: e.visible ?? !1,
|
|
330
474
|
title: e.title ?? "",
|
|
331
475
|
status: e.status ?? "default",
|
|
332
|
-
variant:
|
|
476
|
+
variant: o,
|
|
333
477
|
size: t,
|
|
334
478
|
width: e.width ?? a.width,
|
|
335
479
|
minHeight: a.minHeight,
|
|
@@ -339,13 +483,13 @@ function re(e = {}) {
|
|
|
339
483
|
okText: e.okText ?? "Confirm",
|
|
340
484
|
cancelText: e.cancelText ?? "Cancel",
|
|
341
485
|
// feedback 形态默认隐藏 cancel;显式传值仍优先
|
|
342
|
-
hideCancel: e.hideCancel ??
|
|
486
|
+
hideCancel: e.hideCancel ?? o === "feedback",
|
|
343
487
|
hideOk: e.hideOk ?? !1,
|
|
344
488
|
okLoading: e.okLoading ?? !1
|
|
345
489
|
};
|
|
346
490
|
}
|
|
347
|
-
function
|
|
348
|
-
const t =
|
|
491
|
+
function wt(e = {}) {
|
|
492
|
+
const t = ce(e), a = [
|
|
349
493
|
"mu-modal",
|
|
350
494
|
`mu-modal--${t.size}`,
|
|
351
495
|
`mu-modal--${t.status}`,
|
|
@@ -353,8 +497,8 @@ function rt(e = {}) {
|
|
|
353
497
|
];
|
|
354
498
|
return t.variant === "feedback" && a.push("mu-modal--feedback"), a;
|
|
355
499
|
}
|
|
356
|
-
function
|
|
357
|
-
const t =
|
|
500
|
+
function Vt(e = {}) {
|
|
501
|
+
const t = ce(e);
|
|
358
502
|
return t.variant === "feedback" ? {
|
|
359
503
|
type: "secondary",
|
|
360
504
|
status: t.status === "default" ? void 0 : t.status
|
|
@@ -365,13 +509,13 @@ function ct(e = {}) {
|
|
|
365
509
|
type: "primary"
|
|
366
510
|
};
|
|
367
511
|
}
|
|
368
|
-
const
|
|
512
|
+
const xt = {
|
|
369
513
|
key: 0,
|
|
370
514
|
class: "mu-modal-root"
|
|
371
|
-
},
|
|
515
|
+
}, Tt = { class: "mu-modal__header" }, $t = ["data-status"], Mt = { class: "mu-modal__body" }, Bt = {
|
|
372
516
|
key: 0,
|
|
373
517
|
class: "mu-modal__footer"
|
|
374
|
-
},
|
|
518
|
+
}, St = /* @__PURE__ */ H({
|
|
375
519
|
inheritAttrs: !1,
|
|
376
520
|
__name: "Modal",
|
|
377
521
|
props: {
|
|
@@ -392,92 +536,92 @@ const dt = {
|
|
|
392
536
|
},
|
|
393
537
|
emits: ["update:visible", "ok", "cancel", "close"],
|
|
394
538
|
setup(e, { emit: t }) {
|
|
395
|
-
const a = e,
|
|
396
|
-
const { class:
|
|
397
|
-
return
|
|
398
|
-
}),
|
|
539
|
+
const a = e, o = t, r = R(), s = n(() => ce(a)), l = n(() => [wt(a), r.class]), d = n(() => {
|
|
540
|
+
const { class: m, style: V, ...B } = r;
|
|
541
|
+
return B;
|
|
542
|
+
}), i = n(() => Vt(a)), u = n(
|
|
399
543
|
() => s.value.variant === "feedback" && s.value.hideCancel
|
|
400
|
-
), c =
|
|
544
|
+
), c = n(() => [
|
|
401
545
|
{
|
|
402
546
|
width: s.value.width,
|
|
403
547
|
minHeight: s.value.minHeight
|
|
404
548
|
},
|
|
405
549
|
r.style
|
|
406
|
-
]),
|
|
550
|
+
]), w = `mu-modal-title-${Math.random().toString(36).slice(2, 10)}`, k = typeof globalThis.document < "u" ? globalThis.document : null;
|
|
407
551
|
function $() {
|
|
408
|
-
|
|
552
|
+
o("update:visible", !1);
|
|
409
553
|
}
|
|
410
|
-
function
|
|
411
|
-
s.value.maskClosable && ($(),
|
|
554
|
+
function y() {
|
|
555
|
+
s.value.maskClosable && ($(), o("cancel", new globalThis.MouseEvent("click")));
|
|
412
556
|
}
|
|
413
557
|
function g() {
|
|
414
|
-
$(),
|
|
558
|
+
$(), o("close");
|
|
415
559
|
}
|
|
416
|
-
function
|
|
417
|
-
|
|
560
|
+
function M(m) {
|
|
561
|
+
o("cancel", m), $();
|
|
418
562
|
}
|
|
419
|
-
function
|
|
420
|
-
|
|
563
|
+
function L(m) {
|
|
564
|
+
o("ok", m);
|
|
421
565
|
}
|
|
422
|
-
function O(
|
|
423
|
-
|
|
566
|
+
function O(m) {
|
|
567
|
+
m.key !== "Escape" || !s.value.visible || !s.value.escToClose || ($(), o("close"));
|
|
424
568
|
}
|
|
425
|
-
return
|
|
569
|
+
return se(() => {
|
|
426
570
|
k && k.addEventListener("keydown", O);
|
|
427
|
-
}),
|
|
571
|
+
}), ne(() => {
|
|
428
572
|
k && (k.removeEventListener("keydown", O), k.body.style.overflow = "");
|
|
429
|
-
}),
|
|
573
|
+
}), oe(
|
|
430
574
|
() => s.value.visible,
|
|
431
|
-
(
|
|
432
|
-
k && (k.body.style.overflow =
|
|
575
|
+
(m) => {
|
|
576
|
+
k && (k.body.style.overflow = m ? "hidden" : "");
|
|
433
577
|
},
|
|
434
578
|
{ immediate: !0 }
|
|
435
|
-
), (
|
|
436
|
-
s.value.visible ? (v(),
|
|
437
|
-
|
|
579
|
+
), (m, V) => (v(), Z(Ie, { to: "body" }, [
|
|
580
|
+
s.value.visible ? (v(), h("div", xt, [
|
|
581
|
+
f("div", {
|
|
438
582
|
class: "mu-modal__mask",
|
|
439
|
-
onClick:
|
|
583
|
+
onClick: y
|
|
440
584
|
}),
|
|
441
|
-
|
|
585
|
+
f("div", A(d.value, {
|
|
442
586
|
class: l.value,
|
|
443
587
|
style: c.value,
|
|
444
588
|
role: "dialog",
|
|
445
589
|
"aria-modal": "true",
|
|
446
|
-
"aria-labelledby":
|
|
590
|
+
"aria-labelledby": w
|
|
447
591
|
}), [
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
id:
|
|
592
|
+
f("header", Tt, [
|
|
593
|
+
f("div", {
|
|
594
|
+
id: w,
|
|
451
595
|
class: "mu-modal__title",
|
|
452
596
|
"data-status": s.value.status
|
|
453
597
|
}, [
|
|
454
|
-
|
|
455
|
-
|
|
598
|
+
C(m.$slots, "title", {}, () => [
|
|
599
|
+
D(I(s.value.title), 1)
|
|
456
600
|
], !0)
|
|
457
|
-
], 8,
|
|
458
|
-
s.value.closable ? (v(),
|
|
601
|
+
], 8, $t),
|
|
602
|
+
s.value.closable ? (v(), h("button", {
|
|
459
603
|
key: 0,
|
|
460
604
|
type: "button",
|
|
461
605
|
class: "mu-modal__close",
|
|
462
606
|
"aria-label": "Close dialog",
|
|
463
607
|
onClick: g
|
|
464
|
-
}, [...
|
|
465
|
-
|
|
608
|
+
}, [...V[0] || (V[0] = [
|
|
609
|
+
f("span", {
|
|
466
610
|
class: "mu-modal__close-icon",
|
|
467
611
|
"aria-hidden": "true"
|
|
468
612
|
}, [
|
|
469
|
-
|
|
613
|
+
f("svg", {
|
|
470
614
|
viewBox: "0 0 20 20",
|
|
471
615
|
fill: "none",
|
|
472
616
|
xmlns: "http://www.w3.org/2000/svg"
|
|
473
617
|
}, [
|
|
474
|
-
|
|
618
|
+
f("path", {
|
|
475
619
|
d: "M5 5L15 15",
|
|
476
620
|
stroke: "currentColor",
|
|
477
621
|
"stroke-width": "1.8",
|
|
478
622
|
"stroke-linecap": "round"
|
|
479
623
|
}),
|
|
480
|
-
|
|
624
|
+
f("path", {
|
|
481
625
|
d: "M15 5L5 15",
|
|
482
626
|
stroke: "currentColor",
|
|
483
627
|
"stroke-width": "1.8",
|
|
@@ -485,64 +629,64 @@ const dt = {
|
|
|
485
629
|
})
|
|
486
630
|
])
|
|
487
631
|
], -1)
|
|
488
|
-
])])) :
|
|
632
|
+
])])) : T("", !0)
|
|
489
633
|
]),
|
|
490
|
-
|
|
491
|
-
|
|
634
|
+
f("div", Mt, [
|
|
635
|
+
C(m.$slots, "default", {}, void 0, !0)
|
|
492
636
|
]),
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
s.value.hideCancel ?
|
|
637
|
+
m.$slots.footer || !s.value.hideOk || !s.value.hideCancel ? (v(), h("footer", Bt, [
|
|
638
|
+
C(m.$slots, "footer", {}, () => [
|
|
639
|
+
s.value.hideCancel ? T("", !0) : (v(), Z(z(fe), {
|
|
496
640
|
key: 0,
|
|
497
641
|
type: "ghost",
|
|
498
642
|
class: "mu-modal__cancel",
|
|
499
|
-
onClick:
|
|
643
|
+
onClick: M
|
|
500
644
|
}, {
|
|
501
|
-
default:
|
|
502
|
-
|
|
645
|
+
default: ee(() => [
|
|
646
|
+
D(I(s.value.cancelText), 1)
|
|
503
647
|
]),
|
|
504
648
|
_: 1
|
|
505
649
|
})),
|
|
506
|
-
s.value.hideOk ?
|
|
650
|
+
s.value.hideOk ? T("", !0) : (v(), Z(z(fe), A({ key: 1 }, i.value, {
|
|
507
651
|
loading: s.value.okLoading,
|
|
508
|
-
class: ["mu-modal__ok", { "mu-modal__ok--block":
|
|
509
|
-
onClick:
|
|
652
|
+
class: ["mu-modal__ok", { "mu-modal__ok--block": u.value }],
|
|
653
|
+
onClick: L
|
|
510
654
|
}), {
|
|
511
|
-
default:
|
|
512
|
-
|
|
655
|
+
default: ee(() => [
|
|
656
|
+
D(I(s.value.okText), 1)
|
|
513
657
|
]),
|
|
514
658
|
_: 1
|
|
515
659
|
}, 16, ["loading", "class"]))
|
|
516
660
|
], !0)
|
|
517
|
-
])) :
|
|
661
|
+
])) : T("", !0)
|
|
518
662
|
], 16)
|
|
519
|
-
])) :
|
|
663
|
+
])) : T("", !0)
|
|
520
664
|
]));
|
|
521
665
|
}
|
|
522
|
-
}),
|
|
523
|
-
function
|
|
666
|
+
}), Lt = /* @__PURE__ */ N(St, [["__scopeId", "data-v-e94991b0"]]);
|
|
667
|
+
function Pt(e) {
|
|
524
668
|
return e === void 0 ? null : typeof e == "function" ? e() : e;
|
|
525
669
|
}
|
|
526
|
-
function
|
|
670
|
+
function F(e = {}) {
|
|
527
671
|
return typeof globalThis.document > "u" ? Promise.resolve(!1) : new Promise((t) => {
|
|
528
672
|
const a = globalThis.document.createElement("div");
|
|
529
673
|
globalThis.document.body.appendChild(a);
|
|
530
|
-
const
|
|
674
|
+
const o = P(!0);
|
|
531
675
|
let r = null, s = !1;
|
|
532
676
|
const l = () => {
|
|
533
677
|
r && (r.unmount(), r = null), a.parentNode && a.parentNode.removeChild(a);
|
|
534
678
|
}, d = (c) => {
|
|
535
|
-
s || (s = !0,
|
|
679
|
+
s || (s = !0, o.value = !1, queueMicrotask(() => {
|
|
536
680
|
l(), t(c);
|
|
537
681
|
}));
|
|
538
|
-
}, { content:
|
|
539
|
-
r =
|
|
682
|
+
}, { content: i, ...u } = e;
|
|
683
|
+
r = ze({
|
|
540
684
|
render() {
|
|
541
|
-
return
|
|
542
|
-
|
|
685
|
+
return me(
|
|
686
|
+
Lt,
|
|
543
687
|
{
|
|
544
|
-
...
|
|
545
|
-
visible:
|
|
688
|
+
...u,
|
|
689
|
+
visible: o.value,
|
|
546
690
|
"onUpdate:visible": (c) => {
|
|
547
691
|
c || d(!1);
|
|
548
692
|
},
|
|
@@ -551,30 +695,30 @@ function q(e = {}) {
|
|
|
551
695
|
onClose: () => d(!1)
|
|
552
696
|
},
|
|
553
697
|
{
|
|
554
|
-
default: () =>
|
|
698
|
+
default: () => Pt(i)
|
|
555
699
|
}
|
|
556
700
|
);
|
|
557
701
|
}
|
|
558
702
|
}), r.mount(a);
|
|
559
703
|
});
|
|
560
704
|
}
|
|
561
|
-
const
|
|
705
|
+
const Na = {
|
|
562
706
|
/** 通用版本,透传所有 props,默认 variant='form'。 */
|
|
563
|
-
show:
|
|
707
|
+
show: F,
|
|
564
708
|
/** 通用确认弹窗,等价于 show,使用 form 形态 + 自定义 status。 */
|
|
565
|
-
confirm: (e = {}) =>
|
|
709
|
+
confirm: (e = {}) => F(e),
|
|
566
710
|
/** 反馈形态 + status='success'。 */
|
|
567
|
-
success: (e = {}) =>
|
|
711
|
+
success: (e = {}) => F({ ...e, variant: "feedback", status: "success" }),
|
|
568
712
|
/** 反馈形态 + status='danger'。 */
|
|
569
|
-
danger: (e = {}) =>
|
|
570
|
-
},
|
|
571
|
-
function
|
|
713
|
+
danger: (e = {}) => F({ ...e, variant: "feedback", status: "danger" })
|
|
714
|
+
}, Ce = Symbol("MuRadioGroup"), Ht = ["horizontal", "vertical"];
|
|
715
|
+
function Nt(e, t) {
|
|
572
716
|
return typeof t == "string" && e.includes(t);
|
|
573
717
|
}
|
|
574
|
-
function
|
|
575
|
-
return
|
|
718
|
+
function It(e) {
|
|
719
|
+
return Nt(Ht, e);
|
|
576
720
|
}
|
|
577
|
-
function
|
|
721
|
+
function ye(e = {}) {
|
|
578
722
|
return {
|
|
579
723
|
modelValue: e.modelValue,
|
|
580
724
|
value: e.value ?? !0,
|
|
@@ -583,33 +727,33 @@ function ke(e = {}) {
|
|
|
583
727
|
name: e.name
|
|
584
728
|
};
|
|
585
729
|
}
|
|
586
|
-
function
|
|
730
|
+
function we(e = {}) {
|
|
587
731
|
return {
|
|
588
732
|
modelValue: e.modelValue,
|
|
589
733
|
defaultValue: e.defaultValue,
|
|
590
734
|
disabled: e.disabled ?? !1,
|
|
591
735
|
name: e.name,
|
|
592
|
-
direction:
|
|
736
|
+
direction: It(e.direction) ? e.direction : "horizontal"
|
|
593
737
|
};
|
|
594
738
|
}
|
|
595
|
-
function
|
|
739
|
+
function zt(e = {}) {
|
|
596
740
|
return e.modelValue !== void 0;
|
|
597
741
|
}
|
|
598
|
-
function
|
|
742
|
+
function Ot(e = {}) {
|
|
599
743
|
return e.modelValue !== void 0;
|
|
600
744
|
}
|
|
601
|
-
function
|
|
745
|
+
function te(e, t) {
|
|
602
746
|
return Object.is(e, t);
|
|
603
747
|
}
|
|
604
|
-
function
|
|
605
|
-
const a =
|
|
606
|
-
return t.checked &&
|
|
748
|
+
function At(e = {}, t = {}) {
|
|
749
|
+
const a = ye(e), o = ["mu-radio"];
|
|
750
|
+
return t.checked && o.push("is-checked"), (t.disabled || a.disabled) && o.push("is-disabled"), o;
|
|
607
751
|
}
|
|
608
|
-
function
|
|
609
|
-
const t =
|
|
752
|
+
function Rt(e = {}) {
|
|
753
|
+
const t = we(e), a = ["mu-radio-group", `mu-radio-group--${t.direction}`];
|
|
610
754
|
return t.disabled && a.push("is-disabled"), a;
|
|
611
755
|
}
|
|
612
|
-
const
|
|
756
|
+
const Dt = ["checked", "disabled", "name", "value"], Et = { class: "mu-radio__label" }, Gt = /* @__PURE__ */ H({
|
|
613
757
|
inheritAttrs: !1,
|
|
614
758
|
__name: "Radio",
|
|
615
759
|
props: {
|
|
@@ -621,68 +765,68 @@ const $t = ["checked", "disabled", "name", "value"], Vt = { class: "mu-radio__la
|
|
|
621
765
|
},
|
|
622
766
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
623
767
|
setup(e, { emit: t }) {
|
|
624
|
-
const a = e,
|
|
768
|
+
const a = e, o = t, r = R(), s = he(Ce, null), l = n(() => ye(a)), d = n(() => zt(a)), i = P(l.value.defaultChecked), u = n(() => s ? te(s.value.value, l.value.value) : d.value ? te(l.value.modelValue, l.value.value) : i.value), c = n(
|
|
625
769
|
() => l.value.disabled || !!(s != null && s.disabled.value)
|
|
626
|
-
),
|
|
627
|
-
|
|
628
|
-
checked:
|
|
770
|
+
), w = n(() => (s == null ? void 0 : s.name.value) ?? l.value.name), b = n(() => String(l.value.value)), k = n(() => [
|
|
771
|
+
At(a, {
|
|
772
|
+
checked: u.value,
|
|
629
773
|
disabled: c.value
|
|
630
774
|
}),
|
|
631
775
|
r.class
|
|
632
|
-
]), $ =
|
|
633
|
-
const { class:
|
|
634
|
-
return
|
|
635
|
-
}),
|
|
636
|
-
function g(
|
|
637
|
-
d.value || (
|
|
776
|
+
]), $ = n(() => {
|
|
777
|
+
const { class: m, style: V, ...B } = r;
|
|
778
|
+
return B;
|
|
779
|
+
}), y = n(() => r.style);
|
|
780
|
+
function g(m, V) {
|
|
781
|
+
d.value || (i.value = !0), o("update:modelValue", m), o("change", m, V);
|
|
638
782
|
}
|
|
639
|
-
function
|
|
783
|
+
function M(m) {
|
|
640
784
|
if (c.value)
|
|
641
785
|
return;
|
|
642
|
-
const
|
|
786
|
+
const V = l.value.value, B = m.target instanceof globalThis.HTMLInputElement ? m.target : null;
|
|
643
787
|
if (s) {
|
|
644
|
-
s.select(
|
|
645
|
-
|
|
788
|
+
s.select(V, m), q(() => {
|
|
789
|
+
B && (B.checked = u.value);
|
|
646
790
|
});
|
|
647
791
|
return;
|
|
648
792
|
}
|
|
649
|
-
g(
|
|
650
|
-
|
|
793
|
+
g(V, m), q(() => {
|
|
794
|
+
B && (B.checked = u.value);
|
|
651
795
|
});
|
|
652
796
|
}
|
|
653
|
-
function
|
|
654
|
-
|
|
797
|
+
function L(m) {
|
|
798
|
+
o("focus", m);
|
|
655
799
|
}
|
|
656
|
-
function O(
|
|
657
|
-
|
|
800
|
+
function O(m) {
|
|
801
|
+
o("blur", m);
|
|
658
802
|
}
|
|
659
|
-
return (
|
|
803
|
+
return (m, V) => (v(), h("label", A($.value, {
|
|
660
804
|
class: k.value,
|
|
661
|
-
style:
|
|
805
|
+
style: y.value
|
|
662
806
|
}), [
|
|
663
|
-
|
|
807
|
+
f("input", {
|
|
664
808
|
class: "mu-radio__input",
|
|
665
809
|
type: "radio",
|
|
666
|
-
checked:
|
|
810
|
+
checked: u.value,
|
|
667
811
|
disabled: c.value,
|
|
668
|
-
name:
|
|
812
|
+
name: w.value,
|
|
669
813
|
value: b.value,
|
|
670
|
-
onChange:
|
|
671
|
-
onFocus:
|
|
814
|
+
onChange: M,
|
|
815
|
+
onFocus: L,
|
|
672
816
|
onBlur: O
|
|
673
|
-
}, null, 40,
|
|
674
|
-
|
|
817
|
+
}, null, 40, Dt),
|
|
818
|
+
V[0] || (V[0] = f("span", {
|
|
675
819
|
class: "mu-radio__control",
|
|
676
820
|
"aria-hidden": "true"
|
|
677
821
|
}, [
|
|
678
|
-
|
|
822
|
+
f("span", { class: "mu-radio__dot" })
|
|
679
823
|
], -1)),
|
|
680
|
-
|
|
681
|
-
|
|
824
|
+
f("span", Et, [
|
|
825
|
+
C(m.$slots, "default", {}, void 0, !0)
|
|
682
826
|
])
|
|
683
827
|
], 16));
|
|
684
828
|
}
|
|
685
|
-
}),
|
|
829
|
+
}), Ia = /* @__PURE__ */ N(Gt, [["__scopeId", "data-v-f1283749"]]), Ut = /* @__PURE__ */ H({
|
|
686
830
|
inheritAttrs: !1,
|
|
687
831
|
__name: "RadioGroup",
|
|
688
832
|
props: {
|
|
@@ -694,46 +838,46 @@ const $t = ["checked", "disabled", "name", "value"], Vt = { class: "mu-radio__la
|
|
|
694
838
|
},
|
|
695
839
|
emits: ["update:modelValue", "change"],
|
|
696
840
|
setup(e, { emit: t }) {
|
|
697
|
-
const a = e,
|
|
841
|
+
const a = e, o = t, r = R(), s = n(() => we(a)), l = n(() => Ot(a)), d = P(s.value.defaultValue), i = n(
|
|
698
842
|
() => l.value ? s.value.modelValue : d.value
|
|
699
|
-
),
|
|
700
|
-
const { class:
|
|
701
|
-
return
|
|
702
|
-
}), k =
|
|
703
|
-
function $(
|
|
704
|
-
s.value.disabled ||
|
|
843
|
+
), u = n(() => s.value.disabled), c = n(() => s.value.name), w = n(() => [Rt(a), r.class]), b = n(() => {
|
|
844
|
+
const { class: y, style: g, ...M } = r;
|
|
845
|
+
return M;
|
|
846
|
+
}), k = n(() => r.style);
|
|
847
|
+
function $(y, g) {
|
|
848
|
+
s.value.disabled || te(i.value, y) || (l.value || (d.value = y), o("update:modelValue", y), o("change", y, g));
|
|
705
849
|
}
|
|
706
|
-
return
|
|
707
|
-
value:
|
|
708
|
-
disabled:
|
|
850
|
+
return pe(Ce, {
|
|
851
|
+
value: i,
|
|
852
|
+
disabled: u,
|
|
709
853
|
name: c,
|
|
710
854
|
select: $
|
|
711
|
-
}), (
|
|
855
|
+
}), (y, g) => (v(), h("div", A(b.value, {
|
|
712
856
|
role: "radiogroup",
|
|
713
|
-
class:
|
|
857
|
+
class: w.value,
|
|
714
858
|
style: k.value
|
|
715
859
|
}), [
|
|
716
|
-
|
|
860
|
+
C(y.$slots, "default", {}, void 0, !0)
|
|
717
861
|
], 16));
|
|
718
862
|
}
|
|
719
|
-
}),
|
|
720
|
-
function
|
|
863
|
+
}), za = /* @__PURE__ */ N(Ut, [["__scopeId", "data-v-3879fec4"]]), Zt = ["circle", "round", "line"], jt = ["small", "medium"];
|
|
864
|
+
function Ve(e, t) {
|
|
721
865
|
return typeof t == "string" && e.includes(t);
|
|
722
866
|
}
|
|
723
|
-
function
|
|
724
|
-
return
|
|
867
|
+
function Ft(e) {
|
|
868
|
+
return Ve(Zt, e);
|
|
725
869
|
}
|
|
726
|
-
function
|
|
727
|
-
return
|
|
870
|
+
function qt(e) {
|
|
871
|
+
return Ve(jt, e);
|
|
728
872
|
}
|
|
729
|
-
function
|
|
873
|
+
function ae(e = {}) {
|
|
730
874
|
return {
|
|
731
875
|
modelValue: e.modelValue,
|
|
732
876
|
defaultChecked: e.defaultChecked ?? !1,
|
|
733
877
|
disabled: e.disabled ?? !1,
|
|
734
878
|
loading: e.loading ?? !1,
|
|
735
|
-
type:
|
|
736
|
-
size:
|
|
879
|
+
type: Ft(e.type) ? e.type : "circle",
|
|
880
|
+
size: qt(e.size) ? e.size : "medium",
|
|
737
881
|
checkedValue: e.checkedValue ?? !0,
|
|
738
882
|
uncheckedValue: e.uncheckedValue ?? !1,
|
|
739
883
|
checkedColor: e.checkedColor,
|
|
@@ -743,35 +887,35 @@ function ee(e = {}) {
|
|
|
743
887
|
uncheckedText: e.uncheckedText
|
|
744
888
|
};
|
|
745
889
|
}
|
|
746
|
-
function
|
|
890
|
+
function Kt(e = {}) {
|
|
747
891
|
return e.modelValue !== void 0;
|
|
748
892
|
}
|
|
749
|
-
function
|
|
893
|
+
function xe(e, t) {
|
|
750
894
|
return Object.is(e, t.checkedValue);
|
|
751
895
|
}
|
|
752
|
-
function
|
|
753
|
-
return
|
|
896
|
+
function Xt(e, t) {
|
|
897
|
+
return xe(e, t) ? t.uncheckedValue : t.checkedValue;
|
|
754
898
|
}
|
|
755
|
-
function
|
|
899
|
+
function Wt(e) {
|
|
756
900
|
return e.type !== "line" && e.size !== "small";
|
|
757
901
|
}
|
|
758
|
-
function
|
|
759
|
-
const a =
|
|
760
|
-
return t.checked &&
|
|
902
|
+
function Jt(e = {}, t = {}) {
|
|
903
|
+
const a = ae(e), o = ["mu-switch", `mu-switch--${a.type}`, `mu-switch--${a.size}`];
|
|
904
|
+
return t.checked && o.push("is-checked"), a.disabled && o.push("is-disabled"), (a.loading || t.loading) && o.push("is-loading"), o;
|
|
761
905
|
}
|
|
762
|
-
const
|
|
906
|
+
const Qt = ["aria-checked", "disabled"], Yt = {
|
|
763
907
|
class: "mu-switch__thumb",
|
|
764
908
|
"aria-hidden": "true"
|
|
765
|
-
},
|
|
909
|
+
}, ea = {
|
|
766
910
|
key: 0,
|
|
767
911
|
class: "mu-switch__loading-icon",
|
|
768
912
|
viewBox: "0 0 16 16",
|
|
769
913
|
fill: "none",
|
|
770
914
|
xmlns: "http://www.w3.org/2000/svg"
|
|
771
|
-
},
|
|
915
|
+
}, ta = {
|
|
772
916
|
key: 0,
|
|
773
917
|
class: "mu-switch__label"
|
|
774
|
-
},
|
|
918
|
+
}, aa = /* @__PURE__ */ H({
|
|
775
919
|
inheritAttrs: !1,
|
|
776
920
|
__name: "Switch",
|
|
777
921
|
props: {
|
|
@@ -791,136 +935,136 @@ const Rt = ["aria-checked", "disabled"], Dt = {
|
|
|
791
935
|
},
|
|
792
936
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
793
937
|
setup(e, { emit: t }) {
|
|
794
|
-
const a = e,
|
|
938
|
+
const a = e, o = t, r = R(), s = X(), l = P(!1), d = ae(a), i = P(
|
|
795
939
|
d.defaultChecked ? d.checkedValue : d.uncheckedValue
|
|
796
|
-
),
|
|
797
|
-
() => c.value ?
|
|
798
|
-
), b =
|
|
799
|
-
|
|
940
|
+
), u = n(() => ae(a)), c = n(() => Kt(a)), w = n(
|
|
941
|
+
() => c.value ? u.value.modelValue : i.value
|
|
942
|
+
), b = n(() => xe(w.value, u.value)), k = n(() => u.value.loading || l.value), $ = n(() => Wt(u.value)), y = n(() => $.value ? b.value ? !!(s.checked || u.value.checkedText) : !!(s.unchecked || u.value.uncheckedText) : !1), g = n(() => [
|
|
943
|
+
Jt(a, {
|
|
800
944
|
checked: b.value,
|
|
801
945
|
loading: l.value
|
|
802
946
|
}),
|
|
803
947
|
{
|
|
804
|
-
"has-label":
|
|
948
|
+
"has-label": y.value
|
|
805
949
|
},
|
|
806
950
|
r.class
|
|
807
|
-
]),
|
|
808
|
-
const { class:
|
|
809
|
-
return
|
|
810
|
-
}),
|
|
811
|
-
const
|
|
812
|
-
return
|
|
951
|
+
]), M = n(() => {
|
|
952
|
+
const { class: p, style: x, type: _, ...S } = r;
|
|
953
|
+
return S;
|
|
954
|
+
}), L = n(() => {
|
|
955
|
+
const p = {};
|
|
956
|
+
return u.value.checkedColor && (p["--mu-switch-current-checked-bg"] = u.value.checkedColor, p["--mu-switch-current-checked-border"] = u.value.checkedColor, p["--mu-switch-current-checked-thumb"] = u.value.checkedColor, p["--mu-switch-current-checked-glow"] = `0 0 12px ${u.value.checkedColor}`), u.value.uncheckedColor && (p["--mu-switch-current-unchecked-bg"] = u.value.uncheckedColor), [p, r.style];
|
|
813
957
|
});
|
|
814
958
|
function O() {
|
|
815
959
|
}
|
|
816
|
-
function
|
|
817
|
-
const x =
|
|
960
|
+
function m(p) {
|
|
961
|
+
const x = u.value.beforeChange;
|
|
818
962
|
if (!x)
|
|
819
963
|
return !0;
|
|
820
964
|
try {
|
|
821
|
-
const
|
|
822
|
-
return
|
|
965
|
+
const _ = x(p);
|
|
966
|
+
return _ instanceof Promise ? (l.value = !0, _.then((S) => S !== !1).catch(() => !1)) : _ !== !1;
|
|
823
967
|
} catch {
|
|
824
968
|
return !1;
|
|
825
969
|
}
|
|
826
970
|
}
|
|
827
|
-
function
|
|
828
|
-
c.value || (
|
|
971
|
+
function V(p, x) {
|
|
972
|
+
c.value || (i.value = p), o("update:modelValue", p), o("change", p, x);
|
|
829
973
|
}
|
|
830
|
-
function
|
|
831
|
-
if (
|
|
974
|
+
function B(p) {
|
|
975
|
+
if (u.value.disabled || k.value)
|
|
832
976
|
return;
|
|
833
|
-
const x =
|
|
834
|
-
if (
|
|
835
|
-
|
|
836
|
-
|
|
977
|
+
const x = Xt(w.value, u.value), _ = m(x);
|
|
978
|
+
if (_ instanceof Promise) {
|
|
979
|
+
_.then((S) => {
|
|
980
|
+
S && V(x, p);
|
|
837
981
|
}).finally(() => {
|
|
838
982
|
l.value = !1;
|
|
839
983
|
});
|
|
840
984
|
return;
|
|
841
985
|
}
|
|
842
|
-
|
|
986
|
+
_ && V(x, p);
|
|
843
987
|
}
|
|
844
|
-
function
|
|
845
|
-
|
|
988
|
+
function G(p) {
|
|
989
|
+
o("focus", p);
|
|
846
990
|
}
|
|
847
|
-
function J(
|
|
848
|
-
|
|
991
|
+
function J(p) {
|
|
992
|
+
o("blur", p);
|
|
849
993
|
}
|
|
850
|
-
return (
|
|
994
|
+
return (p, x) => (v(), h("button", A(M.value, {
|
|
851
995
|
type: "button",
|
|
852
996
|
role: "switch",
|
|
853
997
|
class: g.value,
|
|
854
|
-
style:
|
|
998
|
+
style: L.value,
|
|
855
999
|
"aria-checked": b.value ? "true" : "false",
|
|
856
|
-
disabled:
|
|
857
|
-
onClick:
|
|
858
|
-
onFocus:
|
|
1000
|
+
disabled: u.value.disabled || k.value,
|
|
1001
|
+
onClick: B,
|
|
1002
|
+
onFocus: G,
|
|
859
1003
|
onBlur: J
|
|
860
1004
|
}), [
|
|
861
|
-
x[1] || (x[1] =
|
|
1005
|
+
x[1] || (x[1] = f("span", {
|
|
862
1006
|
class: "mu-switch__line-track",
|
|
863
1007
|
"aria-hidden": "true"
|
|
864
1008
|
}, null, -1)),
|
|
865
|
-
|
|
866
|
-
k.value ? (v(),
|
|
867
|
-
|
|
1009
|
+
f("span", Yt, [
|
|
1010
|
+
k.value ? (v(), h("svg", ea, [...x[0] || (x[0] = [
|
|
1011
|
+
f("path", {
|
|
868
1012
|
d: "M8 1.5C8.41421 1.5 8.75 1.83579 8.75 2.25C8.75 2.66421 8.41421 3 8 3C5.23858 3 3 5.23858 3 8C3 10.7614 5.23858 13 8 13C10.7614 13 13 10.7614 13 8C13 7.58579 13.3358 7.25 13.75 7.25C14.1642 7.25 14.5 7.58579 14.5 8C14.5 11.5899 11.5899 14.5 8 14.5C4.41015 14.5 1.5 11.5899 1.5 8C1.5 4.41015 4.41015 1.5 8 1.5Z",
|
|
869
1013
|
fill: "currentColor"
|
|
870
1014
|
}, null, -1)
|
|
871
|
-
])])) : b.value ?
|
|
1015
|
+
])])) : b.value ? C(p.$slots, "checked-icon", { key: 1 }, void 0, !0) : C(p.$slots, "unchecked-icon", { key: 2 }, void 0, !0)
|
|
872
1016
|
]),
|
|
873
|
-
|
|
874
|
-
b.value ?
|
|
875
|
-
|
|
876
|
-
], !0) :
|
|
877
|
-
|
|
1017
|
+
y.value ? (v(), h("span", ta, [
|
|
1018
|
+
b.value ? C(p.$slots, "checked", { key: 0 }, () => [
|
|
1019
|
+
D(I(u.value.checkedText), 1)
|
|
1020
|
+
], !0) : C(p.$slots, "unchecked", { key: 1 }, () => [
|
|
1021
|
+
D(I(u.value.uncheckedText), 1)
|
|
878
1022
|
], !0)
|
|
879
|
-
])) :
|
|
880
|
-
], 16,
|
|
1023
|
+
])) : T("", !0)
|
|
1024
|
+
], 16, Qt));
|
|
881
1025
|
}
|
|
882
|
-
}),
|
|
883
|
-
function
|
|
1026
|
+
}), Oa = /* @__PURE__ */ N(aa, [["__scopeId", "data-v-8cfb8f2a"]]), Te = Symbol("MuTabs"), sa = ["line", "segment"], na = ["small", "medium", "large"], oa = ["white", "ghost"], la = ["content", "equal"];
|
|
1027
|
+
function W(e, t) {
|
|
884
1028
|
return typeof t == "string" && e.includes(t);
|
|
885
1029
|
}
|
|
886
|
-
function
|
|
887
|
-
return
|
|
1030
|
+
function ia(e) {
|
|
1031
|
+
return W(sa, e);
|
|
888
1032
|
}
|
|
889
|
-
function
|
|
890
|
-
return
|
|
1033
|
+
function ua(e) {
|
|
1034
|
+
return W(na, e);
|
|
891
1035
|
}
|
|
892
|
-
function
|
|
893
|
-
return
|
|
1036
|
+
function ra(e) {
|
|
1037
|
+
return W(oa, e);
|
|
894
1038
|
}
|
|
895
|
-
function
|
|
896
|
-
return
|
|
1039
|
+
function ca(e) {
|
|
1040
|
+
return W(la, e);
|
|
897
1041
|
}
|
|
898
|
-
function
|
|
899
|
-
const t = e, a =
|
|
1042
|
+
function $e(e = {}) {
|
|
1043
|
+
const t = e, a = ia(t.variant) ? t.variant : "line";
|
|
900
1044
|
return {
|
|
901
1045
|
modelValue: e.modelValue,
|
|
902
1046
|
defaultValue: e.defaultValue,
|
|
903
1047
|
variant: a,
|
|
904
|
-
appearance: a === "segment" &&
|
|
905
|
-
size:
|
|
906
|
-
layout:
|
|
1048
|
+
appearance: a === "segment" && ra(t.appearance) ? t.appearance : a === "segment" ? "white" : void 0,
|
|
1049
|
+
size: ua(t.size) ? t.size : "medium",
|
|
1050
|
+
layout: ca(t.layout) ? t.layout : "content",
|
|
907
1051
|
disabled: e.disabled ?? !1
|
|
908
1052
|
};
|
|
909
1053
|
}
|
|
910
|
-
function
|
|
1054
|
+
function da(e) {
|
|
911
1055
|
return {
|
|
912
1056
|
value: e.value,
|
|
913
1057
|
disabled: e.disabled ?? !1
|
|
914
1058
|
};
|
|
915
1059
|
}
|
|
916
|
-
function
|
|
1060
|
+
function fa(e = {}) {
|
|
917
1061
|
return e.modelValue !== void 0;
|
|
918
1062
|
}
|
|
919
|
-
function
|
|
1063
|
+
function Me(e, t) {
|
|
920
1064
|
return Object.is(e, t);
|
|
921
1065
|
}
|
|
922
|
-
function
|
|
923
|
-
const t =
|
|
1066
|
+
function va(e = {}) {
|
|
1067
|
+
const t = $e(e), a = [
|
|
924
1068
|
"mu-tabs",
|
|
925
1069
|
`mu-tabs--variant-${t.variant}`,
|
|
926
1070
|
`mu-tabs--size-${t.size}`,
|
|
@@ -928,19 +1072,19 @@ function Yt(e = {}) {
|
|
|
928
1072
|
];
|
|
929
1073
|
return t.variant === "segment" && a.push(`mu-tabs--appearance-${t.appearance}`), t.disabled && a.push("is-disabled"), a;
|
|
930
1074
|
}
|
|
931
|
-
function
|
|
1075
|
+
function ma(e, t = {}) {
|
|
932
1076
|
const a = ["mu-tab"];
|
|
933
1077
|
return t.active && a.push("is-active"), (t.disabled || e.disabled) && a.push("is-disabled"), a;
|
|
934
1078
|
}
|
|
935
|
-
const
|
|
1079
|
+
const ha = ["aria-selected", "disabled"], pa = {
|
|
936
1080
|
key: 0,
|
|
937
1081
|
class: "mu-tab__prefix",
|
|
938
1082
|
"aria-hidden": "true"
|
|
939
|
-
},
|
|
1083
|
+
}, ga = { class: "mu-tab__content" }, ba = {
|
|
940
1084
|
key: 1,
|
|
941
1085
|
class: "mu-tab__suffix",
|
|
942
1086
|
"aria-hidden": "true"
|
|
943
|
-
},
|
|
1087
|
+
}, ka = /* @__PURE__ */ H({
|
|
944
1088
|
inheritAttrs: !1,
|
|
945
1089
|
__name: "Tab",
|
|
946
1090
|
props: {
|
|
@@ -949,63 +1093,63 @@ const ta = ["aria-selected", "disabled"], aa = {
|
|
|
949
1093
|
},
|
|
950
1094
|
emits: ["click"],
|
|
951
1095
|
setup(e, { emit: t }) {
|
|
952
|
-
const a = e,
|
|
953
|
-
() => l ?
|
|
954
|
-
), c =
|
|
955
|
-
() =>
|
|
956
|
-
),
|
|
957
|
-
|
|
958
|
-
active:
|
|
1096
|
+
const a = e, o = t, r = R(), s = X(), l = he(Te, null), d = P(null), i = n(() => da(a)), u = n(
|
|
1097
|
+
() => l ? Me(l.value.value, i.value.value) : !1
|
|
1098
|
+
), c = n(
|
|
1099
|
+
() => i.value.disabled || !!(l != null && l.disabled.value)
|
|
1100
|
+
), w = n(() => [
|
|
1101
|
+
ma(a, {
|
|
1102
|
+
active: u.value,
|
|
959
1103
|
disabled: c.value
|
|
960
1104
|
}),
|
|
961
1105
|
r.class
|
|
962
|
-
]), b =
|
|
963
|
-
const { class: g, style:
|
|
964
|
-
return
|
|
965
|
-
}), k =
|
|
1106
|
+
]), b = n(() => {
|
|
1107
|
+
const { class: g, style: M, ...L } = r;
|
|
1108
|
+
return L;
|
|
1109
|
+
}), k = n(() => r.style);
|
|
966
1110
|
function $() {
|
|
967
|
-
!l || !d.value || l.registerItem(
|
|
1111
|
+
!l || !d.value || l.registerItem(i.value.value, d.value);
|
|
968
1112
|
}
|
|
969
|
-
function
|
|
1113
|
+
function y(g) {
|
|
970
1114
|
if (c.value) {
|
|
971
1115
|
g.preventDefault(), g.stopPropagation();
|
|
972
1116
|
return;
|
|
973
1117
|
}
|
|
974
|
-
l && l.select(
|
|
1118
|
+
l && l.select(i.value.value, g), o("click", g);
|
|
975
1119
|
}
|
|
976
|
-
return
|
|
1120
|
+
return se(() => {
|
|
977
1121
|
$();
|
|
978
|
-
}),
|
|
979
|
-
l == null || l.unregisterItem(
|
|
980
|
-
}),
|
|
981
|
-
() =>
|
|
982
|
-
(g,
|
|
983
|
-
!l || !d.value || (l.unregisterItem(
|
|
1122
|
+
}), ne(() => {
|
|
1123
|
+
l == null || l.unregisterItem(i.value.value);
|
|
1124
|
+
}), oe(
|
|
1125
|
+
() => i.value.value,
|
|
1126
|
+
(g, M) => {
|
|
1127
|
+
!l || !d.value || (l.unregisterItem(M), l.registerItem(g, d.value));
|
|
984
1128
|
}
|
|
985
|
-
), (g,
|
|
1129
|
+
), (g, M) => (v(), h("button", A({
|
|
986
1130
|
ref_key: "buttonRef",
|
|
987
1131
|
ref: d
|
|
988
1132
|
}, b.value, {
|
|
989
1133
|
type: "button",
|
|
990
1134
|
role: "tab",
|
|
991
|
-
class:
|
|
1135
|
+
class: w.value,
|
|
992
1136
|
style: k.value,
|
|
993
|
-
"aria-selected":
|
|
1137
|
+
"aria-selected": u.value ? "true" : "false",
|
|
994
1138
|
disabled: c.value,
|
|
995
|
-
onClick:
|
|
1139
|
+
onClick: y
|
|
996
1140
|
}), [
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
])) :
|
|
1000
|
-
|
|
1001
|
-
|
|
1141
|
+
z(s).prefix ? (v(), h("span", pa, [
|
|
1142
|
+
C(g.$slots, "prefix", {}, void 0, !0)
|
|
1143
|
+
])) : T("", !0),
|
|
1144
|
+
f("span", ga, [
|
|
1145
|
+
C(g.$slots, "default", {}, void 0, !0)
|
|
1002
1146
|
]),
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
])) :
|
|
1006
|
-
], 16,
|
|
1147
|
+
z(s).suffix ? (v(), h("span", ba, [
|
|
1148
|
+
C(g.$slots, "suffix", {}, void 0, !0)
|
|
1149
|
+
])) : T("", !0)
|
|
1150
|
+
], 16, ha));
|
|
1007
1151
|
}
|
|
1008
|
-
}),
|
|
1152
|
+
}), Aa = /* @__PURE__ */ N(ka, [["__scopeId", "data-v-97f04990"]]), _a = /* @__PURE__ */ H({
|
|
1009
1153
|
inheritAttrs: !1,
|
|
1010
1154
|
__name: "Tabs",
|
|
1011
1155
|
props: {
|
|
@@ -1019,109 +1163,109 @@ const ta = ["aria-selected", "disabled"], aa = {
|
|
|
1019
1163
|
},
|
|
1020
1164
|
emits: ["update:modelValue", "change"],
|
|
1021
1165
|
setup(e, { emit: t }) {
|
|
1022
|
-
const a = e,
|
|
1023
|
-
() => d.value ? l.value.modelValue :
|
|
1024
|
-
), c =
|
|
1166
|
+
const a = e, o = t, r = R(), s = P(null), l = n(() => $e(a)), d = n(() => fa(a)), i = P(l.value.defaultValue), u = n(
|
|
1167
|
+
() => d.value ? l.value.modelValue : i.value
|
|
1168
|
+
), c = n(() => l.value.variant), w = n(() => l.value.appearance), b = n(() => l.value.size), k = n(() => l.value.layout), $ = n(() => l.value.disabled), y = P(!1), g = P(0), M = /* @__PURE__ */ new Map(), L = P({
|
|
1025
1169
|
transform: "translateX(0px)",
|
|
1026
1170
|
width: "0px"
|
|
1027
|
-
}), O =
|
|
1028
|
-
const { class:
|
|
1171
|
+
}), O = n(() => [va(a), r.class]), m = n(() => {
|
|
1172
|
+
const { class: _, style: S, ...Q } = r;
|
|
1029
1173
|
return Q;
|
|
1030
|
-
}),
|
|
1031
|
-
function
|
|
1032
|
-
const
|
|
1033
|
-
if (!
|
|
1034
|
-
|
|
1174
|
+
}), V = n(() => r.style);
|
|
1175
|
+
function B() {
|
|
1176
|
+
const _ = s.value, S = u.value !== void 0 ? M.get(u.value) : void 0;
|
|
1177
|
+
if (!_ || !S) {
|
|
1178
|
+
L.value = {
|
|
1035
1179
|
transform: "translateX(0px)",
|
|
1036
1180
|
width: "0px"
|
|
1037
1181
|
};
|
|
1038
1182
|
return;
|
|
1039
1183
|
}
|
|
1040
|
-
const Q =
|
|
1041
|
-
|
|
1042
|
-
transform: `translateX(${
|
|
1043
|
-
width: `${
|
|
1184
|
+
const Q = _.getBoundingClientRect(), de = S.getBoundingClientRect();
|
|
1185
|
+
L.value = {
|
|
1186
|
+
transform: `translateX(${de.left - Q.left}px)`,
|
|
1187
|
+
width: `${de.width}px`
|
|
1044
1188
|
};
|
|
1045
1189
|
}
|
|
1046
|
-
function
|
|
1047
|
-
|
|
1048
|
-
|
|
1190
|
+
function G() {
|
|
1191
|
+
q(() => {
|
|
1192
|
+
B();
|
|
1049
1193
|
});
|
|
1050
1194
|
}
|
|
1051
|
-
function J(
|
|
1052
|
-
$.value ||
|
|
1195
|
+
function J(_, S) {
|
|
1196
|
+
$.value || Me(u.value, _) || (d.value || (i.value = _), o("update:modelValue", _), o("change", _, S));
|
|
1053
1197
|
}
|
|
1054
|
-
function
|
|
1055
|
-
|
|
1198
|
+
function p(_, S) {
|
|
1199
|
+
M.set(_, S), g.value += 1, G();
|
|
1056
1200
|
}
|
|
1057
|
-
function x(
|
|
1058
|
-
|
|
1201
|
+
function x(_) {
|
|
1202
|
+
M.delete(_), g.value += 1, G();
|
|
1059
1203
|
}
|
|
1060
|
-
return
|
|
1061
|
-
value:
|
|
1204
|
+
return pe(Te, {
|
|
1205
|
+
value: u,
|
|
1062
1206
|
variant: c,
|
|
1063
|
-
appearance:
|
|
1207
|
+
appearance: w,
|
|
1064
1208
|
size: b,
|
|
1065
1209
|
layout: k,
|
|
1066
1210
|
disabled: $,
|
|
1067
1211
|
select: J,
|
|
1068
|
-
registerItem:
|
|
1212
|
+
registerItem: p,
|
|
1069
1213
|
unregisterItem: x
|
|
1070
|
-
}),
|
|
1071
|
-
[
|
|
1214
|
+
}), oe(
|
|
1215
|
+
[u, c, b, k, g],
|
|
1072
1216
|
() => {
|
|
1073
|
-
|
|
1217
|
+
G();
|
|
1074
1218
|
},
|
|
1075
1219
|
{ flush: "post" }
|
|
1076
|
-
),
|
|
1077
|
-
globalThis.window.addEventListener("resize",
|
|
1078
|
-
|
|
1220
|
+
), se(() => {
|
|
1221
|
+
globalThis.window.addEventListener("resize", B), q(() => {
|
|
1222
|
+
B(), y.value = !0;
|
|
1079
1223
|
});
|
|
1080
|
-
}),
|
|
1081
|
-
globalThis.window.removeEventListener("resize",
|
|
1082
|
-
}), (
|
|
1224
|
+
}), ne(() => {
|
|
1225
|
+
globalThis.window.removeEventListener("resize", B);
|
|
1226
|
+
}), (_, S) => (v(), h("div", A({
|
|
1083
1227
|
ref_key: "rootRef",
|
|
1084
1228
|
ref: s
|
|
1085
|
-
},
|
|
1229
|
+
}, m.value, {
|
|
1086
1230
|
role: "tablist",
|
|
1087
|
-
class: [O.value, { "is-ready":
|
|
1088
|
-
style:
|
|
1231
|
+
class: [O.value, { "is-ready": y.value }],
|
|
1232
|
+
style: V.value
|
|
1089
1233
|
}), [
|
|
1090
|
-
|
|
1091
|
-
|
|
1234
|
+
C(_.$slots, "default", {}, void 0, !0),
|
|
1235
|
+
f("span", {
|
|
1092
1236
|
class: "mu-tabs__indicator",
|
|
1093
|
-
style:
|
|
1237
|
+
style: ve(L.value),
|
|
1094
1238
|
"aria-hidden": "true"
|
|
1095
1239
|
}, null, 4)
|
|
1096
1240
|
], 16));
|
|
1097
1241
|
}
|
|
1098
|
-
}),
|
|
1099
|
-
function
|
|
1242
|
+
}), Ra = /* @__PURE__ */ N(_a, [["__scopeId", "data-v-28e8c4f7"]]), Ca = ["outline", "solid", "soft"];
|
|
1243
|
+
function ya(e, t) {
|
|
1100
1244
|
return typeof t == "string" && e.includes(t);
|
|
1101
1245
|
}
|
|
1102
|
-
function
|
|
1103
|
-
return
|
|
1246
|
+
function wa(e) {
|
|
1247
|
+
return ya(Ca, e);
|
|
1104
1248
|
}
|
|
1105
|
-
function
|
|
1249
|
+
function Be(e = {}) {
|
|
1106
1250
|
return {
|
|
1107
|
-
variant:
|
|
1251
|
+
variant: wa(e.variant) ? e.variant : "outline",
|
|
1108
1252
|
selected: e.selected ?? !1,
|
|
1109
1253
|
disabled: e.disabled ?? !1
|
|
1110
1254
|
};
|
|
1111
1255
|
}
|
|
1112
|
-
function
|
|
1113
|
-
const t =
|
|
1256
|
+
function Va(e = {}) {
|
|
1257
|
+
const t = Be(e), a = ["mu-tag", `mu-tag--variant-${t.variant}`];
|
|
1114
1258
|
return t.selected && a.push("is-selected"), t.disabled && a.push("is-disabled"), a;
|
|
1115
1259
|
}
|
|
1116
|
-
const
|
|
1260
|
+
const xa = ["disabled", "aria-pressed"], Ta = {
|
|
1117
1261
|
key: 0,
|
|
1118
1262
|
class: "mu-tag__prefix",
|
|
1119
1263
|
"aria-hidden": "true"
|
|
1120
|
-
},
|
|
1264
|
+
}, $a = { class: "mu-tag__content" }, Ma = {
|
|
1121
1265
|
key: 1,
|
|
1122
1266
|
class: "mu-tag__suffix",
|
|
1123
1267
|
"aria-hidden": "true"
|
|
1124
|
-
},
|
|
1268
|
+
}, Ba = /* @__PURE__ */ H({
|
|
1125
1269
|
__name: "Tag",
|
|
1126
1270
|
props: {
|
|
1127
1271
|
variant: {},
|
|
@@ -1130,40 +1274,41 @@ const da = ["disabled", "aria-pressed"], fa = {
|
|
|
1130
1274
|
},
|
|
1131
1275
|
emits: ["update:selected", "click"],
|
|
1132
1276
|
setup(e, { emit: t }) {
|
|
1133
|
-
const a = e,
|
|
1134
|
-
function d(
|
|
1135
|
-
s.value.disabled || (
|
|
1277
|
+
const a = e, o = t, r = X(), s = n(() => Be(a)), l = n(() => Va(a));
|
|
1278
|
+
function d(i) {
|
|
1279
|
+
s.value.disabled || (o("click", i), o("update:selected", !s.value.selected));
|
|
1136
1280
|
}
|
|
1137
|
-
return (
|
|
1281
|
+
return (i, u) => (v(), h("button", {
|
|
1138
1282
|
type: "button",
|
|
1139
|
-
class:
|
|
1283
|
+
class: K(l.value),
|
|
1140
1284
|
disabled: s.value.disabled,
|
|
1141
1285
|
"aria-pressed": s.value.selected,
|
|
1142
1286
|
onClick: d
|
|
1143
1287
|
}, [
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
])) :
|
|
1147
|
-
|
|
1148
|
-
|
|
1288
|
+
z(r).prefix ? (v(), h("span", Ta, [
|
|
1289
|
+
C(i.$slots, "prefix", {}, void 0, !0)
|
|
1290
|
+
])) : T("", !0),
|
|
1291
|
+
f("span", $a, [
|
|
1292
|
+
C(i.$slots, "default", {}, void 0, !0)
|
|
1149
1293
|
]),
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
])) :
|
|
1153
|
-
], 10,
|
|
1294
|
+
z(r).suffix ? (v(), h("span", Ma, [
|
|
1295
|
+
C(i.$slots, "suffix", {}, void 0, !0)
|
|
1296
|
+
])) : T("", !0)
|
|
1297
|
+
], 10, xa));
|
|
1154
1298
|
}
|
|
1155
|
-
}),
|
|
1299
|
+
}), Da = /* @__PURE__ */ N(Ba, [["__scopeId", "data-v-e3e9ee4d"]]);
|
|
1156
1300
|
export {
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1301
|
+
Ha as MessageList,
|
|
1302
|
+
La as MuBadge,
|
|
1303
|
+
fe as MuButton,
|
|
1304
|
+
Lt as MuModal,
|
|
1305
|
+
Ia as MuRadio,
|
|
1306
|
+
za as MuRadioGroup,
|
|
1307
|
+
Oa as MuSwitch,
|
|
1308
|
+
Aa as MuTab,
|
|
1309
|
+
Ra as MuTabs,
|
|
1310
|
+
Da as MuTag,
|
|
1311
|
+
Pa as message,
|
|
1312
|
+
Na as muModal,
|
|
1313
|
+
F as openMuModal
|
|
1169
1314
|
};
|