@cyberpunk-vue/components 1.9.23 → 1.9.24
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/index.cjs +1 -1
- package/dist/index.mjs +181 -138
- 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")),
|
|
@@ -5148,7 +5148,7 @@ var ae = {
|
|
|
5148
5148
|
stroke: "currentColor",
|
|
5149
5149
|
"stroke-width": "2"
|
|
5150
5150
|
}, [p("path", { d: "M18 6L6 18M6 6l12 12" })]), m = e, h = d, w = F(), E = P(), D = Y("dialog");
|
|
5151
|
-
C(
|
|
5151
|
+
C(te, {
|
|
5152
5152
|
type: M(m, "type"),
|
|
5153
5153
|
color: M(m, "color")
|
|
5154
5154
|
});
|
|
@@ -5169,9 +5169,9 @@ var ae = {
|
|
|
5169
5169
|
q.offsetX = e, q.offsetY = t, z.value.style.transform = `translate(${e}px, ${t}px)`;
|
|
5170
5170
|
}, Z = () => {
|
|
5171
5171
|
q.offsetX = 0, q.offsetY = 0, z.value && (z.value.style.transform = "");
|
|
5172
|
-
},
|
|
5172
|
+
}, Q = () => {
|
|
5173
5173
|
X(q.offsetX, q.offsetY);
|
|
5174
|
-
},
|
|
5174
|
+
}, ee = (e) => {
|
|
5175
5175
|
if (!m.draggable || !z.value) return;
|
|
5176
5176
|
let t = e.clientX, n = e.clientY, { offsetX: r, offsetY: i } = q, a = (e) => {
|
|
5177
5177
|
K.value ||= !0, X(r + e.clientX - t, i + e.clientY - n);
|
|
@@ -5179,9 +5179,9 @@ var ae = {
|
|
|
5179
5179
|
K.value = !1, document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", o);
|
|
5180
5180
|
};
|
|
5181
5181
|
document.addEventListener("mousemove", a), document.addEventListener("mouseup", o);
|
|
5182
|
-
},
|
|
5182
|
+
}, 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
5183
|
let e = {};
|
|
5184
|
-
return
|
|
5184
|
+
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
5185
|
}), ie = r(() => {
|
|
5186
5186
|
let e = typeof m.width == "number" ? `${m.width}px` : m.width, t = {
|
|
5187
5187
|
...$.value,
|
|
@@ -5253,18 +5253,18 @@ var ae = {
|
|
|
5253
5253
|
};
|
|
5254
5254
|
return R(() => m.modelValue, (e) => {
|
|
5255
5255
|
e ? (A.value = !0, k.value = !0, h("open"), _(() => {
|
|
5256
|
-
Z(), Oe(), document.addEventListener("keydown", Se), m.draggable && window.addEventListener("resize",
|
|
5256
|
+
Z(), Oe(), document.addEventListener("keydown", Se), m.draggable && window.addEventListener("resize", Q);
|
|
5257
5257
|
})) : k.value && _e();
|
|
5258
5258
|
}), R(k, (e) => {
|
|
5259
|
-
!e && m.modelValue && (h("close"), h("update:modelValue", !1), document.removeEventListener("keydown", Se), window.removeEventListener("resize",
|
|
5259
|
+
!e && m.modelValue && (h("close"), h("update:modelValue", !1), document.removeEventListener("keydown", Se), window.removeEventListener("resize", Q));
|
|
5260
5260
|
}), R(() => m.fullscreen, (e) => {
|
|
5261
5261
|
z.value && (e ? (J = z.value.style.transform, z.value.style.transform = "") : z.value.style.transform = J);
|
|
5262
5262
|
}), x(() => {
|
|
5263
5263
|
m.modelValue && (A.value = !0, k.value = !0, _(() => {
|
|
5264
|
-
Oe(), document.addEventListener("keydown", Se), m.draggable && window.addEventListener("resize",
|
|
5264
|
+
Oe(), document.addEventListener("keydown", Se), m.draggable && window.addEventListener("resize", Q);
|
|
5265
5265
|
}));
|
|
5266
5266
|
}), b(() => {
|
|
5267
|
-
ke(), document.removeEventListener("keydown", Se), window.removeEventListener("resize",
|
|
5267
|
+
ke(), document.removeEventListener("keydown", Se), window.removeEventListener("resize", Q);
|
|
5268
5268
|
}), c({
|
|
5269
5269
|
close: ve,
|
|
5270
5270
|
resetPosition: Z,
|
|
@@ -5307,7 +5307,7 @@ var ae = {
|
|
|
5307
5307
|
ref: H,
|
|
5308
5308
|
class: v(ce.value),
|
|
5309
5309
|
style: y(e.headerStyle),
|
|
5310
|
-
onMousedown:
|
|
5310
|
+
onMousedown: ee
|
|
5311
5311
|
}, [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
5312
|
key: 0,
|
|
5313
5313
|
class: v(N(D).e("close")),
|
|
@@ -6154,7 +6154,7 @@ var ae = {
|
|
|
6154
6154
|
setup(e, { expose: c, emit: d }) {
|
|
6155
6155
|
let f = e, p = d, m = F(), _ = Y("notification"), y = T(!1), C = r(() => !!f.id), w = null, E = 0, D = 0, k = () => {
|
|
6156
6156
|
f.duration <= 0 || (D <= 0 && (D = f.duration), E = Date.now(), w = setTimeout(() => {
|
|
6157
|
-
|
|
6157
|
+
ee();
|
|
6158
6158
|
}, D));
|
|
6159
6159
|
}, M = () => {
|
|
6160
6160
|
w && (clearTimeout(w), w = null, D -= Date.now() - E, D < 0 && (D = 0));
|
|
@@ -6185,11 +6185,11 @@ var ae = {
|
|
|
6185
6185
|
_.is("has-icon", f.type !== "default" || !!m.icon),
|
|
6186
6186
|
_.is("closable", f.showClose),
|
|
6187
6187
|
_.is("selectable", f.selectable)
|
|
6188
|
-
]), Z = r(() => h(f.message) ? f.message : typeof f.message == "function" ? f.message() : null),
|
|
6188
|
+
]), Z = r(() => h(f.message) ? f.message : typeof f.message == "function" ? f.message() : null), Q = r(() => typeof f.message == "string"), ee = () => {
|
|
6189
6189
|
y.value = !1;
|
|
6190
|
-
},
|
|
6190
|
+
}, te = () => {
|
|
6191
6191
|
p("click");
|
|
6192
|
-
},
|
|
6192
|
+
}, ne = r(() => H.value ? `${_.namespace}-notification-right` : `${_.namespace}-notification-left`), re = () => {
|
|
6193
6193
|
f.onClose?.();
|
|
6194
6194
|
}, $ = () => {
|
|
6195
6195
|
p("destroy");
|
|
@@ -6200,7 +6200,7 @@ var ae = {
|
|
|
6200
6200
|
info: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
6201
6201
|
}, ae = r(() => f.type === "default" || f.type === "primary" ? null : ie[f.type] || null);
|
|
6202
6202
|
return R(() => f.modelValue, (e) => {
|
|
6203
|
-
e ? (y.value = !0, D = f.duration, k()) :
|
|
6203
|
+
e ? (y.value = !0, D = f.duration, k()) : ee();
|
|
6204
6204
|
}), R(y, (e) => {
|
|
6205
6205
|
!e && f.modelValue && (P(), p("close"), p("update:modelValue", !1));
|
|
6206
6206
|
}), x(() => {
|
|
@@ -6208,11 +6208,11 @@ var ae = {
|
|
|
6208
6208
|
}), b(() => {
|
|
6209
6209
|
P();
|
|
6210
6210
|
}), c({
|
|
6211
|
-
close:
|
|
6211
|
+
close: ee,
|
|
6212
6212
|
visible: y
|
|
6213
6213
|
}), (e, r) => C.value ? (S(), i(n, {
|
|
6214
6214
|
key: 1,
|
|
6215
|
-
name:
|
|
6215
|
+
name: ne.value,
|
|
6216
6216
|
onBeforeLeave: re,
|
|
6217
6217
|
onAfterLeave: $
|
|
6218
6218
|
}, {
|
|
@@ -6222,7 +6222,7 @@ var ae = {
|
|
|
6222
6222
|
role: "alert",
|
|
6223
6223
|
onMouseenter: I,
|
|
6224
6224
|
onMouseleave: z,
|
|
6225
|
-
onClick:
|
|
6225
|
+
onClick: te
|
|
6226
6226
|
}), [
|
|
6227
6227
|
s("div", { class: v(N(_).e("decor")) }, null, 2),
|
|
6228
6228
|
ae.value || N(m).icon ? (S(), o("div", {
|
|
@@ -6234,10 +6234,10 @@ var ae = {
|
|
|
6234
6234
|
key: 0,
|
|
6235
6235
|
class: v(N(_).e("title"))
|
|
6236
6236
|
}, [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 &&
|
|
6237
|
+
s("div", { class: v(N(_).e("content")) }, [O(e.$slots, "default", {}, () => [e.dangerouslyUseHTMLString && Q.value ? (S(), o("p", {
|
|
6238
6238
|
key: 0,
|
|
6239
6239
|
innerHTML: e.message
|
|
6240
|
-
}, null, 8, zr)) :
|
|
6240
|
+
}, 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
6241
|
N(m).actions ? (S(), o("div", {
|
|
6242
6242
|
key: 1,
|
|
6243
6243
|
class: v(N(_).e("actions")),
|
|
@@ -6248,7 +6248,7 @@ var ae = {
|
|
|
6248
6248
|
key: 1,
|
|
6249
6249
|
class: v(N(_).e("close")),
|
|
6250
6250
|
"aria-label": "Close",
|
|
6251
|
-
onClick: U(
|
|
6251
|
+
onClick: U(ee, ["stop"])
|
|
6252
6252
|
}, [...r[3] ||= [s("svg", {
|
|
6253
6253
|
viewBox: "0 0 24 24",
|
|
6254
6254
|
width: "14",
|
|
@@ -6267,7 +6267,7 @@ var ae = {
|
|
|
6267
6267
|
key: 0,
|
|
6268
6268
|
to: "body"
|
|
6269
6269
|
}, [u(n, {
|
|
6270
|
-
name:
|
|
6270
|
+
name: ne.value,
|
|
6271
6271
|
onBeforeLeave: re,
|
|
6272
6272
|
onAfterLeave: $
|
|
6273
6273
|
}, {
|
|
@@ -6277,7 +6277,7 @@ var ae = {
|
|
|
6277
6277
|
role: "alert",
|
|
6278
6278
|
onMouseenter: I,
|
|
6279
6279
|
onMouseleave: z,
|
|
6280
|
-
onClick:
|
|
6280
|
+
onClick: te
|
|
6281
6281
|
}), [
|
|
6282
6282
|
s("div", { class: v(N(_).e("decor")) }, null, 2),
|
|
6283
6283
|
ae.value || N(m).icon ? (S(), o("div", {
|
|
@@ -6289,10 +6289,10 @@ var ae = {
|
|
|
6289
6289
|
key: 0,
|
|
6290
6290
|
class: v(N(_).e("title"))
|
|
6291
6291
|
}, [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 &&
|
|
6292
|
+
s("div", { class: v(N(_).e("content")) }, [O(e.$slots, "default", {}, () => [e.dangerouslyUseHTMLString && Q.value ? (S(), o("p", {
|
|
6293
6293
|
key: 0,
|
|
6294
6294
|
innerHTML: e.message
|
|
6295
|
-
}, null, 8, Fr)) :
|
|
6295
|
+
}, 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
6296
|
N(m).actions ? (S(), o("div", {
|
|
6297
6297
|
key: 1,
|
|
6298
6298
|
class: v(N(_).e("actions")),
|
|
@@ -6303,7 +6303,7 @@ var ae = {
|
|
|
6303
6303
|
key: 1,
|
|
6304
6304
|
class: v(N(_).e("close")),
|
|
6305
6305
|
"aria-label": "Close",
|
|
6306
|
-
onClick: U(
|
|
6306
|
+
onClick: U(ee, ["stop"])
|
|
6307
6307
|
}, [...r[2] ||= [s("svg", {
|
|
6308
6308
|
viewBox: "0 0 24 24",
|
|
6309
6309
|
width: "14",
|
|
@@ -6769,7 +6769,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
6769
6769
|
if (i.disabled) return;
|
|
6770
6770
|
let t = i.pagerCount - 2;
|
|
6771
6771
|
U(e === "left-ellipsis" ? Math.max(1, f.value - t) : Math.min(m.value, f.value + t));
|
|
6772
|
-
}, Z = T(""),
|
|
6772
|
+
}, Z = T(""), Q = () => {
|
|
6773
6773
|
if (i.disabled) return;
|
|
6774
6774
|
let e = parseInt(Z.value, 10);
|
|
6775
6775
|
!isNaN(e) && e >= 1 && e <= m.value && U(e), Z.value = "";
|
|
@@ -7007,7 +7007,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
7007
7007
|
min: 1,
|
|
7008
7008
|
max: m.value,
|
|
7009
7009
|
disabled: t.disabled,
|
|
7010
|
-
onKeydown: H(
|
|
7010
|
+
onKeydown: H(Q, ["enter"])
|
|
7011
7011
|
}, null, 42, ai), [[I, Z.value]]),
|
|
7012
7012
|
n[5] ||= l(" 页 ", -1)
|
|
7013
7013
|
], 2)]) : a("", !0)], 64))), 128))], 6));
|
|
@@ -7228,7 +7228,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
7228
7228
|
emits: fi,
|
|
7229
7229
|
setup(t, { expose: d, emit: f }) {
|
|
7230
7230
|
let p = t, m = f, h = Y("table"), g = T([]), _ = 0;
|
|
7231
|
-
C(
|
|
7231
|
+
C(ne, {
|
|
7232
7232
|
registerColumn: (e) => {
|
|
7233
7233
|
let t = `cp-col-${_++}`, n = {
|
|
7234
7234
|
...e,
|
|
@@ -7298,10 +7298,10 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
7298
7298
|
if (q.value && e[q.value]) return !0;
|
|
7299
7299
|
let t = e[K.value];
|
|
7300
7300
|
return Array.isArray(t) && t.length > 0;
|
|
7301
|
-
},
|
|
7301
|
+
}, Q = (e, t) => {
|
|
7302
7302
|
let n = H(e, -1), r = new Set(J.value), i = r.has(n), a = t === void 0 ? !i : t;
|
|
7303
7303
|
a ? r.add(n) : r.delete(n), J.value = r, m("expand-change", e, a);
|
|
7304
|
-
},
|
|
7304
|
+
}, ee = () => {
|
|
7305
7305
|
let e = /* @__PURE__ */ new Set(), t = (n) => {
|
|
7306
7306
|
for (let r of n) {
|
|
7307
7307
|
let n = H(r, -1);
|
|
@@ -7313,7 +7313,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
7313
7313
|
}
|
|
7314
7314
|
};
|
|
7315
7315
|
t(p.data), J.value = e;
|
|
7316
|
-
},
|
|
7316
|
+
}, te = () => {
|
|
7317
7317
|
J.value = /* @__PURE__ */ new Set();
|
|
7318
7318
|
}, re = r(() => {
|
|
7319
7319
|
if (!G.value) return [];
|
|
@@ -7385,9 +7385,9 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
7385
7385
|
let t = z.value;
|
|
7386
7386
|
z.value = e, m("current-change", e, t);
|
|
7387
7387
|
},
|
|
7388
|
-
toggleRowExpansion:
|
|
7389
|
-
expandAll:
|
|
7390
|
-
collapseAll:
|
|
7388
|
+
toggleRowExpansion: Q,
|
|
7389
|
+
expandAll: ee,
|
|
7390
|
+
collapseAll: te,
|
|
7391
7391
|
toggleRowExpand: ue
|
|
7392
7392
|
}), (t, r) => (S(), o("div", {
|
|
7393
7393
|
class: v(de.value),
|
|
@@ -7502,7 +7502,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
7502
7502
|
ie(n)?.hasChildren ? (S(), o("span", {
|
|
7503
7503
|
key: 1,
|
|
7504
7504
|
class: v([N(h).e("expand-icon"), N(h).is("expanded", ie(n)?.expanded)]),
|
|
7505
|
-
onClick: U((e) =>
|
|
7505
|
+
onClick: U((e) => Q(n), ["stop"])
|
|
7506
7506
|
}, [...r[5] ||= [s("svg", {
|
|
7507
7507
|
viewBox: "0 0 16 16",
|
|
7508
7508
|
width: "14",
|
|
@@ -7589,7 +7589,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
7589
7589
|
__name: "table-column",
|
|
7590
7590
|
props: xi,
|
|
7591
7591
|
setup(e) {
|
|
7592
|
-
let t = e, n = F(), r = m(
|
|
7592
|
+
let t = e, n = F(), r = m(ne, null), i = "";
|
|
7593
7593
|
return x(() => {
|
|
7594
7594
|
r && (i = r.registerColumn({
|
|
7595
7595
|
prop: t.prop,
|
|
@@ -8243,35 +8243,78 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8243
8243
|
z(e);
|
|
8244
8244
|
} else for (let e of r) G(e);
|
|
8245
8245
|
}
|
|
8246
|
-
function q() {
|
|
8246
|
+
function q(e) {
|
|
8247
|
+
return new Promise((t) => {
|
|
8248
|
+
if (e.isFile) e.file((e) => t([e]), () => t([]));
|
|
8249
|
+
else if (e.isDirectory) {
|
|
8250
|
+
let n = e.createReader(), r = [], i = () => {
|
|
8251
|
+
n.readEntries(async (e) => {
|
|
8252
|
+
if (e.length === 0) {
|
|
8253
|
+
t(r);
|
|
8254
|
+
return;
|
|
8255
|
+
}
|
|
8256
|
+
let n = await Promise.all(e.map(q));
|
|
8257
|
+
r.push(...n.flat()), i();
|
|
8258
|
+
}, () => t(r));
|
|
8259
|
+
};
|
|
8260
|
+
i();
|
|
8261
|
+
} else t([]);
|
|
8262
|
+
});
|
|
8263
|
+
}
|
|
8264
|
+
async function J(e) {
|
|
8265
|
+
let t = (await Promise.all(e.map(q))).flat();
|
|
8266
|
+
if (d.accept) {
|
|
8267
|
+
let e = d.accept.split(",").map((e) => e.trim().toLowerCase());
|
|
8268
|
+
return t.filter((t) => {
|
|
8269
|
+
let n = t.type.toLowerCase(), r = "." + t.name.split(".").pop()?.toLowerCase();
|
|
8270
|
+
return e.some((e) => e.startsWith(".") ? r === e : e.endsWith("/*") ? n.startsWith(e.replace("/*", "/")) : n === e);
|
|
8271
|
+
});
|
|
8272
|
+
}
|
|
8273
|
+
return t;
|
|
8274
|
+
}
|
|
8275
|
+
function X() {
|
|
8247
8276
|
x.value || _.value?.click();
|
|
8248
8277
|
}
|
|
8249
|
-
function
|
|
8278
|
+
function Z(e) {
|
|
8250
8279
|
let t = e.target;
|
|
8251
8280
|
t.files && K(t.files), t.value = "";
|
|
8252
8281
|
}
|
|
8253
|
-
let
|
|
8254
|
-
function Z(e) {
|
|
8255
|
-
e.preventDefault(), !x.value && (X.value++, y.value = !0);
|
|
8256
|
-
}
|
|
8282
|
+
let Q = T(0);
|
|
8257
8283
|
function ee(e) {
|
|
8258
|
-
e.preventDefault();
|
|
8284
|
+
e.preventDefault(), !x.value && (Q.value++, y.value = !0);
|
|
8259
8285
|
}
|
|
8260
8286
|
function te(e) {
|
|
8261
|
-
e.preventDefault()
|
|
8287
|
+
e.preventDefault();
|
|
8262
8288
|
}
|
|
8263
8289
|
function ne(e) {
|
|
8264
|
-
e.preventDefault(), y.value = !1,
|
|
8290
|
+
e.preventDefault(), Q.value--, Q.value <= 0 && (y.value = !1, Q.value = 0);
|
|
8265
8291
|
}
|
|
8266
|
-
function
|
|
8292
|
+
async function re(e) {
|
|
8293
|
+
if (e.preventDefault(), y.value = !1, Q.value = 0, x.value) return;
|
|
8294
|
+
let t = e.dataTransfer?.items;
|
|
8295
|
+
if (t) {
|
|
8296
|
+
let e = [], n = !1;
|
|
8297
|
+
for (let r = 0; r < t.length; r++) {
|
|
8298
|
+
let i = t[r].webkitGetAsEntry?.();
|
|
8299
|
+
i && (e.push(i), i.isDirectory && (n = !0));
|
|
8300
|
+
}
|
|
8301
|
+
if (n) {
|
|
8302
|
+
let t = await J(e);
|
|
8303
|
+
t.length > 0 && K(t);
|
|
8304
|
+
return;
|
|
8305
|
+
}
|
|
8306
|
+
}
|
|
8307
|
+
e.dataTransfer?.files && K(e.dataTransfer.files);
|
|
8308
|
+
}
|
|
8309
|
+
function $(e) {
|
|
8267
8310
|
let t = d.modelValue.filter((t) => t.uid !== e.uid);
|
|
8268
8311
|
e.url && e.raw && URL.revokeObjectURL(e.url), f("remove", e, t), f("change", e, t), z(t);
|
|
8269
8312
|
}
|
|
8270
|
-
function
|
|
8313
|
+
function ie() {
|
|
8271
8314
|
d.modelValue.filter((e) => e.status === "ready").forEach((e) => G(e));
|
|
8272
8315
|
}
|
|
8273
|
-
let
|
|
8274
|
-
function
|
|
8316
|
+
let ae = T(!1), oe = T([]), se = T(0);
|
|
8317
|
+
function ce(e) {
|
|
8275
8318
|
if (!d.preview || !H(e)) return;
|
|
8276
8319
|
let t = [], n = 0;
|
|
8277
8320
|
(I.value && L.value ? [L.value] : d.modelValue).forEach((r) => {
|
|
@@ -8279,13 +8322,13 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8279
8322
|
let i = W(r);
|
|
8280
8323
|
i && (r.uid === e.uid && (n = t.length), t.push(i));
|
|
8281
8324
|
}
|
|
8282
|
-
}), t.length > 0 && (
|
|
8325
|
+
}), t.length > 0 && (oe.value = t, se.value = n, ae.value = !0);
|
|
8283
8326
|
}
|
|
8284
8327
|
n({
|
|
8285
|
-
submit:
|
|
8328
|
+
submit: ie,
|
|
8286
8329
|
clearFiles: () => z([])
|
|
8287
8330
|
});
|
|
8288
|
-
function
|
|
8331
|
+
function le(e) {
|
|
8289
8332
|
if (e === 0) return "0 B";
|
|
8290
8333
|
let t = 1024, n = [
|
|
8291
8334
|
"B",
|
|
@@ -8307,14 +8350,14 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8307
8350
|
accept: t.accept,
|
|
8308
8351
|
multiple: t.multiple || t.directory,
|
|
8309
8352
|
disabled: x.value
|
|
8310
|
-
}, t.directory ? { webkitdirectory: "" } : {}, { onChange:
|
|
8353
|
+
}, t.directory ? { webkitdirectory: "" } : {}, { onChange: Z }), null, 16, Ii),
|
|
8311
8354
|
s("div", {
|
|
8312
8355
|
class: v([N(p).e("trigger"), t.drag && N(p).e("dragger")]),
|
|
8313
|
-
onClick:
|
|
8314
|
-
onDragenter:
|
|
8315
|
-
onDragover:
|
|
8316
|
-
onDragleave:
|
|
8317
|
-
onDrop:
|
|
8356
|
+
onClick: X,
|
|
8357
|
+
onDragenter: ee,
|
|
8358
|
+
onDragover: te,
|
|
8359
|
+
onDragleave: ne,
|
|
8360
|
+
onDrop: re
|
|
8318
8361
|
}, [O(t.$slots, "default", {}, () => [t.drag ? (S(), o("div", {
|
|
8319
8362
|
key: 0,
|
|
8320
8363
|
class: v(N(p).e("drag-content"))
|
|
@@ -8385,9 +8428,9 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8385
8428
|
])], 2)) : a("", !0),
|
|
8386
8429
|
s("div", { class: v(N(p).e("card-actions")) }, [O(t.$slots, "card-actions", {
|
|
8387
8430
|
file: L.value,
|
|
8388
|
-
handleRemove:
|
|
8389
|
-
handlePreview:
|
|
8390
|
-
handleReplace:
|
|
8431
|
+
handleRemove: $,
|
|
8432
|
+
handlePreview: ce,
|
|
8433
|
+
handleReplace: X
|
|
8391
8434
|
}, () => [
|
|
8392
8435
|
d.preview ? (S(), i(N(Ce), {
|
|
8393
8436
|
key: 0,
|
|
@@ -8398,7 +8441,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8398
8441
|
type: d.type,
|
|
8399
8442
|
color: w.value,
|
|
8400
8443
|
title: "预览图片",
|
|
8401
|
-
onClick: n[0] ||= U((e) =>
|
|
8444
|
+
onClick: n[0] ||= U((e) => ce(L.value), ["stop"])
|
|
8402
8445
|
}, {
|
|
8403
8446
|
default: B(() => [...n[6] ||= [s("svg", {
|
|
8404
8447
|
viewBox: "0 0 24 24",
|
|
@@ -8442,7 +8485,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8442
8485
|
type: d.type,
|
|
8443
8486
|
color: w.value,
|
|
8444
8487
|
title: "替换图片",
|
|
8445
|
-
onClick: U(
|
|
8488
|
+
onClick: U(X, ["stop"])
|
|
8446
8489
|
}, {
|
|
8447
8490
|
default: B(() => [...n[7] ||= [s("svg", {
|
|
8448
8491
|
viewBox: "0 0 24 24",
|
|
@@ -8462,7 +8505,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8462
8505
|
type: d.type,
|
|
8463
8506
|
color: w.value,
|
|
8464
8507
|
title: "删除图片",
|
|
8465
|
-
onClick: n[1] ||= U((e) =>
|
|
8508
|
+
onClick: n[1] ||= U((e) => $(L.value), ["stop"])
|
|
8466
8509
|
}, {
|
|
8467
8510
|
default: B(() => [...n[8] ||= [s("svg", {
|
|
8468
8511
|
viewBox: "0 0 24 24",
|
|
@@ -8575,9 +8618,9 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8575
8618
|
])], 2)) : a("", !0),
|
|
8576
8619
|
s("div", { class: v(N(p).e("card-actions")) }, [O(t.$slots, "card-actions", {
|
|
8577
8620
|
file: e,
|
|
8578
|
-
handleRemove:
|
|
8579
|
-
handlePreview:
|
|
8580
|
-
handleReplace:
|
|
8621
|
+
handleRemove: $,
|
|
8622
|
+
handlePreview: ce,
|
|
8623
|
+
handleReplace: X
|
|
8581
8624
|
}, () => [d.preview && H(e) ? (S(), i(N(Ce), {
|
|
8582
8625
|
key: 0,
|
|
8583
8626
|
variant: "semi",
|
|
@@ -8587,7 +8630,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8587
8630
|
type: d.type,
|
|
8588
8631
|
color: w.value,
|
|
8589
8632
|
title: "预览图片",
|
|
8590
|
-
onClick: U((t) =>
|
|
8633
|
+
onClick: U((t) => ce(e), ["stop"])
|
|
8591
8634
|
}, {
|
|
8592
8635
|
default: B(() => [...n[12] ||= [s("svg", {
|
|
8593
8636
|
viewBox: "0 0 24 24",
|
|
@@ -8634,7 +8677,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8634
8677
|
type: d.type,
|
|
8635
8678
|
color: w.value,
|
|
8636
8679
|
title: "删除图片",
|
|
8637
|
-
onClick: U((t) =>
|
|
8680
|
+
onClick: U((t) => $(e), ["stop"])
|
|
8638
8681
|
}, {
|
|
8639
8682
|
default: B(() => [...n[13] ||= [s("svg", {
|
|
8640
8683
|
viewBox: "0 0 24 24",
|
|
@@ -8666,7 +8709,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8666
8709
|
"stroke-width": "1.5"
|
|
8667
8710
|
}, [...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
8711
|
s("span", { class: v(N(p).e("file-name")) }, j(e.name), 3),
|
|
8669
|
-
s("span", { class: v(N(p).e("file-size")) }, j(
|
|
8712
|
+
s("span", { class: v(N(p).e("file-size")) }, j(le(e.size)), 3),
|
|
8670
8713
|
e.status === "success" ? (S(), o("svg", {
|
|
8671
8714
|
key: 0,
|
|
8672
8715
|
class: v([N(p).e("status-icon"), N(p).e("status-icon--success")]),
|
|
@@ -8694,7 +8737,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8694
8737
|
}, null, -1)]], 2)) : a("", !0),
|
|
8695
8738
|
s("span", {
|
|
8696
8739
|
class: v(N(p).e("remove")),
|
|
8697
|
-
onClick: U((t) =>
|
|
8740
|
+
onClick: U((t) => $(e), ["stop"])
|
|
8698
8741
|
}, [...n[17] ||= [s("svg", {
|
|
8699
8742
|
viewBox: "0 0 24 24",
|
|
8700
8743
|
fill: "none",
|
|
@@ -8750,7 +8793,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8750
8793
|
stroke: "currentColor",
|
|
8751
8794
|
"stroke-width": "1.5"
|
|
8752
8795
|
}, [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(
|
|
8796
|
+
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
8797
|
e.status === "uploading" ? (S(), i(N(et), {
|
|
8755
8798
|
key: 0,
|
|
8756
8799
|
percentage: e.percentage,
|
|
@@ -8792,7 +8835,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8792
8835
|
y2: "18"
|
|
8793
8836
|
}, null, -1)]], 2)) : a("", !0), s("span", {
|
|
8794
8837
|
class: v(N(p).e("remove")),
|
|
8795
|
-
onClick: U((t) =>
|
|
8838
|
+
onClick: U((t) => $(e), ["stop"])
|
|
8796
8839
|
}, [...n[21] ||= [s("svg", {
|
|
8797
8840
|
viewBox: "0 0 24 24",
|
|
8798
8841
|
fill: "none",
|
|
@@ -8812,10 +8855,10 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
8812
8855
|
], 2))), 128)) : a("", !0)], 2)) : a("", !0)
|
|
8813
8856
|
], 16), d.preview ? (S(), i(N(Ft), {
|
|
8814
8857
|
key: 0,
|
|
8815
|
-
modelValue:
|
|
8816
|
-
"onUpdate:modelValue": n[2] ||= (e) =>
|
|
8817
|
-
"url-list":
|
|
8818
|
-
"initial-index":
|
|
8858
|
+
modelValue: ae.value,
|
|
8859
|
+
"onUpdate:modelValue": n[2] ||= (e) => ae.value = e,
|
|
8860
|
+
"url-list": oe.value,
|
|
8861
|
+
"initial-index": se.value,
|
|
8819
8862
|
type: d.type,
|
|
8820
8863
|
color: w.value,
|
|
8821
8864
|
download: d.download
|
|
@@ -9139,7 +9182,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
9139
9182
|
error: "var(--cp-color-error)",
|
|
9140
9183
|
info: "var(--cp-color-info)"
|
|
9141
9184
|
}, d = T([]), f = 0;
|
|
9142
|
-
C(
|
|
9185
|
+
C(ee, {
|
|
9143
9186
|
registerItem: (e) => {
|
|
9144
9187
|
let t = `cp-desc-item-${f++}`, n = {
|
|
9145
9188
|
...e,
|
|
@@ -9351,7 +9394,7 @@ var Zr = $(Vr), Qr = ie(Jr, "$notify"), $r = /* @__PURE__ */ d({
|
|
|
9351
9394
|
__name: "descriptions-item",
|
|
9352
9395
|
props: ra,
|
|
9353
9396
|
setup(e) {
|
|
9354
|
-
let t = e, n = F(), r = m(
|
|
9397
|
+
let t = e, n = F(), r = m(ee, void 0), i = "";
|
|
9355
9398
|
return x(() => {
|
|
9356
9399
|
r && (i = r.registerItem({
|
|
9357
9400
|
label: t.label,
|