1 |
- System.register(["./index-legacy-8f644dad.js"],(function(t,e){"use strict";var o,n,l,a,s,c,i,r,u,d,f,m,B,g,b,v,p,C,h,w,y,x,k,S,T,D,O,H,P,z,A,E,N,F;return{setters:[t=>{o=t.x,n=t.d,l=t.H,a=t.aY,s=t.af,c=t.E,i=t.a,r=t.w,u=t.a6,d=t.ap,f=t.aZ,m=t.ar,B=t.c,g=t.ad,b=t.B,v=t.a_,p=t.z,C=t.aq,h=t.C,w=t.a$,y=t.r,x=t.G,k=t.az,S=t.y,T=t.P,D=t.b0,O=t.b1,H=t.b2,P=t.b3,z=t.b4,A=t.am,E=t.a0,N=t.b5,F=t.b6}],execute:function(){t("b",tt);const[e,I]=o("action-bar"),U=Symbol(e),j={placeholder:Boolean,safeAreaInsetBottom:c};var q=n({name:e,props:j,setup(t,{slots:e}){const o=l(),n=a(o,I),{linkChildren:c}=s(U);c();const r=()=>{var n;return i("div",{ref:o,"class":[I(),{"van-safe-area-bottom":t.safeAreaInsetBottom}]},[null==(n=e["default"])?void 0:n.call(e)])};return()=>t.placeholder?n(r):r()}});const G=r(q),[K,L]=o("action-bar-button"),M=u({},d,{type:String,text:String,icon:String,color:String,loading:Boolean,disabled:Boolean});var R=n({name:K,props:M,setup(t,{slots:e}){const o=f(),{parent:n,index:l}=m(U),a=B((()=>{if(n){const t=n.children[l.value-1];return!(t&&"isButton"in t)}})),s=B((()=>{if(n){const t=n.children[l.value+1];return!(t&&"isButton"in t)}}));return g({isButton:!0}),()=>{const{type:n,icon:l,text:c,color:r,loading:u,disabled:d}=t;return i(b,{"class":L([n,{last:s.value,first:a.value}]),size:"large",type:n,icon:l,color:r,loading:u,disabled:d,onClick:o},{"default":()=>[e["default"]?e["default"]():c]})}}});const Y=r(R),[Z,$,_]=o("dialog"),J=u({},v,{title:String,theme:String,width:p,message:[String,Function],callback:Function,allowHtml:Boolean,className:C,transition:h("van-dialog-bounce"),messageAlign:String,closeOnPopstate:c,showCancelButton:Boolean,cancelButtonText:String,cancelButtonColor:String,cancelButtonDisabled:Boolean,confirmButtonText:String,confirmButtonColor:String,confirmButtonDisabled:Boolean,showConfirmButton:c,closeOnClickOverlay:Boolean}),Q=[...w,"transition","closeOnPopstate"];var V=t("s",n({name:Z,props:J,emits:["confirm","cancel","keydown","update:show"],setup(t,{emit:e,slots:o}){const n=l(),a=y({confirm:!1,cancel:!1}),s=t=>e("update:show",t),c=e=>{var o;s(!1),null==(o=t.callback)||o.call(t,e)},r=o=>()=>{t.show&&(e(o),t.beforeClose?(a[o]=!0,A(t.beforeClose,{args:[o],done(){c(o),a[o]=!1},canceled(){a[o]=!1}})):c(o))},u=r("cancel"),d=r("confirm"),f=D((o=>{var l,a;o.target===(null==(a=null==(l=n.value)?void 0:l.popupRef)?void 0:a.value)&&({Enter:t.showConfirmButton?d:O,Escape:t.showCancelButton?u:O}[o.key](),e("keydown",o))}),["enter","esc"]),m=()=>{const e=o.title?o.title():t.title;if(e)return i("div",{"class":$("header",{isolated:!t.message&&!o["default"]})},[e])},B=e=>{const{message:o,allowHtml:n,messageAlign:l}=t,a=$("message",{"has-title":e,[l]:l}),s=H(o)?o():o;return n&&"string"==typeof s?i("div",{"class":a,innerHTML:s},null):i("div",{"class":a},[s])},g=()=>{if(o["default"])return i("div",{"class":$("content")},[o["default"]()]);const{title:e,message:n,allowHtml:l}=t;if(n){const t=!(!e&&!o.title);return i("div",{key:l?1:0,"class":$("content",{isolated:!t})},[B(t)])}},v=()=>o.footer?o.footer():"round-button"===t.theme?i(G,{"class":$("footer")},{"default":()=>[t.showCancelButton&&i(Y,{type:"warning",text:t.cancelButtonText||_("cancel"),"class":$("cancel"),color:t.cancelButtonColor,loading:a.cancel,disabled:t.cancelButtonDisabled,onClick:u},null),t.showConfirmButton&&i(Y,{type:"danger",text:t.confirmButtonText||_("confirm"),"class":$("confirm"),color:t.confirmButtonColor,loading:a.confirm,disabled:t.confirmButtonDisabled,onClick:d},null)]}):i("div",{"class":[z,$("footer")]},[t.showCancelButton&&i(b,{size:"large",text:t.cancelButtonText||_("cancel"),"class":$("cancel"),style:{color:t.cancelButtonColor},loading:a.cancel,disabled:t.cancelButtonDisabled,onClick:u},null),t.showConfirmButton&&i(b,{size:"large",text:t.confirmButtonText||_("confirm"),"class":[$("confirm"),{[P]:t.showCancelButton}],style:{color:t.confirmButtonColor},loading:a.confirm,disabled:t.confirmButtonDisabled,onClick:d},null)]);return()=>{const{width:e,title:o,theme:l,message:a,className:c}=t;return i(T,x({ref:n,role:"dialog","class":[$([l]),c],style:{width:S(e)},tabindex:0,"aria-labelledby":o||a,onKeydown:f,"onUpdate:show":s},k(t,Q)),{"default":()=>[m(),g(),v()]})}}}));let W,X=u({},{title:"",width:"",theme:null,message:"",overlay:!0,callback:null,teleport:"body",className:"",allowHtml:!1,lockScroll:!0,transition:void 0,beforeClose:null,overlayClass:"",overlayStyle:void 0,messageAlign:"",cancelButtonText:"",cancelButtonColor:null,cancelButtonDisabled:!1,confirmButtonText:"",confirmButtonColor:null,confirmButtonDisabled:!1,showConfirmButton:!0,showCancelButton:!1,closeOnPopstate:!0,closeOnClickOverlay:!1});function tt(t){return E?new Promise(((e,o)=>{W||function(){const t={setup(){const{state:t,toggle:e}=F();return()=>i(V,x(t,{"onUpdate:show":e}),null)}};({instance:W}=N(t))}(),W.open(u({},X,t,{callback:t=>{("confirm"===t?e:o)(t)}}))})):Promise.resolve(void 0)}t("a",(t=>tt(u({showCancelButton:!0},t))))}}}));
|