@gx-design-vue/image 0.2.0-beta.21 → 0.2.0-beta.22

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.
@@ -1 +1 @@
1
- (function(h,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("vue-types"),require("vue"),require("@ant-design/icons-vue"),require("@gx-design-vue/pro-utils"),require("@gx-design-vue/pro-hooks"),require("@gx-design-vue/pro-provider"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","vue-types","vue","@ant-design/icons-vue","@gx-design-vue/pro-utils","@gx-design-vue/pro-hooks","@gx-design-vue/pro-provider","@vueuse/core"],_):(h=typeof globalThis<"u"?globalThis:h||self,_(h.GImage={},h.vueTypes,h.vue,h.iconsVue,h.proUtils,h.proHooks,h.proProvider,h.core))})(this,function(h,_,i,k,w,de,O,he){"use strict";const $=_.createTypes({func:void 0,bool:void 0,string:void 0,number:void 0,array:void 0,object:void 0,integer:void 0});$.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 D={infinite:{type:Boolean,default:!0},zIndex:{type:Number,default:2e3},initialIndex:{type:Number,default:0},getContainer:{type:String}},Z={previewTeleported:{type:Boolean,default:!0},hideOnClickModal:{type:Boolean,default:!0},src:{type:String,default:""},alt:{type:String,default:""},fit:{type:String,default:"contain"},lazy:$.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:$.bool,previewSrcList:{type:Array,default:()=>[]},imageClassName:$.string,imageStyle:$.style,width:$.number,height:$.number,zIndex:D.zIndex,infinite:D.infinite,getContainer:D.getContainer,initialIndex:{...D.initialIndex,default:()=>{}}},Te={urlList:{type:Array,default:()=>[]},teleported:Z.previewTeleported,zIndex:D.zIndex,initialIndex:D.initialIndex,infinite:D.infinite,getContainer:Z.getContainer,onHideOnClickModal:Z.hideOnClickModal,icons:{type:Object,default:()=>({})}};function g(e,t){Pe(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 Pe(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function je(e){return typeof e=="string"&&e.indexOf("%")!==-1}function ke(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 H(e){return e.length===1?"0"+e:String(e)}function Ve(e,t,n){return{r:g(e,255)*255,g:g(t,255)*255,b:g(n,255)*255}}function Oe(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 ge(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 Be(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=ge(c,s,e+1/3),r=ge(c,s,e),o=ge(c,s,e-1/3)}return{r:a*255,g:r*255,b:o*255}}function ze(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 Ye(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,M=[n,s,o,o,c,n][u],b=[c,n,n,s,o,o][u],F=[o,o,c,n,n,s][u];return{r:M*255,g:b*255,b:F*255}}function Le(e,t,n,a){var r=[H(Math.round(e).toString(16)),H(Math.round(t).toString(16)),H(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 Ge(e,t,n,a,r){var o=[H(Math.round(e).toString(16)),H(Math.round(t).toString(16)),H(Math.round(n).toString(16)),H(We(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 We(e){return Math.round(parseFloat(e)*255).toString(16)}function Ee(e){return S(e)/255}function S(e){return parseInt(e,16)}function qe(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 _e(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=Qe(e)),typeof e=="object"&&(z(e.r)&&z(e.g)&&z(e.b)?(t=Ve(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=Ye(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=Be(e.h,a,o),s=!0,c="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=ke(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 Ze="[-\\+]?\\d+%?",Xe="[-\\+]?\\d*\\.\\d+%?",R="(?:".concat(Xe,")|(?:").concat(Ze,")"),ve="[\\s|\\(]+(".concat(R,")[,|\\s]+(").concat(R,")[,|\\s]+(").concat(R,")\\s*\\)?"),pe="[\\s|\\(]+(".concat(R,")[,|\\s]+(").concat(R,")[,|\\s]+(").concat(R,")[,|\\s]+(").concat(R,")\\s*\\)?"),T={CSS_UNIT:new RegExp(R),rgb:new RegExp("rgb"+ve),rgba:new RegExp("rgba"+pe),hsl:new RegExp("hsl"+ve),hsla:new RegExp("hsla"+pe),hsv:new RegExp("hsv"+ve),hsva:new RegExp("hsva"+pe),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 Qe(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=T.rgb.exec(e);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?{r:S(n[1]),g:S(n[2]),b:S(n[3]),a:Ee(n[4]),format:t?"name":"hex8"}:(n=T.hex6.exec(e),n?{r:S(n[1]),g:S(n[2]),b:S(n[3]),format:t?"name":"hex"}:(n=T.hex4.exec(e),n?{r:S(n[1]+n[1]),g:S(n[2]+n[2]),b:S(n[3]+n[3]),a:Ee(n[4]+n[4]),format:t?"name":"hex8"}:(n=T.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!!T.CSS_UNIT.exec(String(e))}var X=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=qe(t)),this.originalInput=t;var r=_e(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=ke(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=ze(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=ze(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=Oe(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=Oe(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),Le(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),Ge(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.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(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="#"+Le(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(),r=n.a+a.a*(1-n.a);return new e({r:(n.r*n.a+a.r*a.a*(1-n.a))/r,g:(n.g*n.a+a.g*a.a*(1-n.a))/r,b:(n.b*n.a+a.b*a.a*(1-n.a))/r,a:r})},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 Ke=new O.Keyframe("viewFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),Je=new O.Keyframe("viewFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),Ue=new O.Keyframe("viewZoomBadgeIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),et=new O.Keyframe("viewZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),Re=e=>({position:e||"absolute",inset:0});function be(e){return{position:e,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0}}const tt=e=>({boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none",fontFamily:e.fontFamily}),nt=e=>{const{componentCls:t,modalMaskBg:n,paddingSM:a,previewOperationColorDisabled:r,motionDurationSlow:o}=e,s=new X(n).setAlpha(.1),c=s.clone().setAlpha(.2);return{[`${t}-operations`]:{...tt(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}}}},at=e=>{const{modalMaskBg:t,previewOperationColorDisabled:n,zIndexPopup:a,motionDurationSlow:r}=e,o=new X(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}}},rt=e=>({[e.componentCls]:{"&-root":{...be("fixed"),zIndex:e.zIndexPopup,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"},"&-wrapper":{...be("fixed"),zIndex:e.zIndexPopup,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"},"&-mask":{...be("fixed"),zIndex:e.zIndexPopupBase,height:"100%",backgroundColor:e.colorBgMask},"&-block":{height:"100%",textAlign:"center",pointerEvents:"none"},"&-body":{...Re(),overflow:"hidden"},"&-canvas":{...Re(),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:Ke,animationDuration:e.motionDurationSlow,animationTimingFunction:"linear"},"&-fade-leave":{animationName:Je,animationDuration:e.motionDurationSlow,animationTimingFunction:"linear"},"&-zoom-appear, &-zoom-enter":{animationName:Ue,opacity:0,animationTimingFunction:e.motionEaseOutCirc,animationFillMode:"both",transform:"none",animationDuration:e.motionDurationSlow,userSelect:"none"},"&-zoom-enter-active":{animationPlayState:"running"},"&-zoom-leave":{animationName:et,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%"},"&":[nt(e),at(e)]});function it(e){return O.useStyle("ImageView",t=>{const n=O.mergeToken(t,{zIndexPopup:t.zIndexPopupBase+80,previewOperationColorDisabled:new X(t.colorTextLightSolid).setAlpha(.25).toRgbString(),modalMaskBg:new X("#000").setAlpha(.45).toRgbString(),previewOperationColor:new X(t.colorTextLightSolid).toRgbString(),previewOperationSize:t.fontSizeIcon*1.5,imagePreviewSwitchSize:t.controlHeightLG,iconCls:"anticon"});return[rt(n)]},e)}const j={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace"},ae=function(e,t,n,a=!1){e&&t&&n&&e.addEventListener(t,n,a)},ye=function(e,t,n,a=!1){e&&t&&n&&e.removeEventListener(t,n,a)},Q={CONTAIN:{name:"contain",icon:i.createVNode(k.ExpandOutlined,null,null)},ORIGINAL:{name:"original",icon:i.createVNode(k.OneToOneOutlined,null,null)}},$e=function(){return!w.isServer&&!!window.navigator.userAgent.match(/firefox/i)}()?"DOMMouseScroll":"mousewheel";function we(e){let t=!1;return function(...n){t||(t=!0,window.requestAnimationFrame(()=>{e.apply(this,n),t=!1}))}}const De=i.defineComponent({props:Te,emits:["close","switch"],setup:(e,{emit:t,expose:n})=>{var fe,ue,P,ee,Fe;let a=null,r=null,o=null;const s=w.getPrefixCls({suffixCls:"image-viewer"}),{wrapSSR:c,hashId:u}=it(s),M=i.shallowRef(!1),[b,F]=de.useState(!1),[L,I]=de.useState(!1),E=i.ref(!0),m=i.ref(e.initialIndex),B=i.ref(null),Y=i.ref(null),K=i.ref(Q.CONTAIN),p=i.reactive({transform:{scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}}),re=i.computed(()=>e.urlList.length>1),J=i.computed(()=>m.value===0),ie=i.computed(()=>m.value===e.urlList.length-1),oe=i.computed(()=>e.urlList[m.value]),se=i.computed(()=>{const{scale:l,deg:N,offsetX:d,offsetY:x,enableTransition:y}=p.transform,C={transform:`scale(${l}) rotate(${N}deg)`,transition:y?"transform .3s":"",marginLeft:`${d}px`,marginTop:`${x}px`};return K.value.name===Q.CONTAIN.name&&(C.maxWidth=C.maxHeight="100%"),C}),le=()=>{ye(document,"keydown",a),ye(document,$e,r),a=null,r=null},xe=()=>{le(),t("close"),p.transform={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},Me=l=>{M.value?M.value=!1:B.value===(l==null?void 0:l.target)&&(I(!1),m.value=e.initialIndex)},ce=()=>{p.transform={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},G=()=>{if(J.value&&!e.infinite)return;const l=e.urlList.length;m.value=(m.value-1+l)%l},f=()=>{if(ie.value&&!e.infinite)return;const l=e.urlList.length;m.value=(m.value+1)%l},A=()=>{if(E.value)return;const l=Object.keys(Q),N=Object.values(Q),d=K.value.name,y=(N.findIndex(C=>C.name===d)+1)%l.length;K.value=Q[l[y]],ce()},v=(l,N={})=>{if(E.value)return;const{zoomRate:d,rotateDeg:x,enableTransition:y}={zoomRate:.2,rotateDeg:90,enableTransition:!0,...N};switch(l){case"zoomOut":p.transform.scale>.2&&(p.transform.scale=Number.parseFloat((p.transform.scale-d).toFixed(3)));break;case"zoomIn":p.transform.scale=Number.parseFloat((p.transform.scale+d).toFixed(3));break;case"clocelise":p.transform.deg+=x;break;case"anticlocelise":p.transform.deg-=x;break}p.transform.enableTransition=y},W=()=>{a=we(l=>{switch(l.code){case j.esc:I(!1);break;case j.space:A();break;case j.left:G();break;case j.up:v("zoomIn");break;case j.right:f();break;case j.down:v("zoomOut");break}}),r=we(l=>{(l.wheelDelta?l.wheelDelta:-l.detail)>0?v("zoomIn",{zoomRate:.015,enableTransition:!1}):v("zoomOut",{zoomRate:.015,enableTransition:!1})}),ae(document,"keydown",a),ae(document,$e,r)},q=()=>{E.value=!1},Ie=l=>{E.value=!1,l.target.alt="加载失败"},U=i.shallowRef(),Ae=l=>{if(E.value||l.button!==0)return;l.preventDefault(),l.stopPropagation(),clearTimeout(U.value),M.value=!0;const{offsetX:N,offsetY:d}=p.transform,x=l.pageX,y=l.pageY;o=we(C=>{p.transform={...p.transform,offsetX:N+C.pageX-x,offsetY:d+C.pageY-y}}),ae(document,"mousemove",o),ae(document,"mouseup",()=>{ye(document,"mousemove",o),b.value&&L.value&&(U.value=setTimeout(()=>{M.value=!1}))})},Ne=[{icon:((fe=e.icons)==null?void 0:fe.close)||i.createVNode(k.CloseOutlined,null,null),onClick:l=>{l.stopPropagation(),I(!1)},type:"close"},{icon:((ue=e.icons)==null?void 0:ue.zoomIn)||i.createVNode(k.ZoomInOutlined,null,null),onClick:l=>{l.stopPropagation(),v("zoomIn")},type:"zoomIn"},{icon:((P=e.icons)==null?void 0:P.zoomOut)||i.createVNode(k.ZoomOutOutlined,null,null),onClick:l=>{l.stopPropagation(),v("zoomOut")},type:"zoomOut"},{icon:((ee=e.icons)==null?void 0:ee.rotateRight)||i.createVNode(k.RotateRightOutlined,null,null),onClick:l=>{l.stopPropagation(),v("anticlocelise")},type:"rotateRight"},{icon:((Fe=e.icons)==null?void 0:Fe.rotateLeft)||i.createVNode(k.RotateLeftOutlined,null,null),onClick:l=>{l.stopPropagation(),v("clocelise")},type:"rotateLeft"}];return i.watch(oe,()=>{i.nextTick(()=>{Y.value.complete||(E.value=!0)})}),i.watch(m,l=>{ce(),t("switch",l)}),i.watch(b,l=>{l&&(L.value=l)}),i.watch([()=>b.value,()=>B.value],([l,N])=>{var d,x;l&&N&&(W(),(x=(d=B.value)==null?void 0:d.focus)==null||x.call(d))}),n({setOpen:F}),()=>{const l=O.getTransitionProps(`${s}-fade`),N=O.getTransitionProps(`${s}-zoom`);return c(i.createVNode(i.Teleport,{to:e.getContainer||"body",disabled:!e.teleported},{default:()=>[b.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,b.value&&L.value]])]}),i.createVNode("div",{ref:B,tabindex:-1,class:[`${s}-wrapper`,`${u.value}`],onClick:d=>e.onHideOnClickModal&&Me(d)},[i.createVNode(i.Transition,i.mergeProps(N,{onAfterLeave:()=>xe()}),{default:()=>{var d,x;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:y=>y.stopPropagation()},[i.createVNode("ul",{class:`${s}-operations ${u.value}`},[Ne.map(({icon:y,onClick:C,type:Ce})=>i.createVNode("li",{class:`${s}-operations-operation ${u.value}`,onClick:C,key:Ce},[i.cloneVNode(y,{class:`${s}-operations-icon ${u.value}`})]))])]),i.createVNode("div",{class:`${s}-canvas ${u.value}`},[e.urlList.map((y,C)=>i.createVNode("img",{ref:Y,class:`${s}-img ${u.value}`,style:{...se.value,display:C===m.value?"block":"none"},key:y,src:y,onLoad:()=>q(),onError:Ce=>Ie(Ce),onMousedown:Ae},null))]),re.value&&i.createVNode("div",{class:[`${s}-switch-left`,m.value===0&&!e.infinite?`${s}-switch-left-disabled`:"",`${u.value}`],onClick:()=>G()},[((d=e.icons)==null?void 0:d.left)||i.createVNode(k.LeftOutlined,null,null)]),re.value&&i.createVNode("div",{class:[`${s}-switch-right`,m.value===e.urlList.length-1&&!e.infinite?`${s}-switch-right-disabled`:"",`${u.value}`],onClick:()=>f()},[((x=e.icons)==null?void 0:x.right)||i.createVNode(k.RightOutlined,null,null)])])])]),[[i.vShow,b.value&&L.value]])]}})])])]}))}}}),Se={width:"100%",height:"100%"},ot=e=>({[e.componentCls]:{display:"inline-block",position:"relative",overflow:"hidden","&-inner":{...Se,verticalAlign:"top",opacity:1},"&-placeholder":{...Se,backgroundColor:e.colorBgContainerDisabled,backgroundImage:"url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundSize:"30%"},"&-error":{...Se,display:"flex",alignItems:"center",justifyContent:"center",color:e.colorText,backgroundColor:e.colorBgContainerDisabled},"&-preview":{cursor:"pointer"}}}),st=e=>e&&e.nodeType===Node.ELEMENT_NODE;let He="";const V=i.defineComponent({props:Z,name:"GImage",emits:["error","click","load"],slots:Object,setup(e,{slots:t,emit:n,attrs:a}){const r=w.getPrefixCls({suffixCls:"image"}),{wrapSSR:o,hashId:s}=O.useProStyle("Image",[ot],r),c=i.ref(),u=i.ref(""),M=i.ref(!1),b=i.ref(!0),F=i.ref(!1),L=i.ref(null),I=i.ref();let E,m;const B=i.computed(()=>!w.isServer&&e.fit?{"object-fit":e.fit}:{}),Y=i.computed(()=>{const{previewSrcList:f}=e;return Array.isArray(f)&&f.length>0}),K=i.computed(()=>{const{src:f,previewSrcList:A,initialIndex:v}=e;if(v||v===0)return A.length>=v?v:0;let W=0;const q=A.indexOf(f);return q>=0&&(W=q),W}),p=f=>{u.value=e.src,b.value=!1,M.value=!1,n("load",f)},re=f=>{b.value=!1,M.value=!0,n("error",f)},J=()=>{if(w.isServer)return;b.value=!0,M.value=!1;const f=new Image;f.onload=A=>p(A),f.onerror=re,Object.keys(a||{}).forEach(A=>{if(A.toLowerCase()==="onload")return;const v=(a||{})[A];f.setAttribute(A,v)}),f.src=e.src},ie=he.useThrottleFn(se,200),oe=()=>{w.isServer||!I.value||!ie||(E(),I.value=void 0)};function se(){w.isInContainer(L.value,I.value)&&(J(),oe())}const le=async()=>{if(w.isServer)return;await i.nextTick();const{scrollContainer:f}=e;st(f)?I.value=f:w.isString(f)&&f!==""?I.value=document.querySelector(f)??void 0:L.value&&(I.value=w.getScrollContainer(L.value)),I.value&&(E=he.useEventListener(I,"scroll",ie),setTimeout(()=>se(),200))},xe=f=>{if(f.ctrlKey){if(f.deltaY<0)return f.preventDefault(),!1;if(f.deltaY>0)return f.preventDefault(),!1}},Me=()=>{!Y.value||e.disablePreview||(m=he.useEventListener("wheel",xe,{passive:!1}),He=document.body.style.overflow,document.body.style.overflow="hidden",F.value=!0)},ce=()=>{m==null||m(),document.body.style.overflow=He,F.value=!1};i.watch(()=>e.src,()=>{e.lazy?(b.value=!0,M.value=!1,oe(),le()):J()});const G=f=>w.isNumber(f)?f+"px":f;return de.onMountedOrActivated(()=>{e.lazy?le():J()}),()=>{const{crossorigin:f,decoding:A,alt:v,sizes:W,srcset:q,usemap:Ie,class:U,style:Ae={}}=a,Ne={crossorigin:f,decoding:A,alt:v,sizes:W,srcset:q,usemap:Ie,style:{...B.value,height:e.height?G(e.height):void 0}},fe=w.getSlotVNode(t,e,"fallback"),ue=w.getSlotVNode(t,e,"placeholder");return i.watchEffect(()=>{var P,ee;Y.value&&F.value?(P=c.value)==null||P.setOpen(!0):(ee=c.value)==null||ee.setOpen(!1)}),o(i.createVNode("div",{class:{[`${s.value}`]:!0,[`${r}`]:!0,[`${U}`]:!!U},ref:P=>L.value=P,style:{width:e.width?G(e.width):void 0,height:e.height?G(e.height):void 0,display:e.lazy?"block":void 0,...Ae},onClick:()=>{n("click")}},[b.value?ue||i.createVNode("div",{class:`${r}-placeholder ${s.value}`},null):M.value?fe||i.createVNode("div",{class:`${r}-error ${s.value}`},[i.createTextVNode("加载失败")]):u.value&&i.createVNode("img",i.mergeProps(Ne,{class:{[`${s.value}`]:!0,[`${e.imageClassName}`]:!!e.imageClassName,[`${r}-inner`]:!0,[`${r}-preview`]:Y.value},alt:e.alt,src:u.value,onClick:()=>Me()}),null),i.createVNode(De,{ref:c,zIndex:e.zIndex,infinite:e.infinite,initialIndex:K.value,urlList:e.previewSrcList,getContainer:e.getContainer,onHideOnClickModal:e.hideOnClickModal,onClose:()=>ce()},null)]))}}});V.isGImage=!0,V.install=e=>(e.component(V.name,V),e),h.GImage=V,h.ImageViewer=De,h.default=V,h.imagePorps=Z,h.imageViewProps=Te,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(v,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("ant-design-vue/es/_util/vue-types"),require("vue"),require("@ant-design/icons-vue"),require("@gx-design-vue/pro-utils"),require("@gx-design-vue/pro-hooks"),require("@gx-design-vue/pro-provider"),require("@ctrl/tinycolor"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","ant-design-vue/es/_util/vue-types","vue","@ant-design/icons-vue","@gx-design-vue/pro-utils","@gx-design-vue/pro-hooks","@gx-design-vue/pro-provider","@ctrl/tinycolor","@vueuse/core"],T):(v=typeof globalThis<"u"?globalThis:v||self,T(v.GImage={},v.PropTypes,v.vue,v.iconsVue,v.proUtils,v.proHooks,v.proProvider,v.tinycolor,v.core))})(this,function(v,T,t,b,u,re,p,U,le){"use strict";const R={infinite:{type:Boolean,default:!0},zIndex:{type:Number,default:2e3},current:{type:Number,default:0},getContainer:{type:String}},G={previewTeleported:{type:Boolean,default:!0},hideOnClickModal:{type:Boolean,default:!0},src:{type:String,default:""},alt:{type:String,default:""},fit:{type:String,default:"contain"},lazy:T.bool,scrollContainer:{type:[String,Object]},placeholder:{type:[Function,Object],default:()=>{}},fallback:{type:[Function,Object],default:()=>{}},onLoad:{type:Function},onError:{type:Function},onClick:{type:Function},previewUrls:{type:Array,default:()=>[]},imageClassName:T.string,imageStyle:T.style,width:T.number,height:T.number,zIndex:R.zIndex,infinite:R.infinite,getContainer:R.getContainer,current:{...R.current,default:()=>{}}},z={previewUrls:{type:Array,default:()=>[]},teleported:G.previewTeleported,zIndex:R.zIndex,current:R.current,infinite:R.infinite,getContainer:G.getContainer,onHideOnClickModal:G.hideOnClickModal,countRender:[Function,Array,Object],icons:{type:Object,default:()=>({})}};function xe(e,n){process.env.NODE_ENV!=="production"&&!e&&console!==void 0&&console.error(`Warning: ${n}`)}const Ae=new p.Keyframe("viewFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),Le=new p.Keyframe("viewFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),Te=new p.Keyframe("viewZoomBadgeIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),be=new p.Keyframe("viewZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),ve=e=>({position:e||"absolute",inset:0});function se(e){return{position:e,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0}}const Re=e=>{const{previewCls:n,modalMaskBg:a,paddingSM:l,marginXL:i,margin:g,paddingLG:c,previewOperationColorDisabled:f,previewOperationHoverColor:E,motionDurationSlow:S,iconCls:I,colorTextLightSolid:M}=e,m=new U.TinyColor(a).setAlpha(.1),d=m.clone().setAlpha(.2);return{[`${n}-footer`]:{position:"fixed",bottom:i,left:{_skip_check_:!0,value:"50%"},display:"flex",flexDirection:"column",alignItems:"center",color:e.previewOperationColor,transform:"translateX(-50%)"},[`${n}-progress`]:{marginBottom:g},[`${n}-close`]:{position:"fixed",top:i,right:{_skip_check_:!0,value:i},display:"flex",color:M,backgroundColor:m.toRgbString(),borderRadius:"50%",padding:l,outline:0,border:0,cursor:"pointer",transition:`all ${S}`,"&:hover":{backgroundColor:d.toRgbString()},[`& > ${I}`]:{fontSize:e.previewOperationSize}},[`${n}-operations`]:{display:"flex",alignItems:"center",padding:`0 ${p.unit(c)}`,backgroundColor:m.toRgbString(),borderRadius:100,"&-operation":{marginInlineStart:l,padding:l,cursor:"pointer",transition:`all ${S}`,userSelect:"none",[`&:not(${n}-operations-operation-disabled):hover > ${I}`]:{color:E},"&-disabled":{color:f,cursor:"not-allowed"},"&:first-of-type":{marginInlineStart:0},[`& > ${I}`]:{fontSize:e.previewOperationSize}}}}},Pe=e=>{const{modalMaskBg:n,iconCls:a,previewOperationColorDisabled:l,previewCls:i,zIndexPopup:g,motionDurationSlow:c}=e,f=new U.TinyColor(n).setAlpha(.1),E=f.clone().setAlpha(.2);return{[`${i}-switch-left, ${i}-switch-right`]:{position:"fixed",insetBlockStart:"50%",zIndex:e.calc(g).add(1).equal(),display:"flex",alignItems:"center",justifyContent:"center",width:e.imagePreviewSwitchSize,height:e.imagePreviewSwitchSize,marginTop:e.calc(e.imagePreviewSwitchSize).mul(-1).div(2).equal(),color:e.previewOperationColor,background:f.toRgbString(),borderRadius:"50%",transform:"translateY(-50%)",cursor:"pointer",transition:`all ${c}`,userSelect:"none","&:hover":{background:E.toRgbString()},"&-disabled":{"&, &:hover":{color:l,background:"transparent",cursor:"not-allowed",[`> ${a}`]:{cursor:"not-allowed"}}},[`> ${a}`]:{fontSize:e.previewOperationSize}},[`${i}-switch-left`]:{insetInlineStart:e.marginSM},[`${i}-switch-right`]:{insetInlineEnd:e.marginSM}}},$e=e=>({[e.componentCls]:{height:"100%",textAlign:"center",pointerEvents:"none","&-root":{...se("fixed"),zIndex:e.zIndexPopup,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"},"&-wrap":{...se("fixed"),zIndex:e.zIndexPopup,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"},"&-mask":{...se("fixed"),zIndex:e.zIndexPopupBase,height:"100%",backgroundColor:e.colorBgMask},"&-body":{...ve(),overflow:"hidden"},"&-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","&-wrapper":{...ve(),display:"flex",justifyContent:"center",alignItems:"center",transition:`transform ${e.motionDurationSlow} ${e.motionEaseOut} 0s`,"&::before":{display:"inline-block",width:1,height:"50%",marginInlineEnd:-1,content:'""'}}},"&-fade-appear, &-fade-enter":{animationName:Ae,animationDuration:e.motionDurationSlow,animationTimingFunction:"linear"},"&-fade-leave":{animationName:Le,animationDuration:e.motionDurationSlow,animationTimingFunction:"linear"},"&-zoom-appear, &-zoom-enter":{animationName:Te,opacity:0,animationTimingFunction:e.motionEaseOutCirc,animationFillMode:"both",transform:"none",animationDuration:e.motionDurationSlow,userSelect:"none"},"&-zoom-enter-active":{animationPlayState:"running"},"&-zoom-leave":{animationName:be,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%"},"&":[Re(e),Pe(e)]});function De(e){return p.useStyle("ImageViewer",n=>{const a=p.mergeToken(n,{zIndexPopup:n.zIndexPopupBase+80,previewOperationColorDisabled:new U.TinyColor(n.colorTextLightSolid).setAlpha(.25).toRgbString(),previewOperationHoverColor:new U.TinyColor(n.colorTextLightSolid).setAlpha(.85).toRgbString(),modalMaskBg:new U.TinyColor("#000").setAlpha(.45).toRgbString(),previewOperationColor:new U.TinyColor(n.colorTextLightSolid).toRgbString(),previewOperationSize:n.fontSizeIcon*1.5,imagePreviewSwitchSize:n.controlHeightLG,iconCls:"anticon",previewCls:n.componentCls});return[$e(a)]},e)}function ze(e){const n=e.getBoundingClientRect(),a=document.documentElement;return{left:n.left+(window.scrollX||a.scrollLeft)-(a.clientLeft||document.body.clientLeft||0),top:n.top+(window.scrollY||a.scrollTop)-(a.clientTop||document.body.clientTop||0)}}function _e(){const e=document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight;return{width:e,height:n}}function Se(e,n,a,l){const i=n+a,g=(a-l)/2;if(a>l){if(n>0)return{[e]:g};if(n<0&&i<l)return{[e]:-g}}else if(n<0||i>l)return{[e]:n<0?g:-g};return{}}function Ve(e,n,a,l){const{width:i,height:g}=_e();let c=null;return e<=i&&n<=g?c={x:0,y:0}:(e>i||n>g)&&(c={...Se("x",a,e,i),...Se("y",l,n,g)}),c}let he=!1;try{const e=Object.defineProperty({},"passive",{get(){he=!0}});window.addEventListener("testPassive",null,e),window.removeEventListener("testPassive",null,e)}catch{}function B(e,n,a,l){if(e&&e.addEventListener){let i=l;i===void 0&&he&&(n==="touchstart"||n==="touchmove"||n==="wheel")&&(i={passive:!1}),e.addEventListener(n,a,i)}return{remove:()=>{e&&e.removeEventListener&&e.removeEventListener(n,a)}}}const r={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(n){const{keyCode:a}=n;if(n.altKey&&!n.ctrlKey||n.metaKey||a>=r.F1&&a<=r.F12)return!1;switch(a){case r.ALT:case r.CAPS_LOCK:case r.CONTEXT_MENU:case r.CTRL:case r.DOWN:case r.END:case r.ESC:case r.HOME:case r.INSERT:case r.LEFT:case r.MAC_FF_META:case r.META:case r.NUMLOCK:case r.NUM_CENTER:case r.PAGE_DOWN:case r.PAGE_UP:case r.PAUSE:case r.PRINT_SCREEN:case r.RIGHT:case r.SHIFT:case r.UP:case r.WIN_KEY:case r.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(n){if(n>=r.ZERO&&n<=r.NINE||n>=r.NUM_ZERO&&n<=r.NUM_MULTIPLY||n>=r.A&&n<=r.Z||window.navigator.userAgent.includes("WebKit")&&n===0)return!0;switch(n){case r.SPACE:case r.QUESTION_MARK:case r.NUM_PLUS:case r.NUM_MINUS:case r.NUM_PERIOD:case r.NUM_DIVISION:case r.SEMICOLON:case r.DASH:case r.EQUALS:case r.COMMA:case r.PERIOD:case r.SLASH:case r.APOSTROPHE:case r.SINGLE_QUOTE:case r.OPEN_SQUARE_BRACKET:case r.BACKSLASH:case r.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}};let Ne=e=>setTimeout(e,16),Ie=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(Ne=e=>window.requestAnimationFrame(e),Ie=e=>window.cancelAnimationFrame(e));let Ce=0;const ce=new Map;function Ee(e){ce.delete(e)}function ue(e,n=1){Ce+=1;const a=Ce;function l(i){if(i===0)Ee(a),e();else{const g=Ne(()=>{l(i-1)});ce.set(a,g)}}return l(n),a}ue.cancel=e=>{const n=ce.get(e);return Ee(n),Ie(n)};function Fe(e){const n=t.ref(null),a=t.reactive({...e}),l=t.ref([]),i=g=>{n.value===null&&(l.value=[],n.value=ue(()=>{let c;l.value.forEach(f=>{c={...c,...f}}),Object.assign(a,c),n.value=null})),l.value.push(g)};return t.onMounted(()=>{n.value&&ue.cancel(n.value)}),[a,i]}const Ue=t.defineComponent({name:"Operations",inheritAttrs:!1,props:{open:Boolean,count:{type:Number,default:0},current:{type:Number,default:0},showSwitch:Boolean,showProgress:Boolean,prefixCls:String,hashId:String,zIndex:z.zIndex,icons:z.icons,infinite:z.infinite,getContainer:z.getContainer,countRender:z.countRender,tools:Array,onClose:Function,onActive:Function},setup(e){const n=(a,l)=>{var i;a.preventDefault(),a.stopPropagation(),(i=e.onActive)==null||i.call(e,l)};return()=>{const{prefixCls:a,hashId:l,tools:i}=e,g=p.getTransitionProps(`${e.prefixCls}-fade`),c=`${a}-operations-operation`,f=`${a}-operations-icon`;return t.createVNode(t.Teleport,{to:e.getContainer||"body"},{default:()=>[t.createVNode(t.Transition,g,{default:()=>{var E,S,I,M;return[t.withDirectives(t.createVNode("div",{class:u.classNames(`${a}-operations-wrapper`,l),style:{zIndex:e.zIndex}},[((E=e.icons)==null?void 0:E.close)===null?null:t.createVNode("button",{class:`${a}-close ${l}`,onClick:e.onClose},[((S=e.icons)==null?void 0:S.close)||t.createVNode(b.CloseOutlined,null,null)]),e.showSwitch&&t.createVNode(t.Fragment,null,[t.createVNode("div",{class:u.classNames(`${a}-switch-left ${l}`,{[`${a}-switch-left-disabled`]:e.infinite?!1:e.current===0}),onClick:m=>n(m,-1)},[((I=e.icons)==null?void 0:I.left)||t.createVNode(b.LeftOutlined,null,null)]),t.createVNode("div",{className:u.classNames(`${a}-switch-right ${l}`,{[`${a}-switch-right-disabled`]:e.infinite?!1:e.current===e.count-1}),onClick:m=>n(m,1)},[((M=e.icons)==null?void 0:M.right)||t.createVNode(b.RightOutlined,null,null)])]),t.createVNode("div",{class:`${a}-footer ${l}`},[e.showProgress&&t.createVNode("div",{class:`${a}-progress`},[e.countRender?e.countRender(e.current+1,e.count):`${e.current+1} / ${e.count}`]),t.createVNode("div",{class:`${e.prefixCls}-operations`},[i==null?void 0:i.map(({icon:m,onClick:d,type:O,disabled:h})=>t.createVNode("div",{class:u.classNames(c,{[`${e.prefixCls}-operations-operation-disabled`]:h&&(h==null?void 0:h.value)}),onClick:d,key:O},[t.cloneVNode(m,{class:f})]))])])]),[[t.vShow,e.open]])]}})]})}}}),_={x:0,y:0},j={rotateLeft:t.createVNode(b.RotateLeftOutlined,null,null),rotateRight:t.createVNode(b.RotateRightOutlined,null,null),zoomIn:t.createVNode(b.ZoomInOutlined,null,null),zoomOut:t.createVNode(b.ZoomOutOutlined,null,null),flipX:t.createVNode(b.SwapOutlined,null,null),flipY:t.createVNode(b.SwapOutlined,{rotate:90},null)},ye=t.defineComponent({name:"GImageViewer",props:z,inheritAttrs:!1,emits:["close","switch","afterClose"],setup:(e,{emit:n,expose:a,slots:l})=>{const i=u.getPrefixCls({suffixCls:"image-view"}),{wrapSSR:g,hashId:c}=De(i),[f,E]=re.useState(!1),[S,I]=re.useState(!1),M=t.ref(null),m=t.ref(e.current),d=t.shallowRef(1),O=t.shallowRef(0),h=t.shallowRef(!1),x=t.reactive({x:1,y:1}),[C,P]=Fe(_),X=t.shallowRef({wheelDirection:0}),V=t.shallowRef(),A=t.reactive({originX:0,originY:0,deltaX:0,deltaY:0}),F=t.reactive(new Map),K=t.computed(()=>new Map(Array.from(F).map(([o,{url:w}])=>[o,w]))),k=t.computed(()=>K.value.get(m.value)),Y=t.computed(()=>K.value.size),Z=t.computed(()=>Array.from(K.value.keys())),$=t.computed(()=>Z.value.indexOf(m.value)),q=t.computed(()=>Y.value>1),Q=t.computed(()=>Y.value>=1);t.watch(f,o=>{o&&(S.value=!0)});const s=o=>{m.value=o};t.watch(()=>e.current,o=>{u.isNumber(o)&&s(o)});function N(o,w){F.set(o,{url:w,loading:!0,canPreview:!1})}const L=()=>{I(!1),m.value=e.current},W=()=>{d.value=1,O.value=0,x.x=1,x.y=1,P(_),n("close")},fe=o=>{h.value||M.value===(o==null?void 0:o.target)&&L()},ge=()=>{const o=F.get(m.value);o&&(o.loading=!1,o.canPreview=!0)},J=o=>{const w=F.get(m.value);w&&(w.loading=!1,w.canPreview=!1),o.target.alt="加载失败"},ee=()=>{if($.value>0||e.infinite){const o=$.value-1<0?e.previewUrls.length-1:$.value-1;s(Z.value[o])}},te=()=>{if($.value<Y.value-1||e.infinite){const o=$.value+1>e.previewUrls.length-1?0:$.value+1;s(Z.value[o])}},ne=o=>{o?d.value+=.5:d.value++,P(_)},oe=o=>{d.value>1&&(o?d.value-=.5:d.value--),P(_)},me=()=>{O.value+=90},Ke=()=>{O.value-=90},Ye=()=>{x.x=-x.x},We=()=>{x.y=-x.y},Ge=[{icon:u.getSlotVNode(l,e.icons,"zoomIn")||j.zoomIn,onClick:()=>ne(),type:"zoomIn"},{icon:u.getSlotVNode(l,e.icons,"zoomOut")||j.zoomOut,onClick:()=>oe(),type:"zoomOut",disabled:t.computed(()=>d.value===1)},{icon:u.getSlotVNode(l,e.icons,"rotateRight")||j.rotateRight,onClick:me,type:"rotateRight"},{icon:u.getSlotVNode(l,e.icons,"rotateLeft")||j.rotateLeft,onClick:Ke,type:"rotateLeft"},{icon:u.getSlotVNode(l,e.icons,"flipX")||j.flipX,onClick:Ye,type:"flipX"},{icon:u.getSlotVNode(l,e.icons,"flipY")||j.flipY,onClick:We,type:"flipY"}],Me=()=>{if(f.value&&h.value&&V.value){const o=V.value.offsetWidth*d.value,w=V.value.offsetHeight*d.value,{left:D,top:y}=ze(V.value),ie=O.value%180!==0;h.value=!1;const ae=Ve(ie?w:o,ie?o:w,D,y);ae&&P({...ae})}},Xe=o=>{o.button===0&&(o.preventDefault(),o.stopPropagation(),A.deltaX=o.pageX-C.x,A.deltaY=o.pageY-C.y,A.originX=C.x,A.originY=C.y,h.value=!0)},Oe=o=>{f.value&&h.value&&P({x:o.pageX-A.deltaX,y:o.pageY-A.deltaY})},Ze=o=>{if(!f.value)return;o.preventDefault();const w=o.deltaY;X.value={wheelDirection:w}},Qe=o=>{!f.value||!q.value||(o.keyCode===r.LEFT?ee():o.keyCode===r.RIGHT&&te())},ke=()=>{f.value&&(d.value!==1&&(d.value=1),(C.x!==_.x||C.y!==_.y)&&P(_))};let we=()=>{};return t.onMounted(()=>{t.watch(()=>e.previewUrls,o=>{u.isArray(o)&&o.forEach((w,D)=>{N(D,w)})},{flush:"post",immediate:!0}),t.watch([()=>f.value,h],()=>{we();let o,w;const D=B(window,"mouseup",Me,!1),y=B(window,"mousemove",Oe,!1),ie=B(window,"wheel",Ze,{passive:!1}),ae=B(window,"keydown",Qe,!1);try{window.top!==window.self&&(o=B(window.top,"mouseup",Me,!1),w=B(window.top,"mousemove",Oe,!1))}catch(qe){xe(!1,`[vc-image] ${qe}`)}we=()=>{D.remove(),y.remove(),ie.remove(),ae.remove(),o&&o.remove(),w&&w.remove()}},{flush:"post",immediate:!0}),t.watch([X],()=>{const{wheelDirection:o}=X.value;o>0?oe(!0):o<0&&ne(!0)})}),t.onUnmounted(()=>{we()}),a({setOpen:E}),()=>{const o=p.getTransitionProps(`${i}-fade`),w=p.getTransitionProps(`${i}-zoom`),D={};for(const y in e.icons)D[y]=u.getSlotVNode(l,e.icons,y);return g(t.createVNode(t.Fragment,null,[t.createVNode(t.Teleport,{to:e.getContainer||"body",disabled:!e.teleported},{default:()=>[f.value&&t.createVNode(t.Fragment,null,[t.createVNode("div",{class:`${i}-root ${c.value}`},[t.createVNode(t.Transition,o,{default:()=>[t.withDirectives(t.createVNode("div",{class:`${i}-mask ${c.value}`},null),[[t.vShow,f.value&&S.value]])]}),t.createVNode("div",{ref:M,tabindex:-1,class:[`${i}-wrap`,`${c.value}`],onClick:y=>e.onHideOnClickModal&&fe(y)},[t.createVNode(t.Transition,t.mergeProps(w,{onAfterLeave:()=>W()}),{default:()=>[t.withDirectives(t.createVNode("div",{role:"dialog",class:`${i} ${c.value}`},[t.createVNode("div",{class:`${i}-content ${c.value}`},[t.createVNode("div",{class:`${i}-body ${c.value}`},[t.createVNode("div",{class:`${i}-img-wrapper ${c.value}`,style:{transform:`translate3d(${C.x}px, ${C.y}px, 0)`}},[t.createVNode("img",{onMousedown:Xe,onDblclick:ke,ref:V,class:`${i}-img ${c.value}`,src:k.value,onLoad:()=>ge(),onError:y=>J(y),style:{transform:`scale3d(${x.x*d.value}, ${x.y*d.value}, 1) rotate(${O.value}deg)`}},null)])])])]),[[t.vShow,f.value&&S.value]])]})])])])]}),f.value&&S.value&&t.createVNode(Ue,{open:f.value&&S.value,hashId:c.value,count:e.previewUrls.length,current:m.value,zIndex:e.zIndex+1,getContainer:e.getContainer,prefixCls:i,icons:D,tools:Ge,infinite:e.infinite,countRender:u.getSlot(l,e,"countRenders"),showSwitch:q.value,showProgress:Q.value,onClose:L,onActive:y=>y>0?te():ee()},null)]))}}}),de={width:"100%",height:"100%"},Be=()=>({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",opacity:0}),je=e=>({[e.componentCls]:{display:"inline-block",position:"relative",overflow:"hidden","&-inner":{...de,verticalAlign:"top",opacity:1,[`&${e.componentCls}-inner-preview`]:{userSelect:"none"}},"&-placeholder":{...de,backgroundColor:e.colorBgContainerDisabled,backgroundImage:"url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTQuNSAyLjVoLTEzQS41LjUgMCAwIDAgMSAzdjEwYS41LjUgMCAwIDAgLjUuNWgxM2EuNS41IDAgMCAwIC41LS41VjNhLjUuNSAwIDAgMC0uNS0uNXpNNS4yODEgNC43NWExIDEgMCAwIDEgMCAyIDEgMSAwIDAgMSAwLTJ6bTguMDMgNi44M2EuMTI3LjEyNyAwIDAgMS0uMDgxLjAzSDIuNzY5YS4xMjUuMTI1IDAgMCAxLS4wOTYtLjIwN2wyLjY2MS0zLjE1NmEuMTI2LjEyNiAwIDAgMSAuMTc3LS4wMTZsLjAxNi4wMTZMNy4wOCAxMC4wOWwyLjQ3LTIuOTNhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTUuMDE2IDMuNTg4IDQuMjQ0YS4xMjcuMTI3IDAgMCAxLS4wMi4xNzV6IiBmaWxsPSIjOEM4QzhDIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4=')",backgroundRepeat:"no-repeat",backgroundPosition:"center center",backgroundSize:"30%"},"&-error":{...de,display:"flex",alignItems:"center",justifyContent:"center",color:e.colorText,backgroundColor:e.colorBgContainerDisabled},"&-preview":Be()}}),He=e=>e&&e.nodeType===Node.ELEMENT_NODE;let pe="";const H=t.defineComponent({props:G,name:"GImage",emits:["error","click","load"],slots:Object,setup(e,{slots:n,emit:a,attrs:l}){const i=u.getPrefixCls({suffixCls:"image"}),{wrapSSR:g,hashId:c}=p.useProStyle("Image",[je],i),f=t.ref(),E=t.ref(""),S=t.ref(!1),I=t.ref(!0),M=t.ref(!1),m=t.ref(null),d=t.ref();let O,h;const x=t.computed(()=>!u.isServer&&e.fit?{"object-fit":e.fit}:{}),C=t.computed(()=>u.isArray(e.previewUrls)&&e.previewUrls.length>0),P=t.computed(()=>{const{src:s,previewUrls:N,current:L}=e;if(u.isNumber(L))return N.length>=L?L:0;const W=N.indexOf(s);return W>=0?W:0}),X=s=>{E.value=e.src,I.value=!1,S.value=!1,a("load",s)},V=s=>{I.value=!1,S.value=!0,a("error",s)},A=()=>{if(u.isServer)return;I.value=!0,S.value=!1;const s=new Image;s.onload=N=>X(N),s.onerror=V,Object.keys(l||{}).forEach(N=>{if(N.toLowerCase()==="onload")return;const L=(l||{})[N];s.setAttribute(N,L)}),s.src=e.src},F=le.useThrottleFn(k,200),K=()=>{u.isServer||!d.value||!F||(O(),d.value=void 0)};function k(){u.isInContainer(m.value,d.value)&&(A(),K())}const Y=async()=>{if(u.isServer)return;await t.nextTick();const{scrollContainer:s}=e;He(s)?d.value=s:u.isString(s)&&s!==""?d.value=document.querySelector(s)??void 0:m.value&&(d.value=u.getScrollContainer(m.value)),d.value&&(O=le.useEventListener(d,"scroll",F),setTimeout(()=>k(),200))},Z=s=>{if(s.ctrlKey){if(s.deltaY<0)return s.preventDefault(),!1;if(s.deltaY>0)return s.preventDefault(),!1}},$=()=>{C.value&&(h=le.useEventListener("wheel",Z,{passive:!1}),pe=document.body.style.overflow,document.body.style.overflow="hidden",M.value=!0)},q=()=>{h==null||h(),document.body.style.overflow=pe,M.value=!1};t.watch(()=>e.src,()=>{e.lazy?(I.value=!0,S.value=!1,K(),Y()):A()}),t.watchEffect(()=>{var s,N;C.value&&M.value?(s=f.value)==null||s.setOpen(!0):(N=f.value)==null||N.setOpen(!1)});const Q=s=>u.isNumber(s)?s+"px":s;return re.onMountedOrActivated(()=>{e.lazy?Y():A()}),()=>{const{crossorigin:s,decoding:N,alt:L,sizes:W,srcset:fe,usemap:ge,class:J,style:ee={}}=l,te={crossorigin:s,decoding:N,alt:L,sizes:W,srcset:fe,usemap:ge,style:{...x.value,height:e.height?Q(e.height):void 0}},ne=u.getSlotVNode(n,e,"fallback"),oe=u.getSlotVNode(n,e,"placeholder");return g(t.createVNode("div",{class:{[`${c.value}`]:!0,[`${i}`]:!0,[`${J}`]:!!J},ref:me=>m.value=me,style:{width:e.width?Q(e.width):void 0,height:e.height?Q(e.height):void 0,display:e.lazy?"block":void 0,...ee},onClick:()=>{a("click")}},[I.value?oe||t.createVNode("div",{class:`${i}-placeholder ${c.value}`},null):S.value?ne||t.createVNode("div",{class:`${i}-error ${c.value}`},[t.createTextVNode("加载失败")]):E.value&&t.createVNode("img",t.mergeProps(te,{class:{[`${c.value}`]:!0,[`${e.imageClassName}`]:!!e.imageClassName,[`${i}-inner`]:!0,[`${i}-inner-preview`]:C.value},alt:e.alt,src:E.value}),null),C.value&&t.createVNode("div",{class:`${i}-preview ${c.value}`,onClick:()=>$()},null),t.createVNode(ye,{ref:f,zIndex:e.zIndex,infinite:e.infinite,current:P.value,previewUrls:e.previewUrls,getContainer:e.getContainer,onClose:()=>q()},null)]))}}});H.isGImage=!0,H.install=e=>(e.component(H.name,H),e),v.GImage=H,v.ImagePreview=ye,v.baseProps=R,v.default=H,v.imagePorps=G,v.imagePreviewProps=z,Object.defineProperties(v,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/dist/index.d.ts CHANGED
@@ -1,5 +1,9 @@
1
+ import imagePreviewProps, { type PreviewPropsIcons } from './ImagePreview/props';
1
2
  export * from './props';
2
3
  export type { GImageProps } from './Image';
3
- export { default as ImageViewer } from './components/ImageViewer';
4
+ export type { ImagePreviewProps } from './ImagePreview';
5
+ export type { PreviewPropsIcons };
6
+ export { imagePreviewProps };
7
+ export { default as ImagePreview } from './ImagePreview';
4
8
  export { default } from './Image';
5
9
  export { default as GImage } from './Image';
package/dist/props.d.ts CHANGED
@@ -1,13 +1,21 @@
1
- import type { PropType, VNode } from 'vue';
1
+ import type { PropType } from 'vue';
2
2
  import type { CustomRender, WithFalse } from '@gx-design-vue/pro-utils';
3
- type PreviewPropsIons = {
4
- rotateLeft?: VNode;
5
- rotateRight?: VNode;
6
- zoomIn?: VNode;
7
- zoomOut?: VNode;
8
- close?: VNode;
9
- left?: VNode;
10
- right?: VNode;
3
+ export declare const baseProps: {
4
+ infinite: {
5
+ type: PropType<boolean>;
6
+ default: boolean;
7
+ };
8
+ zIndex: {
9
+ type: PropType<number>;
10
+ default: number;
11
+ };
12
+ current: {
13
+ type: PropType<number>;
14
+ default: number;
15
+ };
16
+ getContainer: {
17
+ type: PropType<string>;
18
+ };
11
19
  };
12
20
  export declare const imagePorps: {
13
21
  previewTeleported: {
@@ -53,10 +61,7 @@ export declare const imagePorps: {
53
61
  onClick: {
54
62
  type: PropType<(info: any) => void>;
55
63
  };
56
- disablePreview: import("vue-types").VueTypeValidableDef<boolean> & {
57
- default: boolean;
58
- };
59
- previewSrcList: {
64
+ previewUrls: {
60
65
  type: PropType<string[]>;
61
66
  default: () => string[];
62
67
  };
@@ -81,42 +86,8 @@ export declare const imagePorps: {
81
86
  getContainer: {
82
87
  type: PropType<string>;
83
88
  };
84
- initialIndex: {
89
+ current: {
85
90
  default: () => undefined;
86
91
  type: PropType<number>;
87
92
  };
88
93
  };
89
- export declare const imageViewProps: {
90
- urlList: {
91
- type: PropType<string[]>;
92
- default: () => never[];
93
- };
94
- teleported: {
95
- type: PropType<boolean>;
96
- default: boolean;
97
- };
98
- zIndex: {
99
- type: PropType<number>;
100
- default: number;
101
- };
102
- initialIndex: {
103
- type: PropType<number>;
104
- default: number;
105
- };
106
- infinite: {
107
- type: PropType<boolean>;
108
- default: boolean;
109
- };
110
- getContainer: {
111
- type: PropType<string>;
112
- };
113
- onHideOnClickModal: {
114
- type: PropType<boolean>;
115
- default: boolean;
116
- };
117
- icons: {
118
- type: PropType<PreviewPropsIons>;
119
- default: () => PreviewPropsIons;
120
- };
121
- };
122
- export {};
package/dist/style.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import type { CSSObject } from 'ant-design-vue';
1
2
  import type { GenerateStyle } from 'ant-design-vue/es/theme/internal';
2
3
  import type { ProAliasToken } from '@gx-design-vue/pro-provider';
4
+ export declare const genImageMaskStyle: () => CSSObject;
3
5
  export declare const genImageStyle: GenerateStyle<ProAliasToken>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gx-design-vue/image",
3
- "version": "0.2.0-beta.21",
3
+ "version": "0.2.0-beta.22",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "vite build",
@@ -25,9 +25,9 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@vueuse/core": "^9.10.0",
28
- "@gx-design-vue/pro-utils": "^0.2.0-beta.42",
29
- "@gx-design-vue/pro-hooks": "^0.2.0-beta.31",
30
- "@gx-design-vue/pro-provider": "^0.1.0-beta.85"
28
+ "@gx-design-vue/pro-utils": "^0.2.0-beta.47",
29
+ "@gx-design-vue/pro-hooks": "^0.2.0-beta.32",
30
+ "@gx-design-vue/pro-provider": "^0.1.0-beta.94"
31
31
  },
32
32
  "devDependencies": {
33
33
  "typescript": "^5.3.3"
@@ -1,123 +0,0 @@
1
- export declare const on: (element: HTMLElement | Document | Window | null, event: string, handler: EventListenerOrEventListenerObject, useCapture?: boolean) => void;
2
- export declare const off: (element: HTMLElement | Document | Window | null, event: string, handler: EventListenerOrEventListenerObject, useCapture?: boolean) => void;
3
- export type AnyFunction<T> = (...args: any[]) => T;
4
- export type ImageViewerAction = 'zoomIn' | 'zoomOut' | 'clocelise' | 'anticlocelise';
5
- export declare const isFirefox: () => boolean;
6
- export declare function rafThrottle<T extends AnyFunction<any>>(fn: T): AnyFunction<void>;
7
- declare const GImageViewer: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
- urlList: {
9
- type: import("vue").PropType<string[]>;
10
- default: () => never[];
11
- };
12
- teleported: {
13
- type: import("vue").PropType<boolean>;
14
- default: boolean;
15
- };
16
- zIndex: {
17
- type: import("vue").PropType<number>;
18
- default: number;
19
- };
20
- initialIndex: {
21
- type: import("vue").PropType<number>;
22
- default: number;
23
- };
24
- infinite: {
25
- type: import("vue").PropType<boolean>;
26
- default: boolean;
27
- };
28
- getContainer: {
29
- type: import("vue").PropType<string>;
30
- };
31
- onHideOnClickModal: {
32
- type: import("vue").PropType<boolean>;
33
- default: boolean;
34
- };
35
- icons: {
36
- type: import("vue").PropType<{
37
- rotateLeft?: import("vue").VNode;
38
- rotateRight?: import("vue").VNode;
39
- zoomIn?: import("vue").VNode;
40
- zoomOut?: import("vue").VNode;
41
- close?: import("vue").VNode;
42
- left?: import("vue").VNode;
43
- right?: import("vue").VNode;
44
- }>;
45
- default: () => {
46
- rotateLeft?: import("vue").VNode;
47
- rotateRight?: import("vue").VNode;
48
- zoomIn?: import("vue").VNode;
49
- zoomOut?: import("vue").VNode;
50
- close?: import("vue").VNode;
51
- left?: import("vue").VNode;
52
- right?: import("vue").VNode;
53
- };
54
- };
55
- }>, () => import("ant-design-vue/es/_util/type").VueNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "switch")[], "close" | "switch", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
56
- urlList: {
57
- type: import("vue").PropType<string[]>;
58
- default: () => never[];
59
- };
60
- teleported: {
61
- type: import("vue").PropType<boolean>;
62
- default: boolean;
63
- };
64
- zIndex: {
65
- type: import("vue").PropType<number>;
66
- default: number;
67
- };
68
- initialIndex: {
69
- type: import("vue").PropType<number>;
70
- default: number;
71
- };
72
- infinite: {
73
- type: import("vue").PropType<boolean>;
74
- default: boolean;
75
- };
76
- getContainer: {
77
- type: import("vue").PropType<string>;
78
- };
79
- onHideOnClickModal: {
80
- type: import("vue").PropType<boolean>;
81
- default: boolean;
82
- };
83
- icons: {
84
- type: import("vue").PropType<{
85
- rotateLeft?: import("vue").VNode;
86
- rotateRight?: import("vue").VNode;
87
- zoomIn?: import("vue").VNode;
88
- zoomOut?: import("vue").VNode;
89
- close?: import("vue").VNode;
90
- left?: import("vue").VNode;
91
- right?: import("vue").VNode;
92
- }>;
93
- default: () => {
94
- rotateLeft?: import("vue").VNode;
95
- rotateRight?: import("vue").VNode;
96
- zoomIn?: import("vue").VNode;
97
- zoomOut?: import("vue").VNode;
98
- close?: import("vue").VNode;
99
- left?: import("vue").VNode;
100
- right?: import("vue").VNode;
101
- };
102
- };
103
- }>> & Readonly<{
104
- onSwitch?: ((...args: any[]) => any) | undefined;
105
- onClose?: ((...args: any[]) => any) | undefined;
106
- }>, {
107
- zIndex: number;
108
- infinite: boolean;
109
- urlList: string[];
110
- teleported: boolean;
111
- initialIndex: number;
112
- onHideOnClickModal: boolean;
113
- icons: {
114
- rotateLeft?: import("vue").VNode;
115
- rotateRight?: import("vue").VNode;
116
- zoomIn?: import("vue").VNode;
117
- zoomOut?: import("vue").VNode;
118
- close?: import("vue").VNode;
119
- left?: import("vue").VNode;
120
- right?: import("vue").VNode;
121
- };
122
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
123
- export default GImageViewer;