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

2 lines
9.4 KiB
JavaScript

/*! For license information please see 1491.550529f8.js.LICENSE.txt */
(self.webpackChunk=self.webpackChunk||[]).push([["1491"],{12891:function(e,t,n){"use strict";n.r(t);let l=n("10928").Z;t.default=l},10928:function(e,t,n){"use strict";var l=n("80681"),i=n("11848"),r=n("91869"),a=n("54369"),o=n("13118");t.Z=(0,l.aZ)({__name:"index",setup(e){var t=(0,a.q)({"zh-CN":{add:"\u65B0\u589E",edit:"\u7F16\u8F91",name:"\u5F20\u4E09",addContact:"\u6DFB\u52A0\u8054\u7CFB\u4EBA",editContact:"\u7F16\u8F91\u8054\u7CFB\u4EBA"},"en-US":{add:"Add",edit:"Edit",name:"John Snow",addContact:"Add Contact",editContact:"Edit Contact"}}),n=(0,l.Fl)(()=>({name:t("name"),tel:"13000000000"})),c=()=>(0,o.CF)(t("add")),s=()=>(0,o.CF)(t("edit"));return(e,a)=>{var o=(0,l.up)("demo-block");return(0,l.wg)(),(0,l.iD)(l.HY,null,[(0,l.Wm)(o,{title:(0,i.SU)(t)("addContact")},{default:(0,l.w5)(()=>[(0,l.Wm)((0,i.SU)(r.ZP),{type:"add",onClick:c})]),_:1},8,["title"]),(0,l.Wm)(o,{title:(0,i.SU)(t)("editContact")},{default:(0,l.w5)(()=>[(0,l.Wm)((0,i.SU)(r.ZP),{type:"edit",name:n.value.name,tel:n.value.tel,onClick:s},null,8,["name","tel"])]),_:1},8,["title"]),(0,l.Wm)(o,{title:(0,i.SU)(t)("uneditable")},{default:(0,l.w5)(()=>[(0,l.Wm)((0,i.SU)(r.ZP),{type:"edit",name:n.value.name,tel:n.value.tel,editable:!1},null,8,["name","tel"])]),_:1},8,["title"])],64)}}})},99742:function(e,t,n){"use strict";n.d(t,{bL:function(){return r}});var l=n("63112"),i=n("54499"),r=(0,l.n)(i.ZP);t.ZP=r},6149:function(e,t,n){"use strict";n.d(t,{BC:function(){return r},g2:function(){return i},yj:function(){return a}}),n("56115"),n("59644");var l=n("80681"),i={to:[String,Object],url:String,replace:Boolean};function r(e){var{to:t,url:n,replace:l,$router:i}=e;t&&i?i[l?"replace":"push"](t):n&&(l?location.replace(n):location.href=n)}function a(){var e=(0,l.FN)().proxy;return()=>r(e)}},91869:function(e,t,n){"use strict";var l=n("63112"),i=n("1445"),r=(0,l.n)(i.Z);t.ZP=r},95786:function(e,t,n){"use strict";n.d(t,{gb:function(){return r}});var l=n("63112"),i=n("2309"),r=(0,l.n)(i.Z);t.ZP=r},20897:function(e,t,n){"use strict";n.d(t,{G:function(){return i}});var l=0;function i(e){e?(!l&&document.body.classList.add("van-toast--unclickable"),l++):l&&!--l&&document.body.classList.remove("van-toast--unclickable")}},84285:function(e,t,n){"use strict";n.d(t,{H:function(){return c},o:function(){return o}});var l=n("11848"),i=n("39594"),r=n("12308"),a=n("10023");function o(){var e=(0,l.qj)({show:!1}),t=t=>{e.show=t},n=n=>{(0,r.l7)(e,n,{transitionAppear:!0}),t(!0)},i=()=>t(!1);return(0,a.F)({open:n,close:i,toggle:t}),{open:n,close:i,state:e,toggle:t}}function c(e){var t=(0,i.ri)(e),n=document.createElement("div");return document.body.appendChild(n),{instance:t.mount(n),unmount(){t.unmount(),document.body.removeChild(n)}}}},54499:function(e,t,n){"use strict";n.d(t,{x_:function(){return d}}),n("82116"),n("17989");var l=n("80681"),i=n("62568"),r=n("78335"),a=n("12308"),o=n("6149"),c=n("96528"),[s,u]=(0,i.do)("cell"),d={tag:(0,r.SQ)("div"),icon:String,size:String,title:r.Or,value:r.Or,label:r.Or,center:Boolean,isLink:Boolean,border:r.J5,iconPrefix:String,valueClass:r.Vg,labelClass:r.Vg,titleClass:r.Vg,titleStyle:null,arrowDirection:String,required:{type:[Boolean,String],default:null},clickable:{type:Boolean,default:null}},v=(0,a.l7)({},d,o.g2);t.ZP=(0,l.aZ)({name:s,props:v,setup(e,t){var{slots:n}=t,i=(0,o.yj)(),r=()=>{if(n.label||(0,a.Xq)(e.label))return(0,l.Wm)("div",{class:[u("label"),e.labelClass]},[n.label?n.label():e.label])},s=()=>{if(n.title||(0,a.Xq)(e.title)){var t,i=null===(t=n.title)||void 0===t?void 0:t.call(n);if(!Array.isArray(i)||0!==i.length)return(0,l.Wm)("div",{class:[u("title"),e.titleClass],style:e.titleStyle},[i||(0,l.Wm)("span",null,[e.title]),r()])}},d=()=>{var t=n.value||n.default;if(t||(0,a.Xq)(e.value))return(0,l.Wm)("div",{class:[u("value"),e.valueClass]},[t?t():(0,l.Wm)("span",null,[e.value])])},v=()=>n.icon?n.icon():e.icon?(0,l.Wm)(c.JO,{name:e.icon,class:u("left-icon"),classPrefix:e.iconPrefix},null):void 0,f=()=>{if(n["right-icon"])return n["right-icon"]();if(e.isLink){var t=e.arrowDirection&&"right"!==e.arrowDirection?"arrow-".concat(e.arrowDirection):"arrow";return(0,l.Wm)(c.JO,{name:t,class:u("right-icon")},null)}};return()=>{var t,{tag:r,size:a,center:o,border:c,isLink:m,required:p}=e,y=null!==(t=e.clickable)&&void 0!==t?t:m,g={center:o,required:!!p,clickable:y,borderless:!c};return a&&(g[a]=!!a),(0,l.Wm)(r,{class:u(g),role:y?"button":void 0,tabindex:y?0:void 0,onClick:i},{default:()=>{var e;return[v(),s(),d(),f(),null===(e=n.extra)||void 0===e?void 0:e.call(n)]}})}}})},1445:function(e,t,n){"use strict";n("82116"),n("17989");var l=n("80681"),i=n("62568"),r=n("78335"),a=n("99742"),[o,c,s]=(0,i.do)("contact-card"),u={tel:String,name:String,type:(0,r.SQ)("add"),addText:String,editable:r.J5};t.Z=(0,l.aZ)({name:o,props:u,emits:["click"],setup(e,t){var{emit:n}=t,i=t=>{e.editable&&n("click",t)},r=()=>"add"===e.type?e.addText||s("addContact"):[(0,l.Wm)("div",null,["".concat(s("name"),"\uFF1A").concat(e.name)]),(0,l.Wm)("div",null,["".concat(s("tel"),"\uFF1A").concat(e.tel)])];return()=>(0,l.Wm)(a.bL,{center:!0,icon:"edit"===e.type?"contact":"add-square",class:c([e.type]),border:!1,isLink:e.editable,titleClass:c("title"),onClick:i},{title:r})}})},2309:function(e,t,n){"use strict";n("82116"),n("17989"),n("66786"),n("14529");var l=n("80681"),i=n("62568"),r=n("78335"),a=n("12308"),o=n("20358"),[c,s]=(0,i.do)("loading"),u=Array(12).fill(null).map((e,t)=>(0,l.Wm)("i",{class:s("line",String(t+1))},null)),d=(0,l.Wm)("svg",{class:s("circular"),viewBox:"25 25 50 50"},[(0,l.Wm)("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)]),v={size:r.Or,type:(0,r.SQ)("circular"),color:String,vertical:Boolean,textSize:r.Or,textColor:String};t.Z=(0,l.aZ)({name:c,props:v,setup(e,t){var{slots:n}=t,i=(0,l.Fl)(()=>(0,a.l7)({color:e.color},(0,o.Xn)(e.size))),r=()=>{var t="spinner"===e.type?u:d;return(0,l.Wm)("span",{class:s("spinner",e.type),style:i.value},[n.icon?n.icon():t])},c=()=>{if(n.default){var t;return(0,l.Wm)("span",{class:s("text"),style:{fontSize:(0,o.Nn)(e.textSize),color:null!==(t=e.textColor)&&void 0!==t?t:e.color}},[n.default()])}};return()=>{var{type:t,vertical:n}=e;return(0,l.Wm)("div",{class:s([t,{vertical:n}]),"aria-live":"polite","aria-busy":!0},[r(),c()])}}})},21083:function(e,t,n){"use strict";n("82116"),n("17989");var l=n("80681"),i=n("62568"),r=n("78335"),a=n("12308"),o=n("20897"),c=n("96528"),s=n("97760"),u=n("95786"),[d,v]=(0,i.do)("toast"),f=["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};t.Z=(0,l.aZ)({name:d,props:m,emits:["update:show"],setup(e,t){var n,{emit:i,slots:r}=t,d=!1,m=()=>{var t=e.show&&e.forbidClick;d!==t&&(d=t,(0,o.G)(d))},p=e=>i("update:show",e),y=()=>{e.closeOnClick&&p(!1)},g=()=>clearTimeout(n),C=()=>{var{icon:t,type:n,iconSize:i,iconPrefix:r,loadingType:a}=e;return t||"success"===n||"fail"===n?(0,l.Wm)(c.JO,{name:t||n,size:i,class:v("icon"),classPrefix:r},null):"loading"===n?(0,l.Wm)(u.gb,{class:v("loading"),size:i,type:a},null):void 0},b=()=>{var{type:t,message:n}=e;return r.message?(0,l.Wm)("div",{class:v("text")},[r.message()]):(0,a.Xq)(n)&&""!==n?"html"===t?(0,l.Wm)("div",{key:0,class:v("text"),innerHTML:String(n)},null):(0,l.Wm)("div",{class:v("text")},[n]):void 0};return(0,l.YP)(()=>[e.show,e.forbidClick],m),(0,l.YP)(()=>[e.show,e.type,e.message,e.duration],()=>{g(),e.show&&e.duration>0&&(n=setTimeout(()=>{p(!1)},e.duration))}),(0,l.bv)(m),(0,l.Ah)(m),()=>(0,l.Wm)(s.GI,(0,l.dG)({class:[v([e.position,"normal"===e.wordBreak?"break-normal":e.wordBreak,{[e.type]:!e.icon}]),e.className],lockScroll:!1,onClick:y,onClosed:g,"onUpdate:show":p},(0,a.ei)(e,f)),{default:()=>[C(),b()]})}})},13118:function(e,t,n){"use strict";n.d(t,{CF:function(){return v},LJ:function(){return y},XA:function(){return p},di:function(){return m},yg:function(){return g}}),n("24836"),n("41712"),n("80855"),n("10502"),n("7978"),n("66746"),n("17530"),n("87604"),n("57024"),n("22175"),n("85322"),n("47897"),n("48943"),n("43356"),n("82116"),n("17989"),n("96245"),n("37232"),n("70629"),n("61557"),n("31564"),n("8649");var l=n("80681"),i=n("11848"),r=n("12308"),a=n("84285"),o=n("21083"),c=[],s=(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(e){return(0,r.Kn)(e)?e:{message:e}}function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!r._f)return{};var t=function(){if(!c.length){var e=function(){var{instance:e,unmount:t}=(0,a.H)({setup(){var e=(0,i.iH)(""),{open:t,state:n,close:r,toggle:c}=(0,a.o)(),s=()=>{};return(0,l.YP)(e,e=>{n.message=e}),(0,l.FN)().render=()=>(0,l.Wm)(o.Z,(0,l.dG)(n,{onClosed:s,"onUpdate:show":c}),null),{open:t,close:r,message:e}}});return e}();c.push(e)}return c[c.length-1]}(),n=d(e);return t.open((0,r.l7)({},s,u.get(n.type||s.type),n)),t}var f=e=>t=>v((0,r.l7)({type:e},d(t))),m=f("loading"),p=f("success"),y=f("fail"),g=e=>{if(c.length){if(e)c.forEach(e=>{e.close()}),c=[];else{var t;c[0].close()}}}}}]);