hr-design-system-handlebars 1.108.0 → 1.109.0

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.
Files changed (39) hide show
  1. package/.storybook/main.js +1 -0
  2. package/CHANGELOG.md +24 -0
  3. package/dist/assets/index.css +11 -6
  4. package/dist/assets/js/alpine.js +2 -1
  5. package/dist/assets/js/components/forms/contactForm.alpine.js +181 -18
  6. package/dist/assets/js/components/forms/inputHandler.alpine.js +52 -5
  7. package/dist/views/components/content_nav/content_nav_container.hbs +1 -1
  8. package/dist/views/components/forms/controls.hbs +3 -2
  9. package/dist/views/components/forms/input.hbs +4 -0
  10. package/dist/views/components/forms/webform.hbs +37 -29
  11. package/dist/views/components/horizontal_scroll_container/horizontal_scroll_container.hbs +2 -2
  12. package/dist/views/components/horizontal_scroll_container/horizontal_scroll_container_example.hbs +2 -2
  13. package/dist/views/components/site_header/brand_navigation/brand_navigation.hbs +1 -1
  14. package/dist/views/components/site_header/section_navigation/section_navigation.hbs +1 -1
  15. package/dist/views_static/components/content_nav/content_nav_container.hbs +1 -1
  16. package/dist/views_static/components/forms/controls.hbs +3 -2
  17. package/dist/views_static/components/forms/input.hbs +4 -0
  18. package/dist/views_static/components/forms/webform.hbs +37 -29
  19. package/dist/views_static/components/horizontal_scroll_container/horizontal_scroll_container.hbs +2 -2
  20. package/dist/views_static/components/horizontal_scroll_container/horizontal_scroll_container_example.hbs +2 -2
  21. package/dist/views_static/components/site_header/brand_navigation/brand_navigation.hbs +1 -1
  22. package/dist/views_static/components/site_header/section_navigation/section_navigation.hbs +1 -1
  23. package/package.json +2 -1
  24. package/src/assets/fixtures/content/copytext/copytext_webform.json +5 -58
  25. package/src/assets/js/alpine.js +2 -1
  26. package/src/stories/views/components/content/copytext/copytext-form.stories.js +41 -0
  27. package/src/stories/views/components/content/copytext/copytext.stories.js +0 -7
  28. package/src/stories/views/components/content/copytext/fixtures/copytext_webform.json +1 -1
  29. package/src/stories/views/components/content_nav/content_nav_container.hbs +1 -1
  30. package/src/stories/views/components/forms/contactForm.alpine.js +181 -18
  31. package/src/stories/views/components/forms/controls.hbs +3 -2
  32. package/src/stories/views/components/forms/input.hbs +4 -0
  33. package/src/stories/views/components/forms/inputHandler.alpine.js +52 -5
  34. package/src/stories/views/components/forms/webform.hbs +37 -29
  35. package/src/stories/views/components/horizontal_scroll_container/horizontal_scroll_container.hbs +2 -2
  36. package/src/stories/views/components/horizontal_scroll_container/horizontal_scroll_container_example.hbs +2 -2
  37. package/src/stories/views/components/site_header/brand_navigation/brand_navigation.hbs +1 -1
  38. package/src/stories/views/components/site_header/section_navigation/section_navigation.hbs +1 -1
  39. package/tailwind.config.js +1 -0
