"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("element-plus"),m=Symbol("ModalStateToken"),y=Symbol("ModalIdToken"),v=()=>e.inject(m,{}),B=()=>e.inject(y,"");function p(){const{store:u,action:n,modalPromise:a}=v(),l=B(),r=u[l],s=i=>n==null?void 0:n.show(l,i),d=()=>n==null?void 0:n.hide(l),o=()=>n==null?void 0:n.remove(l),t=i=>a[l].resolve(i),f=i=>a[l].reject(i);return{show:s,hide:d,visible:e.toRef(r,"visible"),args:e.toRef(r,"args"),remove:o,resolve:t,reject:f}}const g=e.defineComponent({name:"FsDialog",__name:"FsDialog",props:{removeOnClosed:{type:Boolean,default:!0},appendToBody:{type:Boolean},appendTo:{},beforeClose:{},destroyOnClose:{type:Boolean},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},openDelay:{default:0},closeDelay:{default:0},top:{},modelValue:{type:Boolean},modalClass:{},width:{},zIndex:{},trapFocus:{type:Boolean},headerAriaLevel:{},center:{type:Boolean},alignCenter:{type:Boolean},closeIcon:{},draggable:{type:Boolean},overflow:{type:Boolean},fullscreen:{type:Boolean},showClose:{type:Boolean,default:!0},title:{},ariaLevel:{}},emits:["open","opened","close","closed","openAutoFocus","closeAutoFocus"],setup(u,{emit:n}){const a=u,l=n,r=()=>{l("closed",s.visible.value),a.removeOnClosed&&s.remove()},s=p();return(d,o)=>(e.openBlock(),e.createBlock(e.unref(c.ElDialog),e.mergeProps(a,{modelValue:e.unref(s).visible.value,"onUpdate:modelValue":o[0]||(o[0]=t=>e.unref(s).visible.value=t),onOpen:o[1]||(o[1]=t=>l("open",t)),onOpened:o[2]||(o[2]=t=>l("opened",t)),onCloseAutoFocus:o[3]||(o[3]=t=>l("closeAutoFocus",t)),onClose:o[4]||(o[4]=t=>l("close",t)),onClosed:r}),{header:e.withCtx(()=>[e.renderSlot(d.$slots,"header")]),footer:e.withCtx(()=>[e.renderSlot(d.$slots,"footer")]),default:e.withCtx(()=>[e.renderSlot(d.$slots,"default")]),_:3},16,["modelValue"]))}}),C={class:"dialog-footer"},b=e.defineComponent({name:"FsPopupFooter",__name:"FsPopupFooter",props:{confirmLoading:{type:Boolean},confirmText:{default:"确认"},cancelText:{default:"取消"},confirmType:{default:"primary"},cancelType:{default:"default"},confirmDisabled:{type:Boolean,default:!1},cancelDisabled:{type:Boolean,default:!1}},emits:["confirm","cancel"],setup(u,{emit:n}){const a=p(),l=o=>{a.hide(),a.resolve(o)},r=n,s=()=>{r("confirm",l)},d=()=>{r("cancel",l)};return(o,t)=>(e.openBlock(),e.createElementBlock("div",C,[e.createVNode(e.unref(c.ElButton),{type:o.cancelType,disabled:o.cancelDisabled,loading:o.confirmLoading,onClick:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.cancelText),1)]),_:1},8,["type","disabled","loading"]),e.createVNode(e.unref(c.ElButton),{type:o.confirmType,disabled:o.confirmDisabled,loading:o.confirmLoading,onClick:s},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.confirmText),1)]),_:1},8,["type","disabled","loading"])]))}});exports.FsDialog=g;exports.FsPopupFooter=b;
//# sourceMappingURL=index.js.map
