PluginProbe
The Innovative Form Builder – IvyForms / 0.2.1
The Innovative Form Builder – IvyForms v0.2.1
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.2.1, at frontend/src/views/admin/form-builder/fields/text/TextField.vue

81 lines 2.3 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 :label="label" :required="required">
4 <IvyTextInput
5 :id="index"
6 readonly
7 :placeholder="placeholder"
8 :model-value="modelValue"
9 :type="type"
10 />
11 </IvyFormItem>
12 </div>
13 </template>
14
15 <script setup lang="ts">
16 import { computed } from 'vue'
17 import { useFormBuilder } from '@/stores/useFormBuilder'
18
19 const props = defineProps<{ fieldIndex: number }>()
20 const formBuilderStore = useFormBuilder()
21
22 // Computed properties to dynamically get values from the store
23 const field = computed(() => formBuilderStore.fields.find((f) => f.fieldIndex === props.fieldIndex))
24
25 const label = computed(() => field.value?.label || '')
26 const placeholder = computed(() => field.value?.placeholder || '')
27 const required = computed(() => field.value?.required || false)
28 const index = computed(() => field.value?.fieldIndex ?? props.fieldIndex)
29 const modelValue = computed(() => field.value?.defaultValue || '')
30 const type = computed(() => field.value?.type || 'text')
31 </script>
32 <style lang="scss" scoped>
33 .ivyforms-field__text {
34 cursor: move;
35 .ivyforms-form-item {
36 cursor: move;
37 margin-bottom: 0;
38 :deep(.ivyforms-form-item__label) {
39 display: flex;
40 align-items: center;
41 color: var(--map-base-text-0);
42 /* Medium/Medium 14 */
43 font-size: 14px;
44 font-style: normal;
45 font-weight: 500;
46 line-height: 20px; /* 142.857% */
47 margin-bottom: 6px;
48 }
49 :deep(.el-form-item__label) {
50 cursor: move;
51 }
52 .ivyforms-input.el-input {
53 :deep(.el-input__wrapper:hover),
54 :deep(.el-input__wrapper.is-focus),
55 :deep(.el-input__wrapper) {
56 border-radius: var(--Radius-radius-md, 8px);
57 border: 1px solid var(--map-base-dusk-stroke--2);
58 background: var(--map-base-dusk-o05);
59 box-shadow: none;
60 padding: 0 12px;
61 transition: none;
62 cursor: move;
63 }
64 :deep(input) {
65 border: none;
66 background: transparent;
67 cursor: move;
68 box-shadow: none;
69
70 &:focus {
71 outline: none;
72 border: 1px solid transparent; /* Ensure border does not change */
73 background: none; /* Ensure background does not change */
74 box-shadow: none;
75 }
76 }
77 }
78 }
79 }
80 </style>
81