feat: Add Eingabeseite 4 (Löschkonzept)
This commit is contained in:
@@ -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 || ''
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user