Add keine Angabe
This commit is contained in:
parent
a37521eada
commit
1723135be5
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="relative">
|
||||
<field-label :name="field.name" :required="field.required" :hint="field.hint" inline></field-label>
|
||||
<field-label :name="field.name" :required="false" :hint="field.hint" inline></field-label>
|
||||
<div class="grid grid-cols-1 gap-2 pt-1">
|
||||
<label v-for="(option, index) in field.options" :key="index" :for="`${innerId}-${index}`" class="block relative flex items-start">
|
||||
<input :id="`${innerId}-${index}`" v-model="inner" type="checkbox" :name="field.key" :value="option" class="peer absolute invisible" />
|
||||
|
@ -25,8 +25,7 @@ const props = defineProps({
|
|||
field: {
|
||||
required: true,
|
||||
validator: (value) =>
|
||||
hasKeys(value, [...globalFieldRules(), 'required', 'options']) &&
|
||||
typeof value.required === 'boolean' &&
|
||||
hasKeys(value, [...globalFieldRules(), 'options']) &&
|
||||
typeof value.key === 'string' &&
|
||||
value.key.length > 0 &&
|
||||
typeof value.name === 'string' &&
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
:name="field.key"
|
||||
class="bg-white rounded-lg focus:outline-none text-gray-600 text-left peer py-1 px-2 @sm:py-2 text-sm @sm:text-base @sm:px-3 w-full"
|
||||
>
|
||||
<option :value="null">-- kein --</option>
|
||||
<option :value="null">-- keine Angabe --</option>
|
||||
<option v-for="(option, index) in options" :key="index" :value="option.id" v-text="option.name"></option>
|
||||
<option v-if="field.has_empty_option" :value="-1" v-text="field.empty_option_value"></option>
|
||||
</select>
|
||||
|
@ -31,7 +31,7 @@ const props = defineProps({
|
|||
hasKeys(value, [...globalFieldRules(), 'required', 'parent_field', 'parent_group', 'has_empty_option', 'empty_option_value']) &&
|
||||
typeof value.required === 'boolean' &&
|
||||
typeof value.has_empty_option === 'boolean' &&
|
||||
typeof value.empty_option_value === 'string' &&
|
||||
(value.empty_option_value === null || typeof value.empty_option_value === 'string') &&
|
||||
typeof value.key === 'string' &&
|
||||
value.key.length > 0 &&
|
||||
typeof value.name === 'string' &&
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
:name="name"
|
||||
class="bg-white group-[.info]:bg-blue-200 rounded-lg focus:outline-none text-gray-600 text-left py-1 px-2 @sm:py-2 @sm:group-[.info]:py-1 text-sm @sm:text-base @sm:group-[.info]:text-sm @sm:px-3 @sm:group-[.info]:px-2 w-full"
|
||||
>
|
||||
<option :value="null">-- kein --</option>
|
||||
<option :value="null">-- keine Angabe --</option>
|
||||
<option v-for="(option, index) in options" :key="index" :value="option.id" v-text="option.name"></option>
|
||||
</select>
|
||||
<input
|
||||
|
|
Loading…
Reference in New Issue