From d0cef85b72a4a7b55823288bb23bbf9bd841f5d8 Mon Sep 17 00:00:00 2001 From: Afiq Date: Thu, 7 Aug 2025 14:17:51 +0800 Subject: [PATCH] Enhance ComponentPreview and RepeatingTable Functionality - Updated ComponentPreview.vue to improve the handling of repeating groups, including the addition of helper functions for field value retrieval and input handling. - Enhanced the rendering of repeating groups with better structure and improved user experience, including dynamic item addition and removal. - Modified RepeatingTable.vue to increase the maximum visible columns from 20 to 50, allowing for better data presentation and horizontal scrolling. - Improved column width calculations and added a minimum table width to ensure proper layout and usability. - Updated safeGetField.js to allow for optional warning suppression, enhancing flexibility in data access without unnecessary console warnings. - Refined styles across components for better visual consistency and usability. --- components/ComponentPreview.vue | 398 +++++++++++++++++++++----------- components/RepeatingTable.vue | 177 +++++++++++--- composables/safeGetField.js | 13 +- pages/form-builder/index.vue | 119 +++++----- 4 files changed, 480 insertions(+), 227 deletions(-) diff --git a/components/ComponentPreview.vue b/components/ComponentPreview.vue index fa67637..d8bb8e9 100644 --- a/components/ComponentPreview.vue +++ b/components/ComponentPreview.vue @@ -23,12 +23,14 @@ - + }" + @input="handleFieldInput(component, $event)" + @change="handleFieldChange(component, $event)" />
@@ -228,35 +232,59 @@
-
+ + + +
+ +

Item {{ groupIndex + 1 }}

-
- + +
- - +
+ + + +
- - @@ -270,7 +298,7 @@ @@ -289,7 +317,7 @@
-
- @@ -363,7 +391,7 @@ {{ validationErrors[component.props.name] }}
- -