@gx-design-vue/image 0.2.0-beta.1 → 0.2.0-beta.11

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,275 +1,135 @@
1
- import { computed as M, isRef as et, createVNode as c, defineComponent as _e, shallowRef as ze, ref as x, watch as ue, nextTick as Ue, Teleport as tt, Transition as Oe, withDirectives as Le, vShow as Ne, mergeProps as Ze, cloneVNode as nt, watchEffect as at, Fragment as rt, createTextVNode as it } from "vue";
2
- import { ExpandOutlined as ot, OneToOneOutlined as st, CloseOutlined as lt, ZoomInOutlined as ut, ZoomOutOutlined as ct, RotateRightOutlined as ft, RotateLeftOutlined as dt, LeftOutlined as ht, RightOutlined as gt } from "@ant-design/icons-vue";
3
- import { getPrefixCls as Q, isServer as q, getSlotVNode as De, isInContainer as vt, isString as pt, getScrollContainer as mt, isNumber as bt } from "@gx-design-vue/pro-utils";
4
- import { useState as Ee, onMountedOrActivated as Xe } from "@gx-design-vue/pro-hooks";
5
- import { useStyleRegister as Re, theme as yt } from "ant-design-vue";
6
- import { createTypes as wt } from "vue-types";
7
- import { useThrottleFn as St, useEventListener as He } from "@vueuse/core";
8
- const xt = (e, t) => {
9
- const { fontFamily: n, fontSize: a } = e, r = `[class^="${t}"], [class*=" ${t}"]`;
10
- return {
11
- [r]: {
12
- fontFamily: n,
13
- fontSize: a,
14
- boxSizing: "border-box",
15
- "&::before, &::after": {
16
- boxSizing: "border-box"
17
- },
18
- [r]: {
19
- boxSizing: "border-box",
20
- "&::before, &::after": {
21
- boxSizing: "border-box"
22
- }
23
- }
24
- }
25
- };
26
- }, It = (e) => ({
27
- a: {
28
- color: e.colorLink,
29
- textDecoration: e.linkDecoration,
30
- backgroundColor: "transparent",
31
- outline: "none",
32
- cursor: "pointer",
33
- transition: `color ${e.motionDurationSlow}`,
34
- "-webkit-text-decoration-skip": "objects",
35
- "&:hover": {
36
- color: e.colorLinkHover
37
- },
38
- "&:active": {
39
- color: e.colorLinkActive
40
- },
41
- [`&:active,
42
- &:hover`]: {
43
- textDecoration: e.linkHoverDecoration,
44
- outline: 0
45
- },
46
- // https://github.com/ant-design/ant-design/issues/22503
47
- "&:focus": {
48
- textDecoration: e.linkFocusDecoration,
49
- outline: 0
50
- },
51
- "&[disabled]": {
52
- color: e.colorTextDisabled,
53
- cursor: "not-allowed"
54
- }
55
- }
56
- }), qe = (
57
- // @ts-ignore
58
- process.env.NODE_ENV !== "production" || typeof CSSINJS_STATISTIC < "u"
59
- );
60
- let Ae = !0;
61
- function Te(...e) {
62
- if (!qe)
63
- return Object.assign({}, ...e);
64
- Ae = !1;
65
- const t = {};
66
- return e.forEach((n) => {
67
- Object.keys(n).forEach((a) => {
68
- Object.defineProperty(t, a, {
69
- configurable: !0,
70
- enumerable: !0,
71
- get: () => n[a]
72
- });
73
- });
74
- }), Ae = !0, t;
75
- }
76
- function Mt() {
77
- }
78
- function Ct(e) {
79
- let t, n = e, a = Mt;
80
- return qe && (t = /* @__PURE__ */ new Set(), n = new Proxy(e, {
81
- get(r, i) {
82
- return Ae && t.add(i), r[i];
83
- }
84
- }), a = (r, i) => {
85
- Array.from(t);
86
- }), { token: n, keys: t, flush: a };
87
- }
88
- class de {
89
- constructor(t, n) {
90
- this._keyframe = !0, this.name = t, this.style = n;
91
- }
92
- getName(t = "") {
93
- return t ? `${t}-${this.name}` : this.name;
94
- }
95
- }
96
- const Fe = (e, t = {}) => e ? {
97
- name: e,
98
- appear: !0,
99
- // type: 'animation',
100
- // appearFromClass: `${transitionName}-appear ${transitionName}-appear-prepare`,
101
- // appearActiveClass: `antdv-base-transtion`,
102
- // appearToClass: `${transitionName}-appear ${transitionName}-appear-active`,
103
- enterFromClass: `${e}-enter ${e}-enter-prepare ${e}-enter-start`,
104
- enterActiveClass: `${e}-enter ${e}-enter-prepare`,
105
- enterToClass: `${e}-enter ${e}-enter-active`,
106
- leaveFromClass: ` ${e}-leave`,
107
- leaveActiveClass: `${e}-leave ${e}-leave-active`,
108
- leaveToClass: `${e}-leave ${e}-leave-active`,
109
- ...t
110
- } : { css: !1, ...t }, { useToken: At } = yt;
111
- function Qe(e, t) {
112
- return (n) => {
113
- const a = Q({}), r = M(() => et(n) ? n == null ? void 0 : n.value : n || a), { token: i, hashId: o, theme: l } = At(), u = M(() => Q({})), p = M(() => ({
114
- theme: l.value,
115
- token: i.value,
116
- hashId: o.value,
117
- path: ["Shared", u.value]
118
- }));
119
- Re(p, () => [
120
- {
121
- "&": It(i.value)
122
- }
123
- ]);
124
- const v = M(() => ({
125
- theme: l.value,
126
- token: i.value,
127
- hashId: o.value,
128
- path: [e, r.value]
129
- }));
130
- return [
131
- Re(v, () => {
132
- const { token: z, flush: C } = Ct(i.value), m = `.${r.value}`, A = Te(z, {
133
- antCls: ".ant",
134
- componentCls: m,
135
- proComponentsCls: Q({
136
- isPor: !0
137
- })
138
- }), d = t(A, {
139
- hashId: o.value,
140
- prefixCls: r.value
141
- });
142
- return C(e, {}), [xt(i.value, r.value), d];
143
- }),
144
- o
145
- ];
146
- };
147
- }
148
- function g(e, t) {
149
- kt(e) && (e = "100%");
150
- var n = Tt(e);
1
+ import { createVNode as c, defineComponent as Ve, shallowRef as Te, ref as A, reactive as Xe, computed as N, watch as q, 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 ht } from "@gx-design-vue/pro-hooks";
5
+ import { Keyframe as ce, useStyle as gt, mergeToken as vt, getTransitionProps as $e, useProStyle as mt } from "@gx-design-vue/pro-provider";
6
+ import { createTypes as pt } from "vue-types";
7
+ import { useThrottleFn as bt, useEventListener as Ee } from "@vueuse/core";
8
+ function v(e, t) {
9
+ yt(e) && (e = "100%");
10
+ var n = wt(e);
151
11
  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);
152
12
  }
