@cyberpunk-vue/components 1.14.4 → 1.14.5
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/image-preview/index.d.ts +15 -0
- package/dist/image-preview/src/image-preview.d.ts +15 -0
- package/dist/image-preview/src/image-preview.vue.d.ts +9 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +150 -118
- package/dist/text/index.d.ts +15 -0
- package/dist/text/src/text.d.ts +18 -0
- package/dist/text/src/text.vue.d.ts +9 -0
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -2370,6 +2370,10 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
2370
2370
|
type: Boolean,
|
|
2371
2371
|
default: !1
|
|
2372
2372
|
},
|
|
2373
|
+
ellipsisPosition: {
|
|
2374
|
+
type: String,
|
|
2375
|
+
default: "end"
|
|
2376
|
+
},
|
|
2373
2377
|
lineClamp: {
|
|
2374
2378
|
type: [Number, String],
|
|
2375
2379
|
default: void 0
|
|
@@ -2470,73 +2474,94 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
2470
2474
|
name: `${Q}Text`,
|
|
2471
2475
|
__name: "text",
|
|
2472
2476
|
props: Qt,
|
|
2473
|
-
setup(
|
|
2474
|
-
let
|
|
2477
|
+
setup(n) {
|
|
2478
|
+
let i = X(n, "text"), u = h(), d = H(), f = Z("text"), p = {
|
|
2475
2479
|
primary: "var(--cp-color-primary)",
|
|
2476
2480
|
success: "var(--cp-color-success)",
|
|
2477
2481
|
warning: "var(--cp-color-warning)",
|
|
2478
2482
|
error: "var(--cp-color-error)",
|
|
2479
2483
|
info: "var(--cp-color-info)"
|
|
2480
|
-
},
|
|
2484
|
+
}, m = {
|
|
2481
2485
|
sm: 12,
|
|
2482
2486
|
md: 14,
|
|
2483
2487
|
lg: 16
|
|
2484
|
-
},
|
|
2485
|
-
let e =
|
|
2488
|
+
}, g = a(() => {
|
|
2489
|
+
let e = u?.vnode.props;
|
|
2486
2490
|
return !!e && "size" in e;
|
|
2487
|
-
}),
|
|
2488
|
-
let e =
|
|
2491
|
+
}), _ = a(() => {
|
|
2492
|
+
let e = i.lineClamp;
|
|
2489
2493
|
return e != null && e !== "" && e !== "none" && Number(e) > 0;
|
|
2490
|
-
}),
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
r.
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2494
|
+
}), v = a(() => i.ellipsis && !_.value), y = a(() => i.ellipsisPosition === "start" || i.ellipsisPosition === "middle" ? i.ellipsisPosition : "end"), b = (n) => {
|
|
2495
|
+
if (n == null || typeof n == "boolean") return "";
|
|
2496
|
+
if (typeof n == "string" || typeof n == "number") return String(n);
|
|
2497
|
+
if (Array.isArray(n)) return n.map((e) => b(e)).join("");
|
|
2498
|
+
let i = n;
|
|
2499
|
+
return i.type === e ? "" : i.type === r || i.type === t || typeof i.type == "string" ? b(i.children) : "";
|
|
2500
|
+
}, x = () => b(d.default?.()).replace(/\s+/g, " ").trim(), C = () => v.value && y.value === "middle" && x().length > 0, T = () => {
|
|
2501
|
+
let e = x();
|
|
2502
|
+
if (e.length <= 8) return {
|
|
2503
|
+
start: e,
|
|
2504
|
+
end: ""
|
|
2505
|
+
};
|
|
2506
|
+
let t = Math.max(4, Math.min(16, Math.ceil(e.length * .4)));
|
|
2507
|
+
return {
|
|
2508
|
+
start: e.slice(0, -t),
|
|
2509
|
+
end: e.slice(-t)
|
|
2510
|
+
};
|
|
2511
|
+
}, E = a(() => [
|
|
2512
|
+
f.b(),
|
|
2513
|
+
f.m(`level-${i.level}`),
|
|
2514
|
+
f.m(`align-${i.align}`),
|
|
2515
|
+
f.is("ellipsis", v.value),
|
|
2516
|
+
v.value ? f.m(`ellipsis-${y.value}`) : "",
|
|
2517
|
+
f.is("line-clamp", _.value),
|
|
2518
|
+
f.is("underline", i.underline),
|
|
2519
|
+
f.is("boxed", i.boxed),
|
|
2520
|
+
f.is("dashed", i.dashed),
|
|
2521
|
+
f.is("bold", i.bold),
|
|
2522
|
+
f.is("italic", i.italic),
|
|
2523
|
+
f.is("strikethrough", i.strikethrough),
|
|
2524
|
+
f.is("glow", i.glow),
|
|
2525
|
+
f.is("glow-pulse", i.glowPulse),
|
|
2526
|
+
f.is("light-wave", i.lightWave),
|
|
2527
|
+
f.is("marker", i.marker),
|
|
2528
|
+
f.is("overlap", i.overlap),
|
|
2529
|
+
f.is("typed", i.type !== "default" && !i.color),
|
|
2530
|
+
f.is("custom-color", !!i.color),
|
|
2531
|
+
f.is("unselectable", i.unselectable)
|
|
2532
|
+
]), O = a(() => {
|
|
2511
2533
|
let e = {};
|
|
2512
|
-
|
|
2513
|
-
let
|
|
2514
|
-
if (
|
|
2515
|
-
let
|
|
2516
|
-
e.animation = `${`cp-text-glow-pulse ${
|
|
2534
|
+
i.color ? e["--cp-text-color"] = i.color : i.type && i.type !== "default" && p[i.type] && (e["--cp-text-color"] = p[i.type]);
|
|
2535
|
+
let t = i.level === "body" || g.value ? re(i.size, m) : "";
|
|
2536
|
+
if (t && (e["--cp-text-size"] = t), _.value && (e["--cp-text-line-clamp"] = String(i.lineClamp)), i.glow && i.glowIntensity && (e["--cp-text-glow-intensity"] = `${i.glowIntensity}px`), i.marker && i.markerColor && (e["--cp-text-marker-color"] = i.markerColor), i.glowPulse && i.glowPulseDuration && (e["--cp-text-pulse-duration"] = ne(i.glowPulseDuration)), i.lightWave && i.lightWaveDuration && (e["--cp-text-wave-duration"] = ne(i.lightWaveDuration)), i.glowPulse && i.lightWave) {
|
|
2537
|
+
let t = ne(i.glowPulseDuration), n = ne(i.lightWaveDuration);
|
|
2538
|
+
e.animation = `${`cp-text-glow-pulse ${t} ease-in-out infinite`}, ${`cp-text-light-wave ${n} linear infinite`}`;
|
|
2517
2539
|
}
|
|
2518
|
-
return
|
|
2519
|
-
}),
|
|
2540
|
+
return i.overlap && (e["--cp-text-overlap-offset-x"] = `${i.overlapOffsetX}px`, e["--cp-text-overlap-offset-y"] = `${i.overlapOffsetY}px`, i.overlapColor && (e["--cp-text-overlap-color"] = i.overlapColor)), e;
|
|
2541
|
+
}), k = a(() => [f.e("content"), i.contentClass]), A = a(() => {
|
|
2520
2542
|
let e = [];
|
|
2521
|
-
return
|
|
2543
|
+
return i.contentStyle && e.push(i.contentStyle), i.glowPulse && i.lightWave && e.push({ animation: "inherit" }), e;
|
|
2522
2544
|
});
|
|
2523
|
-
return (e, n) => (D(), o(F(B(
|
|
2524
|
-
class: S(
|
|
2525
|
-
style: w(
|
|
2526
|
-
"data-text":
|
|
2545
|
+
return (e, n) => (D(), o(F(B(i).tag), {
|
|
2546
|
+
class: S(E.value),
|
|
2547
|
+
style: w(O.value),
|
|
2548
|
+
"data-text": x()
|
|
2527
2549
|
}, {
|
|
2528
2550
|
default: K(() => [
|
|
2529
2551
|
e.$slots.prefix ? (D(), c("span", {
|
|
2530
2552
|
key: 0,
|
|
2531
|
-
class: S(B(
|
|
2553
|
+
class: S(B(f).e("prefix"))
|
|
2532
2554
|
}, [N(e.$slots, "prefix")], 2)) : s("", !0),
|
|
2533
2555
|
l("span", {
|
|
2534
|
-
class: S(
|
|
2535
|
-
style: w(
|
|
2536
|
-
}, [
|
|
2556
|
+
class: S(k.value),
|
|
2557
|
+
style: w(A.value)
|
|
2558
|
+
}, [C() ? (D(), c(t, { key: 0 }, [l("span", { class: S(B(f).e("ellipsis-middle-start")) }, L(T().start), 3), T().end ? (D(), c("span", {
|
|
2559
|
+
key: 0,
|
|
2560
|
+
class: S(B(f).e("ellipsis-middle-end"))
|
|
2561
|
+
}, L(T().end), 3)) : s("", !0)], 64)) : N(e.$slots, "default", { key: 1 })], 6),
|
|
2537
2562
|
e.$slots.suffix ? (D(), c("span", {
|
|
2538
2563
|
key: 1,
|
|
2539
|
-
class: S(B(
|
|
2564
|
+
class: S(B(f).e("suffix"))
|
|
2540
2565
|
}, [N(e.$slots, "suffix")], 2)) : s("", !0)
|
|
2541
2566
|
]),
|
|
2542
2567
|
_: 3
|
|
@@ -2757,6 +2782,10 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
2757
2782
|
type: String,
|
|
2758
2783
|
default: ""
|
|
2759
2784
|
},
|
|
2785
|
+
shape: {
|
|
2786
|
+
type: String,
|
|
2787
|
+
default: "clip"
|
|
2788
|
+
},
|
|
2760
2789
|
download: {
|
|
2761
2790
|
type: Boolean,
|
|
2762
2791
|
default: !1
|
|
@@ -2779,55 +2808,55 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
2779
2808
|
transform: `translate(${M.value}px, ${P.value}px) scale(${x.value}) rotate(${E.value}deg)`,
|
|
2780
2809
|
cursor: F.value ? "grabbing" : "grab",
|
|
2781
2810
|
userSelect: "none"
|
|
2782
|
-
})), ne = {
|
|
2811
|
+
})), ne = a(() => [m.b(), m.m(`shape-${d.shape}`)]), re = {
|
|
2783
2812
|
default: "var(--cp-text-secondary)",
|
|
2784
2813
|
primary: "var(--cp-color-primary)",
|
|
2785
2814
|
success: "var(--cp-color-success)",
|
|
2786
2815
|
warning: "var(--cp-color-warning)",
|
|
2787
2816
|
error: "var(--cp-color-error)",
|
|
2788
2817
|
info: "var(--cp-color-info)"
|
|
2789
|
-
},
|
|
2818
|
+
}, ie = a(() => {
|
|
2790
2819
|
let e = {
|
|
2791
2820
|
..._ ? B(_) : {},
|
|
2792
2821
|
zIndex: k.value
|
|
2793
2822
|
};
|
|
2794
|
-
return e["--cp-image-preview-accent"] = d.color ||
|
|
2795
|
-
}),
|
|
2823
|
+
return e["--cp-image-preview-accent"] = d.color || re[d.type] || re.primary, e;
|
|
2824
|
+
}), ae = () => {
|
|
2796
2825
|
x.value = 1, E.value = 0, M.value = 0, P.value = 0;
|
|
2797
|
-
}, ae = () => {
|
|
2798
|
-
x.value = Math.min(x.value + dn, un);
|
|
2799
2826
|
}, Q = () => {
|
|
2800
|
-
x.value = Math.
|
|
2827
|
+
x.value = Math.min(x.value + dn, un);
|
|
2801
2828
|
}, oe = () => {
|
|
2802
|
-
|
|
2829
|
+
x.value = Math.max(x.value - dn, ln);
|
|
2803
2830
|
}, se = () => {
|
|
2831
|
+
E.value -= 90;
|
|
2832
|
+
}, ce = () => {
|
|
2804
2833
|
E.value += 90;
|
|
2805
|
-
},
|
|
2834
|
+
}, le = () => ({
|
|
2806
2835
|
index: b.value,
|
|
2807
2836
|
url: H.value,
|
|
2808
2837
|
urlList: [...d.urlList]
|
|
2809
|
-
}),
|
|
2838
|
+
}), ue = () => {
|
|
2810
2839
|
if (ee.value) return;
|
|
2811
2840
|
let e = d.infinite ? (b.value - 1 + d.urlList.length) % d.urlList.length : b.value > 0 ? b.value - 1 : b.value;
|
|
2812
|
-
e !== b.value && (b.value = e,
|
|
2813
|
-
},
|
|
2841
|
+
e !== b.value && (b.value = e, ae(), f("switch", b.value));
|
|
2842
|
+
}, pe = () => {
|
|
2814
2843
|
if (ee.value) return;
|
|
2815
2844
|
let e = d.infinite ? (b.value + 1) % d.urlList.length : b.value < d.urlList.length - 1 ? b.value + 1 : b.value;
|
|
2816
|
-
e !== b.value && (b.value = e,
|
|
2817
|
-
}, pe = () => {
|
|
2818
|
-
let e = ce();
|
|
2819
|
-
y.value = !1, f("update:modelValue", !1), f("close", e);
|
|
2845
|
+
e !== b.value && (b.value = e, ae(), f("switch", b.value));
|
|
2820
2846
|
}, me = () => {
|
|
2821
|
-
|
|
2847
|
+
let e = le();
|
|
2848
|
+
y.value = !1, f("update:modelValue", !1), f("close", e);
|
|
2822
2849
|
}, he = () => {
|
|
2823
2850
|
O.value = !1;
|
|
2824
|
-
}, ge = (
|
|
2825
|
-
|
|
2851
|
+
}, ge = () => {
|
|
2852
|
+
O.value = !1;
|
|
2826
2853
|
}, _e = (e) => {
|
|
2854
|
+
e.button === 0 && (e.preventDefault(), F.value = !0, I = e.clientX, R = e.clientY, z = M.value, V = P.value, document.addEventListener("mousemove", ve), document.addEventListener("mouseup", ye));
|
|
2855
|
+
}, ve = (e) => {
|
|
2827
2856
|
F.value && (M.value = z + (e.clientX - I), P.value = V + (e.clientY - R));
|
|
2828
|
-
},
|
|
2829
|
-
F.value = !1, document.removeEventListener("mousemove",
|
|
2830
|
-
},
|
|
2857
|
+
}, ye = () => {
|
|
2858
|
+
F.value = !1, document.removeEventListener("mousemove", ve), document.removeEventListener("mouseup", ye);
|
|
2859
|
+
}, be = async () => {
|
|
2831
2860
|
if (H.value) try {
|
|
2832
2861
|
let e = await fetch(H.value);
|
|
2833
2862
|
if (!e.ok) throw Error("Network response was not ok");
|
|
@@ -2840,7 +2869,7 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
2840
2869
|
let t = document.createElement("a");
|
|
2841
2870
|
t.href = H.value, t.download = "image.png", t.target = "_blank", document.body.appendChild(t), t.click(), document.body.removeChild(t);
|
|
2842
2871
|
}
|
|
2843
|
-
},
|
|
2872
|
+
}, xe = a(() => ({
|
|
2844
2873
|
scale: x.value,
|
|
2845
2874
|
rotate: E.value,
|
|
2846
2875
|
currentIndex: b.value,
|
|
@@ -2851,42 +2880,42 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
2851
2880
|
canNext: q.value,
|
|
2852
2881
|
zoomMin: ln,
|
|
2853
2882
|
zoomMax: un,
|
|
2854
|
-
zoomIn:
|
|
2855
|
-
zoomOut:
|
|
2856
|
-
rotateLeft:
|
|
2857
|
-
rotateRight:
|
|
2858
|
-
resetTransform:
|
|
2859
|
-
prev:
|
|
2860
|
-
next:
|
|
2861
|
-
close:
|
|
2862
|
-
download:
|
|
2863
|
-
})),
|
|
2883
|
+
zoomIn: Q,
|
|
2884
|
+
zoomOut: oe,
|
|
2885
|
+
rotateLeft: se,
|
|
2886
|
+
rotateRight: ce,
|
|
2887
|
+
resetTransform: ae,
|
|
2888
|
+
prev: ue,
|
|
2889
|
+
next: pe,
|
|
2890
|
+
close: me,
|
|
2891
|
+
download: be
|
|
2892
|
+
})), $ = (e) => {
|
|
2864
2893
|
if (!y.value) return !1;
|
|
2865
2894
|
switch (e.key) {
|
|
2866
|
-
case "Escape": return
|
|
2867
|
-
case "ArrowLeft": return
|
|
2868
|
-
case "ArrowRight": return
|
|
2895
|
+
case "Escape": return me(), !0;
|
|
2896
|
+
case "ArrowLeft": return ue(), !0;
|
|
2897
|
+
case "ArrowRight": return pe(), !0;
|
|
2869
2898
|
case "ArrowUp":
|
|
2870
2899
|
case "+":
|
|
2871
|
-
case "=": return
|
|
2900
|
+
case "=": return Q(), !0;
|
|
2872
2901
|
case "ArrowDown":
|
|
2873
|
-
case "-": return
|
|
2902
|
+
case "-": return oe(), !0;
|
|
2874
2903
|
default: return !1;
|
|
2875
2904
|
}
|
|
2876
|
-
},
|
|
2905
|
+
}, Se = () => {
|
|
2877
2906
|
j ||= Me({
|
|
2878
2907
|
zIndex: d.zIndex,
|
|
2879
2908
|
stackPriority: d.stackPriority,
|
|
2880
|
-
onKeydown:
|
|
2909
|
+
onKeydown: $,
|
|
2881
2910
|
onZIndexChange: (e) => {
|
|
2882
2911
|
k.value = e;
|
|
2883
2912
|
}
|
|
2884
2913
|
});
|
|
2885
|
-
},
|
|
2914
|
+
}, Ce = () => {
|
|
2886
2915
|
j && (j.unregister(), j = void 0, k.value = d.zIndex);
|
|
2887
|
-
}, Ce = (e) => {
|
|
2888
|
-
e.preventDefault(), e.deltaY < 0 ? ae() : Q();
|
|
2889
2916
|
}, we = (e) => {
|
|
2917
|
+
e.preventDefault(), e.deltaY < 0 ? Q() : oe();
|
|
2918
|
+
}, Te = (e) => {
|
|
2890
2919
|
if (!d.closeOnClickModal) return;
|
|
2891
2920
|
let t = e.target;
|
|
2892
2921
|
t instanceof Element && t.closest([
|
|
@@ -2895,10 +2924,10 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
2895
2924
|
`.${m.e("arrow")}`,
|
|
2896
2925
|
`.${m.e("close")}`,
|
|
2897
2926
|
`.${m.e("counter")}`
|
|
2898
|
-
].join(",")) ||
|
|
2927
|
+
].join(",")) || me();
|
|
2899
2928
|
};
|
|
2900
2929
|
return W(() => d.modelValue, (e) => {
|
|
2901
|
-
y.value = e, e ? (b.value = d.initialIndex,
|
|
2930
|
+
y.value = e, e ? (b.value = d.initialIndex, ae(), O.value = !0, Se()) : Ce();
|
|
2902
2931
|
}, { immediate: !0 }), W(() => [d.zIndex, d.stackPriority], ([e, t]) => {
|
|
2903
2932
|
j ? j.update({
|
|
2904
2933
|
zIndex: e,
|
|
@@ -2907,27 +2936,27 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
2907
2936
|
}), W(H, () => {
|
|
2908
2937
|
O.value = !0;
|
|
2909
2938
|
}), T(() => {
|
|
2910
|
-
|
|
2939
|
+
Ce(), document.removeEventListener("mousemove", ve), document.removeEventListener("mouseup", ye);
|
|
2911
2940
|
}), r({
|
|
2912
|
-
close:
|
|
2913
|
-
prev:
|
|
2914
|
-
next:
|
|
2915
|
-
zoomIn:
|
|
2916
|
-
zoomOut:
|
|
2917
|
-
rotateLeft:
|
|
2918
|
-
rotateRight:
|
|
2919
|
-
resetTransform:
|
|
2941
|
+
close: me,
|
|
2942
|
+
prev: ue,
|
|
2943
|
+
next: pe,
|
|
2944
|
+
zoomIn: Q,
|
|
2945
|
+
zoomOut: oe,
|
|
2946
|
+
rotateLeft: se,
|
|
2947
|
+
rotateRight: ce,
|
|
2948
|
+
resetTransform: ae
|
|
2920
2949
|
}), (e, r) => (D(), o(n, {
|
|
2921
2950
|
to: B(d).teleportTo,
|
|
2922
2951
|
disabled: !B(d).teleportTo
|
|
2923
2952
|
}, [p(i, { name: "cp-image-preview-fade" }, {
|
|
2924
2953
|
default: K(() => [y.value ? (D(), c("div", {
|
|
2925
2954
|
key: 0,
|
|
2926
|
-
class: S(
|
|
2955
|
+
class: S(ne.value),
|
|
2927
2956
|
"data-theme": B(h),
|
|
2928
|
-
style: w(
|
|
2929
|
-
onClick:
|
|
2930
|
-
onWheel: J(
|
|
2957
|
+
style: w(ie.value),
|
|
2958
|
+
onClick: Te,
|
|
2959
|
+
onWheel: J(we, ["prevent"])
|
|
2931
2960
|
}, [
|
|
2932
2961
|
p(B(Ze), {
|
|
2933
2962
|
class: S(B(m).e("close")),
|
|
@@ -2938,7 +2967,7 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
2938
2967
|
type: B(d).type,
|
|
2939
2968
|
color: B(d).color,
|
|
2940
2969
|
title: "关闭预览 (ESC)",
|
|
2941
|
-
onClick:
|
|
2970
|
+
onClick: me
|
|
2942
2971
|
}, {
|
|
2943
2972
|
default: K(() => [...r[1] ||= [l("svg", {
|
|
2944
2973
|
viewBox: "0 0 24 24",
|
|
@@ -2958,7 +2987,7 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
2958
2987
|
key: 0,
|
|
2959
2988
|
class: S([B(m).e("arrow"), B(m).bem(void 0, "arrow", "left")]),
|
|
2960
2989
|
title: "上一张 (←)",
|
|
2961
|
-
onClick: J(
|
|
2990
|
+
onClick: J(ue, ["stop"])
|
|
2962
2991
|
}, [p(B(Ze), {
|
|
2963
2992
|
variant: "ghost",
|
|
2964
2993
|
dimmed: "",
|
|
@@ -2987,7 +3016,7 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
2987
3016
|
key: 1,
|
|
2988
3017
|
class: S([B(m).e("arrow"), B(m).bem(void 0, "arrow", "right")]),
|
|
2989
3018
|
title: "下一张 (→)",
|
|
2990
|
-
onClick: J(
|
|
3019
|
+
onClick: J(pe, ["stop"])
|
|
2991
3020
|
}, [p(B(Ze), {
|
|
2992
3021
|
variant: "ghost",
|
|
2993
3022
|
dimmed: "",
|
|
@@ -3014,7 +3043,7 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
3014
3043
|
])], 2)),
|
|
3015
3044
|
l("div", {
|
|
3016
3045
|
class: S(B(m).e("canvas")),
|
|
3017
|
-
onClick:
|
|
3046
|
+
onClick: Te
|
|
3018
3047
|
}, [O.value ? (D(), c("div", {
|
|
3019
3048
|
key: 0,
|
|
3020
3049
|
class: S(B(m).e("loading"))
|
|
@@ -3027,14 +3056,14 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
3027
3056
|
src: H.value,
|
|
3028
3057
|
style: w(Y.value),
|
|
3029
3058
|
draggable: "false",
|
|
3030
|
-
onLoad:
|
|
3031
|
-
onError:
|
|
3032
|
-
onMousedown:
|
|
3059
|
+
onLoad: he,
|
|
3060
|
+
onError: ge,
|
|
3061
|
+
onMousedown: _e
|
|
3033
3062
|
}, null, 46, cn), [[U, !O.value]])], 2),
|
|
3034
3063
|
l("div", {
|
|
3035
3064
|
class: S(B(m).e("toolbar")),
|
|
3036
3065
|
onClick: r[0] ||= J(() => {}, ["stop"])
|
|
3037
|
-
}, [N(e.$slots, "toolbar", C(g(
|
|
3066
|
+
}, [N(e.$slots, "toolbar", C(g(xe.value)), () => [
|
|
3038
3067
|
p(B(Ze), {
|
|
3039
3068
|
variant: "ghost",
|
|
3040
3069
|
dimmed: "",
|
|
@@ -3043,7 +3072,7 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
3043
3072
|
color: B(d).color,
|
|
3044
3073
|
title: "缩小 (-)",
|
|
3045
3074
|
disabled: x.value <= ln,
|
|
3046
|
-
onClick:
|
|
3075
|
+
onClick: oe
|
|
3047
3076
|
}, {
|
|
3048
3077
|
default: K(() => [...r[4] ||= [l("svg", {
|
|
3049
3078
|
viewBox: "0 0 24 24",
|
|
@@ -3071,7 +3100,7 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
3071
3100
|
color: B(d).color,
|
|
3072
3101
|
title: "放大 (+)",
|
|
3073
3102
|
disabled: x.value >= un,
|
|
3074
|
-
onClick:
|
|
3103
|
+
onClick: Q
|
|
3075
3104
|
}, {
|
|
3076
3105
|
default: K(() => [...r[5] ||= [l("svg", {
|
|
3077
3106
|
viewBox: "0 0 24 24",
|
|
@@ -3099,7 +3128,7 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
3099
3128
|
type: B(d).type,
|
|
3100
3129
|
color: B(d).color,
|
|
3101
3130
|
title: "向左旋转",
|
|
3102
|
-
onClick:
|
|
3131
|
+
onClick: se
|
|
3103
3132
|
}, {
|
|
3104
3133
|
default: K(() => [...r[6] ||= [l("svg", {
|
|
3105
3134
|
viewBox: "0 0 24 24",
|
|
@@ -3118,7 +3147,7 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
3118
3147
|
type: B(d).type,
|
|
3119
3148
|
color: B(d).color,
|
|
3120
3149
|
title: "向右旋转",
|
|
3121
|
-
onClick:
|
|
3150
|
+
onClick: ce
|
|
3122
3151
|
}, {
|
|
3123
3152
|
default: K(() => [...r[7] ||= [l("svg", {
|
|
3124
3153
|
viewBox: "0 0 24 24",
|
|
@@ -3138,7 +3167,7 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
3138
3167
|
type: B(d).type,
|
|
3139
3168
|
color: B(d).color,
|
|
3140
3169
|
title: "还原缩放与位置",
|
|
3141
|
-
onClick:
|
|
3170
|
+
onClick: ae
|
|
3142
3171
|
}, {
|
|
3143
3172
|
default: K(() => [...r[8] ||= [l("svg", {
|
|
3144
3173
|
viewBox: "0 0 24 24",
|
|
@@ -3163,7 +3192,7 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
3163
3192
|
type: B(d).type,
|
|
3164
3193
|
color: B(d).color,
|
|
3165
3194
|
title: "下载图片",
|
|
3166
|
-
onClick:
|
|
3195
|
+
onClick: be
|
|
3167
3196
|
}, {
|
|
3168
3197
|
default: K(() => [...r[9] ||= [l("svg", {
|
|
3169
3198
|
viewBox: "0 0 24 24",
|
|
@@ -3184,7 +3213,7 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
3184
3213
|
], -1)]]),
|
|
3185
3214
|
_: 1
|
|
3186
3215
|
}, 8, ["type", "color"])], 64)) : s("", !0),
|
|
3187
|
-
N(e.$slots, "toolbar-append", C(g(
|
|
3216
|
+
N(e.$slots, "toolbar-append", C(g(xe.value)))
|
|
3188
3217
|
])], 2),
|
|
3189
3218
|
ee.value ? s("", !0) : (D(), c("div", {
|
|
3190
3219
|
key: 2,
|
|
@@ -3216,6 +3245,7 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
3216
3245
|
teleportTo: _.value.teleportTo,
|
|
3217
3246
|
type: _.value.type ?? n.type,
|
|
3218
3247
|
color: _.value.color ?? n.color,
|
|
3248
|
+
shape: _.value.shape ?? (n.shape === "circle" ? "round" : n.shape),
|
|
3219
3249
|
download: _.value.download ?? n.download,
|
|
3220
3250
|
closeOnClickModal: _.value.closeOnClickModal
|
|
3221
3251
|
})), C = () => {
|
|
@@ -3358,6 +3388,7 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
3358
3388
|
"teleport-to": x.value.teleportTo,
|
|
3359
3389
|
type: x.value.type,
|
|
3360
3390
|
color: x.value.color,
|
|
3391
|
+
shape: x.value.shape,
|
|
3361
3392
|
download: x.value.download,
|
|
3362
3393
|
"close-on-click-modal": x.value.closeOnClickModal,
|
|
3363
3394
|
onClose: k,
|
|
@@ -3372,6 +3403,7 @@ var Ce = [], we = 0, Te = 0, Ee = () => [...Ce].sort((e, t) => e.stackPriority =
|
|
|
3372
3403
|
"teleport-to",
|
|
3373
3404
|
"type",
|
|
3374
3405
|
"color",
|
|
3406
|
+
"shape",
|
|
3375
3407
|
"download",
|
|
3376
3408
|
"close-on-click-modal"
|
|
3377
3409
|
])) : s("", !0)
|
package/dist/text/index.d.ts
CHANGED
|
@@ -41,6 +41,10 @@ export declare const CpText: import('../utils').SFCWithInstall<{
|
|
|
41
41
|
readonly type: BooleanConstructor;
|
|
42
42
|
readonly default: false;
|
|
43
43
|
};
|
|
44
|
+
readonly ellipsisPosition: {
|
|
45
|
+
readonly type: import('vue').PropType<import('.').TextEllipsisPosition>;
|
|
46
|
+
readonly default: "end";
|
|
47
|
+
};
|
|
44
48
|
readonly lineClamp: {
|
|
45
49
|
readonly type: import('vue').PropType<number | string>;
|
|
46
50
|
readonly default: undefined;
|
|
@@ -143,6 +147,7 @@ export declare const CpText: import('../utils').SFCWithInstall<{
|
|
|
143
147
|
readonly lineClamp: string | number;
|
|
144
148
|
readonly level: import('.').TextLevel;
|
|
145
149
|
readonly align: import('.').TextAlign;
|
|
150
|
+
readonly ellipsisPosition: import('.').TextEllipsisPosition;
|
|
146
151
|
readonly contentClass: import('.').TextContentClassValue;
|
|
147
152
|
readonly contentStyle: import('vue').StyleValue;
|
|
148
153
|
readonly boxed: boolean;
|
|
@@ -195,6 +200,10 @@ export declare const CpText: import('../utils').SFCWithInstall<{
|
|
|
195
200
|
readonly type: BooleanConstructor;
|
|
196
201
|
readonly default: false;
|
|
197
202
|
};
|
|
203
|
+
readonly ellipsisPosition: {
|
|
204
|
+
readonly type: import('vue').PropType<import('.').TextEllipsisPosition>;
|
|
205
|
+
readonly default: "end";
|
|
206
|
+
};
|
|
198
207
|
readonly lineClamp: {
|
|
199
208
|
readonly type: import('vue').PropType<number | string>;
|
|
200
209
|
readonly default: undefined;
|
|
@@ -297,6 +306,7 @@ export declare const CpText: import('../utils').SFCWithInstall<{
|
|
|
297
306
|
readonly lineClamp: string | number;
|
|
298
307
|
readonly level: import('.').TextLevel;
|
|
299
308
|
readonly align: import('.').TextAlign;
|
|
309
|
+
readonly ellipsisPosition: import('.').TextEllipsisPosition;
|
|
300
310
|
readonly contentClass: import('.').TextContentClassValue;
|
|
301
311
|
readonly contentStyle: import('vue').StyleValue;
|
|
302
312
|
readonly boxed: boolean;
|
|
@@ -346,6 +356,10 @@ export declare const CpText: import('../utils').SFCWithInstall<{
|
|
|
346
356
|
readonly type: BooleanConstructor;
|
|
347
357
|
readonly default: false;
|
|
348
358
|
};
|
|
359
|
+
readonly ellipsisPosition: {
|
|
360
|
+
readonly type: import('vue').PropType<import('.').TextEllipsisPosition>;
|
|
361
|
+
readonly default: "end";
|
|
362
|
+
};
|
|
349
363
|
readonly lineClamp: {
|
|
350
364
|
readonly type: import('vue').PropType<number | string>;
|
|
351
365
|
readonly default: undefined;
|
|
@@ -448,6 +462,7 @@ export declare const CpText: import('../utils').SFCWithInstall<{
|
|
|
448
462
|
readonly lineClamp: string | number;
|
|
449
463
|
readonly level: import('.').TextLevel;
|
|
450
464
|
readonly align: import('.').TextAlign;
|
|
465
|
+
readonly ellipsisPosition: import('.').TextEllipsisPosition;
|
|
451
466
|
readonly contentClass: import('.').TextContentClassValue;
|
|
452
467
|
readonly contentStyle: import('vue').StyleValue;
|
|
453
468
|
readonly boxed: boolean;
|
package/dist/text/src/text.d.ts
CHANGED
|
@@ -35,6 +35,13 @@ export type TextLevel = 'heading' | 'subheading' | 'body' | 'secondary' | 'capti
|
|
|
35
35
|
* - `bottom` - 底部对齐
|
|
36
36
|
*/
|
|
37
37
|
export type TextAlign = 'top' | 'middle' | 'bottom';
|
|
38
|
+
/**
|
|
39
|
+
* 单行省略位置
|
|
40
|
+
* - `end` - 末尾省略,默认行为
|
|
41
|
+
* - `start` - 开头省略,保留末尾内容
|
|
42
|
+
* - `middle` - 中间省略,保留开头和末尾内容
|
|
43
|
+
*/
|
|
44
|
+
export type TextEllipsisPosition = 'start' | 'middle' | 'end';
|
|
38
45
|
/**
|
|
39
46
|
* 渲染标签
|
|
40
47
|
*/
|
|
@@ -135,6 +142,17 @@ export declare const textProps: {
|
|
|
135
142
|
readonly type: BooleanConstructor;
|
|
136
143
|
readonly default: false;
|
|
137
144
|
};
|
|
145
|
+
/**
|
|
146
|
+
* 单行省略位置
|
|
147
|
+
* 仅在 ellipsis 开启且未设置 lineClamp 时生效;middle 会对默认插槽中的纯文本进行中间分段显示
|
|
148
|
+
* @default 'end'
|
|
149
|
+
* @example `<CpText ellipsis ellipsis-position="start">很长的文字</CpText>`
|
|
150
|
+
* @example `<CpText ellipsis ellipsis-position="middle">很长的文件名或路径</CpText>`
|
|
151
|
+
*/
|
|
152
|
+
readonly ellipsisPosition: {
|
|
153
|
+
readonly type: PropType<TextEllipsisPosition>;
|
|
154
|
+
readonly default: "end";
|
|
155
|
+
};
|
|
138
156
|
/**
|
|
139
157
|
* 多行省略行数
|
|
140
158
|
* 传入数字或数字字符串后,文字本体会在指定行数后裁剪;优先级高于 ellipsis
|
|
@@ -39,6 +39,10 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
39
39
|
readonly type: BooleanConstructor;
|
|
40
40
|
readonly default: false;
|
|
41
41
|
};
|
|
42
|
+
readonly ellipsisPosition: {
|
|
43
|
+
readonly type: import('vue').PropType<import('./text').TextEllipsisPosition>;
|
|
44
|
+
readonly default: "end";
|
|
45
|
+
};
|
|
42
46
|
readonly lineClamp: {
|
|
43
47
|
readonly type: import('vue').PropType<number | string>;
|
|
44
48
|
readonly default: undefined;
|
|
@@ -156,6 +160,10 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
156
160
|
readonly type: BooleanConstructor;
|
|
157
161
|
readonly default: false;
|
|
158
162
|
};
|
|
163
|
+
readonly ellipsisPosition: {
|
|
164
|
+
readonly type: import('vue').PropType<import('./text').TextEllipsisPosition>;
|
|
165
|
+
readonly default: "end";
|
|
166
|
+
};
|
|
159
167
|
readonly lineClamp: {
|
|
160
168
|
readonly type: import('vue').PropType<number | string>;
|
|
161
169
|
readonly default: undefined;
|
|
@@ -258,6 +266,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
258
266
|
readonly lineClamp: string | number;
|
|
259
267
|
readonly level: import('./text').TextLevel;
|
|
260
268
|
readonly align: import('./text').TextAlign;
|
|
269
|
+
readonly ellipsisPosition: import('./text').TextEllipsisPosition;
|
|
261
270
|
readonly contentClass: import('./text').TextContentClassValue;
|
|
262
271
|
readonly contentStyle: StyleValue;
|
|
263
272
|
readonly boxed: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyberpunk-vue/components",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.5",
|
|
4
4
|
"description": "Cyberpunk Vue components - A futuristic Vue 3 component library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@floating-ui/dom": "^1.7.6",
|
|
27
27
|
"dayjs": "^1.11.20",
|
|
28
|
-
"@cyberpunk-vue/hooks": "1.14.
|
|
29
|
-
"@cyberpunk-vue/
|
|
30
|
-
"@cyberpunk-vue/
|
|
28
|
+
"@cyberpunk-vue/hooks": "1.14.5",
|
|
29
|
+
"@cyberpunk-vue/constants": "1.14.5",
|
|
30
|
+
"@cyberpunk-vue/theme-chalk": "1.14.5"
|
|
31
31
|
},
|
|
32
32
|
"author": "Juxest",
|
|
33
33
|
"license": "MIT",
|