import{h as B,Q as g}from"./element-plus-z3MwpXC9.js";import{d as k,r as C,n as S,H as T,o as r,c as b,a as f,I as p,V,ac as $,M as a,S as s,T as d,L as m,R as v,P as E}from"./@vue-TMcuEboY.js";import{d as h}from"./index-DXEGVToZ.js";const w=k({props:{title:{type:String,default:""},content:{type:String,default:""},confirmButtonText:{type:[String,Boolean],default:"确定"},cancelButtonText:{type:[String,Boolean],default:"取消"},width:{type:String,default:"400px"},disabled:{type:Boolean,default:!1},async:{type:Boolean,default:!1},clickModalClose:{type:Boolean,default:!1},center:{type:Boolean,default:!1},customClass:{type:String,default:""}},emits:["confirm","cancel","close","open"],setup(e,{emit:o}){const t=C(!1),c=l=>{o(l),(!e.async||l==="cancel")&&i()},i=()=>{t.value=!1,S(()=>{o("close")})},u=()=>{e.disabled||(o("open"),t.value=!0)};return T("visible",t),{visible:t,handleEvent:c,close:i,open:u}}}),N={class:"dialog"},M={class:"dialog-footer"};function P(e,o,t,c,i,u){const l=B,y=g;return r(),b("div",N,[f("div",{class:"dialog__trigger",onClick:o[0]||(o[0]=(...n)=>e.open&&e.open(...n))},[p(e.$slots,"trigger",{},void 0,!0)]),V(y,{modelValue:e.visible,"onUpdate:modelValue":o[3]||(o[3]=n=>e.visible=n),class:E(e.customClass),center:e.center,"append-to-body":!0,width:e.width,"close-on-click-modal":e.clickModalClose,onClosed:e.close},$({footer:a(()=>[f("div",M,[e.cancelButtonText?(r(),m(l,{key:0,onClick:o[1]||(o[1]=n=>e.handleEvent("cancel"))},{default:a(()=>[s(d(e.cancelButtonText),1)]),_:1})):v("",!0),e.confirmButtonText?(r(),m(l,{key:1,type:"primary",onClick:o[2]||(o[2]=n=>e.handleEvent("confirm"))},{default:a(()=>[s(d(e.confirmButtonText),1)]),_:1})):v("",!0)])]),default:a(()=>[p(e.$slots,"default",{},()=>[s(d(e.content),1)],!0)]),_:2},[e.title?{name:"header",fn:a(()=>[s(d(e.title),1)]),key:"0"}:void 0]),1032,["modelValue","class","center","width","close-on-click-modal","onClosed"])])}const H=h(w,[["render",P],["__scopeId","data-v-6aed019f"]]);export{H as P};
