var W=Object.defineProperty,q=Object.defineProperties;var G=Object.getOwnPropertyDescriptors;var I=Object.getOwnPropertySymbols;var Q=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var T=(e,n,o)=>n in e?W(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,u=(e,n)=>{for(var o in n||(n={}))Q.call(n,o)&&T(e,o,n[o]);if(I)for(var o of I(n))X.call(n,o)&&T(e,o,n[o]);return e},M=(e,n)=>q(e,G(n));var V=(e,n,o)=>new Promise((C,r)=>{var s=i=>{try{a(o.next(i))}catch(f){r(f)}},d=i=>{try{a(o.throw(i))}catch(f){r(f)}},a=i=>i.done?C(i.value):Promise.resolve(i.value).then(s,d);a((o=o.apply(e,n)).next())});import{d as Y,f as k,e as O,u as t,z as Z,g as x,h as $,w as ee,U as v,a2 as P,ad as R,aj as j,af as c,a3 as le,k as b,V as ne,ae as H,ai as w,ak as _,al as D,ag as E}from"./vue-vendor-CxLCUzY4.js";import{b as oe,d as ae,a as te,c as se,M as ie}from"./ModalHeader-DIFQSP_0.js";import{o as B,aH as ce,aI as ue,T as re,aA as de}from"./antd-vue-vendor-CahNzUUa.js";import{ag as fe,al as me,l as pe,K as ve,_ as ge}from"./index-CLZzJyTP.js";const he=Y({name:"JModal",methods:{omit:B},components:{CloseOutlined:de,Tooltip:re,FullscreenExitOutlined:ue,FullscreenOutlined:ce,ModalHeader:ie,ModalClose:se,ModalFooter:te,Modal:ae},props:u({fullscreen:{type:Boolean,default:!1}},oe),emits:["visible-change","open-change","height-change","cancel","ok","register","update:visible","update:open","fullScreen"],setup(e,{emit:n,attrs:o,slots:C}){const{getIsMobile:r}=fe(),s=k(!1),d=k(null),a=k(e.fullscreen),i=k(!1),{t:f}=ve(),S=k({height:e.maxHeight?e.maxHeight:"600px","overflow-y":"auto"}),g={setModalProps:U,emitVisible:void 0},m=O(()=>{const l=u(u({},e),t(d));return r.value&&(l.fullscreen=!1),l}),p=O(()=>{const l=M(u(u({},o),t(m)),{open:t(s),wrapClassName:t(h)});return t(a)?B(l,["height","visible"]):B(l,["visible"])}),h=O(()=>{const l=Z(m.value,"wrapClassName").value||"";return t(a)?`jeecg-full-screen-modal-code-generate ${l} `:t(l)}),z=O(()=>{const l=M(u({},t(m)),{visible:t(s),okButtonProps:void 0,cancelButtonProps:void 0,title:void 0});return M(u({},l),{wrapClassName:t(h)})}),y=x();y&&n("register",g,y.uid);function J(){return!t(m).title&&!C.title}function N(l){l==null||l.stopPropagation(),l==null||l.preventDefault(),a.value=!t(a)}function A(l){return V(this,null,function*(){if(l==null||l.stopPropagation(),e.closeFunc&&pe(e.closeFunc)){const F=yield e.closeFunc();s.value=!F;return}s.value=!1,n("cancel",l)})}function K(l){n("ok",l)}function L(l){e.fullscreen&&(l.stopPropagation(),N(l))}function U(l){d.value=me(t(d)||{},l),Reflect.has(l,"visible")&&(s.value=!!l.visible),Reflect.has(l,"open")&&(s.value=!!l.open),Reflect.has(l,"defaultFullscreen")&&(a.value=!!l.defaultFullscreen,r.value&&(a.value=!0))}return $(()=>{a.value=e.fullscreen,r.value&&(a.value=!0)}),$(()=>{s.value=!!e.visible}),$(()=>{s.value=!!e.open}),ee(()=>t(s),l=>{var F;n("visible-change",l),n("open-change",l),n("update:visible",l),n("update:open",l),y&&((F=g.emitVisible)==null||F.call(g,l,y.uid))},{immediate:!1}),{isNoTitle:J,getBindValue:p,fullScreenRef:a,handleFullScreen:N,fullScreen:i,t:f,handleCancel:A,handleOk:K,getProps:z,getMergeProps:m,handleTitleDbClick:L,bodyStyle:S}}}),be={key:0,class:"jeecg-basic-modal-close"};function ke(e,n,o,C,r,s){const d=v("FullscreenExitOutlined"),a=v("Tooltip"),i=v("FullscreenOutlined"),f=v("CloseOutlined"),S=v("ModalHeader"),g=v("ModalFooter"),m=v("a-modal");return P(),R(m,E(e.getBindValue,{onCancel:e.handleCancel,"body-style":e.fullScreenRef?{}:e.bodyStyle}),j({default:c(()=>[w(e.$slots,"default",{},void 0,!0)]),_:2},[e.$slots.closeIcon?void 0:{name:"closeIcon",fn:c(()=>[e.canFullscreen?(P(),le("div",be,[e.fullScreenRef?(P(),R(a,{key:0,title:e.t("component.modal.restore"),placement:"bottom"},{default:c(()=>[b(d,{role:"full",onClick:e.handleFullScreen},null,8,["onClick"])]),_:1},8,["title"])):(P(),R(a,{key:1,title:e.t("component.modal.maximize"),placement:"bottom"},{default:c(()=>[b(i,{role:"close",onClick:e.handleFullScreen},null,8,["onClick"])]),_:1},8,["title"])),b(a,{title:e.t("component.modal.close"),placement:"bottom"},{default:c(()=>[b(f,{onClick:e.handleCancel},null,8,["onClick"])]),_:1},8,["title"])])):ne("",!0)]),key:"0"},e.isNoTitle?void 0:{name:"title",fn:c(()=>[b(S,{helpMessage:e.getProps.helpMessage,title:e.getMergeProps.title,onDblclick:e.handleTitleDbClick},null,8,["helpMessage","title","onDblclick"])]),key:"1"},e.$slots.footer?void 0:{name:"footer",fn:c(()=>[b(g,E(e.getBindValue,{onOk:e.handleOk,onCancel:e.handleCancel}),j({_:2},[H(Object.keys(e.$slots),p=>({name:p,fn:c(h=>[w(e.$slots,p,_(D(h||{})),void 0,!0)])}))]),1040,["onOk","onCancel"])]),key:"2"},H(Object.keys(e.omit(e.$slots,"default")),p=>({name:p,fn:c(h=>[w(e.$slots,p,_(D(h||{})),void 0,!0)])}))]),1040,["onCancel","body-style"])}const Pe=ge(he,[["render",ke],["__scopeId","data-v-96f4c571"]]);export{Pe as J};
