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