PluginProbe
The Innovative Form Builder – IvyForms / 0.9
The Innovative Form Builder – IvyForms v0.9
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 / website / WebsiteField.vue

WebsiteField.vue in The Innovative Form Builder – IvyForms 0.9, at frontend/src/views/admin/form-builder/fields/website/WebsiteField.vue

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