sy-form-designer 1.0.0
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/_commonjsHelpers-C6fGbg64.js +6 -0
- package/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/designer-DsmFhyc-.js +198 -0
- package/index-BFhlK9cb.js +39 -0
- package/index-CKi_slLG.js +1220 -0
- package/index-CPJTgrJ5.js +228 -0
- package/index-CiII3mIY.js +350 -0
- package/index-CsmEJRUU.js +2433 -0
- package/index.css +1 -0
- package/index.js +5 -0
- package/index.umd.cjs +1011 -0
- package/package.json +15 -0
- package/render-CfYxuuCz.js +958 -0
- package/settings-Cc6phwii.js +14907 -0
- package/vite.svg +1 -0
- package/vue-i18n-CiM3E4ph.js +3113 -0
- package/widgets-BHbptXKj.js +90 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { defineComponent as r, createElementBlock as n, openBlock as _, createElementVNode as l, defineAsyncComponent as o } from "vue";
|
|
2
|
+
/*! Element Plus Icons Vue v2.3.1 */
|
|
3
|
+
var p = /* @__PURE__ */ r({
|
|
4
|
+
name: "ArrowDown",
|
|
5
|
+
__name: "arrow-down",
|
|
6
|
+
setup(e) {
|
|
7
|
+
return (t, a) => (_(), n("svg", {
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
+
viewBox: "0 0 1024 1024"
|
|
10
|
+
}, [
|
|
11
|
+
l("path", {
|
|
12
|
+
fill: "currentColor",
|
|
13
|
+
d: "M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"
|
|
14
|
+
})
|
|
15
|
+
]));
|
|
16
|
+
}
|
|
17
|
+
}), v = p, m = /* @__PURE__ */ r({
|
|
18
|
+
name: "ArrowUp",
|
|
19
|
+
__name: "arrow-up",
|
|
20
|
+
setup(e) {
|
|
21
|
+
return (t, a) => (_(), n("svg", {
|
|
22
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
23
|
+
viewBox: "0 0 1024 1024"
|
|
24
|
+
}, [
|
|
25
|
+
l("path", {
|
|
26
|
+
fill: "currentColor",
|
|
27
|
+
d: "m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"
|
|
28
|
+
})
|
|
29
|
+
]));
|
|
30
|
+
}
|
|
31
|
+
}), d = m, w = /* @__PURE__ */ r({
|
|
32
|
+
name: "CircleCloseFilled",
|
|
33
|
+
__name: "circle-close-filled",
|
|
34
|
+
setup(e) {
|
|
35
|
+
return (t, a) => (_(), n("svg", {
|
|
36
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37
|
+
viewBox: "0 0 1024 1024"
|
|
38
|
+
}, [
|
|
39
|
+
l("path", {
|
|
40
|
+
fill: "currentColor",
|
|
41
|
+
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"
|
|
42
|
+
})
|
|
43
|
+
]));
|
|
44
|
+
}
|
|
45
|
+
}), S = w, f = /* @__PURE__ */ r({
|
|
46
|
+
name: "CirclePlus",
|
|
47
|
+
__name: "circle-plus",
|
|
48
|
+
setup(e) {
|
|
49
|
+
return (t, a) => (_(), n("svg", {
|
|
50
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
51
|
+
viewBox: "0 0 1024 1024"
|
|
52
|
+
}, [
|
|
53
|
+
l("path", {
|
|
54
|
+
fill: "currentColor",
|
|
55
|
+
d: "M352 480h320a32 32 0 1 1 0 64H352a32 32 0 0 1 0-64"
|
|
56
|
+
}),
|
|
57
|
+
l("path", {
|
|
58
|
+
fill: "currentColor",
|
|
59
|
+
d: "M480 672V352a32 32 0 1 1 64 0v320a32 32 0 0 1-64 0"
|
|
60
|
+
}),
|
|
61
|
+
l("path", {
|
|
62
|
+
fill: "currentColor",
|
|
63
|
+
d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
|
|
64
|
+
})
|
|
65
|
+
]));
|
|
66
|
+
}
|
|
67
|
+
}), g = f, h = /* @__PURE__ */ r({
|
|
68
|
+
name: "Close",
|
|
69
|
+
__name: "close",
|
|
70
|
+
setup(e) {
|
|
71
|
+
return (t, a) => (_(), n("svg", {
|
|
72
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
73
|
+
viewBox: "0 0 1024 1024"
|
|
74
|
+
}, [
|
|
75
|
+
l("path", {
|
|
76
|
+
fill: "currentColor",
|
|
77
|
+
d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
|
|
78
|
+
})
|
|
79
|
+
]));
|
|
80
|
+
}
|
|
81
|
+
}), G = h, x = /* @__PURE__ */ r({
|
|
82
|
+
name: "Delete",
|
|
83
|
+
__name: "delete",
|
|
84
|
+
setup(e) {
|
|
85
|
+
return (t, a) => (_(), n("svg", {
|
|
86
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
87
|
+
viewBox: "0 0 1024 1024"
|
|
88
|
+
}, [
|
|
89
|
+
l("path", {
|
|
90
|
+
fill: "currentColor",
|
|
91
|
+
d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"
|
|
92
|
+
})
|
|
93
|
+
]));
|
|
94
|
+
}
|
|
95
|
+
}), C = x, y = /* @__PURE__ */ r({
|
|
96
|
+
name: "Edit",
|
|
97
|
+
__name: "edit",
|
|
98
|
+
setup(e) {
|
|
99
|
+
return (t, a) => (_(), n("svg", {
|
|
100
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
101
|
+
viewBox: "0 0 1024 1024"
|
|
102
|
+
}, [
|
|
103
|
+
l("path", {
|
|
104
|
+
fill: "currentColor",
|
|
105
|
+
d: "M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"
|
|
106
|
+
}),
|
|
107
|
+
l("path", {
|
|
108
|
+
fill: "currentColor",
|
|
109
|
+
d: "m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"
|
|
110
|
+
})
|
|
111
|
+
]));
|
|
112
|
+
}
|
|
113
|
+
}), M = y, b = /* @__PURE__ */ r({
|
|
114
|
+
name: "InfoFilled",
|
|
115
|
+
__name: "info-filled",
|
|
116
|
+
setup(e) {
|
|
117
|
+
return (t, a) => (_(), n("svg", {
|
|
118
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
119
|
+
viewBox: "0 0 1024 1024"
|
|
120
|
+
}, [
|
|
121
|
+
l("path", {
|
|
122
|
+
fill: "currentColor",
|
|
123
|
+
d: "M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"
|
|
124
|
+
})
|
|
125
|
+
]));
|
|
126
|
+
}
|
|
127
|
+
}), B = b, L = /* @__PURE__ */ r({
|
|
128
|
+
name: "Minus",
|
|
129
|
+
__name: "minus",
|
|
130
|
+
setup(e) {
|
|
131
|
+
return (t, a) => (_(), n("svg", {
|
|
132
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
133
|
+
viewBox: "0 0 1024 1024"
|
|
134
|
+
}, [
|
|
135
|
+
l("path", {
|
|
136
|
+
fill: "currentColor",
|
|
137
|
+
d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"
|
|
138
|
+
})
|
|
139
|
+
]));
|
|
140
|
+
}
|
|
141
|
+
}), z = L, H = /* @__PURE__ */ r({
|
|
142
|
+
name: "Plus",
|
|
143
|
+
__name: "plus",
|
|
144
|
+
setup(e) {
|
|
145
|
+
return (t, a) => (_(), n("svg", {
|
|
146
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
147
|
+
viewBox: "0 0 1024 1024"
|
|
148
|
+
}, [
|
|
149
|
+
l("path", {
|
|
150
|
+
fill: "currentColor",
|
|
151
|
+
d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"
|
|
152
|
+
})
|
|
153
|
+
]));
|
|
154
|
+
}
|
|
155
|
+
}), O = H, V = /* @__PURE__ */ r({
|
|
156
|
+
name: "Search",
|
|
157
|
+
__name: "search",
|
|
158
|
+
setup(e) {
|
|
159
|
+
return (t, a) => (_(), n("svg", {
|
|
160
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
161
|
+
viewBox: "0 0 1024 1024"
|
|
162
|
+
}, [
|
|
163
|
+
l("path", {
|
|
164
|
+
fill: "currentColor",
|
|
165
|
+
d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"
|
|
166
|
+
})
|
|
167
|
+
]));
|
|
168
|
+
}
|
|
169
|
+
}), j = V, I = /* @__PURE__ */ r({
|
|
170
|
+
name: "SuccessFilled",
|
|
171
|
+
__name: "success-filled",
|
|
172
|
+
setup(e) {
|
|
173
|
+
return (t, a) => (_(), n("svg", {
|
|
174
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
175
|
+
viewBox: "0 0 1024 1024"
|
|
176
|
+
}, [
|
|
177
|
+
l("path", {
|
|
178
|
+
fill: "currentColor",
|
|
179
|
+
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"
|
|
180
|
+
})
|
|
181
|
+
]));
|
|
182
|
+
}
|
|
183
|
+
}), N = I, k = /* @__PURE__ */ r({
|
|
184
|
+
name: "WarningFilled",
|
|
185
|
+
__name: "warning-filled",
|
|
186
|
+
setup(e) {
|
|
187
|
+
return (t, a) => (_(), n("svg", {
|
|
188
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
189
|
+
viewBox: "0 0 1024 1024"
|
|
190
|
+
}, [
|
|
191
|
+
l("path", {
|
|
192
|
+
fill: "currentColor",
|
|
193
|
+
d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"
|
|
194
|
+
})
|
|
195
|
+
]));
|
|
196
|
+
}
|
|
197
|
+
}), U = k;
|
|
198
|
+
function A(e) {
|
|
199
|
+
e.component("el-icon-edit", M), e.component("el-icon-minus", z), e.component("el-icon-plus", O), e.component("el-icon-info", B), e.component("el-icon-search", j), e.component("el-icon-circle-plus-outline", g), e.component("el-icon-delete", C), e.component("el-icon-arrow-down", v), e.component("el-icon-arrow-up", d);
|
|
200
|
+
}
|
|
201
|
+
const F = /* @__PURE__ */ Object.assign({ "./libs/panels/render.jsx": () => import("./render-CfYxuuCz.js"), "./libs/panels/settings.vue": () => import("./settings-Cc6phwii.js").then((e) => e.s), "./libs/panels/widgets.vue": () => import("./widgets-BHbptXKj.js") }), u = /* @__PURE__ */ Object.assign({ "./libs/designer.vue": () => import("./designer-DsmFhyc-.js") }), E = /* @__PURE__ */ Object.assign({ "./libs/extensions/image-view/index.vue": () => import("./index-CiII3mIY.js"), "./libs/extensions/picture-upload/index.vue": () => import("./index-CsmEJRUU.js"), "./libs/extensions/svg-icon/index.vue": () => import("./index-BFhlK9cb.js") }), D = (e) => {
|
|
202
|
+
for (const [t, a] of Object.entries(F)) {
|
|
203
|
+
const s = t.slice(t.lastIndexOf("/") + 1, t.lastIndexOf("."));
|
|
204
|
+
e.component("sy-" + s, o(a));
|
|
205
|
+
}
|
|
206
|
+
for (const [t, a] of Object.entries(u)) {
|
|
207
|
+
const s = t.slice(t.lastIndexOf("/") + 1, t.lastIndexOf("."));
|
|
208
|
+
e.component("sy-" + s, o(a));
|
|
209
|
+
}
|
|
210
|
+
for (const [t, a] of Object.entries(E)) {
|
|
211
|
+
const i = t.match(/\.\/libs\/extensions\/([^/]+)\/index\.vue$/)[1];
|
|
212
|
+
e.component("sy-" + i, o(a));
|
|
213
|
+
}
|
|
214
|
+
}, c = function(e) {
|
|
215
|
+
c.installed || (c.installed = !0, D(e), A(e));
|
|
216
|
+
}, W = {
|
|
217
|
+
install: c,
|
|
218
|
+
...u
|
|
219
|
+
};
|
|
220
|
+
export {
|
|
221
|
+
G as a,
|
|
222
|
+
W as b,
|
|
223
|
+
S as c,
|
|
224
|
+
B as i,
|
|
225
|
+
O as p,
|
|
226
|
+
N as s,
|
|
227
|
+
U as w
|
|
228
|
+
};
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
import { ref as x, computed as k, watch as F, nextTick as H, onMounted as ie, onUnmounted as se, resolveComponent as f, createElementBlock as b, openBlock as w, createElementVNode as i, normalizeStyle as V, createCommentVNode as Z, withModifiers as re, createVNode as a, withCtx as v, Fragment as q, normalizeClass as $, toDisplayString as ue, createBlock as ce, resolveDynamicComponent as de, renderList as me, withDirectives as fe, vShow as ve } from "vue";
|
|
2
|
+
import { _ as ge } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
const C = {
|
|
4
|
+
CONTAIN: {
|
|
5
|
+
name: "contain",
|
|
6
|
+
icon: "FullScreen"
|
|
7
|
+
},
|
|
8
|
+
ORIGINAL: {
|
|
9
|
+
name: "original",
|
|
10
|
+
icon: "ScaleToOriginal"
|
|
11
|
+
}
|
|
12
|
+
}, _e = { class: "x-image-viewer__wrapper" }, pe = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "x-image-viewer__btn x-image-viewer__desc"
|
|
15
|
+
}, xe = { class: "x-image-viewer__btn x-image-viewer__actions" }, we = { class: "x-image-viewer__actions__inner" }, ye = ["src"], W = "mousewheel", ke = {
|
|
16
|
+
__name: "index",
|
|
17
|
+
props: {
|
|
18
|
+
// 图片列表
|
|
19
|
+
urls: {
|
|
20
|
+
type: Array,
|
|
21
|
+
default: () => []
|
|
22
|
+
},
|
|
23
|
+
// 全屏展示时,该组件的默认层级
|
|
24
|
+
zIndex: {
|
|
25
|
+
type: Number,
|
|
26
|
+
default: 9e3
|
|
27
|
+
},
|
|
28
|
+
// 默认展示的图片编号
|
|
29
|
+
initialIndex: {
|
|
30
|
+
type: Number,
|
|
31
|
+
default: 0
|
|
32
|
+
},
|
|
33
|
+
//
|
|
34
|
+
infinite: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: !0
|
|
37
|
+
},
|
|
38
|
+
//
|
|
39
|
+
hideOnClickModal: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: !1
|
|
42
|
+
},
|
|
43
|
+
// 默认图片进入的动画
|
|
44
|
+
animateClass: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: "fadeInDown"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
emits: ["close", "change"],
|
|
50
|
+
setup(g, { emit: j }) {
|
|
51
|
+
const _ = g, N = j;
|
|
52
|
+
let Y = null;
|
|
53
|
+
const p = x(!0), h = x(!1), c = x(_.initialIndex), M = x(null), I = x(C.CONTAIN), o = x({
|
|
54
|
+
scale: 1,
|
|
55
|
+
deg: 0,
|
|
56
|
+
offsetX: 0,
|
|
57
|
+
offsetY: 0,
|
|
58
|
+
rotateX: 0,
|
|
59
|
+
rotateY: 0,
|
|
60
|
+
enableTransition: !1
|
|
61
|
+
}), U = k(() => {
|
|
62
|
+
const { urls: t } = _;
|
|
63
|
+
return t.length <= 1;
|
|
64
|
+
}), R = k(() => c.value === 0), E = k(() => c.value === 0), z = k(() => _.urls[c.value]), G = k(() => {
|
|
65
|
+
const {
|
|
66
|
+
scale: t,
|
|
67
|
+
deg: e,
|
|
68
|
+
offsetX: l,
|
|
69
|
+
offsetY: n,
|
|
70
|
+
rotateX: d,
|
|
71
|
+
rotateY: u,
|
|
72
|
+
enableTransition: y
|
|
73
|
+
} = o.value, s = {
|
|
74
|
+
transform: `scale(${t}) rotate(${e}deg) rotateX(${d}deg) rotateY(${u}deg)`,
|
|
75
|
+
transition: y ? "transform .3s" : "",
|
|
76
|
+
marginLeft: `${l}px`,
|
|
77
|
+
marginTop: `${n}px`
|
|
78
|
+
};
|
|
79
|
+
return I.value.name === C.CONTAIN.name && (s.maxWidth = "100%", s.maxHeight = "100%"), s;
|
|
80
|
+
});
|
|
81
|
+
function D() {
|
|
82
|
+
N("close");
|
|
83
|
+
}
|
|
84
|
+
function J() {
|
|
85
|
+
p.value = !1, h.value = !0;
|
|
86
|
+
}
|
|
87
|
+
function K() {
|
|
88
|
+
p.value = !1;
|
|
89
|
+
}
|
|
90
|
+
function O(t) {
|
|
91
|
+
let e = !1;
|
|
92
|
+
return function(...l) {
|
|
93
|
+
e || (e = !0, window.requestAnimationFrame(() => {
|
|
94
|
+
t.apply(this, l), e = !1;
|
|
95
|
+
}));
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
const S = function(t, e, l, n = !1) {
|
|
99
|
+
t && e && l && t.addEventListener(e, l, n);
|
|
100
|
+
}, T = function(t, e, l, n = !1) {
|
|
101
|
+
t && e && l && t.removeEventListener(e, l, n);
|
|
102
|
+
};
|
|
103
|
+
function P(t) {
|
|
104
|
+
if (p.value || t.button !== 0) return;
|
|
105
|
+
const { offsetX: e, offsetY: l } = o.value, n = t.pageX, d = t.pageY;
|
|
106
|
+
Y = O((u) => {
|
|
107
|
+
o.value = {
|
|
108
|
+
...o.value,
|
|
109
|
+
offsetX: e + u.pageX - n,
|
|
110
|
+
offsetY: l + u.pageY - d
|
|
111
|
+
};
|
|
112
|
+
}), S(document, "mousemove", Y), S(document, "mouseup", () => {
|
|
113
|
+
T(document, "mousemove", Y);
|
|
114
|
+
}), t.preventDefault();
|
|
115
|
+
}
|
|
116
|
+
function L() {
|
|
117
|
+
o.value = {
|
|
118
|
+
scale: 1,
|
|
119
|
+
deg: 0,
|
|
120
|
+
offsetX: 0,
|
|
121
|
+
offsetY: 0,
|
|
122
|
+
enableTransition: !1,
|
|
123
|
+
rotateX: 0,
|
|
124
|
+
rotateY: 0
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function r(t, e = {}) {
|
|
128
|
+
if (p.value) return;
|
|
129
|
+
const { zoomRate: l, rotateDeg: n, rotateXDeg: d, rotateYDeg: u, enableTransition: y } = {
|
|
130
|
+
zoomRate: 0.2,
|
|
131
|
+
rotateDeg: 90,
|
|
132
|
+
rotateXDeg: 180,
|
|
133
|
+
rotateYDeg: 180,
|
|
134
|
+
enableTransition: !0,
|
|
135
|
+
...e
|
|
136
|
+
};
|
|
137
|
+
if (t === "zoomOut")
|
|
138
|
+
o.value.scale > 0.2 && (o.value.scale = parseFloat((o.value.scale - l).toFixed(3)));
|
|
139
|
+
else if (t === "zoomIn")
|
|
140
|
+
o.value.scale = parseFloat((o.value.scale + l).toFixed(3));
|
|
141
|
+
else if (t === "clocelise")
|
|
142
|
+
o.value.deg += n;
|
|
143
|
+
else if (t === "anticlocelise")
|
|
144
|
+
o.value.deg -= n;
|
|
145
|
+
else if (t === "fliphorizontal") {
|
|
146
|
+
let s = o.value.deg != 0 && Math.abs(o.value.deg) / n % 2 != 0 ? "rotateX" : "rotateY";
|
|
147
|
+
o.value[s] = o.value[s] ? 0 : u;
|
|
148
|
+
} else if (t === "flipvertical") {
|
|
149
|
+
let s = o.value.deg != 0 && Math.abs(o.value.deg) / n % 2 != 0 ? "rotateY" : "rotateX";
|
|
150
|
+
o.value[s] = o.value[s] ? 0 : d;
|
|
151
|
+
}
|
|
152
|
+
o.value.enableTransition = y;
|
|
153
|
+
}
|
|
154
|
+
function A() {
|
|
155
|
+
if (p.value) return;
|
|
156
|
+
const t = Object.keys(C), e = Object.values(C), l = I.value.name, d = (e.findIndex((u) => u.name === l) + 1) % t.length;
|
|
157
|
+
I.value = C[t[d]], L();
|
|
158
|
+
}
|
|
159
|
+
function Q() {
|
|
160
|
+
if (R.value && !_.infinite) return;
|
|
161
|
+
const t = _.urls.length;
|
|
162
|
+
c.value = (c.value - 1 + t) % t, h.value = !1;
|
|
163
|
+
}
|
|
164
|
+
function ee() {
|
|
165
|
+
if (E.value && !_.infinite) return;
|
|
166
|
+
const t = _.urls.length;
|
|
167
|
+
c.value = (c.value + 1) % t, h.value = !1;
|
|
168
|
+
}
|
|
169
|
+
let X = null, B = null;
|
|
170
|
+
const te = () => {
|
|
171
|
+
X = O((e) => {
|
|
172
|
+
switch (e.keyCode) {
|
|
173
|
+
// ESC
|
|
174
|
+
case 27:
|
|
175
|
+
D();
|
|
176
|
+
break;
|
|
177
|
+
// SPACE
|
|
178
|
+
case 32:
|
|
179
|
+
A();
|
|
180
|
+
break;
|
|
181
|
+
// LEFT_ARROW
|
|
182
|
+
case 37:
|
|
183
|
+
this.prev();
|
|
184
|
+
break;
|
|
185
|
+
// UP_ARROW
|
|
186
|
+
case 38:
|
|
187
|
+
r("zoomIn");
|
|
188
|
+
break;
|
|
189
|
+
// RIGHT_ARROW
|
|
190
|
+
case 39:
|
|
191
|
+
this.next();
|
|
192
|
+
break;
|
|
193
|
+
// DOWN_ARROW
|
|
194
|
+
case 40:
|
|
195
|
+
r("zoomOut");
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
let t = O((e) => {
|
|
200
|
+
(e.wheelDelta ? e.wheelDelta : -e.detail) > 0 ? r("zoomIn", {
|
|
201
|
+
zoomRate: 0.09,
|
|
202
|
+
enableTransition: !1
|
|
203
|
+
}) : r("zoomOut", {
|
|
204
|
+
zoomRate: 0.09,
|
|
205
|
+
enableTransition: !1
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
S(document, "keydown", X), S(document, W, t);
|
|
209
|
+
}, ne = () => {
|
|
210
|
+
T(document, "keydown", X), T(document, W, B), X = null, B = null;
|
|
211
|
+
};
|
|
212
|
+
return F(z, () => {
|
|
213
|
+
H(() => {
|
|
214
|
+
M.value.complete || (p.value = !0);
|
|
215
|
+
});
|
|
216
|
+
}), F(c, (t) => {
|
|
217
|
+
L(), N("change", t);
|
|
218
|
+
}), ie(() => {
|
|
219
|
+
H(() => {
|
|
220
|
+
const t = document.querySelector("body");
|
|
221
|
+
t.append ? t.append(document.getElementById("x-image-viewer")) : t.appendChild(document.getElementById("x-image-viewer")), te();
|
|
222
|
+
});
|
|
223
|
+
}), se(() => {
|
|
224
|
+
document.querySelector("body").removeChild(document.getElementById("x-image-viewer")), ne();
|
|
225
|
+
}), (t, e) => {
|
|
226
|
+
const l = f("Close"), n = f("el-icon"), d = f("ZoomOut"), u = f("ZoomIn"), y = f("RefreshLeft"), s = f("RefreshRight"), oe = f("Switch"), le = f("Sort");
|
|
227
|
+
return w(), b("template", null, [
|
|
228
|
+
i("div", {
|
|
229
|
+
id: "x-image-viewer",
|
|
230
|
+
class: "x-image-viewer",
|
|
231
|
+
style: V({ zIndex: g.zIndex })
|
|
232
|
+
}, [
|
|
233
|
+
i("div", _e, [
|
|
234
|
+
i("div", {
|
|
235
|
+
class: "x-image-viewer__mask",
|
|
236
|
+
onClick: e[0] || (e[0] = re((m) => g.hideOnClickModal && D(), ["self"]))
|
|
237
|
+
}),
|
|
238
|
+
i("span", {
|
|
239
|
+
class: "x-image-viewer__btn x-image-viewer__close",
|
|
240
|
+
onClick: D
|
|
241
|
+
}, [
|
|
242
|
+
a(n, null, {
|
|
243
|
+
default: v(() => [
|
|
244
|
+
a(l)
|
|
245
|
+
]),
|
|
246
|
+
_: 1
|
|
247
|
+
})
|
|
248
|
+
]),
|
|
249
|
+
U.value ? Z("", !0) : (w(), b(q, { key: 0 }, [
|
|
250
|
+
i("span", {
|
|
251
|
+
class: $(["x-image-viewer__btn x-image-viewer__prev", { "is-disabled": !g.infinite && R.value }]),
|
|
252
|
+
onClick: Q
|
|
253
|
+
}, e[7] || (e[7] = [
|
|
254
|
+
i("i", { class: "el-icon-arrow-left" }, null, -1)
|
|
255
|
+
]), 2),
|
|
256
|
+
i("span", {
|
|
257
|
+
class: $(["x-image-viewer__btn x-image-viewer__next", { "is-disabled": !g.infinite && E.value }]),
|
|
258
|
+
onClick: ee
|
|
259
|
+
}, e[8] || (e[8] = [
|
|
260
|
+
i("i", { class: "el-icon-arrow-right" }, null, -1)
|
|
261
|
+
]), 2)
|
|
262
|
+
], 64)),
|
|
263
|
+
z.value.desc ? (w(), b("div", pe, ue(z.value.desc), 1)) : Z("", !0),
|
|
264
|
+
i("div", xe, [
|
|
265
|
+
i("div", we, [
|
|
266
|
+
a(n, {
|
|
267
|
+
onClick: e[1] || (e[1] = (m) => r("zoomOut"))
|
|
268
|
+
}, {
|
|
269
|
+
default: v(() => [
|
|
270
|
+
a(d)
|
|
271
|
+
]),
|
|
272
|
+
_: 1
|
|
273
|
+
}),
|
|
274
|
+
a(n, {
|
|
275
|
+
onClick: e[2] || (e[2] = (m) => r("zoomIn"))
|
|
276
|
+
}, {
|
|
277
|
+
default: v(() => [
|
|
278
|
+
a(u)
|
|
279
|
+
]),
|
|
280
|
+
_: 1
|
|
281
|
+
}),
|
|
282
|
+
e[9] || (e[9] = i("i", { class: "x-image-viewer__actions__divider" }, null, -1)),
|
|
283
|
+
a(n, { onClick: A }, {
|
|
284
|
+
default: v(() => [
|
|
285
|
+
(w(), ce(de(I.value.icon)))
|
|
286
|
+
]),
|
|
287
|
+
_: 1
|
|
288
|
+
}),
|
|
289
|
+
e[10] || (e[10] = i("i", { class: "x-image-viewer__actions__divider" }, null, -1)),
|
|
290
|
+
a(n, {
|
|
291
|
+
onClick: e[3] || (e[3] = (m) => r("anticlocelise"))
|
|
292
|
+
}, {
|
|
293
|
+
default: v(() => [
|
|
294
|
+
a(y)
|
|
295
|
+
]),
|
|
296
|
+
_: 1
|
|
297
|
+
}),
|
|
298
|
+
a(n, {
|
|
299
|
+
onClick: e[4] || (e[4] = (m) => r("clocelise"))
|
|
300
|
+
}, {
|
|
301
|
+
default: v(() => [
|
|
302
|
+
a(s)
|
|
303
|
+
]),
|
|
304
|
+
_: 1
|
|
305
|
+
}),
|
|
306
|
+
a(n, {
|
|
307
|
+
onClick: e[5] || (e[5] = (m) => r("fliphorizontal"))
|
|
308
|
+
}, {
|
|
309
|
+
default: v(() => [
|
|
310
|
+
a(oe)
|
|
311
|
+
]),
|
|
312
|
+
_: 1
|
|
313
|
+
}),
|
|
314
|
+
a(n, {
|
|
315
|
+
onClick: e[6] || (e[6] = (m) => r("flipvertical"))
|
|
316
|
+
}, {
|
|
317
|
+
default: v(() => [
|
|
318
|
+
a(le)
|
|
319
|
+
]),
|
|
320
|
+
_: 1
|
|
321
|
+
})
|
|
322
|
+
])
|
|
323
|
+
]),
|
|
324
|
+
i("div", {
|
|
325
|
+
class: $(["x-image-viewer__canvas opacity-hide", [h.value === !0 ? "opacity-show animated " + g.animateClass : ""]])
|
|
326
|
+
}, [
|
|
327
|
+
(w(!0), b(q, null, me(g.urls, (m, ae) => fe((w(), b("img", {
|
|
328
|
+
ref_for: !0,
|
|
329
|
+
ref_key: "img",
|
|
330
|
+
ref: M,
|
|
331
|
+
key: m,
|
|
332
|
+
src: z.value.src,
|
|
333
|
+
style: V(G.value),
|
|
334
|
+
class: "x-image-viewer__img",
|
|
335
|
+
onLoad: J,
|
|
336
|
+
onError: K,
|
|
337
|
+
onMousedown: P
|
|
338
|
+
}, null, 44, ye)), [
|
|
339
|
+
[ve, ae === c.value]
|
|
340
|
+
])), 128))
|
|
341
|
+
], 2)
|
|
342
|
+
])
|
|
343
|
+
], 4)
|
|
344
|
+
]);
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
}, he = /* @__PURE__ */ ge(ke, [["__scopeId", "data-v-1a9d3431"]]);
|
|
348
|
+
export {
|
|
349
|
+
he as default
|
|
350
|
+
};
|