import{d as m,g as p,h as v,o as l,i,j as y,F as h,e as t,b as u,f as _,k as b}from"./index.9838a17e.js";import{r as w,ah as x,ac as g}from"./index.02c939b6.js";import{_ as k}from"./ElSpinner.vue_vue_type_style_index_0_lang.786c1ff1.js";const B={key:0,class:"flex items-center justify-center p-12 text-slate-300"},V={key:0,class:"amy-4 rounded-md bg-yellow-50 p-4"},E={class:"flex"},S=t("div",{class:"shrink-0"},[u(" Heroicon name: solid/exclamation "),t("svg",{class:"h-5 w-5 text-yellow-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[t("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})])],-1),F={class:"ml-3"},M={class:"text-sm font-medium text-yellow-800"},j={ref:"submit",class:"submit hidden",type:"submit",value:""},$=m({__name:"ElForm",props:{save:{type:Boolean,default:!1},valid:{type:Boolean,default:!1},data:{type:Object,default:()=>{}},notify:{type:String,default:""},loading:{type:Boolean,default:!1}},emits:["submit","update:valid"],setup(a,{emit:d}){const f=a,o=w(),r=()=>{const e=o.value;e&&e.reportValidity()&&d("submit")},n=()=>{const e=o.value;if(e){const s=e.checkValidity();d("update:valid",s)}};return p(()=>{setTimeout(()=>{n();const e=o.value;e&&e.querySelectorAll("input, select, checkbox, .f-input, textarea").forEach(c=>c.addEventListener("blur",()=>n()))},300)}),v(()=>f.data,()=>{setTimeout(()=>{n()},50)},{deep:!0}),x("submit",()=>{r()}),(e,s)=>(l(),i("form",{ref_key:"form",ref:o,class:"wrap-form",autocomplete:"on",onSubmit:s[0]||(s[0]=b(c=>r(),["prevent"]))},[a.loading?(l(),i("div",B,[y(k,{class:"h-6 w-6"})])):(l(),i(h,{key:1},[a.notify?(l(),i("div",V,[t("div",E,[S,t("div",F,[t("h3",M,g(a.notify),1)])])])):u("v-if",!0),_(e.$slots,"default"),t("input",j,null,512)],64))],544))}});export{$ as default};
