UNPKG

ll-package

Version:

2 lines (1 loc) 1.34 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("../../../../../@babel/runtime/helpers/esm/objectSpread2.js"),T=require("vue"),a=require("../../utils/dateUtil.js"),V=require("../../RangeContext.js"),_=require("../../hooks/useCellClassName.js"),p=require("../PanelBody.js"),q=require("../../hooks/useMergeProps.js"),c=3,S=4;function n(d){const r=q.default(d),{prefixCls:i,locale:l,value:C,viewDate:h,generateConfig:e,monthCellRender:s}=r,{rangedValue:g,hoverRangedValue:f}=V.useInjectRange(),m=`${i}-cell`,M=_.default({cellPrefixCls:m,value:C,generateConfig:e,rangedValue:g.value,hoverRangedValue:f.value,isSameCell:(t,o)=>a.isSameMonth(e,t,o),isInView:()=>!0,offsetCell:(t,o)=>e.addMonth(t,o)}),N=l.shortMonths||(e.locale.getShortMonths?e.locale.getShortMonths(l.locale):[]),O=e.setMonth(h,0),v=s?t=>s({current:t,locale:l}):void 0;return T.createVNode(p.default,u.default(u.default({},r),{},{rowNum:S,colNum:c,baseDate:O,getCellNode:v,getCellText:t=>l.monthFormat?a.formatValue(t,{locale:l,format:l.monthFormat,generateConfig:e}):N[e.getMonth(t)],getCellClassName:M,getCellDate:e.addMonth,titleCell:t=>a.formatValue(t,{locale:l,format:"YYYY-MM",generateConfig:e})}),null)}n.displayName="MonthBody";n.inheritAttrs=!1;exports.MONTH_COL_COUNT=c;exports.default=n;