PluginProbe
The Innovative Form Builder – IvyForms / 1.1
The Innovative Form Builder – IvyForms v1.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 / public / fields / HtmlFormField.vue

HtmlFormField.vue in The Innovative Form Builder – IvyForms 1.1, at frontend/src/views/public/fields/HtmlFormField.vue

88 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <template>
2 <div
3 :class="[
4 'ivyforms-field ivyforms-field__html ivyforms-mb-16',
5 'ivyforms-field__html_' + field.id,
6 field.cssClasses,
7 ]"
8 >
9 <IvyFormItem :label="field.hideLabel ? '' : field.label" :label-position="field.labelPosition">
10 <SafeHTML
11 v-if="field.htmlContent"
12 class="ivyforms-field__html-content"
13 :html="field.htmlContent"
14 :allowed-tags="ALLOWED_TAGS"
15 :allowed-attributes="ALLOWED_ATTR"
16 />
17 <div
18 v-if="field.description"
19 class="ivyforms-field__html-description ivyforms-width-100 ivyforms-mt-8 regular-14"
20 >
21 {{ field.description }}
22 </div>
23 </IvyFormItem>
24 </div>
25 </template>
26
27 <script setup lang="ts">
28 import { computed } from 'vue'
29 import SafeHTML from '@/views/_components/SafeHTML.vue'
30 import {
31 ALLOWED_HTML_TAGS as ALLOWED_TAGS,
32 ALLOWED_HTML_ATTR as ALLOWED_ATTR,
33 } from '@/constants/html-sanitization.ts'
34
35 interface Field {
36 id: number
37 type: string
38 label: string
39 hideLabel?: boolean
40 htmlContent?: string
41 description?: string
42 labelPosition?: string
43 cssClasses?: string
44 }
45
46 interface Props {
47 field: Field
48 }
49
50 const props = defineProps<Props>()
51 const field = computed(() => props.field)
52 </script>
53
54 <style lang="scss" scoped>
55 .ivyforms-field__html {
56 .ivyforms-form-item {
57 margin-bottom: 0;
58
59 :deep(.ivyforms-form-item__label) {
60 display: flex;
61 align-items: center;
62 color: var(--map-base-text-0);
63 font-size: 14px;
64 font-style: normal;
65 font-weight: 500;
66 line-height: 20px;
67 }
68 }
69
70 &__html-content,
71 .ivyforms-safe-html {
72 width: 100%;
73 display: block;
74 white-space: normal;
75 overflow-wrap: anywhere;
76 word-break: break-word;
77 }
78
79 &-description {
80 color: var(--map-base-text--1);
81 display: block;
82 white-space: normal;
83 overflow-wrap: anywhere;
84 word-break: break-word;
85 }
86 }
87 </style>
88