From ab83aa166c4e58e79184635e205edb68d995dcb5 Mon Sep 17 00:00:00 2001 From: Chirag Chhatrala <60499540+chiragchhatrala@users.noreply.github.com> Date: Wed, 20 Nov 2024 21:36:11 +0530 Subject: [PATCH] Matrix Improvements (#606) * Support disable on matrix * fix checkbox and radio icon * Use Nuxt UI toggle * Can set max_char_limit null * fix action icon design * Support for URL prefill for Matrix * Apply theme color on toggle * Set --form-color as style variable and use it * Set default value for form-color * fix formatting --------- Co-authored-by: Julien Nahum --- api/app/Http/Requests/UserFormRequest.php | 5 +- client/components/forms/CheckboxInput.vue | 20 ++--- client/components/forms/MatrixInput.vue | 85 ++++++++++--------- client/components/forms/ToggleSwitchInput.vue | 14 +-- .../forms/components/CheckboxIcon.vue | 28 ++++-- .../forms/components/RadioButtonIcon.vue | 30 ++++--- .../components/forms/components/VSwitch.vue | 54 ------------ client/components/open/forms/OpenForm.vue | 18 +++- .../components/open/forms/OpenFormField.vue | 4 +- .../open/forms/components/FormUrlPrefill.vue | 2 + .../forms/fields/components/FieldOptions.vue | 10 ++- 11 files changed, 131 insertions(+), 139 deletions(-) delete mode 100644 client/components/forms/components/VSwitch.vue diff --git a/api/app/Http/Requests/UserFormRequest.php b/api/app/Http/Requests/UserFormRequest.php index 9596e092..bf75ca7d 100644 --- a/api/app/Http/Requests/UserFormRequest.php +++ b/api/app/Http/Requests/UserFormRequest.php @@ -91,7 +91,7 @@ abstract class UserFormRequest extends \Illuminate\Foundation\Http\FormRequest // Text field 'properties.*.multi_lines' => 'boolean|nullable', - 'properties.*.max_char_limit' => 'integer|nullable|min:1|max:2000', + 'properties.*.max_char_limit' => 'integer|nullable|min:1', 'properties.*.show_char_limit ' => 'boolean|nullable', 'properties.*.secret_input' => 'boolean|nullable', @@ -134,8 +134,7 @@ abstract class UserFormRequest extends \Illuminate\Foundation\Http\FormRequest return [ 'properties.*.name.required' => 'The form block number :position is missing a name.', 'properties.*.type.required' => 'The form block number :position is missing a type.', - 'properties.*.max_char_limit.min' => 'The form block number :position max character limit must be at least 1 OR Empty', - 'properties.*.max_char_limit.max' => 'The form block number :position max character limit may not be greater than 2000.', + 'properties.*.max_char_limit.min' => 'The form block number :position max character limit must be at least 1 OR Empty' ]; } } diff --git a/client/components/forms/CheckboxInput.vue b/client/components/forms/CheckboxInput.vue index c18df4b3..9bbd60a4 100644 --- a/client/components/forms/CheckboxInput.vue +++ b/client/components/forms/CheckboxInput.vue @@ -5,16 +5,16 @@
- -
+ +