import e from"../../hooks/useMergeProps.mjs";import{createKeydownHandler as t}from"../../utils/uiUtil.mjs";import n from"./MonthBody.mjs";import r from"./MonthHeader.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,onPanelChange:p,onSelect:m}=o,h=`${s}-month-panel`;c.value={onKeydown:e=>t(e,{onLeftRight:e=>{m(u.addMonth(d||f,e),`key`)},onCtrlLeftRight:e=>{m(u.addYear(d||f,e),`key`)},onUpDown:e=>{m(u.addMonth(d||f,e*3),`key`)},onEnter:()=>{p(`date`,d||f)}})};let g=e=>{let t=u.addYear(f,e);l(t),p(null,t)};return i(`div`,{class:h},[i(r,{...o,prefixCls:s,onPrevYear:()=>{g(-1)},onNextYear:()=>{g(1)},onYearClick:()=>{p(`year`,f)}},null),i(n,{...o,prefixCls:s,onSelect:e=>{m(e,`mouse`),p(`date`,e)}},null)])}a.displayName=`MonthPanel`,a.inheritAttrs=!1;export{a as default};