1 |
- import{d as S,i as P,bz as al,bk as j,aM as F,k as I,b6 as $,bA as rl,aK as W,aL as nl,a as s,o as a,c as b,B as h,F as v,Q as E,C as A,f as K,aO as L,bB as il,bC as ol,aX as cl,p as pl,e as ul,ac as k,aN as M,D as Q,E as R,a2 as dl,bD as yl,aP as bl,aT as ml,__tla as hl}from"./index-4a4d6d33.js";let T,X,vl=Promise.all([(()=>{try{return hl}catch{}})()]).then(async()=>{const C=Symbol("elDescriptions");var w=S({name:"ElDescriptionsCell",props:{cell:{type:Object},tag:{type:String,default:"td"},type:{type:String}},setup:()=>({descriptions:P(C,{})}),render(){var _,o,e,D,r,c,N;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:u,direction:n}=this.descriptions,t=n==="vertical",g=((D=(e=(o=this.cell)==null?void 0:o.children)==null?void 0:e.label)==null?void 0:D.call(e))||i.label,d=(N=(c=(r=this.cell)==null?void 0:r.children)==null?void 0:c.default)==null?void 0:N.call(c),y=i.span,f=i.align?`is-${i.align}`:"",m=i.labelAlign?`is-${i.labelAlign}`:f,x=i.className,O=i.labelClassName,B={width:j(i.width),minWidth:j(i.minWidth)},p=F("descriptions");switch(this.type){case"label":return I($(this.tag,{style:B,class:[p.e("cell"),p.e("label"),p.is("bordered-label",u),p.is("vertical-label",t),m,O],colSpan:t?y:1},g),l);case"content":return I($(this.tag,{style:B,class:[p.e("cell"),p.e("content"),p.is("bordered-content",u),p.is("vertical-content",t),f,x],colSpan:t?y:2*y-1},d),l);default:return I($("td",{style:B,class:[p.e("cell"),f],colSpan:y},[rl(g)?void 0:$("span",{class:[p.e("label"),O]},g),$("span",{class:[p.e("content"),x]},d)]),l)}}});const q=W({row:{type:nl(Array),default:()=>[]}}),G={key:1},H=S({name:"ElDescriptionsRow"});var J=L(S({...H,props:q,setup(_){const o=P(C,{});return(e,D)=>s(o).direction==="vertical"?(a(),b(v,{key:0},[h("tr",null,[(a(!0),b(v,null,E(e.row,(r,c)=>(a(),A(s(w),{key:`tr1-${c}`,cell:r,tag:"th",type:"label"},null,8,["cell"]))),128))]),h("tr",null,[(a(!0),b(v,null,E(e.row,(r,c)=>(a(),A(s(w),{key:`tr2-${c}`,cell:r,tag:"td",type:"content"},null,8,["cell"]))),128))])],64)):(a(),b("tr",G,[(a(!0),b(v,null,E(e.row,(r,c)=>(a(),b(v,{key:`tr3-${c}`},[s(o).border?(a(),b(v,{key:0},[K(s(w),{cell:r,tag:"td",type:"label"},null,8,["cell"]),K(s(w),{cell:r,tag:"td",type:"content"},null,8,["cell"])],64)):(a(),A(s(w),{key:1,cell:r,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=W({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 Y=L(S({...V,props:U,setup(_){const o=_,e=F("descriptions"),D=ol(),r=cl();pl(C,o);const c=ul(()=>[e.b(),e.m(D.value)]),N=(l,u,n,t=!1)=>(l.props||(l.props={}),u>n&&(l.props.span=n),t&&(l.props.span=u),l),i=()=>{if(!r.default)return[];const l=yl(r.default()).filter(d=>{var y;return((y=d==null?void 0:d.type)==null?void 0:y.name)==="ElDescriptionsItem"}),u=[];let n=[],t=o.column,g=0;return l.forEach((d,y)=>{var f;const m=((f=d.props)==null?void 0:f.span)||1;if(y<l.length-1&&(g+=m>t?t:m),y===l.length-1){const x=o.column-g%o.column;return n.push(N(d,x,t,!0)),void u.push(n)}m<t?(t-=m,n.push(d)):(n.push(N(d,m,t)),u.push(n),t=o.column,n=[])}),u};return(l,u)=>(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"))},[h("div",{class:k(s(e).e("title"))},[M(l.$slots,"title",{},()=>[Q(R(l.title),1)])],2),h("div",{class:k(s(e).e("extra"))},[M(l.$slots,"extra",{},()=>[Q(R(l.extra),1)])],2)],2)):dl("v-if",!0),h("div",{class:k(s(e).e("body"))},[h("table",{class:k([s(e).e("table"),s(e).is("bordered",l.border)])},[h("tbody",null,[(a(!0),b(v,null,E(i(),(n,t)=>(a(),A(J,{key:t,row:n},null,8,["row"]))),128))])],2)],2)],2))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/descriptions/src/description.vue"]]);let z;z=S({name:"ElDescriptionsItem",props:W({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:""}})}),X=bl(Y,{DescriptionsItem:z}),T=ml(z)});export{T as E,vl as __tla,X as a};
|