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