@gx-design-vue/image 0.2.0-beta.1 → 0.2.0-beta.2
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.mjs +20 -20
- package/dist/image.umd.js +1 -1
- package/package.json +2 -2
package/dist/image.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed as M, isRef as et, createVNode as c, defineComponent as _e, shallowRef as ze, ref as x, watch as ue, nextTick as Ue, Teleport as tt, Transition as Oe, withDirectives as Le, vShow as Ne, mergeProps as Ze, cloneVNode as nt, watchEffect as at, Fragment as rt, createTextVNode as it } from "vue";
|
|
2
2
|
import { ExpandOutlined as ot, OneToOneOutlined as st, CloseOutlined as lt, ZoomInOutlined as ut, ZoomOutOutlined as ct, RotateRightOutlined as ft, RotateLeftOutlined as dt, LeftOutlined as ht, RightOutlined as gt } from "@ant-design/icons-vue";
|
|
3
|
-
import { getPrefixCls as
|
|
3
|
+
import { getPrefixCls as J, isServer as q, getSlotVNode as De, isInContainer as vt, isString as pt, getScrollContainer as mt, isNumber as bt } from "@gx-design-vue/pro-utils";
|
|
4
4
|
import { useState as Ee, onMountedOrActivated as Xe } from "@gx-design-vue/pro-hooks";
|
|
5
5
|
import { useStyleRegister as Re, theme as yt } from "ant-design-vue";
|
|
6
6
|
import { createTypes as wt } from "vue-types";
|
|
@@ -108,9 +108,9 @@ const Fe = (e, t = {}) => e ? {
|
|
|
108
108
|
leaveToClass: `${e}-leave ${e}-leave-active`,
|
|
109
109
|
...t
|
|
110
110
|
} : { css: !1, ...t }, { useToken: At } = yt;
|
|
111
|
-
function
|
|
111
|
+
function Je(e, t) {
|
|
112
112
|
return (n) => {
|
|
113
|
-
const a =
|
|
113
|
+
const a = J({}), r = M(() => et(n) ? n == null ? void 0 : n.value : n || a), { token: i, hashId: o, theme: l } = At(), u = M(() => J({})), p = M(() => ({
|
|
114
114
|
theme: l.value,
|
|
115
115
|
token: i.value,
|
|
116
116
|
hashId: o.value,
|
|
@@ -132,7 +132,7 @@ function Qe(e, t) {
|
|
|
132
132
|
const { token: z, flush: C } = Ct(i.value), m = `.${r.value}`, A = Te(z, {
|
|
133
133
|
antCls: ".ant",
|
|
134
134
|
componentCls: m,
|
|
135
|
-
proComponentsCls:
|
|
135
|
+
proComponentsCls: J({
|
|
136
136
|
isPor: !0
|
|
137
137
|
})
|
|
138
138
|
}), d = t(A, {
|
|
@@ -159,7 +159,7 @@ function kt(e) {
|
|
|
159
159
|
function Tt(e) {
|
|
160
160
|
return typeof e == "string" && e.indexOf("%") !== -1;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function Qe(e) {
|
|
163
163
|
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
|
|
164
164
|
}
|
|
165
165
|
function se(e) {
|
|
@@ -421,7 +421,7 @@ var ke = {
|
|
|
421
421
|
};
|
|
422
422
|
function Et(e) {
|
|
423
423
|
var t = { r: 0, g: 0, b: 0 }, n = 1, a = null, r = null, i = null, o = !1, l = !1;
|
|
424
|
-
return typeof e == "string" && (e = Ft(e)), typeof e == "object" && (O(e.r) && O(e.g) && O(e.b) ? (t = $t(e.r, e.g, e.b), o = !0, l = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : O(e.h) && O(e.s) && O(e.v) ? (a = se(e.s), r = se(e.v), t = Ot(e.h, a, r), o = !0, l = "hsv") : O(e.h) && O(e.s) && O(e.l) && (a = se(e.s), i = se(e.l), t = zt(e.h, a, i), o = !0, l = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a)), n =
|
|
424
|
+
return typeof e == "string" && (e = Ft(e)), typeof e == "object" && (O(e.r) && O(e.g) && O(e.b) ? (t = $t(e.r, e.g, e.b), o = !0, l = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : O(e.h) && O(e.s) && O(e.v) ? (a = se(e.s), r = se(e.v), t = Ot(e.h, a, r), o = !0, l = "hsv") : O(e.h) && O(e.s) && O(e.l) && (a = se(e.s), i = se(e.l), t = zt(e.h, a, i), o = !0, l = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a)), n = Qe(n), {
|
|
425
425
|
ok: o,
|
|
426
426
|
format: e.format || l,
|
|
427
427
|
r: Math.min(255, Math.max(t.r, 0)),
|
|
@@ -479,7 +479,7 @@ function Ft(e) {
|
|
|
479
479
|
function O(e) {
|
|
480
480
|
return !!k.CSS_UNIT.exec(String(e));
|
|
481
481
|
}
|
|
482
|
-
var
|
|
482
|
+
var Q = (
|
|
483
483
|
/** @class */
|
|
484
484
|
function() {
|
|
485
485
|
function e(t, n) {
|
|
@@ -504,7 +504,7 @@ var J = (
|
|
|
504
504
|
}, e.prototype.getAlpha = function() {
|
|
505
505
|
return this.a;
|
|
506
506
|
}, e.prototype.setAlpha = function(t) {
|
|
507
|
-
return this.a =
|
|
507
|
+
return this.a = Qe(t), this.roundA = Math.round(100 * this.a) / 100, this;
|
|
508
508
|
}, e.prototype.isMonochrome = function() {
|
|
509
509
|
var t = this.toHsl().s;
|
|
510
510
|
return t === 0;
|
|
@@ -706,7 +706,7 @@ const Yt = (e) => ({
|
|
|
706
706
|
listStyle: "none",
|
|
707
707
|
fontFamily: e.fontFamily
|
|
708
708
|
}), Wt = (e) => {
|
|
709
|
-
const { componentCls: t, modalMaskBg: n, paddingSM: a, previewOperationColorDisabled: r, motionDurationSlow: i } = e, o = new
|
|
709
|
+
const { componentCls: t, modalMaskBg: n, paddingSM: a, previewOperationColorDisabled: r, motionDurationSlow: i } = e, o = new Q(n).setAlpha(0.1), l = o.clone().setAlpha(0.2);
|
|
710
710
|
return {
|
|
711
711
|
[`${t}-operations`]: {
|
|
712
712
|
...Yt(e),
|
|
@@ -745,7 +745,7 @@ const Yt = (e) => ({
|
|
|
745
745
|
}
|
|
746
746
|
};
|
|
747
747
|
}, Gt = (e) => {
|
|
748
|
-
const { modalMaskBg: t, previewOperationColorDisabled: n, zIndexPopup: a, motionDurationSlow: r } = e, i = new
|
|
748
|
+
const { modalMaskBg: t, previewOperationColorDisabled: n, zIndexPopup: a, motionDurationSlow: r } = e, i = new Q(t).setAlpha(0.1), o = i.clone().setAlpha(0.2);
|
|
749
749
|
return {
|
|
750
750
|
[`${e.componentCls}-switch-left, ${e.componentCls}-switch-right`]: {
|
|
751
751
|
position: "fixed",
|
|
@@ -885,12 +885,12 @@ const Yt = (e) => ({
|
|
|
885
885
|
width: "100%"
|
|
886
886
|
},
|
|
887
887
|
"&": [Wt(e), Gt(e)]
|
|
888
|
-
}), Ut =
|
|
888
|
+
}), Ut = Je("ImageView", (e) => {
|
|
889
889
|
const t = Te(e, {
|
|
890
890
|
zIndexPopup: e.zIndexPopupBase + 80,
|
|
891
|
-
previewOperationColorDisabled: new
|
|
892
|
-
modalMaskBg: new
|
|
893
|
-
previewOperationColor: new
|
|
891
|
+
previewOperationColorDisabled: new Q(e.colorTextLightSolid).setAlpha(0.25).toRgbString(),
|
|
892
|
+
modalMaskBg: new Q("#000").setAlpha(0.45).toRgbString(),
|
|
893
|
+
previewOperationColor: new Q(e.colorTextLightSolid).toRgbString(),
|
|
894
894
|
previewOperationSize: e.fontSizeIcon * 1.5,
|
|
895
895
|
imagePreviewSwitchSize: e.controlHeightLG,
|
|
896
896
|
iconCls: "anticon"
|
|
@@ -1054,7 +1054,7 @@ const qt = /* @__PURE__ */ _e({
|
|
|
1054
1054
|
}) {
|
|
1055
1055
|
var re, ie, R, Z, $e;
|
|
1056
1056
|
let a = null, r = null, i = null;
|
|
1057
|
-
const o =
|
|
1057
|
+
const o = J({
|
|
1058
1058
|
suffixCls: "image-viewer"
|
|
1059
1059
|
}), [l, u] = Ut(o), p = ze(!1), [v, z] = Ee(!1), [C, m] = Ee(!1), A = x(!0), d = x(e.initialIndex), Y = x(null), P = x(null), W = x(X.CONTAIN), h = x({
|
|
1060
1060
|
scale: 1,
|
|
@@ -1309,7 +1309,7 @@ const qt = /* @__PURE__ */ _e({
|
|
|
1309
1309
|
}), Ce = {
|
|
1310
1310
|
width: "100%",
|
|
1311
1311
|
height: "100%"
|
|
1312
|
-
},
|
|
1312
|
+
}, Jt = (e) => ({
|
|
1313
1313
|
[e.componentCls]: {
|
|
1314
1314
|
display: "inline-block",
|
|
1315
1315
|
position: "relative",
|
|
@@ -1339,9 +1339,9 @@ const qt = /* @__PURE__ */ _e({
|
|
|
1339
1339
|
cursor: "pointer"
|
|
1340
1340
|
}
|
|
1341
1341
|
}
|
|
1342
|
-
}),
|
|
1342
|
+
}), Qt = Je("Image", (e) => {
|
|
1343
1343
|
const t = Te(e);
|
|
1344
|
-
return [
|
|
1344
|
+
return [Jt(t)];
|
|
1345
1345
|
}), Kt = (e) => e && e.nodeType === Node.ELEMENT_NODE;
|
|
1346
1346
|
let Ge = "";
|
|
1347
1347
|
const fe = /* @__PURE__ */ _e({
|
|
@@ -1353,9 +1353,9 @@ const fe = /* @__PURE__ */ _e({
|
|
|
1353
1353
|
emit: n,
|
|
1354
1354
|
attrs: a
|
|
1355
1355
|
}) {
|
|
1356
|
-
const r =
|
|
1356
|
+
const r = J({
|
|
1357
1357
|
suffixCls: "image"
|
|
1358
|
-
}), [i, o] =
|
|
1358
|
+
}), [i, o] = Qt(r), l = x(), u = x(""), p = x(!1), v = x(!0), z = x(!1), C = x(null), m = x();
|
|
1359
1359
|
let A, d;
|
|
1360
1360
|
const Y = M(() => !q && e.fit ? {
|
|
1361
1361
|
"object-fit": e.fit
|
package/dist/image.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(function(p,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue"),require("@ant-design/icons-vue"),require("@gx-design-vue/pro-utils"),require("@gx-design-vue/pro-hooks"),require("ant-design-vue"),require("vue-types"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue","@ant-design/icons-vue","@gx-design-vue/pro-utils","@gx-design-vue/pro-hooks","ant-design-vue","vue-types","@vueuse/core"],i):(p=typeof globalThis<"u"?globalThis:p||self,i(p.GImage={},p.vue,p.iconsVue,p.proUtils,p.proHooks,p.antDesignVue,p.vueTypes,p.core))})(this,function(p,i,$,v,U,de,We,he){"use strict";const Ge=(e,t)=>{const{fontFamily:n,fontSize:a}=e,r=`[class^="${t}"], [class*=" ${t}"]`;return{[r]:{fontFamily:n,fontSize:a,boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"},[r]:{boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}}}}},_e=e=>({a:{color:e.colorLink,textDecoration:e.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${e.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive},[`&:active,
|
|
2
|
-
&:hover`]:{textDecoration:e.linkHoverDecoration,outline:0},"&:focus":{textDecoration:e.linkFocusDecoration,outline:0},"&[disabled]":{color:e.colorTextDisabled,cursor:"not-allowed"}}}),$e=process.env.NODE_ENV!=="production"||typeof CSSINJS_STATISTIC<"u";let ge=!0;function ve(...e){if(!$e)return Object.assign({},...e);ge=!1;const t={};return e.forEach(n=>{Object.keys(n).forEach(a=>{Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:()=>n[a]})})}),ge=!0,t}function qe(){}function Ze(e){let t,n=e,a=qe;return $e&&(t=new Set,n=new Proxy(e,{get(r,o){return ge&&t.add(o),r[o]}}),a=(r,o)=>{Array.from(t)}),{token:n,keys:t,flush:a}}class ee{constructor(t,n){this._keyframe=!0,this.name=t,this.style=n}getName(t=""){return t?`${t}-${this.name}`:this.name}}const ze=(e,t={})=>e?{name:e,appear:!0,enterFromClass:`${e}-enter ${e}-enter-prepare ${e}-enter-start`,enterActiveClass:`${e}-enter ${e}-enter-prepare`,enterToClass:`${e}-enter ${e}-enter-active`,leaveFromClass:` ${e}-leave`,leaveActiveClass:`${e}-leave ${e}-leave-active`,leaveToClass:`${e}-leave ${e}-leave-active`,...t}:{css:!1,...t},{useToken:Xe}=de.theme;function Oe(e,t){return n=>{const a=v.getPrefixCls({}),r=i.computed(()=>i.isRef(n)?n==null?void 0:n.value:n||a),{token:o,hashId:s,theme:c}=Xe(),u=i.computed(()=>v.getPrefixCls({})),b=i.computed(()=>({theme:c.value,token:o.value,hashId:s.value,path:["Shared",u.value]}));de.useStyleRegister(b,()=>[{"&":_e(o.value)}]);const m=i.computed(()=>({theme:c.value,token:o.value,hashId:s.value,path:[e,r.value]}));return[de.useStyleRegister(m,()=>{const{token:O,flush:A}=Ze(o.value),y=`.${r.value}`,N=ve(O,{antCls:".ant",componentCls:y,proComponentsCls:v.getPrefixCls({isPor:!0})}),d=t(N,{hashId:s.value,prefixCls:r.value});return A(e,{}),[Ge(o.value,r.value),d]}),s]}}function g(e,t){Qe(e)&&(e="100%");var n=Je(e);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)}function te(e){return Math.min(1,Math.max(0,e))}function Qe(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Je(e){return typeof e=="string"&&e.indexOf("%")!==-1}function Le(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ne(e){return e<=1?"".concat(Number(e)*100,"%"):e}function E(e){return e.length===1?"0"+e:String(e)}function Ke(e,t,n){return{r:g(e,255)*255,g:g(t,255)*255,b:g(n,255)*255}}function De(e,t,n){e=g(e,255),t=g(t,255),n=g(n,255);var a=Math.max(e,t,n),r=Math.min(e,t,n),o=0,s=0,c=(a+r)/2;if(a===r)s=0,o=0;else{var u=a-r;switch(s=c>.5?u/(2-a-r):u/(a+r),a){case e:o=(t-n)/u+(t<n?6:0);break;case t:o=(n-e)/u+2;break;case n:o=(e-t)/u+4;break}o/=6}return{h:o,s,l:c}}function pe(e,t,n){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}function Ue(e,t,n){var a,r,o;if(e=g(e,360),t=g(t,100),n=g(n,100),t===0)r=n,o=n,a=n;else{var s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;a=pe(c,s,e+1/3),r=pe(c,s,e),o=pe(c,s,e-1/3)}return{r:a*255,g:r*255,b:o*255}}function Ee(e,t,n){e=g(e,255),t=g(t,255),n=g(n,255);var a=Math.max(e,t,n),r=Math.min(e,t,n),o=0,s=a,c=a-r,u=a===0?0:c/a;if(a===r)o=0;else{switch(a){case e:o=(t-n)/c+(t<n?6:0);break;case t:o=(n-e)/c+2;break;case n:o=(e-t)/c+4;break}o/=6}return{h:o,s:u,v:s}}function et(e,t,n){e=g(e,360)*6,t=g(t,100),n=g(n,100);var a=Math.floor(e),r=e-a,o=n*(1-t),s=n*(1-r*t),c=n*(1-(1-r)*t),u=a%6,b=[n,s,o,o,c,n][u],m=[c,n,n,s,o,o][u],O=[o,o,c,n,n,s][u];return{r:b*255,g:m*255,b:O*255}}function Re(e,t,n,a){var r=[E(Math.round(e).toString(16)),E(Math.round(t).toString(16)),E(Math.round(n).toString(16))];return a&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function tt(e,t,n,a,r){var o=[E(Math.round(e).toString(16)),E(Math.round(t).toString(16)),E(Math.round(n).toString(16)),E(nt(a))];return r&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function nt(e){return Math.round(parseFloat(e)*255).toString(16)}function Pe(e){return S(e)/255}function S(e){return parseInt(e,16)}function at(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var me={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function rt(e){var t={r:0,g:0,b:0},n=1,a=null,r=null,o=null,s=!1,c=!1;return typeof e=="string"&&(e=st(e)),typeof e=="object"&&(z(e.r)&&z(e.g)&&z(e.b)?(t=Ke(e.r,e.g,e.b),s=!0,c=String(e.r).substr(-1)==="%"?"prgb":"rgb"):z(e.h)&&z(e.s)&&z(e.v)?(a=ne(e.s),r=ne(e.v),t=et(e.h,a,r),s=!0,c="hsv"):z(e.h)&&z(e.s)&&z(e.l)&&(a=ne(e.s),o=ne(e.l),t=Ue(e.h,a,o),s=!0,c="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=Le(n),{ok:s,format:e.format||c,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var it="[-\\+]?\\d+%?",ot="[-\\+]?\\d*\\.\\d+%?",L="(?:".concat(ot,")|(?:").concat(it,")"),be="[\\s|\\(]+(".concat(L,")[,|\\s]+(").concat(L,")[,|\\s]+(").concat(L,")\\s*\\)?"),ye="[\\s|\\(]+(".concat(L,")[,|\\s]+(").concat(L,")[,|\\s]+(").concat(L,")[,|\\s]+(").concat(L,")\\s*\\)?"),C={CSS_UNIT:new RegExp(L),rgb:new RegExp("rgb"+be),rgba:new RegExp("rgba"+ye),hsl:new RegExp("hsl"+be),hsla:new RegExp("hsla"+ye),hsv:new RegExp("hsv"+be),hsva:new RegExp("hsva"+ye),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function st(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(me[e])e=me[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=C.rgb.exec(e);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?{r:S(n[1]),g:S(n[2]),b:S(n[3]),a:Pe(n[4]),format:t?"name":"hex8"}:(n=C.hex6.exec(e),n?{r:S(n[1]),g:S(n[2]),b:S(n[3]),format:t?"name":"hex"}:(n=C.hex4.exec(e),n?{r:S(n[1]+n[1]),g:S(n[2]+n[2]),b:S(n[3]+n[3]),a:Pe(n[4]+n[4]),format:t?"name":"hex8"}:(n=C.hex3.exec(e),n?{r:S(n[1]+n[1]),g:S(n[2]+n[2]),b:S(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function z(e){return!!C.CSS_UNIT.exec(String(e))}var G=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var a;if(t instanceof e)return t;typeof t=="number"&&(t=at(t)),this.originalInput=t;var r=rt(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(a=n.format)!==null&&a!==void 0?a:r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,a,r,o=t.r/255,s=t.g/255,c=t.b/255;return o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),s<=.03928?a=s/12.92:a=Math.pow((s+.055)/1.055,2.4),c<=.03928?r=c/12.92:r=Math.pow((c+.055)/1.055,2.4),.2126*n+.7152*a+.0722*r},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=Le(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=Ee(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=Ee(this.r,this.g,this.b),n=Math.round(t.h*360),a=Math.round(t.s*100),r=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(a,"%, ").concat(r,"%)"):"hsva(".concat(n,", ").concat(a,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=De(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=De(this.r,this.g,this.b),n=Math.round(t.h*360),a=Math.round(t.s*100),r=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(a,"%, ").concat(r,"%)"):"hsla(".concat(n,", ").concat(a,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),Re(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),tt(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),a=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(a,")"):"rgba(".concat(t,", ").concat(n,", ").concat(a,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(g(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(g(n,255)*100)};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,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+Re(this.r,this.g,this.b,!1),n=0,a=Object.entries(me);n<a.length;n++){var r=a[n],o=r[0],s=r[1];if(t===s)return o}return!1},e.prototype.toString=function(t){var n=!!t;t=t??this.format;var a=!1,r=this.a<1&&this.a>=0,o=!n&&r&&(t.startsWith("hex")||t==="name");return o?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())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=te(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=te(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=te(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=te(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),a=(n.h+t)%360;return n.h=a<0?360+a:a,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var a=this.toRgb(),r=new e(t).toRgb(),o=n/100,s={r:(r.r-a.r)*o+a.r,g:(r.g-a.g)*o+a.g,b:(r.b-a.b)*o+a.b,a:(r.a-a.a)*o+a.a};return new e(s)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var a=this.toHsl(),r=360/n,o=[this];for(a.h=(a.h-(r*t>>1)+720)%360;--t;)a.h=(a.h+r)%360,o.push(new e(a));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),a=n.h,r=n.s,o=n.v,s=[],c=1/t;t--;)s.push(new e({h:a,s:r,v:o})),o=(o+c)%1;return s},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),a=new e(t).toRgb();return new e({r:a.r+(n.r-a.r)*n.a,g:a.g+(n.g-a.g)*n.a,b:a.b+(n.b-a.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),a=n.h,r=[this],o=360/t,s=1;s<t;s++)r.push(new e({h:(a+s*o)%360,s:n.s,l:n.l}));return r},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();const lt=new ee("viewFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),ct=new ee("viewFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),ut=new ee("viewZoomBadgeIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),ft=new ee("viewZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),He=e=>({position:e||"absolute",inset:0});function we(e){return{position:e,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0}}const dt=e=>({boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none",fontFamily:e.fontFamily}),ht=e=>{const{componentCls:t,modalMaskBg:n,paddingSM:a,previewOperationColorDisabled:r,motionDurationSlow:o}=e,s=new G(n).setAlpha(.1),c=s.clone().setAlpha(.2);return{[`${t}-operations`]:{...dt(e),display:"flex",flexDirection:"row-reverse",alignItems:"center",color:e.previewOperationColor,listStyle:"none",background:s.toRgbString(),pointerEvents:"auto","&-operation":{marginInlineStart:a,padding:a,cursor:"pointer",transition:`all ${o}`,userSelect:"none","&:hover":{background:c.toRgbString()},"&-disabled":{color:r,pointerEvents:"none"},"&:last-of-type":{marginInlineStart:0}},"&-progress":{position:"absolute",left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%)"},"&-icon":{fontSize:e.previewOperationSize}}}},gt=e=>{const{modalMaskBg:t,previewOperationColorDisabled:n,zIndexPopup:a,motionDurationSlow:r}=e,o=new G(t).setAlpha(.1),s=o.clone().setAlpha(.2);return{[`${e.componentCls}-switch-left, ${e.componentCls}-switch-right`]:{position:"fixed",insetBlockStart:"50%",zIndex:a+1,display:"flex",alignItems:"center",justifyContent:"center",width:e.imagePreviewSwitchSize,height:e.imagePreviewSwitchSize,marginTop:-e.imagePreviewSwitchSize/2,color:e.previewOperationColor,background:o.toRgbString(),borderRadius:"50%",transform:"translateY(-50%)",cursor:"pointer",transition:`all ${r}`,pointerEvents:"auto",userSelect:"none","&:hover":{background:s.toRgbString()},["&-disabled"]:{"&, &:hover":{color:n,background:"transparent",cursor:"not-allowed",[`> ${e.iconCls}`]:{cursor:"not-allowed"}}},[`> ${e.iconCls}`]:{fontSize:e.previewOperationSize}},[`${e.componentCls}-switch-left`]:{insetInlineStart:e.marginSM},[`${e.componentCls}-switch-right`]:{insetInlineEnd:e.marginSM}}},vt=e=>({[e.componentCls]:{["&-root"]:{...we("fixed"),zIndex:e.zIndexPopup,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"},["&-wrapper"]:{...we("fixed"),zIndex:e.zIndexPopup,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"},["&-mask"]:{...we("fixed"),zIndex:e.zIndexPopupBase,height:"100%",backgroundColor:e.colorBgMask},["&-block"]:{height:"100%",textAlign:"center",pointerEvents:"none"},["&-body"]:{...He(),overflow:"hidden"},["&-canvas"]:{...He(),display:"flex",justifyContent:"center",alignItems:"center","&::before":{display:"inline-block",width:1,height:"50%",marginInlineEnd:-1,content:'""'}},["&-img"]:{maxWidth:"100%",maxHeight:"100%",verticalAlign:"middle",transform:"scale3d(1, 1, 1)",cursor:"grab",transition:`transform ${e.motionDurationSlow} ${e.motionEaseOut} 0s`,userSelect:"none",pointerEvents:"auto"},["&-fade-appear, &-fade-enter"]:{animationName:lt,animationDuration:e.motionDurationSlow,animationTimingFunction:"linear"},["&-fade-leave"]:{animationName:ct,animationDuration:e.motionDurationSlow,animationTimingFunction:"linear"},["&-zoom-appear, &-zoom-enter"]:{animationName:ut,opacity:0,animationTimingFunction:e.motionEaseOutCirc,animationFillMode:"both",transform:"none",animationDuration:e.motionDurationSlow,userSelect:"none"},["&-zoom-enter-active"]:{animationPlayState:"running"},["&-zoom-leave"]:{animationName:ft,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"}},[`${e.componentCls}-root`]:{[`${e.componentCls}-wrapper`]:{zIndex:e.zIndexPopup}},[`${e.componentCls}-operations-wrapper`]:{position:"fixed",insetBlockStart:0,insetInlineEnd:0,zIndex:e.zIndexPopup+1,width:"100%"},"&":[ht(e),gt(e)]}),pt=Oe("ImageView",e=>{const t=ve(e,{zIndexPopup:e.zIndexPopupBase+80,previewOperationColorDisabled:new G(e.colorTextLightSolid).setAlpha(.25).toRgbString(),modalMaskBg:new G("#000").setAlpha(.45).toRgbString(),previewOperationColor:new G(e.colorTextLightSolid).toRgbString(),previewOperationSize:e.fontSizeIcon*1.5,imagePreviewSwitchSize:e.controlHeightLG,iconCls:"anticon"});return[vt(t)]}),Fe=We.createTypes({func:void 0,bool:void 0,string:void 0,number:void 0,array:void 0,object:void 0,integer:void 0});Fe.extend([{name:"looseBool",getter:!0,type:Boolean,default:void 0},{name:"style",getter:!0,type:[String,Object],default:void 0},{name:"VueNode",getter:!0,type:null}]);const j=Fe,R={infinite:{type:Boolean,default:!0},zIndex:{type:Number,default:2e3},initialIndex:{type:Number,default:0},getContainer:{type:String}},ae={previewTeleported:{type:Boolean,default:!0},hideOnClickModal:{type:Boolean,default:!0},wrapperClassName:String,wrapperStyle:{type:Object,default:void 0},src:{type:String,default:""},alt:{type:String,default:""},fit:{type:String,default:"contain"},lazy:j.bool,scrollContainer:{type:[String,Object]},placeholder:{type:[Function,Object],default:()=>{}},fallback:{type:[Function,Object],default:()=>{}},onLoad:{type:Function},onError:{type:Function},onClick:{type:Function},disablePreview:j.bool,previewSrcList:{type:Array,default:()=>[]},imageClassName:j.string,imageStyle:j.style,width:j.number,height:j.number,zIndex:R.zIndex,infinite:R.infinite,getContainer:R.getContainer,initialIndex:R.initialIndex},mt={urlList:{type:Array,default:()=>[]},teleported:ae.previewTeleported,zIndex:R.zIndex,initialIndex:R.initialIndex,infinite:R.infinite,getContainer:ae.getContainer,onHideOnClickModal:ae.hideOnClickModal,icons:{type:Object,default:()=>({})}},V={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace"},re=function(e,t,n,a=!1){e&&t&&n&&e.addEventListener(t,n,a)},Se=function(e,t,n,a=!1){e&&t&&n&&e.removeEventListener(t,n,a)},_={CONTAIN:{name:"contain",icon:i.createVNode($.ExpandOutlined,null,null)},ORIGINAL:{name:"original",icon:i.createVNode($.OneToOneOutlined,null,null)}},je=function(){return!v.isServer&&!!window.navigator.userAgent.match(/firefox/i)}()?"DOMMouseScroll":"mousewheel";function xe(e){let t=!1;return function(...n){t||(t=!0,window.requestAnimationFrame(()=>{e.apply(this,n),t=!1}))}}const Ve=i.defineComponent({props:mt,emits:["close","switch"],setup:function(e,{emit:t,expose:n}){var ue,fe,F,K,Ye;let a=null,r=null,o=null;const s=v.getPrefixCls({suffixCls:"image-viewer"}),[c,u]=pt(s),b=i.shallowRef(!1),[m,O]=U.useState(!1),[A,y]=U.useState(!1),N=i.ref(!0),d=i.ref(e.initialIndex),q=i.ref(null),Y=i.ref(null),Z=i.ref(_.CONTAIN),h=i.ref({scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}),X=i.computed(()=>e.urlList.length>1),ie=i.computed(()=>d.value===0),oe=i.computed(()=>d.value===e.urlList.length-1),se=i.computed(()=>e.urlList[d.value]),Me=i.computed(()=>{const{scale:l,deg:x,offsetX:I,offsetY:T,enableTransition:w}=h.value,M={transform:`scale(${l}) rotate(${x}deg)`,transition:w?"transform .3s":"",marginLeft:`${I}px`,marginTop:`${T}px`};return Z.value.name===_.CONTAIN.name&&(M.maxWidth=M.maxHeight="100%"),M}),le=()=>{Ne(),t("close"),h.value={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},Ce=l=>{b.value?b.value=!1:q.value===(l==null?void 0:l.target)&&(y(!1),d.value=e.initialIndex)},Ae=()=>{a=xe(l=>{switch(l.code){case V.esc:y(!1);break;case V.space:W();break;case V.left:ce();break;case V.up:k("zoomIn");break;case V.right:J();break;case V.down:k("zoomOut");break}}),r=xe(l=>{(l.wheelDelta?l.wheelDelta:-l.detail)>0?k("zoomIn",{zoomRate:.015,enableTransition:!1}):k("zoomOut",{zoomRate:.015,enableTransition:!1})}),re(document,"keydown",a),re(document,je,r)},Ne=()=>{Se(document,"keydown",a),Se(document,je,r),a=null,r=null},Q=()=>{N.value=!1},f=l=>{N.value=!1,l.target.alt="加载失败"},P=i.shallowRef(),D=l=>{if(N.value||l.button!==0)return;l.preventDefault(),l.stopPropagation(),clearTimeout(P.value),b.value=!0;const{offsetX:x,offsetY:I}=h.value,T=l.pageX,w=l.pageY;o=xe(M=>{h.value={...h.value,offsetX:x+M.pageX-T,offsetY:I+M.pageY-w}}),re(document,"mousemove",o),re(document,"mouseup",()=>{Se(document,"mousemove",o),m.value&&A.value&&(P.value=setTimeout(()=>{b.value=!1}))})},H=()=>{h.value={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},W=()=>{if(N.value)return;const l=Object.keys(_),x=Object.values(_),I=Z.value.name,w=(x.findIndex(M=>M.name===I)+1)%l.length;Z.value=_[l[w]],H()},ce=()=>{if(ie.value&&!e.infinite)return;const l=e.urlList.length;d.value=(d.value-1+l)%l},J=()=>{if(oe.value&&!e.infinite)return;const l=e.urlList.length;d.value=(d.value+1)%l},k=(l,x={})=>{if(N.value)return;const{zoomRate:I,rotateDeg:T,enableTransition:w}={zoomRate:.2,rotateDeg:90,enableTransition:!0,...x};switch(l){case"zoomOut":h.value.scale>.2&&(h.value.scale=parseFloat((h.value.scale-I).toFixed(3)));break;case"zoomIn":h.value.scale=parseFloat((h.value.scale+I).toFixed(3));break;case"clocelise":h.value.deg+=T;break;case"anticlocelise":h.value.deg-=T;break}h.value.enableTransition=w},ke=[{icon:((ue=e.icons)==null?void 0:ue.close)||i.createVNode($.CloseOutlined,null,null),onClick:l=>{l.stopPropagation(),y(!1)},type:"close"},{icon:((fe=e.icons)==null?void 0:fe.zoomIn)||i.createVNode($.ZoomInOutlined,null,null),onClick:l=>{l.stopPropagation(),k("zoomIn")},type:"zoomIn"},{icon:((F=e.icons)==null?void 0:F.zoomOut)||i.createVNode($.ZoomOutOutlined,null,null),onClick:l=>{l.stopPropagation(),k("zoomOut")},type:"zoomOut"},{icon:((K=e.icons)==null?void 0:K.rotateRight)||i.createVNode($.RotateRightOutlined,null,null),onClick:l=>{l.stopPropagation(),k("anticlocelise")},type:"rotateRight"},{icon:((Ye=e.icons)==null?void 0:Ye.rotateLeft)||i.createVNode($.RotateLeftOutlined,null,null),onClick:l=>{l.stopPropagation(),k("clocelise")},type:"rotateLeft"}];return i.watch(se,()=>{i.nextTick(()=>{Y.value.complete||(N.value=!0)})}),i.watch(d,l=>{H(),t("switch",l)}),i.watch(m,l=>{l&&(A.value=l)}),U.onMountedOrActivated(()=>{var l,x;Ae(),(x=(l=q.value)==null?void 0:l.focus)==null||x.call(l)}),n({setOpen:O}),()=>{const l=ze(`${s}-fade`),x=ze(`${s}-zoom`);return c(i.createVNode(i.Teleport,{to:e.getContainer||"body",disabled:!e.teleported},{default:()=>[m.value&&i.createVNode("div",{class:`${s}-root ${u.value}`},[i.createVNode(i.Transition,l,{default:()=>[i.withDirectives(i.createVNode("div",{class:`${s}-mask ${u.value}`},null),[[i.vShow,m.value&&A.value]])]}),i.createVNode("div",{ref:q,tabindex:-1,class:[`${s}-wrapper`,`${u.value}`],onClick:I=>e.onHideOnClickModal&&Ce(I)},[i.createVNode(i.Transition,i.mergeProps(x,{onAfterLeave:()=>le()}),{default:()=>{var I,T;return[i.withDirectives(i.createVNode("div",{class:`${s}-block ${u.value}`},[i.createVNode("div",{class:`${s}-content ${u.value}`},[i.createVNode("div",{class:`${s}-body ${u.value}`},[i.createVNode("div",{class:`${s}-operations-wrapper ${u.value}`,onClick:w=>w.stopPropagation()},[i.createVNode("ul",{class:`${s}-operations ${u.value}`},[ke.map(({icon:w,onClick:M,type:Te})=>i.createVNode("li",{class:`${s}-operations-operation ${u.value}`,onClick:M,key:Te},[i.cloneVNode(w,{class:`${s}-operations-icon ${u.value}`})]))])]),i.createVNode("div",{class:`${s}-canvas ${u.value}`},[e.urlList.map((w,M)=>i.createVNode("img",{ref:Y,class:`${s}-img ${u.value}`,style:{...Me.value,display:M===d.value?"block":"none"},key:w,src:w,onLoad:()=>Q(),onError:Te=>f(Te),onMousedown:D},null))]),X.value&&i.createVNode("div",{class:[`${s}-switch-left`,d.value===0&&!e.infinite?`${s}-switch-left-disabled`:"",`${u.value}`],onClick:ce},[((I=e.icons)==null?void 0:I.left)||i.createVNode($.LeftOutlined,null,null)]),X.value&&i.createVNode("div",{class:[`${s}-switch-right`,d.value===e.urlList.length-1&&!e.infinite?`${s}-switch-right-disabled`:"",`${u.value}`],onClick:J},[((T=e.icons)==null?void 0:T.right)||i.createVNode($.RightOutlined,null,null)])])])]),[[i.vShow,m.value&&A.value]])]}})])])]}))}}}),Ie={width:"100%",height:"100%"},bt=e=>({[e.componentCls]:{display:"inline-block",position:"relative",overflow:"hidden",["&-inner"]:{...Ie,verticalAlign:"top",opacity:1},["&-placeholder"]:{...Ie,backgroundColor:e.colorBgContainerDisabled,backgroundImage:"url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundSize:"30%"},["&-error"]:{...Ie,display:"flex",alignItems:"center",justifyContent:"center",color:e.colorText,backgroundColor:e.colorBgContainerDisabled},["&-preview"]:{cursor:"pointer"}}}),yt=Oe("Image",e=>{const t=ve(e);return[bt(t)]}),wt=e=>e&&e.nodeType===Node.ELEMENT_NODE;let Be="";const B=i.defineComponent({props:ae,name:"GImage",emits:["error","click","load"],setup(e,{slots:t,emit:n,attrs:a}){const r=v.getPrefixCls({suffixCls:"image"}),[o,s]=yt(r),c=i.ref(),u=i.ref(""),b=i.ref(!1),m=i.ref(!0),O=i.ref(!1),A=i.ref(null),y=i.ref();let N,d;const q=i.computed(()=>!v.isServer&&e.fit?{"object-fit":e.fit}:{}),Y=i.computed(()=>{const{previewSrcList:f}=e;return Array.isArray(f)&&f.length>0}),Z=i.computed(()=>{const{src:f,previewSrcList:P,initialIndex:D}=e;if(D||D===0)return P.length>=D?D:0;let H=0;const W=P.indexOf(f);return W>=0&&(H=W),H}),h=()=>{v.isServer||(m.value=!0,b.value=!1,e.src?u.value=e.src:le())};function X(){v.isInContainer(A.value,y.value)&&(h(),se())}const ie=he.useThrottleFn(X,200),oe=async()=>{if(v.isServer)return;await i.nextTick();const{scrollContainer:f}=e;wt(f)?y.value=f:v.isString(f)&&f!==""?y.value=document.querySelector(f)??void 0:A.value&&(y.value=v.getScrollContainer(A.value)),y.value&&(N=he.useEventListener(y,"scroll",ie),setTimeout(()=>X(),200))},se=()=>{v.isServer||!y.value||!ie||(N(),y.value=void 0)},Me=f=>{m.value=!1,b.value=!1,n("load",f)},le=f=>{m.value=!1,b.value=!0,n("error",f)},Ce=f=>{if(f.ctrlKey){if(f.deltaY<0)return f.preventDefault(),!1;if(f.deltaY>0)return f.preventDefault(),!1}},Ae=()=>{!Y.value||e.disablePreview||(d=he.useEventListener("wheel",Ce,{passive:!1}),Be=document.body.style.overflow,document.body.style.overflow="hidden",O.value=!0)},Ne=()=>{d==null||d(),document.body.style.overflow=Be,O.value=!1};i.watch(()=>e.src,()=>{e.lazy?(m.value=!0,b.value=!1,se(),oe()):h()});const Q=f=>v.isNumber(f)?f+"px":f;return U.onMountedOrActivated(()=>{e.lazy?oe():h()}),()=>{const{crossorigin:f,decoding:P,alt:D,sizes:H,srcset:W,usemap:ce,class:J,style:k}=a,ke={crossorigin:f,decoding:P,alt:D,sizes:H,srcset:W,usemap:ce,style:{...q.value,height:e.height?Q(e.height):void 0,...k}},ue=v.getSlotVNode(t,e,"fallback"),fe=v.getSlotVNode(t,e,"placeholder");return i.watchEffect(()=>{var F,K;Y.value&&O.value?(F=c.value)==null||F.setOpen(!0):(K=c.value)==null||K.setOpen(!1)}),o(i.createVNode(i.Fragment,null,[i.createVNode("div",{class:{[`${s.value}`]:!0,[`${r}`]:!0,[`${e.wrapperClassName}`]:e.wrapperClassName},ref:F=>A.value=F,style:{...e.wrapperStyle,width:e.width?Q(e.width):void 0,height:e.height?Q(e.height):void 0,display:e.lazy?"block":void 0},onClick:()=>{n("click")}},[m.value&&(fe||i.createVNode("div",{class:`${r}-placeholder ${s.value}`},null)),b.value?ue||i.createVNode("div",{class:`${r}-error ${s.value}`},[i.createTextVNode("加载失败")]):u.value&&i.createVNode("img",i.mergeProps(ke,{class:{[`${s.value}`]:!0,[`${r}-inner`]:!0,[`${r}-preview`]:Y.value,[`${J}`]:!!J},alt:e.alt,src:u.value,onLoad:Me,onError:le,onClick:()=>Ae()}),null),i.createVNode(Ve,{ref:c,zIndex:e.zIndex,infinite:e.infinite,initialIndex:Z.value,urlList:e.previewSrcList,getContainer:e.getContainer,onHideOnClickModal:e.hideOnClickModal,onClose:()=>Ne()},null)])]))}}});B.isWImage=!0,B.install=e=>(e.component(B.name,B),e),p.GImage=B,p.ImageViewer=Ve,p.default=B,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
2
|
+
&:hover`]:{textDecoration:e.linkHoverDecoration,outline:0},"&:focus":{textDecoration:e.linkFocusDecoration,outline:0},"&[disabled]":{color:e.colorTextDisabled,cursor:"not-allowed"}}}),$e=process.env.NODE_ENV!=="production"||typeof CSSINJS_STATISTIC<"u";let ge=!0;function ve(...e){if(!$e)return Object.assign({},...e);ge=!1;const t={};return e.forEach(n=>{Object.keys(n).forEach(a=>{Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:()=>n[a]})})}),ge=!0,t}function qe(){}function Ze(e){let t,n=e,a=qe;return $e&&(t=new Set,n=new Proxy(e,{get(r,o){return ge&&t.add(o),r[o]}}),a=(r,o)=>{Array.from(t)}),{token:n,keys:t,flush:a}}class ee{constructor(t,n){this._keyframe=!0,this.name=t,this.style=n}getName(t=""){return t?`${t}-${this.name}`:this.name}}const ze=(e,t={})=>e?{name:e,appear:!0,enterFromClass:`${e}-enter ${e}-enter-prepare ${e}-enter-start`,enterActiveClass:`${e}-enter ${e}-enter-prepare`,enterToClass:`${e}-enter ${e}-enter-active`,leaveFromClass:` ${e}-leave`,leaveActiveClass:`${e}-leave ${e}-leave-active`,leaveToClass:`${e}-leave ${e}-leave-active`,...t}:{css:!1,...t},{useToken:Xe}=de.theme;function Oe(e,t){return n=>{const a=v.getPrefixCls({}),r=i.computed(()=>i.isRef(n)?n==null?void 0:n.value:n||a),{token:o,hashId:s,theme:c}=Xe(),u=i.computed(()=>v.getPrefixCls({})),b=i.computed(()=>({theme:c.value,token:o.value,hashId:s.value,path:["Shared",u.value]}));de.useStyleRegister(b,()=>[{"&":_e(o.value)}]);const m=i.computed(()=>({theme:c.value,token:o.value,hashId:s.value,path:[e,r.value]}));return[de.useStyleRegister(m,()=>{const{token:O,flush:A}=Ze(o.value),y=`.${r.value}`,N=ve(O,{antCls:".ant",componentCls:y,proComponentsCls:v.getPrefixCls({isPor:!0})}),d=t(N,{hashId:s.value,prefixCls:r.value});return A(e,{}),[Ge(o.value,r.value),d]}),s]}}function g(e,t){Je(e)&&(e="100%");var n=Qe(e);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)}function te(e){return Math.min(1,Math.max(0,e))}function Je(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Qe(e){return typeof e=="string"&&e.indexOf("%")!==-1}function Le(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ne(e){return e<=1?"".concat(Number(e)*100,"%"):e}function E(e){return e.length===1?"0"+e:String(e)}function Ke(e,t,n){return{r:g(e,255)*255,g:g(t,255)*255,b:g(n,255)*255}}function De(e,t,n){e=g(e,255),t=g(t,255),n=g(n,255);var a=Math.max(e,t,n),r=Math.min(e,t,n),o=0,s=0,c=(a+r)/2;if(a===r)s=0,o=0;else{var u=a-r;switch(s=c>.5?u/(2-a-r):u/(a+r),a){case e:o=(t-n)/u+(t<n?6:0);break;case t:o=(n-e)/u+2;break;case n:o=(e-t)/u+4;break}o/=6}return{h:o,s,l:c}}function pe(e,t,n){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}function Ue(e,t,n){var a,r,o;if(e=g(e,360),t=g(t,100),n=g(n,100),t===0)r=n,o=n,a=n;else{var s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;a=pe(c,s,e+1/3),r=pe(c,s,e),o=pe(c,s,e-1/3)}return{r:a*255,g:r*255,b:o*255}}function Ee(e,t,n){e=g(e,255),t=g(t,255),n=g(n,255);var a=Math.max(e,t,n),r=Math.min(e,t,n),o=0,s=a,c=a-r,u=a===0?0:c/a;if(a===r)o=0;else{switch(a){case e:o=(t-n)/c+(t<n?6:0);break;case t:o=(n-e)/c+2;break;case n:o=(e-t)/c+4;break}o/=6}return{h:o,s:u,v:s}}function et(e,t,n){e=g(e,360)*6,t=g(t,100),n=g(n,100);var a=Math.floor(e),r=e-a,o=n*(1-t),s=n*(1-r*t),c=n*(1-(1-r)*t),u=a%6,b=[n,s,o,o,c,n][u],m=[c,n,n,s,o,o][u],O=[o,o,c,n,n,s][u];return{r:b*255,g:m*255,b:O*255}}function Re(e,t,n,a){var r=[E(Math.round(e).toString(16)),E(Math.round(t).toString(16)),E(Math.round(n).toString(16))];return a&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function tt(e,t,n,a,r){var o=[E(Math.round(e).toString(16)),E(Math.round(t).toString(16)),E(Math.round(n).toString(16)),E(nt(a))];return r&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))&&o[3].startsWith(o[3].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function nt(e){return Math.round(parseFloat(e)*255).toString(16)}function Pe(e){return S(e)/255}function S(e){return parseInt(e,16)}function at(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var me={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function rt(e){var t={r:0,g:0,b:0},n=1,a=null,r=null,o=null,s=!1,c=!1;return typeof e=="string"&&(e=st(e)),typeof e=="object"&&(z(e.r)&&z(e.g)&&z(e.b)?(t=Ke(e.r,e.g,e.b),s=!0,c=String(e.r).substr(-1)==="%"?"prgb":"rgb"):z(e.h)&&z(e.s)&&z(e.v)?(a=ne(e.s),r=ne(e.v),t=et(e.h,a,r),s=!0,c="hsv"):z(e.h)&&z(e.s)&&z(e.l)&&(a=ne(e.s),o=ne(e.l),t=Ue(e.h,a,o),s=!0,c="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=Le(n),{ok:s,format:e.format||c,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var it="[-\\+]?\\d+%?",ot="[-\\+]?\\d*\\.\\d+%?",L="(?:".concat(ot,")|(?:").concat(it,")"),be="[\\s|\\(]+(".concat(L,")[,|\\s]+(").concat(L,")[,|\\s]+(").concat(L,")\\s*\\)?"),ye="[\\s|\\(]+(".concat(L,")[,|\\s]+(").concat(L,")[,|\\s]+(").concat(L,")[,|\\s]+(").concat(L,")\\s*\\)?"),C={CSS_UNIT:new RegExp(L),rgb:new RegExp("rgb"+be),rgba:new RegExp("rgba"+ye),hsl:new RegExp("hsl"+be),hsla:new RegExp("hsla"+ye),hsv:new RegExp("hsv"+be),hsva:new RegExp("hsva"+ye),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function st(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(me[e])e=me[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=C.rgb.exec(e);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?{r:S(n[1]),g:S(n[2]),b:S(n[3]),a:Pe(n[4]),format:t?"name":"hex8"}:(n=C.hex6.exec(e),n?{r:S(n[1]),g:S(n[2]),b:S(n[3]),format:t?"name":"hex"}:(n=C.hex4.exec(e),n?{r:S(n[1]+n[1]),g:S(n[2]+n[2]),b:S(n[3]+n[3]),a:Pe(n[4]+n[4]),format:t?"name":"hex8"}:(n=C.hex3.exec(e),n?{r:S(n[1]+n[1]),g:S(n[2]+n[2]),b:S(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function z(e){return!!C.CSS_UNIT.exec(String(e))}var G=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var a;if(t instanceof e)return t;typeof t=="number"&&(t=at(t)),this.originalInput=t;var r=rt(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(a=n.format)!==null&&a!==void 0?a:r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,a,r,o=t.r/255,s=t.g/255,c=t.b/255;return o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),s<=.03928?a=s/12.92:a=Math.pow((s+.055)/1.055,2.4),c<=.03928?r=c/12.92:r=Math.pow((c+.055)/1.055,2.4),.2126*n+.7152*a+.0722*r},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=Le(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=Ee(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=Ee(this.r,this.g,this.b),n=Math.round(t.h*360),a=Math.round(t.s*100),r=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(a,"%, ").concat(r,"%)"):"hsva(".concat(n,", ").concat(a,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=De(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=De(this.r,this.g,this.b),n=Math.round(t.h*360),a=Math.round(t.s*100),r=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(a,"%, ").concat(r,"%)"):"hsla(".concat(n,", ").concat(a,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),Re(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),tt(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),a=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(a,")"):"rgba(".concat(t,", ").concat(n,", ").concat(a,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(g(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(g(n,255)*100)};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,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+Re(this.r,this.g,this.b,!1),n=0,a=Object.entries(me);n<a.length;n++){var r=a[n],o=r[0],s=r[1];if(t===s)return o}return!1},e.prototype.toString=function(t){var n=!!t;t=t??this.format;var a=!1,r=this.a<1&&this.a>=0,o=!n&&r&&(t.startsWith("hex")||t==="name");return o?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())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=te(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=te(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=te(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=te(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),a=(n.h+t)%360;return n.h=a<0?360+a:a,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var a=this.toRgb(),r=new e(t).toRgb(),o=n/100,s={r:(r.r-a.r)*o+a.r,g:(r.g-a.g)*o+a.g,b:(r.b-a.b)*o+a.b,a:(r.a-a.a)*o+a.a};return new e(s)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var a=this.toHsl(),r=360/n,o=[this];for(a.h=(a.h-(r*t>>1)+720)%360;--t;)a.h=(a.h+r)%360,o.push(new e(a));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),a=n.h,r=n.s,o=n.v,s=[],c=1/t;t--;)s.push(new e({h:a,s:r,v:o})),o=(o+c)%1;return s},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),a=new e(t).toRgb();return new e({r:a.r+(n.r-a.r)*n.a,g:a.g+(n.g-a.g)*n.a,b:a.b+(n.b-a.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),a=n.h,r=[this],o=360/t,s=1;s<t;s++)r.push(new e({h:(a+s*o)%360,s:n.s,l:n.l}));return r},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();const lt=new ee("viewFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),ct=new ee("viewFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),ut=new ee("viewZoomBadgeIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),ft=new ee("viewZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),Fe=e=>({position:e||"absolute",inset:0});function we(e){return{position:e,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0}}const dt=e=>({boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none",fontFamily:e.fontFamily}),ht=e=>{const{componentCls:t,modalMaskBg:n,paddingSM:a,previewOperationColorDisabled:r,motionDurationSlow:o}=e,s=new G(n).setAlpha(.1),c=s.clone().setAlpha(.2);return{[`${t}-operations`]:{...dt(e),display:"flex",flexDirection:"row-reverse",alignItems:"center",color:e.previewOperationColor,listStyle:"none",background:s.toRgbString(),pointerEvents:"auto","&-operation":{marginInlineStart:a,padding:a,cursor:"pointer",transition:`all ${o}`,userSelect:"none","&:hover":{background:c.toRgbString()},"&-disabled":{color:r,pointerEvents:"none"},"&:last-of-type":{marginInlineStart:0}},"&-progress":{position:"absolute",left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%)"},"&-icon":{fontSize:e.previewOperationSize}}}},gt=e=>{const{modalMaskBg:t,previewOperationColorDisabled:n,zIndexPopup:a,motionDurationSlow:r}=e,o=new G(t).setAlpha(.1),s=o.clone().setAlpha(.2);return{[`${e.componentCls}-switch-left, ${e.componentCls}-switch-right`]:{position:"fixed",insetBlockStart:"50%",zIndex:a+1,display:"flex",alignItems:"center",justifyContent:"center",width:e.imagePreviewSwitchSize,height:e.imagePreviewSwitchSize,marginTop:-e.imagePreviewSwitchSize/2,color:e.previewOperationColor,background:o.toRgbString(),borderRadius:"50%",transform:"translateY(-50%)",cursor:"pointer",transition:`all ${r}`,pointerEvents:"auto",userSelect:"none","&:hover":{background:s.toRgbString()},["&-disabled"]:{"&, &:hover":{color:n,background:"transparent",cursor:"not-allowed",[`> ${e.iconCls}`]:{cursor:"not-allowed"}}},[`> ${e.iconCls}`]:{fontSize:e.previewOperationSize}},[`${e.componentCls}-switch-left`]:{insetInlineStart:e.marginSM},[`${e.componentCls}-switch-right`]:{insetInlineEnd:e.marginSM}}},vt=e=>({[e.componentCls]:{["&-root"]:{...we("fixed"),zIndex:e.zIndexPopup,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"},["&-wrapper"]:{...we("fixed"),zIndex:e.zIndexPopup,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"},["&-mask"]:{...we("fixed"),zIndex:e.zIndexPopupBase,height:"100%",backgroundColor:e.colorBgMask},["&-block"]:{height:"100%",textAlign:"center",pointerEvents:"none"},["&-body"]:{...Fe(),overflow:"hidden"},["&-canvas"]:{...Fe(),display:"flex",justifyContent:"center",alignItems:"center","&::before":{display:"inline-block",width:1,height:"50%",marginInlineEnd:-1,content:'""'}},["&-img"]:{maxWidth:"100%",maxHeight:"100%",verticalAlign:"middle",transform:"scale3d(1, 1, 1)",cursor:"grab",transition:`transform ${e.motionDurationSlow} ${e.motionEaseOut} 0s`,userSelect:"none",pointerEvents:"auto"},["&-fade-appear, &-fade-enter"]:{animationName:lt,animationDuration:e.motionDurationSlow,animationTimingFunction:"linear"},["&-fade-leave"]:{animationName:ct,animationDuration:e.motionDurationSlow,animationTimingFunction:"linear"},["&-zoom-appear, &-zoom-enter"]:{animationName:ut,opacity:0,animationTimingFunction:e.motionEaseOutCirc,animationFillMode:"both",transform:"none",animationDuration:e.motionDurationSlow,userSelect:"none"},["&-zoom-enter-active"]:{animationPlayState:"running"},["&-zoom-leave"]:{animationName:ft,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"}},[`${e.componentCls}-root`]:{[`${e.componentCls}-wrapper`]:{zIndex:e.zIndexPopup}},[`${e.componentCls}-operations-wrapper`]:{position:"fixed",insetBlockStart:0,insetInlineEnd:0,zIndex:e.zIndexPopup+1,width:"100%"},"&":[ht(e),gt(e)]}),pt=Oe("ImageView",e=>{const t=ve(e,{zIndexPopup:e.zIndexPopupBase+80,previewOperationColorDisabled:new G(e.colorTextLightSolid).setAlpha(.25).toRgbString(),modalMaskBg:new G("#000").setAlpha(.45).toRgbString(),previewOperationColor:new G(e.colorTextLightSolid).toRgbString(),previewOperationSize:e.fontSizeIcon*1.5,imagePreviewSwitchSize:e.controlHeightLG,iconCls:"anticon"});return[vt(t)]}),He=We.createTypes({func:void 0,bool:void 0,string:void 0,number:void 0,array:void 0,object:void 0,integer:void 0});He.extend([{name:"looseBool",getter:!0,type:Boolean,default:void 0},{name:"style",getter:!0,type:[String,Object],default:void 0},{name:"VueNode",getter:!0,type:null}]);const j=He,R={infinite:{type:Boolean,default:!0},zIndex:{type:Number,default:2e3},initialIndex:{type:Number,default:0},getContainer:{type:String}},ae={previewTeleported:{type:Boolean,default:!0},hideOnClickModal:{type:Boolean,default:!0},wrapperClassName:String,wrapperStyle:{type:Object,default:void 0},src:{type:String,default:""},alt:{type:String,default:""},fit:{type:String,default:"contain"},lazy:j.bool,scrollContainer:{type:[String,Object]},placeholder:{type:[Function,Object],default:()=>{}},fallback:{type:[Function,Object],default:()=>{}},onLoad:{type:Function},onError:{type:Function},onClick:{type:Function},disablePreview:j.bool,previewSrcList:{type:Array,default:()=>[]},imageClassName:j.string,imageStyle:j.style,width:j.number,height:j.number,zIndex:R.zIndex,infinite:R.infinite,getContainer:R.getContainer,initialIndex:R.initialIndex},mt={urlList:{type:Array,default:()=>[]},teleported:ae.previewTeleported,zIndex:R.zIndex,initialIndex:R.initialIndex,infinite:R.infinite,getContainer:ae.getContainer,onHideOnClickModal:ae.hideOnClickModal,icons:{type:Object,default:()=>({})}},V={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace"},re=function(e,t,n,a=!1){e&&t&&n&&e.addEventListener(t,n,a)},Se=function(e,t,n,a=!1){e&&t&&n&&e.removeEventListener(t,n,a)},_={CONTAIN:{name:"contain",icon:i.createVNode($.ExpandOutlined,null,null)},ORIGINAL:{name:"original",icon:i.createVNode($.OneToOneOutlined,null,null)}},je=function(){return!v.isServer&&!!window.navigator.userAgent.match(/firefox/i)}()?"DOMMouseScroll":"mousewheel";function xe(e){let t=!1;return function(...n){t||(t=!0,window.requestAnimationFrame(()=>{e.apply(this,n),t=!1}))}}const Ve=i.defineComponent({props:mt,emits:["close","switch"],setup:function(e,{emit:t,expose:n}){var ue,fe,H,K,Ye;let a=null,r=null,o=null;const s=v.getPrefixCls({suffixCls:"image-viewer"}),[c,u]=pt(s),b=i.shallowRef(!1),[m,O]=U.useState(!1),[A,y]=U.useState(!1),N=i.ref(!0),d=i.ref(e.initialIndex),q=i.ref(null),Y=i.ref(null),Z=i.ref(_.CONTAIN),h=i.ref({scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}),X=i.computed(()=>e.urlList.length>1),ie=i.computed(()=>d.value===0),oe=i.computed(()=>d.value===e.urlList.length-1),se=i.computed(()=>e.urlList[d.value]),Me=i.computed(()=>{const{scale:l,deg:x,offsetX:I,offsetY:T,enableTransition:w}=h.value,M={transform:`scale(${l}) rotate(${x}deg)`,transition:w?"transform .3s":"",marginLeft:`${I}px`,marginTop:`${T}px`};return Z.value.name===_.CONTAIN.name&&(M.maxWidth=M.maxHeight="100%"),M}),le=()=>{Ne(),t("close"),h.value={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},Ce=l=>{b.value?b.value=!1:q.value===(l==null?void 0:l.target)&&(y(!1),d.value=e.initialIndex)},Ae=()=>{a=xe(l=>{switch(l.code){case V.esc:y(!1);break;case V.space:W();break;case V.left:ce();break;case V.up:k("zoomIn");break;case V.right:Q();break;case V.down:k("zoomOut");break}}),r=xe(l=>{(l.wheelDelta?l.wheelDelta:-l.detail)>0?k("zoomIn",{zoomRate:.015,enableTransition:!1}):k("zoomOut",{zoomRate:.015,enableTransition:!1})}),re(document,"keydown",a),re(document,je,r)},Ne=()=>{Se(document,"keydown",a),Se(document,je,r),a=null,r=null},J=()=>{N.value=!1},f=l=>{N.value=!1,l.target.alt="加载失败"},P=i.shallowRef(),D=l=>{if(N.value||l.button!==0)return;l.preventDefault(),l.stopPropagation(),clearTimeout(P.value),b.value=!0;const{offsetX:x,offsetY:I}=h.value,T=l.pageX,w=l.pageY;o=xe(M=>{h.value={...h.value,offsetX:x+M.pageX-T,offsetY:I+M.pageY-w}}),re(document,"mousemove",o),re(document,"mouseup",()=>{Se(document,"mousemove",o),m.value&&A.value&&(P.value=setTimeout(()=>{b.value=!1}))})},F=()=>{h.value={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},W=()=>{if(N.value)return;const l=Object.keys(_),x=Object.values(_),I=Z.value.name,w=(x.findIndex(M=>M.name===I)+1)%l.length;Z.value=_[l[w]],F()},ce=()=>{if(ie.value&&!e.infinite)return;const l=e.urlList.length;d.value=(d.value-1+l)%l},Q=()=>{if(oe.value&&!e.infinite)return;const l=e.urlList.length;d.value=(d.value+1)%l},k=(l,x={})=>{if(N.value)return;const{zoomRate:I,rotateDeg:T,enableTransition:w}={zoomRate:.2,rotateDeg:90,enableTransition:!0,...x};switch(l){case"zoomOut":h.value.scale>.2&&(h.value.scale=parseFloat((h.value.scale-I).toFixed(3)));break;case"zoomIn":h.value.scale=parseFloat((h.value.scale+I).toFixed(3));break;case"clocelise":h.value.deg+=T;break;case"anticlocelise":h.value.deg-=T;break}h.value.enableTransition=w},ke=[{icon:((ue=e.icons)==null?void 0:ue.close)||i.createVNode($.CloseOutlined,null,null),onClick:l=>{l.stopPropagation(),y(!1)},type:"close"},{icon:((fe=e.icons)==null?void 0:fe.zoomIn)||i.createVNode($.ZoomInOutlined,null,null),onClick:l=>{l.stopPropagation(),k("zoomIn")},type:"zoomIn"},{icon:((H=e.icons)==null?void 0:H.zoomOut)||i.createVNode($.ZoomOutOutlined,null,null),onClick:l=>{l.stopPropagation(),k("zoomOut")},type:"zoomOut"},{icon:((K=e.icons)==null?void 0:K.rotateRight)||i.createVNode($.RotateRightOutlined,null,null),onClick:l=>{l.stopPropagation(),k("anticlocelise")},type:"rotateRight"},{icon:((Ye=e.icons)==null?void 0:Ye.rotateLeft)||i.createVNode($.RotateLeftOutlined,null,null),onClick:l=>{l.stopPropagation(),k("clocelise")},type:"rotateLeft"}];return i.watch(se,()=>{i.nextTick(()=>{Y.value.complete||(N.value=!0)})}),i.watch(d,l=>{F(),t("switch",l)}),i.watch(m,l=>{l&&(A.value=l)}),U.onMountedOrActivated(()=>{var l,x;Ae(),(x=(l=q.value)==null?void 0:l.focus)==null||x.call(l)}),n({setOpen:O}),()=>{const l=ze(`${s}-fade`),x=ze(`${s}-zoom`);return c(i.createVNode(i.Teleport,{to:e.getContainer||"body",disabled:!e.teleported},{default:()=>[m.value&&i.createVNode("div",{class:`${s}-root ${u.value}`},[i.createVNode(i.Transition,l,{default:()=>[i.withDirectives(i.createVNode("div",{class:`${s}-mask ${u.value}`},null),[[i.vShow,m.value&&A.value]])]}),i.createVNode("div",{ref:q,tabindex:-1,class:[`${s}-wrapper`,`${u.value}`],onClick:I=>e.onHideOnClickModal&&Ce(I)},[i.createVNode(i.Transition,i.mergeProps(x,{onAfterLeave:()=>le()}),{default:()=>{var I,T;return[i.withDirectives(i.createVNode("div",{class:`${s}-block ${u.value}`},[i.createVNode("div",{class:`${s}-content ${u.value}`},[i.createVNode("div",{class:`${s}-body ${u.value}`},[i.createVNode("div",{class:`${s}-operations-wrapper ${u.value}`,onClick:w=>w.stopPropagation()},[i.createVNode("ul",{class:`${s}-operations ${u.value}`},[ke.map(({icon:w,onClick:M,type:Te})=>i.createVNode("li",{class:`${s}-operations-operation ${u.value}`,onClick:M,key:Te},[i.cloneVNode(w,{class:`${s}-operations-icon ${u.value}`})]))])]),i.createVNode("div",{class:`${s}-canvas ${u.value}`},[e.urlList.map((w,M)=>i.createVNode("img",{ref:Y,class:`${s}-img ${u.value}`,style:{...Me.value,display:M===d.value?"block":"none"},key:w,src:w,onLoad:()=>J(),onError:Te=>f(Te),onMousedown:D},null))]),X.value&&i.createVNode("div",{class:[`${s}-switch-left`,d.value===0&&!e.infinite?`${s}-switch-left-disabled`:"",`${u.value}`],onClick:ce},[((I=e.icons)==null?void 0:I.left)||i.createVNode($.LeftOutlined,null,null)]),X.value&&i.createVNode("div",{class:[`${s}-switch-right`,d.value===e.urlList.length-1&&!e.infinite?`${s}-switch-right-disabled`:"",`${u.value}`],onClick:Q},[((T=e.icons)==null?void 0:T.right)||i.createVNode($.RightOutlined,null,null)])])])]),[[i.vShow,m.value&&A.value]])]}})])])]}))}}}),Ie={width:"100%",height:"100%"},bt=e=>({[e.componentCls]:{display:"inline-block",position:"relative",overflow:"hidden",["&-inner"]:{...Ie,verticalAlign:"top",opacity:1},["&-placeholder"]:{...Ie,backgroundColor:e.colorBgContainerDisabled,backgroundImage:"url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundSize:"30%"},["&-error"]:{...Ie,display:"flex",alignItems:"center",justifyContent:"center",color:e.colorText,backgroundColor:e.colorBgContainerDisabled},["&-preview"]:{cursor:"pointer"}}}),yt=Oe("Image",e=>{const t=ve(e);return[bt(t)]}),wt=e=>e&&e.nodeType===Node.ELEMENT_NODE;let Be="";const B=i.defineComponent({props:ae,name:"GImage",emits:["error","click","load"],setup(e,{slots:t,emit:n,attrs:a}){const r=v.getPrefixCls({suffixCls:"image"}),[o,s]=yt(r),c=i.ref(),u=i.ref(""),b=i.ref(!1),m=i.ref(!0),O=i.ref(!1),A=i.ref(null),y=i.ref();let N,d;const q=i.computed(()=>!v.isServer&&e.fit?{"object-fit":e.fit}:{}),Y=i.computed(()=>{const{previewSrcList:f}=e;return Array.isArray(f)&&f.length>0}),Z=i.computed(()=>{const{src:f,previewSrcList:P,initialIndex:D}=e;if(D||D===0)return P.length>=D?D:0;let F=0;const W=P.indexOf(f);return W>=0&&(F=W),F}),h=()=>{v.isServer||(m.value=!0,b.value=!1,e.src?u.value=e.src:le())};function X(){v.isInContainer(A.value,y.value)&&(h(),se())}const ie=he.useThrottleFn(X,200),oe=async()=>{if(v.isServer)return;await i.nextTick();const{scrollContainer:f}=e;wt(f)?y.value=f:v.isString(f)&&f!==""?y.value=document.querySelector(f)??void 0:A.value&&(y.value=v.getScrollContainer(A.value)),y.value&&(N=he.useEventListener(y,"scroll",ie),setTimeout(()=>X(),200))},se=()=>{v.isServer||!y.value||!ie||(N(),y.value=void 0)},Me=f=>{m.value=!1,b.value=!1,n("load",f)},le=f=>{m.value=!1,b.value=!0,n("error",f)},Ce=f=>{if(f.ctrlKey){if(f.deltaY<0)return f.preventDefault(),!1;if(f.deltaY>0)return f.preventDefault(),!1}},Ae=()=>{!Y.value||e.disablePreview||(d=he.useEventListener("wheel",Ce,{passive:!1}),Be=document.body.style.overflow,document.body.style.overflow="hidden",O.value=!0)},Ne=()=>{d==null||d(),document.body.style.overflow=Be,O.value=!1};i.watch(()=>e.src,()=>{e.lazy?(m.value=!0,b.value=!1,se(),oe()):h()});const J=f=>v.isNumber(f)?f+"px":f;return U.onMountedOrActivated(()=>{e.lazy?oe():h()}),()=>{const{crossorigin:f,decoding:P,alt:D,sizes:F,srcset:W,usemap:ce,class:Q,style:k}=a,ke={crossorigin:f,decoding:P,alt:D,sizes:F,srcset:W,usemap:ce,style:{...q.value,height:e.height?J(e.height):void 0,...k}},ue=v.getSlotVNode(t,e,"fallback"),fe=v.getSlotVNode(t,e,"placeholder");return i.watchEffect(()=>{var H,K;Y.value&&O.value?(H=c.value)==null||H.setOpen(!0):(K=c.value)==null||K.setOpen(!1)}),o(i.createVNode(i.Fragment,null,[i.createVNode("div",{class:{[`${s.value}`]:!0,[`${r}`]:!0,[`${e.wrapperClassName}`]:e.wrapperClassName},ref:H=>A.value=H,style:{...e.wrapperStyle,width:e.width?J(e.width):void 0,height:e.height?J(e.height):void 0,display:e.lazy?"block":void 0},onClick:()=>{n("click")}},[m.value&&(fe||i.createVNode("div",{class:`${r}-placeholder ${s.value}`},null)),b.value?ue||i.createVNode("div",{class:`${r}-error ${s.value}`},[i.createTextVNode("加载失败")]):u.value&&i.createVNode("img",i.mergeProps(ke,{class:{[`${s.value}`]:!0,[`${r}-inner`]:!0,[`${r}-preview`]:Y.value,[`${Q}`]:!!Q},alt:e.alt,src:u.value,onLoad:Me,onError:le,onClick:()=>Ae()}),null),i.createVNode(Ve,{ref:c,zIndex:e.zIndex,infinite:e.infinite,initialIndex:Z.value,urlList:e.previewSrcList,getContainer:e.getContainer,onHideOnClickModal:e.hideOnClickModal,onClose:()=>Ne()},null)])]))}}});B.isWImage=!0,B.install=e=>(e.component(B.name,B),e),p.GImage=B,p.ImageViewer=Ve,p.default=B,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gx-design-vue/image",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite",
|
|
6
6
|
"build": "vite build",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@vueuse/core": "^9.10.0",
|
|
27
27
|
"@gx-design-vue/pro-utils": "^0.2.0-beta.6",
|
|
28
28
|
"@gx-design-vue/pro-hooks": "^0.2.0-beta.6",
|
|
29
|
-
"@gx-design-vue/pro-provider": "^0.1.0-beta.
|
|
29
|
+
"@gx-design-vue/pro-provider": "^0.1.0-beta.14",
|
|
30
30
|
"ant-design-vue": "^4.0.0",
|
|
31
31
|
"vue": "^3.2.45",
|
|
32
32
|
"vue-types": "^4.1.1"
|