hr-design-system-handlebars 1.113.1 → 1.113.3

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 (58) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/assets/brand/hessenschau/conf/locatags.merged.json +3 -0
  3. package/dist/assets/brand/hr/conf/locatags.merged.json +3 -0
  4. package/dist/assets/brand/hr-bigband/conf/locatags.merged.json +3 -0
  5. package/dist/assets/brand/hr-fernsehen/conf/locatags.merged.json +3 -0
  6. package/dist/assets/brand/hr-inforadio/conf/locatags.merged.json +3 -0
  7. package/dist/assets/brand/hr-rundfunkrat/conf/locatags.merged.json +3 -0
  8. package/dist/assets/brand/hr-sinfonieorchester/conf/locatags.merged.json +3 -0
  9. package/dist/assets/brand/hr-werbung/conf/locatags.merged.json +3 -0
  10. package/dist/assets/brand/hr1/conf/locatags.merged.json +3 -0
  11. package/dist/assets/brand/hr2/conf/locatags.merged.json +3 -0
  12. package/dist/assets/brand/hr3/conf/locatags.merged.json +3 -0
  13. package/dist/assets/brand/hr4/conf/locatags.merged.json +3 -0
  14. package/dist/assets/brand/you-fm/conf/locatags.merged.json +3 -0
  15. package/dist/assets/index.css +45 -8
  16. package/dist/assets/js/alpine.js +2 -1
  17. package/dist/assets/js/components/forms/js/contactForm.alpine.js +34 -99
  18. package/dist/assets/js/components/forms/js/inputHandler.alpine.js +2 -36
  19. package/dist/views/components/forms/components/controls.hbs +1 -1
  20. package/dist/views/components/forms/components/input.hbs +1 -1
  21. package/dist/views/components/forms/components/message.hbs +22 -10
  22. package/dist/views/components/forms/components/textarea.hbs +1 -2
  23. package/dist/views/components/forms/webform.hbs +33 -12
  24. package/dist/views_static/components/forms/components/controls.hbs +1 -1
  25. package/dist/views_static/components/forms/components/input.hbs +1 -1
  26. package/dist/views_static/components/forms/components/message.hbs +22 -10
  27. package/dist/views_static/components/forms/components/textarea.hbs +1 -2
  28. package/dist/views_static/components/forms/webform.hbs +33 -12
  29. package/package.json +1 -1
  30. package/src/assets/brand/_default/conf/locatags.json +4 -1
  31. package/src/assets/brand/hessenschau/conf/locatags.merged.json +3 -0
  32. package/src/assets/brand/hr/conf/locatags.merged.json +3 -0
  33. package/src/assets/brand/hr-bigband/conf/locatags.merged.json +3 -0
  34. package/src/assets/brand/hr-fernsehen/conf/locatags.merged.json +3 -0
  35. package/src/assets/brand/hr-inforadio/conf/locatags.merged.json +3 -0
  36. package/src/assets/brand/hr-rundfunkrat/conf/locatags.merged.json +3 -0
  37. package/src/assets/brand/hr-sinfonieorchester/conf/locatags.merged.json +3 -0
  38. package/src/assets/brand/hr-werbung/conf/locatags.merged.json +3 -0
  39. package/src/assets/brand/hr1/conf/locatags.merged.json +3 -0
  40. package/src/assets/brand/hr2/conf/locatags.merged.json +3 -0
  41. package/src/assets/brand/hr3/conf/locatags.merged.json +3 -0
  42. package/src/assets/brand/hr4/conf/locatags.merged.json +3 -0
  43. package/src/assets/brand/you-fm/conf/locatags.merged.json +3 -0
  44. package/src/assets/css/custom-utilities.css +1 -1
  45. package/src/assets/fixtures/content/copytext/copytext_webform.json +9 -1
  46. package/src/assets/fixtures/content/copytext/copytext_webform_simple.json +36 -0
  47. package/src/assets/fixtures/forms/error_messages.inc.json +3 -0
  48. package/src/assets/js/alpine.js +2 -1
  49. package/src/stories/views/components/content/copytext/copytext-form.stories.js +52 -1
  50. package/src/stories/views/components/content/copytext/fixtures/copytext_webform.json +1 -1
  51. package/src/stories/views/components/content/copytext/fixtures/copytext_webform_simple.json +1 -0
  52. package/src/stories/views/components/forms/components/controls.hbs +1 -1
  53. package/src/stories/views/components/forms/components/input.hbs +1 -1
  54. package/src/stories/views/components/forms/components/message.hbs +22 -10
  55. package/src/stories/views/components/forms/components/textarea.hbs +1 -2
  56. package/src/stories/views/components/forms/js/contactForm.alpine.js +34 -99
  57. package/src/stories/views/components/forms/js/inputHandler.alpine.js +2 -36
  58. package/src/stories/views/components/forms/webform.hbs +33 -12
