import e from"../../../_util/classNames.mjs";import t from"../../hooks/useMergeProps.mjs";import{createKeydownHandler as n}from"../../utils/uiUtil.mjs";import r from"./DateBody.mjs";import i from"./DateHeader.mjs";import{createVNode as a}from"vue";var o=6;function s(s){let c=t(s),{prefixCls:l,panelName:u=`date`,keyboardConfig:d,active:f,operationRef:p,generateConfig:m,value:h,viewDate:g,onViewDateChange:_,onPanelChange:v,onSelect:y}=c,b=`${l}-${u}-panel`;p.value={onKeydown:e=>n(e,{onLeftRight:e=>{y(m.addDate(h||g,e),`key`)},onCtrlLeftRight:e=>{y(m.addYear(h||g,e),`key`)},onUpDown:e=>{y(m.addDate(h||g,e*7),`key`)},onPageUpDown:e=>{y(m.addMonth(h||g,e),`key`)},...d})};let x=e=>{let t=m.addYear(g,e);_(t),v(null,t)},S=e=>{let t=m.addMonth(g,e);_(t),v(null,t)};return a(`div`,{class:e(b,{[`${b}-active`]:f})},[a(i,{...c,prefixCls:l,value:h,viewDate:g,onPrevYear:()=>{x(-1)},onNextYear:()=>{x(1)},onPrevMonth:()=>{S(-1)},onNextMonth:()=>{S(1)},onMonthClick:()=>{v(`month`,g)},onYearClick:()=>{v(`year`,g)}},null),a(r,{...c,onSelect:e=>y(e,`mouse`),prefixCls:l,value:h,viewDate:g,rowCount:o},null)])}s.displayName=`DatePanel`,s.inheritAttrs=!1;export{s as default};