mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
2 lines
9.2 KiB
JavaScript
2 lines
9.2 KiB
JavaScript
/*! For license information please see 9972.ae07e5c9.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([["9972"],{32938:function(t,e,l){"use strict";l.r(e);let i=l("69505").Z;e.default=i},69505:function(t,e,l){"use strict";var i=l("80681"),n=l("11848"),r=l("95775"),o=l("96528"),a=l("54369"),s=l("13118");e.Z=(0,i.aZ)({__name:"index",setup(t){var e=(0,a.q)({"zh-CN":{useSlot:"\u4F7F\u7528\u63D2\u69FD",showBack:"\u8FD4\u56DE\u4E0A\u7EA7",rightButton:"\u53F3\u4FA7\u6309\u94AE",disableButton:"\u7981\u7528\u6309\u94AE"},"en-US":{useSlot:"Use Slot",showBack:"Back",rightButton:"Right Button",disableButton:"Disable Button"}}),l=()=>(0,s.CF)(e("back")),c=()=>(0,s.CF)(e("button"));return(t,a)=>{var s=(0,i.up)("demo-block");return(0,i.wg)(),(0,i.iD)(i.HY,null,[(0,i.Wm)(s,{title:(0,n.SU)(e)("basicUsage")},{default:(0,i.w5)(()=>[(0,i.Wm)((0,n.SU)(r.ZP),{title:(0,n.SU)(e)("title")},null,8,["title"])]),_:1},8,["title"]),(0,i.Wm)(s,{title:(0,n.SU)(e)("showBack")},{default:(0,i.w5)(()=>[(0,i.Wm)((0,n.SU)(r.ZP),{title:(0,n.SU)(e)("title"),"left-text":(0,n.SU)(e)("back"),"left-arrow":"",onClickRight:c},null,8,["title","left-text"])]),_:1},8,["title"]),(0,i.Wm)(s,{title:(0,n.SU)(e)("rightButton")},{default:(0,i.w5)(()=>[(0,i.Wm)((0,n.SU)(r.ZP),{title:(0,n.SU)(e)("title"),"left-text":(0,n.SU)(e)("back"),"right-text":(0,n.SU)(e)("button"),"left-arrow":"",onClickLeft:l,onClickRight:c},null,8,["title","left-text","right-text"])]),_:1},8,["title"]),(0,i.Wm)(s,{title:(0,n.SU)(e)("useSlot")},{default:(0,i.w5)(()=>[(0,i.Wm)((0,n.SU)(r.ZP),{title:(0,n.SU)(e)("title"),"left-text":(0,n.SU)(e)("back"),"left-arrow":""},{right:(0,i.w5)(()=>[(0,i.Wm)((0,n.SU)(o.ZP),{name:"search",size:"18"})]),_:1},8,["title","left-text"])]),_:1},8,["title"]),(0,i.Wm)(s,{title:(0,n.SU)(e)("disableButton")},{default:(0,i.w5)(()=>[(0,i.Wm)((0,n.SU)(r.ZP),{title:(0,n.SU)(e)("title"),"left-text":(0,n.SU)(e)("back"),"right-text":(0,n.SU)(e)("button"),"left-arrow":"","left-disabled":"","right-disabled":"",onClickLeft:l,onClickRight:c},null,8,["title","left-text","right-text"])]),_:1},8,["title"])],64)}}})},55944:function(t,e,l){"use strict";l.d(e,{F:function(){return s}});var i=l("22300"),n=l("11848"),r=l("80681"),o=l("82210"),a=l("65170"),s=(t,e)=>{var l=(0,n.iH)(),s=()=>{l.value=(0,i.EL)(t).height};return(0,r.bv)(()=>{if((0,r.Y3)(s),e)for(var t=1;t<=3;t++)setTimeout(s,100*t)}),(0,a.h)(()=>(0,r.Y3)(s)),(0,r.YP)([o.bn,o.uK],s),l}},95786:function(t,e,l){"use strict";l.d(e,{gb:function(){return r}});var i=l("63112"),n=l("2309"),r=(0,i.n)(n.Z);e.ZP=r},95775:function(t,e,l){"use strict";var i=l("63112"),n=l("73824"),r=(0,i.n)(n.Z);e.ZP=r},20897:function(t,e,l){"use strict";l.d(e,{G:function(){return n}});var i=0;function n(t){t?(!i&&document.body.classList.add("van-toast--unclickable"),i++):i&&!--i&&document.body.classList.remove("van-toast--unclickable")}},84285:function(t,e,l){"use strict";l.d(e,{H:function(){return s},o:function(){return a}});var i=l("11848"),n=l("39594"),r=l("12308"),o=l("10023");function a(){var t=(0,i.qj)({show:!1}),e=e=>{t.show=e},l=l=>{(0,r.l7)(t,l,{transitionAppear:!0}),e(!0)},n=()=>e(!1);return(0,o.F)({open:l,close:n,toggle:e}),{open:l,close:n,state:t,toggle:e}}function s(t){var e=(0,n.ri)(t),l=document.createElement("div");return document.body.appendChild(l),{instance:e.mount(l),unmount(){e.unmount(),document.body.removeChild(l)}}}},90516:function(t,e,l){"use strict";l.d(e,{J:function(){return r}});var i=l("80681"),n=l("55944");function r(t,e){var l=(0,n.F)(t,!0);return t=>(0,i.Wm)("div",{class:e("placeholder"),style:{height:l.value?"".concat(l.value,"px"):void 0}},[t()])}},2309:function(t,e,l){"use strict";l("82116"),l("17989"),l("66786"),l("14529");var i=l("80681"),n=l("62568"),r=l("78335"),o=l("12308"),a=l("20358"),[s,c]=(0,n.do)("loading"),u=Array(12).fill(null).map((t,e)=>(0,i.Wm)("i",{class:c("line",String(e+1))},null)),d=(0,i.Wm)("svg",{class:c("circular"),viewBox:"25 25 50 50"},[(0,i.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};e.Z=(0,i.aZ)({name:s,props:f,setup(t,e){var{slots:l}=e,n=(0,i.Fl)(()=>(0,o.l7)({color:t.color},(0,a.Xn)(t.size))),r=()=>{var e="spinner"===t.type?u:d;return(0,i.Wm)("span",{class:c("spinner",t.type),style:n.value},[l.icon?l.icon():e])},s=()=>{if(l.default){var e;return(0,i.Wm)("span",{class:c("text"),style:{fontSize:(0,a.Nn)(t.textSize),color:null!==(e=t.textColor)&&void 0!==e?e:t.color}},[l.default()])}};return()=>{var{type:e,vertical:l}=t;return(0,i.Wm)("div",{class:c([e,{vertical:l}]),"aria-live":"polite","aria-busy":!0},[r(),s()])}}})},73824:function(t,e,l){"use strict";l("82116"),l("17989");var i=l("80681"),n=l("11848"),r=l("62568"),o=l("78335"),a=l("20358"),s=l("8051"),c=l("90516"),u=l("96528"),[d,f]=(0,r.do)("nav-bar"),v={title:String,fixed:Boolean,zIndex:o.Or,border:o.J5,leftText:String,rightText:String,leftDisabled:Boolean,rightDisabled:Boolean,leftArrow:Boolean,placeholder:Boolean,safeAreaInsetTop:Boolean,clickable:o.J5};e.Z=(0,i.aZ)({name:d,props:v,emits:["clickLeft","clickRight"],setup(t,e){var{emit:l,slots:r}=e,o=(0,n.iH)(),d=(0,c.J)(o,f),v=e=>{!t.leftDisabled&&l("clickLeft",e)},m=e=>{!t.rightDisabled&&l("clickRight",e)},g=()=>r.left?r.left():[t.leftArrow&&(0,i.Wm)(u.JO,{class:f("arrow"),name:"arrow-left"},null),t.leftText&&(0,i.Wm)("span",{class:f("text")},[t.leftText])],h=()=>r.right?r.right():(0,i.Wm)("span",{class:f("text")},[t.rightText]),p=()=>{var{title:e,fixed:l,border:n,zIndex:c}=t,u=(0,a.As)(c),d=t.leftArrow||t.leftText||r.left,p=t.rightText||r.right;return(0,i.Wm)("div",{ref:o,style:u,class:[f({fixed:l}),{[s.xe]:n,"van-safe-area-top":t.safeAreaInsetTop}]},[(0,i.Wm)("div",{class:f("content")},[d&&(0,i.Wm)("div",{class:[f("left",{disabled:t.leftDisabled}),t.clickable&&!t.leftDisabled?s.e9:""],onClick:v},[g()]),(0,i.Wm)("div",{class:[f("title"),"van-ellipsis"]},[r.title?r.title():e]),p&&(0,i.Wm)("div",{class:[f("right",{disabled:t.rightDisabled}),t.clickable&&!t.rightDisabled?s.e9:""],onClick:m},[h()])])])};return()=>t.fixed&&t.placeholder?d(p):p()}})},21083:function(t,e,l){"use strict";l("82116"),l("17989");var i=l("80681"),n=l("62568"),r=l("78335"),o=l("12308"),a=l("20897"),s=l("96528"),c=l("97760"),u=l("95786"),[d,f]=(0,n.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};e.Z=(0,i.aZ)({name:d,props:m,emits:["update:show"],setup(t,e){var l,{emit:n,slots:r}=e,d=!1,m=()=>{var e=t.show&&t.forbidClick;d!==e&&(d=e,(0,a.G)(d))},g=t=>n("update:show",t),h=()=>{t.closeOnClick&&g(!1)},p=()=>clearTimeout(l),b=()=>{var{icon:e,type:l,iconSize:n,iconPrefix:r,loadingType:o}=t;return e||"success"===l||"fail"===l?(0,i.Wm)(s.JO,{name:e||l,size:n,class:f("icon"),classPrefix:r},null):"loading"===l?(0,i.Wm)(u.gb,{class:f("loading"),size:n,type:o},null):void 0},S=()=>{var{type:e,message:l}=t;return r.message?(0,i.Wm)("div",{class:f("text")},[r.message()]):(0,o.Xq)(l)&&""!==l?"html"===e?(0,i.Wm)("div",{key:0,class:f("text"),innerHTML:String(l)},null):(0,i.Wm)("div",{class:f("text")},[l]):void 0};return(0,i.YP)(()=>[t.show,t.forbidClick],m),(0,i.YP)(()=>[t.show,t.type,t.message,t.duration],()=>{p(),t.show&&t.duration>0&&(l=setTimeout(()=>{g(!1)},t.duration))}),(0,i.bv)(m),(0,i.Ah)(m),()=>(0,i.Wm)(c.GI,(0,i.dG)({class:[f([t.position,"normal"===t.wordBreak?"break-normal":t.wordBreak,{[t.type]:!t.icon}]),t.className],lockScroll:!1,onClick:h,onClosed:p,"onUpdate:show":g},(0,o.ei)(t,v)),{default:()=>[b(),S()]})}})},13118:function(t,e,l){"use strict";l.d(e,{CF:function(){return f},LJ:function(){return h},XA:function(){return g},di:function(){return m},yg:function(){return p}}),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 i=l("80681"),n=l("11848"),r=l("12308"),o=l("84285"),a=l("21083"),s=[],c=(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}),u=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 e=function(){if(!s.length){var t=function(){var{instance:t,unmount:e}=(0,o.H)({setup(){var t=(0,n.iH)(""),{open:e,state:l,close:r,toggle:s}=(0,o.o)(),c=()=>{};return(0,i.YP)(t,t=>{l.message=t}),(0,i.FN)().render=()=>(0,i.Wm)(a.Z,(0,i.dG)(l,{onClosed:c,"onUpdate:show":s}),null),{open:e,close:r,message:t}}});return t}();s.push(t)}return s[s.length-1]}(),l=d(t);return e.open((0,r.l7)({},c,u.get(l.type||c.type),l)),e}var v=t=>e=>f((0,r.l7)({type:t},d(e))),m=v("loading"),g=v("success"),h=v("fail"),p=t=>{if(s.length){if(t)s.forEach(t=>{t.close()}),s=[];else{var e;s[0].close()}}}}}]); |