From b109d40ebbc380a666cea43e6f63e3ceab8dfa5e Mon Sep 17 00:00:00 2001 From: Philipp Lang Date: Tue, 26 Dec 2023 20:20:32 +0100 Subject: [PATCH] add field meta --- app/Form/Fields/CheckboxesField.php | 2 +- .../js/views/formtemplate/CheckboxField.vue | 27 ++++++++++++------- ...{DropdownField.vue => CheckboxesField.vue} | 0 .../js/views/formtemplate/FormBuilder.vue | 7 ++--- .../js/views/formtemplate/RadioField.vue | 9 +++++++ resources/js/views/formtemplate/TextField.vue | 21 +++++++++++++++ .../js/views/formtemplate/TextareaField.vue | 22 +++++++-------- 7 files changed, 62 insertions(+), 26 deletions(-) rename resources/js/views/formtemplate/{DropdownField.vue => CheckboxesField.vue} (100%) create mode 100644 resources/js/views/formtemplate/TextField.vue diff --git a/app/Form/Fields/CheckboxesField.php b/app/Form/Fields/CheckboxesField.php index 62f5badc..45d1546c 100644 --- a/app/Form/Fields/CheckboxesField.php +++ b/app/Form/Fields/CheckboxesField.php @@ -14,7 +14,7 @@ class CheckboxesField extends Field public static function meta(): array { return [ - ['key' => 'options', 'default' => [], 'rules' => ['options' => 'array', 'options.*' => 'string'], 'label' => 'Optionen'], + ['key' => 'options', 'default' => [], 'rules' => ['options' => 'array', 'options.*' => 'required|string'], 'label' => 'Optionen'], ]; } diff --git a/resources/js/views/formtemplate/CheckboxField.vue b/resources/js/views/formtemplate/CheckboxField.vue index d54235dd..0b90dce7 100644 --- a/resources/js/views/formtemplate/CheckboxField.vue +++ b/resources/js/views/formtemplate/CheckboxField.vue @@ -1,14 +1,21 @@ diff --git a/resources/js/views/formtemplate/TextareaField.vue b/resources/js/views/formtemplate/TextareaField.vue index 375a3dcb..bdaf9e92 100644 --- a/resources/js/views/formtemplate/TextareaField.vue +++ b/resources/js/views/formtemplate/TextareaField.vue @@ -1,16 +1,14 @@