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