import{createVNode as s}from"vue";import g from"../../hooks/useMergeProps.mjs";import{createKeydownHandler as E}from"../../utils/uiUtil.mjs";import N,{DECADE_COL_COUNT as h}from"./DecadeBody.mjs";import w from"./DecadeHeader.mjs";const c=10,D=c*10;function p(f){const t=g(f),{prefixCls:l,onViewDateChange:C,generateConfig:a,viewDate:o,operationRef:m,onSelect:r,onPanelChange:d}=t,u=`${l}-decade-panel`;m.value={onKeydown:n=>E(n,{onLeftRight:e=>{r(a.addYear(o,e*c),"key")},onCtrlLeftRight:e=>{r(a.addYear(o,e*D),"key")},onUpDown:e=>{r(a.addYear(o,e*c*h),"key")},onEnter:()=>{d("year",o)}})};const i=n=>{const e=a.addYear(o,n*D);C(e),d(null,e)},y=n=>{r(n,"mouse"),d("year",n)};return s("div",{class:u},[s(w,{...t,prefixCls:l,onPrevDecades:()=>{i(-1)},onNextDecades:()=>{i(1)}},null),s(N,{...t,prefixCls:l,onSelect:y},null)])}p.displayName="DecadePanel";p.inheritAttrs=!1;export{D as DECADE_DISTANCE_COUNT,c as DECADE_UNIT_DIFF,p as default};
