UNPKG

vuux

Version:

Vue3 Nuxt3 Nuxt4 组件库

2 lines (1 loc) 4.52 kB
"use strict";const e=require("vue"),m=require("./date.cjs"),M=require("./hook/useRange.cjs"),o=require("@vuux/icons"),D={class:"app-date-details is-range"},S={class:"details-left"},x={class:"date-control"},P={class:"control-left"},F={class:"is-icon"},q={class:"is-icon"},z={class:"cur-date"},L={class:"control-right"},Y={class:"is-icon"},$={class:"is-icon"},b={class:"date-box"},w={class:"date-num"},R=["onClick","onMouseenter"],H={class:"details-right"},K={class:"date-control"},j={class:"control-left"},A={class:"is-icon"},G={class:"is-icon"},J={class:"cur-date"},O={class:"control-right"},Q={class:"is-icon"},T={class:"is-icon"},U={class:"date-box"},W={class:"date-num"},X=["onClick","onMouseenter"],Z=e.defineComponent({__name:"dateRange",props:e.mergeModels({startKey:{default:"start"},endKey:{default:"end"},clear:{type:Boolean},readonly:{type:Boolean},disabled:{type:Boolean},shadow:{type:Boolean},placeholderStart:{default:"开始日期"},placeholderEnd:{default:"结束日期"}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["change"],["update:modelValue"]),setup(s,{expose:h,emit:_}){const f=s,k=_,v=e.useModel(s,"modelValue"),{state:r,dateState:a,computeClass:t,init:V,setValue:d,hoverValueFn:i,handlePrveYear1:N,handlePrveMonth1:E,handleNextMonth1:p,handleNextYear1:g,handlePrveYear2:C,handlePrveMonth2:y,handleNextMonth2:B,handleNextYear2:I}=M.useRange(f,v,k);return h({init:V}),(ee,u)=>(e.openBlock(),e.createElementBlock("div",D,[e.createElementVNode("div",S,[e.createElementVNode("div",x,[e.createElementVNode("div",P,[e.createElementVNode("div",F,[e.createVNode(e.unref(o.Icon),{name:"Icon1407811",onClick:e.unref(N)},null,8,["onClick"])]),e.createElementVNode("div",q,[e.createVNode(e.unref(o.Icon),{name:"Icon3498333",onClick:e.unref(E)},null,8,["onClick"])])]),e.createElementVNode("div",z,e.toDisplayString(e.unref(a).year1)+" 年 "+e.toDisplayString(e.unref(a).month1)+" 月",1),e.createElementVNode("div",L,[e.createElementVNode("div",Y,[e.createVNode(e.unref(o.Icon),{name:"Icon6657361",onClick:e.unref(p)},null,8,["onClick"])]),e.createElementVNode("div",$,[e.createVNode(e.unref(o.Icon),{name:"Icon1756783",onClick:e.unref(g)},null,8,["onClick"])])])]),e.createElementVNode("div",b,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m.getHeadDate),(n,l)=>(e.openBlock(),e.createElementBlock("div",{key:"h"+l,class:"date-item"},[e.createElementVNode("div",w,e.toDisplayString(n),1)]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).leftPanel,(n,l)=>(e.openBlock(),e.createElementBlock("div",{key:"d"+l,class:e.normalizeClass(["date-item",[e.unref(t)("selected",n),e.unref(t)("rangeSelected",n),e.unref(t)("rangeMonth",n)]]),onClick:c=>e.unref(d)(n,"left"),onMouseenter:c=>e.unref(i)(n)},[e.createElementVNode("div",{class:e.normalizeClass(["date-value",{"is-today":e.unref(t)("today",n)}])},e.toDisplayString(n.showDate),3)],42,R))),128))])]),u[0]||(u[0]=e.createElementVNode("div",{class:"link"},null,-1)),e.createElementVNode("div",H,[e.createElementVNode("div",K,[e.createElementVNode("div",j,[e.createElementVNode("div",A,[e.createVNode(e.unref(o.Icon),{name:"Icon1407811",onClick:e.unref(C)},null,8,["onClick"])]),e.createElementVNode("div",G,[e.createVNode(e.unref(o.Icon),{name:"Icon3498333",onClick:e.unref(y)},null,8,["onClick"])])]),e.createElementVNode("div",J,e.toDisplayString(e.unref(a).year2)+" 年 "+e.toDisplayString(e.unref(a).month2)+" 月",1),e.createElementVNode("div",O,[e.createElementVNode("div",Q,[e.createVNode(e.unref(o.Icon),{name:"Icon6657361",onClick:e.unref(B)},null,8,["onClick"])]),e.createElementVNode("div",T,[e.createVNode(e.unref(o.Icon),{name:"Icon1756783",onClick:e.unref(I)},null,8,["onClick"])])])]),e.createElementVNode("div",U,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m.getHeadDate),(n,l)=>(e.openBlock(),e.createElementBlock("div",{key:"h"+l,class:"date-item"},[e.createElementVNode("div",W,e.toDisplayString(n),1)]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).rightPanel,(n,l)=>(e.openBlock(),e.createElementBlock("div",{key:"d"+l,class:e.normalizeClass(["date-item",[e.unref(t)("selected",n),e.unref(t)("rangeSelected",n),e.unref(t)("rangeMonth",n)]]),onClick:c=>e.unref(d)(n,"right"),onMouseenter:c=>e.unref(i)(n)},[e.createElementVNode("div",{class:e.normalizeClass(["date-value",{"is-today":e.unref(t)("today",n)}])},e.toDisplayString(n.showDate),3)],42,X))),128))])])]))}});module.exports=Z;