Add checkboxes
This commit is contained in:
parent
bde8d48807
commit
ac28466c8d
app/Form/Fields
resources/js/views/formtemplate
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Form\Fields;
|
||||||
|
|
||||||
|
class CheckboxField extends Field
|
||||||
|
{
|
||||||
|
public static function name(): string
|
||||||
|
{
|
||||||
|
return 'Checkbox';
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function meta(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'description' => '',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function default()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Form\Fields;
|
||||||
|
|
||||||
|
class CheckboxesField extends Field
|
||||||
|
{
|
||||||
|
public static function name(): string
|
||||||
|
{
|
||||||
|
return 'Checkboxes';
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function meta(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'options' => [],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function default()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<f-textarea
|
||||||
|
id="description"
|
||||||
|
label="Beschreibung"
|
||||||
|
size="sm"
|
||||||
|
name="description"
|
||||||
|
:model-value="modelValue.description"
|
||||||
|
@update:modelValue="$emit('update:modelValue', {...modelValue, description: $event})"
|
||||||
|
></f-textarea>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: {},
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits(['update:modelValue']);
|
||||||
|
</script>
|
|
@ -53,6 +53,8 @@ import Asideform from './Asideform.vue';
|
||||||
import TextareaField from './TextareaField.vue';
|
import TextareaField from './TextareaField.vue';
|
||||||
import DropdownField from './DropdownField.vue';
|
import DropdownField from './DropdownField.vue';
|
||||||
import RadioField from './RadioField.vue';
|
import RadioField from './RadioField.vue';
|
||||||
|
import CheckboxField from './CheckboxField.vue';
|
||||||
|
import CheckboxesField from './DropdownField.vue';
|
||||||
|
|
||||||
const sectionVisible = ref(-1);
|
const sectionVisible = ref(-1);
|
||||||
const singleSection = ref(null);
|
const singleSection = ref(null);
|
||||||
|
@ -68,6 +70,8 @@ const fields = {
|
||||||
TextareaField: TextareaField,
|
TextareaField: TextareaField,
|
||||||
DropdownField: DropdownField,
|
DropdownField: DropdownField,
|
||||||
RadioField: RadioField,
|
RadioField: RadioField,
|
||||||
|
CheckboxField: CheckboxField,
|
||||||
|
CheckboxesField: CheckboxesField,
|
||||||
};
|
};
|
||||||
|
|
||||||
function editSection(sectionIndex) {
|
function editSection(sectionIndex) {
|
||||||
|
|
Loading…
Reference in New Issue