1 |
- import{d as S,at as M,cQ as al,cF as j,aK as B,z as R,aX as x,cg as rl,aI as W,aJ as nl,a as s,o as a,c as m,g as h,F as v,v as E,x as z,f as J,aM as K,cc as il,c1 as ol,a$ as cl,aw as pl,M as ul,Y as w,aL as L,y as O,t as Q,a4 as dl,cR as yl,aN as ml,aR as bl,__tla as hl}from"./index-689b1c98.js";let P,X,vl=Promise.all([(()=>{try{return hl}catch{}})()]).then(async()=>{const A=Symbol("elDescriptions");var k=S({name:"ElDescriptionsCell",props:{cell:{type:Object},tag:{type:String,default:"td"},type:{type:String}},setup:()=>({descriptions:M(A,{})}),render(){var _,o,e,$,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=(($=(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),y=i.span,f=i.align?`is-${i.align}`:"",b=i.labelAlign?`is-${i.labelAlign}`:f,D=i.className,F=i.labelClassName,C={width:j(i.width),minWidth:j(i.minWidth)},p=B("descriptions");switch(this.type){case"label":return R(x(this.tag,{style:C,class:[p.e("cell"),p.e("label"),p.is("bordered-label",u),p.is("vertical-label",t),b,F],colSpan:t?y:1},g),l);case"content":return R(x(this.tag,{style:C,class:[p.e("cell"),p.e("content"),p.is("bordered-content",u),p.is("vertical-content",t),f,D],colSpan:t?y:2*y-1},d),l);default:return R(x("td",{style:C,class:[p.e("cell"),f],colSpan:y},[rl(g)?void 0:x("span",{class:[p.e("label"),F]},g),x("span",{class:[p.e("content"),D]},d)]),l)}}});const Y=W({row:{type:nl(Array),default:()=>[]}}),q={key:1},G=S({name:"ElDescriptionsRow"});var H=K(S({...G,props:Y,setup(_){const o=M(A,{});return(e,$)=>s(o).direction==="vertical"?(a(),m(v,{key:0},[h("tr",null,[(a(!0),m(v,null,E(e.row,(r,c)=>(a(),z(s(k),{key:`tr1-${c}`,cell:r,tag:"th",type:"label"},null,8,["cell"]))),128))]),h("tr",null,[(a(!0),m(v,null,E(e.row,(r,c)=>(a(),z(s(k),{key:`tr2-${c}`,cell:r,tag:"td",type:"content"},null,8,["cell"]))),128))])],64)):(a(),m("tr",q,[(a(!0),m(v,null,E(e.row,(r,c)=>(a(),m(v,{key:`tr3-${c}`},[s(o).border?(a(),m(v,{key:0},[J(s(k),{cell:r,tag:"td",type:"label"},null,8,["cell"]),J(s(k),{cell:r,tag:"td",type:"content"},null,8,["cell"])],64)):(a(),z(s(k),{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 T=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:""}}),U=S({name:"ElDescriptions"});var V=K(S({...U,props:T,setup(_){const o=_,e=B("descriptions"),$=ol(),r=cl();pl(A,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=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 b=((f=d.props)==null?void 0:f.span)||1;if(y<l.length-1&&(g+=b>t?t:b),y===l.length-1){const D=o.column-g%o.column;return n.push(N(d,D,t,!0)),void u.push(n)}b<t?(t-=b,n.push(d)):(n.push(N(d,b,t)),u.push(n),t=o.column,n=[])}),u};return(l,u)=>(a(),m("div",{class:w(s(c))},[l.title||l.extra||l.$slots.title||l.$slots.extra?(a(),m("div",{key:0,class:w(s(e).e("header"))},[h("div",{class:w(s(e).e("title"))},[L(l.$slots,"title",{},()=>[O(Q(l.title),1)])],2),h("div",{class:w(s(e).e("extra"))},[L(l.$slots,"extra",{},()=>[O(Q(l.extra),1)])],2)],2)):dl("v-if",!0),h("div",{class:w(s(e).e("body"))},[h("table",{class:w([s(e).e("table"),s(e).is("bordered",l.border)])},[h("tbody",null,[(a(!0),m(v,null,E(i(),(n,t)=>(a(),z(H,{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 I;I=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=ml(V,{DescriptionsItem:I}),P=bl(I)});export{P as E,vl as __tla,X as a};
|