import{createVNode as s}from"vue";import{useInjectRange as x}from"../../RangeContext.mjs";import S from"../../hooks/useCellClassName.mjs";import V from"../../hooks/useMergeProps.mjs";import{getWeekStartDate as W,WEEK_DAY_COUNT as n,isSameMonth as R,isSameDate as Y,formatValue as b}from"../../utils/dateUtil.mjs";import M from"../PanelBody.mjs";function i(C){const c=V(C),{prefixCls:f,generateConfig:l,prefixColumn:a,locale:t,rowCount:g,viewDate:u,value:D,dateRender:d}=c,{rangedValue:p,hoverRangedValue:y}=x(),h=W(t.locale,l,u),N=`${f}-cell`,w=l.locale.getWeekFirstDay(t.locale),m=l.getNow(),o=[],k=t.shortWeekDays||(l.locale.getShortWeekDays?l.locale.getShortWeekDays(t.locale):[]);a&&o.push(s("th",{key:"empty","aria-label":"empty cell"},null));for(let e=0;e<n;e+=1)o.push(s("th",{key:e},[k[(e+w)%n]]));const v=S({cellPrefixCls:N,today:m,value:D,generateConfig:l,rangedValue:a?null:p.value,hoverRangedValue:a?null:y.value,isSameCell:(e,r)=>Y(l,e,r),isInView:e=>R(l,e,u),offsetCell:(e,r)=>l.addDate(e,r)});return s(M,{...c,rowNum:g,colNum:n,baseDate:h,getCellNode:d?e=>d({current:e,today:m}):void 0,getCellText:l.getDate,getCellClassName:v,getCellDate:l.addDate,titleCell:e=>b(e,{locale:t,format:"YYYY-MM-DD",generateConfig:l}),headerCells:o},null)}i.displayName="DateBody";i.inheritAttrs=!1;i.props=["prefixCls","generateConfig","value?","viewDate","locale","rowCount","onSelect","dateRender?","disabledDate?","prefixColumn?","rowClassName?"];export{i as default};
