@gx-design-vue/image 0.2.0-beta.31 → 0.2.0-beta.32

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