UNPKG

ll-package

Version:

2 lines (1 loc) 1.6 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const _=require("../../../../@babel/runtime/helpers/esm/extends.js"),t=require("vue"),B=require("../PanelContext.js"),T=require("../utils/timeUtil.js"),U=require("../utils/dateUtil.js"),A=require("../../_util/classNames.js"),I=require("../hooks/useMergeProps.js");function u(V){const{prefixCls:n,disabledDate:q,onSelect:M,picker:d,rowNum:$,colNum:f,prefixColumn:N,rowClassName:C,baseDate:h,getCellClassName:x,getCellText:m,getCellNode:b,getCellDate:w,generateConfig:g,titleCell:p,headerCells:y}=I.default(V),{onDateMouseenter:D,onDateMouseleave:v,mode:k}=B.useInjectPanel(),l=`${n}-cell`,P=[];for(let s=0;s<$;s+=1){const c=[];let i;for(let o=0;o<f;o+=1){const S=s*f+o,e=w(h,S),a=U.getCellDateDisabled({cellDate:e,mode:k.value,disabledDate:q,generateConfig:g});o===0&&(i=e,N&&c.push(N(i)));const r=p&&p(e);c.push(t.createVNode("td",{key:o,title:r,class:A.default(l,_.default({[`${l}-disabled`]:a,[`${l}-start`]:m(e)===1||d==="year"&&Number(r)%10===0,[`${l}-end`]:r===T.getLastDay(g,e)||d==="year"&&Number(r)%10===9},x(e))),onClick:j=>{j.stopPropagation(),a||M(e)},onMouseenter:()=>{!a&&D&&D(e)},onMouseleave:()=>{!a&&v&&v(e)}},[b?b(e):t.createVNode("div",{class:`${l}-inner`},[m(e)])]))}P.push(t.createVNode("tr",{key:s,class:C&&C(i)},[c]))}return t.createVNode("div",{class:`${n}-body`},[t.createVNode("table",{class:`${n}-content`},[y&&t.createVNode("thead",null,[t.createVNode("tr",null,[y])]),t.createVNode("tbody",null,[P])])])}u.displayName="PanelBody";u.inheritAttrs=!1;exports.default=u;