"use strict";const e=require("vue"),h=require("./BaseTransition.vue_vue_type_script_setup_true_lang-DEXehdBc.js"),C=require("./base-iCmnU-fv.js"),n=require("../Element/ClButton.cjs"),y={key:0,class:"modal-header"},w={class:"modal-title"},L={class:"modal-body"},E={key:1,class:"modal-footer"},v={key:2,class:"modal-footer-hide"},g=e.defineComponent({name:"ClModal",__name:"Index",props:{posSubmitClose:{type:String,default:"CloseSubmit",validator:t=>["CloseSubmit","SubmitClose"].indexOf(t)!==-1},className:{type:String,default:""},width:{type:String,default:"600px"},titleName:{type:String,default:""},isBackClick:{type:Boolean,default:!0},isShowHeader:{type:Boolean,default:!0},isShowFooter:{type:Boolean,default:!0},isShowSubmit:{type:Boolean,default:!0},isShowSubmitLoad:{type:Boolean,default:!0},closeLabel:{type:String,default:""},submitLabel:{type:String,default:""},classTransitionEnter:{type:String,default:"animated fadeInDown"}},emits:["onSubmit","onClose"],setup(t,{expose:S,emit:k}){const c=t,u=k,i=e.ref(null),l=e.ref(null),o=e.reactive({isLoadBackClick:!0,disabledSubmit:!1}),B=()=>{u("onSubmit")},r=()=>{u("onClose")},m=()=>{i.value&&i.value.hide()},b=()=>{c.isShowSubmitLoad&&(o.isLoadBackClick=!1),B()},d=()=>{m(),r()},f=()=>{r()};return S({show:()=>{o.disabledSubmit=!1,i.value&&i.value.show()},hide:()=>{o.isLoadBackClick=!0,c.isShowSubmitLoad&&l.value&&l.value.loadStop(),m()},loadStop:()=>{o.isLoadBackClick=!0,c.isShowSubmitLoad&&l.value&&l.value.loadStop()},disabledSubmit:a=>{const s=C.CommonBase.isBoolean(a)?a:!0;o.disabledSubmit=s}}),(a,s)=>(e.openBlock(),e.createBlock(h._sfc_main,{className:t.className,isBackClick:t.isBackClick&&o.isLoadBackClick,classTransitionEnter:t.classTransitionEnter,width:t.width,onOnClickBack:f,ref_key:"refElTransition",ref:i},{default:e.withCtx(()=>[t.isShowHeader?(e.openBlock(),e.createElementBlock("div",y,[e.createElementVNode("h4",w,e.toDisplayString(t.titleName),1),e.createElementVNode("button",{type:"button",class:"close",onClick:d},[...s[0]||(s[0]=[e.createElementVNode("i",{class:"clIconFont clIcon-close"},null,-1)])])])):e.createCommentVNode("",!0),e.createElementVNode("div",L,[e.renderSlot(a.$slots,"default")]),t.isShowFooter?(e.openBlock(),e.createElementBlock("div",E,[t.posSubmitClose==="CloseSubmit"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(n,{label:t.closeLabel||"取消",color:"grayLight",onOnClick:d},null,8,["label"]),t.isShowSubmit?(e.openBlock(),e.createBlock(n,{key:0,ref_key:"refElBtnSubmit",ref:l,disabled:o.disabledSubmit,isShowLoad:t.isShowSubmitLoad,isShowBackDrop:!0,label:t.submitLabel||"提交",onOnClick:b},null,8,["disabled","isShowLoad","label"])):e.createCommentVNode("",!0)],64)):t.posSubmitClose==="SubmitClose"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.isShowSubmit?(e.openBlock(),e.createBlock(n,{key:0,ref_key:"refElBtnSubmit",ref:l,disabled:o.disabledSubmit,isShowLoad:t.isShowSubmitLoad,isShowBackDrop:!0,label:t.submitLabel||"提交",onOnClick:b},null,8,["disabled","isShowLoad","label"])):e.createCommentVNode("",!0),e.createVNode(n,{label:t.closeLabel||"取消",color:"grayLight",onOnClick:d},null,8,["label"])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[],64))])):(e.openBlock(),e.createElementBlock("div",v))]),_:3},8,["className","isBackClick","classTransitionEnter","width"]))}});exports._sfc_main=g;
//# sourceMappingURL=Index.vue_vue_type_script_setup_true_lang-CVPvV5cZ.js.map
