diff --git a/index.html b/index.html index a0dbe7f..671cf8b 100644 --- a/index.html +++ b/index.html @@ -140,6 +140,24 @@ "special_type": null, "rows": 5, "key": "textarea" + }, + { + "name": "numerisch", + "hint": "Quisque justo leo, ultricies vestibulum.", + "type": "NumberField", + "columns": { + "mobile": 2, + "tablet": 4, + "desktop": 6 + }, + "value": null, + "required": false, + "nami_type": null, + "for_members": true, + "special_type": null, + "key": "numerisch", + "min": null, + "max": 7 } ] } diff --git a/src/components/fields/Number.vue b/src/components/fields/Number.vue new file mode 100644 index 0000000..5204ffa --- /dev/null +++ b/src/components/fields/Number.vue @@ -0,0 +1,37 @@ + + + diff --git a/src/components/fields/VText.vue b/src/components/fields/VText.vue index a1fb3e1..8bb320f 100644 --- a/src/components/fields/VText.vue +++ b/src/components/fields/VText.vue @@ -4,10 +4,12 @@ :id="id" v-model="inner" :name="name" + :min="min" + :max="max" :type="type" placeholder="" - @keypress="$emit('keypress', $event)" class="bg-white group-[.info]:bg-blue-200 rounded-lg focus:outline-none text-gray-600 text-left w-full py-1 @sm:py-2 @sm:group-[.info]:py-1 px-2 @sm:px-3 @sm:group-[.info]:px-2 text-sm @sm:text-base @sm:group-[.info]:text-sm" + @keypress="$emit('keypress', $event)" />
@@ -40,6 +42,14 @@ const props = defineProps({ required: true, type: String, }, + min: { + type: String, + default: () => '', + }, + max: { + type: String, + default: () => '', + }, label: { required: true, type: String, diff --git a/src/composables/useFields.js b/src/composables/useFields.js index 9294119..0ae9811 100644 --- a/src/composables/useFields.js +++ b/src/composables/useFields.js @@ -7,6 +7,7 @@ import FieldCheckboxes from '../components/fields/Checkboxes.vue'; import FieldCheckbox from '../components/fields/Checkbox.vue'; import FieldNami from '../components/fields/Nami.vue'; import FieldRadio from '../components/fields/Radio.vue'; +import FieldNumber from '../components/fields/Number.vue'; export default function useFields(active, last) { function resolveComponentName(field) { @@ -21,6 +22,7 @@ export default function useFields(active, last) { CheckboxesField: FieldCheckboxes, CheckboxField: FieldCheckbox, NamiField: FieldNami, + NumberField: FieldNumber, }[field.type]; }