@gx-design-vue/image 0.2.0-beta.14 → 0.2.0-beta.16
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 +8 -8
- package/dist/components/ImageViewer.d.ts +35 -105
- package/dist/image.js +377 -383
- package/dist/image.umd.cjs +1 -1
- package/dist/props.d.ts +4 -4
- package/package.json +13 -40
package/dist/image.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createTypes as Ze } from "vue-types";
|
|
2
|
-
import { createVNode as
|
|
3
|
-
import { ExpandOutlined as
|
|
4
|
-
import { isServer as
|
|
5
|
-
import { useState as Ne, onMountedOrActivated as
|
|
6
|
-
import { Keyframe as
|
|
7
|
-
import { useThrottleFn as
|
|
8
|
-
const
|
|
2
|
+
import { createVNode as f, defineComponent as Ve, shallowRef as Te, ref as C, reactive as Xe, computed as L, watch as _, nextTick as Ye, Teleport as _e, Transition as ke, withDirectives as ze, vShow as Oe, mergeProps as We, cloneVNode as qe, watchEffect as Qe, createTextVNode as Je } from "vue";
|
|
3
|
+
import { ExpandOutlined as Ke, OneToOneOutlined as et, CloseOutlined as tt, ZoomInOutlined as nt, ZoomOutOutlined as at, RotateRightOutlined as it, RotateLeftOutlined as rt, LeftOutlined as ot, RightOutlined as st } from "@ant-design/icons-vue";
|
|
4
|
+
import { isServer as q, getPrefixCls as Ge, isInContainer as lt, getSlotVNode as Le, isString as ut, getScrollContainer as ct, isNumber as ft } from "@gx-design-vue/pro-utils";
|
|
5
|
+
import { useState as Ne, onMountedOrActivated as dt } from "@gx-design-vue/pro-hooks";
|
|
6
|
+
import { Keyframe as fe, useStyle as ht, mergeToken as gt, getTransitionProps as $e, useProStyle as vt } from "@gx-design-vue/pro-provider";
|
|
7
|
+
import { useThrottleFn as mt, useEventListener as Ee } from "@vueuse/core";
|
|
8
|
+
const R = Ze({
|
|
9
9
|
func: void 0,
|
|
10
10
|
bool: void 0,
|
|
11
11
|
string: void 0,
|
|
@@ -14,7 +14,7 @@ const H = Ze({
|
|
|
14
14
|
object: void 0,
|
|
15
15
|
integer: void 0
|
|
16
16
|
});
|
|
17
|
-
|
|
17
|
+
R.extend([{
|
|
18
18
|
name: "looseBool",
|
|
19
19
|
getter: !0,
|
|
20
20
|
type: Boolean,
|
|
@@ -29,7 +29,7 @@ H.extend([{
|
|
|
29
29
|
getter: !0,
|
|
30
30
|
type: null
|
|
31
31
|
}]);
|
|
32
|
-
const
|
|
32
|
+
const D = {
|
|
33
33
|
infinite: {
|
|
34
34
|
type: Boolean,
|
|
35
35
|
default: !0
|
|
@@ -45,7 +45,7 @@ const P = {
|
|
|
45
45
|
getContainer: {
|
|
46
46
|
type: String
|
|
47
47
|
}
|
|
48
|
-
},
|
|
48
|
+
}, ue = {
|
|
49
49
|
previewTeleported: {
|
|
50
50
|
type: Boolean,
|
|
51
51
|
default: !0
|
|
@@ -66,7 +66,7 @@ const P = {
|
|
|
66
66
|
type: String,
|
|
67
67
|
default: "contain"
|
|
68
68
|
},
|
|
69
|
-
lazy:
|
|
69
|
+
lazy: R.bool,
|
|
70
70
|
scrollContainer: {
|
|
71
71
|
type: [String, Object]
|
|
72
72
|
},
|
|
@@ -89,48 +89,48 @@ const P = {
|
|
|
89
89
|
onClick: {
|
|
90
90
|
type: Function
|
|
91
91
|
},
|
|
92
|
-
disablePreview:
|
|
92
|
+
disablePreview: R.bool,
|
|
93
93
|
previewSrcList: {
|
|
94
94
|
type: Array,
|
|
95
95
|
default: () => []
|
|
96
96
|
},
|
|
97
|
-
imageClassName:
|
|
98
|
-
imageStyle:
|
|
99
|
-
width:
|
|
100
|
-
height:
|
|
101
|
-
zIndex:
|
|
102
|
-
infinite:
|
|
103
|
-
getContainer:
|
|
97
|
+
imageClassName: R.string,
|
|
98
|
+
imageStyle: R.style,
|
|
99
|
+
width: R.number,
|
|
100
|
+
height: R.number,
|
|
101
|
+
zIndex: D.zIndex,
|
|
102
|
+
infinite: D.infinite,
|
|
103
|
+
getContainer: D.getContainer,
|
|
104
104
|
initialIndex: {
|
|
105
|
-
...
|
|
105
|
+
...D.initialIndex,
|
|
106
106
|
default: () => {
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
},
|
|
109
|
+
}, pt = {
|
|
110
110
|
urlList: {
|
|
111
111
|
type: Array,
|
|
112
112
|
default: () => []
|
|
113
113
|
},
|
|
114
|
-
teleported:
|
|
115
|
-
zIndex:
|
|
116
|
-
initialIndex:
|
|
117
|
-
infinite:
|
|
118
|
-
getContainer:
|
|
119
|
-
onHideOnClickModal:
|
|
114
|
+
teleported: ue.previewTeleported,
|
|
115
|
+
zIndex: D.zIndex,
|
|
116
|
+
initialIndex: D.initialIndex,
|
|
117
|
+
infinite: D.infinite,
|
|
118
|
+
getContainer: ue.getContainer,
|
|
119
|
+
onHideOnClickModal: ue.hideOnClickModal,
|
|
120
120
|
icons: {
|
|
121
121
|
type: Object,
|
|
122
122
|
default: () => ({})
|
|
123
123
|
}
|
|
124
124
|
};
|
|
125
125
|
function v(e, t) {
|
|
126
|
-
|
|
126
|
+
bt(e) && (e = "100%");
|
|
127
127
|
var n = yt(e);
|
|
128
128
|
return e = t === 360 ? e : Math.min(t, Math.max(0, parseFloat(e))), n && (e = parseInt(String(e * t), 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : (t === 360 ? e = (e < 0 ? e % t + t : e % t) / parseFloat(String(t)) : e = e % t / parseFloat(String(t)), e);
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function oe(e) {
|
|
131
131
|
return Math.min(1, Math.max(0, e));
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function bt(e) {
|
|
134
134
|
return typeof e == "string" && e.indexOf(".") !== -1 && parseFloat(e) === 1;
|
|
135
135
|
}
|
|
136
136
|
function yt(e) {
|
|
@@ -139,13 +139,13 @@ function yt(e) {
|
|
|
139
139
|
function Ue(e) {
|
|
140
140
|
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
|
|
141
141
|
}
|
|
142
|
-
function
|
|
142
|
+
function se(e) {
|
|
143
143
|
return e <= 1 ? "".concat(Number(e) * 100, "%") : e;
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function H(e) {
|
|
146
146
|
return e.length === 1 ? "0" + e : String(e);
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function wt(e, t, n) {
|
|
149
149
|
return {
|
|
150
150
|
r: v(e, 255) * 255,
|
|
151
151
|
g: v(t, 255) * 255,
|
|
@@ -158,16 +158,16 @@ function Re(e, t, n) {
|
|
|
158
158
|
if (a === i)
|
|
159
159
|
o = 0, r = 0;
|
|
160
160
|
else {
|
|
161
|
-
var
|
|
162
|
-
switch (o = l > 0.5 ?
|
|
161
|
+
var c = a - i;
|
|
162
|
+
switch (o = l > 0.5 ? c / (2 - a - i) : c / (a + i), a) {
|
|
163
163
|
case e:
|
|
164
|
-
r = (t - n) /
|
|
164
|
+
r = (t - n) / c + (t < n ? 6 : 0);
|
|
165
165
|
break;
|
|
166
166
|
case t:
|
|
167
|
-
r = (n - e) /
|
|
167
|
+
r = (n - e) / c + 2;
|
|
168
168
|
break;
|
|
169
169
|
case n:
|
|
170
|
-
r = (e - t) /
|
|
170
|
+
r = (e - t) / c + 4;
|
|
171
171
|
break;
|
|
172
172
|
}
|
|
173
173
|
r /= 6;
|
|
@@ -177,7 +177,7 @@ function Re(e, t, n) {
|
|
|
177
177
|
function be(e, t, n) {
|
|
178
178
|
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * (6 * n) : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
|
|
179
179
|
}
|
|
180
|
-
function
|
|
180
|
+
function St(e, t, n) {
|
|
181
181
|
var a, i, r;
|
|
182
182
|
if (e = v(e, 360), t = v(t, 100), n = v(n, 100), t === 0)
|
|
183
183
|
i = n, r = n, a = n;
|
|
@@ -189,7 +189,7 @@ function xt(e, t, n) {
|
|
|
189
189
|
}
|
|
190
190
|
function De(e, t, n) {
|
|
191
191
|
e = v(e, 255), t = v(t, 255), n = v(n, 255);
|
|
192
|
-
var a = Math.max(e, t, n), i = Math.min(e, t, n), r = 0, o = a, l = a - i,
|
|
192
|
+
var a = Math.max(e, t, n), i = Math.min(e, t, n), r = 0, o = a, l = a - i, c = a === 0 ? 0 : l / a;
|
|
193
193
|
if (a === i)
|
|
194
194
|
r = 0;
|
|
195
195
|
else {
|
|
@@ -206,40 +206,40 @@ function De(e, t, n) {
|
|
|
206
206
|
}
|
|
207
207
|
r /= 6;
|
|
208
208
|
}
|
|
209
|
-
return { h: r, s:
|
|
209
|
+
return { h: r, s: c, v: o };
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function xt(e, t, n) {
|
|
212
212
|
e = v(e, 360) * 6, t = v(t, 100), n = v(n, 100);
|
|
213
|
-
var a = Math.floor(e), i = e - a, r = n * (1 - t), o = n * (1 - i * t), l = n * (1 - (1 - i) * t),
|
|
214
|
-
return { r: S * 255, g:
|
|
213
|
+
var a = Math.floor(e), i = e - a, r = n * (1 - t), o = n * (1 - i * t), l = n * (1 - (1 - i) * t), c = a % 6, S = [n, o, r, r, l, n][c], p = [l, n, n, o, r, r][c], $ = [r, r, l, n, n, o][c];
|
|
214
|
+
return { r: S * 255, g: p * 255, b: $ * 255 };
|
|
215
215
|
}
|
|
216
216
|
function He(e, t, n, a) {
|
|
217
217
|
var i = [
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
218
|
+
H(Math.round(e).toString(16)),
|
|
219
|
+
H(Math.round(t).toString(16)),
|
|
220
|
+
H(Math.round(n).toString(16))
|
|
221
221
|
];
|
|
222
222
|
return a && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) : i.join("");
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function Mt(e, t, n, a, i) {
|
|
225
225
|
var r = [
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
226
|
+
H(Math.round(e).toString(16)),
|
|
227
|
+
H(Math.round(t).toString(16)),
|
|
228
|
+
H(Math.round(n).toString(16)),
|
|
229
|
+
H(It(a))
|
|
230
230
|
];
|
|
231
231
|
return i && r[0].startsWith(r[0].charAt(1)) && r[1].startsWith(r[1].charAt(1)) && r[2].startsWith(r[2].charAt(1)) && r[3].startsWith(r[3].charAt(1)) ? r[0].charAt(0) + r[1].charAt(0) + r[2].charAt(0) + r[3].charAt(0) : r.join("");
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function It(e) {
|
|
234
234
|
return Math.round(parseFloat(e) * 255).toString(16);
|
|
235
235
|
}
|
|
236
236
|
function Pe(e) {
|
|
237
|
-
return
|
|
237
|
+
return w(e) / 255;
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function w(e) {
|
|
240
240
|
return parseInt(e, 16);
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function At(e) {
|
|
243
243
|
return {
|
|
244
244
|
r: e >> 16,
|
|
245
245
|
g: (e & 65280) >> 8,
|
|
@@ -396,9 +396,9 @@ var Ae = {
|
|
|
396
396
|
yellow: "#ffff00",
|
|
397
397
|
yellowgreen: "#9acd32"
|
|
398
398
|
};
|
|
399
|
-
function
|
|
399
|
+
function Ct(e) {
|
|
400
400
|
var t = { r: 0, g: 0, b: 0 }, n = 1, a = null, i = null, r = null, o = !1, l = !1;
|
|
401
|
-
return typeof e == "string" && (e =
|
|
401
|
+
return typeof e == "string" && (e = zt(e)), typeof e == "object" && (O(e.r) && O(e.g) && O(e.b) ? (t = wt(e.r, e.g, e.b), o = !0, l = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : O(e.h) && O(e.s) && O(e.v) ? (a = se(e.s), i = se(e.v), t = xt(e.h, a, i), o = !0, l = "hsv") : O(e.h) && O(e.s) && O(e.l) && (a = se(e.s), r = se(e.l), t = St(e.h, a, r), o = !0, l = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a)), n = Ue(n), {
|
|
402
402
|
ok: o,
|
|
403
403
|
format: e.format || l,
|
|
404
404
|
r: Math.min(255, Math.max(t.r, 0)),
|
|
@@ -407,20 +407,20 @@ function Tt(e) {
|
|
|
407
407
|
a: n
|
|
408
408
|
};
|
|
409
409
|
}
|
|
410
|
-
var
|
|
411
|
-
CSS_UNIT: new RegExp(
|
|
412
|
-
rgb: new RegExp("rgb" +
|
|
413
|
-
rgba: new RegExp("rgba" +
|
|
414
|
-
hsl: new RegExp("hsl" +
|
|
415
|
-
hsla: new RegExp("hsla" +
|
|
416
|
-
hsv: new RegExp("hsv" +
|
|
417
|
-
hsva: new RegExp("hsva" +
|
|
410
|
+
var Tt = "[-\\+]?\\d+%?", kt = "[-\\+]?\\d*\\.\\d+%?", N = "(?:".concat(kt, ")|(?:").concat(Tt, ")"), ye = "[\\s|\\(]+(".concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")\\s*\\)?"), we = "[\\s|\\(]+(".concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")[,|\\s]+(").concat(N, ")\\s*\\)?"), T = {
|
|
411
|
+
CSS_UNIT: new RegExp(N),
|
|
412
|
+
rgb: new RegExp("rgb" + ye),
|
|
413
|
+
rgba: new RegExp("rgba" + we),
|
|
414
|
+
hsl: new RegExp("hsl" + ye),
|
|
415
|
+
hsla: new RegExp("hsla" + we),
|
|
416
|
+
hsv: new RegExp("hsv" + ye),
|
|
417
|
+
hsva: new RegExp("hsva" + we),
|
|
418
418
|
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
419
419
|
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
420
420
|
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
421
421
|
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
422
422
|
};
|
|
423
|
-
function
|
|
423
|
+
function zt(e) {
|
|
424
424
|
if (e = e.trim().toLowerCase(), e.length === 0)
|
|
425
425
|
return !1;
|
|
426
426
|
var t = !1;
|
|
@@ -428,35 +428,35 @@ function Ot(e) {
|
|
|
428
428
|
e = Ae[e], t = !0;
|
|
429
429
|
else if (e === "transparent")
|
|
430
430
|
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
|
|
431
|
-
var n =
|
|
432
|
-
return n ? { r: n[1], g: n[2], b: n[3] } : (n =
|
|
433
|
-
r:
|
|
434
|
-
g:
|
|
435
|
-
b:
|
|
431
|
+
var n = T.rgb.exec(e);
|
|
432
|
+
return n ? { r: n[1], g: n[2], b: n[3] } : (n = T.rgba.exec(e), n ? { r: n[1], g: n[2], b: n[3], a: n[4] } : (n = T.hsl.exec(e), n ? { h: n[1], s: n[2], l: n[3] } : (n = T.hsla.exec(e), n ? { h: n[1], s: n[2], l: n[3], a: n[4] } : (n = T.hsv.exec(e), n ? { h: n[1], s: n[2], v: n[3] } : (n = T.hsva.exec(e), n ? { h: n[1], s: n[2], v: n[3], a: n[4] } : (n = T.hex8.exec(e), n ? {
|
|
433
|
+
r: w(n[1]),
|
|
434
|
+
g: w(n[2]),
|
|
435
|
+
b: w(n[3]),
|
|
436
436
|
a: Pe(n[4]),
|
|
437
437
|
format: t ? "name" : "hex8"
|
|
438
|
-
} : (n =
|
|
439
|
-
r:
|
|
440
|
-
g:
|
|
441
|
-
b:
|
|
438
|
+
} : (n = T.hex6.exec(e), n ? {
|
|
439
|
+
r: w(n[1]),
|
|
440
|
+
g: w(n[2]),
|
|
441
|
+
b: w(n[3]),
|
|
442
442
|
format: t ? "name" : "hex"
|
|
443
|
-
} : (n =
|
|
444
|
-
r:
|
|
445
|
-
g:
|
|
446
|
-
b:
|
|
443
|
+
} : (n = T.hex4.exec(e), n ? {
|
|
444
|
+
r: w(n[1] + n[1]),
|
|
445
|
+
g: w(n[2] + n[2]),
|
|
446
|
+
b: w(n[3] + n[3]),
|
|
447
447
|
a: Pe(n[4] + n[4]),
|
|
448
448
|
format: t ? "name" : "hex8"
|
|
449
|
-
} : (n =
|
|
450
|
-
r:
|
|
451
|
-
g:
|
|
452
|
-
b:
|
|
449
|
+
} : (n = T.hex3.exec(e), n ? {
|
|
450
|
+
r: w(n[1] + n[1]),
|
|
451
|
+
g: w(n[2] + n[2]),
|
|
452
|
+
b: w(n[3] + n[3]),
|
|
453
453
|
format: t ? "name" : "hex"
|
|
454
454
|
} : !1)))))))));
|
|
455
455
|
}
|
|
456
|
-
function
|
|
457
|
-
return !!
|
|
456
|
+
function O(e) {
|
|
457
|
+
return !!T.CSS_UNIT.exec(String(e));
|
|
458
458
|
}
|
|
459
|
-
var
|
|
459
|
+
var Q = (
|
|
460
460
|
/** @class */
|
|
461
461
|
function() {
|
|
462
462
|
function e(t, n) {
|
|
@@ -464,8 +464,8 @@ var J = (
|
|
|
464
464
|
var a;
|
|
465
465
|
if (t instanceof e)
|
|
466
466
|
return t;
|
|
467
|
-
typeof t == "number" && (t =
|
|
468
|
-
var i =
|
|
467
|
+
typeof t == "number" && (t = At(t)), this.originalInput = t;
|
|
468
|
+
var i = Ct(t);
|
|
469
469
|
this.originalInput = t, this.r = i.r, this.g = i.g, this.b = i.b, this.a = i.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (a = n.format) !== null && a !== void 0 ? a : i.format, this.gradientType = n.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = i.ok;
|
|
470
470
|
}
|
|
471
471
|
return e.prototype.isDark = function() {
|
|
@@ -502,9 +502,11 @@ var J = (
|
|
|
502
502
|
}, e.prototype.toHexString = function(t) {
|
|
503
503
|
return t === void 0 && (t = !1), "#" + this.toHex(t);
|
|
504
504
|
}, e.prototype.toHex8 = function(t) {
|
|
505
|
-
return t === void 0 && (t = !1),
|
|
505
|
+
return t === void 0 && (t = !1), Mt(this.r, this.g, this.b, this.a, t);
|
|
506
506
|
}, e.prototype.toHex8String = function(t) {
|
|
507
507
|
return t === void 0 && (t = !1), "#" + this.toHex8(t);
|
|
508
|
+
}, e.prototype.toHexShortString = function(t) {
|
|
509
|
+
return t === void 0 && (t = !1), this.a === 1 ? this.toHexString(t) : this.toHex8String(t);
|
|
508
510
|
}, e.prototype.toRgb = function() {
|
|
509
511
|
return {
|
|
510
512
|
r: Math.round(this.r),
|
|
@@ -553,7 +555,7 @@ var J = (
|
|
|
553
555
|
}, e.prototype.lighten = function(t) {
|
|
554
556
|
t === void 0 && (t = 10);
|
|
555
557
|
var n = this.toHsl();
|
|
556
|
-
return n.l += t / 100, n.l =
|
|
558
|
+
return n.l += t / 100, n.l = oe(n.l), new e(n);
|
|
557
559
|
}, e.prototype.brighten = function(t) {
|
|
558
560
|
t === void 0 && (t = 10);
|
|
559
561
|
var n = this.toRgb();
|
|
@@ -561,7 +563,7 @@ var J = (
|
|
|
561
563
|
}, e.prototype.darken = function(t) {
|
|
562
564
|
t === void 0 && (t = 10);
|
|
563
565
|
var n = this.toHsl();
|
|
564
|
-
return n.l -= t / 100, n.l =
|
|
566
|
+
return n.l -= t / 100, n.l = oe(n.l), new e(n);
|
|
565
567
|
}, e.prototype.tint = function(t) {
|
|
566
568
|
return t === void 0 && (t = 10), this.mix("white", t);
|
|
567
569
|
}, e.prototype.shade = function(t) {
|
|
@@ -569,11 +571,11 @@ var J = (
|
|
|
569
571
|
}, e.prototype.desaturate = function(t) {
|
|
570
572
|
t === void 0 && (t = 10);
|
|
571
573
|
var n = this.toHsl();
|
|
572
|
-
return n.s -= t / 100, n.s =
|
|
574
|
+
return n.s -= t / 100, n.s = oe(n.s), new e(n);
|
|
573
575
|
}, e.prototype.saturate = function(t) {
|
|
574
576
|
t === void 0 && (t = 10);
|
|
575
577
|
var n = this.toHsl();
|
|
576
|
-
return n.s += t / 100, n.s =
|
|
578
|
+
return n.s += t / 100, n.s = oe(n.s), new e(n);
|
|
577
579
|
}, e.prototype.greyscale = function() {
|
|
578
580
|
return this.desaturate(100);
|
|
579
581
|
}, e.prototype.spin = function(t) {
|
|
@@ -610,11 +612,12 @@ var J = (
|
|
|
610
612
|
new e({ h: (n + 216) % 360, s: t.s, l: t.l })
|
|
611
613
|
];
|
|
612
614
|
}, e.prototype.onBackground = function(t) {
|
|
613
|
-
var n = this.toRgb(), a = new e(t).toRgb();
|
|
615
|
+
var n = this.toRgb(), a = new e(t).toRgb(), i = n.a + a.a * (1 - n.a);
|
|
614
616
|
return new e({
|
|
615
|
-
r:
|
|
616
|
-
g:
|
|
617
|
-
b:
|
|
617
|
+
r: (n.r * n.a + a.r * a.a * (1 - n.a)) / i,
|
|
618
|
+
g: (n.g * n.a + a.g * a.a * (1 - n.a)) / i,
|
|
619
|
+
b: (n.b * n.a + a.b * a.a * (1 - n.a)) / i,
|
|
620
|
+
a: i
|
|
618
621
|
});
|
|
619
622
|
}, e.prototype.triad = function() {
|
|
620
623
|
return this.polyad(3);
|
|
@@ -629,21 +632,21 @@ var J = (
|
|
|
629
632
|
}, e;
|
|
630
633
|
}()
|
|
631
634
|
);
|
|
632
|
-
const
|
|
635
|
+
const Ot = new fe("viewFadeIn", {
|
|
633
636
|
"0%": {
|
|
634
637
|
opacity: 0
|
|
635
638
|
},
|
|
636
639
|
"100%": {
|
|
637
640
|
opacity: 1
|
|
638
641
|
}
|
|
639
|
-
}),
|
|
642
|
+
}), Lt = new fe("viewFadeOut", {
|
|
640
643
|
"0%": {
|
|
641
644
|
opacity: 1
|
|
642
645
|
},
|
|
643
646
|
"100%": {
|
|
644
647
|
opacity: 0
|
|
645
648
|
}
|
|
646
|
-
}),
|
|
649
|
+
}), Nt = new fe("viewZoomBadgeIn", {
|
|
647
650
|
"0%": {
|
|
648
651
|
transform: "scale(0.2)",
|
|
649
652
|
opacity: 0
|
|
@@ -652,7 +655,7 @@ const Lt = new ce("viewFadeIn", {
|
|
|
652
655
|
transform: "scale(1)",
|
|
653
656
|
opacity: 1
|
|
654
657
|
}
|
|
655
|
-
}),
|
|
658
|
+
}), $t = new fe("viewZoomBadgeOut", {
|
|
656
659
|
"0%": {
|
|
657
660
|
transform: "scale(1)"
|
|
658
661
|
},
|
|
@@ -673,7 +676,7 @@ function Se(e) {
|
|
|
673
676
|
insetInlineStart: 0
|
|
674
677
|
};
|
|
675
678
|
}
|
|
676
|
-
const
|
|
679
|
+
const Et = (e) => ({
|
|
677
680
|
boxSizing: "border-box",
|
|
678
681
|
margin: 0,
|
|
679
682
|
padding: 0,
|
|
@@ -682,11 +685,11 @@ const Rt = (e) => ({
|
|
|
682
685
|
lineHeight: e.lineHeight,
|
|
683
686
|
listStyle: "none",
|
|
684
687
|
fontFamily: e.fontFamily
|
|
685
|
-
}),
|
|
686
|
-
const { componentCls: t, modalMaskBg: n, paddingSM: a, previewOperationColorDisabled: i, motionDurationSlow: r } = e, o = new
|
|
688
|
+
}), Rt = (e) => {
|
|
689
|
+
const { componentCls: t, modalMaskBg: n, paddingSM: a, previewOperationColorDisabled: i, motionDurationSlow: r } = e, o = new Q(n).setAlpha(0.1), l = o.clone().setAlpha(0.2);
|
|
687
690
|
return {
|
|
688
691
|
[`${t}-operations`]: {
|
|
689
|
-
...
|
|
692
|
+
...Et(e),
|
|
690
693
|
display: "flex",
|
|
691
694
|
flexDirection: "row-reverse",
|
|
692
695
|
alignItems: "center",
|
|
@@ -721,8 +724,8 @@ const Rt = (e) => ({
|
|
|
721
724
|
}
|
|
722
725
|
}
|
|
723
726
|
};
|
|
724
|
-
},
|
|
725
|
-
const { modalMaskBg: t, previewOperationColorDisabled: n, zIndexPopup: a, motionDurationSlow: i } = e, r = new
|
|
727
|
+
}, Dt = (e) => {
|
|
728
|
+
const { modalMaskBg: t, previewOperationColorDisabled: n, zIndexPopup: a, motionDurationSlow: i } = e, r = new Q(t).setAlpha(0.1), o = r.clone().setAlpha(0.2);
|
|
726
729
|
return {
|
|
727
730
|
[`${e.componentCls}-switch-left, ${e.componentCls}-switch-right`]: {
|
|
728
731
|
position: "fixed",
|
|
@@ -766,7 +769,7 @@ const Rt = (e) => ({
|
|
|
766
769
|
insetInlineEnd: e.marginSM
|
|
767
770
|
}
|
|
768
771
|
};
|
|
769
|
-
},
|
|
772
|
+
}, Ht = (e) => ({
|
|
770
773
|
[e.componentCls]: {
|
|
771
774
|
"&-root": {
|
|
772
775
|
...Se("fixed"),
|
|
@@ -821,17 +824,17 @@ const Rt = (e) => ({
|
|
|
821
824
|
pointerEvents: "auto"
|
|
822
825
|
},
|
|
823
826
|
"&-fade-appear, &-fade-enter": {
|
|
824
|
-
animationName:
|
|
827
|
+
animationName: Ot,
|
|
825
828
|
animationDuration: e.motionDurationSlow,
|
|
826
829
|
animationTimingFunction: "linear"
|
|
827
830
|
},
|
|
828
831
|
"&-fade-leave": {
|
|
829
|
-
animationName:
|
|
832
|
+
animationName: Lt,
|
|
830
833
|
animationDuration: e.motionDurationSlow,
|
|
831
834
|
animationTimingFunction: "linear"
|
|
832
835
|
},
|
|
833
836
|
"&-zoom-appear, &-zoom-enter": {
|
|
834
|
-
animationName:
|
|
837
|
+
animationName: Nt,
|
|
835
838
|
opacity: 0,
|
|
836
839
|
animationTimingFunction: e.motionEaseOutCirc,
|
|
837
840
|
animationFillMode: "both",
|
|
@@ -843,7 +846,7 @@ const Rt = (e) => ({
|
|
|
843
846
|
animationPlayState: "running"
|
|
844
847
|
},
|
|
845
848
|
"&-zoom-leave": {
|
|
846
|
-
animationName:
|
|
849
|
+
animationName: $t,
|
|
847
850
|
animationDuration: e.motionDurationSlow,
|
|
848
851
|
animationTimingFunction: e.motionEaseOutBack,
|
|
849
852
|
animationFillMode: "both"
|
|
@@ -861,22 +864,22 @@ const Rt = (e) => ({
|
|
|
861
864
|
zIndex: e.zIndexPopup + 1,
|
|
862
865
|
width: "100%"
|
|
863
866
|
},
|
|
864
|
-
"&": [
|
|
867
|
+
"&": [Rt(e), Dt(e)]
|
|
865
868
|
});
|
|
866
|
-
function
|
|
867
|
-
return
|
|
868
|
-
const n =
|
|
869
|
+
function Pt(e) {
|
|
870
|
+
return ht("ImageView", (t) => {
|
|
871
|
+
const n = gt(t, {
|
|
869
872
|
zIndexPopup: t.zIndexPopupBase + 80,
|
|
870
|
-
previewOperationColorDisabled: new
|
|
871
|
-
modalMaskBg: new
|
|
873
|
+
previewOperationColorDisabled: new Q(t.colorTextLightSolid).setAlpha(0.25).toRgbString(),
|
|
874
|
+
modalMaskBg: new Q("#000").setAlpha(0.45).toRgbString(),
|
|
872
875
|
// FIXME: Shared Token
|
|
873
|
-
previewOperationColor: new
|
|
876
|
+
previewOperationColor: new Q(t.colorTextLightSolid).toRgbString(),
|
|
874
877
|
previewOperationSize: t.fontSizeIcon * 1.5,
|
|
875
878
|
// FIXME: fontSizeIconLG
|
|
876
879
|
imagePreviewSwitchSize: t.controlHeightLG,
|
|
877
880
|
iconCls: "anticon"
|
|
878
881
|
});
|
|
879
|
-
return [
|
|
882
|
+
return [Ht(n)];
|
|
880
883
|
}, e);
|
|
881
884
|
}
|
|
882
885
|
const Y = {
|
|
@@ -894,22 +897,22 @@ const Y = {
|
|
|
894
897
|
esc: "Escape",
|
|
895
898
|
delete: "Delete",
|
|
896
899
|
backspace: "Backspace"
|
|
897
|
-
},
|
|
900
|
+
}, le = function(e, t, n, a = !1) {
|
|
898
901
|
e && t && n && e.addEventListener(t, n, a);
|
|
899
902
|
}, xe = function(e, t, n, a = !1) {
|
|
900
903
|
e && t && n && e.removeEventListener(t, n, a);
|
|
901
|
-
},
|
|
904
|
+
}, X = {
|
|
902
905
|
CONTAIN: {
|
|
903
906
|
name: "contain",
|
|
904
|
-
icon:
|
|
907
|
+
icon: f(Ke, null, null)
|
|
905
908
|
},
|
|
906
909
|
ORIGINAL: {
|
|
907
910
|
name: "original",
|
|
908
|
-
icon:
|
|
911
|
+
icon: f(et, null, null)
|
|
909
912
|
}
|
|
910
|
-
},
|
|
911
|
-
return !
|
|
912
|
-
}, je =
|
|
913
|
+
}, Ft = function() {
|
|
914
|
+
return !q && !!window.navigator.userAgent.match(/firefox/i);
|
|
915
|
+
}, je = Ft() ? "DOMMouseScroll" : "mousewheel";
|
|
913
916
|
function Me(e) {
|
|
914
917
|
let t = !1;
|
|
915
918
|
return function(...n) {
|
|
@@ -918,21 +921,21 @@ function Me(e) {
|
|
|
918
921
|
}));
|
|
919
922
|
};
|
|
920
923
|
}
|
|
921
|
-
const
|
|
922
|
-
props:
|
|
924
|
+
const jt = /* @__PURE__ */ Ve({
|
|
925
|
+
props: pt,
|
|
923
926
|
emits: ["close", "switch"],
|
|
924
|
-
setup:
|
|
927
|
+
setup: (e, {
|
|
925
928
|
emit: t,
|
|
926
929
|
expose: n
|
|
927
|
-
}) {
|
|
928
|
-
var
|
|
930
|
+
}) => {
|
|
931
|
+
var ie, re, E, Z, Ce;
|
|
929
932
|
let a = null, i = null, r = null;
|
|
930
933
|
const o = Ge({
|
|
931
934
|
suffixCls: "image-viewer"
|
|
932
935
|
}), {
|
|
933
936
|
wrapSSR: l,
|
|
934
|
-
hashId:
|
|
935
|
-
} =
|
|
937
|
+
hashId: c
|
|
938
|
+
} = Pt(o), S = Te(!1), [p, $] = Ne(!1), [k, x] = Ne(!1), z = C(!0), h = C(e.initialIndex), P = C(null), F = C(null), W = C(X.CONTAIN), m = Xe({
|
|
936
939
|
transform: {
|
|
937
940
|
scale: 1,
|
|
938
941
|
deg: 0,
|
|
@@ -940,22 +943,24 @@ const Bt = /* @__PURE__ */ Ve({
|
|
|
940
943
|
offsetY: 0,
|
|
941
944
|
enableTransition: !1
|
|
942
945
|
}
|
|
943
|
-
}),
|
|
946
|
+
}), J = L(() => e.urlList.length > 1), G = L(() => h.value === 0), K = L(() => h.value === e.urlList.length - 1), ee = L(() => e.urlList[h.value]), te = L(() => {
|
|
944
947
|
const {
|
|
945
948
|
scale: s,
|
|
946
|
-
deg:
|
|
947
|
-
offsetX:
|
|
948
|
-
offsetY:
|
|
949
|
-
enableTransition:
|
|
950
|
-
} =
|
|
951
|
-
transform: `scale(${s}) rotate(${
|
|
952
|
-
transition:
|
|
953
|
-
marginLeft: `${
|
|
954
|
-
marginTop: `${
|
|
949
|
+
deg: I,
|
|
950
|
+
offsetX: d,
|
|
951
|
+
offsetY: y,
|
|
952
|
+
enableTransition: b
|
|
953
|
+
} = m.transform, A = {
|
|
954
|
+
transform: `scale(${s}) rotate(${I}deg)`,
|
|
955
|
+
transition: b ? "transform .3s" : "",
|
|
956
|
+
marginLeft: `${d}px`,
|
|
957
|
+
marginTop: `${y}px`
|
|
955
958
|
};
|
|
956
|
-
return W.value.name ===
|
|
957
|
-
}),
|
|
958
|
-
|
|
959
|
+
return W.value.name === X.CONTAIN.name && (A.maxWidth = A.maxHeight = "100%"), A;
|
|
960
|
+
}), ne = () => {
|
|
961
|
+
xe(document, "keydown", a), xe(document, je, i), a = null, i = null;
|
|
962
|
+
}, de = () => {
|
|
963
|
+
ne(), t("close"), m.transform = {
|
|
959
964
|
scale: 1,
|
|
960
965
|
deg: 0,
|
|
961
966
|
offsetX: 0,
|
|
@@ -963,222 +968,215 @@ const Bt = /* @__PURE__ */ Ve({
|
|
|
963
968
|
enableTransition: !1
|
|
964
969
|
};
|
|
965
970
|
}, he = (s) => {
|
|
966
|
-
S.value ? S.value = !1 :
|
|
967
|
-
},
|
|
971
|
+
S.value ? S.value = !1 : P.value === (s == null ? void 0 : s.target) && (x(!1), h.value = e.initialIndex);
|
|
972
|
+
}, ae = () => {
|
|
973
|
+
m.transform = {
|
|
974
|
+
scale: 1,
|
|
975
|
+
deg: 0,
|
|
976
|
+
offsetX: 0,
|
|
977
|
+
offsetY: 0,
|
|
978
|
+
enableTransition: !1
|
|
979
|
+
};
|
|
980
|
+
}, j = () => {
|
|
981
|
+
if (G.value && !e.infinite) return;
|
|
982
|
+
const s = e.urlList.length;
|
|
983
|
+
h.value = (h.value - 1 + s) % s;
|
|
984
|
+
}, u = () => {
|
|
985
|
+
if (K.value && !e.infinite) return;
|
|
986
|
+
const s = e.urlList.length;
|
|
987
|
+
h.value = (h.value + 1) % s;
|
|
988
|
+
}, M = () => {
|
|
989
|
+
if (z.value) return;
|
|
990
|
+
const s = Object.keys(X), I = Object.values(X), d = W.value.name, b = (I.findIndex((A) => A.name === d) + 1) % s.length;
|
|
991
|
+
W.value = X[s[b]], ae();
|
|
992
|
+
}, g = (s, I = {}) => {
|
|
993
|
+
if (z.value) return;
|
|
994
|
+
const {
|
|
995
|
+
zoomRate: d,
|
|
996
|
+
rotateDeg: y,
|
|
997
|
+
enableTransition: b
|
|
998
|
+
} = {
|
|
999
|
+
zoomRate: 0.2,
|
|
1000
|
+
rotateDeg: 90,
|
|
1001
|
+
enableTransition: !0,
|
|
1002
|
+
...I
|
|
1003
|
+
};
|
|
1004
|
+
switch (s) {
|
|
1005
|
+
case "zoomOut":
|
|
1006
|
+
m.transform.scale > 0.2 && (m.transform.scale = Number.parseFloat((m.transform.scale - d).toFixed(3)));
|
|
1007
|
+
break;
|
|
1008
|
+
case "zoomIn":
|
|
1009
|
+
m.transform.scale = Number.parseFloat((m.transform.scale + d).toFixed(3));
|
|
1010
|
+
break;
|
|
1011
|
+
case "clocelise":
|
|
1012
|
+
m.transform.deg += y;
|
|
1013
|
+
break;
|
|
1014
|
+
case "anticlocelise":
|
|
1015
|
+
m.transform.deg -= y;
|
|
1016
|
+
break;
|
|
1017
|
+
}
|
|
1018
|
+
m.transform.enableTransition = b;
|
|
1019
|
+
}, B = () => {
|
|
968
1020
|
a = Me((s) => {
|
|
969
1021
|
switch (s.code) {
|
|
970
1022
|
case Y.esc:
|
|
971
1023
|
x(!1);
|
|
972
1024
|
break;
|
|
973
1025
|
case Y.space:
|
|
974
|
-
|
|
1026
|
+
M();
|
|
975
1027
|
break;
|
|
976
1028
|
case Y.left:
|
|
977
|
-
|
|
1029
|
+
j();
|
|
978
1030
|
break;
|
|
979
1031
|
case Y.up:
|
|
980
|
-
|
|
1032
|
+
g("zoomIn");
|
|
981
1033
|
break;
|
|
982
1034
|
case Y.right:
|
|
983
|
-
|
|
1035
|
+
u();
|
|
984
1036
|
break;
|
|
985
1037
|
case Y.down:
|
|
986
|
-
|
|
1038
|
+
g("zoomOut");
|
|
987
1039
|
break;
|
|
988
1040
|
}
|
|
989
1041
|
}), i = Me((s) => {
|
|
990
|
-
(s.wheelDelta ? s.wheelDelta : -s.detail) > 0 ?
|
|
1042
|
+
(s.wheelDelta ? s.wheelDelta : -s.detail) > 0 ? g("zoomIn", {
|
|
991
1043
|
zoomRate: 0.015,
|
|
992
1044
|
enableTransition: !1
|
|
993
|
-
}) :
|
|
1045
|
+
}) : g("zoomOut", {
|
|
994
1046
|
zoomRate: 0.015,
|
|
995
1047
|
enableTransition: !1
|
|
996
1048
|
});
|
|
997
|
-
}),
|
|
998
|
-
},
|
|
999
|
-
|
|
1000
|
-
},
|
|
1001
|
-
|
|
1002
|
-
},
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
if (O.value || s.button !== 0)
|
|
1006
|
-
return;
|
|
1007
|
-
s.preventDefault(), s.stopPropagation(), clearTimeout(b.value), S.value = !0;
|
|
1049
|
+
}), le(document, "keydown", a), le(document, je, i);
|
|
1050
|
+
}, V = () => {
|
|
1051
|
+
z.value = !1;
|
|
1052
|
+
}, ge = (s) => {
|
|
1053
|
+
z.value = !1, s.target.alt = "加载失败";
|
|
1054
|
+
}, U = Te(), ve = (s) => {
|
|
1055
|
+
if (z.value || s.button !== 0) return;
|
|
1056
|
+
s.preventDefault(), s.stopPropagation(), clearTimeout(U.value), S.value = !0;
|
|
1008
1057
|
const {
|
|
1009
|
-
offsetX:
|
|
1010
|
-
offsetY:
|
|
1011
|
-
} =
|
|
1012
|
-
r = Me((
|
|
1013
|
-
|
|
1014
|
-
...
|
|
1015
|
-
offsetX:
|
|
1016
|
-
offsetY:
|
|
1058
|
+
offsetX: I,
|
|
1059
|
+
offsetY: d
|
|
1060
|
+
} = m.transform, y = s.pageX, b = s.pageY;
|
|
1061
|
+
r = Me((A) => {
|
|
1062
|
+
m.transform = {
|
|
1063
|
+
...m.transform,
|
|
1064
|
+
offsetX: I + A.pageX - y,
|
|
1065
|
+
offsetY: d + A.pageY - b
|
|
1017
1066
|
};
|
|
1018
|
-
}),
|
|
1019
|
-
xe(document, "mousemove", r),
|
|
1067
|
+
}), le(document, "mousemove", r), le(document, "mouseup", () => {
|
|
1068
|
+
xe(document, "mousemove", r), p.value && k.value && (U.value = setTimeout(() => {
|
|
1020
1069
|
S.value = !1;
|
|
1021
1070
|
}));
|
|
1022
1071
|
});
|
|
1023
|
-
}, R = () => {
|
|
1024
|
-
d.transform = {
|
|
1025
|
-
scale: 1,
|
|
1026
|
-
deg: 0,
|
|
1027
|
-
offsetX: 0,
|
|
1028
|
-
offsetY: 0,
|
|
1029
|
-
enableTransition: !1
|
|
1030
|
-
};
|
|
1031
|
-
}, V = () => {
|
|
1032
|
-
if (O.value)
|
|
1033
|
-
return;
|
|
1034
|
-
const s = Object.keys(_), M = Object.values(_), h = W.value.name, p = (M.findIndex((I) => I.name === h) + 1) % s.length;
|
|
1035
|
-
W.value = _[s[p]], R();
|
|
1036
|
-
}, ne = () => {
|
|
1037
|
-
if (K.value && !e.infinite)
|
|
1038
|
-
return;
|
|
1039
|
-
const s = e.urlList.length;
|
|
1040
|
-
g.value = (g.value - 1 + s) % s;
|
|
1041
|
-
}, Z = () => {
|
|
1042
|
-
if (ee.value && !e.infinite)
|
|
1043
|
-
return;
|
|
1044
|
-
const s = e.urlList.length;
|
|
1045
|
-
g.value = (g.value + 1) % s;
|
|
1046
|
-
}, k = (s, M = {}) => {
|
|
1047
|
-
if (O.value)
|
|
1048
|
-
return;
|
|
1049
|
-
const {
|
|
1050
|
-
zoomRate: h,
|
|
1051
|
-
rotateDeg: w,
|
|
1052
|
-
enableTransition: p
|
|
1053
|
-
} = {
|
|
1054
|
-
zoomRate: 0.2,
|
|
1055
|
-
rotateDeg: 90,
|
|
1056
|
-
enableTransition: !0,
|
|
1057
|
-
...M
|
|
1058
|
-
};
|
|
1059
|
-
switch (s) {
|
|
1060
|
-
case "zoomOut":
|
|
1061
|
-
d.transform.scale > 0.2 && (d.transform.scale = parseFloat((d.transform.scale - h).toFixed(3)));
|
|
1062
|
-
break;
|
|
1063
|
-
case "zoomIn":
|
|
1064
|
-
d.transform.scale = parseFloat((d.transform.scale + h).toFixed(3));
|
|
1065
|
-
break;
|
|
1066
|
-
case "clocelise":
|
|
1067
|
-
d.transform.deg += w;
|
|
1068
|
-
break;
|
|
1069
|
-
case "anticlocelise":
|
|
1070
|
-
d.transform.deg -= w;
|
|
1071
|
-
break;
|
|
1072
|
-
}
|
|
1073
|
-
d.transform.enableTransition = p;
|
|
1074
1072
|
}, me = [{
|
|
1075
|
-
icon: ((
|
|
1073
|
+
icon: ((ie = e.icons) == null ? void 0 : ie.close) || f(tt, null, null),
|
|
1076
1074
|
onClick: (s) => {
|
|
1077
1075
|
s.stopPropagation(), x(!1);
|
|
1078
1076
|
},
|
|
1079
1077
|
type: "close"
|
|
1080
1078
|
}, {
|
|
1081
|
-
icon: ((
|
|
1079
|
+
icon: ((re = e.icons) == null ? void 0 : re.zoomIn) || f(nt, null, null),
|
|
1082
1080
|
onClick: (s) => {
|
|
1083
|
-
s.stopPropagation(),
|
|
1081
|
+
s.stopPropagation(), g("zoomIn");
|
|
1084
1082
|
},
|
|
1085
1083
|
type: "zoomIn"
|
|
1086
1084
|
}, {
|
|
1087
|
-
icon: ((
|
|
1085
|
+
icon: ((E = e.icons) == null ? void 0 : E.zoomOut) || f(at, null, null),
|
|
1088
1086
|
onClick: (s) => {
|
|
1089
|
-
s.stopPropagation(),
|
|
1087
|
+
s.stopPropagation(), g("zoomOut");
|
|
1090
1088
|
},
|
|
1091
1089
|
type: "zoomOut"
|
|
1092
1090
|
}, {
|
|
1093
|
-
icon: ((
|
|
1091
|
+
icon: ((Z = e.icons) == null ? void 0 : Z.rotateRight) || f(it, null, null),
|
|
1094
1092
|
onClick: (s) => {
|
|
1095
|
-
s.stopPropagation(),
|
|
1093
|
+
s.stopPropagation(), g("anticlocelise");
|
|
1096
1094
|
},
|
|
1097
1095
|
type: "rotateRight"
|
|
1098
1096
|
}, {
|
|
1099
|
-
icon: ((Ce = e.icons) == null ? void 0 : Ce.rotateLeft) ||
|
|
1097
|
+
icon: ((Ce = e.icons) == null ? void 0 : Ce.rotateLeft) || f(rt, null, null),
|
|
1100
1098
|
onClick: (s) => {
|
|
1101
|
-
s.stopPropagation(),
|
|
1099
|
+
s.stopPropagation(), g("clocelise");
|
|
1102
1100
|
},
|
|
1103
1101
|
type: "rotateLeft"
|
|
1104
1102
|
}];
|
|
1105
|
-
return
|
|
1103
|
+
return _(ee, () => {
|
|
1106
1104
|
Ye(() => {
|
|
1107
|
-
|
|
1105
|
+
F.value.complete || (z.value = !0);
|
|
1108
1106
|
});
|
|
1109
|
-
}),
|
|
1110
|
-
|
|
1111
|
-
}),
|
|
1112
|
-
s && (
|
|
1113
|
-
}),
|
|
1114
|
-
var
|
|
1115
|
-
s &&
|
|
1107
|
+
}), _(h, (s) => {
|
|
1108
|
+
ae(), t("switch", s);
|
|
1109
|
+
}), _(p, (s) => {
|
|
1110
|
+
s && (k.value = s);
|
|
1111
|
+
}), _([() => p.value, () => P.value], ([s, I]) => {
|
|
1112
|
+
var d, y;
|
|
1113
|
+
s && I && (B(), (y = (d = P.value) == null ? void 0 : d.focus) == null || y.call(d));
|
|
1116
1114
|
}), n({
|
|
1117
|
-
setOpen:
|
|
1115
|
+
setOpen: $
|
|
1118
1116
|
}), () => {
|
|
1119
|
-
const s = $e(`${o}-fade`),
|
|
1120
|
-
return l(
|
|
1117
|
+
const s = $e(`${o}-fade`), I = $e(`${o}-zoom`);
|
|
1118
|
+
return l(f(_e, {
|
|
1121
1119
|
to: e.getContainer || "body",
|
|
1122
1120
|
disabled: !e.teleported
|
|
1123
1121
|
}, {
|
|
1124
|
-
default: () => [
|
|
1125
|
-
class: `${o}-root ${
|
|
1126
|
-
}, [
|
|
1127
|
-
default: () => [ze(
|
|
1128
|
-
class: `${o}-mask ${
|
|
1129
|
-
}, null), [[Oe,
|
|
1130
|
-
}),
|
|
1131
|
-
ref:
|
|
1122
|
+
default: () => [p.value && f("div", {
|
|
1123
|
+
class: `${o}-root ${c.value}`
|
|
1124
|
+
}, [f(ke, s, {
|
|
1125
|
+
default: () => [ze(f("div", {
|
|
1126
|
+
class: `${o}-mask ${c.value}`
|
|
1127
|
+
}, null), [[Oe, p.value && k.value]])]
|
|
1128
|
+
}), f("div", {
|
|
1129
|
+
ref: P,
|
|
1132
1130
|
tabindex: -1,
|
|
1133
|
-
class: [`${o}-wrapper`, `${
|
|
1134
|
-
onClick: (
|
|
1135
|
-
}, [
|
|
1131
|
+
class: [`${o}-wrapper`, `${c.value}`],
|
|
1132
|
+
onClick: (d) => e.onHideOnClickModal && he(d)
|
|
1133
|
+
}, [f(ke, We(I, {
|
|
1136
1134
|
onAfterLeave: () => de()
|
|
1137
1135
|
}), {
|
|
1138
1136
|
default: () => {
|
|
1139
|
-
var
|
|
1140
|
-
return [ze(
|
|
1141
|
-
class: `${o}-block ${
|
|
1142
|
-
}, [
|
|
1143
|
-
class: `${o}-content ${
|
|
1144
|
-
}, [
|
|
1145
|
-
class: `${o}-body ${
|
|
1146
|
-
}, [
|
|
1147
|
-
class: `${o}-operations-wrapper ${
|
|
1148
|
-
onClick: (
|
|
1149
|
-
}, [
|
|
1150
|
-
class: `${o}-operations ${
|
|
1137
|
+
var d, y;
|
|
1138
|
+
return [ze(f("div", {
|
|
1139
|
+
class: `${o}-block ${c.value}`
|
|
1140
|
+
}, [f("div", {
|
|
1141
|
+
class: `${o}-content ${c.value}`
|
|
1142
|
+
}, [f("div", {
|
|
1143
|
+
class: `${o}-body ${c.value}`
|
|
1144
|
+
}, [f("div", {
|
|
1145
|
+
class: `${o}-operations-wrapper ${c.value}`,
|
|
1146
|
+
onClick: (b) => b.stopPropagation()
|
|
1147
|
+
}, [f("ul", {
|
|
1148
|
+
class: `${o}-operations ${c.value}`
|
|
1151
1149
|
}, [me.map(({
|
|
1152
|
-
icon:
|
|
1153
|
-
onClick:
|
|
1150
|
+
icon: b,
|
|
1151
|
+
onClick: A,
|
|
1154
1152
|
type: pe
|
|
1155
|
-
}) =>
|
|
1156
|
-
class: `${o}-operations-operation ${
|
|
1157
|
-
onClick:
|
|
1153
|
+
}) => f("li", {
|
|
1154
|
+
class: `${o}-operations-operation ${c.value}`,
|
|
1155
|
+
onClick: A,
|
|
1158
1156
|
key: pe
|
|
1159
|
-
}, [qe(
|
|
1160
|
-
class: `${o}-operations-icon ${
|
|
1161
|
-
})]))])]),
|
|
1162
|
-
class: `${o}-canvas ${
|
|
1163
|
-
}, [e.urlList.map((
|
|
1164
|
-
ref:
|
|
1165
|
-
class: `${o}-img ${
|
|
1157
|
+
}, [qe(b, {
|
|
1158
|
+
class: `${o}-operations-icon ${c.value}`
|
|
1159
|
+
})]))])]), f("div", {
|
|
1160
|
+
class: `${o}-canvas ${c.value}`
|
|
1161
|
+
}, [e.urlList.map((b, A) => f("img", {
|
|
1162
|
+
ref: F,
|
|
1163
|
+
class: `${o}-img ${c.value}`,
|
|
1166
1164
|
style: {
|
|
1167
|
-
...
|
|
1168
|
-
display:
|
|
1165
|
+
...te.value,
|
|
1166
|
+
display: A === h.value ? "block" : "none"
|
|
1169
1167
|
},
|
|
1170
|
-
key:
|
|
1171
|
-
src:
|
|
1172
|
-
onLoad: () =>
|
|
1173
|
-
onError: (pe) =>
|
|
1174
|
-
onMousedown:
|
|
1175
|
-
}, null))]),
|
|
1176
|
-
class: [`${o}-switch-left`,
|
|
1177
|
-
onClick:
|
|
1178
|
-
}, [((
|
|
1179
|
-
class: [`${o}-switch-right`,
|
|
1180
|
-
onClick:
|
|
1181
|
-
}, [((
|
|
1168
|
+
key: b,
|
|
1169
|
+
src: b,
|
|
1170
|
+
onLoad: () => V(),
|
|
1171
|
+
onError: (pe) => ge(pe),
|
|
1172
|
+
onMousedown: ve
|
|
1173
|
+
}, null))]), J.value && f("div", {
|
|
1174
|
+
class: [`${o}-switch-left`, h.value === 0 && !e.infinite ? `${o}-switch-left-disabled` : "", `${c.value}`],
|
|
1175
|
+
onClick: j
|
|
1176
|
+
}, [((d = e.icons) == null ? void 0 : d.left) || f(ot, null, null)]), J.value && f("div", {
|
|
1177
|
+
class: [`${o}-switch-right`, h.value === e.urlList.length - 1 && !e.infinite ? `${o}-switch-right-disabled` : "", `${c.value}`],
|
|
1178
|
+
onClick: u
|
|
1179
|
+
}, [((y = e.icons) == null ? void 0 : y.right) || f(st, null, null)])])])]), [[Oe, p.value && k.value]])];
|
|
1182
1180
|
}
|
|
1183
1181
|
})])])]
|
|
1184
1182
|
}));
|
|
@@ -1187,7 +1185,7 @@ const Bt = /* @__PURE__ */ Ve({
|
|
|
1187
1185
|
}), Ie = {
|
|
1188
1186
|
width: "100%",
|
|
1189
1187
|
height: "100%"
|
|
1190
|
-
},
|
|
1188
|
+
}, Bt = (e) => ({
|
|
1191
1189
|
[e.componentCls]: {
|
|
1192
1190
|
display: "inline-block",
|
|
1193
1191
|
position: "relative",
|
|
@@ -1217,10 +1215,10 @@ const Bt = /* @__PURE__ */ Ve({
|
|
|
1217
1215
|
cursor: "pointer"
|
|
1218
1216
|
}
|
|
1219
1217
|
}
|
|
1220
|
-
}),
|
|
1218
|
+
}), Vt = (e) => e && e.nodeType === Node.ELEMENT_NODE;
|
|
1221
1219
|
let Be = "";
|
|
1222
|
-
const
|
|
1223
|
-
props:
|
|
1220
|
+
const ce = /* @__PURE__ */ Ve({
|
|
1221
|
+
props: ue,
|
|
1224
1222
|
name: "GImage",
|
|
1225
1223
|
emits: ["error", "click", "load"],
|
|
1226
1224
|
setup(e, {
|
|
@@ -1233,131 +1231,127 @@ const ue = /* @__PURE__ */ Ve({
|
|
|
1233
1231
|
}), {
|
|
1234
1232
|
wrapSSR: r,
|
|
1235
1233
|
hashId: o
|
|
1236
|
-
} =
|
|
1237
|
-
let
|
|
1238
|
-
const
|
|
1234
|
+
} = vt("Image", [Bt], i), l = C(), c = C(""), S = C(!1), p = C(!0), $ = C(!1), k = C(null), x = C();
|
|
1235
|
+
let z, h;
|
|
1236
|
+
const P = L(() => !q && e.fit ? {
|
|
1239
1237
|
"object-fit": e.fit
|
|
1240
|
-
} : {}),
|
|
1238
|
+
} : {}), F = L(() => {
|
|
1241
1239
|
const {
|
|
1242
1240
|
previewSrcList: u
|
|
1243
1241
|
} = e;
|
|
1244
1242
|
return Array.isArray(u) && u.length > 0;
|
|
1245
|
-
}), W =
|
|
1243
|
+
}), W = L(() => {
|
|
1246
1244
|
const {
|
|
1247
1245
|
src: u,
|
|
1248
|
-
previewSrcList:
|
|
1249
|
-
initialIndex:
|
|
1246
|
+
previewSrcList: M,
|
|
1247
|
+
initialIndex: g
|
|
1250
1248
|
} = e;
|
|
1251
|
-
if (
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1249
|
+
if (g || g === 0) return M.length >= g ? g : 0;
|
|
1250
|
+
let B = 0;
|
|
1251
|
+
const V = M.indexOf(u);
|
|
1252
|
+
return V >= 0 && (B = V), B;
|
|
1253
|
+
}), m = (u) => {
|
|
1254
|
+
c.value = e.src, p.value = !1, S.value = !1, n("load", u);
|
|
1255
|
+
}, J = (u) => {
|
|
1256
|
+
p.value = !1, S.value = !0, n("error", u);
|
|
1257
|
+
}, G = () => {
|
|
1258
|
+
if (q) return;
|
|
1259
|
+
p.value = !0, S.value = !1;
|
|
1260
1260
|
const u = new Image();
|
|
1261
|
-
u.onload = (
|
|
1262
|
-
if (
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
u.setAttribute(b, T);
|
|
1261
|
+
u.onload = (M) => m(M), u.onerror = J, Object.keys(a || {}).forEach((M) => {
|
|
1262
|
+
if (M.toLowerCase() === "onload") return;
|
|
1263
|
+
const g = (a || {})[M];
|
|
1264
|
+
u.setAttribute(M, g);
|
|
1266
1265
|
}), u.src = e.src;
|
|
1266
|
+
}, K = mt(te, 200), ee = () => {
|
|
1267
|
+
q || !x.value || !K || (z(), x.value = void 0);
|
|
1267
1268
|
};
|
|
1268
|
-
function
|
|
1269
|
-
|
|
1269
|
+
function te() {
|
|
1270
|
+
lt(k.value, x.value) && (G(), ee());
|
|
1270
1271
|
}
|
|
1271
|
-
const
|
|
1272
|
-
if (
|
|
1273
|
-
return;
|
|
1272
|
+
const ne = async () => {
|
|
1273
|
+
if (q) return;
|
|
1274
1274
|
await Ye();
|
|
1275
1275
|
const {
|
|
1276
1276
|
scrollContainer: u
|
|
1277
1277
|
} = e;
|
|
1278
|
-
|
|
1279
|
-
}, te = () => {
|
|
1280
|
-
Q || !x.value || !K || (O(), x.value = void 0);
|
|
1281
|
-
}, fe = (u) => {
|
|
1282
|
-
f.value = e.src, m.value = !1, S.value = !1, n("load", u);
|
|
1278
|
+
Vt(u) ? x.value = u : ut(u) && u !== "" ? x.value = document.querySelector(u) ?? void 0 : k.value && (x.value = ct(k.value)), x.value && (z = Ee(x, "scroll", K), setTimeout(() => te(), 200));
|
|
1283
1279
|
}, de = (u) => {
|
|
1284
|
-
m.value = !1, S.value = !0, n("error", u);
|
|
1285
|
-
}, he = (u) => {
|
|
1286
1280
|
if (u.ctrlKey) {
|
|
1287
1281
|
if (u.deltaY < 0)
|
|
1288
1282
|
return u.preventDefault(), !1;
|
|
1289
1283
|
if (u.deltaY > 0)
|
|
1290
1284
|
return u.preventDefault(), !1;
|
|
1291
1285
|
}
|
|
1292
|
-
},
|
|
1293
|
-
!
|
|
1286
|
+
}, he = () => {
|
|
1287
|
+
!F.value || e.disablePreview || (h = Ee("wheel", de, {
|
|
1294
1288
|
passive: !1
|
|
1295
|
-
}), Be = document.body.style.overflow, document.body.style.overflow = "hidden",
|
|
1296
|
-
},
|
|
1297
|
-
|
|
1289
|
+
}), Be = document.body.style.overflow, document.body.style.overflow = "hidden", $.value = !0);
|
|
1290
|
+
}, ae = () => {
|
|
1291
|
+
h == null || h(), document.body.style.overflow = Be, $.value = !1;
|
|
1298
1292
|
};
|
|
1299
|
-
|
|
1300
|
-
e.lazy ? (
|
|
1293
|
+
_(() => e.src, () => {
|
|
1294
|
+
e.lazy ? (p.value = !0, S.value = !1, ee(), ne()) : G();
|
|
1301
1295
|
});
|
|
1302
|
-
const
|
|
1303
|
-
return
|
|
1304
|
-
e.lazy ?
|
|
1296
|
+
const j = (u) => ft(u) ? u + "px" : u;
|
|
1297
|
+
return dt(() => {
|
|
1298
|
+
e.lazy ? ne() : G();
|
|
1305
1299
|
}), () => {
|
|
1306
1300
|
const {
|
|
1307
1301
|
crossorigin: u,
|
|
1308
|
-
decoding:
|
|
1309
|
-
alt:
|
|
1310
|
-
sizes:
|
|
1302
|
+
decoding: M,
|
|
1303
|
+
alt: g,
|
|
1304
|
+
sizes: B,
|
|
1311
1305
|
srcset: V,
|
|
1312
|
-
usemap:
|
|
1313
|
-
class:
|
|
1314
|
-
style:
|
|
1306
|
+
usemap: ge,
|
|
1307
|
+
class: U,
|
|
1308
|
+
style: ve = {}
|
|
1315
1309
|
} = a, me = {
|
|
1316
1310
|
crossorigin: u,
|
|
1317
|
-
decoding:
|
|
1318
|
-
alt:
|
|
1319
|
-
sizes:
|
|
1311
|
+
decoding: M,
|
|
1312
|
+
alt: g,
|
|
1313
|
+
sizes: B,
|
|
1320
1314
|
srcset: V,
|
|
1321
|
-
usemap:
|
|
1315
|
+
usemap: ge,
|
|
1322
1316
|
style: {
|
|
1323
|
-
...
|
|
1324
|
-
height: e.height ?
|
|
1317
|
+
...P.value,
|
|
1318
|
+
height: e.height ? j(e.height) : void 0
|
|
1325
1319
|
}
|
|
1326
|
-
},
|
|
1320
|
+
}, ie = Le(t, e, "fallback"), re = Le(t, e, "placeholder");
|
|
1327
1321
|
return Qe(() => {
|
|
1328
|
-
var
|
|
1329
|
-
|
|
1330
|
-
}), r(
|
|
1322
|
+
var E, Z;
|
|
1323
|
+
F.value && $.value ? (E = l.value) == null || E.setOpen(!0) : (Z = l.value) == null || Z.setOpen(!1);
|
|
1324
|
+
}), r(f("div", {
|
|
1331
1325
|
class: {
|
|
1332
1326
|
[`${o.value}`]: !0,
|
|
1333
1327
|
[`${i}`]: !0,
|
|
1334
|
-
[`${
|
|
1328
|
+
[`${U}`]: !!U
|
|
1335
1329
|
},
|
|
1336
|
-
ref: (
|
|
1330
|
+
ref: (E) => k.value = E,
|
|
1337
1331
|
style: {
|
|
1338
|
-
width: e.width ?
|
|
1339
|
-
height: e.height ?
|
|
1332
|
+
width: e.width ? j(e.width) : void 0,
|
|
1333
|
+
height: e.height ? j(e.height) : void 0,
|
|
1340
1334
|
display: e.lazy ? "block" : void 0,
|
|
1341
|
-
...
|
|
1335
|
+
...ve
|
|
1342
1336
|
},
|
|
1343
1337
|
onClick: () => {
|
|
1344
1338
|
n("click");
|
|
1345
1339
|
}
|
|
1346
|
-
}, [
|
|
1340
|
+
}, [p.value ? re || f("div", {
|
|
1347
1341
|
class: `${i}-placeholder ${o.value}`
|
|
1348
|
-
}, null) : S.value ?
|
|
1342
|
+
}, null) : S.value ? ie || f("div", {
|
|
1349
1343
|
class: `${i}-error ${o.value}`
|
|
1350
|
-
}, [
|
|
1344
|
+
}, [Je("加载失败")]) : c.value && f("img", We(me, {
|
|
1351
1345
|
class: {
|
|
1352
1346
|
[`${o.value}`]: !0,
|
|
1353
1347
|
[`${e.imageClassName}`]: !!e.imageClassName,
|
|
1354
1348
|
[`${i}-inner`]: !0,
|
|
1355
|
-
[`${i}-preview`]:
|
|
1349
|
+
[`${i}-preview`]: F.value
|
|
1356
1350
|
},
|
|
1357
1351
|
alt: e.alt,
|
|
1358
|
-
src:
|
|
1359
|
-
onClick: () =>
|
|
1360
|
-
}), null),
|
|
1352
|
+
src: c.value,
|
|
1353
|
+
onClick: () => he()
|
|
1354
|
+
}), null), f(jt, {
|
|
1361
1355
|
ref: l,
|
|
1362
1356
|
zIndex: e.zIndex,
|
|
1363
1357
|
infinite: e.infinite,
|
|
@@ -1365,17 +1359,17 @@ const ue = /* @__PURE__ */ Ve({
|
|
|
1365
1359
|
urlList: e.previewSrcList,
|
|
1366
1360
|
getContainer: e.getContainer,
|
|
1367
1361
|
onHideOnClickModal: e.hideOnClickModal,
|
|
1368
|
-
onClose: () =>
|
|
1369
|
-
}, null)])
|
|
1362
|
+
onClose: () => ae()
|
|
1363
|
+
}, null)]));
|
|
1370
1364
|
};
|
|
1371
1365
|
}
|
|
1372
1366
|
});
|
|
1373
|
-
|
|
1374
|
-
|
|
1367
|
+
ce.isWImage = !0;
|
|
1368
|
+
ce.install = (e) => (e.component(ce.name, ce), e);
|
|
1375
1369
|
export {
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1370
|
+
ce as GImage,
|
|
1371
|
+
jt as ImageViewer,
|
|
1372
|
+
ce as default,
|
|
1373
|
+
ue as gImagePorps,
|
|
1374
|
+
pt as gImageViewProps
|
|
1381
1375
|
};
|