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