From db3b00ce1130f3fced4c5d026ed1e82035e909f1 Mon Sep 17 00:00:00 2001 From: Afiq Date: Fri, 30 May 2025 12:29:11 +0800 Subject: [PATCH] Enhance Form Builder with Conditional Logic and Dynamic List Features - Introduced a new ConditionalLogicEngine component to manage and execute conditional logic for form fields, allowing for dynamic visibility and behavior based on user input. - Added conditional logic properties to various form components, enabling users to define conditions for showing, hiding, enabling, or disabling fields. - Enhanced the dynamic list component with new settings for item validation, uniqueness, and import/export functionality, improving data management capabilities. - Updated FormBuilderFieldSettingsModal to include a visual condition builder interface for easier configuration of conditional logic. - Improved documentation to reflect the new features and provide guidance on using conditional logic within forms. --- assets/js/formkit-custom.js | 2 +- components/ComponentPreview.vue | 690 +++++++++++++------ components/ConditionalLogicEngine.vue | 150 ++++ components/FormBuilderCanvas.vue | 2 +- components/FormBuilderComponents.vue | 68 +- components/FormBuilderConfiguration.vue | 138 +++- components/FormBuilderFieldSettingsModal.vue | 651 ++++++++++++++++- components/formkit/Switch.vue | 79 ++- doc/README.md | 1 + doc/form-builder/ROADMAP.md | 358 ++++++++++ pages/form-builder/index.vue | 16 + 11 files changed, 1897 insertions(+), 258 deletions(-) create mode 100644 components/ConditionalLogicEngine.vue create mode 100644 doc/form-builder/ROADMAP.md diff --git a/assets/js/formkit-custom.js b/assets/js/formkit-custom.js index 18c06fd..514e616 100644 --- a/assets/js/formkit-custom.js +++ b/assets/js/formkit-custom.js @@ -15,6 +15,6 @@ export default { props: ["accept", "multiple", "maxSize", "minSize", "maxFiles", "disabled"], }), switch: createInput(Switch, { - props: ["value"], + props: ["value", "disabled", "name", "id"], }), }; diff --git a/components/ComponentPreview.vue b/components/ComponentPreview.vue index f5a85a7..eb1205d 100644 --- a/components/ComponentPreview.vue +++ b/components/ComponentPreview.vue @@ -1,10 +1,6 @@ @@ -417,6 +417,197 @@ /> + + +