mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
2 lines
14 KiB
JavaScript
2 lines
14 KiB
JavaScript
/*! For license information please see 8811.4e7b0f35.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([["8811"],{71625:function(t,n,o){"use strict";o.r(n);var e=o("22134");o("57339");let i=e.Z;n.default=i},22134:function(t,n,o){"use strict";var e=o("80681"),i=o("11848"),r=o("80902"),l=o("90743"),a=o("78197"),c=o("54369"),u=o("13118");n.Z=(0,e.aZ)({__name:"index",setup(t){var n=(0,c.q)({"zh-CN":{icon1:"\u5BA2\u670D",icon2:"\u8D2D\u7269\u8F66",icon3:"\u5E97\u94FA",button1:"\u52A0\u5165\u8D2D\u7269\u8F66",button2:"\u7ACB\u5373\u8D2D\u4E70",iconBadge:"\u5FBD\u6807\u63D0\u793A",collected:"\u5DF2\u6536\u85CF",clickIcon:"\u70B9\u51FB\u56FE\u6807",clickButton:"\u70B9\u51FB\u6309\u94AE",customIconColor:"\u81EA\u5B9A\u4E49\u56FE\u6807\u989C\u8272",customButtonColor:"\u81EA\u5B9A\u4E49\u6309\u94AE\u989C\u8272"},"en-US":{icon1:"Icon1",icon2:"Icon2",icon3:"Icon3",button1:"Button",button2:"Button",iconBadge:"Icon Badge",collected:"Collected",clickIcon:"Click Icon",clickButton:"Click Button",customIconColor:"Custom Icon Color",customButtonColor:"Custom Button Color"}}),o=()=>(0,u.CF)(n("clickIcon")),s=()=>(0,u.CF)(n("clickButton"));return(t,c)=>{var u=(0,e.up)("demo-block");return(0,e.wg)(),(0,e.iD)(e.HY,null,[(0,e.Wm)(u,{title:(0,i.SU)(n)("basicUsage")},{default:(0,e.w5)(()=>[(0,e.Wm)((0,i.SU)(r.ZP),null,{default:(0,e.w5)(()=>[(0,e.Wm)((0,i.SU)(l.ZP),{icon:"chat-o",text:(0,i.SU)(n)("icon1"),onClick:o},null,8,["text"]),(0,e.Wm)((0,i.SU)(l.ZP),{icon:"cart-o",text:(0,i.SU)(n)("icon2"),onClick:o},null,8,["text"]),(0,e.Wm)((0,i.SU)(l.ZP),{icon:"shop-o",text:(0,i.SU)(n)("icon3"),onClick:o},null,8,["text"]),(0,e.Wm)((0,i.SU)(a.ZP),{type:"danger",text:(0,i.SU)(n)("button2"),onClick:s},null,8,["text"])]),_:1})]),_:1},8,["title"]),(0,e.Wm)(u,{title:(0,i.SU)(n)("iconBadge")},{default:(0,e.w5)(()=>[(0,e.Wm)((0,i.SU)(r.ZP),null,{default:(0,e.w5)(()=>[(0,e.Wm)((0,i.SU)(l.ZP),{icon:"chat-o",dot:"",text:(0,i.SU)(n)("icon1")},null,8,["text"]),(0,e.Wm)((0,i.SU)(l.ZP),{icon:"cart-o",badge:"5",text:(0,i.SU)(n)("icon2")},null,8,["text"]),(0,e.Wm)((0,i.SU)(l.ZP),{icon:"shop-o",badge:"12",text:(0,i.SU)(n)("icon3")},null,8,["text"]),(0,e.Wm)((0,i.SU)(a.ZP),{type:"warning",text:(0,i.SU)(n)("button1")},null,8,["text"]),(0,e.Wm)((0,i.SU)(a.ZP),{type:"danger",text:(0,i.SU)(n)("button2")},null,8,["text"])]),_:1})]),_:1},8,["title"]),(0,e.Wm)(u,{title:(0,i.SU)(n)("customIconColor")},{default:(0,e.w5)(()=>[(0,e.Wm)((0,i.SU)(r.ZP),null,{default:(0,e.w5)(()=>[(0,e.Wm)((0,i.SU)(l.ZP),{icon:"chat-o",text:(0,i.SU)(n)("icon1"),color:"#ee0a24"},null,8,["text"]),(0,e.Wm)((0,i.SU)(l.ZP),{icon:"cart-o",text:(0,i.SU)(n)("icon2")},null,8,["text"]),(0,e.Wm)((0,i.SU)(l.ZP),{icon:"star",text:(0,i.SU)(n)("collected"),color:"#ff5000"},null,8,["text"]),(0,e.Wm)((0,i.SU)(a.ZP),{type:"warning",text:(0,i.SU)(n)("button1")},null,8,["text"]),(0,e.Wm)((0,i.SU)(a.ZP),{type:"danger",text:(0,i.SU)(n)("button2")},null,8,["text"])]),_:1})]),_:1},8,["title"]),(0,e.Wm)(u,{title:(0,i.SU)(n)("customButtonColor")},{default:(0,e.w5)(()=>[(0,e.Wm)((0,i.SU)(r.ZP),null,{default:(0,e.w5)(()=>[(0,e.Wm)((0,i.SU)(l.ZP),{icon:"chat-o",text:(0,i.SU)(n)("icon1")},null,8,["text"]),(0,e.Wm)((0,i.SU)(l.ZP),{icon:"cart-o",text:(0,i.SU)(n)("icon2")},null,8,["text"]),(0,e.Wm)((0,i.SU)(a.ZP),{color:"#be99ff",type:"warning",text:(0,i.SU)(n)("button1")},null,8,["text"]),(0,e.Wm)((0,i.SU)(a.ZP),{color:"#7232dd",type:"danger",text:(0,i.SU)(n)("button2")},null,8,["text"])]),_:1})]),_:1},8,["title"])],64)}}})},78197:function(t,n,o){"use strict";o.d(n,{ZL:function(){return r}});var e=o("63112"),i=o("27065"),r=(0,e.n)(i.Z);n.ZP=r},90743:function(t,n,o){"use strict";var e=o("63112"),i=o("56157"),r=(0,e.n)(i.Z);n.ZP=r},80902:function(t,n,o){"use strict";o.d(n,{ol:function(){return r}});var e=o("63112"),i=o("66840"),r=(0,e.n)(i.ZP);n.ZP=r},99497:function(t,n,o){"use strict";o.d(n,{zx:function(){return r}});var e=o("63112"),i=o("14314"),r=(0,e.n)(i.Z);n.ZP=r},55944:function(t,n,o){"use strict";o.d(n,{F:function(){return c}});var e=o("22300"),i=o("11848"),r=o("80681"),l=o("82210"),a=o("65170"),c=(t,n)=>{var o=(0,i.iH)(),c=()=>{o.value=(0,e.EL)(t).height};return(0,r.bv)(()=>{if((0,r.Y3)(c),n)for(var t=1;t<=3;t++)setTimeout(c,100*t)}),(0,a.h)(()=>(0,r.Y3)(c)),(0,r.YP)([l.bn,l.uK],c),o}},6149:function(t,n,o){"use strict";o.d(n,{BC:function(){return r},g2:function(){return i},yj:function(){return l}}),o("56115"),o("59644");var e=o("80681"),i={to:[String,Object],url:String,replace:Boolean};function r(t){var{to:n,url:o,replace:e,$router:i}=t;n&&i?i[e?"replace":"push"](n):o&&(e?location.replace(o):location.href=o)}function l(){var t=(0,e.FN)().proxy;return()=>r(t)}},95786:function(t,n,o){"use strict";o.d(n,{gb:function(){return r}});var e=o("63112"),i=o("2309"),r=(0,e.n)(i.Z);n.ZP=r},20897:function(t,n,o){"use strict";o.d(n,{G:function(){return i}});var e=0;function i(t){t?(!e&&document.body.classList.add("van-toast--unclickable"),e++):e&&!--e&&document.body.classList.remove("van-toast--unclickable")}},84285:function(t,n,o){"use strict";o.d(n,{H:function(){return c},o:function(){return a}});var e=o("11848"),i=o("39594"),r=o("12308"),l=o("10023");function a(){var t=(0,e.qj)({show:!1}),n=n=>{t.show=n},o=o=>{(0,r.l7)(t,o,{transitionAppear:!0}),n(!0)},i=()=>n(!1);return(0,l.F)({open:o,close:i,toggle:n}),{open:o,close:i,state:t,toggle:n}}function c(t){var n=(0,i.ri)(t),o=document.createElement("div");return document.body.appendChild(o),{instance:n.mount(o),unmount(){n.unmount(),document.body.removeChild(o)}}}},27065:function(t,n,o){"use strict";o("82116"),o("17989");var e=o("80681"),i=o("62568"),r=o("12308"),l=o("66840"),a=o("22300"),c=o("10023"),u=o("6149"),s=o("99497"),[d,f]=(0,i.do)("action-bar-button"),v=(0,r.l7)({},u.g2,{type:String,text:String,icon:String,color:String,loading:Boolean,disabled:Boolean});n.Z=(0,e.aZ)({name:d,props:v,setup(t,n){var{slots:o}=n,i=(0,u.yj)(),{parent:r,index:d}=(0,a.NB)(l.FO),v=(0,e.Fl)(()=>{if(r){var t=r.children[d.value-1];return!(t&&"isButton"in t)}}),m=(0,e.Fl)(()=>{if(r){var t=r.children[d.value+1];return!(t&&"isButton"in t)}});return(0,c.F)({isButton:!0}),()=>{var{type:n,icon:r,text:l,color:a,loading:c,disabled:u}=t;return(0,e.Wm)(s.zx,{class:f([n,{last:m.value,first:v.value}]),size:"large",type:n,icon:r,color:a,loading:c,disabled:u,onClick:i},{default:()=>[o.default?o.default():l]})}}})},56157:function(t,n,o){"use strict";o("82116"),o("17989");var e=o("80681"),i=o("62568"),r=o("12308"),l=o("78335"),a=o("66840"),c=o("22300"),u=o("6149"),s=o("96528"),d=o("72555"),[f,v]=(0,i.do)("action-bar-icon"),m=(0,r.l7)({},u.g2,{dot:Boolean,text:String,icon:String,color:String,badge:l.Or,iconClass:l.Vg,badgeProps:Object,iconPrefix:String});n.Z=(0,e.aZ)({name:f,props:m,setup(t,n){var{slots:o}=n,i=(0,u.yj)();(0,c.NB)(a.FO);var r=()=>{var{dot:n,badge:i,icon:r,color:l,iconClass:a,badgeProps:c,iconPrefix:u}=t;return o.icon?(0,e.Wm)(d.Ct,(0,e.dG)({dot:n,class:v("icon"),content:i},c),{default:o.icon}):(0,e.Wm)(s.JO,{tag:"div",dot:n,name:r,badge:i,color:l,class:[v("icon"),a],badgeProps:c,classPrefix:u},null)};return()=>(0,e.Wm)("div",{role:"button",class:v(),tabindex:0,onClick:i},[r(),o.default?o.default():t.text])}})},66840:function(t,n,o){"use strict";o.d(n,{FO:function(){return d}}),o("82116"),o("17989"),o("86795");var e=o("80681"),i=o("11848"),r=o("62568"),l=o("78335"),a=o("22300"),c=o("90516"),[u,s]=(0,r.do)("action-bar"),d=Symbol(u),f={placeholder:Boolean,safeAreaInsetBottom:l.J5};n.ZP=(0,e.aZ)({name:u,props:f,setup(t,n){var{slots:o}=n,r=(0,i.iH)(),l=(0,c.J)(r,s),{linkChildren:u}=(0,a.$E)(d);u();var f=()=>{var n;return(0,e.Wm)("div",{ref:r,class:[s(),{"van-safe-area-bottom":t.safeAreaInsetBottom}]},[null===(n=o.default)||void 0===n?void 0:n.call(o)])};return()=>t.placeholder?l(f):f()}})},14314:function(t,n,o){"use strict";o("82116"),o("17989"),o("24660");var e=o("80681"),i=o("62568"),r=o("12308"),l=o("78335"),a=o("82210"),c=o("8051"),u=o("6149"),s=o("96528"),d=o("95786"),[f,v]=(0,i.do)("button"),m=(0,r.l7)({},u.g2,{tag:(0,l.SQ)("button"),text:String,icon:String,type:(0,l.SQ)("default"),size:(0,l.SQ)("normal"),color:String,block:Boolean,plain:Boolean,round:Boolean,square:Boolean,loading:Boolean,hairline:Boolean,disabled:Boolean,iconPrefix:String,nativeType:(0,l.SQ)("button"),loadingSize:l.Or,loadingText:String,loadingType:String,iconPosition:(0,l.SQ)("left")});n.Z=(0,e.aZ)({name:f,props:m,emits:["click"],setup(t,n){var{emit:o,slots:i}=n,r=(0,u.yj)(),l=()=>i.loading?i.loading():(0,e.Wm)(d.gb,{size:t.loadingSize,type:t.loadingType,class:v("loading")},null),f=()=>t.loading?l():i.icon?(0,e.Wm)("div",{class:v("icon")},[i.icon()]):t.icon?(0,e.Wm)(s.JO,{name:t.icon,class:v("icon"),classPrefix:t.iconPrefix},null):void 0,m=()=>{var n;if(n=t.loading?t.loadingText:i.default?i.default():t.text)return(0,e.Wm)("span",{class:v("text")},[n])},g=()=>{var{color:n,plain:o}=t;if(n){var e={color:o?n:"white"};return!o&&(e.background=n),n.includes("gradient")?e.border=0:e.borderColor=n,e}},p=n=>{t.loading?(0,a.PF)(n):!t.disabled&&(o("click",n),r())};return()=>{var{tag:n,type:o,size:i,block:r,round:l,plain:a,square:u,loading:s,disabled:d,hairline:S,nativeType:x,iconPosition:b}=t,y=[v([o,i,{plain:a,block:r,round:l,square:u,loading:s,disabled:d,hairline:S}]),{[c._K]:S}];return(0,e.Wm)(n,{type:x,class:y,style:g(),disabled:d,onClick:p},{default:()=>[(0,e.Wm)("div",{class:v("content")},["left"===b&&f(),m(),"right"===b&&f()])]})}}})},90516:function(t,n,o){"use strict";o.d(n,{J:function(){return r}});var e=o("80681"),i=o("55944");function r(t,n){var o=(0,i.F)(t,!0);return t=>(0,e.Wm)("div",{class:n("placeholder"),style:{height:o.value?"".concat(o.value,"px"):void 0}},[t()])}},2309:function(t,n,o){"use strict";o("82116"),o("17989"),o("66786"),o("14529");var e=o("80681"),i=o("62568"),r=o("78335"),l=o("12308"),a=o("20358"),[c,u]=(0,i.do)("loading"),s=Array(12).fill(null).map((t,n)=>(0,e.Wm)("i",{class:u("line",String(n+1))},null)),d=(0,e.Wm)("svg",{class:u("circular"),viewBox:"25 25 50 50"},[(0,e.Wm)("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)]),f={size:r.Or,type:(0,r.SQ)("circular"),color:String,vertical:Boolean,textSize:r.Or,textColor:String};n.Z=(0,e.aZ)({name:c,props:f,setup(t,n){var{slots:o}=n,i=(0,e.Fl)(()=>(0,l.l7)({color:t.color},(0,a.Xn)(t.size))),r=()=>{var n="spinner"===t.type?s:d;return(0,e.Wm)("span",{class:u("spinner",t.type),style:i.value},[o.icon?o.icon():n])},c=()=>{if(o.default){var n;return(0,e.Wm)("span",{class:u("text"),style:{fontSize:(0,a.Nn)(t.textSize),color:null!==(n=t.textColor)&&void 0!==n?n:t.color}},[o.default()])}};return()=>{var{type:n,vertical:o}=t;return(0,e.Wm)("div",{class:u([n,{vertical:o}]),"aria-live":"polite","aria-busy":!0},[r(),c()])}}})},21083:function(t,n,o){"use strict";o("82116"),o("17989");var e=o("80681"),i=o("62568"),r=o("78335"),l=o("12308"),a=o("20897"),c=o("96528"),u=o("97760"),s=o("95786"),[d,f]=(0,i.do)("toast"),v=["show","overlay","teleport","transition","overlayClass","overlayStyle","closeOnClickOverlay","zIndex"],m={icon:String,show:Boolean,type:(0,r.SQ)("text"),overlay:Boolean,message:r.Or,iconSize:r.Or,duration:(0,r.qM)(2e3),position:(0,r.SQ)("middle"),teleport:[String,Object],wordBreak:String,className:r.Vg,iconPrefix:String,transition:(0,r.SQ)("van-fade"),loadingType:String,forbidClick:Boolean,overlayClass:r.Vg,overlayStyle:Object,closeOnClick:Boolean,closeOnClickOverlay:Boolean,zIndex:r.Or};n.Z=(0,e.aZ)({name:d,props:m,emits:["update:show"],setup(t,n){var o,{emit:i,slots:r}=n,d=!1,m=()=>{var n=t.show&&t.forbidClick;d!==n&&(d=n,(0,a.G)(d))},g=t=>i("update:show",t),p=()=>{t.closeOnClick&&g(!1)},S=()=>clearTimeout(o),x=()=>{var{icon:n,type:o,iconSize:i,iconPrefix:r,loadingType:l}=t;return n||"success"===o||"fail"===o?(0,e.Wm)(c.JO,{name:n||o,size:i,class:f("icon"),classPrefix:r},null):"loading"===o?(0,e.Wm)(s.gb,{class:f("loading"),size:i,type:l},null):void 0},b=()=>{var{type:n,message:o}=t;return r.message?(0,e.Wm)("div",{class:f("text")},[r.message()]):(0,l.Xq)(o)&&""!==o?"html"===n?(0,e.Wm)("div",{key:0,class:f("text"),innerHTML:String(o)},null):(0,e.Wm)("div",{class:f("text")},[o]):void 0};return(0,e.YP)(()=>[t.show,t.forbidClick],m),(0,e.YP)(()=>[t.show,t.type,t.message,t.duration],()=>{S(),t.show&&t.duration>0&&(o=setTimeout(()=>{g(!1)},t.duration))}),(0,e.bv)(m),(0,e.Ah)(m),()=>(0,e.Wm)(u.GI,(0,e.dG)({class:[f([t.position,"normal"===t.wordBreak?"break-normal":t.wordBreak,{[t.type]:!t.icon}]),t.className],lockScroll:!1,onClick:p,onClosed:S,"onUpdate:show":g},(0,l.ei)(t,v)),{default:()=>[x(),b()]})}})},13118:function(t,n,o){"use strict";o.d(n,{CF:function(){return f},LJ:function(){return p},XA:function(){return g},di:function(){return m},yg:function(){return S}}),o("24836"),o("41712"),o("80855"),o("10502"),o("7978"),o("66746"),o("17530"),o("87604"),o("57024"),o("22175"),o("85322"),o("47897"),o("48943"),o("43356"),o("82116"),o("17989"),o("96245"),o("37232"),o("70629"),o("61557"),o("31564"),o("8649");var e=o("80681"),i=o("11848"),r=o("12308"),l=o("84285"),a=o("21083"),c=[],u=(0,r.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}),s=new Map;function d(t){return(0,r.Kn)(t)?t:{message:t}}function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!r._f)return{};var n=function(){if(!c.length){var t=function(){var{instance:t,unmount:n}=(0,l.H)({setup(){var t=(0,i.iH)(""),{open:n,state:o,close:r,toggle:c}=(0,l.o)(),u=()=>{};return(0,e.YP)(t,t=>{o.message=t}),(0,e.FN)().render=()=>(0,e.Wm)(a.Z,(0,e.dG)(o,{onClosed:u,"onUpdate:show":c}),null),{open:n,close:r,message:t}}});return t}();c.push(t)}return c[c.length-1]}(),o=d(t);return n.open((0,r.l7)({},u,s.get(o.type||u.type),o)),n}var v=t=>n=>f((0,r.l7)({type:t},d(n))),m=v("loading"),g=v("success"),p=v("fail"),S=t=>{if(c.length){if(t)c.forEach(t=>{t.close()}),c=[];else{var n;c[0].close()}}}},57339:function(t,n,o){"use strict";o.r(t.exports={})},48868:function(t,n,o){"use strict";o.r(t.exports={})}}]); |