@gx-design-vue/image 0.2.0-beta.0 → 0.2.0-beta.10
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.d.ts +0 -11
- package/dist/components/style.d.ts +4 -2
- package/dist/image.mjs +433 -569
- package/dist/image.umd.js +1 -2
- package/dist/props.d.ts +2 -7
- package/dist/style.d.ts +2 -5
- package/package.json +4 -5
package/dist/image.mjs
CHANGED
|
@@ -1,275 +1,135 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ExpandOutlined as
|
|
3
|
-
import {
|
|
4
|
-
import { useState as
|
|
5
|
-
import {
|
|
6
|
-
import { createTypes as
|
|
7
|
-
import { useThrottleFn as
|
|
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
|
-
}
|
|
1
|
+
import { createVNode as u, defineComponent as Ve, shallowRef as Te, ref as w, computed as L, watch as le, nextTick as Ye, Teleport as _e, Transition as ke, withDirectives as ze, vShow as Oe, mergeProps as We, cloneVNode as qe, watchEffect as Qe, Fragment as Je, createTextVNode as Ke } from "vue";
|
|
2
|
+
import { ExpandOutlined as et, OneToOneOutlined as tt, CloseOutlined as nt, ZoomInOutlined as at, ZoomOutOutlined as it, RotateRightOutlined as rt, RotateLeftOutlined as ot, LeftOutlined as st, RightOutlined as lt } from "@ant-design/icons-vue";
|
|
3
|
+
import { isServer as q, getPrefixCls as Ge, getSlotVNode as Le, isInContainer as ut, isString as ct, getScrollContainer as ft, isNumber as dt } from "@gx-design-vue/pro-utils";
|
|
4
|
+
import { useState as Ne, onMountedOrActivated as Ue } from "@gx-design-vue/pro-hooks";
|
|
5
|
+
import { Keyframe as fe, useStyle as ht, mergeToken as gt, getTransitionProps as $e, useProStyle as vt } from "@gx-design-vue/pro-provider";
|
|
6
|
+
import { createTypes as pt } from "vue-types";
|
|
7
|
+
import { useThrottleFn as mt, useEventListener as Ee } from "@vueuse/core";
|
|
148
8
|
function g(e, t) {
|
|
149
|
-
|
|
150
|
-
var n =
|
|
9
|
+
bt(e) && (e = "100%");
|
|
10
|
+
var n = yt(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
|
|
13
|
+
function re(e) {
|
|
154
14
|
return Math.min(1, Math.max(0, e));
|
|
155
15
|
}
|
|
156
|
-
function
|
|
16
|
+
function bt(e) {
|
|
157
17
|
return typeof e == "string" && e.indexOf(".") !== -1 && parseFloat(e) === 1;
|
|
158
18
|
}
|
|
159
|
-
function
|
|
19
|
+
function yt(e) {
|
|
160
20
|
return typeof e == "string" && e.indexOf("%") !== -1;
|
|
161
21
|
}
|
|
162
|
-
function
|
|
22
|
+
function Ze(e) {
|
|
163
23
|
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
|
|
164
24
|
}
|
|
165
|
-
function
|
|
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
|
|
31
|
+
function wt(e, t, n) {
|
|
172
32
|
return {
|
|
173
33
|
r: g(e, 255) * 255,
|
|
174
34
|
g: g(t, 255) * 255,
|
|
175
35
|
b: g(n, 255) * 255
|
|
176
36
|
};
|
|
177
37
|
}
|
|
178
|
-
function
|
|
38
|
+
function Re(e, t, n) {
|
|
179
39
|
e = g(e, 255), t = g(t, 255), n = g(n, 255);
|
|
180
|
-
var a = Math.max(e, t, n),
|
|
181
|
-
if (a ===
|
|
182
|
-
o = 0,
|
|
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
|
|
185
|
-
switch (o = l > 0.5 ?
|
|
44
|
+
var c = a - i;
|
|
45
|
+
switch (o = l > 0.5 ? c / (2 - a - i) : c / (a + i), a) {
|
|
186
46
|
case e:
|
|
187
|
-
|
|
47
|
+
r = (t - n) / c + (t < n ? 6 : 0);
|
|
188
48
|
break;
|
|
189
49
|
case t:
|
|
190
|
-
|
|
50
|
+
r = (n - e) / c + 2;
|
|
191
51
|
break;
|
|
192
52
|
case n:
|
|
193
|
-
|
|
53
|
+
r = (e - t) / c + 4;
|
|
194
54
|
break;
|
|
195
55
|
}
|
|
196
|
-
|
|
56
|
+
r /= 6;
|
|
197
57
|
}
|
|
198
|
-
return { h:
|
|
58
|
+
return { h: r, s: o, l };
|
|
199
59
|
}
|
|
200
|
-
function
|
|
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
|
|
204
|
-
var a,
|
|
63
|
+
function St(e, t, n) {
|
|
64
|
+
var a, i, r;
|
|
205
65
|
if (e = g(e, 360), t = g(t, 100), n = g(n, 100), t === 0)
|
|
206
|
-
|
|
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 =
|
|
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:
|
|
71
|
+
return { r: a * 255, g: i * 255, b: r * 255 };
|
|
212
72
|
}
|
|
213
|
-
function
|
|
73
|
+
function De(e, t, n) {
|
|
214
74
|
e = g(e, 255), t = g(t, 255), n = g(n, 255);
|
|
215
|
-
var a = Math.max(e, t, n),
|
|
216
|
-
if (a ===
|
|
217
|
-
|
|
75
|
+
var a = Math.max(e, t, n), i = Math.min(e, t, n), r = 0, o = a, l = a - i, c = a === 0 ? 0 : l / a;
|
|
76
|
+
if (a === i)
|
|
77
|
+
r = 0;
|
|
218
78
|
else {
|
|
219
79
|
switch (a) {
|
|
220
80
|
case e:
|
|
221
|
-
|
|
81
|
+
r = (t - n) / l + (t < n ? 6 : 0);
|
|
222
82
|
break;
|
|
223
83
|
case t:
|
|
224
|
-
|
|
84
|
+
r = (n - e) / l + 2;
|
|
225
85
|
break;
|
|
226
86
|
case n:
|
|
227
|
-
|
|
87
|
+
r = (e - t) / l + 4;
|
|
228
88
|
break;
|
|
229
89
|
}
|
|
230
|
-
|
|
90
|
+
r /= 6;
|
|
231
91
|
}
|
|
232
|
-
return { h:
|
|
92
|
+
return { h: r, s: c, v: o };
|
|
233
93
|
}
|
|
234
|
-
function
|
|
94
|
+
function xt(e, t, n) {
|
|
235
95
|
e = g(e, 360) * 6, t = g(t, 100), n = g(n, 100);
|
|
236
|
-
var a = Math.floor(e),
|
|
237
|
-
return { r:
|
|
96
|
+
var a = Math.floor(e), i = e - a, r = n * (1 - t), o = n * (1 - i * t), l = n * (1 - (1 - i) * t), c = a % 6, S = [n, o, r, r, l, n][c], p = [l, n, n, o, r, r][c], $ = [r, r, l, n, n, o][c];
|
|
97
|
+
return { r: S * 255, g: p * 255, b: $ * 255 };
|
|
238
98
|
}
|
|
239
|
-
function
|
|
240
|
-
var
|
|
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 &&
|
|
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
|
|
248
|
-
var
|
|
107
|
+
function Mt(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(
|
|
112
|
+
H(It(a))
|
|
253
113
|
];
|
|
254
|
-
return
|
|
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
|
|
116
|
+
function It(e) {
|
|
257
117
|
return Math.round(parseFloat(e) * 255).toString(16);
|
|
258
118
|
}
|
|
259
|
-
function
|
|
260
|
-
return
|
|
119
|
+
function Pe(e) {
|
|
120
|
+
return y(e) / 255;
|
|
261
121
|
}
|
|
262
|
-
function
|
|
122
|
+
function y(e) {
|
|
263
123
|
return parseInt(e, 16);
|
|
264
124
|
}
|
|
265
|
-
function
|
|
125
|
+
function At(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
|
|
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
|
|
423
|
-
var t = { r: 0, g: 0, b: 0 }, n = 1, a = null,
|
|
424
|
-
return typeof e == "string" && (e =
|
|
282
|
+
function Ct(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 = zt(e)), typeof e == "object" && (z(e.r) && z(e.g) && z(e.b) ? (t = wt(e.r, e.g, e.b), o = !0, l = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : z(e.h) && z(e.s) && z(e.v) ? (a = oe(e.s), i = oe(e.v), t = xt(e.h, a, i), o = !0, l = "hsv") : z(e.h) && z(e.s) && z(e.l) && (a = oe(e.s), r = oe(e.l), t = St(e.h, a, r), o = !0, l = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a)), n = Ze(n), {
|
|
425
285
|
ok: o,
|
|
426
286
|
format: e.format || l,
|
|
427
287
|
r: Math.min(255, Math.max(t.r, 0)),
|
|
@@ -430,56 +290,56 @@ function Et(e) {
|
|
|
430
290
|
a: n
|
|
431
291
|
};
|
|
432
292
|
}
|
|
433
|
-
var
|
|
293
|
+
var Tt = "[-\\+]?\\d+%?", kt = "[-\\+]?\\d*\\.\\d+%?", N = "(?:".concat(kt, ")|(?:").concat(Tt, ")"), ye = "[\\s|\\(]+(".concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")\\s*\\)?"), we = "[\\s|\\(]+(".concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")\\s*\\)?"), I = {
|
|
434
294
|
CSS_UNIT: new RegExp(N),
|
|
435
|
-
rgb: new RegExp("rgb" +
|
|
436
|
-
rgba: new RegExp("rgba" +
|
|
437
|
-
hsl: new RegExp("hsl" +
|
|
438
|
-
hsla: new RegExp("hsla" +
|
|
439
|
-
hsv: new RegExp("hsv" +
|
|
440
|
-
hsva: new RegExp("hsva" +
|
|
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
|
|
306
|
+
function zt(e) {
|
|
447
307
|
if (e = e.trim().toLowerCase(), e.length === 0)
|
|
448
308
|
return !1;
|
|
449
309
|
var t = !1;
|
|
450
|
-
if (
|
|
451
|
-
e =
|
|
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 =
|
|
455
|
-
return n ? { r: n[1], g: n[2], b: n[3] } : (n =
|
|
456
|
-
r:
|
|
457
|
-
g:
|
|
458
|
-
b:
|
|
459
|
-
a:
|
|
314
|
+
var n = I.rgb.exec(e);
|
|
315
|
+
return n ? { r: n[1], g: n[2], b: n[3] } : (n = I.rgba.exec(e), n ? { r: n[1], g: n[2], b: n[3], a: n[4] } : (n = I.hsl.exec(e), n ? { h: n[1], s: n[2], l: n[3] } : (n = I.hsla.exec(e), n ? { h: n[1], s: n[2], l: n[3], a: n[4] } : (n = I.hsv.exec(e), n ? { h: n[1], s: n[2], v: n[3] } : (n = I.hsva.exec(e), n ? { h: n[1], s: n[2], v: n[3], a: n[4] } : (n = I.hex8.exec(e), n ? {
|
|
316
|
+
r: y(n[1]),
|
|
317
|
+
g: y(n[2]),
|
|
318
|
+
b: y(n[3]),
|
|
319
|
+
a: Pe(n[4]),
|
|
460
320
|
format: t ? "name" : "hex8"
|
|
461
|
-
} : (n =
|
|
462
|
-
r:
|
|
463
|
-
g:
|
|
464
|
-
b:
|
|
321
|
+
} : (n = I.hex6.exec(e), n ? {
|
|
322
|
+
r: y(n[1]),
|
|
323
|
+
g: y(n[2]),
|
|
324
|
+
b: y(n[3]),
|
|
465
325
|
format: t ? "name" : "hex"
|
|
466
|
-
} : (n =
|
|
467
|
-
r:
|
|
468
|
-
g:
|
|
469
|
-
b:
|
|
470
|
-
a:
|
|
326
|
+
} : (n = I.hex4.exec(e), n ? {
|
|
327
|
+
r: y(n[1] + n[1]),
|
|
328
|
+
g: y(n[2] + n[2]),
|
|
329
|
+
b: y(n[3] + n[3]),
|
|
330
|
+
a: Pe(n[4] + n[4]),
|
|
471
331
|
format: t ? "name" : "hex8"
|
|
472
|
-
} : (n =
|
|
473
|
-
r:
|
|
474
|
-
g:
|
|
475
|
-
b:
|
|
332
|
+
} : (n = I.hex3.exec(e), n ? {
|
|
333
|
+
r: y(n[1] + n[1]),
|
|
334
|
+
g: y(n[2] + n[2]),
|
|
335
|
+
b: y(n[3] + n[3]),
|
|
476
336
|
format: t ? "name" : "hex"
|
|
477
337
|
} : !1)))))))));
|
|
478
338
|
}
|
|
479
|
-
function
|
|
480
|
-
return !!
|
|
339
|
+
function z(e) {
|
|
340
|
+
return !!I.CSS_UNIT.exec(String(e));
|
|
481
341
|
}
|
|
482
|
-
var
|
|
342
|
+
var Q = (
|
|
483
343
|
/** @class */
|
|
484
344
|
function() {
|
|
485
345
|
function e(t, n) {
|
|
@@ -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 =
|
|
491
|
-
var
|
|
492
|
-
this.originalInput = t, this.r =
|
|
350
|
+
typeof t == "number" && (t = At(t)), this.originalInput = t;
|
|
351
|
+
var i = Ct(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,
|
|
503
|
-
return
|
|
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 =
|
|
367
|
+
return this.a = Ze(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 =
|
|
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 =
|
|
516
|
-
return this.a === 1 ? "hsv(".concat(n, ", ").concat(a, "%, ").concat(
|
|
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 =
|
|
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 =
|
|
522
|
-
return this.a === 1 ? "hsl(".concat(n, ", ").concat(a, "%, ").concat(
|
|
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),
|
|
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),
|
|
388
|
+
return t === void 0 && (t = !1), Mt(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() {
|
|
@@ -558,17 +418,17 @@ var J = (
|
|
|
558
418
|
return "transparent";
|
|
559
419
|
if (this.a < 1)
|
|
560
420
|
return !1;
|
|
561
|
-
for (var t = "#" +
|
|
562
|
-
var
|
|
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
|
|
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,
|
|
571
|
-
return
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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(),
|
|
608
|
-
r: (
|
|
609
|
-
g: (
|
|
610
|
-
b: (
|
|
611
|
-
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(),
|
|
617
|
-
for (a.h = (a.h - (
|
|
618
|
-
a.h = (a.h +
|
|
619
|
-
return
|
|
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,
|
|
626
|
-
o.push(new e({ h: a, s:
|
|
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,
|
|
648
|
-
|
|
649
|
-
return
|
|
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
|
|
515
|
+
const Ot = new fe("viewFadeIn", {
|
|
656
516
|
"0%": {
|
|
657
517
|
opacity: 0
|
|
658
518
|
},
|
|
659
519
|
"100%": {
|
|
660
520
|
opacity: 1
|
|
661
521
|
}
|
|
662
|
-
}),
|
|
522
|
+
}), Lt = new fe("viewFadeOut", {
|
|
663
523
|
"0%": {
|
|
664
524
|
opacity: 1
|
|
665
525
|
},
|
|
666
526
|
"100%": {
|
|
667
527
|
opacity: 0
|
|
668
528
|
}
|
|
669
|
-
}),
|
|
529
|
+
}), Nt = new fe("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
|
-
}),
|
|
538
|
+
}), $t = new fe("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
|
-
}),
|
|
546
|
+
}), Fe = (e) => ({
|
|
687
547
|
position: e || "absolute",
|
|
688
548
|
inset: 0
|
|
689
549
|
});
|
|
690
|
-
function
|
|
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
|
|
559
|
+
const Et = (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
|
-
}),
|
|
709
|
-
const { componentCls: t, modalMaskBg: n, paddingSM: a, previewOperationColorDisabled:
|
|
568
|
+
}), Rt = (e) => {
|
|
569
|
+
const { componentCls: t, modalMaskBg: n, paddingSM: a, previewOperationColorDisabled: i, motionDurationSlow: r } = e, o = new Q(n).setAlpha(0.1), l = o.clone().setAlpha(0.2);
|
|
710
570
|
return {
|
|
711
571
|
[`${t}-operations`]: {
|
|
712
|
-
...
|
|
572
|
+
...Et(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 ${
|
|
584
|
+
transition: `all ${r}`,
|
|
725
585
|
userSelect: "none",
|
|
726
586
|
"&:hover": {
|
|
727
587
|
background: l.toRgbString()
|
|
728
588
|
},
|
|
729
589
|
"&-disabled": {
|
|
730
|
-
color:
|
|
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
|
-
},
|
|
748
|
-
const { modalMaskBg: t, previewOperationColorDisabled: n, zIndexPopup: a, motionDurationSlow:
|
|
607
|
+
}, Dt = (e) => {
|
|
608
|
+
const { modalMaskBg: t, previewOperationColorDisabled: n, zIndexPopup: a, motionDurationSlow: i } = e, r = new Q(t).setAlpha(0.1), o = r.clone().setAlpha(0.2);
|
|
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:
|
|
621
|
+
background: r.toRgbString(),
|
|
762
622
|
borderRadius: "50%",
|
|
763
623
|
transform: "translateY(-50%)",
|
|
764
624
|
cursor: "pointer",
|
|
765
|
-
transition: `all ${
|
|
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
|
-
},
|
|
652
|
+
}, Ht = (e) => ({
|
|
793
653
|
[e.componentCls]: {
|
|
794
654
|
["&-root"]: {
|
|
795
|
-
...
|
|
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
|
-
...
|
|
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
|
-
...
|
|
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
|
-
...
|
|
680
|
+
...Fe(),
|
|
821
681
|
overflow: "hidden"
|
|
822
682
|
},
|
|
823
683
|
["&-canvas"]: {
|
|
824
|
-
...
|
|
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:
|
|
707
|
+
animationName: Ot,
|
|
848
708
|
animationDuration: e.motionDurationSlow,
|
|
849
709
|
animationTimingFunction: "linear"
|
|
850
710
|
},
|
|
851
711
|
["&-fade-leave"]: {
|
|
852
|
-
animationName:
|
|
712
|
+
animationName: Lt,
|
|
853
713
|
animationDuration: e.motionDurationSlow,
|
|
854
714
|
animationTimingFunction: "linear"
|
|
855
715
|
},
|
|
856
716
|
["&-zoom-appear, &-zoom-enter"]: {
|
|
857
|
-
animationName:
|
|
717
|
+
animationName: Nt,
|
|
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:
|
|
729
|
+
animationName: $t,
|
|
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
|
-
"&": [
|
|
888
|
-
})
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
})
|
|
747
|
+
"&": [Rt(e), Dt(e)]
|
|
748
|
+
});
|
|
749
|
+
function Pt(e) {
|
|
750
|
+
return ht("ImageView", (t) => {
|
|
751
|
+
const n = gt(t, {
|
|
752
|
+
zIndexPopup: t.zIndexPopupBase + 80,
|
|
753
|
+
previewOperationColorDisabled: new Q(t.colorTextLightSolid).setAlpha(0.25).toRgbString(),
|
|
754
|
+
modalMaskBg: new Q("#000").setAlpha(0.45).toRgbString(),
|
|
755
|
+
previewOperationColor: new Q(t.colorTextLightSolid).toRgbString(),
|
|
756
|
+
previewOperationSize: t.fontSizeIcon * 1.5,
|
|
757
|
+
imagePreviewSwitchSize: t.controlHeightLG,
|
|
758
|
+
iconCls: "anticon"
|
|
759
|
+
});
|
|
760
|
+
return [Ht(n)];
|
|
761
|
+
}, e);
|
|
762
|
+
}
|
|
763
|
+
const Xe = 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
|
-
|
|
772
|
+
Xe.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 =
|
|
787
|
+
const B = Xe, 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
|
-
},
|
|
803
|
+
}, ue = {
|
|
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: ""
|
|
@@ -991,21 +853,21 @@ const B = Ke, F = {
|
|
|
991
853
|
imageStyle: B.style,
|
|
992
854
|
width: B.number,
|
|
993
855
|
height: B.number,
|
|
994
|
-
zIndex:
|
|
995
|
-
infinite:
|
|
996
|
-
getContainer:
|
|
997
|
-
initialIndex:
|
|
998
|
-
},
|
|
856
|
+
zIndex: P.zIndex,
|
|
857
|
+
infinite: P.infinite,
|
|
858
|
+
getContainer: P.getContainer,
|
|
859
|
+
initialIndex: P.initialIndex
|
|
860
|
+
}, Ft = {
|
|
999
861
|
urlList: {
|
|
1000
862
|
type: Array,
|
|
1001
863
|
default: () => []
|
|
1002
864
|
},
|
|
1003
|
-
teleported:
|
|
1004
|
-
zIndex:
|
|
1005
|
-
initialIndex:
|
|
1006
|
-
infinite:
|
|
1007
|
-
getContainer:
|
|
1008
|
-
onHideOnClickModal:
|
|
865
|
+
teleported: ue.previewTeleported,
|
|
866
|
+
zIndex: P.zIndex,
|
|
867
|
+
initialIndex: P.initialIndex,
|
|
868
|
+
infinite: P.infinite,
|
|
869
|
+
getContainer: ue.getContainer,
|
|
870
|
+
onHideOnClickModal: ue.hideOnClickModal,
|
|
1009
871
|
icons: {
|
|
1010
872
|
type: Object,
|
|
1011
873
|
default: () => ({})
|
|
@@ -1021,22 +883,22 @@ const B = Ke, F = {
|
|
|
1021
883
|
esc: "Escape",
|
|
1022
884
|
delete: "Delete",
|
|
1023
885
|
backspace: "Backspace"
|
|
1024
|
-
},
|
|
886
|
+
}, se = function(e, t, n, a = !1) {
|
|
1025
887
|
e && t && n && e.addEventListener(t, n, a);
|
|
1026
|
-
},
|
|
888
|
+
}, xe = function(e, t, n, a = !1) {
|
|
1027
889
|
e && t && n && e.removeEventListener(t, n, a);
|
|
1028
|
-
},
|
|
890
|
+
}, _ = {
|
|
1029
891
|
CONTAIN: {
|
|
1030
892
|
name: "contain",
|
|
1031
|
-
icon:
|
|
893
|
+
icon: u(et, null, null)
|
|
1032
894
|
},
|
|
1033
895
|
ORIGINAL: {
|
|
1034
896
|
name: "original",
|
|
1035
|
-
icon:
|
|
897
|
+
icon: u(tt, null, null)
|
|
1036
898
|
}
|
|
1037
|
-
},
|
|
899
|
+
}, jt = function() {
|
|
1038
900
|
return !q && !!window.navigator.userAgent.match(/firefox/i);
|
|
1039
|
-
},
|
|
901
|
+
}, je = jt() ? "DOMMouseScroll" : "mousewheel";
|
|
1040
902
|
function Me(e) {
|
|
1041
903
|
let t = !1;
|
|
1042
904
|
return function(...n) {
|
|
@@ -1045,105 +907,108 @@ function Me(e) {
|
|
|
1045
907
|
}));
|
|
1046
908
|
};
|
|
1047
909
|
}
|
|
1048
|
-
const
|
|
1049
|
-
props:
|
|
910
|
+
const Bt = /* @__PURE__ */ Ve({
|
|
911
|
+
props: Ft,
|
|
1050
912
|
emits: ["close", "switch"],
|
|
1051
913
|
setup: function(e, {
|
|
1052
914
|
emit: t,
|
|
1053
915
|
expose: n
|
|
1054
916
|
}) {
|
|
1055
|
-
var
|
|
1056
|
-
let a = null,
|
|
1057
|
-
const o =
|
|
917
|
+
var ae, ie, D, X, Ce;
|
|
918
|
+
let a = null, i = null, r = null;
|
|
919
|
+
const o = Ge({
|
|
1058
920
|
suffixCls: "image-viewer"
|
|
1059
|
-
}),
|
|
921
|
+
}), {
|
|
922
|
+
wrapSSR: l,
|
|
923
|
+
hashId: c
|
|
924
|
+
} = Pt(o), S = Te(!1), [p, $] = Ne(!1), [T, x] = Ne(!1), k = w(!0), h = w(e.initialIndex), Y = w(null), F = w(null), W = w(_.CONTAIN), d = w({
|
|
1060
925
|
scale: 1,
|
|
1061
926
|
deg: 0,
|
|
1062
927
|
offsetX: 0,
|
|
1063
928
|
offsetY: 0,
|
|
1064
929
|
enableTransition: !1
|
|
1065
|
-
}), G =
|
|
930
|
+
}), G = L(() => e.urlList.length > 1), J = L(() => h.value === 0), K = L(() => h.value === e.urlList.length - 1), ee = L(() => e.urlList[h.value]), de = L(() => {
|
|
1066
931
|
const {
|
|
1067
932
|
scale: s,
|
|
1068
|
-
deg:
|
|
1069
|
-
offsetX:
|
|
1070
|
-
offsetY:
|
|
1071
|
-
enableTransition:
|
|
1072
|
-
} =
|
|
1073
|
-
transform: `scale(${s}) rotate(${
|
|
1074
|
-
transition:
|
|
1075
|
-
marginLeft: `${
|
|
1076
|
-
marginTop: `${
|
|
933
|
+
deg: m,
|
|
934
|
+
offsetX: b,
|
|
935
|
+
offsetY: C,
|
|
936
|
+
enableTransition: v
|
|
937
|
+
} = d.value, M = {
|
|
938
|
+
transform: `scale(${s}) rotate(${m}deg)`,
|
|
939
|
+
transition: v ? "transform .3s" : "",
|
|
940
|
+
marginLeft: `${b}px`,
|
|
941
|
+
marginTop: `${C}px`
|
|
1077
942
|
};
|
|
1078
|
-
return W.value.name ===
|
|
1079
|
-
}),
|
|
1080
|
-
|
|
943
|
+
return W.value.name === _.CONTAIN.name && (M.maxWidth = M.maxHeight = "100%"), M;
|
|
944
|
+
}), te = () => {
|
|
945
|
+
ve(), t("close"), d.value = {
|
|
1081
946
|
scale: 1,
|
|
1082
947
|
deg: 0,
|
|
1083
948
|
offsetX: 0,
|
|
1084
949
|
offsetY: 0,
|
|
1085
950
|
enableTransition: !1
|
|
1086
951
|
};
|
|
1087
|
-
},
|
|
1088
|
-
|
|
1089
|
-
},
|
|
952
|
+
}, he = (s) => {
|
|
953
|
+
S.value ? S.value = !1 : Y.value === (s == null ? void 0 : s.target) && (x(!1), h.value = e.initialIndex);
|
|
954
|
+
}, ge = () => {
|
|
1090
955
|
a = Me((s) => {
|
|
1091
956
|
switch (s.code) {
|
|
1092
957
|
case V.esc:
|
|
1093
|
-
|
|
958
|
+
x(!1);
|
|
1094
959
|
break;
|
|
1095
960
|
case V.space:
|
|
1096
961
|
j();
|
|
1097
962
|
break;
|
|
1098
963
|
case V.left:
|
|
1099
|
-
|
|
964
|
+
ne();
|
|
1100
965
|
break;
|
|
1101
966
|
case V.up:
|
|
1102
|
-
|
|
967
|
+
A("zoomIn");
|
|
1103
968
|
break;
|
|
1104
969
|
case V.right:
|
|
1105
|
-
|
|
970
|
+
Z();
|
|
1106
971
|
break;
|
|
1107
972
|
case V.down:
|
|
1108
|
-
|
|
973
|
+
A("zoomOut");
|
|
1109
974
|
break;
|
|
1110
975
|
}
|
|
1111
|
-
}),
|
|
1112
|
-
(s.wheelDelta ? s.wheelDelta : -s.detail) > 0 ?
|
|
976
|
+
}), i = Me((s) => {
|
|
977
|
+
(s.wheelDelta ? s.wheelDelta : -s.detail) > 0 ? A("zoomIn", {
|
|
1113
978
|
zoomRate: 0.015,
|
|
1114
979
|
enableTransition: !1
|
|
1115
|
-
}) :
|
|
980
|
+
}) : A("zoomOut", {
|
|
1116
981
|
zoomRate: 0.015,
|
|
1117
982
|
enableTransition: !1
|
|
1118
983
|
});
|
|
1119
|
-
}),
|
|
1120
|
-
},
|
|
1121
|
-
|
|
1122
|
-
},
|
|
1123
|
-
|
|
984
|
+
}), se(document, "keydown", a), se(document, je, i);
|
|
985
|
+
}, ve = () => {
|
|
986
|
+
xe(document, "keydown", a), xe(document, je, i), a = null, i = null;
|
|
987
|
+
}, U = () => {
|
|
988
|
+
k.value = !1;
|
|
1124
989
|
}, f = (s) => {
|
|
1125
|
-
|
|
1126
|
-
},
|
|
1127
|
-
if (
|
|
990
|
+
k.value = !1, s.target.alt = "加载失败";
|
|
991
|
+
}, E = Te(), O = (s) => {
|
|
992
|
+
if (k.value || s.button !== 0)
|
|
1128
993
|
return;
|
|
1129
|
-
s.preventDefault(), s.stopPropagation(), clearTimeout(
|
|
994
|
+
s.preventDefault(), s.stopPropagation(), clearTimeout(E.value), S.value = !0;
|
|
1130
995
|
const {
|
|
1131
|
-
offsetX:
|
|
1132
|
-
offsetY:
|
|
1133
|
-
} =
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
...
|
|
1137
|
-
offsetX:
|
|
1138
|
-
offsetY:
|
|
996
|
+
offsetX: m,
|
|
997
|
+
offsetY: b
|
|
998
|
+
} = d.value, C = s.pageX, v = s.pageY;
|
|
999
|
+
r = Me((M) => {
|
|
1000
|
+
d.value = {
|
|
1001
|
+
...d.value,
|
|
1002
|
+
offsetX: m + M.pageX - C,
|
|
1003
|
+
offsetY: b + M.pageY - v
|
|
1139
1004
|
};
|
|
1140
|
-
}),
|
|
1141
|
-
|
|
1142
|
-
|
|
1005
|
+
}), se(document, "mousemove", r), se(document, "mouseup", () => {
|
|
1006
|
+
xe(document, "mousemove", r), p.value && T.value && (E.value = setTimeout(() => {
|
|
1007
|
+
S.value = !1;
|
|
1143
1008
|
}));
|
|
1144
1009
|
});
|
|
1145
|
-
},
|
|
1146
|
-
|
|
1010
|
+
}, R = () => {
|
|
1011
|
+
d.value = {
|
|
1147
1012
|
scale: 1,
|
|
1148
1013
|
deg: 0,
|
|
1149
1014
|
offsetX: 0,
|
|
@@ -1151,176 +1016,176 @@ const qt = /* @__PURE__ */ _e({
|
|
|
1151
1016
|
enableTransition: !1
|
|
1152
1017
|
};
|
|
1153
1018
|
}, j = () => {
|
|
1154
|
-
if (
|
|
1019
|
+
if (k.value)
|
|
1155
1020
|
return;
|
|
1156
|
-
const s = Object.keys(
|
|
1157
|
-
W.value =
|
|
1158
|
-
},
|
|
1159
|
-
if (
|
|
1021
|
+
const s = Object.keys(_), m = Object.values(_), b = W.value.name, v = (m.findIndex((M) => M.name === b) + 1) % s.length;
|
|
1022
|
+
W.value = _[s[v]], R();
|
|
1023
|
+
}, ne = () => {
|
|
1024
|
+
if (J.value && !e.infinite)
|
|
1160
1025
|
return;
|
|
1161
1026
|
const s = e.urlList.length;
|
|
1162
|
-
|
|
1163
|
-
},
|
|
1164
|
-
if (
|
|
1027
|
+
h.value = (h.value - 1 + s) % s;
|
|
1028
|
+
}, Z = () => {
|
|
1029
|
+
if (K.value && !e.infinite)
|
|
1165
1030
|
return;
|
|
1166
1031
|
const s = e.urlList.length;
|
|
1167
|
-
|
|
1168
|
-
},
|
|
1169
|
-
if (
|
|
1032
|
+
h.value = (h.value + 1) % s;
|
|
1033
|
+
}, A = (s, m = {}) => {
|
|
1034
|
+
if (k.value)
|
|
1170
1035
|
return;
|
|
1171
1036
|
const {
|
|
1172
|
-
zoomRate:
|
|
1173
|
-
rotateDeg:
|
|
1174
|
-
enableTransition:
|
|
1037
|
+
zoomRate: b,
|
|
1038
|
+
rotateDeg: C,
|
|
1039
|
+
enableTransition: v
|
|
1175
1040
|
} = {
|
|
1176
1041
|
zoomRate: 0.2,
|
|
1177
1042
|
rotateDeg: 90,
|
|
1178
1043
|
enableTransition: !0,
|
|
1179
|
-
...
|
|
1044
|
+
...m
|
|
1180
1045
|
};
|
|
1181
1046
|
switch (s) {
|
|
1182
1047
|
case "zoomOut":
|
|
1183
|
-
|
|
1048
|
+
d.value.scale > 0.2 && (d.value.scale = parseFloat((d.value.scale - b).toFixed(3)));
|
|
1184
1049
|
break;
|
|
1185
1050
|
case "zoomIn":
|
|
1186
|
-
|
|
1051
|
+
d.value.scale = parseFloat((d.value.scale + b).toFixed(3));
|
|
1187
1052
|
break;
|
|
1188
1053
|
case "clocelise":
|
|
1189
|
-
|
|
1054
|
+
d.value.deg += C;
|
|
1190
1055
|
break;
|
|
1191
1056
|
case "anticlocelise":
|
|
1192
|
-
|
|
1057
|
+
d.value.deg -= C;
|
|
1193
1058
|
break;
|
|
1194
1059
|
}
|
|
1195
|
-
|
|
1196
|
-
},
|
|
1197
|
-
icon: ((
|
|
1060
|
+
d.value.enableTransition = v;
|
|
1061
|
+
}, pe = [{
|
|
1062
|
+
icon: ((ae = e.icons) == null ? void 0 : ae.close) || u(nt, null, null),
|
|
1198
1063
|
onClick: (s) => {
|
|
1199
|
-
s.stopPropagation(),
|
|
1064
|
+
s.stopPropagation(), x(!1);
|
|
1200
1065
|
},
|
|
1201
1066
|
type: "close"
|
|
1202
1067
|
}, {
|
|
1203
|
-
icon: ((ie = e.icons) == null ? void 0 : ie.zoomIn) ||
|
|
1068
|
+
icon: ((ie = e.icons) == null ? void 0 : ie.zoomIn) || u(at, null, null),
|
|
1204
1069
|
onClick: (s) => {
|
|
1205
|
-
s.stopPropagation(),
|
|
1070
|
+
s.stopPropagation(), A("zoomIn");
|
|
1206
1071
|
},
|
|
1207
1072
|
type: "zoomIn"
|
|
1208
1073
|
}, {
|
|
1209
|
-
icon: ((
|
|
1074
|
+
icon: ((D = e.icons) == null ? void 0 : D.zoomOut) || u(it, null, null),
|
|
1210
1075
|
onClick: (s) => {
|
|
1211
|
-
s.stopPropagation(),
|
|
1076
|
+
s.stopPropagation(), A("zoomOut");
|
|
1212
1077
|
},
|
|
1213
1078
|
type: "zoomOut"
|
|
1214
1079
|
}, {
|
|
1215
|
-
icon: ((
|
|
1080
|
+
icon: ((X = e.icons) == null ? void 0 : X.rotateRight) || u(rt, null, null),
|
|
1216
1081
|
onClick: (s) => {
|
|
1217
|
-
s.stopPropagation(),
|
|
1082
|
+
s.stopPropagation(), A("anticlocelise");
|
|
1218
1083
|
},
|
|
1219
1084
|
type: "rotateRight"
|
|
1220
1085
|
}, {
|
|
1221
|
-
icon: ((
|
|
1086
|
+
icon: ((Ce = e.icons) == null ? void 0 : Ce.rotateLeft) || u(ot, null, null),
|
|
1222
1087
|
onClick: (s) => {
|
|
1223
|
-
s.stopPropagation(),
|
|
1088
|
+
s.stopPropagation(), A("clocelise");
|
|
1224
1089
|
},
|
|
1225
1090
|
type: "rotateLeft"
|
|
1226
1091
|
}];
|
|
1227
|
-
return
|
|
1228
|
-
|
|
1229
|
-
|
|
1092
|
+
return le(ee, () => {
|
|
1093
|
+
Ye(() => {
|
|
1094
|
+
F.value.complete || (k.value = !0);
|
|
1230
1095
|
});
|
|
1231
|
-
}),
|
|
1232
|
-
|
|
1233
|
-
}),
|
|
1234
|
-
s && (
|
|
1235
|
-
}),
|
|
1236
|
-
var s,
|
|
1237
|
-
|
|
1096
|
+
}), le(h, (s) => {
|
|
1097
|
+
R(), t("switch", s);
|
|
1098
|
+
}), le(p, (s) => {
|
|
1099
|
+
s && (T.value = s);
|
|
1100
|
+
}), Ue(() => {
|
|
1101
|
+
var s, m;
|
|
1102
|
+
ge(), (m = (s = Y.value) == null ? void 0 : s.focus) == null || m.call(s);
|
|
1238
1103
|
}), n({
|
|
1239
|
-
setOpen:
|
|
1104
|
+
setOpen: $
|
|
1240
1105
|
}), () => {
|
|
1241
|
-
const s =
|
|
1242
|
-
return l(
|
|
1106
|
+
const s = $e(`${o}-fade`), m = $e(`${o}-zoom`);
|
|
1107
|
+
return l(u(_e, {
|
|
1243
1108
|
to: e.getContainer || "body",
|
|
1244
1109
|
disabled: !e.teleported
|
|
1245
1110
|
}, {
|
|
1246
|
-
default: () => [
|
|
1247
|
-
class: `${o}-root ${
|
|
1248
|
-
}, [
|
|
1249
|
-
default: () => [
|
|
1250
|
-
class: `${o}-mask ${
|
|
1251
|
-
}, null), [[
|
|
1252
|
-
}),
|
|
1111
|
+
default: () => [p.value && u("div", {
|
|
1112
|
+
class: `${o}-root ${c.value}`
|
|
1113
|
+
}, [u(ke, s, {
|
|
1114
|
+
default: () => [ze(u("div", {
|
|
1115
|
+
class: `${o}-mask ${c.value}`
|
|
1116
|
+
}, null), [[Oe, p.value && T.value]])]
|
|
1117
|
+
}), u("div", {
|
|
1253
1118
|
ref: Y,
|
|
1254
1119
|
tabindex: -1,
|
|
1255
|
-
class: [`${o}-wrapper`, `${
|
|
1256
|
-
onClick: (
|
|
1257
|
-
}, [
|
|
1258
|
-
onAfterLeave: () =>
|
|
1120
|
+
class: [`${o}-wrapper`, `${c.value}`],
|
|
1121
|
+
onClick: (b) => e.onHideOnClickModal && he(b)
|
|
1122
|
+
}, [u(ke, We(m, {
|
|
1123
|
+
onAfterLeave: () => te()
|
|
1259
1124
|
}), {
|
|
1260
1125
|
default: () => {
|
|
1261
|
-
var
|
|
1262
|
-
return [
|
|
1263
|
-
class: `${o}-block ${
|
|
1264
|
-
}, [
|
|
1265
|
-
class: `${o}-content ${
|
|
1266
|
-
}, [
|
|
1267
|
-
class: `${o}-body ${
|
|
1268
|
-
}, [
|
|
1269
|
-
class: `${o}-operations-wrapper ${
|
|
1270
|
-
onClick: (
|
|
1271
|
-
}, [
|
|
1272
|
-
class: `${o}-operations ${
|
|
1273
|
-
}, [
|
|
1274
|
-
icon:
|
|
1275
|
-
onClick:
|
|
1276
|
-
type:
|
|
1277
|
-
}) =>
|
|
1278
|
-
class: `${o}-operations-operation ${
|
|
1279
|
-
onClick:
|
|
1280
|
-
key:
|
|
1281
|
-
}, [
|
|
1282
|
-
class: `${o}-operations-icon ${
|
|
1283
|
-
})]))])]),
|
|
1284
|
-
class: `${o}-canvas ${
|
|
1285
|
-
}, [e.urlList.map((
|
|
1286
|
-
ref:
|
|
1287
|
-
class: `${o}-img ${
|
|
1126
|
+
var b, C;
|
|
1127
|
+
return [ze(u("div", {
|
|
1128
|
+
class: `${o}-block ${c.value}`
|
|
1129
|
+
}, [u("div", {
|
|
1130
|
+
class: `${o}-content ${c.value}`
|
|
1131
|
+
}, [u("div", {
|
|
1132
|
+
class: `${o}-body ${c.value}`
|
|
1133
|
+
}, [u("div", {
|
|
1134
|
+
class: `${o}-operations-wrapper ${c.value}`,
|
|
1135
|
+
onClick: (v) => v.stopPropagation()
|
|
1136
|
+
}, [u("ul", {
|
|
1137
|
+
class: `${o}-operations ${c.value}`
|
|
1138
|
+
}, [pe.map(({
|
|
1139
|
+
icon: v,
|
|
1140
|
+
onClick: M,
|
|
1141
|
+
type: me
|
|
1142
|
+
}) => u("li", {
|
|
1143
|
+
class: `${o}-operations-operation ${c.value}`,
|
|
1144
|
+
onClick: M,
|
|
1145
|
+
key: me
|
|
1146
|
+
}, [qe(v, {
|
|
1147
|
+
class: `${o}-operations-icon ${c.value}`
|
|
1148
|
+
})]))])]), u("div", {
|
|
1149
|
+
class: `${o}-canvas ${c.value}`
|
|
1150
|
+
}, [e.urlList.map((v, M) => u("img", {
|
|
1151
|
+
ref: F,
|
|
1152
|
+
class: `${o}-img ${c.value}`,
|
|
1288
1153
|
style: {
|
|
1289
|
-
...
|
|
1290
|
-
display:
|
|
1154
|
+
...de.value,
|
|
1155
|
+
display: M === h.value ? "block" : "none"
|
|
1291
1156
|
},
|
|
1292
|
-
key:
|
|
1293
|
-
src:
|
|
1294
|
-
onLoad: () =>
|
|
1295
|
-
onError: (
|
|
1296
|
-
onMousedown:
|
|
1297
|
-
}, null))]), G.value &&
|
|
1298
|
-
class: [`${o}-switch-left`,
|
|
1299
|
-
onClick:
|
|
1300
|
-
}, [((
|
|
1301
|
-
class: [`${o}-switch-right`,
|
|
1302
|
-
onClick:
|
|
1303
|
-
}, [((
|
|
1157
|
+
key: v,
|
|
1158
|
+
src: v,
|
|
1159
|
+
onLoad: () => U(),
|
|
1160
|
+
onError: (me) => f(me),
|
|
1161
|
+
onMousedown: O
|
|
1162
|
+
}, null))]), G.value && u("div", {
|
|
1163
|
+
class: [`${o}-switch-left`, h.value === 0 && !e.infinite ? `${o}-switch-left-disabled` : "", `${c.value}`],
|
|
1164
|
+
onClick: ne
|
|
1165
|
+
}, [((b = e.icons) == null ? void 0 : b.left) || u(st, null, null)]), G.value && u("div", {
|
|
1166
|
+
class: [`${o}-switch-right`, h.value === e.urlList.length - 1 && !e.infinite ? `${o}-switch-right-disabled` : "", `${c.value}`],
|
|
1167
|
+
onClick: Z
|
|
1168
|
+
}, [((C = e.icons) == null ? void 0 : C.right) || u(lt, null, null)])])])]), [[Oe, p.value && T.value]])];
|
|
1304
1169
|
}
|
|
1305
1170
|
})])])]
|
|
1306
1171
|
}));
|
|
1307
1172
|
};
|
|
1308
1173
|
}
|
|
1309
|
-
}),
|
|
1174
|
+
}), Ie = {
|
|
1310
1175
|
width: "100%",
|
|
1311
1176
|
height: "100%"
|
|
1312
|
-
},
|
|
1177
|
+
}, Vt = (e) => ({
|
|
1313
1178
|
[e.componentCls]: {
|
|
1314
1179
|
display: "inline-block",
|
|
1315
1180
|
position: "relative",
|
|
1316
1181
|
overflow: "hidden",
|
|
1317
1182
|
["&-inner"]: {
|
|
1318
|
-
...
|
|
1183
|
+
...Ie,
|
|
1319
1184
|
verticalAlign: "top",
|
|
1320
1185
|
opacity: 1
|
|
1321
1186
|
},
|
|
1322
1187
|
["&-placeholder"]: {
|
|
1323
|
-
...
|
|
1188
|
+
...Ie,
|
|
1324
1189
|
backgroundColor: e.colorBgContainerDisabled,
|
|
1325
1190
|
backgroundImage: "url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",
|
|
1326
1191
|
backgroundRepeat: "no-repeat",
|
|
@@ -1328,7 +1193,7 @@ const qt = /* @__PURE__ */ _e({
|
|
|
1328
1193
|
backgroundSize: "30%"
|
|
1329
1194
|
},
|
|
1330
1195
|
["&-error"]: {
|
|
1331
|
-
...
|
|
1196
|
+
...Ie,
|
|
1332
1197
|
display: "flex",
|
|
1333
1198
|
alignItems: "center",
|
|
1334
1199
|
justifyContent: "center",
|
|
@@ -1339,13 +1204,10 @@ const qt = /* @__PURE__ */ _e({
|
|
|
1339
1204
|
cursor: "pointer"
|
|
1340
1205
|
}
|
|
1341
1206
|
}
|
|
1342
|
-
}),
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
let Ge = "";
|
|
1347
|
-
const fe = /* @__PURE__ */ _e({
|
|
1348
|
-
props: ce,
|
|
1207
|
+
}), Yt = (e) => e && e.nodeType === Node.ELEMENT_NODE;
|
|
1208
|
+
let Be = "";
|
|
1209
|
+
const ce = /* @__PURE__ */ Ve({
|
|
1210
|
+
props: ue,
|
|
1349
1211
|
name: "GImage",
|
|
1350
1212
|
emits: ["error", "click", "load"],
|
|
1351
1213
|
setup(e, {
|
|
@@ -1353,127 +1215,129 @@ const fe = /* @__PURE__ */ _e({
|
|
|
1353
1215
|
emit: n,
|
|
1354
1216
|
attrs: a
|
|
1355
1217
|
}) {
|
|
1356
|
-
const
|
|
1218
|
+
const i = Ge({
|
|
1357
1219
|
suffixCls: "image"
|
|
1358
|
-
}),
|
|
1359
|
-
|
|
1360
|
-
|
|
1220
|
+
}), {
|
|
1221
|
+
wrapSSR: r,
|
|
1222
|
+
hashId: o
|
|
1223
|
+
} = vt("Image", [Vt], i), l = w(), c = w(""), S = w(!1), p = w(!0), $ = w(!1), T = w(null), x = w();
|
|
1224
|
+
let k, h;
|
|
1225
|
+
const Y = L(() => !q && e.fit ? {
|
|
1361
1226
|
"object-fit": e.fit
|
|
1362
|
-
} : {}),
|
|
1227
|
+
} : {}), F = L(() => {
|
|
1363
1228
|
const {
|
|
1364
1229
|
previewSrcList: f
|
|
1365
1230
|
} = e;
|
|
1366
1231
|
return Array.isArray(f) && f.length > 0;
|
|
1367
|
-
}), W =
|
|
1232
|
+
}), W = L(() => {
|
|
1368
1233
|
const {
|
|
1369
1234
|
src: f,
|
|
1370
|
-
previewSrcList:
|
|
1371
|
-
initialIndex:
|
|
1235
|
+
previewSrcList: E,
|
|
1236
|
+
initialIndex: O
|
|
1372
1237
|
} = e;
|
|
1373
|
-
if (
|
|
1374
|
-
return
|
|
1375
|
-
let
|
|
1376
|
-
const j =
|
|
1377
|
-
return j >= 0 && (
|
|
1378
|
-
}),
|
|
1379
|
-
q || (
|
|
1238
|
+
if (O || O === 0)
|
|
1239
|
+
return E.length >= O ? O : 0;
|
|
1240
|
+
let R = 0;
|
|
1241
|
+
const j = E.indexOf(f);
|
|
1242
|
+
return j >= 0 && (R = j), R;
|
|
1243
|
+
}), d = () => {
|
|
1244
|
+
q || (p.value = !0, S.value = !1, e.src ? c.value = e.src : te());
|
|
1380
1245
|
};
|
|
1381
1246
|
function G() {
|
|
1382
|
-
|
|
1247
|
+
ut(T.value, x.value) && (d(), ee());
|
|
1383
1248
|
}
|
|
1384
|
-
const
|
|
1249
|
+
const J = mt(G, 200), K = async () => {
|
|
1385
1250
|
if (q)
|
|
1386
1251
|
return;
|
|
1387
|
-
await
|
|
1252
|
+
await Ye();
|
|
1388
1253
|
const {
|
|
1389
1254
|
scrollContainer: f
|
|
1390
1255
|
} = e;
|
|
1391
|
-
|
|
1392
|
-
},
|
|
1393
|
-
q || !
|
|
1256
|
+
Yt(f) ? x.value = f : ct(f) && f !== "" ? x.value = document.querySelector(f) ?? void 0 : T.value && (x.value = ft(T.value)), x.value && (k = Ee(x, "scroll", J), setTimeout(() => G(), 200));
|
|
1257
|
+
}, ee = () => {
|
|
1258
|
+
q || !x.value || !J || (k(), x.value = void 0);
|
|
1259
|
+
}, de = (f) => {
|
|
1260
|
+
p.value = !1, S.value = !1, n("load", f);
|
|
1261
|
+
}, te = (f) => {
|
|
1262
|
+
p.value = !1, S.value = !0, n("error", f);
|
|
1394
1263
|
}, 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
1264
|
if (f.ctrlKey) {
|
|
1400
1265
|
if (f.deltaY < 0)
|
|
1401
1266
|
return f.preventDefault(), !1;
|
|
1402
1267
|
if (f.deltaY > 0)
|
|
1403
1268
|
return f.preventDefault(), !1;
|
|
1404
1269
|
}
|
|
1405
|
-
},
|
|
1406
|
-
!
|
|
1270
|
+
}, ge = () => {
|
|
1271
|
+
!F.value || e.disablePreview || (h = Ee("wheel", he, {
|
|
1407
1272
|
passive: !1
|
|
1408
|
-
}),
|
|
1409
|
-
},
|
|
1410
|
-
|
|
1273
|
+
}), Be = document.body.style.overflow, document.body.style.overflow = "hidden", $.value = !0);
|
|
1274
|
+
}, ve = () => {
|
|
1275
|
+
h == null || h(), document.body.style.overflow = Be, $.value = !1;
|
|
1411
1276
|
};
|
|
1412
|
-
|
|
1413
|
-
e.lazy ? (
|
|
1277
|
+
le(() => e.src, () => {
|
|
1278
|
+
e.lazy ? (p.value = !0, S.value = !1, ee(), K()) : d();
|
|
1414
1279
|
});
|
|
1415
|
-
const
|
|
1416
|
-
return
|
|
1417
|
-
e.lazy ?
|
|
1280
|
+
const U = (f) => dt(f) ? f + "px" : f;
|
|
1281
|
+
return Ue(() => {
|
|
1282
|
+
e.lazy ? K() : d();
|
|
1418
1283
|
}), () => {
|
|
1419
1284
|
const {
|
|
1420
1285
|
crossorigin: f,
|
|
1421
|
-
decoding:
|
|
1422
|
-
alt:
|
|
1423
|
-
sizes:
|
|
1286
|
+
decoding: E,
|
|
1287
|
+
alt: O,
|
|
1288
|
+
sizes: R,
|
|
1424
1289
|
srcset: j,
|
|
1425
|
-
usemap:
|
|
1426
|
-
class:
|
|
1427
|
-
style:
|
|
1428
|
-
} = a,
|
|
1290
|
+
usemap: ne,
|
|
1291
|
+
class: Z,
|
|
1292
|
+
style: A = {}
|
|
1293
|
+
} = a, pe = {
|
|
1429
1294
|
crossorigin: f,
|
|
1430
|
-
decoding:
|
|
1431
|
-
alt:
|
|
1432
|
-
sizes:
|
|
1295
|
+
decoding: E,
|
|
1296
|
+
alt: O,
|
|
1297
|
+
sizes: R,
|
|
1433
1298
|
srcset: j,
|
|
1434
|
-
usemap:
|
|
1299
|
+
usemap: ne,
|
|
1435
1300
|
style: {
|
|
1436
1301
|
...Y.value,
|
|
1437
|
-
height: e.height ?
|
|
1438
|
-
...T
|
|
1302
|
+
height: e.height ? U(e.height) : void 0
|
|
1439
1303
|
}
|
|
1440
|
-
},
|
|
1441
|
-
return
|
|
1442
|
-
var
|
|
1443
|
-
|
|
1444
|
-
}),
|
|
1304
|
+
}, ae = Le(t, e, "fallback"), ie = Le(t, e, "placeholder");
|
|
1305
|
+
return Qe(() => {
|
|
1306
|
+
var D, X;
|
|
1307
|
+
F.value && $.value ? (D = l.value) == null || D.setOpen(!0) : (X = l.value) == null || X.setOpen(!1);
|
|
1308
|
+
}), r(u(Je, null, [u("div", {
|
|
1445
1309
|
class: {
|
|
1446
1310
|
[`${o.value}`]: !0,
|
|
1447
|
-
[`${
|
|
1448
|
-
[`${
|
|
1311
|
+
[`${i}`]: !0,
|
|
1312
|
+
[`${Z}`]: !!Z
|
|
1449
1313
|
},
|
|
1450
|
-
ref: (
|
|
1314
|
+
ref: (D) => T.value = D,
|
|
1451
1315
|
style: {
|
|
1452
|
-
...
|
|
1453
|
-
width: e.width ?
|
|
1454
|
-
height: e.height ?
|
|
1316
|
+
...A,
|
|
1317
|
+
width: e.width ? U(e.width) : void 0,
|
|
1318
|
+
height: e.height ? U(e.height) : void 0,
|
|
1455
1319
|
display: e.lazy ? "block" : void 0
|
|
1456
1320
|
},
|
|
1457
1321
|
onClick: () => {
|
|
1458
1322
|
n("click");
|
|
1459
1323
|
}
|
|
1460
|
-
}, [
|
|
1461
|
-
class: `${
|
|
1462
|
-
}, null)),
|
|
1463
|
-
class: `${
|
|
1464
|
-
}, [
|
|
1324
|
+
}, [p.value && (ie || u("div", {
|
|
1325
|
+
class: `${i}-placeholder ${o.value}`
|
|
1326
|
+
}, null)), S.value ? ae || u("div", {
|
|
1327
|
+
class: `${i}-error ${o.value}`
|
|
1328
|
+
}, [Ke("加载失败")]) : c.value && u("img", We(pe, {
|
|
1465
1329
|
class: {
|
|
1466
1330
|
[`${o.value}`]: !0,
|
|
1467
|
-
[`${
|
|
1468
|
-
[`${
|
|
1469
|
-
[`${
|
|
1331
|
+
[`${e.imageClassName}`]: !!e.imageClassName,
|
|
1332
|
+
[`${i}-inner`]: !0,
|
|
1333
|
+
[`${i}-preview`]: F.value
|
|
1470
1334
|
},
|
|
1471
1335
|
alt: e.alt,
|
|
1472
|
-
src:
|
|
1473
|
-
onLoad:
|
|
1474
|
-
onError:
|
|
1475
|
-
onClick: () =>
|
|
1476
|
-
}), null),
|
|
1336
|
+
src: c.value,
|
|
1337
|
+
onLoad: de,
|
|
1338
|
+
onError: te,
|
|
1339
|
+
onClick: () => ge()
|
|
1340
|
+
}), null), u(Bt, {
|
|
1477
1341
|
ref: l,
|
|
1478
1342
|
zIndex: e.zIndex,
|
|
1479
1343
|
infinite: e.infinite,
|
|
@@ -1481,15 +1345,15 @@ const fe = /* @__PURE__ */ _e({
|
|
|
1481
1345
|
urlList: e.previewSrcList,
|
|
1482
1346
|
getContainer: e.getContainer,
|
|
1483
1347
|
onHideOnClickModal: e.hideOnClickModal,
|
|
1484
|
-
onClose: () =>
|
|
1348
|
+
onClose: () => ve()
|
|
1485
1349
|
}, null)])]));
|
|
1486
1350
|
};
|
|
1487
1351
|
}
|
|
1488
1352
|
});
|
|
1489
|
-
|
|
1490
|
-
|
|
1353
|
+
ce.isWImage = !0;
|
|
1354
|
+
ce.install = (e) => (e.component(ce.name, ce), e);
|
|
1491
1355
|
export {
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1356
|
+
ce as GImage,
|
|
1357
|
+
Bt as ImageViewer,
|
|
1358
|
+
ce as default
|
|
1495
1359
|
};
|