@@ -0,0 +1 @@
1
+ {"copytextParagraph":[{"isHeadline":true,"text":"Copytext mit Formular"},{"paragraphBoxItem":{"isWebForm":true,"hasNewWebForm":true,"title":"Kontaktformular","successText":{"richtext":"Liebe Nutzerin, lieber Nutzer,<br><br>ich werde mich so schnell wie möglich um Ihr Anliegen kümmern. Hier geht's zur <a class='' href='https://www.hessenschau.de/index.html'>hessenschau.de-Startseite</a> mit aktuellen Nachrichten aus Hessen.<br><br>Viele Grüße, <br><br>Karsten Hufer"},"jsonUrl":"https://ugc-hessenschau.dev-ext.hrcms.gcp.cloud.hr.de","errorMessages":"&quot;form_error_required&quot;:&quot;Server: Pflichtfeld&quot;,&quot;form_error_max&quot;:&quot;Server: Zu viele Zeichen&quot;,&quot;form_error_validurl&quot;:&quot;Server: Ungültige URL&quot;,&quot;form_error_empty&quot;:&quot;Server: Darf nicht ausgefüllt werden&quot;,&quot;form_error_constants_or_null&quot;:&quot;Server: Ungültiger Wert&quot;,&quot;form_error_constants&quot;:&quot;Server: Ungültiger Wert&quot;,&quot;form_error_max_multivalue&quot;:&quot;Server: Die maximale Anzahl an Antwortmöglichkeiten wurde überschritten&quot;,&quot;vote_error_identity_already_used&quot;:&quot;Server: Unter dieser E-Mail-Adresse wurde bereits abgestimmt. Eine weitere Abstimmung ist nicht möglich.&quot;,&quot;vote_error_token_request_count_exceeded&quot;:&quot;Server: Die maximale Anzahl an Bestätigungs-E-Mails wurde bereits verschickt.&quot;,&quot;form_error_email&quot;:&quot;Server: Ungültige E-Mail-Adresse&quot;","isMultipart":"isMultipart","trackingInformations":"trackingInformations","fields":[{"type":{"isText":true,"asString":"text"},"name":"vorname","label":"Vorname","description":"Das ist der Beschreibungstext von Vorname","defaultValue":"","isHidden":false,"isRequired":false}]}}]}
@@ -4,7 +4,7 @@
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
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
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
+ <input type="submit" class="pl-2 cursor-pointer" value="Absenden" @click.prevent="submitButtonHandler($event)"/>
8
8
  </label>
9
9
 
