import{functionType as e}from"../../_util/type.mjs";import t from"../../_util/classNames.mjs";import n from"../../vc-util/isMobile.mjs";import{createVNode as r,defineComponent as i,onBeforeUnmount as a,ref as o}from"vue";var s=200,c=600,l=i({compatConfig:{MODE:3},name:`StepHandler`,inheritAttrs:!1,props:{prefixCls:String,upDisabled:Boolean,downDisabled:Boolean,onStep:e()},slots:Object,setup(e,{slots:i,emit:l}){let u=o(),d=(e,t)=>{e.preventDefault(),l(`step`,t);function n(){l(`step`,t),u.value=setTimeout(n,s)}u.value=setTimeout(n,c)},f=()=>{clearTimeout(u.value)};return a(()=>{f()}),()=>{if(n())return null;let{prefixCls:a,upDisabled:o,downDisabled:s}=e,c=`${a}-handler`,l=t(c,`${c}-up`,{[`${c}-up-disabled`]:o}),u=t(c,`${c}-down`,{[`${c}-down-disabled`]:s}),p={unselectable:`on`,role:`button`,onMouseup:f,onMouseleave:f},{upNode:m,downNode:h}=i;return r(`div`,{class:`${c}-wrap`},[r(`span`,{...p,onMousedown:e=>{d(e,!0)},"aria-label":`Increase Value`,"aria-disabled":o,class:l},[m?.()||r(`span`,{unselectable:`on`,class:`${a}-handler-up-inner`},null)]),r(`span`,{...p,onMousedown:e=>{d(e,!1)},"aria-label":`Decrease Value`,"aria-disabled":s,class:u},[h?.()||r(`span`,{unselectable:`on`,class:`${a}-handler-down-inner`},null)])])}}});export{l as default};