mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
/*! For license information please see 1637.b1b04160.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([["1637"],{2998:function(e,t,n){"use strict";n.r(t);let r=n("40881").Z;t.default=r},40881:function(e,t,n){"use strict";n("96245"),n("37232"),n("70629");var r=n("80681"),a=n("11848"),u=n("20133"),o=n("54369");t.Z=(0,r.aZ)({__name:"index",setup(e){var t=(0,o.q)({"zh-CN":{day:"\u65E5",year:"\u5E74",month:"\u6708",chooseDate:"\u9009\u62E9\u65E5\u671F",columnsType:"\u9009\u9879\u7C7B\u578B",optionsFilter:"\u8FC7\u6EE4\u9009\u9879",chooseYearMonth:"\u9009\u62E9\u5E74\u6708",optionsFormatter:"\u683C\u5F0F\u5316\u9009\u9879"},"en-US":{day:" Day",year:" Year",month:" Month",chooseDate:"Choose Date",columnsType:"Columns Type",optionsFilter:"Options Filter",chooseYearMonth:"Choose Year-Month",optionsFormatter:"Options Formatter"}}),n=new Date(2020,0,1),l=new Date(2025,5,1),i=(0,a.iH)(["2021","01","01"]),c=(0,a.iH)(["2021","01"]),f=(0,a.iH)(["2021","01"]),s=(0,a.iH)(["2021","01"]),m=["year","month"],d=(e,t)=>"month"===e?t.filter(e=>Number(e.value)%6==0):t,v=(e,n)=>("year"===e&&(n.text+=t("year")),"month"===e&&(n.text+=t("month")),"day"===e&&(n.text+=t("day")),n);return(e,o)=>{var p=(0,r.up)("demo-block");return(0,r.wg)(),(0,r.iD)(r.HY,null,[(0,r.Wm)(p,{card:"",title:(0,a.SU)(t)("basicUsage")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,a.SU)(u.ZP),{modelValue:i.value,"onUpdate:modelValue":o[0]||(o[0]=e=>i.value=e),title:(0,a.SU)(t)("chooseDate"),"min-date":(0,a.SU)(n),"max-date":(0,a.SU)(l)},null,8,["modelValue","title","min-date","max-date"])]),_:1},8,["title"]),(0,r.Wm)(p,{card:"",title:(0,a.SU)(t)("columnsType")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,a.SU)(u.ZP),{modelValue:c.value,"onUpdate:modelValue":o[1]||(o[1]=e=>c.value=e),title:(0,a.SU)(t)("chooseYearMonth"),"min-date":(0,a.SU)(n),"max-date":(0,a.SU)(l),"columns-type":m},null,8,["modelValue","title","min-date","max-date"])]),_:1},8,["title"]),(0,r.Wm)(p,{card:"",title:(0,a.SU)(t)("optionsFormatter")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,a.SU)(u.ZP),{modelValue:f.value,"onUpdate:modelValue":o[2]||(o[2]=e=>f.value=e),title:(0,a.SU)(t)("chooseYearMonth"),"min-date":(0,a.SU)(n),"max-date":(0,a.SU)(l),formatter:v,"columns-type":m},null,8,["modelValue","title","min-date","max-date"])]),_:1},8,["title"]),(0,r.Wm)(p,{card:"",title:(0,a.SU)(t)("optionsFilter")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,a.SU)(u.ZP),{modelValue:s.value,"onUpdate:modelValue":o[3]||(o[3]=e=>s.value=e),title:(0,a.SU)(t)("optionFilter"),filter:d,"min-date":(0,a.SU)(n),"max-date":(0,a.SU)(l),"columns-type":m},null,8,["modelValue","title","min-date","max-date"])]),_:1},8,["title"])],64)}}})},72555:function(e,t,n){"use strict";n.d(t,{Ct:function(){return u}});var r=n("63112"),a=n("63022"),u=(0,r.n)(a.Z);t.ZP=u},65170:function(e,t,n){"use strict";n.d(t,{S:function(){return a},h:function(){return u}}),n("86795");var r=n("80681"),a=Symbol();function u(e){var t=(0,r.f3)(a,null);t&&(0,r.YP)(t,t=>{t&&e()})}},10023:function(e,t,n){"use strict";n.d(t,{F:function(){return u}});var r=n("80681"),a=n("12308");function u(e){var t=(0,r.FN)();t&&(0,a.l7)(t.proxy,e)}},29609:function(e,t,n){"use strict";n.d(t,{o:function(){return u}});var r=n("11848"),a=n("8051");function u(){var e=(0,r.iH)(0),t=(0,r.iH)(0),n=(0,r.iH)(0),u=(0,r.iH)(0),o=(0,r.iH)(0),l=(0,r.iH)(0),i=(0,r.iH)(""),c=(0,r.iH)(!0),f=()=>{n.value=0,u.value=0,o.value=0,l.value=0,i.value="",c.value=!0};return{move:r=>{var f,s,m=r.touches[0];n.value=(m.clientX<0?0:m.clientX)-e.value,u.value=m.clientY-t.value,o.value=Math.abs(n.value),l.value=Math.abs(u.value);if(!i.value||o.value<10&&l.value<10){;i.value=(f=o.value,f>(s=l.value)?"horizontal":s>f?"vertical":"")}c.value&&(o.value>a.mH||l.value>a.mH)&&(c.value=!1)},start:n=>{f(),e.value=n.touches[0].clientX,t.value=n.touches[0].clientY},reset:f,startX:e,startY:t,deltaX:n,deltaY:u,offsetX:o,offsetY:l,direction:i,isVertical:()=>"vertical"===i.value,isHorizontal:()=>"horizontal"===i.value,isTap:c}}},20133:function(e,t,n){"use strict";var r=n("63112"),a=n("65786"),u=(0,r.n)(a.Z);t.ZP=u},92855:function(e,t,n){"use strict";n.d(t,{En:function(){return l},K:function(){return f},re:function(){return s},uT:function(){return i},yn:function(){return c}}),n("66786"),n("14529");var r=n("12308"),a=n("78335"),u=n("20358"),o=n("36809"),l=(0,r.l7)({},o.d4,{modelValue:(0,a.Ce)(),filter:Function,formatter:{type:Function,default:(e,t)=>t}}),i=Object.keys(o.d4),c=(e,t)=>32-new Date(e,t-1,32).getDate(),f=(e,t,n,r,a,o)=>{var l=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 a=(0,u.Bd)(e+t);return r(n,{text:a,value:a})});return a?a(n,l,o):l},s=(e,t)=>e.map((e,n)=>{var r=t[n];if(r.length){var a=+r[0].value,o=+r[r.length-1].value;return(0,u.Bd)((0,u.uZ)(+e,a,o))}return e})},95786:function(e,t,n){"use strict";n.d(t,{gb:function(){return u}});var r=n("63112"),a=n("2309"),u=(0,r.n)(a.Z);t.ZP=u},54854:function(e,t,n){"use strict";n.d(t,{cW:function(){return u}});var r=n("63112"),a=n("36809"),u=(0,r.n)(a.ZP);t.ZP=u},8051:function(e,t,n){"use strict";n.d(t,{Cp:function(){return d},T5:function(){return r},WN:function(){return m},_K:function(){return i},a8:function(){return u},dt:function(){return o},e9:function(){return s},k7:function(){return a},mH:function(){return v},pj:function(){return f},r5:function(){return c},xe:function(){return l}}),n("86795");var r="van-hairline",a="".concat(r,"--top"),u="".concat(r,"--left"),o="".concat(r,"--right"),l="".concat(r,"--bottom"),i="".concat(r,"--surround"),c="".concat(r,"--top-bottom"),f="".concat(r,"-unset--top-bottom"),s="van-haptics-feedback",m=Symbol("van-form"),d=500,v=5},55987:function(e,t,n){"use strict";n.d(t,{I:function(){return a}});var r=n("12308");function a(e,t){var{args:n=[],done:a,canceled:u,error:o}=t;if(e){var l=e.apply(null,n);(0,r.tI)(l)?l.then(e=>{e?a():u&&u()}).catch(o||r.ZT):l?a():u&&u()}else a()}},78335:function(e,t,n){"use strict";n.d(t,{Ce:function(){return l},J5:function(){return u},Or:function(){return a},SI:function(){return c},SQ:function(){return f},Vg:function(){return r},ir:function(){return o},qM:function(){return i}});var r=null,a=[Number,String],u={type:Boolean,default:!0},o=e=>({type:e,required:!0}),l=()=>({type:Array,default:()=>[]}),i=e=>({type:Number,default:e}),c=e=>({type:a,default:e}),f=e=>({type:String,default:e})},63112:function(e,t,n){"use strict";n.d(t,{n:function(){return a}});var r=n("20358");function a(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"),a=n("62568"),u=n("78335"),o=n("12308"),l=n("20358"),[i,c]=(0,a.do)("badge"),f={dot:Boolean,max:u.Or,tag:(0,u.SQ)("div"),color:String,offset:Array,content:u.Or,showZero:u.J5,position:(0,u.SQ)("top-right")};t.Z=(0,r.aZ)({name:i,props:f,setup(e,t){var{slots:n}=t,a=()=>{if(n.content)return!0;var{content:t,showZero:r}=e;return(0,o.Xq)(t)&&""!==t&&(r||0!==t&&"0"!==t)},u=()=>{var{dot:t,max:r,content:u}=e;if(!t&&a())return n.content?n.content():(0,o.Xq)(r)&&(0,o.kE)(u)&&+u>+r?"".concat(r,"+"):u},i=e=>e.startsWith("-")?e.replace("-",""):"-".concat(e),f=(0,r.Fl)(()=>{var t={background:e.color};if(e.offset){var[r,a]=e.offset,{position:u}=e,[o,c]=u.split("-");n.default?("number"==typeof a?t[o]=(0,l.Nn)("top"===o?a:-a):t[o]="top"===o?(0,l.Nn)(a):i(a),"number"==typeof r?t[c]=(0,l.Nn)("left"===c?r:-r):t[c]="left"===c?(0,l.Nn)(r):i(r)):(t.marginTop=(0,l.Nn)(a),t.marginLeft=(0,l.Nn)(r))}return t}),s=()=>{if(a()||e.dot)return(0,r.Wm)("div",{class:c([e.position,{dot:e.dot,fixed:!!n.default}]),style:f.value},[u()])};return()=>{if(n.default){var{tag:t}=e;return(0,r.Wm)(t,{class:c("wrapper")},{default:()=>[n.default(),s()]})}return s()}}})},65786:function(e,t,n){"use strict";n("82116"),n("17989"),n("96245"),n("37232"),n("70629"),n("66786"),n("14529"),n("21413");var r=n("80681"),a=n("11848"),u=n("62568"),o=n("12308"),l=n("92855"),i=n("10023"),c=n("54854"),f=new Date().getFullYear(),[s]=(0,u.do)("date-picker"),m=(0,o.l7)({},l.En,{columnsType:{type:Array,default:()=>["year","month","day"]},minDate:{type:Date,default:()=>new Date(f-10,0,1),validator:o.J_},maxDate:{type:Date,default:()=>new Date(f+10,11,31),validator:o.J_}});t.Z=(0,r.aZ)({name:s,props:m,emits:["confirm","cancel","change","update:modelValue"],setup(e,t){var{emit:n,slots:u}=t,f=(0,a.iH)(e.modelValue),s=(0,a.iH)(!1),m=(0,a.iH)(),d=()=>{var t=e.minDate.getFullYear(),n=e.maxDate.getFullYear();return(0,l.K)(t,n,"year",e.formatter,e.filter)},v=t=>t===e.minDate.getFullYear(),p=t=>t===e.maxDate.getFullYear(),y=t=>t===e.minDate.getMonth()+1,h=t=>t===e.maxDate.getMonth()+1,g=t=>{var{minDate:n,columnsType:r}=e,a=r.indexOf(t),u=s.value?e.modelValue[a]:f.value[a];if(u)return+u;switch(t){case"year":return n.getFullYear();case"month":return n.getMonth()+1;case"day":return n.getDate()}},S=()=>{var t=g("year"),n=v(t)?e.minDate.getMonth()+1:1,r=p(t)?e.maxDate.getMonth()+1:12;return(0,l.K)(n,r,"month",e.formatter,e.filter)},x=()=>{var t=g("year"),n=g("month"),r=v(t)&&y(n)?e.minDate.getDate():1,a=p(t)&&h(n)?e.maxDate.getDate():(0,l.yn)(t,n);return(0,l.K)(r,a,"day",e.formatter,e.filter)},D=(0,r.Fl)(()=>e.columnsType.map(e=>{switch(e){case"year":return d();case"month":return S();case"day":return x();default:return[]}}));(0,r.YP)(f,t=>{!(0,o.$c)(t,e.modelValue)&&n("update:modelValue",t)}),(0,r.YP)(()=>e.modelValue,(e,t)=>{s.value=(0,o.$c)(t,f.value),e=(0,l.re)(e,D.value),!(0,o.$c)(e,f.value)&&(f.value=e),s.value=!1},{immediate:!0});var U=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n("change",...t)},Z=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n("cancel",...t)},F=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return n("confirm",...t)};return(0,i.F)({confirm:()=>{var e;return null===(e=m.value)||void 0===e?void 0:e.confirm()},getSelectedDate:()=>f.value}),()=>(0,r.Wm)(c.cW,(0,r.dG)({ref:m,modelValue:f.value,"onUpdate:modelValue":e=>f.value=e,columns:D.value,onChange:U,onCancel:Z,onConfirm:F},(0,o.ei)(e,l.uT)),u)}})},2309:function(e,t,n){"use strict";n("82116"),n("17989"),n("66786"),n("14529");var r=n("80681"),a=n("62568"),u=n("78335"),o=n("12308"),l=n("20358"),[i,c]=(0,a.do)("loading"),f=Array(12).fill(null).map((e,t)=>(0,r.Wm)("i",{class:c("line",String(t+1))},null)),s=(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)]),m={size:u.Or,type:(0,u.SQ)("circular"),color:String,vertical:Boolean,textSize:u.Or,textColor:String};t.Z=(0,r.aZ)({name:i,props:m,setup(e,t){var{slots:n}=t,a=(0,r.Fl)(()=>(0,o.l7)({color:e.color},(0,l.Xn)(e.size))),u=()=>{var t="spinner"===e.type?f:s;return(0,r.Wm)("span",{class:c("spinner",e.type),style:a.value},[n.icon?n.icon():t])},i=()=>{if(n.default){var t;return(0,r.Wm)("span",{class:c("text"),style:{fontSize:(0,l.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},[u(),i()])}}})}}]); |