ll-package
Version:
2 lines (1 loc) • 1.29 kB
JavaScript
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("../../../../../@babel/runtime/helpers/esm/objectSpread2.js"),v=require("vue"),r=require("./index.js"),T=require("../../hooks/useCellClassName.js"),i=require("../../utils/dateUtil.js"),q=require("../../RangeContext.js"),U=require("../PanelBody.js"),b=require("../../hooks/useMergeProps.js"),s=3,C=4;function o(d){const n=b.default(d),{prefixCls:Y,value:f,viewDate:u,locale:g,generateConfig:e}=n,{rangedValue:N,hoverRangedValue:_}=q.useInjectRange(),E=`${Y}-cell`,m=e.getYear(u),l=Math.floor(m/r.YEAR_DECADE_COUNT)*r.YEAR_DECADE_COUNT,A=l+r.YEAR_DECADE_COUNT-1,R=e.setYear(u,l-Math.ceil((s*C-r.YEAR_DECADE_COUNT)/2)),D=t=>{const a=e.getYear(t);return l<=a&&a<=A},O=T.default({cellPrefixCls:E,value:f,generateConfig:e,rangedValue:N.value,hoverRangedValue:_.value,isSameCell:(t,a)=>i.isSameYear(e,t,a),isInView:D,offsetCell:(t,a)=>e.addYear(t,a)});return v.createVNode(U.default,c.default(c.default({},n),{},{rowNum:C,colNum:s,baseDate:R,getCellText:e.getYear,getCellClassName:O,getCellDate:e.addYear,titleCell:t=>i.formatValue(t,{locale:g,format:"YYYY",generateConfig:e})}),null)}o.displayName="YearBody";o.inheritAttrs=!1;exports.YEAR_COL_COUNT=s;exports.default=o;
;