diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 237966a..e9766ce 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -120,6 +120,27 @@ + + + + + + + + + + diff --git a/frontend/src/components/ConfirmDialog.vue b/frontend/src/components/ConfirmDialog.vue new file mode 100644 index 0000000..0298d6c --- /dev/null +++ b/frontend/src/components/ConfirmDialog.vue @@ -0,0 +1,209 @@ + + + + + + diff --git a/frontend/src/components/DIALOG_TEMPLATES.md b/frontend/src/components/DIALOG_TEMPLATES.md new file mode 100644 index 0000000..b600ea8 --- /dev/null +++ b/frontend/src/components/DIALOG_TEMPLATES.md @@ -0,0 +1,414 @@ +# Dialog-Templates Dokumentation + +## Übersicht + +Das Dialog-System bietet wiederverwendbare Templates für modale und nicht-modale Dialoge. + +## Komponenten + +### 1. BaseDialog.vue + +Die Basis-Komponente für alle Dialoge. Unterstützt sowohl modale als auch nicht-modale Dialoge. + +#### Props + +| Prop | Typ | Default | Beschreibung | +|------|-----|---------|--------------| +| `modelValue` | Boolean | `false` | v-model Binding für Sichtbarkeit | +| `isModal` | Boolean | `true` | Modaler Dialog (mit Overlay) oder nicht-modal | +| `title` | String | - | Dialog-Titel (erforderlich) | +| `size` | String | `'medium'` | Größe: `'small'`, `'medium'`, `'large'`, `'fullscreen'` | +| `position` | Object | `{ x: 100, y: 100 }` | Position für nicht-modale Dialoge | +| `zIndex` | Number | `1000` | z-Index des Dialogs | +| `closable` | Boolean | `true` | Schließen-Button anzeigen | +| `minimizable` | Boolean | `false` | Minimieren-Button anzeigen | +| `draggable` | Boolean | `true` | Dialog verschiebbar (nur nicht-modal) | +| `closeOnOverlay` | Boolean | `true` | Bei Klick auf Overlay schließen (nur modal) | + +#### Events + +| Event | Parameter | Beschreibung | +|-------|-----------|--------------| +| `update:modelValue` | Boolean | Wird beim Öffnen/Schließen gefeuert | +| `close` | - | Wird beim Schließen gefeuert | +| `minimize` | - | Wird beim Minimieren gefeuert | +| `focus` | - | Wird bei Klick auf nicht-modalen Dialog gefeuert | +| `update:position` | Object | Neue Position nach Verschieben | + +#### Slots + +| Slot | Beschreibung | +|------|--------------| +| `default` | Dialog-Inhalt | +| `header-actions` | Zusätzliche Aktionen im Header | +| `footer` | Dialog-Footer (optional) | + +#### Beispiel: Modaler Dialog + +```vue + + + +``` + +#### Beispiel: Nicht-modaler Dialog + +```vue + + + +``` + +## 2. ConfirmDialog.vue + +Spezialisierter Dialog für Bestätigungen. + +#### Props + +| Prop | Typ | Default | Beschreibung | +|------|-----|---------|--------------| +| `modelValue` | Boolean | `false` | v-model Binding | +| `title` | String | `'Bestätigung'` | Dialog-Titel | +| `message` | String | - | Hauptnachricht (erforderlich) | +| `details` | String | `''` | Zusätzliche Details | +| `type` | String | `'info'` | Typ: `'info'`, `'warning'`, `'danger'`, `'success'` | +| `confirmText` | String | `'OK'` | Text für Bestätigen-Button | +| `cancelText` | String | `'Abbrechen'` | Text für Abbrechen-Button | +| `showCancel` | Boolean | `true` | Abbrechen-Button anzeigen | + +#### Events + +| Event | Beschreibung | +|-------|--------------| +| `confirm` | Wird bei Bestätigung gefeuert | +| `cancel` | Wird bei Abbruch gefeuert | + +#### Beispiel + +```vue + + + +``` + +## 3. ImageDialog.vue + +Einfacher Dialog zur Anzeige von Bildern. + +#### Props + +| Prop | Typ | Default | Beschreibung | +|------|-----|---------|--------------| +| `modelValue` | Boolean | `false` | v-model Binding | +| `title` | String | `'Bild'` | Dialog-Titel | +| `imageUrl` | String | `''` | URL des anzuzeigenden Bildes | + +#### Events + +| Event | Beschreibung | +|-------|--------------| +| `close` | Wird beim Schließen gefeuert | + +#### Beispiel + +```vue + + + +``` + +## 4. ImageViewerDialog.vue + +Erweiterter Bild-Dialog mit Aktionen (Drehen, Zoom). + +#### Props + +| Prop | Typ | Default | Beschreibung | +|------|-----|---------|--------------| +| `modelValue` | Boolean | `false` | v-model Binding | +| `title` | String | `'Bild'` | Dialog-Titel | +| `imageUrl` | String | `''` | URL des anzuzeigenden Bildes | +| `memberId` | Number/String | `null` | ID des zugehörigen Members (optional) | +| `showActions` | Boolean | `true` | Aktions-Buttons anzeigen | +| `allowRotate` | Boolean | `true` | Drehen-Buttons anzeigen | +| `allowZoom` | Boolean | `false` | Zoom-Button anzeigen | + +#### Events + +| Event | Parameter | Beschreibung | +|-------|-----------|--------------| +| `close` | - | Wird beim Schließen gefeuert | +| `rotate` | Object | Wird beim Drehen gefeuert: `{ direction, memberId, rotation }` | + +#### Beispiel + +```vue + + + +``` + +## 5. Composables + +### useDialog() + +Einfaches Composable für Dialog-Verwaltung. + +```javascript +import { useDialog } from '@/composables/useDialog.js'; + +const { isOpen, open, close, toggle } = useDialog(); + +// Dialog öffnen +open(); + +// Dialog schließen +close(); + +// Dialog umschalten +toggle(); +``` + +## useConfirm() + +Promise-basiertes Composable für Bestätigungsdialoge. + +```javascript +import { useConfirm } from '@/composables/useDialog.js'; + +const { isOpen, config, confirm, handleConfirm, handleCancel } = useConfirm(); + +// Im Template: + + +// In Methoden: +async function deleteItem() { + const confirmed = await confirm({ + title: 'Löschen bestätigen', + message: 'Wirklich löschen?', + type: 'danger' + }); + + if (confirmed) { + // Löschvorgang durchführen + } +} +``` + +## Dialog-Größen + +| Größe | Breite | Beschreibung | +|-------|--------|--------------| +| `small` | 400px | Kleine Dialoge (z.B. Bestätigungen) | +| `medium` | 600px | Standard-Dialoge | +| `large` | 900px | Große Dialoge mit viel Inhalt | +| `fullscreen` | 90vw x 90vh | Fast Fullscreen | + +## Best Practices + +### Modale Dialoge verwenden für: +- Wichtige Benutzer-Entscheidungen +- Formulare, die Fokus erfordern +- Warnungen und Fehler +- Prozesse, die nicht unterbrochen werden sollten + +### Nicht-modale Dialoge verwenden für: +- Zusätzliche Informationen +- Tools und Paletten +- Mehrere gleichzeitige Arbeitsschritte +- Drag & Drop-Workflows + +### Tipps + +1. **Minimieren-Funktion**: Nur bei nicht-modalen Dialogen sinnvoll +2. **closeOnOverlay**: Bei wichtigen Formularen auf `false` setzen +3. **z-Index**: Bei mehreren nicht-modalen Dialogen unterschiedliche z-Indices verwenden +4. **Footer-Slot**: Für Aktions-Buttons verwenden +5. **header-actions**: Für kontextspezifische Header-Aktionen + +## Styling + +Die Dialoge verwenden CSS-Variablen für konsistentes Styling: + +- `--primary-color`: Primärfarbe für Header und Buttons +- `--primary-hover`: Hover-Farbe +- `--border-color`: Rahmenfarbe +- `--text-color`: Textfarbe +- `--text-muted`: Gedämpfte Textfarbe + +## Migration bestehender Dialoge + +### Alt (individueller Dialog): +```vue + +``` + +### Neu (BaseDialog): +```vue + + Inhalt + +``` + +## Beispiele ansehen + +Die Datei `DialogExamples.vue` enthält vollständige Beispiele für alle Dialog-Typen. + +Route hinzufügen in `router.js`: +```javascript +import DialogExamples from './components/DialogExamples.vue'; + +{ path: '/dialog-examples', component: DialogExamples } +``` + diff --git a/frontend/src/components/DialogExamples.vue b/frontend/src/components/DialogExamples.vue new file mode 100644 index 0000000..11e4fbe --- /dev/null +++ b/frontend/src/components/DialogExamples.vue @@ -0,0 +1,469 @@ + + + + + + diff --git a/frontend/src/components/ImageDialog.vue b/frontend/src/components/ImageDialog.vue new file mode 100644 index 0000000..a3137ba --- /dev/null +++ b/frontend/src/components/ImageDialog.vue @@ -0,0 +1,125 @@ + + + + + + diff --git a/frontend/src/components/ImageViewerDialog.vue b/frontend/src/components/ImageViewerDialog.vue new file mode 100644 index 0000000..ab0fa26 --- /dev/null +++ b/frontend/src/components/ImageViewerDialog.vue @@ -0,0 +1,259 @@ + + + + + + diff --git a/frontend/src/components/InfoDialog.vue b/frontend/src/components/InfoDialog.vue new file mode 100644 index 0000000..1cc9e78 --- /dev/null +++ b/frontend/src/components/InfoDialog.vue @@ -0,0 +1,229 @@ + + + + + + diff --git a/frontend/src/components/SeasonSelector.vue b/frontend/src/components/SeasonSelector.vue index f806c61..100b6e0 100644 --- a/frontend/src/components/SeasonSelector.vue +++ b/frontend/src/components/SeasonSelector.vue @@ -40,6 +40,27 @@ + + + + + + +