import{createVNode as d}from"vue";import u from"../../hooks/useMergeProps.mjs";import{createKeydownHandler as g}from"../../utils/uiUtil.mjs";import y,{MONTH_COL_COUNT as M}from"./MonthBody.mjs";import w from"./MonthHeader.mjs";function f(h){const i=u(h),{prefixCls:s,operationRef:m,onViewDateChange:c,generateConfig:t,value:r,viewDate:n,onPanelChange:a,onSelect:l}=i,C=`${s}-month-panel`;m.value={onKeydown:o=>g(o,{onLeftRight:e=>{l(t.addMonth(r||n,e),"key")},onCtrlLeftRight:e=>{l(t.addYear(r||n,e),"key")},onUpDown:e=>{l(t.addMonth(r||n,e*M),"key")},onEnter:()=>{a("date",r||n)}})};const p=o=>{const e=t.addYear(n,o);c(e),a(null,e)};return d("div",{class:C},[d(w,{...i,prefixCls:s,onPrevYear:()=>{p(-1)},onNextYear:()=>{p(1)},onYearClick:()=>{a("year",n)}},null),d(y,{...i,prefixCls:s,onSelect:o=>{l(o,"mouse"),a("date",o)}},null)])}f.displayName="MonthPanel";f.inheritAttrs=!1;export{f as default};
