import{c as v,t as b,n as m,b as N,d as x,a7 as _,a as i,o as f,as as q,k as p,a9 as O,at as T,aa as V,au as $,e as P,av as z,h as D,aw as E,I as w}from"./index-5a763f46.js";const[h,j]=v("grid"),K={square:Boolean,center:b,border:b,gutter:m,reverse:Boolean,iconSize:m,direction:String,clickable:Boolean,columnNum:N(4)},S=Symbol(h);var L=x({name:h,props:K,setup(e,{slots:t}){const{linkChildren:a}=_(S);return a({props:e}),()=>{var c;return i("div",{style:{paddingLeft:f(e.gutter)},class:[j(),{[q]:e.border&&!e.gutter}]},[(c=t.default)==null?void 0:c.call(t)])}}});const H=p(L),[U,l]=v("grid-item"),Y=O({},T,{dot:Boolean,text:String,icon:String,badge:m,iconColor:String,iconPrefix:String,badgeProps:Object});var A=x({name:U,props:Y,setup(e,{slots:t}){const{parent:a,index:c}=V(S),B=$();if(!a){console.error("[Vant] <GridItem> must be a child component of <Grid>.");return}const I=P(()=>{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=f(n);o.paddingRight=u,c.value>=+r&&(o.marginTop=u)}return o}),y=P(()=>{const{square:s,gutter:n}=a.props;if(s&&n){const r=f(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(w,{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)},R=()=>{if(t.text)return t.text();if(e.text)return i("span",{class:l("text")},[e.text])},k=()=>t.default?t.default():[C(),R()];return()=>{const{center:s,border:n,square:r,gutter:d,reverse:o,direction:u,clickable:g}=a.props,G=[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:G,style:y.value,tabindex:g?0:void 0,onClick:B},[k()])])}}});const J=p(A);export{H as G,J as a};
