import{createVNode as y}from"vue";import{YEAR_DECADE_COUNT as t}from"./index.mjs";import{useInjectRange as _}from"../../RangeContext.mjs";import h from"../../hooks/useCellClassName.mjs";import x from"../../hooks/useMergeProps.mjs";import{isSameYear as A,formatValue as D}from"../../utils/dateUtil.mjs";import E from"../PanelBody.mjs";const n=3,m=4;function c(i){const o=x(i),{prefixCls:u,value:C,viewDate:s,locale:Y,generateConfig:e}=o,{rangedValue:f,hoverRangedValue:d}=_(),g=`${u}-cell`,p=e.getYear(s),l=Math.floor(p/t)*t,N=l+t-1,R=e.setYear(s,l-Math.ceil((n*m-t)/2)),V=a=>{const r=e.getYear(a);return l<=r&&r<=N},v=h({cellPrefixCls:g,value:C,generateConfig:e,rangedValue:f.value,hoverRangedValue:d.value,isSameCell:(a,r)=>A(e,a,r),isInView:V,offsetCell:(a,r)=>e.addYear(a,r)});return y(E,{...o,rowNum:m,colNum:n,baseDate:R,getCellText:e.getYear,getCellClassName:v,getCellDate:e.addYear,titleCell:a=>D(a,{locale:Y,format:"YYYY",generateConfig:e})},null)}c.displayName="YearBody";c.inheritAttrs=!1;export{n as YEAR_COL_COUNT,c as default};
