PluginProbe
The Innovative Form Builder – IvyForms / 0.7
The Innovative Form Builder – IvyForms v0.7
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 / text / TextField.vue

TextField.vue in The Innovative Form Builder – IvyForms 0.7, at frontend/src/views/admin/form-builder/fields/text/TextField.vue

101 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__text">
3 <IvyFormItem
4 :label="hideLabel ? '' : label"
5 :required="required"
6 :label-position="labelPosition"
7 >
8 <IvyTextInput
9 :id="index"
10 :aria-label="label"
11 readonly
12 :placeholder="placeholder"
13 :model-value="modelValue"
14 type="text"
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 description = computed(() => field.value?.description || '')
40 const labelPosition = computed(() =>
41 field.value?.labelPosition === 'default' ? 'top' : field.value?.labelPosition || 'top',
42 )
43 </script>
44 <style lang="scss" scoped>
45 .ivyforms-field__text {
46 cursor: default;
47 .ivyforms-form-item {
48 cursor: default;
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 /* Medium/Medium 14 */
55 font-size: 14px;
56 font-style: normal;
57 font-weight: 500;
58 line-height: 20px; /* 142.857% */
59 cursor: default !important;
60 }
61 :deep(.el-form-item__label) {
62 cursor: default;
63 }
64 .ivyforms-input.el-input {
65 :deep(.el-input__wrapper:hover),
66 :deep(.el-input__wrapper.is-focus),
67 :deep(.el-input__wrapper) {
68 border-radius: var(--Radius-radius-md, 8px);
69 border: 1px solid var(--map-base-dusk-stroke--2);
70 background: transparent;
71 box-shadow: none;
72 padding: 0 12px;
73 transition: none;
74 cursor: default;
75 }
76 :deep(input) {
77 border: none;
78 background: transparent;
79 cursor: default;
80 box-shadow: none;
81
82 &:focus {
83 outline: none;
84 border: 1px solid transparent; /* Ensure border does not change */
85 background: none; /* Ensure background does not change */
86 box-shadow: none;
87 }
88 }
89 }
90 }
91 .ivyforms-description-message {
92 color: var(--map-base-text-0);
93 display: block;
94 width: 100%;
95 white-space: normal;
96 overflow-wrap: anywhere;
97 word-break: break-word;
98 }
99 }
100 </style>
101