@@ -13,6 +13,7 @@ const config = {
13
13
  addons: [
14
14
  '@storybook/addon-themes',
15
15
  '@storybook/addon-links',
16
+ 'storybook-addon-mock',
16
17
  {
17
18
  name: '@storybook/addon-essentials',
18
19
  options: {
package/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ # v1.109.0 (Fri Oct 11 2024)
2
+
3
+ #### 🚀 Enhancement
4
+
5
+ - Feature/dpe 2897 [#1099](https://github.com/mumprod/hr-design-system-handlebars/pull/1099) ([@szuelch](https://github.com/szuelch))
6
+
7
+ #### Authors: 1
8
+
9
+ - [@szuelch](https://github.com/szuelch)
10
+
11
+ ---
12
+
13
+ # v1.108.1 (Fri Oct 11 2024)
14
+
15
+ #### 🐛 Bug Fix
16
+
17
+ - Dpe 3384 server errors [#1100](https://github.com/mumprod/hr-design-system-handlebars/pull/1100) ([@vascoeduardo](https://github.com/vascoeduardo))
18
+
19
+ #### Authors: 1
20
+
21
+ - Vasco ([@vascoeduardo](https://github.com/vascoeduardo))
22
+
23
+ ---
24
+
1
25
  # v1.108.0 (Fri Oct 11 2024)
2
26
 
3
27
  #### 🚀 Enhancement
@@ -18,7 +18,7 @@
18
18
  --tw-scale-y: 1;
19
19
  }
20
20
 
21
- .from-\[\{\{_bgcolor\}\}\], .from-black, .from-white, .md\:from-white {
21
+ .from-\[--color-brandnavigation-bg\], .from-\[--color-navigation-bg\], .from-black, .from-white, .md\:from-white {
22
22
  --tw-gradient-from-position: ;
23
23
  --tw-gradient-via-position: ;
24
24
  --tw-gradient-to-position: ;
@@ -2662,8 +2662,13 @@ article.indexTextDS .indexTextHighlighted .link {
2662
2662
  .bg-gradient-to-t {
2663
2663
  background-image: linear-gradient(to top, var(--tw-gradient-stops));
2664
2664
  }
2665
- .from-\[\{\{_bgcolor\}\}\] {
2666
- --tw-gradient-from: {{ bgcolor}} var(--tw-gradient-from-position);
2665
+ .from-\[--color-brandnavigation-bg\] {
2666
+ --tw-gradient-from: var(--color-brandnavigation-bg) var(--tw-gradient-from-position);
2667
+ --tw-gradient-to: rgba(255, 255, 255, 0) var(--tw-gradient-to-position);
2668
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
2669
+ }
2670
+ .from-\[--color-navigation-bg\] {
2671
+ --tw-gradient-from: var(--color-navigation-bg) var(--tw-gradient-from-position);
2667
2672
  --tw-gradient-to: rgba(255, 255, 255, 0) var(--tw-gradient-to-position);
2668
2673
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
2669
2674
  }
@@ -3516,7 +3521,7 @@ article.indexTextDS .indexTextHighlighted .link {
3516
3521
  border-bottom-color: var(--color-secondary-ds);
3517
3522
  }
3518
3523
  .counter-reset {
3519
- counter-reset: cnt1728647115212;
3524
+ counter-reset: cnt1728649888110;
3520
3525
  }
3521
3526
  .placeholder-text-xs::-webkit-input-placeholder {
3522
3527
  font-size: 0.75rem;
@@ -3920,7 +3925,7 @@ article.indexTextDS .indexTextHighlighted .link {
3920
3925
  --tw-ring-color: rgba(255, 255, 255, 0.5);
3921
3926
  }
3922
3927
  .-ordered {
3923
- counter-increment: cnt1728647115212 1;
3928
+ counter-increment: cnt1728649888110 1;
3924
3929
  }
3925
3930
  .-ordered::before {
3926
3931
  position: absolute;
@@ -3936,7 +3941,7 @@ article.indexTextDS .indexTextHighlighted .link {
3936
3941
  letter-spacing: .0125em;
3937
3942
  --tw-text-opacity: 1;
3938
3943
  color: rgba(0, 0, 0, var(--tw-text-opacity));
3939
- content: counter(cnt1728647115212);
3944
+ content: counter(cnt1728649888110);
3940
3945
  }
3941
3946
  /*! ****************************/
3942
3947
  /*! DataPolicy stuff */
@@ -53,7 +53,8 @@ Alpine.store('sharingBottomPos', {
53
53
  current: '0'
54
54
  })
55
55
  Alpine.store('forms', {
56
- submissionAttempted: []
56
+ submissionAttempted: [],
57
+ serverErrorFields: []
57
58
  })
58
59
  // Initialization of data handlers
59
60
  Alpine.data('mainNavigationHandler', mainNavigationHandler)
@@ -1,36 +1,199 @@
1
- export default function contactForm(formId) {
1
+ export default function contactForm(formId, jsonURL, errorMessages, multipart, trackingInformations, jsonp = false) {
2
2
  return {
3
+ isPosting: false,
4
+ isWebview:false,
5
+ ajaxTimeout: 60 * 1000,
6
+ form: this.$refs[formId],
7
+ formWrapper: this.$refs[formId].closest("#formWrapper"),
8
+ actionUrl: this.form && this.form.getAttribute('action'),
9
+ checkForJsonURL () {
10
+ if (jsonURL) {
11
+ this.actionUrl = jsonURL
12
+ }
13
+ },
3
14
  formInit(){
4
- this.$store.forms.submissionAttempted[formId] = false;
5
- console.log("this.$store.forms.submissionAttempted",this.$store.forms.submissionAttempted[formId]);
15
+ this.checkForJsonURL()
16
+ console.log("%cformId:", 'color: green' ,formId);
17
+ console.log("%cform:", 'color: green' ,this.form);
18
+ console.log("%cformWrapper:", 'color: green' ,this.formWrapper);
19
+ console.log("%cactionUrl:", 'color: green' ,this.actionUrl);
20
+ console.log("%cjsonURL:", 'color: green', jsonURL);
21
+ console.log("%cerrorMessages:", 'color: green', errorMessages);
22
+ console.log("%cmultipart:", 'color: green', multipart);
23
+ console.log("%ctrackingInformations:", 'color: green', trackingInformations);
24
+
25
+ this.$store.forms.submissionAttempted[formId] = false;
6
26
  },
7
- clickHandler() {
8
- console.log('check for Error:',formId);
9
- const form = this.$refs[formId];
10
- console.log('form',form);
11
- const formData = new FormData(form);
12
- const fields = Array.from(form.elements); // Array of all form fields
13
-
14
- // Loop through each field, focus it, blur it, and serialize the data
15
-
16
- if(form.reportValidity()){
17
- this.submitData();
27
+ clickHandler(event) {
28
+ console.log("event:",event);
29
+ console.log('check for Error:',formId);
30
+ console.log('form:',this.form);
31
+
32
+ if(this.form.reportValidity()){
33
+ // this.logData(event,form);
34
+ this.handleSubmit(event,this.form)
18
35
  } else {
19
36
  this.$store.forms.submissionAttempted[formId] = true;
20
37
  }
21
38
  },
22
- submitData() {
23
- const formData = new FormData(this.$refs[formId]);
39
+ logData(event,form) {
40
+ // TODO - FOR DEBUGGIN CN BE REMOVED AT THE END
41
+ const formData = new FormData(form);
42
+ const fields = Array.from(form.elements);
43
+ // Log the serialized form data
44
+ console.log(fields);
45
+
24
46
  // Convert the FormData to a serialized string
25
47
  const serializedData = Array.from(formData.entries())
26
48
  .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
27
49
  .join('&');
28
50
 
29
51
  // Log the serialized form data
30
- console.log('DATA: ' + serializedData);
52
+ console.log('serialized DATA: ' + serializedData);
53
+ console.log('DATA:', new URLSearchParams(new FormData(form)).toString());
54
+
55
+ },
56
+ // TODO - Validation error handler (adapt to your case)
57
+ handleValidationErrors(errors) {
58
+ console.log('Validation Errors:', errors);
59
+ this.$store.forms.serverErrorFields[formId] = errors;
60
+ console.log('Validation Errors in Store:', this.$store.forms.serverErrorFields);
61
+ },
62
+ resetValidationErrors() {
63
+ this.$store.forms.serverErrorFields[formId] = {}
64
+ },
65
+
66
+ handleSubmit(event, form ) {
67
+ event.preventDefault();
68
+
69
+ if (!this.isWebview) {
70
+ //uxAction(trackingInformations); // Assuming this is a tracking library
71
+ }
72
+
73
+ if (this.isPosting) return;
74
+ this.isPosting = true;
75
+
76
+ // TODO mit alpine umsetzen
77
+ //const preloadIcon = formWrapper.querySelector('.js-preloadIcon');
78
+ //const loadingIcon = formWrapper.querySelector('.js-loadingIcon');
79
+
80
+ // Show loading indicator
81
+ //preloadIcon.classList.add('-isHidden');
82
+ //loadingIcon.classList.remove('-isHidden');
83
+
84
+ console.log('DATA:', new URLSearchParams(new FormData(form)).toString());
85
+
86
+ // Define ajaxOptions based on form type (without jQuery $.ajax)
87
+ let ajaxOptions = {
88
+ method: jsonp ? 'GET' : 'POST',
89
+ headers: {
90
+ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
91
+ },
92
+ timeout: this.ajaxTimeout,
93
+ body: new URLSearchParams(new FormData(form)),
94
+ };
95
+
96
+ if (jsonp) {
97
+ ajaxOptions.url = this.actionUrl;
98
+ ajaxOptions.headers['Content-Type'] = 'application/json; charset=utf-8';
99
+ ajaxOptions.body = new URLSearchParams(new FormData(form)).toString(); // For JSONP case
100
+ } else if (multipart) {
101
+ ajaxOptions = {
102
+ method: 'POST',
103
+ url: this.actionUrl,
104
+ timeout: 600 * 1000,
105
+ body: new FormData(form), // No URLSearchParams, we use FormData for multipart
106
+ processData: false,
107
+ headers: {}
108
+ };
109
+ } else {
110
+ ajaxOptions.url = `${this.actionUrl}?${responseFormatParam}`;
111
+ }
112
+
113
+ // Using fetch API instead of $.ajax
114
+ fetch(ajaxOptions.url, ajaxOptions)
115
+ .then(async (response) => {
116
+ const data = await response.text(); // Assuming the rponse is text or JSON
117
+ if (response.ok) {
118
+ console.log('Done');
119
+ console.log(data);
120
+ if (jsonURL) {
121
+ const responseData = JSON.parse(data);
122
+ switch (responseData.status) {
123
+ case 'VALIDATION_ERROR':
124
+ this.resetValidationErrors();
125
+ this.handleValidationErrors(responseData.errors);
126
+ break;
127
+ case 'OK':
128
+ console.log("OK");
129
+ this.replaceAnimated(
130
+ this.formWrapper,
131
+ this.form.querySelector('#successMessage').innerHTML,
132
+ true
133
+ );
134
+ break;
135
+ default:
136
+ console.log("default");
137
+ replaceAnimated(
138
+ this.formWrapper,
139
+ this.form.querySelector('#errorMessage').innerHTML,
140
+ true
141
+ );
142
+ break;
143
+ }
144
+ } else {
145
+ replaceAnimated(this.formWrapper, data, true);
146
+ }
147
+ /*
148
+ if (eventOnSuccess) {
149
+ fireEvent(eventOnSuccess, true);
150
+ } */
151
+
152
+ /* if (rootElement.id) {
153
+ window.location.hash = rootElement.id;
154
+ } */
155
+ } else {
156
+ throw new Error('Network response was not ok.');
157
+ }
158
+ })
159
+ .catch((error) => {
160
+ console.error('Fail:', error);
161
+ replaceAnimated(
162
+ this.formWrapper,
163
+ '<div class="c-form success">Das hat leider nicht funktioniert!</div>',
164
+ true
165
+ );
166
+ })
167
+ .finally(() => {
168
+ console.log('Always');
169
+ // TODO MIT ALPINE UMSETZEN
170
+ //preloadIcon.classList.remove('-isHidden');
171
+ //loadingIcon.classList.add('-isHidden');
172
+ this.isPosting = false;
173
+ });
174
+ },
175
+ // Helper function to replace content with animation (replacing hrQuery's replaceAnimated)
176
+ replaceAnimated(wrapper, newContent, withFade = true) {
177
+ if (withFade) {
178
+ wrapper.style.opacity = 0;
179
+ setTimeout(() => {
180
+ wrapper.innerHTML = newContent;
181
+ wrapper.style.opacity = 1;
182
+ }, 300);
183
+ } else {
184
+ wrapper.innerHTML = newContent;
185
+ }
186
+ },
187
+ // Fire event utility (could be Alpine.js specific or custom)
188
+ fireEvent(eventName, success){
189
+ const event = new CustomEvent(eventName, { detail: success });
190
+ document.dispatchEvent(event);
31
191
  },
32
192
  getSubmissionAttempted() {
33
193
  return this.$store.forms.submissionAttempted[formId]
34
194
  }
195
+
35
196
  }
36
- }
197
+ }
198
+
199
+
@@ -1,6 +1,7 @@
1
1
  export default function inputHandler(element, formId, errorMandatory, type, errorEmail, prefilledText = '') {
2
2
  return {
3
3
  [element]: prefilledText,
4
+ name: document.getElementById(element).getAttribute("name"),
4
5
  valid: false,
5
6
  wasFocused: false,
6
7
  isFocused: false,
@@ -13,19 +14,23 @@ export default function inputHandler(element, formId, errorMandatory, type, erro
13
14
  return this.valueMissing ? errorMandatory : errorEmail
14
15
  }
15
16
  else {
16
- return errorMandatory
17
+ if(this.hasServerError()){
18
+ return this.getServerError()
19
+ } else {
20
+ return errorMandatory
21
+ }
17
22
  }
18
23
  },
19
24
  hideDescription() {
20
25
  switch (type) {
21
26
  case "email":
22
- return Boolean((!this.valid && this.wasFocused && !this.isFocused) || (this.typeMismatch && this.wasFocused && !this.isFocused) || (!this.valid && !this.isFocused && this.$store.forms.submissionAttempted[formId]));
27
+ 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 ));
23
28
  case "checkbox":
24
- return Boolean(!this.valid && this.wasFocused && !this.isFocused && !this.isChecked || (!this.valid && !this.isFocused && this.$store.forms.submissionAttempted[formId]));
29
+ return Boolean(!this.valid && this.wasFocused && !this.isFocused && !this.isChecked || (!this.valid && !this.isFocused && this.$store.forms.submissionAttempted[formId]) || (this.hasServerError() && !this.isFocused ));
25
30
  case "select":
26
- return Boolean((!this.valid && this.wasFocused && !this.isFocused) || (!this.valid && !this.isFocused && this.$store.forms.submissionAttempted[formId]))
31
+ return Boolean((!this.valid && this.wasFocused && !this.isFocused) || (!this.valid && !this.isFocused && this.$store.forms.submissionAttempted[formId]) || (this.hasServerError() && !this.isFocused ))
27
32
  default:
28
- return Boolean((!this.valid && this.wasFocused && !this.isFocused) || (!this.valid && !this.isFocused && this.$store.forms.submissionAttempted[formId]));
33
+ return Boolean((!this.valid && this.wasFocused && !this.isFocused) || (!this.valid && !this.isFocused && this.$store.forms.submissionAttempted[formId]) || (this.hasServerError() && !this.isFocused ));
29
34
  }
30
35
  },
31
36
  hideError() {
@@ -36,6 +41,48 @@ export default function inputHandler(element, formId, errorMandatory, type, erro
36
41
  this.typeMismatch = field.validity.typeMismatch;
37
42
  this.valueMissing = field.validity.valueMissing;
38
43
  this.valid = field.checkValidity()
44
+ },
45
+ hasServerError() {
46
+ return Boolean(this.$store.forms.serverErrorFields[formId][this.name])
47
+ },
48
+ getServerError() {
49
+ let serverError = "Server Error: "
50
+ switch (this.$store.forms.serverErrorFields[formId][this.name]) {
51
+
52
+ case 'form_error_required':
53
+ serverError += "Pflichtfeld"
54
+ break
55
+ case 'form_error_max':
56
+ serverError += "Zu viele Zeichen"
57
+ break
58
+ case 'form_error_validurl':
59
+ serverError += "Ungültige URL"
60
+ break
61
+ case 'form_error_empty':
62
+ serverError += "Darf nicht ausgefüllt werden"
63
+ break
64
+ case 'form_error_constants_or_null':
65
+ serverError += "Ungültiger Wert"
66
+ break
67
+ case 'form_error_constants':
68
+ serverError += "Ungültiger Wert"
69
+ break
70
+ case 'form_error_max_multivalue':
71
+ serverError += "Die maximale Anzahl an Antwortmöglichkeiten wurde überschritten"
72
+ break
73
+ case 'vote_error_identity_already_used':
74
+ serverError += "Unter dieser E-Mail-Adresse wurde bereits abgestimmt. Eine weitere Abstimmung ist nicht möglich."
75
+ break
76
+ case 'vote_error_token_request_count_exceeded':
77
+ serverError += "Die maximale Anzahl an Bestätigungs-E-Mails wurde bereits verschickt."
78
+ break
79
+ case 'form_error_email':
80
+ serverError += "Ungültige E-Mail-Adresse"
81
+ break
82
+ default:
83
+ return false
84
+ }
85
+ return serverError
39
86
  }
40
87
  };
41
88
  }
@@ -4,7 +4,7 @@
4
4
  {{/if}}
5
5
  >
6
6
  {{#if this.isAutosuggest}}
7
- <div class="flex mx-0 w-full h-10 border-primary {{#if _autoSuggestContainerCss}} {{_autoSuggestContainerCss}}{{/if}}">
7
+ <div class="flex mx-0 w-full h-10 border-primary{{#if _autoSuggestContainerCss}} {{_autoSuggestContainerCss}}{{/if}}">
8
8
  <input x-ref="autosuggestInput"
9
9
  class="{{#if _inputclass }}{{_inputclass}}{{/if}} w-full h-10 pl-2 border-b-8 border-white bg-gray-alabaster text-gray-dark placeholder:text-gray-dark focus:outline-none js-autosuggest-input"
10
10
  type="text"
@@ -2,8 +2,9 @@
2
2
  <div class="text-xs text-gray-500 font-headingSerif">Pflichtfeld*</div>
3
3
  <div class="flex items-center">
4
4
  <label class="order-2 cursor-pointer {{> components/button/utilities/button_base_classes}} {{> components/button/utilities/button_variation_classes _variant='primary'}} {{> components/button/utilities/button_dimension_classes _size='lg'}}">
5
- {{> components/base/image/icon _icon="send-ds" _addClass="w-5 h-5 fill-white dark:fill-text-dark "}}
6
- <input type="submit" class="pl-2 cursor-pointer" value="Absenden" @click.prevent="clickHandler"/>
5
+ <span class="hidden" :class="{'hidden': !isPosting}">{{> components/base/image/icon _icon="reload" _addClass="w-5 h-5 fill-white dark:fill-text-dark animate-spin"}}</span>
6
+ <span class="" :class="{'hidden': isPosting}">{{> components/base/image/icon _icon="send-ds" _addClass="w-5 h-5 fill-white dark:fill-text-dark "}}</span>
7
+ <input type="submit" class="pl-2 cursor-pointer" value="Absenden" @click.prevent="clickHandler($event)"/>
7
8
  </label>
8
9
 
9
10
  {{#> components/button/button _variant="tertiary"_size="lg" _css="order-1 mr-4" _type="reset"}}
@@ -77,6 +77,7 @@
77
77
  DEBUG
78
78
  </div>
79
79
  <div class="px-4 py-3 text-red-700 bg-red-100 border border-t-0 border-red-400 rounded-b">
80
+ <div>name:<span x-text="name" class="font-bold" ></span></div>
80
81
  <div>isFocused:<span x-text="isFocused" class="font-bold" :class="isFocused ? 'text-green-800' : 'text-red-700'"></span></div>
81
82
  <div>wasFocused:<span x-text="wasFocused" class="font-bold" :class="wasFocused ? 'text-green-800' : 'text-red-700'"></span></div>
82
83
  <div>valid:<span x-text="valid" class="font-bold" :class="valid ? 'text-green-800' : 'text-red-700'"></span></div>
@@ -88,6 +89,9 @@
88
89
  <div>errorMessage:<span x-text="errorMessage" class="font-bold" ></span></div>
89
90
  <div>valueMissing:<span x-text="valueMissing" class="font-bold" ></span></div>
90
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
+ <div>submissionAttempted[form{{getRandom}}]:<span x-text="getSubmissionAttempted()" class="font-bold" :class="getSubmissionAttempted() ? 'text-green-800' : 'text-red-700'"></span></div>
94
+
91
95
  </div>
92
96
  </div>
93
97
  </div>
@@ -5,38 +5,46 @@
5
5
  <h3 class="mb-6 text-2xl font-headingSerif sm:mb-12">
6
6
  {{this.title}}
7
7
  </h3>
8
-
9
- <form
10
- x-ref="form{{nextRandom}}"
11
- ax-load
12
- x-data="contactForm('form{{getRandom}}')"
13
- x-init="formInit()"
14
- x-ignore
8
+ <div id="formWrapper">
9
+ <form
10
+ x-ref="form{{nextRandom}}"
11
+ ax-load
12
+ x-data="contactForm('form{{getRandom}}','{{this.jsonURL}}','{{this.errorMessages}}','{{this.isMultipart}}','{{this.trackingInformations}}')"
13
+ x-init="formInit()"
14
+ x-ignore
15
15
 
16
- @submit.prevent="submitData"
17
- id="form{{getRandom}}"
18
- class="relative flex flex-col justify-center overflow-hidden group"
19
- action="{{this.url}}"
20
- method="post"
21
- enctype="{{if this.isMultipart 'multipart/form-data' 'application/x-www-form-urlencoded'}}"
22
- accept-charset="utf-8"
23
-
24
- >
25
-
26
- <div class="">
27
- <div class="px-4 py-2 font-bold text-white bg-red-500 rounded-t">
28
- DEBUG
16
+ @submit.prevent="submitData"
17
+ id="form{{getRandom}}"
18
+ class="relative flex flex-col justify-center overflow-hidden group"
19
+ action="{{this.url}}"
20
+ method="post"
21
+ enctype="{{if this.isMultipart 'multipart/form-data' 'application/x-www-form-urlencoded'}}"
22
+ accept-charset="utf-8"
23
+
24
+ >
25
+
26
+ <div class="">
27
+ <div class="px-4 py-2 font-bold text-white bg-red-500 rounded-t">
28
+ DEBUG
29
+ </div>
30
+ <div class="px-4 py-3 text-red-700 bg-red-100 border border-t-0 border-red-400 rounded-b">
31
+ <div>submissionAttempted[form{{getRandom}}]:<span x-text="getSubmissionAttempted()" class="font-bold" :class="getSubmissionAttempted() ? 'text-green-800' : 'text-red-700'"></span></div>
32
+ <div>isPosting:<span x-text="isPosting" class="font-bold" :class="isPosting ? 'text-green-800' : 'text-red-700'"></span></div>
33
+
34
+ </div>
29
35
  </div>
30
- <div class="px-4 py-3 text-red-700 bg-red-100 border border-t-0 border-red-400 rounded-b">
31
- <div>submissionAttempted[form{{getRandom}}]:<span x-text="getSubmissionAttempted()" class="font-bold" :class="getSubmissionAttempted() ? 'text-green-800' : 'text-red-700'"></span></div>
32
- </div>
33
- </div>
34
- {{> components/forms/fields _formId=(joinStrings 'form' (getRandom)) }}
36
+ {{> components/forms/fields _formId=(joinStrings 'form' (getRandom)) }}
35
37
 
36
- {{> components/forms/controls }}
37
-
38
- </form>
39
-
38
+ {{> components/forms/controls }}
39
+ <template id="successMessage">
40
+ <h2>SUPER DAS HAT ALLES FUNKTIONIERT</h2>
41
+ </template>
42
+ <template id="errorMessage">
43
+ <h2>DAS HAT LEIDER NICHT FUNKTIONIERT</h2>
44
+ </template>
45
+
46
+ </form>
47
+ </div>
40
48
  {{/components/forms/backgroundBox }}
41
49
  {{~else~}}
42
50
  {{> content/webform/components/webform _addClass="print:hidden copytext__clearBox marginTrailer--m"}}
@@ -9,12 +9,12 @@
9
9
  <button style="background-image: linear-gradient(90deg, {{_bgcolor}} 50%, transparent);" class="absolute left-0 z-10 flex items-center justify-start w-10 h-full text-{{_iconcolor}} disabled:hidden" @click="prev($refs.scrollContainer_{{getRandom}})" :disabled="!arrowLeftDisplay" tabindex="-1" aria-hidden="true" >
10
10
  {{> components/base/image/icon _icon="arrow-left" _iconmap="icons" _addClass="w-3.5 h-3.5 fill-current" }}
11
11
  </button>
12
- <button style="background-image: linear-gradient(270deg, {{_bgcolor}} 50%, transparent);" class="bg-gradient-to-l from-[{{_bgcolor}}] absolute right-0 z-10 flex items-center justify-end w-10 h-full text-{{_iconcolor}} disabled:hidden group" @click="next($refs.scrollContainer_{{getRandom}})" :disabled="!arrowRightDisplay" tabindex="-1" aria-hidden="true">
12
+ <button style="background-image: linear-gradient(270deg, {{_bgcolor}} 50%, transparent);" class="bg-gradient-to-l absolute right-0 z-10 flex items-center justify-end w-10 h-full text-{{_iconcolor}} disabled:hidden group{{_css}}" @click="next($refs.scrollContainer_{{getRandom}})" :disabled="!arrowRightDisplay" tabindex="-1" aria-hidden="true">
13
13
  {{> components/base/image/icon _icon="arrow-right" _iconmap="icons" _addClass="w-3.5 h-3.5 fill-current" }}
14
14
  </button>
15
15
  </div>
16
16
  </template>
17
- <div x-ref="scrollContainer_{{getRandom}}" @scroll="updateIndex($event.target)" class="w-full overflow-hidden overflow-x-scroll transition-all duration-300 ease-in-out cursor-default hide-scroll-bar align-center">
17
+ <div x-ref="scrollContainer_{{getRandom}}" @scroll="updateIndex($event.target)" class="w-full overflow-hidden overflow-x-scroll transition-all duration-300 ease-in-out cursor-default hide-scroll-bar">
18
18
  {{> @partial-block }}
19
19
  </div>
20
20
  </div>
@@ -1,5 +1,5 @@
1
1
  <div class="w-full h-auto mb-10">
2
- {{#> components/horizontal_scroll_container/horizontal_scroll_container _viewport="xs" _onDarkBackground="true" _bgcolor="var(--color-navigation-bg)" _iconcolor="navigation-icons"}}
2
+ {{#> components/horizontal_scroll_container/horizontal_scroll_container _viewport="xs" _onDarkBackground="true" _css=" from-[--color-navigation-bg]" _bgcolor="var(--color-navigation-bg)" _iconcolor="navigation-icons"}}
3
3
 
4
4
  <div class="flex h-auto p-4 pr-10 text-lg leading-6 text-white bg-primary">
5
5
  <p class="whitespace-nowrap ">Guten Tag. Dieses Div kann mittels click auf die Pfeiltasten verschoben werden kann. Die Pfeile werden dynamisch angezeigt/ausgeblendet sobald der Rand des Inhalts erreicht ist. </p>
@@ -8,7 +8,7 @@
8
8
  {{/components/horizontal_scroll_container/horizontal_scroll_container}}
9
9
  </div>
10
10
  <div class="w-full h-auto mb-10">
11
- {{#> components/horizontal_scroll_container/horizontal_scroll_container _viewport="xs" _onDarkBackground="true" _bgcolor="var(--color-navigation-bg)" _iconcolor="navigation-icons"}}
11
+ {{#> components/horizontal_scroll_container/horizontal_scroll_container _viewport="xs" _onDarkBackground="true" _css=" from-[--color-navigation-bg]" _bgcolor="var(--color-navigation-bg)" _iconcolor="navigation-icons"}}
12
12
 
13
13
  <div class="flex h-auto p-4 pr-10 text-lg leading-6 text-white bg-primary">
14
14
  <p class="whitespace-nowrap ">Guten Tag. Dieses Div kann mittels click auf die Pfeiltasten verschoben werden kann.</p>
@@ -1,5 +1,5 @@
1
1
  <div class="grid-cols-12 px-5 lg:px-10 col-full sm:col-main">
2
- {{#> components/horizontal_scroll_container/horizontal_scroll_container _viewport="xs" _bgcolor="var(--color-brandnavigation-bg)" _iconcolor="primary" }}
2
+ {{#> components/horizontal_scroll_container/horizontal_scroll_container _viewport="xs" _css=" from-[--color-brandnavigation-bg]" _bgcolor="var(--color-brandnavigation-bg)" _iconcolor="primary" }}
3
3
  <nav class="flex w-full text-xs list-none text-grey-scorpion">
4
4
  <span id="brandNavHeading" class="hidden">Navigation der Marken des Hessischen Rundfunks</span>
5
5
  {{#with this.brandNavigationItems}}
@@ -3,7 +3,7 @@
3
3
  class="w-full px-0 mt-10 sb-section-navigation md:mt-0 lg:grid-cols-12 lg:px-10 lg:col-main "
4
4
  x-effect="$el.setAttribute('aria-expanded', $store.burgeropen || $screen('lg')); $el.setAttribute('aria-hidden', ! ($store.burgeropen || $screen('lg')))"
5
5
  >
6
- {{#> components/horizontal_scroll_container/horizontal_scroll_container _viewport="lg" _bgcolor="var(--color-navigation-bg)" _iconcolor="navigation-icons"}}
6
+ {{#> components/horizontal_scroll_container/horizontal_scroll_container _viewport="lg" _css=" from-[--color-navigation-bg]" _bgcolor="var(--color-navigation-bg)" _iconcolor="navigation-icons"}}
7
7
  <div class="flex w-full">
8
8
  <span id="sectionNavHeadline" class="hidden">Bereichsnavigation</span>
9
9
 
@@ -4,7 +4,7 @@
4
4
  {{/if}}
5
5
  >
6
6
  {{#if this.isAutosuggest}}
7
- <div class="flex mx-0 w-full h-10 border-primary {{#if _autoSuggestContainerCss}} {{_autoSuggestContainerCss}}{{/if}}">
7
+ <div class="flex mx-0 w-full h-10 border-primary{{#if _autoSuggestContainerCss}} {{_autoSuggestContainerCss}}{{/if}}">
8
8
  <input x-ref="autosuggestInput"
9
9
  class="{{#if _inputclass }}{{_inputclass}}{{/if}} w-full h-10 pl-2 border-b-8 border-white bg-gray-alabaster text-gray-dark placeholder:text-gray-dark focus:outline-none js-autosuggest-input"
10
10
  type="text"
@@ -2,8 +2,9 @@
2
2
  <div class="text-xs text-gray-500 font-headingSerif">Pflichtfeld*</div>
3
3
  <div class="flex items-center">
4
4
  <label class="order-2 cursor-pointer {{> components/button/utilities/button_base_classes}} {{> components/button/utilities/button_variation_classes _variant='primary'}} {{> components/button/utilities/button_dimension_classes _size='lg'}}">
5
- {{> components/base/image/icon _icon="send-ds" _addClass="w-5 h-5 fill-white dark:fill-text-dark "}}
6
- <input type="submit" class="pl-2 cursor-pointer" value="Absenden" @click.prevent="clickHandler"/>
5
+ <span class="hidden" :class="{'hidden': !isPosting}">{{> components/base/image/icon _icon="reload" _addClass="w-5 h-5 fill-white dark:fill-text-dark animate-spin"}}</span>
6
+ <span class="" :class="{'hidden': isPosting}">{{> components/base/image/icon _icon="send-ds" _addClass="w-5 h-5 fill-white dark:fill-text-dark "}}</span>
7
+ <input type="submit" class="pl-2 cursor-pointer" value="Absenden" @click.prevent="clickHandler($event)"/>
7
8
  </label>
8
9
 
9
10
  {{#> components/button/button _variant="tertiary"_size="lg" _css="order-1 mr-4" _type="reset"}}
@@ -77,6 +77,7 @@
77
77
  DEBUG
78
78
  </div>
79
79
  <div class="px-4 py-3 text-red-700 bg-red-100 border border-t-0 border-red-400 rounded-b">
80
+ <div>name:<span x-text="name" class="font-bold" ></span></div>
80
81
  <div>isFocused:<span x-text="isFocused" class="font-bold" :class="isFocused ? 'text-green-800' : 'text-red-700'"></span></div>
81
82
  <div>wasFocused:<span x-text="wasFocused" class="font-bold" :class="wasFocused ? 'text-green-800' : 'text-red-700'"></span></div>
82
83
  <div>valid:<span x-text="valid" class="font-bold" :class="valid ? 'text-green-800' : 'text-red-700'"></span></div>
@@ -88,6 +89,9 @@
88
89
  <div>errorMessage:<span x-text="errorMessage" class="font-bold" ></span></div>
89
90
  <div>valueMissing:<span x-text="valueMissing" class="font-bold" ></span></div>
90
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
+ <div>submissionAttempted[form{{getRandom}}]:<span x-text="getSubmissionAttempted()" class="font-bold" :class="getSubmissionAttempted() ? 'text-green-800' : 'text-red-700'"></span></div>
94
+
91
95
  </div>
92
96
  </div>
93
97
  </div>