1 |
- import{d as S,aX as B,cV as al,bg as F,b4 as J,C as I,h as x,bM as rl,b2 as j,b8 as nl,a as s,o as a,c as y,g as h,F as v,k as E,l as C,i as M,b6 as O,bC as il,bP as ol,cv as cl,bZ as pl,b as ul,W as k,aJ as R,j as V,t as X,a2 as dl,cW as bl,b7 as yl,bb as ml,__tla as hl}from"./index-af173888.js";let Z,q,vl=Promise.all([(()=>{try{return hl}catch{}})()]).then(async()=>{const W=Symbol("elDescriptions");var w=S({name:"ElDescriptionsCell",props:{cell:{type:Object},tag:{type:String,default:"td"},type:{type:String}},setup:()=>({descriptions:B(W,{})}),render(){var _,o,e,$,r,c,N;const i=al(this.cell),l=(((_=this.cell)==null?void 0:_.dirs)||[]).map(Y=>{const{dir:ll,arg:el,modifiers:tl,value:sl}=Y;return[ll,sl,el,tl]}),{border:u,direction:n}=this.descriptions,t=n==="vertical",g=(($=(e=(o=this.cell)==null?void 0:o.children)==null?void 0:e.label)==null?void 0:$.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),b=i.span,f=i.align?`is-${i.align}`:"",m=i.labelAlign?`is-${i.labelAlign}`:f,D=i.className,P=i.labelClassName,z={width:F(i.width),minWidth:F(i.minWidth)},p=J("descriptions");switch(this.type){case"label":return I(x(this.tag,{style:z,class:[p.e("cell"),p.e("label"),p.is("bordered-label",u),p.is("vertical-label",t),m,P],colSpan:t?b:1},g),l);case"content":return I(x(this.tag,{style:z,class:[p.e("cell"),p.e("content"),p.is("bordered-content",u),p.is("vertical-content",t),f,D],colSpan:t?b:2*b-1},d),l);default:return I(x("td",{style:z,class:[p.e("cell"),f],colSpan:b},[rl(g)?void 0:x("span",{class:[p.e("label"),P]},g),x("span",{class:[p.e("content"),D]},d)]),l)}}});const G=j({row:{type:nl(Array),default:()=>[]}}),H={key:1},K=S({name:"ElDescriptionsRow"});var L=O(S({...K,props:G,setup(_){const o=B(W,{});return(e,$)=>s(o).direction==="vertical"?(a(),y(v,{key:0},[h("tr",null,[(a(!0),y(v,null,E(e.row,(r,c)=>(a(),C(s(w),{key:`tr1-${c}`,cell:r,tag:"th",type:"label"},null,8,["cell"]))),128))]),h("tr",null,[(a(!0),y(v,null,E(e.row,(r,c)=>(a(),C(s(w),{key:`tr2-${c}`,cell:r,tag:"td",type:"content"},null,8,["cell"]))),128))])],64)):(a(),y("tr",H,[(a(!0),y(v,null,E(e.row,(r,c)=>(a(),y(v,{key:`tr3-${c}`},[s(o).border?(a(),y(v,{key:0},[M(s(w),{cell:r,tag:"td",type:"label"},null,8,["cell"]),M(s(w),{cell:r,tag:"td",type:"content"},null,8,["cell"])],64)):(a(),C(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 Q=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:""}}),T=S({name:"ElDescriptions"});var U=O(S({...T,props:Q,setup(_){const o=_,e=J("descriptions"),$=ol(),r=cl();pl(W,o);const c=ul(()=>[e.b(),e.m($.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=bl(r.default()).filter(d=>{var b;return((b=d==null?void 0:d.type)==null?void 0:b.name)==="ElDescriptionsItem"}),u=[];let n=[],t=o.column,g=0;return l.forEach((d,b)=>{var f;const m=((f=d.props)==null?void 0:f.span)||1;if(b<l.length-1&&(g+=m>t?t:m),b===l.length-1){const D=o.column-g%o.column;return n.push(N(d,D,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(),y("div",{class:k(s(c))},[l.title||l.extra||l.$slots.title||l.$slots.extra?(a(),y("div",{key:0,class:k(s(e).e("header"))},[h("div",{class:k(s(e).e("title"))},[R(l.$slots,"title",{},()=>[V(X(l.title),1)])],2),h("div",{class:k(s(e).e("extra"))},[R(l.$slots,"extra",{},()=>[V(X(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),y(v,null,E(i(),(n,t)=>(a(),C(L,{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 A;A=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:""}})}),q=yl(U,{DescriptionsItem:A}),Z=ml(A)});export{Z as E,vl as __tla,q as a};
|