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