10
10
  {{#> components/button/button _variant="tertiary"_size="lg" _css="order-1 mr-4" _type="reset"}}
@@ -4,7 +4,7 @@
4
4
  x-init="validateField()"
5
5
  x-ignore
6
6
  >
7
- <input class="relative w-full h-12 pt-4 pl-4 placeholder-transparent bg-white text-text dark:bg-black dark:text-text-dark autofill:shadow-autofill border-form-highlight dark:form-highlight-dark pr-9 peer border-y focus:border-y-2 border-t-transparent dark:border-t-transparent focus:outline-none"
7
+ <input class="relative w-full h-12 pt-4 pl-4 placeholder-transparent bg-white placeholder:select-none text-text dark:bg-black dark:text-text-dark autofill:shadow-autofill border-form-highlight dark:form-highlight-dark pr-9 peer border-y focus:border-y-2 border-t-transparent dark:border-t-transparent focus:outline-none"
8
8
  :class="{'border-form-highlight dark:form-highlight-dark': hideError(),'border-error dark:border-error-dark': hideDescription() }"
9
9
  x-model="input{{getRandom}}"
10
10
  id="input{{getRandom}}"
@@ -1,16 +1,28 @@
1
- <div class="flex flex-row items-center justify-between w-full">
1
+ <div class="flex flex-col justify-between w-full gap-6 md:gap-10">
2
2
  <div class="flex items-center gap-x-2 md:gap-x-3">
3
3
  {{#if _success}}
4
4
  {{> components/forms/components/success_icon}}
5
- <span class="h-5 font-bold text-success">{{#if this.successText}}{{this.successText.richtext}}{{else}}{{~loca "webform_send_text_success"}}{{/if}}</span>
5
+ <h3 class="font-bold text-success">{{~loca "webform_send_title_success"}}</h3>
6
6
  {{else}}
7
7
  {{> components/forms/components/error_icon _class="!block"}}
8
- <span class="h-5 font-bold text-error dark:text-error-dark">{{~loca "webform_send_text_error"}}</span>
8
+ <h3 class="font-bold text-error dark:text-error-dark">{{~loca "webform_send_title_error"}}</h3>
9
9
  {{/if}}
10
- </div>
11
- {{#unless _success}}
12
- {{#> components/button/button _variant="primary"_size="lg" _css="" _type="reset"}}
13
- <span class="text-base ds-button-label ">Nochmal versuchen</span>
14
- {{/components/button/button}}
15
- {{/unless}}
16
- </div>
10
+ </div>
11
+ </div>
12
+ <span class="font-copy">
13
+ {{#if _locaKeyText}}
14
+ {{loca _locaKeyText}}
15
+ {{else}}
16
+ {{{_text}}}
17
+ {{/if}}
18
+ </span>
19
+ {{#unless _success}}
20
+ <div class="flex justify-end">
21
+ {{#> components/button/button _variant="primary" _size="lg" }}
22
+ <span class="text-base ds-button-label ">{{loca "webform_send_form_back"}}</span>
23
+ {{/components/button/button}}
24
+ {{#*inline "htmlProperties"}}
25
+ @click="retryHandler"
26
+ {{/inline}}
27
+ </div>
28
+ {{/unless}}
@@ -6,7 +6,7 @@
6
6
  >
7
7
  <div class="w-full h-4 bg-white dark:bg-black dark:text-text-dark"></div>
8
8
  <textarea
9
- class="relative w-full pl-4 placeholder-transparent bg-white text-text dark:bg-black dark:text-text-dark autofill:shadow-autofill border-form-highlight dark:form-highlight-dark pr-9 peer border-y focus:border-y-2 border-t-transparent dark:border-t-transparent focus:outline-none"
9
+ class="relative w-full py-px pl-4 placeholder-transparent bg-white placeholder:select-none dark:border-form-highlight-dark min-h-12 peer focus:border-b-2 focus:py-0 text-text dark:bg-black dark:text-text-dark autofill:shadow-autofill border-form-highlight dark:form-highlight-dark pr-9 border-y focus:border-y-2 border-t-transparent dark:border-t-transparent focus:outline-none"
10
10
  x-model="textarea{{getRandom}}"
11
11
  id="textarea{{getRandom}}"
12
12
  {{#if _required}}
@@ -35,7 +35,6 @@
35
35
  maxlength="{{_maxLength}}"
36
36
  {{/if~}}
37
37
  {{#if _required}}required{{/if}}
38
- class="relative w-full px-4 pb-px text-black placeholder-transparent bg-white border-form-highlight dark:border-form-highlight-dark min-h-12 peer border-y focus:border-b-2 focus:pb-0 border-t-transparent focus:outline-none"
39
38
  {{#if _required}}
40
39
  :class="{'border-form-highlight dark:border-form-highlight-dark': hideError(),'border-error dark:border-error-dark': hideDescription() }"
41
40
  {{/if}}
@@ -1,7 +1,12 @@
1
+ import { uxAction } from 'base/tracking/pianoHelper.subfeature'
2
+
1
3
  export default function contactForm(formId, jsonUrl, errorMessages, multipart, trackingInformations, jsonp = false) {
2
4
  return {
3
5
  isPosting: false,
4
- isWebview:false,
6
+ wasPosted: false,
7
+ wasPostedWithSuccess: false,
8
+ wasPostedWithError: false,
9
+ isWebview: window.parent.document.documentElement.classList.contains('webview'),
5
10
  ajaxTimeout: 60 * 1000,
6
11
  form: this.$refs[formId],
7
12
  formWrapper: this.$refs[formId].closest("#formWrapper"),
@@ -13,47 +18,20 @@ export default function contactForm(formId, jsonUrl, errorMessages, multipart, t
13
18
  },
14
19
  formInit(){
15
20
  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
21
  this.$store.forms.submissionAttempted[formId] = false;
22
+ this.$store.forms.errorMessages = JSON.parse( "{" + errorMessages.replace(/&quot;/g,'"') + "}")
26
23
  },
27
- clickHandler(event) {
28
- console.log("event:",event);
29
- console.log('check for Error:',formId);
30
- console.log('form:',this.form);
31
-
24
+ submitButtonHandler(event) {
32
25
  if(this.form.reportValidity()){
33
- // this.logData(event,form);
34
26
  this.handleSubmit(event,this.form)
35
27
  } else {
36
28
  this.$store.forms.submissionAttempted[formId] = true;
37
29
  }
38
30
  },
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
-
46
- // Convert the FormData to a serialized string
47
- const serializedData = Array.from(formData.entries())
48
- .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
49
- .join('&');
50
-
51
- // Log the serialized form data
52
- console.log('serialized DATA: ' + serializedData);
53
- console.log('DATA:', new URLSearchParams(new FormData(form)).toString());
54
-
31
+ retryHandler() {
32
+ this.wasPosted = false;
33
+ this.wasPostedWithError = false;
55
34
  },
56
- // TODO - Validation error handler (adapt to your case)
57
35
  handleValidationErrors(errors) {
58
36
  console.log('Validation Errors:', errors);
59
37
  this.$store.forms.serverErrorFields[formId] = errors;
@@ -61,29 +39,19 @@ export default function contactForm(formId, jsonUrl, errorMessages, multipart, t
61
39
  },
62
40
  resetValidationErrors() {
63
41
  this.$store.forms.serverErrorFields[formId] = {}
64
- },
65
-
42
+ },
66
43
  handleSubmit(event, form ) {
67
44
  event.preventDefault();
68
45
 
69
- if (!this.isWebview) {
70
- //uxAction(trackingInformations); // Assuming this is a tracking library
46
+ if (!this.isWebview) {
47
+ uxAction(trackingInformations);
71
48
  }
72
49
 
73
50
  if (this.isPosting) return;
74
51
  this.isPosting = true;
75
52
 
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
53
  console.log('DATA:', new URLSearchParams(new FormData(form)).toString());
85
54
 
86
- // Define ajaxOptions based on form type (without jQuery $.ajax)
87
55
  let ajaxOptions = {
88
56
  method: jsonp ? 'GET' : 'POST',
89
57
  headers: {
@@ -96,13 +64,13 @@ export default function contactForm(formId, jsonUrl, errorMessages, multipart, t
96
64
  if (jsonp) {
97
65
  ajaxOptions.url = this.actionUrl;
98
66
  ajaxOptions.headers['Content-Type'] = 'application/json; charset=utf-8';
99
- ajaxOptions.body = new URLSearchParams(new FormData(form)).toString(); // For JSONP case
67
+ ajaxOptions.body = new URLSearchParams(new FormData(form)).toString();
100
68
  } else if (multipart) {
101
69
  ajaxOptions = {
102
70
  method: 'POST',
103
71
  url: this.actionUrl,
104
72
  timeout: 600 * 1000,
105
- body: new FormData(form), // No URLSearchParams, we use FormData for multipart
73
+ body: new FormData(form),
106
74
  processData: false,
107
75
  headers: {}
108
76
  };
@@ -110,10 +78,9 @@ export default function contactForm(formId, jsonUrl, errorMessages, multipart, t
110
78
  ajaxOptions.url = `${this.actionUrl}?${responseFormatParam}`;
111
79
  }
112
80
 
113
- // Using fetch API instead of $.ajax
114
81
  fetch(ajaxOptions.url, ajaxOptions)
115
82
  .then(async (response) => {
116
- const data = await response.text(); // Assuming the rponse is text or JSON
83
+ const data = await response.text();
117
84
  if (response.ok) {
118
85
  console.log('Done');
119
86
  console.log(data);
@@ -126,74 +93,42 @@ export default function contactForm(formId, jsonUrl, errorMessages, multipart, t
126
93
  break;
127
94
  case 'OK':
128
95
  console.log("OK");
129
- this.replaceAnimated(
130
- this.formWrapper,
131
- this.form.querySelector('#successMessage').innerHTML,
132
- true
133
- );
96
+ this.wasPosted = true;
97
+ this.wasPostedWithSuccess = true;
134
98
  break;
135
99
  default:
136
100
  console.log("default");
137
- this.replaceAnimated(
138
- this.formWrapper,
139
- this.form.querySelector('#errorMessage').innerHTML,
140
- true
141
- );
101
+ this.wasPosted = true;
102
+ this.wasPostedWithError = true;
142
103
  break;
143
104
  }
144
105
  } else {
145
- this.replaceAnimated(this.formWrapper, data, true);
106
+
107
+ this.wasPosted = true;
108
+ this.wasPostedWithError = true;
146
109
  }
147
- /*
148
- if (eventOnSuccess) {
149
- fireEvent(eventOnSuccess, true);
150
- } */
151
-
152
- /* if (rootElement.id) {
153
- window.location.hash = rootElement.id;
154
- } */
110
+ if (formId) {
111
+ window.location.hash = formId;
112
+ }
155
113
  } else {
114
+ this.wasPosted = true;
115
+ this.wasPostedWithError = true;
156
116
  throw new Error('Network response was not ok.');
117
+
157
118
  }
158
119
  })
159
120
  .catch((error) => {
160
121
  console.error('Fail:', error);
161
- this.replaceAnimated(
162
- this.formWrapper,
163
- '<div class="c-form success">Das hat leider nicht funktioniert!</div>',
164
- true
165
- );
122
+ this.wasPosted = true;
123
+ this.wasPostedWithError = true;
166
124
  })
167
125
  .finally(() => {
168
126
  console.log('Always');
169
- // TODO MIT ALPINE UMSETZEN
170
- //preloadIcon.classList.remove('-isHidden');
171
- //loadingIcon.classList.add('-isHidden');
172
127
  this.isPosting = false;
173
128
  });
174
129
  },
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);
191
- },
192
130
  getSubmissionAttempted() {
193
131
  return this.$store.forms.submissionAttempted[formId]
194
- }
195
-
132
+ }
196
133
  }
197
- }
198
-
199
-
134
+ }
@@ -90,42 +90,8 @@ export default function inputHandler(element, formId, errorMandatory, type, erro
90
90
  return Boolean(this.$store.forms.serverErrorFields[formId]?.[name]);
91
91
  },
92
92
  getServerError() {
93
- let serverError = "Server Error: "
94
- switch (this.$store.forms.serverErrorFields[formId][name]) {
95
-
96
- case 'form_error_required':
97
- serverError += "Pflichtfeld"
98
- break
99
- case 'form_error_max':
100
- serverError += "Zu viele Zeichen"
101
- break
102
- case 'form_error_validurl':
103
- serverError += "Ungültige URL"
104
- break
105
- case 'form_error_empty':
106
- serverError += "Darf nicht ausgefüllt werden"
107
- break
108
- case 'form_error_constants_or_null':
109
- serverError += "Ungültiger Wert"
110
- break
111
- case 'form_error_constants':
112
- serverError += "Ungültiger Wert"
113
- break
114
- case 'form_error_max_multivalue':
115
- serverError += "Die maximale Anzahl an Antwortmöglichkeiten wurde überschritten"
116
- break
117
- case 'vote_error_identity_already_used':
118
- serverError += "Unter dieser E-Mail-Adresse wurde bereits abgestimmt. Eine weitere Abstimmung ist nicht möglich."
119
- break
120
- case 'vote_error_token_request_count_exceeded':
121
- serverError += "Die maximale Anzahl an Bestätigungs-E-Mails wurde bereits verschickt."
122
- break
123
- case 'form_error_email':
124
- serverError += "Ungültige E-Mail-Adresse"
125
- break
126
- default:
127
- return false
128
- }
93
+ let errorName = this.$store.forms.serverErrorFields[formId][name]
94
+ let serverError = this.$store.forms.errorMessages[errorName]
129
95
  return serverError
130
96
  }
131
97
  };
@@ -1,7 +1,5 @@
1
1
  {{~#if _newWebForm ~}}
2
- {{#>components/forms/components/backgroundBox }}
3
-
4
-
2
+ {{#>components/forms/components/backgroundBox }}
5
3
  <h3 class="mb-6 text-2xl font-headingSerif sm:mb-12 text-text dark:text-text-dark">
6
4
  {{this.title}}
7
5
  </h3>
@@ -21,20 +19,43 @@
21
19
  enctype="{{if this.isMultipart 'multipart/form-data' 'application/x-www-form-urlencoded'}}"
22
20
  accept-charset="utf-8"
23
21
 
22
+ >
23
+ <div x-show="!wasPosted"
24
+ x-transition:enter="transition ease-out duration-300 delay-300"
25
+ x-transition:enter-start="opacity-0 transform scale-90"
26
+ x-transition:enter-end="opacity-100 transform scale-100"
27
+ x-transition:leave="transition ease-in duration-75 delay-0"
28
+ x-transition:leave-start="opacity-100 transform scale-100"
29
+ x-transition:leave-end="opacity-0 transform scale-90"
24
30
  >
25
- {{> components/forms/components/fields _formId=(joinStrings 'form' (getRandom)) }}
31
+ {{> components/forms/components/fields _formId=(joinStrings 'form' (getRandom)) }}
26
32
 
27
- {{> components/forms/components/controls }}
33
+ {{> components/forms/components/controls }}
34
+ </div>
35
+ <div class="flex flex-col gap-6 md:gap-10" id="successMessage" x-show="wasPostedWithSuccess"
36
+ x-transition:enter="transition ease-out duration-300 delay-75"
37
+ x-transition:enter-start="opacity-0 transform scale-90"
38
+ x-transition:enter-end="opacity-100 transform scale-100"
39
+ x-cloak
40
+ >
41
+ {{#if this.successText}}
42
+ {{> components/forms/components/message _success=true _locaKeyTitle="webform_send_title_success" _text=this.successText.richtext }}
43
+ {{else}}
44
+ {{> components/forms/components/message _success=true _locaKeyTitle="webform_send_title_success" _locaKeyText="webform_send_text_success" }}
45
+ {{/if}}
46
+ </div>
28
47
 
29
- <template id="successMessage">
30
- {{> components/forms/components/message _success=true }}
31
- </template>
48
+ <div class="flex flex-col gap-6 md:gap-10" id="errorMessage" x-show="wasPostedWithError"
49
+ x-transition:enter="transition ease-out duration-300 delay-75"
50
+ x-transition:enter-start="opacity-0 transform scale-90"
51
+ x-transition:enter-end="opacity-100 transform scale-100"
52
+ x-cloak>
53
+ {{> components/forms/components/message _success=false _locaKeyTitle="webform_send_title_error" _locaKeyText="webform_send_text_error"}}
54
+ </div>
32
55
 
33
- <template id="errorMessage">
34
- {{> components/forms/components/message _success=false }}
35
- </template>
36
-
37
56
  </form>
57
+
58
+
38
59
  </div>
39
60
  {{/components/forms/components/backgroundBox }}
40
61
  {{~else~}}