import e from"../_util/classNames.mjs";import t from"../config-provider/hooks/useConfigInject.mjs";import{useInjectRow as n}from"./context.mjs";import{useColStyle as r}from"./style/index.mjs";import{computed as i,createVNode as a,defineComponent as o}from"vue";function s(e){return typeof e==`number`?`${e} ${e} auto`:/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?`0 0 ${e}`:e}var c=()=>({span:[String,Number],order:[String,Number],offset:[String,Number],push:[String,Number],pull:[String,Number],xs:{type:[String,Number,Object],default:void 0},sm:{type:[String,Number,Object],default:void 0},md:{type:[String,Number,Object],default:void 0},lg:{type:[String,Number,Object],default:void 0},xl:{type:[String,Number,Object],default:void 0},xxl:{type:[String,Number,Object],default:void 0},prefixCls:String,flex:[String,Number]}),l=[`xs`,`sm`,`md`,`lg`,`xl`,`xxl`],u=o({compatConfig:{MODE:3},name:`ACol`,inheritAttrs:!1,props:c(),setup(o,{slots:c,attrs:u}){let{gutter:d,supportFlexGap:f,wrap:p}=n(),{prefixCls:m,direction:h}=t(`col`,o),[g,_]=r(m),v=i(()=>{let{span:t,order:n,offset:r,push:i,pull:a}=o,s=m.value,c={};return l.forEach(e=>{let t={},n=o[e];typeof n==`number`?t.span=n:typeof n==`object`&&(t=n||{}),c={...c,[`${s}-${e}-${t.span}`]:t.span!==void 0,[`${s}-${e}-order-${t.order}`]:t.order||t.order===0,[`${s}-${e}-offset-${t.offset}`]:t.offset||t.offset===0,[`${s}-${e}-push-${t.push}`]:t.push||t.push===0,[`${s}-${e}-pull-${t.pull}`]:t.pull||t.pull===0,[`${s}-rtl`]:h.value===`rtl`}}),e(s,{[`${s}-${t}`]:t!==void 0,[`${s}-order-${n}`]:n,[`${s}-offset-${r}`]:r,[`${s}-push-${i}`]:i,[`${s}-pull-${a}`]:a},c,u.class,_.value)}),y=i(()=>{let{flex:e}=o,t=d.value,n={};if(t&&t[0]>0){let e=`${t[0]/2}px`;n.paddingLeft=e,n.paddingRight=e}if(t&&t[1]>0&&!f.value){let e=`${t[1]/2}px`;n.paddingTop=e,n.paddingBottom=e}return e&&(n.flex=s(e),p.value===!1&&!n.minWidth&&(n.minWidth=0)),n});return()=>g(a(`div`,{...u,class:v.value,style:[y.value,u.style]},[c.default?.()]))}});export{c as colProps,u as default};