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 2891.24972336.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([["2891"],{48129:function(e,t,l){"use strict";l.r(t);var n=l("26096");l("56136");let o=n.Z;t.default=o},26096:function(e,t,l){"use strict";var n=l("80681"),o=l("11848"),i=l("57122"),r=l("89959"),a=l("6918"),s=l("69434"),u=l("30578"),c=l("54369"),d=l("13118"),v={class:"demo-sidebar-title"},m={class:"demo-sidebar-title"},f={class:"demo-sidebar-title"},p={class:"demo-sidebar-title"};t.Z=(0,n.aZ)({__name:"index",setup(e){var t=(0,c.q)({"zh-CN":{title:"\u6807\u7B7E\u540D",disabled:"\u7981\u7528\u9009\u9879",showBadge:"\u5FBD\u6807\u63D0\u793A",changeEvent:"\u76D1\u542C\u5207\u6362\u4E8B\u4EF6"},"en-US":{disabled:"Disabled",showBadge:"Show Badge",changeEvent:"Change Event"}}),l=(0,o.iH)(0),g=(0,o.iH)(0),S=(0,o.iH)(0),b=(0,o.iH)(0),y=e=>(0,d.CF)("".concat(t("title")," ").concat(e+1));return(e,c)=>((0,n.wg)(),(0,n.j4)((0,o.SU)(r.ZP),{"column-num":2,border:!1},{default:(0,n.w5)(()=>[(0,n.Wm)((0,o.SU)(a.ZP),null,{default:(0,n.w5)(()=>[(0,n._)("h3",v,(0,i.zw)((0,o.SU)(t)("basicUsage")),1),(0,n.Wm)((0,o.SU)(s.ZP),{modelValue:l.value,"onUpdate:modelValue":c[0]||(c[0]=e=>l.value=e)},{default:(0,n.w5)(()=>[(0,n.Wm)((0,o.SU)(u.ZP),{title:(0,o.SU)(t)("title")},null,8,["title"]),(0,n.Wm)((0,o.SU)(u.ZP),{title:(0,o.SU)(t)("title")},null,8,["title"]),(0,n.Wm)((0,o.SU)(u.ZP),{title:(0,o.SU)(t)("title")},null,8,["title"])]),_:1},8,["modelValue"])]),_:1}),(0,n.Wm)((0,o.SU)(a.ZP),null,{default:(0,n.w5)(()=>[(0,n._)("h3",m,(0,i.zw)((0,o.SU)(t)("showBadge")),1),(0,n.Wm)((0,o.SU)(s.ZP),{modelValue:g.value,"onUpdate:modelValue":c[1]||(c[1]=e=>g.value=e)},{default:(0,n.w5)(()=>[(0,n.Wm)((0,o.SU)(u.ZP),{title:(0,o.SU)(t)("title"),dot:""},null,8,["title"]),(0,n.Wm)((0,o.SU)(u.ZP),{title:(0,o.SU)(t)("title"),badge:"5"},null,8,["title"]),(0,n.Wm)((0,o.SU)(u.ZP),{title:(0,o.SU)(t)("title")},null,8,["title"])]),_:1},8,["modelValue"])]),_:1}),(0,n.Wm)((0,o.SU)(a.ZP),null,{default:(0,n.w5)(()=>[(0,n._)("h3",f,(0,i.zw)((0,o.SU)(t)("disabled")),1),(0,n.Wm)((0,o.SU)(s.ZP),{modelValue:S.value,"onUpdate:modelValue":c[2]||(c[2]=e=>S.value=e)},{default:(0,n.w5)(()=>[(0,n.Wm)((0,o.SU)(u.ZP),{title:(0,o.SU)(t)("title")},null,8,["title"]),(0,n.Wm)((0,o.SU)(u.ZP),{title:(0,o.SU)(t)("title"),disabled:""},null,8,["title"]),(0,n.Wm)((0,o.SU)(u.ZP),{title:(0,o.SU)(t)("title")},null,8,["title"])]),_:1},8,["modelValue"])]),_:1}),(0,n.Wm)((0,o.SU)(a.ZP),null,{default:(0,n.w5)(()=>[(0,n._)("h3",p,(0,i.zw)((0,o.SU)(t)("changeEvent")),1),(0,n.Wm)((0,o.SU)(s.ZP),{modelValue:b.value,"onUpdate:modelValue":c[3]||(c[3]=e=>b.value=e),onChange:y},{default:(0,n.w5)(()=>[(0,n.Wm)((0,o.SU)(u.ZP),{title:"".concat((0,o.SU)(t)("title")," 1")},null,8,["title"]),(0,n.Wm)((0,o.SU)(u.ZP),{title:"".concat((0,o.SU)(t)("title")," 2")},null,8,["title"]),(0,n.Wm)((0,o.SU)(u.ZP),{title:"".concat((0,o.SU)(t)("title")," 3")},null,8,["title"])]),_:1},8,["modelValue"])]),_:1})]),_:1}))}})},6149:function(e,t,l){"use strict";l.d(t,{BC:function(){return i},g2:function(){return o},yj:function(){return r}}),l("56115"),l("59644");var n=l("80681"),o={to:[String,Object],url:String,replace:Boolean};function i(e){var{to:t,url:l,replace:n,$router:o}=e;t&&o?o[n?"replace":"push"](t):l&&(n?location.replace(l):location.href=l)}function r(){var e=(0,n.FN)().proxy;return()=>i(e)}},6918:function(e,t,l){"use strict";var n=l("63112"),o=l("49605"),i=(0,n.n)(o.Z);t.ZP=i},89959:function(e,t,l){"use strict";var n=l("63112"),o=l("69014"),i=(0,n.n)(o.ZP);t.ZP=i},95786:function(e,t,l){"use strict";l.d(t,{gb:function(){return i}});var n=l("63112"),o=l("2309"),i=(0,n.n)(o.Z);t.ZP=i},30578:function(e,t,l){"use strict";l.d(t,{R6:function(){return i}});var n=l("63112"),o=l("17551"),i=(0,n.n)(o.Z);t.ZP=i},69434:function(e,t,l){"use strict";l.d(t,{YE:function(){return i}});var n=l("63112"),o=l("68952"),i=(0,n.n)(o.ZP);t.ZP=i},20897:function(e,t,l){"use strict";l.d(t,{G:function(){return o}});var n=0;function o(e){e?(!n&&document.body.classList.add("van-toast--unclickable"),n++):n&&!--n&&document.body.classList.remove("van-toast--unclickable")}},84285:function(e,t,l){"use strict";l.d(t,{H:function(){return s},o:function(){return a}});var n=l("11848"),o=l("39594"),i=l("12308"),r=l("10023");function a(){var e=(0,n.qj)({show:!1}),t=t=>{e.show=t},l=l=>{(0,i.l7)(e,l,{transitionAppear:!0}),t(!0)},o=()=>t(!1);return(0,r.F)({open:l,close:o,toggle:t}),{open:l,close:o,state:e,toggle:t}}function s(e){var t=(0,o.ri)(e),l=document.createElement("div");return document.body.appendChild(l),{instance:t.mount(l),unmount(){t.unmount(),document.body.removeChild(l)}}}},49605:function(e,t,l){"use strict";l("82116"),l("17989"),l("58294");var n=l("80681"),o=l("62568"),i=l("12308"),r=l("78335"),a=l("20358"),s=l("8051"),u=l("69014"),c=l("22300"),d=l("6149"),v=l("96528"),m=l("72555"),[f,p]=(0,o.do)("grid-item"),g=(0,i.l7)({},d.g2,{dot:Boolean,text:String,icon:String,badge:r.Or,iconColor:String,iconPrefix:String,badgeProps:Object});t.Z=(0,n.aZ)({name:f,props:g,setup(e,t){var{slots:l}=t,{parent:o,index:i}=(0,c.NB)(u.Sb),r=(0,d.yj)();if(o){var f=(0,n.Fl)(()=>{var{square:e,gutter:t,columnNum:l}=o.props,n="".concat(100/+l,"%"),r={flexBasis:n};if(e)r.paddingTop=n;else if(t){var s=(0,a.Nn)(t);r.paddingRight=s,i.value>=+l&&(r.marginTop=s)}return r}),g=(0,n.Fl)(()=>{var{square:e,gutter:t}=o.props;if(e&&t){var l=(0,a.Nn)(t);return{right:l,bottom:l,height:"auto"}}}),S=()=>l.icon?(0,n.Wm)(m.Ct,(0,n.dG)({dot:e.dot,content:e.badge},e.badgeProps),{default:l.icon}):e.icon?(0,n.Wm)(v.JO,{dot:e.dot,name:e.icon,size:o.props.iconSize,badge:e.badge,class:p("icon"),color:e.iconColor,badgeProps:e.badgeProps,classPrefix:e.iconPrefix},null):void 0,b=()=>l.text?l.text():e.text?(0,n.Wm)("span",{class:p("text")},[e.text]):void 0,y=()=>l.default?l.default():[S(),b()];return()=>{var{center:e,border:t,square:l,gutter:i,reverse:a,direction:u,clickable:c}=o.props,d=[p("content",[u,{center:e,square:l,reverse:a,clickable:c,surround:t&&i}]),{[s.T5]:t}];return(0,n.Wm)("div",{class:[p({square:l})],style:f.value},[(0,n.Wm)("div",{role:c?"button":void 0,class:d,style:g.value,tabindex:c?0:void 0,onClick:r},[y()])])}}}})},69014:function(e,t,l){"use strict";l.d(t,{Sb:function(){return v}}),l("82116"),l("17989"),l("86795");var n=l("80681"),o=l("62568"),i=l("78335"),r=l("20358"),a=l("8051"),s=l("22300"),[u,c]=(0,o.do)("grid"),d={square:Boolean,center:i.J5,border:i.J5,gutter:i.Or,reverse:Boolean,iconSize:i.Or,direction:String,clickable:Boolean,columnNum:(0,i.SI)(4)},v=Symbol(u);t.ZP=(0,n.aZ)({name:u,props:d,setup(e,t){var{slots:l}=t,{linkChildren:o}=(0,s.$E)(v);return o({props:e}),()=>{var t;return(0,n.Wm)("div",{style:{paddingLeft:(0,r.Nn)(e.gutter)},class:[c(),{[a.k7]:e.border&&!e.gutter}]},[null===(t=l.default)||void 0===t?void 0:t.call(l)])}}})},2309:function(e,t,l){"use strict";l("82116"),l("17989"),l("66786"),l("14529");var n=l("80681"),o=l("62568"),i=l("78335"),r=l("12308"),a=l("20358"),[s,u]=(0,o.do)("loading"),c=Array(12).fill(null).map((e,t)=>(0,n.Wm)("i",{class:u("line",String(t+1))},null)),d=(0,n.Wm)("svg",{class:u("circular"),viewBox:"25 25 50 50"},[(0,n.Wm)("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)]),v={size:i.Or,type:(0,i.SQ)("circular"),color:String,vertical:Boolean,textSize:i.Or,textColor:String};t.Z=(0,n.aZ)({name:s,props:v,setup(e,t){var{slots:l}=t,o=(0,n.Fl)(()=>(0,r.l7)({color:e.color},(0,a.Xn)(e.size))),i=()=>{var t="spinner"===e.type?c:d;return(0,n.Wm)("span",{class:u("spinner",e.type),style:o.value},[l.icon?l.icon():t])},s=()=>{if(l.default){var t;return(0,n.Wm)("span",{class:u("text"),style:{fontSize:(0,a.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,n.Wm)("div",{class:u([t,{vertical:l}]),"aria-live":"polite","aria-busy":!0},[i(),s()])}}})},17551:function(e,t,l){"use strict";l("82116"),l("17989");var n=l("80681"),o=l("62568"),i=l("12308"),r=l("78335"),a=l("68952"),s=l("22300"),u=l("6149"),c=l("72555"),[d,v]=(0,o.do)("sidebar-item"),m=(0,i.l7)({},u.g2,{dot:Boolean,title:String,badge:r.Or,disabled:Boolean,badgeProps:Object});t.Z=(0,n.aZ)({name:d,props:m,emits:["click"],setup(e,t){var{emit:l,slots:o}=t,i=(0,u.yj)(),{parent:r,index:d}=(0,s.NB)(a.pA);if(r){var m=()=>{!e.disabled&&(l("click",d.value),r.setActive(d.value),i())};return()=>{var{dot:t,badge:l,title:i,disabled:a}=e,s=d.value===r.getActive();return(0,n.Wm)("div",{role:"tab",class:v({select:s,disabled:a}),tabindex:a?void 0:0,"aria-selected":s,onClick:m},[(0,n.Wm)(c.Ct,(0,n.dG)({dot:t,class:v("text"),content:l},e.badgeProps),{default:()=>[o.title?o.title():i]})])}}}})},68952:function(e,t,l){"use strict";l.d(t,{pA:function(){return u}}),l("82116"),l("17989"),l("86795");var n=l("80681"),o=l("62568"),i=l("78335"),r=l("22300"),[a,s]=(0,o.do)("sidebar"),u=Symbol(a),c={modelValue:(0,i.SI)(0)};t.ZP=(0,n.aZ)({name:a,props:c,emits:["change","update:modelValue"],setup(e,t){var{emit:l,slots:o}=t,{linkChildren:i}=(0,r.$E)(u),a=()=>+e.modelValue;return i({getActive:a,setActive:e=>{e!==a()&&(l("update:modelValue",e),l("change",e))}}),()=>{var e;return(0,n.Wm)("div",{role:"tablist",class:s()},[null===(e=o.default)||void 0===e?void 0:e.call(o)])}}})},21083:function(e,t,l){"use strict";l("82116"),l("17989");var n=l("80681"),o=l("62568"),i=l("78335"),r=l("12308"),a=l("20897"),s=l("96528"),u=l("97760"),c=l("95786"),[d,v]=(0,o.do)("toast"),m=["show","overlay","teleport","transition","overlayClass","overlayStyle","closeOnClickOverlay","zIndex"],f={icon:String,show:Boolean,type:(0,i.SQ)("text"),overlay:Boolean,message:i.Or,iconSize:i.Or,duration:(0,i.qM)(2e3),position:(0,i.SQ)("middle"),teleport:[String,Object],wordBreak:String,className:i.Vg,iconPrefix:String,transition:(0,i.SQ)("van-fade"),loadingType:String,forbidClick:Boolean,overlayClass:i.Vg,overlayStyle:Object,closeOnClick:Boolean,closeOnClickOverlay:Boolean,zIndex:i.Or};t.Z=(0,n.aZ)({name:d,props:f,emits:["update:show"],setup(e,t){var l,{emit:o,slots:i}=t,d=!1,f=()=>{var t=e.show&&e.forbidClick;d!==t&&(d=t,(0,a.G)(d))},p=e=>o("update:show",e),g=()=>{e.closeOnClick&&p(!1)},S=()=>clearTimeout(l),b=()=>{var{icon:t,type:l,iconSize:o,iconPrefix:i,loadingType:r}=e;return t||"success"===l||"fail"===l?(0,n.Wm)(s.JO,{name:t||l,size:o,class:v("icon"),classPrefix:i},null):"loading"===l?(0,n.Wm)(c.gb,{class:v("loading"),size:o,type:r},null):void 0},y=()=>{var{type:t,message:l}=e;return i.message?(0,n.Wm)("div",{class:v("text")},[i.message()]):(0,r.Xq)(l)&&""!==l?"html"===t?(0,n.Wm)("div",{key:0,class:v("text"),innerHTML:String(l)},null):(0,n.Wm)("div",{class:v("text")},[l]):void 0};return(0,n.YP)(()=>[e.show,e.forbidClick],f),(0,n.YP)(()=>[e.show,e.type,e.message,e.duration],()=>{S(),e.show&&e.duration>0&&(l=setTimeout(()=>{p(!1)},e.duration))}),(0,n.bv)(f),(0,n.Ah)(f),()=>(0,n.Wm)(u.GI,(0,n.dG)({class:[v([e.position,"normal"===e.wordBreak?"break-normal":e.wordBreak,{[e.type]:!e.icon}]),e.className],lockScroll:!1,onClick:g,onClosed:S,"onUpdate:show":p},(0,r.ei)(e,m)),{default:()=>[b(),y()]})}})},13118:function(e,t,l){"use strict";l.d(t,{CF:function(){return v},LJ:function(){return g},XA:function(){return p},di:function(){return f},yg:function(){return S}}),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 n=l("80681"),o=l("11848"),i=l("12308"),r=l("84285"),a=l("21083"),s=[],u=(0,i.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,i.Kn)(e)?e:{message:e}}function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!i._f)return{};var t=function(){if(!s.length){var e=function(){var{instance:e,unmount:t}=(0,r.H)({setup(){var e=(0,o.iH)(""),{open:t,state:l,close:i,toggle:s}=(0,r.o)(),u=()=>{};return(0,n.YP)(e,e=>{l.message=e}),(0,n.FN)().render=()=>(0,n.Wm)(a.Z,(0,n.dG)(l,{onClosed:u,"onUpdate:show":s}),null),{open:t,close:i,message:e}}});return e}();s.push(e)}return s[s.length-1]}(),l=d(e);return t.open((0,i.l7)({},u,c.get(l.type||u.type),l)),t}var m=e=>t=>v((0,i.l7)({type:e},d(t))),f=m("loading"),p=m("success"),g=m("fail"),S=e=>{if(s.length){if(e)s.forEach(e=>{e.close()}),s=[];else{var t;s[0].close()}}}},56136:function(e,t,l){"use strict";l.r(e.exports={})},37349:function(e,t,l){"use strict";l.r(e.exports={})}}]); |