felicity-lims/felicity/templates/static/assets/SimpleModal-0c0664c5.js
2024-04-21 12:22:39 +02:00

1 line
1.7 KiB
JavaScript

import{d as i,N as c,k as p,z as u,o as m,c as _,b as o,w as f,y as h,ap as s,H as d,g as v,I as b,J as y}from"./index-2a6c9271.js";const w=i({name:"simple-modal",props:{contentWidth:String},setup(e,{emit:t}){return c(()=>{document.addEventListener("keydown",n=>{n.keyCode==27&&t("close")})}),{}}});const r=e=>(b("data-v-026c1294"),e=e(),y(),e),$={class:"modal-mask"},k={class:"modal-wrapper"},C={class:"modal-header"},S={class:"flex justify-between"},x=r(()=>o("hr",null,null,-1)),I={class:"modal-body"},g=r(()=>o("hr",null,null,-1)),M={class:"modal-footer"},N={class:"flex justify-end"};function j(e,t,n,B,V,W){const l=u("font-awesome-icon");return m(),_("div",$,[o("div",k,[o("div",{onClick:t[2]||(t[2]=f(()=>{},["stop"])),class:h(["modal-container max-h-screen overflow-y-scroll",e.contentWidth?e.contentWidth:"w-1/2"])},[o("div",C,[o("div",S,[s(e.$slots,"header",{},()=>[d("default header")],!0),o("button",{onClick:t[0]||(t[0]=a=>e.$emit("close")),class:"ml-4 inline-flex items-center justify-center w-8 h-8 mr-2 text-red-500 transition-colors duration-150 bg-white rounded-full border-red-200 border focus:outline-none hover:border-red-500"},[v(l,{icon:"times"})])])]),x,o("div",I,[s(e.$slots,"body",{},()=>[d("default body")],!0)]),g,o("div",M,[s(e.$slots,"footer",{},()=>[o("div",N,[o("button",{class:"modal-default-button text-red-500 border-red-200 border rounded py-1 px-2 transition-colors hover:outline-none hover:border-red-500",onClick:t[1]||(t[1]=a=>e.$emit("close"))}," Cancel ")])],!0)])],2)])])}const D=p(w,[["render",j],["__scopeId","data-v-026c1294"],["__file","/home/aurthur/Documents/Development/felicity-lims/webapp/components/SimpleModal.vue"]]);export{D as default};