153
- function oe(e) {
13
+ function re(e) {
154
14
  return Math.min(1, Math.max(0, e));
155
15
  }
156
- function kt(e) {
16
+ function yt(e) {
157
17
  return typeof e == "string" && e.indexOf(".") !== -1 && parseFloat(e) === 1;
158
18
  }
159
- function Tt(e) {
19
+ function wt(e) {
160
20
  return typeof e == "string" && e.indexOf("%") !== -1;
161
21
  }
162
- function Je(e) {
22
+ function Ue(e) {
163
23
  return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
164
24
  }
165
- function se(e) {
25
+ function oe(e) {
166
26
  return e <= 1 ? "".concat(Number(e) * 100, "%") : e;
167
27
  }
168
28
  function H(e) {
169
29
  return e.length === 1 ? "0" + e : String(e);
170
30
  }
171
- function $t(e, t, n) {
31
+ function St(e, t, n) {
172
32
  return {
173
- r: g(e, 255) * 255,
174
- g: g(t, 255) * 255,
175
- b: g(n, 255) * 255
33
+ r: v(e, 255) * 255,
34
+ g: v(t, 255) * 255,
35
+ b: v(n, 255) * 255
176
36
  };
177
37
  }
178
- function Pe(e, t, n) {
179
- e = g(e, 255), t = g(t, 255), n = g(n, 255);
180
- var a = Math.max(e, t, n), r = Math.min(e, t, n), i = 0, o = 0, l = (a + r) / 2;
181
- if (a === r)
182
- o = 0, i = 0;
38
+ function Re(e, t, n) {
39
+ e = v(e, 255), t = v(t, 255), n = v(n, 255);
40
+ var a = Math.max(e, t, n), i = Math.min(e, t, n), r = 0, o = 0, l = (a + i) / 2;
41
+ if (a === i)
42
+ o = 0, r = 0;
183
43
  else {
184
- var u = a - r;
185
- switch (o = l > 0.5 ? u / (2 - a - r) : u / (a + r), a) {
44
+ var f = a - i;
45
+ switch (o = l > 0.5 ? f / (2 - a - i) : f / (a + i), a) {
186
46
  case e:
187
- i = (t - n) / u + (t < n ? 6 : 0);
47
+ r = (t - n) / f + (t < n ? 6 : 0);
188
48
  break;
189
49
  case t:
190
- i = (n - e) / u + 2;
50
+ r = (n - e) / f + 2;
191
51
  break;
192
52
  case n:
193
- i = (e - t) / u + 4;
53
+ r = (e - t) / f + 4;
194
54
  break;
195
55
  }
196
- i /= 6;
56
+ r /= 6;
197
57
  }
198
- return { h: i, s: o, l };
58
+ return { h: r, s: o, l };
199
59
  }
200
- function ye(e, t, n) {
60
+ function be(e, t, n) {
201
61
  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;
202
62
  }
203
- function zt(e, t, n) {
204
- var a, r, i;
205
- if (e = g(e, 360), t = g(t, 100), n = g(n, 100), t === 0)
206
- r = n, i = n, a = n;
63
+ function xt(e, t, n) {
64
+ var a, i, r;
65
+ if (e = v(e, 360), t = v(t, 100), n = v(n, 100), t === 0)
66
+ i = n, r = n, a = n;
207
67
  else {
208
68
  var o = n < 0.5 ? n * (1 + t) : n + t - n * t, l = 2 * n - o;
209
- a = ye(l, o, e + 1 / 3), r = ye(l, o, e), i = ye(l, o, e - 1 / 3);
69
+ a = be(l, o, e + 1 / 3), i = be(l, o, e), r = be(l, o, e - 1 / 3);
210
70
  }
211
- return { r: a * 255, g: r * 255, b: i * 255 };
71
+ return { r: a * 255, g: i * 255, b: r * 255 };
212
72
  }
213
- function je(e, t, n) {
214
- e = g(e, 255), t = g(t, 255), n = g(n, 255);
215
- var a = Math.max(e, t, n), r = Math.min(e, t, n), i = 0, o = a, l = a - r, u = a === 0 ? 0 : l / a;
216
- if (a === r)
217
- i = 0;
73
+ function De(e, t, n) {
74
+ e = v(e, 255), t = v(t, 255), n = v(n, 255);
75
+ 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
+ if (a === i)
77
+ r = 0;
218
78
  else {
219
79
  switch (a) {
220
80
  case e:
221
- i = (t - n) / l + (t < n ? 6 : 0);
81
+ r = (t - n) / l + (t < n ? 6 : 0);
222
82
  break;
223
83
  case t:
224
- i = (n - e) / l + 2;
84
+ r = (n - e) / l + 2;
225
85
  break;
226
86
  case n:
227
- i = (e - t) / l + 4;
87
+ r = (e - t) / l + 4;
228
88
  break;
229
89
  }
230
- i /= 6;
90
+ r /= 6;
231
91
  }
232
- return { h: i, s: u, v: o };
92
+ return { h: r, s: f, v: o };
233
93
  }
234
- function Ot(e, t, n) {
235
- e = g(e, 360) * 6, t = g(t, 100), n = g(n, 100);
236
- var a = Math.floor(e), r = e - a, i = n * (1 - t), o = n * (1 - r * t), l = n * (1 - (1 - r) * t), u = a % 6, p = [n, o, i, i, l, n][u], v = [l, n, n, o, i, i][u], z = [i, i, l, n, n, o][u];
237
- return { r: p * 255, g: v * 255, b: z * 255 };
94
+ function Mt(e, t, n) {
95
+ e = v(e, 360) * 6, t = v(t, 100), n = v(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), 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];
97
+ return { r: S * 255, g: m * 255, b: E * 255 };
238
98
  }
239
- function Be(e, t, n, a) {
240
- var r = [
99
+ function He(e, t, n, a) {
100
+ var i = [
241
101
  H(Math.round(e).toString(16)),
242
102
  H(Math.round(t).toString(16)),
243
103
  H(Math.round(n).toString(16))
244
104
  ];
245
- return a && r[0].startsWith(r[0].charAt(1)) && r[1].startsWith(r[1].charAt(1)) && r[2].startsWith(r[2].charAt(1)) ? r[0].charAt(0) + r[1].charAt(0) + r[2].charAt(0) : r.join("");
105
+ 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("");
246
106
  }
247
- function Lt(e, t, n, a, r) {
248
- var i = [
107
+ function It(e, t, n, a, i) {
108
+ var r = [
249
109
  H(Math.round(e).toString(16)),
250
110
  H(Math.round(t).toString(16)),
251
111
  H(Math.round(n).toString(16)),
252
- H(Nt(a))
112
+ H(At(a))
253
113
  ];
254
- return r && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) && i[3].startsWith(i[3].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) + i[3].charAt(0) : i.join("");
114
+ 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("");
255
115
  }
256
- function Nt(e) {
116
+ function At(e) {
257
117
  return Math.round(parseFloat(e) * 255).toString(16);
258
118
  }
259
- function Ve(e) {
260
- return S(e) / 255;
119
+ function Pe(e) {
120
+ return w(e) / 255;
261
121
  }
262
- function S(e) {
122
+ function w(e) {
263
123
  return parseInt(e, 16);
264
124
  }
265
- function Dt(e) {
125
+ function Ct(e) {
266
126
  return {
267
127
  r: e >> 16,
268
128
  g: (e & 65280) >> 8,
269
129
  b: e & 255
270
130
  };
271
131
  }
272
- var ke = {
132
+ var Ae = {
273
133
  aliceblue: "#f0f8ff",
274
134
  antiquewhite: "#faebd7",
275
135
  aqua: "#00ffff",
@@ -419,9 +279,9 @@ var ke = {
419
279
  yellow: "#ffff00",
420
280
  yellowgreen: "#9acd32"
421
281
  };
422
- function Et(e) {
423
- var t = { r: 0, g: 0, b: 0 }, n = 1, a = null, r = null, i = null, o = !1, l = !1;
424
- return typeof e == "string" && (e = Ft(e)), typeof e == "object" && (O(e.r) && O(e.g) && O(e.b) ? (t = $t(e.r, e.g, e.b), o = !0, l = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : O(e.h) && O(e.s) && O(e.v) ? (a = se(e.s), r = se(e.v), t = Ot(e.h, a, r), o = !0, l = "hsv") : O(e.h) && O(e.s) && O(e.l) && (a = se(e.s), i = se(e.l), t = zt(e.h, a, i), o = !0, l = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a)), n = Je(n), {
282
+ function Tt(e) {
283
+ 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 = Ot(e)), typeof e == "object" && (L(e.r) && L(e.g) && L(e.b) ? (t = St(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 = Mt(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 = xt(e.h, a, r), o = !0, l = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a)), n = Ue(n), {
425
285
  ok: o,
426
286
  format: e.format || l,
427
287
  r: Math.min(255, Math.max(t.r, 0)),
@@ -430,54 +290,54 @@ function Et(e) {
430
290
  a: n
431
291
  };
432
292
  }
433
- var Rt = "[-\\+]?\\d+%?", Ht = "[-\\+]?\\d*\\.\\d+%?", N = "(?:".concat(Ht, ")|(?:").concat(Rt, ")"), we = "[\\s|\\(]+(".concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")\\s*\\)?"), Se = "[\\s|\\(]+(".concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")\\s*\\)?"), k = {
434
- CSS_UNIT: new RegExp(N),
435
- rgb: new RegExp("rgb" + we),
436
- rgba: new RegExp("rgba" + Se),
437
- hsl: new RegExp("hsl" + we),
438
- hsla: new RegExp("hsla" + Se),
439
- hsv: new RegExp("hsv" + we),
440
- hsva: new RegExp("hsva" + Se),
293
+ var kt = "[-\\+]?\\d+%?", zt = "[-\\+]?\\d*\\.\\d+%?", $ = "(?:".concat(zt, ")|(?:").concat(kt, ")"), ye = "[\\s|\\(]+(".concat($, ")[,|\\s]+(").concat($, ")[,|\\s]+(").concat($, ")\\s*\\)?"), we = "[\\s|\\(]+(".concat($, ")[,|\\s]+(").concat($, ")[,|\\s]+(").concat($, ")[,|\\s]+(").concat($, ")\\s*\\)?"), C = {
294
+ CSS_UNIT: new RegExp($),
295
+ rgb: new RegExp("rgb" + ye),
296
+ rgba: new RegExp("rgba" + we),
297
+ hsl: new RegExp("hsl" + ye),
298
+ hsla: new RegExp("hsla" + we),
299
+ hsv: new RegExp("hsv" + ye),
300
+ hsva: new RegExp("hsva" + we),
441
301
  hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
442
302
  hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
443
303
  hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
444
304
  hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
445
305
  };
446
- function Ft(e) {
306
+ function Ot(e) {
447
307
  if (e = e.trim().toLowerCase(), e.length === 0)
448
308
  return !1;
449
309
  var t = !1;
450
- if (ke[e])
451
- e = ke[e], t = !0;
310
+ if (Ae[e])
311
+ e = Ae[e], t = !0;
452
312
  else if (e === "transparent")
453
313
  return { r: 0, g: 0, b: 0, a: 0, format: "name" };
454
- var n = k.rgb.exec(e);
455
- return n ? { r: n[1], g: n[2], b: n[3] } : (n = k.rgba.exec(e), n ? { r: n[1], g: n[2], b: n[3], a: n[4] } : (n = k.hsl.exec(e), n ? { h: n[1], s: n[2], l: n[3] } : (n = k.hsla.exec(e), n ? { h: n[1], s: n[2], l: n[3], a: n[4] } : (n = k.hsv.exec(e), n ? { h: n[1], s: n[2], v: n[3] } : (n = k.hsva.exec(e), n ? { h: n[1], s: n[2], v: n[3], a: n[4] } : (n = k.hex8.exec(e), n ? {
456
- r: S(n[1]),
457
- g: S(n[2]),
458
- b: S(n[3]),
459
- a: Ve(n[4]),
314
+ var n = C.rgb.exec(e);
315
+ 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 ? {
316
+ r: w(n[1]),
317
+ g: w(n[2]),
318
+ b: w(n[3]),
319
+ a: Pe(n[4]),
460
320
  format: t ? "name" : "hex8"
461
- } : (n = k.hex6.exec(e), n ? {
462
- r: S(n[1]),
463
- g: S(n[2]),
464
- b: S(n[3]),
321
+ } : (n = C.hex6.exec(e), n ? {
322
+ r: w(n[1]),
323
+ g: w(n[2]),
324
+ b: w(n[3]),
465
325
  format: t ? "name" : "hex"
466
- } : (n = k.hex4.exec(e), n ? {
467
- r: S(n[1] + n[1]),
468
- g: S(n[2] + n[2]),
469
- b: S(n[3] + n[3]),
470
- a: Ve(n[4] + n[4]),
326
+ } : (n = C.hex4.exec(e), n ? {
327
+ r: w(n[1] + n[1]),
328
+ g: w(n[2] + n[2]),
329
+ b: w(n[3] + n[3]),
330
+ a: Pe(n[4] + n[4]),
471
331
  format: t ? "name" : "hex8"
472
- } : (n = k.hex3.exec(e), n ? {
473
- r: S(n[1] + n[1]),
474
- g: S(n[2] + n[2]),
475
- b: S(n[3] + n[3]),
332
+ } : (n = C.hex3.exec(e), n ? {
333
+ r: w(n[1] + n[1]),
334
+ g: w(n[2] + n[2]),
335
+ b: w(n[3] + n[3]),
476
336
  format: t ? "name" : "hex"
477
337
  } : !1)))))))));
478
338
  }
479
- function O(e) {
480
- return !!k.CSS_UNIT.exec(String(e));
339
+ function L(e) {
340
+ return !!C.CSS_UNIT.exec(String(e));
481
341
  }
482
342
  var J = (
483
343
  /** @class */
@@ -487,9 +347,9 @@ var J = (
487
347
  var a;
488
348
  if (t instanceof e)
489
349
  return t;
490
- typeof t == "number" && (t = Dt(t)), this.originalInput = t;
491
- var r = Et(t);
492
- this.originalInput = t, this.r = r.r, this.g = r.g, this.b = r.b, this.a = r.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (a = n.format) !== null && a !== void 0 ? a : r.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 = r.ok;
350
+ typeof t == "number" && (t = Ct(t)), this.originalInput = t;
351
+ var i = Tt(t);
352
+ 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;
493
353
  }
494
354
  return e.prototype.isDark = function() {
495
355
  return this.getBrightness() < 128;
@@ -499,33 +359,33 @@ var J = (
499
359
  var t = this.toRgb();
500
360
  return (t.r * 299 + t.g * 587 + t.b * 114) / 1e3;
501
361
  }, e.prototype.getLuminance = function() {
502
- var t = this.toRgb(), n, a, r, i = t.r / 255, o = t.g / 255, l = t.b / 255;
503
- return i <= 0.03928 ? n = i / 12.92 : n = Math.pow((i + 0.055) / 1.055, 2.4), o <= 0.03928 ? a = o / 12.92 : a = Math.pow((o + 0.055) / 1.055, 2.4), l <= 0.03928 ? r = l / 12.92 : r = Math.pow((l + 0.055) / 1.055, 2.4), 0.2126 * n + 0.7152 * a + 0.0722 * r;
362
+ var t = this.toRgb(), n, a, i, r = t.r / 255, o = t.g / 255, l = t.b / 255;
363
+ return r <= 0.03928 ? n = r / 12.92 : n = Math.pow((r + 0.055) / 1.055, 2.4), o <= 0.03928 ? a = o / 12.92 : a = Math.pow((o + 0.055) / 1.055, 2.4), l <= 0.03928 ? i = l / 12.92 : i = Math.pow((l + 0.055) / 1.055, 2.4), 0.2126 * n + 0.7152 * a + 0.0722 * i;
504
364
  }, e.prototype.getAlpha = function() {
505
365
  return this.a;
506
366
  }, e.prototype.setAlpha = function(t) {
507
- return this.a = Je(t), this.roundA = Math.round(100 * this.a) / 100, this;
367
+ return this.a = Ue(t), this.roundA = Math.round(100 * this.a) / 100, this;
508
368
  }, e.prototype.isMonochrome = function() {
509
369
  var t = this.toHsl().s;
510
370
  return t === 0;
511
371
  }, e.prototype.toHsv = function() {
512
- var t = je(this.r, this.g, this.b);
372
+ var t = De(this.r, this.g, this.b);
513
373
  return { h: t.h * 360, s: t.s, v: t.v, a: this.a };
514
374
  }, e.prototype.toHsvString = function() {
515
- var t = je(this.r, this.g, this.b), n = Math.round(t.h * 360), a = Math.round(t.s * 100), r = Math.round(t.v * 100);
516
- return this.a === 1 ? "hsv(".concat(n, ", ").concat(a, "%, ").concat(r, "%)") : "hsva(".concat(n, ", ").concat(a, "%, ").concat(r, "%, ").concat(this.roundA, ")");
375
+ var t = De(this.r, this.g, this.b), n = Math.round(t.h * 360), a = Math.round(t.s * 100), i = Math.round(t.v * 100);
376
+ return this.a === 1 ? "hsv(".concat(n, ", ").concat(a, "%, ").concat(i, "%)") : "hsva(".concat(n, ", ").concat(a, "%, ").concat(i, "%, ").concat(this.roundA, ")");
517
377
  }, e.prototype.toHsl = function() {
518
- var t = Pe(this.r, this.g, this.b);
378
+ var t = Re(this.r, this.g, this.b);
519
379
  return { h: t.h * 360, s: t.s, l: t.l, a: this.a };
520
380
  }, e.prototype.toHslString = function() {
521
- var t = Pe(this.r, this.g, this.b), n = Math.round(t.h * 360), a = Math.round(t.s * 100), r = Math.round(t.l * 100);
522
- return this.a === 1 ? "hsl(".concat(n, ", ").concat(a, "%, ").concat(r, "%)") : "hsla(".concat(n, ", ").concat(a, "%, ").concat(r, "%, ").concat(this.roundA, ")");
381
+ var t = Re(this.r, this.g, this.b), n = Math.round(t.h * 360), a = Math.round(t.s * 100), i = Math.round(t.l * 100);
382
+ return this.a === 1 ? "hsl(".concat(n, ", ").concat(a, "%, ").concat(i, "%)") : "hsla(".concat(n, ", ").concat(a, "%, ").concat(i, "%, ").concat(this.roundA, ")");
523
383
  }, e.prototype.toHex = function(t) {
524
- return t === void 0 && (t = !1), Be(this.r, this.g, this.b, t);
384
+ return t === void 0 && (t = !1), He(this.r, this.g, this.b, t);
525
385
  }, e.prototype.toHexString = function(t) {
526
386
  return t === void 0 && (t = !1), "#" + this.toHex(t);
527
387
  }, e.prototype.toHex8 = function(t) {
528
- return t === void 0 && (t = !1), Lt(this.r, this.g, this.b, this.a, t);
388
+ return t === void 0 && (t = !1), It(this.r, this.g, this.b, this.a, t);
529
389
  }, e.prototype.toHex8String = function(t) {
530
390
  return t === void 0 && (t = !1), "#" + this.toHex8(t);
531
391
  }, e.prototype.toRgb = function() {
@@ -540,7 +400,7 @@ var J = (
540
400
  return this.a === 1 ? "rgb(".concat(t, ", ").concat(n, ", ").concat(a, ")") : "rgba(".concat(t, ", ").concat(n, ", ").concat(a, ", ").concat(this.roundA, ")");
541
401
  }, e.prototype.toPercentageRgb = function() {
542
402
  var t = function(n) {
543
- return "".concat(Math.round(g(n, 255) * 100), "%");
403
+ return "".concat(Math.round(v(n, 255) * 100), "%");
544
404
  };
545
405
  return {
546
406
  r: t(this.r),
@@ -550,7 +410,7 @@ var J = (
550
410
  };
551
411
  }, e.prototype.toPercentageRgbString = function() {
552
412
  var t = function(n) {
553
- return Math.round(g(n, 255) * 100);
413
+ return Math.round(v(n, 255) * 100);
554
414
  };
555
415
  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, ")");
556
416
  }, e.prototype.toName = function() {
@@ -558,17 +418,17 @@ var J = (
558
418
  return "transparent";
559
419
  if (this.a < 1)
560
420
  return !1;
561
- for (var t = "#" + Be(this.r, this.g, this.b, !1), n = 0, a = Object.entries(ke); n < a.length; n++) {
562
- var r = a[n], i = r[0], o = r[1];
421
+ for (var t = "#" + He(this.r, this.g, this.b, !1), n = 0, a = Object.entries(Ae); n < a.length; n++) {
422
+ var i = a[n], r = i[0], o = i[1];
563
423
  if (t === o)
564
- return i;
424
+ return r;
565
425
  }
566
426
  return !1;
567
427
  }, e.prototype.toString = function(t) {
568
428
  var n = !!t;
569
429
  t = t ?? this.format;
570
- var a = !1, r = this.a < 1 && this.a >= 0, i = !n && r && (t.startsWith("hex") || t === "name");
571
- return i ? t === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (t === "rgb" && (a = this.toRgbString()), t === "prgb" && (a = this.toPercentageRgbString()), (t === "hex" || t === "hex6") && (a = this.toHexString()), t === "hex3" && (a = this.toHexString(!0)), t === "hex4" && (a = this.toHex8String(!0)), t === "hex8" && (a = this.toHex8String()), t === "name" && (a = this.toName()), t === "hsl" && (a = this.toHslString()), t === "hsv" && (a = this.toHsvString()), a || this.toHexString());
430
+ var a = !1, i = this.a < 1 && this.a >= 0, r = !n && i && (t.startsWith("hex") || t === "name");
431
+ return r ? t === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (t === "rgb" && (a = this.toRgbString()), t === "prgb" && (a = this.toPercentageRgbString()), (t === "hex" || t === "hex6") && (a = this.toHexString()), t === "hex3" && (a = this.toHexString(!0)), t === "hex4" && (a = this.toHex8String(!0)), t === "hex8" && (a = this.toHex8String()), t === "name" && (a = this.toName()), t === "hsl" && (a = this.toHslString()), t === "hsv" && (a = this.toHsvString()), a || this.toHexString());
572
432
  }, e.prototype.toNumber = function() {
573
433
  return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
574
434
  }, e.prototype.clone = function() {
@@ -576,7 +436,7 @@ var J = (
576
436
  }, e.prototype.lighten = function(t) {
577
437
  t === void 0 && (t = 10);
578
438
  var n = this.toHsl();
579
- return n.l += t / 100, n.l = oe(n.l), new e(n);
439
+ return n.l += t / 100, n.l = re(n.l), new e(n);
580
440
  }, e.prototype.brighten = function(t) {
581
441
  t === void 0 && (t = 10);
582
442
  var n = this.toRgb();
@@ -584,7 +444,7 @@ var J = (
584
444
  }, e.prototype.darken = function(t) {
585
445
  t === void 0 && (t = 10);
586
446
  var n = this.toHsl();
587
- return n.l -= t / 100, n.l = oe(n.l), new e(n);
447
+ return n.l -= t / 100, n.l = re(n.l), new e(n);
588
448
  }, e.prototype.tint = function(t) {
589
449
  return t === void 0 && (t = 10), this.mix("white", t);
590
450
  }, e.prototype.shade = function(t) {
@@ -592,11 +452,11 @@ var J = (
592
452
  }, e.prototype.desaturate = function(t) {
593
453
  t === void 0 && (t = 10);
594
454
  var n = this.toHsl();
595
- return n.s -= t / 100, n.s = oe(n.s), new e(n);
455
+ return n.s -= t / 100, n.s = re(n.s), new e(n);
596
456
  }, e.prototype.saturate = function(t) {
597
457
  t === void 0 && (t = 10);
598
458
  var n = this.toHsl();
599
- return n.s += t / 100, n.s = oe(n.s), new e(n);
459
+ return n.s += t / 100, n.s = re(n.s), new e(n);
600
460
  }, e.prototype.greyscale = function() {
601
461
  return this.desaturate(100);
602
462
  }, e.prototype.spin = function(t) {
@@ -604,26 +464,26 @@ var J = (
604
464
  return n.h = a < 0 ? 360 + a : a, new e(n);
605
465
  }, e.prototype.mix = function(t, n) {
606
466
  n === void 0 && (n = 50);
607
- var a = this.toRgb(), r = new e(t).toRgb(), i = n / 100, o = {
608
- r: (r.r - a.r) * i + a.r,
609
- g: (r.g - a.g) * i + a.g,
610
- b: (r.b - a.b) * i + a.b,
611
- a: (r.a - a.a) * i + a.a
467
+ var a = this.toRgb(), i = new e(t).toRgb(), r = n / 100, o = {
468
+ r: (i.r - a.r) * r + a.r,
469
+ g: (i.g - a.g) * r + a.g,
470
+ b: (i.b - a.b) * r + a.b,
471
+ a: (i.a - a.a) * r + a.a
612
472
  };
613
473
  return new e(o);
614
474
  }, e.prototype.analogous = function(t, n) {
615
475
  t === void 0 && (t = 6), n === void 0 && (n = 30);
616
- var a = this.toHsl(), r = 360 / n, i = [this];
617
- for (a.h = (a.h - (r * t >> 1) + 720) % 360; --t; )
618
- a.h = (a.h + r) % 360, i.push(new e(a));
619
- return i;
476
+ var a = this.toHsl(), i = 360 / n, r = [this];
477
+ for (a.h = (a.h - (i * t >> 1) + 720) % 360; --t; )
478
+ a.h = (a.h + i) % 360, r.push(new e(a));
479
+ return r;
620
480
  }, e.prototype.complement = function() {
621
481
  var t = this.toHsl();
622
482
  return t.h = (t.h + 180) % 360, new e(t);
623
483
  }, e.prototype.monochromatic = function(t) {
624
484
  t === void 0 && (t = 6);
625
- for (var n = this.toHsv(), a = n.h, r = n.s, i = n.v, o = [], l = 1 / t; t--; )
626
- o.push(new e({ h: a, s: r, v: i })), i = (i + l) % 1;
485
+ for (var n = this.toHsv(), a = n.h, i = n.s, r = n.v, o = [], l = 1 / t; t--; )
486
+ o.push(new e({ h: a, s: i, v: r })), r = (r + l) % 1;
627
487
  return o;
628
488
  }, e.prototype.splitcomplement = function() {
629
489
  var t = this.toHsl(), n = t.h;
@@ -644,29 +504,29 @@ var J = (
644
504
  }, e.prototype.tetrad = function() {
645
505
  return this.polyad(4);
646
506
  }, e.prototype.polyad = function(t) {
647
- for (var n = this.toHsl(), a = n.h, r = [this], i = 360 / t, o = 1; o < t; o++)
648
- r.push(new e({ h: (a + o * i) % 360, s: n.s, l: n.l }));
649
- return r;
507
+ for (var n = this.toHsl(), a = n.h, i = [this], r = 360 / t, o = 1; o < t; o++)
508
+ i.push(new e({ h: (a + o * r) % 360, s: n.s, l: n.l }));
509
+ return i;
650
510
  }, e.prototype.equals = function(t) {
651
511
  return this.toRgbString() === new e(t).toRgbString();
652
512
  }, e;
653
513
  }()
654
514
  );
655
- const Pt = new de("viewFadeIn", {
515
+ const Lt = new ce("viewFadeIn", {
656
516
  "0%": {
657
517
  opacity: 0
658
518
  },
659
519
  "100%": {
660
520
  opacity: 1
661
521
  }
662
- }), jt = new de("viewFadeOut", {
522
+ }), Nt = new ce("viewFadeOut", {
663
523
  "0%": {
664
524
  opacity: 1
665
525
  },
666
526
  "100%": {
667
527
  opacity: 0
668
528
  }
669
- }), Bt = new de("viewZoomBadgeIn", {
529
+ }), $t = new ce("viewZoomBadgeIn", {
670
530
  "0%": {
671
531
  transform: "scale(0.2)",
672
532
  opacity: 0
@@ -675,7 +535,7 @@ const Pt = new de("viewFadeIn", {
675
535
  transform: "scale(1)",
676
536
  opacity: 1
677
537
  }
678
- }), Vt = new de("viewZoomBadgeOut", {
538
+ }), Et = new ce("viewZoomBadgeOut", {
679
539
  "0%": {
680
540
  transform: "scale(1)"
681
541
  },
@@ -683,11 +543,11 @@ const Pt = new de("viewFadeIn", {
683
543
  transform: "scale(0.2)",
684
544
  opacity: 0
685
545
  }
686
- }), Ye = (e) => ({
546
+ }), Fe = (e) => ({
687
547
  position: e || "absolute",
688
548
  inset: 0
689
549
  });
690
- function xe(e) {
550
+ function Se(e) {
691
551
  return {
692
552
  position: e,
693
553
  top: 0,
@@ -696,7 +556,7 @@ function xe(e) {
696
556
  insetInlineStart: 0
697
557
  };
698
558
  }
699
- const Yt = (e) => ({
559
+ const Rt = (e) => ({
700
560
  boxSizing: "border-box",
701
561
  margin: 0,
702
562
  padding: 0,
@@ -705,11 +565,11 @@ const Yt = (e) => ({
705
565
  lineHeight: e.lineHeight,
706
566
  listStyle: "none",
707
567
  fontFamily: e.fontFamily
708
- }), Wt = (e) => {
709
- const { componentCls: t, modalMaskBg: n, paddingSM: a, previewOperationColorDisabled: r, motionDurationSlow: i } = e, o = new J(n).setAlpha(0.1), l = o.clone().setAlpha(0.2);
568
+ }), Dt = (e) => {
569
+ 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);
710
570
  return {
711
571
  [`${t}-operations`]: {
712
- ...Yt(e),
572
+ ...Rt(e),
713
573
  display: "flex",
714
574
  flexDirection: "row-reverse",
715
575
  alignItems: "center",
@@ -721,13 +581,13 @@ const Yt = (e) => ({
721
581
  marginInlineStart: a,
722
582
  padding: a,
723
583
  cursor: "pointer",
724
- transition: `all ${i}`,
584
+ transition: `all ${r}`,
725
585
  userSelect: "none",
726
586
  "&:hover": {
727
587
  background: l.toRgbString()
728
588
  },
729
589
  "&-disabled": {
730
- color: r,
590
+ color: i,
731
591
  pointerEvents: "none"
732
592
  },
733
593
  "&:last-of-type": {
@@ -744,8 +604,8 @@ const Yt = (e) => ({
744
604
  }
745
605
  }
746
606
  };
747
- }, Gt = (e) => {
748
- const { modalMaskBg: t, previewOperationColorDisabled: n, zIndexPopup: a, motionDurationSlow: r } = e, i = new J(t).setAlpha(0.1), o = i.clone().setAlpha(0.2);
607
+ }, Ht = (e) => {
608
+ const { modalMaskBg: t, previewOperationColorDisabled: n, zIndexPopup: a, motionDurationSlow: i } = e, r = new J(t).setAlpha(0.1), o = r.clone().setAlpha(0.2);
749
609
  return {
750
610
  [`${e.componentCls}-switch-left, ${e.componentCls}-switch-right`]: {
751
611
  position: "fixed",
@@ -758,11 +618,11 @@ const Yt = (e) => ({
758
618
  height: e.imagePreviewSwitchSize,
759
619
  marginTop: -e.imagePreviewSwitchSize / 2,
760
620
  color: e.previewOperationColor,
761
- background: i.toRgbString(),
621
+ background: r.toRgbString(),
762
622
  borderRadius: "50%",
763
623
  transform: "translateY(-50%)",
764
624
  cursor: "pointer",
765
- transition: `all ${r}`,
625
+ transition: `all ${i}`,
766
626
  pointerEvents: "auto",
767
627
  userSelect: "none",
768
628
  "&:hover": {
@@ -789,24 +649,24 @@ const Yt = (e) => ({
789
649
  insetInlineEnd: e.marginSM
790
650
  }
791
651
  };
792
- }, _t = (e) => ({
652
+ }, Pt = (e) => ({
793
653
  [e.componentCls]: {
794
654
  ["&-root"]: {
795
- ...xe("fixed"),
655
+ ...Se("fixed"),
796
656
  zIndex: e.zIndexPopup,
797
657
  overflow: "auto",
798
658
  outline: 0,
799
659
  WebkitOverflowScrolling: "touch"
800
660
  },
801
661
  ["&-wrapper"]: {
802
- ...xe("fixed"),
662
+ ...Se("fixed"),
803
663
  zIndex: e.zIndexPopup,
804
664
  overflow: "auto",
805
665
  outline: 0,
806
666
  WebkitOverflowScrolling: "touch"
807
667
  },
808
668
  ["&-mask"]: {
809
- ...xe("fixed"),
669
+ ...Se("fixed"),
810
670
  zIndex: e.zIndexPopupBase,
811
671
  height: "100%",
812
672
  backgroundColor: e.colorBgMask
@@ -817,11 +677,11 @@ const Yt = (e) => ({
817
677
  pointerEvents: "none"
818
678
  },
819
679
  ["&-body"]: {
820
- ...Ye(),
680
+ ...Fe(),
821
681
  overflow: "hidden"
822
682
  },
823
683
  ["&-canvas"]: {
824
- ...Ye(),
684
+ ...Fe(),
825
685
  display: "flex",
826
686
  justifyContent: "center",
827
687
  alignItems: "center",
@@ -844,17 +704,17 @@ const Yt = (e) => ({
844
704
  pointerEvents: "auto"
845
705
  },
846
706
  ["&-fade-appear, &-fade-enter"]: {
847
- animationName: Pt,
707
+ animationName: Lt,
848
708
  animationDuration: e.motionDurationSlow,
849
709
  animationTimingFunction: "linear"
850
710
  },
851
711
  ["&-fade-leave"]: {
852
- animationName: jt,
712
+ animationName: Nt,
853
713
  animationDuration: e.motionDurationSlow,
854
714
  animationTimingFunction: "linear"
855
715
  },
856
716
  ["&-zoom-appear, &-zoom-enter"]: {
857
- animationName: Bt,
717
+ animationName: $t,
858
718
  opacity: 0,
859
719
  animationTimingFunction: e.motionEaseOutCirc,
860
720
  animationFillMode: "both",
@@ -866,7 +726,7 @@ const Yt = (e) => ({
866
726
  animationPlayState: "running"
867
727
  },
868
728
  ["&-zoom-leave"]: {
869
- animationName: Vt,
729
+ animationName: Et,
870
730
  animationDuration: e.motionDurationSlow,
871
731
  animationTimingFunction: e.motionEaseOutBack,
872
732
  animationFillMode: "both"
@@ -884,19 +744,23 @@ const Yt = (e) => ({
884
744
  zIndex: e.zIndexPopup + 1,
885
745
  width: "100%"
886
746
  },
887
- "&": [Wt(e), Gt(e)]
888
- }), Ut = Qe("ImageView", (e) => {
889
- const t = Te(e, {
890
- zIndexPopup: e.zIndexPopupBase + 80,
891
- previewOperationColorDisabled: new J(e.colorTextLightSolid).setAlpha(0.25).toRgbString(),
892
- modalMaskBg: new J("#000").setAlpha(0.45).toRgbString(),
893
- previewOperationColor: new J(e.colorTextLightSolid).toRgbString(),
894
- previewOperationSize: e.fontSizeIcon * 1.5,
895
- imagePreviewSwitchSize: e.controlHeightLG,
896
- iconCls: "anticon"
897
- });
898
- return [_t(t)];
899
- }), Ke = wt({
747
+ "&": [Dt(e), Ht(e)]
748
+ });
749
+ function Ft(e) {
750
+ return gt("ImageView", (t) => {
751
+ const n = vt(t, {
752
+ zIndexPopup: t.zIndexPopupBase + 80,
753
+ previewOperationColorDisabled: new J(t.colorTextLightSolid).setAlpha(0.25).toRgbString(),
754
+ modalMaskBg: new J("#000").setAlpha(0.45).toRgbString(),
755
+ previewOperationColor: new J(t.colorTextLightSolid).toRgbString(),
756
+ previewOperationSize: t.fontSizeIcon * 1.5,
757
+ imagePreviewSwitchSize: t.controlHeightLG,
758
+ iconCls: "anticon"
759
+ });
760
+ return [Pt(n)];
761
+ }, e);
762
+ }
763
+ const Ze = pt({
900
764
  func: void 0,
901
765
  bool: void 0,
902
766
  string: void 0,
@@ -905,7 +769,7 @@ const Yt = (e) => ({
905
769
  object: void 0,
906
770
  integer: void 0
907
771
  });
908
- Ke.extend([{
772
+ Ze.extend([{
909
773
  name: "looseBool",
910
774
  getter: !0,
911
775
  type: Boolean,
@@ -920,7 +784,7 @@ Ke.extend([{
920
784
  getter: !0,
921
785
  type: null
922
786
  }]);
923
- const B = Ke, F = {
787
+ const V = Ze, P = {
924
788
  infinite: {
925
789
  type: Boolean,
926
790
  default: !0
@@ -936,7 +800,7 @@ const B = Ke, F = {
936
800
  getContainer: {
937
801
  type: String
938
802
  }
939
- }, ce = {
803
+ }, le = {
940
804
  previewTeleported: {
941
805
  type: Boolean,
942
806
  default: !0
@@ -945,8 +809,6 @@ const B = Ke, F = {
945
809
  type: Boolean,
946
810
  default: !0
947
811
  },
948
- wrapperClassName: String,
949
- wrapperStyle: { type: Object, default: void 0 },
950
812
  src: {
951
813
  type: String,
952
814
  default: ""
@@ -959,7 +821,7 @@ const B = Ke, F = {
959
821
  type: String,
960
822
  default: "contain"
961
823
  },
962
- lazy: B.bool,
824
+ lazy: V.bool,
963
825
  scrollContainer: {
964
826
  type: [String, Object]
965
827
  },
@@ -982,35 +844,39 @@ const B = Ke, F = {
982
844
  onClick: {
983
845
  type: Function
984
846
  },
985
- disablePreview: B.bool,
847
+ disablePreview: V.bool,
986
848
  previewSrcList: {
987
849
  type: Array,
988
850
  default: () => []
989
851
  },
990
- imageClassName: B.string,
991
- imageStyle: B.style,
992
- width: B.number,
993
- height: B.number,
994
- zIndex: F.zIndex,
995
- infinite: F.infinite,
996
- getContainer: F.getContainer,
997
- initialIndex: F.initialIndex
998
- }, Zt = {
852
+ imageClassName: V.string,
853
+ imageStyle: V.style,
854
+ width: V.number,
855
+ height: V.number,
856
+ zIndex: P.zIndex,
857
+ infinite: P.infinite,
858
+ getContainer: P.getContainer,
859
+ initialIndex: {
860
+ ...P.initialIndex,
861
+ default: () => {
862
+ }
863
+ }
864
+ }, jt = {
999
865
  urlList: {
1000
866
  type: Array,
1001
867
  default: () => []
1002
868
  },
1003
- teleported: ce.previewTeleported,
1004
- zIndex: F.zIndex,
1005
- initialIndex: F.initialIndex,
1006
- infinite: F.infinite,
1007
- getContainer: ce.getContainer,
1008
- onHideOnClickModal: ce.hideOnClickModal,
869
+ teleported: le.previewTeleported,
870
+ zIndex: P.zIndex,
871
+ initialIndex: P.initialIndex,
872
+ infinite: P.infinite,
873
+ getContainer: le.getContainer,
874
+ onHideOnClickModal: le.hideOnClickModal,
1009
875
  icons: {
1010
876
  type: Object,
1011
877
  default: () => ({})
1012
878
  }
1013
- }, V = {
879
+ }, Y = {
1014
880
  tab: "Tab",
1015
881
  enter: "Enter",
1016
882
  space: "Space",
@@ -1021,22 +887,22 @@ const B = Ke, F = {
1021
887
  esc: "Escape",
1022
888
  delete: "Delete",
1023
889
  backspace: "Backspace"
1024
- }, le = function(e, t, n, a = !1) {
890
+ }, se = function(e, t, n, a = !1) {
1025
891
  e && t && n && e.addEventListener(t, n, a);
1026
- }, Ie = function(e, t, n, a = !1) {
892
+ }, xe = function(e, t, n, a = !1) {
1027
893
  e && t && n && e.removeEventListener(t, n, a);
1028
- }, X = {
894
+ }, _ = {
1029
895
  CONTAIN: {
1030
896
  name: "contain",
1031
- icon: c(ot, null, null)
897
+ icon: c(et, null, null)
1032
898
  },
1033
899
  ORIGINAL: {
1034
900
  name: "original",
1035
- icon: c(st, null, null)
901
+ icon: c(tt, null, null)
1036
902
  }
1037
- }, Xt = function() {
1038
- return !q && !!window.navigator.userAgent.match(/firefox/i);
1039
- }, We = Xt() ? "DOMMouseScroll" : "mousewheel";
903
+ }, Bt = function() {
904
+ return !Q && !!window.navigator.userAgent.match(/firefox/i);
905
+ }, je = Bt() ? "DOMMouseScroll" : "mousewheel";
1040
906
  function Me(e) {
1041
907
  let t = !1;
1042
908
  return function(...n) {
@@ -1045,282 +911,287 @@ function Me(e) {
1045
911
  }));
1046
912
  };
1047
913
  }
1048
- const qt = /* @__PURE__ */ _e({
1049
- props: Zt,
914
+ const Vt = /* @__PURE__ */ Ve({
915
+ props: jt,
1050
916
  emits: ["close", "switch"],
1051
917
  setup: function(e, {
1052
918
  emit: t,
1053
919
  expose: n
1054
920
  }) {
1055
- var re, ie, R, Z, $e;
1056
- let a = null, r = null, i = null;
1057
- const o = Q({
921
+ var ae, ie, D, X, Ce;
922
+ let a = null, i = null, r = null;
923
+ const o = Ge({
1058
924
  suffixCls: "image-viewer"
1059
- }), [l, u] = Ut(o), p = ze(!1), [v, z] = Ee(!1), [C, m] = Ee(!1), A = x(!0), d = x(e.initialIndex), Y = x(null), P = x(null), W = x(X.CONTAIN), h = x({
1060
- scale: 1,
1061
- deg: 0,
1062
- offsetX: 0,
1063
- offsetY: 0,
1064
- enableTransition: !1
1065
- }), G = M(() => e.urlList.length > 1), K = M(() => d.value === 0), ee = M(() => d.value === e.urlList.length - 1), te = M(() => e.urlList[d.value]), he = M(() => {
925
+ }), {
926
+ wrapSSR: l,
927
+ hashId: f
928
+ } = Ft(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 = Xe({
929
+ transform: {
930
+ scale: 1,
931
+ deg: 0,
932
+ offsetX: 0,
933
+ offsetY: 0,
934
+ enableTransition: !1
935
+ }
936
+ }), 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(() => {
1066
937
  const {
1067
938
  scale: s,
1068
- deg: y,
1069
- offsetX: w,
1070
- offsetY: $,
1071
- enableTransition: b
1072
- } = h.value, I = {
1073
- transform: `scale(${s}) rotate(${y}deg)`,
1074
- transition: b ? "transform .3s" : "",
1075
- marginLeft: `${w}px`,
1076
- marginTop: `${$}px`
939
+ deg: M,
940
+ offsetX: h,
941
+ offsetY: y,
942
+ enableTransition: p
943
+ } = d.transform, I = {
944
+ transform: `scale(${s}) rotate(${M}deg)`,
945
+ transition: p ? "transform .3s" : "",
946
+ marginLeft: `${h}px`,
947
+ marginTop: `${y}px`
1077
948
  };
1078
- return W.value.name === X.CONTAIN.name && (I.maxWidth = I.maxHeight = "100%"), I;
1079
- }), ne = () => {
1080
- pe(), t("close"), h.value = {
949
+ return W.value.name === _.CONTAIN.name && (I.maxWidth = I.maxHeight = "100%"), I;
950
+ }), de = () => {
951
+ ve(), t("close"), d.transform = {
1081
952
  scale: 1,
1082
953
  deg: 0,
1083
954
  offsetX: 0,
1084
955
  offsetY: 0,
1085
956
  enableTransition: !1
1086
957
  };
1087
- }, ge = (s) => {
1088
- p.value ? p.value = !1 : Y.value === (s == null ? void 0 : s.target) && (m(!1), d.value = e.initialIndex);
1089
- }, ve = () => {
958
+ }, he = (s) => {
959
+ S.value ? S.value = !1 : F.value === (s == null ? void 0 : s.target) && (x(!1), g.value = e.initialIndex);
960
+ }, ge = () => {
1090
961
  a = Me((s) => {
1091
962
  switch (s.code) {
1092
- case V.esc:
1093
- m(!1);
963
+ case Y.esc:
964
+ x(!1);
1094
965
  break;
1095
- case V.space:
1096
- j();
966
+ case Y.space:
967
+ B();
1097
968
  break;
1098
- case V.left:
1099
- ae();
969
+ case Y.left:
970
+ ne();
1100
971
  break;
1101
- case V.up:
1102
- T("zoomIn");
972
+ case Y.up:
973
+ k("zoomIn");
1103
974
  break;
1104
- case V.right:
1105
- U();
975
+ case Y.right:
976
+ Z();
1106
977
  break;
1107
- case V.down:
1108
- T("zoomOut");
978
+ case Y.down:
979
+ k("zoomOut");
1109
980
  break;
1110
981
  }
1111
- }), r = Me((s) => {
1112
- (s.wheelDelta ? s.wheelDelta : -s.detail) > 0 ? T("zoomIn", {
982
+ }), i = Me((s) => {
983
+ (s.wheelDelta ? s.wheelDelta : -s.detail) > 0 ? k("zoomIn", {
1113
984
  zoomRate: 0.015,
1114
985
  enableTransition: !1
1115
- }) : T("zoomOut", {
986
+ }) : k("zoomOut", {
1116
987
  zoomRate: 0.015,
1117
988
  enableTransition: !1
1118
989
  });
1119
- }), le(document, "keydown", a), le(document, We, r);
1120
- }, pe = () => {
1121
- Ie(document, "keydown", a), Ie(document, We, r), a = null, r = null;
1122
- }, _ = () => {
1123
- A.value = !1;
1124
- }, f = (s) => {
1125
- A.value = !1, s.target.alt = "加载失败";
1126
- }, D = ze(), L = (s) => {
1127
- if (A.value || s.button !== 0)
990
+ }), se(document, "keydown", a), se(document, je, i);
991
+ }, ve = () => {
992
+ xe(document, "keydown", a), xe(document, je, i), a = null, i = null;
993
+ }, U = () => {
994
+ O.value = !1;
995
+ }, u = (s) => {
996
+ O.value = !1, s.target.alt = "加载失败";
997
+ }, b = Te(), T = (s) => {
998
+ if (O.value || s.button !== 0)
1128
999
  return;
1129
- s.preventDefault(), s.stopPropagation(), clearTimeout(D.value), p.value = !0;
1000
+ s.preventDefault(), s.stopPropagation(), clearTimeout(b.value), S.value = !0;
1130
1001
  const {
1131
- offsetX: y,
1132
- offsetY: w
1133
- } = h.value, $ = s.pageX, b = s.pageY;
1134
- i = Me((I) => {
1135
- h.value = {
1136
- ...h.value,
1137
- offsetX: y + I.pageX - $,
1138
- offsetY: w + I.pageY - b
1002
+ offsetX: M,
1003
+ offsetY: h
1004
+ } = d.transform, y = s.pageX, p = s.pageY;
1005
+ r = Me((I) => {
1006
+ d.transform = {
1007
+ ...d.transform,
1008
+ offsetX: M + I.pageX - y,
1009
+ offsetY: h + I.pageY - p
1139
1010
  };
1140
- }), le(document, "mousemove", i), le(document, "mouseup", () => {
1141
- Ie(document, "mousemove", i), v.value && C.value && (D.value = setTimeout(() => {
1142
- p.value = !1;
1011
+ }), se(document, "mousemove", r), se(document, "mouseup", () => {
1012
+ xe(document, "mousemove", r), m.value && z.value && (b.value = setTimeout(() => {
1013
+ S.value = !1;
1143
1014
  }));
1144
1015
  });
1145
- }, E = () => {
1146
- h.value = {
1016
+ }, R = () => {
1017
+ d.transform = {
1147
1018
  scale: 1,
1148
1019
  deg: 0,
1149
1020
  offsetX: 0,
1150
1021
  offsetY: 0,
1151
1022
  enableTransition: !1
1152
1023
  };
1153
- }, j = () => {
1154
- if (A.value)
1024
+ }, B = () => {
1025
+ if (O.value)
1155
1026
  return;
1156
- const s = Object.keys(X), y = Object.values(X), w = W.value.name, b = (y.findIndex((I) => I.name === w) + 1) % s.length;
1157
- W.value = X[s[b]], E();
1158
- }, ae = () => {
1027
+ const s = Object.keys(_), M = Object.values(_), h = W.value.name, p = (M.findIndex((I) => I.name === h) + 1) % s.length;
1028
+ W.value = _[s[p]], R();
1029
+ }, ne = () => {
1159
1030
  if (K.value && !e.infinite)
1160
1031
  return;
1161
1032
  const s = e.urlList.length;
1162
- d.value = (d.value - 1 + s) % s;
1163
- }, U = () => {
1033
+ g.value = (g.value - 1 + s) % s;
1034
+ }, Z = () => {
1164
1035
  if (ee.value && !e.infinite)
1165
1036
  return;
1166
1037
  const s = e.urlList.length;
1167
- d.value = (d.value + 1) % s;
1168
- }, T = (s, y = {}) => {
1169
- if (A.value)
1038
+ g.value = (g.value + 1) % s;
1039
+ }, k = (s, M = {}) => {
1040
+ if (O.value)
1170
1041
  return;
1171
1042
  const {
1172
- zoomRate: w,
1173
- rotateDeg: $,
1174
- enableTransition: b
1043
+ zoomRate: h,
1044
+ rotateDeg: y,
1045
+ enableTransition: p
1175
1046
  } = {
1176
1047
  zoomRate: 0.2,
1177
1048
  rotateDeg: 90,
1178
1049
  enableTransition: !0,
1179
- ...y
1050
+ ...M
1180
1051
  };
1181
1052
  switch (s) {
1182
1053
  case "zoomOut":
1183
- h.value.scale > 0.2 && (h.value.scale = parseFloat((h.value.scale - w).toFixed(3)));
1054
+ d.transform.scale > 0.2 && (d.transform.scale = parseFloat((d.transform.scale - h).toFixed(3)));
1184
1055
  break;
1185
1056
  case "zoomIn":
1186
- h.value.scale = parseFloat((h.value.scale + w).toFixed(3));
1057
+ d.transform.scale = parseFloat((d.transform.scale + h).toFixed(3));
1187
1058
  break;
1188
1059
  case "clocelise":
1189
- h.value.deg += $;
1060
+ d.transform.deg += y;
1190
1061
  break;
1191
1062
  case "anticlocelise":
1192
- h.value.deg -= $;
1063
+ d.transform.deg -= y;
1193
1064
  break;
1194
1065
  }
1195
- h.value.enableTransition = b;
1066
+ d.transform.enableTransition = p;
1196
1067
  }, me = [{
1197
- icon: ((re = e.icons) == null ? void 0 : re.close) || c(lt, null, null),
1068
+ icon: ((ae = e.icons) == null ? void 0 : ae.close) || c(nt, null, null),
1198
1069
  onClick: (s) => {
1199
- s.stopPropagation(), m(!1);
1070
+ s.stopPropagation(), x(!1);
1200
1071
  },
1201
1072
  type: "close"
1202
1073
  }, {
1203
- icon: ((ie = e.icons) == null ? void 0 : ie.zoomIn) || c(ut, null, null),
1074
+ icon: ((ie = e.icons) == null ? void 0 : ie.zoomIn) || c(at, null, null),
1204
1075
  onClick: (s) => {
1205
- s.stopPropagation(), T("zoomIn");
1076
+ s.stopPropagation(), k("zoomIn");
1206
1077
  },
1207
1078
  type: "zoomIn"
1208
1079
  }, {
1209
- icon: ((R = e.icons) == null ? void 0 : R.zoomOut) || c(ct, null, null),
1080
+ icon: ((D = e.icons) == null ? void 0 : D.zoomOut) || c(it, null, null),
1210
1081
  onClick: (s) => {
1211
- s.stopPropagation(), T("zoomOut");
1082
+ s.stopPropagation(), k("zoomOut");
1212
1083
  },
1213
1084
  type: "zoomOut"
1214
1085
  }, {
1215
- icon: ((Z = e.icons) == null ? void 0 : Z.rotateRight) || c(ft, null, null),
1086
+ icon: ((X = e.icons) == null ? void 0 : X.rotateRight) || c(rt, null, null),
1216
1087
  onClick: (s) => {
1217
- s.stopPropagation(), T("anticlocelise");
1088
+ s.stopPropagation(), k("anticlocelise");
1218
1089
  },
1219
1090
  type: "rotateRight"
1220
1091
  }, {
1221
- icon: (($e = e.icons) == null ? void 0 : $e.rotateLeft) || c(dt, null, null),
1092
+ icon: ((Ce = e.icons) == null ? void 0 : Ce.rotateLeft) || c(ot, null, null),
1222
1093
  onClick: (s) => {
1223
- s.stopPropagation(), T("clocelise");
1094
+ s.stopPropagation(), k("clocelise");
1224
1095
  },
1225
1096
  type: "rotateLeft"
1226
1097
  }];
1227
- return ue(te, () => {
1228
- Ue(() => {
1229
- P.value.complete || (A.value = !0);
1098
+ return q(te, () => {
1099
+ Ye(() => {
1100
+ j.value.complete || (O.value = !0);
1230
1101
  });
1231
- }), ue(d, (s) => {
1232
- E(), t("switch", s);
1233
- }), ue(v, (s) => {
1234
- s && (C.value = s);
1235
- }), Xe(() => {
1236
- var s, y;
1237
- ve(), (y = (s = Y.value) == null ? void 0 : s.focus) == null || y.call(s);
1102
+ }), q(g, (s) => {
1103
+ R(), t("switch", s);
1104
+ }), q(m, (s) => {
1105
+ s && (z.value = s);
1106
+ }), q([() => m.value, () => F.value], ([s, M]) => {
1107
+ var h, y;
1108
+ s && M && (ge(), (y = (h = F.value) == null ? void 0 : h.focus) == null || y.call(h));
1238
1109
  }), n({
1239
- setOpen: z
1110
+ setOpen: E
1240
1111
  }), () => {
1241
- const s = Fe(`${o}-fade`), y = Fe(`${o}-zoom`);
1242
- return l(c(tt, {
1112
+ const s = $e(`${o}-fade`), M = $e(`${o}-zoom`);
1113
+ return l(c(_e, {
1243
1114
  to: e.getContainer || "body",
1244
1115
  disabled: !e.teleported
1245
1116
  }, {
1246
- default: () => [v.value && c("div", {
1247
- class: `${o}-root ${u.value}`
1248
- }, [c(Oe, s, {
1249
- default: () => [Le(c("div", {
1250
- class: `${o}-mask ${u.value}`
1251
- }, null), [[Ne, v.value && C.value]])]
1117
+ default: () => [m.value && c("div", {
1118
+ class: `${o}-root ${f.value}`
1119
+ }, [c(ke, s, {
1120
+ default: () => [ze(c("div", {
1121
+ class: `${o}-mask ${f.value}`
1122
+ }, null), [[Oe, m.value && z.value]])]
1252
1123
  }), c("div", {
1253
- ref: Y,
1124
+ ref: F,
1254
1125
  tabindex: -1,
1255
- class: [`${o}-wrapper`, `${u.value}`],
1256
- onClick: (w) => e.onHideOnClickModal && ge(w)
1257
- }, [c(Oe, Ze(y, {
1258
- onAfterLeave: () => ne()
1126
+ class: [`${o}-wrapper`, `${f.value}`],
1127
+ onClick: (h) => e.onHideOnClickModal && he(h)
1128
+ }, [c(ke, We(M, {
1129
+ onAfterLeave: () => de()
1259
1130
  }), {
1260
1131
  default: () => {
1261
- var w, $;
1262
- return [Le(c("div", {
1263
- class: `${o}-block ${u.value}`
1132
+ var h, y;
1133
+ return [ze(c("div", {
1134
+ class: `${o}-block ${f.value}`
1264
1135
  }, [c("div", {
1265
- class: `${o}-content ${u.value}`
1136
+ class: `${o}-content ${f.value}`
1266
1137
  }, [c("div", {
1267
- class: `${o}-body ${u.value}`
1138
+ class: `${o}-body ${f.value}`
1268
1139
  }, [c("div", {
1269
- class: `${o}-operations-wrapper ${u.value}`,
1270
- onClick: (b) => b.stopPropagation()
1140
+ class: `${o}-operations-wrapper ${f.value}`,
1141
+ onClick: (p) => p.stopPropagation()
1271
1142
  }, [c("ul", {
1272
- class: `${o}-operations ${u.value}`
1143
+ class: `${o}-operations ${f.value}`
1273
1144
  }, [me.map(({
1274
- icon: b,
1145
+ icon: p,
1275
1146
  onClick: I,
1276
- type: be
1147
+ type: pe
1277
1148
  }) => c("li", {
1278
- class: `${o}-operations-operation ${u.value}`,
1149
+ class: `${o}-operations-operation ${f.value}`,
1279
1150
  onClick: I,
1280
- key: be
1281
- }, [nt(b, {
1282
- class: `${o}-operations-icon ${u.value}`
1151
+ key: pe
1152
+ }, [qe(p, {
1153
+ class: `${o}-operations-icon ${f.value}`
1283
1154
  })]))])]), c("div", {
1284
- class: `${o}-canvas ${u.value}`
1285
- }, [e.urlList.map((b, I) => c("img", {
1286
- ref: P,
1287
- class: `${o}-img ${u.value}`,
1155
+ class: `${o}-canvas ${f.value}`
1156
+ }, [e.urlList.map((p, I) => c("img", {
1157
+ ref: j,
1158
+ class: `${o}-img ${f.value}`,
1288
1159
  style: {
1289
- ...he.value,
1290
- display: I === d.value ? "block" : "none"
1160
+ ...fe.value,
1161
+ display: I === g.value ? "block" : "none"
1291
1162
  },
1292
- key: b,
1293
- src: b,
1294
- onLoad: () => _(),
1295
- onError: (be) => f(be),
1296
- onMousedown: L
1163
+ key: p,
1164
+ src: p,
1165
+ onLoad: () => U(),
1166
+ onError: (pe) => u(pe),
1167
+ onMousedown: T
1297
1168
  }, null))]), G.value && c("div", {
1298
- class: [`${o}-switch-left`, d.value === 0 && !e.infinite ? `${o}-switch-left-disabled` : "", `${u.value}`],
1299
- onClick: ae
1300
- }, [((w = e.icons) == null ? void 0 : w.left) || c(ht, null, null)]), G.value && c("div", {
1301
- class: [`${o}-switch-right`, d.value === e.urlList.length - 1 && !e.infinite ? `${o}-switch-right-disabled` : "", `${u.value}`],
1302
- onClick: U
1303
- }, [(($ = e.icons) == null ? void 0 : $.right) || c(gt, null, null)])])])]), [[Ne, v.value && C.value]])];
1169
+ class: [`${o}-switch-left`, g.value === 0 && !e.infinite ? `${o}-switch-left-disabled` : "", `${f.value}`],
1170
+ onClick: ne
1171
+ }, [((h = e.icons) == null ? void 0 : h.left) || c(st, null, null)]), G.value && c("div", {
1172
+ class: [`${o}-switch-right`, g.value === e.urlList.length - 1 && !e.infinite ? `${o}-switch-right-disabled` : "", `${f.value}`],
1173
+ onClick: Z
1174
+ }, [((y = e.icons) == null ? void 0 : y.right) || c(lt, null, null)])])])]), [[Oe, m.value && z.value]])];
1304
1175
  }
1305
1176
  })])])]
1306
1177
  }));
1307
1178
  };
1308
1179
  }
1309
- }), Ce = {
1180
+ }), Ie = {
1310
1181
  width: "100%",
1311
1182
  height: "100%"
1312
- }, Qt = (e) => ({
1183
+ }, Yt = (e) => ({
1313
1184
  [e.componentCls]: {
1314
1185
  display: "inline-block",
1315
1186
  position: "relative",
1316
1187
  overflow: "hidden",
1317
1188
  ["&-inner"]: {
1318
- ...Ce,
1189
+ ...Ie,
1319
1190
  verticalAlign: "top",
1320
1191
  opacity: 1
1321
1192
  },
1322
1193
  ["&-placeholder"]: {
1323
- ...Ce,
1194
+ ...Ie,
1324
1195
  backgroundColor: e.colorBgContainerDisabled,
1325
1196
  backgroundImage: "url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",
1326
1197
  backgroundRepeat: "no-repeat",
@@ -1328,7 +1199,7 @@ const qt = /* @__PURE__ */ _e({
1328
1199
  backgroundSize: "30%"
1329
1200
  },
1330
1201
  ["&-error"]: {
1331
- ...Ce,
1202
+ ...Ie,
1332
1203
  display: "flex",
1333
1204
  alignItems: "center",
1334
1205
  justifyContent: "center",
@@ -1339,13 +1210,10 @@ const qt = /* @__PURE__ */ _e({
1339
1210
  cursor: "pointer"
1340
1211
  }
1341
1212
  }
1342
- }), Jt = Qe("Image", (e) => {
1343
- const t = Te(e);
1344
- return [Qt(t)];
1345
- }), Kt = (e) => e && e.nodeType === Node.ELEMENT_NODE;
1346
- let Ge = "";
1347
- const fe = /* @__PURE__ */ _e({
1348
- props: ce,
1213
+ }), Wt = (e) => e && e.nodeType === Node.ELEMENT_NODE;
1214
+ let Be = "";
1215
+ const ue = /* @__PURE__ */ Ve({
1216
+ props: le,
1349
1217
  name: "GImage",
1350
1218
  emits: ["error", "click", "load"],
1351
1219
  setup(e, {
@@ -1353,127 +1221,136 @@ const fe = /* @__PURE__ */ _e({
1353
1221
  emit: n,
1354
1222
  attrs: a
1355
1223
  }) {
1356
- const r = Q({
1224
+ const i = Ge({
1357
1225
  suffixCls: "image"
1358
- }), [i, o] = Jt(r), l = x(), u = x(""), p = x(!1), v = x(!0), z = x(!1), C = x(null), m = x();
1359
- let A, d;
1360
- const Y = M(() => !q && e.fit ? {
1226
+ }), {
1227
+ wrapSSR: r,
1228
+ hashId: o
1229
+ } = mt("Image", [Yt], i), l = A(), f = A(""), S = A(!1), m = A(!0), E = A(!1), z = A(null), x = A();
1230
+ let O, g;
1231
+ const F = N(() => !Q && e.fit ? {
1361
1232
  "object-fit": e.fit
1362
- } : {}), P = M(() => {
1233
+ } : {}), j = N(() => {
1363
1234
  const {
1364
- previewSrcList: f
1235
+ previewSrcList: u
1365
1236
  } = e;
1366
- return Array.isArray(f) && f.length > 0;
1367
- }), W = M(() => {
1237
+ return Array.isArray(u) && u.length > 0;
1238
+ }), W = N(() => {
1368
1239
  const {
1369
- src: f,
1370
- previewSrcList: D,
1371
- initialIndex: L
1240
+ src: u,
1241
+ previewSrcList: b,
1242
+ initialIndex: T
1372
1243
  } = e;
1373
- if (L || L === 0)
1374
- return D.length >= L ? L : 0;
1375
- let E = 0;
1376
- const j = D.indexOf(f);
1377
- return j >= 0 && (E = j), E;
1378
- }), h = () => {
1379
- q || (v.value = !0, p.value = !1, e.src ? u.value = e.src : ne());
1244
+ if (T || T === 0)
1245
+ return b.length >= T ? T : 0;
1246
+ let R = 0;
1247
+ const B = b.indexOf(u);
1248
+ return B >= 0 && (R = B), R;
1249
+ }), d = () => {
1250
+ if (Q)
1251
+ return;
1252
+ m.value = !0, S.value = !1;
1253
+ const u = new Image();
1254
+ u.onload = (b) => fe(b), u.onerror = de, Object.keys(a || {}).forEach((b) => {
1255
+ if (b.toLowerCase() === "onload")
1256
+ return;
1257
+ const T = (a || {})[b];
1258
+ u.setAttribute(b, T);
1259
+ }), u.src = e.src;
1380
1260
  };
1381
1261
  function G() {
1382
- vt(C.value, m.value) && (h(), te());
1262
+ ut(z.value, x.value) && (d(), te());
1383
1263
  }
1384
- const K = St(G, 200), ee = async () => {
1385
- if (q)
1264
+ const K = bt(G, 200), ee = async () => {
1265
+ if (Q)
1386
1266
  return;
1387
- await Ue();
1267
+ await Ye();
1388
1268
  const {
1389
- scrollContainer: f
1269
+ scrollContainer: u
1390
1270
  } = e;
1391
- Kt(f) ? m.value = f : pt(f) && f !== "" ? m.value = document.querySelector(f) ?? void 0 : C.value && (m.value = mt(C.value)), m.value && (A = He(m, "scroll", K), setTimeout(() => G(), 200));
1271
+ Wt(u) ? x.value = u : ct(u) && u !== "" ? x.value = document.querySelector(u) ?? void 0 : z.value && (x.value = ft(z.value)), x.value && (O = Ee(x, "scroll", K), setTimeout(() => G(), 200));
1392
1272
  }, te = () => {
1393
- q || !m.value || !K || (A(), m.value = void 0);
1394
- }, he = (f) => {
1395
- v.value = !1, p.value = !1, n("load", f);
1396
- }, ne = (f) => {
1397
- v.value = !1, p.value = !0, n("error", f);
1398
- }, ge = (f) => {
1399
- if (f.ctrlKey) {
1400
- if (f.deltaY < 0)
1401
- return f.preventDefault(), !1;
1402
- if (f.deltaY > 0)
1403
- return f.preventDefault(), !1;
1273
+ Q || !x.value || !K || (O(), x.value = void 0);
1274
+ }, fe = (u) => {
1275
+ f.value = e.src, m.value = !1, S.value = !1, n("load", u);
1276
+ }, de = (u) => {
1277
+ m.value = !1, S.value = !0, n("error", u);
1278
+ }, he = (u) => {
1279
+ if (u.ctrlKey) {
1280
+ if (u.deltaY < 0)
1281
+ return u.preventDefault(), !1;
1282
+ if (u.deltaY > 0)
1283
+ return u.preventDefault(), !1;
1404
1284
  }
1405
- }, ve = () => {
1406
- !P.value || e.disablePreview || (d = He("wheel", ge, {
1285
+ }, ge = () => {
1286
+ !j.value || e.disablePreview || (g = Ee("wheel", he, {
1407
1287
  passive: !1
1408
- }), Ge = document.body.style.overflow, document.body.style.overflow = "hidden", z.value = !0);
1409
- }, pe = () => {
1410
- d == null || d(), document.body.style.overflow = Ge, z.value = !1;
1288
+ }), Be = document.body.style.overflow, document.body.style.overflow = "hidden", E.value = !0);
1289
+ }, ve = () => {
1290
+ g == null || g(), document.body.style.overflow = Be, E.value = !1;
1411
1291
  };
1412
- ue(() => e.src, () => {
1413
- e.lazy ? (v.value = !0, p.value = !1, te(), ee()) : h();
1292
+ q(() => e.src, () => {
1293
+ e.lazy ? (m.value = !0, S.value = !1, te(), ee()) : d();
1414
1294
  });
1415
- const _ = (f) => bt(f) ? f + "px" : f;
1416
- return Xe(() => {
1417
- e.lazy ? ee() : h();
1295
+ const U = (u) => dt(u) ? u + "px" : u;
1296
+ return ht(() => {
1297
+ e.lazy ? ee() : d();
1418
1298
  }), () => {
1419
1299
  const {
1420
- crossorigin: f,
1421
- decoding: D,
1422
- alt: L,
1423
- sizes: E,
1424
- srcset: j,
1425
- usemap: ae,
1426
- class: U,
1427
- style: T
1300
+ crossorigin: u,
1301
+ decoding: b,
1302
+ alt: T,
1303
+ sizes: R,
1304
+ srcset: B,
1305
+ usemap: ne,
1306
+ class: Z,
1307
+ style: k = {}
1428
1308
  } = a, me = {
1429
- crossorigin: f,
1430
- decoding: D,
1431
- alt: L,
1432
- sizes: E,
1433
- srcset: j,
1434
- usemap: ae,
1309
+ crossorigin: u,
1310
+ decoding: b,
1311
+ alt: T,
1312
+ sizes: R,
1313
+ srcset: B,
1314
+ usemap: ne,
1435
1315
  style: {
1436
- ...Y.value,
1437
- height: e.height ? _(e.height) : void 0,
1438
- ...T
1316
+ ...F.value,
1317
+ height: e.height ? U(e.height) : void 0
1439
1318
  }
1440
- }, re = De(t, e, "fallback"), ie = De(t, e, "placeholder");
1441
- return at(() => {
1442
- var R, Z;
1443
- P.value && z.value ? (R = l.value) == null || R.setOpen(!0) : (Z = l.value) == null || Z.setOpen(!1);
1444
- }), i(c(rt, null, [c("div", {
1319
+ }, ae = Le(t, e, "fallback"), ie = Le(t, e, "placeholder");
1320
+ return Qe(() => {
1321
+ var D, X;
1322
+ j.value && E.value ? (D = l.value) == null || D.setOpen(!0) : (X = l.value) == null || X.setOpen(!1);
1323
+ }), r(c(Je, null, [c("div", {
1445
1324
  class: {
1446
1325
  [`${o.value}`]: !0,
1447
- [`${r}`]: !0,
1448
- [`${e.wrapperClassName}`]: e.wrapperClassName
1326
+ [`${i}`]: !0,
1327
+ [`${Z}`]: !!Z
1449
1328
  },
1450
- ref: (R) => C.value = R,
1329
+ ref: (D) => z.value = D,
1451
1330
  style: {
1452
- ...e.wrapperStyle,
1453
- width: e.width ? _(e.width) : void 0,
1454
- height: e.height ? _(e.height) : void 0,
1455
- display: e.lazy ? "block" : void 0
1331
+ width: e.width ? U(e.width) : void 0,
1332
+ height: e.height ? U(e.height) : void 0,
1333
+ display: e.lazy ? "block" : void 0,
1334
+ ...k
1456
1335
  },
1457
1336
  onClick: () => {
1458
1337
  n("click");
1459
1338
  }
1460
- }, [v.value && (ie || c("div", {
1461
- class: `${r}-placeholder ${o.value}`
1462
- }, null)), p.value ? re || c("div", {
1463
- class: `${r}-error ${o.value}`
1464
- }, [it("加载失败")]) : u.value && c("img", Ze(me, {
1339
+ }, [m.value ? ie || c("div", {
1340
+ class: `${i}-placeholder ${o.value}`
1341
+ }, null) : S.value ? ae || c("div", {
1342
+ class: `${i}-error ${o.value}`
1343
+ }, [Ke("加载失败")]) : f.value && c("img", We(me, {
1465
1344
  class: {
1466
1345
  [`${o.value}`]: !0,
1467
- [`${r}-inner`]: !0,
1468
- [`${r}-preview`]: P.value,
1469
- [`${U}`]: !!U
1346
+ [`${e.imageClassName}`]: !!e.imageClassName,
1347
+ [`${i}-inner`]: !0,
1348
+ [`${i}-preview`]: j.value
1470
1349
  },
1471
1350
  alt: e.alt,
1472
- src: u.value,
1473
- onLoad: he,
1474
- onError: ne,
1475
- onClick: () => ve()
1476
- }), null), c(qt, {
1351
+ src: f.value,
1352
+ onClick: () => ge()
1353
+ }), null), c(Vt, {
1477
1354
  ref: l,
1478
1355
  zIndex: e.zIndex,
1479
1356
  infinite: e.infinite,
@@ -1481,15 +1358,15 @@ const fe = /* @__PURE__ */ _e({
1481
1358
  urlList: e.previewSrcList,
1482
1359
  getContainer: e.getContainer,
1483
1360
  onHideOnClickModal: e.hideOnClickModal,
1484
- onClose: () => pe()
1361
+ onClose: () => ve()
1485
1362
  }, null)])]));
1486
1363
  };
1487
1364
  }
1488
1365
  });
1489
- fe.isWImage = !0;
1490
- fe.install = (e) => (e.component(fe.name, fe), e);
1366
+ ue.isWImage = !0;
1367
+ ue.install = (e) => (e.component(ue.name, ue), e);
1491
1368
  export {
1492
- fe as GImage,
1493
- qt as ImageViewer,
1494
- fe as default
1369
+ ue as GImage,
1370
+ Vt as ImageViewer,
1371
+ ue as default
1495
1372
  };