import{createVNode as n}from"vue";import{useInjectPanel as P}from"../../PanelContext.mjs";import g from"../../hooks/useMergeProps.mjs";import{formatValue as m}from"../../utils/dateUtil.mjs";import k from"../Header.mjs";function c(h){const a=g(h),{prefixCls:t,generateConfig:o,locale:e,viewDate:r,onNextMonth:i,onPrevMonth:f,onNextYear:d,onPrevYear:p,onYearClick:u,onMonthClick:x}=a,{hideHeader:y}=P();if(y.value)return null;const N=`${t}-header`,b=e.shortMonths||(o.locale.getShortMonths?o.locale.getShortMonths(e.locale):[]),C=o.getMonth(r),s=n("button",{type:"button",key:"year",onClick:u,tabindex:-1,class:`${t}-year-btn`},[m(r,{locale:e,format:e.yearFormat,generateConfig:o})]),l=n("button",{type:"button",key:"month",onClick:x,tabindex:-1,class:`${t}-month-btn`},[e.monthFormat?m(r,{locale:e,format:e.monthFormat,generateConfig:o}):b[C]]),M=e.monthBeforeYear?[l,s]:[s,l];return n(k,{...a,prefixCls:N,onSuperPrev:p,onPrev:f,onNext:i,onSuperNext:d},{default:()=>[M]})}c.displayName="DateHeader";c.inheritAttrs=!1;export{c as default};
