@cyberpunk-vue/components 1.9.23 → 1.9.25
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/dialog/index.d.ts +61 -0
- package/dist/dialog/src/dialog.d.ts +32 -0
- package/dist/dialog/src/dialog.vue.d.ts +37 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +316 -221
- package/dist/menu/index.d.ts +15 -0
- package/dist/menu/src/menu.d.ts +14 -0
- package/dist/menu/src/menu.vue.d.ts +9 -0
- package/dist/menu-nav/index.d.ts +9 -0
- package/dist/menu-nav/src/menu-nav.d.ts +9 -1
- package/dist/menu-nav/src/menu-nav.vue.d.ts +9 -0
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createStaticVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, getCurrentInstance as f, h as p, inject as m, isVNode as h, mergeProps as g, nextTick as _, normalizeClass as v, normalizeStyle as y, onBeforeUnmount as b, onMounted as x, openBlock as S, provide as C, reactive as w, ref as T, render as E, renderList as D, renderSlot as O, resolveComponent as k, resolveDynamicComponent as A, toDisplayString as j, toRef as M, unref as N, useAttrs as P, useSlots as F, vModelText as I, vShow as L, watch as R, watchEffect as z, withCtx as B, withDirectives as V, withKeys as H, withModifiers as U } from "vue";
|
|
2
2
|
import { isPresetSize as W, normalizeDuration as G, normalizeSize as K, parseSizeNumber as q, useImageSrc as J, useNamespace as Y } from "@cyberpunk-vue/hooks";
|
|
3
|
-
import { COMPONENT_PREFIX as X, CSS_NAMESPACE as Z, DEFAULTS_KEY as
|
|
3
|
+
import { COMPONENT_PREFIX as X, CSS_NAMESPACE as Z, DEFAULTS_KEY as Q, DESCRIPTIONS_CONTEXT_KEY as ee, DIALOG_CONTEXT_KEY as te, TABLE_CONTEXT_KEY as ne, THEME_KEY as re } from "@cyberpunk-vue/constants";
|
|
4
4
|
//#region utils/install.ts
|
|
5
5
|
function $(e) {
|
|
6
6
|
return e.install = (t) => {
|
|
@@ -426,7 +426,7 @@ var ae = {
|
|
|
426
426
|
props: we,
|
|
427
427
|
setup(e) {
|
|
428
428
|
let t = e;
|
|
429
|
-
return C(
|
|
429
|
+
return C(Q, t.defaults), C(re, M(t, "theme")), z(() => {
|
|
430
430
|
typeof document < "u" && document.documentElement.setAttribute("data-theme", t.theme);
|
|
431
431
|
}), (e, t) => O(e.$slots, "default");
|
|
432
432
|
}
|
|
@@ -1082,18 +1082,18 @@ var ae = {
|
|
|
1082
1082
|
let t = U(e.clientX, e.clientY);
|
|
1083
1083
|
q(t), G(t, !0);
|
|
1084
1084
|
}, X = (e, t) => {
|
|
1085
|
-
f.value || (e.preventDefault(), e.stopPropagation(), _.value = t, g.value = !0, w.value = A.value[0], E.value = A.value[1], t === "start" ? x.value = !0 : C.value = !0, document.addEventListener("mousemove", Z), document.addEventListener("mouseup",
|
|
1085
|
+
f.value || (e.preventDefault(), e.stopPropagation(), _.value = t, g.value = !0, w.value = A.value[0], E.value = A.value[1], t === "start" ? x.value = !0 : C.value = !0, document.addEventListener("mousemove", Z), document.addEventListener("mouseup", Q));
|
|
1086
1086
|
}, Z = (e) => {
|
|
1087
1087
|
if (!g.value || f.value) return;
|
|
1088
1088
|
let t = U(e.clientX, e.clientY);
|
|
1089
1089
|
c.range ? _.value === "start" ? w.value = Math.min(t, E.value ?? A.value[1]) : E.value = Math.max(t, w.value ?? A.value[0]) : E.value = t, G(t);
|
|
1090
|
-
},
|
|
1090
|
+
}, Q = () => {
|
|
1091
1091
|
if (g.value) {
|
|
1092
1092
|
let e = w.value ?? A.value[0], t = E.value ?? A.value[1], n = c.range ? [e, t] : t;
|
|
1093
1093
|
l("update:modelValue", n), l("input", n), l("change", n), g.value = !1, _.value = null, x.value = !1, C.value = !1, w.value = null, E.value = null;
|
|
1094
1094
|
}
|
|
1095
|
-
document.removeEventListener("mousemove", Z), document.removeEventListener("mouseup",
|
|
1096
|
-
},
|
|
1095
|
+
document.removeEventListener("mousemove", Z), document.removeEventListener("mouseup", Q);
|
|
1096
|
+
}, ee = (e, t) => {
|
|
1097
1097
|
if (f.value) return;
|
|
1098
1098
|
let n = 0;
|
|
1099
1099
|
switch (e.key) {
|
|
@@ -1114,13 +1114,13 @@ var ae = {
|
|
|
1114
1114
|
default: return;
|
|
1115
1115
|
}
|
|
1116
1116
|
e.preventDefault(), _.value = t, G((t === "start" ? A.value[0] : A.value[1]) + n, !0);
|
|
1117
|
-
},
|
|
1117
|
+
}, te = (e) => {
|
|
1118
1118
|
!c.showTooltip || f.value || (e === "start" ? x.value = !0 : C.value = !0);
|
|
1119
|
-
},
|
|
1119
|
+
}, ne = (e) => {
|
|
1120
1120
|
g.value || (e === "start" ? x.value = !1 : C.value = !1);
|
|
1121
1121
|
};
|
|
1122
1122
|
return b(() => {
|
|
1123
|
-
document.removeEventListener("mousemove", Z), document.removeEventListener("mouseup",
|
|
1123
|
+
document.removeEventListener("mousemove", Z), document.removeEventListener("mouseup", Q);
|
|
1124
1124
|
}), n({ sliderRef: h }), (t, n) => (S(), o("div", {
|
|
1125
1125
|
ref_key: "sliderRef",
|
|
1126
1126
|
ref: h,
|
|
@@ -1153,9 +1153,9 @@ var ae = {
|
|
|
1153
1153
|
style: y(L.value),
|
|
1154
1154
|
tabindex: "0",
|
|
1155
1155
|
onMousedown: n[0] ||= (e) => X(e, "start"),
|
|
1156
|
-
onMouseenter: n[1] ||= (e) =>
|
|
1157
|
-
onMouseleave: n[2] ||= (e) =>
|
|
1158
|
-
onKeydown: n[3] ||= (e) =>
|
|
1156
|
+
onMouseenter: n[1] ||= (e) => te("start"),
|
|
1157
|
+
onMouseleave: n[2] ||= (e) => ne("start"),
|
|
1158
|
+
onKeydown: n[3] ||= (e) => ee(e, "start")
|
|
1159
1159
|
}, [t.showTooltip && x.value ? (S(), o("div", {
|
|
1160
1160
|
key: 0,
|
|
1161
1161
|
class: v(N(u).e("tooltip"))
|
|
@@ -1165,9 +1165,9 @@ var ae = {
|
|
|
1165
1165
|
style: y(R.value),
|
|
1166
1166
|
tabindex: "0",
|
|
1167
1167
|
onMousedown: n[4] ||= (e) => X(e, "end"),
|
|
1168
|
-
onMouseenter: n[5] ||= (e) =>
|
|
1169
|
-
onMouseleave: n[6] ||= (e) =>
|
|
1170
|
-
onKeydown: n[7] ||= (e) =>
|
|
1168
|
+
onMouseenter: n[5] ||= (e) => te("end"),
|
|
1169
|
+
onMouseleave: n[6] ||= (e) => ne("end"),
|
|
1170
|
+
onKeydown: n[7] ||= (e) => ee(e, "end")
|
|
1171
1171
|
}, [t.showTooltip && C.value ? (S(), o("div", {
|
|
1172
1172
|
key: 0,
|
|
1173
1173
|
class: v(N(u).e("tooltip"))
|
|
@@ -1889,19 +1889,19 @@ var ae = {
|
|
|
1889
1889
|
f.is("half-collapsed", D.value && i.halfCollapse),
|
|
1890
1890
|
f.is("loading", i.loading),
|
|
1891
1891
|
f.is("disabled", i.disabled)
|
|
1892
|
-
]), X = r(() => [f.e("container"), i.backgroundClass]), Z = r(() => i.color ? i.color : i.type && i.type !== "default" ? `var(--cp-color-${i.type})` : null),
|
|
1892
|
+
]), X = r(() => [f.e("container"), i.backgroundClass]), Z = r(() => i.color ? i.color : i.type && i.type !== "default" ? `var(--cp-color-${i.type})` : null), Q = r(() => i.color ? `color-mix(in srgb, ${i.color} 30%, transparent)` : i.type && i.type !== "default" ? `var(--cp-color-${i.type}-light)` : null), ee = r(() => {
|
|
1893
1893
|
let e = {};
|
|
1894
|
-
Z.value && (e["--cp-card-color"] = Z.value),
|
|
1894
|
+
Z.value && (e["--cp-card-color"] = Z.value), Q.value && (e["--cp-card-color-light"] = Q.value), i.bgColor && (e["--cp-card-bg"] = i.bgColor), i.borderColor && (e["--cp-card-border-color"] = i.borderColor), i.dividerColor && (e["--cp-card-divider-color"] = i.dividerColor), i.headerDividerColor && (e["--cp-card-header-divider-color"] = i.headerDividerColor), i.footerDividerColor && (e["--cp-card-footer-divider-color"] = i.footerDividerColor), i.shadowColor ? e["--cp-card-shadow-color"] = i.shadowColor : Z.value && (e["--cp-card-shadow-color"] = `color-mix(in srgb, ${Z.value} 40%, black)`);
|
|
1895
1895
|
let t = G(i.dimmedDuration);
|
|
1896
1896
|
if (t && (e["--cp-card-dimmed-duration"] = t), i.halfCollapse) {
|
|
1897
1897
|
let t = i.peekHeight;
|
|
1898
1898
|
e["--cp-card-peek-height"] = typeof t == "number" ? `${t}px` : t, P.value !== null && (e["--cp-card-expanded-height"] = `${P.value}px`);
|
|
1899
1899
|
}
|
|
1900
1900
|
return e;
|
|
1901
|
-
}),
|
|
1901
|
+
}), te = r(() => {
|
|
1902
1902
|
let e = typeof i.bodyStyle == "string" ? {} : { ...i.bodyStyle };
|
|
1903
1903
|
return i.bodyPadding && (e.padding = i.bodyPadding), e;
|
|
1904
|
-
}),
|
|
1904
|
+
}), ne = r(() => !!(i.title || d.header || d.title || d.extra)), re = r(() => !D.value || ne.value), $ = r(() => !!d.footer), ie = r(() => !!d.overlay), ae = r(() => [
|
|
1905
1905
|
f.e("header"),
|
|
1906
1906
|
f.is("bordered", i.headerBorder),
|
|
1907
1907
|
i.headerClass
|
|
@@ -1919,7 +1919,7 @@ var ae = {
|
|
|
1919
1919
|
})), me = r(() => [f.e("loading-overlay"), i.loadingClass]);
|
|
1920
1920
|
return (e, t) => V((S(), o("div", {
|
|
1921
1921
|
class: v(J.value),
|
|
1922
|
-
style: y(
|
|
1922
|
+
style: y(ee.value)
|
|
1923
1923
|
}, [s("div", {
|
|
1924
1924
|
class: v(X.value),
|
|
1925
1925
|
style: y(e.backgroundStyle)
|
|
@@ -1929,7 +1929,7 @@ var ae = {
|
|
|
1929
1929
|
class: v(N(f).e("collapse-transition")),
|
|
1930
1930
|
onTransitionend: A
|
|
1931
1931
|
}, [s("div", { class: v(N(f).e("collapse-inner")) }, [s("div", { class: v(N(f).e("cover")) }, [O(e.$slots, "cover")], 2)], 2)], 34)) : a("", !0),
|
|
1932
|
-
|
|
1932
|
+
ne.value ? (S(), o("div", {
|
|
1933
1933
|
key: 1,
|
|
1934
1934
|
class: v(ae.value),
|
|
1935
1935
|
style: y(e.headerStyle)
|
|
@@ -1946,7 +1946,7 @@ var ae = {
|
|
|
1946
1946
|
class: v(N(f).e("collapse-inner"))
|
|
1947
1947
|
}, [s("div", {
|
|
1948
1948
|
class: v([N(f).e("body"), e.bodyClass]),
|
|
1949
|
-
style: y(
|
|
1949
|
+
style: y(te.value)
|
|
1950
1950
|
}, [O(e.$slots, "default")], 6), $.value ? (S(), o("div", {
|
|
1951
1951
|
key: 0,
|
|
1952
1952
|
class: v(oe.value)
|
|
@@ -2491,13 +2491,13 @@ var ae = {
|
|
|
2491
2491
|
C.value = Math.max(C.value - jt, kt);
|
|
2492
2492
|
}, Z = () => {
|
|
2493
2493
|
w.value -= 90;
|
|
2494
|
-
},
|
|
2494
|
+
}, Q = () => {
|
|
2495
2495
|
w.value += 90;
|
|
2496
|
-
},
|
|
2496
|
+
}, ee = () => {
|
|
2497
2497
|
z.value || (f.infinite ? g.value = (g.value - 1 + f.urlList.length) % f.urlList.length : g.value > 0 && g.value--, q(), p("switch", g.value));
|
|
2498
|
-
},
|
|
2498
|
+
}, te = () => {
|
|
2499
2499
|
z.value || (f.infinite ? g.value = (g.value + 1) % f.urlList.length : g.value < f.urlList.length - 1 && g.value++, q(), p("switch", g.value));
|
|
2500
|
-
},
|
|
2500
|
+
}, ne = () => {
|
|
2501
2501
|
h.value = !1, p("update:modelValue", !1), p("close");
|
|
2502
2502
|
}, re = () => {
|
|
2503
2503
|
E.value = !1;
|
|
@@ -2525,13 +2525,13 @@ var ae = {
|
|
|
2525
2525
|
}, ce = (e) => {
|
|
2526
2526
|
if (h.value) switch (e.key) {
|
|
2527
2527
|
case "Escape":
|
|
2528
|
-
|
|
2528
|
+
ne();
|
|
2529
2529
|
break;
|
|
2530
2530
|
case "ArrowLeft":
|
|
2531
|
-
|
|
2531
|
+
ee();
|
|
2532
2532
|
break;
|
|
2533
2533
|
case "ArrowRight":
|
|
2534
|
-
|
|
2534
|
+
te();
|
|
2535
2535
|
break;
|
|
2536
2536
|
case "ArrowUp":
|
|
2537
2537
|
case "+":
|
|
@@ -2546,7 +2546,7 @@ var ae = {
|
|
|
2546
2546
|
}, le = (e) => {
|
|
2547
2547
|
e.preventDefault(), e.deltaY < 0 ? J() : X();
|
|
2548
2548
|
}, ue = (e) => {
|
|
2549
|
-
e.target === e.currentTarget &&
|
|
2549
|
+
e.target === e.currentTarget && ne();
|
|
2550
2550
|
};
|
|
2551
2551
|
return R(() => f.modelValue, (e) => {
|
|
2552
2552
|
h.value = e, e ? (g.value = f.initialIndex, q(), E.value = !0, _(() => {
|
|
@@ -2559,13 +2559,13 @@ var ae = {
|
|
|
2559
2559
|
}), b(() => {
|
|
2560
2560
|
document.removeEventListener("keydown", ce), document.removeEventListener("mousemove", ae), document.removeEventListener("mouseup", oe);
|
|
2561
2561
|
}), l({
|
|
2562
|
-
close:
|
|
2563
|
-
prev:
|
|
2564
|
-
next:
|
|
2562
|
+
close: ne,
|
|
2563
|
+
prev: ee,
|
|
2564
|
+
next: te,
|
|
2565
2565
|
zoomIn: J,
|
|
2566
2566
|
zoomOut: X,
|
|
2567
2567
|
rotateLeft: Z,
|
|
2568
|
-
rotateRight:
|
|
2568
|
+
rotateRight: Q,
|
|
2569
2569
|
resetTransform: q
|
|
2570
2570
|
}), (r, c) => (S(), i(t, {
|
|
2571
2571
|
to: r.teleportTo,
|
|
@@ -2587,7 +2587,7 @@ var ae = {
|
|
|
2587
2587
|
type: f.type,
|
|
2588
2588
|
color: f.color,
|
|
2589
2589
|
title: "关闭预览 (ESC)",
|
|
2590
|
-
onClick:
|
|
2590
|
+
onClick: ne
|
|
2591
2591
|
}, {
|
|
2592
2592
|
default: B(() => [...c[2] ||= [s("svg", {
|
|
2593
2593
|
viewBox: "0 0 24 24",
|
|
@@ -2614,7 +2614,7 @@ var ae = {
|
|
|
2614
2614
|
color: f.color,
|
|
2615
2615
|
title: "上一张 (←)",
|
|
2616
2616
|
disabled: !H.value,
|
|
2617
|
-
onClick: U(
|
|
2617
|
+
onClick: U(ee, ["stop"])
|
|
2618
2618
|
}, {
|
|
2619
2619
|
default: B(() => [...c[3] ||= [s("svg", {
|
|
2620
2620
|
viewBox: "0 0 24 24",
|
|
@@ -2642,7 +2642,7 @@ var ae = {
|
|
|
2642
2642
|
color: f.color,
|
|
2643
2643
|
title: "下一张 (→)",
|
|
2644
2644
|
disabled: !W.value,
|
|
2645
|
-
onClick: U(
|
|
2645
|
+
onClick: U(te, ["stop"])
|
|
2646
2646
|
}, {
|
|
2647
2647
|
default: B(() => [...c[4] ||= [s("svg", {
|
|
2648
2648
|
viewBox: "0 0 24 24",
|
|
@@ -2765,7 +2765,7 @@ var ae = {
|
|
|
2765
2765
|
type: f.type,
|
|
2766
2766
|
color: f.color,
|
|
2767
2767
|
title: "向右旋转",
|
|
2768
|
-
onClick:
|
|
2768
|
+
onClick: Q
|
|
2769
2769
|
}, {
|
|
2770
2770
|
default: B(() => [...c[8] ||= [s("svg", {
|
|
2771
2771
|
viewBox: "0 0 24 24",
|
|
@@ -3401,7 +3401,7 @@ var ae = {
|
|
|
3401
3401
|
width: e === "auto" ? void 0 : e,
|
|
3402
3402
|
maxWidth: t
|
|
3403
3403
|
};
|
|
3404
|
-
}),
|
|
3404
|
+
}), Q = r(() => [
|
|
3405
3405
|
h.e("content"),
|
|
3406
3406
|
`${h.e("content")}--${H.value.split("-")[0]}`,
|
|
3407
3407
|
`${h.e("content")}--${p.variant}`,
|
|
@@ -3412,16 +3412,16 @@ var ae = {
|
|
|
3412
3412
|
h.is("has-arrow", p.showArrow),
|
|
3413
3413
|
h.is("flipped", p.flipArrow),
|
|
3414
3414
|
h.is("no-transition", p.transition === "none")
|
|
3415
|
-
]),
|
|
3415
|
+
]), ee = {
|
|
3416
3416
|
top: "bottom",
|
|
3417
3417
|
bottom: "top",
|
|
3418
3418
|
left: "right",
|
|
3419
3419
|
right: "left"
|
|
3420
|
-
},
|
|
3420
|
+
}, te = r(() => {
|
|
3421
3421
|
if (p.transition === "none") return "";
|
|
3422
3422
|
let e = H.value.split("-")[0];
|
|
3423
|
-
return p.transition === "slide" ? `${h.namespace}-popover-slide-${e}` : p.transition === "slide-reverse" ? `${h.namespace}-popover-slide-${
|
|
3424
|
-
}),
|
|
3423
|
+
return p.transition === "slide" ? `${h.namespace}-popover-slide-${e}` : p.transition === "slide-reverse" ? `${h.namespace}-popover-slide-${ee[e] ?? e}` : `${h.namespace}-popover-fade`;
|
|
3424
|
+
}), ne = r(() => [h.e("arrow"), `${h.e("arrow")}--${H.value.split("-")[0]}`]), re = () => {
|
|
3425
3425
|
C.value.has("hover") && M("hover");
|
|
3426
3426
|
}, $ = () => {
|
|
3427
3427
|
C.value.has("hover") && P("hover");
|
|
@@ -3462,12 +3462,12 @@ var ae = {
|
|
|
3462
3462
|
onClick: ie,
|
|
3463
3463
|
onFocus: ae,
|
|
3464
3464
|
onBlur: oe
|
|
3465
|
-
}, [O(r.$slots, "default")], 34), (S(), i(t, { to: r.teleportTo }, [u(n, { name:
|
|
3465
|
+
}, [O(r.$slots, "default")], 34), (S(), i(t, { to: r.teleportTo }, [u(n, { name: te.value }, {
|
|
3466
3466
|
default: B(() => [I.value ? (S(), o("div", {
|
|
3467
3467
|
key: 0,
|
|
3468
3468
|
ref_key: "popoverRef",
|
|
3469
3469
|
ref: z,
|
|
3470
|
-
class: v(
|
|
3470
|
+
class: v(Q.value),
|
|
3471
3471
|
style: y(Z.value),
|
|
3472
3472
|
onMouseenter: se,
|
|
3473
3473
|
onMouseleave: ce
|
|
@@ -3475,7 +3475,7 @@ var ae = {
|
|
|
3475
3475
|
s("div", { class: v(N(h).e("background")) }, null, 2),
|
|
3476
3476
|
r.showArrow ? (S(), o("div", {
|
|
3477
3477
|
key: 0,
|
|
3478
|
-
class: v(
|
|
3478
|
+
class: v(ne.value)
|
|
3479
3479
|
}, null, 2)) : a("", !0),
|
|
3480
3480
|
N(g).popover ? O(r.$slots, "popover", { key: 1 }) : (S(), o(e, { key: 2 }, [r.title && !r.tooltip ? (S(), o("div", {
|
|
3481
3481
|
key: 0,
|
|
@@ -3701,16 +3701,16 @@ var ae = {
|
|
|
3701
3701
|
sm: 28,
|
|
3702
3702
|
md: 36,
|
|
3703
3703
|
lg: 44
|
|
3704
|
-
}, A = T(null), M = T(null), P = T(null), L = T(null), z = T(!1), H = T(""), G = T(-1), q = T(!1), J = T(p.placement), X = T(p.maxHeight), Z = r(() => p.inline && p.filterable),
|
|
3705
|
-
get: () => z.value ? H.value :
|
|
3704
|
+
}, A = T(null), M = T(null), P = T(null), L = T(null), z = T(!1), H = T(""), G = T(-1), q = T(!1), J = T(p.placement), X = T(p.maxHeight), Z = r(() => p.inline && p.filterable), Q = r({
|
|
3705
|
+
get: () => z.value ? H.value : ne.value,
|
|
3706
3706
|
set: (e) => {
|
|
3707
3707
|
H.value = e;
|
|
3708
3708
|
}
|
|
3709
|
-
}),
|
|
3709
|
+
}), ee = T({
|
|
3710
3710
|
top: 0,
|
|
3711
3711
|
left: 0,
|
|
3712
3712
|
width: 0
|
|
3713
|
-
}),
|
|
3713
|
+
}), te = r(() => p.options.find((e) => e.value === p.modelValue)), ne = r(() => te.value?.label || ""), re = r(() => {
|
|
3714
3714
|
if (!p.filterable || !H.value) return p.options;
|
|
3715
3715
|
let e = H.value.toLowerCase();
|
|
3716
3716
|
return p.options.filter((t) => t.label.toLowerCase().includes(e));
|
|
@@ -3730,9 +3730,9 @@ var ae = {
|
|
|
3730
3730
|
let e = {};
|
|
3731
3731
|
return p.color && (e["--cp-dropdown-custom-color"] = p.color, e["--cp-dropdown-custom-color-light"] = `color-mix(in srgb, ${p.color} 20%, transparent)`), p.inactiveColor && (e["--cp-dropdown-inactive-color"] = p.inactiveColor), p.placeholderColor && (e["--cp-dropdown-placeholder-color"] = p.placeholderColor), W(p.size) || (e["--cp-dropdown-height"] = K(p.size, k)), p.clearDuration !== 150 && (e["--cp-dropdown-clear-duration"] = `${p.clearDuration}ms`), p.width && (e["--cp-dropdown-width"] = typeof p.width == "number" ? `${p.width}px` : p.width), e;
|
|
3732
3732
|
}), se = r(() => ({
|
|
3733
|
-
top: `${
|
|
3734
|
-
left: `${
|
|
3735
|
-
width: `${
|
|
3733
|
+
top: `${ee.value.top}px`,
|
|
3734
|
+
left: `${ee.value.left}px`,
|
|
3735
|
+
width: `${ee.value.width}px`,
|
|
3736
3736
|
maxHeight: `${X.value}px`
|
|
3737
3737
|
})), ce = r(() => [
|
|
3738
3738
|
C.e("popper"),
|
|
@@ -3755,7 +3755,7 @@ var ae = {
|
|
|
3755
3755
|
l = e.top - t - 4 + window.scrollY;
|
|
3756
3756
|
}
|
|
3757
3757
|
let u = p.placement.split("-")[1] || "";
|
|
3758
|
-
J.value = u ? `${s}-${u}` : s,
|
|
3758
|
+
J.value = u ? `${s}-${u}` : s, ee.value = {
|
|
3759
3759
|
top: l,
|
|
3760
3760
|
left: n,
|
|
3761
3761
|
width: r
|
|
@@ -3834,18 +3834,18 @@ var ae = {
|
|
|
3834
3834
|
key: 1,
|
|
3835
3835
|
ref_key: "inlineInputRef",
|
|
3836
3836
|
ref: L,
|
|
3837
|
-
"onUpdate:modelValue": c[0] ||= (e) =>
|
|
3837
|
+
"onUpdate:modelValue": c[0] ||= (e) => Q.value = e,
|
|
3838
3838
|
class: v([N(C).e("inline-input"), N(C).is("active", z.value)]),
|
|
3839
|
-
placeholder: z.value ? "" : $.value ?
|
|
3839
|
+
placeholder: z.value ? "" : $.value ? ne.value : p.placeholder,
|
|
3840
3840
|
autocomplete: "off",
|
|
3841
3841
|
disabled: E.value,
|
|
3842
3842
|
onClick: c[1] ||= U(() => {}, ["stop"]),
|
|
3843
3843
|
onFocus: de,
|
|
3844
3844
|
onKeydown: ve
|
|
3845
|
-
}, null, 42, sn)), [[I,
|
|
3845
|
+
}, null, 42, sn)), [[I, Q.value]]) : (S(), o("span", {
|
|
3846
3846
|
key: 2,
|
|
3847
3847
|
class: v([N(C).e("value"), { [N(C).is("placeholder")]: !$.value }])
|
|
3848
|
-
}, j($.value ?
|
|
3848
|
+
}, j($.value ? ne.value : p.placeholder), 3)),
|
|
3849
3849
|
ie.value ? (S(), o("span", {
|
|
3850
3850
|
key: 3,
|
|
3851
3851
|
class: v(N(C).e("clear")),
|
|
@@ -5107,6 +5107,26 @@ var ae = {
|
|
|
5107
5107
|
type: [String, Object],
|
|
5108
5108
|
default: void 0
|
|
5109
5109
|
},
|
|
5110
|
+
loading: {
|
|
5111
|
+
type: Boolean,
|
|
5112
|
+
default: !1
|
|
5113
|
+
},
|
|
5114
|
+
loadingText: {
|
|
5115
|
+
type: String,
|
|
5116
|
+
default: "加载中..."
|
|
5117
|
+
},
|
|
5118
|
+
loadingClass: {
|
|
5119
|
+
type: [
|
|
5120
|
+
String,
|
|
5121
|
+
Object,
|
|
5122
|
+
Array
|
|
5123
|
+
],
|
|
5124
|
+
default: void 0
|
|
5125
|
+
},
|
|
5126
|
+
loadingStyle: {
|
|
5127
|
+
type: [String, Object],
|
|
5128
|
+
default: void 0
|
|
5129
|
+
},
|
|
5110
5130
|
zIndex: {
|
|
5111
5131
|
type: Number,
|
|
5112
5132
|
default: 2e3
|
|
@@ -5148,7 +5168,7 @@ var ae = {
|
|
|
5148
5168
|
stroke: "currentColor",
|
|
5149
5169
|
"stroke-width": "2"
|
|
5150
5170
|
}, [p("path", { d: "M18 6L6 18M6 6l12 12" })]), m = e, h = d, w = F(), E = P(), D = Y("dialog");
|
|
5151
|
-
C(
|
|
5171
|
+
C(te, {
|
|
5152
5172
|
type: M(m, "type"),
|
|
5153
5173
|
color: M(m, "color")
|
|
5154
5174
|
});
|
|
@@ -5169,9 +5189,9 @@ var ae = {
|
|
|
5169
5189
|
q.offsetX = e, q.offsetY = t, z.value.style.transform = `translate(${e}px, ${t}px)`;
|
|
5170
5190
|
}, Z = () => {
|
|
5171
5191
|
q.offsetX = 0, q.offsetY = 0, z.value && (z.value.style.transform = "");
|
|
5172
|
-
},
|
|
5192
|
+
}, Q = () => {
|
|
5173
5193
|
X(q.offsetX, q.offsetY);
|
|
5174
|
-
},
|
|
5194
|
+
}, ee = (e) => {
|
|
5175
5195
|
if (!m.draggable || !z.value) return;
|
|
5176
5196
|
let t = e.clientX, n = e.clientY, { offsetX: r, offsetY: i } = q, a = (e) => {
|
|
5177
5197
|
K.value ||= !0, X(r + e.clientX - t, i + e.clientY - n);
|
|
@@ -5179,9 +5199,9 @@ var ae = {
|
|
|
5179
5199
|
K.value = !1, document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", o);
|
|
5180
5200
|
};
|
|
5181
5201
|
document.addEventListener("mousemove", a), document.addEventListener("mouseup", o);
|
|
5182
|
-
},
|
|
5202
|
+
}, ne = r(() => m.color ? m.color : m.type && m.type !== "default" ? `var(--cp-color-${m.type})` : null), re = r(() => m.color ? `color-mix(in srgb, ${m.color} 30%, transparent)` : m.type && m.type !== "default" ? `var(--cp-color-${m.type}-light)` : null), $ = r(() => {
|
|
5183
5203
|
let e = {};
|
|
5184
|
-
return
|
|
5204
|
+
return ne.value && (e["--cp-dialog-color"] = ne.value), re.value && (e["--cp-dialog-color-light"] = re.value), m.bgColor && (e["--cp-dialog-bg"] = m.bgColor), m.borderColor && (e["--cp-dialog-border-color"] = m.borderColor), m.titleColor && (e["--cp-dialog-title-color"] = m.titleColor), m.textColor && (e["--cp-dialog-text-color"] = m.textColor), m.closeColor && (e["--cp-dialog-close-color"] = m.closeColor), m.headerDividerColor && (e["--cp-dialog-header-divider-color"] = m.headerDividerColor), m.footerDividerColor && (e["--cp-dialog-footer-divider-color"] = m.footerDividerColor), e;
|
|
5185
5205
|
}), ie = r(() => {
|
|
5186
5206
|
let e = typeof m.width == "number" ? `${m.width}px` : m.width, t = {
|
|
5187
5207
|
...$.value,
|
|
@@ -5204,6 +5224,7 @@ var ae = {
|
|
|
5204
5224
|
D.is("center", m.center),
|
|
5205
5225
|
D.is("draggable", m.draggable),
|
|
5206
5226
|
D.is("dragging", K.value),
|
|
5227
|
+
D.is("loading", m.loading),
|
|
5207
5228
|
D.is("shaking", I.value),
|
|
5208
5229
|
m.dialogClass
|
|
5209
5230
|
]), ce = r(() => [
|
|
@@ -5221,52 +5242,52 @@ var ae = {
|
|
|
5221
5242
|
D.e("overlay"),
|
|
5222
5243
|
m.overlayClass,
|
|
5223
5244
|
m.modalClass
|
|
5224
|
-
]), fe = r(() => m.title || w.header || w.title || m.showClose),
|
|
5245
|
+
]), fe = r(() => [D.e("loading-overlay"), m.loadingClass]), pe = r(() => m.title || w.header || w.title || m.showClose), me = r(() => !!w.footer || m.showConfirmButton || m.showCancelButton), ge = r(() => m.type && m.type !== "default" ? m.type : "primary"), _e = r(() => m.color || ""), ve = r(() => {
|
|
5225
5246
|
if (m.beforeClose) return m.beforeClose;
|
|
5226
5247
|
let e = E["before-close"] ?? E.beforeClose;
|
|
5227
5248
|
return typeof e == "function" ? e : void 0;
|
|
5228
|
-
}),
|
|
5249
|
+
}), ye = () => {
|
|
5229
5250
|
k.value = !1;
|
|
5230
|
-
},
|
|
5251
|
+
}, be = () => {
|
|
5231
5252
|
let e = (e) => {
|
|
5232
|
-
e ||
|
|
5253
|
+
e || ye();
|
|
5233
5254
|
};
|
|
5234
|
-
|
|
5235
|
-
}, ye = () => {
|
|
5236
|
-
m.closeOnClickModal ? ve() : W();
|
|
5237
|
-
}, be = () => {
|
|
5238
|
-
h("confirm"), ve();
|
|
5255
|
+
ve.value ? ve.value(e) : e();
|
|
5239
5256
|
}, xe = () => {
|
|
5240
|
-
|
|
5241
|
-
}, Se = (
|
|
5242
|
-
|
|
5243
|
-
}, we = (
|
|
5257
|
+
m.closeOnClickModal ? be() : W();
|
|
5258
|
+
}, Se = () => {
|
|
5259
|
+
h("confirm"), be();
|
|
5260
|
+
}, we = () => {
|
|
5261
|
+
h("cancel"), be();
|
|
5262
|
+
}, Te = (e) => {
|
|
5263
|
+
e.key === "Escape" && k.value && (m.closeOnEscape ? be() : W());
|
|
5264
|
+
}, Ee = (e) => {
|
|
5244
5265
|
e.stopPropagation();
|
|
5245
|
-
},
|
|
5266
|
+
}, De = () => {
|
|
5246
5267
|
h("opened");
|
|
5247
|
-
},
|
|
5248
|
-
h("closed"),
|
|
5249
|
-
},
|
|
5250
|
-
m.lockScroll && (
|
|
5251
|
-
},
|
|
5252
|
-
m.lockScroll && (document.body.style.overflow =
|
|
5268
|
+
}, Oe = () => {
|
|
5269
|
+
h("closed"), je(), m.destroyOnClose && (A.value = !1);
|
|
5270
|
+
}, ke = "", Ae = () => {
|
|
5271
|
+
m.lockScroll && (ke = document.body.style.overflow, document.body.style.overflow = "hidden");
|
|
5272
|
+
}, je = () => {
|
|
5273
|
+
m.lockScroll && (document.body.style.overflow = ke);
|
|
5253
5274
|
};
|
|
5254
5275
|
return R(() => m.modelValue, (e) => {
|
|
5255
5276
|
e ? (A.value = !0, k.value = !0, h("open"), _(() => {
|
|
5256
|
-
Z(),
|
|
5257
|
-
})) : k.value &&
|
|
5277
|
+
Z(), Ae(), document.addEventListener("keydown", Te), m.draggable && window.addEventListener("resize", Q);
|
|
5278
|
+
})) : k.value && ye();
|
|
5258
5279
|
}), R(k, (e) => {
|
|
5259
|
-
!e && m.modelValue && (h("close"), h("update:modelValue", !1), document.removeEventListener("keydown",
|
|
5280
|
+
!e && m.modelValue && (h("close"), h("update:modelValue", !1), document.removeEventListener("keydown", Te), window.removeEventListener("resize", Q));
|
|
5260
5281
|
}), R(() => m.fullscreen, (e) => {
|
|
5261
5282
|
z.value && (e ? (J = z.value.style.transform, z.value.style.transform = "") : z.value.style.transform = J);
|
|
5262
5283
|
}), x(() => {
|
|
5263
5284
|
m.modelValue && (A.value = !0, k.value = !0, _(() => {
|
|
5264
|
-
|
|
5285
|
+
Ae(), document.addEventListener("keydown", Te), m.draggable && window.addEventListener("resize", Q);
|
|
5265
5286
|
}));
|
|
5266
5287
|
}), b(() => {
|
|
5267
|
-
|
|
5288
|
+
je(), document.removeEventListener("keydown", Te), window.removeEventListener("resize", Q);
|
|
5268
5289
|
}), c({
|
|
5269
|
-
close:
|
|
5290
|
+
close: be,
|
|
5270
5291
|
resetPosition: Z,
|
|
5271
5292
|
visible: k
|
|
5272
5293
|
}), (e, r) => (S(), i(t, {
|
|
@@ -5274,17 +5295,17 @@ var ae = {
|
|
|
5274
5295
|
disabled: !e.appendToBody
|
|
5275
5296
|
}, [u(n, {
|
|
5276
5297
|
name: N(D).namespace + "-dialog-fade",
|
|
5277
|
-
onAfterEnter:
|
|
5278
|
-
onAfterLeave:
|
|
5298
|
+
onAfterEnter: De,
|
|
5299
|
+
onAfterLeave: Oe
|
|
5279
5300
|
}, {
|
|
5280
5301
|
default: B(() => [(e.destroyOnClose ? k.value : A.value || k.value) ? V((S(), o("div", {
|
|
5281
5302
|
key: 0,
|
|
5282
5303
|
class: v(de.value),
|
|
5283
5304
|
style: y(ae.value),
|
|
5284
|
-
onClick: U(
|
|
5305
|
+
onClick: U(xe, ["self"])
|
|
5285
5306
|
}, [s("div", {
|
|
5286
5307
|
class: v(oe.value),
|
|
5287
|
-
onClick: U(
|
|
5308
|
+
onClick: U(xe, ["self"])
|
|
5288
5309
|
}, [s("div", g({
|
|
5289
5310
|
ref_key: "panelRef",
|
|
5290
5311
|
ref: z
|
|
@@ -5293,7 +5314,7 @@ var ae = {
|
|
|
5293
5314
|
style: ie.value,
|
|
5294
5315
|
role: "dialog",
|
|
5295
5316
|
"aria-modal": "true",
|
|
5296
|
-
onClick:
|
|
5317
|
+
onClick: Ee,
|
|
5297
5318
|
onAnimationend: G
|
|
5298
5319
|
}), [
|
|
5299
5320
|
s("div", { class: v(N(D).e("decor")) }, null, 2),
|
|
@@ -5301,13 +5322,13 @@ var ae = {
|
|
|
5301
5322
|
key: 0,
|
|
5302
5323
|
class: v(N(D).e("cover"))
|
|
5303
5324
|
}, [O(e.$slots, "cover")], 2)) : a("", !0),
|
|
5304
|
-
|
|
5325
|
+
pe.value ? (S(), o("div", {
|
|
5305
5326
|
key: 1,
|
|
5306
5327
|
ref_key: "headerRef",
|
|
5307
5328
|
ref: H,
|
|
5308
5329
|
class: v(ce.value),
|
|
5309
5330
|
style: y(e.headerStyle),
|
|
5310
|
-
onMousedown:
|
|
5331
|
+
onMousedown: ee
|
|
5311
5332
|
}, [O(e.$slots, "header", {}, () => [s("div", { class: v(N(D).e("title")) }, [O(e.$slots, "title", {}, () => [l(j(e.title), 1)])], 2), e.showClose ? (S(), i(N(Ce), {
|
|
5312
5333
|
key: 0,
|
|
5313
5334
|
class: v(N(D).e("close")),
|
|
@@ -5318,7 +5339,7 @@ var ae = {
|
|
|
5318
5339
|
variant: "ghost",
|
|
5319
5340
|
size: "sm",
|
|
5320
5341
|
"aria-label": "Close",
|
|
5321
|
-
onClick:
|
|
5342
|
+
onClick: be
|
|
5322
5343
|
}, null, 8, [
|
|
5323
5344
|
"class",
|
|
5324
5345
|
"shape",
|
|
@@ -5329,26 +5350,26 @@ var ae = {
|
|
|
5329
5350
|
class: v(le.value),
|
|
5330
5351
|
style: y(e.bodyStyle)
|
|
5331
5352
|
}, [O(e.$slots, "default")], 6),
|
|
5332
|
-
|
|
5353
|
+
me.value ? (S(), o("div", {
|
|
5333
5354
|
key: 2,
|
|
5334
5355
|
class: v(ue.value),
|
|
5335
5356
|
style: y(e.footerStyle)
|
|
5336
5357
|
}, [O(e.$slots, "footer", {
|
|
5337
|
-
close:
|
|
5338
|
-
confirm:
|
|
5358
|
+
close: be,
|
|
5359
|
+
confirm: Se
|
|
5339
5360
|
}, () => [e.showCancelButton ? (S(), i(N(Ce), {
|
|
5340
5361
|
key: 0,
|
|
5341
5362
|
class: v(N(D).e("cancel-btn")),
|
|
5342
|
-
onClick:
|
|
5363
|
+
onClick: we
|
|
5343
5364
|
}, {
|
|
5344
5365
|
default: B(() => [l(j(e.cancelText || "取消"), 1)]),
|
|
5345
5366
|
_: 1
|
|
5346
5367
|
}, 8, ["class"])) : a("", !0), e.showConfirmButton ? (S(), i(N(Ce), {
|
|
5347
5368
|
key: 1,
|
|
5348
5369
|
class: v(N(D).e("confirm-btn")),
|
|
5349
|
-
type:
|
|
5350
|
-
color:
|
|
5351
|
-
onClick:
|
|
5370
|
+
type: ge.value,
|
|
5371
|
+
color: _e.value,
|
|
5372
|
+
onClick: Se
|
|
5352
5373
|
}, {
|
|
5353
5374
|
default: B(() => [l(j(e.confirmText || "确认"), 1)]),
|
|
5354
5375
|
_: 1
|
|
@@ -5356,7 +5377,18 @@ var ae = {
|
|
|
5356
5377
|
"class",
|
|
5357
5378
|
"type",
|
|
5358
5379
|
"color"
|
|
5359
|
-
])) : a("", !0)])], 6)) : a("", !0)
|
|
5380
|
+
])) : a("", !0)])], 6)) : a("", !0),
|
|
5381
|
+
u(n, { name: "cp-dialog-loading" }, {
|
|
5382
|
+
default: B(() => [e.loading ? (S(), o("div", {
|
|
5383
|
+
key: 0,
|
|
5384
|
+
class: v(fe.value),
|
|
5385
|
+
style: y(e.loadingStyle)
|
|
5386
|
+
}, [O(e.$slots, "loading", {}, () => [u(N(he), { color: ne.value || void 0 }, null, 8, ["color"]), e.loadingText ? (S(), o("span", {
|
|
5387
|
+
key: 0,
|
|
5388
|
+
class: v(N(D).e("loading-text"))
|
|
5389
|
+
}, j(e.loadingText), 3)) : a("", !0)])], 6)) : a("", !0)]),
|
|
5390
|
+
_: 3
|
|
5391
|
+
})
|
|
5360
5392
|
], 16)], 2)], 6)), [[L, k.value]]) : a("", !0)]),
|
|
5361
5393
|
_: 3
|
|
5362
5394
|
}, 8, ["name"])], 8, ["disabled"]));
|
|
@@ -5668,6 +5700,10 @@ var ae = {
|
|
|
5668
5700
|
type: String,
|
|
5669
5701
|
default: "solid"
|
|
5670
5702
|
},
|
|
5703
|
+
size: {
|
|
5704
|
+
type: [String, Number],
|
|
5705
|
+
default: "md"
|
|
5706
|
+
},
|
|
5671
5707
|
defaultActive: {
|
|
5672
5708
|
type: String,
|
|
5673
5709
|
default: ""
|
|
@@ -5706,77 +5742,87 @@ var ae = {
|
|
|
5706
5742
|
props: mr,
|
|
5707
5743
|
emits: hr,
|
|
5708
5744
|
setup(e, { emit: t }) {
|
|
5709
|
-
let n = e, i = t, a = Y("menu"), s = f()?.appContext.config.globalProperties.$router, c =
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
},
|
|
5745
|
+
let n = e, i = t, a = Y("menu"), s = f()?.appContext.config.globalProperties.$router, c = {
|
|
5746
|
+
sm: 13,
|
|
5747
|
+
md: 14,
|
|
5748
|
+
lg: 16
|
|
5749
|
+
}, l = T(n.defaultActive), u = T([]), d = T(new Set(n.defaultOpeneds)), p = T(new Set(n.defaultOpeneds)), m = T(!1), h = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), b = (e, t) => {
|
|
5714
5750
|
h.set(e, [...t]);
|
|
5715
|
-
},
|
|
5751
|
+
}, w = (e) => {
|
|
5716
5752
|
h.delete(e);
|
|
5753
|
+
}, E = (e, t) => {
|
|
5754
|
+
g.set(e, [...t]);
|
|
5717
5755
|
}, D = (e) => {
|
|
5718
|
-
|
|
5756
|
+
g.delete(e);
|
|
5757
|
+
}, k = (e) => {
|
|
5758
|
+
if (h.has(e)) return {
|
|
5719
5759
|
index: e,
|
|
5720
|
-
indexPath:
|
|
5760
|
+
indexPath: h.get(e)
|
|
5721
5761
|
};
|
|
5722
5762
|
let t = null;
|
|
5723
|
-
for (let [n, r] of
|
|
5763
|
+
for (let [n, r] of h) n !== "/" && (e.startsWith(n + "/") || e.startsWith(n + "?")) && (!t || n.length > t.index.length) && (t = {
|
|
5724
5764
|
index: n,
|
|
5725
5765
|
indexPath: r
|
|
5726
5766
|
});
|
|
5727
5767
|
return t;
|
|
5728
|
-
},
|
|
5768
|
+
}, A = (e) => {
|
|
5729
5769
|
if (!e) return;
|
|
5730
|
-
let t =
|
|
5770
|
+
let t = k(e);
|
|
5731
5771
|
if (t) {
|
|
5732
|
-
|
|
5733
|
-
let e = new Set(
|
|
5734
|
-
for (let n of t.indexPath) n !== t.index &&
|
|
5735
|
-
|
|
5772
|
+
l.value = t.index, u.value = t.indexPath;
|
|
5773
|
+
let e = new Set(d.value);
|
|
5774
|
+
for (let n of t.indexPath) n !== t.index && g.has(n) && e.add(n);
|
|
5775
|
+
d.value = e, n.collapse || (p.value = new Set(e));
|
|
5736
5776
|
}
|
|
5737
5777
|
};
|
|
5738
5778
|
R(() => n.defaultActive, (e) => {
|
|
5739
|
-
|
|
5779
|
+
A(e);
|
|
5740
5780
|
}), R(() => n.collapse, (e) => {
|
|
5741
|
-
e ? (
|
|
5742
|
-
|
|
5743
|
-
}, 350)) :
|
|
5781
|
+
e ? (m.value = !0, p.value = new Set(d.value), d.value = /* @__PURE__ */ new Set(), setTimeout(() => {
|
|
5782
|
+
m.value = !1;
|
|
5783
|
+
}, 350)) : d.value = new Set(p.value);
|
|
5744
5784
|
}, { flush: "sync" });
|
|
5745
|
-
let
|
|
5746
|
-
n.router || (
|
|
5747
|
-
}, j = (e, t) => {
|
|
5748
|
-
let r = new Set(u.value);
|
|
5749
|
-
r.has(e) || (n.uniqueOpened && r.clear(), r.add(e), u.value = r, i("open", e, t), n.collapse || (d.value = new Set(r)));
|
|
5785
|
+
let j = (e, t) => {
|
|
5786
|
+
n.router || (l.value = e, u.value = t), i("select", e, t);
|
|
5750
5787
|
}, N = (e, t) => {
|
|
5751
|
-
let r = new Set(
|
|
5752
|
-
r.has(e) && (r.
|
|
5788
|
+
let r = new Set(d.value);
|
|
5789
|
+
r.has(e) || (n.uniqueOpened && r.clear(), r.add(e), d.value = r, i("open", e, t), n.collapse || (p.value = new Set(r)));
|
|
5753
5790
|
}, P = (e, t) => {
|
|
5754
|
-
|
|
5791
|
+
let r = new Set(d.value);
|
|
5792
|
+
r.has(e) && (r.delete(e), d.value = r, i("close", e, t), n.collapse || (p.value = new Set(r)));
|
|
5793
|
+
}, F = (e, t) => {
|
|
5794
|
+
d.value.has(e) ? P(e, t) : N(e, t);
|
|
5755
5795
|
};
|
|
5756
5796
|
x(() => {
|
|
5757
5797
|
_(() => {
|
|
5758
|
-
|
|
5798
|
+
A(l.value);
|
|
5759
5799
|
}), n.router && s && R(() => s.currentRoute.value.path, (e) => {
|
|
5760
|
-
|
|
5800
|
+
A(e);
|
|
5761
5801
|
});
|
|
5762
5802
|
});
|
|
5763
|
-
let
|
|
5803
|
+
let I = 0, L = () => `__cp_auto_${++I}`, z = r(() => [
|
|
5764
5804
|
a.b(),
|
|
5765
5805
|
a.m(n.mode),
|
|
5766
5806
|
a.m(`shape-${n.shape}`),
|
|
5767
5807
|
a.m(n.variant),
|
|
5808
|
+
W(n.size) && a.m(n.size),
|
|
5768
5809
|
a.is("collapse", n.collapse && n.mode === "vertical"),
|
|
5810
|
+
a.is("custom-size", !W(n.size)),
|
|
5769
5811
|
n.type === "default" ? "" : a.m(n.type),
|
|
5770
5812
|
n.color ? a.is("custom-color") : ""
|
|
5771
|
-
]),
|
|
5813
|
+
]), B = r(() => {
|
|
5772
5814
|
let e = {};
|
|
5815
|
+
if (!W(n.size)) {
|
|
5816
|
+
let t = K(n.size, c);
|
|
5817
|
+
e["--cp-menu-font-size"] = t, e["--cp-menu-item-height"] = `calc(${t} * 3.25)`, e["--cp-menu-icon-size"] = `calc(${t} * 1.15)`, e["--cp-menu-group-title-font-size"] = `calc(${t} * 0.8)`;
|
|
5818
|
+
}
|
|
5773
5819
|
return n.color && (e["--cp-menu-active-color"] = n.color, e["--cp-menu-active-color-light"] = `color-mix(in srgb, ${n.color} 20%, transparent)`), e;
|
|
5774
5820
|
});
|
|
5775
5821
|
return C(gr, {
|
|
5776
|
-
generateIndex:
|
|
5777
|
-
activeIndex:
|
|
5778
|
-
activeIndexPath:
|
|
5779
|
-
openedMenus:
|
|
5822
|
+
generateIndex: L,
|
|
5823
|
+
activeIndex: l,
|
|
5824
|
+
activeIndexPath: u,
|
|
5825
|
+
openedMenus: d,
|
|
5780
5826
|
mode: n.mode,
|
|
5781
5827
|
collapse: M(n, "collapse"),
|
|
5782
5828
|
type: n.type,
|
|
@@ -5784,18 +5830,18 @@ var ae = {
|
|
|
5784
5830
|
variant: n.variant,
|
|
5785
5831
|
router: n.router,
|
|
5786
5832
|
color: n.color,
|
|
5787
|
-
handleSelect:
|
|
5788
|
-
handleSubMenuClick:
|
|
5789
|
-
openMenu:
|
|
5790
|
-
closeMenu:
|
|
5791
|
-
addItem:
|
|
5792
|
-
removeItem:
|
|
5793
|
-
addSubMenu:
|
|
5794
|
-
removeSubMenu:
|
|
5795
|
-
suppressTransition:
|
|
5833
|
+
handleSelect: j,
|
|
5834
|
+
handleSubMenuClick: F,
|
|
5835
|
+
openMenu: N,
|
|
5836
|
+
closeMenu: P,
|
|
5837
|
+
addItem: b,
|
|
5838
|
+
removeItem: w,
|
|
5839
|
+
addSubMenu: E,
|
|
5840
|
+
removeSubMenu: D,
|
|
5841
|
+
suppressTransition: m
|
|
5796
5842
|
}), (e, t) => (S(), o("ul", {
|
|
5797
|
-
class: v(
|
|
5798
|
-
style: y(
|
|
5843
|
+
class: v(z.value),
|
|
5844
|
+
style: y(B.value),
|
|
5799
5845
|
role: "menubar"
|
|
5800
5846
|
}, [O(e.$slots, "default")], 6));
|
|
5801
5847
|
}
|
|
@@ -6154,7 +6200,7 @@ var ae = {
|
|
|
6154
6200
|
setup(e, { expose: c, emit: d }) {
|
|
6155
6201
|
let f = e, p = d, m = F(), _ = Y("notification"), y = T(!1), C = r(() => !!f.id), w = null, E = 0, D = 0, k = () => {
|
|
6156
6202
|
f.duration <= 0 || (D <= 0 && (D = f.duration), E = Date.now(), w = setTimeout(() => {
|
|
6157
|
-
|
|
6203
|
+
ee();
|
|
6158
6204
|
}, D));
|
|
6159
6205
|
}, M = () => {
|
|
6160
6206
|
w && (clearTimeout(w), w = null, D -= Date.now() - E, D < 0 && (D = 0));
|
|
@@ -6185,11 +6231,11 @@ var ae = {
|
|
|
6185
6231
|
_.is("has-icon", f.type !== "default" || !!m.icon),
|
|
6186
6232
|
_.is("closable", f.showClose),
|
|
6187
6233
|
_.is("selectable", f.selectable)
|
|
6188
|
-
]), Z = r(() => h(f.message) ? f.message : typeof f.message == "function" ? f.message() : null),
|
|
6234
|
+
]), Z = r(() => h(f.message) ? f.message : typeof f.message == "function" ? f.message() : null), Q = r(() => typeof f.message == "string"), ee = () => {
|
|
6189
6235
|
y.value = !1;
|
|
6190
|
-
},
|
|
6236
|
+
}, te = () => {
|
|
6191
6237
|
p("click");
|
|
6192
|
-
},
|
|
6238
|
+
}, ne = r(() => H.value ? `${_.namespace}-notification-right` : `${_.namespace}-notification-left`), re = () => {
|
|
6193
6239
|
f.onClose?.();
|
|
6194
6240
|
}, $ = () => {
|
|
6195
6241
|
p("destroy");
|
|
@@ -6200,7 +6246,7 @@ var ae = {
|
|
|
6200
6246
|
info: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
6201
6247
|
}, ae = r(() => f.type === "default" || f.type === "primary" ? null : ie[f.type] || null);
|
|
6202
6248
|
return R(() => f.modelValue, (e) => {
|
|
6203
|
-
e ? (y.value = !0, D = f.duration, k()) :
|
|
6249
|
+
e ? (y.value = !0, D = f.duration, k()) : ee();
|
|
6204
6250
|
}), R(y, (e) => {
|
|
6205
6251
|
!e && f.modelValue && (P(), p("close"), p("update:modelValue", !1));
|
|
6206
6252
|
}), x(() => {
|
|
@@ -6208,11 +6254,11 @@ var ae = {
|
|
|
6208
6254
|
}), b(() => {
|
|
6209
6255
|
P();
|
|
6210
6256
|
}), c({
|
|
6211
|
-
close:
|
|
6257
|
+
close: ee,
|
|
6212
6258
|
visible: y
|
|
6213
6259
|
}), (e, r) => C.value ? (S(), i(n, {
|
|
6214
6260
|
key: 1,
|
|
6215
|
-
name:
|
|
6261
|
+
name: ne.value,
|
|
6216
6262
|
onBeforeLeave: re,
|
|
6217
6263
|
onAfterLeave: $
|
|
6218
6264
|
}, {
|
|
@@ -6222,7 +6268,7 @@ var ae = {
|
|
|
6222
6268
|
role: "alert",
|
|
6223
6269
|
onMouseenter: I,
|
|
6224
6270
|
onMouseleave: z,
|
|
6225
|
-
onClick:
|
|
6271
|
+
onClick: te
|
|
6226
6272
|
}), [
|
|
6227
6273
|
s("div", { class: v(N(_).e("decor")) }, null, 2),
|
|
6228
6274
|
ae.value || N(m).icon ? (S(), o("div", {
|
|
@@ -6234,10 +6280,10 @@ var ae = {
|
|
|
6234
6280
|
key: 0,
|
|
6235
6281
|
class: v(N(_).e("title"))
|
|
6236
6282
|
}, [O(e.$slots, "title", {}, () => [l(j(e.title), 1)])], 2)) : a("", !0),
|
|
6237
|
-
s("div", { class: v(N(_).e("content")) }, [O(e.$slots, "default", {}, () => [e.dangerouslyUseHTMLString &&
|
|
6283
|
+
s("div", { class: v(N(_).e("content")) }, [O(e.$slots, "default", {}, () => [e.dangerouslyUseHTMLString && Q.value ? (S(), o("p", {
|
|
6238
6284
|
key: 0,
|
|
6239
6285
|
innerHTML: e.message
|
|
6240
|
-
}, null, 8, zr)) :
|
|
6286
|
+
}, null, 8, zr)) : Q.value ? (S(), o("p", Br, j(e.message), 1)) : Z.value ? (S(), i(A(() => Z.value), { key: 2 })) : a("", !0)])], 2),
|
|
6241
6287
|
N(m).actions ? (S(), o("div", {
|
|
6242
6288
|
key: 1,
|
|
6243
6289
|
class: v(N(_).e("actions")),
|
|
@@ -6248,7 +6294,7 @@ var ae = {
|
|
|
6248
6294
|
key: 1,
|
|
6249
6295
|
class: v(N(_).e("close")),
|
|
6250
6296
|
"aria-label": "Close",
|
|
6251
|
-
onClick: U(
|
|
6297
|
+
onClick: U(ee, ["stop"])
|
|
6252
6298
|
}, [...r[3] ||= [s("svg", {
|
|
6253
6299
|
viewBox: "0 0 24 24",
|
|
6254
6300
|
width: "14",
|
|
@@ -6267,7 +6313,7 @@ var ae = {
|
|
|
6267
6313
|
key: 0,
|
|
6268
6314
|
to: "body"
|
|
6269
6315
|
}, [u(n, {
|
|
6270
|
-
name:
|
|
6316
|
+
name: ne.value,
|
|
6271
6317
|
onBeforeLeave: re,
|
|
6272
6318
|
onAfterLeave: $
|
|
6273
6319
|
}, {
|
|
@@ -6277,7 +6323,7 @@ var ae = {
|
|
|
6277
6323
|
role: "alert",
|
|
6278
6324
|
onMouseenter: I,
|
|
6279
6325
|
onMouseleave: z,
|
|
6280
|
-
onClick:
|
|
6326
|
+
onClick: te
|
|
6281
6327
|
}), [
|
|
6282
6328
|
s("div", { class: v(N(_).e("decor")) }, null, 2),
|
|
6283
6329
|
ae.value || N(m).icon ? (S(), o("div", {
|
|
@@ -6289,10 +6335,10 @@ var ae = {
|
|
|
6289
6335
|
key: 0,
|
|
6290
6336
|
class: v(N(_).e("title"))
|
|
6291
6337
|
}, [O(e.$slots, "title", {}, () => [l(j(e.title), 1)])], 2)) : a("", !0),
|
|
6292
|
-
s("div", { class: v(N(_).e("content")) }, [O(e.$slots, "default", {}, () => [e.dangerouslyUseHTMLString &&
|
|
6338
|
+
s("div", { class: v(N(_).e("content")) }, [O(e.$slots, "default", {}, () => [e.dangerouslyUseHTMLString && Q.value ? (S(), o("p", {
|
|
6293
6339
|
key: 0,
|
|
6294
6340
|
innerHTML: e.message
|
|
6295
|
-
}, null, 8, Fr)) :
|
|
6341
|
+
}, null, 8, Fr)) : Q.value ? (S(), o("p", Ir, j(e.message), 1)) : Z.value ? (S(), i(A(() => Z.value), { key: 2 })) : a("", !0)])], 2),
|
|
6296
6342
|
N(m).actions ? (S(), o("div", {
|
|
6297
6343
|
key: 1,
|
|
6298
6344
|
class: v(N(_).e("actions")),
|
|
@@ -6303,7 +6349,7 @@ var ae = {
|
|
|
6303
6349
|
key: 1,
|
|
6304
6350
|
class: v(N(_).e("close")),
|
|
6305
6351
|
"aria-label": "Close",
|
|
6306
|
-
onClick: U(
|
|
6352
|
+
onClick: U(ee, ["stop"])
|
|
6307
6353
|
}, [...r[2] ||= [s("svg", {
|
|
6308
6354
|
viewBox: "0 0 24 24",
|
|
6309
6355
|
width: "14",
|
|
@@ -6475,6 +6521,10 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
6475
6521
|
type: String,
|
|
6476
6522
|
default: "vertical"
|
|
6477
6523
|
},
|
|
6524
|
+
size: {
|
|
6525
|
+
type: [String, Number],
|
|
6526
|
+
default: "md"
|
|
6527
|
+
},
|
|
6478
6528
|
defaultActive: {
|
|
6479
6529
|
type: String,
|
|
6480
6530
|
default: ""
|
|
@@ -6530,6 +6580,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
6530
6580
|
}, d = (e) => !!e.group;
|
|
6531
6581
|
return (t, n) => (S(), i(N(vr), {
|
|
6532
6582
|
mode: t.mode,
|
|
6583
|
+
size: t.size,
|
|
6533
6584
|
"default-active": t.defaultActive,
|
|
6534
6585
|
"default-openeds": t.defaultOpeneds,
|
|
6535
6586
|
"unique-opened": t.uniqueOpened,
|
|
@@ -6607,6 +6658,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
6607
6658
|
_: 1
|
|
6608
6659
|
}, 8, [
|
|
6609
6660
|
"mode",
|
|
6661
|
+
"size",
|
|
6610
6662
|
"default-active",
|
|
6611
6663
|
"default-openeds",
|
|
6612
6664
|
"unique-opened",
|
|
@@ -6769,7 +6821,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
6769
6821
|
if (i.disabled) return;
|
|
6770
6822
|
let t = i.pagerCount - 2;
|
|
6771
6823
|
U(e === "left-ellipsis" ? Math.max(1, f.value - t) : Math.min(m.value, f.value + t));
|
|
6772
|
-
}, Z = T(""),
|
|
6824
|
+
}, Z = T(""), Q = () => {
|
|
6773
6825
|
if (i.disabled) return;
|
|
6774
6826
|
let e = parseInt(Z.value, 10);
|
|
6775
6827
|
!isNaN(e) && e >= 1 && e <= m.value && U(e), Z.value = "";
|
|
@@ -7007,7 +7059,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
7007
7059
|
min: 1,
|
|
7008
7060
|
max: m.value,
|
|
7009
7061
|
disabled: t.disabled,
|
|
7010
|
-
onKeydown: H(
|
|
7062
|
+
onKeydown: H(Q, ["enter"])
|
|
7011
7063
|
}, null, 42, ai), [[I, Z.value]]),
|
|
7012
7064
|
n[5] ||= l(" 页 ", -1)
|
|
7013
7065
|
], 2)]) : a("", !0)], 64))), 128))], 6));
|
|
@@ -7228,7 +7280,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
7228
7280
|
emits: fi,
|
|
7229
7281
|
setup(t, { expose: d, emit: f }) {
|
|
7230
7282
|
let p = t, m = f, h = Y("table"), g = T([]), _ = 0;
|
|
7231
|
-
C(
|
|
7283
|
+
C(ne, {
|
|
7232
7284
|
registerColumn: (e) => {
|
|
7233
7285
|
let t = `cp-col-${_++}`, n = {
|
|
7234
7286
|
...e,
|
|
@@ -7298,10 +7350,10 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
7298
7350
|
if (q.value && e[q.value]) return !0;
|
|
7299
7351
|
let t = e[K.value];
|
|
7300
7352
|
return Array.isArray(t) && t.length > 0;
|
|
7301
|
-
},
|
|
7353
|
+
}, Q = (e, t) => {
|
|
7302
7354
|
let n = H(e, -1), r = new Set(J.value), i = r.has(n), a = t === void 0 ? !i : t;
|
|
7303
7355
|
a ? r.add(n) : r.delete(n), J.value = r, m("expand-change", e, a);
|
|
7304
|
-
},
|
|
7356
|
+
}, ee = () => {
|
|
7305
7357
|
let e = /* @__PURE__ */ new Set(), t = (n) => {
|
|
7306
7358
|
for (let r of n) {
|
|
7307
7359
|
let n = H(r, -1);
|
|
@@ -7313,7 +7365,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
7313
7365
|
}
|
|
7314
7366
|
};
|
|
7315
7367
|
t(p.data), J.value = e;
|
|
7316
|
-
},
|
|
7368
|
+
}, te = () => {
|
|
7317
7369
|
J.value = /* @__PURE__ */ new Set();
|
|
7318
7370
|
}, re = r(() => {
|
|
7319
7371
|
if (!G.value) return [];
|
|
@@ -7385,9 +7437,9 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
7385
7437
|
let t = z.value;
|
|
7386
7438
|
z.value = e, m("current-change", e, t);
|
|
7387
7439
|
},
|
|
7388
|
-
toggleRowExpansion:
|
|
7389
|
-
expandAll:
|
|
7390
|
-
collapseAll:
|
|
7440
|
+
toggleRowExpansion: Q,
|
|
7441
|
+
expandAll: ee,
|
|
7442
|
+
collapseAll: te,
|
|
7391
7443
|
toggleRowExpand: ue
|
|
7392
7444
|
}), (t, r) => (S(), o("div", {
|
|
7393
7445
|
class: v(de.value),
|
|
@@ -7502,7 +7554,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
7502
7554
|
ie(n)?.hasChildren ? (S(), o("span", {
|
|
7503
7555
|
key: 1,
|
|
7504
7556
|
class: v([N(h).e("expand-icon"), N(h).is("expanded", ie(n)?.expanded)]),
|
|
7505
|
-
onClick: U((e) =>
|
|
7557
|
+
onClick: U((e) => Q(n), ["stop"])
|
|
7506
7558
|
}, [...r[5] ||= [s("svg", {
|
|
7507
7559
|
viewBox: "0 0 16 16",
|
|
7508
7560
|
width: "14",
|
|
@@ -7589,7 +7641,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
7589
7641
|
__name: "table-column",
|
|
7590
7642
|
props: xi,
|
|
7591
7643
|
setup(e) {
|
|
7592
|
-
let t = e, n = F(), r = m(
|
|
7644
|
+
let t = e, n = F(), r = m(ne, null), i = "";
|
|
7593
7645
|
return x(() => {
|
|
7594
7646
|
r && (i = r.registerColumn({
|
|
7595
7647
|
prop: t.prop,
|
|
@@ -8243,35 +8295,78 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8243
8295
|
z(e);
|
|
8244
8296
|
} else for (let e of r) G(e);
|
|
8245
8297
|
}
|
|
8246
|
-
function q() {
|
|
8298
|
+
function q(e) {
|
|
8299
|
+
return new Promise((t) => {
|
|
8300
|
+
if (e.isFile) e.file((e) => t([e]), () => t([]));
|
|
8301
|
+
else if (e.isDirectory) {
|
|
8302
|
+
let n = e.createReader(), r = [], i = () => {
|
|
8303
|
+
n.readEntries(async (e) => {
|
|
8304
|
+
if (e.length === 0) {
|
|
8305
|
+
t(r);
|
|
8306
|
+
return;
|
|
8307
|
+
}
|
|
8308
|
+
let n = await Promise.all(e.map(q));
|
|
8309
|
+
r.push(...n.flat()), i();
|
|
8310
|
+
}, () => t(r));
|
|
8311
|
+
};
|
|
8312
|
+
i();
|
|
8313
|
+
} else t([]);
|
|
8314
|
+
});
|
|
8315
|
+
}
|
|
8316
|
+
async function J(e) {
|
|
8317
|
+
let t = (await Promise.all(e.map(q))).flat();
|
|
8318
|
+
if (d.accept) {
|
|
8319
|
+
let e = d.accept.split(",").map((e) => e.trim().toLowerCase());
|
|
8320
|
+
return t.filter((t) => {
|
|
8321
|
+
let n = t.type.toLowerCase(), r = "." + t.name.split(".").pop()?.toLowerCase();
|
|
8322
|
+
return e.some((e) => e.startsWith(".") ? r === e : e.endsWith("/*") ? n.startsWith(e.replace("/*", "/")) : n === e);
|
|
8323
|
+
});
|
|
8324
|
+
}
|
|
8325
|
+
return t;
|
|
8326
|
+
}
|
|
8327
|
+
function X() {
|
|
8247
8328
|
x.value || _.value?.click();
|
|
8248
8329
|
}
|
|
8249
|
-
function
|
|
8330
|
+
function Z(e) {
|
|
8250
8331
|
let t = e.target;
|
|
8251
8332
|
t.files && K(t.files), t.value = "";
|
|
8252
8333
|
}
|
|
8253
|
-
let
|
|
8254
|
-
function Z(e) {
|
|
8255
|
-
e.preventDefault(), !x.value && (X.value++, y.value = !0);
|
|
8256
|
-
}
|
|
8334
|
+
let Q = T(0);
|
|
8257
8335
|
function ee(e) {
|
|
8258
|
-
e.preventDefault();
|
|
8336
|
+
e.preventDefault(), !x.value && (Q.value++, y.value = !0);
|
|
8259
8337
|
}
|
|
8260
8338
|
function te(e) {
|
|
8261
|
-
e.preventDefault()
|
|
8339
|
+
e.preventDefault();
|
|
8262
8340
|
}
|
|
8263
8341
|
function ne(e) {
|
|
8264
|
-
e.preventDefault(), y.value = !1,
|
|
8342
|
+
e.preventDefault(), Q.value--, Q.value <= 0 && (y.value = !1, Q.value = 0);
|
|
8343
|
+
}
|
|
8344
|
+
async function re(e) {
|
|
8345
|
+
if (e.preventDefault(), y.value = !1, Q.value = 0, x.value) return;
|
|
8346
|
+
let t = e.dataTransfer?.items;
|
|
8347
|
+
if (t) {
|
|
8348
|
+
let e = [], n = !1;
|
|
8349
|
+
for (let r = 0; r < t.length; r++) {
|
|
8350
|
+
let i = t[r].webkitGetAsEntry?.();
|
|
8351
|
+
i && (e.push(i), i.isDirectory && (n = !0));
|
|
8352
|
+
}
|
|
8353
|
+
if (n) {
|
|
8354
|
+
let t = await J(e);
|
|
8355
|
+
t.length > 0 && K(t);
|
|
8356
|
+
return;
|
|
8357
|
+
}
|
|
8358
|
+
}
|
|
8359
|
+
e.dataTransfer?.files && K(e.dataTransfer.files);
|
|
8265
8360
|
}
|
|
8266
|
-
function
|
|
8361
|
+
function $(e) {
|
|
8267
8362
|
let t = d.modelValue.filter((t) => t.uid !== e.uid);
|
|
8268
8363
|
e.url && e.raw && URL.revokeObjectURL(e.url), f("remove", e, t), f("change", e, t), z(t);
|
|
8269
8364
|
}
|
|
8270
|
-
function
|
|
8365
|
+
function ie() {
|
|
8271
8366
|
d.modelValue.filter((e) => e.status === "ready").forEach((e) => G(e));
|
|
8272
8367
|
}
|
|
8273
|
-
let
|
|
8274
|
-
function
|
|
8368
|
+
let ae = T(!1), oe = T([]), se = T(0);
|
|
8369
|
+
function ce(e) {
|
|
8275
8370
|
if (!d.preview || !H(e)) return;
|
|
8276
8371
|
let t = [], n = 0;
|
|
8277
8372
|
(I.value && L.value ? [L.value] : d.modelValue).forEach((r) => {
|
|
@@ -8279,13 +8374,13 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8279
8374
|
let i = W(r);
|
|
8280
8375
|
i && (r.uid === e.uid && (n = t.length), t.push(i));
|
|
8281
8376
|
}
|
|
8282
|
-
}), t.length > 0 && (
|
|
8377
|
+
}), t.length > 0 && (oe.value = t, se.value = n, ae.value = !0);
|
|
8283
8378
|
}
|
|
8284
8379
|
n({
|
|
8285
|
-
submit:
|
|
8380
|
+
submit: ie,
|
|
8286
8381
|
clearFiles: () => z([])
|
|
8287
8382
|
});
|
|
8288
|
-
function
|
|
8383
|
+
function le(e) {
|
|
8289
8384
|
if (e === 0) return "0 B";
|
|
8290
8385
|
let t = 1024, n = [
|
|
8291
8386
|
"B",
|
|
@@ -8307,14 +8402,14 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8307
8402
|
accept: t.accept,
|
|
8308
8403
|
multiple: t.multiple || t.directory,
|
|
8309
8404
|
disabled: x.value
|
|
8310
|
-
}, t.directory ? { webkitdirectory: "" } : {}, { onChange:
|
|
8405
|
+
}, t.directory ? { webkitdirectory: "" } : {}, { onChange: Z }), null, 16, Ii),
|
|
8311
8406
|
s("div", {
|
|
8312
8407
|
class: v([N(p).e("trigger"), t.drag && N(p).e("dragger")]),
|
|
8313
|
-
onClick:
|
|
8314
|
-
onDragenter:
|
|
8315
|
-
onDragover:
|
|
8316
|
-
onDragleave:
|
|
8317
|
-
onDrop:
|
|
8408
|
+
onClick: X,
|
|
8409
|
+
onDragenter: ee,
|
|
8410
|
+
onDragover: te,
|
|
8411
|
+
onDragleave: ne,
|
|
8412
|
+
onDrop: re
|
|
8318
8413
|
}, [O(t.$slots, "default", {}, () => [t.drag ? (S(), o("div", {
|
|
8319
8414
|
key: 0,
|
|
8320
8415
|
class: v(N(p).e("drag-content"))
|
|
@@ -8385,9 +8480,9 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8385
8480
|
])], 2)) : a("", !0),
|
|
8386
8481
|
s("div", { class: v(N(p).e("card-actions")) }, [O(t.$slots, "card-actions", {
|
|
8387
8482
|
file: L.value,
|
|
8388
|
-
handleRemove:
|
|
8389
|
-
handlePreview:
|
|
8390
|
-
handleReplace:
|
|
8483
|
+
handleRemove: $,
|
|
8484
|
+
handlePreview: ce,
|
|
8485
|
+
handleReplace: X
|
|
8391
8486
|
}, () => [
|
|
8392
8487
|
d.preview ? (S(), i(N(Ce), {
|
|
8393
8488
|
key: 0,
|
|
@@ -8398,7 +8493,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8398
8493
|
type: d.type,
|
|
8399
8494
|
color: w.value,
|
|
8400
8495
|
title: "预览图片",
|
|
8401
|
-
onClick: n[0] ||= U((e) =>
|
|
8496
|
+
onClick: n[0] ||= U((e) => ce(L.value), ["stop"])
|
|
8402
8497
|
}, {
|
|
8403
8498
|
default: B(() => [...n[6] ||= [s("svg", {
|
|
8404
8499
|
viewBox: "0 0 24 24",
|
|
@@ -8442,7 +8537,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8442
8537
|
type: d.type,
|
|
8443
8538
|
color: w.value,
|
|
8444
8539
|
title: "替换图片",
|
|
8445
|
-
onClick: U(
|
|
8540
|
+
onClick: U(X, ["stop"])
|
|
8446
8541
|
}, {
|
|
8447
8542
|
default: B(() => [...n[7] ||= [s("svg", {
|
|
8448
8543
|
viewBox: "0 0 24 24",
|
|
@@ -8462,7 +8557,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8462
8557
|
type: d.type,
|
|
8463
8558
|
color: w.value,
|
|
8464
8559
|
title: "删除图片",
|
|
8465
|
-
onClick: n[1] ||= U((e) =>
|
|
8560
|
+
onClick: n[1] ||= U((e) => $(L.value), ["stop"])
|
|
8466
8561
|
}, {
|
|
8467
8562
|
default: B(() => [...n[8] ||= [s("svg", {
|
|
8468
8563
|
viewBox: "0 0 24 24",
|
|
@@ -8575,9 +8670,9 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8575
8670
|
])], 2)) : a("", !0),
|
|
8576
8671
|
s("div", { class: v(N(p).e("card-actions")) }, [O(t.$slots, "card-actions", {
|
|
8577
8672
|
file: e,
|
|
8578
|
-
handleRemove:
|
|
8579
|
-
handlePreview:
|
|
8580
|
-
handleReplace:
|
|
8673
|
+
handleRemove: $,
|
|
8674
|
+
handlePreview: ce,
|
|
8675
|
+
handleReplace: X
|
|
8581
8676
|
}, () => [d.preview && H(e) ? (S(), i(N(Ce), {
|
|
8582
8677
|
key: 0,
|
|
8583
8678
|
variant: "semi",
|
|
@@ -8587,7 +8682,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8587
8682
|
type: d.type,
|
|
8588
8683
|
color: w.value,
|
|
8589
8684
|
title: "预览图片",
|
|
8590
|
-
onClick: U((t) =>
|
|
8685
|
+
onClick: U((t) => ce(e), ["stop"])
|
|
8591
8686
|
}, {
|
|
8592
8687
|
default: B(() => [...n[12] ||= [s("svg", {
|
|
8593
8688
|
viewBox: "0 0 24 24",
|
|
@@ -8634,7 +8729,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8634
8729
|
type: d.type,
|
|
8635
8730
|
color: w.value,
|
|
8636
8731
|
title: "删除图片",
|
|
8637
|
-
onClick: U((t) =>
|
|
8732
|
+
onClick: U((t) => $(e), ["stop"])
|
|
8638
8733
|
}, {
|
|
8639
8734
|
default: B(() => [...n[13] ||= [s("svg", {
|
|
8640
8735
|
viewBox: "0 0 24 24",
|
|
@@ -8666,7 +8761,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8666
8761
|
"stroke-width": "1.5"
|
|
8667
8762
|
}, [...n[14] ||= [s("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }, null, -1), s("polyline", { points: "14 2 14 8 20 8" }, null, -1)]], 2)),
|
|
8668
8763
|
s("span", { class: v(N(p).e("file-name")) }, j(e.name), 3),
|
|
8669
|
-
s("span", { class: v(N(p).e("file-size")) }, j(
|
|
8764
|
+
s("span", { class: v(N(p).e("file-size")) }, j(le(e.size)), 3),
|
|
8670
8765
|
e.status === "success" ? (S(), o("svg", {
|
|
8671
8766
|
key: 0,
|
|
8672
8767
|
class: v([N(p).e("status-icon"), N(p).e("status-icon--success")]),
|
|
@@ -8694,7 +8789,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8694
8789
|
}, null, -1)]], 2)) : a("", !0),
|
|
8695
8790
|
s("span", {
|
|
8696
8791
|
class: v(N(p).e("remove")),
|
|
8697
|
-
onClick: U((t) =>
|
|
8792
|
+
onClick: U((t) => $(e), ["stop"])
|
|
8698
8793
|
}, [...n[17] ||= [s("svg", {
|
|
8699
8794
|
viewBox: "0 0 24 24",
|
|
8700
8795
|
fill: "none",
|
|
@@ -8750,7 +8845,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8750
8845
|
stroke: "currentColor",
|
|
8751
8846
|
"stroke-width": "1.5"
|
|
8752
8847
|
}, [s("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }), s("polyline", { points: "14 2 14 8 20 8" })], -1)]], 2))], 2),
|
|
8753
|
-
s("div", { class: v(N(p).e("item-info")) }, [s("span", { class: v(N(p).e("file-name")) }, j(e.name), 3), s("span", { class: v(N(p).e("file-size")) }, j(
|
|
8848
|
+
s("div", { class: v(N(p).e("item-info")) }, [s("span", { class: v(N(p).e("file-name")) }, j(e.name), 3), s("span", { class: v(N(p).e("file-size")) }, j(le(e.size)), 3)], 2),
|
|
8754
8849
|
e.status === "uploading" ? (S(), i(N(et), {
|
|
8755
8850
|
key: 0,
|
|
8756
8851
|
percentage: e.percentage,
|
|
@@ -8792,7 +8887,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8792
8887
|
y2: "18"
|
|
8793
8888
|
}, null, -1)]], 2)) : a("", !0), s("span", {
|
|
8794
8889
|
class: v(N(p).e("remove")),
|
|
8795
|
-
onClick: U((t) =>
|
|
8890
|
+
onClick: U((t) => $(e), ["stop"])
|
|
8796
8891
|
}, [...n[21] ||= [s("svg", {
|
|
8797
8892
|
viewBox: "0 0 24 24",
|
|
8798
8893
|
fill: "none",
|
|
@@ -8812,10 +8907,10 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8812
8907
|
], 2))), 128)) : a("", !0)], 2)) : a("", !0)
|
|
8813
8908
|
], 16), d.preview ? (S(), i(N(Ft), {
|
|
8814
8909
|
key: 0,
|
|
8815
|
-
modelValue:
|
|
8816
|
-
"onUpdate:modelValue": n[2] ||= (e) =>
|
|
8817
|
-
"url-list":
|
|
8818
|
-
"initial-index":
|
|
8910
|
+
modelValue: ae.value,
|
|
8911
|
+
"onUpdate:modelValue": n[2] ||= (e) => ae.value = e,
|
|
8912
|
+
"url-list": oe.value,
|
|
8913
|
+
"initial-index": se.value,
|
|
8819
8914
|
type: d.type,
|
|
8820
8915
|
color: w.value,
|
|
8821
8916
|
download: d.download
|
|
@@ -9139,7 +9234,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
9139
9234
|
error: "var(--cp-color-error)",
|
|
9140
9235
|
info: "var(--cp-color-info)"
|
|
9141
9236
|
}, d = T([]), f = 0;
|
|
9142
|
-
C(
|
|
9237
|
+
C(ee, {
|
|
9143
9238
|
registerItem: (e) => {
|
|
9144
9239
|
let t = `cp-desc-item-${f++}`, n = {
|
|
9145
9240
|
...e,
|
|
@@ -9351,7 +9446,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
9351
9446
|
__name: "descriptions-item",
|
|
9352
9447
|
props: ra,
|
|
9353
9448
|
setup(e) {
|
|
9354
|
-
let t = e, n = F(), r = m(
|
|
9449
|
+
let t = e, n = F(), r = m(ee, void 0), i = "";
|
|
9355
9450
|
return x(() => {
|
|
9356
9451
|
r && (i = r.registerItem({
|
|
9357
9452
|
label: t.label,
|