hr-design-system-handlebars 1.110.3 → 1.110.5
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/CHANGELOG.md +25 -0
- package/dist/assets/index.css +3 -3
- package/dist/assets/js/alpine.js +1 -1
- package/dist/assets/js/components/forms/inputHandler.alpine.js +20 -7
- package/dist/views/components/forms/choice.hbs +15 -7
- package/dist/views/components/forms/choiceGroup.hbs +10 -2
- package/dist/views/components/forms/fields.hbs +2 -1
- package/dist/views/components/forms/input.hbs +1 -2
- package/dist/views/components/teaser/cluster/teaser_cluster_item.hbs +1 -1
- package/dist/views/components/teaser/cluster/teaser_cluster_list.hbs +2 -2
- package/dist/views_static/components/forms/choice.hbs +15 -7
- package/dist/views_static/components/forms/choiceGroup.hbs +10 -2
- package/dist/views_static/components/forms/fields.hbs +2 -1
- package/dist/views_static/components/forms/input.hbs +1 -2
- package/dist/views_static/components/teaser/cluster/teaser_cluster_item.hbs +1 -1
- package/dist/views_static/components/teaser/cluster/teaser_cluster_list.hbs +2 -2
- package/package.json +1 -1
- package/src/assets/fixtures/content/copytext/copytext_webform.json +8 -0
- package/src/assets/fixtures/forms/form_fields.inc.json +13 -1
- package/src/assets/js/alpine.js +1 -1
- package/src/stories/views/components/content/copytext/fixtures/copytext_webform.json +1 -1
- package/src/stories/views/components/forms/choice.hbs +15 -7
- package/src/stories/views/components/forms/choiceGroup.hbs +10 -2
- package/src/stories/views/components/forms/fields.hbs +2 -1
- package/src/stories/views/components/forms/fixtures/form_checkbox_grouped.json +1 -1
- package/src/stories/views/components/forms/fixtures/form_radio_grouped.json +1 -1
- package/src/stories/views/components/forms/form_checkbox.stories.js +2 -2
- package/src/stories/views/components/forms/form_checkbox_grouped.stories.js +2 -2
- package/src/stories/views/components/forms/form_group.stories.js +1 -1
- package/src/stories/views/components/forms/form_radio_grouped.stories.js +2 -2
- package/src/stories/views/components/forms/form_select.stories.js +1 -1
- package/src/stories/views/components/forms/form_textfields.stories.js +1 -1
- package/src/stories/views/components/forms/input.hbs +1 -2
- package/src/stories/views/components/forms/inputHandler.alpine.js +20 -7
- package/src/stories/views/components/teaser/cluster/teaser_cluster_item.hbs +1 -1
- package/src/stories/views/components/teaser/cluster/teaser_cluster_list.hbs +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
# v1.110.5 (Mon Oct 14 2024)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- :recycle: remove unused css classes [#1109](https://github.com/mumprod/hr-design-system-handlebars/pull/1109) ([@szuelch](https://github.com/szuelch))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- [@szuelch](https://github.com/szuelch)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# v1.110.4 (Mon Oct 14 2024)
|
|
14
|
+
|
|
15
|
+
#### 🐛 Bug Fix
|
|
16
|
+
|
|
17
|
+
- add choice-group validation [#1107](https://github.com/mumprod/hr-design-system-handlebars/pull/1107) (saad.elbaciri@hr.de [@selbaciri](https://github.com/selbaciri))
|
|
18
|
+
|
|
19
|
+
#### Authors: 2
|
|
20
|
+
|
|
21
|
+
- Saad El Baciri ([@selbaciri](https://github.com/selbaciri))
|
|
22
|
+
- selbaciri (saad.elbaciri@hr.de)
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
1
26
|
# v1.110.3 (Mon Oct 14 2024)
|
|
2
27
|
|
|
3
28
|
#### 🐛 Bug Fix
|
package/dist/assets/index.css
CHANGED
|
@@ -3593,7 +3593,7 @@ article.indexTextDS .indexTextHighlighted .link {
|
|
|
3593
3593
|
border-bottom-color: var(--color-secondary-ds);
|
|
3594
3594
|
}
|
|
3595
3595
|
.counter-reset {
|
|
3596
|
-
counter-reset:
|
|
3596
|
+
counter-reset: cnt1728910132020;
|
|
3597
3597
|
}
|
|
3598
3598
|
.placeholder-text-xs::-webkit-input-placeholder {
|
|
3599
3599
|
font-size: 0.75rem;
|
|
@@ -4007,7 +4007,7 @@ article.indexTextDS .indexTextHighlighted .link {
|
|
|
4007
4007
|
--tw-ring-color: rgba(255, 255, 255, 0.5);
|
|
4008
4008
|
}
|
|
4009
4009
|
.-ordered {
|
|
4010
|
-
counter-increment:
|
|
4010
|
+
counter-increment: cnt1728910132020 1;
|
|
4011
4011
|
}
|
|
4012
4012
|
.-ordered::before {
|
|
4013
4013
|
position: absolute;
|
|
@@ -4025,7 +4025,7 @@ article.indexTextDS .indexTextHighlighted .link {
|
|
|
4025
4025
|
--tw-text-opacity: 1;
|
|
4026
4026
|
color: rgba(0, 0, 0, 1);
|
|
4027
4027
|
color: rgba(0, 0, 0, var(--tw-text-opacity));
|
|
4028
|
-
content: counter(
|
|
4028
|
+
content: counter(cnt1728910132020);
|
|
4029
4029
|
}
|
|
4030
4030
|
/*! ****************************/
|
|
4031
4031
|
/*! DataPolicy stuff */
|
package/dist/assets/js/alpine.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
export default function inputHandler(element, formId, errorMandatory, type, errorEmail, prefilledText = '') {
|
|
1
|
+
export default function inputHandler(element, formId, errorMandatory, type, errorEmail, prefilledText = '', name) {
|
|
2
2
|
return {
|
|
3
3
|
[element]: prefilledText,
|
|
4
|
-
name: document.getElementById(element).getAttribute("name"),
|
|
5
4
|
valid: false,
|
|
6
5
|
wasFocused: false,
|
|
7
6
|
isFocused: false,
|
|
8
|
-
isChecked: false,
|
|
9
7
|
typeMismatch: true,
|
|
10
8
|
valueMissing: true,
|
|
11
9
|
|
|
@@ -21,14 +19,25 @@ export default function inputHandler(element, formId, errorMandatory, type, erro
|
|
|
21
19
|
}
|
|
22
20
|
}
|
|
23
21
|
},
|
|
22
|
+
anyChecked() {
|
|
23
|
+
var formElement = document.getElementById(formId);
|
|
24
|
+
var form_data = new FormData(formElement)
|
|
25
|
+
if(form_data.has(name)){
|
|
26
|
+
this.valid = true
|
|
27
|
+
}else{
|
|
28
|
+
this.valid = false
|
|
29
|
+
}
|
|
30
|
+
},
|
|
24
31
|
hideDescription() {
|
|
25
32
|
switch (type) {
|
|
26
33
|
case "email":
|
|
27
34
|
return Boolean((!this.valid && this.wasFocused && !this.isFocused) || (this.typeMismatch && this.wasFocused && !this.isFocused) || (!this.valid && !this.isFocused && this.$store.forms.submissionAttempted[formId]) || (this.hasServerError() && !this.isFocused ));
|
|
28
35
|
case "checkbox":
|
|
29
|
-
return Boolean(!this.valid && this.wasFocused && !this.isFocused
|
|
36
|
+
return Boolean((!this.valid && this.wasFocused && !this.isFocused) || (!this.valid && !this.isFocused && this.$store.forms.submissionAttempted[formId]) || (this.hasServerError() && !this.isFocused ));
|
|
30
37
|
case "select":
|
|
31
|
-
return Boolean((!this.valid && this.wasFocused && !this.isFocused) || (!this.valid && !this.isFocused && this.$store.forms.submissionAttempted[formId]) || (this.hasServerError() && !this.isFocused ))
|
|
38
|
+
return Boolean((!this.valid && this.wasFocused && !this.isFocused) || (!this.valid && !this.isFocused && this.$store.forms.submissionAttempted[formId]) || (this.hasServerError() && !this.isFocused ));
|
|
39
|
+
case "choice-group":
|
|
40
|
+
return Boolean((!this.valid && this.wasFocused && !this.isFocused) || (!this.valid && !this.isFocused && this.$store.forms.submissionAttempted[formId]));
|
|
32
41
|
default:
|
|
33
42
|
return Boolean((!this.valid && this.wasFocused && !this.isFocused) || (!this.valid && !this.isFocused && this.$store.forms.submissionAttempted[formId]) || (this.hasServerError() && !this.isFocused ));
|
|
34
43
|
}
|
|
@@ -42,12 +51,16 @@ export default function inputHandler(element, formId, errorMandatory, type, erro
|
|
|
42
51
|
this.valueMissing = field.validity.valueMissing;
|
|
43
52
|
this.valid = field.checkValidity()
|
|
44
53
|
},
|
|
54
|
+
validateChoice() {
|
|
55
|
+
var choice = document.getElementById(element)
|
|
56
|
+
this.valid = choice.checkValidity()
|
|
57
|
+
},
|
|
45
58
|
hasServerError() {
|
|
46
|
-
return Boolean(this.$store.forms.serverErrorFields[formId][
|
|
59
|
+
return Boolean(this.$store.forms.serverErrorFields[formId]?.[name]);
|
|
47
60
|
},
|
|
48
61
|
getServerError() {
|
|
49
62
|
let serverError = "Server Error: "
|
|
50
|
-
switch (this.$store.forms.serverErrorFields[formId][
|
|
63
|
+
switch (this.$store.forms.serverErrorFields[formId][name]) {
|
|
51
64
|
|
|
52
65
|
case 'form_error_required':
|
|
53
66
|
serverError += "Pflichtfeld"
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
<div class="relative flex flex-col w-full {{#unless _inGroup}} mb-6 md:mb-12{{/unless}} gap-y-4 md:gap-y-5"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
{{#unless _inGroup}}
|
|
3
|
+
{{#if _required}}
|
|
4
|
+
ax-load
|
|
5
|
+
x-data="inputHandler('input{{nextRandom}}','{{_formId}}','{{_errorMandatory}}','{{_type}}','', '', '{{_name}}')"
|
|
6
|
+
x-init="validateChoice()"
|
|
7
|
+
x-ignore
|
|
8
|
+
{{/if}}
|
|
9
|
+
{{/unless}}
|
|
5
10
|
>
|
|
6
11
|
<div class="flex flex-row items-center w-full gap-x-2 md:gap-x-3">
|
|
7
12
|
<input class="relative self-start flex-shrink-0 w-6 h-6 bg-white border appearance-none cursor-pointer {{~inline-switch _type '["checkbox","radio"]' '[" border-blue-science-hex checked:bg-blue-congress-hex checked:border-transparent"," border-blue-science-hex checked:bg-white checked:border-blue-congress-hex rounded-full",""]'}}"
|
|
8
13
|
:class="{' border-blue-science-hex': hideError(),'border-red-700': hideDescription() }"
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
{{#if _inGroup }}
|
|
15
|
+
@change="anyChecked()"
|
|
16
|
+
{{else}}
|
|
17
|
+
@change="validateChoice()"
|
|
18
|
+
{{/if}}
|
|
11
19
|
id="input{{getRandom}}"
|
|
12
20
|
{{#if _required}}
|
|
13
21
|
@focus="isFocused = true"
|
|
@@ -59,7 +67,7 @@
|
|
|
59
67
|
{{/if}}
|
|
60
68
|
</label>
|
|
61
69
|
</div>
|
|
62
|
-
|
|
70
|
+
{{#unless _inGroup}}
|
|
63
71
|
<div class="font-heading">
|
|
64
72
|
{{#if _description}}
|
|
65
73
|
<div class="text-xs text-gray-500" {{#if _required}}:class="{'hidden': hideDescription() }"{{/if}}>{{_description}}</div>
|
|
@@ -68,5 +76,5 @@
|
|
|
68
76
|
<div class="hidden text-xs text-red-700" :class="{'hidden': hideError()}" x-text="errorMessage"></div>
|
|
69
77
|
{{/if}}
|
|
70
78
|
</div>
|
|
71
|
-
|
|
79
|
+
{{/unless}}
|
|
72
80
|
</div>
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
<fieldset
|
|
1
|
+
<fieldset
|
|
2
|
+
{{#if _required}}
|
|
3
|
+
ax-load
|
|
4
|
+
x-data="inputHandler('input{{nextRandom}}','{{_formId}}','{{_errorMandatory}}','choice-group','', '', '{{_name}}')"
|
|
5
|
+
x-ignore
|
|
6
|
+
{{/if}}
|
|
7
|
+
>
|
|
2
8
|
<div class="relative flex flex-col w-full mb-6 md:mb-12 gap-y-4 md:gap-y-5">
|
|
3
9
|
<legend class="text-lg font-bold text-black md:text-xl font-heading">
|
|
4
10
|
{{#if _hasBody}}
|
|
@@ -19,19 +25,21 @@
|
|
|
19
25
|
{{> components/forms/choice
|
|
20
26
|
_type=../_type
|
|
21
27
|
_name=../_name
|
|
28
|
+
_required=(if ../_isRadio ../_required false)
|
|
22
29
|
_value=this.value
|
|
23
30
|
_inGroup=true
|
|
24
31
|
_label=this.label
|
|
25
32
|
_selected=this.selected
|
|
26
33
|
_title=this.title
|
|
27
34
|
_multipleChoice=../_multipleChoice
|
|
35
|
+
_formId=../_formId
|
|
28
36
|
}}
|
|
29
37
|
</div>
|
|
30
38
|
{{/each}}
|
|
31
39
|
</div>
|
|
32
40
|
<div class="font-heading">
|
|
33
41
|
{{#if _description}}
|
|
34
|
-
<div class="text-xs text-gray-500" {{#if _required}}:class="{'hidden': hideDescription()
|
|
42
|
+
<div class="text-xs text-gray-500" {{#if _required}}:class="{'hidden': hideDescription()}"{{/if}}>{{_description}}</div>
|
|
35
43
|
{{/if}}
|
|
36
44
|
{{#if _required}}
|
|
37
45
|
<div class="hidden text-xs text-red-700" :class="{'hidden': hideError()}" x-text="errorMessage"></div>
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
_description=this.description
|
|
66
66
|
_items=this.options
|
|
67
67
|
_required=this.isRequired
|
|
68
|
+
_isRadio=this.type.isRadioChoice
|
|
68
69
|
_multipleChoice=../_multipleChoice
|
|
69
70
|
_addClass=../_addClass
|
|
70
71
|
_errorMandatory="Bitte füllen Sie dieses Pflichtfeld aus"
|
|
@@ -85,7 +86,7 @@
|
|
|
85
86
|
}}
|
|
86
87
|
{{/if}}
|
|
87
88
|
{{else if this.type.isUpload}}
|
|
88
|
-
{{~>
|
|
89
|
+
{{~> components/forms/upload
|
|
89
90
|
_name=this.name
|
|
90
91
|
_label=this.label
|
|
91
92
|
_description=this.description
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div class=" relative flex flex-col w-full mb-5 {{_wrapperClass}}"
|
|
2
2
|
ax-load
|
|
3
|
-
x-data="inputHandler('input{{nextRandom}}','{{_formId}}','{{_errorMandatory}}',{{#if _isEmail}}'email'{{else}}'{{_type}}'{{/if}},'{{_errorEmail}}','{{#if _formField.forHtmlAttribute}}{{_formField.forHtmlAttribute}}{{else}}{{#if _value}}{{_value}}{{else}}{{_defaultValue}}{{/if}}{{/if}}')"
|
|
3
|
+
x-data="inputHandler('input{{nextRandom}}','{{_formId}}','{{_errorMandatory}}',{{#if _isEmail}}'email'{{else}}'{{_type}}'{{/if}},'{{_errorEmail}}','{{#if _formField.forHtmlAttribute}}{{_formField.forHtmlAttribute}}{{else}}{{#if _value}}{{_value}}{{else}}{{_defaultValue}}{{/if}}{{/if}}','{{_name}}')"
|
|
4
4
|
x-init="validateField()"
|
|
5
5
|
x-ignore
|
|
6
6
|
>
|
|
@@ -89,7 +89,6 @@
|
|
|
89
89
|
<div>errorMessage:<span x-text="errorMessage" class="font-bold" ></span></div>
|
|
90
90
|
<div>valueMissing:<span x-text="valueMissing" class="font-bold" ></span></div>
|
|
91
91
|
<div>typeMismatch:<span x-text="typeMismatch" class="font-bold" ></span></div>
|
|
92
|
-
<div>serverErrorFields[form{{getRandom}}][name]:<span x-text="getServerErrorFields('{{_name}}')" class="font-bold" ></span></div>
|
|
93
92
|
<div>submissionAttempted[form{{getRandom}}]:<span x-text="getSubmissionAttempted()" class="font-bold" :class="getSubmissionAttempted() ? 'text-green-800' : 'text-red-700'"></span></div>
|
|
94
93
|
|
|
95
94
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{{#>components/base/link _link=this.link _css=(appendToDefault (if _firstItem "ds-teaser-focus ") "block group") }}
|
|
1
|
+
{{#>components/base/link _link=this.link _css=(appendToDefault (if _firstItem " ds-teaser-focus ") "block group") }}
|
|
2
2
|
{{#if this.label}}
|
|
3
3
|
{{#> components/label/label_group _css=(if ../../_ordered-adjust_context "pl-8")}}
|
|
4
4
|
{{> components/label/label _type=this.label.type _text=(loca this.label.loca) _css=""}}
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
{{/if~}}
|
|
19
19
|
{{~#with this.clusterTeaserItems}}
|
|
20
20
|
{{~#if ../this.isOrdered}}
|
|
21
|
-
<ol class="ui-test-teaser-cluster__list mx-5 list-none divide-y divide-white divide-solid counter-reset border-t border-white{{~#if ../this.showFirstImageOrGenreImage}}{{~inline-switch ../this.realTeaserSize '["100"]' '[" md
|
|
21
|
+
<ol class="ui-test-teaser-cluster__list mx-5 list-none divide-y divide-white divide-solid counter-reset border-t border-white{{~#if ../this.showFirstImageOrGenreImage}}{{~inline-switch ../this.realTeaserSize '["100"]' '[" md:mx-0 md:pr-5 md:border-none md:basis-1/2-gap-6 lg:basis-2/3-gap-6"]'}}{{/if~}}">
|
|
22
22
|
{{else}}
|
|
23
|
-
<ul class="ui-test-teaser-cluster__list mx-5 divide-y divide-white divide-solid border-t border-white {{~#if ../this.showFirstImageOrGenreImage}}{{~inline-switch ../this.realTeaserSize '["100"]' '[" md
|
|
23
|
+
<ul class="ui-test-teaser-cluster__list mx-5 divide-y divide-white divide-solid border-t border-white {{~#if ../this.showFirstImageOrGenreImage}}{{~inline-switch ../this.realTeaserSize '["100"]' '[" md:mx-0 md:pr-5 md:border-none md:basis-1/2-gap-6 lg:basis-2/3-gap-6"]'}}{{/if~}}">
|
|
24
24
|
{{/if}}
|
|
25
25
|
{{~#each this~}}
|
|
26
26
|
<li class="ui-test-teaser-cluster__item {{#if ../../this.isOrdered}}-ordered{{/if}} py-3{{#unless ../../this.overviewLink.link}} last-of-type:pb-3{{/unless~}}{{~#if ../../this.showFirstImageOrGenreImage}}{{~inline-switch ../../this.realTeaserSize '["100"]' '[" md:first-of-type:pt-0"]'}}{{/if~}}">
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
<div class="relative flex flex-col w-full {{#unless _inGroup}} mb-6 md:mb-12{{/unless}} gap-y-4 md:gap-y-5"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
{{#unless _inGroup}}
|
|
3
|
+
{{#if _required}}
|
|
4
|
+
ax-load
|
|
5
|
+
x-data="inputHandler('input{{nextRandom}}','{{_formId}}','{{_errorMandatory}}','{{_type}}','', '', '{{_name}}')"
|
|
6
|
+
x-init="validateChoice()"
|
|
7
|
+
x-ignore
|
|
8
|
+
{{/if}}
|
|
9
|
+
{{/unless}}
|
|
5
10
|
>
|
|
6
11
|
<div class="flex flex-row items-center w-full gap-x-2 md:gap-x-3">
|
|
7
12
|
<input class="relative self-start flex-shrink-0 w-6 h-6 bg-white border appearance-none cursor-pointer {{~inline-switch _type '["checkbox","radio"]' '[" border-blue-science-hex checked:bg-blue-congress-hex checked:border-transparent"," border-blue-science-hex checked:bg-white checked:border-blue-congress-hex rounded-full",""]'}}"
|
|
8
13
|
:class="{' border-blue-science-hex': hideError(),'border-red-700': hideDescription() }"
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
{{#if _inGroup }}
|
|
15
|
+
@change="anyChecked()"
|
|
16
|
+
{{else}}
|
|
17
|
+
@change="validateChoice()"
|
|
18
|
+
{{/if}}
|
|
11
19
|
id="input{{getRandom}}"
|
|
12
20
|
{{#if _required}}
|
|
13
21
|
@focus="isFocused = true"
|
|
@@ -59,7 +67,7 @@
|
|
|
59
67
|
{{/if}}
|
|
60
68
|
</label>
|
|
61
69
|
</div>
|
|
62
|
-
|
|
70
|
+
{{#unless _inGroup}}
|
|
63
71
|
<div class="font-heading">
|
|
64
72
|
{{#if _description}}
|
|
65
73
|
<div class="text-xs text-gray-500" {{#if _required}}:class="{'hidden': hideDescription() }"{{/if}}>{{_description}}</div>
|
|
@@ -68,5 +76,5 @@
|
|
|
68
76
|
<div class="hidden text-xs text-red-700" :class="{'hidden': hideError()}" x-text="errorMessage"></div>
|
|
69
77
|
{{/if}}
|
|
70
78
|
</div>
|
|
71
|
-
|
|
79
|
+
{{/unless}}
|
|
72
80
|
</div>
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
<fieldset
|
|
1
|
+
<fieldset
|
|
2
|
+
{{#if _required}}
|
|
3
|
+
ax-load
|
|
4
|
+
x-data="inputHandler('input{{nextRandom}}','{{_formId}}','{{_errorMandatory}}','choice-group','', '', '{{_name}}')"
|
|
5
|
+
x-ignore
|
|
6
|
+
{{/if}}
|
|
7
|
+
>
|
|
2
8
|
<div class="relative flex flex-col w-full mb-6 md:mb-12 gap-y-4 md:gap-y-5">
|
|
3
9
|
<legend class="text-lg font-bold text-black md:text-xl font-heading">
|
|
4
10
|
{{#if _hasBody}}
|
|
@@ -19,19 +25,21 @@
|
|
|
19
25
|
{{> components/forms/choice
|
|
20
26
|
_type=../_type
|
|
21
27
|
_name=../_name
|
|
28
|
+
_required=(if ../_isRadio ../_required false)
|
|
22
29
|
_value=this.value
|
|
23
30
|
_inGroup=true
|
|
24
31
|
_label=this.label
|
|
25
32
|
_selected=this.selected
|
|
26
33
|
_title=this.title
|
|
27
34
|
_multipleChoice=../_multipleChoice
|
|
35
|
+
_formId=../_formId
|
|
28
36
|
}}
|
|
29
37
|
</div>
|
|
30
38
|
{{/each}}
|
|
31
39
|
</div>
|
|
32
40
|
<div class="font-heading">
|
|
33
41
|
{{#if _description}}
|
|
34
|
-
<div class="text-xs text-gray-500" {{#if _required}}:class="{'hidden': hideDescription()
|
|
42
|
+
<div class="text-xs text-gray-500" {{#if _required}}:class="{'hidden': hideDescription()}"{{/if}}>{{_description}}</div>
|
|
35
43
|
{{/if}}
|
|
36
44
|
{{#if _required}}
|
|
37
45
|
<div class="hidden text-xs text-red-700" :class="{'hidden': hideError()}" x-text="errorMessage"></div>
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
_description=this.description
|
|
66
66
|
_items=this.options
|
|
67
67
|
_required=this.isRequired
|
|
68
|
+
_isRadio=this.type.isRadioChoice
|
|
68
69
|
_multipleChoice=../_multipleChoice
|
|
69
70
|
_addClass=../_addClass
|
|
70
71
|
_errorMandatory="Bitte füllen Sie dieses Pflichtfeld aus"
|
|
@@ -85,7 +86,7 @@
|
|
|
85
86
|
}}
|
|
86
87
|
{{/if}}
|
|
87
88
|
{{else if this.type.isUpload}}
|
|
88
|
-
{{~>
|
|
89
|
+
{{~> components/forms/upload
|
|
89
90
|
_name=this.name
|
|
90
91
|
_label=this.label
|
|
91
92
|
_description=this.description
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div class=" relative flex flex-col w-full mb-5 {{_wrapperClass}}"
|
|
2
2
|
ax-load
|
|
3
|
-
x-data="inputHandler('input{{nextRandom}}','{{_formId}}','{{_errorMandatory}}',{{#if _isEmail}}'email'{{else}}'{{_type}}'{{/if}},'{{_errorEmail}}','{{#if _formField.forHtmlAttribute}}{{_formField.forHtmlAttribute}}{{else}}{{#if _value}}{{_value}}{{else}}{{_defaultValue}}{{/if}}{{/if}}')"
|
|
3
|
+
x-data="inputHandler('input{{nextRandom}}','{{_formId}}','{{_errorMandatory}}',{{#if _isEmail}}'email'{{else}}'{{_type}}'{{/if}},'{{_errorEmail}}','{{#if _formField.forHtmlAttribute}}{{_formField.forHtmlAttribute}}{{else}}{{#if _value}}{{_value}}{{else}}{{_defaultValue}}{{/if}}{{/if}}','{{_name}}')"
|
|
4
4
|
x-init="validateField()"
|
|
5
5
|
x-ignore
|
|
6
6
|
>
|
|
@@ -89,7 +89,6 @@
|
|
|
89
89
|
<div>errorMessage:<span x-text="errorMessage" class="font-bold" ></span></div>
|
|
90
90
|
<div>valueMissing:<span x-text="valueMissing" class="font-bold" ></span></div>
|
|
91
91
|
<div>typeMismatch:<span x-text="typeMismatch" class="font-bold" ></span></div>
|
|
92
|
-
<div>serverErrorFields[form{{getRandom}}][name]:<span x-text="getServerErrorFields('{{_name}}')" class="font-bold" ></span></div>
|
|
93
92
|
<div>submissionAttempted[form{{getRandom}}]:<span x-text="getSubmissionAttempted()" class="font-bold" :class="getSubmissionAttempted() ? 'text-green-800' : 'text-red-700'"></span></div>
|
|
94
93
|
|
|
95
94
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{{#>components/base/link _link=this.link _css=(appendToDefault (if _firstItem "ds-teaser-focus ") "block group") }}
|
|
1
|
+
{{#>components/base/link _link=this.link _css=(appendToDefault (if _firstItem " ds-teaser-focus ") "block group") }}
|
|
2
2
|
{{#if this.label}}
|
|
3
3
|
{{#> components/label/label_group _css=(if _ordered "pl-8")}}
|
|
4
4
|
{{> components/label/label _type=this.label.type _text=(loca this.label.loca) _css=""}}
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
{{/if~}}
|
|
19
19
|
{{~#with this.clusterTeaserItems}}
|
|
20
20
|
{{~#if ../this.isOrdered}}
|
|
21
|
-
<ol class="ui-test-teaser-cluster__list mx-5 list-none divide-y divide-white divide-solid counter-reset border-t border-white{{~#if ../this.showFirstImageOrGenreImage}}{{~inline-switch ../this.realTeaserSize '["100"]' '[" md
|
|
21
|
+
<ol class="ui-test-teaser-cluster__list mx-5 list-none divide-y divide-white divide-solid counter-reset border-t border-white{{~#if ../this.showFirstImageOrGenreImage}}{{~inline-switch ../this.realTeaserSize '["100"]' '[" md:mx-0 md:pr-5 md:border-none md:basis-1/2-gap-6 lg:basis-2/3-gap-6"]'}}{{/if~}}">
|
|
22
22
|
{{else}}
|
|
23
|
-
<ul class="ui-test-teaser-cluster__list mx-5 divide-y divide-white divide-solid border-t border-white {{~#if ../this.showFirstImageOrGenreImage}}{{~inline-switch ../this.realTeaserSize '["100"]' '[" md
|
|
23
|
+
<ul class="ui-test-teaser-cluster__list mx-5 divide-y divide-white divide-solid border-t border-white {{~#if ../this.showFirstImageOrGenreImage}}{{~inline-switch ../this.realTeaserSize '["100"]' '[" md:mx-0 md:pr-5 md:border-none md:basis-1/2-gap-6 lg:basis-2/3-gap-6"]'}}{{/if~}}">
|
|
24
24
|
{{/if}}
|
|
25
25
|
{{~#each this~}}
|
|
26
26
|
<li class="ui-test-teaser-cluster__item {{#if ../../this.isOrdered}}-ordered{{/if}} py-3{{#unless ../../this.overviewLink.link}} last-of-type:pb-3{{/unless~}}{{~#if ../../this.showFirstImageOrGenreImage}}{{~inline-switch ../../this.realTeaserSize '["100"]' '[" md:first-of-type:pt-0"]'}}{{/if~}}">
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"repository": "https://github.com/szuelch/hr-design-system-handlebars",
|
|
9
|
-
"version": "1.110.
|
|
9
|
+
"version": "1.110.5",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
12
|
"storybook": "storybook dev -p 6006 public",
|
|
@@ -22,6 +22,14 @@
|
|
|
22
22
|
"@->jsoninclude": "forms/form_fields.inc.json",
|
|
23
23
|
"@->contentpath": "input-text-nachname-required"
|
|
24
24
|
},
|
|
25
|
+
{
|
|
26
|
+
"@->jsoninclude": "forms/form_fields.inc.json",
|
|
27
|
+
"@->contentpath": "checkbox-group"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"@->jsoninclude": "forms/form_fields.inc.json",
|
|
31
|
+
"@->contentpath": "radio-group"
|
|
32
|
+
},
|
|
25
33
|
{
|
|
26
34
|
"@->jsoninclude": "forms/form_fields.inc.json",
|
|
27
35
|
"@->contentpath": "checkbox",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"label":"Wählen Sie Ihre Interessen",
|
|
105
105
|
"isMeta":false,
|
|
106
106
|
"description":"Bitte kreuzen Sie alle Interessen an, die auf Sie zutreffen. Ihre Auswahl hilft uns, Ihnen relevante Inhalte anzubieten.",
|
|
107
|
-
"isRequired":
|
|
107
|
+
"isRequired":false,
|
|
108
108
|
"options":[
|
|
109
109
|
{
|
|
110
110
|
"value":"sport",
|
|
@@ -161,6 +161,7 @@
|
|
|
161
161
|
"isGrouped":true,
|
|
162
162
|
"type":{
|
|
163
163
|
"isChoice":true,
|
|
164
|
+
"isRadioChoice":true,
|
|
164
165
|
"asString":"radio"
|
|
165
166
|
},
|
|
166
167
|
"name":"lieblingsfarbe",
|
|
@@ -234,5 +235,16 @@
|
|
|
234
235
|
},
|
|
235
236
|
"caption": "Eine Gruppe mit Überschrift",
|
|
236
237
|
"fields": []
|
|
238
|
+
},
|
|
239
|
+
"upload":
|
|
240
|
+
{
|
|
241
|
+
"type":{
|
|
242
|
+
"isUpload":true,
|
|
243
|
+
"asString":"upload"
|
|
244
|
+
},
|
|
245
|
+
"name":"lieblingsfarbe",
|
|
246
|
+
"label":"Wählen Sie Ihre Lieblingsfarbe",
|
|
247
|
+
"description":"Bitte wählen Sie eine der folgenden Farben aus.",
|
|
248
|
+
"isRequired":false
|
|
237
249
|
}
|
|
238
250
|
}
|
package/src/assets/js/alpine.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"copytextParagraph":[{"isHeadline":true,"text":"Copytext mit Formular"},{"paragraphBoxItem":{"isWebForm":true,"hasNewWebForm":true,"title":"Kontaktformular","jsonUrl":"https://ugc-hessenschau.dev-ext.hrcms.gcp.cloud.hr.de","errorMessages":"errorMessages","isMultipart":"isMultipart","trackingInformations":"trackingInformations","fields":[{"type":{"isText":true,"asString":"text"},"name":"vorname","label":"Vorname","description":"Das ist der Beschreibungstext (*Pflichtfeld)","defaultValue":"","isHidden":false,"isRequired":true,"maxLength":"140"},{"type":{"isText":true,"asString":"text"},"name":"nachname","label":"Nachname","description":"","defaultValue":"","isHidden":false,"isRequired":true,"maxLength":"140"},{"isGrouped":false,"type":{"isChoice":true,"asString":"checkbox"},"name":"checkbox","label":"Ich bin damit einverstanden, dass der hr die von mir im vorstehenden Formular angegebenen personenbezogenen Daten für den Zweck der Kontaktaufnahme mit Upload verarbeitet. Eine Weitergabe an Dritte findet nicht statt, es sei denn, es wird ausdrücklich darauf hingewiesen. Unsere Datenschutzerklärung mit sämtlichen Informationen gemäß Art 13 DSGVO zur Datenverarbeitung durch den hr und zu Ihren Rechten können Sie unter Datenschutzerklärung einsehen. Den Datenschutzbeauftragten des hr erreichen Sie unter datenschutz@hr.de.","isMeta":false,"description":"Das ist der Beschreibungstext von Checkbox","isRequired":true}]}}]}
|
|
1
|
+
{"copytextParagraph":[{"isHeadline":true,"text":"Copytext mit Formular"},{"paragraphBoxItem":{"isWebForm":true,"hasNewWebForm":true,"title":"Kontaktformular","jsonUrl":"https://ugc-hessenschau.dev-ext.hrcms.gcp.cloud.hr.de","errorMessages":"errorMessages","isMultipart":"isMultipart","trackingInformations":"trackingInformations","fields":[{"type":{"isText":true,"asString":"text"},"name":"vorname","label":"Vorname","description":"Das ist der Beschreibungstext (*Pflichtfeld)","defaultValue":"","isHidden":false,"isRequired":true,"maxLength":"140"},{"type":{"isText":true,"asString":"text"},"name":"nachname","label":"Nachname","description":"","defaultValue":"","isHidden":false,"isRequired":true,"maxLength":"140"},{"isGrouped":true,"type":{"isChoice":true,"asString":"checkbox"},"name":"interessen","label":"Wählen Sie Ihre Interessen","isMeta":false,"description":"Bitte kreuzen Sie alle Interessen an, die auf Sie zutreffen. Ihre Auswahl hilft uns, Ihnen relevante Inhalte anzubieten.","isRequired":false,"options":[{"value":"sport","label":"sport","title":"sport","isSelected":false},{"value":"musik","label":"musik","title":"musik","isSelected":false},{"value":"lesen","label":"lesen","title":"lesen","isSelected":false},{"value":"reisen","label":"reisen","title":"reisen","isSelected":false},{"value":"kochen","label":"kochen","title":"kochen","isSelected":false},{"value":"filme","label":"filme","title":"filme","isSelected":false},{"value":"tanzen","label":"tanzen","title":"tanzen","isSelected":false},{"value":"fotografie","label":"fotografie","title":"fotografie","isSelected":false}]},{"isGrouped":true,"type":{"isChoice":true,"isRadioChoice":true,"asString":"radio"},"name":"lieblingsfarbe","label":"Wählen Sie Ihre Lieblingsfarbe","isMeta":false,"description":"Bitte wählen Sie eine der folgenden Farben aus.","isRequired":true,"options":[{"value":"rot","label":"rot","title":"rot","isSelected":false},{"value":"blau","label":"blau","title":"blau","isSelected":false},{"value":"grün","label":"grün","title":"grün","isSelected":false}]},{"isGrouped":false,"type":{"isChoice":true,"asString":"checkbox"},"name":"checkbox","label":"Ich bin damit einverstanden, dass der hr die von mir im vorstehenden Formular angegebenen personenbezogenen Daten für den Zweck der Kontaktaufnahme mit Upload verarbeitet. Eine Weitergabe an Dritte findet nicht statt, es sei denn, es wird ausdrücklich darauf hingewiesen. Unsere Datenschutzerklärung mit sämtlichen Informationen gemäß Art 13 DSGVO zur Datenverarbeitung durch den hr und zu Ihren Rechten können Sie unter Datenschutzerklärung einsehen. Den Datenschutzbeauftragten des hr erreichen Sie unter datenschutz@hr.de.","isMeta":false,"description":"Das ist der Beschreibungstext von Checkbox","isRequired":true}]}}]}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
<div class="relative flex flex-col w-full {{#unless _inGroup}} mb-6 md:mb-12{{/unless}} gap-y-4 md:gap-y-5"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
{{#unless _inGroup}}
|
|
3
|
+
{{#if _required}}
|
|
4
|
+
ax-load
|
|
5
|
+
x-data="inputHandler('input{{nextRandom}}','{{_formId}}','{{_errorMandatory}}','{{_type}}','', '', '{{_name}}')"
|
|
6
|
+
x-init="validateChoice()"
|
|
7
|
+
x-ignore
|
|
8
|
+
{{/if}}
|
|
9
|
+
{{/unless}}
|
|
5
10
|
>
|
|
6
11
|
<div class="flex flex-row items-center w-full gap-x-2 md:gap-x-3">
|
|
7
12
|
<input class="relative self-start flex-shrink-0 w-6 h-6 bg-white border appearance-none cursor-pointer {{~inline-switch _type '["checkbox","radio"]' '[" border-blue-science-hex checked:bg-blue-congress-hex checked:border-transparent"," border-blue-science-hex checked:bg-white checked:border-blue-congress-hex rounded-full",""]'}}"
|
|
8
13
|
:class="{' border-blue-science-hex': hideError(),'border-red-700': hideDescription() }"
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
{{#if _inGroup }}
|
|
15
|
+
@change="anyChecked()"
|
|
16
|
+
{{else}}
|
|
17
|
+
@change="validateChoice()"
|
|
18
|
+
{{/if}}
|
|
11
19
|
id="input{{getRandom}}"
|
|
12
20
|
{{#if _required}}
|
|
13
21
|
@focus="isFocused = true"
|
|
@@ -59,7 +67,7 @@
|
|
|
59
67
|
{{/if}}
|
|
60
68
|
</label>
|
|
61
69
|
</div>
|
|
62
|
-
|
|
70
|
+
{{#unless _inGroup}}
|
|
63
71
|
<div class="font-heading">
|
|
64
72
|
{{#if _description}}
|
|
65
73
|
<div class="text-xs text-gray-500" {{#if _required}}:class="{'hidden': hideDescription() }"{{/if}}>{{_description}}</div>
|
|
@@ -68,5 +76,5 @@
|
|
|
68
76
|
<div class="hidden text-xs text-red-700" :class="{'hidden': hideError()}" x-text="errorMessage"></div>
|
|
69
77
|
{{/if}}
|
|
70
78
|
</div>
|
|
71
|
-
|
|
79
|
+
{{/unless}}
|
|
72
80
|
</div>
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
<fieldset
|
|
1
|
+
<fieldset
|
|
2
|
+
{{#if _required}}
|
|
3
|
+
ax-load
|
|
4
|
+
x-data="inputHandler('input{{nextRandom}}','{{_formId}}','{{_errorMandatory}}','choice-group','', '', '{{_name}}')"
|
|
5
|
+
x-ignore
|
|
6
|
+
{{/if}}
|
|
7
|
+
>
|
|
2
8
|
<div class="relative flex flex-col w-full mb-6 md:mb-12 gap-y-4 md:gap-y-5">
|
|
3
9
|
<legend class="text-lg font-bold text-black md:text-xl font-heading">
|
|
4
10
|
{{#if _hasBody}}
|
|
@@ -19,19 +25,21 @@
|
|
|
19
25
|
{{> components/forms/choice
|
|
20
26
|
_type=../_type
|
|
21
27
|
_name=../_name
|
|
28
|
+
_required=(if ../_isRadio ../_required false)
|
|
22
29
|
_value=this.value
|
|
23
30
|
_inGroup=true
|
|
24
31
|
_label=this.label
|
|
25
32
|
_selected=this.selected
|
|
26
33
|
_title=this.title
|
|
27
34
|
_multipleChoice=../_multipleChoice
|
|
35
|
+
_formId=../_formId
|
|
28
36
|
}}
|
|
29
37
|
</div>
|
|
30
38
|
{{/each}}
|
|
31
39
|
</div>
|
|
32
40
|
<div class="font-heading">
|
|
33
41
|
{{#if _description}}
|
|
34
|
-
<div class="text-xs text-gray-500" {{#if _required}}:class="{'hidden': hideDescription()
|
|
42
|
+
<div class="text-xs text-gray-500" {{#if _required}}:class="{'hidden': hideDescription()}"{{/if}}>{{_description}}</div>
|
|
35
43
|
{{/if}}
|
|
36
44
|
{{#if _required}}
|
|
37
45
|
<div class="hidden text-xs text-red-700" :class="{'hidden': hideError()}" x-text="errorMessage"></div>
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
_description=this.description
|
|
66
66
|
_items=this.options
|
|
67
67
|
_required=this.isRequired
|
|
68
|
+
_isRadio=this.type.isRadioChoice
|
|
68
69
|
_multipleChoice=../_multipleChoice
|
|
69
70
|
_addClass=../_addClass
|
|
70
71
|
_errorMandatory="Bitte füllen Sie dieses Pflichtfeld aus"
|
|
@@ -85,7 +86,7 @@
|
|
|
85
86
|
}}
|
|
86
87
|
{{/if}}
|
|
87
88
|
{{else if this.type.isUpload}}
|
|
88
|
-
{{~>
|
|
89
|
+
{{~> components/forms/upload
|
|
89
90
|
_name=this.name
|
|
90
91
|
_label=this.label
|
|
91
92
|
_description=this.description
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"fields":[{"isGrouped":true,"type":{"isChoice":true,"asString":"checkbox"},"name":"interessen","label":"Wählen Sie Ihre Interessen","isMeta":false,"description":"Bitte kreuzen Sie alle Interessen an, die auf Sie zutreffen. Ihre Auswahl hilft uns, Ihnen relevante Inhalte anzubieten.","isRequired":
|
|
1
|
+
{"fields":[{"isGrouped":true,"type":{"isChoice":true,"asString":"checkbox"},"name":"interessen","label":"Wählen Sie Ihre Interessen","isMeta":false,"description":"Bitte kreuzen Sie alle Interessen an, die auf Sie zutreffen. Ihre Auswahl hilft uns, Ihnen relevante Inhalte anzubieten.","isRequired":false,"options":[{"value":"sport","label":"sport","title":"sport","isSelected":false},{"value":"musik","label":"musik","title":"musik","isSelected":false},{"value":"lesen","label":"lesen","title":"lesen","isSelected":false},{"value":"reisen","label":"reisen","title":"reisen","isSelected":false},{"value":"kochen","label":"kochen","title":"kochen","isSelected":false},{"value":"filme","label":"filme","title":"filme","isSelected":false},{"value":"tanzen","label":"tanzen","title":"tanzen","isSelected":false},{"value":"fotografie","label":"fotografie","title":"fotografie","isSelected":false}]}]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"fields":[{"isGrouped":true,"type":{"isChoice":true,"asString":"radio"},"name":"lieblingsfarbe","label":"Wählen Sie Ihre Lieblingsfarbe","isMeta":false,"description":"Bitte wählen Sie eine der folgenden Farben aus.","isRequired":true,"options":[{"value":"rot","label":"rot","title":"rot","isSelected":false},{"value":"blau","label":"blau","title":"blau","isSelected":false},{"value":"grün","label":"grün","title":"grün","isSelected":false}]}]}
|
|
1
|
+
{"fields":[{"isGrouped":true,"type":{"isChoice":true,"isRadioChoice":true,"asString":"radio"},"name":"lieblingsfarbe","label":"Wählen Sie Ihre Lieblingsfarbe","isMeta":false,"description":"Bitte wählen Sie eine der folgenden Farben aus.","isRequired":true,"options":[{"value":"rot","label":"rot","title":"rot","isSelected":false},{"value":"blau","label":"blau","title":"blau","isSelected":false},{"value":"grün","label":"grün","title":"grün","isSelected":false}]}]}
|
|
@@ -19,8 +19,8 @@ export default {
|
|
|
19
19
|
const Template = (args) => {
|
|
20
20
|
let hbsTemplate = handlebars.compile(`
|
|
21
21
|
{{#>components/forms/backgroundBox }}
|
|
22
|
-
<form class="relative flex flex-col justify-center overflow-hidden group" id="form
|
|
23
|
-
{{> components/forms/fields }}
|
|
22
|
+
<form class="relative flex flex-col justify-center overflow-hidden group" id="form{{nextRandom}}" action="{{this.url}}" method="post" enctype="{{if this.isMultipart 'multipart/form-data' 'application/x-www-form-urlencoded'}}" accept-charset="utf-8" >
|
|
23
|
+
{{> components/forms/fields _formId=(joinStrings 'form' (getRandom)) }}
|
|
24
24
|
</form>
|
|
25
25
|
{{/components/forms/backgroundBox }}
|
|
26
26
|
`)
|
|
@@ -19,8 +19,8 @@ export default {
|
|
|
19
19
|
const Template = (args) => {
|
|
20
20
|
let hbsTemplate = handlebars.compile(`
|
|
21
21
|
{{#>components/forms/backgroundBox }}
|
|
22
|
-
<form class="relative flex flex-col justify-center overflow-hidden group" id="form
|
|
23
|
-
|
|
22
|
+
<form class="relative flex flex-col justify-center overflow-hidden group" id="form{{nextRandom}}" action="{{this.url}}" method="post" enctype="{{if this.isMultipart 'multipart/form-data' 'application/x-www-form-urlencoded'}}" accept-charset="utf-8" >
|
|
23
|
+
{{> components/forms/fields _formId=(joinStrings 'form' (getRandom)) }}
|
|
24
24
|
</form>
|
|
25
25
|
{{/components/forms/backgroundBox }}
|
|
26
26
|
`)
|
|
@@ -19,7 +19,7 @@ export default {
|
|
|
19
19
|
const Template = (args) => {
|
|
20
20
|
let hbsTemplate = handlebars.compile(`
|
|
21
21
|
{{#>components/forms/backgroundBox }}
|
|
22
|
-
<form class="relative flex flex-col justify-center overflow-hidden group" id="form
|
|
22
|
+
<form class="relative flex flex-col justify-center overflow-hidden group" id="form{{nextRandom}}" action="{{this.url}}" method="post" enctype="{{if this.isMultipart 'multipart/form-data' 'application/x-www-form-urlencoded'}}" accept-charset="utf-8" >
|
|
23
23
|
{{> components/forms/fields }}
|
|
24
24
|
</form>
|
|
25
25
|
{{/components/forms/backgroundBox }}
|
|
@@ -19,8 +19,8 @@ export default {
|
|
|
19
19
|
const Template = (args) => {
|
|
20
20
|
let hbsTemplate = handlebars.compile(`
|
|
21
21
|
{{#>components/forms/backgroundBox }}
|
|
22
|
-
<form class="relative flex flex-col justify-center overflow-hidden group" id="form
|
|
23
|
-
{{> components/forms/fields }}
|
|
22
|
+
<form class="relative flex flex-col justify-center overflow-hidden group" id="form{{nextRandom}}" action="{{this.url}}" method="post" enctype="{{if this.isMultipart 'multipart/form-data' 'application/x-www-form-urlencoded'}}" accept-charset="utf-8" >
|
|
23
|
+
{{> components/forms/fields _formId=(joinStrings 'form' (getRandom)) }}
|
|
24
24
|
</form>
|
|
25
25
|
{{/components/forms/backgroundBox }}
|
|
26
26
|
`)
|
|
@@ -19,7 +19,7 @@ export default {
|
|
|
19
19
|
const Template = (args) => {
|
|
20
20
|
let hbsTemplate = handlebars.compile(`
|
|
21
21
|
{{#>components/forms/backgroundBox }}
|
|
22
|
-
<form class="relative flex flex-col justify-center overflow-hidden group" id="form
|
|
22
|
+
<form class="relative flex flex-col justify-center overflow-hidden group" id="form{{nextRandom}}" action="{{this.url}}" method="post" enctype="{{if this.isMultipart 'multipart/form-data' 'application/x-www-form-urlencoded'}}" accept-charset="utf-8" >
|
|
23
23
|
{{> components/forms/fields }}
|
|
24
24
|
</form>
|
|
25
25
|
{{/components/forms/backgroundBox }}
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
const Template = (args) => {
|
|
24
24
|
let hbsTemplate = handlebars.compile(`
|
|
25
25
|
{{#>components/forms/backgroundBox }}
|
|
26
|
-
<form class="relative flex flex-col justify-center overflow-hidden group" id="form
|
|
26
|
+
<form class="relative flex flex-col justify-center overflow-hidden group" id="form{{nextRandom}}" action="{{this.url}}" method="post" enctype="{{if this.isMultipart 'multipart/form-data' 'application/x-www-form-urlencoded'}}" accept-charset="utf-8" >
|
|
27
27
|
{{> components/forms/fields }}
|
|
28
28
|
</form>
|
|
29
29
|
{{/components/forms/backgroundBox }}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div class=" relative flex flex-col w-full mb-5 {{_wrapperClass}}"
|
|
2
2
|
ax-load
|
|
3
|
-
x-data="inputHandler('input{{nextRandom}}','{{_formId}}','{{_errorMandatory}}',{{#if _isEmail}}'email'{{else}}'{{_type}}'{{/if}},'{{_errorEmail}}','{{#if _formField.forHtmlAttribute}}{{_formField.forHtmlAttribute}}{{else}}{{#if _value}}{{_value}}{{else}}{{_defaultValue}}{{/if}}{{/if}}')"
|
|
3
|
+
x-data="inputHandler('input{{nextRandom}}','{{_formId}}','{{_errorMandatory}}',{{#if _isEmail}}'email'{{else}}'{{_type}}'{{/if}},'{{_errorEmail}}','{{#if _formField.forHtmlAttribute}}{{_formField.forHtmlAttribute}}{{else}}{{#if _value}}{{_value}}{{else}}{{_defaultValue}}{{/if}}{{/if}}','{{_name}}')"
|
|
4
4
|
x-init="validateField()"
|
|
5
5
|
x-ignore
|
|
6
6
|
>
|
|
@@ -89,7 +89,6 @@
|
|
|
89
89
|
<div>errorMessage:<span x-text="errorMessage" class="font-bold" ></span></div>
|
|
90
90
|
<div>valueMissing:<span x-text="valueMissing" class="font-bold" ></span></div>
|
|
91
91
|
<div>typeMismatch:<span x-text="typeMismatch" class="font-bold" ></span></div>
|
|
92
|
-
<div>serverErrorFields[form{{getRandom}}][name]:<span x-text="getServerErrorFields('{{_name}}')" class="font-bold" ></span></div>
|
|
93
92
|
<div>submissionAttempted[form{{getRandom}}]:<span x-text="getSubmissionAttempted()" class="font-bold" :class="getSubmissionAttempted() ? 'text-green-800' : 'text-red-700'"></span></div>
|
|
94
93
|
|
|
95
94
|
</div>
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
export default function inputHandler(element, formId, errorMandatory, type, errorEmail, prefilledText = '') {
|
|
1
|
+
export default function inputHandler(element, formId, errorMandatory, type, errorEmail, prefilledText = '', name) {
|
|
2
2
|
return {
|
|
3
3
|
[element]: prefilledText,
|
|
4
|
-
name: document.getElementById(element).getAttribute("name"),
|
|
5
4
|
valid: false,
|
|
6
5
|
wasFocused: false,
|
|
7
6
|
isFocused: false,
|
|
8
|
-
isChecked: false,
|
|
9
7
|
typeMismatch: true,
|
|
10
8
|
valueMissing: true,
|
|
11
9
|
|
|
@@ -21,14 +19,25 @@ export default function inputHandler(element, formId, errorMandatory, type, erro
|
|
|
21
19
|
}
|
|
22
20
|
}
|
|
23
21
|
},
|
|
22
|
+
anyChecked() {
|
|
23
|
+
var formElement = document.getElementById(formId);
|
|
24
|
+
var form_data = new FormData(formElement)
|
|
25
|
+
if(form_data.has(name)){
|
|
26
|
+
this.valid = true
|
|
27
|
+
}else{
|
|
28
|
+
this.valid = false
|
|
29
|
+
}
|
|
30
|
+
},
|
|
24
31
|
hideDescription() {
|
|
25
32
|
switch (type) {
|
|
26
33
|
case "email":
|
|
27
34
|
return Boolean((!this.valid && this.wasFocused && !this.isFocused) || (this.typeMismatch && this.wasFocused && !this.isFocused) || (!this.valid && !this.isFocused && this.$store.forms.submissionAttempted[formId]) || (this.hasServerError() && !this.isFocused ));
|
|
28
35
|
case "checkbox":
|
|
29
|
-
return Boolean(!this.valid && this.wasFocused && !this.isFocused
|
|
36
|
+
return Boolean((!this.valid && this.wasFocused && !this.isFocused) || (!this.valid && !this.isFocused && this.$store.forms.submissionAttempted[formId]) || (this.hasServerError() && !this.isFocused ));
|
|
30
37
|
case "select":
|
|
31
|
-
return Boolean((!this.valid && this.wasFocused && !this.isFocused) || (!this.valid && !this.isFocused && this.$store.forms.submissionAttempted[formId]) || (this.hasServerError() && !this.isFocused ))
|
|
38
|
+
return Boolean((!this.valid && this.wasFocused && !this.isFocused) || (!this.valid && !this.isFocused && this.$store.forms.submissionAttempted[formId]) || (this.hasServerError() && !this.isFocused ));
|
|
39
|
+
case "choice-group":
|
|
40
|
+
return Boolean((!this.valid && this.wasFocused && !this.isFocused) || (!this.valid && !this.isFocused && this.$store.forms.submissionAttempted[formId]));
|
|
32
41
|
default:
|
|
33
42
|
return Boolean((!this.valid && this.wasFocused && !this.isFocused) || (!this.valid && !this.isFocused && this.$store.forms.submissionAttempted[formId]) || (this.hasServerError() && !this.isFocused ));
|
|
34
43
|
}
|
|
@@ -42,12 +51,16 @@ export default function inputHandler(element, formId, errorMandatory, type, erro
|
|
|
42
51
|
this.valueMissing = field.validity.valueMissing;
|
|
43
52
|
this.valid = field.checkValidity()
|
|
44
53
|
},
|
|
54
|
+
validateChoice() {
|
|
55
|
+
var choice = document.getElementById(element)
|
|
56
|
+
this.valid = choice.checkValidity()
|
|
57
|
+
},
|
|
45
58
|
hasServerError() {
|
|
46
|
-
return Boolean(this.$store.forms.serverErrorFields[formId][
|
|
59
|
+
return Boolean(this.$store.forms.serverErrorFields[formId]?.[name]);
|
|
47
60
|
},
|
|
48
61
|
getServerError() {
|
|
49
62
|
let serverError = "Server Error: "
|
|
50
|
-
switch (this.$store.forms.serverErrorFields[formId][
|
|
63
|
+
switch (this.$store.forms.serverErrorFields[formId][name]) {
|
|
51
64
|
|
|
52
65
|
case 'form_error_required':
|
|
53
66
|
serverError += "Pflichtfeld"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{{#>components/base/link _link=this.link _css=(appendToDefault (if _firstItem "ds-teaser-focus ") "block group") }}
|
|
1
|
+
{{#>components/base/link _link=this.link _css=(appendToDefault (if _firstItem " ds-teaser-focus ") "block group") }}
|
|
2
2
|
{{#if this.label}}
|
|
3
3
|
{{#> components/label/label_group _css=(if _ordered-adjust_context "pl-8")}}
|
|
4
4
|
{{> components/label/label _type=this.label.type _text=(loca this.label.loca) _css=""}}
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
{{/if~}}
|
|
19
19
|
{{~#with this.clusterTeaserItems}}
|
|
20
20
|
{{~#if ../this.isOrdered}}
|
|
21
|
-
<ol class="ui-test-teaser-cluster__list mx-5 list-none divide-y divide-white divide-solid counter-reset border-t border-white{{~#if ../this.showFirstImageOrGenreImage}}{{~inline-switch ../this.realTeaserSize '["100"]' '[" md
|
|
21
|
+
<ol class="ui-test-teaser-cluster__list mx-5 list-none divide-y divide-white divide-solid counter-reset border-t border-white{{~#if ../this.showFirstImageOrGenreImage}}{{~inline-switch ../this.realTeaserSize '["100"]' '[" md:mx-0 md:pr-5 md:border-none md:basis-1/2-gap-6 lg:basis-2/3-gap-6"]'}}{{/if~}}">
|
|
22
22
|
{{else}}
|
|
23
|
-
<ul class="ui-test-teaser-cluster__list mx-5 divide-y divide-white divide-solid border-t border-white {{~#if ../this.showFirstImageOrGenreImage}}{{~inline-switch ../this.realTeaserSize '["100"]' '[" md
|
|
23
|
+
<ul class="ui-test-teaser-cluster__list mx-5 divide-y divide-white divide-solid border-t border-white {{~#if ../this.showFirstImageOrGenreImage}}{{~inline-switch ../this.realTeaserSize '["100"]' '[" md:mx-0 md:pr-5 md:border-none md:basis-1/2-gap-6 lg:basis-2/3-gap-6"]'}}{{/if~}}">
|
|
24
24
|
{{/if}}
|
|
25
25
|
{{~#each this~}}
|
|
26
26
|
<li class="ui-test-teaser-cluster__item {{#if ../../this.isOrdered}}-ordered{{/if}} py-3{{#unless ../../this.overviewLink.link}} last-of-type:pb-3{{/unless~}}{{~#if ../../this.showFirstImageOrGenreImage}}{{~inline-switch ../../this.realTeaserSize '["100"]' '[" md:first-of-type:pt-0"]'}}{{/if~}}">
|