import e from"../../../_util/classNames.mjs";import t from"../../hooks/useMergeProps.mjs";import{createKeydownHandler as n}from"../../utils/uiUtil.mjs";import r from"./TimeBody.mjs";import i from"./TimeHeader.mjs";import{createVNode as a,ref as o}from"vue";var s=e=>e.filter(e=>e!==!1).length;function c(c){let l=t(c),{generateConfig:u,format:d=`HH:mm:ss`,prefixCls:f,active:p,operationRef:m,showHour:h,showMinute:g,showSecond:_,use12Hours:v=!1,onSelect:y,value:b}=l,x=`${f}-time-panel`,S=o(),C=o(-1),w=s([h,g,_,v]);return m.value={onKeydown:e=>n(e,{onLeftRight:e=>{C.value=(C.value+e+w)%w},onUpDown:e=>{C.value===-1?C.value=0:S.value&&S.value.onUpDown(e)},onEnter:()=>{y(b||u.getNow(),`key`),C.value=-1}}),onBlur:()=>{C.value=-1}},a(`div`,{class:e(x,{[`${x}-active`]:p})},[a(i,{...l,format:d,prefixCls:f},null),a(r,{...l,prefixCls:f,activeColumnIndex:C.value,operationRef:S},null)])}c.displayName=`TimePanel`,c.inheritAttrs=!1;export{c as default};