mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
2 lines
12 KiB
JavaScript
2 lines
12 KiB
JavaScript
/*! For license information please see 3997.e87914d4.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([["3997"],{70436:function(e,t,n){"use strict";n.r(t);let r=n("55810").Z;t.default=r},55810:function(e,t,n){"use strict";n("96245"),n("37232"),n("70629");var r=n("80681"),u=n("11848"),l=n("83708"),a=n("54369");t.Z=(0,r.aZ)({__name:"index",setup(e){var t=(0,a.q)({"zh-CN":{hour:"\u65F6",minute:"\u5206",timeRange:"\u65F6\u95F4\u8303\u56F4",chooseTime:"\u9009\u62E9\u65F6\u95F4",columnsType:"\u9009\u9879\u7C7B\u578B",optionsFilter:"\u8FC7\u6EE4\u9009\u9879",optionsFormatter:"\u683C\u5F0F\u5316\u9009\u9879",overallTimeRange:"\u6574\u4F53\u65F6\u95F4\u8303\u56F4"},"en-US":{hour:"h",minute:"m",timeRange:"Time Range",chooseTime:"Choose Time",columnsType:"Columns Type",optionsFilter:"Options Filter",optionsFormatter:"Options Formatter",overallTimeRange:"Overall Time Range"}}),n=(0,u.iH)(["12","00"]),i=(0,u.iH)(["12","00","00"]),o=(0,u.iH)(["12","35"]),c=(0,u.iH)(["12"," 00"]),m=(0,u.iH)(["12","00"]),f=(0,u.iH)(["12","00","00"]),v=["hour","minute","second"],s=(e,t)=>"minute"===e?t.filter(e=>Number(e.value)%10==0):t,d=(e,t,n)=>{var r=+n[0];if("hour"===e)return t.filter(e=>Number(e.value)>=8&&18>=Number(e.value));if("minute"===e){if(t=t.filter(e=>Number(e.value)%10==0),8===r)return t.filter(e=>Number(e.value)>=40);if(18===r)return t.filter(e=>20>=Number(e.value))}return t},p=(e,n)=>("hour"===e&&(n.text+=t("hour")),"minute"===e&&(n.text+=t("minute")),n);return(e,a)=>{var h=(0,r.up)("demo-block");return(0,r.wg)(),(0,r.iD)(r.HY,null,[(0,r.Wm)(h,{card:"",title:(0,u.SU)(t)("basicUsage")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,u.SU)(l.ZP),{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=e=>n.value=e),title:(0,u.SU)(t)("chooseTime")},null,8,["modelValue","title"])]),_:1},8,["title"]),(0,r.Wm)(h,{card:"",title:(0,u.SU)(t)("columnsType")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,u.SU)(l.ZP),{modelValue:i.value,"onUpdate:modelValue":a[1]||(a[1]=e=>i.value=e),title:(0,u.SU)(t)("chooseTime"),"columns-type":v},null,8,["modelValue","title"])]),_:1},8,["title"]),(0,r.Wm)(h,{card:"",title:(0,u.SU)(t)("timeRange")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,u.SU)(l.ZP),{modelValue:o.value,"onUpdate:modelValue":a[2]||(a[2]=e=>o.value=e),title:(0,u.SU)(t)("chooseTime"),"min-hour":10,"max-hour":20,"min-minute":30,"max-minute":40},null,8,["modelValue","title"])]),_:1},8,["title"]),(0,r.Wm)(h,{card:"",title:(0,u.SU)(t)("overallTimeRange")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,u.SU)(l.ZP),{modelValue:f.value,"onUpdate:modelValue":a[3]||(a[3]=e=>f.value=e),title:(0,u.SU)(t)("chooseTime"),"columns-type":["hour","minute","second"],"min-time":"09:40:10","max-time":"20:20:50"},null,8,["modelValue","title"])]),_:1},8,["title"]),(0,r.Wm)(h,{card:"",title:(0,u.SU)(t)("optionsFormatter")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,u.SU)(l.ZP),{modelValue:m.value,"onUpdate:modelValue":a[4]||(a[4]=e=>m.value=e),title:(0,u.SU)(t)("chooseTime"),formatter:p},null,8,["modelValue","title"])]),_:1},8,["title"]),(0,r.Wm)(h,{card:"",title:(0,u.SU)(t)("optionsFilter")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,u.SU)(l.ZP),{modelValue:c.value,"onUpdate:modelValue":a[5]||(a[5]=e=>c.value=e),title:(0,u.SU)(t)("chooseTime"),filter:s},null,8,["modelValue","title"])]),_:1},8,["title"]),(0,r.Wm)(h,{card:"",title:(0,u.SU)(t)("advancedUsage")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,u.SU)(l.ZP),{title:(0,u.SU)(t)("chooseTime"),filter:d},null,8,["title"])]),_:1},8,["title"])],64)}}})},72555:function(e,t,n){"use strict";n.d(t,{Ct:function(){return l}});var r=n("63112"),u=n("63022"),l=(0,r.n)(u.Z);t.ZP=l},65170:function(e,t,n){"use strict";n.d(t,{S:function(){return u},h:function(){return l}}),n("86795");var r=n("80681"),u=Symbol();function l(e){var t=(0,r.f3)(u,null);t&&(0,r.YP)(t,t=>{t&&e()})}},10023:function(e,t,n){"use strict";n.d(t,{F:function(){return l}});var r=n("80681"),u=n("12308");function l(e){var t=(0,r.FN)();t&&(0,u.l7)(t.proxy,e)}},29609:function(e,t,n){"use strict";n.d(t,{o:function(){return l}});var r=n("11848"),u=n("8051");function l(){var e=(0,r.iH)(0),t=(0,r.iH)(0),n=(0,r.iH)(0),l=(0,r.iH)(0),a=(0,r.iH)(0),i=(0,r.iH)(0),o=(0,r.iH)(""),c=(0,r.iH)(!0),m=()=>{n.value=0,l.value=0,a.value=0,i.value=0,o.value="",c.value=!0};return{move:r=>{var m,f,v=r.touches[0];n.value=(v.clientX<0?0:v.clientX)-e.value,l.value=v.clientY-t.value,a.value=Math.abs(n.value),i.value=Math.abs(l.value);if(!o.value||a.value<10&&i.value<10){;o.value=(m=a.value,m>(f=i.value)?"horizontal":f>m?"vertical":"")}c.value&&(a.value>u.mH||i.value>u.mH)&&(c.value=!1)},start:n=>{m(),e.value=n.touches[0].clientX,t.value=n.touches[0].clientY},reset:m,startX:e,startY:t,deltaX:n,deltaY:l,offsetX:a,offsetY:i,direction:o,isVertical:()=>"vertical"===o.value,isHorizontal:()=>"horizontal"===o.value,isTap:c}}},92855:function(e,t,n){"use strict";n.d(t,{En:function(){return i},K:function(){return m},re:function(){return f},uT:function(){return o},yn:function(){return c}}),n("66786"),n("14529");var r=n("12308"),u=n("78335"),l=n("20358"),a=n("36809"),i=(0,r.l7)({},a.d4,{modelValue:(0,u.Ce)(),filter:Function,formatter:{type:Function,default:(e,t)=>t}}),o=Object.keys(a.d4),c=(e,t)=>32-new Date(e,t-1,32).getDate(),m=(e,t,n,r,u,a)=>{var i=function(e,t){if(e<0)return[];for(var n=Array(e),r=-1;++r<e;)n[r]=t(r);return n}(t-e+1,t=>{var u=(0,l.Bd)(e+t);return r(n,{text:u,value:u})});return u?u(n,i,a):i},f=(e,t)=>e.map((e,n)=>{var r=t[n];if(r.length){var u=+r[0].value,a=+r[r.length-1].value;return(0,l.Bd)((0,l.uZ)(+e,u,a))}return e})},95786:function(e,t,n){"use strict";n.d(t,{gb:function(){return l}});var r=n("63112"),u=n("2309"),l=(0,r.n)(u.Z);t.ZP=l},54854:function(e,t,n){"use strict";n.d(t,{cW:function(){return l}});var r=n("63112"),u=n("36809"),l=(0,r.n)(u.ZP);t.ZP=l},83708:function(e,t,n){"use strict";var r=n("63112"),u=n("15179"),l=(0,r.n)(u.Z);t.ZP=l},8051:function(e,t,n){"use strict";n.d(t,{Cp:function(){return s},T5:function(){return r},WN:function(){return v},_K:function(){return o},a8:function(){return l},dt:function(){return a},e9:function(){return f},k7:function(){return u},mH:function(){return d},pj:function(){return m},r5:function(){return c},xe:function(){return i}}),n("86795");var r="van-hairline",u="".concat(r,"--top"),l="".concat(r,"--left"),a="".concat(r,"--right"),i="".concat(r,"--bottom"),o="".concat(r,"--surround"),c="".concat(r,"--top-bottom"),m="".concat(r,"-unset--top-bottom"),f="van-haptics-feedback",v=Symbol("van-form"),s=500,d=5},55987:function(e,t,n){"use strict";n.d(t,{I:function(){return u}});var r=n("12308");function u(e,t){var{args:n=[],done:u,canceled:l,error:a}=t;if(e){var i=e.apply(null,n);(0,r.tI)(i)?i.then(e=>{e?u():l&&l()}).catch(a||r.ZT):i?u():l&&l()}else u()}},78335:function(e,t,n){"use strict";n.d(t,{Ce:function(){return i},J5:function(){return l},Or:function(){return u},SI:function(){return c},SQ:function(){return m},Vg:function(){return r},ir:function(){return a},qM:function(){return o}});var r=null,u=[Number,String],l={type:Boolean,default:!0},a=e=>({type:e,required:!0}),i=()=>({type:Array,default:()=>[]}),o=e=>({type:Number,default:e}),c=e=>({type:u,default:e}),m=e=>({type:String,default:e})},63112:function(e,t,n){"use strict";n.d(t,{n:function(){return u}});var r=n("20358");function u(e){return e.install=t=>{var{name:n}=e;n&&(t.component(n,e),t.component((0,r._A)("-".concat(n)),e))},e}},63022:function(e,t,n){"use strict";n("82116"),n("17989"),n("56115"),n("59644"),n("89176");var r=n("80681"),u=n("62568"),l=n("78335"),a=n("12308"),i=n("20358"),[o,c]=(0,u.do)("badge"),m={dot:Boolean,max:l.Or,tag:(0,l.SQ)("div"),color:String,offset:Array,content:l.Or,showZero:l.J5,position:(0,l.SQ)("top-right")};t.Z=(0,r.aZ)({name:o,props:m,setup(e,t){var{slots:n}=t,u=()=>{if(n.content)return!0;var{content:t,showZero:r}=e;return(0,a.Xq)(t)&&""!==t&&(r||0!==t&&"0"!==t)},l=()=>{var{dot:t,max:r,content:l}=e;if(!t&&u())return n.content?n.content():(0,a.Xq)(r)&&(0,a.kE)(l)&&+l>+r?"".concat(r,"+"):l},o=e=>e.startsWith("-")?e.replace("-",""):"-".concat(e),m=(0,r.Fl)(()=>{var t={background:e.color};if(e.offset){var[r,u]=e.offset,{position:l}=e,[a,c]=l.split("-");n.default?("number"==typeof u?t[a]=(0,i.Nn)("top"===a?u:-u):t[a]="top"===a?(0,i.Nn)(u):o(u),"number"==typeof r?t[c]=(0,i.Nn)("left"===c?r:-r):t[c]="left"===c?(0,i.Nn)(r):o(r)):(t.marginTop=(0,i.Nn)(u),t.marginLeft=(0,i.Nn)(r))}return t}),f=()=>{if(u()||e.dot)return(0,r.Wm)("div",{class:c([e.position,{dot:e.dot,fixed:!!n.default}]),style:m.value},[l()])};return()=>{if(n.default){var{tag:t}=e;return(0,r.Wm)(t,{class:c("wrapper")},{default:()=>[n.default(),f()]})}return f()}}})},2309:function(e,t,n){"use strict";n("82116"),n("17989"),n("66786"),n("14529");var r=n("80681"),u=n("62568"),l=n("78335"),a=n("12308"),i=n("20358"),[o,c]=(0,u.do)("loading"),m=Array(12).fill(null).map((e,t)=>(0,r.Wm)("i",{class:c("line",String(t+1))},null)),f=(0,r.Wm)("svg",{class:c("circular"),viewBox:"25 25 50 50"},[(0,r.Wm)("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)]),v={size:l.Or,type:(0,l.SQ)("circular"),color:String,vertical:Boolean,textSize:l.Or,textColor:String};t.Z=(0,r.aZ)({name:o,props:v,setup(e,t){var{slots:n}=t,u=(0,r.Fl)(()=>(0,a.l7)({color:e.color},(0,i.Xn)(e.size))),l=()=>{var t="spinner"===e.type?m:f;return(0,r.Wm)("span",{class:c("spinner",e.type),style:u.value},[n.icon?n.icon():t])},o=()=>{if(n.default){var t;return(0,r.Wm)("span",{class:c("text"),style:{fontSize:(0,i.Nn)(e.textSize),color:null!==(t=e.textColor)&&void 0!==t?t:e.color}},[n.default()])}};return()=>{var{type:t,vertical:n}=e;return(0,r.Wm)("div",{class:c([t,{vertical:n}]),"aria-live":"polite","aria-busy":!0},[l(),o()])}}})},15179:function(e,t,n){"use strict";n("82116"),n("17989"),n("59644"),n("89176"),n("66786"),n("14529"),n("24660"),n("31564"),n("8649"),n("70629"),n("96245"),n("37232"),n("21413");var r=n("80681"),u=n("11848"),l=n("92855"),a=n("62568"),i=n("12308"),o=n("78335"),c=n("10023"),m=n("54854"),[f]=(0,a.do)("time-picker"),v=e=>/^([01]\d|2[0-3]):([0-5]\d):([0-5]\d)$/.test(e),s=["hour","minute","second"],d=(0,i.l7)({},l.En,{minHour:(0,o.SI)(0),maxHour:(0,o.SI)(23),minMinute:(0,o.SI)(0),maxMinute:(0,o.SI)(59),minSecond:(0,o.SI)(0),maxSecond:(0,o.SI)(59),minTime:{type:String,validator:v},maxTime:{type:String,validator:v},columnsType:{type:Array,default:()=>["hour","minute"]},filter:Function});t.Z=(0,r.aZ)({name:f,props:d,emits:["confirm","cancel","change","update:modelValue"],setup(e,t){var{emit:n,slots:a}=t,o=(0,u.iH)(e.modelValue),f=(0,u.iH)(),v=t=>{var n=t.split(":");return s.map((t,r)=>e.columnsType.includes(t)?n[r]:"00")},d=(0,r.Fl)(()=>{var{minHour:t,maxHour:n,minMinute:r,maxMinute:u,minSecond:a,maxSecond:i}=e;if(e.minTime||e.maxTime){var c={hour:0,minute:0,second:0};e.columnsType.forEach((e,t)=>{var n;c[e]=null!==(n=o.value[t])&&void 0!==n?n:0});var{hour:m,minute:f}=c;if(e.minTime){var[s,d,p]=v(e.minTime);r=+m<=+(t=s)?d:"00",a=+m<=+t&&+f<=+r?p:"00"}if(e.maxTime){var[h,S,y]=v(e.maxTime);u=+m>=+(n=h)?S:"59",i=+m>=+n&&+f>=+u?y:"59"}}return e.columnsType.map(c=>{var{filter:m,formatter:f}=e;switch(c){case"hour":return(0,l.K)(+t,+n,c,f,m,o.value);case"minute":return(0,l.K)(+r,+u,c,f,m,o.value);case"second":return(0,l.K)(+a,+i,c,f,m,o.value);default:return[]}})});(0,r.YP)(o,t=>{!(0,i.$c)(t,e.modelValue)&&n("update:modelValue",t)}),(0,r.YP)(()=>e.modelValue,e=>{e=(0,l.re)(e,d.value),!(0,i.$c)(e,o.value)&&(o.value=e)},{immediate:!0});var p=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n("change",...t)},h=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n("cancel",...t)},S=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n("confirm",...t)};return(0,c.F)({confirm:()=>{var e;return null===(e=f.value)||void 0===e?void 0:e.confirm()},getSelectedTime:()=>o.value}),()=>(0,r.Wm)(m.cW,(0,r.dG)({ref:f,modelValue:o.value,"onUpdate:modelValue":e=>o.value=e,columns:d.value,onChange:p,onCancel:h,onConfirm:S},(0,i.ei)(e,l.uT)),a)}})}}]); |