index.80389b79.js 1.3 KB

1
  1. import{E as d,a0 as g,H as x,ab as h,d as v,aj as C,W as p,i as m,G as E,at as N,O as $}from"./index.7994470a.js";const[P,S]=d("row"),w=Symbol(P),_={tag:g("div"),wrap:x,align:String,gutter:h(0),justify:String};var j=v({name:P,props:_,setup(o,{slots:r}){const{children:l,linkChildren:u}=C(w),i=p(()=>{const e=[[]];let t=0;return l.forEach((a,s)=>{t+=Number(a.span),t>24?(e.push([s]),t-=24):e[e.length-1].push(s)}),e}),n=p(()=>{const e=Number(o.gutter),t=[];return e&&i.value.forEach(a=>{const s=e*(a.length-1)/a.length;a.forEach((c,b)=>{if(b===0)t.push({right:s});else{const f=e-t[c-1].right,y=s-f;t.push({left:f,right:y})}})}),t});return u({spaces:n}),()=>{const{tag:e,wrap:t,align:a,justify:s}=o;return m(e,{class:S({[`align-${a}`]:a,[`justify-${s}`]:s,nowrap:!t})},{default:()=>{var c;return[(c=r.default)==null?void 0:c.call(r)]}})}}});const[R,k]=d("col"),O={tag:g("div"),span:h(0),offset:E};var W=v({name:R,props:O,setup(o,{slots:r}){const{parent:l,index:u}=N(w),i=p(()=>{if(!l)return;const{spaces:n}=l;if(n&&n.value&&n.value[u.value]){const{left:e,right:t}=n.value[u.value];return{paddingLeft:e?`${e}px`:null,paddingRight:t?`${t}px`:null}}});return()=>{const{tag:n,span:e,offset:t}=o;return m(n,{style:i.value,class:k({[e]:e,[`offset-${t}`]:t})},{default:()=>{var a;return[(a=r.default)==null?void 0:a.call(r)]}})}}});const H=$(W),I=$(j);export{H as C,I as R};