@gx-design-vue/image 0.2.0-beta.29 → 0.2.0-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Image.d.ts +2 -1
- package/dist/ImagePreview/index.d.ts +2 -2
- package/dist/ImagePreview/props.d.ts +9 -9
- package/dist/ImagePreview/typings.d.ts +3 -2
- package/dist/image.js +437 -421
- package/dist/image.umd.cjs +12 -1
- package/dist/index.d.ts +4 -5
- package/dist/slots.d.ts +3 -0
- package/package.json +4 -4
package/dist/image.js
CHANGED
|
@@ -1,38 +1,164 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* Gx Design Pro
|
|
3
|
+
* Version: 0.2.0-beta.29
|
|
4
|
+
* Author: gx12358
|
|
5
|
+
* Copyright (C) 2024 gx12358
|
|
6
|
+
* License: MIT License
|
|
7
|
+
* Description: Gx Design Image
|
|
8
|
+
* Date Created: 2025-08-15
|
|
9
|
+
* Homepage:
|
|
10
|
+
* Contact: gx12358@gmail.com
|
|
11
|
+
*/
|
|
12
|
+
import { ref as $, defineComponent as Ce, createVNode as s, Teleport as De, Transition as pe, withDirectives as we, Fragment as ue, cloneVNode as ot, vShow as ye, toRef as H, reactive as it, computed as b, watch as J, onMounted as Re, onUnmounted as at, mergeProps as le, watchEffect as lt, nextTick as rt } from "vue";
|
|
13
|
+
import { CloseOutlined as st, LeftOutlined as ut, RightOutlined as ct, SwapOutlined as Me, ZoomOutOutlined as dt, ZoomInOutlined as ft, RotateRightOutlined as vt, RotateLeftOutlined as gt, EyeOutlined as mt } from "@ant-design/icons-vue";
|
|
14
|
+
import { getTransitionProps as Se, Keyframe as de, useStyle as ht, mergeToken as pt, unit as ee, FastColor as wt, useProStyle as yt } from "@gx-design-vue/pro-provider";
|
|
15
|
+
import { classNames as X, getPrefixCls as Ne, isNumber as Pe, getSlotVNode as Z, isArray as St, getSlot as re, isInContainer as Ct, isString as xt, getScrollContainer as It } from "@gx-design-vue/pro-utils";
|
|
16
|
+
import { useWindowSize as Xe, isClient as Q, useThrottleFn as bt, useEventListener as ze } from "@vueuse/core";
|
|
17
|
+
import { isEqual as Lt, cloneDeep as $t, omit as Ye, fromPairs as Mt } from "lodash-es";
|
|
18
|
+
import { useState as ne, useEffect as xe, useMergedState as zt } from "@gx-design-vue/pro-hooks";
|
|
19
|
+
import { TinyColor as F } from "@ctrl/tinycolor";
|
|
20
|
+
const te = {
|
|
21
|
+
infinite: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !0
|
|
24
|
+
},
|
|
25
|
+
zIndex: {
|
|
26
|
+
type: Number,
|
|
27
|
+
default: 2e3
|
|
28
|
+
},
|
|
29
|
+
current: {
|
|
30
|
+
type: Number,
|
|
31
|
+
default: 0
|
|
32
|
+
},
|
|
33
|
+
getContainer: {
|
|
34
|
+
type: String
|
|
35
|
+
}
|
|
36
|
+
}, je = {
|
|
37
|
+
preview: {
|
|
38
|
+
type: [Object, Boolean],
|
|
39
|
+
default: !0
|
|
40
|
+
},
|
|
41
|
+
src: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: ""
|
|
44
|
+
},
|
|
45
|
+
alt: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: ""
|
|
48
|
+
},
|
|
49
|
+
loading: {
|
|
50
|
+
type: String
|
|
51
|
+
},
|
|
52
|
+
fit: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: "contain"
|
|
55
|
+
},
|
|
56
|
+
crossOrigin: {
|
|
57
|
+
type: String
|
|
58
|
+
},
|
|
59
|
+
lazy: Boolean,
|
|
60
|
+
scrollContainer: {
|
|
61
|
+
type: [String, Object]
|
|
62
|
+
},
|
|
63
|
+
placeholder: {
|
|
64
|
+
type: [Function, Object, Boolean],
|
|
65
|
+
default: () => {
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
fallback: {
|
|
69
|
+
type: [Function, Object],
|
|
70
|
+
default: () => {
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
onLoad: {
|
|
74
|
+
type: Function
|
|
75
|
+
},
|
|
76
|
+
onError: {
|
|
77
|
+
type: Function
|
|
78
|
+
},
|
|
79
|
+
onClick: {
|
|
80
|
+
type: Function
|
|
81
|
+
},
|
|
82
|
+
imageStyle: {
|
|
83
|
+
type: Object,
|
|
84
|
+
default: () => ({})
|
|
85
|
+
},
|
|
86
|
+
imageClass: String,
|
|
87
|
+
size: Number,
|
|
88
|
+
width: Number,
|
|
89
|
+
height: Number,
|
|
90
|
+
zIndex: te.zIndex,
|
|
91
|
+
getContainer: te.getContainer
|
|
92
|
+
}, G = {
|
|
93
|
+
urls: {
|
|
94
|
+
type: Array,
|
|
95
|
+
default: () => []
|
|
96
|
+
},
|
|
97
|
+
open: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
default: !1
|
|
100
|
+
},
|
|
101
|
+
scaleStep: {
|
|
102
|
+
type: Number,
|
|
103
|
+
default: 0.5
|
|
104
|
+
},
|
|
105
|
+
minScale: {
|
|
106
|
+
type: Number,
|
|
107
|
+
default: 0.32
|
|
108
|
+
},
|
|
109
|
+
maxScale: {
|
|
110
|
+
type: Number,
|
|
111
|
+
default: 32
|
|
112
|
+
},
|
|
113
|
+
movable: {
|
|
114
|
+
type: Boolean,
|
|
115
|
+
default: !0
|
|
116
|
+
},
|
|
117
|
+
disabled: Boolean,
|
|
118
|
+
zIndex: te.zIndex,
|
|
119
|
+
current: te.current,
|
|
120
|
+
infinite: te.infinite,
|
|
121
|
+
getContainer: je.getContainer,
|
|
122
|
+
onHideOnClickModal: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: !0
|
|
125
|
+
},
|
|
126
|
+
countRender: [Function, Array, Object],
|
|
127
|
+
icons: {
|
|
128
|
+
type: Object,
|
|
129
|
+
default: () => ({})
|
|
130
|
+
},
|
|
131
|
+
onTransform: Function,
|
|
132
|
+
onOpenChange: Function,
|
|
133
|
+
"onUpdate:open": Function
|
|
134
|
+
};
|
|
135
|
+
let Be = (e) => setTimeout(e, 16), Fe = (e) => clearTimeout(e);
|
|
136
|
+
typeof window < "u" && "requestAnimationFrame" in window && (Be = (e) => window.requestAnimationFrame(e), Fe = (e) => window.cancelAnimationFrame(e));
|
|
137
|
+
let Oe = 0;
|
|
138
|
+
const Ie = /* @__PURE__ */ new Map();
|
|
139
|
+
function ke(e) {
|
|
140
|
+
Ie.delete(e);
|
|
15
141
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
const o =
|
|
142
|
+
function He(e, t = 1) {
|
|
143
|
+
Oe += 1;
|
|
144
|
+
const o = Oe;
|
|
19
145
|
function i(n) {
|
|
20
146
|
if (n === 0)
|
|
21
|
-
|
|
147
|
+
ke(o), e();
|
|
22
148
|
else {
|
|
23
|
-
const r =
|
|
149
|
+
const r = Be(() => {
|
|
24
150
|
i(n - 1);
|
|
25
151
|
});
|
|
26
|
-
|
|
152
|
+
Ie.set(o, r);
|
|
27
153
|
}
|
|
28
154
|
}
|
|
29
155
|
return i(t), o;
|
|
30
156
|
}
|
|
31
|
-
|
|
32
|
-
const t =
|
|
33
|
-
return
|
|
157
|
+
He.cancel = (e) => {
|
|
158
|
+
const t = Ie.get(e);
|
|
159
|
+
return ke(t), Fe(t);
|
|
34
160
|
};
|
|
35
|
-
const
|
|
161
|
+
const ae = {
|
|
36
162
|
x: 0,
|
|
37
163
|
y: 0,
|
|
38
164
|
rotate: 0,
|
|
@@ -40,12 +166,12 @@ const ie = {
|
|
|
40
166
|
flipX: !1,
|
|
41
167
|
flipY: !1
|
|
42
168
|
};
|
|
43
|
-
function
|
|
44
|
-
const n = $(null), r = $([]), [c, p] = ne(
|
|
45
|
-
p(
|
|
169
|
+
function Ot(e, t, o, i) {
|
|
170
|
+
const n = $(null), r = $([]), [c, p] = ne(ae), v = (m) => {
|
|
171
|
+
p(ae), Lt(ae, c.value) || i?.({ transform: ae, action: m });
|
|
46
172
|
}, d = (m, C) => {
|
|
47
|
-
n.value === null && (r.value = [], n.value =
|
|
48
|
-
let x =
|
|
173
|
+
n.value === null && (r.value = [], n.value = He(() => {
|
|
174
|
+
let x = $t(c.value);
|
|
49
175
|
r.value.forEach((a) => {
|
|
50
176
|
x = { ...x, ...a };
|
|
51
177
|
}), n.value = null, i?.({ transform: x, action: C }), p(x);
|
|
@@ -56,17 +182,17 @@ function Et(e, t, o, i) {
|
|
|
56
182
|
};
|
|
57
183
|
return {
|
|
58
184
|
transform: c,
|
|
59
|
-
resetTransform:
|
|
185
|
+
resetTransform: v,
|
|
60
186
|
updateTransform: d,
|
|
61
187
|
dispatchZoomChange: (m, C, x, a, l) => {
|
|
62
|
-
const { width: w, height: h, offsetWidth: y, offsetHeight: S, offsetLeft: L, offsetTop:
|
|
188
|
+
const { width: w, height: h, offsetWidth: y, offsetHeight: S, offsetLeft: L, offsetTop: T } = e.value;
|
|
63
189
|
let M = m, I = c.value.scale * m;
|
|
64
190
|
I > o.value ? (I = o.value, M = o.value / c.value.scale) : I < t.value && (I = l ? I : t.value, M = I / c.value.scale);
|
|
65
|
-
const
|
|
191
|
+
const k = x ?? innerWidth / 2, W = a ?? innerHeight / 2, R = M - 1, z = R * w * 0.5, N = R * h * 0.5, Y = R * (k - c.value.x - L), _ = R * (W - c.value.y - T);
|
|
66
192
|
let j = c.value.x - (Y - z), B = c.value.y - (_ - N);
|
|
67
193
|
if (m < 1 && I === 1) {
|
|
68
|
-
const
|
|
69
|
-
|
|
194
|
+
const A = y * I, f = S * I, { width: P, height: E } = Xe();
|
|
195
|
+
A <= P.value && f <= E.value && (j = 0, B = 0);
|
|
70
196
|
}
|
|
71
197
|
d({
|
|
72
198
|
x: j,
|
|
@@ -76,23 +202,23 @@ function Et(e, t, o, i) {
|
|
|
76
202
|
}
|
|
77
203
|
};
|
|
78
204
|
}
|
|
79
|
-
function
|
|
205
|
+
function Tt(e, t) {
|
|
80
206
|
process.env.NODE_ENV !== "production" && console !== void 0 && console.error(`Warning: ${t}`);
|
|
81
207
|
}
|
|
82
|
-
let
|
|
208
|
+
let Ze = !1;
|
|
83
209
|
try {
|
|
84
210
|
const e = Object.defineProperty({}, "passive", {
|
|
85
211
|
get() {
|
|
86
|
-
|
|
212
|
+
Ze = !0;
|
|
87
213
|
}
|
|
88
214
|
});
|
|
89
215
|
window.addEventListener("testPassive", null, e), window.removeEventListener("testPassive", null, e);
|
|
90
216
|
} catch {
|
|
91
217
|
}
|
|
92
|
-
function
|
|
218
|
+
function V(e, t, o, i) {
|
|
93
219
|
if (e && e.addEventListener) {
|
|
94
220
|
let n = i;
|
|
95
|
-
n === void 0 &&
|
|
221
|
+
n === void 0 && Ze && (t === "touchstart" || t === "touchmove" || t === "wheel") && (n = { passive: !1 }), e.addEventListener(t, o, n);
|
|
96
222
|
}
|
|
97
223
|
return {
|
|
98
224
|
remove: () => {
|
|
@@ -100,8 +226,8 @@ function q(e, t, o, i) {
|
|
|
100
226
|
}
|
|
101
227
|
};
|
|
102
228
|
}
|
|
103
|
-
const
|
|
104
|
-
function
|
|
229
|
+
const q = 1, At = 1;
|
|
230
|
+
function Te(e, t, o, i) {
|
|
105
231
|
const n = t + o, r = (o - i) / 2;
|
|
106
232
|
if (o > i) {
|
|
107
233
|
if (t > 0)
|
|
@@ -118,30 +244,30 @@ function ze(e, t, o, i) {
|
|
|
118
244
|
};
|
|
119
245
|
return {};
|
|
120
246
|
}
|
|
121
|
-
function
|
|
122
|
-
const { width: n, height: r } =
|
|
247
|
+
function We(e, t, o, i) {
|
|
248
|
+
const { width: n, height: r } = Xe();
|
|
123
249
|
let c = null;
|
|
124
250
|
return e <= n.value && t <= r.value ? c = {
|
|
125
251
|
x: 0,
|
|
126
252
|
y: 0
|
|
127
253
|
} : (e > n.value || t > r.value) && (c = {
|
|
128
|
-
...
|
|
129
|
-
...
|
|
254
|
+
...Te("x", o, e, n.value),
|
|
255
|
+
...Te("y", i, t, r.value)
|
|
130
256
|
}), c;
|
|
131
257
|
}
|
|
132
|
-
function
|
|
133
|
-
const [p,
|
|
258
|
+
function Et(e, t, o, i, n, r, c) {
|
|
259
|
+
const [p, v] = ne(!1), d = $({
|
|
134
260
|
diffX: 0,
|
|
135
261
|
diffY: 0,
|
|
136
262
|
transformX: 0,
|
|
137
263
|
transformY: 0
|
|
138
|
-
}),
|
|
264
|
+
}), g = (a) => {
|
|
139
265
|
!t || a.button !== 0 || (a.preventDefault(), a.stopPropagation(), d.value = {
|
|
140
266
|
diffX: a.pageX - n.value.x,
|
|
141
267
|
diffY: a.pageY - n.value.y,
|
|
142
268
|
transformX: n.value.x,
|
|
143
269
|
transformY: n.value.y
|
|
144
|
-
},
|
|
270
|
+
}, v(!0));
|
|
145
271
|
}, m = (a) => {
|
|
146
272
|
o && p.value && r({
|
|
147
273
|
x: a.pageX - d.value.diffX,
|
|
@@ -149,28 +275,28 @@ function Nt(e, t, o, i, n, r, c) {
|
|
|
149
275
|
}, "move");
|
|
150
276
|
}, C = () => {
|
|
151
277
|
if (o && p.value) {
|
|
152
|
-
|
|
278
|
+
v(!1);
|
|
153
279
|
const { transformX: a, transformY: l } = d.value;
|
|
154
280
|
if (!(n.value.x !== a && n.value.y !== l))
|
|
155
281
|
return;
|
|
156
|
-
const h = e.value.offsetWidth * n.value.scale, y = e.value.offsetHeight * n.value.scale, { left: S, top: L } = e.value.getBoundingClientRect(),
|
|
282
|
+
const h = e.value.offsetWidth * n.value.scale, y = e.value.offsetHeight * n.value.scale, { left: S, top: L } = e.value.getBoundingClientRect(), T = n.value.rotate % 180 !== 0, M = We(T ? y : h, T ? h : y, S, L);
|
|
157
283
|
M && r({ ...M }, "dragRebound");
|
|
158
284
|
}
|
|
159
285
|
}, x = (a) => {
|
|
160
286
|
if (!o || a.deltaY === 0)
|
|
161
287
|
return;
|
|
162
|
-
const l = Math.abs(a.deltaY / 100), w = Math.min(l,
|
|
163
|
-
let h =
|
|
164
|
-
a.deltaY > 0 && (h =
|
|
288
|
+
const l = Math.abs(a.deltaY / 100), w = Math.min(l, At);
|
|
289
|
+
let h = q + w * i.value;
|
|
290
|
+
a.deltaY > 0 && (h = q / h), c(h, "wheel", a.clientX, a.clientY);
|
|
165
291
|
};
|
|
166
|
-
return
|
|
292
|
+
return xe(() => {
|
|
167
293
|
let a, l, w, h;
|
|
168
294
|
if (t) {
|
|
169
|
-
w =
|
|
295
|
+
w = V(window, "mouseup", C, !1), h = V(window, "mousemove", m, !1);
|
|
170
296
|
try {
|
|
171
|
-
window.top !== window.self && (a =
|
|
297
|
+
window.top !== window.self && (a = V(window.top, "mouseup", C, !1), l = V(window.top, "mousemove", m, !1));
|
|
172
298
|
} catch (y) {
|
|
173
|
-
|
|
299
|
+
Tt(!1, `[rc-image] ${y}`);
|
|
174
300
|
}
|
|
175
301
|
}
|
|
176
302
|
return () => {
|
|
@@ -178,29 +304,29 @@ function Nt(e, t, o, i, n, r, c) {
|
|
|
178
304
|
};
|
|
179
305
|
}, [o, p, () => n.value.x, () => n.value.y, () => n.value.rotate, t]), {
|
|
180
306
|
isMoving: p,
|
|
181
|
-
onMouseDown:
|
|
307
|
+
onMouseDown: g,
|
|
182
308
|
onMouseMove: m,
|
|
183
309
|
onMouseUp: C,
|
|
184
310
|
onWheel: x
|
|
185
311
|
};
|
|
186
312
|
}
|
|
187
|
-
function
|
|
313
|
+
function ce(e, t) {
|
|
188
314
|
const o = e.x - t.x, i = e.y - t.y;
|
|
189
315
|
return Math.hypot(o, i);
|
|
190
316
|
}
|
|
191
|
-
function
|
|
192
|
-
const n =
|
|
317
|
+
function Dt(e, t, o, i) {
|
|
318
|
+
const n = ce(e, o), r = ce(t, i);
|
|
193
319
|
if (n === 0 && r === 0)
|
|
194
320
|
return [e.x, e.y];
|
|
195
|
-
const c = n / (n + r), p = e.x + c * (t.x - e.x),
|
|
196
|
-
return [p,
|
|
321
|
+
const c = n / (n + r), p = e.x + c * (t.x - e.x), v = e.y + c * (t.y - e.y);
|
|
322
|
+
return [p, v];
|
|
197
323
|
}
|
|
198
|
-
function
|
|
199
|
-
const [p,
|
|
324
|
+
function Rt(e, t, o, i, n, r, c) {
|
|
325
|
+
const [p, v] = ne(!1), d = $({
|
|
200
326
|
point1: { x: 0, y: 0 },
|
|
201
327
|
point2: { x: 0, y: 0 },
|
|
202
328
|
eventType: "none"
|
|
203
|
-
}),
|
|
329
|
+
}), g = (a) => {
|
|
204
330
|
d.value = {
|
|
205
331
|
...d.value,
|
|
206
332
|
...a
|
|
@@ -208,13 +334,13 @@ function Xt(e, t, o, i, n, r, c) {
|
|
|
208
334
|
}, m = (a) => {
|
|
209
335
|
if (!t.value)
|
|
210
336
|
return;
|
|
211
|
-
a.stopPropagation(),
|
|
337
|
+
a.stopPropagation(), v(!0);
|
|
212
338
|
const { touches: l = [] } = a;
|
|
213
|
-
l.length > 1 ?
|
|
339
|
+
l.length > 1 ? g({
|
|
214
340
|
point1: { x: l[0].clientX, y: l[0].clientY },
|
|
215
341
|
point2: { x: l[1].clientX, y: l[1].clientY },
|
|
216
342
|
eventType: "touchZoom"
|
|
217
|
-
}) :
|
|
343
|
+
}) : g({
|
|
218
344
|
point1: {
|
|
219
345
|
x: l[0].clientX - n.value.x,
|
|
220
346
|
y: l[0].clientY - n.value.y
|
|
@@ -230,8 +356,8 @@ function Xt(e, t, o, i, n, r, c) {
|
|
|
230
356
|
}, L = {
|
|
231
357
|
x: l[1].clientX,
|
|
232
358
|
y: l[1].clientY
|
|
233
|
-
}, [
|
|
234
|
-
c(I, "touchZoom",
|
|
359
|
+
}, [T, M] = Dt(w, h, S, L), I = ce(S, L) / ce(w, h);
|
|
360
|
+
c(I, "touchZoom", T, M, !0), g({
|
|
235
361
|
point1: S,
|
|
236
362
|
point2: L,
|
|
237
363
|
eventType: "touchZoom"
|
|
@@ -239,18 +365,18 @@ function Xt(e, t, o, i, n, r, c) {
|
|
|
239
365
|
} else y === "move" && (r({
|
|
240
366
|
x: l[0].clientX - w.x,
|
|
241
367
|
y: l[0].clientY - w.y
|
|
242
|
-
}, "move"),
|
|
368
|
+
}, "move"), g({ eventType: "move" }));
|
|
243
369
|
}, x = () => {
|
|
244
370
|
if (!o.value)
|
|
245
371
|
return;
|
|
246
|
-
if (p &&
|
|
372
|
+
if (p && v(!1), g({ eventType: "none" }), i.value > n.value.scale)
|
|
247
373
|
return r({ x: 0, y: 0, scale: i.value }, "touchZoom");
|
|
248
|
-
const a = e.value.offsetWidth * n.value.scale, l = e.value.offsetHeight * n.value.scale, { left: w, top: h } = e.value.getBoundingClientRect(), y = n.value.rotate % 180 !== 0, S =
|
|
374
|
+
const a = e.value.offsetWidth * n.value.scale, l = e.value.offsetHeight * n.value.scale, { left: w, top: h } = e.value.getBoundingClientRect(), y = n.value.rotate % 180 !== 0, S = We(y ? l : a, y ? a : l, w, h);
|
|
249
375
|
S && r({ ...S }, "dragRebound");
|
|
250
376
|
};
|
|
251
|
-
return
|
|
377
|
+
return xe(() => {
|
|
252
378
|
let a;
|
|
253
|
-
return o.value && t.value && (a =
|
|
379
|
+
return o.value && t.value && (a = V(window, "touchmove", (l) => l.preventDefault(), {
|
|
254
380
|
passive: !1
|
|
255
381
|
})), () => {
|
|
256
382
|
a?.remove();
|
|
@@ -262,121 +388,7 @@ function Xt(e, t, o, i, n, r, c) {
|
|
|
262
388
|
onTouchEnd: x
|
|
263
389
|
};
|
|
264
390
|
}
|
|
265
|
-
const
|
|
266
|
-
infinite: {
|
|
267
|
-
type: Boolean,
|
|
268
|
-
default: !0
|
|
269
|
-
},
|
|
270
|
-
zIndex: {
|
|
271
|
-
type: Number,
|
|
272
|
-
default: 2e3
|
|
273
|
-
},
|
|
274
|
-
current: {
|
|
275
|
-
type: Number,
|
|
276
|
-
default: 0
|
|
277
|
-
},
|
|
278
|
-
getContainer: {
|
|
279
|
-
type: String
|
|
280
|
-
}
|
|
281
|
-
}, Ze = {
|
|
282
|
-
preview: {
|
|
283
|
-
type: [Object, Boolean],
|
|
284
|
-
default: !0
|
|
285
|
-
},
|
|
286
|
-
src: {
|
|
287
|
-
type: String,
|
|
288
|
-
default: ""
|
|
289
|
-
},
|
|
290
|
-
alt: {
|
|
291
|
-
type: String,
|
|
292
|
-
default: ""
|
|
293
|
-
},
|
|
294
|
-
loading: {
|
|
295
|
-
type: String
|
|
296
|
-
},
|
|
297
|
-
fit: {
|
|
298
|
-
type: String,
|
|
299
|
-
default: "contain"
|
|
300
|
-
},
|
|
301
|
-
crossOrigin: {
|
|
302
|
-
type: String
|
|
303
|
-
},
|
|
304
|
-
lazy: Boolean,
|
|
305
|
-
scrollContainer: {
|
|
306
|
-
type: [String, Object]
|
|
307
|
-
},
|
|
308
|
-
placeholder: {
|
|
309
|
-
type: [Function, Object, Boolean],
|
|
310
|
-
default: () => {
|
|
311
|
-
}
|
|
312
|
-
},
|
|
313
|
-
fallback: {
|
|
314
|
-
type: [Function, Object],
|
|
315
|
-
default: () => {
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
onLoad: {
|
|
319
|
-
type: Function
|
|
320
|
-
},
|
|
321
|
-
onError: {
|
|
322
|
-
type: Function
|
|
323
|
-
},
|
|
324
|
-
onClick: {
|
|
325
|
-
type: Function
|
|
326
|
-
},
|
|
327
|
-
imageStyle: {
|
|
328
|
-
type: Object,
|
|
329
|
-
default: () => ({})
|
|
330
|
-
},
|
|
331
|
-
imageClass: String,
|
|
332
|
-
size: Number,
|
|
333
|
-
width: Number,
|
|
334
|
-
height: Number,
|
|
335
|
-
zIndex: te.zIndex,
|
|
336
|
-
getContainer: te.getContainer
|
|
337
|
-
}, V = {
|
|
338
|
-
urls: {
|
|
339
|
-
type: Array,
|
|
340
|
-
default: () => []
|
|
341
|
-
},
|
|
342
|
-
open: {
|
|
343
|
-
type: Boolean,
|
|
344
|
-
default: !1
|
|
345
|
-
},
|
|
346
|
-
scaleStep: {
|
|
347
|
-
type: Number,
|
|
348
|
-
default: 0.5
|
|
349
|
-
},
|
|
350
|
-
minScale: {
|
|
351
|
-
type: Number,
|
|
352
|
-
default: 0.32
|
|
353
|
-
},
|
|
354
|
-
maxScale: {
|
|
355
|
-
type: Number,
|
|
356
|
-
default: 32
|
|
357
|
-
},
|
|
358
|
-
movable: {
|
|
359
|
-
type: Boolean,
|
|
360
|
-
default: !0
|
|
361
|
-
},
|
|
362
|
-
disabled: Boolean,
|
|
363
|
-
zIndex: te.zIndex,
|
|
364
|
-
current: te.current,
|
|
365
|
-
infinite: te.infinite,
|
|
366
|
-
getContainer: Ze.getContainer,
|
|
367
|
-
onHideOnClickModal: {
|
|
368
|
-
type: Boolean,
|
|
369
|
-
default: !0
|
|
370
|
-
},
|
|
371
|
-
countRender: [Function, Array, Object],
|
|
372
|
-
icons: {
|
|
373
|
-
type: Object,
|
|
374
|
-
default: () => ({})
|
|
375
|
-
},
|
|
376
|
-
onTransform: Function,
|
|
377
|
-
onOpenChange: Function,
|
|
378
|
-
"onUpdate:open": Function
|
|
379
|
-
}, Yt = /* @__PURE__ */ ye({
|
|
391
|
+
const Nt = /* @__PURE__ */ Ce({
|
|
380
392
|
name: "Operations",
|
|
381
393
|
inheritAttrs: !1,
|
|
382
394
|
props: {
|
|
@@ -393,11 +405,11 @@ const te = {
|
|
|
393
405
|
showProgress: Boolean,
|
|
394
406
|
prefixCls: String,
|
|
395
407
|
hashId: String,
|
|
396
|
-
zIndex:
|
|
397
|
-
icons:
|
|
398
|
-
infinite:
|
|
399
|
-
getContainer:
|
|
400
|
-
countRender:
|
|
408
|
+
zIndex: G.zIndex,
|
|
409
|
+
icons: G.icons,
|
|
410
|
+
infinite: G.infinite,
|
|
411
|
+
getContainer: G.getContainer,
|
|
412
|
+
countRender: G.countRender,
|
|
401
413
|
tools: Array,
|
|
402
414
|
onClose: Function,
|
|
403
415
|
onActive: Function
|
|
@@ -411,12 +423,12 @@ const te = {
|
|
|
411
423
|
prefixCls: o,
|
|
412
424
|
hashId: i,
|
|
413
425
|
tools: n
|
|
414
|
-
} = e, r =
|
|
415
|
-
return s(
|
|
426
|
+
} = e, r = Se(`${e.prefixCls}-fade`), c = `${o}-operations-operation`, p = `${o}-operations-icon`;
|
|
427
|
+
return s(De, {
|
|
416
428
|
to: e.getContainer || "body"
|
|
417
429
|
}, {
|
|
418
|
-
default: () => [s(
|
|
419
|
-
default: () => [
|
|
430
|
+
default: () => [s(pe, r, {
|
|
431
|
+
default: () => [we(s("div", {
|
|
420
432
|
class: X(`${o}-operations-wrapper`, i),
|
|
421
433
|
style: {
|
|
422
434
|
zIndex: e.zIndex
|
|
@@ -424,55 +436,55 @@ const te = {
|
|
|
424
436
|
}, [e.icons?.close === null ? null : s("button", {
|
|
425
437
|
class: `${o}-close ${i}`,
|
|
426
438
|
onClick: e.onClose
|
|
427
|
-
}, [e.icons?.close || s(
|
|
439
|
+
}, [e.icons?.close || s(st, null, null)]), e.showSwitch && s(ue, null, [s("div", {
|
|
428
440
|
class: X(`${o}-switch-left ${i}`, {
|
|
429
441
|
[`${o}-switch-left-disabled`]: e.infinite ? !1 : e.current === 0
|
|
430
442
|
}),
|
|
431
|
-
onClick: (
|
|
432
|
-
}, [e.icons?.left || s(
|
|
443
|
+
onClick: (v) => t(v, -1)
|
|
444
|
+
}, [e.icons?.left || s(ut, null, null)]), s("div", {
|
|
433
445
|
class: X(`${o}-switch-right ${i}`, {
|
|
434
446
|
[`${o}-switch-right-disabled`]: e.infinite ? !1 : e.current === e.count - 1
|
|
435
447
|
}),
|
|
436
|
-
onClick: (
|
|
437
|
-
}, [e.icons?.right || s(
|
|
448
|
+
onClick: (v) => t(v, 1)
|
|
449
|
+
}, [e.icons?.right || s(ct, null, null)])]), s("div", {
|
|
438
450
|
class: `${o}-footer ${i}`
|
|
439
451
|
}, [e.showProgress && s("div", {
|
|
440
452
|
class: `${o}-progress`
|
|
441
453
|
}, [e.countRender ? e.countRender(e.current + 1, e.count) : `${e.current + 1} / ${e.count}`]), s("div", {
|
|
442
454
|
class: `${e.prefixCls}-operations`
|
|
443
455
|
}, [n?.map(({
|
|
444
|
-
icon:
|
|
456
|
+
icon: v,
|
|
445
457
|
onClick: d,
|
|
446
|
-
type:
|
|
458
|
+
type: g,
|
|
447
459
|
disabled: m
|
|
448
460
|
}) => s("div", {
|
|
449
461
|
class: X(c, {
|
|
450
462
|
[`${e.prefixCls}-operations-operation-disabled`]: m && m?.value
|
|
451
463
|
}),
|
|
452
464
|
onClick: d,
|
|
453
|
-
key:
|
|
454
|
-
}, [
|
|
465
|
+
key: g
|
|
466
|
+
}, [ot(v, {
|
|
455
467
|
class: p
|
|
456
|
-
})]))])])]), [[
|
|
468
|
+
})]))])])]), [[ye, e.open]])]
|
|
457
469
|
})]
|
|
458
470
|
});
|
|
459
471
|
};
|
|
460
472
|
}
|
|
461
|
-
}),
|
|
473
|
+
}), Pt = new de("viewFadeIn", {
|
|
462
474
|
"0%": {
|
|
463
475
|
opacity: 0
|
|
464
476
|
},
|
|
465
477
|
"100%": {
|
|
466
478
|
opacity: 1
|
|
467
479
|
}
|
|
468
|
-
}),
|
|
480
|
+
}), Xt = new de("viewFadeOut", {
|
|
469
481
|
"0%": {
|
|
470
482
|
opacity: 1
|
|
471
483
|
},
|
|
472
484
|
"100%": {
|
|
473
485
|
opacity: 0
|
|
474
486
|
}
|
|
475
|
-
}),
|
|
487
|
+
}), Yt = new de("viewZoomBadgeIn", {
|
|
476
488
|
"0%": {
|
|
477
489
|
transform: "scale(0)",
|
|
478
490
|
opacity: 0
|
|
@@ -481,7 +493,7 @@ const te = {
|
|
|
481
493
|
transform: "scale(1)",
|
|
482
494
|
opacity: 1
|
|
483
495
|
}
|
|
484
|
-
}),
|
|
496
|
+
}), jt = new de("viewZoomBadgeOut", {
|
|
485
497
|
"0%": {
|
|
486
498
|
transform: "scale(1)"
|
|
487
499
|
},
|
|
@@ -489,11 +501,11 @@ const te = {
|
|
|
489
501
|
transform: "scale(0)",
|
|
490
502
|
opacity: 0
|
|
491
503
|
}
|
|
492
|
-
}),
|
|
504
|
+
}), Ae = (e) => ({
|
|
493
505
|
position: e || "absolute",
|
|
494
506
|
inset: 0
|
|
495
507
|
});
|
|
496
|
-
function
|
|
508
|
+
function ge(e) {
|
|
497
509
|
return {
|
|
498
510
|
position: e,
|
|
499
511
|
top: 0,
|
|
@@ -502,8 +514,8 @@ function fe(e) {
|
|
|
502
514
|
insetInlineStart: 0
|
|
503
515
|
};
|
|
504
516
|
}
|
|
505
|
-
const
|
|
506
|
-
const { previewCls: t, modalMaskBg: o, marginXL: i, margin: n, colorTextLightSolid: r, previewOperationColorDisabled: c, previewOperationHoverColor: p, motionDurationSlow:
|
|
517
|
+
const Bt = (e) => {
|
|
518
|
+
const { previewCls: t, modalMaskBg: o, marginXL: i, margin: n, colorTextLightSolid: r, previewOperationColorDisabled: c, previewOperationHoverColor: p, motionDurationSlow: v, iconCls: d } = e, g = new F(o).setAlpha(0.1), m = g.clone().setAlpha(0.2), C = new F(o).setAlpha(0.5), x = new F(o).setAlpha(0.03);
|
|
507
519
|
return {
|
|
508
520
|
[`${t}-footer`]: {
|
|
509
521
|
position: "fixed",
|
|
@@ -532,7 +544,7 @@ const Ht = (e) => {
|
|
|
532
544
|
alignItems: "center",
|
|
533
545
|
justifyContent: "center",
|
|
534
546
|
color: r,
|
|
535
|
-
backgroundColor:
|
|
547
|
+
backgroundColor: g.toRgbString(),
|
|
536
548
|
borderRadius: e.borderRadiusLG,
|
|
537
549
|
backdropFilter: "saturate(180%) blur(10px)",
|
|
538
550
|
width: e.sizeXL,
|
|
@@ -540,7 +552,7 @@ const Ht = (e) => {
|
|
|
540
552
|
outline: 0,
|
|
541
553
|
border: 0,
|
|
542
554
|
cursor: "pointer",
|
|
543
|
-
transition: `all ${
|
|
555
|
+
transition: `all ${v}`,
|
|
544
556
|
"&:hover": {
|
|
545
557
|
backgroundColor: m.toRgbString()
|
|
546
558
|
},
|
|
@@ -553,9 +565,10 @@ const Ht = (e) => {
|
|
|
553
565
|
alignItems: "center",
|
|
554
566
|
gap: e.sizeXXS,
|
|
555
567
|
padding: e.paddingXXS,
|
|
556
|
-
|
|
568
|
+
border: `1px solid ${e.colorBorderSecondary}`,
|
|
569
|
+
backgroundColor: C.toRgbString(),
|
|
557
570
|
borderRadius: e.borderRadiusLG,
|
|
558
|
-
backdropFilter: "saturate(
|
|
571
|
+
backdropFilter: "saturate(150%) blur(10px)",
|
|
559
572
|
"&-operation": {
|
|
560
573
|
display: "flex",
|
|
561
574
|
alignItems: "center",
|
|
@@ -565,13 +578,13 @@ const Ht = (e) => {
|
|
|
565
578
|
cursor: "pointer",
|
|
566
579
|
color: r,
|
|
567
580
|
borderRadius: e.borderRadiusSM,
|
|
568
|
-
transition: `all ${
|
|
581
|
+
transition: `all ${v}`,
|
|
569
582
|
userSelect: "none",
|
|
570
583
|
[`&:not(${t}-operations-operation-disabled):hover > ${d}`]: {
|
|
571
584
|
color: p
|
|
572
585
|
},
|
|
573
586
|
"&:hover": {
|
|
574
|
-
backgroundColor:
|
|
587
|
+
backgroundColor: x.toRgbString()
|
|
575
588
|
},
|
|
576
589
|
"&-disabled": {
|
|
577
590
|
color: c,
|
|
@@ -586,8 +599,8 @@ const Ht = (e) => {
|
|
|
586
599
|
}
|
|
587
600
|
}
|
|
588
601
|
};
|
|
589
|
-
},
|
|
590
|
-
const { modalMaskBg: t, iconCls: o, previewOperationColorDisabled: i, previewCls: n, zIndexPopup: r, motionDurationSlow: c, colorTextLightSolid: p } = e,
|
|
602
|
+
}, Ft = (e) => {
|
|
603
|
+
const { modalMaskBg: t, iconCls: o, previewOperationColorDisabled: i, previewCls: n, zIndexPopup: r, motionDurationSlow: c, colorTextLightSolid: p } = e, v = new F(t).setAlpha(0.1), d = v.clone().setAlpha(0.2);
|
|
591
604
|
return {
|
|
592
605
|
[`${n}-switch-left, ${n}-switch-right`]: {
|
|
593
606
|
position: "fixed",
|
|
@@ -602,7 +615,7 @@ const Ht = (e) => {
|
|
|
602
615
|
height: e.imagePreviewSwitchSize,
|
|
603
616
|
marginTop: e.calc(e.imagePreviewSwitchSize).mul(-1).div(2).equal(),
|
|
604
617
|
color: p,
|
|
605
|
-
background:
|
|
618
|
+
background: v.toRgbString(),
|
|
606
619
|
transform: "translateY(-50%)",
|
|
607
620
|
cursor: "pointer",
|
|
608
621
|
transition: `all ${c}`,
|
|
@@ -631,7 +644,7 @@ const Ht = (e) => {
|
|
|
631
644
|
insetInlineEnd: e.marginSM
|
|
632
645
|
}
|
|
633
646
|
};
|
|
634
|
-
},
|
|
647
|
+
}, kt = (e) => {
|
|
635
648
|
const { motionEaseOut: t, motionDurationSlow: o } = e;
|
|
636
649
|
return {
|
|
637
650
|
[e.componentCls]: {
|
|
@@ -639,28 +652,28 @@ const Ht = (e) => {
|
|
|
639
652
|
textAlign: "center",
|
|
640
653
|
pointerEvents: "none",
|
|
641
654
|
"&-root": {
|
|
642
|
-
...
|
|
655
|
+
...ge("fixed"),
|
|
643
656
|
zIndex: e.zIndexPopup,
|
|
644
657
|
overflow: "auto",
|
|
645
658
|
outline: 0,
|
|
646
659
|
WebkitOverflowScrolling: "touch"
|
|
647
660
|
},
|
|
648
661
|
"&-wrap": {
|
|
649
|
-
...
|
|
662
|
+
...ge("fixed"),
|
|
650
663
|
zIndex: e.zIndexPopup,
|
|
651
664
|
overflow: "auto",
|
|
652
665
|
outline: 0,
|
|
653
666
|
WebkitOverflowScrolling: "touch"
|
|
654
667
|
},
|
|
655
668
|
"&-mask": {
|
|
656
|
-
...
|
|
669
|
+
...ge("fixed"),
|
|
657
670
|
zIndex: e.zIndexPopupBase,
|
|
658
671
|
height: "100%",
|
|
659
672
|
backgroundColor: e.colorBgMask,
|
|
660
|
-
backdropFilter: "blur(
|
|
673
|
+
backdropFilter: "blur(8px)"
|
|
661
674
|
},
|
|
662
675
|
"&-body": {
|
|
663
|
-
...
|
|
676
|
+
...Ae(),
|
|
664
677
|
overflow: "hidden"
|
|
665
678
|
},
|
|
666
679
|
"&-img": {
|
|
@@ -672,7 +685,7 @@ const Ht = (e) => {
|
|
|
672
685
|
transition: `transform ${o} ${t} 0s`,
|
|
673
686
|
userSelect: "none",
|
|
674
687
|
"&-wrapper": {
|
|
675
|
-
...
|
|
688
|
+
...Ae(),
|
|
676
689
|
transition: `transform ${o} ${t} 0s`,
|
|
677
690
|
display: "flex",
|
|
678
691
|
justifyContent: "center",
|
|
@@ -698,19 +711,19 @@ const Ht = (e) => {
|
|
|
698
711
|
}
|
|
699
712
|
},
|
|
700
713
|
"&-mask-zoom-appear, &-mask-zoom-enter": {
|
|
701
|
-
animationName:
|
|
714
|
+
animationName: Pt,
|
|
702
715
|
animationDuration: e.motionDurationSlow,
|
|
703
716
|
animationTimingFunction: "linear",
|
|
704
717
|
userSelect: "none"
|
|
705
718
|
},
|
|
706
719
|
"&-mask-zoom-leave": {
|
|
707
|
-
animationName:
|
|
720
|
+
animationName: Xt,
|
|
708
721
|
animationDuration: e.motionDurationSlow,
|
|
709
722
|
animationTimingFunction: "linear",
|
|
710
723
|
pointerEvents: "none"
|
|
711
724
|
},
|
|
712
725
|
"&-zoom-appear, &-zoom-enter": {
|
|
713
|
-
animationName:
|
|
726
|
+
animationName: Yt,
|
|
714
727
|
opacity: 0,
|
|
715
728
|
animationTimingFunction: e.motionEaseOutCirc,
|
|
716
729
|
animationFillMode: "both",
|
|
@@ -722,7 +735,7 @@ const Ht = (e) => {
|
|
|
722
735
|
animationPlayState: "running"
|
|
723
736
|
},
|
|
724
737
|
"&-zoom-leave": {
|
|
725
|
-
animationName:
|
|
738
|
+
animationName: jt,
|
|
726
739
|
animationDuration: e.motionDurationSlow,
|
|
727
740
|
animationTimingFunction: e.motionEaseInOutCirc,
|
|
728
741
|
animationFillMode: "both"
|
|
@@ -740,28 +753,28 @@ const Ht = (e) => {
|
|
|
740
753
|
zIndex: e.calc(e.zIndexPopup).add(1).equal(),
|
|
741
754
|
width: "100%"
|
|
742
755
|
},
|
|
743
|
-
"&": [
|
|
756
|
+
"&": [Bt(e), Ft(e)]
|
|
744
757
|
};
|
|
745
758
|
};
|
|
746
|
-
function
|
|
747
|
-
return
|
|
748
|
-
const o =
|
|
759
|
+
function Ht(e) {
|
|
760
|
+
return ht("ImageViewer", (t) => {
|
|
761
|
+
const o = pt(t, {
|
|
749
762
|
zIndexPopup: t.zIndexPopupBase + 80,
|
|
750
|
-
previewOperationColor: new
|
|
751
|
-
previewOperationHoverColor: new
|
|
752
|
-
previewOperationColorDisabled: new
|
|
763
|
+
previewOperationColor: new F(t.colorTextLightSolid).setAlpha(0.65).toRgbString(),
|
|
764
|
+
previewOperationHoverColor: new F(t.colorTextLightSolid).setAlpha(0.85).toRgbString(),
|
|
765
|
+
previewOperationColorDisabled: new F(t.colorTextLightSolid).setAlpha(0.25).toRgbString(),
|
|
753
766
|
imagePreviewSwitchSize: t.sizeXL,
|
|
754
|
-
modalMaskBg: new
|
|
767
|
+
modalMaskBg: new F("#000").setAlpha(0.45).toRgbString(),
|
|
755
768
|
// FIXME: Shared Token
|
|
756
769
|
previewOperationSize: t.fontSizeIcon * 1.5,
|
|
757
770
|
// FIXME: fontSizeIconLG
|
|
758
771
|
iconCls: ".anticon",
|
|
759
772
|
previewCls: t.componentCls
|
|
760
773
|
});
|
|
761
|
-
return [
|
|
774
|
+
return [kt(o)];
|
|
762
775
|
}, e);
|
|
763
776
|
}
|
|
764
|
-
const
|
|
777
|
+
const me = {
|
|
765
778
|
/**
|
|
766
779
|
* ESC
|
|
767
780
|
*/
|
|
@@ -776,18 +789,18 @@ const ve = {
|
|
|
776
789
|
* RIGHT
|
|
777
790
|
*/
|
|
778
791
|
RIGHT: 39
|
|
779
|
-
},
|
|
780
|
-
rotateLeft: s(
|
|
781
|
-
rotateRight: s(
|
|
782
|
-
zoomIn: s(
|
|
783
|
-
zoomOut: s(
|
|
784
|
-
flipX: s(
|
|
785
|
-
flipY: s(
|
|
792
|
+
}, U = {
|
|
793
|
+
rotateLeft: s(gt, null, null),
|
|
794
|
+
rotateRight: s(vt, null, null),
|
|
795
|
+
zoomIn: s(ft, null, null),
|
|
796
|
+
zoomOut: s(dt, null, null),
|
|
797
|
+
flipX: s(Me, null, null),
|
|
798
|
+
flipY: s(Me, {
|
|
786
799
|
rotate: 90
|
|
787
800
|
}, null)
|
|
788
|
-
},
|
|
801
|
+
}, Zt = /* @__PURE__ */ Ce({
|
|
789
802
|
name: "GImagePreview",
|
|
790
|
-
props:
|
|
803
|
+
props: G,
|
|
791
804
|
inheritAttrs: !1,
|
|
792
805
|
slots: Object,
|
|
793
806
|
emits: {
|
|
@@ -800,178 +813,178 @@ const ve = {
|
|
|
800
813
|
expose: o,
|
|
801
814
|
slots: i
|
|
802
815
|
}) => {
|
|
803
|
-
const n =
|
|
816
|
+
const n = Ne({
|
|
804
817
|
suffixCls: "image-view"
|
|
805
818
|
}), {
|
|
806
819
|
wrapSSR: r,
|
|
807
820
|
hashId: c
|
|
808
|
-
} =
|
|
809
|
-
value:
|
|
821
|
+
} = Ht(n), [p, v, d] = zt(e.open, {
|
|
822
|
+
value: H(e, "open"),
|
|
810
823
|
onChange: (u) => {
|
|
811
824
|
e.onOpenChange?.(u), t("update:open", u);
|
|
812
825
|
}
|
|
813
|
-
}), [
|
|
826
|
+
}), [g, m] = ne(!1), [C, x] = ne(!0), a = $(), {
|
|
814
827
|
transform: l,
|
|
815
828
|
resetTransform: w,
|
|
816
829
|
updateTransform: h,
|
|
817
830
|
dispatchZoomChange: y
|
|
818
|
-
} =
|
|
831
|
+
} = Ot(a, H(e, "minScale"), H(e, "maxScale"), e.onTransform), {
|
|
819
832
|
isMoving: S,
|
|
820
833
|
onMouseDown: L,
|
|
821
|
-
onWheel:
|
|
822
|
-
} =
|
|
834
|
+
onWheel: T
|
|
835
|
+
} = Et(a, H(e, "movable"), d, H(e, "scaleStep"), l, h, y), {
|
|
823
836
|
isTouching: M,
|
|
824
837
|
onTouchStart: I,
|
|
825
|
-
onTouchMove:
|
|
838
|
+
onTouchMove: k,
|
|
826
839
|
onTouchEnd: W
|
|
827
|
-
} =
|
|
828
|
-
|
|
840
|
+
} = Rt(a, H(e, "movable"), d, H(e, "minScale"), l, h, y);
|
|
841
|
+
xe(() => {
|
|
829
842
|
C.value || x(!0);
|
|
830
843
|
}, [C]);
|
|
831
|
-
const R = $(null), z = $(e.current), N =
|
|
832
|
-
url:
|
|
833
|
-
}]) => [u,
|
|
844
|
+
const R = $(null), z = $(e.current), N = it(/* @__PURE__ */ new Map()), Y = b(() => new Map(Array.from(N).map(([u, {
|
|
845
|
+
url: O
|
|
846
|
+
}]) => [u, O]))), _ = b(() => Y.value.get(z.value)), j = b(() => Y.value.size), B = b(() => Array.from(Y.value.keys())), A = b(() => B.value.indexOf(z.value)), f = b(() => j.value > 1), P = b(() => j.value >= 1);
|
|
834
847
|
J(d, (u) => {
|
|
835
|
-
u && (
|
|
848
|
+
u && (g.value = !0);
|
|
836
849
|
});
|
|
837
|
-
const
|
|
850
|
+
const E = (u) => {
|
|
838
851
|
z.value = u;
|
|
839
852
|
};
|
|
840
853
|
J(() => e.current, (u) => {
|
|
841
|
-
|
|
854
|
+
Pe(u) && E(u);
|
|
842
855
|
});
|
|
843
|
-
function
|
|
856
|
+
function fe(u, O) {
|
|
844
857
|
N.set(u, {
|
|
845
|
-
url:
|
|
858
|
+
url: O,
|
|
846
859
|
loading: !0,
|
|
847
860
|
canPreview: !1
|
|
848
861
|
});
|
|
849
862
|
}
|
|
850
|
-
const
|
|
863
|
+
const K = () => {
|
|
851
864
|
m(!1);
|
|
852
|
-
},
|
|
865
|
+
}, oe = () => {
|
|
853
866
|
w("close"), t("close");
|
|
854
|
-
},
|
|
855
|
-
S.value || R.value === u?.target &&
|
|
856
|
-
},
|
|
867
|
+
}, _e = (u) => {
|
|
868
|
+
S.value || R.value === u?.target && K();
|
|
869
|
+
}, Ue = () => {
|
|
857
870
|
const u = N.get(z.value);
|
|
858
871
|
u && (u.loading = !1, u.canPreview = !0);
|
|
859
|
-
},
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
},
|
|
863
|
-
if (
|
|
864
|
-
const u =
|
|
865
|
-
|
|
872
|
+
}, Ge = (u) => {
|
|
873
|
+
const O = N.get(z.value);
|
|
874
|
+
O && (O.loading = !1, O.canPreview = !1), u.target.alt = "加载失败";
|
|
875
|
+
}, be = () => {
|
|
876
|
+
if (A.value > 0 || e.infinite) {
|
|
877
|
+
const u = A.value - 1 < 0 ? e.urls.length - 1 : A.value - 1;
|
|
878
|
+
E(B.value[u]), w("prev");
|
|
866
879
|
}
|
|
867
|
-
},
|
|
868
|
-
if (
|
|
869
|
-
const u =
|
|
870
|
-
|
|
880
|
+
}, Le = () => {
|
|
881
|
+
if (A.value < j.value - 1 || e.infinite) {
|
|
882
|
+
const u = A.value + 1 > e.urls.length - 1 ? 0 : A.value + 1;
|
|
883
|
+
E(B.value[u]), w("next");
|
|
871
884
|
}
|
|
885
|
+
}, Ve = () => {
|
|
886
|
+
y(q + e.scaleStep, "zoomIn");
|
|
872
887
|
}, qe = () => {
|
|
873
|
-
y(
|
|
888
|
+
y(q / (q + e.scaleStep), "zoomOut");
|
|
874
889
|
}, Ke = () => {
|
|
875
|
-
y(K / (K + e.scaleStep), "zoomOut");
|
|
876
|
-
}, Qe = () => {
|
|
877
890
|
h({
|
|
878
891
|
rotate: l.value.rotate + 90
|
|
879
892
|
}, "rotateRight");
|
|
880
|
-
},
|
|
893
|
+
}, Qe = () => {
|
|
881
894
|
h({
|
|
882
895
|
rotate: l.value.rotate - 90
|
|
883
896
|
}, "rotateLeft");
|
|
884
|
-
},
|
|
897
|
+
}, Je = () => {
|
|
885
898
|
h({
|
|
886
899
|
flipX: !l.value.flipX
|
|
887
900
|
}, "flipX");
|
|
888
|
-
},
|
|
901
|
+
}, et = () => {
|
|
889
902
|
h({
|
|
890
903
|
flipY: !l.value.flipY
|
|
891
904
|
}, "flipY");
|
|
892
|
-
},
|
|
893
|
-
icon:
|
|
894
|
-
onClick:
|
|
905
|
+
}, $e = [{
|
|
906
|
+
icon: Z(i, e.icons, "flipY") || U.flipY,
|
|
907
|
+
onClick: et,
|
|
895
908
|
type: "flipY"
|
|
896
909
|
}, {
|
|
897
|
-
icon:
|
|
898
|
-
onClick:
|
|
910
|
+
icon: Z(i, e.icons, "flipX") || U.flipX,
|
|
911
|
+
onClick: Je,
|
|
899
912
|
type: "flipX"
|
|
900
913
|
}, {
|
|
901
|
-
icon:
|
|
902
|
-
onClick:
|
|
914
|
+
icon: Z(i, e.icons, "rotateLeft") || U.rotateLeft,
|
|
915
|
+
onClick: Qe,
|
|
903
916
|
type: "rotateLeft"
|
|
904
917
|
}, {
|
|
905
|
-
icon:
|
|
906
|
-
onClick:
|
|
918
|
+
icon: Z(i, e.icons, "rotateRight") || U.rotateRight,
|
|
919
|
+
onClick: Ke,
|
|
907
920
|
type: "rotateRight"
|
|
908
921
|
}, {
|
|
909
|
-
icon:
|
|
910
|
-
onClick: () =>
|
|
922
|
+
icon: Z(i, e.icons, "zoomOut") || U.zoomOut,
|
|
923
|
+
onClick: () => qe(),
|
|
911
924
|
type: "zoomOut",
|
|
912
925
|
disabled: b(() => l.value.scale <= e.minScale)
|
|
913
926
|
}, {
|
|
914
|
-
icon:
|
|
915
|
-
onClick: () =>
|
|
927
|
+
icon: Z(i, e.icons, "zoomIn") || U.zoomIn,
|
|
928
|
+
onClick: () => Ve(),
|
|
916
929
|
type: "zoomIn",
|
|
917
930
|
disabled: b(() => l.value.scale === e.maxScale)
|
|
918
|
-
}],
|
|
931
|
+
}], tt = (u) => {
|
|
919
932
|
d.value && (l.value.scale !== 1 ? h({
|
|
920
933
|
x: 0,
|
|
921
934
|
y: 0,
|
|
922
935
|
scale: 1
|
|
923
|
-
}, "doubleClick") : y(
|
|
924
|
-
},
|
|
925
|
-
u.keyCode ===
|
|
936
|
+
}, "doubleClick") : y(q + e.scaleStep, "doubleClick", u.clientX, u.clientY));
|
|
937
|
+
}, nt = (u) => {
|
|
938
|
+
u.keyCode === me.ESC && K(), !(!d.value || !f.value) && (u.keyCode === me.LEFT ? be() : u.keyCode === me.RIGHT && Le());
|
|
926
939
|
};
|
|
927
|
-
let
|
|
940
|
+
let ve = () => {
|
|
928
941
|
};
|
|
929
|
-
return
|
|
942
|
+
return Re(() => {
|
|
930
943
|
J(() => e.urls, (u) => {
|
|
931
|
-
|
|
932
|
-
|
|
944
|
+
St(u) && u.forEach((O, ie) => {
|
|
945
|
+
fe(ie, O);
|
|
933
946
|
});
|
|
934
947
|
}, {
|
|
935
948
|
flush: "post",
|
|
936
949
|
immediate: !0
|
|
937
950
|
}), J([() => d.value, () => S.value], () => {
|
|
938
|
-
|
|
939
|
-
const u =
|
|
940
|
-
|
|
951
|
+
ve();
|
|
952
|
+
const u = V(window, "keydown", nt, !1);
|
|
953
|
+
ve = () => {
|
|
941
954
|
u.remove();
|
|
942
955
|
};
|
|
943
956
|
}, {
|
|
944
957
|
flush: "post",
|
|
945
958
|
immediate: !0
|
|
946
959
|
});
|
|
947
|
-
}),
|
|
948
|
-
|
|
960
|
+
}), at(() => {
|
|
961
|
+
ve();
|
|
949
962
|
}), o({
|
|
950
963
|
setOpen: (u) => {
|
|
951
|
-
|
|
964
|
+
v(u), z.value = e.current;
|
|
952
965
|
}
|
|
953
966
|
}), () => {
|
|
954
|
-
const u =
|
|
967
|
+
const u = Se(`${n}-mask-zoom`), O = Se(`${n}-zoom`), ie = {};
|
|
955
968
|
for (const D in e.icons)
|
|
956
|
-
|
|
957
|
-
return r(s(
|
|
969
|
+
ie[D] = Z(i, e.icons, D);
|
|
970
|
+
return r(s(ue, null, [s(De, {
|
|
958
971
|
to: e.getContainer || "body"
|
|
959
972
|
}, {
|
|
960
|
-
default: () => [d.value && s(
|
|
973
|
+
default: () => [d.value && s(ue, null, [s("div", {
|
|
961
974
|
class: `${n}-root ${c.value}`
|
|
962
|
-
}, [s(
|
|
963
|
-
default: () => [
|
|
975
|
+
}, [s(pe, u, {
|
|
976
|
+
default: () => [we(s("div", {
|
|
964
977
|
class: `${n}-mask ${c.value}`
|
|
965
|
-
}, null), [[
|
|
978
|
+
}, null), [[ye, d.value && g.value]])]
|
|
966
979
|
}), s("div", {
|
|
967
980
|
ref: R,
|
|
968
981
|
tabindex: -1,
|
|
969
982
|
class: [`${n}-wrap`, `${c.value}`, S.value && `${n}-moving`],
|
|
970
|
-
onClick: (D) => e.onHideOnClickModal &&
|
|
971
|
-
}, [s(
|
|
972
|
-
onAfterLeave: () =>
|
|
983
|
+
onClick: (D) => e.onHideOnClickModal && _e(D)
|
|
984
|
+
}, [s(pe, le(O, {
|
|
985
|
+
onAfterLeave: () => oe()
|
|
973
986
|
}), {
|
|
974
|
-
default: () => [
|
|
987
|
+
default: () => [we(s("div", {
|
|
975
988
|
role: "dialog",
|
|
976
989
|
class: `${n} ${c.value}`
|
|
977
990
|
}, [s("div", {
|
|
@@ -984,50 +997,50 @@ const ve = {
|
|
|
984
997
|
ref: a,
|
|
985
998
|
class: `${n}-img ${c.value}`,
|
|
986
999
|
src: _.value,
|
|
987
|
-
onLoad: () =>
|
|
988
|
-
onError: (D) =>
|
|
1000
|
+
onLoad: () => Ue(),
|
|
1001
|
+
onError: (D) => Ge(D),
|
|
989
1002
|
style: {
|
|
990
1003
|
transform: `translate3d(${l.value.x}px, ${l.value.y}px, 0) scale3d(${l.value.flipX ? "-" : ""}${l.value.scale}, ${l.value.flipY ? "-" : ""}${l.value.scale}, 1) rotate(${l.value.rotate}deg)`,
|
|
991
1004
|
transitionDuration: !C.value || M.value ? "0s" : void 0
|
|
992
1005
|
},
|
|
993
|
-
onWheel:
|
|
1006
|
+
onWheel: T,
|
|
994
1007
|
onMousedown: L,
|
|
995
|
-
onDblclick:
|
|
1008
|
+
onDblclick: tt,
|
|
996
1009
|
onTouchstart: I,
|
|
997
|
-
onTouchmove:
|
|
1010
|
+
onTouchmove: k,
|
|
998
1011
|
onTouchend: W,
|
|
999
1012
|
onTouchcancel: W
|
|
1000
|
-
}, null)])])])]), [[
|
|
1013
|
+
}, null)])])])]), [[ye, d.value && g.value]])]
|
|
1001
1014
|
})])])])]
|
|
1002
|
-
}), d.value &&
|
|
1003
|
-
open: d.value &&
|
|
1015
|
+
}), d.value && g.value && s(Nt, {
|
|
1016
|
+
open: d.value && g.value,
|
|
1004
1017
|
hashId: c.value,
|
|
1005
1018
|
count: e.urls.length,
|
|
1006
1019
|
current: z.value,
|
|
1007
1020
|
zIndex: e.zIndex + 1,
|
|
1008
1021
|
getContainer: e.getContainer,
|
|
1009
1022
|
prefixCls: n,
|
|
1010
|
-
icons:
|
|
1023
|
+
icons: Ye(ie, $e.map(({
|
|
1011
1024
|
type: D
|
|
1012
1025
|
}) => D)),
|
|
1013
|
-
tools:
|
|
1026
|
+
tools: $e,
|
|
1014
1027
|
infinite: e.infinite,
|
|
1015
|
-
countRender:
|
|
1016
|
-
showSwitch:
|
|
1028
|
+
countRender: re(i, e, "countRender"),
|
|
1029
|
+
showSwitch: f.value,
|
|
1017
1030
|
showProgress: P.value,
|
|
1018
|
-
onClose:
|
|
1019
|
-
onActive: (D) => D > 0 ?
|
|
1031
|
+
onClose: K,
|
|
1032
|
+
onActive: (D) => D > 0 ? Le() : be()
|
|
1020
1033
|
}, null)]));
|
|
1021
1034
|
};
|
|
1022
1035
|
}
|
|
1023
|
-
}),
|
|
1036
|
+
}), he = {
|
|
1024
1037
|
width: "100%",
|
|
1025
1038
|
height: "100%"
|
|
1026
|
-
},
|
|
1039
|
+
}, Wt = {
|
|
1027
1040
|
overflow: "hidden",
|
|
1028
1041
|
whiteSpace: "nowrap",
|
|
1029
1042
|
textOverflow: "ellipsis"
|
|
1030
|
-
},
|
|
1043
|
+
}, _t = (e) => {
|
|
1031
1044
|
const { motionDurationSlow: t, paddingXXS: o, marginXXS: i, colorTextLightSolid: n } = e, r = ".anticon";
|
|
1032
1045
|
return {
|
|
1033
1046
|
position: "absolute",
|
|
@@ -1036,12 +1049,12 @@ const ve = {
|
|
|
1036
1049
|
alignItems: "center",
|
|
1037
1050
|
justifyContent: "center",
|
|
1038
1051
|
color: n,
|
|
1039
|
-
background: new
|
|
1052
|
+
background: new wt("#000").setA(0.5).toRgbString(),
|
|
1040
1053
|
cursor: "pointer",
|
|
1041
1054
|
opacity: 0,
|
|
1042
1055
|
transition: `opacity ${t}`,
|
|
1043
1056
|
[`.${e.componentCls}-mask-info`]: {
|
|
1044
|
-
...
|
|
1057
|
+
...Wt,
|
|
1045
1058
|
padding: `0 ${ee(o)}`,
|
|
1046
1059
|
[r]: {
|
|
1047
1060
|
marginInlineEnd: i,
|
|
@@ -1051,16 +1064,16 @@ const ve = {
|
|
|
1051
1064
|
}
|
|
1052
1065
|
}
|
|
1053
1066
|
};
|
|
1054
|
-
},
|
|
1067
|
+
}, Ut = (e) => ({
|
|
1055
1068
|
position: e || "absolute",
|
|
1056
1069
|
inset: 0
|
|
1057
|
-
}),
|
|
1070
|
+
}), Gt = (e) => ({
|
|
1058
1071
|
[e.componentCls]: {
|
|
1059
1072
|
display: "inline-block",
|
|
1060
1073
|
position: "relative",
|
|
1061
1074
|
overflow: "hidden",
|
|
1062
1075
|
[`${e.componentCls}-img`]: {
|
|
1063
|
-
...
|
|
1076
|
+
...he,
|
|
1064
1077
|
verticalAlign: "top",
|
|
1065
1078
|
opacity: 1,
|
|
1066
1079
|
[`&${e.componentCls}-img-preview`]: {
|
|
@@ -1068,7 +1081,7 @@ const ve = {
|
|
|
1068
1081
|
cursor: "pointer"
|
|
1069
1082
|
},
|
|
1070
1083
|
"&-placeholder": {
|
|
1071
|
-
...
|
|
1084
|
+
...he,
|
|
1072
1085
|
backgroundColor: e.colorBgContainerDisabled,
|
|
1073
1086
|
backgroundImage: "url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",
|
|
1074
1087
|
backgroundRepeat: "no-repeat",
|
|
@@ -1077,25 +1090,25 @@ const ve = {
|
|
|
1077
1090
|
}
|
|
1078
1091
|
},
|
|
1079
1092
|
[`${e.componentCls}-error`]: {
|
|
1080
|
-
...
|
|
1093
|
+
...he,
|
|
1081
1094
|
display: "flex",
|
|
1082
1095
|
alignItems: "center",
|
|
1083
1096
|
justifyContent: "center"
|
|
1084
1097
|
},
|
|
1085
1098
|
[`${e.componentCls}-placeholder`]: {
|
|
1086
|
-
...
|
|
1099
|
+
...Ut()
|
|
1087
1100
|
},
|
|
1088
1101
|
[`${e.componentCls}-mask`]: {
|
|
1089
|
-
...
|
|
1102
|
+
..._t(e)
|
|
1090
1103
|
},
|
|
1091
1104
|
[`${e.componentCls}-mask:hover`]: {
|
|
1092
1105
|
opacity: 1
|
|
1093
1106
|
}
|
|
1094
1107
|
}
|
|
1095
|
-
}),
|
|
1096
|
-
let
|
|
1097
|
-
const
|
|
1098
|
-
props:
|
|
1108
|
+
}), Vt = (e) => typeof Element > "u" ? !1 : e instanceof Element;
|
|
1109
|
+
let Ee = "";
|
|
1110
|
+
const se = /* @__PURE__ */ Ce({
|
|
1111
|
+
props: je,
|
|
1099
1112
|
name: "GImage",
|
|
1100
1113
|
inheritAttrs: !1,
|
|
1101
1114
|
emits: {
|
|
@@ -1109,88 +1122,92 @@ const Jt = [...We, "placeholder", "fallback"], le = /* @__PURE__ */ ye({
|
|
|
1109
1122
|
emit: o,
|
|
1110
1123
|
attrs: i
|
|
1111
1124
|
}) {
|
|
1112
|
-
const n = Q && "loading" in HTMLImageElement.prototype, r =
|
|
1125
|
+
const n = Q && "loading" in HTMLImageElement.prototype, r = Ne({
|
|
1113
1126
|
suffixCls: "image"
|
|
1114
1127
|
}), {
|
|
1115
1128
|
wrapSSR: c,
|
|
1116
1129
|
hashId: p
|
|
1117
|
-
} =
|
|
1130
|
+
} = yt("Image", [Gt], r), v = $(), d = $(), g = $(!1), m = $(!0), C = $(!1), x = $(), a = $();
|
|
1118
1131
|
let l, w;
|
|
1119
1132
|
const h = b(() => e.loading === "eager" ? !1 : !n && e.loading === "lazy" || e.lazy), y = b(() => Q && e.fit ? {
|
|
1120
1133
|
...e.imageStyle,
|
|
1121
1134
|
objectFit: e.fit
|
|
1122
|
-
} : e.imageStyle), S = b(() => typeof e.preview == "object" ? e.preview : {}), L = b(() => !!e.preview),
|
|
1135
|
+
} : e.imageStyle), S = b(() => typeof e.preview == "object" ? e.preview : {}), L = b(() => !!e.preview), T = b(() => {
|
|
1123
1136
|
const {
|
|
1124
|
-
urls:
|
|
1137
|
+
urls: f = [],
|
|
1125
1138
|
current: P = 0
|
|
1126
1139
|
} = S.value;
|
|
1127
|
-
if (
|
|
1128
|
-
const
|
|
1129
|
-
return
|
|
1130
|
-
}), M = b(() => ee(e.width)), I = b(() => ee(e.height)),
|
|
1131
|
-
Q && (m.value = !0,
|
|
1140
|
+
if (Pe(P)) return f.length >= P ? P : 0;
|
|
1141
|
+
const E = f.indexOf(e.src);
|
|
1142
|
+
return E >= 0 ? E : 0;
|
|
1143
|
+
}), M = b(() => ee(e.width)), I = b(() => ee(e.height)), k = () => {
|
|
1144
|
+
Q && (m.value = !0, g.value = !1, d.value = e.src);
|
|
1132
1145
|
};
|
|
1133
|
-
function W(
|
|
1134
|
-
|
|
1146
|
+
function W(f) {
|
|
1147
|
+
g.value || (m.value = !1, g.value = !1, o("load", f));
|
|
1135
1148
|
}
|
|
1136
|
-
function R(
|
|
1137
|
-
m.value = !1,
|
|
1149
|
+
function R(f) {
|
|
1150
|
+
m.value = !1, g.value = !0, o("error", f);
|
|
1138
1151
|
}
|
|
1139
1152
|
function z() {
|
|
1140
|
-
|
|
1153
|
+
Ct(x.value, a.value) && (k(), _());
|
|
1141
1154
|
}
|
|
1142
|
-
const N =
|
|
1155
|
+
const N = bt(z, 200, !0);
|
|
1143
1156
|
async function Y() {
|
|
1144
1157
|
if (!Q) return;
|
|
1145
|
-
await
|
|
1158
|
+
await rt();
|
|
1146
1159
|
const {
|
|
1147
|
-
scrollContainer:
|
|
1160
|
+
scrollContainer: f
|
|
1148
1161
|
} = e;
|
|
1149
|
-
|
|
1162
|
+
Vt(f) ? a.value = f : xt(f) && f !== "" ? a.value = document.querySelector(f) ?? void 0 : x.value && (a.value = It(x.value)), a.value && (l = ze(a, "scroll", N), setTimeout(() => z(), 100));
|
|
1150
1163
|
}
|
|
1151
1164
|
function _() {
|
|
1152
1165
|
!Q || !a.value || !N || (l?.(), a.value = void 0);
|
|
1153
1166
|
}
|
|
1154
|
-
function j(
|
|
1155
|
-
if (
|
|
1156
|
-
if (
|
|
1157
|
-
return
|
|
1158
|
-
if (
|
|
1159
|
-
return
|
|
1167
|
+
function j(f) {
|
|
1168
|
+
if (f.ctrlKey) {
|
|
1169
|
+
if (f.deltaY < 0)
|
|
1170
|
+
return f.preventDefault(), !1;
|
|
1171
|
+
if (f.deltaY > 0)
|
|
1172
|
+
return f.preventDefault(), !1;
|
|
1160
1173
|
}
|
|
1161
1174
|
}
|
|
1162
1175
|
const B = () => {
|
|
1163
|
-
o("click"), !(m.value ||
|
|
1176
|
+
o("click"), !(m.value || g.value) && L.value && (w = ze("wheel", j, {
|
|
1164
1177
|
passive: !1
|
|
1165
|
-
}),
|
|
1166
|
-
},
|
|
1167
|
-
w?.(), document.body.style.overflow =
|
|
1178
|
+
}), Ee = document.body.style.overflow, document.body.style.overflow = "hidden", C.value = !0);
|
|
1179
|
+
}, A = () => {
|
|
1180
|
+
w?.(), document.body.style.overflow = Ee, C.value = !1;
|
|
1168
1181
|
};
|
|
1169
1182
|
return J(() => e.src, () => {
|
|
1170
|
-
h.value ? (m.value = !0,
|
|
1171
|
-
}),
|
|
1172
|
-
L.value && C.value ?
|
|
1173
|
-
}),
|
|
1174
|
-
h.value ? Y() :
|
|
1183
|
+
h.value ? (m.value = !0, g.value = !1, _(), Y()) : k();
|
|
1184
|
+
}), lt(() => {
|
|
1185
|
+
L.value && C.value ? v.value?.setOpen(!0) : v.value?.setOpen(!1);
|
|
1186
|
+
}), Re(() => {
|
|
1187
|
+
h.value ? Y() : k();
|
|
1175
1188
|
}), () => {
|
|
1176
|
-
const
|
|
1189
|
+
const f = Mt(Object.entries(i).filter(([oe]) => /^(?:data-|on[A-Z])/i.test(oe) || ["id", "style", "class"].includes(oe))), P = Ye(i, Object.keys(f)), E = re(t, e, "fallback", {
|
|
1177
1190
|
render: !0
|
|
1178
|
-
}),
|
|
1179
|
-
|
|
1191
|
+
}), fe = re(t, e, "mask", {
|
|
1192
|
+
render: !0
|
|
1193
|
+
}), K = re(t, e, "placeholder", {
|
|
1194
|
+
render: !0
|
|
1195
|
+
});
|
|
1196
|
+
return c(s("div", le({
|
|
1180
1197
|
class: {
|
|
1181
1198
|
[`${p.value}`]: !0,
|
|
1182
1199
|
[`${r}`]: !0
|
|
1183
1200
|
},
|
|
1184
1201
|
ref: x
|
|
1185
|
-
},
|
|
1202
|
+
}, f, {
|
|
1186
1203
|
style: {
|
|
1187
1204
|
width: ee(e.size) || M.value,
|
|
1188
1205
|
height: ee(e.size) || I.value,
|
|
1189
|
-
...
|
|
1206
|
+
...f.style || {}
|
|
1190
1207
|
}
|
|
1191
|
-
}), [
|
|
1208
|
+
}), [g.value ? s("div", {
|
|
1192
1209
|
class: X(p.value, `${r}-error`)
|
|
1193
|
-
}, [
|
|
1210
|
+
}, [E]) : s(ue, null, [s("img", le(P, {
|
|
1194
1211
|
src: d.value,
|
|
1195
1212
|
loading: e.loading,
|
|
1196
1213
|
style: y.value,
|
|
@@ -1206,29 +1223,28 @@ const Jt = [...We, "placeholder", "fallback"], le = /* @__PURE__ */ ye({
|
|
|
1206
1223
|
onError: R
|
|
1207
1224
|
}), null), m.value && s("div", {
|
|
1208
1225
|
class: X(`${r}-placeholder`, p.value)
|
|
1209
|
-
}, [
|
|
1226
|
+
}, [K])]), S.value.mask && L.value && s("div", {
|
|
1210
1227
|
class: X(`${r}-mask`, S.value.maskClass, p.value),
|
|
1211
1228
|
style: {
|
|
1212
|
-
display:
|
|
1229
|
+
display: f.style?.display === "none" ? "none" : void 0
|
|
1213
1230
|
}
|
|
1214
|
-
}, [
|
|
1231
|
+
}, [fe || s("div", {
|
|
1215
1232
|
class: X(`${r}-mask-info`, p.value)
|
|
1216
|
-
}, [s(
|
|
1217
|
-
ref:
|
|
1218
|
-
}, S.value,
|
|
1233
|
+
}, [s(mt, null, null)])]), L.value && s(Zt, le({
|
|
1234
|
+
ref: v
|
|
1235
|
+
}, S.value, {
|
|
1219
1236
|
urls: S.value.urls || [e.src],
|
|
1220
|
-
current:
|
|
1221
|
-
onClose: () =>
|
|
1222
|
-
}),
|
|
1237
|
+
current: T.value,
|
|
1238
|
+
onClose: () => A()
|
|
1239
|
+
}), t)]));
|
|
1223
1240
|
};
|
|
1224
1241
|
}
|
|
1225
1242
|
});
|
|
1226
|
-
|
|
1227
|
-
|
|
1243
|
+
se.isGImage = !0;
|
|
1244
|
+
se.install = (e) => (e.component(se.name, se), e);
|
|
1228
1245
|
export {
|
|
1229
|
-
|
|
1230
|
-
|
|
1246
|
+
se as GImage,
|
|
1247
|
+
Zt as GImagePreview,
|
|
1231
1248
|
te as baseProps,
|
|
1232
|
-
|
|
1233
|
-
Ze as imageProps
|
|
1249
|
+
je as imageProps
|
|
1234
1250
|
};
|