You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
11 KiB

"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[134],{81643:function(le,T,t){t.d(T,{Z:function(){return e}});const e=x=>x?typeof x=="function"?x():x:null},7134:function(le,T,t){t.d(T,{C:function(){return de}});var e=t(67294),x=t(93967),M=t.n(x),H=t(9220),L=t(42550),j=t(74443),N=t(53124),K=t(35792),X=t(98675),Q=t(25378),n=e.createContext({}),c=t(54548),r=t(14747),u=t(91945),d=t(45503);const l=o=>{const{antCls:i,componentCls:v,iconCls:s,avatarBg:p,avatarColor:z,containerSize:D,containerSizeLG:y,containerSizeSM:b,textFontSize:S,textFontSizeLG:I,textFontSizeSM:k,borderRadius:g,borderRadiusLG:h,borderRadiusSM:_,lineWidth:q,lineType:ee}=o,w=(F,W,te)=>({width:F,height:F,borderRadius:"50%",[`&${v}-square`]:{borderRadius:te},[`&${v}-icon`]:{fontSize:W,[`> ${s}`]:{margin:0}}});return{[v]:Object.assign(Object.assign(Object.assign(Object.assign({},(0,r.Wf)(o)),{position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",overflow:"hidden",color:z,whiteSpace:"nowrap",textAlign:"center",verticalAlign:"middle",background:p,border:`${(0,c.bf)(q)} ${ee} transparent`,["&-image"]:{background:"transparent"},[`${i}-image-img`]:{display:"block"}}),w(D,S,g)),{["&-lg"]:Object.assign({},w(y,I,h)),["&-sm"]:Object.assign({},w(b,k,_)),"> img":{display:"block",width:"100%",height:"100%",objectFit:"cover"}})}},E=o=>{const{componentCls:i,groupBorderColor:v,groupOverlapping:s,groupSpace:p}=o;return{[`${i}-group`]:{display:"inline-flex",[`${i}`]:{borderColor:v},["> *:not(:first-child)"]:{marginInlineStart:s}},[`${i}-group-popover`]:{[`${i} + ${i}`]:{marginInlineStart:p}}}},m=o=>{const{controlHeight:i,controlHeightLG:v,controlHeightSM:s,fontSize:p,fontSizeLG:z,fontSizeXL:D,fontSizeHeading3:y,marginXS:b,marginXXS:S,colorBorderBg:I}=o;return{containerSize:i,containerSizeLG:v,containerSizeSM:s,textFontSize:Math.round((z+D)/2),textFontSizeLG:y,textFontSizeSM:p,groupSpace:S,groupOverlapping:-b,groupBorderColor:I}};var a=(0,u.I$)("Avatar",o=>{const{colorTextLightSolid:i,colorTextPlaceholder:v}=o,s=(0,d.TS)(o,{avatarBg:v,avatarColor:i});return[l(s),E(s)]},m),P=function(o,i){var v={};for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&i.indexOf(s)<0&&(v[s]=o[s]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var p=0,s=Object.getOwnPropertySymbols(o);p<s.length;p++)i.indexOf(s[p])<0&&Object.prototype.propertyIsEnumerable.call(o,s[p])&&(v[s[p]]=o[s[p]]);return v};const U=(o,i)=>{const[v,s]=e.useState(1),[p,z]=e.useState(!1),[D,y]=e.useState(!0),b=e.useRef(null),S=e.useRef(null),I=(0,L.sQ)(i,b),{getPrefixCls:k,avatar:g}=e.useContext(N.E_),h=e.useContext(n),_=()=>{if(!S.current||!b.current)return;const C=S.current.offsetWidth,O=b.current.offsetWidth;if(C!==0&&O!==0){const{gap:A=4}=o;A*2<O&&s(O-A*2<C?(O-A*2)/C:1)}};e.useEffect(()=>{z(!0)},[]),e.useEffect(()=>{y(!0),s(1)},[o.src]),e.useEffect(_,[o.gap]);const q=()=>{const{onError:C}=o;(C==null?void 0:C())!==!1&&y(!1)},{prefixCls:ee,shape:w,size:F,src:W,srcSet:te,icon:$,className:ae,rootClassName:ne,alt:se,draggable:Ee,children:ue,crossOrigin:Ce}=o,ve=P(o,["prefixCls","shape","size","src","srcSet","icon","className","rootClassName","alt","draggable","children","crossOrigin"]),B=(0,X.Z)(C=>{var O,A;return(A=(O=F!=null?F:h==null?void 0:h.size)!==null&&O!==void 0?O:C)!==null&&A!==void 0?A:"default"}),Oe=Object.keys(typeof B=="object"?B||{}:{}).some(C=>["xs","sm","md","lg","xl","xxl"].includes(C)),me=(0,Q.Z)(Oe),he=e.useMemo(()=>{if(typeof B!="object")return{};const C=j.c4.find(A=>me[A]),O=B[C];return O?{width:O,height:O,fontSize:O&&($||ue)?O/2:18}:{}},[me,B]),R=k("avatar",ee),fe=(0,K.Z)(R),[Pe,ye,Se]=a(R,fe),xe=M()({[`${R}-lg`]:B==="large",[`${R}-sm`]:B==="small"}),pe=e.isValidElement(W),_e=w||(h==null?void 0:h.shape)||"circle",Me=M()(R,xe,g==null?void 0:g.className,`${R}-${_e}`,{[`${R}-image`]:pe||W&&D,[`${R}-icon`]:!!$},Se,fe,ae,ne,ye),De=typeof B=="number"?{width:B,height:B,fontSize:$?B/2:18}:{};let oe;if(typeof W=="string"&&D)oe=e.createElement("img",{src:W,draggable:Ee,srcSet:te,onError:q,alt:se,crossOrigin:Ce});else if(pe)oe=W