mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-16 12:18:10 +00:00
1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
|
|
"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[3797],{72547:function(e,t,n){n.d(t,{Z:function(){return o}});const o=e=>e?"function"==typeof e?e():e:null},33797:function(e,t,n){n.d(t,{Z:function(){return P}});var o=n(44194),r=n(51865),i=n.n(r),a=n(20488),l=n(65489),s=n(28440),c=n(31246),d=n(1648),p=n(64357),u=n(48406);var g=o.createContext({}),m=n(59199),f=n(54184),v=n(51858),b=n(77167);const y=e=>{const{antCls:t,componentCls:n,iconCls:o,avatarBg:r,avatarColor:i,containerSize:a,containerSizeLG:l,containerSizeSM:s,textFontSize:c,textFontSizeLG:d,textFontSizeSM:p,iconFontSize:u,iconFontSizeLG:g,iconFontSizeSM:v,borderRadius:b,borderRadiusLG:y,borderRadiusSM:h,lineWidth:x,lineType:O}=e,S=(e,t,r,i)=>({width:e,height:e,borderRadius:"50%",fontSize:t,[`&${n}-square`]:{borderRadius:i},[`&${n}-icon`]:{fontSize:r,[`> ${o}`]:{margin:0}}});return{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,f.Wf)(e)),{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",overflow:"hidden",color:i,whiteSpace:"nowrap",textAlign:"center",verticalAlign:"middle",background:r,border:`${(0,m.bf)(x)} ${O} transparent`,"&-image":{background:"transparent"},[`${t}-image-img`]:{display:"block"}}),S(a,c,u,b)),{"&-lg":Object.assign({},S(l,d,g,y)),"&-sm":Object.assign({},S(s,p,v,h)),"> img":{display:"block",width:"100%",height:"100%",objectFit:"cover"}})}},h=e=>{const{componentCls:t,groupBorderColor:n,groupOverlapping:o,groupSpace:r}=e;return{[`${t}-group`]:{display:"inline-flex",[t]:{borderColor:n},"> *:not(:first-child)":{marginInlineStart:o}},[`${t}-group-popover`]:{[`${t} + ${t}`]:{marginInlineStart:r}}}};var x=(0,v.I$)("Avatar",(e=>{const{colorTextLightSolid:t,colorTextPlaceholder:n}=e,o=(0,b.IX)(e,{avatarBg:n,avatarColor:t});return[y(o),h(o)]}),(e=>{const{controlHeight:t,controlHeightLG:n,controlHeightSM:o,fontSize:r,fontSizeLG:i,fontSizeXL:a,fontSizeHeading3:l,marginXS:s,marginXXS:c,colorBorderBg:d}=e;return{containerSize:t,containerSizeLG:n,containerSizeSM:o,textFontSize:r,textFontSizeLG:r,textFontSizeSM:r,iconFontSize:Math.round((i+a)/2),iconFontSizeLG:l,iconFontSizeSM:r,groupSpace:c,groupOverlapping:-s,groupBorderColor:d}})),O=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const S=o.forwardRef(((e,t)=>{const{prefixCls:n,shape:r,size:m,src:f,srcSet:v,icon:b,className:y,rootClassName:h,style:S,alt:C,draggable:$,children:j,crossOrigin:z,gap:E=4,onError:w}=e,N=O(e,["prefixCls","shape","size","src","srcSet","icon","className","rootClassName","style","alt","draggable","children","crossOrigin","gap","onError"]),[P,k]=o.useState(1),[Z,B]=o.useState(!1),[W,M]=o.useState(!0),I=o.useRef(null),L=o.useRef(null),F=(0,l.sQ)(t,I),{getPrefixCls:R,avatar:G}=o.useContext(c.E_),T=o.useContext(g),D=()=>{if(!L.current||!I.current)return;const e=L.current.offsetWidth,t=I.current.offsetWidth;0!==e&&0!==t&&2*E<t&&k(t-2*E<e?(t-2*E)/e:1)};o.useEffect((()=>{B(!0)}),[]),o.useEffect((()=>{M(!0),k(1)}),[f]),o.useEffect(D,[E]);const H=()=>{!1!==(null==w?void 0:w())&&M(!1)},_=(0,p.Z)((e=>{var t,n;return null!==(n=null!==(t=null!=m?m:null==T?void 0:T.size)&&void 0!==t?t:e)&&void 0!==n?n:"default"})),V=Object.keys("object"==typeof _&&_||{}).some((e=>["xs","sm","md","lg","xl","xxl"].includes(e))),X=(0,u.Z)(V),A=o.useMemo((()=>{if("object"!=typeof _)return{};const e=s.c4.find((e=>X[e])),t=_[e];return t?{width:t,height:t,fontSize:t&&(b||j)?t/2:18}:{}}),[X,_,b,j]);const K=R("avatar",n),q=(0,d.Z)(K),[Q,U,Y]=x(K,q),J=i()({[`${K}-lg`]:"large"===_,[`${K}-sm`]:"small"===_}),ee=o.isValidElement(f),te=r||(null==T?void 0:T.shape)||"circle",ne=i()(K,J,null==G?void 0:G.className,`${K}-${te}`,{[`${K}-image`]:ee||f&&W,[`${K}-icon`]:!!b},Y,q,y,h,U),oe="number"==typeof _?{width:_,height:_,fontSize:b?_/2:18}:{};let re;if("string"==typeof f&&W)re=o.creat
|