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