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