index-84bc77be.js 7.0 KB

1
  1. import{d as G,r as $,u as B,a as T,y as Y,w as F,af as M,o as ee,q,_ as h,c as u,b as i,R as ae,P as w,X as Z,i as te,ag as re,I as ne,Z as H,ah as J,v as oe,H as le,D as ie,h as se,t as X}from"./index-c0ea9eee.js";import{u as ue,e as ce,t as ve,T as fe,d as pe}from"./index-97c28cb7.js";import{r as de,u as me}from"./useFlexGapSupport-20a12060.js";import{u as ge,a as ye}from"./useSize-7089b0c3.js";var xe=function(){return{prefixCls:String,shape:{type:String,default:"circle"},size:{type:[Number,String,Object],default:function(){return"default"}},src:String,srcset:String,icon:w.any,alt:String,gap:Number,draggable:{type:Boolean,default:void 0},crossOrigin:String,loadError:{type:Function}}},he=G({compatConfig:{MODE:3},name:"AAvatar",inheritAttrs:!1,props:xe(),slots:["icon"],setup:function(e,_){var S=_.slots,o=_.attrs,c=$(!0),C=$(!1),x=$(1),d=$(null),g=$(null),A=B("avatar",e),y=A.prefixCls,m=ge(),r=T(function(){return e.size==="default"?m.value:e.size}),N=ue(),v=ce(function(){if(Y(e.size)==="object"){var n=de.find(function(s){return N.value[s]}),l=e.size[n];return l}}),a=function(l){return v.value?{width:"".concat(v.value,"px"),height:"".concat(v.value,"px"),lineHeight:"".concat(v.value,"px"),fontSize:"".concat(l?v.value/2:18,"px")}:{}},t=function(){if(!(!d.value||!g.value)){var l=d.value.offsetWidth,s=g.value.offsetWidth;if(l!==0&&s!==0){var P=e.gap,b=P===void 0?4:P;b*2<s&&(x.value=s-b*2<l?(s-b*2)/l:1)}}},f=function(){var l=e.loadError,s=l==null?void 0:l();s!==!1&&(c.value=!1)};return F(function(){return e.src},function(){M(function(){c.value=!0,x.value=1})}),F(function(){return e.gap},function(){M(function(){t()})}),ee(function(){M(function(){t(),C.value=!0})}),function(){var n,l,s=e.shape,P=e.src,b=e.alt,R=e.srcset,k=e.draggable,D=e.crossOrigin,O=q(S,e,"icon"),z=y.value,E=(n={},h(n,"".concat(o.class),!!o.class),h(n,z,!0),h(n,"".concat(z,"-lg"),r.value==="large"),h(n,"".concat(z,"-sm"),r.value==="small"),h(n,"".concat(z,"-").concat(s),s),h(n,"".concat(z,"-image"),P&&c.value),h(n,"".concat(z,"-icon"),O),n),K=typeof r.value=="number"?{width:"".concat(r.value,"px"),height:"".concat(r.value,"px"),lineHeight:"".concat(r.value,"px"),fontSize:O?"".concat(r.value/2,"px"):"18px"}:{},V=(l=S.default)===null||l===void 0?void 0:l.call(S),I;if(P&&c.value)I=u("img",{draggable:k,src:P,srcset:R,onError:f,alt:b,crossorigin:D},null);else if(O)I=O;else if(C.value||x.value!==1){var W="scale(".concat(x.value,") translateX(-50%)"),Q={msTransform:W,WebkitTransform:W,transform:W},U=typeof r.value=="number"?{lineHeight:"".concat(r.value,"px")}:{};I=u(ae,{onResize:t},{default:function(){return[u("span",{class:"".concat(z,"-string"),ref:d,style:i(i({},U),Q)},[V])]}})}else I=u("span",{class:"".concat(z,"-string"),ref:d,style:{opacity:0}},[V]);return u("span",i(i({},o),{},{ref:g,class:E,style:[K,a(!!O),o.style]}),[I])}}});const j=he;var Se=function(){return i(i({},pe()),{},{content:w.any,title:w.any})},Pe=G({compatConfig:{MODE:3},name:"APopover",props:te(Se(),i(i({},ve()),{},{trigger:"hover",transitionName:"zoom-big",placement:"top",mouseEnterDelay:.1,mouseLeaveDelay:.1})),setup:function(e,_){var S=_.expose,o=_.slots,c=$();S({getPopupDomNode:function(){var m,r;return(m=c.value)===null||m===void 0||(r=m.getPopupDomNode)===null||r===void 0?void 0:r.call(m)}});var C=B("popover",e),x=C.prefixCls,d=C.configProvider,g=T(function(){return d.getPrefixCls()}),A=function(){var m,r,N=e.title,v=N===void 0?H((m=o.title)===null||m===void 0?void 0:m.call(o)):N,a=e.content,t=a===void 0?H((r=o.content)===null||r===void 0?void 0:r.call(o)):a,f=!!(Array.isArray(v)?v.length:v),n=!!(Array.isArray(t)?t.length:v);if(!(!f&&!n))return u(J,null,[f&&u("div",{class:"".concat(x.value,"-title")},[v]),u("div",{class:"".concat(x.value,"-inner-content")},[t])])};return function(){return u(fe,i(i({},ne(e,["title","content"])),{},{prefixCls:x.value,ref:c,transitionName:re(g.value,"zoom-big",e.transitionName)}),{title:A,default:o.default})}}});const ze=Z(Pe);var Ce=function(){return{prefixCls:String,maxCount:Number,maxStyle:{type:Object,default:void 0},maxPopoverPlacement:{type:String,default:"top"},maxPopoverTrigger:String,size:{type:[Number,String,Object],default:"default"}}},_e=G({compatConfig:{MODE:3},name:"AAvatarGroup",inheritAttrs:!1,props:Ce(),setup:function(e,_){var S=_.slots,o=_.attrs,c=B("avatar-group",e),C=c.prefixCls,x=c.direction;return ye(e),function(){var d,g=e.maxPopoverPlacement,A=g===void 0?"top":g,y=e.maxCount,m=e.maxStyle,r=e.maxPopoverTrigger,N=r===void 0?"hover":r,v=(d={},h(d,C.value,!0),h(d,"".concat(C.value,"-rtl"),x.value==="rtl"),h(d,"".concat(o.class),!!o.class),d),a=q(S,e),t=oe(a).map(function(s,P){return le(s,{key:"avatar-key-".concat(P)})}),f=t.length;if(y&&y<f){var n=t.slice(0,y),l=t.slice(y,f);return n.push(u(ze,{key:"avatar-popover-key",content:l,trigger:N,placement:A,overlayClassName:"".concat(C.value,"-popover")},{default:function(){return[u(j,{style:m},{default:function(){return["+".concat(f-y)]}})]}})),u("div",i(i({},o),{},{class:v,style:o.style}),[n])}return u("div",i(i({},o),{},{class:v,style:o.style}),[t])}}});const L=_e;j.Group=L;j.install=function(p){return p.component(j.name,j),p.component(L.name,L),p};var be={small:8,middle:16,large:24},Ae=function(){return{prefixCls:String,size:{type:[String,Number,Array]},direction:w.oneOf(X("horizontal","vertical")).def("horizontal"),align:w.oneOf(X("start","end","center","baseline")),wrap:{type:Boolean,default:void 0}}};function Ne(p){return typeof p=="string"?be[p]:p||0}var $e=G({compatConfig:{MODE:3},name:"ASpace",props:Ae(),slots:["split"],setup:function(e,_){var S=_.slots,o=B("space",e),c=o.prefixCls,C=o.space,x=o.direction,d=me(),g=T(function(){var a,t,f;return(a=(t=e.size)!==null&&t!==void 0?t:(f=C.value)===null||f===void 0?void 0:f.size)!==null&&a!==void 0?a:"small"}),A=$(),y=$();F(g,function(){var a=(Array.isArray(g.value)?g.value:[g.value,g.value]).map(function(f){return Ne(f)}),t=ie(a,2);A.value=t[0],y.value=t[1]},{immediate:!0});var m=T(function(){return e.align===void 0&&e.direction==="horizontal"?"center":e.align}),r=T(function(){var a;return se(c.value,"".concat(c.value,"-").concat(e.direction),(a={},h(a,"".concat(c.value,"-rtl"),x.value==="rtl"),h(a,"".concat(c.value,"-align-").concat(m.value),m.value),a))}),N=T(function(){return x.value==="rtl"?"marginLeft":"marginRight"}),v=T(function(){var a={};return d.value&&(a.columnGap="".concat(A.value,"px"),a.rowGap="".concat(y.value,"px")),i(i({},a),e.wrap&&{flexWrap:"wrap",marginBottom:"".concat(-y.value,"px")})});return function(){var a,t,f=e.wrap,n=e.direction,l=n===void 0?"horizontal":n,s=H((a=S.default)===null||a===void 0?void 0:a.call(S)),P=s.length;if(P===0)return null;var b=(t=S.split)===null||t===void 0?void 0:t.call(S),R="".concat(c.value,"-item"),k=A.value,D=P-1;return u("div",{class:r.value,style:v.value},[s.map(function(O,z){var E={};return d.value||(l==="vertical"?z<D&&(E={marginBottom:"".concat(k/(b?2:1),"px")}):E=i(i({},z<D&&h({},N.value,"".concat(k/(b?2:1),"px"))),f&&{paddingBottom:"".concat(y.value,"px")})),u(J,null,[u("div",{class:R,style:E},[O]),z<D&&b&&u("span",{class:"".concat(R,"-split"),style:E},[b])])})])}}});const je=Z($e);export{j as A,je as S};