Files
aiot-platform-ui/apps/web-antd/dist/js/index-BeoVA2jS.js
lzh 19d36d1ffb
All checks were successful
Web UI CI/CD / build-and-deploy (push) Successful in 8s
chore: build and deploy web-antd
2026-03-09 13:05:46 +08:00

2 lines
5.2 KiB
JavaScript

import{m as U,aF as Y,_ as x,r as Z,P as ee,y as T,be as te,bf as re,bg as B,bh as ae,j as C,aH as ne,G as oe,aI as se,bi as ie}from"./bootstrap-CRjSNGHY.js";import{aE as le,b4 as ce,m as E,bl as w,aa as L,w as M,v as ue,n as F,j as S,bF as de}from"../jse/index-index-CMeVxoEG.js";const ge=e=>{const{antCls:n,componentCls:a,iconCls:r,avatarBg:o,avatarColor:m,containerSize:i,containerSizeLG:c,containerSizeSM:f,textFontSize:g,textFontSizeLG:u,textFontSizeSM:P,borderRadius:$,borderRadiusLG:s,borderRadiusSM:z,lineWidth:p,lineType:h}=e,d=(v,t,l)=>({width:v,height:v,lineHeight:`${v-p*2}px`,borderRadius:"50%",[`&${a}-square`]:{borderRadius:l},[`${a}-string`]:{position:"absolute",left:{_skip_check_:!0,value:"50%"},transformOrigin:"0 center"},[`&${a}-icon`]:{fontSize:t,[`> ${r}`]:{margin:0}}});return{[a]:x(x(x(x({},Z(e)),{position:"relative",display:"inline-block",overflow:"hidden",color:m,whiteSpace:"nowrap",textAlign:"center",verticalAlign:"middle",background:o,border:`${p}px ${h} transparent`,"&-image":{background:"transparent"},[`${n}-image-img`]:{display:"block"}}),d(i,g,$)),{"&-lg":x({},d(c,u,s)),"&-sm":x({},d(f,P,z)),"> img":{display:"block",width:"100%",height:"100%",objectFit:"cover"}})}},pe=e=>{const{componentCls:n,groupBorderColor:a,groupOverlapping:r,groupSpace:o}=e;return{[`${n}-group`]:{display:"inline-flex",[`${n}`]:{borderColor:a},"> *:not(:first-child)":{marginInlineStart:r}},[`${n}-group-popover`]:{[`${n} + ${n}`]:{marginInlineStart:o}}}},I=U("Avatar",e=>{const{colorTextLightSolid:n,colorTextPlaceholder:a}=e,r=Y(e,{avatarBg:a,avatarColor:n});return[ge(r),pe(r)]},e=>{const{controlHeight:n,controlHeightLG:a,controlHeightSM:r,fontSize:o,fontSizeLG:m,fontSizeXL:i,fontSizeHeading3:c,marginXS:f,marginXXS:g,colorBorderBg:u}=e;return{containerSize:n,containerSizeLG:a,containerSizeSM:r,textFontSize:Math.round((m+i)/2),textFontSizeLG:c,textFontSizeSM:o,groupSpace:g,groupOverlapping:-f,groupBorderColor:u}}),_=Symbol("AvatarContextKey"),ve=()=>le(_,{}),fe=e=>ce(_,e),Se=()=>({prefixCls:String,shape:{type:String,default:"circle"},size:{type:[Number,String,Object],default:()=>"default"},src:String,srcset:String,icon:ee.any,alt:String,gap:Number,draggable:{type:Boolean,default:void 0},crossOrigin:String,loadError:{type:Function}}),O=E({compatConfig:{MODE:3},name:"AAvatar",inheritAttrs:!1,props:Se(),slots:Object,setup(e,n){let{slots:a,attrs:r}=n;const o=w(!0),m=w(!1),i=w(1),c=w(null),f=w(null),{prefixCls:g}=T("avatar",e),[u,P]=I(g),$=ve(),s=L(()=>e.size==="default"?$.size:e.size),z=te(),p=re(()=>{if(typeof e.size!="object")return;const t=ne.find(b=>z.value[b]);return e.size[t]}),h=t=>p.value?{width:`${p.value}px`,height:`${p.value}px`,lineHeight:`${p.value}px`,fontSize:`${t?p.value/2:18}px`}:{},d=()=>{if(!c.value||!f.value)return;const t=c.value.offsetWidth,l=f.value.offsetWidth;if(t!==0&&l!==0){const{gap:b=4}=e;b*2<l&&(i.value=l-b*2<t?(l-b*2)/t:1)}},v=()=>{const{loadError:t}=e;(t==null?void 0:t())!==!1&&(o.value=!1)};return M(()=>e.src,()=>{F(()=>{o.value=!0,i.value=1})}),M(()=>e.gap,()=>{F(()=>{d()})}),ue(()=>{F(()=>{d(),m.value=!0})}),()=>{var t,l;const{shape:b,src:R,alt:N,srcset:W,draggable:X,crossOrigin:D}=e,K=(t=$.shape)!==null&&t!==void 0?t:b,A=B(a,e,"icon"),y=g.value,q={[`${r.class}`]:!!r.class,[y]:!0,[`${y}-lg`]:s.value==="large",[`${y}-sm`]:s.value==="small",[`${y}-${K}`]:!0,[`${y}-image`]:R&&o.value,[`${y}-icon`]:A,[P.value]:!0},V=typeof s.value=="number"?{width:`${s.value}px`,height:`${s.value}px`,lineHeight:`${s.value}px`,fontSize:A?`${s.value/2}px`:"18px"}:{},H=(l=a.default)===null||l===void 0?void 0:l.call(a);let k;if(R&&o.value)k=S("img",{draggable:X,src:R,srcset:W,onError:v,alt:N,crossorigin:D},null);else if(A)k=A;else if(m.value||i.value!==1){const j=`scale(${i.value}) translateX(-50%)`,J={msTransform:j,WebkitTransform:j,transform:j},Q=typeof s.value=="number"?{lineHeight:`${s.value}px`}:{};k=S(ae,{onResize:d},{default:()=>[S("span",{class:`${y}-string`,ref:c,style:x(x({},Q),J)},[H])]})}else k=S("span",{class:`${y}-string`,ref:c,style:{opacity:0}},[H]);return u(S("span",C(C({},r),{},{ref:f,class:q,style:[V,h(!!A),r.style]}),[k]))}}}),me=()=>({prefixCls:String,maxCount:Number,maxStyle:{type:Object,default:void 0},maxPopoverPlacement:{type:String,default:"top"},maxPopoverTrigger:String,size:{type:[Number,String,Object],default:"default"},shape:{type:String,default:"circle"}}),G=E({compatConfig:{MODE:3},name:"AAvatarGroup",inheritAttrs:!1,props:me(),setup(e,n){let{slots:a,attrs:r}=n;const{prefixCls:o,direction:m}=T("avatar",e),i=L(()=>`${o.value}-group`),[c,f]=I(o);return de(()=>{const g={size:e.size,shape:e.shape};fe(g)}),()=>{const{maxPopoverPlacement:g="top",maxCount:u,maxStyle:P,maxPopoverTrigger:$="hover",shape:s}=e,z={[i.value]:!0,[`${i.value}-rtl`]:m.value==="rtl",[`${r.class}`]:!!r.class,[f.value]:!0},p=B(a,e),h=oe(p).map((v,t)=>se(v,{key:`avatar-key-${t}`})),d=h.length;if(u&&u<d){const v=h.slice(0,u),t=h.slice(u,d);return v.push(S(ie,{key:"avatar-popover-key",content:t,trigger:$,placement:g,overlayClassName:`${i.value}-popover`},{default:()=>[S(O,{style:P,shape:s},{default:()=>[`+${d-u}`]})]})),c(S("div",C(C({},r),{},{class:z,style:r.style}),[v]))}return c(S("div",C(C({},r),{},{class:z,style:r.style}),[h]))}}});O.Group=G;O.install=function(e){return e.component(O.name,O),e.component(G.name,G),e};export{O as A};