vant/v3/assets/index.c4b18c89.js
2024-04-20 08:49:23 +00:00

2 lines
1.4 KiB
JavaScript

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