import{getClass as e,getSlot as t,getStyle as n}from"../_util/props-util/index.mjs";import r from"./Cell.mjs";import{descriptionsContext as i}from"./index.mjs";import{Fragment as a,createVNode as o,inject as s,ref as c}from"vue";var l=l=>{let u=(i,{colon:a,prefixCls:s,bordered:c},{component:l,type:u,showLabel:d,showContent:f,labelStyle:p,contentStyle:m})=>i.map((i,h)=>{let g=i.props||{},{prefixCls:_=s,span:v=1,labelStyle:y=g[`label-style`],contentStyle:b=g[`content-style`],label:x=i.children?.label?.()}=g,S=t(i),C=e(i),w=n(i),{key:T}=i;return typeof l==`string`?o(r,{key:`${u}-${String(T)||h}`,class:C,style:w,labelStyle:{...p,...y},contentStyle:{...m,...b},span:v,colon:a,component:l,itemPrefixCls:_,bordered:c,label:d?x:null,content:f?S:null},null):[o(r,{key:`label-${String(T)||h}`,class:C,style:{...p,...w,...y},span:1,colon:a,component:l[0],itemPrefixCls:_,bordered:c,label:x},null),o(r,{key:`content-${String(T)||h}`,class:C,style:{...m,...w,...b},span:v*2-1,component:l[1],itemPrefixCls:_,bordered:c,content:S},null)]}),{prefixCls:d,vertical:f,row:p,index:m,bordered:h}=l,{labelStyle:g,contentStyle:_}=s(i,{labelStyle:c({}),contentStyle:c({})});return f?o(a,null,[o(`tr`,{key:`label-${m}`,class:`${d}-row`},[u(p,l,{component:`th`,type:`label`,showLabel:!0,labelStyle:g.value,contentStyle:_.value})]),o(`tr`,{key:`content-${m}`,class:`${d}-row`},[u(p,l,{component:`td`,type:`content`,showContent:!0,labelStyle:g.value,contentStyle:_.value})])]):o(`tr`,{key:m,class:`${d}-row`},[u(p,l,{component:h?[`th`,`td`]:`td`,type:`item`,showLabel:!0,showContent:!0,labelStyle:g.value,contentStyle:_.value})])};export{l as default};