vue-next-yui 1.0.4 → 1.0.6

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.
Files changed (40) hide show
  1. package/README.md +5 -0
  2. package/dist/components/imgViewer/directive.d.ts +6 -0
  3. package/dist/components/imgViewer/directive.d.ts.map +1 -0
  4. package/dist/components/imgViewer/index.d.ts +2 -0
  5. package/dist/components/imgViewer/index.d.ts.map +1 -0
  6. package/dist/components/index.d.ts +11 -0
  7. package/dist/components/index.d.ts.map +1 -0
  8. package/dist/components/loading/directive.d.ts +7 -0
  9. package/dist/components/loading/directive.d.ts.map +1 -0
  10. package/dist/components/loading/index.d.ts +18 -0
  11. package/dist/components/loading/index.d.ts.map +1 -0
  12. package/dist/components/mask/directive.d.ts +6 -0
  13. package/dist/components/mask/directive.d.ts.map +1 -0
  14. package/dist/components/mask/index.d.ts +17 -0
  15. package/dist/components/mask/index.d.ts.map +1 -0
  16. package/dist/components/watermark/directive.d.ts +5 -0
  17. package/dist/components/watermark/directive.d.ts.map +1 -0
  18. package/dist/components/watermark/index.d.ts +40 -0
  19. package/dist/components/watermark/index.d.ts.map +1 -0
  20. package/dist/components/watermark/useWatermark.d.ts +4 -0
  21. package/dist/components/watermark/useWatermark.d.ts.map +1 -0
  22. package/dist/directives/index.d.ts +15 -0
  23. package/dist/directives/index.d.ts.map +1 -0
  24. package/dist/directives/index.js +425 -0
  25. package/dist/directives/index.umd.cjs +1 -0
  26. package/dist/directives/outside.d.ts +6 -0
  27. package/dist/directives/outside.d.ts.map +1 -0
  28. package/dist/directives/vue-next-yui.css +1 -0
  29. package/dist/index.d.ts +6 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.umd.cjs +2 -0
  32. package/dist/utils/pick.d.ts +6 -0
  33. package/dist/utils/pick.d.ts.map +1 -0
  34. package/dist/utils/types.d.ts +12 -0
  35. package/dist/utils/types.d.ts.map +1 -0
  36. package/package.json +39 -37
  37. package/favicon.ico +0 -0
  38. package/style.css +0 -1
  39. package/vue-next-yui.es.js +0 -248
  40. package/vue-next-yui.umd.js +0 -1
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # Vue 3 + Vite
2
+
3
+ This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4
+
5
+ Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://vuejs.org/guide/scaling-up/tooling.html#ide-support).
@@ -0,0 +1,6 @@
1
+ export default vViewer;
2
+ declare namespace vViewer {
3
+ function mounted(el: any): void;
4
+ function beforeUnmount(el: any): void;
5
+ }
6
+ //# sourceMappingURL=directive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directive.d.ts","sourceRoot":"","sources":["../../../src/components/imgViewer/directive.js"],"names":[],"mappings":";;IAIE,gCAsBC;IACD,sCAaC"}
@@ -0,0 +1,2 @@
1
+ export function useImgViewer(): (params: any) => void;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/imgViewer/index.js"],"names":[],"mappings":"AAGA,iCAoCU,WAAM,UACf"}
@@ -0,0 +1,11 @@
1
+ import { default as Watermark } from './watermark/index';
2
+ import { default as ImgViewer } from './imgViewer/index';
3
+ import { default as Mask } from './mask/index';
4
+ export default components;
5
+ declare namespace components {
6
+ export { Watermark };
7
+ export { ImgViewer };
8
+ export { Mask };
9
+ }
10
+ export { Watermark, ImgViewer, Mask };
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.js"],"names":[],"mappings":";sBAAsB,uBAAuB;sBACvB,uBAAuB;iBAC5B,kBAAkB"}
@@ -0,0 +1,7 @@
1
+ export default vLoading;
2
+ declare namespace vLoading {
3
+ function mounted(el: any, binding: any): void;
4
+ function updated(el: any, binding: any): void;
5
+ function beforeUnmount(el: any): void;
6
+ }
7
+ //# sourceMappingURL=directive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directive.d.ts","sourceRoot":"","sources":["../../../src/components/loading/directive.js"],"names":[],"mappings":";;IAKE,8CAgBC;IACD,8CAKC;IACD,sCAOC"}
@@ -0,0 +1,18 @@
1
+ export function useLoading(): (params: any) => {
2
+ close: () => void;
3
+ };
4
+ //# sourceMappingURL=index.d.ts.maplor: string;
5
+ zIndex: number;
6
+ text: string;
7
+ bgColor: string;
8
+ fullscreen: boolean;
9
+ $props: {
10
+ readonly color?: string;
11
+ readonly zIndex?: number;
12
+ readonly text?: string;
13
+ readonly bgColor?: string;
14
+ readonly fullscreen?: boolean;
15
+ };
16
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
17
+ export default _default;
18
+ //# sourceMappingURL=index.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/loading/index.js"],"names":[],"mappings":"AAQA,+BA4DU,WAAM;;EACf"}
@@ -0,0 +1,6 @@
1
+ export default vMask;
2
+ declare namespace vMask {
3
+ function updated(el: any, binding: any): void;
4
+ function beforeUnmount(el: any): void;
5
+ }
6
+ //# sourceMappingURL=directive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directive.d.ts","sourceRoot":"","sources":["../../../src/components/mask/directive.js"],"names":[],"mappings":";;IAiCE,8CAQC;IACD,sCAIC"}
@@ -0,0 +1,17 @@
1
+ declare const _default: import('vue').DefineComponent<{}, {
2
+ show: () => void;
3
+ hide: () => void;
4
+ $emit: (event: "close", ...args: any[]) => void;
5
+ color: string;
6
+ zIndex: number;
7
+ closable: boolean;
8
+ lockScroll: boolean;
9
+ $props: {
10
+ readonly color?: string;
11
+ readonly zIndex?: number;
12
+ readonly closable?: boolean;
13
+ readonly lockScroll?: boolean;
14
+ };
15
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
16
+ export default _default;
17
+ //# sourceMappingURL=index.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../src/components/mask/index.vue"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export default vWatermark;
2
+ declare namespace vWatermark {
3
+ function mounted(el: any, binding: any): void;
4
+ }
5
+ //# sourceMappingURL=directive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directive.d.ts","sourceRoot":"","sources":["../../../src/components/watermark/directive.js"],"names":[],"mappings":";;IAKE,8CAmBC"}
@@ -0,0 +1,40 @@
1
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
2
+ export default _default;
3
+ type __VLS_WithTemplateSlots<T, S> = T & (new () => {
4
+ $slots: S;
5
+ });
6
+ declare const __VLS_component: import('vue').DefineComponent<{}, {
7
+ width: number;
8
+ height: number;
9
+ opacity: number;
10
+ angle: number;
11
+ content: string;
12
+ fontSize: number;
13
+ fontColor: string;
14
+ img: string;
15
+ imgWidth: number;
16
+ $props: {
17
+ readonly width?: number;
18
+ readonly height?: number;
19
+ readonly opacity?: number;
20
+ readonly angle?: number;
21
+ readonly content?: string;
22
+ readonly fontSize?: number;
23
+ readonly fontColor?: string;
24
+ readonly img?: string;
25
+ readonly imgWidth?: number;
26
+ };
27
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
28
+ watermarkRef: HTMLDivElement;
29
+ }, HTMLDivElement>;
30
+ type __VLS_TemplateResult = {
31
+ attrs: Partial<{}>;
32
+ slots: {
33
+ default?(_: {}): any;
34
+ };
35
+ refs: {
36
+ watermarkRef: HTMLDivElement;
37
+ };
38
+ rootEl: HTMLDivElement;
39
+ };
40
+ //# sourceMappingURL=index.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../src/components/watermark/index.vue"],"names":[],"mappings":"wBAkPqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAZjC;;;;;;;;;;;;;;;;;;;;;;;mBASG"}
@@ -0,0 +1,4 @@
1
+ export function useWatermark(): {
2
+ createWatermark: (width: any, height: any, opacity: any, content: any, fontSize: any, fontColor: any, angle: any, img: any, imgWidth: any) => Promise<any>;
3
+ };
4
+ //# sourceMappingURL=useWatermark.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWatermark.d.ts","sourceRoot":"","sources":["../../../src/components/watermark/useWatermark.js"],"names":[],"mappings":"AAAA;;EA4CC"}
@@ -0,0 +1,15 @@
1
+ import { default as vOutside } from './outside';
2
+ import { default as vWatermark } from '../components/watermark/directive.js';
3
+ import { default as vViewer } from '../components/imgViewer/directive.js';
4
+ import { default as vLoading } from '../components/loading/directive.js';
5
+ import { default as vMask } from '../components/mask/directive.js';
6
+ export default directives;
7
+ declare namespace directives {
8
+ export { vOutside };
9
+ export { vWatermark };
10
+ export { vViewer };
11
+ export { vLoading };
12
+ export { vMask };
13
+ }
14
+ export { vOutside, vWatermark, vViewer, vLoading, vMask };
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/directives/index.js"],"names":[],"mappings":";qBAAqB,WAAW;uBACT,sCAAsC;oBACzC,sCAAsC;qBACrC,oCAAoC;kBACvC,iCAAiC"}
@@ -0,0 +1,425 @@
1
+ import { mergeModels as R, useModel as z, ref as w, watch as J, createBlock as x, openBlock as h, Transition as S, withCtx as I, createElementBlock as C, createCommentVNode as F, createElementVNode as p, normalizeStyle as N, createApp as O, normalizeClass as P, withDirectives as X, toDisplayString as Z, vShow as q, computed as $ } from "vue";
2
+ const _ = {
3
+ beforeMount(e, t) {
4
+ e.clickOutsideEvent = (o) => {
5
+ e === o.target || e.contains(o.target) || t.value(o);
6
+ }, document.addEventListener("click", e.clickOutsideEvent);
7
+ },
8
+ unmounted(e) {
9
+ document.removeEventListener("click", e.clickOutsideEvent);
10
+ }
11
+ };
12
+ function ee() {
13
+ return {
14
+ createWatermark: (t, o, n, a, m, s, i, r, u) => new Promise((A, d) => {
15
+ try {
16
+ const f = document.createElement("canvas");
17
+ f.width = t, f.height = o;
18
+ const g = f.getContext("2d");
19
+ g.translate(t / 2, o / 2), g.rotate(-i * Math.PI / 180), g.globalAlpha = n >= 0 && n <= 1 ? n : 0.2;
20
+ let k = 0;
21
+ if (a) {
22
+ g.font = `${m}px Arial`, g.fillStyle = s, g.textBaseline = "middle", g.textAlign = "center";
23
+ const v = r ? (u + 10) / 2 : 0;
24
+ k = g.measureText(a).width, g.fillText(a, v, 0, t);
25
+ }
26
+ if (r) {
27
+ const v = new Image();
28
+ v.src = r, v.setAttribute("crossOrigin", "Anonymous"), v.onload = function() {
29
+ const B = v.width, E = v.height * u / B, V = -(u + k + 10) / 2;
30
+ g.drawImage(v, V, -E / 2, u, E), A(f.toDataURL("image/png"));
31
+ };
32
+ } else
33
+ A(f.toDataURL("image/png"));
34
+ } catch (f) {
35
+ d(f);
36
+ }
37
+ })
38
+ };
39
+ }
40
+ const { createWatermark: te } = ee(), oe = {
41
+ mounted(e, t) {
42
+ const {
43
+ width: o = 240,
44
+ height: n = 240,
45
+ opacity: a = 0.2,
46
+ content: m = "",
47
+ angle: s = 30,
48
+ fontSize: i = 20,
49
+ fontColor: r = "#999",
50
+ img: u = "",
51
+ imgWidth: A = 50
52
+ } = t.value;
53
+ te(o, n, a, m, i, r, s, u, A).then((d) => {
54
+ e.style.backgroundImage = `url(${d})`, e.style.backgroundPosition = "center top", e.style.backgroundRepeat = "repeat";
55
+ }).catch((d) => {
56
+ console.error(d);
57
+ });
58
+ }
59
+ }, K = (e, t) => {
60
+ const o = e.__vccOpts || e;
61
+ for (const [n, a] of t)
62
+ o[n] = a;
63
+ return o;
64
+ }, ne = ["src"], M = 0.95, ae = {
65
+ __name: "index",
66
+ props: /* @__PURE__ */ R({
67
+ src: {
68
+ type: String,
69
+ default() {
70
+ return "";
71
+ }
72
+ },
73
+ maskClose: {
74
+ type: Boolean,
75
+ default() {
76
+ return !0;
77
+ }
78
+ }
79
+ }, {
80
+ modelValue: { type: Boolean, default: !1 },
81
+ modelModifiers: {}
82
+ }),
83
+ emits: /* @__PURE__ */ R(["close"], ["update:modelValue"]),
84
+ setup(e, { expose: t, emit: o }) {
85
+ const n = z(e, "modelValue"), a = e, m = o, s = w(1), i = w(1), r = w(0), u = w(0), A = w(0), d = w(!0), f = () => {
86
+ a.maskClose && U();
87
+ }, g = (l) => {
88
+ u.value = l.target.naturalWidth, A.value = l.target.naturalHeight, k();
89
+ }, k = () => {
90
+ const l = window.innerWidth, c = window.innerHeight, y = c / l, Y = A.value / u.value;
91
+ let b = 1;
92
+ Y > y ? b = c * M / A.value : b = l * M / u.value;
93
+ const L = Math.round(b * 10) / 10;
94
+ s.value = Math.max(L, 1), d.value || (i.value = s.value);
95
+ }, v = (l) => {
96
+ l.preventDefault(), l.wheelDelta > 0 ? T() : B();
97
+ }, B = (l = 0.1) => {
98
+ const c = i.value - l;
99
+ i.value = Math.max(c, 0.1);
100
+ }, T = (l = 0.1) => {
101
+ const c = i.value + l;
102
+ i.value = Math.min(c, 2);
103
+ }, E = () => {
104
+ d.value = !d.value, i.value = d.value ? 1 : s.value;
105
+ }, V = (l) => {
106
+ r.value += l;
107
+ }, G = () => {
108
+ n.value = !0;
109
+ }, D = () => {
110
+ n.value = !1, Q();
111
+ }, U = () => {
112
+ D(), m("close");
113
+ }, Q = () => {
114
+ s.value = 1, i.value = 1, r.value = 0, u.value = 0, A.value = 0;
115
+ }, j = (l) => {
116
+ l.stopPropagation();
117
+ }, H = () => {
118
+ n.value && !d.value && k();
119
+ }, W = (l) => {
120
+ l.key === "Escape" && U();
121
+ };
122
+ return J(n, (l) => {
123
+ l ? (document.body.style.overflow = "hidden", window.addEventListener("keydown", W), window.addEventListener("resize", H)) : (document.body.style.overflow = "", window.removeEventListener("keydown", W), window.removeEventListener("resize", H));
124
+ }, { immediate: !0 }), t({
125
+ show: G,
126
+ hide: D
127
+ }), (l, c) => (h(), x(S, {
128
+ name: "yu-img-viewer",
129
+ appear: ""
130
+ }, {
131
+ default: I(() => [
132
+ n.value ? (h(), C("div", {
133
+ key: 0,
134
+ class: "yu-img-viewer-wrapper",
135
+ onClick: f,
136
+ onWheel: v
137
+ }, [
138
+ p("img", {
139
+ src: e.src,
140
+ class: "img-show",
141
+ onClick: j,
142
+ onLoad: g,
143
+ style: N(`max-width:${M * 100}%;max-height:${M * 100}%;transform: scale(${i.value}) rotate(${r.value}deg);transition: all 0.3s ease;`),
144
+ alt: ""
145
+ }, null, 44, ne),
146
+ p("div", {
147
+ class: "yu-img-viewer",
148
+ onClick: j
149
+ }, [
150
+ p("img", {
151
+ onClick: c[0] || (c[0] = (y) => B()),
152
+ title: "缩小",
153
+ class: "icon",
154
+ alt: "",
155
+ src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAMAAABiM0N1AAAAmVBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////VHQRUAAAAMnRSTlMA9+7gJPncJwX06aV0ShHkmo4+GrFIRbdvU3tsamZhNDDPxbaflU7WvzIgHg2tgzmHWNLgL/wAAAJTSURBVFjD7Zdrd7IwDMfDTRAE8QJDuaiIt6nb8/T7f7gR2TkeWEtT5975e5mUP23StCm8eMHHzsOjMWRsaJRhZj+qctqNWYvx7hPU+b9hHA65oyazPzABxh7oBFfWoM9HsR04TmDHo7n+bdyeqTrTJjaaF7Xtkac18j5NJ7FuMpPZT9ds0kgtKTr/GPJm8r3mG0N2cp2P23RSEJJqJKUMR7kr6GHlElY3xfgMTOjFHKDSvjfvmK/xO0h4x2F63y7wMD4nkLLWMB9if8xqMkAooVwI3Yfbf0hssVpEdbfAhZk0IRMXVwicWO8TIDLB9AoiiBOaUYVmOKWp8B8ekMEMh1yPUXsiulCEJcANH24yUADPpzXHntf2uYrQvP4g4djD2j5SERrVH1Qc+7G2+ypCfv1BybFjSdsqQjZubkHsLq0jxWAdjNa+CQTZwZEtQ1enOwGnNlh/KTTsLi3+oTQgLc1QDragbMtH0n/k2CvlDSmo2uSREkn5x5F60XIvCvdJxwiE6gdbxb9lFY9acZYHTzr8oVC7jsS7xTGwsaNfkO4Fem5IllN0chyZiP3Yjg3XhCYCK3zjgJCzTm9rrFVvf83IjVYiaSGprd8GJISyZjTTGK1F3snbY6LSkskadoRyevl6I+XFbXvsfctcoyGTxhs5b++PGr951Pj3R41eAEwbpRRkLAZMgFXhklGJVgZOceDJaJUNDXGjVICcz9DtTOaYBXd3pBGVkFMalvg41selt4wvnZxYN/UF/Jq9JdniZBao5MKTlK7wDFYfSQAvXgB8AbQmiYamqSF8AAAAAElFTkSuQmCC"
156
+ }),
157
+ p("img", {
158
+ onClick: c[1] || (c[1] = (y) => T()),
159
+ title: "放大",
160
+ class: "icon",
161
+ alt: "",
162
+ src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAMAAABiM0N1AAAAilBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////2N2iNAAAALXRSTlMA+ODk70Uk9belj3QnBdxKRzHonfyYVDUfGhFv7LF8bGpmYT3PxK9O1r4NhhWkhma1AAACU0lEQVRYw+2X2ZqaQBCFD4swCAgD4oYr7mbq/V8vFoxfPkw3VE/Mnf9lqae71i7x5o2aaFdcbZ/It4/5NsIP+Rw61MIppjBnciAFl10MI84X0mCfIefrRA3uKhxEizheRINw5VLDagYhe4cYK0jRIg0sYpYJRJTjWmY4x1/Mh43UGgJ+EfPhQYn3QcxQqGNtoGVTX6pAD1u6k3XWyzQTeLfn+Iw8dOKNWOncmXfOl9Ob3pnDuev6WsDx+RR0j8X5gJYB3dmCkYRyAh2X+hwRXAV2rOtTdsyDCI+dq6DmUFeakCGnVxNBvtBcETnHGSi6ha+0154RKOw2ka3JcA6of0Cpwk53FOaUW0AZPp4/kAuB55Oq5nY8s0yEVkRUKuwFEYUmQqEmSFciSkyEEiI6Kuzc0pGJUMTFrYndrV0/9ES7nhY8AiQH29Tm+QIxF/D/FPL7XbPTZ9dcVWEbB1vTtsefpP+qsOfGBal5lUrTFuEFYaMaR69qWmTmY2QJFfmrBtteO2rtVDNqEygZvWj4ozJ9jkKoiW2zBzK7oeOFpB0E7OhO2X2OL1kiuMMPMbTMlvK1ZjxFB2cSL1plzwopXf0O6KHoW0a3FslW5EKyHjMhelgT46sXdp9IrpQsv/9CDJ6aLvj2KkhdYsre9D7u757CpPlTk4Qn92GsgL1PzAZ9TEakYZx/AbWSrA3i6kIK/Dx6+NkoVehnWmTUwrpuF38+Tq36ghUkfG7yo+3T2HWOwXpwe8pJozTBP3O2ekpczISVMrxCaUx0wiuYrssF3rwBfgPQ0YapPYGLOQAAAABJRU5ErkJggg=="
163
+ }),
164
+ d.value ? (h(), C("img", {
165
+ key: 0,
166
+ onClick: E,
167
+ title: "适应窗口",
168
+ class: "icon",
169
+ alt: "",
170
+ src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABIBAMAAACnw650AAAALVBMVEUAAAD///////////////////////////////////////////////////////+hSKubAAAADnRSTlMA7+b59OdySknVttYPDGmoZHwAAACySURBVEjHYxgFQx5k2r0DgkcNEB6HHoj3eBqqGq53EKAA4TJBuQtQFOVBRQNQFT1DUTTvnaEgEDgVQLjsISCe8LvXKIrsHl/AdCev3WMU/ruH2Hwj925UETmKnmBT5IeqSO8plIFPtFQdykAXHQWjABU0aRAhqvcIysAQJZx8h0C+G6qK7B4fwFTDY/cYa2EPq1tUEIU9ZrWhgK/a4MJetyzAWpXB6pY4cFW2jWEUDHUAANSUoGLnF/1TAAAAAElFTkSuQmCC"
171
+ })) : (h(), C("img", {
172
+ key: 1,
173
+ onClick: E,
174
+ title: "实际尺寸",
175
+ class: "icon",
176
+ alt: "",
177
+ src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABIBAMAAACnw650AAAAJ1BMVEUAAAD///////////////////////////////////////////////+uPUo5AAAADHRSTlMA7vD5hXLVtg3W1HNKpeIJAAAAkUlEQVRIx2MYBaMABqJszmABh1OR1bCfwQEKkBTF4FJ0FElRzhlDQSxA+MxJJEU2hxuwuZTD5jAS78wh7P7ROTOqCIsiZxMgAWXhVAQOYCgLp6IzIDEoC78iZxNCimA2EVZEHetAYPApGorhhJZUCCe6wZIRhp4iAsUh4YKVcBF9mtTCniEMe7UxlWEUjAIoAACLZA9Ayw+XDwAAAABJRU5ErkJggg=="
178
+ })),
179
+ p("img", {
180
+ onClick: c[2] || (c[2] = (y) => V(-90)),
181
+ title: "向左旋转90°",
182
+ class: "icon",
183
+ alt: "",
184
+ src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAMAAABiM0N1AAAAn1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8Kd3m4AAAANHRSTlMA+u1wMJv0EAzjysVFGwb81aJVCdu4aFrSzqiNijsV96+fkWFALSgj59dNNRizfFFJhe++/7y+OwAAAjhJREFUWMPt19dy4jAUBuBfLjHggsEB06vpJeyu3v/Z1kdyJmSwZMFwkZnwXWUic+RzJKvg5eU3mrRHndhifFr3XdvBgzzbb/JrljvG/TbulN+K03vfZsh4uTjDHfZ1LjQbo7YzieBtAntmcalVg6khF97tENcuAyb/ry97rfb5R4eTXbukcHNR/rdAl82ULWV5GvTs9ByhzKFPrawNpXfOt8glDf3bRwsRaQ+Vv3kz/XpGz/3zoNZtUnYrKJzyVhs4U5xOAp02Rdqpxs6mAHBoXBoJ9LrUm6todOh9RYG2R7P5ofpeaL4N6IEAlSLqsK9opCCkBQMOlelDnTilF1KPwXCmfzGXaolSaxlogXA5e6OpEkIjZGK6lKrLzPq8MIbOXHRaqsW/8aGV5Y/UUWrJv/SG+hIVCazL0+bStpVWzySZQBelZvmYdewVzCzVszv6yCIYO+jraK5Gqw2egeWVwDPQx/msQOxZqVk/qtiPD79+Qj5urv5EkPYGHgzJj1a9WI1gaCyWEfUaaSUw46oWNtITaRs50jHsoNv46onxyacBlWSbN59hYMWK7UizbzMH1XzNBkkiqlJcPQX+VO4yY9pBT6iQUhzXoK8BtC5MHmv0xAHypHsqZfKgVcHrUaT+BiojamcZKk1icZawFePuF4dRA54vN9s9boQLJnq5wEgy50JsT3AtaCkO7GqpdXuFGCiuEHoTl/FyuwD3Wc+Z/pplLrT736NYboYHHYurqCWvoi8vv85/WZV1EethCRYAAAAASUVORK5CYII="
185
+ }),
186
+ p("img", {
187
+ onClick: c[3] || (c[3] = (y) => V(90)),
188
+ title: "向右旋转90°",
189
+ class: "icon",
190
+ alt: "",
191
+ src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAMAAABiM0N1AAAAn1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8Kd3m4AAAANHRSTlMA+uLt1gYw/JxwDvbzysWhR7ORi2hVCtHPuamGWk9ANSIRCGFCLSgdGBXo2jquo5l1Gn1bVjAitwAAAkhJREFUWMPtl9ly6jAMhu1sZCMrgRASlrCGFgqt3//ZTmUfhsMc23HaXHSmfDeZiTW/LVmWZfTkye/DcuxA84iv5XGaNV9VeX3Tyb8MAmeFulMa5H88e9lRZmMQPjh1kTpuSBj6yYmWK+QuF1k6HBCKNlcP8QubvIgefu/fNRarmammE/nUPOSEI2MeT2/ujccSnQyDbb7gDpoXD0aHbPvW2KuEOhXVSUy530O6lCMhLyK7rQdujZCY1RSUYtCE7RBYjQ3QyZCMmiq9I3ShgnxssBkhOeMh7KmF4s+PwzeZ0/igNg5HCFMNu2vxLXIwMBUyBCYsxCGqIEAWUuCW+gV/GHx/ky/llG5gxVfYXGE4FxDDvTQ4kGT+ab1HCRPacc1gMJSXKPKX/MwOMN8MzqT8aJsBeeDMtdqxKeRE6YTcWXNtRtSzdg4f4ZEw+AG16RRqbJ2pJzwf4P8CKWPOK1Mcaxf1gE8IRn0AR+dnCfXgWs/BZtvfAywhewCOiN2HEDu0qrjFpJRF+1VVKCUEXwVjSQffap3VR2Gp9Q7qAZ0gQFT8E7UFadKLtILqv1URmn1aHmvxOJTRQKUV8+63tfjKnrVvPbQahtmW3eSjrTbGcCNLE4W1NTiSCxUq6976oFTK5oppG9neYWM6nzAAyxzGJwr1hjWjgSALHB9GjUa9PcbJnpNo7JoNVt0a9vPm4XfjGIQS1t2fEAV9QpiNlc1uTwi97OVRM7CbPp5ZONyh7szZw+9Ofrl+6ymqE6wb07Q8oCdPfiF/ANQydloYw+eCAAAAAElFTkSuQmCC"
192
+ }),
193
+ p("img", {
194
+ onClick: U,
195
+ title: "关闭",
196
+ class: "icon",
197
+ alt: "",
198
+ src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAMAAABiM0N1AAAAbFBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8+T+BWAAAAI3RSTlMAsoyKtI+5mK+spJ/RvKecjnMGyb+pkw3AtoN6V0cb6js4LTOnxLwAAAFGSURBVFjD7dbLbsIwEIXhScCEBsilBcq1t3n/d6zTNjpIjjzOzKqS/w0L0KfRAQSUy+VyQ2vmmhK6MG9fI8/f2VfITsm+PvKCD06SHEsQNTy0TriHt88UaylLC2bGRIL0JN3jHakiLjk4adKBJut46AX7yFIzuU+6g50ao4Ob6mBnOGoJO5/SFUib8J79HAU7tQ/74B6NVKnvQcUoYZ8dkV464nO40iiQnN/H4mCnvodjuGnsTMgiLclYxXjzTF1/oavV6fiv0uYcMbazO23789DpDHwvivHztLDd4x2jVMEhOusXr/BTiZuc1cFNagetNDu1oxNK5VwHP9uQ5u60gTMldVYHO6kdtEuX6tAJpTLVORASFpcd9U3Yp6Foe3mnG+6JdeKhe+wPPe4RbhJOent/+Csj7fRFMam/UVKX+pNyudx/7hvtEkCDo9yvRAAAAABJRU5ErkJggg=="
199
+ })
200
+ ])
201
+ ], 32)) : F("", !0)
202
+ ]),
203
+ _: 1
204
+ }));
205
+ }
206
+ }, le = /* @__PURE__ */ K(ae, [["__scopeId", "data-v-fd184b03"]]), se = {
207
+ mounted(e) {
208
+ e.clickShowImage = (t) => {
209
+ try {
210
+ if (t.target.tagName !== "IMG" || !t.target.src) return;
211
+ if (e.instance) {
212
+ e.instance.show();
213
+ return;
214
+ }
215
+ const o = O(le, { src: t.target.src }), n = document.createElement("div"), a = o.mount(n);
216
+ e.instance = a, e.app = o, document.body.appendChild(a.$el), a.show();
217
+ } catch (o) {
218
+ console.error("Image viewer error:", o);
219
+ }
220
+ }, e.addEventListener("click", e.clickShowImage, { passive: !0 });
221
+ },
222
+ beforeUnmount(e) {
223
+ try {
224
+ if (e.removeEventListener("click", e.clickShowImage, { passive: !0 }), !e.instance) return;
225
+ e.instance.hide(), setTimeout(() => {
226
+ e.app.unmount(), e.instance.$el.remove(), e.instance = null;
227
+ }, 200);
228
+ } catch (t) {
229
+ console.log("Image viewer error:", t);
230
+ }
231
+ }
232
+ }, ie = { class: "yu-loading" }, Ae = ["textContent"], ce = {
233
+ __name: "index",
234
+ props: {
235
+ text: {
236
+ type: String,
237
+ default() {
238
+ return "";
239
+ }
240
+ },
241
+ bgColor: {
242
+ type: String,
243
+ default() {
244
+ return "";
245
+ }
246
+ },
247
+ color: {
248
+ type: String,
249
+ default() {
250
+ return "";
251
+ }
252
+ },
253
+ fullscreen: {
254
+ type: Boolean,
255
+ default() {
256
+ return !1;
257
+ }
258
+ },
259
+ zIndex: {
260
+ type: Number,
261
+ default() {
262
+ return 998;
263
+ }
264
+ }
265
+ },
266
+ setup(e, { expose: t }) {
267
+ const o = w(!1);
268
+ return t({
269
+ show: () => {
270
+ o.value = !0;
271
+ },
272
+ hide: () => {
273
+ o.value = !1;
274
+ }
275
+ }), (m, s) => (h(), x(S, {
276
+ name: "yu-loading",
277
+ appear: ""
278
+ }, {
279
+ default: I(() => [
280
+ o.value ? (h(), C("div", {
281
+ key: 0,
282
+ class: P(["yu-loading-wrapper", { "yu-loading-fullscreen": e.fullscreen }]),
283
+ style: N({ "--yu-loading-color": e.color || "var(--qui-color-primary, #3565ee)", background: e.bgColor, zIndex: e.zIndex })
284
+ }, [
285
+ p("div", ie, [
286
+ s[0] || (s[0] = p("div", { class: "loading-icon" }, null, -1)),
287
+ X(p("div", {
288
+ class: "loading-text",
289
+ textContent: Z(e.text)
290
+ }, null, 8, Ae), [
291
+ [q, e.text]
292
+ ])
293
+ ])
294
+ ], 6)) : F("", !0)
295
+ ]),
296
+ _: 1
297
+ }));
298
+ }
299
+ }, re = /* @__PURE__ */ K(ce, [["__scopeId", "data-v-1a0ab7d2"]]), ue = {
300
+ mounted(e, t) {
301
+ e.style.position = "relative";
302
+ const o = parseInt(e.getAttribute("loading-z-index")), n = {
303
+ text: e.getAttribute("loading-text") || "",
304
+ color: e.getAttribute("loading-color") || "",
305
+ zIndex: o || 998
306
+ }, a = O(re, n), m = document.createElement("div"), s = a.mount(m);
307
+ e.instance = s, e.appendChild(s.$el), t.value ? s.show() : s.hide();
308
+ },
309
+ updated(e, t) {
310
+ console.log("updated"), t.value !== t.oldValue && (t.value ? e.instance.show() : e.instance.hide());
311
+ },
312
+ beforeUnmount(e) {
313
+ console.log("beforeUnmount"), e.instance.hide(), setTimeout(() => {
314
+ e.instance.$el.remove(), e.instance = null;
315
+ }, 200);
316
+ }
317
+ }, de = {
318
+ __name: "index",
319
+ props: /* @__PURE__ */ R({
320
+ color: {
321
+ type: String,
322
+ default: function() {
323
+ return "rgba(0, 0, 0, 0.5)";
324
+ }
325
+ },
326
+ zIndex: {
327
+ type: Number,
328
+ default: function() {
329
+ return 999;
330
+ }
331
+ },
332
+ closable: {
333
+ type: Boolean,
334
+ default: function() {
335
+ return !0;
336
+ }
337
+ },
338
+ lockScroll: {
339
+ type: Boolean,
340
+ default() {
341
+ return !1;
342
+ }
343
+ }
344
+ }, {
345
+ modelValue: { type: Boolean, default: !1 },
346
+ modelModifiers: {}
347
+ }),
348
+ emits: /* @__PURE__ */ R(["close"], ["update:modelValue"]),
349
+ setup(e, { expose: t, emit: o }) {
350
+ const n = z(e, "modelValue"), a = e, m = o, s = $(() => ({
351
+ backgroundColor: a.color,
352
+ zIndex: a.zIndex
353
+ }));
354
+ J(n, (A) => {
355
+ a.lockScroll && (document.body.style.overflow = A ? "hidden" : "");
356
+ });
357
+ const i = () => {
358
+ n.value = !0;
359
+ }, r = () => {
360
+ n.value = !1;
361
+ }, u = () => {
362
+ a.closable && (r(), m("close"));
363
+ };
364
+ return t({
365
+ show: i,
366
+ hide: r
367
+ }), (A, d) => (h(), x(S, {
368
+ name: "yu-mask-fade",
369
+ appear: ""
370
+ }, {
371
+ default: I(() => [
372
+ n.value ? (h(), C("div", {
373
+ key: 0,
374
+ class: "yu-page-mask",
375
+ style: N(s.value),
376
+ onClick: u
377
+ }, null, 4)) : F("", !0)
378
+ ]),
379
+ _: 1
380
+ }));
381
+ }
382
+ }, me = /* @__PURE__ */ K(de, [["__scopeId", "data-v-2eb2644e"]]), ge = (e, t) => {
383
+ const {
384
+ visible: o = !1,
385
+ color: n = "rgba(0,0,0,0.5)",
386
+ zIndex: a = 999,
387
+ closable: m = !0,
388
+ lockScroll: s = !1,
389
+ onClose: i = null
390
+ } = t.value, r = document.createElement("div"), A = O(me, {
391
+ modelValue: o,
392
+ closable: m,
393
+ color: n,
394
+ zIndex: a,
395
+ lockScroll: s,
396
+ onClose: () => {
397
+ i && typeof i == "function" && i();
398
+ }
399
+ }).mount(r);
400
+ document.body.appendChild(A.$el), e.cleanup = () => {
401
+ document.body.removeChild(A.$el);
402
+ };
403
+ }, ve = {
404
+ updated(e, t) {
405
+ const { value: o } = t;
406
+ o.visible ? ge(e, t) : e.cleanup();
407
+ },
408
+ beforeUnmount(e) {
409
+ e.cleanup && e.cleanup();
410
+ }
411
+ }, fe = {
412
+ vOutside: _,
413
+ vWatermark: oe,
414
+ vViewer: se,
415
+ vLoading: ue,
416
+ vMask: ve
417
+ };
418
+ export {
419
+ fe as default,
420
+ ue as vLoading,
421
+ ve as vMask,
422
+ _ as vOutside,
423
+ se as vViewer,
424
+ oe as vWatermark
425
+ };
@@ -0,0 +1 @@
1
+ (function(g,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(g=typeof globalThis<"u"?globalThis:g||self,t(g.YUI={},g.Vue))})(this,(function(g,t){"use strict";const b={beforeMount(e,o){e.clickOutsideEvent=n=>{e===n.target||e.contains(n.target)||o.value(n)},document.addEventListener("click",e.clickOutsideEvent)},unmounted(e){document.removeEventListener("click",e.clickOutsideEvent)}};function D(){return{createWatermark:(o,n,a,l,p,i,c,d,m)=>new Promise((r,u)=>{try{const k=document.createElement("canvas");k.width=o,k.height=n;const f=k.getContext("2d");f.translate(o/2,n/2),f.rotate(-c*Math.PI/180),f.globalAlpha=a>=0&&a<=1?a:.2;let w=0;if(l){f.font=`${p}px Arial`,f.fillStyle=i,f.textBaseline="middle",f.textAlign="center";const h=d?(m+10)/2:0;w=f.measureText(l).width,f.fillText(l,h,0,o)}if(d){const h=new Image;h.src=d,h.setAttribute("crossOrigin","Anonymous"),h.onload=function(){const C=h.width,E=h.height*m/C,B=-(m+w+10)/2;f.drawImage(h,B,-E/2,m,E),r(k.toDataURL("image/png"))}}else r(k.toDataURL("image/png"))}catch(k){u(k)}})}}const{createWatermark:j}=D(),R={mounted(e,o){const{width:n=240,height:a=240,opacity:l=.2,content:p="",angle:i=30,fontSize:c=20,fontColor:d="#999",img:m="",imgWidth:r=50}=o.value;j(n,a,l,p,c,d,i,m,r).then(u=>{e.style.backgroundImage=`url(${u})`,e.style.backgroundPosition="center top",e.style.backgroundRepeat="repeat"}).catch(u=>{console.error(u)})}},V=(e,o)=>{const n=e.__vccOpts||e;for(const[a,l]of o)n[a]=l;return n},z=["src"],v=.95,W=V({__name:"index",props:t.mergeModels({src:{type:String,default(){return""}},maskClose:{type:Boolean,default(){return!0}}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:t.mergeModels(["close"],["update:modelValue"]),setup(e,{expose:o,emit:n}){const a=t.useModel(e,"modelValue"),l=e,p=n,i=t.ref(1),c=t.ref(1),d=t.ref(0),m=t.ref(0),r=t.ref(0),u=t.ref(!0),k=()=>{l.maskClose&&T()},f=s=>{m.value=s.target.naturalWidth,r.value=s.target.naturalHeight,w()},w=()=>{const s=window.innerWidth,A=window.innerHeight,y=A/s,Z=r.value/m.value;let U=1;Z>y?U=A*v/r.value:U=s*v/m.value;const q=Math.round(U*10)/10;i.value=Math.max(q,1),u.value||(c.value=i.value)},h=s=>{s.preventDefault(),s.wheelDelta>0?M():C()},C=(s=.1)=>{const A=c.value-s;c.value=Math.max(A,.1)},M=(s=.1)=>{const A=c.value+s;c.value=Math.min(A,2)},E=()=>{u.value=!u.value,c.value=u.value?1:i.value},B=s=>{d.value+=s},P=()=>{a.value=!0},N=()=>{a.value=!1,X()},T=()=>{N(),p("close")},X=()=>{i.value=1,c.value=1,d.value=0,m.value=0,r.value=0},F=s=>{s.stopPropagation()},O=()=>{a.value&&!u.value&&w()},K=s=>{s.key==="Escape"&&T()};return t.watch(a,s=>{s?(document.body.style.overflow="hidden",window.addEventListener("keydown",K),window.addEventListener("resize",O)):(document.body.style.overflow="",window.removeEventListener("keydown",K),window.removeEventListener("resize",O))},{immediate:!0}),o({show:P,hide:N}),(s,A)=>(t.openBlock(),t.createBlock(t.Transition,{name:"yu-img-viewer",appear:""},{default:t.withCtx(()=>[a.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"yu-img-viewer-wrapper",onClick:k,onWheel:h},[t.createElementVNode("img",{src:e.src,class:"img-show",onClick:F,onLoad:f,style:t.normalizeStyle(`max-width:${v*100}%;max-height:${v*100}%;transform: scale(${c.value}) rotate(${d.value}deg);transition: all 0.3s ease;`),alt:""},null,44,z),t.createElementVNode("div",{class:"yu-img-viewer",onClick:F},[t.createElementVNode("img",{onClick:A[0]||(A[0]=y=>C()),title:"缩小",class:"icon",alt:"",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAMAAABiM0N1AAAAmVBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////VHQRUAAAAMnRSTlMA9+7gJPncJwX06aV0ShHkmo4+GrFIRbdvU3tsamZhNDDPxbaflU7WvzIgHg2tgzmHWNLgL/wAAAJTSURBVFjD7Zdrd7IwDMfDTRAE8QJDuaiIt6nb8/T7f7gR2TkeWEtT5975e5mUP23StCm8eMHHzsOjMWRsaJRhZj+qctqNWYvx7hPU+b9hHA65oyazPzABxh7oBFfWoM9HsR04TmDHo7n+bdyeqTrTJjaaF7Xtkac18j5NJ7FuMpPZT9ds0kgtKTr/GPJm8r3mG0N2cp2P23RSEJJqJKUMR7kr6GHlElY3xfgMTOjFHKDSvjfvmK/xO0h4x2F63y7wMD4nkLLWMB9if8xqMkAooVwI3Yfbf0hssVpEdbfAhZk0IRMXVwicWO8TIDLB9AoiiBOaUYVmOKWp8B8ekMEMh1yPUXsiulCEJcANH24yUADPpzXHntf2uYrQvP4g4djD2j5SERrVH1Qc+7G2+ypCfv1BybFjSdsqQjZubkHsLq0jxWAdjNa+CQTZwZEtQ1enOwGnNlh/KTTsLi3+oTQgLc1QDragbMtH0n/k2CvlDSmo2uSREkn5x5F60XIvCvdJxwiE6gdbxb9lFY9acZYHTzr8oVC7jsS7xTGwsaNfkO4Fem5IllN0chyZiP3Yjg3XhCYCK3zjgJCzTm9rrFVvf83IjVYiaSGprd8GJISyZjTTGK1F3snbY6LSkskadoRyevl6I+XFbXvsfctcoyGTxhs5b++PGr951Pj3R41eAEwbpRRkLAZMgFXhklGJVgZOceDJaJUNDXGjVICcz9DtTOaYBXd3pBGVkFMalvg41selt4wvnZxYN/UF/Jq9JdniZBao5MKTlK7wDFYfSQAvXgB8AbQmiYamqSF8AAAAAElFTkSuQmCC"}),t.createElementVNode("img",{onClick:A[1]||(A[1]=y=>M()),title:"放大",class:"icon",alt:"",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAMAAABiM0N1AAAAilBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////2N2iNAAAALXRSTlMA+ODk70Uk9belj3QnBdxKRzHonfyYVDUfGhFv7LF8bGpmYT3PxK9O1r4NhhWkhma1AAACU0lEQVRYw+2X2ZqaQBCFD4swCAgD4oYr7mbq/V8vFoxfPkw3VE/Mnf9lqae71i7x5o2aaFdcbZ/It4/5NsIP+Rw61MIppjBnciAFl10MI84X0mCfIefrRA3uKhxEizheRINw5VLDagYhe4cYK0jRIg0sYpYJRJTjWmY4x1/Mh43UGgJ+EfPhQYn3QcxQqGNtoGVTX6pAD1u6k3XWyzQTeLfn+Iw8dOKNWOncmXfOl9Ob3pnDuev6WsDx+RR0j8X5gJYB3dmCkYRyAh2X+hwRXAV2rOtTdsyDCI+dq6DmUFeakCGnVxNBvtBcETnHGSi6ha+0154RKOw2ka3JcA6of0Cpwk53FOaUW0AZPp4/kAuB55Oq5nY8s0yEVkRUKuwFEYUmQqEmSFciSkyEEiI6Kuzc0pGJUMTFrYndrV0/9ES7nhY8AiQH29Tm+QIxF/D/FPL7XbPTZ9dcVWEbB1vTtsefpP+qsOfGBal5lUrTFuEFYaMaR69qWmTmY2QJFfmrBtteO2rtVDNqEygZvWj4ozJ9jkKoiW2zBzK7oeOFpB0E7OhO2X2OL1kiuMMPMbTMlvK1ZjxFB2cSL1plzwopXf0O6KHoW0a3FslW5EKyHjMhelgT46sXdp9IrpQsv/9CDJ6aLvj2KkhdYsre9D7u757CpPlTk4Qn92GsgL1PzAZ9TEakYZx/AbWSrA3i6kIK/Dx6+NkoVehnWmTUwrpuF38+Tq36ghUkfG7yo+3T2HWOwXpwe8pJozTBP3O2ekpczISVMrxCaUx0wiuYrssF3rwBfgPQ0YapPYGLOQAAAABJRU5ErkJggg=="}),u.value?(t.openBlock(),t.createElementBlock("img",{key:0,onClick:E,title:"适应窗口",class:"icon",alt:"",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABIBAMAAACnw650AAAALVBMVEUAAAD///////////////////////////////////////////////////////+hSKubAAAADnRSTlMA7+b59OdySknVttYPDGmoZHwAAACySURBVEjHYxgFQx5k2r0DgkcNEB6HHoj3eBqqGq53EKAA4TJBuQtQFOVBRQNQFT1DUTTvnaEgEDgVQLjsISCe8LvXKIrsHl/AdCev3WMU/ruH2Hwj925UETmKnmBT5IeqSO8plIFPtFQdykAXHQWjABU0aRAhqvcIysAQJZx8h0C+G6qK7B4fwFTDY/cYa2EPq1tUEIU9ZrWhgK/a4MJetyzAWpXB6pY4cFW2jWEUDHUAANSUoGLnF/1TAAAAAElFTkSuQmCC"})):(t.openBlock(),t.createElementBlock("img",{key:1,onClick:E,title:"实际尺寸",class:"icon",alt:"",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABIBAMAAACnw650AAAAJ1BMVEUAAAD///////////////////////////////////////////////+uPUo5AAAADHRSTlMA7vD5hXLVtg3W1HNKpeIJAAAAkUlEQVRIx2MYBaMABqJszmABh1OR1bCfwQEKkBTF4FJ0FElRzhlDQSxA+MxJJEU2hxuwuZTD5jAS78wh7P7ROTOqCIsiZxMgAWXhVAQOYCgLp6IzIDEoC78iZxNCimA2EVZEHetAYPApGorhhJZUCCe6wZIRhp4iAsUh4YKVcBF9mtTCniEMe7UxlWEUjAIoAACLZA9Ayw+XDwAAAABJRU5ErkJggg=="})),t.createElementVNode("img",{onClick:A[2]||(A[2]=y=>B(-90)),title:"向左旋转90°",class:"icon",alt:"",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAMAAABiM0N1AAAAn1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8Kd3m4AAAANHRSTlMA+u1wMJv0EAzjysVFGwb81aJVCdu4aFrSzqiNijsV96+fkWFALSgj59dNNRizfFFJhe++/7y+OwAAAjhJREFUWMPt19dy4jAUBuBfLjHggsEB06vpJeyu3v/Z1kdyJmSwZMFwkZnwXWUic+RzJKvg5eU3mrRHndhifFr3XdvBgzzbb/JrljvG/TbulN+K03vfZsh4uTjDHfZ1LjQbo7YzieBtAntmcalVg6khF97tENcuAyb/ry97rfb5R4eTXbukcHNR/rdAl82ULWV5GvTs9ByhzKFPrawNpXfOt8glDf3bRwsRaQ+Vv3kz/XpGz/3zoNZtUnYrKJzyVhs4U5xOAp02Rdqpxs6mAHBoXBoJ9LrUm6todOh9RYG2R7P5ofpeaL4N6IEAlSLqsK9opCCkBQMOlelDnTilF1KPwXCmfzGXaolSaxlogXA5e6OpEkIjZGK6lKrLzPq8MIbOXHRaqsW/8aGV5Y/UUWrJv/SG+hIVCazL0+bStpVWzySZQBelZvmYdewVzCzVszv6yCIYO+jraK5Gqw2egeWVwDPQx/msQOxZqVk/qtiPD79+Qj5urv5EkPYGHgzJj1a9WI1gaCyWEfUaaSUw46oWNtITaRs50jHsoNv46onxyacBlWSbN59hYMWK7UizbzMH1XzNBkkiqlJcPQX+VO4yY9pBT6iQUhzXoK8BtC5MHmv0xAHypHsqZfKgVcHrUaT+BiojamcZKk1icZawFePuF4dRA54vN9s9boQLJnq5wEgy50JsT3AtaCkO7GqpdXuFGCiuEHoTl/FyuwD3Wc+Z/pplLrT736NYboYHHYurqCWvoi8vv85/WZV1EethCRYAAAAASUVORK5CYII="}),t.createElementVNode("img",{onClick:A[3]||(A[3]=y=>B(90)),title:"向右旋转90°",class:"icon",alt:"",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAMAAABiM0N1AAAAn1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8Kd3m4AAAANHRSTlMA+uLt1gYw/JxwDvbzysWhR7ORi2hVCtHPuamGWk9ANSIRCGFCLSgdGBXo2jquo5l1Gn1bVjAitwAAAkhJREFUWMPtl9ly6jAMhu1sZCMrgRASlrCGFgqt3//ZTmUfhsMc23HaXHSmfDeZiTW/LVmWZfTkye/DcuxA84iv5XGaNV9VeX3Tyb8MAmeFulMa5H88e9lRZmMQPjh1kTpuSBj6yYmWK+QuF1k6HBCKNlcP8QubvIgefu/fNRarmammE/nUPOSEI2MeT2/ujccSnQyDbb7gDpoXD0aHbPvW2KuEOhXVSUy530O6lCMhLyK7rQdujZCY1RSUYtCE7RBYjQ3QyZCMmiq9I3ShgnxssBkhOeMh7KmF4s+PwzeZ0/igNg5HCFMNu2vxLXIwMBUyBCYsxCGqIEAWUuCW+gV/GHx/ky/llG5gxVfYXGE4FxDDvTQ4kGT+ab1HCRPacc1gMJSXKPKX/MwOMN8MzqT8aJsBeeDMtdqxKeRE6YTcWXNtRtSzdg4f4ZEw+AG16RRqbJ2pJzwf4P8CKWPOK1Mcaxf1gE8IRn0AR+dnCfXgWs/BZtvfAywhewCOiN2HEDu0qrjFpJRF+1VVKCUEXwVjSQffap3VR2Gp9Q7qAZ0gQFT8E7UFadKLtILqv1URmn1aHmvxOJTRQKUV8+63tfjKnrVvPbQahtmW3eSjrTbGcCNLE4W1NTiSCxUq6976oFTK5oppG9neYWM6nzAAyxzGJwr1hjWjgSALHB9GjUa9PcbJnpNo7JoNVt0a9vPm4XfjGIQS1t2fEAV9QpiNlc1uTwi97OVRM7CbPp5ZONyh7szZw+9Ofrl+6ymqE6wb07Q8oCdPfiF/ANQydloYw+eCAAAAAElFTkSuQmCC"}),t.createElementVNode("img",{onClick:T,title:"关闭",class:"icon",alt:"",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAMAAABiM0N1AAAAbFBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8+T+BWAAAAI3RSTlMAsoyKtI+5mK+spJ/RvKecjnMGyb+pkw3AtoN6V0cb6js4LTOnxLwAAAFGSURBVFjD7dbLbsIwEIXhScCEBsilBcq1t3n/d6zTNjpIjjzOzKqS/w0L0KfRAQSUy+VyQ2vmmhK6MG9fI8/f2VfITsm+PvKCD06SHEsQNTy0TriHt88UaylLC2bGRIL0JN3jHakiLjk4adKBJut46AX7yFIzuU+6g50ao4Ob6mBnOGoJO5/SFUib8J79HAU7tQ/74B6NVKnvQcUoYZ8dkV464nO40iiQnN/H4mCnvodjuGnsTMgiLclYxXjzTF1/oavV6fiv0uYcMbazO23789DpDHwvivHztLDd4x2jVMEhOusXr/BTiZuc1cFNagetNDu1oxNK5VwHP9uQ5u60gTMldVYHO6kdtEuX6tAJpTLVORASFpcd9U3Yp6Foe3mnG+6JdeKhe+wPPe4RbhJOent/+Csj7fRFMam/UVKX+pNyudx/7hvtEkCDo9yvRAAAAABJRU5ErkJggg=="})])],32)):t.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-fd184b03"]]),S={mounted(e){e.clickShowImage=o=>{try{if(o.target.tagName!=="IMG"||!o.target.src)return;if(e.instance){e.instance.show();return}const n=t.createApp(W,{src:o.target.src}),a=document.createElement("div"),l=n.mount(a);e.instance=l,e.app=n,document.body.appendChild(l.$el),l.show()}catch(n){console.error("Image viewer error:",n)}},e.addEventListener("click",e.clickShowImage,{passive:!0})},beforeUnmount(e){try{if(e.removeEventListener("click",e.clickShowImage,{passive:!0}),!e.instance)return;e.instance.hide(),setTimeout(()=>{e.app.unmount(),e.instance.$el.remove(),e.instance=null},200)}catch(o){console.log("Image viewer error:",o)}}},H={class:"yu-loading"},J=["textContent"],G=V({__name:"index",props:{text:{type:String,default(){return""}},bgColor:{type:String,default(){return""}},color:{type:String,default(){return""}},fullscreen:{type:Boolean,default(){return!1}},zIndex:{type:Number,default(){return 998}}},setup(e,{expose:o}){const n=t.ref(!1);return o({show:()=>{n.value=!0},hide:()=>{n.value=!1}}),(p,i)=>(t.openBlock(),t.createBlock(t.Transition,{name:"yu-loading",appear:""},{default:t.withCtx(()=>[n.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["yu-loading-wrapper",{"yu-loading-fullscreen":e.fullscreen}]),style:t.normalizeStyle({"--yu-loading-color":e.color||"var(--qui-color-primary, #3565ee)",background:e.bgColor,zIndex:e.zIndex})},[t.createElementVNode("div",H,[i[0]||(i[0]=t.createElementVNode("div",{class:"loading-icon"},null,-1)),t.withDirectives(t.createElementVNode("div",{class:"loading-text",textContent:t.toDisplayString(e.text)},null,8,J),[[t.vShow,e.text]])])],6)):t.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-1a0ab7d2"]]),x={mounted(e,o){e.style.position="relative";const n=parseInt(e.getAttribute("loading-z-index")),a={text:e.getAttribute("loading-text")||"",color:e.getAttribute("loading-color")||"",zIndex:n||998},l=t.createApp(G,a),p=document.createElement("div"),i=l.mount(p);e.instance=i,e.appendChild(i.$el),o.value?i.show():i.hide()},updated(e,o){console.log("updated"),o.value!==o.oldValue&&(o.value?e.instance.show():e.instance.hide())},beforeUnmount(e){console.log("beforeUnmount"),e.instance.hide(),setTimeout(()=>{e.instance.$el.remove(),e.instance=null},200)}},Y=V({__name:"index",props:t.mergeModels({color:{type:String,default:function(){return"rgba(0, 0, 0, 0.5)"}},zIndex:{type:Number,default:function(){return 999}},closable:{type:Boolean,default:function(){return!0}},lockScroll:{type:Boolean,default(){return!1}}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:t.mergeModels(["close"],["update:modelValue"]),setup(e,{expose:o,emit:n}){const a=t.useModel(e,"modelValue"),l=e,p=n,i=t.computed(()=>({backgroundColor:l.color,zIndex:l.zIndex}));t.watch(a,r=>{l.lockScroll&&(document.body.style.overflow=r?"hidden":"")});const c=()=>{a.value=!0},d=()=>{a.value=!1},m=()=>{l.closable&&(d(),p("close"))};return o({show:c,hide:d}),(r,u)=>(t.openBlock(),t.createBlock(t.Transition,{name:"yu-mask-fade",appear:""},{default:t.withCtx(()=>[a.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"yu-page-mask",style:t.normalizeStyle(i.value),onClick:m},null,4)):t.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-2eb2644e"]]),Q=(e,o)=>{const{visible:n=!1,color:a="rgba(0,0,0,0.5)",zIndex:l=999,closable:p=!0,lockScroll:i=!1,onClose:c=null}=o.value,d=document.createElement("div"),r=t.createApp(Y,{modelValue:n,closable:p,color:a,zIndex:l,lockScroll:i,onClose:()=>{c&&typeof c=="function"&&c()}}).mount(d);document.body.appendChild(r.$el),e.cleanup=()=>{document.body.removeChild(r.$el)}},I={updated(e,o){const{value:n}=o;n.visible?Q(e,o):e.cleanup()},beforeUnmount(e){e.cleanup&&e.cleanup()}},L={vOutside:b,vWatermark:R,vViewer:S,vLoading:x,vMask:I};g.default=L,g.vLoading=x,g.vMask=I,g.vOutside=b,g.vViewer=S,g.vWatermark=R,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
@@ -0,0 +1,6 @@
1
+ export default vOutside;
2
+ declare namespace vOutside {
3
+ function beforeMount(el: any, binding: any): void;
4
+ function unmounted(el: any): void;
5
+ }
6
+ //# sourceMappingURL=outside.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outside.d.ts","sourceRoot":"","sources":["../../src/directives/outside.js"],"names":[],"mappings":";;IACE,kDAOC;IACD,kCAGC"}
@@ -0,0 +1 @@
1
+ @charset "UTF-8";.yu-img-viewer-wrapper[data-v-fd184b03]{position:fixed;inset:0;z-index:998;background-color:#0006;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;align-items:center;justify-content:center;overflow:hidden;-webkit-user-select:none;user-select:none;will-change:transform,opacity}.yu-img-viewer-wrapper .yu-img-viewer[data-v-fd184b03]{position:fixed;bottom:40px;left:50%;z-index:1;transform:translate(-50%);font-size:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;align-items:center;gap:10px;background-color:#00000080;padding:10px 15px;border-radius:50px}.yu-img-viewer-wrapper .yu-img-viewer .icon[data-v-fd184b03]{width:24px;height:24px;padding:5px;box-sizing:content-box;max-width:none}.yu-img-viewer-enter-active[data-v-fd184b03],.yu-img-viewer-leave-active[data-v-fd184b03]{transition:transform .3s cubic-bezier(.4,0,.2,1),opacity .3s linear}.yu-img-viewer-enter-from[data-v-fd184b03],.yu-img-viewer-leave-to[data-v-fd184b03]{transform:translateY(-10px);opacity:0}@media screen and (min-width:768px){.yu-img-viewer-wrapper .yu-img-viewer .icon[data-v-fd184b03]{cursor:pointer}}@media screen and (max-width:768px){.yu-img-viewer-wrapper .yu-img-viewer[data-v-fd184b03]{bottom:20px;left:15px;right:15px;z-index:1;transform:translate(0);justify-content:space-between;padding:10px 15px;border-radius:10px}.yu-img-viewer-wrapper .yu-img-viewer .icon[data-v-fd184b03]{padding:6px}}.yu-loading-wrapper[data-v-1a0ab7d2]{position:absolute;inset:0;width:100%;height:100%;z-index:998;background:#fffc;opacity:1;will-change:opacity;display:flex;align-items:center;justify-content:center}.yu-loading-wrapper.yu-loading-fullscreen[data-v-1a0ab7d2]{position:fixed}.yu-loading-wrapper .yu-loading[data-v-1a0ab7d2]{display:flex;flex-direction:column;align-items:center;gap:15px}.yu-loading-wrapper .yu-loading .loading-icon[data-v-1a0ab7d2]{width:36px;aspect-ratio:1;--_bg: no-repeat radial-gradient(farthest-side, var(--yu-loading-color,#333) 92%, #0000);background:var(--_bg) top,var(--_bg) left,var(--_bg) right,var(--_bg) bottom;background-size:8px 8px;animation:loadingPointRotate-1a0ab7d2 .75s infinite}.yu-loading-wrapper .yu-loading .loading-text[data-v-1a0ab7d2]{font-size:inherit;line-height:1.5;color:var(--yu-loading-color, #333)}.yu-loading-enter-active[data-v-1a0ab7d2],.yu-loading-leave-active[data-v-1a0ab7d2]{transition:opacity .2s ease}.yu-loading-enter-from[data-v-1a0ab7d2],.yu-loading-leave-to[data-v-1a0ab7d2]{opacity:0}@keyframes loadingPointRotate-1a0ab7d2{to{transform:rotate(.5turn)}}.dark .yu-loading-wrapper[data-v-1a0ab7d2]{background:#000c}.yu-page-mask[data-v-2eb2644e]{position:fixed;inset:0;width:100%;height:100%;background-color:transparent;transition:all .3s ease-out;z-index:999;opacity:1}.yu-mask-fade-enter-from[data-v-2eb2644e],.yu-mask-fade-leave-to[data-v-2eb2644e]{opacity:0}.yu-mask-fade-enter-active[data-v-2eb2644e],.yu-mask-fade-leave-active[data-v-2eb2644e]{transition:opacity .3s ease}
@@ -0,0 +1,6 @@
1
+ declare namespace _default {
2
+ export { install };
3
+ }
4
+ export default _default;
5
+ declare function install(app: any): void;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";;;;AASA,yCAeC"}
@@ -0,0 +1,2 @@
1
+ (function(w,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(w=typeof globalThis<"u"?globalThis:w||self,t(w["vue-next-yui"]={},w.Vue))})(this,(function(w,t){"use strict";var T=document.createElement("style");T.textContent=`@charset "UTF-8";.yu-watermark-wrapper[data-v-11d0b7dd]{background-repeat:repeat}.yu-watermark-wrapper .yu-watermark[data-v-11d0b7dd]{mix-blend-mode:multiply}.yu-img-viewer-wrapper[data-v-fd184b03]{position:fixed;inset:0;z-index:998;background-color:#0006;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;align-items:center;justify-content:center;overflow:hidden;-webkit-user-select:none;user-select:none;will-change:transform,opacity}.yu-img-viewer-wrapper .yu-img-viewer[data-v-fd184b03]{position:fixed;bottom:40px;left:50%;z-index:1;transform:translate(-50%);font-size:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;align-items:center;gap:10px;background-color:#00000080;padding:10px 15px;border-radius:50px}.yu-img-viewer-wrapper .yu-img-viewer .icon[data-v-fd184b03]{width:24px;height:24px;padding:5px;box-sizing:content-box;max-width:none}.yu-img-viewer-enter-active[data-v-fd184b03],.yu-img-viewer-leave-active[data-v-fd184b03]{transition:transform .3s cubic-bezier(.4,0,.2,1),opacity .3s linear}.yu-img-viewer-enter-from[data-v-fd184b03],.yu-img-viewer-leave-to[data-v-fd184b03]{transform:translateY(-10px);opacity:0}@media screen and (min-width:768px){.yu-img-viewer-wrapper .yu-img-viewer .icon[data-v-fd184b03]{cursor:pointer}}@media screen and (max-width:768px){.yu-img-viewer-wrapper .yu-img-viewer[data-v-fd184b03]{bottom:20px;left:15px;right:15px;z-index:1;transform:translate(0);justify-content:space-between;padding:10px 15px;border-radius:10px}.yu-img-viewer-wrapper .yu-img-viewer .icon[data-v-fd184b03]{padding:6px}}.yu-page-mask[data-v-2eb2644e]{position:fixed;inset:0;width:100%;height:100%;background-color:transparent;transition:all .3s ease-out;z-index:999;opacity:1}.yu-mask-fade-enter-from[data-v-2eb2644e],.yu-mask-fade-leave-to[data-v-2eb2644e]{opacity:0}.yu-mask-fade-enter-active[data-v-2eb2644e],.yu-mask-fade-leave-active[data-v-2eb2644e]{transition:opacity .3s ease}.yu-loading-wrapper[data-v-1a0ab7d2]{position:absolute;inset:0;width:100%;height:100%;z-index:998;background:#fffc;opacity:1;will-change:opacity;display:flex;align-items:center;justify-content:center}.yu-loading-wrapper.yu-loading-fullscreen[data-v-1a0ab7d2]{position:fixed}.yu-loading-wrapper .yu-loading[data-v-1a0ab7d2]{display:flex;flex-direction:column;align-items:center;gap:15px}.yu-loading-wrapper .yu-loading .loading-icon[data-v-1a0ab7d2]{width:36px;aspect-ratio:1;--_bg: no-repeat radial-gradient(farthest-side, var(--yu-loading-color,#333) 92%, #0000);background:var(--_bg) top,var(--_bg) left,var(--_bg) right,var(--_bg) bottom;background-size:8px 8px;animation:loadingPointRotate-1a0ab7d2 .75s infinite}.yu-loading-wrapper .yu-loading .loading-text[data-v-1a0ab7d2]{font-size:inherit;line-height:1.5;color:var(--yu-loading-color, #333)}.yu-loading-enter-active[data-v-1a0ab7d2],.yu-loading-leave-active[data-v-1a0ab7d2]{transition:opacity .2s ease}.yu-loading-enter-from[data-v-1a0ab7d2],.yu-loading-leave-to[data-v-1a0ab7d2]{opacity:0}@keyframes loadingPointRotate-1a0ab7d2{to{transform:rotate(.5turn)}}.dark .yu-loading-wrapper[data-v-1a0ab7d2]{background:#000c}
2
+ /*$vite$:1*/`,document.head.appendChild(T);function R(){return{createWatermark:(a,n,o,i,s,r,c,A,m)=>new Promise((d,g)=>{try{const y=document.createElement("canvas");y.width=a,y.height=n;const p=y.getContext("2d");p.translate(a/2,n/2),p.rotate(-c*Math.PI/180),p.globalAlpha=o>=0&&o<=1?o:.2;let h=0;if(i){p.font=`${s}px Arial`,p.fillStyle=r,p.textBaseline="middle",p.textAlign="center";const f=A?(m+10)/2:0;h=p.measureText(i).width,p.fillText(i,f,0,a)}if(A){const f=new Image;f.src=A,f.setAttribute("crossOrigin","Anonymous"),f.onload=function(){const E=f.width,v=f.height*m/E,C=-(m+h+10)/2;p.drawImage(f,C,-v/2,m,v),d(y.toDataURL("image/png"))}}else d(y.toDataURL("image/png"))}catch(y){g(y)}})}}const b=(e,a)=>{const n=e.__vccOpts||e;for(const[o,i]of a)n[o]=i;return n},O={class:"yu-watermark"},j=b({__name:"index",props:{width:{type:Number,default:function(){return 240}},height:{type:Number,default:function(){return 240}},opacity:{type:Number,default:function(){return .2}},angle:{type:Number,default:function(){return 30}},content:{type:String,default:function(){return""}},fontSize:{type:Number,default:function(){return 20}},fontColor:{type:String,default:function(){return"#999"}},img:{type:String,default:function(){return""}},imgWidth:{type:Number,default:function(){return 50}}},setup(e){const a=e,n=t.ref(),{createWatermark:o}=R();t.onMounted(()=>{i()});const i=()=>{o(a.width,a.height,a.opacity,a.content,a.fontSize,a.fontColor,a.angle,a.img,a.imgWidth).then(s=>{n.value.style.backgroundImage=`url(${s})`,n.value.style.backgroundPosition="center top",n.value.style.backgroundRepeat="repeat"}).catch(s=>{console.error(s)})};return t.watch([()=>a.content,()=>a.img],s=>{i()}),(s,r)=>(t.openBlock(),t.createElementBlock("div",{class:"yu-watermark-wrapper",ref_key:"watermarkRef",ref:n},[t.createElementVNode("div",O,[t.renderSlot(s.$slots,"default",{},void 0,!0)])],512))}},[["__scopeId","data-v-11d0b7dd"]]),W=["src"],x=.95,S=b({__name:"index",props:t.mergeModels({src:{type:String,default(){return""}},maskClose:{type:Boolean,default(){return!0}}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:t.mergeModels(["close"],["update:modelValue"]),setup(e,{expose:a,emit:n}){const o=t.useModel(e,"modelValue"),i=e,s=n,r=t.ref(1),c=t.ref(1),A=t.ref(0),m=t.ref(0),d=t.ref(0),g=t.ref(!0),y=()=>{i.maskClose&&V()},p=l=>{m.value=l.target.naturalWidth,d.value=l.target.naturalHeight,h()},h=()=>{const l=window.innerWidth,u=window.innerHeight,k=u/l,ee=d.value/m.value;let M=1;ee>k?M=u*x/d.value:M=l*x/m.value;const te=Math.round(M*10)/10;r.value=Math.max(te,1),g.value||(c.value=r.value)},f=l=>{l.preventDefault(),l.wheelDelta>0?B():E()},E=(l=.1)=>{const u=c.value-l;c.value=Math.max(u,.1)},B=(l=.1)=>{const u=c.value+l;c.value=Math.min(u,2)},v=()=>{g.value=!g.value,c.value=g.value?1:r.value},C=l=>{A.value+=l},_=()=>{o.value=!0},N=()=>{o.value=!1,$()},V=()=>{N(),s("close")},$=()=>{r.value=1,c.value=1,A.value=0,m.value=0,d.value=0},I=l=>{l.stopPropagation()},F=()=>{o.value&&!g.value&&h()},z=l=>{l.key==="Escape"&&V()};return t.watch(o,l=>{l?(document.body.style.overflow="hidden",window.addEventListener("keydown",z),window.addEventListener("resize",F)):(document.body.style.overflow="",window.removeEventListener("keydown",z),window.removeEventListener("resize",F))},{immediate:!0}),a({show:_,hide:N}),(l,u)=>(t.openBlock(),t.createBlock(t.Transition,{name:"yu-img-viewer",appear:""},{default:t.withCtx(()=>[o.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"yu-img-viewer-wrapper",onClick:y,onWheel:f},[t.createElementVNode("img",{src:e.src,class:"img-show",onClick:I,onLoad:p,style:t.normalizeStyle(`max-width:${x*100}%;max-height:${x*100}%;transform: scale(${c.value}) rotate(${A.value}deg);transition: all 0.3s ease;`),alt:""},null,44,W),t.createElementVNode("div",{class:"yu-img-viewer",onClick:I},[t.createElementVNode("img",{onClick:u[0]||(u[0]=k=>E()),title:"缩小",class:"icon",alt:"",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAMAAABiM0N1AAAAmVBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////VHQRUAAAAMnRSTlMA9+7gJPncJwX06aV0ShHkmo4+GrFIRbdvU3tsamZhNDDPxbaflU7WvzIgHg2tgzmHWNLgL/wAAAJTSURBVFjD7Zdrd7IwDMfDTRAE8QJDuaiIt6nb8/T7f7gR2TkeWEtT5975e5mUP23StCm8eMHHzsOjMWRsaJRhZj+qctqNWYvx7hPU+b9hHA65oyazPzABxh7oBFfWoM9HsR04TmDHo7n+bdyeqTrTJjaaF7Xtkac18j5NJ7FuMpPZT9ds0kgtKTr/GPJm8r3mG0N2cp2P23RSEJJqJKUMR7kr6GHlElY3xfgMTOjFHKDSvjfvmK/xO0h4x2F63y7wMD4nkLLWMB9if8xqMkAooVwI3Yfbf0hssVpEdbfAhZk0IRMXVwicWO8TIDLB9AoiiBOaUYVmOKWp8B8ekMEMh1yPUXsiulCEJcANH24yUADPpzXHntf2uYrQvP4g4djD2j5SERrVH1Qc+7G2+ypCfv1BybFjSdsqQjZubkHsLq0jxWAdjNa+CQTZwZEtQ1enOwGnNlh/KTTsLi3+oTQgLc1QDragbMtH0n/k2CvlDSmo2uSREkn5x5F60XIvCvdJxwiE6gdbxb9lFY9acZYHTzr8oVC7jsS7xTGwsaNfkO4Fem5IllN0chyZiP3Yjg3XhCYCK3zjgJCzTm9rrFVvf83IjVYiaSGprd8GJISyZjTTGK1F3snbY6LSkskadoRyevl6I+XFbXvsfctcoyGTxhs5b++PGr951Pj3R41eAEwbpRRkLAZMgFXhklGJVgZOceDJaJUNDXGjVICcz9DtTOaYBXd3pBGVkFMalvg41selt4wvnZxYN/UF/Jq9JdniZBao5MKTlK7wDFYfSQAvXgB8AbQmiYamqSF8AAAAAElFTkSuQmCC"}),t.createElementVNode("img",{onClick:u[1]||(u[1]=k=>B()),title:"放大",class:"icon",alt:"",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAMAAABiM0N1AAAAilBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////2N2iNAAAALXRSTlMA+ODk70Uk9belj3QnBdxKRzHonfyYVDUfGhFv7LF8bGpmYT3PxK9O1r4NhhWkhma1AAACU0lEQVRYw+2X2ZqaQBCFD4swCAgD4oYr7mbq/V8vFoxfPkw3VE/Mnf9lqae71i7x5o2aaFdcbZ/It4/5NsIP+Rw61MIppjBnciAFl10MI84X0mCfIefrRA3uKhxEizheRINw5VLDagYhe4cYK0jRIg0sYpYJRJTjWmY4x1/Mh43UGgJ+EfPhQYn3QcxQqGNtoGVTX6pAD1u6k3XWyzQTeLfn+Iw8dOKNWOncmXfOl9Ob3pnDuev6WsDx+RR0j8X5gJYB3dmCkYRyAh2X+hwRXAV2rOtTdsyDCI+dq6DmUFeakCGnVxNBvtBcETnHGSi6ha+0154RKOw2ka3JcA6of0Cpwk53FOaUW0AZPp4/kAuB55Oq5nY8s0yEVkRUKuwFEYUmQqEmSFciSkyEEiI6Kuzc0pGJUMTFrYndrV0/9ES7nhY8AiQH29Tm+QIxF/D/FPL7XbPTZ9dcVWEbB1vTtsefpP+qsOfGBal5lUrTFuEFYaMaR69qWmTmY2QJFfmrBtteO2rtVDNqEygZvWj4ozJ9jkKoiW2zBzK7oeOFpB0E7OhO2X2OL1kiuMMPMbTMlvK1ZjxFB2cSL1plzwopXf0O6KHoW0a3FslW5EKyHjMhelgT46sXdp9IrpQsv/9CDJ6aLvj2KkhdYsre9D7u757CpPlTk4Qn92GsgL1PzAZ9TEakYZx/AbWSrA3i6kIK/Dx6+NkoVehnWmTUwrpuF38+Tq36ghUkfG7yo+3T2HWOwXpwe8pJozTBP3O2ekpczISVMrxCaUx0wiuYrssF3rwBfgPQ0YapPYGLOQAAAABJRU5ErkJggg=="}),g.value?(t.openBlock(),t.createElementBlock("img",{key:0,onClick:v,title:"适应窗口",class:"icon",alt:"",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABIBAMAAACnw650AAAALVBMVEUAAAD///////////////////////////////////////////////////////+hSKubAAAADnRSTlMA7+b59OdySknVttYPDGmoZHwAAACySURBVEjHYxgFQx5k2r0DgkcNEB6HHoj3eBqqGq53EKAA4TJBuQtQFOVBRQNQFT1DUTTvnaEgEDgVQLjsISCe8LvXKIrsHl/AdCev3WMU/ruH2Hwj925UETmKnmBT5IeqSO8plIFPtFQdykAXHQWjABU0aRAhqvcIysAQJZx8h0C+G6qK7B4fwFTDY/cYa2EPq1tUEIU9ZrWhgK/a4MJetyzAWpXB6pY4cFW2jWEUDHUAANSUoGLnF/1TAAAAAElFTkSuQmCC"})):(t.openBlock(),t.createElementBlock("img",{key:1,onClick:v,title:"实际尺寸",class:"icon",alt:"",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABIBAMAAACnw650AAAAJ1BMVEUAAAD///////////////////////////////////////////////+uPUo5AAAADHRSTlMA7vD5hXLVtg3W1HNKpeIJAAAAkUlEQVRIx2MYBaMABqJszmABh1OR1bCfwQEKkBTF4FJ0FElRzhlDQSxA+MxJJEU2hxuwuZTD5jAS78wh7P7ROTOqCIsiZxMgAWXhVAQOYCgLp6IzIDEoC78iZxNCimA2EVZEHetAYPApGorhhJZUCCe6wZIRhp4iAsUh4YKVcBF9mtTCniEMe7UxlWEUjAIoAACLZA9Ayw+XDwAAAABJRU5ErkJggg=="})),t.createElementVNode("img",{onClick:u[2]||(u[2]=k=>C(-90)),title:"向左旋转90°",class:"icon",alt:"",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAMAAABiM0N1AAAAn1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8Kd3m4AAAANHRSTlMA+u1wMJv0EAzjysVFGwb81aJVCdu4aFrSzqiNijsV96+fkWFALSgj59dNNRizfFFJhe++/7y+OwAAAjhJREFUWMPt19dy4jAUBuBfLjHggsEB06vpJeyu3v/Z1kdyJmSwZMFwkZnwXWUic+RzJKvg5eU3mrRHndhifFr3XdvBgzzbb/JrljvG/TbulN+K03vfZsh4uTjDHfZ1LjQbo7YzieBtAntmcalVg6khF97tENcuAyb/ry97rfb5R4eTXbukcHNR/rdAl82ULWV5GvTs9ByhzKFPrawNpXfOt8glDf3bRwsRaQ+Vv3kz/XpGz/3zoNZtUnYrKJzyVhs4U5xOAp02Rdqpxs6mAHBoXBoJ9LrUm6todOh9RYG2R7P5ofpeaL4N6IEAlSLqsK9opCCkBQMOlelDnTilF1KPwXCmfzGXaolSaxlogXA5e6OpEkIjZGK6lKrLzPq8MIbOXHRaqsW/8aGV5Y/UUWrJv/SG+hIVCazL0+bStpVWzySZQBelZvmYdewVzCzVszv6yCIYO+jraK5Gqw2egeWVwDPQx/msQOxZqVk/qtiPD79+Qj5urv5EkPYGHgzJj1a9WI1gaCyWEfUaaSUw46oWNtITaRs50jHsoNv46onxyacBlWSbN59hYMWK7UizbzMH1XzNBkkiqlJcPQX+VO4yY9pBT6iQUhzXoK8BtC5MHmv0xAHypHsqZfKgVcHrUaT+BiojamcZKk1icZawFePuF4dRA54vN9s9boQLJnq5wEgy50JsT3AtaCkO7GqpdXuFGCiuEHoTl/FyuwD3Wc+Z/pplLrT736NYboYHHYurqCWvoi8vv85/WZV1EethCRYAAAAASUVORK5CYII="}),t.createElementVNode("img",{onClick:u[3]||(u[3]=k=>C(90)),title:"向右旋转90°",class:"icon",alt:"",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAMAAABiM0N1AAAAn1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8Kd3m4AAAANHRSTlMA+uLt1gYw/JxwDvbzysWhR7ORi2hVCtHPuamGWk9ANSIRCGFCLSgdGBXo2jquo5l1Gn1bVjAitwAAAkhJREFUWMPtl9ly6jAMhu1sZCMrgRASlrCGFgqt3//ZTmUfhsMc23HaXHSmfDeZiTW/LVmWZfTkye/DcuxA84iv5XGaNV9VeX3Tyb8MAmeFulMa5H88e9lRZmMQPjh1kTpuSBj6yYmWK+QuF1k6HBCKNlcP8QubvIgefu/fNRarmammE/nUPOSEI2MeT2/ujccSnQyDbb7gDpoXD0aHbPvW2KuEOhXVSUy530O6lCMhLyK7rQdujZCY1RSUYtCE7RBYjQ3QyZCMmiq9I3ShgnxssBkhOeMh7KmF4s+PwzeZ0/igNg5HCFMNu2vxLXIwMBUyBCYsxCGqIEAWUuCW+gV/GHx/ky/llG5gxVfYXGE4FxDDvTQ4kGT+ab1HCRPacc1gMJSXKPKX/MwOMN8MzqT8aJsBeeDMtdqxKeRE6YTcWXNtRtSzdg4f4ZEw+AG16RRqbJ2pJzwf4P8CKWPOK1Mcaxf1gE8IRn0AR+dnCfXgWs/BZtvfAywhewCOiN2HEDu0qrjFpJRF+1VVKCUEXwVjSQffap3VR2Gp9Q7qAZ0gQFT8E7UFadKLtILqv1URmn1aHmvxOJTRQKUV8+63tfjKnrVvPbQahtmW3eSjrTbGcCNLE4W1NTiSCxUq6976oFTK5oppG9neYWM6nzAAyxzGJwr1hjWjgSALHB9GjUa9PcbJnpNo7JoNVt0a9vPm4XfjGIQS1t2fEAV9QpiNlc1uTwi97OVRM7CbPp5ZONyh7szZw+9Ofrl+6ymqE6wb07Q8oCdPfiF/ANQydloYw+eCAAAAAElFTkSuQmCC"}),t.createElementVNode("img",{onClick:V,title:"关闭",class:"icon",alt:"",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAMAAABiM0N1AAAAbFBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8+T+BWAAAAI3RSTlMAsoyKtI+5mK+spJ/RvKecjnMGyb+pkw3AtoN6V0cb6js4LTOnxLwAAAFGSURBVFjD7dbLbsIwEIXhScCEBsilBcq1t3n/d6zTNjpIjjzOzKqS/w0L0KfRAQSUy+VyQ2vmmhK6MG9fI8/f2VfITsm+PvKCD06SHEsQNTy0TriHt88UaylLC2bGRIL0JN3jHakiLjk4adKBJut46AX7yFIzuU+6g50ao4Ob6mBnOGoJO5/SFUib8J79HAU7tQ/74B6NVKnvQcUoYZ8dkV464nO40iiQnN/H4mCnvodjuGnsTMgiLclYxXjzTF1/oavV6fiv0uYcMbazO23789DpDHwvivHztLDd4x2jVMEhOusXr/BTiZuc1cFNagetNDu1oxNK5VwHP9uQ5u60gTMldVYHO6kdtEuX6tAJpTLVORASFpcd9U3Yp6Foe3mnG+6JdeKhe+wPPe4RbhJOent/+Csj7fRFMam/UVKX+pNyudx/7hvtEkCDo9yvRAAAAABJRU5ErkJggg=="})])],32)):t.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-fd184b03"]]),U=b({__name:"index",props:t.mergeModels({color:{type:String,default:function(){return"rgba(0, 0, 0, 0.5)"}},zIndex:{type:Number,default:function(){return 999}},closable:{type:Boolean,default:function(){return!0}},lockScroll:{type:Boolean,default(){return!1}}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:t.mergeModels(["close"],["update:modelValue"]),setup(e,{expose:a,emit:n}){const o=t.useModel(e,"modelValue"),i=e,s=n,r=t.computed(()=>({backgroundColor:i.color,zIndex:i.zIndex}));t.watch(o,d=>{i.lockScroll&&(document.body.style.overflow=d?"hidden":"")});const c=()=>{o.value=!0},A=()=>{o.value=!1},m=()=>{i.closable&&(A(),s("close"))};return a({show:c,hide:A}),(d,g)=>(t.openBlock(),t.createBlock(t.Transition,{name:"yu-mask-fade",appear:""},{default:t.withCtx(()=>[o.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"yu-page-mask",style:t.normalizeStyle(r.value),onClick:m},null,4)):t.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-2eb2644e"]]),K={Watermark:j,ImgViewer:S,Mask:U},D={beforeMount(e,a){e.clickOutsideEvent=n=>{e===n.target||e.contains(n.target)||a.value(n)},document.addEventListener("click",e.clickOutsideEvent)},unmounted(e){document.removeEventListener("click",e.clickOutsideEvent)}},{createWatermark:H}=R(),J={mounted(e,a){const{width:n=240,height:o=240,opacity:i=.2,content:s="",angle:r=30,fontSize:c=20,fontColor:A="#999",img:m="",imgWidth:d=50}=a.value;H(n,o,i,s,c,A,r,m,d).then(g=>{e.style.backgroundImage=`url(${g})`,e.style.backgroundPosition="center top",e.style.backgroundRepeat="repeat"}).catch(g=>{console.error(g)})}},G={mounted(e){e.clickShowImage=a=>{try{if(a.target.tagName!=="IMG"||!a.target.src)return;if(e.instance){e.instance.show();return}const n=t.createApp(S,{src:a.target.src}),o=document.createElement("div"),i=n.mount(o);e.instance=i,e.app=n,document.body.appendChild(i.$el),i.show()}catch(n){console.error("Image viewer error:",n)}},e.addEventListener("click",e.clickShowImage,{passive:!0})},beforeUnmount(e){try{if(e.removeEventListener("click",e.clickShowImage,{passive:!0}),!e.instance)return;e.instance.hide(),setTimeout(()=>{e.app.unmount(),e.instance.$el.remove(),e.instance=null},200)}catch(a){console.log("Image viewer error:",a)}}},Y={class:"yu-loading"},Q=["textContent"],P=b({__name:"index",props:{text:{type:String,default(){return""}},bgColor:{type:String,default(){return""}},color:{type:String,default(){return""}},fullscreen:{type:Boolean,default(){return!1}},zIndex:{type:Number,default(){return 998}}},setup(e,{expose:a}){const n=t.ref(!1);return a({show:()=>{n.value=!0},hide:()=>{n.value=!1}}),(s,r)=>(t.openBlock(),t.createBlock(t.Transition,{name:"yu-loading",appear:""},{default:t.withCtx(()=>[n.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["yu-loading-wrapper",{"yu-loading-fullscreen":e.fullscreen}]),style:t.normalizeStyle({"--yu-loading-color":e.color||"var(--qui-color-primary, #3565ee)",background:e.bgColor,zIndex:e.zIndex})},[t.createElementVNode("div",Y,[r[0]||(r[0]=t.createElementVNode("div",{class:"loading-icon"},null,-1)),t.withDirectives(t.createElementVNode("div",{class:"loading-text",textContent:t.toDisplayString(e.text)},null,8,Q),[[t.vShow,e.text]])])],6)):t.createCommentVNode("",!0)]),_:1}))}},[["__scopeId","data-v-1a0ab7d2"]]),L={mounted(e,a){e.style.position="relative";const n=parseInt(e.getAttribute("loading-z-index")),o={text:e.getAttribute("loading-text")||"",color:e.getAttribute("loading-color")||"",zIndex:n||998},i=t.createApp(P,o),s=document.createElement("div"),r=i.mount(s);e.instance=r,e.appendChild(r.$el),a.value?r.show():r.hide()},updated(e,a){console.log("updated"),a.value!==a.oldValue&&(a.value?e.instance.show():e.instance.hide())},beforeUnmount(e){console.log("beforeUnmount"),e.instance.hide(),setTimeout(()=>{e.instance.$el.remove(),e.instance=null},200)}},X=(e,a)=>{const{visible:n=!1,color:o="rgba(0,0,0,0.5)",zIndex:i=999,closable:s=!0,lockScroll:r=!1,onClose:c=null}=a.value,A=document.createElement("div"),d=t.createApp(U,{modelValue:n,closable:s,color:o,zIndex:i,lockScroll:r,onClose:()=>{c&&typeof c=="function"&&c()}}).mount(A);document.body.appendChild(d.$el),e.cleanup=()=>{document.body.removeChild(d.$el)}},Z={vOutside:D,vWatermark:J,vViewer:G,vLoading:L,vMask:{updated(e,a){const{value:n}=a;n.visible?X(e,a):e.cleanup()},beforeUnmount(e){e.cleanup&&e.cleanup()}}},q={install:e=>{Object.entries(Z).forEach(([a,n])=>{const o=a.replace(/^v/,"").replace(/([A-Z])/g,"-$1").toLowerCase();e.directive(o,n)}),Object.entries(K).forEach(([a,n])=>{e.component(a,n)}),e.prototype.$toast=Toast,e.prototype.$loading=Loading,e.prototype.$message=Message}};w.default=q,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
@@ -0,0 +1,6 @@
1
+ declare function _default(source: any, paths: Array<string> | string, options?: {
2
+ deep?: boolean;
3
+ ignoreCase?: boolean;
4
+ }): any;
5
+ export default _default;
6
+ //# sourceMappingURL=pick.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pick.d.ts","sourceRoot":"","sources":["../../src/utils/pick.js"],"names":[],"mappings":"AAgBe,8CANJ,KAAK,CAAC,MAAM,CAAC,GAAC,MAAM,YAE5B;IAA0B,IAAI,GAAtB,OAAO;IACW,UAAU,GAA5B,OAAO;CACf,OAiCF"}
@@ -0,0 +1,12 @@
1
+ export function isNil(value: any): boolean;
2
+ export function isNull(value: any): boolean;
3
+ export function isUndefined(value: any): boolean;
4
+ export function isBoolean(value: any): value is boolean;
5
+ export function isNumber(value: any): value is number;
6
+ export function isString(value: any): value is string;
7
+ export function isStringNumber(value: any): boolean;
8
+ export function isObject(value: any): boolean;
9
+ export function isArray(value: any): value is any[];
10
+ export function isEmpty(value: any): boolean;
11
+ export function isElement(e: any): boolean;
12
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.js"],"names":[],"mappings":"AAAO,2CAA8D;AAE9D,4CAAwC;AAExC,iDAAkD;AAElD,wDAAuD;AAEvD,sDAAqD;AAErD,sDAAqD;AAErD,oDAKN;AAEM,8CAEN;AAEM,oDAEN;AAEM,6CAA+I;AAE/I,2CAGN"}
package/package.json CHANGED
@@ -1,38 +1,40 @@
1
- {
2
- "name": "vue-next-yui",
3
- "version": "1.0.4",
4
- "description": "vue-next-yui",
5
- "type": "module",
6
- "scripts": {
7
- "dev": "vite",
8
- "build": "vite build",
9
- "preview": "vite preview"
10
- },
11
- "main": "vue-next-yui.umd.js",
12
- "module": "vue-next-yui.es.js",
13
- "exports": {
14
- ".": {
15
- "import": "vue-next-yui.es.js",
16
- "require": "vue-next-yui.umd.js"
17
- },
18
- "./style.css": "style.css"
19
- },
20
- "dependencies": {
21
- "vue": "^3.4.29",
22
- "vue-router": "^4.3.3"
23
- },
24
- "devDependencies": {
25
- "@vitejs/plugin-vue": "^5.0.5",
26
- "sass": "^1.77.8",
27
- "vite": "^5.3.1"
28
- },
29
- "keywords": [
30
- "vue-next-yui",
31
- "npm",
32
- "package",
33
- "vue",
34
- "vue3"
35
- ],
36
- "author": "shawyu",
37
- "license": "MIT"
1
+ {
2
+ "name": "vue-next-yui",
3
+ "private": false,
4
+ "version": "1.0.6",
5
+ "type": "module",
6
+ "files": [
7
+ "dist/"
8
+ ],
9
+ "main": "./dist/index.umd.cjs",
10
+ "module": "./dist/index.js",
11
+ "types": "./dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "require": "./dist/index.umd.cjs",
16
+ "import": "./dist/index.js"
17
+ },
18
+ "./directives": {
19
+ "types": "./dist/directives/index.d.ts",
20
+ "require": "./dist/directives/index.umd.cjs",
21
+ "import": "./dist/directives/index.js"
22
+ }
23
+ },
24
+ "scripts": {
25
+ "dev": "vite",
26
+ "build": "node scripts/index.js",
27
+ "preview": "vite preview",
28
+ "publish": "call ./scripts/publish.cmd"
29
+ },
30
+ "dependencies": {
31
+ "vue": "^3.5.13",
32
+ "vue-next-yui": "^1.0.5"
33
+ },
34
+ "devDependencies": {
35
+ "@vitejs/plugin-vue": "^6.0.3",
36
+ "sass": "^1.97.0",
37
+ "vite": "7.3.0",
38
+ "vite-plugin-dts": "^4.5.4"
39
+ }
38
40
  }
package/favicon.ico DELETED
Binary file
package/style.css DELETED
@@ -1 +0,0 @@
1
- .yu-slide-wrapper[data-v-3bff58af]{position:relative;overflow:hidden}.yu-slide-wrapper .yu-slide-container[data-v-3bff58af]{width:100%;height:100%;font-size:0;line-height:0;white-space:nowrap}.yu-slide-wrapper .yu-slide-arrow .prev[data-v-3bff58af]{position:absolute;left:30px;top:50%;transform:translateY(-50%);z-index:1;font-size:0;line-height:0;padding:10px;border-radius:50px;background-color:#fff0;cursor:pointer;transition:all .3s}.yu-slide-wrapper .yu-slide-arrow .prev .icon[data-v-3bff58af]{transition:all .3s;opacity:0}.yu-slide-wrapper .yu-slide-arrow .next[data-v-3bff58af]{position:absolute;right:30px;top:50%;transform:translateY(-50%);z-index:1;font-size:0;line-height:0;padding:10px;border-radius:50px;background-color:#fff0;cursor:pointer;transition:all .3s}.yu-slide-wrapper .yu-slide-arrow .next .icon[data-v-3bff58af]{transition:all .3s;opacity:0}.yu-slide-wrapper .yu-slide-indicator[data-v-3bff58af]{position:absolute;left:50%;bottom:10px;z-index:1;transform:translate(-50%);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;align-items:center;gap:6px}.yu-slide-wrapper .yu-slide-indicator span[data-v-3bff58af]{display:block;width:12px;height:5px;border-radius:5px;background-color:#00000026;cursor:pointer}.yu-slide-wrapper .yu-slide-indicator span.active[data-v-3bff58af]{background-color:#0006}.yu-slide-wrapper .yu-slide-indicator span.white[data-v-3bff58af]{background-color:#ffffff4d}.yu-slide-wrapper .yu-slide-indicator span.white.active[data-v-3bff58af]{background-color:#ffffffe6}.yu-slide-wrapper .yu-slide-indicator span.black[data-v-3bff58af]{background-color:#00000026}.yu-slide-wrapper .yu-slide-indicator span.black.active[data-v-3bff58af]{background-color:#0006}@media screen and (min-width: 768px){.yu-slide-wrapper:hover .yu-slide-arrow .prev.white[data-v-3bff58af]{background-color:#00000026}.yu-slide-wrapper:hover .yu-slide-arrow .prev.white .icon[data-v-3bff58af]{opacity:.9}.yu-slide-wrapper:hover .yu-slide-arrow .prev.black[data-v-3bff58af]{background-color:#fff3}.yu-slide-wrapper:hover .yu-slide-arrow .prev.black .icon[data-v-3bff58af]{opacity:.6}.yu-slide-wrapper:hover .yu-slide-arrow .next.white[data-v-3bff58af]{background-color:#00000026}.yu-slide-wrapper:hover .yu-slide-arrow .next.white .icon[data-v-3bff58af]{opacity:.9}.yu-slide-wrapper:hover .yu-slide-arrow .next.black[data-v-3bff58af]{background-color:#fff3}.yu-slide-wrapper:hover .yu-slide-arrow .next.black .icon[data-v-3bff58af]{opacity:.6}}@media screen and (max-width: 768px){.yu-slide-wrapper .yu-slide-arrow[data-v-3bff58af]{display:none;opacity:0;visibility:hidden}.yu-slide-wrapper .yu-slide-indicator[data-v-3bff58af]{gap:5px}.yu-slide-wrapper .yu-slide-indicator span[data-v-3bff58af]{width:10px;height:4px;border-radius:5px;cursor:auto}}.yu-slide-item-wrapper[data-v-69b2940a]{display:inline-block;width:100%;height:100%}.yu-slide-item-wrapper .yu-slide-item[data-v-69b2940a]{position:relative;width:100%;height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;align-items:center;justify-content:center;background-color:#ccc;font-size:16px;line-height:2}
@@ -1,248 +0,0 @@
1
- import { ref as r, reactive as ee, onMounted as te, onBeforeUnmount as le, watch as V, openBlock as m, createElementBlock as y, createElementVNode as M, renderSlot as j, normalizeClass as N, withModifiers as O, unref as $, createCommentVNode as z, Fragment as ae, renderList as oe, pushScopeId as ne, popScopeId as ue } from "vue";
2
- const U = (n, h) => {
3
- const u = n.__vccOpts || n;
4
- for (const [v, x] of h)
5
- u[v] = x;
6
- return u;
7
- }, R = (n) => (ne("data-v-3bff58af"), n = n(), ue(), n), se = {
8
- key: 0,
9
- class: "yu-slide-arrow"
10
- }, ie = ["fill"], re = /* @__PURE__ */ R(() => /* @__PURE__ */ M("path", { d: "M703.967748 885.366929c-8.532661 0-14.932661-2.134677-21.332661-8.532661l-384-341.332662c-6.4-6.4-10.667339-14.932661-10.667339-23.467338s4.267339-17.067339 10.667339-23.467339l384-341.334677c12.8-12.8 34.134677-10.665323 44.8 2.134677 12.802016 12.8 10.667339 34.134677-2.132662 44.8L369.033071 512.034268l356.267338 317.865323c12.8 10.667339 14.932661 32 2.132662 44.8-6.4 6.4-14.932661 10.667339-23.465323 10.667338z" }, null, -1)), ve = [
11
- re
12
- ], ce = ["fill"], de = /* @__PURE__ */ R(() => /* @__PURE__ */ M("path", { d: "M320 885.333333c-8.533333 0-17.066667-4.266667-23.466667-10.666666-12.8-12.8-10.666667-34.133333 2.133334-44.8L654.933333 512 298.666667 194.133333c-12.8-10.666667-14.933333-32-2.133334-44.8 10.666667-12.8 32-14.933333 44.8-2.133333l384 341.333333c6.4 6.4 10.666667 14.933333 10.666667 23.466667 0 8.533333-4.266667 17.066667-10.666667 23.466667l-384 341.333333c-6.4 6.4-12.8 8.533333-21.333333 8.533333z" }, null, -1)), fe = [
13
- de
14
- ], he = {
15
- key: 1,
16
- class: "yu-slide-indicator"
17
- }, pe = ["onClick"], me = {
18
- name: "Slide"
19
- }, ye = /* @__PURE__ */ Object.assign(me, {
20
- props: {
21
- option: {
22
- type: Object,
23
- default() {
24
- return {};
25
- }
26
- },
27
- value: {
28
- type: Number,
29
- default() {
30
- return 0;
31
- }
32
- },
33
- themeStyle: {
34
- //white,black
35
- type: String,
36
- default() {
37
- return "white";
38
- }
39
- },
40
- gap: {
41
- type: [Number, String],
42
- default() {
43
- return 0;
44
- }
45
- }
46
- },
47
- emits: ["slide"],
48
- setup(n, { emit: h }) {
49
- const u = n, v = r(""), x = h, p = "all 0.45s", t = r(null), l = r(0), d = r(0), f = r(null), c = r(!1), w = r(!1), S = r(!1), i = r(0);
50
- r(0);
51
- const g = r("white"), a = ee({
52
- width: u.option.width || document.body.clientWidth,
53
- height: u.option.height || "auto",
54
- duration: u.option.duration || 3e3,
55
- showArrow: !!u.option.showArrow || !1,
56
- showIndicator: !!u.option.showIndicator || !1,
57
- autoPlay: !!u.option.autoPlay || !1,
58
- loop: !!u.option.loop || !1
59
- });
60
- te(() => {
61
- g.value = ["black", "white"].includes(u.themeStyle) ? u.themeStyle : "white", q();
62
- }), le(() => {
63
- clearTimeout(f.value);
64
- }), V(() => u.option, (e, o) => {
65
- console.log("option的name变化了", e, o);
66
- }), V(l, (e, o) => {
67
- });
68
- const q = () => {
69
- if (!t.value) return;
70
- let e = t.value.children;
71
- d.value = e.length;
72
- for (let o = 0, s = e.length; o < s; o++)
73
- e[o].setAttribute("index", o);
74
- t.value.style.transition = p, a.loop ? (t.value.style.transform = `translateX(${-(l.value + 1) * a.width}px)`, t.value.insertBefore(e[e.length - 1].cloneNode(!0), e[0]), t.value.appendChild(e[1].cloneNode(!0))) : t.value.style.transform = `translateX(${-l.value * a.width}px)`, a.autoPlay && _();
75
- }, D = (e, o = 300) => {
76
- const s = r(!0);
77
- return (...T) => {
78
- s.value && (s.value = !1, e(...T), setTimeout(() => {
79
- s.value = !0;
80
- }, o));
81
- };
82
- }, _ = () => {
83
- clearTimeout(f.value), f.value = setTimeout(() => {
84
- a.loop ? P() : (console.log("a", l.value, d.value - 1), l.value >= d.value - 1 ? B(0) : (console.log("c"), P()));
85
- }, a.duration);
86
- }, C = (e) => {
87
- let s = (a.loop ? l.value + 1 : l.value) * a.width + i.value - e;
88
- t.value.style.transition = "none", t.value.style.transform = `translateX(${-s}px)`;
89
- }, L = (e) => {
90
- i.value && (a.loop ? e >= i.value && e - i.value > 80 ? k() : e < i.value && i.value - e > 80 ? P() : (t.value.style.transition = p, t.value.style.transform = `translateX(${-(l.value + 1) * a.width}px)`, a.autoPlay && _()) : e >= i.value && e - i.value > 80 && l.value > 0 ? k() : e < i.value && i.value - e > 80 && l.value < d.value - 1 ? P() : (t.value.style.transition = p, t.value.style.transform = `translateX(${-l.value * a.width}px)`, a.autoPlay && _()), i.value = 0, setTimeout(() => {
91
- w.value = !1;
92
- }, 300));
93
- }, k = () => {
94
- if (!(t.value && t.value.children)) return;
95
- let e = t.value.children;
96
- a.loop ? (l.value--, t.value.style.transition = p, t.value.style.transform = `translateX(${-(l.value + 1) * e[0].offsetWidth}px)`, l.value < 0 && (l.value = d.value - 1, setTimeout(() => {
97
- t.value.style.transition = "none", t.value.style.transform = `translateX(${-d.value * e[0].offsetWidth}px)`;
98
- }, 300))) : l.value > 0 && (l.value--, t.value.style.transition = p, t.value.style.transform = `translateX(${-l.value * e[0].offsetWidth}px)`), a.autoPlay && _(), x("slide", l.value);
99
- }, P = () => {
100
- if (!(t.value && t.value.children)) return;
101
- let e = t.value.children;
102
- a.loop ? (l.value++, t.value.style.transition = p, t.value.style.transform = `translateX(${-(l.value + 1) * e[0].offsetWidth}px)`, l.value > d.value - 1 && (l.value = 0, setTimeout(() => {
103
- t.value.style.transition = "none", t.value.style.transform = `translateX(${-e[0].offsetWidth}px)`;
104
- }, 300))) : l.value < d.value - 1 && (l.value++, t.value.style.transition = p, t.value.style.transform = `translateX(${-l.value * e[0].offsetWidth}px)`), a.autoPlay && _(), x("slide", l.value);
105
- }, B = (e) => {
106
- let o = t.value.children;
107
- a.autoPlay && clearTimeout(f.value), l.value = e;
108
- let s = a.loop ? l.value + 1 : l.value;
109
- t.value.style.transition = p, t.value.style.transform = `translateX(${-s * o[0].offsetWidth}px)`, a.autoPlay && _(), x("slide", e);
110
- }, G = (e) => {
111
- v.value += "MouseEnter_", e.preventDefault(), S.value = !0, a.autoPlay && clearTimeout(f.value);
112
- }, H = (e) => {
113
- v.value += "MouseLeave_", e.preventDefault(), S.value && (S.value = !1, a.autoPlay && _());
114
- }, J = (e) => {
115
- v.value += "MouseDown_", e.preventDefault(), S.value = !1, !(c.value || w.value) && (a.autoPlay && clearTimeout(f.value), c.value = !0, i.value = e.clientX);
116
- }, K = (e) => {
117
- v.value += "MouseMove_", e.preventDefault(), c.value && (!w.value && (w.value = !0), C(e.clientX));
118
- }, Q = (e) => {
119
- v.value += "MouseUp_", e.preventDefault(), c.value && (c.value = !1, L(e.clientX));
120
- }, Y = (e) => {
121
- if (v.value += "TouchStart_", e.preventDefault(), c.value || w.value) return;
122
- a.autoPlay && clearTimeout(f.value), c.value = !0;
123
- let o = e.changedTouches[0];
124
- i.value = o.clientX;
125
- }, Z = (e) => {
126
- v.value += "TouchMove_", e.preventDefault(), c.value && (!w.value && (w.value = !0), C(e.changedTouches[0].clientX));
127
- }, W = (e) => {
128
- v.value += "TouchLeave_", e.preventDefault(), c.value && (c.value = !1, L(e.changedTouches[0].clientX));
129
- }, A = D(() => {
130
- a.autoPlay && clearTimeout(f.value), k();
131
- }, 300), E = D(() => {
132
- a.autoPlay && clearTimeout(f.value), P();
133
- }, 300);
134
- return (e, o) => (m(), y("div", {
135
- class: "yu-slide-wrapper",
136
- onMousedown: J,
137
- onMousemove: K,
138
- onMouseup: Q,
139
- onMouseenter: G,
140
- onMouseleave: H,
141
- onTouchstart: Y,
142
- onTouchmove: Z,
143
- onTouchend: W,
144
- onTouchcancel: W
145
- }, [
146
- M("div", {
147
- class: "yu-slide-container",
148
- ref_key: "slideItemContainer",
149
- ref: t
150
- }, [
151
- j(e.$slots, "default", {}, void 0, !0)
152
- ], 512),
153
- a.showArrow ? (m(), y("div", se, [
154
- M("div", {
155
- class: N(["prev", g.value]),
156
- onClick: o[0] || (o[0] = O((...s) => $(A) && $(A)(...s), ["stop"]))
157
- }, [
158
- (m(), y("svg", {
159
- class: "icon",
160
- fill: g.value,
161
- viewBox: "0 0 1024 1024",
162
- xmlns: "http://www.w3.org/2000/svg",
163
- width: "18",
164
- height: "18"
165
- }, ve, 8, ie))
166
- ], 2),
167
- M("div", {
168
- class: N(["next", g.value]),
169
- onClick: o[1] || (o[1] = O((...s) => $(E) && $(E)(...s), ["stop"]))
170
- }, [
171
- (m(), y("svg", {
172
- class: "icon",
173
- fill: g.value,
174
- viewBox: "0 0 1024 1024",
175
- xmlns: "http://www.w3.org/2000/svg",
176
- width: "18",
177
- height: "18"
178
- }, fe, 8, ce))
179
- ], 2)
180
- ])) : z("", !0),
181
- a.showIndicator ? (m(), y("div", he, [
182
- (m(!0), y(ae, null, oe(d.value, (s, T) => (m(), y("span", {
183
- class: N([g.value, { active: l.value === T }]),
184
- key: T,
185
- onClick: O((Me) => B(T), ["stop"])
186
- }, null, 10, pe))), 128))
187
- ])) : z("", !0)
188
- ], 32));
189
- }
190
- }), I = /* @__PURE__ */ U(ye, [["__scopeId", "data-v-3bff58af"]]);
191
- I.install = function(n) {
192
- n.component(I.name, I);
193
- };
194
- const we = { class: "yu-slide-item-wrapper" }, _e = { class: "yu-slide-item" }, ge = {
195
- name: "SlideItem"
196
- }, Te = /* @__PURE__ */ Object.assign(ge, {
197
- props: {
198
- name: {
199
- type: String,
200
- default() {
201
- return "";
202
- }
203
- },
204
- size: {
205
- type: [Number, String],
206
- default() {
207
- return "16px";
208
- }
209
- },
210
- showArrow: {
211
- type: Boolean,
212
- default() {
213
- return !1;
214
- }
215
- },
216
- showPagination: {
217
- type: Boolean,
218
- default() {
219
- return !1;
220
- }
221
- }
222
- },
223
- setup(n) {
224
- return (h, u) => (m(), y("div", we, [
225
- M("div", _e, [
226
- j(h.$slots, "default", {}, void 0, !0)
227
- ])
228
- ]));
229
- }
230
- }), b = /* @__PURE__ */ U(Te, [["__scopeId", "data-v-69b2940a"]]);
231
- b.install = function(n) {
232
- n.component(b.name, b);
233
- };
234
- const F = [I, b], X = function(n) {
235
- X.installed || (X.installed = !0, F.map((h) => {
236
- n.component(h.name, h);
237
- }));
238
- };
239
- typeof window < "u" && window.Vue && X(window.Vue);
240
- const Pe = {
241
- // 导出的对象必须具备一个 install 方法
242
- install: X,
243
- // 组件列表
244
- ...F
245
- };
246
- export {
247
- Pe as default
248
- };
@@ -1 +0,0 @@
1
- (function(e,y){typeof exports=="object"&&typeof module<"u"?module.exports=y(require("vue")):typeof define=="function"&&define.amd?define(["vue"],y):(e=typeof globalThis<"u"?globalThis:e||self,e["vue-next-yui"]=y(e.Vue))})(this,function(e){"use strict";const y=(s,h)=>{const u=s.__vccOpts||s;for(const[c,g]of h)u[c]=g;return u},P=s=>(e.pushScopeId("data-v-3bff58af"),s=s(),e.popScopeId(),s),D={key:0,class:"yu-slide-arrow"},L=["fill"],W=[P(()=>e.createElementVNode("path",{d:"M703.967748 885.366929c-8.532661 0-14.932661-2.134677-21.332661-8.532661l-384-341.332662c-6.4-6.4-10.667339-14.932661-10.667339-23.467338s4.267339-17.067339 10.667339-23.467339l384-341.334677c12.8-12.8 34.134677-10.665323 44.8 2.134677 12.802016 12.8 10.667339 34.134677-2.132662 44.8L369.033071 512.034268l356.267338 317.865323c12.8 10.667339 14.932661 32 2.132662 44.8-6.4 6.4-14.932661 10.667339-23.465323 10.667338z"},null,-1))],A=["fill"],z=[P(()=>e.createElementVNode("path",{d:"M320 885.333333c-8.533333 0-17.066667-4.266667-23.466667-10.666666-12.8-12.8-10.666667-34.133333 2.133334-44.8L654.933333 512 298.666667 194.133333c-12.8-10.666667-14.933333-32-2.133334-44.8 10.666667-12.8 32-14.933333 44.8-2.133333l384 341.333333c6.4 6.4 10.666667 14.933333 10.666667 23.466667 0 8.533333-4.266667 17.066667-10.666667 23.466667l-384 341.333333c-6.4 6.4-12.8 8.533333-21.333333 8.533333z"},null,-1))],j={key:1,class:"yu-slide-indicator"},U=["onClick"],k=y(Object.assign({name:"Slide"},{props:{option:{type:Object,default(){return{}}},value:{type:Number,default(){return 0}},themeStyle:{type:String,default(){return"white"}},gap:{type:[Number,String],default(){return 0}}},emits:["slide"],setup(s,{emit:h}){const u=s,c=e.ref(""),g=h,p="all 0.45s",l=e.ref(null),a=e.ref(0),f=e.ref(0),v=e.ref(null),d=e.ref(!1),m=e.ref(!1),$=e.ref(!1),r=e.ref(0);e.ref(0);const w=e.ref("white"),o=e.reactive({width:u.option.width||document.body.clientWidth,height:u.option.height||"auto",duration:u.option.duration||3e3,showArrow:!!u.option.showArrow||!1,showIndicator:!!u.option.showIndicator||!1,autoPlay:!!u.option.autoPlay||!1,loop:!!u.option.loop||!1});e.onMounted(()=>{w.value=["black","white"].includes(u.themeStyle)?u.themeStyle:"white",F()}),e.onBeforeUnmount(()=>{clearTimeout(v.value)}),e.watch(()=>u.option,(t,n)=>{console.log("option的name变化了",t,n)}),e.watch(a,(t,n)=>{});const F=()=>{if(!l.value)return;let t=l.value.children;f.value=t.length;for(let n=0,i=t.length;n<i;n++)t[n].setAttribute("index",n);l.value.style.transition=p,o.loop?(l.value.style.transform=`translateX(${-(a.value+1)*o.width}px)`,l.value.insertBefore(t[t.length-1].cloneNode(!0),t[0]),l.value.appendChild(t[1].cloneNode(!0))):l.value.style.transform=`translateX(${-a.value*o.width}px)`,o.autoPlay&&_()},N=(t,n=300)=>{const i=e.ref(!0);return(...T)=>{i.value&&(i.value=!1,t(...T),setTimeout(()=>{i.value=!0},n))}},_=()=>{clearTimeout(v.value),v.value=setTimeout(()=>{o.loop?M():(console.log("a",a.value,f.value-1),a.value>=f.value-1?V(0):(console.log("c"),M()))},o.duration)},I=t=>{let i=(o.loop?a.value+1:a.value)*o.width+r.value-t;l.value.style.transition="none",l.value.style.transform=`translateX(${-i}px)`},b=t=>{r.value&&(o.loop?t>=r.value&&t-r.value>80?S():t<r.value&&r.value-t>80?M():(l.value.style.transition=p,l.value.style.transform=`translateX(${-(a.value+1)*o.width}px)`,o.autoPlay&&_()):t>=r.value&&t-r.value>80&&a.value>0?S():t<r.value&&r.value-t>80&&a.value<f.value-1?M():(l.value.style.transition=p,l.value.style.transform=`translateX(${-a.value*o.width}px)`,o.autoPlay&&_()),r.value=0,setTimeout(()=>{m.value=!1},300))},S=()=>{if(!(l.value&&l.value.children))return;let t=l.value.children;o.loop?(a.value--,l.value.style.transition=p,l.value.style.transform=`translateX(${-(a.value+1)*t[0].offsetWidth}px)`,a.value<0&&(a.value=f.value-1,setTimeout(()=>{l.value.style.transition="none",l.value.style.transform=`translateX(${-f.value*t[0].offsetWidth}px)`},300))):a.value>0&&(a.value--,l.value.style.transition=p,l.value.style.transform=`translateX(${-a.value*t[0].offsetWidth}px)`),o.autoPlay&&_(),g("slide",a.value)},M=()=>{if(!(l.value&&l.value.children))return;let t=l.value.children;o.loop?(a.value++,l.value.style.transition=p,l.value.style.transform=`translateX(${-(a.value+1)*t[0].offsetWidth}px)`,a.value>f.value-1&&(a.value=0,setTimeout(()=>{l.value.style.transition="none",l.value.style.transform=`translateX(${-t[0].offsetWidth}px)`},300))):a.value<f.value-1&&(a.value++,l.value.style.transition=p,l.value.style.transform=`translateX(${-a.value*t[0].offsetWidth}px)`),o.autoPlay&&_(),g("slide",a.value)},V=t=>{let n=l.value.children;o.autoPlay&&clearTimeout(v.value),a.value=t;let i=o.loop?a.value+1:a.value;l.value.style.transition=p,l.value.style.transform=`translateX(${-i*n[0].offsetWidth}px)`,o.autoPlay&&_(),g("slide",t)},G=t=>{c.value+="MouseEnter_",t.preventDefault(),$.value=!0,o.autoPlay&&clearTimeout(v.value)},H=t=>{c.value+="MouseLeave_",t.preventDefault(),$.value&&($.value=!1,o.autoPlay&&_())},J=t=>{c.value+="MouseDown_",t.preventDefault(),$.value=!1,!(d.value||m.value)&&(o.autoPlay&&clearTimeout(v.value),d.value=!0,r.value=t.clientX)},K=t=>{c.value+="MouseMove_",t.preventDefault(),d.value&&(!m.value&&(m.value=!0),I(t.clientX))},Q=t=>{c.value+="MouseUp_",t.preventDefault(),d.value&&(d.value=!1,b(t.clientX))},Y=t=>{if(c.value+="TouchStart_",t.preventDefault(),d.value||m.value)return;o.autoPlay&&clearTimeout(v.value),d.value=!0;let n=t.changedTouches[0];r.value=n.clientX},Z=t=>{c.value+="TouchMove_",t.preventDefault(),d.value&&(!m.value&&(m.value=!0),I(t.changedTouches[0].clientX))},X=t=>{c.value+="TouchLeave_",t.preventDefault(),d.value&&(d.value=!1,b(t.changedTouches[0].clientX))},C=N(()=>{o.autoPlay&&clearTimeout(v.value),S()},300),O=N(()=>{o.autoPlay&&clearTimeout(v.value),M()},300);return(t,n)=>(e.openBlock(),e.createElementBlock("div",{class:"yu-slide-wrapper",onMousedown:J,onMousemove:K,onMouseup:Q,onMouseenter:G,onMouseleave:H,onTouchstart:Y,onTouchmove:Z,onTouchend:X,onTouchcancel:X},[e.createElementVNode("div",{class:"yu-slide-container",ref_key:"slideItemContainer",ref:l},[e.renderSlot(t.$slots,"default",{},void 0,!0)],512),o.showArrow?(e.openBlock(),e.createElementBlock("div",D,[e.createElementVNode("div",{class:e.normalizeClass(["prev",w.value]),onClick:n[0]||(n[0]=e.withModifiers((...i)=>e.unref(C)&&e.unref(C)(...i),["stop"]))},[(e.openBlock(),e.createElementBlock("svg",{class:"icon",fill:w.value,viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18"},W,8,L))],2),e.createElementVNode("div",{class:e.normalizeClass(["next",w.value]),onClick:n[1]||(n[1]=e.withModifiers((...i)=>e.unref(O)&&e.unref(O)(...i),["stop"]))},[(e.openBlock(),e.createElementBlock("svg",{class:"icon",fill:w.value,viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18"},z,8,A))],2)])):e.createCommentVNode("",!0),o.showIndicator?(e.openBlock(),e.createElementBlock("div",j,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(i,T)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass([w.value,{active:a.value===T}]),key:T,onClick:e.withModifiers(ue=>V(T),["stop"])},null,10,U))),128))])):e.createCommentVNode("",!0)],32))}}),[["__scopeId","data-v-3bff58af"]]);k.install=function(s){s.component(k.name,k)};const R={class:"yu-slide-item-wrapper"},q={class:"yu-slide-item"},x=y(Object.assign({name:"SlideItem"},{props:{name:{type:String,default(){return""}},size:{type:[Number,String],default(){return"16px"}},showArrow:{type:Boolean,default(){return!1}},showPagination:{type:Boolean,default(){return!1}}},setup(s){return(h,u)=>(e.openBlock(),e.createElementBlock("div",R,[e.createElementVNode("div",q,[e.renderSlot(h.$slots,"default",{},void 0,!0)])]))}}),[["__scopeId","data-v-69b2940a"]]);x.install=function(s){s.component(x.name,x)};const E=[k,x],B=function(s){B.installed||(B.installed=!0,E.map(h=>{s.component(h.name,h)}))};return typeof window<"u"&&window.Vue&&B(window.Vue),{install:B,...E}});