import{createVNode as s}from"vue";import Y from"../../hooks/useMergeProps.mjs";import{createKeydownHandler as g}from"../../utils/uiUtil.mjs";import h,{YEAR_COL_COUNT as y}from"./YearBody.mjs";import w from"./YearHeader.mjs";const x=10;function f(m){const l=Y(m),{prefixCls:i,operationRef:C,onViewDateChange:u,generateConfig:n,value:r,viewDate:a,sourceMode:c,onSelect:t,onPanelChange:d}=l,D=`${i}-year-panel`;C.value={onKeydown:o=>g(o,{onLeftRight:e=>{t(n.addYear(r||a,e),"key")},onCtrlLeftRight:e=>{t(n.addYear(r||a,e*x),"key")},onUpDown:e=>{t(n.addYear(r||a,e*y),"key")},onEnter:()=>{d(c==="date"?"date":"month",r||a)}})};const p=o=>{const e=n.addYear(a,o*10);u(e),d(null,e)};return s("div",{class:D},[s(w,{...l,prefixCls:i,onPrevDecade:()=>{p(-1)},onNextDecade:()=>{p(1)},onDecadeClick:()=>{d("decade",a)}},null),s(h,{...l,prefixCls:i,onSelect:o=>{d(c==="date"?"date":"month",o),t(o,"mouse")}},null)])}f.displayName="YearPanel";f.inheritAttrs=!1;export{x as YEAR_DECADE_COUNT,f as default};
