mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
2 lines
20 KiB
JavaScript
2 lines
20 KiB
JavaScript
/*! For license information please see 3689.52b3e81e.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([["3689"],{70623:function(e,a,t){"use strict";t.r(a);var l=t("47336");t("66754");let n=l.Z;a.default=n},47336:function(e,a,t){"use strict";var l=t("80681"),n=t("11848"),o=t("91668"),r=t("90872"),i=t("54369"),s=t("13118");a.Z=(0,l.aZ)({__name:"index",setup(e){var a=(0,i.q)({"zh-CN":{areaColumnsPlaceholder:["\u8BF7\u9009\u62E9","\u8BF7\u9009\u62E9","\u8BF7\u9009\u62E9"],searchResult:[{name:"\u9EC4\u9F99\u4E07\u79D1\u4E2D\u5FC3",address:"\u676D\u5DDE\u5E02\u897F\u6E56\u533A"},{name:"\u9EC4\u9F99\u4E07\u79D1\u4E2D\u5FC3G\u5EA7"},{name:"\u9EC4\u9F99\u4E07\u79D1\u4E2D\u5FC3H\u5EA7",address:"\u676D\u5DDE\u5E02\u897F\u6E56\u533A"}]},"en-US":{areaColumnsPlaceholder:["Choose","Choose","Choose"],searchResult:[{name:"Name1",address:"Address"},{name:"Name2"},{name:"Name3",address:"Address"}]}}),t=(0,n.iH)([]),u=()=>(0,s.CF)(a("save")),c=()=>(0,s.CF)(a("delete")),d=e=>{t.value=e?a("searchResult"):[]};return(e,i)=>{var s=(0,l.up)("demo-block");return(0,l.wg)(),(0,l.j4)(s,{title:(0,n.SU)(a)("basicUsage")},{default:(0,l.w5)(()=>[(0,l.Wm)((0,n.SU)(o.ZP),{"area-list":(0,n.SU)(r.H),"show-delete":"","show-set-default":"","show-search-result":"","search-result":t.value,"area-columns-placeholder":(0,n.SU)(a)("areaColumnsPlaceholder"),onSave:u,onDelete:c,onChangeDetail:d},null,8,["area-list","search-result","area-columns-placeholder"])]),_:1},8,["title"])}}})},91668:function(e,a,t){"use strict";var l=t("63112"),n=t("8181"),o=(0,l.n)(n.Z);a.ZP=o},20665:function(e,a,t){"use strict";t.d(a,{uN:function(){return o}});var l=t("63112"),n=t("74868"),o=(0,l.n)(n.Z);a.ZP=o},77830:function(e,a,t){"use strict";t.d(a,{If:function(){return i},NC:function(){return o},eW:function(){return n},h5:function(){return l}}),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("31564"),t("8649"),t("70629"),t("61557"),t("51185");var l="000000",n=["title","cancel","confirm","toolbar","columns-top","columns-bottom"],o=["title","loading","readonly","optionHeight","swipeDuration","visibleOptionNum","cancelButtonText","confirmButtonText"],r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return{text:e,value:a,children:t}};function i(e){var{areaList:a,columnsNum:t,columnsPlaceholder:n}=e,{city_list:o={},county_list:i={},province_list:s={}}=a,u=+t>1,c=+t>2,d=()=>{if(u)return n.length?[r(n[0],l,c?[]:void 0)]:[]},v=new Map;Object.keys(s).forEach(e=>{v.set(e.slice(0,2),r(s[e],e,d()))});var m=new Map;if(u){var h=()=>{if(c)return n.length?[r(n[1])]:[]};Object.keys(o).forEach(e=>{var a=r(o[e],e,h());m.set(e.slice(0,4),a);var t=v.get(e.slice(0,2));t&&t.children.push(a)})}c&&Object.keys(i).forEach(e=>{var a=m.get(e.slice(0,4));a&&a.children.push(r(i[e],e))});var f=Array.from(v.values());if(n.length){var g=c?[r(n[2])]:void 0,p=u?[r(n[1],l,g)]:void 0;f.unshift(r(n[0],l,p))}return f}},99497:function(e,a,t){"use strict";t.d(a,{zx:function(){return o}});var l=t("63112"),n=t("14314"),o=(0,l.n)(n.Z);a.ZP=o},85865:function(e,a,t){"use strict";t.d(a,{l0:function(){return o}});var l=t("63112"),n=t("48641"),o=(0,l.n)(n.Z);a.ZP=o},54854:function(e,a,t){"use strict";t.d(a,{cW:function(){return o}});var l=t("63112"),n=t("36809"),o=(0,l.n)(n.ZP);a.ZP=o},41936:function(e,a,t){"use strict";t.d(a,{rs:function(){return o}});var l=t("63112"),n=t("79960"),o=(0,l.n)(n.Z);a.ZP=o},20897:function(e,a,t){"use strict";t.d(a,{G:function(){return n}});var l=0;function n(e){e?(!l&&document.body.classList.add("van-toast--unclickable"),l++):l&&!--l&&document.body.classList.remove("van-toast--unclickable")}},84285:function(e,a,t){"use strict";t.d(a,{H:function(){return s},o:function(){return i}});var l=t("11848"),n=t("39594"),o=t("12308"),r=t("10023");function i(){var e=(0,l.qj)({show:!1}),a=a=>{e.show=a},t=t=>{(0,o.l7)(e,t,{transitionAppear:!0}),a(!0)},n=()=>a(!1);return(0,r.F)({open:t,close:n,toggle:a}),{open:t,close:n,state:e,toggle:a}}function s(e){var a=(0,n.ri)(e),t=document.createElement("div");return document.body.appendChild(t),{instance:a.mount(t),unmount(){a.unmount(),document.body.removeChild(t)}}}},8181:function(e,a,t){"use strict";t("82116"),t("17989"),t("96245"),t("37232"),t("70629"),t("63773"),t("97687"),t("25171"),t("6438");var l=t("80681"),n=t("39594"),o=t("11848"),r=t("62568"),i=t("78335"),s=t("12308"),u=t("10023"),c=t("20665"),d=t("99742"),v=t("85865"),m=t("51041"),h=t("97760"),f=t("13118"),g=t("99497"),p=t("41936"),y=t("4057"),b=t("77830"),[S,C,w]=(0,r.do)("address-edit"),k={name:"",tel:"",city:"",county:"",country:"",province:"",areaCode:"",isDefault:!1,addressDetail:""},x={areaList:Object,isSaving:Boolean,isDeleting:Boolean,validator:Function,showArea:i.J5,showDetail:i.J5,showDelete:Boolean,disableArea:Boolean,searchResult:Array,telMaxlength:i.Or,showSetDefault:Boolean,saveButtonText:String,areaPlaceholder:String,deleteButtonText:String,showSearchResult:Boolean,detailRows:(0,i.SI)(1),detailMaxlength:(0,i.SI)(200),areaColumnsPlaceholder:(0,i.Ce)(),addressInfo:{type:Object,default:()=>(0,s.l7)({},k)},telValidator:{type:Function,default:s.tq}};a.Z=(0,l.aZ)({name:S,props:x,emits:["save","focus","change","delete","clickArea","changeArea","changeDetail","selectSearch","changeDefault"],setup(e,a){var{emit:t,slots:r}=a,i=(0,o.iH)(),S=(0,o.qj)({}),x=(0,o.iH)(!1),B=(0,o.iH)(!1),W=(0,l.Fl)(()=>(0,s.Kn)(e.areaList)&&Object.keys(e.areaList).length),V=(0,l.Fl)(()=>{var{province:e,city:a,county:t,areaCode:l}=S;if(l){var n=[e,a,t];return e&&e===a&&n.splice(1,1),n.filter(Boolean).join("/")}return""}),P=(0,l.Fl)(()=>{var a;return(null===(a=e.searchResult)||void 0===a?void 0:a.length)&&B.value}),O=e=>{B.value="addressDetail"===e,t("focus",e)},Z=(e,a)=>{t("change",{key:e,value:a})},D=(0,l.Fl)(()=>{var{validator:a,telValidator:t}=e,l=(e,t)=>({validator:l=>{if(a){var n=a(e,l);if(n)return n}return!!l||t}});return{name:[l("name",w("nameEmpty"))],tel:[l("tel",w("telInvalid")),{validator:t,message:w("telInvalid")}],areaCode:[l("areaCode",w("areaEmpty"))],addressDetail:[l("addressDetail",w("addressEmpty"))]}}),F=()=>t("save",S),A=e=>{S.addressDetail=e,t("changeDetail",e)},N=e=>{S.province=e[0].text,S.city=e[1].text,S.county=e[2].text},T=e=>{var{selectedValues:a,selectedOptions:l}=e;a.some(e=>e===b.h5)?(0,f.CF)(w("areaEmpty")):(x.value=!1,N(l),t("changeArea",l))},z=()=>t("delete",S),R=()=>{setTimeout(()=>{B.value=!1})},E=()=>{if(e.showSetDefault)return(0,l.wy)((0,l.Wm)(d.bL,{center:!0,border:!1,title:w("defaultAddress"),class:C("default")},{"right-icon":()=>(0,l.Wm)(p.rs,{modelValue:S.isDefault,"onUpdate:modelValue":e=>S.isDefault=e,onChange:e=>t("changeDefault",e)},null)}),[[n.F8,!P.value]])};return(0,u.F)({setAreaCode:e=>{S.areaCode=e||""},setAddressDetail:e=>{S.addressDetail=e}}),(0,l.YP)(()=>e.addressInfo,e=>{(0,s.l7)(S,k,e),(0,l.Y3)(()=>{var e,a=null===(e=i.value)||void 0===e?void 0:e.getSelectedOptions();a&&a.every(e=>e&&e.value!==b.h5)&&N(a)})},{deep:!0,immediate:!0}),()=>{var{disableArea:a}=e;return(0,l.Wm)(v.l0,{class:C(),onSubmit:F},{default:()=>{var o;return[(0,l.Wm)("div",{class:C("fields")},[(0,l.Wm)(m.gN,{modelValue:S.name,"onUpdate:modelValue":[e=>S.name=e,e=>Z("name",e)],clearable:!0,label:w("name"),rules:D.value.name,placeholder:w("name"),onFocus:()=>O("name")},null),(0,l.Wm)(m.gN,{modelValue:S.tel,"onUpdate:modelValue":[e=>S.tel=e,e=>Z("tel",e)],clearable:!0,type:"tel",label:w("tel"),rules:D.value.tel,maxlength:e.telMaxlength,placeholder:w("tel"),onFocus:()=>O("tel")},null),(0,l.wy)((0,l.Wm)(m.gN,{readonly:!0,label:w("area"),"is-link":!a,modelValue:V.value,rules:e.showArea?D.value.areaCode:void 0,placeholder:e.areaPlaceholder||w("area"),onFocus:()=>O("areaCode"),onClick:()=>{t("clickArea"),x.value=!a}},null),[[n.F8,e.showArea]]),(0,l.Wm)(y.Z,{show:e.showDetail,rows:e.detailRows,rules:D.value.addressDetail,value:S.addressDetail,focused:B.value,maxlength:e.detailMaxlength,searchResult:e.searchResult,showSearchResult:e.showSearchResult,onBlur:R,onFocus:()=>O("addressDetail"),onInput:A,onSelectSearch:e=>t("selectSearch",e)},null),null===(o=r.default)||void 0===o?void 0:o.call(r)]),E(),(0,l.wy)((0,l.Wm)("div",{class:C("buttons")},[(0,l.Wm)(g.zx,{block:!0,round:!0,type:"primary",text:e.saveButtonText||w("save"),class:C("button"),loading:e.isSaving,nativeType:"submit"},null),e.showDelete&&(0,l.Wm)(g.zx,{block:!0,round:!0,class:C("button"),loading:e.isDeleting,text:e.deleteButtonText||w("delete"),onClick:z},null)]),[[n.F8,!P.value]]),(0,l.Wm)(h.GI,{show:x.value,"onUpdate:show":e=>x.value=e,round:!0,teleport:"body",position:"bottom",lazyRender:!1},{default:()=>[(0,l.Wm)(c.uN,{modelValue:S.areaCode,"onUpdate:modelValue":e=>S.areaCode=e,ref:i,loading:!W.value,areaList:e.areaList,columnsPlaceholder:e.areaColumnsPlaceholder,onConfirm:T,onCancel:()=>{x.value=!1}},null)]})]}})}}})},4057:function(e,a,t){"use strict";t("82116"),t("17989"),t("89571"),t("66786"),t("14529");var l=t("80681"),n=t("11848"),o=t("62568"),r=t("78335"),i=t("99742"),s=t("51041"),[u,c]=(0,o.do)("address-edit-detail"),d=(0,o.do)("address-edit")[2];a.Z=(0,l.aZ)({name:u,props:{show:Boolean,rows:r.Or,value:String,rules:Array,focused:Boolean,maxlength:r.Or,searchResult:Array,showSearchResult:Boolean},emits:["blur","focus","input","selectSearch"],setup(e,a){var{emit:t}=a,o=(0,n.iH)(),r=()=>e.focused&&e.searchResult&&e.showSearchResult,u=e=>{t("selectSearch",e),t("input","".concat(e.address||""," ").concat(e.name||"").trim())},v=()=>{if(r()){var{searchResult:a}=e;return a.map(e=>(0,l.Wm)(i.bL,{clickable:!0,key:(e.name||"")+(e.address||""),icon:"location-o",title:e.name,label:e.address,class:c("search-item"),border:!1,onClick:()=>u(e)},null))}},m=e=>t("blur",e),h=e=>t("focus",e),f=e=>t("input",e);return()=>{if(e.show)return(0,l.Wm)(l.HY,null,[(0,l.Wm)(s.gN,{autosize:!0,clearable:!0,ref:o,class:c(),rows:e.rows,type:"textarea",rules:e.rules,label:d("addressDetail"),border:!r(),maxlength:e.maxlength,modelValue:e.value,placeholder:d("addressDetail"),onBlur:m,onFocus:h,"onUpdate:modelValue":f},null),v()])}}})},74868:function(e,a,t){"use strict";t("82116"),t("17989");var l=t("80681"),n=t("11848"),o=t("62568"),r=t("12308"),i=t("78335"),s=t("36809"),u=t("77830"),c=t("10023"),d=t("54854"),[v,m]=(0,o.do)("area"),h=(0,r.l7)({},(0,r.ei)(s.d4,u.NC),{modelValue:String,columnsNum:(0,i.SI)(3),columnsPlaceholder:(0,i.Ce)(),areaList:{type:Object,default:()=>({})}});a.Z=(0,l.aZ)({name:v,props:h,emits:["change","confirm","cancel","update:modelValue"],setup(e,a){var{emit:t,slots:o}=a,i=(0,n.iH)([]),s=(0,n.iH)(),v=(0,l.Fl)(()=>(0,u.If)(e)),h=function(){for(var e=arguments.length,a=Array(e),l=0;l<e;l++)a[l]=arguments[l];return t("change",...a)},f=function(){for(var e=arguments.length,a=Array(e),l=0;l<e;l++)a[l]=arguments[l];return t("cancel",...a)},g=function(){for(var e=arguments.length,a=Array(e),l=0;l<e;l++)a[l]=arguments[l];return t("confirm",...a)};return(0,l.YP)(i,a=>{var l=a.length?a[a.length-1]:"";l&&l!==e.modelValue&&t("update:modelValue",l)},{deep:!0}),(0,l.YP)(()=>e.modelValue,a=>{a?a!==(i.value.length?i.value[i.value.length-1]:"")&&(i.value=["".concat(a.slice(0,2),"0000"),"".concat(a.slice(0,4),"00"),a].slice(0,+e.columnsNum)):i.value=[]},{immediate:!0}),(0,c.F)({confirm:()=>{var e;return null===(e=s.value)||void 0===e?void 0:e.confirm()},getSelectedOptions:()=>{var e;return(null===(e=s.value)||void 0===e?void 0:e.getSelectedOptions())||[]}}),()=>(0,l.Wm)(d.cW,(0,l.dG)({ref:s,modelValue:i.value,"onUpdate:modelValue":e=>i.value=e,class:m(),columns:v.value,onChange:h,onCancel:f,onConfirm:g},(0,r.ei)(e,u.NC)),(0,r.ei)(o,u.eW))}})},14314:function(e,a,t){"use strict";t("82116"),t("17989"),t("24660");var l=t("80681"),n=t("62568"),o=t("12308"),r=t("78335"),i=t("82210"),s=t("8051"),u=t("6149"),c=t("96528"),d=t("95786"),[v,m]=(0,n.do)("button"),h=(0,o.l7)({},u.g2,{tag:(0,r.SQ)("button"),text:String,icon:String,type:(0,r.SQ)("default"),size:(0,r.SQ)("normal"),color:String,block:Boolean,plain:Boolean,round:Boolean,square:Boolean,loading:Boolean,hairline:Boolean,disabled:Boolean,iconPrefix:String,nativeType:(0,r.SQ)("button"),loadingSize:r.Or,loadingText:String,loadingType:String,iconPosition:(0,r.SQ)("left")});a.Z=(0,l.aZ)({name:v,props:h,emits:["click"],setup(e,a){var{emit:t,slots:n}=a,o=(0,u.yj)(),r=()=>n.loading?n.loading():(0,l.Wm)(d.gb,{size:e.loadingSize,type:e.loadingType,class:m("loading")},null),v=()=>e.loading?r():n.icon?(0,l.Wm)("div",{class:m("icon")},[n.icon()]):e.icon?(0,l.Wm)(c.JO,{name:e.icon,class:m("icon"),classPrefix:e.iconPrefix},null):void 0,h=()=>{var a;if(a=e.loading?e.loadingText:n.default?n.default():e.text)return(0,l.Wm)("span",{class:m("text")},[a])},f=()=>{var{color:a,plain:t}=e;if(a){var l={color:t?a:"white"};return!t&&(l.background=a),a.includes("gradient")?l.border=0:l.borderColor=a,l}},g=a=>{e.loading?(0,i.PF)(a):!e.disabled&&(t("click",a),o())};return()=>{var{tag:a,type:t,size:n,block:o,round:r,plain:i,square:u,loading:c,disabled:d,hairline:p,nativeType:y,iconPosition:b}=e,S=[m([t,n,{plain:i,block:o,round:r,square:u,loading:c,disabled:d,hairline:p}]),{[s._K]:p}];return(0,l.Wm)(a,{type:y,class:S,style:f(),disabled:d,onClick:g},{default:()=>[(0,l.Wm)("div",{class:m("content")},["left"===b&&v(),h(),"right"===b&&v()])]})}}})},48641:function(e,a,t){"use strict";t("82116"),t("17989"),t("96245"),t("37232"),t("70629"),t("24660"),t("40944"),t("21690"),t("29256"),t("36056"),t("61557"),t("66786"),t("14529"),t("57856"),t("31053"),t("31564"),t("8649"),t("63773"),t("97687");var l=t("80681"),n=t("62568"),o=t("78335"),r=t("8051"),i=t("82210"),s=t("22300"),u=t("10023"),[c,d]=(0,n.do)("form"),v={colon:Boolean,disabled:Boolean,readonly:Boolean,required:[Boolean,String],showError:Boolean,labelWidth:o.Or,labelAlign:String,inputAlign:String,scrollToError:Boolean,validateFirst:Boolean,submitOnEnter:o.J5,showErrorMessage:o.J5,errorMessageAlign:String,validateTrigger:{type:[String,Array],default:"onBlur"}};a.Z=(0,l.aZ)({name:c,props:v,emits:["submit","failed"],setup(e,a){var{emit:t,slots:n}=a,{children:o,linkChildren:c}=(0,s.$E)(r.WN),v=e=>e?o.filter(a=>e.includes(a.name)):o,m=e=>new Promise((a,t)=>{var l=[];v(e).reduce((e,a)=>e.then(()=>{if(!l.length)return a.validate().then(e=>{e&&l.push(e)})}),Promise.resolve()).then(()=>{l.length?t(l):a()})}),h=e=>new Promise((a,t)=>{Promise.all(v(e).map(e=>e.validate())).then(e=>{(e=e.filter(Boolean)).length?t(e):a()})}),f=e=>{var a=o.find(a=>a.name===e);return a?new Promise((e,t)=>{a.validate().then(a=>{a?t(a):e()})}):Promise.reject()},g=a=>"string"==typeof a?f(a):e.validateFirst?m(a):h(a),p=(e,a)=>{o.some(t=>t.name===e&&(t.$el.scrollIntoView(a),!0))},y=()=>o.reduce((e,a)=>(void 0!==a.name&&(e[a.name]=a.formValue.value),e),{}),b=()=>{var a=y();g().then(()=>t("submit",a)).catch(l=>{t("failed",{values:a,errors:l}),e.scrollToError&&l[0].name&&p(l[0].name)})},S=e=>{(0,i.PF)(e),b()};return c({props:e}),(0,u.F)({submit:b,validate:g,getValues:y,scrollToField:p,resetValidation:e=>{"string"==typeof e&&(e=[e]),v(e).forEach(e=>{e.resetValidation()})},getValidationStatus:()=>o.reduce((e,a)=>(e[a.name]=a.getValidationStatus(),e),{})}),()=>{var e;return(0,l.Wm)("form",{class:d(),onSubmit:S},[null===(e=n.default)||void 0===e?void 0:e.call(n)])}}})},79960:function(e,a,t){"use strict";t("82116"),t("17989");var l=t("80681"),n=t("62568"),o=t("78335"),r=t("20358"),i=t("22300"),s=t("95786"),[u,c]=(0,n.do)("switch"),d={size:o.Or,loading:Boolean,disabled:Boolean,modelValue:o.Vg,activeColor:String,inactiveColor:String,activeValue:{type:o.Vg,default:!0},inactiveValue:{type:o.Vg,default:!1}};a.Z=(0,l.aZ)({name:u,props:d,emits:["change","update:modelValue"],setup(e,a){var{emit:t,slots:n}=a,o=()=>e.modelValue===e.activeValue,u=()=>{if(!e.disabled&&!e.loading){var a=o()?e.inactiveValue:e.activeValue;t("update:modelValue",a),t("change",a)}},d=()=>{if(e.loading){var a=o()?e.activeColor:e.inactiveColor;return(0,l.Wm)(s.gb,{class:c("loading"),color:a},null)}if(n.node)return n.node()};return(0,i.aM)(()=>e.modelValue),()=>{var a,{size:t,loading:i,disabled:s,activeColor:v,inactiveColor:m}=e,h=o(),f={fontSize:(0,r.Nn)(t),backgroundColor:h?v:m};return(0,l.Wm)("div",{role:"switch",class:c({on:h,loading:i,disabled:s}),style:f,tabindex:s?void 0:0,"aria-checked":h,onClick:u},[(0,l.Wm)("div",{class:c("node")},[d()]),null===(a=n.background)||void 0===a?void 0:a.call(n)])}}})},21083:function(e,a,t){"use strict";t("82116"),t("17989");var l=t("80681"),n=t("62568"),o=t("78335"),r=t("12308"),i=t("20897"),s=t("96528"),u=t("97760"),c=t("95786"),[d,v]=(0,n.do)("toast"),m=["show","overlay","teleport","transition","overlayClass","overlayStyle","closeOnClickOverlay","zIndex"],h={icon:String,show:Boolean,type:(0,o.SQ)("text"),overlay:Boolean,message:o.Or,iconSize:o.Or,duration:(0,o.qM)(2e3),position:(0,o.SQ)("middle"),teleport:[String,Object],wordBreak:String,className:o.Vg,iconPrefix:String,transition:(0,o.SQ)("van-fade"),loadingType:String,forbidClick:Boolean,overlayClass:o.Vg,overlayStyle:Object,closeOnClick:Boolean,closeOnClickOverlay:Boolean,zIndex:o.Or};a.Z=(0,l.aZ)({name:d,props:h,emits:["update:show"],setup(e,a){var t,{emit:n,slots:o}=a,d=!1,h=()=>{var a=e.show&&e.forbidClick;d!==a&&(d=a,(0,i.G)(d))},f=e=>n("update:show",e),g=()=>{e.closeOnClick&&f(!1)},p=()=>clearTimeout(t),y=()=>{var{icon:a,type:t,iconSize:n,iconPrefix:o,loadingType:r}=e;return a||"success"===t||"fail"===t?(0,l.Wm)(s.JO,{name:a||t,size:n,class:v("icon"),classPrefix:o},null):"loading"===t?(0,l.Wm)(c.gb,{class:v("loading"),size:n,type:r},null):void 0},b=()=>{var{type:a,message:t}=e;return o.message?(0,l.Wm)("div",{class:v("text")},[o.message()]):(0,r.Xq)(t)&&""!==t?"html"===a?(0,l.Wm)("div",{key:0,class:v("text"),innerHTML:String(t)},null):(0,l.Wm)("div",{class:v("text")},[t]):void 0};return(0,l.YP)(()=>[e.show,e.forbidClick],h),(0,l.YP)(()=>[e.show,e.type,e.message,e.duration],()=>{p(),e.show&&e.duration>0&&(t=setTimeout(()=>{f(!1)},e.duration))}),(0,l.bv)(h),(0,l.Ah)(h),()=>(0,l.Wm)(u.GI,(0,l.dG)({class:[v([e.position,"normal"===e.wordBreak?"break-normal":e.wordBreak,{[e.type]:!e.icon}]),e.className],lockScroll:!1,onClick:g,onClosed:p,"onUpdate:show":f},(0,r.ei)(e,m)),{default:()=>[y(),b()]})}})},13118:function(e,a,t){"use strict";t.d(a,{CF:function(){return v},LJ:function(){return g},XA:function(){return f},di:function(){return h},yg:function(){return p}}),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 l=t("80681"),n=t("11848"),o=t("12308"),r=t("84285"),i=t("21083"),s=[],u=(0,o.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,o.Kn)(e)?e:{message:e}}function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!o._f)return{};var a=function(){if(!s.length){var e=function(){var{instance:e,unmount:a}=(0,r.H)({setup(){var e=(0,n.iH)(""),{open:a,state:t,close:o,toggle:s}=(0,r.o)(),u=()=>{};return(0,l.YP)(e,e=>{t.message=e}),(0,l.FN)().render=()=>(0,l.Wm)(i.Z,(0,l.dG)(t,{onClosed:u,"onUpdate:show":s}),null),{open:a,close:o,message:e}}});return e}();s.push(e)}return s[s.length-1]}(),t=d(e);return a.open((0,o.l7)({},u,c.get(t.type||u.type),t)),a}var m=e=>a=>v((0,o.l7)({type:e},d(a))),h=m("loading"),f=m("success"),g=m("fail"),p=e=>{if(s.length){if(e)s.forEach(e=>{e.close()}),s=[];else{var a;s[0].close()}}}},66754:function(e,a,t){"use strict";t.r(e.exports={})},32917:function(e,a,t){"use strict";t.r(e.exports={})}}]); |