cur-ui-plus
Version:
this is a Vue3 components library
1,676 lines (1,675 loc) • 49.2 kB
JavaScript
import { library as Yt } from "@fortawesome/fontawesome-svg-core";
import { FontAwesomeIcon as Gt } from "@fortawesome/vue-fontawesome";
import { fas as Kt } from "@fortawesome/free-solid-svg-icons";
import { resolveComponent as fe, openBlock as $, createElementBlock as j, normalizeClass as V, createVNode as F, normalizeProps as Jt, guardReactiveProps as Qt, ref as ae, createBlock as Le, createCommentVNode as z, renderSlot as I, normalizeStyle as He, createElementVNode as E, toDisplayString as ie, Transition as kt, withCtx as Ee, withDirectives as Pt, vShow as jt, computed as Ue, withModifiers as te, Fragment as We, renderList as xt, provide as Zt, inject as er, createTextVNode as St, mergeProps as Me, toHandlers as Ve, reactive as ut, watch as tr, unref as ze, defineComponent as rr } from "vue";
const nr = {
// 图标
icon: {
type: String,
required: !0
},
// 大小
size: {
type: String
},
// 旋转
rotation: {
type: [Number, String]
},
// 翻转
flip: {
type: [Number, String]
},
// 下面是动画效果相关的属性
beat: Boolean,
"beat-fade": Boolean,
bounce: Boolean,
fade: Boolean,
shake: Boolean,
spin: Boolean,
"spin-reverse": Boolean,
"spin-pulse": Boolean,
// 下面是自定义属性
type: String,
color: String
}, or = /* @__PURE__ */ Object.assign({
name: "CurIcon"
}, {
__name: "Icon",
props: nr,
setup(e) {
const t = e;
return (r, n) => {
const o = fe("font-awesome-icon");
return $(), j("i", {
class: V(["cur-icon", { [`cur-icon--${r.type}`]: r.type }])
}, [
F(o, Jt(Qt(t)), null, 16)
], 2);
};
}
}), ar = {
type: {
type: String,
default: "default"
},
plain: {
type: Boolean,
default: !1
},
round: {
type: Boolean,
default: !1
},
disabled: {
type: Boolean,
default: !1
},
loading: {
type: Boolean,
default: !1
},
icon: {
type: String
},
size: {
type: String
},
circle: {
type: Boolean,
default: !1
}
}, ir = ["disabled"], sr = { key: 2 }, lr = /* @__PURE__ */ Object.assign({
name: "CurButton"
}, {
__name: "Button",
props: ar,
setup(e, { expose: t }) {
const r = ae(null);
return t({
ref: r
}), (n, o) => {
const c = fe("Cur-Icon");
return $(), j("button", {
ref_key: "_ref",
ref: r,
class: V(["cur-button", {
[`cur-button--${n.type}`]: n.type,
[`cur-button--${n.size}`]: n.size,
"is-plain": n.plain,
"is-round": n.round,
"is-circle": n.circle,
"is-disabled": n.disabled || n.loading
}]),
disabled: n.disabled || n.loading
}, [
n.loading ? ($(), Le(c, {
key: 0,
icon: "spinner",
spin: ""
})) : z("", !0),
n.icon ? ($(), Le(c, {
key: 1,
icon: n.icon
}, null, 8, ["icon"])) : z("", !0),
n.$slots.default ? ($(), j("span", sr, [
I(n.$slots, "default")
])) : z("", !0)
], 10, ir);
};
}
}), cr = {
// 图片链接,必填属性
imgSrc: {
type: String,
required: !0
},
// 卡片的描述信息
summary: {
type: String
},
// 卡片的宽度
width: {
type: Number
},
// 卡片的高度
imgHeight: {
type: Number
}
}, ur = ["src"], fr = {
key: 0,
class: "cur-card-summary"
}, pr = {
key: 1,
class: "cur-card-summary"
}, dr = {
key: 2,
class: "cur-card-footer"
}, vr = /* @__PURE__ */ Object.assign({
name: "CurCard"
}, {
__name: "Card",
props: cr,
setup(e) {
return (t, r) => ($(), j("div", {
class: "cur-card",
style: He(t.width ? { width: t.width + "px" } : {})
}, [
E("div", {
class: "cur-card-img",
style: He(t.imgHeight ? { height: t.imgHeight + "px" } : {})
}, [
E("img", {
src: t.imgSrc,
alt: "img"
}, null, 8, ur)
], 4),
t.summary ? ($(), j("div", fr, ie(t.summary), 1)) : ($(), j("div", pr, [
I(t.$slots, "default")
])),
t.$slots.footer ? ($(), j("div", dr, [
I(t.$slots, "footer")
])) : z("", !0)
], 4));
}
}), mr = {
// 控制对话框是否可见
visible: {
type: Boolean,
default: !1
},
// 标题
title: {
type: String,
default: "提示"
},
// 宽度
width: {
type: String,
default: "50%"
},
// 距离顶部的距离
top: {
type: String,
default: "15vh"
}
}, gr = { class: "cur-dialog_wrapper" }, hr = { class: "cur-dialog_header" }, yr = { class: "cur-dialog_title" }, br = { class: "cur-dialog_body" }, wr = {
key: 0,
class: "cur-dialog_footer"
}, Or = /* @__PURE__ */ Object.assign({
name: "CurDialog"
}, {
__name: "Dialog",
props: mr,
emits: ["close"],
setup(e, { emit: t }) {
const r = t;
function n() {
r("close");
}
return (o, c) => {
const s = fe("Cur-Icon");
return $(), Le(kt, { name: "dialog-fade" }, {
default: Ee(() => [
Pt(E("div", gr, [
E("div", {
class: "cur-dialog",
style: He({ width: o.width, marginTop: o.top })
}, [
E("div", hr, [
I(o.$slots, "title", {}, () => [
E("span", yr, ie(o.title), 1)
]),
E("button", {
class: "cur-dialog_headerbtn",
onClick: n
}, [
F(s, { icon: "xmark" })
])
]),
E("div", br, [
I(o.$slots, "default")
]),
o.$slots.footer ? ($(), j("div", wr, [
I(o.$slots, "footer")
])) : z("", !0)
], 4)
], 512), [
[jt, o.visible]
])
]),
_: 3
});
};
}
}), $r = {
// 总页码数
total: {
type: Number,
default: 0
},
// 当前页码数
currentPage: {
type: Number,
default: 1
},
// 页码最大能够显示的数量
pagerCount: {
type: Number,
default: 10
},
type: String,
size: String
}, Cr = ["disabled"], kr = { key: 1 }, Pr = ["onClick"], jr = { key: 2 }, xr = ["disabled"], Sr = /* @__PURE__ */ Object.assign({
name: "CurPager"
}, {
__name: "Pager",
props: $r,
emits: ["current-change"],
setup(e, { emit: t }) {
const r = e, n = Ue(() => {
const a = [];
if (r.total <= r.pagerCount)
for (let u = 1; u <= r.total; u++)
a.push(u);
else if (r.currentPage <= 5)
for (let u = 1; u <= 5; u++)
a.push(u);
else if (r.currentPage >= r.total - 4)
for (let u = r.total - 4; u <= r.total; u++)
a.push(u);
else
for (let u = r.currentPage - 2; u <= r.currentPage + 2; u++)
a.push(u);
return a;
}), o = t, c = () => {
o("current-change", 1);
}, s = () => {
o("current-change", r.total);
}, l = () => {
r.currentPage !== 1 && o("current-change", r.currentPage - 1);
}, i = () => {
r.currentPage !== r.total && o("current-change", r.currentPage + 1);
}, f = (a) => {
o("current-change", a);
};
return (a, u) => {
const v = fe("Cur-Icon");
return $(), j("div", {
class: V(["cur-pager", {
[`cur-pager--${a.type}`]: a.type,
[`cur-pager--${a.size}`]: a.size
}])
}, [
E("a", {
class: V(a.currentPage === 1 ? "disabled" : ""),
onClick: te(c, ["prevent"])
}, "首页", 2),
E("a", {
class: V(a.currentPage === 1 ? "disabled" : ""),
disabled: a.currentPage === 1,
onClick: te(l, ["prevent"])
}, [
F(v, { icon: "angles-left" })
], 10, Cr),
a.total > a.pagerCount && a.currentPage > 5 ? ($(), j("a", {
key: 0,
onClick: u[0] || (u[0] = te((p) => f(1), ["prevent"]))
}, "1")) : z("", !0),
a.total > a.pagerCount && a.currentPage > 5 ? ($(), j("a", kr, [
F(v, {
icon: "ellipsis",
size: "sm"
})
])) : z("", !0),
($(!0), j(We, null, xt(n.value, (p) => ($(), j("a", {
key: p,
class: V(p === a.currentPage ? "active" : ""),
onClick: te((w) => f(p), ["prevent"])
}, ie(p), 11, Pr))), 128)),
a.total > a.pagerCount && a.currentPage < a.total - 4 ? ($(), j("a", jr, [
F(v, {
icon: "ellipsis",
size: "sm"
})
])) : z("", !0),
a.total > a.pagerCount && a.currentPage < a.total - 4 ? ($(), j("a", {
key: 3,
onClick: u[1] || (u[1] = te((p) => f(a.total), ["prevent"]))
}, ie(a.total), 1)) : z("", !0),
E("a", {
class: V(a.currentPage === a.total ? "disabled" : ""),
onClick: te(i, ["prevent"]),
disabled: a.currentPage === a.total
}, [
F(v, { icon: "angles-right" })
], 10, xr),
E("a", {
class: V(a.currentPage === a.total ? "disabled" : ""),
onClick: te(s, ["prevent"])
}, "尾页", 2)
], 2);
};
}
}), Er = {
modelValue: {
type: Array,
default: []
},
accordion: {
type: Boolean,
default: !1
}
}, Ar = {
name: {
type: String,
required: !0
},
title: {
type: String
},
disabled: {
type: Boolean,
default: !1
}
}, Et = Symbol("collapseContextKey"), Tr = { class: "cur-collapse" }, _r = /* @__PURE__ */ Object.assign({
name: "CurCollapse"
}, {
__name: "Collapse",
props: Er,
emits: ["change", "update:modelValue"],
setup(e, { emit: t }) {
const r = t, n = e, o = ae(n.modelValue);
return Zt(Et, {
activeNames: o,
handleItemClick: (s) => {
let l = [...o.value];
if (n.accordion)
l = [o.value[0] === s ? "" : s];
else {
const i = l.indexOf(s);
i > -1 ? l.splice(i, 1) : l.push(s);
}
o.value = l, r("update:modelValue", l), r("change", l);
}
}), (s, l) => ($(), j("div", Tr, [
I(s.$slots, "default")
]));
}
}), Br = ["id"], Dr = { class: "cur-collapse-item__wrapper" }, Rr = ["id"], Ir = /* @__PURE__ */ Object.assign({
name: "CurCollapseItem"
}, {
__name: "CollapseItem",
props: Ar,
setup(e) {
const t = er(Et), r = e, n = Ue(() => t.activeNames.value.includes(r.name)), o = () => {
r.disabled || t.handleItemClick(r.name);
}, c = {
beforeEnter(s) {
s.style.height = "0px", s.style.overflow = "hidden";
},
enter(s) {
s.style.height = s.scrollHeight + "px";
},
afterEnter(s) {
s.style.height = "", s.style.overflow = "";
},
beforeLeave(s) {
s.style.height = s.scrollHeight + "px", s.style.overflow = "hidden";
},
leave(s) {
s.style.height = "0px";
},
afterLeave(s) {
s.style.height = "", s.style.overflow = "";
}
};
return (s, l) => {
const i = fe("Cur-Icon");
return $(), j("div", {
class: V(["cur-collapse-item", {
"is-disabled": s.disabled
}])
}, [
E("div", {
class: V(["cur-collapse-item__header", {
"is-disabled": s.disabled,
// isActive 并非父组件传递过来的
// 而是回头我们会创建一个 computed 来计算,计算该面板是否处于活动状态
"is-active": n.value
}]),
id: `item-header-${s.name}`,
onClick: o
}, [
I(s.$slots, "title", {}, () => [
St(ie(s.title), 1)
]),
F(i, {
icon: "angle-right",
class: "header-angle"
})
], 10, Br),
F(kt, Me({ name: "slide" }, Ve(c)), {
default: Ee(() => [
Pt(E("div", Dr, [
E("div", {
class: "cur-collapse-item__content",
id: `item-content-${s.title}`
}, [
I(s.$slots, "default")
], 8, Rr)
], 512), [
[jt, n.value]
])
]),
_: 3
}, 16)
], 2);
};
}
});
var _ = "top", L = "bottom", H = "right", B = "left", Ye = "auto", we = [_, L, H, B], se = "start", ye = "end", Nr = "clippingParents", At = "viewport", ve = "popper", Lr = "reference", ft = /* @__PURE__ */ we.reduce(function(e, t) {
return e.concat([t + "-" + se, t + "-" + ye]);
}, []), Tt = /* @__PURE__ */ [].concat(we, [Ye]).reduce(function(e, t) {
return e.concat([t, t + "-" + se, t + "-" + ye]);
}, []), Hr = "beforeRead", Wr = "read", Mr = "afterRead", Vr = "beforeMain", zr = "main", Fr = "afterMain", qr = "beforeWrite", Xr = "write", Ur = "afterWrite", Yr = [Hr, Wr, Mr, Vr, zr, Fr, qr, Xr, Ur];
function X(e) {
return e ? (e.nodeName || "").toLowerCase() : null;
}
function R(e) {
if (e == null)
return window;
if (e.toString() !== "[object Window]") {
var t = e.ownerDocument;
return t && t.defaultView || window;
}
return e;
}
function ne(e) {
var t = R(e).Element;
return e instanceof t || e instanceof Element;
}
function N(e) {
var t = R(e).HTMLElement;
return e instanceof t || e instanceof HTMLElement;
}
function Ge(e) {
if (typeof ShadowRoot > "u")
return !1;
var t = R(e).ShadowRoot;
return e instanceof t || e instanceof ShadowRoot;
}
function Gr(e) {
var t = e.state;
Object.keys(t.elements).forEach(function(r) {
var n = t.styles[r] || {}, o = t.attributes[r] || {}, c = t.elements[r];
!N(c) || !X(c) || (Object.assign(c.style, n), Object.keys(o).forEach(function(s) {
var l = o[s];
l === !1 ? c.removeAttribute(s) : c.setAttribute(s, l === !0 ? "" : l);
}));
});
}
function Kr(e) {
var t = e.state, r = {
popper: {
position: t.options.strategy,
left: "0",
top: "0",
margin: "0"
},
arrow: {
position: "absolute"
},
reference: {}
};
return Object.assign(t.elements.popper.style, r.popper), t.styles = r, t.elements.arrow && Object.assign(t.elements.arrow.style, r.arrow), function() {
Object.keys(t.elements).forEach(function(n) {
var o = t.elements[n], c = t.attributes[n] || {}, s = Object.keys(t.styles.hasOwnProperty(n) ? t.styles[n] : r[n]), l = s.reduce(function(i, f) {
return i[f] = "", i;
}, {});
!N(o) || !X(o) || (Object.assign(o.style, l), Object.keys(c).forEach(function(i) {
o.removeAttribute(i);
}));
});
};
}
const Jr = {
name: "applyStyles",
enabled: !0,
phase: "write",
fn: Gr,
effect: Kr,
requires: ["computeStyles"]
};
function q(e) {
return e.split("-")[0];
}
var re = Math.max, Ae = Math.min, le = Math.round;
function Fe() {
var e = navigator.userAgentData;
return e != null && e.brands && Array.isArray(e.brands) ? e.brands.map(function(t) {
return t.brand + "/" + t.version;
}).join(" ") : navigator.userAgent;
}
function _t() {
return !/^((?!chrome|android).)*safari/i.test(Fe());
}
function ce(e, t, r) {
t === void 0 && (t = !1), r === void 0 && (r = !1);
var n = e.getBoundingClientRect(), o = 1, c = 1;
t && N(e) && (o = e.offsetWidth > 0 && le(n.width) / e.offsetWidth || 1, c = e.offsetHeight > 0 && le(n.height) / e.offsetHeight || 1);
var s = ne(e) ? R(e) : window, l = s.visualViewport, i = !_t() && r, f = (n.left + (i && l ? l.offsetLeft : 0)) / o, a = (n.top + (i && l ? l.offsetTop : 0)) / c, u = n.width / o, v = n.height / c;
return {
width: u,
height: v,
top: a,
right: f + u,
bottom: a + v,
left: f,
x: f,
y: a
};
}
function Ke(e) {
var t = ce(e), r = e.offsetWidth, n = e.offsetHeight;
return Math.abs(t.width - r) <= 1 && (r = t.width), Math.abs(t.height - n) <= 1 && (n = t.height), {
x: e.offsetLeft,
y: e.offsetTop,
width: r,
height: n
};
}
function Bt(e, t) {
var r = t.getRootNode && t.getRootNode();
if (e.contains(t))
return !0;
if (r && Ge(r)) {
var n = t;
do {
if (n && e.isSameNode(n))
return !0;
n = n.parentNode || n.host;
} while (n);
}
return !1;
}
function U(e) {
return R(e).getComputedStyle(e);
}
function Qr(e) {
return ["table", "td", "th"].indexOf(X(e)) >= 0;
}
function G(e) {
return ((ne(e) ? e.ownerDocument : (
// $FlowFixMe[prop-missing]
e.document
)) || window.document).documentElement;
}
function _e(e) {
return X(e) === "html" ? e : (
// this is a quicker (but less type safe) way to save quite some bytes from the bundle
// $FlowFixMe[incompatible-return]
// $FlowFixMe[prop-missing]
e.assignedSlot || // step into the shadow DOM of the parent of a slotted node
e.parentNode || // DOM Element detected
(Ge(e) ? e.host : null) || // ShadowRoot detected
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
G(e)
);
}
function pt(e) {
return !N(e) || // https://github.com/popperjs/popper-core/issues/837
U(e).position === "fixed" ? null : e.offsetParent;
}
function Zr(e) {
var t = /firefox/i.test(Fe()), r = /Trident/i.test(Fe());
if (r && N(e)) {
var n = U(e);
if (n.position === "fixed")
return null;
}
var o = _e(e);
for (Ge(o) && (o = o.host); N(o) && ["html", "body"].indexOf(X(o)) < 0; ) {
var c = U(o);
if (c.transform !== "none" || c.perspective !== "none" || c.contain === "paint" || ["transform", "perspective"].indexOf(c.willChange) !== -1 || t && c.willChange === "filter" || t && c.filter && c.filter !== "none")
return o;
o = o.parentNode;
}
return null;
}
function Oe(e) {
for (var t = R(e), r = pt(e); r && Qr(r) && U(r).position === "static"; )
r = pt(r);
return r && (X(r) === "html" || X(r) === "body" && U(r).position === "static") ? t : r || Zr(e) || t;
}
function Je(e) {
return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y";
}
function ge(e, t, r) {
return re(e, Ae(t, r));
}
function en(e, t, r) {
var n = ge(e, t, r);
return n > r ? r : n;
}
function Dt() {
return {
top: 0,
right: 0,
bottom: 0,
left: 0
};
}
function Rt(e) {
return Object.assign({}, Dt(), e);
}
function It(e, t) {
return t.reduce(function(r, n) {
return r[n] = e, r;
}, {});
}
var tn = function(t, r) {
return t = typeof t == "function" ? t(Object.assign({}, r.rects, {
placement: r.placement
})) : t, Rt(typeof t != "number" ? t : It(t, we));
};
function rn(e) {
var t, r = e.state, n = e.name, o = e.options, c = r.elements.arrow, s = r.modifiersData.popperOffsets, l = q(r.placement), i = Je(l), f = [B, H].indexOf(l) >= 0, a = f ? "height" : "width";
if (!(!c || !s)) {
var u = tn(o.padding, r), v = Ke(c), p = i === "y" ? _ : B, w = i === "y" ? L : H, g = r.rects.reference[a] + r.rects.reference[i] - s[i] - r.rects.popper[a], h = s[i] - r.rects.reference[i], y = Oe(c), C = y ? i === "y" ? y.clientHeight || 0 : y.clientWidth || 0 : 0, k = g / 2 - h / 2, m = u[p], b = C - v[a] - u[w], d = C / 2 - v[a] / 2 + k, O = ge(m, d, b), P = i;
r.modifiersData[n] = (t = {}, t[P] = O, t.centerOffset = O - d, t);
}
}
function nn(e) {
var t = e.state, r = e.options, n = r.element, o = n === void 0 ? "[data-popper-arrow]" : n;
o != null && (typeof o == "string" && (o = t.elements.popper.querySelector(o), !o) || Bt(t.elements.popper, o) && (t.elements.arrow = o));
}
const on = {
name: "arrow",
enabled: !0,
phase: "main",
fn: rn,
effect: nn,
requires: ["popperOffsets"],
requiresIfExists: ["preventOverflow"]
};
function ue(e) {
return e.split("-")[1];
}
var an = {
top: "auto",
right: "auto",
bottom: "auto",
left: "auto"
};
function sn(e, t) {
var r = e.x, n = e.y, o = t.devicePixelRatio || 1;
return {
x: le(r * o) / o || 0,
y: le(n * o) / o || 0
};
}
function dt(e) {
var t, r = e.popper, n = e.popperRect, o = e.placement, c = e.variation, s = e.offsets, l = e.position, i = e.gpuAcceleration, f = e.adaptive, a = e.roundOffsets, u = e.isFixed, v = s.x, p = v === void 0 ? 0 : v, w = s.y, g = w === void 0 ? 0 : w, h = typeof a == "function" ? a({
x: p,
y: g
}) : {
x: p,
y: g
};
p = h.x, g = h.y;
var y = s.hasOwnProperty("x"), C = s.hasOwnProperty("y"), k = B, m = _, b = window;
if (f) {
var d = Oe(r), O = "clientHeight", P = "clientWidth";
if (d === R(r) && (d = G(r), U(d).position !== "static" && l === "absolute" && (O = "scrollHeight", P = "scrollWidth")), d = d, o === _ || (o === B || o === H) && c === ye) {
m = L;
var x = u && d === b && b.visualViewport ? b.visualViewport.height : (
// $FlowFixMe[prop-missing]
d[O]
);
g -= x - n.height, g *= i ? 1 : -1;
}
if (o === B || (o === _ || o === L) && c === ye) {
k = H;
var S = u && d === b && b.visualViewport ? b.visualViewport.width : (
// $FlowFixMe[prop-missing]
d[P]
);
p -= S - n.width, p *= i ? 1 : -1;
}
}
var A = Object.assign({
position: l
}, f && an), W = a === !0 ? sn({
x: p,
y: g
}, R(r)) : {
x: p,
y: g
};
if (p = W.x, g = W.y, i) {
var T;
return Object.assign({}, A, (T = {}, T[m] = C ? "0" : "", T[k] = y ? "0" : "", T.transform = (b.devicePixelRatio || 1) <= 1 ? "translate(" + p + "px, " + g + "px)" : "translate3d(" + p + "px, " + g + "px, 0)", T));
}
return Object.assign({}, A, (t = {}, t[m] = C ? g + "px" : "", t[k] = y ? p + "px" : "", t.transform = "", t));
}
function ln(e) {
var t = e.state, r = e.options, n = r.gpuAcceleration, o = n === void 0 ? !0 : n, c = r.adaptive, s = c === void 0 ? !0 : c, l = r.roundOffsets, i = l === void 0 ? !0 : l, f = {
placement: q(t.placement),
variation: ue(t.placement),
popper: t.elements.popper,
popperRect: t.rects.popper,
gpuAcceleration: o,
isFixed: t.options.strategy === "fixed"
};
t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, dt(Object.assign({}, f, {
offsets: t.modifiersData.popperOffsets,
position: t.options.strategy,
adaptive: s,
roundOffsets: i
})))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, dt(Object.assign({}, f, {
offsets: t.modifiersData.arrow,
position: "absolute",
adaptive: !1,
roundOffsets: i
})))), t.attributes.popper = Object.assign({}, t.attributes.popper, {
"data-popper-placement": t.placement
});
}
const cn = {
name: "computeStyles",
enabled: !0,
phase: "beforeWrite",
fn: ln,
data: {}
};
var xe = {
passive: !0
};
function un(e) {
var t = e.state, r = e.instance, n = e.options, o = n.scroll, c = o === void 0 ? !0 : o, s = n.resize, l = s === void 0 ? !0 : s, i = R(t.elements.popper), f = [].concat(t.scrollParents.reference, t.scrollParents.popper);
return c && f.forEach(function(a) {
a.addEventListener("scroll", r.update, xe);
}), l && i.addEventListener("resize", r.update, xe), function() {
c && f.forEach(function(a) {
a.removeEventListener("scroll", r.update, xe);
}), l && i.removeEventListener("resize", r.update, xe);
};
}
const fn = {
name: "eventListeners",
enabled: !0,
phase: "write",
fn: function() {
},
effect: un,
data: {}
};
var pn = {
left: "right",
right: "left",
bottom: "top",
top: "bottom"
};
function Se(e) {
return e.replace(/left|right|bottom|top/g, function(t) {
return pn[t];
});
}
var dn = {
start: "end",
end: "start"
};
function vt(e) {
return e.replace(/start|end/g, function(t) {
return dn[t];
});
}
function Qe(e) {
var t = R(e), r = t.pageXOffset, n = t.pageYOffset;
return {
scrollLeft: r,
scrollTop: n
};
}
function Ze(e) {
return ce(G(e)).left + Qe(e).scrollLeft;
}
function vn(e, t) {
var r = R(e), n = G(e), o = r.visualViewport, c = n.clientWidth, s = n.clientHeight, l = 0, i = 0;
if (o) {
c = o.width, s = o.height;
var f = _t();
(f || !f && t === "fixed") && (l = o.offsetLeft, i = o.offsetTop);
}
return {
width: c,
height: s,
x: l + Ze(e),
y: i
};
}
function mn(e) {
var t, r = G(e), n = Qe(e), o = (t = e.ownerDocument) == null ? void 0 : t.body, c = re(r.scrollWidth, r.clientWidth, o ? o.scrollWidth : 0, o ? o.clientWidth : 0), s = re(r.scrollHeight, r.clientHeight, o ? o.scrollHeight : 0, o ? o.clientHeight : 0), l = -n.scrollLeft + Ze(e), i = -n.scrollTop;
return U(o || r).direction === "rtl" && (l += re(r.clientWidth, o ? o.clientWidth : 0) - c), {
width: c,
height: s,
x: l,
y: i
};
}
function et(e) {
var t = U(e), r = t.overflow, n = t.overflowX, o = t.overflowY;
return /auto|scroll|overlay|hidden/.test(r + o + n);
}
function Nt(e) {
return ["html", "body", "#document"].indexOf(X(e)) >= 0 ? e.ownerDocument.body : N(e) && et(e) ? e : Nt(_e(e));
}
function he(e, t) {
var r;
t === void 0 && (t = []);
var n = Nt(e), o = n === ((r = e.ownerDocument) == null ? void 0 : r.body), c = R(n), s = o ? [c].concat(c.visualViewport || [], et(n) ? n : []) : n, l = t.concat(s);
return o ? l : (
// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
l.concat(he(_e(s)))
);
}
function qe(e) {
return Object.assign({}, e, {
left: e.x,
top: e.y,
right: e.x + e.width,
bottom: e.y + e.height
});
}
function gn(e, t) {
var r = ce(e, !1, t === "fixed");
return r.top = r.top + e.clientTop, r.left = r.left + e.clientLeft, r.bottom = r.top + e.clientHeight, r.right = r.left + e.clientWidth, r.width = e.clientWidth, r.height = e.clientHeight, r.x = r.left, r.y = r.top, r;
}
function mt(e, t, r) {
return t === At ? qe(vn(e, r)) : ne(t) ? gn(t, r) : qe(mn(G(e)));
}
function hn(e) {
var t = he(_e(e)), r = ["absolute", "fixed"].indexOf(U(e).position) >= 0, n = r && N(e) ? Oe(e) : e;
return ne(n) ? t.filter(function(o) {
return ne(o) && Bt(o, n) && X(o) !== "body";
}) : [];
}
function yn(e, t, r, n) {
var o = t === "clippingParents" ? hn(e) : [].concat(t), c = [].concat(o, [r]), s = c[0], l = c.reduce(function(i, f) {
var a = mt(e, f, n);
return i.top = re(a.top, i.top), i.right = Ae(a.right, i.right), i.bottom = Ae(a.bottom, i.bottom), i.left = re(a.left, i.left), i;
}, mt(e, s, n));
return l.width = l.right - l.left, l.height = l.bottom - l.top, l.x = l.left, l.y = l.top, l;
}
function Lt(e) {
var t = e.reference, r = e.element, n = e.placement, o = n ? q(n) : null, c = n ? ue(n) : null, s = t.x + t.width / 2 - r.width / 2, l = t.y + t.height / 2 - r.height / 2, i;
switch (o) {
case _:
i = {
x: s,
y: t.y - r.height
};
break;
case L:
i = {
x: s,
y: t.y + t.height
};
break;
case H:
i = {
x: t.x + t.width,
y: l
};
break;
case B:
i = {
x: t.x - r.width,
y: l
};
break;
default:
i = {
x: t.x,
y: t.y
};
}
var f = o ? Je(o) : null;
if (f != null) {
var a = f === "y" ? "height" : "width";
switch (c) {
case se:
i[f] = i[f] - (t[a] / 2 - r[a] / 2);
break;
case ye:
i[f] = i[f] + (t[a] / 2 - r[a] / 2);
break;
}
}
return i;
}
function be(e, t) {
t === void 0 && (t = {});
var r = t, n = r.placement, o = n === void 0 ? e.placement : n, c = r.strategy, s = c === void 0 ? e.strategy : c, l = r.boundary, i = l === void 0 ? Nr : l, f = r.rootBoundary, a = f === void 0 ? At : f, u = r.elementContext, v = u === void 0 ? ve : u, p = r.altBoundary, w = p === void 0 ? !1 : p, g = r.padding, h = g === void 0 ? 0 : g, y = Rt(typeof h != "number" ? h : It(h, we)), C = v === ve ? Lr : ve, k = e.rects.popper, m = e.elements[w ? C : v], b = yn(ne(m) ? m : m.contextElement || G(e.elements.popper), i, a, s), d = ce(e.elements.reference), O = Lt({
reference: d,
element: k,
strategy: "absolute",
placement: o
}), P = qe(Object.assign({}, k, O)), x = v === ve ? P : d, S = {
top: b.top - x.top + y.top,
bottom: x.bottom - b.bottom + y.bottom,
left: b.left - x.left + y.left,
right: x.right - b.right + y.right
}, A = e.modifiersData.offset;
if (v === ve && A) {
var W = A[o];
Object.keys(S).forEach(function(T) {
var K = [H, L].indexOf(T) >= 0 ? 1 : -1, J = [_, L].indexOf(T) >= 0 ? "y" : "x";
S[T] += W[J] * K;
});
}
return S;
}
function bn(e, t) {
t === void 0 && (t = {});
var r = t, n = r.placement, o = r.boundary, c = r.rootBoundary, s = r.padding, l = r.flipVariations, i = r.allowedAutoPlacements, f = i === void 0 ? Tt : i, a = ue(n), u = a ? l ? ft : ft.filter(function(w) {
return ue(w) === a;
}) : we, v = u.filter(function(w) {
return f.indexOf(w) >= 0;
});
v.length === 0 && (v = u);
var p = v.reduce(function(w, g) {
return w[g] = be(e, {
placement: g,
boundary: o,
rootBoundary: c,
padding: s
})[q(g)], w;
}, {});
return Object.keys(p).sort(function(w, g) {
return p[w] - p[g];
});
}
function wn(e) {
if (q(e) === Ye)
return [];
var t = Se(e);
return [vt(e), t, vt(t)];
}
function On(e) {
var t = e.state, r = e.options, n = e.name;
if (!t.modifiersData[n]._skip) {
for (var o = r.mainAxis, c = o === void 0 ? !0 : o, s = r.altAxis, l = s === void 0 ? !0 : s, i = r.fallbackPlacements, f = r.padding, a = r.boundary, u = r.rootBoundary, v = r.altBoundary, p = r.flipVariations, w = p === void 0 ? !0 : p, g = r.allowedAutoPlacements, h = t.options.placement, y = q(h), C = y === h, k = i || (C || !w ? [Se(h)] : wn(h)), m = [h].concat(k).reduce(function(oe, Y) {
return oe.concat(q(Y) === Ye ? bn(t, {
placement: Y,
boundary: a,
rootBoundary: u,
padding: f,
flipVariations: w,
allowedAutoPlacements: g
}) : Y);
}, []), b = t.rects.reference, d = t.rects.popper, O = /* @__PURE__ */ new Map(), P = !0, x = m[0], S = 0; S < m.length; S++) {
var A = m[S], W = q(A), T = ue(A) === se, K = [_, L].indexOf(W) >= 0, J = K ? "width" : "height", D = be(t, {
placement: A,
boundary: a,
rootBoundary: u,
altBoundary: v,
padding: f
}), M = K ? T ? H : B : T ? L : _;
b[J] > d[J] && (M = Se(M));
var $e = Se(M), Q = [];
if (c && Q.push(D[W] <= 0), l && Q.push(D[M] <= 0, D[$e] <= 0), Q.every(function(oe) {
return oe;
})) {
x = A, P = !1;
break;
}
O.set(A, Q);
}
if (P)
for (var Ce = w ? 3 : 1, Be = function(Y) {
var de = m.find(function(Pe) {
var Z = O.get(Pe);
if (Z)
return Z.slice(0, Y).every(function(De) {
return De;
});
});
if (de)
return x = de, "break";
}, pe = Ce; pe > 0; pe--) {
var ke = Be(pe);
if (ke === "break")
break;
}
t.placement !== x && (t.modifiersData[n]._skip = !0, t.placement = x, t.reset = !0);
}
}
const $n = {
name: "flip",
enabled: !0,
phase: "main",
fn: On,
requiresIfExists: ["offset"],
data: {
_skip: !1
}
};
function gt(e, t, r) {
return r === void 0 && (r = {
x: 0,
y: 0
}), {
top: e.top - t.height - r.y,
right: e.right - t.width + r.x,
bottom: e.bottom - t.height + r.y,
left: e.left - t.width - r.x
};
}
function ht(e) {
return [_, H, L, B].some(function(t) {
return e[t] >= 0;
});
}
function Cn(e) {
var t = e.state, r = e.name, n = t.rects.reference, o = t.rects.popper, c = t.modifiersData.preventOverflow, s = be(t, {
elementContext: "reference"
}), l = be(t, {
altBoundary: !0
}), i = gt(s, n), f = gt(l, o, c), a = ht(i), u = ht(f);
t.modifiersData[r] = {
referenceClippingOffsets: i,
popperEscapeOffsets: f,
isReferenceHidden: a,
hasPopperEscaped: u
}, t.attributes.popper = Object.assign({}, t.attributes.popper, {
"data-popper-reference-hidden": a,
"data-popper-escaped": u
});
}
const kn = {
name: "hide",
enabled: !0,
phase: "main",
requiresIfExists: ["preventOverflow"],
fn: Cn
};
function Pn(e, t, r) {
var n = q(e), o = [B, _].indexOf(n) >= 0 ? -1 : 1, c = typeof r == "function" ? r(Object.assign({}, t, {
placement: e
})) : r, s = c[0], l = c[1];
return s = s || 0, l = (l || 0) * o, [B, H].indexOf(n) >= 0 ? {
x: l,
y: s
} : {
x: s,
y: l
};
}
function jn(e) {
var t = e.state, r = e.options, n = e.name, o = r.offset, c = o === void 0 ? [0, 0] : o, s = Tt.reduce(function(a, u) {
return a[u] = Pn(u, t.rects, c), a;
}, {}), l = s[t.placement], i = l.x, f = l.y;
t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += i, t.modifiersData.popperOffsets.y += f), t.modifiersData[n] = s;
}
const xn = {
name: "offset",
enabled: !0,
phase: "main",
requires: ["popperOffsets"],
fn: jn
};
function Sn(e) {
var t = e.state, r = e.name;
t.modifiersData[r] = Lt({
reference: t.rects.reference,
element: t.rects.popper,
strategy: "absolute",
placement: t.placement
});
}
const En = {
name: "popperOffsets",
enabled: !0,
phase: "read",
fn: Sn,
data: {}
};
function An(e) {
return e === "x" ? "y" : "x";
}
function Tn(e) {
var t = e.state, r = e.options, n = e.name, o = r.mainAxis, c = o === void 0 ? !0 : o, s = r.altAxis, l = s === void 0 ? !1 : s, i = r.boundary, f = r.rootBoundary, a = r.altBoundary, u = r.padding, v = r.tether, p = v === void 0 ? !0 : v, w = r.tetherOffset, g = w === void 0 ? 0 : w, h = be(t, {
boundary: i,
rootBoundary: f,
padding: u,
altBoundary: a
}), y = q(t.placement), C = ue(t.placement), k = !C, m = Je(y), b = An(m), d = t.modifiersData.popperOffsets, O = t.rects.reference, P = t.rects.popper, x = typeof g == "function" ? g(Object.assign({}, t.rects, {
placement: t.placement
})) : g, S = typeof x == "number" ? {
mainAxis: x,
altAxis: x
} : Object.assign({
mainAxis: 0,
altAxis: 0
}, x), A = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, W = {
x: 0,
y: 0
};
if (d) {
if (c) {
var T, K = m === "y" ? _ : B, J = m === "y" ? L : H, D = m === "y" ? "height" : "width", M = d[m], $e = M + h[K], Q = M - h[J], Ce = p ? -P[D] / 2 : 0, Be = C === se ? O[D] : P[D], pe = C === se ? -P[D] : -O[D], ke = t.elements.arrow, oe = p && ke ? Ke(ke) : {
width: 0,
height: 0
}, Y = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : Dt(), de = Y[K], Pe = Y[J], Z = ge(0, O[D], oe[D]), De = k ? O[D] / 2 - Ce - Z - de - S.mainAxis : Be - Z - de - S.mainAxis, Vt = k ? -O[D] / 2 + Ce + Z + Pe + S.mainAxis : pe + Z + Pe + S.mainAxis, Re = t.elements.arrow && Oe(t.elements.arrow), zt = Re ? m === "y" ? Re.clientTop || 0 : Re.clientLeft || 0 : 0, tt = (T = A == null ? void 0 : A[m]) != null ? T : 0, Ft = M + De - tt - zt, qt = M + Vt - tt, rt = ge(p ? Ae($e, Ft) : $e, M, p ? re(Q, qt) : Q);
d[m] = rt, W[m] = rt - M;
}
if (l) {
var nt, Xt = m === "x" ? _ : B, Ut = m === "x" ? L : H, ee = d[b], je = b === "y" ? "height" : "width", ot = ee + h[Xt], at = ee - h[Ut], Ie = [_, B].indexOf(y) !== -1, it = (nt = A == null ? void 0 : A[b]) != null ? nt : 0, st = Ie ? ot : ee - O[je] - P[je] - it + S.altAxis, lt = Ie ? ee + O[je] + P[je] - it - S.altAxis : at, ct = p && Ie ? en(st, ee, lt) : ge(p ? st : ot, ee, p ? lt : at);
d[b] = ct, W[b] = ct - ee;
}
t.modifiersData[n] = W;
}
}
const _n = {
name: "preventOverflow",
enabled: !0,
phase: "main",
fn: Tn,
requiresIfExists: ["offset"]
};
function Bn(e) {
return {
scrollLeft: e.scrollLeft,
scrollTop: e.scrollTop
};
}
function Dn(e) {
return e === R(e) || !N(e) ? Qe(e) : Bn(e);
}
function Rn(e) {
var t = e.getBoundingClientRect(), r = le(t.width) / e.offsetWidth || 1, n = le(t.height) / e.offsetHeight || 1;
return r !== 1 || n !== 1;
}
function In(e, t, r) {
r === void 0 && (r = !1);
var n = N(t), o = N(t) && Rn(t), c = G(t), s = ce(e, o, r), l = {
scrollLeft: 0,
scrollTop: 0
}, i = {
x: 0,
y: 0
};
return (n || !n && !r) && ((X(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
et(c)) && (l = Dn(t)), N(t) ? (i = ce(t, !0), i.x += t.clientLeft, i.y += t.clientTop) : c && (i.x = Ze(c))), {
x: s.left + l.scrollLeft - i.x,
y: s.top + l.scrollTop - i.y,
width: s.width,
height: s.height
};
}
function Nn(e) {
var t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), n = [];
e.forEach(function(c) {
t.set(c.name, c);
});
function o(c) {
r.add(c.name);
var s = [].concat(c.requires || [], c.requiresIfExists || []);
s.forEach(function(l) {
if (!r.has(l)) {
var i = t.get(l);
i && o(i);
}
}), n.push(c);
}
return e.forEach(function(c) {
r.has(c.name) || o(c);
}), n;
}
function Ln(e) {
var t = Nn(e);
return Yr.reduce(function(r, n) {
return r.concat(t.filter(function(o) {
return o.phase === n;
}));
}, []);
}
function Hn(e) {
var t;
return function() {
return t || (t = new Promise(function(r) {
Promise.resolve().then(function() {
t = void 0, r(e());
});
})), t;
};
}
function Wn(e) {
var t = e.reduce(function(r, n) {
var o = r[n.name];
return r[n.name] = o ? Object.assign({}, o, n, {
options: Object.assign({}, o.options, n.options),
data: Object.assign({}, o.data, n.data)
}) : n, r;
}, {});
return Object.keys(t).map(function(r) {
return t[r];
});
}
var yt = {
placement: "bottom",
modifiers: [],
strategy: "absolute"
};
function bt() {
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
t[r] = arguments[r];
return !t.some(function(n) {
return !(n && typeof n.getBoundingClientRect == "function");
});
}
function Mn(e) {
e === void 0 && (e = {});
var t = e, r = t.defaultModifiers, n = r === void 0 ? [] : r, o = t.defaultOptions, c = o === void 0 ? yt : o;
return function(l, i, f) {
f === void 0 && (f = c);
var a = {
placement: "bottom",
orderedModifiers: [],
options: Object.assign({}, yt, c),
modifiersData: {},
elements: {
reference: l,
popper: i
},
attributes: {},
styles: {}
}, u = [], v = !1, p = {
state: a,
setOptions: function(y) {
var C = typeof y == "function" ? y(a.options) : y;
g(), a.options = Object.assign({}, c, a.options, C), a.scrollParents = {
reference: ne(l) ? he(l) : l.contextElement ? he(l.contextElement) : [],
popper: he(i)
};
var k = Ln(Wn([].concat(n, a.options.modifiers)));
return a.orderedModifiers = k.filter(function(m) {
return m.enabled;
}), w(), p.update();
},
// Sync update – it will always be executed, even if not necessary. This
// is useful for low frequency updates where sync behavior simplifies the
// logic.
// For high frequency updates (e.g. `resize` and `scroll` events), always
// prefer the async Popper#update method
forceUpdate: function() {
if (!v) {
var y = a.elements, C = y.reference, k = y.popper;
if (bt(C, k)) {
a.rects = {
reference: In(C, Oe(k), a.options.strategy === "fixed"),
popper: Ke(k)
}, a.reset = !1, a.placement = a.options.placement, a.orderedModifiers.forEach(function(S) {
return a.modifiersData[S.name] = Object.assign({}, S.data);
});
for (var m = 0; m < a.orderedModifiers.length; m++) {
if (a.reset === !0) {
a.reset = !1, m = -1;
continue;
}
var b = a.orderedModifiers[m], d = b.fn, O = b.options, P = O === void 0 ? {} : O, x = b.name;
typeof d == "function" && (a = d({
state: a,
options: P,
name: x,
instance: p
}) || a);
}
}
}
},
// Async and optimistically optimized update – it will not be executed if
// not necessary (debounced to run at most once-per-tick)
update: Hn(function() {
return new Promise(function(h) {
p.forceUpdate(), h(a);
});
}),
destroy: function() {
g(), v = !0;
}
};
if (!bt(l, i))
return p;
p.setOptions(f).then(function(h) {
!v && f.onFirstUpdate && f.onFirstUpdate(h);
});
function w() {
a.orderedModifiers.forEach(function(h) {
var y = h.name, C = h.options, k = C === void 0 ? {} : C, m = h.effect;
if (typeof m == "function") {
var b = m({
state: a,
name: y,
instance: p,
options: k
}), d = function() {
};
u.push(b || d);
}
});
}
function g() {
u.forEach(function(h) {
return h();
}), u = [];
}
return p;
};
}
var Vn = [fn, En, cn, Jr, xn, $n, _n, on, kn], zn = /* @__PURE__ */ Mn({
defaultModifiers: Vn
});
const Ht = {
content: {
type: String
},
placement: {
type: String,
default: "left"
},
// 触发方式
trigger: {
type: String,
default: "hover"
},
// 手动触发
manual: {
type: Boolean,
default: !1
},
openDelay: {
type: Number,
default: 100
},
closeDelay: {
type: Number,
default: 100
}
};
var Fn = typeof global == "object" && global && global.Object === Object && global, qn = typeof self == "object" && self && self.Object === Object && self, Wt = Fn || qn || Function("return this")(), Te = Wt.Symbol, Mt = Object.prototype, Xn = Mt.hasOwnProperty, Un = Mt.toString, me = Te ? Te.toStringTag : void 0;
function Yn(e) {
var t = Xn.call(e, me), r = e[me];
try {
e[me] = void 0;
var n = !0;
} catch {
}
var o = Un.call(e);
return n && (t ? e[me] = r : delete e[me]), o;
}
var Gn = Object.prototype, Kn = Gn.toString;
function Jn(e) {
return Kn.call(e);
}
var Qn = "[object Null]", Zn = "[object Undefined]", wt = Te ? Te.toStringTag : void 0;
function eo(e) {
return e == null ? e === void 0 ? Zn : Qn : wt && wt in Object(e) ? Yn(e) : Jn(e);
}
function to(e) {
return e != null && typeof e == "object";
}
var ro = "[object Symbol]";
function no(e) {
return typeof e == "symbol" || to(e) && eo(e) == ro;
}
var oo = /\s/;
function ao(e) {
for (var t = e.length; t-- && oo.test(e.charAt(t)); )
;
return t;
}
var io = /^\s+/;
function so(e) {
return e && e.slice(0, ao(e) + 1).replace(io, "");
}
function Xe(e) {
var t = typeof e;
return e != null && (t == "object" || t == "function");
}
var Ot = NaN, lo = /^[-+]0x[0-9a-f]+$/i, co = /^0b[01]+$/i, uo = /^0o[0-7]+$/i, fo = parseInt;
function $t(e) {
if (typeof e == "number")
return e;
if (no(e))
return Ot;
if (Xe(e)) {
var t = typeof e.valueOf == "function" ? e.valueOf() : e;
e = Xe(t) ? t + "" : t;
}
if (typeof e != "string")
return e === 0 ? e : +e;
e = so(e);
var r = co.test(e);
return r || uo.test(e) ? fo(e.slice(2), r ? 2 : 8) : lo.test(e) ? Ot : +e;
}
var Ne = function() {
return Wt.Date.now();
}, po = "Expected a function", vo = Math.max, mo = Math.min;
function Ct(e, t, r) {
var n, o, c, s, l, i, f = 0, a = !1, u = !1, v = !0;
if (typeof e != "function")
throw new TypeError(po);
t = $t(t) || 0, Xe(r) && (a = !!r.leading, u = "maxWait" in r, c = u ? vo($t(r.maxWait) || 0, t) : c, v = "trailing" in r ? !!r.trailing : v);
function p(d) {
var O = n, P = o;
return n = o = void 0, f = d, s = e.apply(P, O), s;
}
function w(d) {
return f = d, l = setTimeout(y, t), a ? p(d) : s;
}
function g(d) {
var O = d - i, P = d - f, x = t - O;
return u ? mo(x, c - P) : x;
}
function h(d) {
var O = d - i, P = d - f;
return i === void 0 || O >= t || O < 0 || u && P >= c;
}
function y() {
var d = Ne();
if (h(d))
return C(d);
l = setTimeout(y, g(d));
}
function C(d) {
return l = void 0, v && n ? p(d) : (n = o = void 0, s);
}
function k() {
l !== void 0 && clearTimeout(l), f = 0, n = i = o = l = void 0;
}
function m() {
return l === void 0 ? s : C(Ne());
}
function b() {
var d = Ne(), O = h(d);
if (n = arguments, o = this, i = d, O) {
if (l === void 0)
return w(i);
if (u)
return clearTimeout(l), l = setTimeout(y, t), p(i);
}
return l === void 0 && (l = setTimeout(y, t)), s;
}
return b.cancel = k, b.flush = m, b;
}
const go = /* @__PURE__ */ E("div", {
id: "arrow",
"data-popper-arrow": ""
}, null, -1), ho = /* @__PURE__ */ Object.assign({
name: "CurTooltip"
}, {
__name: "Tooltip",
props: Ht,
emits: ["visible-change"],
setup(e, { expose: t, emit: r }) {
const n = e, o = ae(null), c = ae(null), s = r;
let l = null;
const i = ae(!1);
let f = ut({}), a = ut({});
const u = Ue(() => ({
placement: n.placement,
modifiers: [
{
name: "offset",
options: {
offset: [0, 6]
}
}
]
})), v = Ct(() => {
i.value = !0, s("visible-change", !0);
}, n.openDelay), p = Ct(() => {
i.value = !1, s("visible-change", !1);
}, n.closeDelay), w = () => {
p.cancel(), v();
}, g = () => {
v.cancel(), p();
};
tr(
i,
(y) => {
y && (o.value && c.value ? l = zn(o.value, c.value, u.value) : l == null || l.destroy());
},
{ flush: "post" }
);
const h = () => {
n.trigger === "hover" ? (f.mouseenter = w, a.mouseleave = g) : n.trigger === "click" && (f.click = () => i.value ? g() : w());
};
return n.manual || h(), t({
show: w,
hide: g
}), (y, C) => ($(), j("div", Me({ class: "cur-tooltip" }, Ve(ze(a), !0)), [
E("div", Me({
class: "cur-tooltip__trigger",
ref_key: "triggerRef",
ref: o
}, Ve(ze(f), !0)), [
I(y.$slots, "default")
], 16),
i.value ? ($(), j("div", {
key: 0,
class: "cur-tooltip__popper",
ref_key: "popperRef",
ref: c
}, [
I(y.$slots, "content", {}, () => [
St(ie(y.content), 1)
]),
go
], 512)) : z("", !0)
], 16));
}
}), yo = {
...Ht,
// 下拉列表数组
menuOptions: {
type: Array,
required: !0
},
hideAfterClick: {
type: Boolean,
default: !1
}
}, bo = rr({
props: {
vNode: {
type: [String, Object],
required: !0
}
},
setup(e) {
return () => e.vNode;
}
}), wo = (e, t) => {
const r = e.__vccOpts || e;
for (const [n, o] of t)
r[n] = o;
return r;
}, Oo = { class: "cur-dropdown" }, $o = { class: "cur-dropdown__menu" }, Co = {
key: 0,
class: "divided-placeholder"
}, ko = ["id", "onClick"], Po = /* @__PURE__ */ Object.assign({
name: "CurDropdown"
}, {
__name: "Dropdown",
props: yo,
emits: ["select", "visible-change"],
setup(e, { expose: t, emit: r }) {
const n = r, o = ae(null), c = e, s = (i) => {
i.disabled || (n("select", i), c.hideAfterClick && o.value.hide());
}, l = (i) => {
n("visible-change", i);
};
return t({
show: () => {
o.value.show();
},
hide: () => {
o.value.hide();
}
}), (i, f) => {
const a = fe("Cur-Tooltip");
return $(), j("div", Oo, [
F(a, {
trigger: i.trigger,
placement: i.placement,
"open-delay": i.openDelay,
"close-delay": i.closeDelay,
manual: i.manual,
onVisibleChange: l,
ref_key: "tooltipRef",
ref: o
}, {
content: Ee(() => [
E("ul", $o, [
($(!0), j(We, null, xt(i.menuOptions, (u) => ($(), j(We, {
key: u.key
}, [
u.divided ? ($(), j("li", Co)) : z("", !0),
E("li", {
class: V(["cur-dropdown__item", {
"is-disabled": u.disabled
}]),
id: `dropdown-item-${u.key}`,
onClick: (v) => s(u)
}, [
F(ze(bo), {
"v-node": u.label
}, null, 8, ["v-node"])
], 10, ko)
], 64))), 128))
])
]),
default: Ee(() => [
I(i.$slots, "default", {}, void 0, !0)
]),
_: 3
}, 8, ["trigger", "placement", "open-delay", "close-delay", "manual"])
]);
};
}
}), jo = /* @__PURE__ */ wo(Po, [["__scopeId", "data-v-d4197866"]]);
Yt.add(Kt);
const xo = [or, lr, vr, Or, Sr, _r, Ir, ho, jo], So = (e) => {
xo.forEach((t) => {
e.component(t.name, t);
}), e.component("font-awesome-icon", Gt);
}, Bo = {
install: So
};
export {
Bo as default
};