import{Q as A,ax as J,d as z,R as L,dJ as M,bv as I,W as O,w as P,dg as C,cI as Q,X as j,e as i,o as n,c as b,q as v,I as w,J as W,a0 as $,m as B,aC as U,ae as X,K as _,a6 as T,y as V,z as K,$ as G,T as H,cK as Y,ap as Z,aq as ee,bw as te}from"./index-XuO881sr.js";const R=["left","center","right"],se=A({border:Boolean,column:{type:Number,default:3},direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},size:J,title:{type:String,default:""},extra:{type:String,default:""},labelWidth:{type:[String,Number]}}),q="ElDescriptionsItem",le=A({label:{type:String,default:""},span:{type:Number,default:1},rowspan:{type:Number,default:1},width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},labelWidth:{type:[String,Number]},align:{type:String,values:R,default:"left"},labelAlign:{type:String,values:R},className:{type:String,default:""},labelClassName:{type:String,default:""}}),F=z({name:q,props:le}),x=Symbol("elDescriptions"),ae=A({row:{type:L(Array),default:()=>[]}});var D=z({name:"ElDescriptionsCell",props:{cell:{type:Object},tag:{type:String,default:"td"},type:{type:String}},setup(){return{descriptions:j(x,{})}},render(){const e=M(this.cell),o=(this.cell?.dirs||[]).map(f=>{const{dir:d,arg:g,modifiers:h,value:y}=f;return[d,y,g,h]}),{border:c,direction:E}=this.descriptions,l=E==="vertical",u=()=>this.cell?.children?.label?.()||e.label,k=()=>this.cell?.children?.default?.(),S=e.span,t=e.rowspan,p=e.align?`is-${e.align}`:"",r=e.labelAlign?`is-${e.labelAlign}`:p,a=e.className,N=e.labelClassName,m={width:I(this.type==="label"?e.labelWidth??this.descriptions.labelWidth??e.width:e.width),minWidth:I(e.minWidth)},s=O("descriptions");switch(this.type){case"label":return P(C(this.tag,{style:m,class:[s.e("cell"),s.e("label"),s.is("bordered-label",c),s.is("vertical-label",l),r,N],colSpan:l?S:1,rowspan:l?1:t},u()),o);case"content":return P(C(this.tag,{style:m,class:[s.e("cell"),s.e("content"),s.is("bordered-content",c),s.is("vertical-content",l),p,a],colSpan:l?S:S*2-1,rowspan:l?t*2-1:t},k()),o);default:{const f=u(),d={},g=I(e.labelWidth??this.descriptions.labelWidth);return g&&(d.width=g,d.display="inline-block"),P(C("td",{style:m,class:[s.e("cell"),p],colSpan:S,rowspan:t},[Q(f)?void 0:C("span",{style:d,class:[s.e("label"),N]},f),C("span",{class:[s.e("content"),a]},k())]),o)}}}});const ne={key:1};var re=z({name:"ElDescriptionsRow",__name:"descriptions-row",props:ae,setup(e){const o=j(x,{});return(c,E)=>i(o).direction==="vertical"?(n(),b(w,{key:0},[v("tr",null,[(n(!0),b(w,null,W(e.row,(l,u)=>(n(),$(i(D),{key:`tr1-${u}`,cell:l,tag:"th",type:"label"},null,8,["cell"]))),128))]),v("tr",null,[(n(!0),b(w,null,W(e.row,(l,u)=>(n(),$(i(D),{key:`tr2-${u}`,cell:l,tag:"td",type:"content"},null,8,["cell"]))),128))])],64)):(n(),b("tr",ne,[(n(!0),b(w,null,W(e.row,(l,u)=>(n(),b(w,{key:`tr3-${u}`},[i(o).border?(n(),b(w,{key:0},[B(i(D),{cell:l,tag:"td",type:"label"},null,8,["cell"]),B(i(D),{cell:l,tag:"td",type:"content"},null,8,["cell"])],64)):(n(),$(i(D),{key:1,cell:l,tag:"td",type:"both"},null,8,["cell"]))],64))),128))]))}}),ie=re,oe=z({name:"ElDescriptions",__name:"description",props:se,setup(e){const o=e,c=O("descriptions"),E=U(),l=X();Z(x,o);const u=H(()=>[c.b(),c.m(E.value)]),k=(t,p,r,a=!1)=>(t.props||(t.props={}),p>r&&(t.props.span=r),a&&(t.props.span=p),t),S=()=>{if(!l.default)return[];const t=Y(l.default()).filter(s=>s?.type?.name===q),p=[];let r=[],a=o.column,N=0;const m=[];return t.forEach((s,f)=>{const d=s.props?.span||1,g=s.props?.rowspan||1,h=p.length;if(m[h]||=0,g>1)for(let y=1;y<g;y++)m[h+y]||=0,m[h+y]++,N++;if(m[h]>0&&(a-=m[h],m[h]=0),f<t.length-1&&(N+=d>a?a:d),f===t.length-1){const y=o.column-N%o.column;r.push(k(s,y,a,!0)),p.push(r);return}d<a?(a-=d,r.push(s)):(r.push(k(s,d,a)),p.push(r),a=o.column,r=[])}),p};return(t,p)=>(n(),b("div",{class:_(u.value)},[e.title||e.extra||t.$slots.title||t.$slots.extra?(n(),b("div",{key:0,class:_(i(c).e("header"))},[v("div",{class:_(i(c).e("title"))},[T(t.$slots,"title",{},()=>[V(K(e.title),1)])],2),v("div",{class:_(i(c).e("extra"))},[T(t.$slots,"extra",{},()=>[V(K(e.extra),1)])],2)],2)):G("v-if",!0),v("div",{class:_(i(c).e("body"))},[v("table",{class:_([i(c).e("table"),i(c).is("bordered",e.border)])},[v("tbody",null,[(n(!0),b(w,null,W(S(),(r,a)=>(n(),$(ie,{key:a,row:r},null,8,["row"]))),128))])],2)],2)],2))}}),ce=oe;const de=ee(ce,{DescriptionsItem:F}),ue=te(F);export{de as E,ue as a};
