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