vant/static/js/async/2616.607a1c98.js
2024-04-20 08:49:23 +00:00

2 lines
12 KiB
JavaScript

/*! For license information please see 2616.607a1c98.js.LICENSE.txt */
(self.webpackChunk=self.webpackChunk||[]).push([["2616"],{18548:function(e,t,l){"use strict";l.r(t);var a=l("92703");l("48812");let r=a.Z;t.default=r},92703:function(e,t,l){"use strict";var a=l("80681"),r=l("11848"),n=l("57122"),o=l("73393"),i=l("54369"),u=l("13118"),s={class:"custom-button"},d={style:{height:"150px",paddingLeft:"30px"}};t.Z=(0,a.aZ)({__name:"index",setup(e){var t=(0,i.q)({"zh-CN":{text:"\u5F53\u524D\u503C\uFF1A",title1:"\u57FA\u7840\u7528\u6CD5",title2:"\u53CC\u6ED1\u5757",title3:"\u6307\u5B9A\u9009\u62E9\u8303\u56F4",title4:"\u7981\u7528",title5:"\u6307\u5B9A\u6B65\u957F",vertical:"\u5782\u76F4\u65B9\u5411",customStyle:"\u81EA\u5B9A\u4E49\u6837\u5F0F",customButton:"\u81EA\u5B9A\u4E49\u6309\u94AE"},"en-US":{text:"Current value: ",title1:"Basic Usage",title2:"Dual thumb mode",title3:"Range",title4:"Disabled",title5:"Step size",vertical:"Vertical",customStyle:"Custom Style",customButton:"Custom Button"}}),l=(0,r.iH)(50),c=(0,r.iH)([20,60]),v=(0,r.iH)(0),m=(0,r.iH)(50),p=(0,r.iH)(50),f=(0,r.iH)(50),g=(0,r.iH)(50),b=(0,r.iH)(50),h=(0,r.iH)([20,60]),y=e=>(0,u.CF)(t("text")+e);return(e,i)=>{var u=(0,a.up)("demo-block");return(0,a.wg)(),(0,a.iD)(a.HY,null,[(0,a.Wm)(u,{title:(0,r.SU)(t)("title1")},{default:(0,a.w5)(()=>[(0,a.Wm)((0,r.SU)(o.ZP),{modelValue:l.value,"onUpdate:modelValue":i[0]||(i[0]=e=>l.value=e),onChange:y},null,8,["modelValue"])]),_:1},8,["title"]),(0,a.Wm)(u,{title:(0,r.SU)(t)("title2")},{default:(0,a.w5)(()=>[(0,a.Wm)((0,r.SU)(o.ZP),{range:"",modelValue:c.value,"onUpdate:modelValue":i[1]||(i[1]=e=>c.value=e),onChange:y},null,8,["modelValue"])]),_:1},8,["title"]),(0,a.Wm)(u,{title:(0,r.SU)(t)("title3")},{default:(0,a.w5)(()=>[(0,a.Wm)((0,r.SU)(o.ZP),{modelValue:v.value,"onUpdate:modelValue":i[2]||(i[2]=e=>v.value=e),min:-50,max:50,onChange:y},null,8,["modelValue"])]),_:1},8,["title"]),(0,a.Wm)(u,{title:(0,r.SU)(t)("title4")},{default:(0,a.w5)(()=>[(0,a.Wm)((0,r.SU)(o.ZP),{modelValue:m.value,"onUpdate:modelValue":i[3]||(i[3]=e=>m.value=e),disabled:""},null,8,["modelValue"])]),_:1},8,["title"]),(0,a.Wm)(u,{title:(0,r.SU)(t)("title5")},{default:(0,a.w5)(()=>[(0,a.Wm)((0,r.SU)(o.ZP),{modelValue:p.value,"onUpdate:modelValue":i[4]||(i[4]=e=>p.value=e),step:10,onChange:y},null,8,["modelValue"])]),_:1},8,["title"]),(0,a.Wm)(u,{title:(0,r.SU)(t)("customStyle")},{default:(0,a.w5)(()=>[(0,a.Wm)((0,r.SU)(o.ZP),{modelValue:f.value,"onUpdate:modelValue":i[5]||(i[5]=e=>f.value=e),"bar-height":"4px","active-color":"#ee0a24",onChange:y},null,8,["modelValue"])]),_:1},8,["title"]),(0,a.Wm)(u,{title:(0,r.SU)(t)("customButton")},{default:(0,a.w5)(()=>[(0,a.Wm)((0,r.SU)(o.ZP),{modelValue:g.value,"onUpdate:modelValue":i[6]||(i[6]=e=>g.value=e)},{button:(0,a.w5)(()=>[(0,a._)("div",s,(0,n.zw)(g.value),1)]),_:1},8,["modelValue"])]),_:1},8,["title"]),(0,a.Wm)(u,{title:(0,r.SU)(t)("vertical")},{default:(0,a.w5)(()=>[(0,a._)("div",d,[(0,a.Wm)((0,r.SU)(o.ZP),{modelValue:b.value,"onUpdate:modelValue":i[7]||(i[7]=e=>b.value=e),vertical:"",onChange:y},null,8,["modelValue"]),(0,a.Wm)((0,r.SU)(o.ZP),{modelValue:h.value,"onUpdate:modelValue":i[8]||(i[8]=e=>h.value=e),range:"",vertical:"",style:{"margin-left":"100px"},onChange:y},null,8,["modelValue"])])]),_:1},8,["title"])],64)}}})},95786:function(e,t,l){"use strict";l.d(t,{gb:function(){return n}});var a=l("63112"),r=l("2309"),n=(0,a.n)(r.Z);t.ZP=n},73393:function(e,t,l){"use strict";var a=l("63112"),r=l("31918"),n=(0,a.n)(r.Z);t.ZP=n},20897:function(e,t,l){"use strict";l.d(t,{G:function(){return r}});var a=0;function r(e){e?(!a&&document.body.classList.add("van-toast--unclickable"),a++):a&&!--a&&document.body.classList.remove("van-toast--unclickable")}},84285:function(e,t,l){"use strict";l.d(t,{H:function(){return u},o:function(){return i}});var a=l("11848"),r=l("39594"),n=l("12308"),o=l("10023");function i(){var e=(0,a.qj)({show:!1}),t=t=>{e.show=t},l=l=>{(0,n.l7)(e,l,{transitionAppear:!0}),t(!0)},r=()=>t(!1);return(0,o.F)({open:l,close:r,toggle:t}),{open:l,close:r,state:e,toggle:t}}function u(e){var t=(0,r.ri)(e),l=document.createElement("div");return document.body.appendChild(l),{instance:t.mount(l),unmount(){t.unmount(),document.body.removeChild(l)}}}},2309:function(e,t,l){"use strict";l("82116"),l("17989"),l("66786"),l("14529");var a=l("80681"),r=l("62568"),n=l("78335"),o=l("12308"),i=l("20358"),[u,s]=(0,r.do)("loading"),d=Array(12).fill(null).map((e,t)=>(0,a.Wm)("i",{class:s("line",String(t+1))},null)),c=(0,a.Wm)("svg",{class:s("circular"),viewBox:"25 25 50 50"},[(0,a.Wm)("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)]),v={size:n.Or,type:(0,n.SQ)("circular"),color:String,vertical:Boolean,textSize:n.Or,textColor:String};t.Z=(0,a.aZ)({name:u,props:v,setup(e,t){var{slots:l}=t,r=(0,a.Fl)(()=>(0,o.l7)({color:e.color},(0,i.Xn)(e.size))),n=()=>{var t="spinner"===e.type?d:c;return(0,a.Wm)("span",{class:s("spinner",e.type),style:r.value},[l.icon?l.icon():t])},u=()=>{if(l.default){var t;return(0,a.Wm)("span",{class:s("text"),style:{fontSize:(0,i.Nn)(e.textSize),color:null!==(t=e.textColor)&&void 0!==t?t:e.color}},[l.default()])}};return()=>{var{type:t,vertical:l}=e;return(0,a.Wm)("div",{class:s([t,{vertical:l}]),"aria-live":"polite","aria-busy":!0},[n(),u()])}}})},31918:function(e,t,l){"use strict";l("82116"),l("17989"),l("58294"),l("66786"),l("14529"),l("31564"),l("8649"),l("70629");var a=l("80681"),r=l("11848"),n=l("62568"),o=l("78335"),i=l("20358"),u=l("12308"),s=l("82210"),d=l("22300"),c=l("29609"),[v,m]=(0,n.do)("slider"),p={min:(0,o.SI)(0),max:(0,o.SI)(100),step:(0,o.SI)(1),range:Boolean,reverse:Boolean,disabled:Boolean,readonly:Boolean,vertical:Boolean,barHeight:o.Or,buttonSize:o.Or,activeColor:String,inactiveColor:String,modelValue:{type:[Number,Array],default:0}};t.Z=(0,a.aZ)({name:v,props:p,emits:["change","dragEnd","dragStart","update:modelValue"],setup(e,t){var l,n,o,{emit:v,slots:p}=t,f=(0,r.iH)(),g=[(0,r.iH)(),(0,r.iH)()],b=(0,r.iH)(),h=(0,c.o)(),y=(0,a.Fl)(()=>Number(e.max)-Number(e.min)),S=(0,a.Fl)(()=>{var t=e.vertical?"width":"height";return{background:e.inactiveColor,[t]:(0,i.Nn)(e.barHeight)}}),C=t=>e.range&&Array.isArray(t),V=()=>{var{modelValue:t,min:l}=e;return C(t)?"".concat((t[1]-t[0])*100/y.value,"%"):"".concat((t-Number(l))*100/y.value,"%")},w=()=>{var{modelValue:t,min:l}=e;return C(t)?"".concat((t[0]-Number(l))*100/y.value,"%"):"0%"},x=(0,a.Fl)(()=>{var t={[e.vertical?"height":"width"]:V(),background:e.activeColor};return b.value&&(t.transition="none"),t[e.vertical?e.reverse?"bottom":"top":e.reverse?"right":"left"]=w(),t}),W=t=>{var l=+e.min,a=+e.max,r=+e.step,n=Math.round(((t=(0,i.uZ)(t,l,a))-l)/r)*r;return(0,i.Ft)(l,n)},U=()=>{var t=e.modelValue;o=C(t)?t.map(W):W(t)},k=t=>{var l,a,r=null!==(l=t[0])&&void 0!==l?l:Number(e.min),n=null!==(a=t[1])&&void 0!==a?a:Number(e.max);return r>n?[n,r]:[r,n]},Z=(t,l)=>{t=C(t)?k(t).map(W):W(t),!(0,u.$c)(t,e.modelValue)&&v("update:modelValue",t),l&&!(0,u.$c)(t,o)&&v("change",t)},O=t=>{if(t.stopPropagation(),!e.disabled&&!e.readonly){U();var{min:l,reverse:a,vertical:r,modelValue:n}=e,o=(0,d.EL)(f),i=r?o.height:o.width,u=Number(l)+(()=>{if(r)return a?o.bottom-t.clientY:t.clientY-o.top;return a?o.right-t.clientX:t.clientX-o.left})()/i*y.value;if(C(n)){var[s,c]=n;u<=(s+c)/2?Z([u,c],!0):Z([s,u],!0)}else Z(u,!0)}},B=t=>{!e.disabled&&!e.readonly&&(h.start(t),n=e.modelValue,U(),b.value="start")},H=t=>{if(!e.disabled&&!e.readonly){"start"===b.value&&v("dragStart",t),(0,s.PF)(t,!0),h.move(t),b.value="dragging";var a=(0,d.EL)(f),r=(e.vertical?h.deltaY.value:h.deltaX.value)/(e.vertical?a.height:a.width)*y.value;if(e.reverse&&(r=-r),C(o)){var i=e.reverse?1-l:l;n[i]=o[i]+r}else n=o+r;Z(n)}},P=t=>{!e.disabled&&!e.readonly&&("dragging"===b.value&&(Z(n,!0),v("dragEnd",t)),b.value="")},z=t=>"number"==typeof t?m("button-wrapper",["left","right"][t]):m("button-wrapper",e.reverse?"left":"right"),N=(t,r)=>{var o="dragging"===b.value;if("number"==typeof r){var u,s=p[0===r?"left-button":"right-button"];if(o&&Array.isArray(n)&&(u=n[0]>n[1]?1^l:l),s)return s({value:t,dragging:o,dragIndex:u})}return p.button?p.button({value:t,dragging:o}):(0,a.Wm)("div",{class:m("button"),style:(0,i.Xn)(e.buttonSize)},null)},_=t=>{var r="number"==typeof t?e.modelValue[t]:e.modelValue;return(0,a.Wm)("div",{ref:g[null!=t?t:0],role:"slider",class:z(t),tabindex:e.disabled?void 0:0,"aria-valuemin":e.min,"aria-valuenow":r,"aria-valuemax":e.max,"aria-disabled":e.disabled||void 0,"aria-readonly":e.readonly||void 0,"aria-orientation":e.vertical?"vertical":"horizontal",onTouchstartPassive:e=>{"number"==typeof t&&(l=t),B(e)},onTouchend:P,onTouchcancel:P,onClick:s.UW},[N(r,t)])};return Z(e.modelValue),(0,d.aM)(()=>e.modelValue),g.forEach(e=>{(0,d.OR)("touchmove",H,{target:e})}),()=>(0,a.Wm)("div",{ref:f,style:S.value,class:m({vertical:e.vertical,disabled:e.disabled}),onClick:O},[(0,a.Wm)("div",{class:m("bar"),style:x.value},[e.range?[_(0),_(1)]:_()])])}})},21083:function(e,t,l){"use strict";l("82116"),l("17989");var a=l("80681"),r=l("62568"),n=l("78335"),o=l("12308"),i=l("20897"),u=l("96528"),s=l("97760"),d=l("95786"),[c,v]=(0,r.do)("toast"),m=["show","overlay","teleport","transition","overlayClass","overlayStyle","closeOnClickOverlay","zIndex"],p={icon:String,show:Boolean,type:(0,n.SQ)("text"),overlay:Boolean,message:n.Or,iconSize:n.Or,duration:(0,n.qM)(2e3),position:(0,n.SQ)("middle"),teleport:[String,Object],wordBreak:String,className:n.Vg,iconPrefix:String,transition:(0,n.SQ)("van-fade"),loadingType:String,forbidClick:Boolean,overlayClass:n.Vg,overlayStyle:Object,closeOnClick:Boolean,closeOnClickOverlay:Boolean,zIndex:n.Or};t.Z=(0,a.aZ)({name:c,props:p,emits:["update:show"],setup(e,t){var l,{emit:r,slots:n}=t,c=!1,p=()=>{var t=e.show&&e.forbidClick;c!==t&&(c=t,(0,i.G)(c))},f=e=>r("update:show",e),g=()=>{e.closeOnClick&&f(!1)},b=()=>clearTimeout(l),h=()=>{var{icon:t,type:l,iconSize:r,iconPrefix:n,loadingType:o}=e;return t||"success"===l||"fail"===l?(0,a.Wm)(u.JO,{name:t||l,size:r,class:v("icon"),classPrefix:n},null):"loading"===l?(0,a.Wm)(d.gb,{class:v("loading"),size:r,type:o},null):void 0},y=()=>{var{type:t,message:l}=e;return n.message?(0,a.Wm)("div",{class:v("text")},[n.message()]):(0,o.Xq)(l)&&""!==l?"html"===t?(0,a.Wm)("div",{key:0,class:v("text"),innerHTML:String(l)},null):(0,a.Wm)("div",{class:v("text")},[l]):void 0};return(0,a.YP)(()=>[e.show,e.forbidClick],p),(0,a.YP)(()=>[e.show,e.type,e.message,e.duration],()=>{b(),e.show&&e.duration>0&&(l=setTimeout(()=>{f(!1)},e.duration))}),(0,a.bv)(p),(0,a.Ah)(p),()=>(0,a.Wm)(s.GI,(0,a.dG)({class:[v([e.position,"normal"===e.wordBreak?"break-normal":e.wordBreak,{[e.type]:!e.icon}]),e.className],lockScroll:!1,onClick:g,onClosed:b,"onUpdate:show":f},(0,o.ei)(e,m)),{default:()=>[h(),y()]})}})},13118:function(e,t,l){"use strict";l.d(t,{CF:function(){return v},LJ:function(){return g},XA:function(){return f},di:function(){return p},yg:function(){return b}}),l("24836"),l("41712"),l("80855"),l("10502"),l("7978"),l("66746"),l("17530"),l("87604"),l("57024"),l("22175"),l("85322"),l("47897"),l("48943"),l("43356"),l("82116"),l("17989"),l("96245"),l("37232"),l("70629"),l("61557"),l("31564"),l("8649");var a=l("80681"),r=l("11848"),n=l("12308"),o=l("84285"),i=l("21083"),u=[],s=(0,n.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}),d=new Map;function c(e){return(0,n.Kn)(e)?e:{message:e}}function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!n._f)return{};var t=function(){if(!u.length){var e=function(){var{instance:e,unmount:t}=(0,o.H)({setup(){var e=(0,r.iH)(""),{open:t,state:l,close:n,toggle:u}=(0,o.o)(),s=()=>{};return(0,a.YP)(e,e=>{l.message=e}),(0,a.FN)().render=()=>(0,a.Wm)(i.Z,(0,a.dG)(l,{onClosed:s,"onUpdate:show":u}),null),{open:t,close:n,message:e}}});return e}();u.push(e)}return u[u.length-1]}(),l=c(e);return t.open((0,n.l7)({},s,d.get(l.type||s.type),l)),t}var m=e=>t=>v((0,n.l7)({type:e},c(t))),p=m("loading"),f=m("success"),g=m("fail"),b=e=>{if(u.length){if(e)u.forEach(e=>{e.close()}),u=[];else{var t;u[0].close()}}}},48812:function(e,t,l){"use strict";l.r(e.exports={})},87115:function(e,t,l){"use strict";l.r(e.exports={})}}]);