Loheide-eu-mitarbeiterplatt.../public/build/assets/PollForm-115v-DG4.js
Friederich Loheide 03e31f42b5
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 7m38s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 8m0s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 11m51s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 12m15s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 13m27s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 13m42s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 16m0s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 15m20s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 56s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m14s
Noch schneller (0.46.0)
- Erscheinungsbild: große Fotos (Anmeldung, Titelbild) beim Speichern als WebP
  ≤ 2400 px; Migration verkleinert vorhandene einmal
- Vite: Grundgerüst und UI-Bausteine als gemeinsame Dateien (Startseite 34 statt
  58 Skripte)
- Plugin-Oberflächen: Kopie nach public/ erneuert sich bei neuem Build
  (Fingerabdruck von dist/inhaus.json), auch ohne neue Version

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

1 line
No EOL
7.2 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{At as e,Ot as t,P as n,j as r}from"./ui-DTELwomD.js";import{C as i,O as a,Ot as o,S as s,T as c,Y as l,a as u,d,g as f,k as p,kt as m,ot as h,q as g,st as _,v,w as y,wt as b,x}from"./framework-CFqPLBV8.js";import{t as S}from"./lock-Dh55WMD5.js";var C={class:`grid gap-6`},w={class:`text-sm text-muted-foreground`},T={class:`text-sm font-semibold`},E={key:0,class:`text-muted-foreground`},D={key:0,class:`grid gap-2.5`},O={class:`flex items-baseline justify-between gap-3 text-sm`},k={class:`min-w-0`},A={class:`shrink-0 text-muted-foreground tabular-nums`},j={key:0,class:`text-xs`},M={class:`h-2 overflow-hidden rounded-full bg-muted`},N={key:1,class:`grid gap-2`},P={class:`text-sm`},F={class:`font-semibold tabular-nums`},I={class:`text-muted-foreground`},L=[`aria-label`],R=[`title`],z={class:`text-[11px] text-muted-foreground tabular-nums`},B={key:0,class:`flex justify-between text-[11px] text-muted-foreground`},V={class:`text-sm text-muted-foreground`},H={key:0,class:`grid max-h-80 gap-2 overflow-y-auto`},ee={__name:`PollResults`,props:{results:{type:Object,required:!0},compact:{type:Boolean,default:!1}},setup(e){return(t,n)=>(g(),c(`div`,C,[s(`p`,w,m(e.results.total)+` `+m(e.results.total===1?`Teilnahme`:`Teilnahmen`),1),(g(!0),c(v,null,l(e.results.questions,(t,r)=>(g(),c(`section`,{key:t.id,class:`grid gap-3`},[s(`h3`,T,[e.results.questions.length>1?(g(),c(`span`,E,m(r+1)+`. `,1)):y(``,!0),a(m(t.label),1)]),t.options?(g(),c(`ul`,D,[(g(!0),c(v,null,l(t.options,t=>(g(),c(`li`,{key:t.id,class:`grid gap-1`},[s(`div`,O,[s(`span`,k,m(t.label),1),s(`span`,A,[a(m(t.percent)+` %`,1),e.compact?y(``,!0):(g(),c(`span`,j,` · `+m(t.votes),1))])]),s(`div`,M,[s(`div`,{class:`h-full rounded-full bg-brand transition-[width] duration-500`,style:o({width:`${t.percent}%`})},null,4)])]))),128))])):t.type===`scale`?(g(),c(`div`,N,[s(`p`,P,[n[0]||=a(`Durchschnitt: `,-1),s(`span`,F,m(t.average===null?`–`:t.average.toLocaleString(`de-DE`)),1),n[1]||=a(),s(`span`,I,`von `+m(t.scale),1)]),s(`div`,{class:`flex h-20 items-end gap-1`,role:`img`,"aria-label":`Verteilung der Antworten von 1 bis ${t.scale}`},[(g(!0),c(v,null,l(t.distribution,e=>(g(),c(`div`,{key:e.value,class:`flex flex-1 flex-col items-center gap-1`},[s(`div`,{class:`w-full rounded-t-sm bg-brand/75`,style:o({height:`${t.answered?Math.max(3,e.votes/Math.max(...t.distribution.map(e=>e.votes),1)*56):3}px`}),title:`${e.value}: ${e.votes}`},null,12,R),s(`span`,z,m(e.value),1)]))),128))],8,L),t.min_label||t.max_label?(g(),c(`div`,B,[s(`span`,null,m(t.min_label),1),s(`span`,null,m(t.max_label),1)])):y(``,!0)])):t.type===`text`?(g(),c(v,{key:2},[s(`p`,V,m(t.answered)+` `+m(t.answered===1?`Antwort`:`Antworten`),1),t.texts?.length?(g(),c(`ul`,H,[(g(!0),c(v,null,l(t.texts,(e,t)=>(g(),c(`li`,{key:t,class:`rounded-md bg-muted/60 px-3 py-2 text-sm whitespace-pre-line`},m(e),1))),128))])):y(``,!0)],64)):y(``,!0)]))),128))]))}},U=[`disabled`],W={class:`mb-2.5 text-sm font-semibold`},G={key:0,class:`text-muted-foreground`},K={key:1,class:`font-normal text-muted-foreground`},q={key:2,class:`block text-xs font-normal text-muted-foreground`},J=[`onUpdate:modelValue`,`name`,`value`],Y=[`checked`,`onChange`],X={key:1,class:`grid gap-1.5`},Z={class:`flex flex-wrap gap-1.5`},Q=[`onUpdate:modelValue`,`name`,`value`],$={key:3,class:`text-[13px] text-destructive`},te={key:0,class:`text-[13px] text-destructive`},ne={class:`flex flex-wrap items-center gap-3`},re={key:0,class:`inline-flex items-center gap-1.5 text-xs text-muted-foreground`},ie={key:0,class:`mb-5 flex items-center gap-2 text-sm font-medium text-brand-text`},ae={key:1,class:`mb-5 text-sm text-muted-foreground`},oe={key:3,class:`text-sm text-muted-foreground`},se={__name:`PollForm`,props:{poll:{type:Object,required:!0},compact:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(C){let w=C,T=u({answers:Object.fromEntries(w.poll.questions.map(e=>[e.id,e.type===`multiple`?[]:null]))});function E(e,t){let n=T.answers[e.id],r=n.indexOf(t);r>=0?n.splice(r,1):(!e.max||n.length<e.max)&&n.push(t)}let D=x(()=>w.poll.questions.every(e=>{let t=T.answers[e.id];return!e.required||(Array.isArray(t)?t.length:t!==null&&t!==``)}));function O(){T.post(`/umfragen/${w.poll.id}/abstimmen`,{preserveScroll:!0})}let k=x(()=>T.errors.answers??null);return(u,x)=>(g(),c(`div`,null,[C.poll.can_vote?(g(),c(`form`,{key:0,class:`grid gap-6`,onSubmit:f(O,[`prevent`])},[(g(!0),c(v,null,l(C.poll.questions,(e,t)=>(g(),c(`fieldset`,{key:e.id,class:`grid gap-2.5`,disabled:C.disabled},[s(`legend`,W,[C.poll.questions.length>1?(g(),c(`span`,G,m(t+1)+`. `,1)):y(``,!0),a(m(e.label)+` `,1),e.required?y(``,!0):(g(),c(`span`,K,` (optional)`)),e.type===`multiple`?(g(),c(`span`,q,m(e.max?`Bis zu ${e.max} Antworten`:`Mehrere Antworten möglich`),1)):y(``,!0)]),e.type===`single`||e.type===`multiple`?(g(!0),c(v,{key:0},l(e.options,t=>(g(),c(`label`,{key:t.id,class:`flex cursor-pointer items-center gap-3 rounded-md border px-3.5 py-2.5 text-sm transition-colors hover:bg-accent/50 has-[:checked]:border-brand has-[:checked]:bg-brand-soft`},[e.type===`single`?_((g(),c(`input`,{key:0,"onUpdate:modelValue":t=>b(T).answers[e.id]=t,type:`radio`,name:`q-${C.poll.id}-${e.id}`,value:t.id,class:`size-4 accent-[var(--color-brand)]`},null,8,J)),[[d,b(T).answers[e.id]]]):(g(),c(`input`,{key:1,type:`checkbox`,checked:b(T).answers[e.id].includes(t.id),class:`size-4 accent-[var(--color-brand)]`,onChange:n=>E(e,t.id)},null,40,Y)),a(` `+m(t.label),1)]))),128)):e.type===`scale`?(g(),c(`div`,X,[s(`div`,Z,[(g(!0),c(v,null,l(e.scale,t=>(g(),c(`label`,{key:t,class:`grid size-10 cursor-pointer place-items-center rounded-md border text-sm font-medium tabular-nums transition-colors hover:bg-accent/50 has-[:checked]:border-brand has-[:checked]:bg-brand has-[:checked]:text-brand-foreground`},[_(s(`input`,{"onUpdate:modelValue":t=>b(T).answers[e.id]=t,type:`radio`,name:`q-${C.poll.id}-${e.id}`,value:t,class:`sr-only`},null,8,Q),[[d,b(T).answers[e.id]]]),a(` `+m(t),1)]))),128))]),e.min_label||e.max_label?(g(),c(`div`,{key:0,class:`flex justify-between gap-3 text-xs text-muted-foreground`,style:o({maxWidth:`${e.scale*2.5+(e.scale-1)*.375}rem`})},[s(`span`,null,`1 = `+m(e.min_label),1),s(`span`,null,m(e.scale)+` = `+m(e.max_label),1)],4)):y(``,!0)])):(g(),i(b(r),{key:2,modelValue:b(T).answers[e.id],"onUpdate:modelValue":t=>b(T).answers[e.id]=t,rows:`3`,maxlength:`2000`},null,8,[`modelValue`,`onUpdate:modelValue`])),b(T).errors[`answers.${e.id}`]?(g(),c(`p`,$,m(b(T).errors[`answers.${e.id}`]),1)):y(``,!0)],8,U))),128)),k.value?(g(),c(`p`,te,m(k.value),1)):y(``,!0),s(`div`,ne,[p(b(n),{type:`submit`,disabled:b(T).processing||!D.value||C.disabled},{default:h(()=>[b(T).processing?(g(),i(b(t),{key:0,class:`animate-spin`})):y(``,!0),x[0]||=a(` Abstimmen `,-1)]),_:1},8,[`disabled`]),C.poll.anonymous?(g(),c(`span`,re,[p(b(S),{class:`size-3.5`}),x[1]||=a(` Anonym – Ihre Antworten werden ohne Namen gespeichert.`,-1)])):y(``,!0)])],32)):(g(),c(v,{key:1},[C.poll.voted?(g(),c(`p`,ie,[p(b(e),{class:`size-4`}),x[2]||=a(` Sie haben teilgenommen – danke!`,-1)])):C.poll.open?y(``,!0):(g(),c(`p`,ae,`Diese Umfrage ist beendet.`)),C.poll.results?(g(),i(ee,{key:2,results:C.poll.results,compact:C.compact},null,8,[`results`,`compact`])):C.poll.results_note?(g(),c(`p`,oe,m(C.poll.results_note),1)):y(``,!0)],64))]))}};export{se as t};