Loheide-eu-mitarbeiterplatt.../public/build/assets/FormRenderer-D9Ou7ynT.js
Friederich Loheide ee8dde93c0
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m18s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m21s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m40s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m34s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 3m8s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 3m6s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 2m43s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 2m47s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m1s
Feste Profilfelder in Formularen, Geburtstage, anpassbare Startseite
- Formulare: Felder fest aus dem Profil (nicht änderbar, Server setzt den
  Profilwert ein), Hinweis bei fehlender Profilangabe
- Geburtstage (optionales Plugin, standardmäßig aus): Tag und Monat freiwillig
  im Profil, Kachel, Liste /geburtstage, Pagebuilder-Block, Glückwunsch am
  eigenen Geburtstag; Sichtbarkeit alle/Abteilung/Standort
- Startseite: Kacheln je Bereich sortieren und ausblenden; eigene Kacheln
  (Bild mit Link, Text, Hinweis) mit Zeitraum und Zielgruppe
- Kern: optionale mitgelieferte Plugins, Startseitenbereich „top“,
  Profilabschnitte für Plugins, Kachel-Bezeichnungen

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 09:51:19 +00:00

1 line
No EOL
9.5 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{D as e,E as t,On as n,Yt as r,Zn as i,_ as a,b as o,bt as s,g as c,mt as l,o as u,qt as d,tr as f,v as p,wt as ee,y as m}from"./runtime-core.esm-bundler-B8D2lM98.js";import{_ as te,w as h,y as ne}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{i as g,r as re}from"./app-fPqdDpbG.js";import{A as ie,j as _}from"./dist-CleIz2GP.js";import{_ as ae,b as oe,o as se}from"./http-C4J46rTq.js";import{t as v}from"./eye-off-DWbaLHNt.js";import{t as y}from"./lock-4X8Kfof0.js";import{t as b}from"./send-BevoJaJI.js";import{t as x}from"./button-SRYY3-ko.js";import{t as S}from"./NativeSelect-OH2VlOdN.js";import{t as C}from"./Input-CgjHXzkf.js";import{t as w}from"./Textarea-DWpyL-nk.js";var T=_({name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]}),E={key:0,class:`flex gap-3 rounded-lg border border-emerald-200 bg-emerald-50 p-5 text-emerald-950 dark:border-emerald-900 dark:bg-emerald-950/40 dark:text-emerald-100`,role:`status`},D={class:`font-medium whitespace-pre-line`},O={key:0,class:`mt-1 text-sm opacity-80`},k={key:1,class:`rounded-lg border bg-muted px-5 py-4 text-sm`},A={key:2,class:`rounded-lg border bg-muted px-5 py-4 text-sm`},j={key:0,class:`flex items-start gap-2 rounded-md bg-muted px-3 py-2 text-[13px] text-muted-foreground @xl:col-span-2`},M={key:1,class:`rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive @xl:col-span-2`},N={key:0,class:`pt-2 text-lg font-semibold @xl:col-span-2`},P={key:1,class:`text-sm leading-relaxed whitespace-pre-line text-muted-foreground @xl:col-span-2`},F=[`for`],I=[`id`,`onUpdate:modelValue`,`aria-invalid`],L={key:0,class:`text-destructive`},R={key:0,class:`text-destructive`},z=[`aria-labelledby`],B=[`onUpdate:modelValue`,`name`,`value`],V=[`checked`,`onChange`],ce={key:3,class:`grid gap-2`},H={key:0,class:`grid gap-1`},U={class:`min-w-0 flex-1 truncate`},W={class:`text-xs text-muted-foreground`},G=[`aria-label`,`onClick`],le={key:1,class:`flex h-10 cursor-pointer items-center justify-center gap-2 rounded-md border border-dashed text-sm text-muted-foreground hover:border-brand-300 hover:text-foreground`},ue=[`id`,`accept`,`multiple`,`onChange`],de=[`aria-describedby`],fe=[`id`],pe={key:1,class:`text-muted-foreground italic`},me={key:2,class:`text-[13px] text-destructive`},he={key:0,href:`/profil/bearbeiten`,class:`font-medium underline`},ge=[`id`],_e={key:4,class:`text-[13px] text-muted-foreground`},ve={class:`flex items-center gap-4 border-t pt-5 @xl:col-span-2`},K={__name:`FormRenderer`,props:{form:{type:Object,required:!0},compact:{type:Boolean,default:!1},preview:{type:Boolean,default:!1}},setup(_){let K=_,q=g(),ye=[`text`,`textarea`,`email`,`phone`,`number`,`date`,`select`,`radio`,`checkboxes`,`checkbox`,`file`];function be(e){let t=K.form.prefill?.[e.key];return e.type===`checkboxes`||e.type===`file`?[]:e.type===`checkbox`?!1:t??``}let J=re({answers:Object.fromEntries(K.form.fields.filter(e=>ye.includes(e.type)).map(e=>[e.key,be(e)]))}),xe=c(()=>q.props.flash?.form_submitted===K.form.id);function Y(e,t=0){if(!e.condition||t>10)return!0;let n=K.form.fields.find(t=>t.key===e.condition.field);if(!n||!Y(n,t+1))return!1;let r=J.answers[e.condition.field],i=(Array.isArray(r)?r:r===!0?[`1`]:r===!1||r===``||r==null?[]:[String(r)]).map(String),a=e.condition.value??``;switch(e.condition.operator){case`not_equals`:return!i.includes(a);case`filled`:return i.length>0;case`empty`:return i.length===0;default:return i.includes(a)}}let X=c(()=>K.form.fields.filter(e=>Y(e)));function Z(e){return J.errors[`answers.${e.key}`]??Object.entries(J.errors).find(([t])=>t.startsWith(`answers.${e.key}.`))?.[1]}function Q(e,t){let n=new Set(J.answers[e.key]);n.has(t)?n.delete(t):n.add(t),J.answers[e.key]=[...n]}function Se(e,t){let n=[...t.target.files??[]];J.answers[e.key]=e.multiple?[...J.answers[e.key],...n].slice(0,10):n.slice(0,1),t.target.value=``}function Ce(e,t){J.answers[e.key]=J.answers[e.key].filter((e,n)=>n!==t)}function we(){if(K.preview){se.info(`Vorschau – es wird nichts gesendet.`);return}let e=new Set(X.value.map(e=>e.key));J.transform(t=>({answers:Object.fromEntries(Object.entries(t.answers).filter(([t])=>e.has(t)))})).post(K.form.url,{forceFormData:!0,preserveScroll:!0,onSuccess:()=>{q.props.flash?.form_submitted===K.form.id&&J.reset()}})}let Te=e=>e>1048576?`${(e/1024/1024).toFixed(1).replace(`.`,`,`)} MB`:`${Math.max(1,Math.round(e/1024))} KB`,$=e=>`f${K.form.id}-${e.key}`;return(c,g)=>xe.value?(l(),o(`div`,E,[e(n(oe),{class:`mt-0.5 size-5 shrink-0 text-emerald-600`}),a(`div`,null,[a(`p`,D,f(_.form.confirmation),1),_.form.send_copy?(l(),o(`p`,O,`Eine Kopie Ihrer Angaben ist per E-Mail unterwegs.`)):m(``,!0)])])):_.form.already_submitted?(l(),o(`p`,k,`Sie haben dieses Formular bereits ausgefüllt. Vielen Dank!`)):_.form.open?(l(),o(`form`,{key:3,class:`grid gap-5 @xl:grid-cols-2`,novalidate:``,onSubmit:h(we,[`prevent`])},[_.form.anonymous?(l(),o(`p`,j,[e(n(v),{class:`mt-0.5 size-4 shrink-0`}),g[0]||=t(` Anonym: Ihr Name und Ihre E-Mail-Adresse werden nicht gespeichert. `,-1)])):m(``,!0),n(J).errors.form?(l(),o(`p`,M,f(n(J).errors.form),1)):m(``,!0),(l(!0),o(u,null,s(X.value,c=>(l(),o(u,{key:c.key},[c.type===`heading`?(l(),o(`h3`,N,f(c.text),1)):c.type===`paragraph`?(l(),o(`p`,P,f(c.text),1)):(l(),o(`div`,{key:2,class:i([`grid content-start gap-1.5`,c.width===`half`?``:`@xl:col-span-2`])},[c.type===`checkbox`?(l(),o(`label`,{key:0,for:$(c),class:`flex items-start gap-2.5 text-sm`},[r(a(`input`,{id:$(c),"onUpdate:modelValue":e=>n(J).answers[c.key]=e,type:`checkbox`,class:`mt-0.5 size-4 shrink-0 accent-[var(--brand)]`,"aria-invalid":!!Z(c)},null,8,I),[[te,n(J).answers[c.key]]]),a(`span`,null,[t(f(c.label),1),c.required?(l(),o(`span`,L,` *`)):m(``,!0)])],8,F)):(l(),o(u,{key:1},[(l(),p(ee([`radio`,`checkboxes`].includes(c.type)?`span`:`label`),{for:$(c),class:`text-[13px] font-medium`,id:`${$(c)}-label`},{default:d(()=>[t(f(c.label),1),c.required?(l(),o(`span`,R,` *`)):m(``,!0)]),_:2},1032,[`for`,`id`])),c.type===`textarea`?(l(),p(n(w),{key:0,id:$(c),modelValue:n(J).answers[c.key],"onUpdate:modelValue":e=>n(J).answers[c.key]=e,rows:c.rows??4,maxlength:c.max,"aria-invalid":!!Z(c)},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`rows`,`maxlength`,`aria-invalid`])):c.type===`select`?(l(),p(S,{key:1,id:$(c),modelValue:n(J).answers[c.key],"onUpdate:modelValue":e=>n(J).answers[c.key]=e,options:c.options.map(e=>({value:e,label:e})),placeholder:`Bitte wählen …`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`options`])):c.type===`radio`||c.type===`checkboxes`?(l(),o(`div`,{key:2,class:`grid gap-1.5`,role:`group`,"aria-labelledby":`${$(c)}-label`},[(l(!0),o(u,null,s(c.options,e=>(l(),o(`label`,{key:e,class:`flex items-center gap-2.5 text-sm`},[c.type===`radio`?r((l(),o(`input`,{key:0,"onUpdate:modelValue":e=>n(J).answers[c.key]=e,type:`radio`,name:$(c),value:e,class:`size-4 accent-[var(--brand)]`},null,8,B)),[[ne,n(J).answers[c.key]]]):(l(),o(`input`,{key:1,type:`checkbox`,checked:n(J).answers[c.key].includes(e),class:`size-4 accent-[var(--brand)]`,onChange:t=>Q(c,e)},null,40,V)),t(` `+f(e),1)]))),128))],8,z)):c.type===`file`?(l(),o(`div`,ce,[n(J).answers[c.key].length?(l(),o(`ul`,H,[(l(!0),o(u,null,s(n(J).answers[c.key],(t,r)=>(l(),o(`li`,{key:r,class:`flex items-center gap-2 rounded-md border bg-card px-3 py-1.5 text-sm`},[e(n(T),{class:`size-4 shrink-0 text-muted-foreground`}),a(`span`,U,f(t.name),1),a(`span`,W,f(Te(t.size)),1),a(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,"aria-label":`${t.name} entfernen`,onClick:e=>Ce(c,r)},[e(n(ae),{class:`size-3.5`})],8,G)]))),128))])):m(``,!0),c.multiple||!n(J).answers[c.key].length?(l(),o(`label`,le,[e(n(T),{class:`size-4`}),t(` `+f(c.multiple?`Dateien auswählen`:`Datei auswählen`)+` `,1),a(`input`,{id:$(c),type:`file`,class:`sr-only`,accept:c.accept,multiple:c.multiple,onChange:e=>Se(c,e)},null,40,ue)])):m(``,!0)])):c.locked?(l(),o(`div`,{key:4,class:`flex h-9 items-center gap-2 rounded-md border border-input bg-muted/60 px-3 text-sm`,"aria-describedby":`${$(c)}-locked`},[e(n(y),{class:`size-3.5 shrink-0 text-muted-foreground`}),n(J).answers[c.key]?(l(),o(`span`,{key:0,id:$(c),class:`truncate`},f(n(J).answers[c.key]),9,fe)):(l(),o(`span`,pe,f(_.preview?`wird aus dem Profil übernommen`:`nicht im Profil hinterlegt`),1))],8,de)):(l(),p(n(C),{key:5,id:$(c),modelValue:n(J).answers[c.key],"onUpdate:modelValue":e=>n(J).answers[c.key]=e,type:{email:`email`,phone:`tel`,number:`number`,date:`date`}[c.type]??`text`,placeholder:c.placeholder,maxlength:c.type===`text`?c.max:void 0,min:c.type===`number`?c.min:void 0,max:c.type===`number`?c.max:void 0,"aria-invalid":!!Z(c)},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`type`,`placeholder`,`maxlength`,`min`,`max`,`aria-invalid`]))],64)),Z(c)?(l(),o(`p`,me,[t(f(Z(c))+` `,1),c.locked?(l(),o(`a`,he,`Profil öffnen`)):m(``,!0)])):c.locked?(l(),o(`p`,{key:3,id:`${$(c)}-locked`,class:`text-[13px] text-muted-foreground`},`Aus Ihrem Profil – nicht änderbar.`,8,ge)):c.help?(l(),o(`p`,_e,[t(f(c.help),1),c.type===`file`&&c.max_size?(l(),o(u,{key:0},[t(` (höchstens `+f(c.max_size)+` MB)`,1)],64)):m(``,!0)])):m(``,!0)],2))],64))),128)),a(`div`,ve,[e(n(x),{type:`submit`,disabled:n(J).processing},{default:d(()=>[n(J).processing?(l(),p(n(ie),{key:0,class:`animate-spin`})):(l(),p(n(b),{key:1})),t(` `+f(_.form.submit_label),1)]),_:1},8,[`disabled`]),g[1]||=a(`span`,{class:`text-xs text-muted-foreground`},`* Pflichtfeld`,-1)])],32)):(l(),o(`p`,A,`Dieses Formular nimmt keine Einsendungen mehr an.`))}};export{T as n,K as t};