import{G as P,I as f,H as m,ac as N,d as v,ak as O,j as i,a3 as b,ba as _,P as p,K as $,L as q,au as T,M as V,X as x,bb as z,a9 as D,ax as E,O as j}from"./ResizeObserver.es.62ab429c.js";const[S,K]=P("grid"),L={square:Boolean,center:f,border:f,gutter:m,reverse:Boolean,iconSize:m,direction:String,clickable:Boolean,columnNum:N(4)},h=Symbol(S);var w=v({name:S,props:L,setup(e,{slots:t}){const{linkChildren:a}=O(h);return a({props:e}),()=>{var c;return i("div",{style:{paddingLeft:b(e.gutter)},class:[K(),{[_]:e.border&&!e.gutter}]},[(c=t.default)==null?void 0:c.call(t)])}}});const Y=p(w),[H,l]=P("grid-item"),M=$({},q,{dot:Boolean,text:String,icon:String,badge:m,iconColor:String,iconPrefix:String,badgeProps:Object});var U=v({name:H,props:M,setup(e,{slots:t}){const{parent:a,index:c}=T(h),B=V();if(!a){console.error("[Vant] <GridItem> must be a child component of <Grid>.");return}const I=x(()=>{const{square:s,gutter:n,columnNum:r}=a.props,d=`${100/+r}%`,o={flexBasis:d};if(s)o.paddingTop=d;else if(n){const u=b(n);o.paddingRight=u,c.value>=r&&(o.marginTop=u)}return o}),y=x(()=>{const{square:s,gutter:n}=a.props;if(s&&n){const r=b(n);return{right:r,bottom:r,height:"auto"}}}),C=()=>{if(t.icon)return i(E,D({dot:e.dot,content:e.badge},e.badgeProps),{default:t.icon});if(e.icon)return i(j,{dot:e.dot,name:e.icon,size:a.props.iconSize,badge:e.badge,class:l("icon"),color:e.iconColor,badgeProps:e.badgeProps,classPrefix:e.iconPrefix},null)},G=()=>{if(t.text)return t.text();if(e.text)return i("span",{class:l("text")},[e.text])},R=()=>t.default?t.default():[C(),G()];return()=>{const{center:s,border:n,square:r,gutter:d,reverse:o,direction:u,clickable:g}=a.props,k=[l("content",[u,{center:s,square:r,reverse:o,clickable:g,surround:n&&d}]),{[z]:n}];return i("div",{class:[l({square:r})],style:I.value},[i("div",{role:g?"button":void 0,class:k,style:y.value,tabindex:g?0:void 0,onClick:B},[R()])])}}});const A=p(U);export{Y as G,A as a};
