import{defineComponent as v,computed as d,createVNode as g}from"vue";import{isPresetSize as i}from"../_util/gapSize.mjs";import C from"../_util/omit.mjs";import{withInstall as h}from"../_util/type.mjs";import{useConfigContextInject as y}from"../config-provider/context.mjs";import S from"../config-provider/hooks/useConfigInject.mjs";import{flexProps as $}from"./interface.mjs";import F from"./style/index.mjs";import I from"./utils.mjs";const j=v({name:"AFlex",inheritAttrs:!1,props:$(),setup(e,{slots:n,attrs:r}){const{flex:s,direction:m}=y(),{prefixCls:t}=S("flex",e),[f,c]=F(t),u=d(()=>[t.value,c.value,I(t.value,e),{[`${t.value}-rtl`]:m.value==="rtl",[`${t.value}-gap-${e.gap}`]:i(e.gap),[`${t.value}-vertical`]:e.vertical??s?.value.vertical}]);return()=>{const{flex:a,gap:l,component:p="div",...x}=e,o={};return a&&(o.flex=a),l&&!i(l)&&(o.gap=`${l}px`),f(g(p,{class:[r.class,u.value],style:[r.style,o],...C(x,["justify","wrap","align","vertical"])},{default:()=>[n.default?.()]}))}}}),k=h(j);export{k as default};
