PluginProbe
The Innovative Form Builder – IvyForms / 0.8
The Innovative Form Builder – IvyForms v0.8
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 / admin / form-builder / fields / paragraph / ParagraphField.vue

ParagraphField.vue in The Innovative Form Builder – IvyForms 0.8, at frontend/src/views/admin/form-builder/fields/paragraph/ParagraphField.vue

100 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <template>
2 <div class="ivyforms-field__paragraph">
3 <IvyFormItem
4 :label="hideLabel ? '' : label"
5 :required="required"
6 :label-position="labelPosition"
7 >
8 <IvyTextInput
9 :id="index"
10 readonly
11 :placeholder="placeholder"
12 :model-value="modelValue"
13 type="textarea"
14 :rows="rows"
15 />
16 <div v-if="description" class="ivyforms-description-message regular-14">
17 {{ description }}
18 </div>
19 </IvyFormItem>
20 </div>
21 </template>
22
23 <script setup lang="ts">
24 import { computed } from 'vue'
25 import { useFormBuilder } from '@/stores/useFormBuilder'
26
27 const props = defineProps<{ fieldIndex: number }>()
28 const formBuilderStore = useFormBuilder()
29
30 // Computed properties to dynamically get values from the store
31 const field = computed(() => formBuilderStore.fields.find((f) => f.fieldIndex === props.fieldIndex))
32
33 const label = computed(() => field.value?.label || '')
34 const placeholder = computed(() => field.value?.placeholder || '')
35 const required = computed(() => field.value?.required || false)
36 const hideLabel = computed(() => field.value?.hideLabel || false)
37 const index = computed(() => field.value?.fieldIndex ?? props.fieldIndex)
38 const modelValue = computed(() => field.value?.defaultValue || '')
39 const rows = computed(() => (field.value?.rows <= 0 ? 3 : field.value?.rows))
40 const description = computed(() => field.value?.description || '')
41 const labelPosition = computed(() =>
42 field.value?.labelPosition === 'default' ? 'top' : field.value?.labelPosition || 'top',
43 )
44 </script>
45 <style lang="scss" scoped>
46 .ivyforms-field__paragraph {
47 cursor: default;
48 .ivyforms-form-item {
49 margin-bottom: 0;
50 :deep(.ivyforms-form-item__label) {
51 display: flex;
52 align-items: center;
53 color: var(--map-base-text-0);
54 font-size: 14px;
55 font-style: normal;
56 font-weight: 500;
57 line-height: 20px;
58 cursor: default !important;
59 }
60 :deep(.el-form-item__label) {
61 cursor: default;
62 }
63 .ivyforms-textarea.el-textarea {
64 :deep(.el-textarea__inner:hover),
65 :deep(.el-textarea__inner.is-focus),
66 :deep(.el-textarea__inner) {
67 border-radius: var(--Radius-radius-md, 8px);
68 border: 1px solid var(--map-base-dusk-stroke--2);
69 background: transparent;
70 box-shadow: none;
71 padding: 0 12px;
72 transition: none;
73 cursor: default;
74 }
75 :deep(textarea) {
76 border: none;
77 background: transparent;
78 cursor: default;
79 box-shadow: none;
80
81 &:focus {
82 outline: none;
83 border: 1px solid transparent; /* Ensure border does not change */
84 background: none; /* Ensure background does not change */
85 box-shadow: none;
86 }
87 }
88 }
89 }
90 .ivyforms-description-message {
91 color: var(--map-base-text-0);
92 display: block;
93 width: 100%;
94 white-space: normal;
95 overflow-wrap: anywhere;
96 word-break: break-word;
97 }
98 }
99 </style>
100