ll-package
Version:
2 lines (1 loc) • 1.2 kB
JavaScript
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../../../../../@babel/runtime/helpers/esm/objectSpread2.js"),u=require("vue"),y=require("./DecadeHeader.js"),f=require("./DecadeBody.js"),A=require("../../utils/uiUtil.js"),S=require("../../hooks/useMergeProps.js"),l=10,i=l*10;function D(p){const d=S.default(p),{prefixCls:c,onViewDateChange:E,generateConfig:a,viewDate:t,operationRef:N,onSelect:o,onPanelChange:s}=d,_=`${c}-decade-panel`;N.value={onKeydown:n=>A.createKeydownHandler(n,{onLeftRight:e=>{o(a.addYear(t,e*l),"key")},onCtrlLeftRight:e=>{o(a.addYear(t,e*i),"key")},onUpDown:e=>{o(a.addYear(t,e*l*f.DECADE_COL_COUNT),"key")},onEnter:()=>{s("year",t)}})};const C=n=>{const e=a.addYear(t,n*i);E(e),s(null,e)},g=n=>{o(n,"mouse"),s("year",n)};return u.createVNode("div",{class:_},[u.createVNode(y.default,r.default(r.default({},d),{},{prefixCls:c,onPrevDecades:()=>{C(-1)},onNextDecades:()=>{C(1)}}),null),u.createVNode(f.default,r.default(r.default({},d),{},{prefixCls:c,onSelect:g}),null)])}D.displayName="DecadePanel";D.inheritAttrs=!1;exports.DECADE_DISTANCE_COUNT=i;exports.DECADE_UNIT_DIFF=l;exports.default=D;
;