@gx-design-vue/image 0.2.0-beta.10 → 0.2.0-beta.12

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.mjs CHANGED
@@ -1,22 +1,139 @@
1
- import { createVNode as u, defineComponent as Ve, shallowRef as Te, ref as w, computed as L, watch as le, nextTick as Ye, Teleport as _e, Transition as ke, withDirectives as ze, vShow as Oe, mergeProps as We, cloneVNode as qe, watchEffect as Qe, Fragment as Je, createTextVNode as Ke } from "vue";
2
- import { ExpandOutlined as et, OneToOneOutlined as tt, CloseOutlined as nt, ZoomInOutlined as at, ZoomOutOutlined as it, RotateRightOutlined as rt, RotateLeftOutlined as ot, LeftOutlined as st, RightOutlined as lt } from "@ant-design/icons-vue";
3
- import { isServer as q, getPrefixCls as Ge, getSlotVNode as Le, isInContainer as ut, isString as ct, getScrollContainer as ft, isNumber as dt } from "@gx-design-vue/pro-utils";
4
- import { useState as Ne, onMountedOrActivated as Ue } from "@gx-design-vue/pro-hooks";
5
- import { Keyframe as fe, useStyle as ht, mergeToken as gt, getTransitionProps as $e, useProStyle as vt } from "@gx-design-vue/pro-provider";
6
- import { createTypes as pt } from "vue-types";
7
- import { useThrottleFn as mt, useEventListener as Ee } from "@vueuse/core";
8
- function g(e, t) {
9
- bt(e) && (e = "100%");
10
- var n = yt(e);
1
+ import { createTypes as Xe } from "vue-types";
2
+ import { createVNode as c, defineComponent as Ve, shallowRef as Te, ref as A, reactive as _e, computed as N, watch as q, nextTick as Ye, Teleport as qe, Transition as ke, withDirectives as ze, vShow as Oe, mergeProps as We, cloneVNode as Qe, watchEffect as Je, Fragment as Ke, createTextVNode as et } from "vue";
3
+ import { ExpandOutlined as tt, OneToOneOutlined as nt, CloseOutlined as at, ZoomInOutlined as it, ZoomOutOutlined as rt, RotateRightOutlined as ot, RotateLeftOutlined as st, LeftOutlined as lt, RightOutlined as ut } from "@ant-design/icons-vue";
4
+ import { isServer as Q, getPrefixCls as Ge, getSlotVNode as Le, isInContainer as ct, isString as ft, getScrollContainer as dt, isNumber as ht } from "@gx-design-vue/pro-utils";
5
+ import { useState as Ne, onMountedOrActivated as gt } from "@gx-design-vue/pro-hooks";
6
+ import { Keyframe as ce, useStyle as vt, mergeToken as mt, getTransitionProps as $e, useProStyle as pt } from "@gx-design-vue/pro-provider";
7
+ import { useThrottleFn as bt, useEventListener as Ee } from "@vueuse/core";
8
+ const Ue = Xe({
9
+ func: void 0,
10
+ bool: void 0,
11
+ string: void 0,
12
+ number: void 0,
13
+ array: void 0,
14
+ object: void 0,
15
+ integer: void 0
16
+ });
17
+ Ue.extend([{
18
+ name: "looseBool",
19
+ getter: !0,
20
+ type: Boolean,
21
+ default: void 0
22
+ }, {
23
+ name: "style",
24
+ getter: !0,
25
+ type: [String, Object],
26
+ default: void 0
27
+ }, {
28
+ name: "VueNode",
29
+ getter: !0,
30
+ type: null
31
+ }]);
32
+ const V = Ue, H = {
33
+ infinite: {
34
+ type: Boolean,
35
+ default: !0
36
+ },
37
+ zIndex: {
38
+ type: Number,
39
+ default: 2e3
40
+ },
41
+ initialIndex: {
42
+ type: Number,
43
+ default: 0
44
+ },
45
+ getContainer: {
46
+ type: String
47
+ }
48
+ }, le = {
49
+ previewTeleported: {
50
+ type: Boolean,
51
+ default: !0
52
+ },
53
+ hideOnClickModal: {
54
+ type: Boolean,
55
+ default: !0
56
+ },
57
+ src: {
58
+ type: String,
59
+ default: ""
60
+ },
61
+ alt: {
62
+ type: String,
63
+ default: ""
64
+ },
65
+ fit: {
66
+ type: String,
67
+ default: "contain"
68
+ },
69
+ lazy: V.bool,
70
+ scrollContainer: {
71
+ type: [String, Object]
72
+ },
73
+ placeholder: {
74
+ type: [Function, Object],
75
+ default: () => {
76
+ }
77
+ },
78
+ fallback: {
79
+ type: [Function, Object],
80
+ default: () => {
81
+ }
82
+ },
83
+ onLoad: {
84
+ type: Function
85
+ },
86
+ onError: {
87
+ type: Function
88
+ },
89
+ onClick: {
90
+ type: Function
91
+ },
92
+ disablePreview: V.bool,
93
+ previewSrcList: {
94
+ type: Array,
95
+ default: () => []
96
+ },
97
+ imageClassName: V.string,
98
+ imageStyle: V.style,
99
+ width: V.number,
100
+ height: V.number,
101
+ zIndex: H.zIndex,
102
+ infinite: H.infinite,
103
+ getContainer: H.getContainer,
104
+ initialIndex: {
105
+ ...H.initialIndex,
106
+ default: () => {
107
+ }
108
+ }
109
+ }, yt = {
110
+ urlList: {
111
+ type: Array,
112
+ default: () => []
113
+ },
114
+ teleported: le.previewTeleported,
115
+ zIndex: H.zIndex,
116
+ initialIndex: H.initialIndex,
117
+ infinite: H.infinite,
118
+ getContainer: le.getContainer,
119
+ onHideOnClickModal: le.hideOnClickModal,
120
+ icons: {
121
+ type: Object,
122
+ default: () => ({})
123
+ }
124
+ };
125
+ function v(e, t) {
126
+ wt(e) && (e = "100%");
127
+ var n = St(e);
11
128
  return e = t === 360 ? e : Math.min(t, Math.max(0, parseFloat(e))), n && (e = parseInt(String(e * t), 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : (t === 360 ? e = (e < 0 ? e % t + t : e % t) / parseFloat(String(t)) : e = e % t / parseFloat(String(t)), e);
12
129
  }
13
130
  function re(e) {
14
131
  return Math.min(1, Math.max(0, e));
15
132
  }
16
- function bt(e) {
133
+ function wt(e) {
17
134
  return typeof e == "string" && e.indexOf(".") !== -1 && parseFloat(e) === 1;
18
135
  }
19
- function yt(e) {
136
+ function St(e) {
20
137
  return typeof e == "string" && e.indexOf("%") !== -1;
21
138
  }
22
139
  function Ze(e) {
@@ -25,32 +142,32 @@ function Ze(e) {
25
142
  function oe(e) {
26
143
  return e <= 1 ? "".concat(Number(e) * 100, "%") : e;
27
144
  }
28
- function H(e) {
145
+ function P(e) {
29
146
  return e.length === 1 ? "0" + e : String(e);
30
147
  }
31
- function wt(e, t, n) {
148
+ function xt(e, t, n) {
32
149
  return {
33
- r: g(e, 255) * 255,
34
- g: g(t, 255) * 255,
35
- b: g(n, 255) * 255
150
+ r: v(e, 255) * 255,
151
+ g: v(t, 255) * 255,
152
+ b: v(n, 255) * 255
36
153
  };
37
154
  }
38
155
  function Re(e, t, n) {
39
- e = g(e, 255), t = g(t, 255), n = g(n, 255);
156
+ e = v(e, 255), t = v(t, 255), n = v(n, 255);
40
157
  var a = Math.max(e, t, n), i = Math.min(e, t, n), r = 0, o = 0, l = (a + i) / 2;
41
158
  if (a === i)
42
159
  o = 0, r = 0;
43
160
  else {
44
- var c = a - i;
45
- switch (o = l > 0.5 ? c / (2 - a - i) : c / (a + i), a) {
161
+ var f = a - i;
162
+ switch (o = l > 0.5 ? f / (2 - a - i) : f / (a + i), a) {
46
163
  case e:
47
- r = (t - n) / c + (t < n ? 6 : 0);
164
+ r = (t - n) / f + (t < n ? 6 : 0);
48
165
  break;
49
166
  case t:
50
- r = (n - e) / c + 2;
167
+ r = (n - e) / f + 2;
51
168
  break;
52
169
  case n:
53
- r = (e - t) / c + 4;
170
+ r = (e - t) / f + 4;
54
171
  break;
55
172
  }
56
173
  r /= 6;
@@ -60,9 +177,9 @@ function Re(e, t, n) {
60
177
  function be(e, t, n) {
61
178
  return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * (6 * n) : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
62
179
  }
63
- function St(e, t, n) {
180
+ function Mt(e, t, n) {
64
181
  var a, i, r;
65
- if (e = g(e, 360), t = g(t, 100), n = g(n, 100), t === 0)
182
+ if (e = v(e, 360), t = v(t, 100), n = v(n, 100), t === 0)
66
183
  i = n, r = n, a = n;
67
184
  else {
68
185
  var o = n < 0.5 ? n * (1 + t) : n + t - n * t, l = 2 * n - o;
@@ -71,8 +188,8 @@ function St(e, t, n) {
71
188
  return { r: a * 255, g: i * 255, b: r * 255 };
72
189
  }
73
190
  function De(e, t, n) {
74
- e = g(e, 255), t = g(t, 255), n = g(n, 255);
75
- var a = Math.max(e, t, n), i = Math.min(e, t, n), r = 0, o = a, l = a - i, c = a === 0 ? 0 : l / a;
191
+ e = v(e, 255), t = v(t, 255), n = v(n, 255);
192
+ var a = Math.max(e, t, n), i = Math.min(e, t, n), r = 0, o = a, l = a - i, f = a === 0 ? 0 : l / a;
76
193
  if (a === i)
77
194
  r = 0;
78
195
  else {
@@ -89,40 +206,40 @@ function De(e, t, n) {
89
206
  }
90
207
  r /= 6;
91
208
  }
92
- return { h: r, s: c, v: o };
209
+ return { h: r, s: f, v: o };
93
210
  }
94
- function xt(e, t, n) {
95
- e = g(e, 360) * 6, t = g(t, 100), n = g(n, 100);
96
- var a = Math.floor(e), i = e - a, r = n * (1 - t), o = n * (1 - i * t), l = n * (1 - (1 - i) * t), c = a % 6, S = [n, o, r, r, l, n][c], p = [l, n, n, o, r, r][c], $ = [r, r, l, n, n, o][c];
97
- return { r: S * 255, g: p * 255, b: $ * 255 };
211
+ function It(e, t, n) {
212
+ e = v(e, 360) * 6, t = v(t, 100), n = v(n, 100);
213
+ var a = Math.floor(e), i = e - a, r = n * (1 - t), o = n * (1 - i * t), l = n * (1 - (1 - i) * t), f = a % 6, S = [n, o, r, r, l, n][f], m = [l, n, n, o, r, r][f], E = [r, r, l, n, n, o][f];
214
+ return { r: S * 255, g: m * 255, b: E * 255 };
98
215
  }
99
216
  function He(e, t, n, a) {
100
217
  var i = [
101
- H(Math.round(e).toString(16)),
102
- H(Math.round(t).toString(16)),
103
- H(Math.round(n).toString(16))
218
+ P(Math.round(e).toString(16)),
219
+ P(Math.round(t).toString(16)),
220
+ P(Math.round(n).toString(16))
104
221
  ];
105
222
  return a && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) : i.join("");
106
223
  }
107
- function Mt(e, t, n, a, i) {
224
+ function At(e, t, n, a, i) {
108
225
  var r = [
109
- H(Math.round(e).toString(16)),
110
- H(Math.round(t).toString(16)),
111
- H(Math.round(n).toString(16)),
112
- H(It(a))
226
+ P(Math.round(e).toString(16)),
227
+ P(Math.round(t).toString(16)),
228
+ P(Math.round(n).toString(16)),
229
+ P(Ct(a))
113
230
  ];
114
231
  return i && r[0].startsWith(r[0].charAt(1)) && r[1].startsWith(r[1].charAt(1)) && r[2].startsWith(r[2].charAt(1)) && r[3].startsWith(r[3].charAt(1)) ? r[0].charAt(0) + r[1].charAt(0) + r[2].charAt(0) + r[3].charAt(0) : r.join("");
115
232
  }
116
- function It(e) {
233
+ function Ct(e) {
117
234
  return Math.round(parseFloat(e) * 255).toString(16);
118
235
  }
119
236
  function Pe(e) {
120
- return y(e) / 255;
237
+ return w(e) / 255;
121
238
  }
122
- function y(e) {
239
+ function w(e) {
123
240
  return parseInt(e, 16);
124
241
  }
125
- function At(e) {
242
+ function Tt(e) {
126
243
  return {
127
244
  r: e >> 16,
128
245
  g: (e & 65280) >> 8,
@@ -279,9 +396,9 @@ var Ae = {
279
396
  yellow: "#ffff00",
280
397
  yellowgreen: "#9acd32"
281
398
  };
282
- function Ct(e) {
399
+ function kt(e) {
283
400
  var t = { r: 0, g: 0, b: 0 }, n = 1, a = null, i = null, r = null, o = !1, l = !1;
284
- return typeof e == "string" && (e = zt(e)), typeof e == "object" && (z(e.r) && z(e.g) && z(e.b) ? (t = wt(e.r, e.g, e.b), o = !0, l = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : z(e.h) && z(e.s) && z(e.v) ? (a = oe(e.s), i = oe(e.v), t = xt(e.h, a, i), o = !0, l = "hsv") : z(e.h) && z(e.s) && z(e.l) && (a = oe(e.s), r = oe(e.l), t = St(e.h, a, r), o = !0, l = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a)), n = Ze(n), {
401
+ return typeof e == "string" && (e = Lt(e)), typeof e == "object" && (L(e.r) && L(e.g) && L(e.b) ? (t = xt(e.r, e.g, e.b), o = !0, l = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : L(e.h) && L(e.s) && L(e.v) ? (a = oe(e.s), i = oe(e.v), t = It(e.h, a, i), o = !0, l = "hsv") : L(e.h) && L(e.s) && L(e.l) && (a = oe(e.s), r = oe(e.l), t = Mt(e.h, a, r), o = !0, l = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a)), n = Ze(n), {
285
402
  ok: o,
286
403
  format: e.format || l,
287
404
  r: Math.min(255, Math.max(t.r, 0)),
@@ -290,8 +407,8 @@ function Ct(e) {
290
407
  a: n
291
408
  };
292
409
  }
293
- var Tt = "[-\\+]?\\d+%?", kt = "[-\\+]?\\d*\\.\\d+%?", N = "(?:".concat(kt, ")|(?:").concat(Tt, ")"), ye = "[\\s|\\(]+(".concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")\\s*\\)?"), we = "[\\s|\\(]+(".concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")\\s*\\)?"), I = {
294
- CSS_UNIT: new RegExp(N),
410
+ var zt = "[-\\+]?\\d+%?", Ot = "[-\\+]?\\d*\\.\\d+%?", $ = "(?:".concat(Ot, ")|(?:").concat(zt, ")"), ye = "[\\s|\\(]+(".concat($, ")[,|\\s]+(").concat($, ")[,|\\s]+(").concat($, ")\\s*\\)?"), we = "[\\s|\\(]+(".concat($, ")[,|\\s]+(").concat($, ")[,|\\s]+(").concat($, ")[,|\\s]+(").concat($, ")\\s*\\)?"), C = {
411
+ CSS_UNIT: new RegExp($),
295
412
  rgb: new RegExp("rgb" + ye),
296
413
  rgba: new RegExp("rgba" + we),
297
414
  hsl: new RegExp("hsl" + ye),
@@ -303,7 +420,7 @@ var Tt = "[-\\+]?\\d+%?", kt = "[-\\+]?\\d*\\.\\d+%?", N = "(?:".concat(kt, ")|(
303
420
  hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
304
421
  hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
305
422
  };
306
- function zt(e) {
423
+ function Lt(e) {
307
424
  if (e = e.trim().toLowerCase(), e.length === 0)
308
425
  return !1;
309
426
  var t = !1;
@@ -311,35 +428,35 @@ function zt(e) {
311
428
  e = Ae[e], t = !0;
312
429
  else if (e === "transparent")
313
430
  return { r: 0, g: 0, b: 0, a: 0, format: "name" };
314
- var n = I.rgb.exec(e);
315
- return n ? { r: n[1], g: n[2], b: n[3] } : (n = I.rgba.exec(e), n ? { r: n[1], g: n[2], b: n[3], a: n[4] } : (n = I.hsl.exec(e), n ? { h: n[1], s: n[2], l: n[3] } : (n = I.hsla.exec(e), n ? { h: n[1], s: n[2], l: n[3], a: n[4] } : (n = I.hsv.exec(e), n ? { h: n[1], s: n[2], v: n[3] } : (n = I.hsva.exec(e), n ? { h: n[1], s: n[2], v: n[3], a: n[4] } : (n = I.hex8.exec(e), n ? {
316
- r: y(n[1]),
317
- g: y(n[2]),
318
- b: y(n[3]),
431
+ var n = C.rgb.exec(e);
432
+ return n ? { r: n[1], g: n[2], b: n[3] } : (n = C.rgba.exec(e), n ? { r: n[1], g: n[2], b: n[3], a: n[4] } : (n = C.hsl.exec(e), n ? { h: n[1], s: n[2], l: n[3] } : (n = C.hsla.exec(e), n ? { h: n[1], s: n[2], l: n[3], a: n[4] } : (n = C.hsv.exec(e), n ? { h: n[1], s: n[2], v: n[3] } : (n = C.hsva.exec(e), n ? { h: n[1], s: n[2], v: n[3], a: n[4] } : (n = C.hex8.exec(e), n ? {
433
+ r: w(n[1]),
434
+ g: w(n[2]),
435
+ b: w(n[3]),
319
436
  a: Pe(n[4]),
320
437
  format: t ? "name" : "hex8"
321
- } : (n = I.hex6.exec(e), n ? {
322
- r: y(n[1]),
323
- g: y(n[2]),
324
- b: y(n[3]),
438
+ } : (n = C.hex6.exec(e), n ? {
439
+ r: w(n[1]),
440
+ g: w(n[2]),
441
+ b: w(n[3]),
325
442
  format: t ? "name" : "hex"
326
- } : (n = I.hex4.exec(e), n ? {
327
- r: y(n[1] + n[1]),
328
- g: y(n[2] + n[2]),
329
- b: y(n[3] + n[3]),
443
+ } : (n = C.hex4.exec(e), n ? {
444
+ r: w(n[1] + n[1]),
445
+ g: w(n[2] + n[2]),
446
+ b: w(n[3] + n[3]),
330
447
  a: Pe(n[4] + n[4]),
331
448
  format: t ? "name" : "hex8"
332
- } : (n = I.hex3.exec(e), n ? {
333
- r: y(n[1] + n[1]),
334
- g: y(n[2] + n[2]),
335
- b: y(n[3] + n[3]),
449
+ } : (n = C.hex3.exec(e), n ? {
450
+ r: w(n[1] + n[1]),
451
+ g: w(n[2] + n[2]),
452
+ b: w(n[3] + n[3]),
336
453
  format: t ? "name" : "hex"
337
454
  } : !1)))))))));
338
455
  }
339
- function z(e) {
340
- return !!I.CSS_UNIT.exec(String(e));
456
+ function L(e) {
457
+ return !!C.CSS_UNIT.exec(String(e));
341
458
  }
342
- var Q = (
459
+ var J = (
343
460
  /** @class */
344
461
  function() {
345
462
  function e(t, n) {
@@ -347,8 +464,8 @@ var Q = (
347
464
  var a;
348
465
  if (t instanceof e)
349
466
  return t;
350
- typeof t == "number" && (t = At(t)), this.originalInput = t;
351
- var i = Ct(t);
467
+ typeof t == "number" && (t = Tt(t)), this.originalInput = t;
468
+ var i = kt(t);
352
469
  this.originalInput = t, this.r = i.r, this.g = i.g, this.b = i.b, this.a = i.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (a = n.format) !== null && a !== void 0 ? a : i.format, this.gradientType = n.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = i.ok;
353
470
  }
354
471
  return e.prototype.isDark = function() {
@@ -385,7 +502,7 @@ var Q = (
385
502
  }, e.prototype.toHexString = function(t) {
386
503
  return t === void 0 && (t = !1), "#" + this.toHex(t);
387
504
  }, e.prototype.toHex8 = function(t) {
388
- return t === void 0 && (t = !1), Mt(this.r, this.g, this.b, this.a, t);
505
+ return t === void 0 && (t = !1), At(this.r, this.g, this.b, this.a, t);
389
506
  }, e.prototype.toHex8String = function(t) {
390
507
  return t === void 0 && (t = !1), "#" + this.toHex8(t);
391
508
  }, e.prototype.toRgb = function() {
@@ -400,7 +517,7 @@ var Q = (
400
517
  return this.a === 1 ? "rgb(".concat(t, ", ").concat(n, ", ").concat(a, ")") : "rgba(".concat(t, ", ").concat(n, ", ").concat(a, ", ").concat(this.roundA, ")");
401
518
  }, e.prototype.toPercentageRgb = function() {
402
519
  var t = function(n) {
403
- return "".concat(Math.round(g(n, 255) * 100), "%");
520
+ return "".concat(Math.round(v(n, 255) * 100), "%");
404
521
  };
405
522
  return {
406
523
  r: t(this.r),
@@ -410,7 +527,7 @@ var Q = (
410
527
  };
411
528
  }, e.prototype.toPercentageRgbString = function() {
412
529
  var t = function(n) {
413
- return Math.round(g(n, 255) * 100);
530
+ return Math.round(v(n, 255) * 100);
414
531
  };
415
532
  return this.a === 1 ? "rgb(".concat(t(this.r), "%, ").concat(t(this.g), "%, ").concat(t(this.b), "%)") : "rgba(".concat(t(this.r), "%, ").concat(t(this.g), "%, ").concat(t(this.b), "%, ").concat(this.roundA, ")");
416
533
  }, e.prototype.toName = function() {
@@ -512,21 +629,21 @@ var Q = (
512
629
  }, e;
513
630
  }()
514
631
  );
515
- const Ot = new fe("viewFadeIn", {
632
+ const Nt = new ce("viewFadeIn", {
516
633
  "0%": {
517
634
  opacity: 0
518
635
  },
519
636
  "100%": {
520
637
  opacity: 1
521
638
  }
522
- }), Lt = new fe("viewFadeOut", {
639
+ }), $t = new ce("viewFadeOut", {
523
640
  "0%": {
524
641
  opacity: 1
525
642
  },
526
643
  "100%": {
527
644
  opacity: 0
528
645
  }
529
- }), Nt = new fe("viewZoomBadgeIn", {
646
+ }), Et = new ce("viewZoomBadgeIn", {
530
647
  "0%": {
531
648
  transform: "scale(0.2)",
532
649
  opacity: 0
@@ -535,7 +652,7 @@ const Ot = new fe("viewFadeIn", {
535
652
  transform: "scale(1)",
536
653
  opacity: 1
537
654
  }
538
- }), $t = new fe("viewZoomBadgeOut", {
655
+ }), Rt = new ce("viewZoomBadgeOut", {
539
656
  "0%": {
540
657
  transform: "scale(1)"
541
658
  },
@@ -556,7 +673,7 @@ function Se(e) {
556
673
  insetInlineStart: 0
557
674
  };
558
675
  }
559
- const Et = (e) => ({
676
+ const Dt = (e) => ({
560
677
  boxSizing: "border-box",
561
678
  margin: 0,
562
679
  padding: 0,
@@ -565,11 +682,11 @@ const Et = (e) => ({
565
682
  lineHeight: e.lineHeight,
566
683
  listStyle: "none",
567
684
  fontFamily: e.fontFamily
568
- }), Rt = (e) => {
569
- const { componentCls: t, modalMaskBg: n, paddingSM: a, previewOperationColorDisabled: i, motionDurationSlow: r } = e, o = new Q(n).setAlpha(0.1), l = o.clone().setAlpha(0.2);
685
+ }), Ht = (e) => {
686
+ const { componentCls: t, modalMaskBg: n, paddingSM: a, previewOperationColorDisabled: i, motionDurationSlow: r } = e, o = new J(n).setAlpha(0.1), l = o.clone().setAlpha(0.2);
570
687
  return {
571
688
  [`${t}-operations`]: {
572
- ...Et(e),
689
+ ...Dt(e),
573
690
  display: "flex",
574
691
  flexDirection: "row-reverse",
575
692
  alignItems: "center",
@@ -604,8 +721,8 @@ const Et = (e) => ({
604
721
  }
605
722
  }
606
723
  };
607
- }, Dt = (e) => {
608
- const { modalMaskBg: t, previewOperationColorDisabled: n, zIndexPopup: a, motionDurationSlow: i } = e, r = new Q(t).setAlpha(0.1), o = r.clone().setAlpha(0.2);
724
+ }, Pt = (e) => {
725
+ const { modalMaskBg: t, previewOperationColorDisabled: n, zIndexPopup: a, motionDurationSlow: i } = e, r = new J(t).setAlpha(0.1), o = r.clone().setAlpha(0.2);
609
726
  return {
610
727
  [`${e.componentCls}-switch-left, ${e.componentCls}-switch-right`]: {
611
728
  position: "fixed",
@@ -649,7 +766,7 @@ const Et = (e) => ({
649
766
  insetInlineEnd: e.marginSM
650
767
  }
651
768
  };
652
- }, Ht = (e) => ({
769
+ }, Ft = (e) => ({
653
770
  [e.componentCls]: {
654
771
  ["&-root"]: {
655
772
  ...Se("fixed"),
@@ -704,17 +821,17 @@ const Et = (e) => ({
704
821
  pointerEvents: "auto"
705
822
  },
706
823
  ["&-fade-appear, &-fade-enter"]: {
707
- animationName: Ot,
824
+ animationName: Nt,
708
825
  animationDuration: e.motionDurationSlow,
709
826
  animationTimingFunction: "linear"
710
827
  },
711
828
  ["&-fade-leave"]: {
712
- animationName: Lt,
829
+ animationName: $t,
713
830
  animationDuration: e.motionDurationSlow,
714
831
  animationTimingFunction: "linear"
715
832
  },
716
833
  ["&-zoom-appear, &-zoom-enter"]: {
717
- animationName: Nt,
834
+ animationName: Et,
718
835
  opacity: 0,
719
836
  animationTimingFunction: e.motionEaseOutCirc,
720
837
  animationFillMode: "both",
@@ -726,7 +843,7 @@ const Et = (e) => ({
726
843
  animationPlayState: "running"
727
844
  },
728
845
  ["&-zoom-leave"]: {
729
- animationName: $t,
846
+ animationName: Rt,
730
847
  animationDuration: e.motionDurationSlow,
731
848
  animationTimingFunction: e.motionEaseOutBack,
732
849
  animationFillMode: "both"
@@ -744,135 +861,23 @@ const Et = (e) => ({
744
861
  zIndex: e.zIndexPopup + 1,
745
862
  width: "100%"
746
863
  },
747
- "&": [Rt(e), Dt(e)]
864
+ "&": [Ht(e), Pt(e)]
748
865
  });
749
- function Pt(e) {
750
- return ht("ImageView", (t) => {
751
- const n = gt(t, {
866
+ function jt(e) {
867
+ return vt("ImageView", (t) => {
868
+ const n = mt(t, {
752
869
  zIndexPopup: t.zIndexPopupBase + 80,
753
- previewOperationColorDisabled: new Q(t.colorTextLightSolid).setAlpha(0.25).toRgbString(),
754
- modalMaskBg: new Q("#000").setAlpha(0.45).toRgbString(),
755
- previewOperationColor: new Q(t.colorTextLightSolid).toRgbString(),
870
+ previewOperationColorDisabled: new J(t.colorTextLightSolid).setAlpha(0.25).toRgbString(),
871
+ modalMaskBg: new J("#000").setAlpha(0.45).toRgbString(),
872
+ previewOperationColor: new J(t.colorTextLightSolid).toRgbString(),
756
873
  previewOperationSize: t.fontSizeIcon * 1.5,
757
874
  imagePreviewSwitchSize: t.controlHeightLG,
758
875
  iconCls: "anticon"
759
876
  });
760
- return [Ht(n)];
877
+ return [Ft(n)];
761
878
  }, e);
762
879
  }
763
- const Xe = pt({
764
- func: void 0,
765
- bool: void 0,
766
- string: void 0,
767
- number: void 0,
768
- array: void 0,
769
- object: void 0,
770
- integer: void 0
771
- });
772
- Xe.extend([{
773
- name: "looseBool",
774
- getter: !0,
775
- type: Boolean,
776
- default: void 0
777
- }, {
778
- name: "style",
779
- getter: !0,
780
- type: [String, Object],
781
- default: void 0
782
- }, {
783
- name: "VueNode",
784
- getter: !0,
785
- type: null
786
- }]);
787
- const B = Xe, P = {
788
- infinite: {
789
- type: Boolean,
790
- default: !0
791
- },
792
- zIndex: {
793
- type: Number,
794
- default: 2e3
795
- },
796
- initialIndex: {
797
- type: Number,
798
- default: 0
799
- },
800
- getContainer: {
801
- type: String
802
- }
803
- }, ue = {
804
- previewTeleported: {
805
- type: Boolean,
806
- default: !0
807
- },
808
- hideOnClickModal: {
809
- type: Boolean,
810
- default: !0
811
- },
812
- src: {
813
- type: String,
814
- default: ""
815
- },
816
- alt: {
817
- type: String,
818
- default: ""
819
- },
820
- fit: {
821
- type: String,
822
- default: "contain"
823
- },
824
- lazy: B.bool,
825
- scrollContainer: {
826
- type: [String, Object]
827
- },
828
- placeholder: {
829
- type: [Function, Object],
830
- default: () => {
831
- }
832
- },
833
- fallback: {
834
- type: [Function, Object],
835
- default: () => {
836
- }
837
- },
838
- onLoad: {
839
- type: Function
840
- },
841
- onError: {
842
- type: Function
843
- },
844
- onClick: {
845
- type: Function
846
- },
847
- disablePreview: B.bool,
848
- previewSrcList: {
849
- type: Array,
850
- default: () => []
851
- },
852
- imageClassName: B.string,
853
- imageStyle: B.style,
854
- width: B.number,
855
- height: B.number,
856
- zIndex: P.zIndex,
857
- infinite: P.infinite,
858
- getContainer: P.getContainer,
859
- initialIndex: P.initialIndex
860
- }, Ft = {
861
- urlList: {
862
- type: Array,
863
- default: () => []
864
- },
865
- teleported: ue.previewTeleported,
866
- zIndex: P.zIndex,
867
- initialIndex: P.initialIndex,
868
- infinite: P.infinite,
869
- getContainer: ue.getContainer,
870
- onHideOnClickModal: ue.hideOnClickModal,
871
- icons: {
872
- type: Object,
873
- default: () => ({})
874
- }
875
- }, V = {
880
+ const Y = {
876
881
  tab: "Tab",
877
882
  enter: "Enter",
878
883
  space: "Space",
@@ -890,15 +895,15 @@ const B = Xe, P = {
890
895
  }, _ = {
891
896
  CONTAIN: {
892
897
  name: "contain",
893
- icon: u(et, null, null)
898
+ icon: c(tt, null, null)
894
899
  },
895
900
  ORIGINAL: {
896
901
  name: "original",
897
- icon: u(tt, null, null)
902
+ icon: c(nt, null, null)
898
903
  }
899
- }, jt = function() {
900
- return !q && !!window.navigator.userAgent.match(/firefox/i);
901
- }, je = jt() ? "DOMMouseScroll" : "mousewheel";
904
+ }, Bt = function() {
905
+ return !Q && !!window.navigator.userAgent.match(/firefox/i);
906
+ }, je = Bt() ? "DOMMouseScroll" : "mousewheel";
902
907
  function Me(e) {
903
908
  let t = !1;
904
909
  return function(...n) {
@@ -907,8 +912,8 @@ function Me(e) {
907
912
  }));
908
913
  };
909
914
  }
910
- const Bt = /* @__PURE__ */ Ve({
911
- props: Ft,
915
+ const Vt = /* @__PURE__ */ Ve({
916
+ props: yt,
912
917
  emits: ["close", "switch"],
913
918
  setup: function(e, {
914
919
  emit: t,
@@ -920,29 +925,31 @@ const Bt = /* @__PURE__ */ Ve({
920
925
  suffixCls: "image-viewer"
921
926
  }), {
922
927
  wrapSSR: l,
923
- hashId: c
924
- } = Pt(o), S = Te(!1), [p, $] = Ne(!1), [T, x] = Ne(!1), k = w(!0), h = w(e.initialIndex), Y = w(null), F = w(null), W = w(_.CONTAIN), d = w({
925
- scale: 1,
926
- deg: 0,
927
- offsetX: 0,
928
- offsetY: 0,
929
- enableTransition: !1
930
- }), G = L(() => e.urlList.length > 1), J = L(() => h.value === 0), K = L(() => h.value === e.urlList.length - 1), ee = L(() => e.urlList[h.value]), de = L(() => {
928
+ hashId: f
929
+ } = jt(o), S = Te(!1), [m, E] = Ne(!1), [z, x] = Ne(!1), O = A(!0), g = A(e.initialIndex), F = A(null), j = A(null), W = A(_.CONTAIN), d = _e({
930
+ transform: {
931
+ scale: 1,
932
+ deg: 0,
933
+ offsetX: 0,
934
+ offsetY: 0,
935
+ enableTransition: !1
936
+ }
937
+ }), G = N(() => e.urlList.length > 1), K = N(() => g.value === 0), ee = N(() => g.value === e.urlList.length - 1), te = N(() => e.urlList[g.value]), fe = N(() => {
931
938
  const {
932
939
  scale: s,
933
- deg: m,
934
- offsetX: b,
935
- offsetY: C,
936
- enableTransition: v
937
- } = d.value, M = {
938
- transform: `scale(${s}) rotate(${m}deg)`,
939
- transition: v ? "transform .3s" : "",
940
- marginLeft: `${b}px`,
941
- marginTop: `${C}px`
940
+ deg: M,
941
+ offsetX: h,
942
+ offsetY: y,
943
+ enableTransition: p
944
+ } = d.transform, I = {
945
+ transform: `scale(${s}) rotate(${M}deg)`,
946
+ transition: p ? "transform .3s" : "",
947
+ marginLeft: `${h}px`,
948
+ marginTop: `${y}px`
942
949
  };
943
- return W.value.name === _.CONTAIN.name && (M.maxWidth = M.maxHeight = "100%"), M;
944
- }), te = () => {
945
- ve(), t("close"), d.value = {
950
+ return W.value.name === _.CONTAIN.name && (I.maxWidth = I.maxHeight = "100%"), I;
951
+ }), de = () => {
952
+ ve(), t("close"), d.transform = {
946
953
  scale: 1,
947
954
  deg: 0,
948
955
  offsetX: 0,
@@ -950,34 +957,34 @@ const Bt = /* @__PURE__ */ Ve({
950
957
  enableTransition: !1
951
958
  };
952
959
  }, he = (s) => {
953
- S.value ? S.value = !1 : Y.value === (s == null ? void 0 : s.target) && (x(!1), h.value = e.initialIndex);
960
+ S.value ? S.value = !1 : F.value === (s == null ? void 0 : s.target) && (x(!1), g.value = e.initialIndex);
954
961
  }, ge = () => {
955
962
  a = Me((s) => {
956
963
  switch (s.code) {
957
- case V.esc:
964
+ case Y.esc:
958
965
  x(!1);
959
966
  break;
960
- case V.space:
961
- j();
967
+ case Y.space:
968
+ B();
962
969
  break;
963
- case V.left:
970
+ case Y.left:
964
971
  ne();
965
972
  break;
966
- case V.up:
967
- A("zoomIn");
973
+ case Y.up:
974
+ k("zoomIn");
968
975
  break;
969
- case V.right:
976
+ case Y.right:
970
977
  Z();
971
978
  break;
972
- case V.down:
973
- A("zoomOut");
979
+ case Y.down:
980
+ k("zoomOut");
974
981
  break;
975
982
  }
976
983
  }), i = Me((s) => {
977
- (s.wheelDelta ? s.wheelDelta : -s.detail) > 0 ? A("zoomIn", {
984
+ (s.wheelDelta ? s.wheelDelta : -s.detail) > 0 ? k("zoomIn", {
978
985
  zoomRate: 0.015,
979
986
  enableTransition: !1
980
- }) : A("zoomOut", {
987
+ }) : k("zoomOut", {
981
988
  zoomRate: 0.015,
982
989
  enableTransition: !1
983
990
  });
@@ -985,187 +992,187 @@ const Bt = /* @__PURE__ */ Ve({
985
992
  }, ve = () => {
986
993
  xe(document, "keydown", a), xe(document, je, i), a = null, i = null;
987
994
  }, U = () => {
988
- k.value = !1;
989
- }, f = (s) => {
990
- k.value = !1, s.target.alt = "加载失败";
991
- }, E = Te(), O = (s) => {
992
- if (k.value || s.button !== 0)
995
+ O.value = !1;
996
+ }, u = (s) => {
997
+ O.value = !1, s.target.alt = "加载失败";
998
+ }, b = Te(), T = (s) => {
999
+ if (O.value || s.button !== 0)
993
1000
  return;
994
- s.preventDefault(), s.stopPropagation(), clearTimeout(E.value), S.value = !0;
1001
+ s.preventDefault(), s.stopPropagation(), clearTimeout(b.value), S.value = !0;
995
1002
  const {
996
- offsetX: m,
997
- offsetY: b
998
- } = d.value, C = s.pageX, v = s.pageY;
999
- r = Me((M) => {
1000
- d.value = {
1001
- ...d.value,
1002
- offsetX: m + M.pageX - C,
1003
- offsetY: b + M.pageY - v
1003
+ offsetX: M,
1004
+ offsetY: h
1005
+ } = d.transform, y = s.pageX, p = s.pageY;
1006
+ r = Me((I) => {
1007
+ d.transform = {
1008
+ ...d.transform,
1009
+ offsetX: M + I.pageX - y,
1010
+ offsetY: h + I.pageY - p
1004
1011
  };
1005
1012
  }), se(document, "mousemove", r), se(document, "mouseup", () => {
1006
- xe(document, "mousemove", r), p.value && T.value && (E.value = setTimeout(() => {
1013
+ xe(document, "mousemove", r), m.value && z.value && (b.value = setTimeout(() => {
1007
1014
  S.value = !1;
1008
1015
  }));
1009
1016
  });
1010
1017
  }, R = () => {
1011
- d.value = {
1018
+ d.transform = {
1012
1019
  scale: 1,
1013
1020
  deg: 0,
1014
1021
  offsetX: 0,
1015
1022
  offsetY: 0,
1016
1023
  enableTransition: !1
1017
1024
  };
1018
- }, j = () => {
1019
- if (k.value)
1025
+ }, B = () => {
1026
+ if (O.value)
1020
1027
  return;
1021
- const s = Object.keys(_), m = Object.values(_), b = W.value.name, v = (m.findIndex((M) => M.name === b) + 1) % s.length;
1022
- W.value = _[s[v]], R();
1028
+ const s = Object.keys(_), M = Object.values(_), h = W.value.name, p = (M.findIndex((I) => I.name === h) + 1) % s.length;
1029
+ W.value = _[s[p]], R();
1023
1030
  }, ne = () => {
1024
- if (J.value && !e.infinite)
1031
+ if (K.value && !e.infinite)
1025
1032
  return;
1026
1033
  const s = e.urlList.length;
1027
- h.value = (h.value - 1 + s) % s;
1034
+ g.value = (g.value - 1 + s) % s;
1028
1035
  }, Z = () => {
1029
- if (K.value && !e.infinite)
1036
+ if (ee.value && !e.infinite)
1030
1037
  return;
1031
1038
  const s = e.urlList.length;
1032
- h.value = (h.value + 1) % s;
1033
- }, A = (s, m = {}) => {
1034
- if (k.value)
1039
+ g.value = (g.value + 1) % s;
1040
+ }, k = (s, M = {}) => {
1041
+ if (O.value)
1035
1042
  return;
1036
1043
  const {
1037
- zoomRate: b,
1038
- rotateDeg: C,
1039
- enableTransition: v
1044
+ zoomRate: h,
1045
+ rotateDeg: y,
1046
+ enableTransition: p
1040
1047
  } = {
1041
1048
  zoomRate: 0.2,
1042
1049
  rotateDeg: 90,
1043
1050
  enableTransition: !0,
1044
- ...m
1051
+ ...M
1045
1052
  };
1046
1053
  switch (s) {
1047
1054
  case "zoomOut":
1048
- d.value.scale > 0.2 && (d.value.scale = parseFloat((d.value.scale - b).toFixed(3)));
1055
+ d.transform.scale > 0.2 && (d.transform.scale = parseFloat((d.transform.scale - h).toFixed(3)));
1049
1056
  break;
1050
1057
  case "zoomIn":
1051
- d.value.scale = parseFloat((d.value.scale + b).toFixed(3));
1058
+ d.transform.scale = parseFloat((d.transform.scale + h).toFixed(3));
1052
1059
  break;
1053
1060
  case "clocelise":
1054
- d.value.deg += C;
1061
+ d.transform.deg += y;
1055
1062
  break;
1056
1063
  case "anticlocelise":
1057
- d.value.deg -= C;
1064
+ d.transform.deg -= y;
1058
1065
  break;
1059
1066
  }
1060
- d.value.enableTransition = v;
1061
- }, pe = [{
1062
- icon: ((ae = e.icons) == null ? void 0 : ae.close) || u(nt, null, null),
1067
+ d.transform.enableTransition = p;
1068
+ }, me = [{
1069
+ icon: ((ae = e.icons) == null ? void 0 : ae.close) || c(at, null, null),
1063
1070
  onClick: (s) => {
1064
1071
  s.stopPropagation(), x(!1);
1065
1072
  },
1066
1073
  type: "close"
1067
1074
  }, {
1068
- icon: ((ie = e.icons) == null ? void 0 : ie.zoomIn) || u(at, null, null),
1075
+ icon: ((ie = e.icons) == null ? void 0 : ie.zoomIn) || c(it, null, null),
1069
1076
  onClick: (s) => {
1070
- s.stopPropagation(), A("zoomIn");
1077
+ s.stopPropagation(), k("zoomIn");
1071
1078
  },
1072
1079
  type: "zoomIn"
1073
1080
  }, {
1074
- icon: ((D = e.icons) == null ? void 0 : D.zoomOut) || u(it, null, null),
1081
+ icon: ((D = e.icons) == null ? void 0 : D.zoomOut) || c(rt, null, null),
1075
1082
  onClick: (s) => {
1076
- s.stopPropagation(), A("zoomOut");
1083
+ s.stopPropagation(), k("zoomOut");
1077
1084
  },
1078
1085
  type: "zoomOut"
1079
1086
  }, {
1080
- icon: ((X = e.icons) == null ? void 0 : X.rotateRight) || u(rt, null, null),
1087
+ icon: ((X = e.icons) == null ? void 0 : X.rotateRight) || c(ot, null, null),
1081
1088
  onClick: (s) => {
1082
- s.stopPropagation(), A("anticlocelise");
1089
+ s.stopPropagation(), k("anticlocelise");
1083
1090
  },
1084
1091
  type: "rotateRight"
1085
1092
  }, {
1086
- icon: ((Ce = e.icons) == null ? void 0 : Ce.rotateLeft) || u(ot, null, null),
1093
+ icon: ((Ce = e.icons) == null ? void 0 : Ce.rotateLeft) || c(st, null, null),
1087
1094
  onClick: (s) => {
1088
- s.stopPropagation(), A("clocelise");
1095
+ s.stopPropagation(), k("clocelise");
1089
1096
  },
1090
1097
  type: "rotateLeft"
1091
1098
  }];
1092
- return le(ee, () => {
1099
+ return q(te, () => {
1093
1100
  Ye(() => {
1094
- F.value.complete || (k.value = !0);
1101
+ j.value.complete || (O.value = !0);
1095
1102
  });
1096
- }), le(h, (s) => {
1103
+ }), q(g, (s) => {
1097
1104
  R(), t("switch", s);
1098
- }), le(p, (s) => {
1099
- s && (T.value = s);
1100
- }), Ue(() => {
1101
- var s, m;
1102
- ge(), (m = (s = Y.value) == null ? void 0 : s.focus) == null || m.call(s);
1105
+ }), q(m, (s) => {
1106
+ s && (z.value = s);
1107
+ }), q([() => m.value, () => F.value], ([s, M]) => {
1108
+ var h, y;
1109
+ s && M && (ge(), (y = (h = F.value) == null ? void 0 : h.focus) == null || y.call(h));
1103
1110
  }), n({
1104
- setOpen: $
1111
+ setOpen: E
1105
1112
  }), () => {
1106
- const s = $e(`${o}-fade`), m = $e(`${o}-zoom`);
1107
- return l(u(_e, {
1113
+ const s = $e(`${o}-fade`), M = $e(`${o}-zoom`);
1114
+ return l(c(qe, {
1108
1115
  to: e.getContainer || "body",
1109
1116
  disabled: !e.teleported
1110
1117
  }, {
1111
- default: () => [p.value && u("div", {
1112
- class: `${o}-root ${c.value}`
1113
- }, [u(ke, s, {
1114
- default: () => [ze(u("div", {
1115
- class: `${o}-mask ${c.value}`
1116
- }, null), [[Oe, p.value && T.value]])]
1117
- }), u("div", {
1118
- ref: Y,
1118
+ default: () => [m.value && c("div", {
1119
+ class: `${o}-root ${f.value}`
1120
+ }, [c(ke, s, {
1121
+ default: () => [ze(c("div", {
1122
+ class: `${o}-mask ${f.value}`
1123
+ }, null), [[Oe, m.value && z.value]])]
1124
+ }), c("div", {
1125
+ ref: F,
1119
1126
  tabindex: -1,
1120
- class: [`${o}-wrapper`, `${c.value}`],
1121
- onClick: (b) => e.onHideOnClickModal && he(b)
1122
- }, [u(ke, We(m, {
1123
- onAfterLeave: () => te()
1127
+ class: [`${o}-wrapper`, `${f.value}`],
1128
+ onClick: (h) => e.onHideOnClickModal && he(h)
1129
+ }, [c(ke, We(M, {
1130
+ onAfterLeave: () => de()
1124
1131
  }), {
1125
1132
  default: () => {
1126
- var b, C;
1127
- return [ze(u("div", {
1128
- class: `${o}-block ${c.value}`
1129
- }, [u("div", {
1130
- class: `${o}-content ${c.value}`
1131
- }, [u("div", {
1132
- class: `${o}-body ${c.value}`
1133
- }, [u("div", {
1134
- class: `${o}-operations-wrapper ${c.value}`,
1135
- onClick: (v) => v.stopPropagation()
1136
- }, [u("ul", {
1137
- class: `${o}-operations ${c.value}`
1138
- }, [pe.map(({
1139
- icon: v,
1140
- onClick: M,
1141
- type: me
1142
- }) => u("li", {
1143
- class: `${o}-operations-operation ${c.value}`,
1144
- onClick: M,
1145
- key: me
1146
- }, [qe(v, {
1147
- class: `${o}-operations-icon ${c.value}`
1148
- })]))])]), u("div", {
1149
- class: `${o}-canvas ${c.value}`
1150
- }, [e.urlList.map((v, M) => u("img", {
1151
- ref: F,
1152
- class: `${o}-img ${c.value}`,
1133
+ var h, y;
1134
+ return [ze(c("div", {
1135
+ class: `${o}-block ${f.value}`
1136
+ }, [c("div", {
1137
+ class: `${o}-content ${f.value}`
1138
+ }, [c("div", {
1139
+ class: `${o}-body ${f.value}`
1140
+ }, [c("div", {
1141
+ class: `${o}-operations-wrapper ${f.value}`,
1142
+ onClick: (p) => p.stopPropagation()
1143
+ }, [c("ul", {
1144
+ class: `${o}-operations ${f.value}`
1145
+ }, [me.map(({
1146
+ icon: p,
1147
+ onClick: I,
1148
+ type: pe
1149
+ }) => c("li", {
1150
+ class: `${o}-operations-operation ${f.value}`,
1151
+ onClick: I,
1152
+ key: pe
1153
+ }, [Qe(p, {
1154
+ class: `${o}-operations-icon ${f.value}`
1155
+ })]))])]), c("div", {
1156
+ class: `${o}-canvas ${f.value}`
1157
+ }, [e.urlList.map((p, I) => c("img", {
1158
+ ref: j,
1159
+ class: `${o}-img ${f.value}`,
1153
1160
  style: {
1154
- ...de.value,
1155
- display: M === h.value ? "block" : "none"
1161
+ ...fe.value,
1162
+ display: I === g.value ? "block" : "none"
1156
1163
  },
1157
- key: v,
1158
- src: v,
1164
+ key: p,
1165
+ src: p,
1159
1166
  onLoad: () => U(),
1160
- onError: (me) => f(me),
1161
- onMousedown: O
1162
- }, null))]), G.value && u("div", {
1163
- class: [`${o}-switch-left`, h.value === 0 && !e.infinite ? `${o}-switch-left-disabled` : "", `${c.value}`],
1167
+ onError: (pe) => u(pe),
1168
+ onMousedown: T
1169
+ }, null))]), G.value && c("div", {
1170
+ class: [`${o}-switch-left`, g.value === 0 && !e.infinite ? `${o}-switch-left-disabled` : "", `${f.value}`],
1164
1171
  onClick: ne
1165
- }, [((b = e.icons) == null ? void 0 : b.left) || u(st, null, null)]), G.value && u("div", {
1166
- class: [`${o}-switch-right`, h.value === e.urlList.length - 1 && !e.infinite ? `${o}-switch-right-disabled` : "", `${c.value}`],
1172
+ }, [((h = e.icons) == null ? void 0 : h.left) || c(lt, null, null)]), G.value && c("div", {
1173
+ class: [`${o}-switch-right`, g.value === e.urlList.length - 1 && !e.infinite ? `${o}-switch-right-disabled` : "", `${f.value}`],
1167
1174
  onClick: Z
1168
- }, [((C = e.icons) == null ? void 0 : C.right) || u(lt, null, null)])])])]), [[Oe, p.value && T.value]])];
1175
+ }, [((y = e.icons) == null ? void 0 : y.right) || c(ut, null, null)])])])]), [[Oe, m.value && z.value]])];
1169
1176
  }
1170
1177
  })])])]
1171
1178
  }));
@@ -1174,7 +1181,7 @@ const Bt = /* @__PURE__ */ Ve({
1174
1181
  }), Ie = {
1175
1182
  width: "100%",
1176
1183
  height: "100%"
1177
- }, Vt = (e) => ({
1184
+ }, Yt = (e) => ({
1178
1185
  [e.componentCls]: {
1179
1186
  display: "inline-block",
1180
1187
  position: "relative",
@@ -1204,10 +1211,10 @@ const Bt = /* @__PURE__ */ Ve({
1204
1211
  cursor: "pointer"
1205
1212
  }
1206
1213
  }
1207
- }), Yt = (e) => e && e.nodeType === Node.ELEMENT_NODE;
1214
+ }), Wt = (e) => e && e.nodeType === Node.ELEMENT_NODE;
1208
1215
  let Be = "";
1209
- const ce = /* @__PURE__ */ Ve({
1210
- props: ue,
1216
+ const ue = /* @__PURE__ */ Ve({
1217
+ props: le,
1211
1218
  name: "GImage",
1212
1219
  emits: ["error", "click", "load"],
1213
1220
  setup(e, {
@@ -1220,124 +1227,131 @@ const ce = /* @__PURE__ */ Ve({
1220
1227
  }), {
1221
1228
  wrapSSR: r,
1222
1229
  hashId: o
1223
- } = vt("Image", [Vt], i), l = w(), c = w(""), S = w(!1), p = w(!0), $ = w(!1), T = w(null), x = w();
1224
- let k, h;
1225
- const Y = L(() => !q && e.fit ? {
1230
+ } = pt("Image", [Yt], i), l = A(), f = A(""), S = A(!1), m = A(!0), E = A(!1), z = A(null), x = A();
1231
+ let O, g;
1232
+ const F = N(() => !Q && e.fit ? {
1226
1233
  "object-fit": e.fit
1227
- } : {}), F = L(() => {
1234
+ } : {}), j = N(() => {
1228
1235
  const {
1229
- previewSrcList: f
1236
+ previewSrcList: u
1230
1237
  } = e;
1231
- return Array.isArray(f) && f.length > 0;
1232
- }), W = L(() => {
1238
+ return Array.isArray(u) && u.length > 0;
1239
+ }), W = N(() => {
1233
1240
  const {
1234
- src: f,
1235
- previewSrcList: E,
1236
- initialIndex: O
1241
+ src: u,
1242
+ previewSrcList: b,
1243
+ initialIndex: T
1237
1244
  } = e;
1238
- if (O || O === 0)
1239
- return E.length >= O ? O : 0;
1245
+ if (T || T === 0)
1246
+ return b.length >= T ? T : 0;
1240
1247
  let R = 0;
1241
- const j = E.indexOf(f);
1242
- return j >= 0 && (R = j), R;
1248
+ const B = b.indexOf(u);
1249
+ return B >= 0 && (R = B), R;
1243
1250
  }), d = () => {
1244
- q || (p.value = !0, S.value = !1, e.src ? c.value = e.src : te());
1251
+ if (Q)
1252
+ return;
1253
+ m.value = !0, S.value = !1;
1254
+ const u = new Image();
1255
+ u.onload = (b) => fe(b), u.onerror = de, Object.keys(a || {}).forEach((b) => {
1256
+ if (b.toLowerCase() === "onload")
1257
+ return;
1258
+ const T = (a || {})[b];
1259
+ u.setAttribute(b, T);
1260
+ }), u.src = e.src;
1245
1261
  };
1246
1262
  function G() {
1247
- ut(T.value, x.value) && (d(), ee());
1263
+ ct(z.value, x.value) && (d(), te());
1248
1264
  }
1249
- const J = mt(G, 200), K = async () => {
1250
- if (q)
1265
+ const K = bt(G, 200), ee = async () => {
1266
+ if (Q)
1251
1267
  return;
1252
1268
  await Ye();
1253
1269
  const {
1254
- scrollContainer: f
1270
+ scrollContainer: u
1255
1271
  } = e;
1256
- Yt(f) ? x.value = f : ct(f) && f !== "" ? x.value = document.querySelector(f) ?? void 0 : T.value && (x.value = ft(T.value)), x.value && (k = Ee(x, "scroll", J), setTimeout(() => G(), 200));
1257
- }, ee = () => {
1258
- q || !x.value || !J || (k(), x.value = void 0);
1259
- }, de = (f) => {
1260
- p.value = !1, S.value = !1, n("load", f);
1261
- }, te = (f) => {
1262
- p.value = !1, S.value = !0, n("error", f);
1263
- }, he = (f) => {
1264
- if (f.ctrlKey) {
1265
- if (f.deltaY < 0)
1266
- return f.preventDefault(), !1;
1267
- if (f.deltaY > 0)
1268
- return f.preventDefault(), !1;
1272
+ Wt(u) ? x.value = u : ft(u) && u !== "" ? x.value = document.querySelector(u) ?? void 0 : z.value && (x.value = dt(z.value)), x.value && (O = Ee(x, "scroll", K), setTimeout(() => G(), 200));
1273
+ }, te = () => {
1274
+ Q || !x.value || !K || (O(), x.value = void 0);
1275
+ }, fe = (u) => {
1276
+ f.value = e.src, m.value = !1, S.value = !1, n("load", u);
1277
+ }, de = (u) => {
1278
+ m.value = !1, S.value = !0, n("error", u);
1279
+ }, he = (u) => {
1280
+ if (u.ctrlKey) {
1281
+ if (u.deltaY < 0)
1282
+ return u.preventDefault(), !1;
1283
+ if (u.deltaY > 0)
1284
+ return u.preventDefault(), !1;
1269
1285
  }
1270
1286
  }, ge = () => {
1271
- !F.value || e.disablePreview || (h = Ee("wheel", he, {
1287
+ !j.value || e.disablePreview || (g = Ee("wheel", he, {
1272
1288
  passive: !1
1273
- }), Be = document.body.style.overflow, document.body.style.overflow = "hidden", $.value = !0);
1289
+ }), Be = document.body.style.overflow, document.body.style.overflow = "hidden", E.value = !0);
1274
1290
  }, ve = () => {
1275
- h == null || h(), document.body.style.overflow = Be, $.value = !1;
1291
+ g == null || g(), document.body.style.overflow = Be, E.value = !1;
1276
1292
  };
1277
- le(() => e.src, () => {
1278
- e.lazy ? (p.value = !0, S.value = !1, ee(), K()) : d();
1293
+ q(() => e.src, () => {
1294
+ e.lazy ? (m.value = !0, S.value = !1, te(), ee()) : d();
1279
1295
  });
1280
- const U = (f) => dt(f) ? f + "px" : f;
1281
- return Ue(() => {
1282
- e.lazy ? K() : d();
1296
+ const U = (u) => ht(u) ? u + "px" : u;
1297
+ return gt(() => {
1298
+ e.lazy ? ee() : d();
1283
1299
  }), () => {
1284
1300
  const {
1285
- crossorigin: f,
1286
- decoding: E,
1287
- alt: O,
1301
+ crossorigin: u,
1302
+ decoding: b,
1303
+ alt: T,
1288
1304
  sizes: R,
1289
- srcset: j,
1305
+ srcset: B,
1290
1306
  usemap: ne,
1291
1307
  class: Z,
1292
- style: A = {}
1293
- } = a, pe = {
1294
- crossorigin: f,
1295
- decoding: E,
1296
- alt: O,
1308
+ style: k = {}
1309
+ } = a, me = {
1310
+ crossorigin: u,
1311
+ decoding: b,
1312
+ alt: T,
1297
1313
  sizes: R,
1298
- srcset: j,
1314
+ srcset: B,
1299
1315
  usemap: ne,
1300
1316
  style: {
1301
- ...Y.value,
1317
+ ...F.value,
1302
1318
  height: e.height ? U(e.height) : void 0
1303
1319
  }
1304
1320
  }, ae = Le(t, e, "fallback"), ie = Le(t, e, "placeholder");
1305
- return Qe(() => {
1321
+ return Je(() => {
1306
1322
  var D, X;
1307
- F.value && $.value ? (D = l.value) == null || D.setOpen(!0) : (X = l.value) == null || X.setOpen(!1);
1308
- }), r(u(Je, null, [u("div", {
1323
+ j.value && E.value ? (D = l.value) == null || D.setOpen(!0) : (X = l.value) == null || X.setOpen(!1);
1324
+ }), r(c(Ke, null, [c("div", {
1309
1325
  class: {
1310
1326
  [`${o.value}`]: !0,
1311
1327
  [`${i}`]: !0,
1312
1328
  [`${Z}`]: !!Z
1313
1329
  },
1314
- ref: (D) => T.value = D,
1330
+ ref: (D) => z.value = D,
1315
1331
  style: {
1316
- ...A,
1317
1332
  width: e.width ? U(e.width) : void 0,
1318
1333
  height: e.height ? U(e.height) : void 0,
1319
- display: e.lazy ? "block" : void 0
1334
+ display: e.lazy ? "block" : void 0,
1335
+ ...k
1320
1336
  },
1321
1337
  onClick: () => {
1322
1338
  n("click");
1323
1339
  }
1324
- }, [p.value && (ie || u("div", {
1340
+ }, [m.value ? ie || c("div", {
1325
1341
  class: `${i}-placeholder ${o.value}`
1326
- }, null)), S.value ? ae || u("div", {
1342
+ }, null) : S.value ? ae || c("div", {
1327
1343
  class: `${i}-error ${o.value}`
1328
- }, [Ke("加载失败")]) : c.value && u("img", We(pe, {
1344
+ }, [et("加载失败")]) : f.value && c("img", We(me, {
1329
1345
  class: {
1330
1346
  [`${o.value}`]: !0,
1331
1347
  [`${e.imageClassName}`]: !!e.imageClassName,
1332
1348
  [`${i}-inner`]: !0,
1333
- [`${i}-preview`]: F.value
1349
+ [`${i}-preview`]: j.value
1334
1350
  },
1335
1351
  alt: e.alt,
1336
- src: c.value,
1337
- onLoad: de,
1338
- onError: te,
1352
+ src: f.value,
1339
1353
  onClick: () => ge()
1340
- }), null), u(Bt, {
1354
+ }), null), c(Vt, {
1341
1355
  ref: l,
1342
1356
  zIndex: e.zIndex,
1343
1357
  infinite: e.infinite,
@@ -1350,10 +1364,12 @@ const ce = /* @__PURE__ */ Ve({
1350
1364
  };
1351
1365
  }
1352
1366
  });
1353
- ce.isWImage = !0;
1354
- ce.install = (e) => (e.component(ce.name, ce), e);
1367
+ ue.isWImage = !0;
1368
+ ue.install = (e) => (e.component(ue.name, ue), e);
1355
1369
  export {
1356
- ce as GImage,
1357
- Bt as ImageViewer,
1358
- ce as default
1370
+ ue as GImage,
1371
+ Vt as ImageViewer,
1372
+ ue as default,
1373
+ le as gImagePorps,
1374
+ yt as gImageViewProps
1359
1375
  };