"use strict";const e=require("../../../../common/vendor.js");require("../../../adapter-vue.js");const t=require("../../../utils/env.js");Math||a();const a=()=>"./date-picker-panel.js",n=e.defineComponent({__name:"index",props:{type:{type:String,default:"range"},rangeTableType:{type:String,default:"one"},startPlaceholder:{type:String,default:()=>e.Wt.t("开始时间")},endPlaceholder:{type:String,default:()=>e.Wt.t("开始时间")},popupPosition:{type:String,default:"bottom"},defaultSingleDate:{type:e.dayjs_minExports.Dayjs,default:null,required:!1}},emits:["pick","change"],setup(a,{emit:n}){e.dayjs.extend(e.localeData),e.dayjs.extend(e.isSameOrAfter),e.dayjs.extend(e.isSameOrBefore),e.dayjs.locale("zh-cn");const l=n,u=a,r=e.ref(!1),i=e.ref("single"===u.type?null==u?void 0:u.defaultSingleDate:null),d=e.ref("single"===u.type?null==u?void 0:u.defaultSingleDate:null),o=e.ref("single"===u.type?null==u?void 0:u.defaultSingleDate:null),p=e.computed((()=>{var e;return null==(e=null==d?void 0:d.value)?void 0:e.format("YYYY/MM/DD")})),s=e.computed((()=>{var e;return null==(e=null==o?void 0:o.value)?void 0:e.format("YYYY/MM/DD")})),v=u.startPlaceholder,f=u.endPlaceholder,c=e.ref(),g=e.ref(),y=e=>{r.value=e},h=e=>{const a=[];return e.forEach((e=>{e?(a.push("tui-date-picker-"+e),!t.isPC&&a.push("tui-date-picker-h5-"+e)):(a.push("tui-date-picker"),!t.isPC&&a.push("tui-date-picker-h5"))})),a},D=e=>{var t,a,n;switch(u.type){case"single":d.value=e.date,o.value=e.date,i.value=e.date,l("change",e),l("pick",i.value),setTimeout((()=>{y(!1)}),300);break;case"range":(null==d?void 0:d.value)?(null==o?void 0:o.value)?(d.value=e.date,o.value=null):((null==(t=null==d?void 0:d.value)?void 0:t.isSameOrBefore(e.date,"day"))?o.value=e.date:(o.value=d.value,d.value=e.date),l("pick",{startDate:null==(a=null==d?void 0:d.value)?void 0:a.startOf("date"),endDate:null==(n=null==o?void 0:o.value)?void 0:n.endOf("date")}),setTimeout((()=>{y(!1)}),200)):d.value=e.date,l("change",{startDate:d.value,endDate:o.value,leftCurrentPanel:c.value,rightCurrentPanel:c.value})}},m=e=>{c.value=e,l("change",{startDate:d.value,endDate:o.value,leftCurrentPanel:c.value,rightCurrentPanel:c.value})},P=e=>{g.value=e,l("change",{startDate:d.value,endDate:o.value,leftCurrentPanel:c.value,rightCurrentPanel:c.value})};return(n,l)=>e.e({a:e.unref(v),b:e.n(h(["input-start"])),c:e.unref(t.isUniFrameWork),d:e.unref(p),e:e.o$1((t=>e.isRef(p)?p.value=t.detail.value:null)),f:"single"!==a.type},(a.type,{}),{g:"single"!==a.type},"single"!==a.type?{h:e.unref(f),i:e.n(h(["input-end"])),j:e.unref(t.isUniFrameWork),k:e.unref(s),l:e.o$1((t=>e.isRef(s)?s.value=t.detail.value:null))}:{},{m:e.n(h(["input"])),n:e.n(e.unref(r)&&h(["input-active"])),o:e.o$1((t=>y(!e.unref(r)))),p:e.unref(r)},e.unref(r)?e.e({q:e.o$1(D),r:e.o$1(m),s:e.p({type:u.type,rangeType:"left",date:e.unref(i),startDate:e.unref(d),endDate:e.unref(o),currentOtherPanelValue:e.unref(g)}),t:"range"===u.type&&e.unref(t.isPC)&&"two"===a.rangeTableType},"range"===u.type&&e.unref(t.isPC)&&"two"===a.rangeTableType?{v:e.o$1(D),w:e.o$1(P),x:e.p({type:u.type,rangeType:"right",date:e.unref(i),startDate:e.unref(d),endDate:e.unref(o),currentOtherPanelValue:e.unref(c)})}:{},{y:e.n(h(["dialog-container","dialog-container-"+a.rangeTableType,"dialog-container-"+a.popupPosition])),z:e.n(h(["dialog"]))}):{},{A:e.n(h([""]))})}}),l=e._export_sfc(n,[["__scopeId","data-v-b0775539"]]);wx.createComponent(l);
