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