mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
2 lines
15 KiB
JavaScript
2 lines
15 KiB
JavaScript
/*! For license information please see 2903.4302dc37.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([["2903"],{75889:function(t,e,n){"use strict";n.r(e);var r=n("39729");n("14911");let i=r.Z;e.default=i},83882:function(t,e,n){"use strict";n.d(e,{Bm:function(){return i},Ky:function(){return u},Od:function(){return a},P2:function(){return s},S1:function(){return v},bH:function(){return o},fY:function(){return d},lM:function(){return l},on:function(){return f},q6:function(){return c},ym:function(){return m}});var r=n("22300");let i=r._f&&"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype,l={event:"event",observer:"observer"};function a(t,e){if(!t.length)return;let n=t.indexOf(e);if(n>-1)return t.splice(n,1)}function o(t,e){let n,r,i,l;if("IMG"!==t.tagName||!t.getAttribute("data-srcset"))return;let a=t.getAttribute("data-srcset"),o=t.parentNode.offsetWidth*e,u=(a=a.trim().split(",")).map(t=>(-1===(n=(t=t.trim()).lastIndexOf(" "))?(r=t,i=999998):(r=t.substr(0,n),i=parseInt(t.substr(n+1,t.length-n-2),10)),[i,r]));u.sort((t,e)=>{if(t[0]<e[0])return 1;if(t[0]>e[0])return -1;if(t[0]===e[0]){if(-1!==e[1].indexOf(".webp",e[1].length-5))return 1;if(-1!==t[1].indexOf(".webp",t[1].length-5))return -1}return 0});let c="";for(let t=0;t<u.length;t++){c=(l=u[t])[1];let e=u[t+1];if(e&&e[0]<o){c=l[1];break}if(!e){c=l[1];break}}return c}let u=(t=1)=>r._f&&window.devicePixelRatio||t;function c(){if(!r._f)return!1;let t=!0;try{let e=document.createElement("canvas");e.getContext&&e.getContext("2d")&&(t=0===e.toDataURL("image/webp").indexOf("data:image/webp"))}catch(e){t=!1}return t}function s(t,e){let n=null,r=0;return function(...i){if(n)return;let l=Date.now()-r,a=()=>{r=Date.now(),n=!1,t.apply(this,i)};l>=e?a():n=setTimeout(a,e)}}function f(t,e,n){t.addEventListener(e,n,{capture:!1,passive:!0})}function v(t,e,n){t.removeEventListener(e,n,!1)}let d=(t,e,n)=>{let r=new Image;if(!t||!t.src)return n(Error("image src is required"));r.src=t.src,t.cors&&(r.crossOrigin=t.cors),r.onload=()=>e({naturalHeight:r.naturalHeight,naturalWidth:r.naturalWidth,src:r.src}),r.onerror=t=>n(t)};class m{constructor({max:t}){this.options={max:t||100},this.caches=[]}has(t){return this.caches.indexOf(t)>-1}add(t){!this.has(t)&&(this.caches.push(t),this.caches.length>this.options.max&&this.free())}free(){this.caches.shift()}}},39729:function(t,e,n){"use strict";n("82116"),n("17989");var r=n("80681"),i=n("11848"),l=n("57122"),a=n("57779"),o=n("19924"),u=n("44616"),c=n("99742"),s=n("54369");e.Z=(0,r.aZ)({__name:"index",setup(t){var e=(0,s.q)({"zh-CN":{backTop:"\u8FD4\u56DE\u9876\u90E8",customContent:"\u81EA\u5B9A\u4E49\u5185\u5BB9",customPosition:"\u81EA\u5B9A\u4E49\u4F4D\u7F6E",immediateScroll:"\u77AC\u95F4\u6EDA\u52A8",setScrollTarget:"\u8BBE\u7F6E\u6EDA\u52A8\u76EE\u6807"},"en-US":{backTop:"Back Top",customContent:"Custom Content",customPosition:"Custom Position",immediateScroll:"Immediate Scroll",setScrollTarget:"Set Scroll Target"}}),n=(0,i.iH)(0),f=[...Array(50).keys()],v=(0,i.iH)();return(t,s)=>((0,r.wg)(),(0,r.j4)((0,i.SU)(o.ZP),{active:n.value,"onUpdate:active":s[0]||(s[0]=t=>n.value=t),ellipsis:!1},{default:(0,r.w5)(()=>[(0,r.Wm)((0,i.SU)(u.ZP),{title:(0,i.SU)(e)("basicUsage")},{default:(0,r.w5)(()=>[((0,r.wg)(),(0,r.iD)(r.HY,null,(0,r.Ko)(f,t=>(0,r.Wm)((0,i.SU)(c.ZP),{key:t,title:t},null,8,["title"])),64)),0===n.value?((0,r.wg)(),(0,r.j4)((0,i.SU)(a.ZP),{key:0})):(0,r.kq)("",!0)]),_:1},8,["title"]),(0,r.Wm)((0,i.SU)(u.ZP),{title:(0,i.SU)(e)("customPosition")},{default:(0,r.w5)(()=>[((0,r.wg)(),(0,r.iD)(r.HY,null,(0,r.Ko)(f,t=>(0,r.Wm)((0,i.SU)(c.ZP),{key:t,title:t},null,8,["title"])),64)),1===n.value?((0,r.wg)(),(0,r.j4)((0,i.SU)(a.ZP),{key:0,right:"15vw",bottom:"10vh"})):(0,r.kq)("",!0)]),_:1},8,["title"]),(0,r.Wm)((0,i.SU)(u.ZP),{title:(0,i.SU)(e)("customContent")},{default:(0,r.w5)(()=>[((0,r.wg)(),(0,r.iD)(r.HY,null,(0,r.Ko)(f,t=>(0,r.Wm)((0,i.SU)(c.ZP),{key:t,title:t},null,8,["title"])),64)),2===n.value?((0,r.wg)(),(0,r.j4)((0,i.SU)(a.ZP),{key:0,class:"custom-back-top"},{default:(0,r.w5)(()=>[(0,r.Uk)((0,l.zw)((0,i.SU)(e)("backTop")),1)]),_:1})):(0,r.kq)("",!0)]),_:1},8,["title"]),(0,r.Wm)((0,i.SU)(u.ZP),{title:(0,i.SU)(e)("setScrollTarget")},{default:(0,r.w5)(()=>[(0,r._)("div",{class:"back-top-wrapper",ref_key:"targetEl",ref:v},[((0,r.wg)(),(0,r.iD)(r.HY,null,(0,r.Ko)(f,t=>(0,r.Wm)((0,i.SU)(c.ZP),{key:t,title:t},null,8,["title"])),64)),3===n.value?((0,r.wg)(),(0,r.j4)((0,i.SU)(a.ZP),{key:0,target:v.value,bottom:"30vh"},null,8,["target"])):(0,r.kq)("",!0)],512)]),_:1},8,["title"]),(0,r.Wm)((0,i.SU)(u.ZP),{title:(0,i.SU)(e)("immediateScroll")},{default:(0,r.w5)(()=>[((0,r.wg)(),(0,r.iD)(r.HY,null,(0,r.Ko)(f,t=>(0,r.Wm)((0,i.SU)(c.ZP),{key:t,title:t},null,8,["title"])),64)),4===n.value?((0,r.wg)(),(0,r.j4)((0,i.SU)(a.ZP),{key:0,immediate:""})):(0,r.kq)("",!0)]),_:1},8,["title"])]),_:1},8,["active"]))}})},57779:function(t,e,n){"use strict";var r=n("63112"),i=n("14563"),l=(0,r.n)(i.Z);e.ZP=l},72555:function(t,e,n){"use strict";n.d(e,{Ct:function(){return l}});var r=n("63112"),i=n("63022"),l=(0,r.n)(i.Z);e.ZP=l},99742:function(t,e,n){"use strict";n.d(e,{bL:function(){return l}});var r=n("63112"),i=n("54499"),l=(0,r.n)(i.ZP);e.ZP=l},65170:function(t,e,n){"use strict";n.d(e,{S:function(){return i},h:function(){return l}}),n("86795");var r=n("80681"),i=Symbol();function l(t){var e=(0,r.f3)(i,null);e&&(0,r.YP)(e,e=>{e&&t()})}},10023:function(t,e,n){"use strict";n.d(e,{F:function(){return l}});var r=n("80681"),i=n("12308");function l(t){var e=(0,r.FN)();e&&(0,i.l7)(e.proxy,t)}},14517:function(t,e,n){"use strict";n.d(e,{H:function(){return l},t:function(){return i}});var r=2e3,i=()=>++r,l=t=>{r=t}},29609:function(t,e,n){"use strict";n.d(e,{o:function(){return l}});var r=n("11848"),i=n("8051");function l(){var t=(0,r.iH)(0),e=(0,r.iH)(0),n=(0,r.iH)(0),l=(0,r.iH)(0),a=(0,r.iH)(0),o=(0,r.iH)(0),u=(0,r.iH)(""),c=(0,r.iH)(!0),s=()=>{n.value=0,l.value=0,a.value=0,o.value=0,u.value="",c.value=!0};return{move:r=>{var s,f,v=r.touches[0];n.value=(v.clientX<0?0:v.clientX)-t.value,l.value=v.clientY-e.value,a.value=Math.abs(n.value),o.value=Math.abs(l.value);if(!u.value||a.value<10&&o.value<10){;u.value=(s=a.value,s>(f=o.value)?"horizontal":f>s?"vertical":"")}c.value&&(a.value>i.mH||o.value>i.mH)&&(c.value=!1)},start:n=>{s(),t.value=n.touches[0].clientX,e.value=n.touches[0].clientY},reset:s,startX:t,startY:e,deltaX:n,deltaY:l,offsetX:a,offsetY:o,direction:u,isVertical:()=>"vertical"===u.value,isHorizontal:()=>"horizontal"===u.value,isTap:c}}},96528:function(t,e,n){"use strict";n.d(e,{JO:function(){return l}});var r=n("63112"),i=n("28779"),l=(0,r.n)(i.Z);e.ZP=l},8051:function(t,e,n){"use strict";n.d(e,{Cp:function(){return d},T5:function(){return r},WN:function(){return v},_K:function(){return u},a8:function(){return l},dt:function(){return a},e9:function(){return f},k7:function(){return i},mH:function(){return m},pj:function(){return s},r5:function(){return c},xe:function(){return o}}),n("86795");var r="van-hairline",i="".concat(r,"--top"),l="".concat(r,"--left"),a="".concat(r,"--right"),o="".concat(r,"--bottom"),u="".concat(r,"--surround"),c="".concat(r,"--top-bottom"),s="".concat(r,"-unset--top-bottom"),f="van-haptics-feedback",v=Symbol("van-form"),d=500,m=5},55987:function(t,e,n){"use strict";n.d(e,{I:function(){return i}});var r=n("12308");function i(t,e){var{args:n=[],done:i,canceled:l,error:a}=e;if(t){var o=t.apply(null,n);(0,r.tI)(o)?o.then(t=>{t?i():l&&l()}).catch(a||r.ZT):o?i():l&&l()}else i()}},78335:function(t,e,n){"use strict";n.d(e,{Ce:function(){return o},J5:function(){return l},Or:function(){return i},SI:function(){return c},SQ:function(){return s},Vg:function(){return r},ir:function(){return a},qM:function(){return u}});var r=null,i=[Number,String],l={type:Boolean,default:!0},a=t=>({type:t,required:!0}),o=()=>({type:Array,default:()=>[]}),u=t=>({type:Number,default:t}),c=t=>({type:i,default:t}),s=t=>({type:String,default:t})},63112:function(t,e,n){"use strict";n.d(e,{n:function(){return i}});var r=n("20358");function i(t){return t.install=e=>{var{name:n}=t;n&&(e.component(n,t),e.component((0,r._A)("-".concat(n)),t))},t}},14563:function(t,e,n){"use strict";n("82116"),n("17989");var r=n("80681"),i=n("11848"),l=n("62568"),a=n("78335"),o=n("12308"),u=n("20358"),c=n("82210"),s=n("83882"),f=n("22300"),v=n("96528"),[d,m]=(0,l.do)("back-top"),p={right:a.Or,bottom:a.Or,zIndex:a.Or,target:[String,Object],offset:(0,a.SI)(200),immediate:Boolean,teleport:{type:[String,Object],default:"body"}};e.Z=(0,r.aZ)({name:d,inheritAttrs:!1,props:p,emits:["click"],setup(t,e){var{emit:n,slots:l,attrs:a}=e,d=!1,p=(0,i.iH)(!1),g=(0,i.iH)(),h=(0,i.iH)(),b=(0,r.Fl)(()=>(0,o.l7)((0,u.As)(t.zIndex),{right:(0,u.Nn)(t.right),bottom:(0,u.Nn)(t.bottom)})),S=e=>{var r;n("click",e),null===(r=h.value)||void 0===r||r.scrollTo({top:0,behavior:t.immediate?"auto":"smooth"})},y=()=>{p.value=!!h.value&&(0,c.cx)(h.value)>=+t.offset},k=()=>{var{target:e}=t;if("string"!=typeof e)return e;var n=document.querySelector(e);if(n)return n},P=()=>{o._f&&(0,r.Y3)(()=>{h.value=t.target?k():(0,f.rP)(g.value),y()})};return(0,f.OR)("scroll",(0,s.P2)(y,100),{target:h}),(0,r.bv)(P),(0,r.dl)(()=>{d&&(p.value=!0,d=!1)}),(0,r.se)(()=>{p.value&&t.teleport&&(p.value=!1,d=!0)}),(0,r.YP)(()=>t.target,P),()=>{var e,n=(0,r.Wm)("div",(0,r.dG)({ref:t.teleport?void 0:g,class:m({active:p.value}),style:b.value,onClick:S},a),[l.default?l.default():(0,r.Wm)(v.JO,{name:"back-top",class:m("icon")},null)]);if(t.teleport){;return[(0,r.Wm)("div",{ref:g,class:m("placeholder")},null),(0,r.Wm)(r.lR,{to:t.teleport},"function"!=typeof(e=n)&&("[object Object]"!==Object.prototype.toString.call(e)||(0,r.lA)(e))?{default:()=>[n]}:n)]}return n}}})},63022:function(t,e,n){"use strict";n("82116"),n("17989"),n("56115"),n("59644"),n("89176");var r=n("80681"),i=n("62568"),l=n("78335"),a=n("12308"),o=n("20358"),[u,c]=(0,i.do)("badge"),s={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")};e.Z=(0,r.aZ)({name:u,props:s,setup(t,e){var{slots:n}=e,i=()=>{if(n.content)return!0;var{content:e,showZero:r}=t;return(0,a.Xq)(e)&&""!==e&&(r||0!==e&&"0"!==e)},l=()=>{var{dot:e,max:r,content:l}=t;if(!e&&i())return n.content?n.content():(0,a.Xq)(r)&&(0,a.kE)(l)&&+l>+r?"".concat(r,"+"):l},u=t=>t.startsWith("-")?t.replace("-",""):"-".concat(t),s=(0,r.Fl)(()=>{var e={background:t.color};if(t.offset){var[r,i]=t.offset,{position:l}=t,[a,c]=l.split("-");n.default?("number"==typeof i?e[a]=(0,o.Nn)("top"===a?i:-i):e[a]="top"===a?(0,o.Nn)(i):u(i),"number"==typeof r?e[c]=(0,o.Nn)("left"===c?r:-r):e[c]="left"===c?(0,o.Nn)(r):u(r)):(e.marginTop=(0,o.Nn)(i),e.marginLeft=(0,o.Nn)(r))}return e}),f=()=>{if(i()||t.dot)return(0,r.Wm)("div",{class:c([t.position,{dot:t.dot,fixed:!!n.default}]),style:s.value},[l()])};return()=>{if(n.default){var{tag:e}=t;return(0,r.Wm)(e,{class:c("wrapper")},{default:()=>[n.default(),f()]})}return f()}}})},54499:function(t,e,n){"use strict";n.d(e,{x_:function(){return f}}),n("82116"),n("17989");var r=n("80681"),i=n("62568"),l=n("78335"),a=n("12308"),o=n("6149"),u=n("96528"),[c,s]=(0,i.do)("cell"),f={tag:(0,l.SQ)("div"),icon:String,size:String,title:l.Or,value:l.Or,label:l.Or,center:Boolean,isLink:Boolean,border:l.J5,iconPrefix:String,valueClass:l.Vg,labelClass:l.Vg,titleClass:l.Vg,titleStyle:null,arrowDirection:String,required:{type:[Boolean,String],default:null},clickable:{type:Boolean,default:null}},v=(0,a.l7)({},f,o.g2);e.ZP=(0,r.aZ)({name:c,props:v,setup(t,e){var{slots:n}=e,i=(0,o.yj)(),l=()=>{if(n.label||(0,a.Xq)(t.label))return(0,r.Wm)("div",{class:[s("label"),t.labelClass]},[n.label?n.label():t.label])},c=()=>{if(n.title||(0,a.Xq)(t.title)){var e,i=null===(e=n.title)||void 0===e?void 0:e.call(n);if(!Array.isArray(i)||0!==i.length)return(0,r.Wm)("div",{class:[s("title"),t.titleClass],style:t.titleStyle},[i||(0,r.Wm)("span",null,[t.title]),l()])}},f=()=>{var e=n.value||n.default;if(e||(0,a.Xq)(t.value))return(0,r.Wm)("div",{class:[s("value"),t.valueClass]},[e?e():(0,r.Wm)("span",null,[t.value])])},v=()=>n.icon?n.icon():t.icon?(0,r.Wm)(u.JO,{name:t.icon,class:s("left-icon"),classPrefix:t.iconPrefix},null):void 0,d=()=>{if(n["right-icon"])return n["right-icon"]();if(t.isLink){var e=t.arrowDirection&&"right"!==t.arrowDirection?"arrow-".concat(t.arrowDirection):"arrow";return(0,r.Wm)(u.JO,{name:e,class:s("right-icon")},null)}};return()=>{var e,{tag:l,size:a,center:o,border:u,isLink:m,required:p}=t,g=null!==(e=t.clickable)&&void 0!==e?e:m,h={center:o,required:!!p,clickable:g,borderless:!u};return a&&(h[a]=!!a),(0,r.Wm)(l,{class:s(h),role:g?"button":void 0,tabindex:g?0:void 0,onClick:i},{default:()=>{var t;return[v(),c(),f(),d(),null===(t=n.extra)||void 0===t?void 0:t.call(n)]}})}}})},53419:function(t,e,n){"use strict";n.d(e,{q9:function(){return f}}),n("82116"),n("17989"),n("86795"),n("56115"),n("59644"),n("31564"),n("8649"),n("70629");var r=n("80681"),i=n("62568"),l=n("78335"),a=n("20358"),o=n("12308"),u=n("14517"),[c,s]=(0,i.do)("config-provider"),f=Symbol(c),v={tag:(0,l.SQ)("div"),theme:(0,l.SQ)("light"),zIndex:Number,themeVars:Object,themeVarsDark:Object,themeVarsLight:Object,themeVarsScope:(0,l.SQ)("local"),iconPrefix:String};function d(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach(n=>{t[n]!==e[n]&&document.documentElement.style.setProperty(n,t[n])}),Object.keys(e).forEach(e=>{!t[e]&&document.documentElement.style.removeProperty(e)})}e.ZP=(0,r.aZ)({name:c,props:v,setup(t,e){var{slots:n}=e,i=(0,r.Fl)(()=>{var e,n;return e=(0,o.l7)({},t.themeVars,"dark"===t.theme?t.themeVarsDark:t.themeVarsLight),n={},Object.keys(e).forEach(t=>{var r=(0,a.GL)(t).replace(/([a-zA-Z])(\d)/g,"$1-$2");n["--van-".concat(r)]=e[t]}),n});if(o._f){var l=()=>{document.documentElement.classList.add("van-theme-".concat(t.theme))},c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.theme;document.documentElement.classList.remove("van-theme-".concat(e))};(0,r.YP)(()=>t.theme,(t,e)=>{e&&c(e),l()},{immediate:!0}),(0,r.dl)(l),(0,r.se)(c),(0,r.Jd)(c),(0,r.YP)(i,(e,n)=>{"global"===t.themeVarsScope&&d(e,n)}),(0,r.YP)(()=>t.themeVarsScope,(t,e)=>{"global"===e&&d({},i.value),"global"===t&&d(i.value,{})}),"global"===t.themeVarsScope&&d(i.value,{})}return(0,r.JJ)(f,t),(0,r.m0)(()=>{void 0!==t.zIndex&&(0,u.H)(t.zIndex)}),()=>(0,r.Wm)(t.tag,{class:s(),style:"local"===t.themeVarsScope?i.value:void 0},{default:()=>{var t;return[null===(t=n.default)||void 0===t?void 0:t.call(n)]}})}})},28779:function(t,e,n){"use strict";n("82116"),n("17989"),n("24660");var r=n("80681"),i=n("62568"),l=n("78335"),a=n("20358"),o=n("72555"),u=n("53419"),[c,s]=(0,i.do)("icon"),f=t=>null==t?void 0:t.includes("/"),v={dot:Boolean,tag:(0,l.SQ)("i"),name:String,size:l.Or,badge:l.Or,color:String,badgeProps:Object,classPrefix:String};e.Z=(0,r.aZ)({name:c,props:v,setup(t,e){var{slots:n}=e,i=(0,r.f3)(u.q9,null),l=(0,r.Fl)(()=>t.classPrefix||(null==i?void 0:i.iconPrefix)||s());return()=>{var{tag:e,dot:i,name:u,size:c,badge:v,color:d}=t,m=f(u);return(0,r.Wm)(o.Ct,(0,r.dG)({dot:i,tag:e,class:[l.value,m?"":"".concat(l.value,"-").concat(u)],style:{color:d,fontSize:(0,a.Nn)(c)},content:v},t.badgeProps),{default:()=>{var t;return[null===(t=n.default)||void 0===t?void 0:t.call(n),m&&(0,r.Wm)("img",{class:s("image"),src:u},null)]}})}}})},14911:function(t,e,n){"use strict";n.r(t.exports={})},82804:function(t,e,n){"use strict";n.r(t.exports={})}}]); |