@gx-design-vue/image 0.2.0-beta.10 → 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 -2
- package/dist/image.mjs +337 -324
- package/dist/image.umd.js +1 -1
- package/dist/props.d.ts +1 -1
- package/package.json +3 -3
package/dist/image.mjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { createVNode as
|
|
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
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
|
|
4
|
-
import { useState as Ne, onMountedOrActivated as
|
|
5
|
-
import { Keyframe as
|
|
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
6
|
import { createTypes as pt } from "vue-types";
|
|
7
|
-
import { useThrottleFn as
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
var n =
|
|
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);
|
|
11
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);
|
|
12
12
|
}
|
|
13
13
|
function re(e) {
|
|
14
14
|
return Math.min(1, Math.max(0, e));
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function yt(e) {
|
|
17
17
|
return typeof e == "string" && e.indexOf(".") !== -1 && parseFloat(e) === 1;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function wt(e) {
|
|
20
20
|
return typeof e == "string" && e.indexOf("%") !== -1;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function Ue(e) {
|
|
23
23
|
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
|
|
24
24
|
}
|
|
25
25
|
function oe(e) {
|
|
@@ -28,29 +28,29 @@ function oe(e) {
|
|
|
28
28
|
function H(e) {
|
|
29
29
|
return e.length === 1 ? "0" + e : String(e);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function St(e, t, n) {
|
|
32
32
|
return {
|
|
33
|
-
r:
|
|
34
|
-
g:
|
|
35
|
-
b:
|
|
33
|
+
r: v(e, 255) * 255,
|
|
34
|
+
g: v(t, 255) * 255,
|
|
35
|
+
b: v(n, 255) * 255
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
function Re(e, t, n) {
|
|
39
|
-
e =
|
|
39
|
+
e = v(e, 255), t = v(t, 255), n = v(n, 255);
|
|
40
40
|
var a = Math.max(e, t, n), i = Math.min(e, t, n), r = 0, o = 0, l = (a + i) / 2;
|
|
41
41
|
if (a === i)
|
|
42
42
|
o = 0, r = 0;
|
|
43
43
|
else {
|
|
44
|
-
var
|
|
45
|
-
switch (o = l > 0.5 ?
|
|
44
|
+
var f = a - i;
|
|
45
|
+
switch (o = l > 0.5 ? f / (2 - a - i) : f / (a + i), a) {
|
|
46
46
|
case e:
|
|
47
|
-
r = (t - n) /
|
|
47
|
+
r = (t - n) / f + (t < n ? 6 : 0);
|
|
48
48
|
break;
|
|
49
49
|
case t:
|
|
50
|
-
r = (n - e) /
|
|
50
|
+
r = (n - e) / f + 2;
|
|
51
51
|
break;
|
|
52
52
|
case n:
|
|
53
|
-
r = (e - t) /
|
|
53
|
+
r = (e - t) / f + 4;
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
56
56
|
r /= 6;
|
|
@@ -60,9 +60,9 @@ function Re(e, t, n) {
|
|
|
60
60
|
function be(e, t, n) {
|
|
61
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;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function xt(e, t, n) {
|
|
64
64
|
var a, i, r;
|
|
65
|
-
if (e =
|
|
65
|
+
if (e = v(e, 360), t = v(t, 100), n = v(n, 100), t === 0)
|
|
66
66
|
i = n, r = n, a = n;
|
|
67
67
|
else {
|
|
68
68
|
var o = n < 0.5 ? n * (1 + t) : n + t - n * t, l = 2 * n - o;
|
|
@@ -71,8 +71,8 @@ function St(e, t, n) {
|
|
|
71
71
|
return { r: a * 255, g: i * 255, b: r * 255 };
|
|
72
72
|
}
|
|
73
73
|
function De(e, t, n) {
|
|
74
|
-
e =
|
|
75
|
-
var a = Math.max(e, t, n), i = Math.min(e, t, n), r = 0, o = a, l = a - i,
|
|
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
76
|
if (a === i)
|
|
77
77
|
r = 0;
|
|
78
78
|
else {
|
|
@@ -89,12 +89,12 @@ function De(e, t, n) {
|
|
|
89
89
|
}
|
|
90
90
|
r /= 6;
|
|
91
91
|
}
|
|
92
|
-
return { h: r, s:
|
|
92
|
+
return { h: r, s: f, v: o };
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
e =
|
|
96
|
-
var a = Math.floor(e), i = e - a, r = n * (1 - t), o = n * (1 - i * t), l = n * (1 - (1 - i) * t),
|
|
97
|
-
return { r: S * 255, g:
|
|
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 };
|
|
98
98
|
}
|
|
99
99
|
function He(e, t, n, a) {
|
|
100
100
|
var i = [
|
|
@@ -104,25 +104,25 @@ function He(e, t, n, a) {
|
|
|
104
104
|
];
|
|
105
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("");
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function It(e, t, n, a, i) {
|
|
108
108
|
var r = [
|
|
109
109
|
H(Math.round(e).toString(16)),
|
|
110
110
|
H(Math.round(t).toString(16)),
|
|
111
111
|
H(Math.round(n).toString(16)),
|
|
112
|
-
H(
|
|
112
|
+
H(At(a))
|
|
113
113
|
];
|
|
114
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("");
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function At(e) {
|
|
117
117
|
return Math.round(parseFloat(e) * 255).toString(16);
|
|
118
118
|
}
|
|
119
119
|
function Pe(e) {
|
|
120
|
-
return
|
|
120
|
+
return w(e) / 255;
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function w(e) {
|
|
123
123
|
return parseInt(e, 16);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function Ct(e) {
|
|
126
126
|
return {
|
|
127
127
|
r: e >> 16,
|
|
128
128
|
g: (e & 65280) >> 8,
|
|
@@ -279,9 +279,9 @@ var Ae = {
|
|
|
279
279
|
yellow: "#ffff00",
|
|
280
280
|
yellowgreen: "#9acd32"
|
|
281
281
|
};
|
|
282
|
-
function
|
|
282
|
+
function Tt(e) {
|
|
283
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 =
|
|
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), {
|
|
285
285
|
ok: o,
|
|
286
286
|
format: e.format || l,
|
|
287
287
|
r: Math.min(255, Math.max(t.r, 0)),
|
|
@@ -290,8 +290,8 @@ function Ct(e) {
|
|
|
290
290
|
a: n
|
|
291
291
|
};
|
|
292
292
|
}
|
|
293
|
-
var
|
|
294
|
-
CSS_UNIT: new RegExp(
|
|
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
295
|
rgb: new RegExp("rgb" + ye),
|
|
296
296
|
rgba: new RegExp("rgba" + we),
|
|
297
297
|
hsl: new RegExp("hsl" + ye),
|
|
@@ -303,7 +303,7 @@ var Tt = "[-\\+]?\\d+%?", kt = "[-\\+]?\\d*\\.\\d+%?", N = "(?:".concat(kt, ")|(
|
|
|
303
303
|
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
304
304
|
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
305
305
|
};
|
|
306
|
-
function
|
|
306
|
+
function Ot(e) {
|
|
307
307
|
if (e = e.trim().toLowerCase(), e.length === 0)
|
|
308
308
|
return !1;
|
|
309
309
|
var t = !1;
|
|
@@ -311,35 +311,35 @@ function zt(e) {
|
|
|
311
311
|
e = Ae[e], t = !0;
|
|
312
312
|
else if (e === "transparent")
|
|
313
313
|
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
|
|
314
|
-
var n =
|
|
315
|
-
return n ? { r: n[1], g: n[2], b: n[3] } : (n =
|
|
316
|
-
r:
|
|
317
|
-
g:
|
|
318
|
-
b:
|
|
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
319
|
a: Pe(n[4]),
|
|
320
320
|
format: t ? "name" : "hex8"
|
|
321
|
-
} : (n =
|
|
322
|
-
r:
|
|
323
|
-
g:
|
|
324
|
-
b:
|
|
321
|
+
} : (n = C.hex6.exec(e), n ? {
|
|
322
|
+
r: w(n[1]),
|
|
323
|
+
g: w(n[2]),
|
|
324
|
+
b: w(n[3]),
|
|
325
325
|
format: t ? "name" : "hex"
|
|
326
|
-
} : (n =
|
|
327
|
-
r:
|
|
328
|
-
g:
|
|
329
|
-
b:
|
|
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
330
|
a: Pe(n[4] + n[4]),
|
|
331
331
|
format: t ? "name" : "hex8"
|
|
332
|
-
} : (n =
|
|
333
|
-
r:
|
|
334
|
-
g:
|
|
335
|
-
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]),
|
|
336
336
|
format: t ? "name" : "hex"
|
|
337
337
|
} : !1)))))))));
|
|
338
338
|
}
|
|
339
|
-
function
|
|
340
|
-
return !!
|
|
339
|
+
function L(e) {
|
|
340
|
+
return !!C.CSS_UNIT.exec(String(e));
|
|
341
341
|
}
|
|
342
|
-
var
|
|
342
|
+
var J = (
|
|
343
343
|
/** @class */
|
|
344
344
|
function() {
|
|
345
345
|
function e(t, n) {
|
|
@@ -347,8 +347,8 @@ var Q = (
|
|
|
347
347
|
var a;
|
|
348
348
|
if (t instanceof e)
|
|
349
349
|
return t;
|
|
350
|
-
typeof t == "number" && (t =
|
|
351
|
-
var i =
|
|
350
|
+
typeof t == "number" && (t = Ct(t)), this.originalInput = t;
|
|
351
|
+
var i = Tt(t);
|
|
352
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;
|
|
353
353
|
}
|
|
354
354
|
return e.prototype.isDark = function() {
|
|
@@ -364,7 +364,7 @@ var Q = (
|
|
|
364
364
|
}, e.prototype.getAlpha = function() {
|
|
365
365
|
return this.a;
|
|
366
366
|
}, e.prototype.setAlpha = function(t) {
|
|
367
|
-
return this.a =
|
|
367
|
+
return this.a = Ue(t), this.roundA = Math.round(100 * this.a) / 100, this;
|
|
368
368
|
}, e.prototype.isMonochrome = function() {
|
|
369
369
|
var t = this.toHsl().s;
|
|
370
370
|
return t === 0;
|
|
@@ -385,7 +385,7 @@ var Q = (
|
|
|
385
385
|
}, e.prototype.toHexString = function(t) {
|
|
386
386
|
return t === void 0 && (t = !1), "#" + this.toHex(t);
|
|
387
387
|
}, e.prototype.toHex8 = function(t) {
|
|
388
|
-
return t === void 0 && (t = !1),
|
|
388
|
+
return t === void 0 && (t = !1), It(this.r, this.g, this.b, this.a, t);
|
|
389
389
|
}, e.prototype.toHex8String = function(t) {
|
|
390
390
|
return t === void 0 && (t = !1), "#" + this.toHex8(t);
|
|
391
391
|
}, e.prototype.toRgb = function() {
|
|
@@ -400,7 +400,7 @@ var Q = (
|
|
|
400
400
|
return this.a === 1 ? "rgb(".concat(t, ", ").concat(n, ", ").concat(a, ")") : "rgba(".concat(t, ", ").concat(n, ", ").concat(a, ", ").concat(this.roundA, ")");
|
|
401
401
|
}, e.prototype.toPercentageRgb = function() {
|
|
402
402
|
var t = function(n) {
|
|
403
|
-
return "".concat(Math.round(
|
|
403
|
+
return "".concat(Math.round(v(n, 255) * 100), "%");
|
|
404
404
|
};
|
|
405
405
|
return {
|
|
406
406
|
r: t(this.r),
|
|
@@ -410,7 +410,7 @@ var Q = (
|
|
|
410
410
|
};
|
|
411
411
|
}, e.prototype.toPercentageRgbString = function() {
|
|
412
412
|
var t = function(n) {
|
|
413
|
-
return Math.round(
|
|
413
|
+
return Math.round(v(n, 255) * 100);
|
|
414
414
|
};
|
|
415
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, ")");
|
|
416
416
|
}, e.prototype.toName = function() {
|
|
@@ -512,21 +512,21 @@ var Q = (
|
|
|
512
512
|
}, e;
|
|
513
513
|
}()
|
|
514
514
|
);
|
|
515
|
-
const
|
|
515
|
+
const Lt = new ce("viewFadeIn", {
|
|
516
516
|
"0%": {
|
|
517
517
|
opacity: 0
|
|
518
518
|
},
|
|
519
519
|
"100%": {
|
|
520
520
|
opacity: 1
|
|
521
521
|
}
|
|
522
|
-
}),
|
|
522
|
+
}), Nt = new ce("viewFadeOut", {
|
|
523
523
|
"0%": {
|
|
524
524
|
opacity: 1
|
|
525
525
|
},
|
|
526
526
|
"100%": {
|
|
527
527
|
opacity: 0
|
|
528
528
|
}
|
|
529
|
-
}),
|
|
529
|
+
}), $t = new ce("viewZoomBadgeIn", {
|
|
530
530
|
"0%": {
|
|
531
531
|
transform: "scale(0.2)",
|
|
532
532
|
opacity: 0
|
|
@@ -535,7 +535,7 @@ const Ot = new fe("viewFadeIn", {
|
|
|
535
535
|
transform: "scale(1)",
|
|
536
536
|
opacity: 1
|
|
537
537
|
}
|
|
538
|
-
}),
|
|
538
|
+
}), Et = new ce("viewZoomBadgeOut", {
|
|
539
539
|
"0%": {
|
|
540
540
|
transform: "scale(1)"
|
|
541
541
|
},
|
|
@@ -556,7 +556,7 @@ function Se(e) {
|
|
|
556
556
|
insetInlineStart: 0
|
|
557
557
|
};
|
|
558
558
|
}
|
|
559
|
-
const
|
|
559
|
+
const Rt = (e) => ({
|
|
560
560
|
boxSizing: "border-box",
|
|
561
561
|
margin: 0,
|
|
562
562
|
padding: 0,
|
|
@@ -565,11 +565,11 @@ const Et = (e) => ({
|
|
|
565
565
|
lineHeight: e.lineHeight,
|
|
566
566
|
listStyle: "none",
|
|
567
567
|
fontFamily: e.fontFamily
|
|
568
|
-
}),
|
|
569
|
-
const { componentCls: t, modalMaskBg: n, paddingSM: a, previewOperationColorDisabled: i, motionDurationSlow: r } = e, o = new
|
|
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);
|
|
570
570
|
return {
|
|
571
571
|
[`${t}-operations`]: {
|
|
572
|
-
...
|
|
572
|
+
...Rt(e),
|
|
573
573
|
display: "flex",
|
|
574
574
|
flexDirection: "row-reverse",
|
|
575
575
|
alignItems: "center",
|
|
@@ -604,8 +604,8 @@ const Et = (e) => ({
|
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
606
|
};
|
|
607
|
-
},
|
|
608
|
-
const { modalMaskBg: t, previewOperationColorDisabled: n, zIndexPopup: a, motionDurationSlow: i } = e, r = new
|
|
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);
|
|
609
609
|
return {
|
|
610
610
|
[`${e.componentCls}-switch-left, ${e.componentCls}-switch-right`]: {
|
|
611
611
|
position: "fixed",
|
|
@@ -649,7 +649,7 @@ const Et = (e) => ({
|
|
|
649
649
|
insetInlineEnd: e.marginSM
|
|
650
650
|
}
|
|
651
651
|
};
|
|
652
|
-
},
|
|
652
|
+
}, Pt = (e) => ({
|
|
653
653
|
[e.componentCls]: {
|
|
654
654
|
["&-root"]: {
|
|
655
655
|
...Se("fixed"),
|
|
@@ -704,17 +704,17 @@ const Et = (e) => ({
|
|
|
704
704
|
pointerEvents: "auto"
|
|
705
705
|
},
|
|
706
706
|
["&-fade-appear, &-fade-enter"]: {
|
|
707
|
-
animationName:
|
|
707
|
+
animationName: Lt,
|
|
708
708
|
animationDuration: e.motionDurationSlow,
|
|
709
709
|
animationTimingFunction: "linear"
|
|
710
710
|
},
|
|
711
711
|
["&-fade-leave"]: {
|
|
712
|
-
animationName:
|
|
712
|
+
animationName: Nt,
|
|
713
713
|
animationDuration: e.motionDurationSlow,
|
|
714
714
|
animationTimingFunction: "linear"
|
|
715
715
|
},
|
|
716
716
|
["&-zoom-appear, &-zoom-enter"]: {
|
|
717
|
-
animationName:
|
|
717
|
+
animationName: $t,
|
|
718
718
|
opacity: 0,
|
|
719
719
|
animationTimingFunction: e.motionEaseOutCirc,
|
|
720
720
|
animationFillMode: "both",
|
|
@@ -726,7 +726,7 @@ const Et = (e) => ({
|
|
|
726
726
|
animationPlayState: "running"
|
|
727
727
|
},
|
|
728
728
|
["&-zoom-leave"]: {
|
|
729
|
-
animationName:
|
|
729
|
+
animationName: Et,
|
|
730
730
|
animationDuration: e.motionDurationSlow,
|
|
731
731
|
animationTimingFunction: e.motionEaseOutBack,
|
|
732
732
|
animationFillMode: "both"
|
|
@@ -744,23 +744,23 @@ const Et = (e) => ({
|
|
|
744
744
|
zIndex: e.zIndexPopup + 1,
|
|
745
745
|
width: "100%"
|
|
746
746
|
},
|
|
747
|
-
"&": [
|
|
747
|
+
"&": [Dt(e), Ht(e)]
|
|
748
748
|
});
|
|
749
|
-
function
|
|
750
|
-
return
|
|
751
|
-
const n =
|
|
749
|
+
function Ft(e) {
|
|
750
|
+
return gt("ImageView", (t) => {
|
|
751
|
+
const n = vt(t, {
|
|
752
752
|
zIndexPopup: t.zIndexPopupBase + 80,
|
|
753
|
-
previewOperationColorDisabled: new
|
|
754
|
-
modalMaskBg: new
|
|
755
|
-
previewOperationColor: new
|
|
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
756
|
previewOperationSize: t.fontSizeIcon * 1.5,
|
|
757
757
|
imagePreviewSwitchSize: t.controlHeightLG,
|
|
758
758
|
iconCls: "anticon"
|
|
759
759
|
});
|
|
760
|
-
return [
|
|
760
|
+
return [Pt(n)];
|
|
761
761
|
}, e);
|
|
762
762
|
}
|
|
763
|
-
const
|
|
763
|
+
const Ze = pt({
|
|
764
764
|
func: void 0,
|
|
765
765
|
bool: void 0,
|
|
766
766
|
string: void 0,
|
|
@@ -769,7 +769,7 @@ const Xe = pt({
|
|
|
769
769
|
object: void 0,
|
|
770
770
|
integer: void 0
|
|
771
771
|
});
|
|
772
|
-
|
|
772
|
+
Ze.extend([{
|
|
773
773
|
name: "looseBool",
|
|
774
774
|
getter: !0,
|
|
775
775
|
type: Boolean,
|
|
@@ -784,7 +784,7 @@ Xe.extend([{
|
|
|
784
784
|
getter: !0,
|
|
785
785
|
type: null
|
|
786
786
|
}]);
|
|
787
|
-
const
|
|
787
|
+
const V = Ze, P = {
|
|
788
788
|
infinite: {
|
|
789
789
|
type: Boolean,
|
|
790
790
|
default: !0
|
|
@@ -800,7 +800,7 @@ const B = Xe, P = {
|
|
|
800
800
|
getContainer: {
|
|
801
801
|
type: String
|
|
802
802
|
}
|
|
803
|
-
},
|
|
803
|
+
}, le = {
|
|
804
804
|
previewTeleported: {
|
|
805
805
|
type: Boolean,
|
|
806
806
|
default: !0
|
|
@@ -821,7 +821,7 @@ const B = Xe, P = {
|
|
|
821
821
|
type: String,
|
|
822
822
|
default: "contain"
|
|
823
823
|
},
|
|
824
|
-
lazy:
|
|
824
|
+
lazy: V.bool,
|
|
825
825
|
scrollContainer: {
|
|
826
826
|
type: [String, Object]
|
|
827
827
|
},
|
|
@@ -844,35 +844,39 @@ const B = Xe, P = {
|
|
|
844
844
|
onClick: {
|
|
845
845
|
type: Function
|
|
846
846
|
},
|
|
847
|
-
disablePreview:
|
|
847
|
+
disablePreview: V.bool,
|
|
848
848
|
previewSrcList: {
|
|
849
849
|
type: Array,
|
|
850
850
|
default: () => []
|
|
851
851
|
},
|
|
852
|
-
imageClassName:
|
|
853
|
-
imageStyle:
|
|
854
|
-
width:
|
|
855
|
-
height:
|
|
852
|
+
imageClassName: V.string,
|
|
853
|
+
imageStyle: V.style,
|
|
854
|
+
width: V.number,
|
|
855
|
+
height: V.number,
|
|
856
856
|
zIndex: P.zIndex,
|
|
857
857
|
infinite: P.infinite,
|
|
858
858
|
getContainer: P.getContainer,
|
|
859
|
-
initialIndex:
|
|
860
|
-
|
|
859
|
+
initialIndex: {
|
|
860
|
+
...P.initialIndex,
|
|
861
|
+
default: () => {
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
}, jt = {
|
|
861
865
|
urlList: {
|
|
862
866
|
type: Array,
|
|
863
867
|
default: () => []
|
|
864
868
|
},
|
|
865
|
-
teleported:
|
|
869
|
+
teleported: le.previewTeleported,
|
|
866
870
|
zIndex: P.zIndex,
|
|
867
871
|
initialIndex: P.initialIndex,
|
|
868
872
|
infinite: P.infinite,
|
|
869
|
-
getContainer:
|
|
870
|
-
onHideOnClickModal:
|
|
873
|
+
getContainer: le.getContainer,
|
|
874
|
+
onHideOnClickModal: le.hideOnClickModal,
|
|
871
875
|
icons: {
|
|
872
876
|
type: Object,
|
|
873
877
|
default: () => ({})
|
|
874
878
|
}
|
|
875
|
-
},
|
|
879
|
+
}, Y = {
|
|
876
880
|
tab: "Tab",
|
|
877
881
|
enter: "Enter",
|
|
878
882
|
space: "Space",
|
|
@@ -890,15 +894,15 @@ const B = Xe, P = {
|
|
|
890
894
|
}, _ = {
|
|
891
895
|
CONTAIN: {
|
|
892
896
|
name: "contain",
|
|
893
|
-
icon:
|
|
897
|
+
icon: c(et, null, null)
|
|
894
898
|
},
|
|
895
899
|
ORIGINAL: {
|
|
896
900
|
name: "original",
|
|
897
|
-
icon:
|
|
901
|
+
icon: c(tt, null, null)
|
|
898
902
|
}
|
|
899
|
-
},
|
|
900
|
-
return !
|
|
901
|
-
}, je =
|
|
903
|
+
}, Bt = function() {
|
|
904
|
+
return !Q && !!window.navigator.userAgent.match(/firefox/i);
|
|
905
|
+
}, je = Bt() ? "DOMMouseScroll" : "mousewheel";
|
|
902
906
|
function Me(e) {
|
|
903
907
|
let t = !1;
|
|
904
908
|
return function(...n) {
|
|
@@ -907,8 +911,8 @@ function Me(e) {
|
|
|
907
911
|
}));
|
|
908
912
|
};
|
|
909
913
|
}
|
|
910
|
-
const
|
|
911
|
-
props:
|
|
914
|
+
const Vt = /* @__PURE__ */ Ve({
|
|
915
|
+
props: jt,
|
|
912
916
|
emits: ["close", "switch"],
|
|
913
917
|
setup: function(e, {
|
|
914
918
|
emit: t,
|
|
@@ -920,29 +924,31 @@ const Bt = /* @__PURE__ */ Ve({
|
|
|
920
924
|
suffixCls: "image-viewer"
|
|
921
925
|
}), {
|
|
922
926
|
wrapSSR: l,
|
|
923
|
-
hashId:
|
|
924
|
-
} =
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
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(() => {
|
|
931
937
|
const {
|
|
932
938
|
scale: s,
|
|
933
|
-
deg:
|
|
934
|
-
offsetX:
|
|
935
|
-
offsetY:
|
|
936
|
-
enableTransition:
|
|
937
|
-
} = d.
|
|
938
|
-
transform: `scale(${s}) rotate(${
|
|
939
|
-
transition:
|
|
940
|
-
marginLeft: `${
|
|
941
|
-
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`
|
|
942
948
|
};
|
|
943
|
-
return W.value.name === _.CONTAIN.name && (
|
|
944
|
-
}),
|
|
945
|
-
ve(), t("close"), d.
|
|
949
|
+
return W.value.name === _.CONTAIN.name && (I.maxWidth = I.maxHeight = "100%"), I;
|
|
950
|
+
}), de = () => {
|
|
951
|
+
ve(), t("close"), d.transform = {
|
|
946
952
|
scale: 1,
|
|
947
953
|
deg: 0,
|
|
948
954
|
offsetX: 0,
|
|
@@ -950,34 +956,34 @@ const Bt = /* @__PURE__ */ Ve({
|
|
|
950
956
|
enableTransition: !1
|
|
951
957
|
};
|
|
952
958
|
}, he = (s) => {
|
|
953
|
-
S.value ? S.value = !1 :
|
|
959
|
+
S.value ? S.value = !1 : F.value === (s == null ? void 0 : s.target) && (x(!1), g.value = e.initialIndex);
|
|
954
960
|
}, ge = () => {
|
|
955
961
|
a = Me((s) => {
|
|
956
962
|
switch (s.code) {
|
|
957
|
-
case
|
|
963
|
+
case Y.esc:
|
|
958
964
|
x(!1);
|
|
959
965
|
break;
|
|
960
|
-
case
|
|
961
|
-
|
|
966
|
+
case Y.space:
|
|
967
|
+
B();
|
|
962
968
|
break;
|
|
963
|
-
case
|
|
969
|
+
case Y.left:
|
|
964
970
|
ne();
|
|
965
971
|
break;
|
|
966
|
-
case
|
|
967
|
-
|
|
972
|
+
case Y.up:
|
|
973
|
+
k("zoomIn");
|
|
968
974
|
break;
|
|
969
|
-
case
|
|
975
|
+
case Y.right:
|
|
970
976
|
Z();
|
|
971
977
|
break;
|
|
972
|
-
case
|
|
973
|
-
|
|
978
|
+
case Y.down:
|
|
979
|
+
k("zoomOut");
|
|
974
980
|
break;
|
|
975
981
|
}
|
|
976
982
|
}), i = Me((s) => {
|
|
977
|
-
(s.wheelDelta ? s.wheelDelta : -s.detail) > 0 ?
|
|
983
|
+
(s.wheelDelta ? s.wheelDelta : -s.detail) > 0 ? k("zoomIn", {
|
|
978
984
|
zoomRate: 0.015,
|
|
979
985
|
enableTransition: !1
|
|
980
|
-
}) :
|
|
986
|
+
}) : k("zoomOut", {
|
|
981
987
|
zoomRate: 0.015,
|
|
982
988
|
enableTransition: !1
|
|
983
989
|
});
|
|
@@ -985,187 +991,187 @@ const Bt = /* @__PURE__ */ Ve({
|
|
|
985
991
|
}, ve = () => {
|
|
986
992
|
xe(document, "keydown", a), xe(document, je, i), a = null, i = null;
|
|
987
993
|
}, U = () => {
|
|
988
|
-
|
|
989
|
-
},
|
|
990
|
-
|
|
991
|
-
},
|
|
992
|
-
if (
|
|
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)
|
|
993
999
|
return;
|
|
994
|
-
s.preventDefault(), s.stopPropagation(), clearTimeout(
|
|
1000
|
+
s.preventDefault(), s.stopPropagation(), clearTimeout(b.value), S.value = !0;
|
|
995
1001
|
const {
|
|
996
|
-
offsetX:
|
|
997
|
-
offsetY:
|
|
998
|
-
} = d.
|
|
999
|
-
r = Me((
|
|
1000
|
-
d.
|
|
1001
|
-
...d.
|
|
1002
|
-
offsetX:
|
|
1003
|
-
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
|
|
1004
1010
|
};
|
|
1005
1011
|
}), se(document, "mousemove", r), se(document, "mouseup", () => {
|
|
1006
|
-
xe(document, "mousemove", r),
|
|
1012
|
+
xe(document, "mousemove", r), m.value && z.value && (b.value = setTimeout(() => {
|
|
1007
1013
|
S.value = !1;
|
|
1008
1014
|
}));
|
|
1009
1015
|
});
|
|
1010
1016
|
}, R = () => {
|
|
1011
|
-
d.
|
|
1017
|
+
d.transform = {
|
|
1012
1018
|
scale: 1,
|
|
1013
1019
|
deg: 0,
|
|
1014
1020
|
offsetX: 0,
|
|
1015
1021
|
offsetY: 0,
|
|
1016
1022
|
enableTransition: !1
|
|
1017
1023
|
};
|
|
1018
|
-
},
|
|
1019
|
-
if (
|
|
1024
|
+
}, B = () => {
|
|
1025
|
+
if (O.value)
|
|
1020
1026
|
return;
|
|
1021
|
-
const s = Object.keys(_),
|
|
1022
|
-
W.value = _[s[
|
|
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();
|
|
1023
1029
|
}, ne = () => {
|
|
1024
|
-
if (
|
|
1030
|
+
if (K.value && !e.infinite)
|
|
1025
1031
|
return;
|
|
1026
1032
|
const s = e.urlList.length;
|
|
1027
|
-
|
|
1033
|
+
g.value = (g.value - 1 + s) % s;
|
|
1028
1034
|
}, Z = () => {
|
|
1029
|
-
if (
|
|
1035
|
+
if (ee.value && !e.infinite)
|
|
1030
1036
|
return;
|
|
1031
1037
|
const s = e.urlList.length;
|
|
1032
|
-
|
|
1033
|
-
},
|
|
1034
|
-
if (
|
|
1038
|
+
g.value = (g.value + 1) % s;
|
|
1039
|
+
}, k = (s, M = {}) => {
|
|
1040
|
+
if (O.value)
|
|
1035
1041
|
return;
|
|
1036
1042
|
const {
|
|
1037
|
-
zoomRate:
|
|
1038
|
-
rotateDeg:
|
|
1039
|
-
enableTransition:
|
|
1043
|
+
zoomRate: h,
|
|
1044
|
+
rotateDeg: y,
|
|
1045
|
+
enableTransition: p
|
|
1040
1046
|
} = {
|
|
1041
1047
|
zoomRate: 0.2,
|
|
1042
1048
|
rotateDeg: 90,
|
|
1043
1049
|
enableTransition: !0,
|
|
1044
|
-
...
|
|
1050
|
+
...M
|
|
1045
1051
|
};
|
|
1046
1052
|
switch (s) {
|
|
1047
1053
|
case "zoomOut":
|
|
1048
|
-
d.
|
|
1054
|
+
d.transform.scale > 0.2 && (d.transform.scale = parseFloat((d.transform.scale - h).toFixed(3)));
|
|
1049
1055
|
break;
|
|
1050
1056
|
case "zoomIn":
|
|
1051
|
-
d.
|
|
1057
|
+
d.transform.scale = parseFloat((d.transform.scale + h).toFixed(3));
|
|
1052
1058
|
break;
|
|
1053
1059
|
case "clocelise":
|
|
1054
|
-
d.
|
|
1060
|
+
d.transform.deg += y;
|
|
1055
1061
|
break;
|
|
1056
1062
|
case "anticlocelise":
|
|
1057
|
-
d.
|
|
1063
|
+
d.transform.deg -= y;
|
|
1058
1064
|
break;
|
|
1059
1065
|
}
|
|
1060
|
-
d.
|
|
1061
|
-
},
|
|
1062
|
-
icon: ((ae = e.icons) == null ? void 0 : ae.close) ||
|
|
1066
|
+
d.transform.enableTransition = p;
|
|
1067
|
+
}, me = [{
|
|
1068
|
+
icon: ((ae = e.icons) == null ? void 0 : ae.close) || c(nt, null, null),
|
|
1063
1069
|
onClick: (s) => {
|
|
1064
1070
|
s.stopPropagation(), x(!1);
|
|
1065
1071
|
},
|
|
1066
1072
|
type: "close"
|
|
1067
1073
|
}, {
|
|
1068
|
-
icon: ((ie = e.icons) == null ? void 0 : ie.zoomIn) ||
|
|
1074
|
+
icon: ((ie = e.icons) == null ? void 0 : ie.zoomIn) || c(at, null, null),
|
|
1069
1075
|
onClick: (s) => {
|
|
1070
|
-
s.stopPropagation(),
|
|
1076
|
+
s.stopPropagation(), k("zoomIn");
|
|
1071
1077
|
},
|
|
1072
1078
|
type: "zoomIn"
|
|
1073
1079
|
}, {
|
|
1074
|
-
icon: ((D = e.icons) == null ? void 0 : D.zoomOut) ||
|
|
1080
|
+
icon: ((D = e.icons) == null ? void 0 : D.zoomOut) || c(it, null, null),
|
|
1075
1081
|
onClick: (s) => {
|
|
1076
|
-
s.stopPropagation(),
|
|
1082
|
+
s.stopPropagation(), k("zoomOut");
|
|
1077
1083
|
},
|
|
1078
1084
|
type: "zoomOut"
|
|
1079
1085
|
}, {
|
|
1080
|
-
icon: ((X = e.icons) == null ? void 0 : X.rotateRight) ||
|
|
1086
|
+
icon: ((X = e.icons) == null ? void 0 : X.rotateRight) || c(rt, null, null),
|
|
1081
1087
|
onClick: (s) => {
|
|
1082
|
-
s.stopPropagation(),
|
|
1088
|
+
s.stopPropagation(), k("anticlocelise");
|
|
1083
1089
|
},
|
|
1084
1090
|
type: "rotateRight"
|
|
1085
1091
|
}, {
|
|
1086
|
-
icon: ((Ce = e.icons) == null ? void 0 : Ce.rotateLeft) ||
|
|
1092
|
+
icon: ((Ce = e.icons) == null ? void 0 : Ce.rotateLeft) || c(ot, null, null),
|
|
1087
1093
|
onClick: (s) => {
|
|
1088
|
-
s.stopPropagation(),
|
|
1094
|
+
s.stopPropagation(), k("clocelise");
|
|
1089
1095
|
},
|
|
1090
1096
|
type: "rotateLeft"
|
|
1091
1097
|
}];
|
|
1092
|
-
return
|
|
1098
|
+
return q(te, () => {
|
|
1093
1099
|
Ye(() => {
|
|
1094
|
-
|
|
1100
|
+
j.value.complete || (O.value = !0);
|
|
1095
1101
|
});
|
|
1096
|
-
}),
|
|
1102
|
+
}), q(g, (s) => {
|
|
1097
1103
|
R(), t("switch", s);
|
|
1098
|
-
}),
|
|
1099
|
-
s && (
|
|
1100
|
-
}),
|
|
1101
|
-
var
|
|
1102
|
-
ge(), (
|
|
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));
|
|
1103
1109
|
}), n({
|
|
1104
|
-
setOpen:
|
|
1110
|
+
setOpen: E
|
|
1105
1111
|
}), () => {
|
|
1106
|
-
const s = $e(`${o}-fade`),
|
|
1107
|
-
return l(
|
|
1112
|
+
const s = $e(`${o}-fade`), M = $e(`${o}-zoom`);
|
|
1113
|
+
return l(c(_e, {
|
|
1108
1114
|
to: e.getContainer || "body",
|
|
1109
1115
|
disabled: !e.teleported
|
|
1110
1116
|
}, {
|
|
1111
|
-
default: () => [
|
|
1112
|
-
class: `${o}-root ${
|
|
1113
|
-
}, [
|
|
1114
|
-
default: () => [ze(
|
|
1115
|
-
class: `${o}-mask ${
|
|
1116
|
-
}, null), [[Oe,
|
|
1117
|
-
}),
|
|
1118
|
-
ref:
|
|
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]])]
|
|
1123
|
+
}), c("div", {
|
|
1124
|
+
ref: F,
|
|
1119
1125
|
tabindex: -1,
|
|
1120
|
-
class: [`${o}-wrapper`, `${
|
|
1121
|
-
onClick: (
|
|
1122
|
-
}, [
|
|
1123
|
-
onAfterLeave: () =>
|
|
1126
|
+
class: [`${o}-wrapper`, `${f.value}`],
|
|
1127
|
+
onClick: (h) => e.onHideOnClickModal && he(h)
|
|
1128
|
+
}, [c(ke, We(M, {
|
|
1129
|
+
onAfterLeave: () => de()
|
|
1124
1130
|
}), {
|
|
1125
1131
|
default: () => {
|
|
1126
|
-
var
|
|
1127
|
-
return [ze(
|
|
1128
|
-
class: `${o}-block ${
|
|
1129
|
-
}, [
|
|
1130
|
-
class: `${o}-content ${
|
|
1131
|
-
}, [
|
|
1132
|
-
class: `${o}-body ${
|
|
1133
|
-
}, [
|
|
1134
|
-
class: `${o}-operations-wrapper ${
|
|
1135
|
-
onClick: (
|
|
1136
|
-
}, [
|
|
1137
|
-
class: `${o}-operations ${
|
|
1138
|
-
}, [
|
|
1139
|
-
icon:
|
|
1140
|
-
onClick:
|
|
1141
|
-
type:
|
|
1142
|
-
}) =>
|
|
1143
|
-
class: `${o}-operations-operation ${
|
|
1144
|
-
onClick:
|
|
1145
|
-
key:
|
|
1146
|
-
}, [qe(
|
|
1147
|
-
class: `${o}-operations-icon ${
|
|
1148
|
-
})]))])]),
|
|
1149
|
-
class: `${o}-canvas ${
|
|
1150
|
-
}, [e.urlList.map((
|
|
1151
|
-
ref:
|
|
1152
|
-
class: `${o}-img ${
|
|
1132
|
+
var h, y;
|
|
1133
|
+
return [ze(c("div", {
|
|
1134
|
+
class: `${o}-block ${f.value}`
|
|
1135
|
+
}, [c("div", {
|
|
1136
|
+
class: `${o}-content ${f.value}`
|
|
1137
|
+
}, [c("div", {
|
|
1138
|
+
class: `${o}-body ${f.value}`
|
|
1139
|
+
}, [c("div", {
|
|
1140
|
+
class: `${o}-operations-wrapper ${f.value}`,
|
|
1141
|
+
onClick: (p) => p.stopPropagation()
|
|
1142
|
+
}, [c("ul", {
|
|
1143
|
+
class: `${o}-operations ${f.value}`
|
|
1144
|
+
}, [me.map(({
|
|
1145
|
+
icon: p,
|
|
1146
|
+
onClick: I,
|
|
1147
|
+
type: pe
|
|
1148
|
+
}) => c("li", {
|
|
1149
|
+
class: `${o}-operations-operation ${f.value}`,
|
|
1150
|
+
onClick: I,
|
|
1151
|
+
key: pe
|
|
1152
|
+
}, [qe(p, {
|
|
1153
|
+
class: `${o}-operations-icon ${f.value}`
|
|
1154
|
+
})]))])]), c("div", {
|
|
1155
|
+
class: `${o}-canvas ${f.value}`
|
|
1156
|
+
}, [e.urlList.map((p, I) => c("img", {
|
|
1157
|
+
ref: j,
|
|
1158
|
+
class: `${o}-img ${f.value}`,
|
|
1153
1159
|
style: {
|
|
1154
|
-
...
|
|
1155
|
-
display:
|
|
1160
|
+
...fe.value,
|
|
1161
|
+
display: I === g.value ? "block" : "none"
|
|
1156
1162
|
},
|
|
1157
|
-
key:
|
|
1158
|
-
src:
|
|
1163
|
+
key: p,
|
|
1164
|
+
src: p,
|
|
1159
1165
|
onLoad: () => U(),
|
|
1160
|
-
onError: (
|
|
1161
|
-
onMousedown:
|
|
1162
|
-
}, null))]), G.value &&
|
|
1163
|
-
class: [`${o}-switch-left`,
|
|
1166
|
+
onError: (pe) => u(pe),
|
|
1167
|
+
onMousedown: T
|
|
1168
|
+
}, null))]), G.value && c("div", {
|
|
1169
|
+
class: [`${o}-switch-left`, g.value === 0 && !e.infinite ? `${o}-switch-left-disabled` : "", `${f.value}`],
|
|
1164
1170
|
onClick: ne
|
|
1165
|
-
}, [((
|
|
1166
|
-
class: [`${o}-switch-right`,
|
|
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}`],
|
|
1167
1173
|
onClick: Z
|
|
1168
|
-
}, [((
|
|
1174
|
+
}, [((y = e.icons) == null ? void 0 : y.right) || c(lt, null, null)])])])]), [[Oe, m.value && z.value]])];
|
|
1169
1175
|
}
|
|
1170
1176
|
})])])]
|
|
1171
1177
|
}));
|
|
@@ -1174,7 +1180,7 @@ const Bt = /* @__PURE__ */ Ve({
|
|
|
1174
1180
|
}), Ie = {
|
|
1175
1181
|
width: "100%",
|
|
1176
1182
|
height: "100%"
|
|
1177
|
-
},
|
|
1183
|
+
}, Yt = (e) => ({
|
|
1178
1184
|
[e.componentCls]: {
|
|
1179
1185
|
display: "inline-block",
|
|
1180
1186
|
position: "relative",
|
|
@@ -1204,10 +1210,10 @@ const Bt = /* @__PURE__ */ Ve({
|
|
|
1204
1210
|
cursor: "pointer"
|
|
1205
1211
|
}
|
|
1206
1212
|
}
|
|
1207
|
-
}),
|
|
1213
|
+
}), Wt = (e) => e && e.nodeType === Node.ELEMENT_NODE;
|
|
1208
1214
|
let Be = "";
|
|
1209
|
-
const
|
|
1210
|
-
props:
|
|
1215
|
+
const ue = /* @__PURE__ */ Ve({
|
|
1216
|
+
props: le,
|
|
1211
1217
|
name: "GImage",
|
|
1212
1218
|
emits: ["error", "click", "load"],
|
|
1213
1219
|
setup(e, {
|
|
@@ -1220,124 +1226,131 @@ const ce = /* @__PURE__ */ Ve({
|
|
|
1220
1226
|
}), {
|
|
1221
1227
|
wrapSSR: r,
|
|
1222
1228
|
hashId: o
|
|
1223
|
-
} =
|
|
1224
|
-
let
|
|
1225
|
-
const
|
|
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 ? {
|
|
1226
1232
|
"object-fit": e.fit
|
|
1227
|
-
} : {}),
|
|
1233
|
+
} : {}), j = N(() => {
|
|
1228
1234
|
const {
|
|
1229
|
-
previewSrcList:
|
|
1235
|
+
previewSrcList: u
|
|
1230
1236
|
} = e;
|
|
1231
|
-
return Array.isArray(
|
|
1232
|
-
}), W =
|
|
1237
|
+
return Array.isArray(u) && u.length > 0;
|
|
1238
|
+
}), W = N(() => {
|
|
1233
1239
|
const {
|
|
1234
|
-
src:
|
|
1235
|
-
previewSrcList:
|
|
1236
|
-
initialIndex:
|
|
1240
|
+
src: u,
|
|
1241
|
+
previewSrcList: b,
|
|
1242
|
+
initialIndex: T
|
|
1237
1243
|
} = e;
|
|
1238
|
-
if (
|
|
1239
|
-
return
|
|
1244
|
+
if (T || T === 0)
|
|
1245
|
+
return b.length >= T ? T : 0;
|
|
1240
1246
|
let R = 0;
|
|
1241
|
-
const
|
|
1242
|
-
return
|
|
1247
|
+
const B = b.indexOf(u);
|
|
1248
|
+
return B >= 0 && (R = B), R;
|
|
1243
1249
|
}), d = () => {
|
|
1244
|
-
|
|
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;
|
|
1245
1260
|
};
|
|
1246
1261
|
function G() {
|
|
1247
|
-
ut(
|
|
1262
|
+
ut(z.value, x.value) && (d(), te());
|
|
1248
1263
|
}
|
|
1249
|
-
const
|
|
1250
|
-
if (
|
|
1264
|
+
const K = bt(G, 200), ee = async () => {
|
|
1265
|
+
if (Q)
|
|
1251
1266
|
return;
|
|
1252
1267
|
await Ye();
|
|
1253
1268
|
const {
|
|
1254
|
-
scrollContainer:
|
|
1269
|
+
scrollContainer: u
|
|
1255
1270
|
} = e;
|
|
1256
|
-
|
|
1257
|
-
},
|
|
1258
|
-
|
|
1259
|
-
},
|
|
1260
|
-
|
|
1261
|
-
},
|
|
1262
|
-
|
|
1263
|
-
}, he = (
|
|
1264
|
-
if (
|
|
1265
|
-
if (
|
|
1266
|
-
return
|
|
1267
|
-
if (
|
|
1268
|
-
return
|
|
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));
|
|
1272
|
+
}, te = () => {
|
|
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;
|
|
1269
1284
|
}
|
|
1270
1285
|
}, ge = () => {
|
|
1271
|
-
!
|
|
1286
|
+
!j.value || e.disablePreview || (g = Ee("wheel", he, {
|
|
1272
1287
|
passive: !1
|
|
1273
|
-
}), Be = document.body.style.overflow, document.body.style.overflow = "hidden",
|
|
1288
|
+
}), Be = document.body.style.overflow, document.body.style.overflow = "hidden", E.value = !0);
|
|
1274
1289
|
}, ve = () => {
|
|
1275
|
-
|
|
1290
|
+
g == null || g(), document.body.style.overflow = Be, E.value = !1;
|
|
1276
1291
|
};
|
|
1277
|
-
|
|
1278
|
-
e.lazy ? (
|
|
1292
|
+
q(() => e.src, () => {
|
|
1293
|
+
e.lazy ? (m.value = !0, S.value = !1, te(), ee()) : d();
|
|
1279
1294
|
});
|
|
1280
|
-
const U = (
|
|
1281
|
-
return
|
|
1282
|
-
e.lazy ?
|
|
1295
|
+
const U = (u) => dt(u) ? u + "px" : u;
|
|
1296
|
+
return ht(() => {
|
|
1297
|
+
e.lazy ? ee() : d();
|
|
1283
1298
|
}), () => {
|
|
1284
1299
|
const {
|
|
1285
|
-
crossorigin:
|
|
1286
|
-
decoding:
|
|
1287
|
-
alt:
|
|
1300
|
+
crossorigin: u,
|
|
1301
|
+
decoding: b,
|
|
1302
|
+
alt: T,
|
|
1288
1303
|
sizes: R,
|
|
1289
|
-
srcset:
|
|
1304
|
+
srcset: B,
|
|
1290
1305
|
usemap: ne,
|
|
1291
1306
|
class: Z,
|
|
1292
|
-
style:
|
|
1293
|
-
} = a,
|
|
1294
|
-
crossorigin:
|
|
1295
|
-
decoding:
|
|
1296
|
-
alt:
|
|
1307
|
+
style: k = {}
|
|
1308
|
+
} = a, me = {
|
|
1309
|
+
crossorigin: u,
|
|
1310
|
+
decoding: b,
|
|
1311
|
+
alt: T,
|
|
1297
1312
|
sizes: R,
|
|
1298
|
-
srcset:
|
|
1313
|
+
srcset: B,
|
|
1299
1314
|
usemap: ne,
|
|
1300
1315
|
style: {
|
|
1301
|
-
...
|
|
1316
|
+
...F.value,
|
|
1302
1317
|
height: e.height ? U(e.height) : void 0
|
|
1303
1318
|
}
|
|
1304
1319
|
}, ae = Le(t, e, "fallback"), ie = Le(t, e, "placeholder");
|
|
1305
1320
|
return Qe(() => {
|
|
1306
1321
|
var D, X;
|
|
1307
|
-
|
|
1308
|
-
}), r(
|
|
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", {
|
|
1309
1324
|
class: {
|
|
1310
1325
|
[`${o.value}`]: !0,
|
|
1311
1326
|
[`${i}`]: !0,
|
|
1312
1327
|
[`${Z}`]: !!Z
|
|
1313
1328
|
},
|
|
1314
|
-
ref: (D) =>
|
|
1329
|
+
ref: (D) => z.value = D,
|
|
1315
1330
|
style: {
|
|
1316
|
-
...A,
|
|
1317
1331
|
width: e.width ? U(e.width) : void 0,
|
|
1318
1332
|
height: e.height ? U(e.height) : void 0,
|
|
1319
|
-
display: e.lazy ? "block" : void 0
|
|
1333
|
+
display: e.lazy ? "block" : void 0,
|
|
1334
|
+
...k
|
|
1320
1335
|
},
|
|
1321
1336
|
onClick: () => {
|
|
1322
1337
|
n("click");
|
|
1323
1338
|
}
|
|
1324
|
-
}, [
|
|
1339
|
+
}, [m.value ? ie || c("div", {
|
|
1325
1340
|
class: `${i}-placeholder ${o.value}`
|
|
1326
|
-
}, null)
|
|
1341
|
+
}, null) : S.value ? ae || c("div", {
|
|
1327
1342
|
class: `${i}-error ${o.value}`
|
|
1328
|
-
}, [Ke("加载失败")]) :
|
|
1343
|
+
}, [Ke("加载失败")]) : f.value && c("img", We(me, {
|
|
1329
1344
|
class: {
|
|
1330
1345
|
[`${o.value}`]: !0,
|
|
1331
1346
|
[`${e.imageClassName}`]: !!e.imageClassName,
|
|
1332
1347
|
[`${i}-inner`]: !0,
|
|
1333
|
-
[`${i}-preview`]:
|
|
1348
|
+
[`${i}-preview`]: j.value
|
|
1334
1349
|
},
|
|
1335
1350
|
alt: e.alt,
|
|
1336
|
-
src:
|
|
1337
|
-
onLoad: de,
|
|
1338
|
-
onError: te,
|
|
1351
|
+
src: f.value,
|
|
1339
1352
|
onClick: () => ge()
|
|
1340
|
-
}), null),
|
|
1353
|
+
}), null), c(Vt, {
|
|
1341
1354
|
ref: l,
|
|
1342
1355
|
zIndex: e.zIndex,
|
|
1343
1356
|
infinite: e.infinite,
|
|
@@ -1350,10 +1363,10 @@ const ce = /* @__PURE__ */ Ve({
|
|
|
1350
1363
|
};
|
|
1351
1364
|
}
|
|
1352
1365
|
});
|
|
1353
|
-
|
|
1354
|
-
|
|
1366
|
+
ue.isWImage = !0;
|
|
1367
|
+
ue.install = (e) => (e.component(ue.name, ue), e);
|
|
1355
1368
|
export {
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1369
|
+
ue as GImage,
|
|
1370
|
+
Vt as ImageViewer,
|
|
1371
|
+
ue as default
|
|
1359
1372
|
};
|