PageSourceSearch

https://www.easy-tutor.eu/bundle/ControlSubmit-BrjJnQY4.js

js easy-tutor.eu collected 2026-09-24 18:47:52 UTC 2,877 bytes, 1 lines download raw bytes

1import{_ as R,B as c,i as f,$,o as u,e as S,c as p,w as B,b as k,t as C,u as m,ac as T,j as F,a as w,d as z,n as N,f as j,k as M,F as P,az as U,aA as D}from"./main-CGEc23yE.js";import{u as I}from"./UserFormRegistry-C5yvdllk.js";import{L as O}from"./LoadingSpinner-CMbZyu96.js";const W={class:"et-submit-loading flex-column-center"},q={key:0},G={__name:"ControlSubmit",props:{size:{type:String},color:{type:String},mode:{type:String},variant:{type:String},iconLeft:{type:String},iconColor:{type:String},iconRight:{type:String},type:{type:String,validate:e=>["submit","button"].includes(e),default:"submit"},click:{type:Function,default:()=>{}},errorRef:{type:String},errorFallback:{type:String,default:"Fehler. Bitte prüfe deine Eingaben"},disableButtonAfterSuccess:{type:Boolean,default:!0},showErrorAlert:{type:Boolean,default:!0},loadingLabel:{type:String,default:null},disabled:{type:Boolean,default:!1}},setup(e){const r=e,s=c(!1),y=c("Fehler. Bitte prüfe deine Eingaben"),d=c(!1),o=c(!1),E=f(()=>r.color!==void 0||r.mode!==void 0),L=f(()=>r.color??"classic-primary"),A=f(()=>r.variant??(E.value?void 0:"primary")),n=I.activeForm;function i(a){if(typeof a=="string"&&a.trim()){const t=a.trim(),l=/^[a-z0-9.+-]+\/[a-z0-9.+-]+(?:(?:::?\d+)|(?:\s*;.*))?$/i.test(t),V=/^\d{3}$/.test(t),x=/(?:^|\s)[a-z][a-z0-9_]*::\d+(?:\s|$)/i.test(t);return l||V||x?void 0:t}if(Array.isArray(a))return a.map(i).find(Boolean);if(a&&typeof a=="object")return Object.entries(a).filter(([t])=>!t.startsWith("__")).map(([,t])=>i(t)).find(Boolean)}const g=()=>{o.value=!1,d.value=!0,s.value=!1},b=a=>{o.value=!1,s.value=!0;let t;if(r.errorRef){const l={};U(l,a),t=D(l,r.errorRef)}y.value=i(t)??i(a)??r.errorFallback},v=()=>{d.value=!1,s.value=!1},h=()=>{o.value=!0};return n.on("success",g),n.on("error",b),n.on("change",v),n.on("submit",h),$(()=>{n.off("success",g),n.off("error",b),n.off("change",v),n.off("submit",h)}),(a,t)=>(u(),S(P,null,[s.value&&e.showErrorAlert?(u(),p(m(T),{key:0,color:"destructive"},{default:B(()=>[k(C(y.value),1)]),_:1})):F("",!0),w(m(M),{type:e.type,class:"et-form-submit","data-ett":"submit",size:e.size,color:L.value,mode:e.mode,variant:A.value,"icon-left":e.iconLeft,"icon-color":e.iconColor,"icon-right":e.iconRight,disabled:e.disabled||e.disableButtonAfterSuccess&&d.value||o.value,"aria-busy":o.value||void 0,onClick:e.click},{default:B(()=>[z("span",{class:N({"et-submit-loading-overlay":!0,"et-submit-loading-overlay--labelled":o.value&&e.loadingLabel})},[z("span",W,[o.value?(u(),p(m(O),{key:0,size:"small",text:""})):F("",!0)]),o.value&&e.loadingLabel?(u(),S("span",q,C(e.loadingLabel),1)):j(a.$slots,"default",{key:1},()=>[t[0]||(t[0]=k("Formular absenden"))],!0)],2)]),_:3},8,["type","size","color","mode","variant","icon-left","icon-color","icon-right","disabled","aria-busy","onClick"])],64))}},Q=R(G,[["__scopeId","data-v-ff7be2da"]]);export{Q as C};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.