1 |
- import{t as P,N as k,w as n,d as x,R as V,y as g,Z as i,aW as s,c as v,E as C,am as S,D as H}from"./index.332c7f08.js";import{s as M,a as r,f as N,p as T}from"./utils.4b86e8c9.js";import{P as p}from"./index.656e257f.js";const[y]=P("time-picker"),w=k({},M,{minHour:n(0),maxHour:n(23),minMinute:n(0),maxMinute:n(59),minSecond:n(0),maxSecond:n(59),columnsType:{type:Array,default:()=>["hour","minute"]}});var D=x({name:y,props:w,emits:["confirm","cancel","change","update:modelValue"],setup(a,{emit:t,slots:l}){const o=V(a.modelValue),u=g(()=>a.columnsType.map(e=>{const{filter:m,formatter:c}=a;switch(e){case"hour":return r(+a.minHour,+a.maxHour,e,c,m);case"minute":return r(+a.minMinute,+a.maxMinute,e,c,m);case"second":return r(+a.minSecond,+a.maxSecond,e,c,m);default:throw new Error(`[Vant] DatePicker: unsupported columns type: ${e}`)}}));i(o,e=>{s(e,a.modelValue)||t("update:modelValue",e)}),i(()=>a.modelValue,e=>{e=N(e,u.value),s(e,o.value)||(o.value=e)},{immediate:!0});const d=(...e)=>t("change",...e),f=(...e)=>t("cancel",...e),h=(...e)=>t("confirm",...e);return()=>v(p,C({modelValue:o.value,"onUpdate:modelValue":e=>o.value=e,columns:u.value,onChange:d,onCancel:f,onConfirm:h},S(a,T)),l)}});const A=H(D);export{A as T};
|