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 5030.25f886ca.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([["5030"],{72555:function(e,t,n){"use strict";n.d(t,{Ct:function(){return a}});var o=n("63112"),r=n("63022"),a=(0,o.n)(r.Z);t.ZP=a},65170:function(e,t,n){"use strict";n.d(t,{S:function(){return r},h:function(){return a}}),n("86795");var o=n("80681"),r=Symbol();function a(e){var t=(0,o.f3)(r,null);t&&(0,o.YP)(t,t=>{t&&e()})}},10023:function(e,t,n){"use strict";n.d(t,{F:function(){return a}});var o=n("80681"),r=n("12308");function a(e){var t=(0,o.FN)();t&&(0,r.l7)(t.proxy,e)}},14517:function(e,t,n){"use strict";n.d(t,{H:function(){return a},t:function(){return r}});var o=2e3,r=()=>++o,a=e=>{o=e}},55133:function(e,t,n){"use strict";n.d(t,{W:function(){return a}});var o=n("11848"),r=n("80681");function a(e){var t=(0,o.iH)(!1);return(0,r.YP)(e,e=>{e&&(t.value=e)},{immediate:!0}),e=>()=>t.value?e():null}},84503:function(e,t,n){"use strict";n.d(t,{F:function(){return i}});var o=n("80681"),r=n("22300"),a=n("29609"),u=n("82210"),l=0,c="van-overflow-hidden";function i(e,t){var n=(0,a.o)(),i=t=>{n.move(t);var o=n.deltaY.value>0?"10":"01",{scrollHeight:a,offsetHeight:l,scrollTop:c}=(0,r.rP)(t.target,e.value),i="11";0===c?i=l>=a?"00":"01":c+l>=a&&(i="10"),"11"!==i&&n.isVertical()&&!(parseInt(i,2)&parseInt(o,2))&&(0,u.PF)(t,!0)},s=()=>{document.addEventListener("touchstart",n.start),document.addEventListener("touchmove",i,{passive:!1}),!l&&document.body.classList.add(c),l++},v=()=>{l&&(document.removeEventListener("touchstart",n.start),document.removeEventListener("touchmove",i),!--l&&document.body.classList.remove(c))},d=()=>t()&&v();(0,r.Ib)(()=>t()&&s()),(0,o.se)(d),(0,o.Jd)(d),(0,o.YP)(t,e=>{e?s():v()})}},96277:function(e,t,n){"use strict";n.d(t,{a:function(){return r}});var o=n("80681"),r=()=>{var e,{scopeId:t}=(null===(e=(0,o.FN)())||void 0===e?void 0:e.vnode)||{};return t?{[t]:""}:null}},29609:function(e,t,n){"use strict";n.d(t,{o:function(){return a}});var o=n("11848"),r=n("8051");function a(){var e=(0,o.iH)(0),t=(0,o.iH)(0),n=(0,o.iH)(0),a=(0,o.iH)(0),u=(0,o.iH)(0),l=(0,o.iH)(0),c=(0,o.iH)(""),i=(0,o.iH)(!0),s=()=>{n.value=0,a.value=0,u.value=0,l.value=0,c.value="",i.value=!0};return{move:o=>{var s,v,d=o.touches[0];n.value=(d.clientX<0?0:d.clientX)-e.value,a.value=d.clientY-t.value,u.value=Math.abs(n.value),l.value=Math.abs(a.value);if(!c.value||u.value<10&&l.value<10){;c.value=(s=u.value,s>(v=l.value)?"horizontal":v>s?"vertical":"")}i.value&&(u.value>r.mH||l.value>r.mH)&&(i.value=!1)},start:n=>{s(),e.value=n.touches[0].clientX,t.value=n.touches[0].clientY},reset:s,startX:e,startY:t,deltaX:n,deltaY:a,offsetX:u,offsetY:l,direction:c,isVertical:()=>"vertical"===c.value,isHorizontal:()=>"horizontal"===c.value,isTap:i}}},96528:function(e,t,n){"use strict";n.d(t,{JO:function(){return a}});var o=n("63112"),r=n("28779"),a=(0,o.n)(r.Z);t.ZP=a},28441:function(e,t,n){"use strict";n.d(t,{aV:function(){return a}});var o=n("63112"),r=n("64302"),a=(0,o.n)(r.Z);t.ZP=a},97760:function(e,t,n){"use strict";n.d(t,{GI:function(){return a}});var o=n("63112"),r=n("72522"),a=(0,o.n)(r.Z);t.ZP=a},3558:function(e,t,n){"use strict";n.d(t,{W:function(){return r},m:function(){return a}});var o=n("78335"),r={show:Boolean,zIndex:o.Or,overlay:o.J5,duration:o.Or,teleport:[String,Object],lockScroll:o.J5,lazyRender:o.J5,beforeClose:Function,overlayStyle:Object,overlayClass:o.Vg,transitionAppear:Boolean,closeOnClickOverlay:o.J5},a=Object.keys(r)},8051:function(e,t,n){"use strict";n.d(t,{Cp:function(){return f},T5:function(){return o},WN:function(){return d},_K:function(){return c},a8:function(){return a},dt:function(){return u},e9:function(){return v},k7:function(){return r},mH:function(){return m},pj:function(){return s},r5:function(){return i},xe:function(){return l}}),n("86795");var o="van-hairline",r="".concat(o,"--top"),a="".concat(o,"--left"),u="".concat(o,"--right"),l="".concat(o,"--bottom"),c="".concat(o,"--surround"),i="".concat(o,"--top-bottom"),s="".concat(o,"-unset--top-bottom"),v="van-haptics-feedback",d=Symbol("van-form"),f=500,m=5},55987:function(e,t,n){"use strict";n.d(t,{I:function(){return r}});var o=n("12308");function r(e,t){var{args:n=[],done:r,canceled:a,error:u}=t;if(e){var l=e.apply(null,n);(0,o.tI)(l)?l.then(e=>{e?r():a&&a()}).catch(u||o.ZT):l?r():a&&a()}else r()}},78335:function(e,t,n){"use strict";n.d(t,{Ce:function(){return l},J5:function(){return a},Or:function(){return r},SI:function(){return i},SQ:function(){return s},Vg:function(){return o},ir:function(){return u},qM:function(){return c}});var o=null,r=[Number,String],a={type:Boolean,default:!0},u=e=>({type:e,required:!0}),l=()=>({type:Array,default:()=>[]}),c=e=>({type:Number,default:e}),i=e=>({type:r,default:e}),s=e=>({type:String,default:e})},63112:function(e,t,n){"use strict";n.d(t,{n:function(){return r}});var o=n("20358");function r(e){return e.install=t=>{var{name:n}=e;n&&(t.component(n,e),t.component((0,o._A)("-".concat(n)),e))},e}},63022:function(e,t,n){"use strict";n("82116"),n("17989"),n("56115"),n("59644"),n("89176");var o=n("80681"),r=n("62568"),a=n("78335"),u=n("12308"),l=n("20358"),[c,i]=(0,r.do)("badge"),s={dot:Boolean,max:a.Or,tag:(0,a.SQ)("div"),color:String,offset:Array,content:a.Or,showZero:a.J5,position:(0,a.SQ)("top-right")};t.Z=(0,o.aZ)({name:c,props:s,setup(e,t){var{slots:n}=t,r=()=>{if(n.content)return!0;var{content:t,showZero:o}=e;return(0,u.Xq)(t)&&""!==t&&(o||0!==t&&"0"!==t)},a=()=>{var{dot:t,max:o,content:a}=e;if(!t&&r())return n.content?n.content():(0,u.Xq)(o)&&(0,u.kE)(a)&&+a>+o?"".concat(o,"+"):a},c=e=>e.startsWith("-")?e.replace("-",""):"-".concat(e),s=(0,o.Fl)(()=>{var t={background:e.color};if(e.offset){var[o,r]=e.offset,{position:a}=e,[u,i]=a.split("-");n.default?("number"==typeof r?t[u]=(0,l.Nn)("top"===u?r:-r):t[u]="top"===u?(0,l.Nn)(r):c(r),"number"==typeof o?t[i]=(0,l.Nn)("left"===i?o:-o):t[i]="left"===i?(0,l.Nn)(o):c(o)):(t.marginTop=(0,l.Nn)(r),t.marginLeft=(0,l.Nn)(o))}return t}),v=()=>{if(r()||e.dot)return(0,o.Wm)("div",{class:i([e.position,{dot:e.dot,fixed:!!n.default}]),style:s.value},[a()])};return()=>{if(n.default){var{tag:t}=e;return(0,o.Wm)(t,{class:i("wrapper")},{default:()=>[n.default(),v()]})}return v()}}})},53419:function(e,t,n){"use strict";n.d(t,{q9:function(){return v}}),n("82116"),n("17989"),n("86795"),n("56115"),n("59644"),n("31564"),n("8649"),n("70629");var o=n("80681"),r=n("62568"),a=n("78335"),u=n("20358"),l=n("12308"),c=n("14517"),[i,s]=(0,r.do)("config-provider"),v=Symbol(i),d={tag:(0,a.SQ)("div"),theme:(0,a.SQ)("light"),zIndex:Number,themeVars:Object,themeVarsDark:Object,themeVarsLight:Object,themeVarsScope:(0,a.SQ)("local"),iconPrefix:String};function f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(e).forEach(n=>{e[n]!==t[n]&&document.documentElement.style.setProperty(n,e[n])}),Object.keys(t).forEach(t=>{!e[t]&&document.documentElement.style.removeProperty(t)})}t.ZP=(0,o.aZ)({name:i,props:d,setup(e,t){var{slots:n}=t,r=(0,o.Fl)(()=>{var t,n;return t=(0,l.l7)({},e.themeVars,"dark"===e.theme?e.themeVarsDark:e.themeVarsLight),n={},Object.keys(t).forEach(e=>{var o=(0,u.GL)(e).replace(/([a-zA-Z])(\d)/g,"$1-$2");n["--van-".concat(o)]=t[e]}),n});if(l._f){var a=()=>{document.documentElement.classList.add("van-theme-".concat(e.theme))},i=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.theme;document.documentElement.classList.remove("van-theme-".concat(t))};(0,o.YP)(()=>e.theme,(e,t)=>{t&&i(t),a()},{immediate:!0}),(0,o.dl)(a),(0,o.se)(i),(0,o.Jd)(i),(0,o.YP)(r,(t,n)=>{"global"===e.themeVarsScope&&f(t,n)}),(0,o.YP)(()=>e.themeVarsScope,(e,t)=>{"global"===t&&f({},r.value),"global"===e&&f(r.value,{})}),"global"===e.themeVarsScope&&f(r.value,{})}return(0,o.JJ)(v,e),(0,o.m0)(()=>{void 0!==e.zIndex&&(0,c.H)(e.zIndex)}),()=>(0,o.Wm)(e.tag,{class:s(),style:"local"===e.themeVarsScope?r.value:void 0},{default:()=>{var e;return[null===(e=n.default)||void 0===e?void 0:e.call(n)]}})}})},28779:function(e,t,n){"use strict";n("82116"),n("17989"),n("24660");var o=n("80681"),r=n("62568"),a=n("78335"),u=n("20358"),l=n("72555"),c=n("53419"),[i,s]=(0,r.do)("icon"),v=e=>null==e?void 0:e.includes("/"),d={dot:Boolean,tag:(0,a.SQ)("i"),name:String,size:a.Or,badge:a.Or,color:String,badgeProps:Object,classPrefix:String};t.Z=(0,o.aZ)({name:i,props:d,setup(e,t){var{slots:n}=t,r=(0,o.f3)(c.q9,null),a=(0,o.Fl)(()=>e.classPrefix||(null==r?void 0:r.iconPrefix)||s());return()=>{var{tag:t,dot:r,name:c,size:i,badge:d,color:f}=e,m=v(c);return(0,o.Wm)(l.Ct,(0,o.dG)({dot:r,tag:t,class:[a.value,m?"":"".concat(a.value,"-").concat(c)],style:{color:f,fontSize:(0,u.Nn)(i)},content:d},e.badgeProps),{default:()=>{var e;return[null===(e=n.default)||void 0===e?void 0:e.call(n),m&&(0,o.Wm)("img",{class:s("image"),src:c},null)]}})}}})},64302:function(e,t,n){"use strict";n("82116"),n("17989");var o=n("80681"),r=n("39594"),a=n("11848"),u=n("62568"),l=n("78335"),c=n("82210"),i=n("12308"),s=n("20358"),v=n("22300"),d=n("55133"),[f,m]=(0,u.do)("overlay"),p={show:Boolean,zIndex:l.Or,duration:l.Or,className:l.Vg,lockScroll:l.J5,lazyRender:l.J5,customStyle:Object};t.Z=(0,o.aZ)({name:f,props:p,setup(e,t){var{slots:n}=t,u=(0,a.iH)(),l=(0,d.W)(()=>e.show||!e.lazyRender),f=l(()=>{var t,a=(0,i.l7)((0,s.As)(e.zIndex),e.customStyle);return(0,i.Xq)(e.duration)&&(a.animationDuration="".concat(e.duration,"s")),(0,o.wy)((0,o.Wm)("div",{ref:u,style:a,class:[m(),e.className]},[null===(t=n.default)||void 0===t?void 0:t.call(n)]),[[r.F8,e.show]])});return(0,v.OR)("touchmove",t=>{e.lockScroll&&(0,c.PF)(t,!0)},{target:u}),()=>(0,o.Wm)(r.uT,{name:"van-fade",appear:!0},{default:f})}})},72522:function(e,t,n){"use strict";n("82116"),n("17989");var o=n("80681"),r=n("39594"),a=n("11848"),u=n("3558"),l=n("12308"),c=n("78335"),i=n("62568"),s=n("55987"),v=n("8051"),d=n("22300"),f=n("10023"),m=n("84503"),p=n("55133"),h=n("65170"),y=n("14517"),b=n("96277"),g=n("96528"),S=n("28441"),O=(0,l.l7)({},u.W,{round:Boolean,position:(0,c.SQ)("center"),closeIcon:(0,c.SQ)("cross"),closeable:Boolean,transition:String,iconPrefix:String,closeOnPopstate:Boolean,closeIconPosition:(0,c.SQ)("top-right"),safeAreaInsetTop:Boolean,safeAreaInsetBottom:Boolean}),[k,P]=(0,i.do)("popup");t.Z=(0,o.aZ)({name:k,inheritAttrs:!1,props:O,emits:["open","close","opened","closed","keydown","update:show","clickOverlay","clickCloseIcon"],setup(e,t){var n,u,c,{emit:i,attrs:O,slots:k}=t,w=(0,a.iH)(),I=(0,a.iH)(),x=(0,p.W)(()=>e.show||!e.lazyRender),Z=(0,o.Fl)(()=>{var t={zIndex:w.value};return(0,l.Xq)(e.duration)&&(t["center"===e.position?"animationDuration":"transitionDuration"]="".concat(e.duration,"s")),t}),z=()=>{!n&&(n=!0,w.value=void 0!==e.zIndex?+e.zIndex:(0,y.t)(),i("open"))},W=()=>{n&&(0,s.I)(e.beforeClose,{done(){n=!1,i("close"),i("update:show",!1)}})},H=t=>{i("clickOverlay",t),e.closeOnClickOverlay&&W()},C=()=>{if(e.overlay)return(0,o.Wm)(S.aV,(0,o.dG)({show:e.show,class:e.overlayClass,zIndex:w.value,duration:e.duration,customStyle:e.overlayStyle,role:e.closeOnClickOverlay?"button":void 0,tabindex:e.closeOnClickOverlay?0:void 0},(0,b.a)(),{onClick:H}),{default:k["overlay-content"]})},V=e=>{i("clickCloseIcon",e),W()},J=()=>{if(e.closeable)return(0,o.Wm)(g.JO,{role:"button",tabindex:0,name:e.closeIcon,class:[P("close-icon",e.closeIconPosition),v.e9],classPrefix:e.iconPrefix,onClick:V},null)},F=()=>{c&&clearTimeout(c),c=setTimeout(()=>{i("opened")})},N=()=>i("closed"),E=e=>i("keydown",e),L=x(()=>{var t,{round:n,position:a,safeAreaInsetTop:u,safeAreaInsetBottom:l}=e;return(0,o.wy)((0,o.Wm)("div",(0,o.dG)({ref:I,style:Z.value,role:"dialog",tabindex:0,class:[P({round:n,[a]:a}),{"van-safe-area-top":u,"van-safe-area-bottom":l}],onKeydown:E},O,(0,b.a)()),[null===(t=k.default)||void 0===t?void 0:t.call(k),J()]),[[r.F8,e.show]])}),j=()=>{var{position:t,transition:n,transitionAppear:a}=e;return(0,o.Wm)(r.uT,{name:n||("center"===t?"van-fade":"van-popup-slide-".concat(t)),appear:a,onAfterEnter:F,onAfterLeave:N},{default:L})};return(0,o.YP)(()=>e.show,e=>{e&&!n&&(z(),0===O.tabindex&&(0,o.Y3)(()=>{var e;null===(e=I.value)||void 0===e||e.focus()})),!e&&n&&(n=!1,i("close"))}),(0,f.F)({popupRef:I}),(0,m.F)(I,()=>e.show&&e.lockScroll),(0,d.OR)("popstate",()=>{e.closeOnPopstate&&(W(),u=!1)}),(0,o.bv)(()=>{e.show&&z()}),(0,o.dl)(()=>{u&&(i("update:show",!0),u=!1)}),(0,o.se)(()=>{e.show&&e.teleport&&(W(),u=!0)}),(0,o.JJ)(h.S,()=>e.show),()=>e.teleport?(0,o.Wm)(o.lR,{to:e.teleport},{default:()=>[C(),j()]}):(0,o.Wm)(o.HY,null,[C(),j()])}})}}]); |