vue-amazing-ui
Version:
An Amazing Vue3 UI Components Library, Using TypeScript.
1,283 lines (1,282 loc) • 551 kB
JavaScript
import { onMounted as vt, onUnmounted as Rl, ref as c, computed as v, toValue as rl, watch as Le, onBeforeUnmount as zt, useSlots as ha, reactive as gl, inject as jl, toRefs as Nl, getCurrentInstance as ma, Comment as ga, Text as ya, defineComponent as me, createBlock as ke, openBlock as a, Transition as rt, withCtx as se, createElementBlock as n, createCommentVNode as F, normalizeStyle as E, normalizeClass as A, unref as W, createElementVNode as s, Fragment as ce, renderSlot as D, createTextVNode as Z, toDisplayString as j, withKeys as Xe, withModifiers as Ae, nextTick as Ge, resolveDynamicComponent as at, createVNode as we, withDirectives as We, vShow as Oe, mergeProps as ve, createSlots as kl, renderList as Be, createStaticVNode as Kt, watchEffect as st, vModelText as Al, provide as Ul, normalizeProps as Qt, guardReactiveProps as Jt, h as ba, Teleport as wa, TransitionGroup as Tl, isVNode as yl, shallowRef as ll } from "vue";
import { TinyColor as Tt } from "@ctrl/tinycolor";
import { generate as Dl } from "@ant-design/colors";
import { getYear as al, getMonth as Ot, parse as Yl, format as xt, startOfDay as Kl, startOfMonth as vl, getTime as Et, addDays as pl, getDay as ka, startOfYear as $a, addMonths as ql, addYears as Ca, isSameDay as Sa, isSameMonth as Xl, getDate as Ma } from "date-fns";
import { useTransition as la, TransitionPresets as za } from "@vueuse/core";
import { toRgbaString as Ct, toHexString as ol, rgba as St, rgb2hsv as Cl, hsla as Gt, hsl2hsv as Gl, hsva as jt, hsl2rgb as Sl, hsv2rgb as Pt, rgb2hsl as Ml, hsv2hsl as hl, toHexaString as Rt, toHslaString as At, toRgbString as zl, toHslString as Bl, toHsvaString as Nt, toHsvString as Ll } from "seemly";
import Ba from "@vuepic/vue-datepicker";
import ml from "qrcode";
import { Swiper as Fl, SwiperSlide as El } from "swiper/vue";
import { Autoplay as Zl, Navigation as Ql, Pagination as Jl, Mousewheel as La, EffectCreative as Fa, EffectCards as Ea, EffectCoverflow as Pa, EffectFlip as Ra, EffectCube as Aa, EffectFade as Ta } from "swiper/modules";
function q0(k = Date.now(), l = "YYYY-MM-DD HH:mm:ss") {
try {
let e;
if (typeof k == "number" || typeof k == "string") {
if (e = new Date(k), isNaN(e.getTime()))
throw new Error("Invalid date");
} else
e = k;
const t = (i, u = 2) => String(i).padStart(u, "0"), r = (i) => {
switch (i) {
case "YYYY":
return t(e.getFullYear());
case "YY":
return t(e.getFullYear()).slice(2, 4);
case "MM":
return t(e.getMonth() + 1);
case "M":
return String(e.getMonth() + 1);
case "DD":
return t(e.getDate());
case "D":
return String(e.getDate());
case "HH":
return t(e.getHours());
case "H":
return String(e.getHours());
case "mm":
return t(e.getMinutes());
case "m":
return String(e.getMinutes());
case "ss":
return t(e.getSeconds());
case "s":
return String(e.getSeconds());
case "SSS":
return t(e.getMilliseconds(), 3);
default:
return i;
}
};
return l.replace(/(YYYY|YY|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS)/g, r);
} catch (e) {
return console.error("Error formatting date:", e), "";
}
}
function aa(k, l = 2, e = ",", t = ".", r, i) {
typeof k != "number" && typeof k != "string" && console.warn("Expected value to be of type number or string"), typeof l != "number" && console.warn("Expected precision to be of type number");
const u = Number(k);
if (isNaN(u) || !isFinite(u))
return "";
if (u === 0)
return u.toFixed(l);
let o = u.toFixed(l);
if (typeof e == "string" && e !== "") {
const [f, d] = o.split(".");
o = f.replace(/(\d)(?=(\d{3})+$)/g, "$1" + e) + (d ? t + d : "");
}
return (r || "") + o + (i || "");
}
function Mt(k, l = 0, e = !1) {
let t = null;
function r(u) {
if (t || (t = u), u - t >= l) {
try {
k();
} catch (f) {
console.error("Error executing rafTimeout function:", f);
}
e && (t = u, i.id = requestAnimationFrame(r));
} else
i.id = requestAnimationFrame(r);
}
const i = {
id: requestAnimationFrame(r)
};
return i;
}
function it(k) {
k && k.id && typeof k.id == "number" ? cancelAnimationFrame(k.id) : console.warn("cancelRaf received an invalid id:", k);
}
function Da(k, l = 300) {
let e = !0;
return function(...t) {
return e && (k(...t), e = !1, setTimeout(() => {
e = !0;
}, l)), !1;
};
}
function Zt(k, l = 300) {
let e = null;
return function(...t) {
e && clearTimeout(e), e = setTimeout(() => {
k(...t);
}, l);
};
}
function nl(k, l) {
if (Number.isNaN(k) || Number.isNaN(l))
throw new Error("Both num1 and num2 must be valid numbers.");
const e = k % 1 !== 0, t = l % 1 !== 0;
if (!e && !t)
return k + l;
const r = String(k).split(".")[1] ?? "", i = String(l).split(".")[1] ?? "", u = Math.max(r.length, i.length), o = Math.pow(10, u), f = k.toFixed(u), d = l.toFixed(u);
return (+f.replace(".", "") + +d.replace(".", "")) / o;
}
function Ha(k, l) {
if (!k) {
console.error("无效的 url");
return;
}
const e = l || k.split("?")[0].split("/").pop() || "download";
try {
fetch(k).then((t) => {
t.ok ? t.blob().then((r) => {
const i = URL.createObjectURL(r), u = document.createElement("a");
u.href = i, u.download = e, document.body.appendChild(u), u.click(), document.body.removeChild(u), URL.revokeObjectURL(i);
}) : console.error("请求文件失败,状态码:", t.status);
});
} catch (t) {
console.error("文件下载失败:", t);
}
}
function X0() {
const k = document.documentElement;
k.classList.toggle("dark"), k.classList.contains("dark") ? k.style.colorScheme = "dark" : k.style.colorScheme = "light";
}
function Va() {
const k = c(!1), l = ma();
return l && vt(() => {
k.value = !0;
}, l), k;
}
function oa(k) {
const l = Va();
return v(() => (l.value, !!k()));
}
function _t(k, l, e) {
vt(() => k.addEventListener(l, e)), Rl(() => k.removeEventListener(l, e));
}
function il(k, l, e = {}) {
const t = oa(() => window && "MutationObserver" in window), r = c(!1);
let i;
const u = v(() => {
const p = rl(k);
return p ? Array.isArray(p) ? p.map(($) => rl($)).filter(($) => $) : [p] : [];
}), o = () => {
i && (i.disconnect(), i = void 0);
}, f = () => {
t.value && u.value.length && !r.value && (i = new MutationObserver(l), u.value.forEach((p) => i.observe(p, e)));
};
Le(
() => u.value,
() => {
o(), f();
},
{
immediate: !0,
// 立即触发回调,以便初始状态也被观察
flush: "post"
}
);
const d = () => {
r.value = !0, o();
}, b = () => {
r.value = !1, f();
};
return zt(() => o()), {
stop: d,
start: b
};
}
function Wa(k = window, l = 0, e, t) {
const r = c(0), i = c(0), u = c(0), o = c(0), f = c(!1), d = c(!1), b = c(!1), p = c(!1), $ = c(!1), B = c(0), w = c(0);
function C(R) {
f.value = !0;
const L = R.target.documentElement ?? R.target;
r.value = L.scrollLeft, u.value = L.scrollTop, d.value = r.value < B.value, b.value = r.value > B.value, p.value = u.value < w.value, $.value = u.value > w.value, B.value = r.value, w.value = u.value, y(R), e && e(R);
}
const m = Da(C, l);
function h(R) {
f.value && (f.value = !1, d.value = !1, b.value = !1, p.value = !1, $.value = !1, t && t(R));
}
const y = Zt(h, l + 200), g = v(() => {
const R = rl(k);
return R || null;
});
Le(
() => g.value,
(R, L) => {
var N;
if (L && S(L), R) {
const P = ((N = R == null ? void 0 : R.document) == null ? void 0 : N.documentElement) || (R == null ? void 0 : R.documentElement) || R;
i.value = P.scrollWidth - P.clientWidth, o.value = P.scrollHeight - P.clientHeight, P.addEventListener("scroll", m), P.addEventListener("scrollend", y);
}
},
{
immediate: !0,
flush: "post"
}
);
function S(R) {
var N;
const L = ((N = R == null ? void 0 : R.document) == null ? void 0 : N.documentElement) || (R == null ? void 0 : R.documentElement) || R;
L.removeEventListener("scroll", m), L.removeEventListener("scrollend", y);
}
return zt(() => S(g.value)), { x: r, xScrollMax: i, y: u, yScrollMax: o, isScrolling: f, left: d, right: b, top: p, bottom: $ };
}
function G0() {
const k = c(0), l = c(0);
let e = performance.now();
const t = 10, r = (i) => {
if (l.value++, l.value >= t) {
const u = i - e;
k.value = Math.round(1e3 / (u / t)), e = i, l.value = 0;
}
requestAnimationFrame(r);
};
return requestAnimationFrame(r), { fps: k };
}
function Z0(k) {
if (!k || typeof k != "string" || k.trim() === "")
throw new Error("Invalid mediaQuery parameter. It must be a non-empty string.");
const l = c(window && window.matchMedia(k).matches), e = window.matchMedia(k), t = (r) => {
l.value = r.matches;
};
return vt(() => {
e.addEventListener("change", t);
}), zt(() => {
e.removeEventListener("change", t);
}), { match: l };
}
function kt(k, l, e = {}) {
const t = oa(() => window && "ResizeObserver" in window);
let r;
const i = c(!1), u = v(() => {
const p = rl(k);
return p ? Array.isArray(p) ? p.map(($) => rl($)).filter(($) => $) : [p] : [];
}), o = () => {
r && (r.disconnect(), r = void 0);
}, f = () => {
t.value && u.value.length && !i.value && (r = new ResizeObserver(l), u.value.forEach((p) => r.observe(p, e)));
};
Le(
() => u.value,
() => {
o(), f();
},
{
immediate: !0,
// 立即触发回调,以便初始状态也被观察
flush: "post"
}
);
const d = () => {
i.value = !0, o();
}, b = () => {
i.value = !1, f();
};
return zt(() => o()), {
stop: d,
start: b
};
}
function Ze(k = "default") {
const l = ha(), e = (t) => {
var u;
const r = (u = l[t]) == null ? void 0 : u.call(l), i = (o) => {
if (o.type === ga || Array.isArray(o.children) && !o.children.length)
return !1;
if (o.type !== ya)
return !0;
if (typeof o.children == "string")
return o.children.trim() !== "";
};
return r && (r != null && r.length) ? r.some((f) => i(f)) : !1;
};
if (Array.isArray(k)) {
const t = gl({});
return k.forEach((r) => {
const i = v(() => e(r));
t[r] = i;
}), t;
} else
return v(() => e(k));
}
function Qe(k) {
const l = Ia("#1677ff"), e = jl("common", gl({ colorPalettes: l, shadowColor: Oa(l[0]) })), t = jl("components", null);
return t !== null && k in t && t[k].colorPalettes.length ? Nl(t[k]) : Nl(e);
}
function Ia(k) {
return Dl(k);
}
function Pl(k) {
return k >= 0 && k <= 255;
}
function Oa(k, l = "#ffffff") {
const { r: e, g: t, b: r, a: i } = new Tt(k).toRgb();
if (i < 1) return k;
const { r: u, g: o, b: f } = new Tt(l).toRgb();
for (let d = 0.01; d <= 1; d += 0.01) {
const b = Math.round((e - u * (1 - d)) / d), p = Math.round((t - o * (1 - d)) / d), $ = Math.round((r - f * (1 - d)) / d);
if (Pl(b) && Pl(p) && Pl($))
return new Tt({ r: b, g: p, b: $, a: Math.round(d * 100) / 100 }).toRgbString();
}
return new Tt({ r: e, g: t, b: r, a: 1 }).toRgbString();
}
const xa = {
key: 0,
class: "m-alert-icon"
}, ja = ["src"], Na = {
key: 1,
class: "icon-svg",
focusable: "false",
"data-icon": "info-circle",
width: "1em",
height: "1em",
fill: "currentColor",
"aria-hidden": "true",
viewBox: "64 64 896 896"
}, Ua = {
key: 2,
class: "icon-svg",
focusable: "false",
"data-icon": "check-circle",
width: "1em",
height: "1em",
fill: "currentColor",
"aria-hidden": "true",
viewBox: "64 64 896 896"
}, Ya = {
key: 3,
class: "icon-svg",
focusable: "false",
"data-icon": "exclamation-circle",
width: "1em",
height: "1em",
fill: "currentColor",
"aria-hidden": "true",
viewBox: "64 64 896 896"
}, Ka = {
key: 4,
class: "icon-svg",
focusable: "false",
"data-icon": "close-circle",
width: "1em",
height: "1em",
fill: "currentColor",
"aria-hidden": "true",
viewBox: "64 64 896 896"
}, qa = {
key: 1,
class: "m-big-icon"
}, Xa = ["src"], Ga = {
key: 1,
class: "icon-svg",
focusable: "false",
"data-icon": "info-circle",
width: "1em",
height: "1em",
fill: "currentColor",
"aria-hidden": "true",
viewBox: "64 64 896 896"
}, Za = {
key: 2,
class: "icon-svg",
focusable: "false",
"data-icon": "check-circle",
width: "1em",
height: "1em",
fill: "currentColor",
"aria-hidden": "true",
viewBox: "64 64 896 896"
}, Qa = {
key: 3,
class: "icon-svg",
focusable: "false",
"data-icon": "exclamation-circle",
width: "1em",
height: "1em",
fill: "currentColor",
"aria-hidden": "true",
viewBox: "64 64 896 896"
}, Ja = {
key: 4,
class: "icon-svg",
focusable: "false",
"data-icon": "close-circle",
width: "1em",
height: "1em",
fill: "currentColor",
"aria-hidden": "true",
viewBox: "64 64 896 896"
}, _a = { class: "m-alert-content" }, eo = { class: "alert-message" }, to = {
key: 0,
class: "alert-description"
}, lo = {
key: 1,
class: "m-alert-actions"
}, ao = ["onKeydown"], oo = { key: 0 }, so = {
key: 1,
class: "alert-close",
focusable: "false",
"data-icon": "close",
width: "1em",
height: "1em",
fill: "currentColor",
"aria-hidden": "true",
viewBox: "64 64 896 896"
}, no = /* @__PURE__ */ me({
__name: "Alert",
props: {
message: { default: void 0 },
description: { default: void 0 },
type: { default: "default" },
bordered: { type: Boolean, default: !0 },
closable: { type: Boolean, default: !1 },
closeText: { default: void 0 },
icon: { default: void 0 },
showIcon: { type: Boolean, default: !1 },
actions: { default: void 0 }
},
emits: ["close"],
setup(k, { emit: l }) {
const e = k, t = c(), r = c(!1), { colorPalettes: i } = Qe("Alert"), u = l, o = Ze(["icon", "description", "actions"]), f = v(() => o.icon || e.icon || ["success", "info", "warning", "error"].includes(e.type)), d = v(() => o.description || e.description);
async function b(p) {
t.value.style.maxHeight = `${t.value.offsetHeight}px`, await Ge(), r.value = !0, u("close", p);
}
return (p, $) => (a(), ke(rt, {
name: "alert-motion",
"leave-from-class": "alert-motion-leave",
"leave-active-class": "alert-motion-leave alert-motion-leave-active",
"leave-to-class": "alert-motion-leave alert-motion-leave-active"
}, {
default: se(() => [
r.value ? F("", !0) : (a(), n("div", {
key: 0,
ref_key: "alertRef",
ref: t,
class: A(["m-alert", [
`alert-${p.type}`,
{
"alert-borderless": !p.bordered,
"alert-width-description": d.value
}
]]),
style: E(`
--alert-primary-color: ${W(i)[5]};
--alert-primary-bg-color: ${W(i)[0]};
--alert-primary-border-color: ${W(i)[2]};
--alert-success-color: #52c41a;
--alert-success-bg-color: #f6ffed;
--alert-success-border-color: #b7eb8f;
--alert-warning-color: #faad14;
--alert-warning-bg-color: #fffbe6;
--alert-warning-border-color: #ffe58f;
--alert-error-color: #ff4d4f;
--alert-error-bg-color: #fff2f0;
--alert-error-border-color: #ffccc7;
`)
}, [
p.showIcon && f.value ? (a(), n(ce, { key: 0 }, [
d.value ? (a(), n("span", qa, [
D(p.$slots, "icon", {}, () => [
p.icon ? (a(), n("img", {
key: 0,
src: p.icon,
class: "big-icon-img"
}, null, 8, Xa)) : p.type === "info" ? (a(), n("svg", Ga, $[4] || ($[4] = [
s("path", { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" }, null, -1),
s("path", { d: "M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z" }, null, -1)
]))) : p.type === "success" ? (a(), n("svg", Za, $[5] || ($[5] = [
s("path", { d: "M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z" }, null, -1),
s("path", { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" }, null, -1)
]))) : p.type === "warning" ? (a(), n("svg", Qa, $[6] || ($[6] = [
s("path", { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" }, null, -1),
s("path", { d: "M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z" }, null, -1)
]))) : p.type === "error" ? (a(), n("svg", Ja, $[7] || ($[7] = [
s("path", { d: "M685.4 354.8c0-4.4-3.6-8-8-8l-66 .3L512 465.6l-99.3-118.4-66.1-.3c-4.4 0-8 3.5-8 8 0 1.9.7 3.7 1.9 5.2l130.1 155L340.5 670a8.32 8.32 0 00-1.9 5.2c0 4.4 3.6 8 8 8l66.1-.3L512 564.4l99.3 118.4 66 .3c4.4 0 8-3.5 8-8 0-1.9-.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z" }, null, -1),
s("path", { d: "M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" }, null, -1)
]))) : F("", !0)
], !0)
])) : (a(), n("span", xa, [
D(p.$slots, "icon", {}, () => [
p.icon ? (a(), n("img", {
key: 0,
src: p.icon,
class: "icon-img"
}, null, 8, ja)) : p.type === "info" ? (a(), n("svg", Na, $[0] || ($[0] = [
s("path", { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" }, null, -1)
]))) : p.type === "success" ? (a(), n("svg", Ua, $[1] || ($[1] = [
s("path", { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" }, null, -1)
]))) : p.type === "warning" ? (a(), n("svg", Ya, $[2] || ($[2] = [
s("path", { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" }, null, -1)
]))) : p.type === "error" ? (a(), n("svg", Ka, $[3] || ($[3] = [
s("path", { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z" }, null, -1)
]))) : F("", !0)
], !0)
]))
], 64)) : F("", !0),
s("div", _a, [
s("div", eo, [
D(p.$slots, "default", {}, () => [
Z(j(p.message), 1)
], !0)
]),
d.value ? (a(), n("div", to, [
D(p.$slots, "description", {}, () => [
Z(j(p.description), 1)
], !0)
])) : F("", !0)
]),
W(o).actions ? (a(), n("div", lo, [
D(p.$slots, "actions", {}, void 0, !0)
])) : F("", !0),
p.closable ? (a(), n("a", {
key: 2,
tabindex: "0",
class: "m-alert-close",
onClick: b,
onKeydown: Xe(Ae(b, ["prevent"]), ["enter"])
}, [
D(p.$slots, "closeText", {}, () => [
p.closeText ? (a(), n("span", oo, j(p.closeText), 1)) : (a(), n("svg", so, $[8] || ($[8] = [
s("path", { d: "M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z" }, null, -1)
])))
], !0)
], 40, ao)) : F("", !0)
], 6))
]),
_: 3
}));
}
}), $e = (k, l) => {
const e = k.__vccOpts || k;
for (const [t, r] of l)
e[t] = r;
return e;
}, ro = /* @__PURE__ */ $e(no, [["__scopeId", "data-v-922b8af5"]]), ge = (k) => {
const l = k;
return l.install = function(e) {
e.component(l.__name, k);
}, k;
}, io = ge(ro), uo = ["src", "alt"], co = /* @__PURE__ */ me({
__name: "Avatar",
props: {
color: { default: "rgba(0, 0, 0, 0.25)" },
shape: { default: "circle" },
size: { default: "middle" },
src: { default: void 0 },
alt: { default: void 0 },
icon: { default: void 0 },
href: { default: void 0 },
target: { default: "_self" }
},
setup(k) {
const l = k, e = c(window.innerWidth), t = Ze(["default", "icon"]), r = v(() => l.src ? !1 : !!(t.icon || l.icon)), i = v(() => {
if (typeof l.size == "number")
return r.value ? {
backgroundColor: l.color,
width: `${l.size}px`,
height: `${l.size}px`,
lineHeight: `${l.size}px`,
fontSize: `${l.size / 2}px`
} : {
backgroundColor: l.color,
width: `${l.size}px`,
height: `${l.size}px`,
lineHeight: `${l.size}px`,
fontSize: "18px"
};
if (typeof l.size == "object") {
let d = 32;
return e.value >= 1600 && l.size.xxl !== void 0 ? d = l.size.xxl : e.value >= 1200 && l.size.xl !== void 0 ? d = l.size.xl : e.value >= 992 && l.size.lg !== void 0 ? d = l.size.lg : e.value >= 768 && l.size.md !== void 0 ? d = l.size.md : e.value >= 576 && l.size.sm !== void 0 ? d = l.size.sm : e.value < 576 && l.size.xs !== void 0 && (d = l.size.xs), {
backgroundColor: l.color,
width: `${d}px`,
height: `${d}px`,
lineHeight: `${d}px`,
fontSize: `${d / 2}px`
};
}
return {
backgroundColor: l.color
};
}), u = v(() => !l.src && !r.value ? t.default : !1), o = v(() => {
if (typeof l.size == "string")
return {
transform: "scale(1) translateX(-50%)"
};
if (typeof l.size == "number") {
const d = Math.min(1, Math.max(0.022222222222222223, (1 + (l.size - 9) * 1) / 45));
return {
lineHeight: `${l.size}px`,
transform: `scale(${d}) translateX(-50%)`
};
}
return {};
});
_t(window, "resize", f);
function f() {
e.value = window.innerWidth;
}
return (d, b) => (a(), ke(at(d.href ? "a" : "div"), {
class: A(["m-avatar", [
`avatar-${d.shape}`,
{
[`avatar-${d.size}`]: typeof d.size == "string" && ["small", "middle", "large"].includes(d.size),
"avatar-image": d.src,
"avatar-link": d.href
}
]]),
style: E(i.value),
href: d.href,
target: d.target
}, {
default: se(() => [
d.src ? (a(), n("img", {
key: 0,
class: "image-item",
src: d.src,
alt: d.alt
}, null, 8, uo)) : F("", !0),
!d.src && r.value ? D(d.$slots, "icon", { key: 1 }, () => [
(a(), ke(at(d.icon)))
], !0) : F("", !0),
u.value ? (a(), n("span", {
key: 2,
class: "string-item",
style: E(o.value)
}, [
D(d.$slots, "default", {}, void 0, !0)
], 4)) : F("", !0)
]),
_: 3
}, 8, ["class", "style", "href", "target"]));
}
}), fo = /* @__PURE__ */ $e(co, [["__scopeId", "data-v-a9ed35a8"]]), sa = ge(fo), vo = /* @__PURE__ */ me({
__name: "Tooltip",
props: {
maxWidth: { default: 240 },
content: { default: void 0 },
contentClass: { default: void 0 },
contentStyle: { default: () => ({}) },
tooltip: { default: void 0 },
tooltipClass: { default: void 0 },
tooltipStyle: { default: () => ({}) },
bgColor: { default: "rgba(0, 0, 0, 0.85)" },
arrow: { type: Boolean, default: !0 },
placement: { default: "top" },
flip: { type: Boolean, default: !0 },
trigger: { default: "hover" },
keyboard: { type: Boolean, default: !1 },
transitionDuration: { default: 100 },
showDelay: { default: 100 },
hideDelay: { default: 100 },
show: { type: Boolean, default: !1 },
showControl: { type: Boolean, default: !1 }
},
emits: ["update:show", "openChange", "animationend"],
setup(k, { expose: l, emit: e }) {
const t = k, r = c(!1), i = c(), u = c(null), o = c(0), f = c(0), d = c("top"), b = c(), p = c(0), $ = c(0), B = c(), w = c(), C = c(0), m = c(0), h = c(document.documentElement.clientWidth), y = c(document.documentElement.clientHeight), g = e, S = Ze(["tooltip"]), R = v(() => typeof t.maxWidth == "number" ? `${t.maxWidth}px` : t.maxWidth), L = v(() => S.tooltip || t.tooltip), N = v(() => {
switch (d.value) {
case "top":
return {
transformOrigin: `50% ${o.value}px`,
top: `${-o.value}px`,
left: `${-f.value}px`
};
case "bottom":
return {
transformOrigin: `50% ${t.arrow ? -4 : -6}px`,
bottom: `${-o.value}px`,
left: `${-f.value}px`
};
case "left":
return {
transformOrigin: `${f.value}px 50%`,
top: `${-o.value}px`,
left: `${-f.value}px`
};
case "right":
return {
transformOrigin: `${t.arrow ? -4 : -6}px 50%`,
top: `${-o.value}px`,
right: `${-f.value}px`
};
default:
return {
transformOrigin: `50% ${o.value}px`,
top: `${-o.value}px`,
left: `${-f.value}px`
};
}
});
Le(
() => [t.placement, t.arrow, t.flip],
() => {
x();
},
{
deep: !0
}
), Le(
() => t.show,
(de) => {
de && !r.value && re(), !de && r.value && oe();
},
{
immediate: !0
}
), vt(() => {
V();
}), zt(() => {
z();
});
const P = il(
u,
() => {
x();
},
{ subtree: !0, childList: !0, attributes: !0, characterData: !0 }
);
_t(window, "resize", O), kt([w, b], (de) => {
if (de.length === 1 && de[0].target.className === "tooltip-card") {
const { blockSize: Se, inlineSize: te } = de[0].borderBoxSize[0];
if (Se === m.value && te === C.value)
return;
}
x();
});
function O() {
h.value = document.documentElement.clientWidth, y.value = document.documentElement.clientHeight, V(), x();
}
function V() {
var de;
z(), u.value = U(((de = b.value) == null ? void 0 : de.parentElement) ?? null), u.value && u.value.addEventListener("scroll", x), u.value === document.documentElement && P.start();
}
function z() {
u.value && u.value.removeEventListener("scroll", x), u.value = null, P.stop();
}
function U(de) {
const Se = (te) => {
const he = window.getComputedStyle(te);
return !!(te.scrollWidth > te.clientWidth && ["scroll", "auto"].includes(he.overflowX) || te.scrollHeight > te.clientHeight && ["scroll", "auto"].includes(he.overflowY) || (te.scrollWidth > te.clientWidth || te.scrollHeight > te.clientHeight) && te === document.documentElement);
};
return de ? Se(de) ? de : U(de.parentElement ?? null) : null;
}
function x() {
r.value && Q();
}
async function Q() {
await Ge(), p.value = b.value.offsetWidth, $.value = b.value.offsetHeight, C.value = w.value.offsetWidth, m.value = w.value.offsetHeight, t.flip && (d.value = ae()), ["top", "bottom"].includes(d.value) ? (o.value = m.value + (t.arrow ? 16 : 6), f.value = (C.value - p.value) / 2) : (o.value = (m.value - $.value) / 2, f.value = C.value + (t.arrow ? 16 : 6));
}
function G() {
return u.value && u.value !== document.documentElement ? u.value.getBoundingClientRect() : {
top: 0,
left: 0,
bottom: y.value,
right: h.value
};
}
function ae() {
const { top: de, bottom: Se, left: te, right: he } = b.value.getBoundingClientRect(), { top: Fe, bottom: De, left: xe, right: ye } = G(), ee = de - Fe - (t.arrow ? 12 : 0), be = De - Se - (t.arrow ? 12 : 0), le = te - xe - (t.arrow ? 12 : 0), Re = ye - he - (t.arrow ? 12 : 0), Ve = (C.value - p.value) / 2, _e = (m.value - $.value) / 2;
return je(t.placement, []);
function je(ut, Me) {
if (ut === "top") {
if (Me.includes("top"))
return Me.includes("bottom") ? Me.includes("left") ? je("right", Me) : je("left", Me) : je("bottom", Me);
if (ee < m.value + (t.arrow ? 4 : 6) && Me.length !== 3)
return je("bottom", [...Me, "top"]);
if (le >= Ve && Re >= Ve)
return "top";
if (Me.length !== 3) {
if (le >= Ve)
return je("left", ["top", "bottom", "right"]);
if (Re >= Ve)
return je("right", ["top", "bottom", "left"]);
}
} else if (ut === "bottom") {
if (Me.includes("bottom"))
return Me.includes("top") ? Me.includes("left") ? je("right", Me) : je("left", Me) : je("top", Me);
if (be < m.value + (t.arrow ? 4 : 6) && Me.length !== 3)
return je("top", [...Me, "bottom"]);
if (le >= Ve && Re >= Ve)
return "bottom";
if (Me.length !== 3) {
if (le >= Ve)
return je("left", ["top", "bottom", "right"]);
if (Re >= Ve)
return je("right", ["top", "bottom", "left"]);
}
} else if (ut === "left") {
if (Me.includes("left"))
return Me.includes("right") ? Me.includes("top") ? je("bottom", Me) : je("top", Me) : je("right", Me);
if (le < C.value + (t.arrow ? 4 : 6) && Me.length !== 3)
return je("right", [...Me, "left"]);
if (ee >= _e && be >= _e)
return "left";
if (Me.length !== 3) {
if (ee >= _e)
return je("top", ["left", "right", "bottom"]);
if (be >= _e)
return je("bottom", ["left", "right", "top"]);
}
} else if (ut === "right") {
if (Me.includes("right"))
return Me.includes("left") ? Me.includes("top") ? je("bottom", Me) : je("top", Me) : je("left", Me);
if (Re < C.value + (t.arrow ? 4 : 6) && Me.length !== 3)
return je("left", [...Me, "right"]);
if (ee >= _e && be >= _e)
return "right";
if (Me.length !== 3) {
if (ee >= _e)
return je("top", ["left", "right", "bottom"]);
if (be >= _e)
return je("bottom", ["left", "right", "top"]);
}
}
return t.placement;
}
}
function re() {
i.value && it(i.value), r.value || (i.value = Mt(() => {
r.value = !0, Q(), g("update:show", !0), g("openChange", !0), L.value && t.trigger === "click" && document.addEventListener("click", ie);
}, t.showDelay));
}
function oe() {
i.value && it(i.value), r.value && (i.value = Mt(() => {
r.value = !1, g("update:show", !1), g("openChange", !1), L.value && t.trigger === "click" && document.removeEventListener("click", ie);
}, t.hideDelay));
}
function Te() {
r.value ? oe() : re();
}
function ie(de) {
B.value.contains(de.target) || oe();
}
function H() {
L.value && t.trigger === "hover" && !t.showControl && re();
}
function K() {
L.value && t.trigger === "hover" && !t.showControl && oe();
}
function ne() {
g("animationend", r.value);
}
function Ce() {
t.trigger === "hover" && !t.showControl && re();
}
function pe() {
t.trigger === "hover" && !t.showControl && oe();
}
return l({
show: re,
hide: oe,
observeScroll: V
}), (de, Se) => (a(), n("div", {
class: "m-tooltip-wrap",
style: E(`--tooltip-max-width: ${R.value}; --tooltip-background-color: ${de.bgColor}; --transition-duration: ${de.transitionDuration}ms;`),
onMouseenter: H,
onMouseleave: K
}, [
we(rt, {
name: "zoom",
"enter-from-class": "zoom-enter",
"enter-active-class": "zoom-enter",
"enter-to-class": "zoom-enter zoom-enter-active",
"leave-from-class": "zoom-leave",
"leave-active-class": "zoom-leave zoom-leave-active",
"leave-to-class": "zoom-leave zoom-leave-active",
onAnimationend: ne
}, {
default: se(() => [
We(s("div", {
ref_key: "tooltipRef",
ref: B,
class: A(["m-tooltip-card", { [`tooltip-${d.value}-padding`]: de.arrow }]),
style: E(N.value),
onMouseenter: Ce,
onMouseleave: pe,
onKeydown: Se[0] || (Se[0] = Xe((te) => de.trigger === "click" && de.keyboard && r.value ? oe() : () => !1, ["esc"]))
}, [
s("div", {
ref_key: "tooltipCardRef",
ref: w,
class: A(["tooltip-card", de.tooltipClass]),
style: E(de.tooltipStyle)
}, [
D(de.$slots, "tooltip", {}, () => [
Z(j(de.tooltip), 1)
], !0)
], 6),
de.arrow ? (a(), n("div", {
key: 0,
class: A(["tooltip-arrow", `arrow-${d.value || "top"}`])
}, null, 2)) : F("", !0)
], 38), [
[Oe, L.value && r.value]
])
]),
_: 3
}),
s("span", {
ref_key: "contentRef",
ref: b,
class: A(["tooltip-content", de.contentClass]),
style: E(de.contentStyle),
onClick: Se[1] || (Se[1] = (te) => L.value && de.trigger === "click" && !r.value ? re() : () => !1),
onKeydown: [
Se[2] || (Se[2] = Xe((te) => L.value && de.trigger === "click" && de.keyboard ? Te() : () => !1, ["enter"])),
Se[3] || (Se[3] = Xe((te) => L.value && de.trigger === "click" && de.keyboard && r.value ? oe() : () => !1, ["esc"]))
]
}, [
D(de.$slots, "default", {}, () => [
Z(j(de.content), 1)
], !0)
], 38)
], 36));
}
}), po = /* @__PURE__ */ $e(vo, [["__scopeId", "data-v-afdd9188"]]), wt = ge(po), ho = {
key: 1,
width: "1em",
height: "1em",
viewBox: "0 0 24 24",
version: "1.1",
xmlns: "http://www.w3.org/2000/svg",
xlinkHref: "http://www.w3.org/1999/xlink"
}, mo = {
key: 0,
class: "backtop-description"
}, go = /* @__PURE__ */ me({
__name: "BackTop",
props: {
icon: { default: void 0 },
description: { default: void 0 },
tooltip: { default: void 0 },
tooltipProps: { default: () => ({}) },
type: { default: "default" },
shape: { default: "circle" },
bottom: { default: 40 },
right: { default: 40 },
zIndex: { default: 9 },
visibilityHeight: { default: 180 },
to: { default: "body" },
listenTo: { default: void 0 }
},
emits: ["click", "show"],
setup(k, { emit: l }) {
const e = k, t = c(null), r = c(0), i = c(null), u = c(null), { colorPalettes: o } = Qe("BackTop"), f = l, d = Ze(["tooltip", "icon", "description"]), b = v(() => ({
bottom: typeof e.bottom == "number" ? `${e.bottom}px` : e.bottom,
right: typeof e.right == "number" ? `${e.right}px` : e.right
})), p = v(() => r.value >= e.visibilityHeight), $ = v(() => d.tooltip || e.tooltip), B = v(() => d.description || e.description);
Le(
() => e.to,
() => {
y();
},
{
flush: "post"
}
), Le(
() => e.listenTo,
() => {
m();
},
{
flush: "post"
}
), Le(p, (L) => {
f("show", L);
}), vt(() => {
m();
}), zt(() => {
var L;
h(), (L = t.value) == null || L.remove();
});
const w = il(
i,
() => {
var L;
r.value = ((L = i.value) == null ? void 0 : L.scrollTop) ?? 0;
},
{ subtree: !0, childList: !0, attributes: !0, characterData: !0 }
);
function C(L) {
r.value = L.target.scrollTop;
}
function m() {
h(), e.listenTo === void 0 ? i.value = S(t.value) : typeof e.listenTo == "string" ? i.value = document.getElementsByTagName(e.listenTo)[0] : e.listenTo instanceof HTMLElement && (i.value = e.listenTo), i.value || console.warn("Container of back-top element is not found."), i.value && i.value.addEventListener("scroll", C), i.value === document.documentElement && w.start(), y();
}
function h() {
i.value && i.value.removeEventListener("scroll", C), i.value = null, w.stop();
}
function y() {
var L;
typeof e.to == "string" ? u.value = document.getElementsByTagName(e.to)[0] : e.to instanceof HTMLElement && (u.value = e.to), u.value && ((L = u.value) == null || L.appendChild(t.value));
}
function g(L) {
return L === document.documentElement ? null : L.parentElement;
}
function S(L) {
if (L === null) return null;
const N = g(L);
return N === null ? null : N === document.documentElement ? document.documentElement : ((O) => {
const { overflow: V, overflowX: z, overflowY: U } = getComputedStyle(O);
return /(auto|scroll|overlay)/.test(V + U + z);
})(N) ? N : S(N);
}
function R() {
i.value && i.value.scrollTo({
top: 0,
behavior: "smooth"
// 平滑滚动并产生过渡效果
}), f("click");
}
return (L, N) => (a(), ke(rt, { name: "zoom" }, {
default: se(() => [
We(s("div", {
ref_key: "backtopRef",
ref: t,
class: "m-backtop",
style: E([
b.value,
`
--backtop-z-index: ${L.zIndex};
--backtop-width: 44px;
--backtop-height: 44px;
--backtop-icon-size: 26px;
--backtop-icon-with-desc-size: 24px;
--backtop-desc-font-size: 12px;
--backtop-default-color: rgba(0, 0, 0, 0.88);
--backtop-default-color-hover: ${W(o)[5]};
--backtop-default-bg-color: rgba(255, 255, 255, 0.88);
--backtop-default-bg-color-hover: rgba(255, 255, 255);
--backtop-default-shadow-color: rgba(0, 0, 0, 0.12);
--backtop-default-shadow-color-hover: rgba(0, 0, 0, 0.12);
--backtop-primary-color: #fff;
--backtop-primary-color-hover: #fff;
--backtop-primary-bg-color: ${W(o)[5]};
--backtop-primary-bg-color-hover: ${W(o)[4]};
--backtop-primary-shadow-color: rgba(9, 88, 217, 0.32);
--backtop-primary-shadow-color-hover: rgba(9, 88, 217, 0.32);
--backtop-circle-border-radius: calc(var(--backtop-width) / 2);
--backtop-square-border-radius: 8px;
`
]),
onClick: R
}, [
we(W(wt), ve({
style: `border-radius: var(--${L.shape}-border-radius)`,
"content-style": { borderRadius: `var(--${L.shape}-border-radius)` }
}, L.tooltipProps), kl({
default: se(() => [
s("div", {
class: A(["backtop-wrap", `backtop-${L.type} backtop-${L.shape}`])
}, [
D(L.$slots, "default", {}, () => [
s("span", {
class: A(["backtop-icon", { "icon-with-description": B.value }])
}, [
D(L.$slots, "icon", {}, () => [
L.icon ? (a(), ke(at(L.icon), { key: 0 })) : (a(), n("svg", ho, N[0] || (N[0] = [
s("g", {
stroke: "none",
"stroke-width": "1",
"fill-rule": "evenodd"
}, [
s("g", {
transform: "translate(-139.000000, -4423.000000)",
"fill-rule": "nonzero"
}, [
s("g", { transform: "translate(120.000000, 4285.000000)" }, [
s("g", { transform: "translate(7.000000, 126.000000)" }, [
s("g", { transform: "translate(24.000000, 24.000000) scale(1, -1) translate(-24.000000, -24.000000) translate(12.000000, 12.000000)" }, [
s("g", { transform: "translate(4.000000, 2.000000)" }, [
s("path", { d: "M8,0 C8.51283584,0 8.93550716,0.38604019 8.99327227,0.883378875 L9,1 L9,10.584 L12.2928932,7.29289322 C12.6834175,6.90236893 13.3165825,6.90236893 13.7071068,7.29289322 C14.0675907,7.65337718 14.0953203,8.22060824 13.7902954,8.61289944 L13.7071068,8.70710678 L8.70710678,13.7071068 L8.62544899,13.7803112 L8.618,13.784 L8.59530661,13.8036654 L8.4840621,13.8753288 L8.37133602,13.9287745 L8.22929083,13.9735893 L8.14346259,13.9897165 L8.03324678,13.9994506 L7.9137692,13.9962979 L7.77070917,13.9735893 L7.6583843,13.9401293 L7.57677845,13.9063266 L7.47929125,13.8540045 L7.4048407,13.8036865 L7.38131006,13.7856883 C7.35030318,13.7612383 7.32077858,13.7349921 7.29289322,13.7071068 L2.29289322,8.70710678 L2.20970461,8.61289944 C1.90467972,8.22060824 1.93240926,7.65337718 2.29289322,7.29289322 C2.65337718,6.93240926 3.22060824,6.90467972 3.61289944,7.20970461 L3.70710678,7.29289322 L7,10.585 L7,1 L7.00672773,0.883378875 C7.06449284,0.38604019 7.48716416,0 8,0 Z" }),
s("path", { d: "M14.9333333,15.9994506 C15.5224371,15.9994506 16,16.4471659 16,16.9994506 C16,17.5122865 15.5882238,17.9349578 15.0577292,17.9927229 L14.9333333,17.9994506 L1.06666667,17.9994506 C0.477562934,17.9994506 0,17.5517354 0,16.9994506 C0,16.4866148 0.411776203,16.0639435 0.9422708,16.0061783 L1.06666667,15.9994506 L14.9333333,15.9994506 Z" })
])
])
])
])
])
], -1)
])))
], !0)
], 2),
B.value ? (a(), n("span", mo, [
D(L.$slots, "description", {}, () => [
Z(j(L.description), 1)
], !0)
])) : F("", !0)
], !0)
], 2)
]),
_: 2
}, [
$.value ? {
name: "tooltip",
fn: se(() => [
D(L.$slots, "tooltip", {}, () => [
Z(j(L.tooltip), 1)
], !0)
]),
key: "0"
} : void 0
]), 1040, ["style", "content-style"])
], 4), [
[Oe, p.value]
])
]),
_: 3
}));
}
}), yo = /* @__PURE__ */ $e(go, [["__scopeId", "data-v-a4d4f32b"]]), bo = ge(yo), wo = { class: "status-text" }, ko = ["title"], $o = {
key: 0,
class: "m-number",
style: { transition: "none 0s ease 0s" }
}, Co = { class: "u-number" }, So = /* @__PURE__ */ me({
__name: "Badge",
props: {
color: { default: void 0 },
value: { default: void 0 },
max: { default: 99 },
showZero: { type: Boolean, default: !1 },
dot: { type: Boolean, default: !1 },
offset: { default: void 0 },
status: { default: void 0 },
text: { default: void 0 },
valueStyle: { default: () => ({}) },
zIndex: { default: 9 },
title: { default: void 0 },
ripple: { type: Boolean, default: !1 }
},
setup(k) {
const l = k, e = [
"pink",
"red",
"yellow",
"orange",
"cyan",
"green",
"blue",
"purple",
"geekblue",
"magenta",
"volcano",
"gold",
"lime"
], t = Ze(["default", "value"]), r = v(() => {
if (l.color && !e.includes(l.color))
return l.value !== void 0 && l.value !== 0 || l.showZero && l.value === 0 ? {
backgroundColor: l.color
} : {
color: l.color,
backgroundColor: l.color
};
}), i = v(() => {
if (l.color && e.includes(l.color))
return l.value !== void 0 && l.value !== 0 || l.showZero && l.value === 0 ? `color-${l.color} white` : `color-${l.color}`;
if (l.status)
return l.value !== void 0 && l.value !== 0 || l.showZero && l.value === 0 ? `status-${l.status} white` : `status-${l.status}`;
}), u = v(() => l.value !== void 0 || l.dot || !l.color && !l.status ? t.default : !1), o = v(() => !l.color && !l.status ? t.value : !1), f = v(() => !!(l.value !== void 0 && l.value !== 0 || l.showZero && l.value === 0 || l.dot)), d = v(() => l.value === void 0 || l.value === 0 && !l.showZero || l.dot), b = v(() => {
var B;
return (B = l.offset) != null && B.length ? {
right: p(l.offset[0]) ? -l.offset[0] + "px" : $(l.offset[0]),
marginTop: p(l.offset[1]) ? l.offset[1] + "px" : l.offset[1]
} : {};
});
function p(B) {
return typeof B == "number";
}
function $(B) {
return B.includes("-") ? B.replace("-", "") : `-${B}`;
}
return (B, w) => (a(), n("div", {
class: A(["m-badge", { "badge-status-color": B.value === void 0 && (B.color || B.status) }]),
style: E([`--badge-z-index: ${B.zIndex}`, B.value === void 0 && !B.dot ? b.value : null])
}, [
B.value === void 0 && !B.dot && (B.color || B.status) ? (a(), n(ce, { key: 0 }, [
s("span", {
class: A(["status-dot", [i.value, { "dot-ripple": B.ripple }]]),
style: E(r.value)
}, null, 6),
s("span", wo, [
D(B.$slots, "default", {}, () => [
Z(j(B.text), 1)
], !0)
])
], 64)) : (a(), n(ce, { key: 1 }, [
u.value ? D(B.$slots, "default", { key: 0 }, void 0, !0) : F("", !0),
o.value ? (a(), n("span", {
key: 1,
class: A(["m-value", { "only-number": !u.value }])
}, [
D(B.$slots, "value", {}, void 0, !0)
], 2)) : (a(), ke(rt, {
key: 2,
name: "zoom",
"enter-from-class": "zoom-enter",
"enter-active-class": "zoom-enter",
"enter-to-class": "zoom-enter",
"leave-from-class": "zoom-leave",
"leave-active-class": "zoom-leave",
"leave-to-class": "zoom-leave"
}, {
default: se(() => [
f.value ? (a(), n("div", {
key: 0,
class: A(["m-badge-value", [
{
"small-num": typeof B.value == "number" && B.value < 10,
"only-number": !u.value,
"only-dot": d.value
},
i.value
]]),
style: E([r.value, b.value, B.valueStyle]),
title: B.title || (B.value !== void 0 ? String(B.value) : "")
}, [
B.dot ? F("", !0) : (a(), n("span", $o, [
s("span", Co, j(typeof B.value == "number" && B.value > B.max ? B.max + "+" : B.value), 1)
]))
], 14, ko)) : F("", !0)
]),
_: 1
}))
], 64))
], 6));
}
}), Mo = /* @__PURE__ */ $e(So, [["__scopeId", "data-v-1dbe9f03"]]), na = ge(Mo), zo = { key: 0 }, Bo = {
key: 1,
focusable: "false",
"data-icon": "right",
width: "1em",
height: "1em",
fill: "currentColor",
"aria-hidden": "true",
viewBox: "64 64 896 896"
}, Lo = /* @__PURE__ */ me({
__name: "Breadcrumb",
props: {
routes: { default: () => [] },
breadcrumbClass: { default: void 0 },
breadcrumbStyle: { default: () => ({}) },
maxWidth: { default: "100%" },
separator: { default: void 0 },
separatorStyle: { default: () => ({}) },
target: { default: "_self" }
},
setup(k) {
const l = k, e = v(() => l.routes.length);
function t(r) {
let i = "";
if (r.path && (i = r.path), r.query && JSON.stringify(r.query) !== "{}") {
const u = r.query;
Object.keys(u).forEach((o, f) => {
f === 0 ? i = i + "?" + o + "=" + u[o] : i = i + "&" + o + "=" + u[o];
});
}
return i;
}
return (r, i) => (a(), n("div", {
class: A(["m-breadcrumb", r.breadcrumbClass]),
style: E([
`
--breadcrumb-color: rgba(0, 0, 0, 0.45);
--breadcrumb-bg-color-hover: rgba(0, 0, 0, 0.06);
--breadcrumb-color-hover: rgba(0, 0, 0, 0.88);
--breadcrumb-color-active: rgba(0, 0, 0, 0.88);
--breadcrumb-padding: 0 4px;
--breadcrumb-border-radius: 4px;
--breadcrumb-separator-color: rgba(0, 0, 0, 0.45);
`,