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