useOpen-e85fe6b6.js 1.9 KB

1
  1. /* empty css *//* empty css *//* empty css *//* empty css */import{_ as e}from"./index-10c2f342.js";import{d as t,q as a,n as s,z as l,o,c as i,a as d,aJ as n,w as u,e as r,b as c,t as m,H as p,I as f,aG as v,X as w,y,_ as h,Y as _}from"./index-9c60f3ea.js";const b={class:"flex justify-between w-full"},g=["id"],j={class:"flex w-12 justify-end"},x={class:"dialog-footer"},k=h(t({__name:"index",props:{modelValue:{type:Boolean,default:!1,require:!0},showFooter:{type:Boolean,default:!1},width:{type:String,required:!1,default:""},title:{type:String,default:""}},emits:["update:modelValue"],setup(t,{emit:h}){const _=t,k=a(!1);s((()=>k.value?"arrows-pointing-in":"arrows-pointing-out"));const V=()=>{h("update:modelValue",!1)},C=()=>{h("update:modelValue",!1)},$=a("");l((()=>{$.value=_.width?_.width:q()}));const q=()=>{const e=window.document.body.clientWidth;return e<=726?"100%":e>726&&e<1440?"60%":"650px"};return(a,s)=>{const l=e,h=w,_=y;return o(),i("div",null,[d(_,v({"model-value":t.modelValue,"show-close":!1,fullscreen:k.value},a.$attrs,{width:$.value,close:V,"before-close":C,draggable:""}),n({header:u((({titleId:e,titleClass:a})=>[r("div",b,[r("div",null,[r("h4",{id:e,class:p(a)},m(t.title),11,g)]),r("div",j,[d(l,{name:"x-mark",className:"hover:cursor-pointer w-5 h-5",onClick:V})])])])),default:u((()=>[f(a.$slots,"default",{},void 0,!0)])),_:2},[t.showFooter?{name:"footer",fn:u((()=>[r("span",x,[d(h,{onClick:V},{default:u((()=>[c(m(a.$t("system.cancel")),1)])),_:1}),d(h,{type:"primary",onClick:V},{default:u((()=>[c(m(a.$t("system.confirm")),1)])),_:1})])])),key:"0"}:void 0]),1040,["model-value","fullscreen","width"])])}}}),[["__scopeId","data-v-21105f75"]]);function V(){const e=a(!1),t=a(null),s=a("");return{open:(a=null)=>{s.value=_(a?"system.edit":"system.add"),t.value=a,e.value=!0},close:t=>{e.value=!1,t()},title:s,visible:e,id:t}}export{k as _,V as u};