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