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 9103.221e497b.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([["9103"],{75924:function(e,n,t){"use strict";t.r(n);var o=t("51752");t("4085");let i=o.Z;n.default=i},51752:function(e,n,t){"use strict";var o=t("80681"),i=t("11848"),l=t("57122"),a=t("99742"),r=t("60888"),s=t("54369"),c=t("13118"),u={class:"demo-action-sheet-content"};n.Z=(0,o.aZ)({__name:"index",setup(e){var n=(0,s.q)({"zh-CN":{option1:"\u9009\u9879\u4E00",option2:"\u9009\u9879\u4E8C",option3:"\u9009\u9879\u4E09",subname:"\u63CF\u8FF0\u4FE1\u606F",showIcon:"\u5C55\u793A\u56FE\u6807",showCancel:"\u5C55\u793A\u53D6\u6D88\u6309\u94AE",buttonText:"\u5F39\u51FA\u83DC\u5355",customPanel:"\u81EA\u5B9A\u4E49\u9762\u677F",description:"\u8FD9\u662F\u4E00\u6BB5\u63CF\u8FF0\u4FE1\u606F",optionStatus:"\u9009\u9879\u72B6\u6001",coloredOption:"\u7740\u8272\u9009\u9879",disabledOption:"\u7981\u7528\u9009\u9879",showDescription:"\u5C55\u793A\u63CF\u8FF0\u4FE1\u606F"},"en-US":{option1:"Option 1",option2:"Option 2",option3:"Option 3",subname:"Description",showIcon:"Show Icon",showCancel:"Show Cancel Button",buttonText:"Show ActionSheet",customPanel:"Custom Panel",description:"Description",optionStatus:"Option Status",coloredOption:"Colored Option",disabledOption:"Disabled Option",showDescription:"Show Description"}}),t=(0,i.iH)(!1),d=(0,i.iH)(!1),v=(0,i.iH)(!1),p=(0,i.iH)(!1),m=(0,i.iH)(!1),f=(0,i.iH)(!1),S=(0,o.Fl)(()=>[{name:n("option1")},{name:n("option2")},{name:n("option3")}]),h=(0,o.Fl)(()=>[{name:n("option1"),icon:"cart-o"},{name:n("option2"),icon:"shop-o"},{name:n("option3"),icon:"star-o"}]),w=(0,o.Fl)(()=>[{name:n("coloredOption"),color:"#ee0a24"},{name:n("disabledOption"),disabled:!0},{loading:!0}]),b=(0,o.Fl)(()=>[{name:n("option1")},{name:n("option2")},{name:n("option3"),subname:n("subname")}]),g=e=>{t.value=!1,(0,c.CF)(e.name)},C=e=>{d.value=!1,(0,c.CF)(e.name)},y=()=>(0,c.CF)(n("cancel"));return(e,s)=>{var c=(0,o.up)("demo-block");return(0,o.wg)(),(0,o.iD)(o.HY,null,[(0,o.Wm)(c,{card:"",title:(0,i.SU)(n)("basicUsage")},{default:(0,o.w5)(()=>[(0,o.Wm)((0,i.SU)(a.ZP),{"is-link":"",title:(0,i.SU)(n)("basicUsage"),onClick:s[0]||(s[0]=e=>t.value=!0)},null,8,["title"]),(0,o.Wm)((0,i.SU)(a.ZP),{"is-link":"",title:(0,i.SU)(n)("showIcon"),onClick:s[1]||(s[1]=e=>d.value=!0)},null,8,["title"]),(0,o.Wm)((0,i.SU)(a.ZP),{"is-link":"",title:(0,i.SU)(n)("showCancel"),onClick:s[2]||(s[2]=e=>v.value=!0)},null,8,["title"]),(0,o.Wm)((0,i.SU)(a.ZP),{"is-link":"",title:(0,i.SU)(n)("showDescription"),onClick:s[3]||(s[3]=e=>f.value=!0)},null,8,["title"])]),_:1},8,["title"]),(0,o.Wm)(c,{card:"",title:(0,i.SU)(n)("optionStatus")},{default:(0,o.w5)(()=>[(0,o.Wm)((0,i.SU)(a.ZP),{"is-link":"",title:(0,i.SU)(n)("optionStatus"),onClick:s[4]||(s[4]=e=>m.value=!0)},null,8,["title"])]),_:1},8,["title"]),(0,o.Wm)(c,{card:"",title:(0,i.SU)(n)("customPanel")},{default:(0,o.w5)(()=>[(0,o.Wm)((0,i.SU)(a.ZP),{"is-link":"",title:(0,i.SU)(n)("customPanel"),onClick:s[5]||(s[5]=e=>p.value=!0)},null,8,["title"])]),_:1},8,["title"]),(0,o.Wm)((0,i.SU)(r.ZP),{show:t.value,"onUpdate:show":s[6]||(s[6]=e=>t.value=e),actions:S.value,onSelect:g},null,8,["show","actions"]),(0,o.Wm)((0,i.SU)(r.ZP),{show:d.value,"onUpdate:show":s[7]||(s[7]=e=>d.value=e),actions:h.value,onSelect:C},null,8,["show","actions"]),(0,o.Wm)((0,i.SU)(r.ZP),{show:v.value,"onUpdate:show":s[8]||(s[8]=e=>v.value=e),actions:S.value,"close-on-click-action":"","cancel-text":(0,i.SU)(n)("cancel"),onCancel:y},null,8,["show","actions","cancel-text"]),(0,o.Wm)((0,i.SU)(r.ZP),{show:f.value,"onUpdate:show":s[9]||(s[9]=e=>f.value=e),actions:b.value,"close-on-click-action":"","cancel-text":(0,i.SU)(n)("cancel"),description:(0,i.SU)(n)("description")},null,8,["show","actions","cancel-text","description"]),(0,o.Wm)((0,i.SU)(r.ZP),{show:m.value,"onUpdate:show":s[10]||(s[10]=e=>m.value=e),"close-on-click-action":"",actions:w.value,"cancel-text":(0,i.SU)(n)("cancel")},null,8,["show","actions","cancel-text"]),(0,o.Wm)((0,i.SU)(r.ZP),{show:p.value,"onUpdate:show":s[11]||(s[11]=e=>p.value=e),title:(0,i.SU)(n)("title")},{default:(0,o.w5)(()=>[(0,o._)("div",u,(0,l.zw)((0,i.SU)(n)("content")),1)]),_:1},8,["show","title"])],64)}}})},60888:function(e,n,t){"use strict";var o=t("63112"),i=t("5626"),l=(0,o.n)(i.Z);n.ZP=l},99742:function(e,n,t){"use strict";t.d(n,{bL:function(){return l}});var o=t("63112"),i=t("54499"),l=(0,o.n)(i.ZP);n.ZP=l},6149:function(e,n,t){"use strict";t.d(n,{BC:function(){return l},g2:function(){return i},yj:function(){return a}}),t("56115"),t("59644");var o=t("80681"),i={to:[String,Object],url:String,replace:Boolean};function l(e){var{to:n,url:t,replace:o,$router:i}=e;n&&i?i[o?"replace":"push"](n):t&&(o?location.replace(t):location.href=t)}function a(){var e=(0,o.FN)().proxy;return()=>l(e)}},95786:function(e,n,t){"use strict";t.d(n,{gb:function(){return l}});var o=t("63112"),i=t("2309"),l=(0,o.n)(i.Z);n.ZP=l},20897:function(e,n,t){"use strict";t.d(n,{G:function(){return i}});var o=0;function i(e){e?(!o&&document.body.classList.add("van-toast--unclickable"),o++):o&&!--o&&document.body.classList.remove("van-toast--unclickable")}},84285:function(e,n,t){"use strict";t.d(n,{H:function(){return s},o:function(){return r}});var o=t("11848"),i=t("39594"),l=t("12308"),a=t("10023");function r(){var e=(0,o.qj)({show:!1}),n=n=>{e.show=n},t=t=>{(0,l.l7)(e,t,{transitionAppear:!0}),n(!0)},i=()=>n(!1);return(0,a.F)({open:t,close:i,toggle:n}),{open:t,close:i,state:e,toggle:n}}function s(e){var n=(0,i.ri)(e),t=document.createElement("div");return document.body.appendChild(t),{instance:n.mount(t),unmount(){n.unmount(),document.body.removeChild(t)}}}},5626:function(e,n,t){"use strict";t("82116"),t("17989"),t("86795"),t("66786"),t("14529");var o=t("80681"),i=t("62568"),l=t("12308"),a=t("78335"),r=t("8051"),s=t("96528"),c=t("97760"),u=t("95786"),d=t("3558"),[v,p]=(0,i.do)("action-sheet"),m=(0,l.l7)({},d.W,{title:String,round:a.J5,actions:(0,a.Ce)(),closeIcon:(0,a.SQ)("cross"),closeable:a.J5,cancelText:String,description:String,closeOnPopstate:a.J5,closeOnClickAction:Boolean,safeAreaInsetBottom:a.J5}),f=[...d.m,"round","closeOnPopstate","safeAreaInsetBottom"];n.Z=(0,o.aZ)({name:v,props:m,emits:["select","cancel","update:show"],setup(e,n){var{slots:t,emit:i}=n,a=e=>i("update:show",e),d=()=>{a(!1),i("cancel")},v=()=>{if(e.title)return(0,o.Wm)("div",{class:p("header")},[e.title,e.closeable&&(0,o.Wm)(s.JO,{name:e.closeIcon,class:[p("close"),r.e9],onClick:d},null)])},m=()=>{if(t.cancel||e.cancelText)return[(0,o.Wm)("div",{class:p("gap")},null),(0,o.Wm)("button",{type:"button",class:p("cancel"),onClick:d},[t.cancel?t.cancel():e.cancelText])]},S=e=>{if(e.icon)return(0,o.Wm)(s.JO,{class:p("item-icon"),name:e.icon},null)},h=(e,n)=>e.loading?(0,o.Wm)(u.gb,{class:p("loading-icon")},null):t.action?t.action({action:e,index:n}):[(0,o.Wm)("span",{class:p("name")},[e.name]),e.subname&&(0,o.Wm)("div",{class:p("subname")},[e.subname])],w=(n,t)=>{var{color:l,loading:r,callback:s,disabled:c,className:u}=n;return(0,o.Wm)("button",{type:"button",style:{color:l},class:[p("item",{loading:r,disabled:c}),u],onClick:()=>{!c&&!r&&(s&&s(n),e.closeOnClickAction&&a(!1),(0,o.Y3)(()=>i("select",n,t)))}},[S(n),h(n,t)])},b=()=>{if(e.description||t.description){var n=t.description?t.description():e.description;return(0,o.Wm)("div",{class:p("description")},[n])}};return()=>(0,o.Wm)(c.GI,(0,o.dG)({class:p(),position:"bottom","onUpdate:show":a},(0,l.ei)(e,f)),{default:()=>{var n;return[v(),b(),(0,o.Wm)("div",{class:p("content")},[e.actions.map(w),null===(n=t.default)||void 0===n?void 0:n.call(t)]),m()]}})}})},54499:function(e,n,t){"use strict";t.d(n,{x_:function(){return d}}),t("82116"),t("17989");var o=t("80681"),i=t("62568"),l=t("78335"),a=t("12308"),r=t("6149"),s=t("96528"),[c,u]=(0,i.do)("cell"),d={tag:(0,l.SQ)("div"),icon:String,size:String,title:l.Or,value:l.Or,label:l.Or,center:Boolean,isLink:Boolean,border:l.J5,iconPrefix:String,valueClass:l.Vg,labelClass:l.Vg,titleClass:l.Vg,titleStyle:null,arrowDirection:String,required:{type:[Boolean,String],default:null},clickable:{type:Boolean,default:null}},v=(0,a.l7)({},d,r.g2);n.ZP=(0,o.aZ)({name:c,props:v,setup(e,n){var{slots:t}=n,i=(0,r.yj)(),l=()=>{if(t.label||(0,a.Xq)(e.label))return(0,o.Wm)("div",{class:[u("label"),e.labelClass]},[t.label?t.label():e.label])},c=()=>{if(t.title||(0,a.Xq)(e.title)){var n,i=null===(n=t.title)||void 0===n?void 0:n.call(t);if(!Array.isArray(i)||0!==i.length)return(0,o.Wm)("div",{class:[u("title"),e.titleClass],style:e.titleStyle},[i||(0,o.Wm)("span",null,[e.title]),l()])}},d=()=>{var n=t.value||t.default;if(n||(0,a.Xq)(e.value))return(0,o.Wm)("div",{class:[u("value"),e.valueClass]},[n?n():(0,o.Wm)("span",null,[e.value])])},v=()=>t.icon?t.icon():e.icon?(0,o.Wm)(s.JO,{name:e.icon,class:u("left-icon"),classPrefix:e.iconPrefix},null):void 0,p=()=>{if(t["right-icon"])return t["right-icon"]();if(e.isLink){var n=e.arrowDirection&&"right"!==e.arrowDirection?"arrow-".concat(e.arrowDirection):"arrow";return(0,o.Wm)(s.JO,{name:n,class:u("right-icon")},null)}};return()=>{var n,{tag:l,size:a,center:r,border:s,isLink:m,required:f}=e,S=null!==(n=e.clickable)&&void 0!==n?n:m,h={center:r,required:!!f,clickable:S,borderless:!s};return a&&(h[a]=!!a),(0,o.Wm)(l,{class:u(h),role:S?"button":void 0,tabindex:S?0:void 0,onClick:i},{default:()=>{var e;return[v(),c(),d(),p(),null===(e=t.extra)||void 0===e?void 0:e.call(t)]}})}}})},2309:function(e,n,t){"use strict";t("82116"),t("17989"),t("66786"),t("14529");var o=t("80681"),i=t("62568"),l=t("78335"),a=t("12308"),r=t("20358"),[s,c]=(0,i.do)("loading"),u=Array(12).fill(null).map((e,n)=>(0,o.Wm)("i",{class:c("line",String(n+1))},null)),d=(0,o.Wm)("svg",{class:c("circular"),viewBox:"25 25 50 50"},[(0,o.Wm)("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)]),v={size:l.Or,type:(0,l.SQ)("circular"),color:String,vertical:Boolean,textSize:l.Or,textColor:String};n.Z=(0,o.aZ)({name:s,props:v,setup(e,n){var{slots:t}=n,i=(0,o.Fl)(()=>(0,a.l7)({color:e.color},(0,r.Xn)(e.size))),l=()=>{var n="spinner"===e.type?u:d;return(0,o.Wm)("span",{class:c("spinner",e.type),style:i.value},[t.icon?t.icon():n])},s=()=>{if(t.default){var n;return(0,o.Wm)("span",{class:c("text"),style:{fontSize:(0,r.Nn)(e.textSize),color:null!==(n=e.textColor)&&void 0!==n?n:e.color}},[t.default()])}};return()=>{var{type:n,vertical:t}=e;return(0,o.Wm)("div",{class:c([n,{vertical:t}]),"aria-live":"polite","aria-busy":!0},[l(),s()])}}})},21083:function(e,n,t){"use strict";t("82116"),t("17989");var o=t("80681"),i=t("62568"),l=t("78335"),a=t("12308"),r=t("20897"),s=t("96528"),c=t("97760"),u=t("95786"),[d,v]=(0,i.do)("toast"),p=["show","overlay","teleport","transition","overlayClass","overlayStyle","closeOnClickOverlay","zIndex"],m={icon:String,show:Boolean,type:(0,l.SQ)("text"),overlay:Boolean,message:l.Or,iconSize:l.Or,duration:(0,l.qM)(2e3),position:(0,l.SQ)("middle"),teleport:[String,Object],wordBreak:String,className:l.Vg,iconPrefix:String,transition:(0,l.SQ)("van-fade"),loadingType:String,forbidClick:Boolean,overlayClass:l.Vg,overlayStyle:Object,closeOnClick:Boolean,closeOnClickOverlay:Boolean,zIndex:l.Or};n.Z=(0,o.aZ)({name:d,props:m,emits:["update:show"],setup(e,n){var t,{emit:i,slots:l}=n,d=!1,m=()=>{var n=e.show&&e.forbidClick;d!==n&&(d=n,(0,r.G)(d))},f=e=>i("update:show",e),S=()=>{e.closeOnClick&&f(!1)},h=()=>clearTimeout(t),w=()=>{var{icon:n,type:t,iconSize:i,iconPrefix:l,loadingType:a}=e;return n||"success"===t||"fail"===t?(0,o.Wm)(s.JO,{name:n||t,size:i,class:v("icon"),classPrefix:l},null):"loading"===t?(0,o.Wm)(u.gb,{class:v("loading"),size:i,type:a},null):void 0},b=()=>{var{type:n,message:t}=e;return l.message?(0,o.Wm)("div",{class:v("text")},[l.message()]):(0,a.Xq)(t)&&""!==t?"html"===n?(0,o.Wm)("div",{key:0,class:v("text"),innerHTML:String(t)},null):(0,o.Wm)("div",{class:v("text")},[t]):void 0};return(0,o.YP)(()=>[e.show,e.forbidClick],m),(0,o.YP)(()=>[e.show,e.type,e.message,e.duration],()=>{h(),e.show&&e.duration>0&&(t=setTimeout(()=>{f(!1)},e.duration))}),(0,o.bv)(m),(0,o.Ah)(m),()=>(0,o.Wm)(c.GI,(0,o.dG)({class:[v([e.position,"normal"===e.wordBreak?"break-normal":e.wordBreak,{[e.type]:!e.icon}]),e.className],lockScroll:!1,onClick:S,onClosed:h,"onUpdate:show":f},(0,a.ei)(e,p)),{default:()=>[w(),b()]})}})},13118:function(e,n,t){"use strict";t.d(n,{CF:function(){return v},LJ:function(){return S},XA:function(){return f},di:function(){return m},yg:function(){return h}}),t("24836"),t("41712"),t("80855"),t("10502"),t("7978"),t("66746"),t("17530"),t("87604"),t("57024"),t("22175"),t("85322"),t("47897"),t("48943"),t("43356"),t("82116"),t("17989"),t("96245"),t("37232"),t("70629"),t("61557"),t("31564"),t("8649");var o=t("80681"),i=t("11848"),l=t("12308"),a=t("84285"),r=t("21083"),s=[],c=(0,l.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(e){return(0,l.Kn)(e)?e:{message:e}}function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!l._f)return{};var n=function(){if(!s.length){var e=function(){var{instance:e,unmount:n}=(0,a.H)({setup(){var e=(0,i.iH)(""),{open:n,state:t,close:l,toggle:s}=(0,a.o)(),c=()=>{};return(0,o.YP)(e,e=>{t.message=e}),(0,o.FN)().render=()=>(0,o.Wm)(r.Z,(0,o.dG)(t,{onClosed:c,"onUpdate:show":s}),null),{open:n,close:l,message:e}}});return e}();s.push(e)}return s[s.length-1]}(),t=d(e);return n.open((0,l.l7)({},c,u.get(t.type||c.type),t)),n}var p=e=>n=>v((0,l.l7)({type:e},d(n))),m=p("loading"),f=p("success"),S=p("fail"),h=e=>{if(s.length){if(e)s.forEach(e=>{e.close()}),s=[];else{var n;s[0].close()}}}},4085:function(e,n,t){"use strict";t.r(e.exports={})},46289:function(e,n,t){"use strict";t.r(e.exports={})}}]); |