@gx-design-vue/image 0.2.0-beta.22 → 0.2.0-beta.24

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,12 +1,12 @@
1
- import Z from "ant-design-vue/es/_util/vue-types";
2
- import { ref as M, reactive as re, onMounted as De, defineComponent as Me, createVNode as r, Teleport as Ue, Transition as Se, withDirectives as he, Fragment as Ie, cloneVNode as Je, vShow as pe, shallowRef as V, computed as y, watch as j, onUnmounted as et, mergeProps as ze, watchEffect as tt, createTextVNode as nt, nextTick as ot } from "vue";
1
+ import { ref as N, reactive as ae, onMounted as De, defineComponent as ye, createVNode as r, Teleport as ze, Transition as ge, withDirectives as we, Fragment as Se, cloneVNode as Je, vShow as he, shallowRef as Z, computed as y, watch as H, onUnmounted as et, mergeProps as pe, watchEffect as tt, createTextVNode as nt, nextTick as ot } from "vue";
3
2
  import { CloseOutlined as it, LeftOutlined as at, RightOutlined as lt, RotateLeftOutlined as rt, RotateRightOutlined as st, ZoomInOutlined as ct, ZoomOutOutlined as ut, SwapOutlined as xe } from "@ant-design/icons-vue";
4
- import { classNames as ae, getPrefixCls as _e, isNumber as Ee, getSlotVNode as L, isArray as Fe, getSlot as dt, isServer as le, isInContainer as ft, isString as vt, getScrollContainer as gt } from "@gx-design-vue/pro-utils";
5
- import { useState as Le, onMountedOrActivated as mt } from "@gx-design-vue/pro-hooks";
6
- import { Keyframe as ue, useStyle as wt, mergeToken as St, unit as ht, getTransitionProps as Ce, useProStyle as It } from "@gx-design-vue/pro-provider";
7
- import { TinyColor as K } from "@ctrl/tinycolor";
8
- import { useThrottleFn as pt, useEventListener as Te } from "@vueuse/core";
9
- const U = {
3
+ import { classNames as oe, getPrefixCls as Ue, isNumber as Ie, getSlotVNode as $, isArray as _e, getSlot as dt, isServer as ie, isInContainer as ft, getSlotsProps as vt, isString as mt, getScrollContainer as gt } from "@gx-design-vue/pro-utils";
4
+ import { useState as Le, onMountedOrActivated as wt } from "@gx-design-vue/pro-hooks";
5
+ import { Keyframe as re, useStyle as St, mergeToken as ht, unit as pt, getTransitionProps as Ee, useProStyle as It } from "@gx-design-vue/pro-provider";
6
+ import { TinyColor as Y } from "@ctrl/tinycolor";
7
+ import { omit as Et, pick as Ct } from "lodash-es";
8
+ import { useThrottleFn as yt, useEventListener as be } from "@vueuse/core";
9
+ const V = {
10
10
  infinite: {
11
11
  type: Boolean,
12
12
  default: !0
@@ -22,12 +22,16 @@ const U = {
22
22
  getContainer: {
23
23
  type: String
24
24
  }
25
- }, se = {
26
- previewTeleported: {
27
- type: Boolean,
28
- default: !0
25
+ }, Fe = {
26
+ preview: {
27
+ type: Object,
28
+ default: () => ({
29
+ current: 0,
30
+ infinite: !0,
31
+ onHideOnClickModal: !0
32
+ })
29
33
  },
30
- hideOnClickModal: {
34
+ showPreview: {
31
35
  type: Boolean,
32
36
  default: !0
33
37
  },
@@ -43,7 +47,7 @@ const U = {
43
47
  type: String,
44
48
  default: "contain"
45
49
  },
46
- lazy: Z.bool,
50
+ lazy: Boolean,
47
51
  scrollContainer: {
48
52
  type: [String, Object]
49
53
  },
@@ -66,57 +70,47 @@ const U = {
66
70
  onClick: {
67
71
  type: Function
68
72
  },
73
+ imageClassName: String,
74
+ imageStyle: Object,
75
+ width: Number,
76
+ height: Number,
77
+ zIndex: V.zIndex,
78
+ getContainer: V.getContainer
79
+ }, j = {
69
80
  previewUrls: {
70
81
  type: Array,
71
82
  default: () => []
72
83
  },
73
- imageClassName: Z.string,
74
- imageStyle: Z.style,
75
- width: Z.number,
76
- height: Z.number,
77
- zIndex: U.zIndex,
78
- infinite: U.infinite,
79
- getContainer: U.getContainer,
80
- current: {
81
- ...U.current,
82
- default: () => {
83
- }
84
- }
85
- }, Y = {
86
- previewUrls: {
87
- type: Array,
88
- default: () => []
89
- },
90
- teleported: se.previewTeleported,
91
- zIndex: U.zIndex,
92
- current: U.current,
93
- infinite: U.infinite,
94
- getContainer: se.getContainer,
95
- onHideOnClickModal: se.hideOnClickModal,
84
+ disabled: Boolean,
85
+ zIndex: V.zIndex,
86
+ current: V.current,
87
+ infinite: V.infinite,
88
+ getContainer: Fe.getContainer,
89
+ onHideOnClickModal: Boolean,
96
90
  countRender: [Function, Array, Object],
97
91
  icons: {
98
92
  type: Object,
99
93
  default: () => ({})
100
94
  }
101
95
  };
102
- function Et(e, t) {
96
+ function Nt(e, t) {
103
97
  process.env.NODE_ENV !== "production" && !e && console !== void 0 && console.error(`Warning: ${t}`);
104
98
  }
105
- const Ct = new ue("viewFadeIn", {
99
+ const Mt = new re("viewFadeIn", {
106
100
  "0%": {
107
101
  opacity: 0
108
102
  },
109
103
  "100%": {
110
104
  opacity: 1
111
105
  }
112
- }), yt = new ue("viewFadeOut", {
106
+ }), Ot = new re("viewFadeOut", {
113
107
  "0%": {
114
108
  opacity: 1
115
109
  },
116
110
  "100%": {
117
111
  opacity: 0
118
112
  }
119
- }), Mt = new ue("viewZoomBadgeIn", {
113
+ }), At = new re("viewZoomBadgeIn", {
120
114
  "0%": {
121
115
  transform: "scale(0.2)",
122
116
  opacity: 0
@@ -125,7 +119,7 @@ const Ct = new ue("viewFadeIn", {
125
119
  transform: "scale(1)",
126
120
  opacity: 1
127
121
  }
128
- }), Nt = new ue("viewZoomBadgeOut", {
122
+ }), xt = new re("viewZoomBadgeOut", {
129
123
  "0%": {
130
124
  transform: "scale(1)"
131
125
  },
@@ -133,11 +127,11 @@ const Ct = new ue("viewFadeIn", {
133
127
  transform: "scale(0.2)",
134
128
  opacity: 0
135
129
  }
136
- }), be = (e) => ({
130
+ }), Te = (e) => ({
137
131
  position: e || "absolute",
138
132
  inset: 0
139
133
  });
140
- function me(e) {
134
+ function ve(e) {
141
135
  return {
142
136
  position: e,
143
137
  top: 0,
@@ -146,8 +140,8 @@ function me(e) {
146
140
  insetInlineStart: 0
147
141
  };
148
142
  }
149
- const Ot = (e) => {
150
- const { previewCls: t, modalMaskBg: i, paddingSM: l, marginXL: o, margin: f, paddingLG: c, previewOperationColorDisabled: d, previewOperationHoverColor: p, motionDurationSlow: m, iconCls: h, colorTextLightSolid: C } = e, v = new K(i).setAlpha(0.1), u = v.clone().setAlpha(0.2);
143
+ const Lt = (e) => {
144
+ const { previewCls: t, modalMaskBg: i, paddingSM: l, marginXL: o, margin: f, paddingLG: c, previewOperationColorDisabled: d, previewOperationHoverColor: E, motionDurationSlow: g, iconCls: h, colorTextLightSolid: C } = e, v = new Y(i).setAlpha(0.1), u = v.clone().setAlpha(0.2);
151
145
  return {
152
146
  [`${t}-footer`]: {
153
147
  position: "fixed",
@@ -180,7 +174,7 @@ const Ot = (e) => {
180
174
  outline: 0,
181
175
  border: 0,
182
176
  cursor: "pointer",
183
- transition: `all ${m}`,
177
+ transition: `all ${g}`,
184
178
  "&:hover": {
185
179
  backgroundColor: u.toRgbString()
186
180
  },
@@ -191,17 +185,17 @@ const Ot = (e) => {
191
185
  [`${t}-operations`]: {
192
186
  display: "flex",
193
187
  alignItems: "center",
194
- padding: `0 ${ht(c)}`,
188
+ padding: `0 ${pt(c)}`,
195
189
  backgroundColor: v.toRgbString(),
196
190
  borderRadius: 100,
197
191
  "&-operation": {
198
192
  marginInlineStart: l,
199
193
  padding: l,
200
194
  cursor: "pointer",
201
- transition: `all ${m}`,
195
+ transition: `all ${g}`,
202
196
  userSelect: "none",
203
197
  [`&:not(${t}-operations-operation-disabled):hover > ${h}`]: {
204
- color: p
198
+ color: E
205
199
  },
206
200
  "&-disabled": {
207
201
  color: d,
@@ -216,8 +210,8 @@ const Ot = (e) => {
216
210
  }
217
211
  }
218
212
  };
219
- }, At = (e) => {
220
- const { modalMaskBg: t, iconCls: i, previewOperationColorDisabled: l, previewCls: o, zIndexPopup: f, motionDurationSlow: c } = e, d = new K(t).setAlpha(0.1), p = d.clone().setAlpha(0.2);
213
+ }, bt = (e) => {
214
+ const { modalMaskBg: t, iconCls: i, previewOperationColorDisabled: l, previewCls: o, zIndexPopup: f, motionDurationSlow: c } = e, d = new Y(t).setAlpha(0.1), E = d.clone().setAlpha(0.2);
221
215
  return {
222
216
  [`${o}-switch-left, ${o}-switch-right`]: {
223
217
  position: "fixed",
@@ -237,7 +231,7 @@ const Ot = (e) => {
237
231
  transition: `all ${c}`,
238
232
  userSelect: "none",
239
233
  "&:hover": {
240
- background: p.toRgbString()
234
+ background: E.toRgbString()
241
235
  },
242
236
  "&-disabled": {
243
237
  "&, &:hover": {
@@ -260,33 +254,33 @@ const Ot = (e) => {
260
254
  insetInlineEnd: e.marginSM
261
255
  }
262
256
  };
263
- }, xt = (e) => ({
257
+ }, Tt = (e) => ({
264
258
  [e.componentCls]: {
265
259
  height: "100%",
266
260
  textAlign: "center",
267
261
  pointerEvents: "none",
268
262
  "&-root": {
269
- ...me("fixed"),
263
+ ...ve("fixed"),
270
264
  zIndex: e.zIndexPopup,
271
265
  overflow: "auto",
272
266
  outline: 0,
273
267
  WebkitOverflowScrolling: "touch"
274
268
  },
275
269
  "&-wrap": {
276
- ...me("fixed"),
270
+ ...ve("fixed"),
277
271
  zIndex: e.zIndexPopup,
278
272
  overflow: "auto",
279
273
  outline: 0,
280
274
  WebkitOverflowScrolling: "touch"
281
275
  },
282
276
  "&-mask": {
283
- ...me("fixed"),
277
+ ...ve("fixed"),
284
278
  zIndex: e.zIndexPopupBase,
285
279
  height: "100%",
286
280
  backgroundColor: e.colorBgMask
287
281
  },
288
282
  "&-body": {
289
- ...be(),
283
+ ...Te(),
290
284
  overflow: "hidden"
291
285
  },
292
286
  "&-img": {
@@ -299,7 +293,7 @@ const Ot = (e) => {
299
293
  userSelect: "none",
300
294
  pointerEvents: "auto",
301
295
  "&-wrapper": {
302
- ...be(),
296
+ ...Te(),
303
297
  display: "flex",
304
298
  justifyContent: "center",
305
299
  alignItems: "center",
@@ -314,17 +308,17 @@ const Ot = (e) => {
314
308
  }
315
309
  },
316
310
  "&-fade-appear, &-fade-enter": {
317
- animationName: Ct,
311
+ animationName: Mt,
318
312
  animationDuration: e.motionDurationSlow,
319
313
  animationTimingFunction: "linear"
320
314
  },
321
315
  "&-fade-leave": {
322
- animationName: yt,
316
+ animationName: Ot,
323
317
  animationDuration: e.motionDurationSlow,
324
318
  animationTimingFunction: "linear"
325
319
  },
326
320
  "&-zoom-appear, &-zoom-enter": {
327
- animationName: Mt,
321
+ animationName: At,
328
322
  opacity: 0,
329
323
  animationTimingFunction: e.motionEaseOutCirc,
330
324
  animationFillMode: "both",
@@ -336,7 +330,7 @@ const Ot = (e) => {
336
330
  animationPlayState: "running"
337
331
  },
338
332
  "&-zoom-leave": {
339
- animationName: Nt,
333
+ animationName: xt,
340
334
  animationDuration: e.motionDurationSlow,
341
335
  animationTimingFunction: e.motionEaseOutBack,
342
336
  animationFillMode: "both"
@@ -354,34 +348,34 @@ const Ot = (e) => {
354
348
  zIndex: e.zIndexPopup + 1,
355
349
  width: "100%"
356
350
  },
357
- "&": [Ot(e), At(e)]
351
+ "&": [Lt(e), bt(e)]
358
352
  });
359
- function Lt(e) {
360
- return wt("ImageViewer", (t) => {
361
- const i = St(t, {
353
+ function Pt(e) {
354
+ return St("ImageViewer", (t) => {
355
+ const i = ht(t, {
362
356
  zIndexPopup: t.zIndexPopupBase + 80,
363
- previewOperationColorDisabled: new K(t.colorTextLightSolid).setAlpha(0.25).toRgbString(),
364
- previewOperationHoverColor: new K(t.colorTextLightSolid).setAlpha(0.85).toRgbString(),
365
- modalMaskBg: new K("#000").setAlpha(0.45).toRgbString(),
357
+ previewOperationColorDisabled: new Y(t.colorTextLightSolid).setAlpha(0.25).toRgbString(),
358
+ previewOperationHoverColor: new Y(t.colorTextLightSolid).setAlpha(0.85).toRgbString(),
359
+ modalMaskBg: new Y("#000").setAlpha(0.45).toRgbString(),
366
360
  // FIXME: Shared Token
367
- previewOperationColor: new K(t.colorTextLightSolid).toRgbString(),
361
+ previewOperationColor: new Y(t.colorTextLightSolid).toRgbString(),
368
362
  previewOperationSize: t.fontSizeIcon * 1.5,
369
363
  // FIXME: fontSizeIconLG
370
364
  imagePreviewSwitchSize: t.controlHeightLG,
371
365
  iconCls: "anticon",
372
366
  previewCls: t.componentCls
373
367
  });
374
- return [xt(i)];
368
+ return [Tt(i)];
375
369
  }, e);
376
370
  }
377
- function Tt(e) {
371
+ function Rt(e) {
378
372
  const t = e.getBoundingClientRect(), i = document.documentElement;
379
373
  return {
380
374
  left: t.left + (window.scrollX || i.scrollLeft) - (i.clientLeft || document.body.clientLeft || 0),
381
375
  top: t.top + (window.scrollY || i.scrollTop) - (i.clientTop || document.body.clientTop || 0)
382
376
  };
383
377
  }
384
- function bt() {
378
+ function $t() {
385
379
  const e = document.documentElement.clientWidth, t = window.innerHeight || document.documentElement.clientHeight;
386
380
  return {
387
381
  width: e,
@@ -405,8 +399,8 @@ function Pe(e, t, i, l) {
405
399
  };
406
400
  return {};
407
401
  }
408
- function Pt(e, t, i, l) {
409
- const { width: o, height: f } = bt();
402
+ function Dt(e, t, i, l) {
403
+ const { width: o, height: f } = $t();
410
404
  let c = null;
411
405
  return e <= o && t <= f ? c = {
412
406
  x: 0,
@@ -426,7 +420,7 @@ try {
426
420
  window.addEventListener("testPassive", null, e), window.removeEventListener("testPassive", null, e);
427
421
  } catch {
428
422
  }
429
- function B(e, t, i, l) {
423
+ function F(e, t, i, l) {
430
424
  if (e && e.addEventListener) {
431
425
  let o = l;
432
426
  o === void 0 && Be && (t === "touchstart" || t === "touchmove" || t === "wheel") && (o = { passive: !1 }), e.addEventListener(t, i, o);
@@ -958,7 +952,7 @@ const Ne = /* @__PURE__ */ new Map();
958
952
  function Ye(e) {
959
953
  Ne.delete(e);
960
954
  }
961
- function ye(e, t = 1) {
955
+ function Ce(e, t = 1) {
962
956
  Re += 1;
963
957
  const i = Re;
964
958
  function l(o) {
@@ -973,13 +967,13 @@ function ye(e, t = 1) {
973
967
  }
974
968
  return l(t), i;
975
969
  }
976
- ye.cancel = (e) => {
970
+ Ce.cancel = (e) => {
977
971
  const t = Ne.get(e);
978
972
  return Ye(t), je(t);
979
973
  };
980
- function Rt(e) {
981
- const t = M(null), i = re({ ...e }), l = M([]), o = (f) => {
982
- t.value === null && (l.value = [], t.value = ye(() => {
974
+ function zt(e) {
975
+ const t = N(null), i = ae({ ...e }), l = N([]), o = (f) => {
976
+ t.value === null && (l.value = [], t.value = Ce(() => {
983
977
  let c;
984
978
  l.value.forEach((d) => {
985
979
  c = { ...c, ...d };
@@ -987,10 +981,10 @@ function Rt(e) {
987
981
  })), l.value.push(f);
988
982
  };
989
983
  return De(() => {
990
- t.value && ye.cancel(t.value);
984
+ t.value && Ce.cancel(t.value);
991
985
  }), [i, o];
992
986
  }
993
- const $t = /* @__PURE__ */ Me({
987
+ const Ut = /* @__PURE__ */ ye({
994
988
  name: "Operations",
995
989
  inheritAttrs: !1,
996
990
  props: {
@@ -1007,11 +1001,11 @@ const $t = /* @__PURE__ */ Me({
1007
1001
  showProgress: Boolean,
1008
1002
  prefixCls: String,
1009
1003
  hashId: String,
1010
- zIndex: Y.zIndex,
1011
- icons: Y.icons,
1012
- infinite: Y.infinite,
1013
- getContainer: Y.getContainer,
1014
- countRender: Y.countRender,
1004
+ zIndex: j.zIndex,
1005
+ icons: j.icons,
1006
+ infinite: j.infinite,
1007
+ getContainer: j.getContainer,
1008
+ countRender: j.countRender,
1015
1009
  tools: Array,
1016
1010
  onClose: Function,
1017
1011
  onActive: Function
@@ -1026,28 +1020,28 @@ const $t = /* @__PURE__ */ Me({
1026
1020
  prefixCls: i,
1027
1021
  hashId: l,
1028
1022
  tools: o
1029
- } = e, f = Ce(`${e.prefixCls}-fade`), c = `${i}-operations-operation`, d = `${i}-operations-icon`;
1030
- return r(Ue, {
1023
+ } = e, f = Ee(`${e.prefixCls}-fade`), c = `${i}-operations-operation`, d = `${i}-operations-icon`;
1024
+ return r(ze, {
1031
1025
  to: e.getContainer || "body"
1032
1026
  }, {
1033
- default: () => [r(Se, f, {
1027
+ default: () => [r(ge, f, {
1034
1028
  default: () => {
1035
- var p, m, h, C;
1036
- return [he(r("div", {
1037
- class: ae(`${i}-operations-wrapper`, l),
1029
+ var E, g, h, C;
1030
+ return [we(r("div", {
1031
+ class: oe(`${i}-operations-wrapper`, l),
1038
1032
  style: {
1039
1033
  zIndex: e.zIndex
1040
1034
  }
1041
- }, [((p = e.icons) == null ? void 0 : p.close) === null ? null : r("button", {
1035
+ }, [((E = e.icons) == null ? void 0 : E.close) === null ? null : r("button", {
1042
1036
  class: `${i}-close ${l}`,
1043
1037
  onClick: e.onClose
1044
- }, [((m = e.icons) == null ? void 0 : m.close) || r(it, null, null)]), e.showSwitch && r(Ie, null, [r("div", {
1045
- class: ae(`${i}-switch-left ${l}`, {
1038
+ }, [((g = e.icons) == null ? void 0 : g.close) || r(it, null, null)]), e.showSwitch && r(Se, null, [r("div", {
1039
+ class: oe(`${i}-switch-left ${l}`, {
1046
1040
  [`${i}-switch-left-disabled`]: e.infinite ? !1 : e.current === 0
1047
1041
  }),
1048
1042
  onClick: (v) => t(v, -1)
1049
1043
  }, [((h = e.icons) == null ? void 0 : h.left) || r(at, null, null)]), r("div", {
1050
- className: ae(`${i}-switch-right ${l}`, {
1044
+ className: oe(`${i}-switch-right ${l}`, {
1051
1045
  [`${i}-switch-right-disabled`]: e.infinite ? !1 : e.current === e.count - 1
1052
1046
  }),
1053
1047
  onClick: (v) => t(v, 1)
@@ -1060,17 +1054,17 @@ const $t = /* @__PURE__ */ Me({
1060
1054
  }, [o == null ? void 0 : o.map(({
1061
1055
  icon: v,
1062
1056
  onClick: u,
1063
- type: N,
1057
+ type: M,
1064
1058
  disabled: w
1065
1059
  }) => r("div", {
1066
- class: ae(c, {
1060
+ class: oe(c, {
1067
1061
  [`${e.prefixCls}-operations-operation-disabled`]: w && (w == null ? void 0 : w.value)
1068
1062
  }),
1069
1063
  onClick: u,
1070
- key: N
1064
+ key: M
1071
1065
  }, [Je(v, {
1072
1066
  class: d
1073
- })]))])])]), [[pe, e.open]])];
1067
+ })]))])])]), [[he, e.open]])];
1074
1068
  }
1075
1069
  })]
1076
1070
  });
@@ -1079,7 +1073,7 @@ const $t = /* @__PURE__ */ Me({
1079
1073
  }), D = {
1080
1074
  x: 0,
1081
1075
  y: 0
1082
- }, H = {
1076
+ }, B = {
1083
1077
  rotateLeft: r(rt, null, null),
1084
1078
  rotateRight: r(st, null, null),
1085
1079
  zoomIn: r(ct, null, null),
@@ -1088,200 +1082,200 @@ const $t = /* @__PURE__ */ Me({
1088
1082
  flipY: r(xe, {
1089
1083
  rotate: 90
1090
1084
  }, null)
1091
- }, Dt = /* @__PURE__ */ Me({
1085
+ }, Ke = ["close", "left", "right", "rotateRight", "rotateRight", "zoomOut", "flipX", "flipY", "rotateLeft"], _t = /* @__PURE__ */ ye({
1092
1086
  name: "GImageViewer",
1093
- props: Y,
1087
+ props: j,
1094
1088
  inheritAttrs: !1,
1095
1089
  emits: ["close", "switch", "afterClose"],
1090
+ emit: Object,
1096
1091
  setup: (e, {
1097
1092
  emit: t,
1098
1093
  expose: i,
1099
1094
  slots: l
1100
1095
  }) => {
1101
- const o = _e({
1096
+ const o = Ue({
1102
1097
  suffixCls: "image-view"
1103
1098
  }), {
1104
1099
  wrapSSR: f,
1105
1100
  hashId: c
1106
- } = Lt(o), [d, p] = Le(!1), [m, h] = Le(!1), C = M(null), v = M(e.current), u = V(1), N = V(0), w = V(!1), O = re({
1101
+ } = Pt(o), [d, E] = Le(!1), [g, h] = Le(!1), C = N(null), v = N(e.current), u = Z(1), M = Z(0), w = Z(!1), O = ae({
1107
1102
  x: 1,
1108
1103
  y: 1
1109
- }), [I, T] = Rt(D), W = V({
1104
+ }), [p, L] = zt(D), K = Z({
1110
1105
  wheelDirection: 0
1111
- }), R = V(), A = re({
1106
+ }), P = Z(), A = ae({
1112
1107
  originX: 0,
1113
1108
  originY: 0,
1114
1109
  deltaX: 0,
1115
1110
  deltaY: 0
1116
- }), $ = re(/* @__PURE__ */ new Map()), z = y(() => new Map(Array.from($).map(([n, {
1117
- url: g
1118
- }]) => [n, g]))), Q = y(() => z.value.get(v.value)), _ = y(() => z.value.size), G = y(() => Array.from(z.value.keys())), b = y(() => G.value.indexOf(v.value)), k = y(() => _.value > 1), X = y(() => _.value >= 1);
1119
- j(d, (n) => {
1120
- n && (m.value = !0);
1111
+ }), R = ae(/* @__PURE__ */ new Map()), z = y(() => new Map(Array.from(R).map(([n, {
1112
+ url: m
1113
+ }]) => [n, m]))), Q = y(() => z.value.get(v.value)), U = y(() => z.value.size), W = y(() => Array.from(z.value.keys())), b = y(() => W.value.indexOf(v.value)), k = y(() => U.value > 1), G = y(() => U.value >= 1);
1114
+ H(d, (n) => {
1115
+ n && (g.value = !0);
1121
1116
  });
1122
1117
  const s = (n) => {
1123
1118
  v.value = n;
1124
1119
  };
1125
- j(() => e.current, (n) => {
1126
- Ee(n) && s(n);
1120
+ H(() => e.current, (n) => {
1121
+ Ie(n) && s(n);
1127
1122
  });
1128
- function S(n, g) {
1129
- $.set(n, {
1130
- url: g,
1123
+ function S(n, m) {
1124
+ R.set(n, {
1125
+ url: m,
1131
1126
  loading: !0,
1132
1127
  canPreview: !1
1133
1128
  });
1134
1129
  }
1135
1130
  const x = () => {
1136
1131
  h(!1), v.value = e.current;
1137
- }, F = () => {
1138
- u.value = 1, N.value = 0, O.x = 1, O.y = 1, T(D), t("close");
1139
- }, de = (n) => {
1132
+ }, se = () => {
1133
+ u.value = 1, M.value = 0, O.x = 1, O.y = 1, L(D), t("close");
1134
+ }, ce = (n) => {
1140
1135
  w.value || C.value === (n == null ? void 0 : n.target) && x();
1141
- }, fe = () => {
1142
- const n = $.get(v.value);
1136
+ }, ue = () => {
1137
+ const n = R.get(v.value);
1143
1138
  n && (n.loading = !1, n.canPreview = !0);
1144
1139
  }, q = (n) => {
1145
- const g = $.get(v.value);
1146
- g && (g.loading = !1, g.canPreview = !1), n.target.alt = "加载失败";
1140
+ const m = R.get(v.value);
1141
+ m && (m.loading = !1, m.canPreview = !1), n.target.alt = "加载失败";
1147
1142
  }, J = () => {
1148
1143
  if (b.value > 0 || e.infinite) {
1149
1144
  const n = b.value - 1 < 0 ? e.previewUrls.length - 1 : b.value - 1;
1150
- s(G.value[n]);
1145
+ s(W.value[n]);
1151
1146
  }
1152
1147
  }, ee = () => {
1153
- if (b.value < _.value - 1 || e.infinite) {
1148
+ if (b.value < U.value - 1 || e.infinite) {
1154
1149
  const n = b.value + 1 > e.previewUrls.length - 1 ? 0 : b.value + 1;
1155
- s(G.value[n]);
1150
+ s(W.value[n]);
1156
1151
  }
1157
- }, te = (n) => {
1158
- n ? u.value += 0.5 : u.value++, T(D);
1159
- }, ne = (n) => {
1160
- u.value > 1 && (n ? u.value -= 0.5 : u.value--), T(D);
1161
- }, ve = () => {
1162
- N.value += 90;
1163
- }, Ke = () => {
1164
- N.value -= 90;
1152
+ }, _ = (n) => {
1153
+ n ? u.value += 0.5 : u.value++, L(D);
1154
+ }, X = (n) => {
1155
+ u.value > 1 && (n ? u.value -= 0.5 : u.value--), L(D);
1156
+ }, de = () => {
1157
+ M.value += 90;
1165
1158
  }, We = () => {
1166
- O.x = -O.x;
1159
+ M.value -= 90;
1167
1160
  }, Ge = () => {
1161
+ O.x = -O.x;
1162
+ }, Xe = () => {
1168
1163
  O.y = -O.y;
1169
- }, Xe = [{
1170
- icon: L(l, e.icons, "zoomIn") || H.zoomIn,
1171
- onClick: () => te(),
1164
+ }, Me = [{
1165
+ icon: $(l, e.icons, "zoomIn") || B.zoomIn,
1166
+ onClick: () => _(),
1172
1167
  type: "zoomIn"
1173
1168
  }, {
1174
- icon: L(l, e.icons, "zoomOut") || H.zoomOut,
1175
- onClick: () => ne(),
1169
+ icon: $(l, e.icons, "zoomOut") || B.zoomOut,
1170
+ onClick: () => X(),
1176
1171
  type: "zoomOut",
1177
1172
  disabled: y(() => u.value === 1)
1178
1173
  }, {
1179
- icon: L(l, e.icons, "rotateRight") || H.rotateRight,
1180
- onClick: ve,
1174
+ icon: $(l, e.icons, "rotateRight") || B.rotateRight,
1175
+ onClick: de,
1181
1176
  type: "rotateRight"
1182
1177
  }, {
1183
- icon: L(l, e.icons, "rotateLeft") || H.rotateLeft,
1184
- onClick: Ke,
1178
+ icon: $(l, e.icons, "rotateLeft") || B.rotateLeft,
1179
+ onClick: We,
1185
1180
  type: "rotateLeft"
1186
1181
  }, {
1187
- icon: L(l, e.icons, "flipX") || H.flipX,
1188
- onClick: We,
1182
+ icon: $(l, e.icons, "flipX") || B.flipX,
1183
+ onClick: Ge,
1189
1184
  type: "flipX"
1190
1185
  }, {
1191
- icon: L(l, e.icons, "flipY") || H.flipY,
1192
- onClick: Ge,
1186
+ icon: $(l, e.icons, "flipY") || B.flipY,
1187
+ onClick: Xe,
1193
1188
  type: "flipY"
1194
1189
  }], Oe = () => {
1195
- if (d.value && w.value && R.value) {
1196
- const n = R.value.offsetWidth * u.value, g = R.value.offsetHeight * u.value, {
1197
- left: P,
1198
- top: E
1199
- } = Tt(R.value), oe = N.value % 180 !== 0;
1190
+ if (d.value && w.value && P.value) {
1191
+ const n = P.value.offsetWidth * u.value, m = P.value.offsetHeight * u.value, {
1192
+ left: T,
1193
+ top: I
1194
+ } = Rt(P.value), te = M.value % 180 !== 0;
1200
1195
  w.value = !1;
1201
- const ie = Pt(oe ? g : n, oe ? n : g, P, E);
1202
- ie && T({
1203
- ...ie
1196
+ const ne = Dt(te ? m : n, te ? n : m, T, I);
1197
+ ne && L({
1198
+ ...ne
1204
1199
  });
1205
1200
  }
1206
1201
  }, Ze = (n) => {
1207
- n.button === 0 && (n.preventDefault(), n.stopPropagation(), A.deltaX = n.pageX - I.x, A.deltaY = n.pageY - I.y, A.originX = I.x, A.originY = I.y, w.value = !0);
1202
+ n.button === 0 && (n.preventDefault(), n.stopPropagation(), A.deltaX = n.pageX - p.x, A.deltaY = n.pageY - p.y, A.originX = p.x, A.originY = p.y, w.value = !0);
1208
1203
  }, Ae = (n) => {
1209
- d.value && w.value && T({
1204
+ d.value && w.value && L({
1210
1205
  x: n.pageX - A.deltaX,
1211
1206
  y: n.pageY - A.deltaY
1212
1207
  });
1213
1208
  }, Ve = (n) => {
1214
1209
  if (!d.value) return;
1215
1210
  n.preventDefault();
1216
- const g = n.deltaY;
1217
- W.value = {
1218
- wheelDirection: g
1211
+ const m = n.deltaY;
1212
+ K.value = {
1213
+ wheelDirection: m
1219
1214
  };
1220
1215
  }, Qe = (n) => {
1221
1216
  !d.value || !k.value || (n.keyCode === a.LEFT ? J() : n.keyCode === a.RIGHT && ee());
1222
1217
  }, ke = () => {
1223
- d.value && (u.value !== 1 && (u.value = 1), (I.x !== D.x || I.y !== D.y) && T(D));
1218
+ d.value && (u.value !== 1 && (u.value = 1), (p.x !== D.x || p.y !== D.y) && L(D));
1224
1219
  };
1225
- let ge = () => {
1220
+ let fe = () => {
1226
1221
  };
1227
1222
  return De(() => {
1228
- j(() => e.previewUrls, (n) => {
1229
- Fe(n) && n.forEach((g, P) => {
1230
- S(P, g);
1223
+ H(() => e.previewUrls, (n) => {
1224
+ _e(n) && n.forEach((m, T) => {
1225
+ S(T, m);
1231
1226
  });
1232
1227
  }, {
1233
1228
  flush: "post",
1234
1229
  immediate: !0
1235
- }), j([() => d.value, w], () => {
1236
- ge();
1237
- let n, g;
1238
- const P = B(window, "mouseup", Oe, !1), E = B(window, "mousemove", Ae, !1), oe = B(window, "wheel", Ve, {
1230
+ }), H([() => d.value, w], () => {
1231
+ fe();
1232
+ let n, m;
1233
+ const T = F(window, "mouseup", Oe, !1), I = F(window, "mousemove", Ae, !1), te = F(window, "wheel", Ve, {
1239
1234
  passive: !1
1240
- }), ie = B(window, "keydown", Qe, !1);
1235
+ }), ne = F(window, "keydown", Qe, !1);
1241
1236
  try {
1242
- window.top !== window.self && (n = B(window.top, "mouseup", Oe, !1), g = B(window.top, "mousemove", Ae, !1));
1237
+ window.top !== window.self && (n = F(window.top, "mouseup", Oe, !1), m = F(window.top, "mousemove", Ae, !1));
1243
1238
  } catch (qe) {
1244
- Et(!1, `[vc-image] ${qe}`);
1239
+ Nt(!1, `[vc-image] ${qe}`);
1245
1240
  }
1246
- ge = () => {
1247
- P.remove(), E.remove(), oe.remove(), ie.remove(), n && n.remove(), g && g.remove();
1241
+ fe = () => {
1242
+ T.remove(), I.remove(), te.remove(), ne.remove(), n && n.remove(), m && m.remove();
1248
1243
  };
1249
1244
  }, {
1250
1245
  flush: "post",
1251
1246
  immediate: !0
1252
- }), j([W], () => {
1247
+ }), H([K], () => {
1253
1248
  const {
1254
1249
  wheelDirection: n
1255
- } = W.value;
1256
- n > 0 ? ne(!0) : n < 0 && te(!0);
1250
+ } = K.value;
1251
+ n > 0 ? X(!0) : n < 0 && _(!0);
1257
1252
  });
1258
1253
  }), et(() => {
1259
- ge();
1254
+ fe();
1260
1255
  }), i({
1261
- setOpen: p
1256
+ setOpen: E
1262
1257
  }), () => {
1263
- const n = Ce(`${o}-fade`), g = Ce(`${o}-zoom`), P = {};
1264
- for (const E in e.icons)
1265
- P[E] = L(l, e.icons, E);
1266
- return f(r(Ie, null, [r(Ue, {
1267
- to: e.getContainer || "body",
1268
- disabled: !e.teleported
1258
+ const n = Ee(`${o}-fade`), m = Ee(`${o}-zoom`), T = {};
1259
+ for (const I in e.icons)
1260
+ T[I] = $(l, e.icons, I);
1261
+ return f(r(Se, null, [r(ze, {
1262
+ to: e.getContainer || "body"
1269
1263
  }, {
1270
- default: () => [d.value && r(Ie, null, [r("div", {
1264
+ default: () => [d.value && r(Se, null, [r("div", {
1271
1265
  class: `${o}-root ${c.value}`
1272
- }, [r(Se, n, {
1273
- default: () => [he(r("div", {
1266
+ }, [r(ge, n, {
1267
+ default: () => [we(r("div", {
1274
1268
  class: `${o}-mask ${c.value}`
1275
- }, null), [[pe, d.value && m.value]])]
1269
+ }, null), [[he, d.value && g.value]])]
1276
1270
  }), r("div", {
1277
1271
  ref: C,
1278
1272
  tabindex: -1,
1279
1273
  class: [`${o}-wrap`, `${c.value}`],
1280
- onClick: (E) => e.onHideOnClickModal && de(E)
1281
- }, [r(Se, ze(g, {
1282
- onAfterLeave: () => F()
1274
+ onClick: (I) => e.onHideOnClickModal && ce(I)
1275
+ }, [r(ge, pe(m, {
1276
+ onAfterLeave: () => se()
1283
1277
  }), {
1284
- default: () => [he(r("div", {
1278
+ default: () => [we(r("div", {
1285
1279
  role: "dialog",
1286
1280
  class: `${o} ${c.value}`
1287
1281
  }, [r("div", {
@@ -1291,44 +1285,46 @@ const $t = /* @__PURE__ */ Me({
1291
1285
  }, [r("div", {
1292
1286
  class: `${o}-img-wrapper ${c.value}`,
1293
1287
  style: {
1294
- transform: `translate3d(${I.x}px, ${I.y}px, 0)`
1288
+ transform: `translate3d(${p.x}px, ${p.y}px, 0)`
1295
1289
  }
1296
1290
  }, [r("img", {
1297
1291
  onMousedown: Ze,
1298
1292
  onDblclick: ke,
1299
- ref: R,
1293
+ ref: P,
1300
1294
  class: `${o}-img ${c.value}`,
1301
1295
  src: Q.value,
1302
- onLoad: () => fe(),
1303
- onError: (E) => q(E),
1296
+ onLoad: () => ue(),
1297
+ onError: (I) => q(I),
1304
1298
  style: {
1305
- transform: `scale3d(${O.x * u.value}, ${O.y * u.value}, 1) rotate(${N.value}deg)`
1299
+ transform: `scale3d(${O.x * u.value}, ${O.y * u.value}, 1) rotate(${M.value}deg)`
1306
1300
  }
1307
- }, null)])])])]), [[pe, d.value && m.value]])]
1301
+ }, null)])])])]), [[he, d.value && g.value]])]
1308
1302
  })])])])]
1309
- }), d.value && m.value && r($t, {
1310
- open: d.value && m.value,
1303
+ }), d.value && g.value && r(Ut, {
1304
+ open: d.value && g.value,
1311
1305
  hashId: c.value,
1312
1306
  count: e.previewUrls.length,
1313
1307
  current: v.value,
1314
1308
  zIndex: e.zIndex + 1,
1315
1309
  getContainer: e.getContainer,
1316
1310
  prefixCls: o,
1317
- icons: P,
1318
- tools: Xe,
1311
+ icons: Et(T, Me.map(({
1312
+ type: I
1313
+ }) => I)),
1314
+ tools: Me,
1319
1315
  infinite: e.infinite,
1320
1316
  countRender: dt(l, e, "countRenders"),
1321
1317
  showSwitch: k.value,
1322
- showProgress: X.value,
1318
+ showProgress: G.value,
1323
1319
  onClose: x,
1324
- onActive: (E) => E > 0 ? ee() : J()
1320
+ onActive: (I) => I > 0 ? ee() : J()
1325
1321
  }, null)]));
1326
1322
  };
1327
1323
  }
1328
- }), we = {
1324
+ }), me = {
1329
1325
  width: "100%",
1330
1326
  height: "100%"
1331
- }, Ut = () => ({
1327
+ }, Ft = () => ({
1332
1328
  position: "absolute",
1333
1329
  inset: 0,
1334
1330
  display: "flex",
@@ -1336,13 +1332,13 @@ const $t = /* @__PURE__ */ Me({
1336
1332
  justifyContent: "center",
1337
1333
  cursor: "pointer",
1338
1334
  opacity: 0
1339
- }), zt = (e) => ({
1335
+ }), Bt = (e) => ({
1340
1336
  [e.componentCls]: {
1341
1337
  display: "inline-block",
1342
1338
  position: "relative",
1343
1339
  overflow: "hidden",
1344
1340
  "&-inner": {
1345
- ...we,
1341
+ ...me,
1346
1342
  verticalAlign: "top",
1347
1343
  opacity: 1,
1348
1344
  [`&${e.componentCls}-inner-preview`]: {
@@ -1350,7 +1346,7 @@ const $t = /* @__PURE__ */ Me({
1350
1346
  }
1351
1347
  },
1352
1348
  "&-placeholder": {
1353
- ...we,
1349
+ ...me,
1354
1350
  backgroundColor: e.colorBgContainerDisabled,
1355
1351
  backgroundImage: "url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",
1356
1352
  backgroundRepeat: "no-repeat",
@@ -1358,19 +1354,19 @@ const $t = /* @__PURE__ */ Me({
1358
1354
  backgroundSize: "30%"
1359
1355
  },
1360
1356
  "&-error": {
1361
- ...we,
1357
+ ...me,
1362
1358
  display: "flex",
1363
1359
  alignItems: "center",
1364
1360
  justifyContent: "center",
1365
1361
  color: e.colorText,
1366
1362
  backgroundColor: e.colorBgContainerDisabled
1367
1363
  },
1368
- "&-preview": Ut()
1364
+ "&-preview": Ft()
1369
1365
  }
1370
- }), _t = (e) => e && e.nodeType === Node.ELEMENT_NODE;
1366
+ }), Ht = (e) => e && e.nodeType === Node.ELEMENT_NODE;
1371
1367
  let $e = "";
1372
- const ce = /* @__PURE__ */ Me({
1373
- props: se,
1368
+ const jt = [...Ke, "fallback", "placeholder"], le = /* @__PURE__ */ ye({
1369
+ props: Fe,
1374
1370
  name: "GImage",
1375
1371
  emits: ["error", "click", "load"],
1376
1372
  slots: Object,
@@ -1379,51 +1375,55 @@ const ce = /* @__PURE__ */ Me({
1379
1375
  emit: i,
1380
1376
  attrs: l
1381
1377
  }) {
1382
- const o = _e({
1378
+ const o = Ue({
1383
1379
  suffixCls: "image"
1384
1380
  }), {
1385
1381
  wrapSSR: f,
1386
1382
  hashId: c
1387
- } = It("Image", [zt], o), d = M(), p = M(""), m = M(!1), h = M(!0), C = M(!1), v = M(null), u = M();
1388
- let N, w;
1389
- const O = y(() => !le && e.fit ? {
1383
+ } = It("Image", [Bt], o), d = N(), E = N(""), g = N(!1), h = N(!0), C = N(!1), v = N(null), u = N();
1384
+ let M, w;
1385
+ const O = y(() => !ie && e.fit ? {
1390
1386
  "object-fit": e.fit
1391
- } : {}), I = y(() => Fe(e.previewUrls) && e.previewUrls.length > 0), T = y(() => {
1387
+ } : {}), p = y(() => {
1392
1388
  const {
1393
- src: s,
1394
- previewUrls: S,
1395
- current: x
1396
- } = e;
1397
- if (Ee(x)) return S.length >= x ? x : 0;
1398
- const F = S.indexOf(s);
1399
- return F >= 0 ? F : 0;
1400
- }), W = (s) => {
1401
- p.value = e.src, h.value = !1, m.value = !1, i("load", s);
1402
- }, R = (s) => {
1403
- h.value = !1, m.value = !0, i("error", s);
1389
+ previewUrls: s
1390
+ } = e.preview;
1391
+ return _e(s) && s.length > 0 || e.showPreview;
1392
+ }), L = y(() => {
1393
+ const {
1394
+ previewUrls: s = [],
1395
+ current: S = 0
1396
+ } = e.preview;
1397
+ if (Ie(S)) return s.length >= S ? S : 0;
1398
+ const x = s.indexOf(e.src);
1399
+ return x >= 0 ? x : 0;
1400
+ }), K = (s) => {
1401
+ E.value = e.src, h.value = !1, g.value = !1, i("load", s);
1402
+ }, P = (s) => {
1403
+ h.value = !1, g.value = !0, i("error", s);
1404
1404
  }, A = () => {
1405
- if (le) return;
1406
- h.value = !0, m.value = !1;
1405
+ if (ie) return;
1406
+ h.value = !0, g.value = !1;
1407
1407
  const s = new Image();
1408
- s.onload = (S) => W(S), s.onerror = R, Object.keys(l || {}).forEach((S) => {
1408
+ s.onload = (S) => K(S), s.onerror = P, Object.keys(l || {}).forEach((S) => {
1409
1409
  if (S.toLowerCase() === "onload") return;
1410
1410
  const x = (l || {})[S];
1411
1411
  s.setAttribute(S, x);
1412
1412
  }), s.src = e.src;
1413
- }, $ = pt(Q, 200), z = () => {
1414
- le || !u.value || !$ || (N(), u.value = void 0);
1413
+ }, R = yt(Q, 200), z = () => {
1414
+ ie || !u.value || !R || (M(), u.value = void 0);
1415
1415
  };
1416
1416
  function Q() {
1417
1417
  ft(v.value, u.value) && (A(), z());
1418
1418
  }
1419
- const _ = async () => {
1420
- if (le) return;
1419
+ const U = async () => {
1420
+ if (ie) return;
1421
1421
  await ot();
1422
1422
  const {
1423
1423
  scrollContainer: s
1424
1424
  } = e;
1425
- _t(s) ? u.value = s : vt(s) && s !== "" ? u.value = document.querySelector(s) ?? void 0 : v.value && (u.value = gt(v.value)), u.value && (N = Te(u, "scroll", $), setTimeout(() => Q(), 200));
1426
- }, G = (s) => {
1425
+ Ht(s) ? u.value = s : mt(s) && s !== "" ? u.value = document.querySelector(s) ?? void 0 : v.value && (u.value = gt(v.value)), u.value && (M = be(u, "scroll", R), setTimeout(() => Q(), 200));
1426
+ }, W = (s) => {
1427
1427
  if (s.ctrlKey) {
1428
1428
  if (s.deltaY < 0)
1429
1429
  return s.preventDefault(), !1;
@@ -1431,94 +1431,95 @@ const ce = /* @__PURE__ */ Me({
1431
1431
  return s.preventDefault(), !1;
1432
1432
  }
1433
1433
  }, b = () => {
1434
- I.value && (w = Te("wheel", G, {
1434
+ p.value && (w = be("wheel", W, {
1435
1435
  passive: !1
1436
1436
  }), $e = document.body.style.overflow, document.body.style.overflow = "hidden", C.value = !0);
1437
1437
  }, k = () => {
1438
1438
  w == null || w(), document.body.style.overflow = $e, C.value = !1;
1439
1439
  };
1440
- j(() => e.src, () => {
1441
- e.lazy ? (h.value = !0, m.value = !1, z(), _()) : A();
1440
+ H(() => e.src, () => {
1441
+ e.lazy ? (h.value = !0, g.value = !1, z(), U()) : A();
1442
1442
  }), tt(() => {
1443
1443
  var s, S;
1444
- I.value && C.value ? (s = d.value) == null || s.setOpen(!0) : (S = d.value) == null || S.setOpen(!1);
1444
+ p.value && C.value ? (s = d.value) == null || s.setOpen(!0) : (S = d.value) == null || S.setOpen(!1);
1445
1445
  });
1446
- const X = (s) => Ee(s) ? s + "px" : s;
1447
- return mt(() => {
1448
- e.lazy ? _() : A();
1446
+ const G = (s) => Ie(s) ? s + "px" : s;
1447
+ return wt(() => {
1448
+ e.lazy ? U() : A();
1449
1449
  }), () => {
1450
+ var X;
1450
1451
  const {
1451
1452
  crossorigin: s,
1452
1453
  decoding: S,
1453
1454
  alt: x,
1454
- sizes: F,
1455
- srcset: de,
1456
- usemap: fe,
1455
+ sizes: se,
1456
+ srcset: ce,
1457
+ usemap: ue,
1457
1458
  class: q,
1458
1459
  style: J = {}
1459
1460
  } = l, ee = {
1460
1461
  crossorigin: s,
1461
1462
  decoding: S,
1462
1463
  alt: x,
1463
- sizes: F,
1464
- srcset: de,
1465
- usemap: fe,
1464
+ sizes: se,
1465
+ srcset: ce,
1466
+ usemap: ue,
1466
1467
  style: {
1467
1468
  ...O.value,
1468
- height: e.height ? X(e.height) : void 0
1469
+ height: e.height ? G(e.height) : void 0
1469
1470
  }
1470
- }, te = L(t, e, "fallback"), ne = L(t, e, "placeholder");
1471
+ }, _ = vt(jt, t, e, {
1472
+ render: !0
1473
+ });
1471
1474
  return f(r("div", {
1472
1475
  class: {
1473
1476
  [`${c.value}`]: !0,
1474
1477
  [`${o}`]: !0,
1475
1478
  [`${q}`]: !!q
1476
1479
  },
1477
- ref: (ve) => v.value = ve,
1480
+ ref: (de) => v.value = de,
1478
1481
  style: {
1479
- width: e.width ? X(e.width) : void 0,
1480
- height: e.height ? X(e.height) : void 0,
1482
+ width: e.width ? G(e.width) : void 0,
1483
+ height: e.height ? G(e.height) : void 0,
1481
1484
  display: e.lazy ? "block" : void 0,
1482
1485
  ...J
1483
1486
  },
1484
1487
  onClick: () => {
1485
1488
  i("click");
1486
1489
  }
1487
- }, [h.value ? ne || r("div", {
1490
+ }, [h.value ? _.placeholder || r("div", {
1488
1491
  class: `${o}-placeholder ${c.value}`
1489
- }, null) : m.value ? te || r("div", {
1492
+ }, null) : g.value ? _.fallback || r("div", {
1490
1493
  class: `${o}-error ${c.value}`
1491
- }, [nt("加载失败")]) : p.value && r("img", ze(ee, {
1494
+ }, [nt("加载失败")]) : E.value && r("img", pe(ee, {
1492
1495
  class: {
1493
1496
  [`${c.value}`]: !0,
1494
1497
  [`${e.imageClassName}`]: !!e.imageClassName,
1495
1498
  [`${o}-inner`]: !0,
1496
- [`${o}-inner-preview`]: I.value
1499
+ [`${o}-inner-preview`]: p.value
1497
1500
  },
1498
1501
  alt: e.alt,
1499
- src: p.value
1500
- }), null), I.value && r("div", {
1502
+ src: E.value
1503
+ }), null), p.value && r("div", {
1501
1504
  class: `${o}-preview ${c.value}`,
1502
1505
  onClick: () => b()
1503
- }, null), r(Dt, {
1504
- ref: d,
1505
- zIndex: e.zIndex,
1506
- infinite: e.infinite,
1507
- current: T.value,
1508
- previewUrls: e.previewUrls,
1509
- getContainer: e.getContainer,
1506
+ }, null), p.value && r(_t, pe({
1507
+ ref: d
1508
+ }, e.preview, Ct(_, Ke), {
1509
+ previewUrls: ((X = e.preview) == null ? void 0 : X.previewUrls) || [e.src],
1510
+ current: L.value,
1510
1511
  onClose: () => k()
1511
- }, null)]));
1512
+ }), null)]));
1512
1513
  };
1513
1514
  }
1514
1515
  });
1515
- ce.isGImage = !0;
1516
- ce.install = (e) => (e.component(ce.name, ce), e);
1516
+ le.isGImage = !0;
1517
+ le.install = (e) => (e.component(le.name, le), e);
1517
1518
  export {
1518
- ce as GImage,
1519
- Dt as ImagePreview,
1520
- U as baseProps,
1521
- ce as default,
1522
- se as imagePorps,
1523
- Y as imagePreviewProps
1519
+ le as GImage,
1520
+ _t as ImagePreview,
1521
+ V as baseProps,
1522
+ le as default,
1523
+ Fe as imagePorps,
1524
+ j as imagePreviewProps
1524
1525
  };