From 24bb0f220f1ef6c747913de719751f14c7e716c8 Mon Sep 17 00:00:00 2001 From: Denis Lugowski Date: Fri, 23 Jan 2026 17:24:03 +0100 Subject: [PATCH] feat: Make stepper draggable and take up more width --- .../components/FormStepperWithNavigation.vue | 344 ++++++++++++++---- .../composables/useFormElementVisibility.ts | 14 +- .../application-forms/[id]/[sectionIndex].vue | 24 +- legalconsenthub/app/pages/create.vue | 38 +- 4 files changed, 315 insertions(+), 105 deletions(-) diff --git a/legalconsenthub/app/components/FormStepperWithNavigation.vue b/legalconsenthub/app/components/FormStepperWithNavigation.vue index c6bbb89..aa7e069 100644 --- a/legalconsenthub/app/components/FormStepperWithNavigation.vue +++ b/legalconsenthub/app/components/FormStepperWithNavigation.vue @@ -1,83 +1,149 @@ + + diff --git a/legalconsenthub/app/composables/useFormElementVisibility.ts b/legalconsenthub/app/composables/useFormElementVisibility.ts index 05c0099..46a3cfc 100644 --- a/legalconsenthub/app/composables/useFormElementVisibility.ts +++ b/legalconsenthub/app/composables/useFormElementVisibility.ts @@ -1,5 +1,9 @@ import type { FormElementDto, FormElementVisibilityCondition, VisibilityConditionOperator } from '~~/.api-client' -import { VisibilityConditionOperator as VCOperator, VisibilityConditionType as VCType, FormElementType } from '~~/.api-client' +import { + VisibilityConditionOperator as VCOperator, + VisibilityConditionType as VCType, + FormElementType +} from '~~/.api-client' export function useFormElementVisibility() { /** @@ -60,13 +64,13 @@ export function useFormElementVisibility() { // Special handling for CHECKBOX with multiple options if (sourceElement.type === FormElementType.Checkbox && sourceElement.options.length > 1) { const operator = condition.formElementOperator || VCOperator.Equals - const conditionMet = evaluateCheckboxCondition(sourceElement, condition.formElementExpectedValue, operator) + const conditionMet = evaluateCheckboxCondition(sourceElement, condition.formElementExpectedValue || '', operator) return condition.formElementConditionType === VCType.Show ? conditionMet : !conditionMet } const sourceValue = getFormElementValue(sourceElement) const operator = condition.formElementOperator || VCOperator.Equals - const conditionMet = evaluateCondition(sourceValue, condition.formElementExpectedValue, operator) + const conditionMet = evaluateCondition(sourceValue, condition.formElementExpectedValue || '', operator) return condition.formElementConditionType === VCType.Show ? conditionMet : !conditionMet } @@ -91,9 +95,7 @@ export function useFormElementVisibility() { expectedValue: string, operator: VisibilityConditionOperator ): boolean { - const selectedLabels = element.options - .filter((option) => option.value === 'true') - .map((option) => option.label) + const selectedLabels = element.options.filter((option) => option.value === 'true').map((option) => option.label) switch (operator) { case VCOperator.Equals: diff --git a/legalconsenthub/app/pages/application-forms/[id]/[sectionIndex].vue b/legalconsenthub/app/pages/application-forms/[id]/[sectionIndex].vue index b8283b8..d926ef6 100644 --- a/legalconsenthub/app/pages/application-forms/[id]/[sectionIndex].vue +++ b/legalconsenthub/app/pages/application-forms/[id]/[sectionIndex].vue @@ -30,19 +30,17 @@ diff --git a/legalconsenthub/app/pages/create.vue b/legalconsenthub/app/pages/create.vue index 2cdf7e4..91e63f5 100644 --- a/legalconsenthub/app/pages/create.vue +++ b/legalconsenthub/app/pages/create.vue @@ -15,26 +15,24 @@