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

2 lines
12 KiB
JavaScript

/*! For license information please see 4337.69b7e15e.js.LICENSE.txt */
(self.webpackChunk=self.webpackChunk||[]).push([["4337"],{26642:function(e,t,n){"use strict";n.r(t);var a=n("9834");n("32487");let o=a.Z;t.default=o},9834:function(e,t,n){"use strict";var a=n("80681"),o=n("11848"),l=n("79514"),i=n("54369"),r=n("13118");t.Z=(0,a.aZ)({__name:"index",setup(e){var t=(0,i.q)({"zh-CN":{defaultLabel:"\u8BBE\u4E3A\u9ED8\u8BA4\u8054\u7CFB\u4EBA"},"en-US":{defaultLabel:"Set as the default contact"}}),n=(0,o.iH)({tel:"",name:""}),s=()=>(0,r.CF)(t("save")),u=()=>(0,r.CF)(t("delete"));return(e,i)=>{var r=(0,a.up)("demo-block");return(0,a.wg)(),(0,a.j4)(r,{title:(0,o.SU)(t)("basicUsage")},{default:(0,a.w5)(()=>[(0,a.Wm)((0,o.SU)(l.ZP),{"is-edit":"","show-set-default":"","contact-info":n.value,"set-default-label":(0,o.SU)(t)("defaultLabel"),onSave:s,onDelete:u},null,8,["contact-info","set-default-label"])]),_:1},8,["title"])}}})},99497:function(e,t,n){"use strict";n.d(t,{zx:function(){return l}});var a=n("63112"),o=n("14314"),l=(0,a.n)(o.Z);t.ZP=l},46267:function(e,t,n){"use strict";n.d(t,{M:function(){return l}});var a=n("80681"),o=0;function l(){var e=(0,a.FN)(),{name:t="unknown"}=(null==e?void 0:e.type)||{};return"".concat(t,"-").concat(++o)}},6149:function(e,t,n){"use strict";n.d(t,{BC:function(){return l},g2:function(){return o},yj:function(){return i}}),n("56115"),n("59644");var a=n("80681"),o={to:[String,Object],url:String,replace:Boolean};function l(e){var{to:t,url:n,replace:a,$router:o}=e;t&&o?o[a?"replace":"push"](t):n&&(a?location.replace(n):location.href=n)}function i(){var e=(0,a.FN)().proxy;return()=>l(e)}},79514:function(e,t,n){"use strict";var a=n("63112"),o=n("19563"),l=(0,a.n)(o.Z);t.ZP=l},85865:function(e,t,n){"use strict";n.d(t,{l0:function(){return l}});var a=n("63112"),o=n("48641"),l=(0,a.n)(o.Z);t.ZP=l},41936:function(e,t,n){"use strict";n.d(t,{rs:function(){return l}});var a=n("63112"),o=n("79960"),l=(0,a.n)(o.Z);t.ZP=l},20897:function(e,t,n){"use strict";n.d(t,{G:function(){return o}});var a=0;function o(e){e?(!a&&document.body.classList.add("van-toast--unclickable"),a++):a&&!--a&&document.body.classList.remove("van-toast--unclickable")}},84285:function(e,t,n){"use strict";n.d(t,{H:function(){return s},o:function(){return r}});var a=n("11848"),o=n("39594"),l=n("12308"),i=n("10023");function r(){var e=(0,a.qj)({show:!1}),t=t=>{e.show=t},n=n=>{(0,l.l7)(e,n,{transitionAppear:!0}),t(!0)},o=()=>t(!1);return(0,i.F)({open:n,close:o,toggle:t}),{open:n,close:o,state:e,toggle:t}}function s(e){var t=(0,o.ri)(e),n=document.createElement("div");return document.body.appendChild(n),{instance:t.mount(n),unmount(){t.unmount(),document.body.removeChild(n)}}}},14314:function(e,t,n){"use strict";n("82116"),n("17989"),n("24660");var a=n("80681"),o=n("62568"),l=n("12308"),i=n("78335"),r=n("82210"),s=n("8051"),u=n("6149"),c=n("96528"),d=n("95786"),[v,f]=(0,o.do)("button"),m=(0,l.l7)({},u.g2,{tag:(0,i.SQ)("button"),text:String,icon:String,type:(0,i.SQ)("default"),size:(0,i.SQ)("normal"),color:String,block:Boolean,plain:Boolean,round:Boolean,square:Boolean,loading:Boolean,hairline:Boolean,disabled:Boolean,iconPrefix:String,nativeType:(0,i.SQ)("button"),loadingSize:i.Or,loadingText:String,loadingType:String,iconPosition:(0,i.SQ)("left")});t.Z=(0,a.aZ)({name:v,props:m,emits:["click"],setup(e,t){var{emit:n,slots:o}=t,l=(0,u.yj)(),i=()=>o.loading?o.loading():(0,a.Wm)(d.gb,{size:e.loadingSize,type:e.loadingType,class:f("loading")},null),v=()=>e.loading?i():o.icon?(0,a.Wm)("div",{class:f("icon")},[o.icon()]):e.icon?(0,a.Wm)(c.JO,{name:e.icon,class:f("icon"),classPrefix:e.iconPrefix},null):void 0,m=()=>{var t;if(t=e.loading?e.loadingText:o.default?o.default():e.text)return(0,a.Wm)("span",{class:f("text")},[t])},g=()=>{var{color:t,plain:n}=e;if(t){var a={color:n?t:"white"};return!n&&(a.background=t),t.includes("gradient")?a.border=0:a.borderColor=t,a}},p=t=>{e.loading?(0,r.PF)(t):!e.disabled&&(n("click",t),l())};return()=>{var{tag:t,type:n,size:o,block:l,round:i,plain:r,square:u,loading:c,disabled:d,hairline:b,nativeType:h,iconPosition:y}=e,S=[f([n,o,{plain:r,block:l,round:i,square:u,loading:c,disabled:d,hairline:b}]),{[s._K]:b}];return(0,a.Wm)(t,{type:h,class:S,style:g(),disabled:d,onClick:p},{default:()=>[(0,a.Wm)("div",{class:f("content")},["left"===y&&v(),m(),"right"===y&&v()])]})}}})},19563:function(e,t,n){"use strict";n("82116"),n("17989");var a=n("80681"),o=n("11848"),l=n("62568"),i=n("12308"),r=n("99742"),s=n("85865"),u=n("51041"),c=n("99497"),d=n("41936"),[v,f,m]=(0,l.do)("contact-edit"),g={tel:"",name:""},p={isEdit:Boolean,isSaving:Boolean,isDeleting:Boolean,showSetDefault:Boolean,setDefaultLabel:String,contactInfo:{type:Object,default:()=>(0,i.l7)({},g)},telValidator:{type:Function,default:i.tq}};t.Z=(0,a.aZ)({name:v,props:p,emits:["save","delete","changeDefault"],setup(e,t){var{emit:n}=t,l=(0,o.qj)((0,i.l7)({},g,e.contactInfo)),v=()=>{!e.isSaving&&n("save",l)},p=()=>n("delete",l),b=()=>(0,a.Wm)("div",{class:f("buttons")},[(0,a.Wm)(c.zx,{block:!0,round:!0,type:"primary",text:m("save"),class:f("button"),loading:e.isSaving,nativeType:"submit"},null),e.isEdit&&(0,a.Wm)(c.zx,{block:!0,round:!0,text:m("delete"),class:f("button"),loading:e.isDeleting,onClick:p},null)]),h=()=>(0,a.Wm)(d.rs,{modelValue:l.isDefault,"onUpdate:modelValue":e=>l.isDefault=e,onChange:e=>n("changeDefault",e)},null),y=()=>{if(e.showSetDefault)return(0,a.Wm)(r.bL,{title:e.setDefaultLabel,class:f("switch-cell"),border:!1},{"right-icon":h})};return(0,a.YP)(()=>e.contactInfo,e=>(0,i.l7)(l,g,e)),()=>(0,a.Wm)(s.l0,{class:f(),onSubmit:v},{default:()=>[(0,a.Wm)("div",{class:f("fields")},[(0,a.Wm)(u.gN,{modelValue:l.name,"onUpdate:modelValue":e=>l.name=e,clearable:!0,label:m("name"),rules:[{required:!0,message:m("nameEmpty")}],maxlength:"30",placeholder:m("name")},null),(0,a.Wm)(u.gN,{modelValue:l.tel,"onUpdate:modelValue":e=>l.tel=e,clearable:!0,type:"tel",label:m("tel"),rules:[{validator:e.telValidator,message:m("telInvalid")}],placeholder:m("tel")},null)]),y(),b()]})}})},48641:function(e,t,n){"use strict";n("82116"),n("17989"),n("96245"),n("37232"),n("70629"),n("24660"),n("40944"),n("21690"),n("29256"),n("36056"),n("61557"),n("66786"),n("14529"),n("57856"),n("31053"),n("31564"),n("8649"),n("63773"),n("97687");var a=n("80681"),o=n("62568"),l=n("78335"),i=n("8051"),r=n("82210"),s=n("22300"),u=n("10023"),[c,d]=(0,o.do)("form"),v={colon:Boolean,disabled:Boolean,readonly:Boolean,required:[Boolean,String],showError:Boolean,labelWidth:l.Or,labelAlign:String,inputAlign:String,scrollToError:Boolean,validateFirst:Boolean,submitOnEnter:l.J5,showErrorMessage:l.J5,errorMessageAlign:String,validateTrigger:{type:[String,Array],default:"onBlur"}};t.Z=(0,a.aZ)({name:c,props:v,emits:["submit","failed"],setup(e,t){var{emit:n,slots:o}=t,{children:l,linkChildren:c}=(0,s.$E)(i.WN),v=e=>e?l.filter(t=>e.includes(t.name)):l,f=e=>new Promise((t,n)=>{var a=[];v(e).reduce((e,t)=>e.then(()=>{if(!a.length)return t.validate().then(e=>{e&&a.push(e)})}),Promise.resolve()).then(()=>{a.length?n(a):t()})}),m=e=>new Promise((t,n)=>{Promise.all(v(e).map(e=>e.validate())).then(e=>{(e=e.filter(Boolean)).length?n(e):t()})}),g=e=>{var t=l.find(t=>t.name===e);return t?new Promise((e,n)=>{t.validate().then(t=>{t?n(t):e()})}):Promise.reject()},p=t=>"string"==typeof t?g(t):e.validateFirst?f(t):m(t),b=(e,t)=>{l.some(n=>n.name===e&&(n.$el.scrollIntoView(t),!0))},h=()=>l.reduce((e,t)=>(void 0!==t.name&&(e[t.name]=t.formValue.value),e),{}),y=()=>{var t=h();p().then(()=>n("submit",t)).catch(a=>{n("failed",{values:t,errors:a}),e.scrollToError&&a[0].name&&b(a[0].name)})},S=e=>{(0,r.PF)(e),y()};return c({props:e}),(0,u.F)({submit:y,validate:p,getValues:h,scrollToField:b,resetValidation:e=>{"string"==typeof e&&(e=[e]),v(e).forEach(e=>{e.resetValidation()})},getValidationStatus:()=>l.reduce((e,t)=>(e[t.name]=t.getValidationStatus(),e),{})}),()=>{var e;return(0,a.Wm)("form",{class:d(),onSubmit:S},[null===(e=o.default)||void 0===e?void 0:e.call(o)])}}})},79960:function(e,t,n){"use strict";n("82116"),n("17989");var a=n("80681"),o=n("62568"),l=n("78335"),i=n("20358"),r=n("22300"),s=n("95786"),[u,c]=(0,o.do)("switch"),d={size:l.Or,loading:Boolean,disabled:Boolean,modelValue:l.Vg,activeColor:String,inactiveColor:String,activeValue:{type:l.Vg,default:!0},inactiveValue:{type:l.Vg,default:!1}};t.Z=(0,a.aZ)({name:u,props:d,emits:["change","update:modelValue"],setup(e,t){var{emit:n,slots:o}=t,l=()=>e.modelValue===e.activeValue,u=()=>{if(!e.disabled&&!e.loading){var t=l()?e.inactiveValue:e.activeValue;n("update:modelValue",t),n("change",t)}},d=()=>{if(e.loading){var t=l()?e.activeColor:e.inactiveColor;return(0,a.Wm)(s.gb,{class:c("loading"),color:t},null)}if(o.node)return o.node()};return(0,r.aM)(()=>e.modelValue),()=>{var t,{size:n,loading:r,disabled:s,activeColor:v,inactiveColor:f}=e,m=l(),g={fontSize:(0,i.Nn)(n),backgroundColor:m?v:f};return(0,a.Wm)("div",{role:"switch",class:c({on:m,loading:r,disabled:s}),style:g,tabindex:s?void 0:0,"aria-checked":m,onClick:u},[(0,a.Wm)("div",{class:c("node")},[d()]),null===(t=o.background)||void 0===t?void 0:t.call(o)])}}})},21083:function(e,t,n){"use strict";n("82116"),n("17989");var a=n("80681"),o=n("62568"),l=n("78335"),i=n("12308"),r=n("20897"),s=n("96528"),u=n("97760"),c=n("95786"),[d,v]=(0,o.do)("toast"),f=["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};t.Z=(0,a.aZ)({name:d,props:m,emits:["update:show"],setup(e,t){var n,{emit:o,slots:l}=t,d=!1,m=()=>{var t=e.show&&e.forbidClick;d!==t&&(d=t,(0,r.G)(d))},g=e=>o("update:show",e),p=()=>{e.closeOnClick&&g(!1)},b=()=>clearTimeout(n),h=()=>{var{icon:t,type:n,iconSize:o,iconPrefix:l,loadingType:i}=e;return t||"success"===n||"fail"===n?(0,a.Wm)(s.JO,{name:t||n,size:o,class:v("icon"),classPrefix:l},null):"loading"===n?(0,a.Wm)(c.gb,{class:v("loading"),size:o,type:i},null):void 0},y=()=>{var{type:t,message:n}=e;return l.message?(0,a.Wm)("div",{class:v("text")},[l.message()]):(0,i.Xq)(n)&&""!==n?"html"===t?(0,a.Wm)("div",{key:0,class:v("text"),innerHTML:String(n)},null):(0,a.Wm)("div",{class:v("text")},[n]):void 0};return(0,a.YP)(()=>[e.show,e.forbidClick],m),(0,a.YP)(()=>[e.show,e.type,e.message,e.duration],()=>{b(),e.show&&e.duration>0&&(n=setTimeout(()=>{g(!1)},e.duration))}),(0,a.bv)(m),(0,a.Ah)(m),()=>(0,a.Wm)(u.GI,(0,a.dG)({class:[v([e.position,"normal"===e.wordBreak?"break-normal":e.wordBreak,{[e.type]:!e.icon}]),e.className],lockScroll:!1,onClick:p,onClosed:b,"onUpdate:show":g},(0,i.ei)(e,f)),{default:()=>[h(),y()]})}})},13118:function(e,t,n){"use strict";n.d(t,{CF:function(){return v},LJ:function(){return p},XA:function(){return g},di:function(){return m},yg:function(){return b}}),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 a=n("80681"),o=n("11848"),l=n("12308"),i=n("84285"),r=n("21083"),s=[],u=(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}),c=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 t=function(){if(!s.length){var e=function(){var{instance:e,unmount:t}=(0,i.H)({setup(){var e=(0,o.iH)(""),{open:t,state:n,close:l,toggle:s}=(0,i.o)(),u=()=>{};return(0,a.YP)(e,e=>{n.message=e}),(0,a.FN)().render=()=>(0,a.Wm)(r.Z,(0,a.dG)(n,{onClosed:u,"onUpdate:show":s}),null),{open:t,close:l,message:e}}});return e}();s.push(e)}return s[s.length-1]}(),n=d(e);return t.open((0,l.l7)({},u,c.get(n.type||u.type),n)),t}var f=e=>t=>v((0,l.l7)({type:e},d(t))),m=f("loading"),g=f("success"),p=f("fail"),b=e=>{if(s.length){if(e)s.forEach(e=>{e.close()}),s=[];else{var t;s[0].close()}}}},32487:function(e,t,n){"use strict";n.r(e.exports={})},804:function(e,t,n){"use strict";n.r(e.exports={})}}]);