diff --git a/components/ComponentPreview.vue b/components/ComponentPreview.vue index f1841c6..8c01205 100644 --- a/components/ComponentPreview.vue +++ b/components/ComponentPreview.vue @@ -873,7 +873,7 @@ const props = defineProps({ } }); -const emit = defineEmits(['select-nested-component', 'form-data-updated']); +const emit = defineEmits(['select-nested-component', 'form-data-updated', 'button-clicked']); // Get access to the form builder store const formStore = useFormBuilderStore(); @@ -1445,7 +1445,17 @@ const handleButtonClick = () => { } } + // Emit button click event for workflow processing + emit('button-clicked', { + buttonName: props.component.props.name, + buttonLabel: props.component.props.label, + buttonText: props.component.props.buttonText || props.component.props.label, + buttonType: props.component.props.buttonType || 'button', + timestamp: new Date().toISOString() + }); + // Default behavior - log the button click + console.log('[ComponentPreview] Button clicked:', props.component.props.name); }; // Check if the component is a standard FormKit input type (excluding specialized components) diff --git a/components/process-flow/FormNodeConfiguration.vue b/components/process-flow/FormNodeConfiguration.vue index ebb8219..f798fae 100644 --- a/components/process-flow/FormNodeConfiguration.vue +++ b/components/process-flow/FormNodeConfiguration.vue @@ -242,6 +242,127 @@ + + +
Assign button click events to process variables
++ No button mappings defined. Button clicks will not be tracked in process variables. +
++ {{ formButtons.length === 0 ? 'No form buttons available' : 'The source button in the form' }} +
++ The target variable to store button click information +
+What value to assign to the process variable when button is clicked
+The custom value to assign when button is clicked
+