1 |
- import{d as S,at as j,cR as al,cG as B,aK as F,z as R,aX as x,ch as rl,aI as W,aJ as nl,a as s,o as a,c as m,g as b,F as v,v as E,x as z,f as G,aM as J,cd as il,c2 as ol,a$ as cl,aw as pl,M as ul,Y as w,aL as K,y as L,t as O,a4 as dl,cS as yl,aN as ml,aR as hl,__tla as bl}from"./index-eb1133d9.js";let P,X,vl=Promise.all([(()=>{try{return bl}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:j(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}`:"",h=i.labelAlign?`is-${i.labelAlign}`:f,D=i.className,M=i.labelClassName,C={width:B(i.width),minWidth:B(i.minWidth)},p=F("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),h,M],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"),M]},g),x("span",{class:[p.e("content"),D]},d)]),l)}}});const Y=W({row:{type:nl(Array),default:()=>[]}}),q={key:1},H=S({name:"ElDescriptionsRow"});var Q=J(S({...H,props:Y,setup(_){const o=j(A,{});return(e,$)=>s(o).direction==="vertical"?(a(),m(v,{key:0},[b("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))]),b("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},[G(s(k),{cell:r,tag:"td",type:"label"},null,8,["cell"]),G(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=J(S({...U,props:T,setup(_){const o=_,e=F("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 h=((f=d.props)==null?void 0:f.span)||1;if(y<l.length-1&&(g+=h>t?t:h),y===l.length-1){const D=o.column-g%o.column;return n.push(N(d,D,t,!0)),void u.push(n)}h<t?(t-=h,n.push(d)):(n.push(N(d,h,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"))},[b("div",{class:w(s(e).e("title"))},[K(l.$slots,"title",{},()=>[L(O(l.title),1)])],2),b("div",{class:w(s(e).e("extra"))},[K(l.$slots,"extra",{},()=>[L(O(l.extra),1)])],2)],2)):dl("v-if",!0),b("div",{class:w(s(e).e("body"))},[b("table",{class:w([s(e).e("table"),s(e).is("bordered",l.border)])},[b("tbody",null,[(a(!0),m(v,null,E(i(),(n,t)=>(a(),z(Q,{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=hl(I)});export{P as E,vl as __tla,X as a};
|