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 / website / WebsiteField.vue

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

129 lines 3.8 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: move;
55 .ivyforms-form-item {
56 cursor: move;
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 }
68 :deep(.el-form-item__label) {
69 cursor: move;
70 }
71 .ivyforms-input.el-input {
72 :deep(.el-input__wrapper:hover),
73 :deep(.el-input__wrapper.is-focus),
74 :deep(.el-input__wrapper) {
75 border-radius: var(--Radius-radius-md, 8px);
76 border: 1px solid var(--map-base-dusk-stroke--2);
77 background: var(--map-base-dusk-o05);
78 box-shadow: none;
79 padding: 0 12px;
80 transition: none;
81 cursor: move;
82 }
83 :deep(input) {
84 border: none;
85 background: transparent;
86 cursor: move;
87 box-shadow: none;
88
89 &:focus {
90 outline: none;
91 border: 1px solid transparent; /* Ensure border does not change */
92 background: none; /* Ensure background does not change */
93 box-shadow: none;
94 }
95 }
96 }
97 }
98 .ivyforms-description-message {
99 color: var(--map-base-text-0);
100 display: block;
101 width: 100%;
102 white-space: normal;
103 overflow-wrap: anywhere;
104 word-break: break-word;
105 }
106
107 // Styling for website prefix and suffix
108 :deep(.ivyforms-field__website-prefix),
109 :deep(.ivyforms-field__website-suffix) {
110 display: inline-block;
111 padding: 0 8px;
112 font-size: 14px;
113 line-height: 40px;
114 color: var(--map-base-text--2);
115 cursor: move;
116 }
117
118 :deep(.ivyforms-field__website-prefix) {
119 border-right: 1px solid var(--map-base-dusk-stroke--2, #ccc);
120 border-radius: 8px 0 0 8px;
121 }
122
123 :deep(.ivyforms-field__website-suffix) {
124 border-left: 1px solid var(--map-base-dusk-stroke--2, #ccc);
125 border-radius: 0 8px 8px 0;
126 }
127 }
128 </style>
129