iking-web-ui-pro 0.2.30 → 0.2.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/IKPreviewFile/ik.index.es.js +2168 -1519
- package/dist/IKPreviewFile/ik.index.umd.js +61 -61
- package/dist/IkApprovalProcessDetail/ik.index.es.js +3194 -2545
- package/dist/IkApprovalProcessDetail/ik.index.umd.js +58 -58
- package/dist/IkDescription/ik.index.es.js +2300 -1651
- package/dist/IkDescription/ik.index.umd.js +61 -61
- package/dist/IkDetailPreviewFiles/ik.index.es.js +2385 -1736
- package/dist/IkDetailPreviewFiles/ik.index.umd.js +61 -61
- package/dist/IkImageViewer/ik.index.es.js +681 -0
- package/dist/IkImageViewer/ik.index.umd.js +1 -0
- package/dist/IkPreviewFileDialog/ik.index.es.js +2762 -2113
- package/dist/IkPreviewFileDialog/ik.index.umd.js +58 -58
- package/dist/IkUploadFile/ik.index.es.js +3189 -2540
- package/dist/IkUploadFile/ik.index.umd.js +58 -58
- package/dist/IkUploadImage/ik.index.es.js +914 -279
- package/dist/IkUploadImage/ik.index.umd.js +1 -1
- package/dist/IkUploadImage/style.css +1 -1
- package/dist/index.es.js +27129 -26521
- package/dist/index.umd.js +112 -112
- package/dist/src/components/IkImageViewer/index.d.ts +6 -0
- package/dist/src/components/IkImageViewer/src/IkImageViewer.vue.d.ts +11 -0
- package/dist/src/components/IkImageViewer/src/image-viewer.d.ts +87 -0
- package/dist/src/components/index.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,681 @@
|
|
|
1
|
+
import { unref as o, getCurrentScope as Oe, onScopeDispose as be, watch as Q, defineComponent as x, openBlock as _, createElementBlock as p, createElementVNode as u, markRaw as J, ref as M, effectScope as ke, shallowRef as ze, computed as A, nextTick as Ce, onMounted as Le, createBlock as ee, Teleport as Ne, createVNode as f, Transition as Ee, withCtx as O, normalizeClass as w, normalizeStyle as te, withModifiers as Ae, createCommentVNode as S, Fragment as ae, resolveDynamicComponent as Me, renderList as Te, withDirectives as Ve, vShow as Se, renderSlot as Re } from "vue";
|
|
2
|
+
import { paramType as ne, _ as F } from "iking-utils-pro";
|
|
3
|
+
import { useLocale as Be, useNamespace as Pe, useZIndex as He, ElIcon as z, EVENT_CODE as T } from "element-plus";
|
|
4
|
+
const Xe = (e, n) => {
|
|
5
|
+
if (e.install = (a) => {
|
|
6
|
+
for (const v of [e, ...Object.values(n ?? {})])
|
|
7
|
+
a.component(v.name, v);
|
|
8
|
+
}, n)
|
|
9
|
+
for (const [a, v] of Object.entries(n))
|
|
10
|
+
e[a] = v;
|
|
11
|
+
return e;
|
|
12
|
+
};
|
|
13
|
+
var re;
|
|
14
|
+
const ce = typeof window < "u", Ye = (e) => typeof e == "string", $e = () => {
|
|
15
|
+
};
|
|
16
|
+
ce && ((re = window == null ? void 0 : window.navigator) != null && re.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
17
|
+
function fe(e) {
|
|
18
|
+
return typeof e == "function" ? e() : o(e);
|
|
19
|
+
}
|
|
20
|
+
function Fe(e) {
|
|
21
|
+
return e;
|
|
22
|
+
}
|
|
23
|
+
function Qe(e) {
|
|
24
|
+
return Oe() ? (be(e), !0) : !1;
|
|
25
|
+
}
|
|
26
|
+
function De(e) {
|
|
27
|
+
var n;
|
|
28
|
+
const a = fe(e);
|
|
29
|
+
return (n = a == null ? void 0 : a.$el) != null ? n : a;
|
|
30
|
+
}
|
|
31
|
+
const je = ce ? window : void 0;
|
|
32
|
+
function P(...e) {
|
|
33
|
+
let n, a, v, I;
|
|
34
|
+
if (Ye(e[0]) || Array.isArray(e[0]) ? ([a, v, I] = e, n = je) : [n, a, v, I] = e, !n)
|
|
35
|
+
return $e;
|
|
36
|
+
Array.isArray(a) || (a = [a]), Array.isArray(v) || (v = [v]);
|
|
37
|
+
const i = [], C = () => {
|
|
38
|
+
i.forEach((d) => d()), i.length = 0;
|
|
39
|
+
}, H = (d, L, N, m) => (d.addEventListener(L, N, m), () => d.removeEventListener(L, N, m)), l = Q(() => [De(n), fe(I)], ([d, L]) => {
|
|
40
|
+
C(), d && i.push(...a.flatMap((N) => v.map((m) => H(d, N, m, L))));
|
|
41
|
+
}, { immediate: !0, flush: "post" }), R = () => {
|
|
42
|
+
l(), C();
|
|
43
|
+
};
|
|
44
|
+
return Qe(R), R;
|
|
45
|
+
}
|
|
46
|
+
const oe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, se = "__vueuse_ssr_handlers__";
|
|
47
|
+
oe[se] = oe[se] || {};
|
|
48
|
+
var le;
|
|
49
|
+
(function(e) {
|
|
50
|
+
e.UP = "UP", e.RIGHT = "RIGHT", e.DOWN = "DOWN", e.LEFT = "LEFT", e.NONE = "NONE";
|
|
51
|
+
})(le || (le = {}));
|
|
52
|
+
var We = Object.defineProperty, ue = Object.getOwnPropertySymbols, Ze = Object.prototype.hasOwnProperty, Ge = Object.prototype.propertyIsEnumerable, ie = (e, n, a) => n in e ? We(e, n, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[n] = a, Ke = (e, n) => {
|
|
53
|
+
for (var a in n || (n = {}))
|
|
54
|
+
Ze.call(n, a) && ie(e, a, n[a]);
|
|
55
|
+
if (ue)
|
|
56
|
+
for (var a of ue(n))
|
|
57
|
+
Ge.call(n, a) && ie(e, a, n[a]);
|
|
58
|
+
return e;
|
|
59
|
+
};
|
|
60
|
+
const Ue = {
|
|
61
|
+
easeInSine: [0.12, 0, 0.39, 0],
|
|
62
|
+
easeOutSine: [0.61, 1, 0.88, 1],
|
|
63
|
+
easeInOutSine: [0.37, 0, 0.63, 1],
|
|
64
|
+
easeInQuad: [0.11, 0, 0.5, 0],
|
|
65
|
+
easeOutQuad: [0.5, 1, 0.89, 1],
|
|
66
|
+
easeInOutQuad: [0.45, 0, 0.55, 1],
|
|
67
|
+
easeInCubic: [0.32, 0, 0.67, 0],
|
|
68
|
+
easeOutCubic: [0.33, 1, 0.68, 1],
|
|
69
|
+
easeInOutCubic: [0.65, 0, 0.35, 1],
|
|
70
|
+
easeInQuart: [0.5, 0, 0.75, 0],
|
|
71
|
+
easeOutQuart: [0.25, 1, 0.5, 1],
|
|
72
|
+
easeInOutQuart: [0.76, 0, 0.24, 1],
|
|
73
|
+
easeInQuint: [0.64, 0, 0.78, 0],
|
|
74
|
+
easeOutQuint: [0.22, 1, 0.36, 1],
|
|
75
|
+
easeInOutQuint: [0.83, 0, 0.17, 1],
|
|
76
|
+
easeInExpo: [0.7, 0, 0.84, 0],
|
|
77
|
+
easeOutExpo: [0.16, 1, 0.3, 1],
|
|
78
|
+
easeInOutExpo: [0.87, 0, 0.13, 1],
|
|
79
|
+
easeInCirc: [0.55, 0, 1, 0.45],
|
|
80
|
+
easeOutCirc: [0, 0.55, 0.45, 1],
|
|
81
|
+
easeInOutCirc: [0.85, 0, 0.15, 1],
|
|
82
|
+
easeInBack: [0.36, 0, 0.66, -0.56],
|
|
83
|
+
easeOutBack: [0.34, 1.56, 0.64, 1],
|
|
84
|
+
easeInOutBack: [0.68, -0.6, 0.32, 1.6]
|
|
85
|
+
};
|
|
86
|
+
Ke({
|
|
87
|
+
linear: Fe
|
|
88
|
+
}, Ue);
|
|
89
|
+
/*! Element Plus Icons Vue v2.3.1 */
|
|
90
|
+
var qe = /* @__PURE__ */ x({
|
|
91
|
+
name: "ArrowLeft",
|
|
92
|
+
__name: "arrow-left",
|
|
93
|
+
setup(e) {
|
|
94
|
+
return (n, a) => (_(), p("svg", {
|
|
95
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
96
|
+
viewBox: "0 0 1024 1024"
|
|
97
|
+
}, [
|
|
98
|
+
u("path", {
|
|
99
|
+
fill: "currentColor",
|
|
100
|
+
d: "M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"
|
|
101
|
+
})
|
|
102
|
+
]));
|
|
103
|
+
}
|
|
104
|
+
}), Je = qe, et = /* @__PURE__ */ x({
|
|
105
|
+
name: "ArrowRight",
|
|
106
|
+
__name: "arrow-right",
|
|
107
|
+
setup(e) {
|
|
108
|
+
return (n, a) => (_(), p("svg", {
|
|
109
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
110
|
+
viewBox: "0 0 1024 1024"
|
|
111
|
+
}, [
|
|
112
|
+
u("path", {
|
|
113
|
+
fill: "currentColor",
|
|
114
|
+
d: "M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"
|
|
115
|
+
})
|
|
116
|
+
]));
|
|
117
|
+
}
|
|
118
|
+
}), tt = et, at = /* @__PURE__ */ x({
|
|
119
|
+
name: "Close",
|
|
120
|
+
__name: "close",
|
|
121
|
+
setup(e) {
|
|
122
|
+
return (n, a) => (_(), p("svg", {
|
|
123
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
124
|
+
viewBox: "0 0 1024 1024"
|
|
125
|
+
}, [
|
|
126
|
+
u("path", {
|
|
127
|
+
fill: "currentColor",
|
|
128
|
+
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"
|
|
129
|
+
})
|
|
130
|
+
]));
|
|
131
|
+
}
|
|
132
|
+
}), nt = at, rt = /* @__PURE__ */ x({
|
|
133
|
+
name: "FullScreen",
|
|
134
|
+
__name: "full-screen",
|
|
135
|
+
setup(e) {
|
|
136
|
+
return (n, a) => (_(), p("svg", {
|
|
137
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
138
|
+
viewBox: "0 0 1024 1024"
|
|
139
|
+
}, [
|
|
140
|
+
u("path", {
|
|
141
|
+
fill: "currentColor",
|
|
142
|
+
d: "m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64l192-.192zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"
|
|
143
|
+
})
|
|
144
|
+
]));
|
|
145
|
+
}
|
|
146
|
+
}), ot = rt, st = /* @__PURE__ */ x({
|
|
147
|
+
name: "RefreshLeft",
|
|
148
|
+
__name: "refresh-left",
|
|
149
|
+
setup(e) {
|
|
150
|
+
return (n, a) => (_(), p("svg", {
|
|
151
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
152
|
+
viewBox: "0 0 1024 1024"
|
|
153
|
+
}, [
|
|
154
|
+
u("path", {
|
|
155
|
+
fill: "currentColor",
|
|
156
|
+
d: "M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"
|
|
157
|
+
})
|
|
158
|
+
]));
|
|
159
|
+
}
|
|
160
|
+
}), lt = st, ut = /* @__PURE__ */ x({
|
|
161
|
+
name: "RefreshRight",
|
|
162
|
+
__name: "refresh-right",
|
|
163
|
+
setup(e) {
|
|
164
|
+
return (n, a) => (_(), p("svg", {
|
|
165
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
166
|
+
viewBox: "0 0 1024 1024"
|
|
167
|
+
}, [
|
|
168
|
+
u("path", {
|
|
169
|
+
fill: "currentColor",
|
|
170
|
+
d: "M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88z"
|
|
171
|
+
})
|
|
172
|
+
]));
|
|
173
|
+
}
|
|
174
|
+
}), it = ut, ct = /* @__PURE__ */ x({
|
|
175
|
+
name: "ScaleToOriginal",
|
|
176
|
+
__name: "scale-to-original",
|
|
177
|
+
setup(e) {
|
|
178
|
+
return (n, a) => (_(), p("svg", {
|
|
179
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
180
|
+
viewBox: "0 0 1024 1024"
|
|
181
|
+
}, [
|
|
182
|
+
u("path", {
|
|
183
|
+
fill: "currentColor",
|
|
184
|
+
d: "M813.176 180.706a60.235 60.235 0 0 1 60.236 60.235v481.883a60.235 60.235 0 0 1-60.236 60.235H210.824a60.235 60.235 0 0 1-60.236-60.235V240.94a60.235 60.235 0 0 1 60.236-60.235h602.352zm0-60.235H210.824A120.47 120.47 0 0 0 90.353 240.94v481.883a120.47 120.47 0 0 0 120.47 120.47h602.353a120.47 120.47 0 0 0 120.471-120.47V240.94a120.47 120.47 0 0 0-120.47-120.47zm-120.47 180.705a30.118 30.118 0 0 0-30.118 30.118v301.177a30.118 30.118 0 0 0 60.236 0V331.294a30.118 30.118 0 0 0-30.118-30.118zm-361.412 0a30.118 30.118 0 0 0-30.118 30.118v301.177a30.118 30.118 0 1 0 60.236 0V331.294a30.118 30.118 0 0 0-30.118-30.118M512 361.412a30.118 30.118 0 0 0-30.118 30.117v30.118a30.118 30.118 0 0 0 60.236 0V391.53A30.118 30.118 0 0 0 512 361.412M512 512a30.118 30.118 0 0 0-30.118 30.118v30.117a30.118 30.118 0 0 0 60.236 0v-30.117A30.118 30.118 0 0 0 512 512"
|
|
185
|
+
})
|
|
186
|
+
]));
|
|
187
|
+
}
|
|
188
|
+
}), ft = ct, _t = /* @__PURE__ */ x({
|
|
189
|
+
name: "ZoomIn",
|
|
190
|
+
__name: "zoom-in",
|
|
191
|
+
setup(e) {
|
|
192
|
+
return (n, a) => (_(), p("svg", {
|
|
193
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
194
|
+
viewBox: "0 0 1024 1024"
|
|
195
|
+
}, [
|
|
196
|
+
u("path", {
|
|
197
|
+
fill: "currentColor",
|
|
198
|
+
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 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"
|
|
199
|
+
})
|
|
200
|
+
]));
|
|
201
|
+
}
|
|
202
|
+
}), vt = _t, pt = /* @__PURE__ */ x({
|
|
203
|
+
name: "ZoomOut",
|
|
204
|
+
__name: "zoom-out",
|
|
205
|
+
setup(e) {
|
|
206
|
+
return (n, a) => (_(), p("svg", {
|
|
207
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
208
|
+
viewBox: "0 0 1024 1024"
|
|
209
|
+
}, [
|
|
210
|
+
u("path", {
|
|
211
|
+
fill: "currentColor",
|
|
212
|
+
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 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"
|
|
213
|
+
})
|
|
214
|
+
]));
|
|
215
|
+
}
|
|
216
|
+
}), dt = pt;
|
|
217
|
+
const mt = {
|
|
218
|
+
/**
|
|
219
|
+
* @description preview link list.
|
|
220
|
+
*/
|
|
221
|
+
urlList: {
|
|
222
|
+
type: Array,
|
|
223
|
+
default: () => []
|
|
224
|
+
},
|
|
225
|
+
/**
|
|
226
|
+
* @description preview backdrop z-index.
|
|
227
|
+
*/
|
|
228
|
+
zIndex: {
|
|
229
|
+
type: Number
|
|
230
|
+
},
|
|
231
|
+
/**
|
|
232
|
+
* @description the initial preview image index, less than or equal to the length of `url-list`.
|
|
233
|
+
*/
|
|
234
|
+
initialIndex: {
|
|
235
|
+
type: Number,
|
|
236
|
+
default: 0
|
|
237
|
+
},
|
|
238
|
+
/**
|
|
239
|
+
* @description whether preview is infinite.
|
|
240
|
+
*/
|
|
241
|
+
infinite: {
|
|
242
|
+
type: Boolean,
|
|
243
|
+
default: !0
|
|
244
|
+
},
|
|
245
|
+
/**
|
|
246
|
+
* @description whether user can emit close event when clicking backdrop.
|
|
247
|
+
*/
|
|
248
|
+
hideOnClickModal: Boolean,
|
|
249
|
+
/**
|
|
250
|
+
* @description whether to append image itself to body. A nested parent element attribute transform should have this attribute set to `true`.
|
|
251
|
+
*/
|
|
252
|
+
teleported: Boolean,
|
|
253
|
+
/**
|
|
254
|
+
* @description whether the image-viewer can be closed by pressing ESC.
|
|
255
|
+
*/
|
|
256
|
+
closeOnPressEscape: {
|
|
257
|
+
type: Boolean,
|
|
258
|
+
default: !0
|
|
259
|
+
},
|
|
260
|
+
/**
|
|
261
|
+
* @description the zoom rate of the image viewer zoom event.
|
|
262
|
+
*/
|
|
263
|
+
zoomRate: {
|
|
264
|
+
type: Number,
|
|
265
|
+
default: 1.2
|
|
266
|
+
},
|
|
267
|
+
/**
|
|
268
|
+
* @description the min scale of the image viewer zoom event.
|
|
269
|
+
*/
|
|
270
|
+
minScale: {
|
|
271
|
+
type: Number,
|
|
272
|
+
default: 0.2
|
|
273
|
+
},
|
|
274
|
+
/**
|
|
275
|
+
* @description the max scale of the image viewer zoom event.
|
|
276
|
+
*/
|
|
277
|
+
maxScale: {
|
|
278
|
+
type: Number,
|
|
279
|
+
default: 7
|
|
280
|
+
},
|
|
281
|
+
/**
|
|
282
|
+
* @description set HTML attribute: crossorigin.
|
|
283
|
+
*/
|
|
284
|
+
crossorigin: {
|
|
285
|
+
type: ["anonymous", "use-credentials", ""]
|
|
286
|
+
}
|
|
287
|
+
}, gt = {
|
|
288
|
+
close: () => !0,
|
|
289
|
+
switch: (e) => ne.isNumber(e),
|
|
290
|
+
rotate: (e) => ne.isNumber(e)
|
|
291
|
+
}, wt = ["src", "crossorigin"], ht = /* @__PURE__ */ x({
|
|
292
|
+
name: "ElImageViewer",
|
|
293
|
+
__name: "IkImageViewer",
|
|
294
|
+
props: mt,
|
|
295
|
+
emits: gt,
|
|
296
|
+
setup(e, { expose: n, emit: a }) {
|
|
297
|
+
const v = (t) => Object.keys(t), I = {
|
|
298
|
+
CONTAIN: {
|
|
299
|
+
name: "contain",
|
|
300
|
+
icon: J(ot)
|
|
301
|
+
},
|
|
302
|
+
ORIGINAL: {
|
|
303
|
+
name: "original",
|
|
304
|
+
icon: J(ft)
|
|
305
|
+
}
|
|
306
|
+
}, i = e, C = a, { t: H } = Be(), l = Pe("image-viewer"), { nextZIndex: R } = He(), d = M(), L = M([]), N = ke(), m = M(!0), b = M(i.initialIndex), B = ze(I.CONTAIN), c = M({
|
|
307
|
+
scale: 1,
|
|
308
|
+
deg: 0,
|
|
309
|
+
offsetX: 0,
|
|
310
|
+
offsetY: 0,
|
|
311
|
+
enableTransition: !1
|
|
312
|
+
}), _e = M(i.zIndex ?? R()), ve = A(() => {
|
|
313
|
+
const { urlList: t } = i;
|
|
314
|
+
return t.length <= 1;
|
|
315
|
+
}), D = A(() => b.value === 0), j = A(() => b.value === i.urlList.length - 1), pe = A(() => i.urlList[b.value]), de = A(() => [
|
|
316
|
+
l.e("btn"),
|
|
317
|
+
l.e("prev"),
|
|
318
|
+
l.is("disabled", !i.infinite && D.value)
|
|
319
|
+
]), me = A(() => [
|
|
320
|
+
l.e("btn"),
|
|
321
|
+
l.e("next"),
|
|
322
|
+
l.is("disabled", !i.infinite && j.value)
|
|
323
|
+
]), ge = A(() => {
|
|
324
|
+
const { scale: t, deg: r, offsetX: s, offsetY: g, enableTransition: h } = c.value;
|
|
325
|
+
let y = s / t, k = g / t;
|
|
326
|
+
const V = r * Math.PI / 180, U = Math.cos(V), q = Math.sin(V);
|
|
327
|
+
y = y * U + k * q, k = k * U - s / t * q;
|
|
328
|
+
const $ = {
|
|
329
|
+
transform: `scale(${t}) rotate(${r}deg) translate(${y}px, ${k}px)`,
|
|
330
|
+
transition: h ? "transform .3s" : ""
|
|
331
|
+
};
|
|
332
|
+
return B.value.name === I.CONTAIN.name && ($.maxWidth = $.maxHeight = "100%"), $;
|
|
333
|
+
});
|
|
334
|
+
function X() {
|
|
335
|
+
he(), C("close");
|
|
336
|
+
}
|
|
337
|
+
function we() {
|
|
338
|
+
const t = F.throttle((s) => {
|
|
339
|
+
switch (s.code) {
|
|
340
|
+
case T.esc:
|
|
341
|
+
i.closeOnPressEscape && X();
|
|
342
|
+
break;
|
|
343
|
+
case T.space:
|
|
344
|
+
Z();
|
|
345
|
+
break;
|
|
346
|
+
case T.left:
|
|
347
|
+
G();
|
|
348
|
+
break;
|
|
349
|
+
case T.up:
|
|
350
|
+
E("zoomIn");
|
|
351
|
+
break;
|
|
352
|
+
case T.right:
|
|
353
|
+
K();
|
|
354
|
+
break;
|
|
355
|
+
case T.down:
|
|
356
|
+
E("zoomOut");
|
|
357
|
+
break;
|
|
358
|
+
}
|
|
359
|
+
}), r = F.throttle((s) => {
|
|
360
|
+
const g = s.deltaY || s.deltaX;
|
|
361
|
+
E(g < 0 ? "zoomIn" : "zoomOut", {
|
|
362
|
+
zoomRate: i.zoomRate,
|
|
363
|
+
enableTransition: !1
|
|
364
|
+
});
|
|
365
|
+
});
|
|
366
|
+
N.run(() => {
|
|
367
|
+
P(document, "keydown", t), P(document, "wheel", r);
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
function he() {
|
|
371
|
+
N.stop();
|
|
372
|
+
}
|
|
373
|
+
function ye() {
|
|
374
|
+
m.value = !1;
|
|
375
|
+
}
|
|
376
|
+
function xe(t) {
|
|
377
|
+
m.value = !1, t.target.alt = H("el.image.error");
|
|
378
|
+
}
|
|
379
|
+
function Ie(t) {
|
|
380
|
+
if (m.value || t.button !== 0 || !d.value)
|
|
381
|
+
return;
|
|
382
|
+
c.value.enableTransition = !1;
|
|
383
|
+
const { offsetX: r, offsetY: s } = c.value, g = t.pageX, h = t.pageY, y = F.throttle((V) => {
|
|
384
|
+
c.value = {
|
|
385
|
+
...c.value,
|
|
386
|
+
offsetX: r + V.pageX - g,
|
|
387
|
+
offsetY: s + V.pageY - h
|
|
388
|
+
};
|
|
389
|
+
}), k = P(document, "mousemove", y);
|
|
390
|
+
P(document, "mouseup", () => {
|
|
391
|
+
k();
|
|
392
|
+
}), t.preventDefault();
|
|
393
|
+
}
|
|
394
|
+
function W() {
|
|
395
|
+
c.value = {
|
|
396
|
+
scale: 1,
|
|
397
|
+
deg: 0,
|
|
398
|
+
offsetX: 0,
|
|
399
|
+
offsetY: 0,
|
|
400
|
+
enableTransition: !1
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
function Z() {
|
|
404
|
+
if (m.value)
|
|
405
|
+
return;
|
|
406
|
+
const t = v(I), r = Object.values(I), s = B.value.name, h = ((r == null ? void 0 : r.findIndex((y) => y.name === s)) + 1) % t.length;
|
|
407
|
+
B.value = I[t[h]], W();
|
|
408
|
+
}
|
|
409
|
+
function Y(t) {
|
|
410
|
+
const r = i.urlList.length;
|
|
411
|
+
b.value = (t + r) % r;
|
|
412
|
+
}
|
|
413
|
+
function G() {
|
|
414
|
+
D.value && !i.infinite || Y(b.value - 1);
|
|
415
|
+
}
|
|
416
|
+
function K() {
|
|
417
|
+
j.value && !i.infinite || Y(b.value + 1);
|
|
418
|
+
}
|
|
419
|
+
function E(t, r = {}) {
|
|
420
|
+
if (m.value)
|
|
421
|
+
return;
|
|
422
|
+
const { minScale: s, maxScale: g } = i, { zoomRate: h, rotateDeg: y, enableTransition: k } = {
|
|
423
|
+
zoomRate: i.zoomRate,
|
|
424
|
+
rotateDeg: 90,
|
|
425
|
+
enableTransition: !0,
|
|
426
|
+
...r
|
|
427
|
+
};
|
|
428
|
+
switch (t) {
|
|
429
|
+
case "zoomOut":
|
|
430
|
+
c.value.scale > s && (c.value.scale = Number.parseFloat(
|
|
431
|
+
(c.value.scale / h).toFixed(3)
|
|
432
|
+
));
|
|
433
|
+
break;
|
|
434
|
+
case "zoomIn":
|
|
435
|
+
c.value.scale < g && (c.value.scale = Number.parseFloat(
|
|
436
|
+
(c.value.scale * h).toFixed(3)
|
|
437
|
+
));
|
|
438
|
+
break;
|
|
439
|
+
case "clockwise":
|
|
440
|
+
c.value.deg += y, C("rotate", c.value.deg);
|
|
441
|
+
break;
|
|
442
|
+
case "anticlockwise":
|
|
443
|
+
c.value.deg -= y, C("rotate", c.value.deg);
|
|
444
|
+
break;
|
|
445
|
+
}
|
|
446
|
+
c.value.enableTransition = k;
|
|
447
|
+
}
|
|
448
|
+
return Q(pe, () => {
|
|
449
|
+
Ce(() => {
|
|
450
|
+
const t = L.value[0];
|
|
451
|
+
t != null && t.complete || (m.value = !0);
|
|
452
|
+
});
|
|
453
|
+
}), Q(b, (t) => {
|
|
454
|
+
W(), C("switch", t);
|
|
455
|
+
}), Le(() => {
|
|
456
|
+
var t, r;
|
|
457
|
+
we(), (r = (t = d.value) == null ? void 0 : t.focus) == null || r.call(t);
|
|
458
|
+
}), n({
|
|
459
|
+
/**
|
|
460
|
+
* @description manually switch image
|
|
461
|
+
*/
|
|
462
|
+
setActiveItem: Y
|
|
463
|
+
}), (t, r) => (_(), ee(Ne, { to: "body" }, [
|
|
464
|
+
f(Ee, {
|
|
465
|
+
name: "viewer-fade",
|
|
466
|
+
appear: ""
|
|
467
|
+
}, {
|
|
468
|
+
default: O(() => [
|
|
469
|
+
u(
|
|
470
|
+
"div",
|
|
471
|
+
{
|
|
472
|
+
ref_key: "wrapper",
|
|
473
|
+
ref: d,
|
|
474
|
+
tabindex: -1,
|
|
475
|
+
class: w(o(l).e("wrapper")),
|
|
476
|
+
style: te({ zIndex: _e.value })
|
|
477
|
+
},
|
|
478
|
+
[
|
|
479
|
+
u(
|
|
480
|
+
"div",
|
|
481
|
+
{
|
|
482
|
+
class: w(o(l).e("mask")),
|
|
483
|
+
onClick: r[0] || (r[0] = Ae((s) => t.hideOnClickModal && X(), ["self"]))
|
|
484
|
+
},
|
|
485
|
+
null,
|
|
486
|
+
2
|
|
487
|
+
/* CLASS */
|
|
488
|
+
),
|
|
489
|
+
S(" CLOSE "),
|
|
490
|
+
u(
|
|
491
|
+
"span",
|
|
492
|
+
{
|
|
493
|
+
class: w([o(l).e("btn"), o(l).e("close")]),
|
|
494
|
+
onClick: X
|
|
495
|
+
},
|
|
496
|
+
[
|
|
497
|
+
f(o(z), null, {
|
|
498
|
+
default: O(() => [
|
|
499
|
+
f(o(nt))
|
|
500
|
+
]),
|
|
501
|
+
_: 1
|
|
502
|
+
/* STABLE */
|
|
503
|
+
})
|
|
504
|
+
],
|
|
505
|
+
2
|
|
506
|
+
/* CLASS */
|
|
507
|
+
),
|
|
508
|
+
S(" ARROW "),
|
|
509
|
+
ve.value ? S("v-if", !0) : (_(), p(
|
|
510
|
+
ae,
|
|
511
|
+
{ key: 0 },
|
|
512
|
+
[
|
|
513
|
+
u(
|
|
514
|
+
"span",
|
|
515
|
+
{
|
|
516
|
+
class: w(de.value),
|
|
517
|
+
onClick: G
|
|
518
|
+
},
|
|
519
|
+
[
|
|
520
|
+
f(o(z), null, {
|
|
521
|
+
default: O(() => [
|
|
522
|
+
f(o(Je))
|
|
523
|
+
]),
|
|
524
|
+
_: 1
|
|
525
|
+
/* STABLE */
|
|
526
|
+
})
|
|
527
|
+
],
|
|
528
|
+
2
|
|
529
|
+
/* CLASS */
|
|
530
|
+
),
|
|
531
|
+
u(
|
|
532
|
+
"span",
|
|
533
|
+
{
|
|
534
|
+
class: w(me.value),
|
|
535
|
+
onClick: K
|
|
536
|
+
},
|
|
537
|
+
[
|
|
538
|
+
f(o(z), null, {
|
|
539
|
+
default: O(() => [
|
|
540
|
+
f(o(tt))
|
|
541
|
+
]),
|
|
542
|
+
_: 1
|
|
543
|
+
/* STABLE */
|
|
544
|
+
})
|
|
545
|
+
],
|
|
546
|
+
2
|
|
547
|
+
/* CLASS */
|
|
548
|
+
)
|
|
549
|
+
],
|
|
550
|
+
64
|
|
551
|
+
/* STABLE_FRAGMENT */
|
|
552
|
+
)),
|
|
553
|
+
S(" ACTIONS "),
|
|
554
|
+
u(
|
|
555
|
+
"div",
|
|
556
|
+
{
|
|
557
|
+
class: w([o(l).e("btn"), o(l).e("actions")])
|
|
558
|
+
},
|
|
559
|
+
[
|
|
560
|
+
u(
|
|
561
|
+
"div",
|
|
562
|
+
{
|
|
563
|
+
class: w(o(l).e("actions__inner"))
|
|
564
|
+
},
|
|
565
|
+
[
|
|
566
|
+
f(o(z), {
|
|
567
|
+
onClick: r[1] || (r[1] = (s) => E("zoomOut"))
|
|
568
|
+
}, {
|
|
569
|
+
default: O(() => [
|
|
570
|
+
f(o(dt))
|
|
571
|
+
]),
|
|
572
|
+
_: 1
|
|
573
|
+
/* STABLE */
|
|
574
|
+
}),
|
|
575
|
+
f(o(z), {
|
|
576
|
+
onClick: r[2] || (r[2] = (s) => E("zoomIn"))
|
|
577
|
+
}, {
|
|
578
|
+
default: O(() => [
|
|
579
|
+
f(o(vt))
|
|
580
|
+
]),
|
|
581
|
+
_: 1
|
|
582
|
+
/* STABLE */
|
|
583
|
+
}),
|
|
584
|
+
u(
|
|
585
|
+
"i",
|
|
586
|
+
{
|
|
587
|
+
class: w(o(l).e("actions__divider"))
|
|
588
|
+
},
|
|
589
|
+
null,
|
|
590
|
+
2
|
|
591
|
+
/* CLASS */
|
|
592
|
+
),
|
|
593
|
+
f(o(z), { onClick: Z }, {
|
|
594
|
+
default: O(() => [
|
|
595
|
+
(_(), ee(Me(B.value.icon)))
|
|
596
|
+
]),
|
|
597
|
+
_: 1
|
|
598
|
+
/* STABLE */
|
|
599
|
+
}),
|
|
600
|
+
u(
|
|
601
|
+
"i",
|
|
602
|
+
{
|
|
603
|
+
class: w(o(l).e("actions__divider"))
|
|
604
|
+
},
|
|
605
|
+
null,
|
|
606
|
+
2
|
|
607
|
+
/* CLASS */
|
|
608
|
+
),
|
|
609
|
+
f(o(z), {
|
|
610
|
+
onClick: r[3] || (r[3] = (s) => E("anticlockwise"))
|
|
611
|
+
}, {
|
|
612
|
+
default: O(() => [
|
|
613
|
+
f(o(lt))
|
|
614
|
+
]),
|
|
615
|
+
_: 1
|
|
616
|
+
/* STABLE */
|
|
617
|
+
}),
|
|
618
|
+
f(o(z), {
|
|
619
|
+
onClick: r[4] || (r[4] = (s) => E("clockwise"))
|
|
620
|
+
}, {
|
|
621
|
+
default: O(() => [
|
|
622
|
+
f(o(it))
|
|
623
|
+
]),
|
|
624
|
+
_: 1
|
|
625
|
+
/* STABLE */
|
|
626
|
+
})
|
|
627
|
+
],
|
|
628
|
+
2
|
|
629
|
+
/* CLASS */
|
|
630
|
+
)
|
|
631
|
+
],
|
|
632
|
+
2
|
|
633
|
+
/* CLASS */
|
|
634
|
+
),
|
|
635
|
+
S(" CANVAS "),
|
|
636
|
+
u(
|
|
637
|
+
"div",
|
|
638
|
+
{
|
|
639
|
+
class: w(o(l).e("canvas"))
|
|
640
|
+
},
|
|
641
|
+
[
|
|
642
|
+
(_(!0), p(
|
|
643
|
+
ae,
|
|
644
|
+
null,
|
|
645
|
+
Te(t.urlList, (s, g) => Ve((_(), p("img", {
|
|
646
|
+
ref_for: !0,
|
|
647
|
+
ref: (h) => L.value[g] = h,
|
|
648
|
+
key: s,
|
|
649
|
+
src: s,
|
|
650
|
+
style: te(ge.value),
|
|
651
|
+
class: w(o(l).e("img")),
|
|
652
|
+
crossorigin: t.crossorigin,
|
|
653
|
+
onLoad: ye,
|
|
654
|
+
onError: xe,
|
|
655
|
+
onMousedown: Ie
|
|
656
|
+
}, null, 46, wt)), [
|
|
657
|
+
[Se, g === b.value]
|
|
658
|
+
])),
|
|
659
|
+
128
|
|
660
|
+
/* KEYED_FRAGMENT */
|
|
661
|
+
))
|
|
662
|
+
],
|
|
663
|
+
2
|
|
664
|
+
/* CLASS */
|
|
665
|
+
),
|
|
666
|
+
Re(t.$slots, "default")
|
|
667
|
+
],
|
|
668
|
+
6
|
|
669
|
+
/* CLASS, STYLE */
|
|
670
|
+
)
|
|
671
|
+
]),
|
|
672
|
+
_: 3
|
|
673
|
+
/* FORWARDED */
|
|
674
|
+
})
|
|
675
|
+
]));
|
|
676
|
+
}
|
|
677
|
+
}), Ot = Xe(ht);
|
|
678
|
+
export {
|
|
679
|
+
Ot as IkImageViewer,
|
|
680
|
+
Ot as default
|
|
681
|
+
};
|