feat: Add Eingabeseite 4 (Löschkonzept)

This commit is contained in:
2026-01-22 11:37:17 +01:00
parent e7633f9bc4
commit 186ad830c1
3 changed files with 493 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
import type { FormElementDto, FormElementVisibilityCondition, VisibilityConditionOperator } from '~~/.api-client'
import { VisibilityConditionOperator as VCOperator, VisibilityConditionType as VCType } from '~~/.api-client'
import { VisibilityConditionOperator as VCOperator, VisibilityConditionType as VCType, FormElementType } from '~~/.api-client'
export function useFormElementVisibility() {
/**
@@ -65,6 +65,12 @@ export function useFormElementVisibility() {
}
function getFormElementValue(element: FormElementDto): string {
// For CHECKBOX with a single option, return the value directly
if (element.type === FormElementType.Checkbox && element.options.length === 1) {
return element.options[0]?.value || ''
}
// For other element types (RADIOBUTTON, SELECT, etc.), find the selected option and return its label
const selectedOption = element.options.find((option) => option.value === 'true')
return selectedOption?.label || ''
}