PluginProbe
The Innovative Form Builder – IvyForms / 0.2
The Innovative Form Builder – IvyForms v0.2
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / frontend / src / views / public / fields / ParagraphFormField.vue

ParagraphFormField.vue in The Innovative Form Builder – IvyForms 0.2, at frontend/src/views/public/fields/ParagraphFormField.vue

64 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <template>
2 <div
3 :class="['ivyforms-field', 'ivyforms-field__textarea', 'ivyforms-field__textarea_' + field.id]"
4 >
5 <IvyFormItem
6 :label="field.label"
7 :required="field.required"
8 :error="error"
9 :prop="field.type + '_' + field.fieldIndex"
10 >
11 <IvyTextInput
12 :id="fieldID"
13 v-model="localModelValue"
14 class="ivyforms-field__textarea-input"
15 type="textarea"
16 :placeholder="field.placeholder"
17 :disabled="disabled"
18 :required="field.required"
19 />
20 </IvyFormItem>
21 </div>
22 </template>
23
24 <script setup lang="ts">
25 import { computed } from 'vue'
26
27 interface Field {
28 id: number
29 formId: number
30 fieldIndex: number
31 type: string
32 label: string
33 placeholder?: string
34 required?: boolean
35 }
36 interface FieldProps {
37 modelValue: string | number | null | undefined
38 field: Field
39 disabled?: boolean
40 error?: string
41 }
42
43 const props = withDefaults(defineProps<FieldProps>(), {
44 modelValue: '',
45 disabled: false,
46 error: '',
47 })
48
49 const emit = defineEmits(['update:modelValue'])
50
51 const localModelValue = computed({
52 get() {
53 return props.modelValue
54 },
55 set(value) {
56 emit('update:modelValue', value)
57 },
58 })
59 // Generate unique field ID as a string
60 const fieldID = computed(() => {
61 return `ivyforms-field__paragraph-input_${props.field.formId || ''}_${props.field.fieldIndex || ''}`
62 })
63 </script>
64