PluginProbe
The Innovative Form Builder – IvyForms / 0.4
The Innovative Form Builder – IvyForms v0.4
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 / email / EmailField.vue

EmailField.vue in The Innovative Form Builder – IvyForms 0.4, at frontend/src/views/admin/form-builder/fields/email/EmailField.vue

116 lines 3.4 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__email">
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="email"
14 />
15 <div v-if="description" class="ivyforms-description-message regular-14">
16 {{ description }}
17 </div>
18 </IvyFormItem>
19 <!-- Confirmation preview -->
20 <IvyFormItem
21 v-if="field?.confirmFieldEnabled"
22 :label="field?.confirmFieldHideLabel ? '' : confirmLabel"
23 :required="required"
24 >
25 <IvyTextInput
26 :id="index + '-confirm'"
27 readonly
28 :placeholder="confirmPlaceholder"
29 :model-value="''"
30 type="email"
31 />
32 </IvyFormItem>
33 </div>
34 </template>
35
36 <script setup lang="ts">
37 import { computed } from 'vue'
38 import { useFormBuilder } from '@/stores/useFormBuilder'
39
40 const props = defineProps<{ fieldIndex: number }>()
41 const formBuilderStore = useFormBuilder()
42
43 // Computed properties to dynamically get values from the store
44 const field = computed(() => formBuilderStore.fields.find((f) => f.fieldIndex === props.fieldIndex))
45
46 const label = computed(() => field.value?.label || '')
47 const placeholder = computed(() => field.value?.placeholder || '')
48 const required = computed(() => field.value?.required || false)
49 const hideLabel = computed(() => field.value?.hideLabel || false)
50 const index = computed(() => field.value?.fieldIndex ?? props.fieldIndex)
51 const modelValue = computed(() => field.value?.defaultValue || '')
52 const labelPosition = computed(() =>
53 field.value?.labelPosition === 'default' ? 'top' : field.value?.labelPosition || 'top',
54 )
55 const description = computed(() => field.value?.description || '')
56 const confirmLabel = computed(() => field.value?.confirmFieldLabel || '')
57 const confirmPlaceholder = computed(() => field.value?.confirmFieldPlaceholder || '')
58 </script>
59 <style lang="scss" scoped>
60 .ivyforms-field__email {
61 cursor: move;
62 .ivyforms-form-item {
63 margin-bottom: 0;
64 cursor: move;
65 :deep(.ivyforms-form-item__label) {
66 display: flex;
67 align-items: center;
68 color: var(--map-base-text-0);
69 /* Medium/Medium 14 */
70 font-size: 14px;
71 font-style: normal;
72 font-weight: 500;
73 line-height: 20px; /* 142.857% */
74 cursor: move;
75 }
76 :deep(.el-form-item__label) {
77 cursor: move;
78 }
79 .ivyforms-input.el-input {
80 :deep(.el-input__wrapper:hover),
81 :deep(.el-input__wrapper.is-focus),
82 :deep(.el-input__wrapper) {
83 border-radius: var(--Radius-radius-md, 8px);
84 border: 1px solid var(--map-base-dusk-stroke--2);
85 background: var(--map-base-dusk-o05);
86 box-shadow: none;
87 padding: 0 12px;
88 transition: none;
89 cursor: move;
90 }
91 :deep(input) {
92 border: none;
93 background: transparent;
94 cursor: move;
95 box-shadow: none;
96
97 &:focus {
98 outline: none;
99 border: 1px solid transparent; /* Ensure border does not change */
100 background: none; /* Ensure background does not change */
101 box-shadow: none;
102 }
103 }
104 }
105 }
106 .ivyforms-description-message {
107 color: var(--map-base-text-0);
108 display: block;
109 width: 100%;
110 white-space: normal;
111 overflow-wrap: anywhere;
112 word-break: break-word;
113 }
114 }
115 </style>
116