1 |
- import{d as S,an as F,d5 as al,cW as O,b5 as R,z as I,bg as x,cz as nl,b3 as j,b4 as rl,a as s,o as a,c as b,g as v,F as h,v as E,x as z,f as T,b6 as Y,cv as il,ck as ol,bj as cl,as as pl,Y as dl,T as k,aN as q,y as G,t as H,a0 as ul,d6 as yl,b7 as bl,ba as ml,__tla as vl}from"./index-893d5d13.js";let P,J,hl=Promise.all([(()=>{try{return vl}catch{}})()]).then(async()=>{const A=Symbol("elDescriptions");var w=S({name:"ElDescriptionsCell",props:{cell:{type:Object},tag:{type:String,default:"td"},type:{type:String}},setup:()=>({descriptions:F(A,{})}),render(){var _,o,e,N,n,c,$;const i=al(this.cell),l=(((_=this.cell)==null?void 0:_.dirs)||[]).map(Z=>{const{dir:ll,arg:el,modifiers:tl,value:sl}=Z;return[ll,sl,el,tl]}),{border:d,direction:r}=this.descriptions,t=r==="vertical",g=((N=(e=(o=this.cell)==null?void 0:o.children)==null?void 0:e.label)==null?void 0:N.call(e))||i.label,u=($=(c=(n=this.cell)==null?void 0:n.children)==null?void 0:c.default)==null?void 0:$.call(c),y=i.span,f=i.align?`is-${i.align}`:"",m=i.labelAlign?`is-${i.labelAlign}`:f,D=i.className,B=i.labelClassName,C={width:O(i.width),minWidth:O(i.minWidth)},p=R("descriptions");switch(this.type){case"label":return I(x(this.tag,{style:C,class:[p.e("cell"),p.e("label"),p.is("bordered-label",d),p.is("vertical-label",t),m,B],colSpan:t?y:1},g),l);case"content":return I(x(this.tag,{style:C,class:[p.e("cell"),p.e("content"),p.is("bordered-content",d),p.is("vertical-content",t),f,D],colSpan:t?y:2*y-1},u),l);default:return I(x("td",{style:C,class:[p.e("cell"),f],colSpan:y},[nl(g)?void 0:x("span",{class:[p.e("label"),B]},g),x("span",{class:[p.e("content"),D]},u)]),l)}}});const K=j({row:{type:rl(Array),default:()=>[]}}),L={key:1},M=S({name:"ElDescriptionsRow"});var Q=Y(S({...M,props:K,setup(_){const o=F(A,{});return(e,N)=>s(o).direction==="vertical"?(a(),b(h,{key:0},[v("tr",null,[(a(!0),b(h,null,E(e.row,(n,c)=>(a(),z(s(w),{key:`tr1-${c}`,cell:n,tag:"th",type:"label"},null,8,["cell"]))),128))]),v("tr",null,[(a(!0),b(h,null,E(e.row,(n,c)=>(a(),z(s(w),{key:`tr2-${c}`,cell:n,tag:"td",type:"content"},null,8,["cell"]))),128))])],64)):(a(),b("tr",L,[(a(!0),b(h,null,E(e.row,(n,c)=>(a(),b(h,{key:`tr3-${c}`},[s(o).border?(a(),b(h,{key:0},[T(s(w),{cell:n,tag:"td",type:"label"},null,8,["cell"]),T(s(w),{cell:n,tag:"td",type:"content"},null,8,["cell"])],64)):(a(),z(s(w),{key:1,cell:n,tag:"td",type:"both"},null,8,["cell"]))],64))),128))]))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/descriptions/src/descriptions-row.vue"]]);const U=j({border:{type:Boolean,default:!1},column:{type:Number,default:3},direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},size:il,title:{type:String,default:""},extra:{type:String,default:""}}),V=S({name:"ElDescriptions"});var X=Y(S({...V,props:U,setup(_){const o=_,e=R("descriptions"),N=ol(),n=cl();pl(A,o);const c=dl(()=>[e.b(),e.m(N.value)]),$=(l,d,r,t=!1)=>(l.props||(l.props={}),d>r&&(l.props.span=r),t&&(l.props.span=d),l),i=()=>{if(!n.default)return[];const l=yl(n.default()).filter(u=>{var y;return((y=u==null?void 0:u.type)==null?void 0:y.name)==="ElDescriptionsItem"}),d=[];let r=[],t=o.column,g=0;return l.forEach((u,y)=>{var f;const m=((f=u.props)==null?void 0:f.span)||1;if(y<l.length-1&&(g+=m>t?t:m),y===l.length-1){const D=o.column-g%o.column;return r.push($(u,D,t,!0)),void d.push(r)}m<t?(t-=m,r.push(u)):(r.push($(u,m,t)),d.push(r),t=o.column,r=[])}),d};return(l,d)=>(a(),b("div",{class:k(s(c))},[l.title||l.extra||l.$slots.title||l.$slots.extra?(a(),b("div",{key:0,class:k(s(e).e("header"))},[v("div",{class:k(s(e).e("title"))},[q(l.$slots,"title",{},()=>[G(H(l.title),1)])],2),v("div",{class:k(s(e).e("extra"))},[q(l.$slots,"extra",{},()=>[G(H(l.extra),1)])],2)],2)):ul("v-if",!0),v("div",{class:k(s(e).e("body"))},[v("table",{class:k([s(e).e("table"),s(e).is("bordered",l.border)])},[v("tbody",null,[(a(!0),b(h,null,E(i(),(r,t)=>(a(),z(Q,{key:t,row:r},null,8,["row"]))),128))])],2)],2)],2))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/descriptions/src/description.vue"]]);let W;W=S({name:"ElDescriptionsItem",props:j({label:{type:String,default:""},span:{type:Number,default:1},width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},align:{type:String,default:"left"},labelAlign:{type:String,default:""},className:{type:String,default:""},labelClassName:{type:String,default:""}})}),J=bl(X,{DescriptionsItem:W}),P=ml(W)});export{P as E,hl as __tla,J as a};
|