mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
/*! For license information please see 9726.23275830.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([["9726"],{54269:function(e,t,n){"use strict";n.r(t);var s=n("11570");n("94907");let a=s.Z;t.default=a},11570:function(e,t,n){"use strict";var s=n("80681"),a=n("11848"),o=n("57122"),l=n("19924"),r=n("44616"),i=n("73934"),u=n("54369"),c=n("24647"),d=n("13118"),v=["src"],m=["src"],p=["src"];t.Z=(0,s.aZ)({__name:"index",setup(e){var t=(0,u.q)({"zh-CN":{try:"\u4E0B\u62C9\u8BD5\u8BD5",text:"\u5237\u65B0\u6B21\u6570",success:"\u5237\u65B0\u6210\u529F",successTip:"\u6210\u529F\u63D0\u793A",customTips:"\u81EA\u5B9A\u4E49\u63D0\u793A"},"en-US":{try:"Try it down",text:"Refresh Count",success:"Refresh success",successTip:"Success Tip",customTips:"Custom Tips"}}),n=(0,a.iH)(0),f=(0,a.iH)(!1),g=(0,s.Fl)(()=>n.value?"".concat(t("text"),": ").concat(n.value):t("try")),h=e=>{setTimeout(()=>{e&&(0,d.CF)(t("success")),f.value=!1,n.value++},1e3)};return(0,s.bv)(()=>{var e=new Image,t=new Image;e.src=(0,c.RQ)("doge.png"),t.src=(0,c.RQ)("doge-fire.jpeg")}),(e,n)=>((0,s.wg)(),(0,s.j4)((0,a.SU)(l.ZP),null,{default:(0,s.w5)(()=>[(0,s.Wm)((0,a.SU)(r.ZP),{title:(0,a.SU)(t)("basicUsage")},{default:(0,s.w5)(()=>[(0,s.Wm)((0,a.SU)(i.ZP),{modelValue:f.value,"onUpdate:modelValue":n[0]||(n[0]=e=>f.value=e),onRefresh:n[1]||(n[1]=e=>h(!0))},{default:(0,s.w5)(()=>[(0,s._)("p",null,(0,o.zw)(g.value),1)]),_:1},8,["modelValue"])]),_:1},8,["title"]),(0,s.Wm)((0,a.SU)(r.ZP),{title:(0,a.SU)(t)("successTip")},{default:(0,s.w5)(()=>[(0,s.Wm)((0,a.SU)(i.ZP),{modelValue:f.value,"onUpdate:modelValue":n[2]||(n[2]=e=>f.value=e),"success-text":(0,a.SU)(t)("success"),onRefresh:n[3]||(n[3]=e=>h(!1))},{default:(0,s.w5)(()=>[(0,s._)("p",null,(0,o.zw)(g.value),1)]),_:1},8,["modelValue","success-text"])]),_:1},8,["title"]),(0,s.Wm)((0,a.SU)(r.ZP),{title:(0,a.SU)(t)("customTips")},{default:(0,s.w5)(()=>[(0,s.Wm)((0,a.SU)(i.ZP),{modelValue:f.value,"onUpdate:modelValue":n[4]||(n[4]=e=>f.value=e),"head-height":"80",onRefresh:n[5]||(n[5]=e=>h(!0))},{pulling:(0,s.w5)(e=>{var{distance:t}=e;return[(0,s._)("img",{class:"doge",src:(0,a.SU)(c.RQ)("doge.png"),style:(0,o.j5)({transform:"scale(".concat(t/80,")")})},null,12,v)]}),loosing:(0,s.w5)(()=>[(0,s._)("img",{src:(0,a.SU)(c.RQ)("doge.png"),class:"doge"},null,8,m)]),loading:(0,s.w5)(()=>[(0,s._)("img",{src:(0,a.SU)(c.RQ)("doge-fire.jpeg"),class:"doge"},null,8,p)]),default:(0,s.w5)(()=>[(0,s._)("p",null,(0,o.zw)(g.value),1)]),_:1},8,["modelValue"])]),_:1},8,["title"])]),_:1}))}})},24647:function(e,t,n){"use strict";n.d(t,{RQ:function(){return s}});var s=e=>"https://fastly.jsdelivr.net/npm/@vant/assets/".concat(e)},95786:function(e,t,n){"use strict";n.d(t,{gb:function(){return o}});var s=n("63112"),a=n("2309"),o=(0,s.n)(a.Z);t.ZP=o},73934:function(e,t,n){"use strict";var s=n("63112"),a=n("74222"),o=(0,s.n)(a.Z);t.ZP=o},20897:function(e,t,n){"use strict";n.d(t,{G:function(){return a}});var s=0;function a(e){e?(!s&&document.body.classList.add("van-toast--unclickable"),s++):s&&!--s&&document.body.classList.remove("van-toast--unclickable")}},84285:function(e,t,n){"use strict";n.d(t,{H:function(){return i},o:function(){return r}});var s=n("11848"),a=n("39594"),o=n("12308"),l=n("10023");function r(){var e=(0,s.qj)({show:!1}),t=t=>{e.show=t},n=n=>{(0,o.l7)(e,n,{transitionAppear:!0}),t(!0)},a=()=>t(!1);return(0,l.F)({open:n,close:a,toggle:t}),{open:n,close:a,state:e,toggle:t}}function i(e){var t=(0,a.ri)(e),n=document.createElement("div");return document.body.appendChild(n),{instance:t.mount(n),unmount(){t.unmount(),document.body.removeChild(n)}}}},2309:function(e,t,n){"use strict";n("82116"),n("17989"),n("66786"),n("14529");var s=n("80681"),a=n("62568"),o=n("78335"),l=n("12308"),r=n("20358"),[i,u]=(0,a.do)("loading"),c=Array(12).fill(null).map((e,t)=>(0,s.Wm)("i",{class:u("line",String(t+1))},null)),d=(0,s.Wm)("svg",{class:u("circular"),viewBox:"25 25 50 50"},[(0,s.Wm)("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)]),v={size:o.Or,type:(0,o.SQ)("circular"),color:String,vertical:Boolean,textSize:o.Or,textColor:String};t.Z=(0,s.aZ)({name:i,props:v,setup(e,t){var{slots:n}=t,a=(0,s.Fl)(()=>(0,l.l7)({color:e.color},(0,r.Xn)(e.size))),o=()=>{var t="spinner"===e.type?c:d;return(0,s.Wm)("span",{class:u("spinner",e.type),style:a.value},[n.icon?n.icon():t])},i=()=>{if(n.default){var t;return(0,s.Wm)("span",{class:u("text"),style:{fontSize:(0,r.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,s.Wm)("div",{class:u([t,{vertical:n}]),"aria-live":"polite","aria-busy":!0},[o(),i()])}}})},74222:function(e,t,n){"use strict";n("82116"),n("17989"),n("24660"),n("61557");var s=n("80681"),a=n("11848"),o=n("62568"),l=n("78335"),r=n("82210"),i=n("22300"),u=n("29609"),c=n("95786"),[d,v,m]=(0,o.do)("pull-refresh"),p=["pulling","loosing","success"],f={disabled:Boolean,modelValue:Boolean,headHeight:(0,l.SI)(50),successText:String,pullingText:String,loosingText:String,loadingText:String,pullDistance:l.Or,successDuration:(0,l.SI)(500),animationDuration:(0,l.SI)(300)};t.Z=(0,s.aZ)({name:d,props:f,emits:["change","refresh","update:modelValue"],setup(e,t){var n,{emit:o,slots:l}=t,d=(0,a.iH)(),f=(0,a.iH)(),g=(0,i.eo)(d),h=(0,a.qj)({status:"normal",distance:0,duration:0}),y=(0,u.o)(),S=()=>{if(50!==e.headHeight)return{height:"".concat(e.headHeight,"px")}},w=()=>"loading"!==h.status&&"success"!==h.status&&!e.disabled,x=t=>{var n=+(e.pullDistance||e.headHeight);return t>n&&(t=t<2*n?n+(t-n)/2:1.5*n+(t-2*n)/4),Math.round(t)},C=(t,n)=>{var s=+(e.pullDistance||e.headHeight);h.distance=t,n?h.status="loading":0===t?h.status="normal":t<s?h.status="pulling":h.status="loosing",o("change",{status:h.status,distance:t})},b=()=>{var{status:t}=h;return"normal"===t?"":e["".concat(t,"Text")]||m(t)},T=()=>{var{status:e,distance:t}=h;if(l[e])return l[e]({distance:t});var n=[];return p.includes(e)&&n.push((0,s.Wm)("div",{class:v("text")},[b()])),"loading"===e&&n.push((0,s.Wm)(c.gb,{class:v("loading")},{default:b})),n},k=()=>{h.status="success",setTimeout(()=>{C(0)},+e.successDuration)},W=e=>{(n=0===(0,r.cx)(g.value))&&(h.duration=0,y.start(e))},U=e=>{w()&&W(e)},Z=()=>{n&&y.deltaY.value&&w()&&(h.duration=+e.animationDuration,"loosing"===h.status?(C(+e.headHeight,!0),o("update:modelValue",!0),(0,s.Y3)(()=>o("refresh"))):C(0))};return(0,s.YP)(()=>e.modelValue,t=>{h.duration=+e.animationDuration,t?C(+e.headHeight,!0):l.success||e.successText?k():C(0,!1)}),(0,i.OR)("touchmove",e=>{if(w()){!n&&W(e);var{deltaY:t}=y;y.move(e),n&&t.value>=0&&y.isVertical()&&((0,r.PF)(e),C(x(t.value)))}},{target:f}),()=>{var e,t={transitionDuration:"".concat(h.duration,"ms"),transform:h.distance?"translate3d(0,".concat(h.distance,"px, 0)"):""};return(0,s.Wm)("div",{ref:d,class:v()},[(0,s.Wm)("div",{ref:f,class:v("track"),style:t,onTouchstartPassive:U,onTouchend:Z,onTouchcancel:Z},[(0,s.Wm)("div",{class:v("head"),style:S()},[T()]),null===(e=l.default)||void 0===e?void 0:e.call(l)])])}}})},21083:function(e,t,n){"use strict";n("82116"),n("17989");var s=n("80681"),a=n("62568"),o=n("78335"),l=n("12308"),r=n("20897"),i=n("96528"),u=n("97760"),c=n("95786"),[d,v]=(0,a.do)("toast"),m=["show","overlay","teleport","transition","overlayClass","overlayStyle","closeOnClickOverlay","zIndex"],p={icon:String,show:Boolean,type:(0,o.SQ)("text"),overlay:Boolean,message:o.Or,iconSize:o.Or,duration:(0,o.qM)(2e3),position:(0,o.SQ)("middle"),teleport:[String,Object],wordBreak:String,className:o.Vg,iconPrefix:String,transition:(0,o.SQ)("van-fade"),loadingType:String,forbidClick:Boolean,overlayClass:o.Vg,overlayStyle:Object,closeOnClick:Boolean,closeOnClickOverlay:Boolean,zIndex:o.Or};t.Z=(0,s.aZ)({name:d,props:p,emits:["update:show"],setup(e,t){var n,{emit:a,slots:o}=t,d=!1,p=()=>{var t=e.show&&e.forbidClick;d!==t&&(d=t,(0,r.G)(d))},f=e=>a("update:show",e),g=()=>{e.closeOnClick&&f(!1)},h=()=>clearTimeout(n),y=()=>{var{icon:t,type:n,iconSize:a,iconPrefix:o,loadingType:l}=e;return t||"success"===n||"fail"===n?(0,s.Wm)(i.JO,{name:t||n,size:a,class:v("icon"),classPrefix:o},null):"loading"===n?(0,s.Wm)(c.gb,{class:v("loading"),size:a,type:l},null):void 0},S=()=>{var{type:t,message:n}=e;return o.message?(0,s.Wm)("div",{class:v("text")},[o.message()]):(0,l.Xq)(n)&&""!==n?"html"===t?(0,s.Wm)("div",{key:0,class:v("text"),innerHTML:String(n)},null):(0,s.Wm)("div",{class:v("text")},[n]):void 0};return(0,s.YP)(()=>[e.show,e.forbidClick],p),(0,s.YP)(()=>[e.show,e.type,e.message,e.duration],()=>{h(),e.show&&e.duration>0&&(n=setTimeout(()=>{f(!1)},e.duration))}),(0,s.bv)(p),(0,s.Ah)(p),()=>(0,s.Wm)(u.GI,(0,s.dG)({class:[v([e.position,"normal"===e.wordBreak?"break-normal":e.wordBreak,{[e.type]:!e.icon}]),e.className],lockScroll:!1,onClick:g,onClosed:h,"onUpdate:show":f},(0,l.ei)(e,m)),{default:()=>[y(),S()]})}})},13118:function(e,t,n){"use strict";n.d(t,{CF:function(){return v},LJ:function(){return g},XA:function(){return f},di:function(){return p},yg:function(){return h}}),n("24836"),n("41712"),n("80855"),n("10502"),n("7978"),n("66746"),n("17530"),n("87604"),n("57024"),n("22175"),n("85322"),n("47897"),n("48943"),n("43356"),n("82116"),n("17989"),n("96245"),n("37232"),n("70629"),n("61557"),n("31564"),n("8649");var s=n("80681"),a=n("11848"),o=n("12308"),l=n("84285"),r=n("21083"),i=[],u=(0,o.l7)({},{icon:"",type:"text",message:"",className:"",overlay:!1,onClose:void 0,onOpened:void 0,duration:2e3,teleport:"body",iconSize:void 0,iconPrefix:void 0,position:"middle",transition:"van-fade",forbidClick:!1,loadingType:void 0,overlayClass:"",overlayStyle:void 0,closeOnClick:!1,closeOnClickOverlay:!1}),c=new Map;function d(e){return(0,o.Kn)(e)?e:{message:e}}function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!o._f)return{};var t=function(){if(!i.length){var e=function(){var{instance:e,unmount:t}=(0,l.H)({setup(){var e=(0,a.iH)(""),{open:t,state:n,close:o,toggle:i}=(0,l.o)(),u=()=>{};return(0,s.YP)(e,e=>{n.message=e}),(0,s.FN)().render=()=>(0,s.Wm)(r.Z,(0,s.dG)(n,{onClosed:u,"onUpdate:show":i}),null),{open:t,close:o,message:e}}});return e}();i.push(e)}return i[i.length-1]}(),n=d(e);return t.open((0,o.l7)({},u,c.get(n.type||u.type),n)),t}var m=e=>t=>v((0,o.l7)({type:e},d(t))),p=m("loading"),f=m("success"),g=m("fail"),h=e=>{if(i.length){if(e)i.forEach(e=>{e.close()}),i=[];else{var t;i[0].close()}}}},94907:function(e,t,n){"use strict";n.r(e.exports={})},80627:function(e,t,n){"use strict";n.r(e.exports={})}}]); |