PluginProbe
The Innovative Form Builder – IvyForms / 0.5
The Innovative Form Builder – IvyForms v0.5
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.5, at frontend/src/views/admin/form-builder/fields/paragraph/ParagraphField.vue

99 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: move;
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 }
59 :deep(.el-form-item__label) {
60 cursor: move;
61 }
62 .ivyforms-textarea.el-textarea {
63 :deep(.el-textarea__inner:hover),
64 :deep(.el-textarea__inner.is-focus),
65 :deep(.el-textarea__inner) {
66 border-radius: var(--Radius-radius-md, 8px);
67 border: 1px solid var(--map-base-dusk-stroke--2);
68 background: var(--map-base-dusk-o05);
69 box-shadow: none;
70 padding: 0 12px;
71 transition: none;
72 cursor: move;
73 }
74 :deep(textarea) {
75 border: none;
76 background: transparent;
77 cursor: move;
78 box-shadow: none;
79
80 &:focus {
81 outline: none;
82 border: 1px solid transparent; /* Ensure border does not change */
83 background: none; /* Ensure background does not change */
84 box-shadow: none;
85 }
86 }
87 }
88 }
89 .ivyforms-description-message {
90 color: var(--map-base-text-0);
91 display: block;
92 width: 100%;
93 white-space: normal;
94 overflow-wrap: anywhere;
95 word-break: break-word;
96 }
97 }
98 </style>
99