@gx-design-vue/image 0.2.0-beta.2 → 0.2.0-beta.20

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