From 415ac5a0d16b3c094b445ba9351b471a9b50f0b6 Mon Sep 17 00:00:00 2001 From: Afiq Date: Thu, 7 Aug 2025 10:28:57 +0800 Subject: [PATCH] Enhance ComponentPreview and FormBuilder Components with Drag-and-Drop Functionality - Updated ComponentPreview.vue to implement a draggable container for nested components, allowing users to reorder fields within repeating groups. - Enhanced the user interface with visual feedback during drag-and-drop actions, improving usability and interaction. - Modified FormBuilderComponents.vue to include default properties for nested components, facilitating better organization and management of form fields. - Improved FormBuilderFieldSettingsModal.vue to provide clearer information about repeating group containers and their functionalities. - Refactored event handling for component updates and deletions to support nested components within sections and repeating groups, ensuring consistent data management. - Updated styles across components to enhance the visual experience during drag-and-drop operations and improve overall aesthetics. --- components/ComponentPreview.vue | 316 +++++++++++++++---- components/FormBuilderComponents.vue | 16 +- components/FormBuilderFieldSettingsModal.vue | 135 ++------ components/formkit/Switch.vue | 22 +- pages/form-builder/index.vue | 16 +- 5 files changed, 305 insertions(+), 200 deletions(-) diff --git a/components/ComponentPreview.vue b/components/ComponentPreview.vue index 10e220a..ef287c2 100644 --- a/components/ComponentPreview.vue +++ b/components/ComponentPreview.vue @@ -144,24 +144,81 @@ {{ component.props.help }} - +
-
-
-

Item 1

- + +
+
+ + +
- -
- + + +
+ +

Drag fields here to add them to this repeating group

+
- +
@@ -181,12 +238,17 @@
-
-