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 / email / EmailField.vue

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

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