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