comand-component-library 4.0.17 → 4.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/comand-component-library.js +2864 -2766
- package/dist/comand-component-library.umd.cjs +3 -3
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/ComponentLibrary.vue +28 -1
- package/src/assets/data/listOfComponents.json +1 -0
- package/src/assets/styles/component-library-global-styles.scss +1 -41
- package/src/assets/styles/transitions.css +0 -6
- package/src/{pages/BasicForm.vue → components/CmdBasicForm.vue} +71 -33
- package/src/components/CmdBreadcrumbs.vue +2 -2
- package/src/components/CmdFancyBox.vue +3 -3
- package/src/components/CmdForm.vue +13 -5
- package/src/components/CmdPageFooter.vue +36 -0
- package/src/components/CmdPageHeader.vue +2 -2
- package/src/components/CmdSiteFooter.vue +1 -3
- package/src/components/CmdSiteHeader.vue +0 -2
- package/src/components/CmdSlideshow.vue +4 -0
- package/src/components/CmdSwitchLanguage.vue +1 -1
- package/src/index.js +1 -1
- package/src/mixins/{pages/BasicForm → CmdBasicForm}/DefaultMessageProperties.js +2 -2
- package/src/pages/PageOverview.vue +1 -43
- package/src/utils/ContactFormValidation.js +45 -0
- package/src/assets/fonts/iconfonts/logos-iconfont/images/flags/flag-cn.svg +0 -26
- package/src/assets/fonts/iconfonts/logos-iconfont/images/flags/flag-de.svg +0 -76
- package/src/assets/fonts/iconfonts/logos-iconfont/images/flags/flag-en.svg +0 -76
- package/src/assets/fonts/iconfonts/logos-iconfont/images/flags/flag-es.svg +0 -83
- package/src/assets/fonts/iconfonts/logos-iconfont/images/flags/flag-fr.svg +0 -76
- package/src/assets/fonts/iconfonts/logos-iconfont/images/flags/flag-it.svg +0 -76
- package/src/assets/fonts/iconfonts/logos-iconfont/images/flags/flag-ru.svg +0 -76
@@ -10,6 +10,7 @@
|
|
10
10
|
novalidate="novalidate"
|
11
11
|
:textLegend="getMessage('basic_form.legend')"
|
12
12
|
:submitButton="submitButton"
|
13
|
+
:formAction="formAction"
|
13
14
|
>
|
14
15
|
<div v-if="configuration.salutation" class="flex-container no-flex order-male-female">
|
15
16
|
<!-- begin cmd-form-element -->
|
@@ -20,7 +21,7 @@
|
|
20
21
|
:name="configuration.salutation?.name || 'salutation'"
|
21
22
|
inputValue="m"
|
22
23
|
:replaceInputType="configuration.salutation?.replaceInputType"
|
23
|
-
v-model="formData.salutation"
|
24
|
+
v-model="formData.salutation.value"
|
24
25
|
@validate="onValidate"
|
25
26
|
/>
|
26
27
|
<!-- end cmd-form-element -->
|
@@ -33,7 +34,7 @@
|
|
33
34
|
:name="configuration.salutation?.name || 'salutation'"
|
34
35
|
inputValue="f"
|
35
36
|
:replaceInputType="configuration.salutation?.replaceInputType"
|
36
|
-
v-model="formData.salutation"
|
37
|
+
v-model="formData.salutation.value"
|
37
38
|
@validate="onValidate"
|
38
39
|
/>
|
39
40
|
<!-- end cmd-form-element -->
|
@@ -122,7 +123,7 @@
|
|
122
123
|
v-model="formData.country.value"
|
123
124
|
:status="formData.country.error ? 'error' : ''"
|
124
125
|
@validate="onValidate"
|
125
|
-
@
|
126
|
+
@update:modelValue="onCountrySelect"
|
126
127
|
/>
|
127
128
|
<!-- end cmd-form-element -->
|
128
129
|
|
@@ -156,7 +157,7 @@
|
|
156
157
|
/>
|
157
158
|
<!-- end cmd-form-element -->
|
158
159
|
|
159
|
-
<div class="input-wrapper" :class="
|
160
|
+
<div class="input-wrapper" :class="cityBeforeZip ? 'order-city-zip' : 'order-zip-city'">
|
160
161
|
<!-- begin cmd-form-element -->
|
161
162
|
<CmdFormElement
|
162
163
|
v-if="configuration.zip"
|
@@ -181,7 +182,7 @@
|
|
181
182
|
:labelText="getMessage('basic_form.labeltext.city')"
|
182
183
|
:placeholder="getMessage('basic_form.placeholder.city')"
|
183
184
|
:required="configuration.city?.required"
|
184
|
-
:name="configuration.city?.name || '
|
185
|
+
:name="configuration.city?.name || 'city'"
|
185
186
|
v-model="formData.city.value"
|
186
187
|
:status="formData.city.error ? 'error' : ''"
|
187
188
|
@validate="onValidate"
|
@@ -207,14 +208,14 @@
|
|
207
208
|
|
208
209
|
<!-- begin cmd-form-element -->
|
209
210
|
<CmdFormElement
|
210
|
-
v-if="configuration.
|
211
|
-
:element="configuration.
|
212
|
-
:labelText="getMessage('basic_form.labeltext.
|
213
|
-
:placeholder="getMessage('basic_form.placeholder.
|
214
|
-
:required="configuration.
|
215
|
-
:name="configuration.
|
216
|
-
v-model="formData.
|
217
|
-
:status="formData.
|
211
|
+
v-if="configuration.userMessage"
|
212
|
+
:element="configuration.userMessage?.element || 'textarea'"
|
213
|
+
:labelText="getMessage('basic_form.labeltext.userMessage')"
|
214
|
+
:placeholder="getMessage('basic_form.placeholder.userMessage')"
|
215
|
+
:required="configuration.userMessage?.required"
|
216
|
+
:name="configuration.userMessage?.name || 'user-message'"
|
217
|
+
v-model="formData.userMessage.value"
|
218
|
+
:status="formData.userMessage.error ? 'error' : ''"
|
218
219
|
@validate="onValidate"
|
219
220
|
/>
|
220
221
|
<!-- end cmd-form-element -->
|
@@ -246,11 +247,13 @@
|
|
246
247
|
|
247
248
|
<script>
|
248
249
|
// import mixins
|
249
|
-
import I18n from "../mixins/I18n"
|
250
|
-
import DefaultMessageProperties from "../mixins/
|
251
|
-
import FieldValidation from "../mixins/FieldValidation"
|
250
|
+
import I18n from "../mixins/I18n.js"
|
251
|
+
import DefaultMessageProperties from "../mixins/CmdBasicForm/DefaultMessageProperties.js"
|
252
|
+
import FieldValidation from "../mixins/FieldValidation.js"
|
253
|
+
import {ContactFormValidator} from "@/utils/ContactFormValidation.js";
|
252
254
|
|
253
255
|
export default {
|
256
|
+
emits: ["submit"],
|
254
257
|
mixins: [
|
255
258
|
I18n,
|
256
259
|
DefaultMessageProperties,
|
@@ -263,9 +266,9 @@ export default {
|
|
263
266
|
},
|
264
267
|
data() {
|
265
268
|
return {
|
266
|
-
|
269
|
+
validator: new ContactFormValidator(label => label),
|
267
270
|
formData: {
|
268
|
-
salutation: this.configuration.salutation.default,
|
271
|
+
salutation: {value: this.configuration.salutation.default},
|
269
272
|
lastName: {value: ''},
|
270
273
|
firstName: {value: ''},
|
271
274
|
email: {value: ''},
|
@@ -276,13 +279,27 @@ export default {
|
|
276
279
|
pobox: {value: ''},
|
277
280
|
country: {value: ''},
|
278
281
|
additionalAddressInfo: {value: ''},
|
279
|
-
|
282
|
+
userMessage: {value: ''},
|
280
283
|
acceptPrivacy: {value: false}
|
281
284
|
},
|
282
285
|
cityBeforeZip: this.showCityBeforeZip
|
283
286
|
}
|
284
287
|
},
|
285
288
|
props: {
|
289
|
+
/**
|
290
|
+
* activate if native submit-event should be used
|
291
|
+
*/
|
292
|
+
useNativeSubmit: {
|
293
|
+
type: Boolean,
|
294
|
+
default: false
|
295
|
+
},
|
296
|
+
/**
|
297
|
+
* set url for form-action
|
298
|
+
*/
|
299
|
+
formAction: {
|
300
|
+
type: String,
|
301
|
+
required: false
|
302
|
+
},
|
286
303
|
/**
|
287
304
|
* configuration for form-elements used in form
|
288
305
|
*/
|
@@ -346,7 +363,7 @@ export default {
|
|
346
363
|
required: false,
|
347
364
|
type: "text"
|
348
365
|
},
|
349
|
-
|
366
|
+
userMessage: {
|
350
367
|
required: false,
|
351
368
|
element: "textarea"
|
352
369
|
},
|
@@ -400,29 +417,50 @@ export default {
|
|
400
417
|
}
|
401
418
|
},
|
402
419
|
mounted() {
|
403
|
-
this.$refs.dataPrivacy?.querySelector(
|
420
|
+
this.$refs.dataPrivacy?.querySelector(".fancybox")?.addEventListener("click", event => {
|
404
421
|
event.preventDefault()
|
405
|
-
openFancyBox({url: event.target.getAttribute(
|
422
|
+
openFancyBox({url: event.target.getAttribute("href")})
|
406
423
|
})
|
407
424
|
},
|
408
425
|
methods: {
|
409
426
|
onSubmit(event) {
|
410
|
-
this.onValidate()
|
427
|
+
this.onValidate()
|
411
428
|
|
412
429
|
this.formData = Object.assign({}, this.validator.validatePrivacy(this.formData));
|
413
|
-
|
414
|
-
|
415
|
-
|
430
|
+
|
431
|
+
if (this.formData.error || this.useNativeSubmit) {
|
432
|
+
if(this.formData.error) {
|
433
|
+
// prevent original event from CmdForm (to avoid submit and reload)
|
434
|
+
event.originalEvent.preventDefault()
|
435
|
+
}
|
436
|
+
return
|
437
|
+
}
|
438
|
+
|
439
|
+
// custom submit of form-data
|
440
|
+
const customSubmitFormData = new FormData()
|
441
|
+
// get keys for form-elements from configuration
|
442
|
+
const configurationEntries = Object.keys(this.configuration)
|
443
|
+
|
444
|
+
for(let i = 0; i < configurationEntries.length; i++) {
|
445
|
+
// assign formData values to form-element key
|
446
|
+
customSubmitFormData.set(configurationEntries[i], this.formData[configurationEntries[i]].value)
|
416
447
|
}
|
417
448
|
|
418
|
-
|
449
|
+
fetch(this.formAction, {method: "POST", body: customSubmitFormData}).then((response) => {
|
450
|
+
if(response.ok) {
|
451
|
+
console.log("CmdBasicForm", "ok")
|
452
|
+
} else {
|
453
|
+
console.log("CmdBasicForm", "fail")
|
454
|
+
}
|
455
|
+
}).catch((error) => {
|
456
|
+
console.error(error)
|
457
|
+
})
|
458
|
+
|
459
|
+
// prevent original levent form CmdForm (to avoid submit and reload)
|
460
|
+
event.originalEvent.preventDefault()
|
419
461
|
},
|
420
462
|
onCountrySelect(event) {
|
421
|
-
|
422
|
-
console.log("country selected", event)
|
423
|
-
if (event === 'us' || event === 'uk') {
|
424
|
-
this.cityBeforeZip = true
|
425
|
-
}
|
463
|
+
this.cityBeforeZip = event === 'us' || event === 'uk';
|
426
464
|
},
|
427
465
|
onValidate() {
|
428
466
|
this.formData = Object.assign({}, this.validator.validate(this.formData));
|
@@ -438,7 +476,7 @@ export default {
|
|
438
476
|
}
|
439
477
|
},
|
440
478
|
watch: {
|
441
|
-
|
479
|
+
showCityBeforeZip() {
|
442
480
|
this.cityBeforeZip = this.showCityBeforeZip
|
443
481
|
}
|
444
482
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<template>
|
2
2
|
<ul class="cmd-breadcrumbs">
|
3
|
-
<li v-if="breadcrumbLabel">{{ breadcrumbLabel }}</li>
|
3
|
+
<li v-if="breadcrumbLabel" class="breadcrumb-label">{{ breadcrumbLabel }}</li>
|
4
4
|
<li v-for="(link, index) in breadcrumbLinks || []" :key="index">
|
5
5
|
<!-- begin type 'href' -->
|
6
6
|
<a v-if="link.type === 'href'" :href="link.path">
|
@@ -84,7 +84,7 @@ export default {
|
|
84
84
|
padding: 0 calc(var(--default-padding) / 2);
|
85
85
|
}
|
86
86
|
|
87
|
-
|
87
|
+
&.breadcrumb-label {
|
88
88
|
margin-right: calc(var(--default-margin) / 2);
|
89
89
|
}
|
90
90
|
|
@@ -73,7 +73,7 @@
|
|
73
73
|
<!-- end CmdImage -->
|
74
74
|
</div>
|
75
75
|
<div v-else-if="fancyBoxContent" class="content" v-html="fancyBoxContent"></div>
|
76
|
-
<div v-else-if="fancyBoxElements" class="content"></div>
|
76
|
+
<div v-else-if="fancyBoxElements" class="content" ref="elements"></div>
|
77
77
|
<div v-else-if="fancyBoxGallery" class="content">
|
78
78
|
<!-- begin CmdSlideButton -->
|
79
79
|
<CmdSlideButton @click.prevent="showPrevItem" slideButtonType="prev"/>
|
@@ -259,7 +259,7 @@ const FancyBox = defineComponent({
|
|
259
259
|
required: false
|
260
260
|
},
|
261
261
|
/**
|
262
|
-
* list of
|
262
|
+
* list of shown elements (not images)
|
263
263
|
*/
|
264
264
|
elements: {
|
265
265
|
type: Array,
|
@@ -382,7 +382,7 @@ const FancyBox = defineComponent({
|
|
382
382
|
} else if (this.elements) {
|
383
383
|
this.fancyBoxElements = this.elements.map(el => el.cloneNode(true))
|
384
384
|
this.$nextTick(() => {
|
385
|
-
this.$
|
385
|
+
this.$refs.elements.append(...this.fancyBoxElements)
|
386
386
|
})
|
387
387
|
}
|
388
388
|
},
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<template>
|
2
|
-
<form class="cmd-form" :data-use-validation="useValidation" @submit="onSubmit" :class="{error: errorOccurred}" :novalidate="novalidate">
|
2
|
+
<form class="cmd-form" :action="formAction" :data-use-validation="useValidation" @submit="onSubmit" :class="{error: errorOccurred}" :novalidate="novalidate">
|
3
3
|
<template v-if="useFieldset">
|
4
4
|
<fieldset class="flex-container">
|
5
5
|
<legend :class="{hidden : !showLegend}">{{ textLegend }}</legend>
|
@@ -73,6 +73,13 @@ export default {
|
|
73
73
|
}
|
74
74
|
},
|
75
75
|
props: {
|
76
|
+
/**
|
77
|
+
* set url for form-action
|
78
|
+
*/
|
79
|
+
formAction: {
|
80
|
+
type: String,
|
81
|
+
required: false
|
82
|
+
},
|
76
83
|
/**
|
77
84
|
* activate if form-elements should be given by slot
|
78
85
|
*/
|
@@ -153,10 +160,11 @@ export default {
|
|
153
160
|
submitFormData(event) {
|
154
161
|
// fill formdata with names and value
|
155
162
|
let formdata = {}
|
156
|
-
this.formElements
|
157
|
-
|
158
|
-
|
159
|
-
|
163
|
+
if(this.formElements) {
|
164
|
+
this.formElements.forEach((element) => {
|
165
|
+
formdata[element.name] = this.formValues[element.name]
|
166
|
+
})
|
167
|
+
}
|
160
168
|
this.$emit("submit", {originalEvent: event, formdata: formdata})
|
161
169
|
},
|
162
170
|
onSubmit(event) {
|
@@ -16,6 +16,7 @@
|
|
16
16
|
v-if="buttonPrintView.show"
|
17
17
|
:class="['button', {'primary': buttonPrintView.primary}]"
|
18
18
|
:title="buttonPrintView.text ? buttonPrintView.icon?.tooltip : null"
|
19
|
+
@click="showFancyBox"
|
19
20
|
>
|
20
21
|
<span v-if="buttonPrintView.icon?.show" :class="buttonPrintView.icon?.iconClass"></span>
|
21
22
|
<span v-if="buttonPrintView.text">{{buttonPrintView.text}}</span>
|
@@ -26,6 +27,8 @@
|
|
26
27
|
</template>
|
27
28
|
|
28
29
|
<script>
|
30
|
+
import { openFancyBox } from "./CmdFancyBox.vue"
|
31
|
+
|
29
32
|
export default {
|
30
33
|
name: "CmdPageFooter",
|
31
34
|
props: {
|
@@ -60,6 +63,38 @@ export default {
|
|
60
63
|
cmdSocialNetworks: {
|
61
64
|
type: Array,
|
62
65
|
required: false
|
66
|
+
},
|
67
|
+
/**
|
68
|
+
* properties for CmdFancyBox-component
|
69
|
+
*/
|
70
|
+
cmdFancyBox: {
|
71
|
+
type: Object,
|
72
|
+
default() {
|
73
|
+
return {
|
74
|
+
showPrintButtons: true,
|
75
|
+
defaultAriaLabelText: "print-preview"
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
79
|
+
},
|
80
|
+
methods: {
|
81
|
+
showFancyBox() {
|
82
|
+
let elements = []
|
83
|
+
if(typeof this.cmdFancyBox.elements === "function") {
|
84
|
+
elements = this.cmdFancyBox.elements()
|
85
|
+
} else {
|
86
|
+
elements = [document.querySelector("main")]
|
87
|
+
}
|
88
|
+
|
89
|
+
openFancyBox({
|
90
|
+
elements: elements,
|
91
|
+
showPrintButtons: this.cmdFancyBox.showPrintButtons,
|
92
|
+
defaultAriaLabelText: this.cmdFancyBox.defaultAriaLabelText,
|
93
|
+
cmdHeadline: this.cmdFancyBox.cmdHeadline,
|
94
|
+
showOverlay: this.cmdFancyBox.showOverlay,
|
95
|
+
showSubmitButtons: this.cmdFancyBox.showSubmitButtons,
|
96
|
+
allowEscapeKey: this.cmdFancyBox.allowEscapeKey
|
97
|
+
})
|
63
98
|
}
|
64
99
|
}
|
65
100
|
}
|
@@ -90,6 +125,7 @@ export default {
|
|
90
125
|
justify-content: flex-end;
|
91
126
|
margin-left: auto;
|
92
127
|
gap: calc(var(--default-gap) / 2);
|
128
|
+
flex: none;
|
93
129
|
}
|
94
130
|
}
|
95
131
|
/* end cmd-page-footer -------------------------------------------------------------------------------------------- */
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<template>
|
2
|
-
<header class="cmd-page-header flex-container">
|
2
|
+
<header v-if="cmdBreadcrumbs || cmdHeadline || $slots.default" class="cmd-page-header flex-container">
|
3
3
|
<div v-if="cmdBreadcrumbs || cmdHeadline" class="headline-wrapper flex-container vertical">
|
4
4
|
<!-- begin CmdBreadcrumbs -->
|
5
5
|
<CmdBreadcrumbs v-if="cmdBreadcrumbs" v-bind="cmdBreadcrumbs" />
|
@@ -11,7 +11,7 @@
|
|
11
11
|
</div>
|
12
12
|
|
13
13
|
<!-- begin slot -->
|
14
|
-
<slot></slot>
|
14
|
+
<slot v-if="$slots.default"></slot>
|
15
15
|
<!-- end slot -->
|
16
16
|
</header>
|
17
17
|
</template>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<template>
|
2
|
-
<div class="cmd-site-footer">
|
2
|
+
<div class="cmd-site-footer site-footer">
|
3
3
|
<footer :class="['flex-container', {vertical: orientation === 'vertical'}]">
|
4
4
|
<slot></slot>
|
5
5
|
</footer>
|
@@ -31,8 +31,6 @@ export default {
|
|
31
31
|
/* begin cmd-site-footer ---------------------------------------------------------------------------------------- */
|
32
32
|
.cmd-site-footer {
|
33
33
|
padding: var(--grid-gap) 0;
|
34
|
-
border-top: var(--default-border);
|
35
|
-
background: var(--default-background);
|
36
34
|
margin-top: auto;
|
37
35
|
flex: none;
|
38
36
|
|
@@ -95,7 +95,7 @@ export default {
|
|
95
95
|
a:not([class*="active"]) {
|
96
96
|
filter: contrast(.5);
|
97
97
|
|
98
|
-
&:hover, &:focus-visible, &:active, &.active {
|
98
|
+
&:hover, &:focus-visible, &:active, &.active, &.router-link-active {
|
99
99
|
filter: none;
|
100
100
|
padding: 0; /* overwrite default settings from frontend-framework for .active */
|
101
101
|
background: none; /* overwrite default settings from frontend-framework for .active */
|
package/src/index.js
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
export { default as CmdAddressData } from '@/components/CmdAddressData.vue'
|
3
3
|
export { default as CmdBackToTopButton } from '@/components/CmdBackToTopButton.vue'
|
4
4
|
export { default as CmdBankAccountData } from '@/components/CmdBankAccountData.vue'
|
5
|
+
export { default as CmdBasicForm } from '@/components/CmdBasicForm.vue'
|
5
6
|
export { default as CmdBox } from '@/components/CmdBox.vue'
|
6
7
|
export { default as CmdBoxWrapper } from '@/components/CmdBoxWrapper.vue'
|
7
8
|
export { default as CmdBreadcrumbs } from '@/components/CmdBreadcrumbs.vue'
|
@@ -51,7 +52,6 @@ export { default as CmdWidthLimitationWrapper } from '@/components/CmdWidthLimit
|
|
51
52
|
export { default as EditComponentWrapper } from '@/components/EditComponentWrapper.vue'
|
52
53
|
|
53
54
|
// export page-components
|
54
|
-
export { default as BasicForm } from '@/pages/BasicForm.vue'
|
55
55
|
export { default as ContactInformation } from '@/pages/ContactInformation.vue'
|
56
56
|
export { default as MultipleBoxWrapper } from '@/pages/MultipleBoxWrapper.vue'
|
57
57
|
export { default as MultipleListsOfLinks } from '@/pages/MultipleListsOfLinks.vue'
|
@@ -24,8 +24,8 @@ export default {
|
|
24
24
|
"basic_form.labeltext.country": "Country:",
|
25
25
|
"basic_form.labeltext.additional_address_info": "Additional address information:",
|
26
26
|
"basic_form.placeholder.additional_address_info": "Additional address information",
|
27
|
-
"basic_form.labeltext.
|
28
|
-
"basic_form.placeholder.
|
27
|
+
"basic_form.labeltext.user_message": "Your message:",
|
28
|
+
"basic_form.placeholder.user_message": "Your message",
|
29
29
|
"basic_form.labeltext.data_privacy": "I accept handling and saving of my personal data a mentioned in the <a href='/content/data-privacy-en.html' class='fancybox'>private policy</a>."
|
30
30
|
}
|
31
31
|
}
|
@@ -1,12 +1,4 @@
|
|
1
1
|
<template>
|
2
|
-
<!-- begin basic-form ------------------------------------------------------------------------------------------------------------------------------------------------------->
|
3
|
-
<CmdWidthLimitationWrapper>
|
4
|
-
<h2 class="headline-demopage" id="section-basic-form">
|
5
|
-
<span>Basic Form</span>
|
6
|
-
</h2>
|
7
|
-
<BasicForm :formAction="basicForm.formAction" />
|
8
|
-
</CmdWidthLimitationWrapper>
|
9
|
-
<!-- end basic-form ------------------------------------------------------------------------------------------------------------------------------------------------------->
|
10
2
|
|
11
3
|
<!-- begin basic-form ------------------------------------------------------------------------------------------------------------------------------------------------------->
|
12
4
|
<CmdWidthLimitationWrapper>
|
@@ -66,41 +58,7 @@ export default {
|
|
66
58
|
faqsData,
|
67
59
|
boxesTeamOverviewData,
|
68
60
|
listOfDownloadsData,
|
69
|
-
listOfSiteLinksData
|
70
|
-
basicForm: {
|
71
|
-
configuration: {
|
72
|
-
salutation: {
|
73
|
-
name: "salutation",
|
74
|
-
default: "m",
|
75
|
-
replaceInputType: true
|
76
|
-
},
|
77
|
-
lastName: {
|
78
|
-
name: "surname",
|
79
|
-
required: true,
|
80
|
-
type: "text"
|
81
|
-
},
|
82
|
-
firstName: {
|
83
|
-
required: false,
|
84
|
-
type: "text"
|
85
|
-
},
|
86
|
-
email: {
|
87
|
-
required: true,
|
88
|
-
type: "email"
|
89
|
-
},
|
90
|
-
phone: {
|
91
|
-
required: false,
|
92
|
-
type: "phone"
|
93
|
-
},
|
94
|
-
additionalText: {
|
95
|
-
required: false,
|
96
|
-
element: "textarea"
|
97
|
-
},
|
98
|
-
acceptPrivacy: {
|
99
|
-
required: true,
|
100
|
-
replaceInputType: true
|
101
|
-
}
|
102
|
-
}
|
103
|
-
}
|
61
|
+
listOfSiteLinksData
|
104
62
|
}
|
105
63
|
}
|
106
64
|
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
// noinspection CommaExpressionJS
|
2
|
+
class ContactFormValidator {
|
3
|
+
static PATTERN_SURNAME = /^[a-züöäßáéíóàèìòêîô '-]+$/i
|
4
|
+
static PATTERN_EMAIL = /^[a-z\d._%+-]+@[a-z\d._%+-]+\.[a-z]{2,}$/i
|
5
|
+
static PATTERN_MESSAGE = /^.{2,500}$/
|
6
|
+
|
7
|
+
label
|
8
|
+
|
9
|
+
constructor(label) {
|
10
|
+
this.label = label
|
11
|
+
}
|
12
|
+
|
13
|
+
validate(formData) {
|
14
|
+
[formData.lastName.error, formData.lastName.errorMessage] = this.validateRequired(
|
15
|
+
formData.lastName.value, ContactFormValidator.PATTERN_SURNAME, this.label('form_error_invalid_surname'))
|
16
|
+
[formData.email.error, formData.email.errorMessage] = this.validateRequired(
|
17
|
+
formData.email.value, ContactFormValidator.PATTERN_EMAIL, this.label('form_error_invalid_email'))
|
18
|
+
[formData.additionalText.error, formData.additionalText.errorMessage] = this.validateRequired(
|
19
|
+
formData.additionalText.value, ContactFormValidator.PATTERN_MESSAGE, this.label('form_error_invalid_message'))
|
20
|
+
formData.acceptPrivacy.error = false
|
21
|
+
formData.error = formData.lastName.error
|
22
|
+
|| formData.email.error
|
23
|
+
|| formData.additionalText.error
|
24
|
+
return formData
|
25
|
+
}
|
26
|
+
|
27
|
+
validatePrivacy(formData) {
|
28
|
+
formData.acceptPrivacy.error = !formData.acceptPrivacy.value
|
29
|
+
formData.acceptPrivacy.errorMessage = formData.acceptPrivacy.error ? this.label('form_error_missing_privacy_consent') : ''
|
30
|
+
formData.error = formData.error || formData.acceptPrivacy.error
|
31
|
+
return formData
|
32
|
+
}
|
33
|
+
|
34
|
+
validateRequired(value, pattern, errorMessage) {
|
35
|
+
if (!value || value.trim().length === 0) {
|
36
|
+
return [true, this.label('form_error_empty')]
|
37
|
+
}
|
38
|
+
if (pattern && !pattern.test(value)) {
|
39
|
+
return [true, errorMessage || this.label('form_error_invalid')]
|
40
|
+
}
|
41
|
+
return [false, '']
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
export { ContactFormValidator }
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3
|
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
4
|
-
<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
5
|
-
width="850.395px" height="566.929px" viewBox="0 0 850.395 566.929" enable-background="new 0 0 850.395 566.929"
|
6
|
-
xml:space="preserve">
|
7
|
-
<symbol id="Stern" viewBox="-80.297 -76.367 160.595 152.734">
|
8
|
-
<polygon fill="#FFDE08" points="0,76.367 20.678,20.397 80.298,18.027 33.457,-18.934 49.627,-76.367 0,-43.241 -49.626,-76.367
|
9
|
-
-33.457,-18.934 -80.297,18.027 -20.677,20.397 "/>
|
10
|
-
</symbol>
|
11
|
-
<g id="cn">
|
12
|
-
<g>
|
13
|
-
<rect fill="#DF2B14" width="850.395" height="566.929"/>
|
14
|
-
|
15
|
-
<use xlink:href="#Stern" width="160.595" height="152.734" x="-80.297" y="-76.367" transform="matrix(1 0 0 -1 141.4941 133.5356)" overflow="visible"/>
|
16
|
-
|
17
|
-
<use xlink:href="#Stern" width="160.595" height="152.734" x="-80.297" y="-76.367" transform="matrix(0.318 0.1158 0.1158 -0.318 282.7402 57.1685)" overflow="visible"/>
|
18
|
-
|
19
|
-
<use xlink:href="#Stern" width="160.595" height="152.734" x="-80.297" y="-76.367" transform="matrix(0.318 -0.1158 -0.1158 -0.318 341.1777 115.0728)" overflow="visible"/>
|
20
|
-
|
21
|
-
<use xlink:href="#Stern" width="160.595" height="152.734" x="-80.297" y="-76.367" transform="matrix(0.318 0.1158 0.1158 -0.318 284.2407 256.6177)" overflow="visible"/>
|
22
|
-
|
23
|
-
<use xlink:href="#Stern" width="160.595" height="152.734" x="-80.297" y="-76.367" transform="matrix(0.3384 0 0 -0.3384 340.73 194.541)" overflow="visible"/>
|
24
|
-
</g>
|
25
|
-
</g>
|
26
|
-
</svg>
|