hr-design-system-handlebars 1.114.30 → 1.114.32

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 (29) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/assets/index.css +8 -3
  3. package/dist/assets/js/components/voting/js/votingDs.feature.js +13 -2
  4. package/dist/views/components/forms/components/backgroundBox.hbs +1 -1
  5. package/dist/views/components/teaser/teaser_voting.hbs +7 -0
  6. package/dist/views/components/voting/components/voting_header.hbs +1 -1
  7. package/dist/views/components/voting/voting.hbs +7 -3
  8. package/dist/views/components/voting/voting_result.hbs +2 -2
  9. package/dist/views_static/components/forms/components/backgroundBox.hbs +1 -1
  10. package/dist/views_static/components/teaser/teaser_voting.hbs +7 -0
  11. package/dist/views_static/components/voting/components/voting_header.hbs +1 -1
  12. package/dist/views_static/components/voting/voting.hbs +7 -3
  13. package/dist/views_static/components/voting/voting_result.hbs +2 -2
  14. package/package.json +1 -1
  15. package/src/assets/fixtures/voting/voting.json +19 -1
  16. package/src/assets/fixtures/voting/voting_result.inc.json +47 -0
  17. package/src/assets/fixtures/voting/voting_result_absolute.json +7 -3
  18. package/src/assets/fixtures/voting/voting_teaser_50.json +10 -0
  19. package/src/stories/views/components/forms/components/backgroundBox.hbs +1 -1
  20. package/src/stories/views/components/teaser/teaser_voting.hbs +7 -0
  21. package/src/stories/views/components/voting/components/voting_header.hbs +1 -1
  22. package/src/stories/views/components/voting/fixtures/voting.json +1 -1
  23. package/src/stories/views/components/voting/fixtures/voting_result.json +1 -0
  24. package/src/stories/views/components/voting/fixtures/voting_result_absolute.json +1 -1
  25. package/src/stories/views/components/voting/fixtures/voting_teaser_50.json +1 -0
  26. package/src/stories/views/components/voting/js/votingDs.feature.js +13 -2
  27. package/src/stories/views/components/voting/voting.hbs +7 -3
  28. package/src/stories/views/components/voting/voting.stories.js +34 -16
  29. package/src/stories/views/components/voting/voting_result.hbs +2 -2
@@ -0,0 +1 @@
1
+ {"votingResult":[{"label":"Gut, beste website ever","count":"27","percentageCount":"4,1","roundedPercentageCount":"4.0"},{"label":"Super, allerbeste website ever","count":"117","percentageCount":"17,6","roundedPercentageCount":"18.0"},{"label":"Mega, allerallerbeste website ever","count":"242","percentageCount":"36,3","roundedPercentageCount":"36.0"},{"label":"Hammer, allerallerbesteste website ever","count":"280","percentageCount":"42,0","roundedPercentageCount":"42.0","isWinner":true}],"summarizedResult":"666","isMultipleChoice":false,"votingDoc":{"showAbsoluteResult":false,"hasRedirect":false,"isVotingOver":false,"isSimpleSecured":false,"is2FSecured":false,"cmsFields":{"title":"Wie finden Sie hessenschau.de?","cookieLifetime":"12","sophoraId":"Sophora-Id","showVoteResult":false,"_resultBoxMessageText":"Danke für Ihre Abstimmung!"}}}
@@ -1 +1 @@
1
- {"teasersize":100,"realTeasersize":100,"topline":"Voting-Topline","toplineSize":"h3","title":"Wie finden Sie hessenschau.de?","backlink":"backlink-url","uuid":"UUID","headingSize":"h2","isVoting":true,"isMultiVote":true,"isMultimediaVoting":false,"hasRedirect":false,"isMultipleChoice":false,"maxAnswerCount":1,"votingSuccessText":{"richtext":"Danke für Ihre Abstimmung!"},"isSimpleSecured":false,"cookieLifetime":"12","sophoraId":"Sophora-Id","hasBarchart":true,"showAbsoluteResult":true,"showVoteResult":true,"summarizedResult":"666","votingResult":[{"label":"Gut, beste website ever","count":"27","percentageCount":"4,1","roundedPercentageCount":"4.0"},{"label":"Super, allerbeste website ever","count":"117","percentageCount":"17,6","roundedPercentageCount":"18.0"},{"label":"Mega, allerallerbeste website ever","count":"242","percentageCount":"36,3","roundedPercentageCount":"36.0"},{"label":"Hammer, allerallerbesteste website ever","count":"280","percentageCount":"42,0","roundedPercentageCount":"42.0","isWinner":true}],"form":{"shorttext":"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.","isVotingOver":false,"is2FSecured":false,"jsonUrl":"https://ugc-hessenschau.dev-ext.hrcms.gcp.cloud.hr.de","errorMessages":"{\"form_error_required\":\"Pflichtfeld\",\"form_error_max\":\"Zu viele Zeichen\",\"form_error_validurl\":\"Ungültige URL\",\"form_error_empty\":\"Darf nicht ausgefüllt werden\",\"form_error_constants_or_null\":\"Ungültiger Wert\",\"form_error_constants\":\"Ungültiger Wert\",\"form_error_max_multivalue\":\"Die maximale Anzahl an Antwortmöglichkeiten wurde überschritten\",\"vote_error_identity_already_used\":\"Unter dieser E-Mail-Adresse wurde bereits abgestimmt. Eine weitere Abstimmung ist nicht möglich.\",\"vote_error_token_request_count_exceeded\":\"Die maximale Anzahl an Bestätigungs-E-Mails wurde bereits verschickt.\",\"form_error_email\":\"Ungültige E-Mail-Adresse\"}","isSimpleSecured":false,"url":"https://ugc-hessenschau.dev-ext.hrcms.gcp.cloud.hr.de","isHorizontalLayout":false,"hideVotingResult":false,"sophoraId":"Sophora-Id","fields":[{"type":{"isGroup":false,"isChoice":true,"asString":"radio"},"name":"voting","isGrouped":true,"isRequired":false,"options":[{"value":"1","label":"Gut, beste website ever","title":"Voting-Answer 1"},{"value":"2","label":"Super, allerbeste website ever","title":"Voting-Answer 2"},{"value":"3","label":"Mega, allerallerbeste website ever","title":"Voting-Answer 3"},{"value":"4","label":"Hammer, allerallerbesteste website ever","title":"Voting-Answer 4"}]}]}}
1
+ {"votingResult":[{"label":"Gut, beste website ever","count":"27","percentageCount":"4,1","roundedPercentageCount":"4.0"},{"label":"Super, allerbeste website ever","count":"117","percentageCount":"17,6","roundedPercentageCount":"18.0"},{"label":"Mega, allerallerbeste website ever","count":"242","percentageCount":"36,3","roundedPercentageCount":"36.0"},{"label":"Hammer, allerallerbesteste website ever","count":"280","percentageCount":"42,0","roundedPercentageCount":"42.0","isWinner":true}],"summarizedResult":"666","isMultipleChoice":false,"votingDoc":{"showAbsoluteResult":true,"hasRedirect":false,"isVotingOver":false,"isSimpleSecured":false,"is2FSecured":false,"cmsFields":{"title":"Wie finden Sie hessenschau.de?","cookieLifetime":"12","sophoraId":"Sophora-Id","showVoteResult":false,"_resultBoxMessageText":"Danke für Ihre Abstimmung!"}}}
@@ -0,0 +1 @@
1
+ {"teasersize":"50","realTeasersize":100,"topline":"Voting-Topline","toplineSize":"h3","title":"Wie finden Sie hessenschau.de?","backlink":"backlink-url","uuid":"UUID","headingSize":"h2","isVoting":true,"isMultiVote":true,"isMultimediaVoting":false,"hasRedirect":false,"isMultipleChoice":false,"maxAnswerCount":1,"votingSuccessText":{"richtext":"Danke für Ihre Abstimmung!"},"isSimpleSecured":false,"cookieLifetime":"12","sophoraId":"Sophora-Id","hasBarchart":true,"showAbsoluteResult":false,"showVoteResult":true,"summarizedResult":"666","votingResult":[{"label":"Gut, beste website ever","count":"27","percentageCount":"4,1","roundedPercentageCount":"4.0"},{"label":"Super, allerbeste website ever","count":"117","percentageCount":"17,6","roundedPercentageCount":"18.0"},{"label":"Mega, allerallerbeste website ever","count":"242","percentageCount":"36,3","roundedPercentageCount":"36.0"},{"label":"Hammer, allerallerbesteste website ever","count":"280","percentageCount":"42,0","roundedPercentageCount":"42.0","isWinner":true}],"form":{"shorttext":"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.","isVotingOver":false,"is2FSecured":false,"jsonUrl":"https://ugc-hessenschau.dev-ext.hrcms.gcp.cloud.hr.de","errorMessages":"{\"form_error_required\":\"Pflichtfeld\",\"form_error_max\":\"Zu viele Zeichen\",\"form_error_validurl\":\"Ungültige URL\",\"form_error_empty\":\"Darf nicht ausgefüllt werden\",\"form_error_constants_or_null\":\"Ungültiger Wert\",\"form_error_constants\":\"Ungültiger Wert\",\"form_error_max_multivalue\":\"Die maximale Anzahl an Antwortmöglichkeiten wurde überschritten\",\"vote_error_identity_already_used\":\"Unter dieser E-Mail-Adresse wurde bereits abgestimmt. Eine weitere Abstimmung ist nicht möglich.\",\"vote_error_token_request_count_exceeded\":\"Die maximale Anzahl an Bestätigungs-E-Mails wurde bereits verschickt.\",\"form_error_email\":\"Ungültige E-Mail-Adresse\"}","isSimpleSecured":false,"url":"https://ugc-hessenschau.dev-ext.hrcms.gcp.cloud.hr.de","isHorizontalLayout":false,"hideVotingResult":false,"sophoraId":"Sophora-Id","fields":[{"type":{"isGroup":false,"isChoice":true,"asString":"radio"},"name":"voting","isGrouped":true,"isRequired":false,"options":[{"value":"1","label":"Gut, beste website ever","title":"Voting-Answer 1"},{"value":"2","label":"Super, allerbeste website ever","title":"Voting-Answer 2"},{"value":"3","label":"Mega, allerallerbeste website ever","title":"Voting-Answer 3"},{"value":"4","label":"Hammer, allerallerbesteste website ever","title":"Voting-Answer 4"}]}]}}
@@ -1,4 +1,4 @@
1
- import { hr$, listen, replaceAnimated } from 'hrQuery'
1
+ import { hr$, listen, replaceAnimated, reinitializeFeature } from 'hrQuery'
2
2
  import $ from 'zepto-modules'
3
3
 
4
4
  require('zepto-modules/callbacks')
@@ -136,6 +136,17 @@ const Voting = (context) => {
136
136
  })
137
137
  }, 850)
138
138
  }
139
+
140
+ const scrollIntoVotingAndReinitialize = function (vertical) {
141
+ setTimeout(function () {
142
+ rootElement.scrollIntoView({
143
+ behavior: 'smooth',
144
+ block: 'center',
145
+ })
146
+ reinitializeFeature(votingWrapper.parentNode.parentNode)
147
+ }, 850)
148
+ }
149
+
139
150
  /**
140
151
  * Handles click events globally
141
152
  * and delegates to concrete handlers
@@ -151,7 +162,7 @@ const Voting = (context) => {
151
162
 
152
163
  const handleFormReload = function (event) {
153
164
  event.preventDefault()
154
- replaceAnimated(votingWrapper, votingTmpl, true, scrollIntoVoting)
165
+ replaceAnimated(votingWrapper, votingTmpl, true, scrollIntoVotingAndReinitialize)
155
166
  }
156
167
 
157
168
  const handleKeydown = function (event) {
@@ -1,4 +1,4 @@
1
- {{#>components/forms/components/backgroundBox }}
1
+ {{#>components/forms/components/backgroundBox _isTeaser=_isTeaser }}
2
2
  {{#with this.form}}
3
3
  {{#unless this.isVotingOver}}
4
4
  {{#unless ../this.hasRedirect}}
@@ -28,7 +28,7 @@
28
28
  accept-charset="utf-8"
29
29
  autocomplete="off"
30
30
  >
31
- {{> components/voting/components/voting_header _title=../this.title _topline=../this.topline}}
31
+ {{> components/voting/components/voting_header _isTeaser=../../_isTeaser _title=../this.title _topline=../this.topline}}
32
32
 
33
33
  <div class="js-voting-form__bottomWrapper">
34
34
  {{#if this.shorttext}}
@@ -66,6 +66,7 @@
66
66
  _statusDone=true
67
67
  _resultBoxMessageTitle=(loca "votingform2F_title_success")
68
68
  _resultBoxMessageText=(loca "votingform2F_text_success")
69
+ _isTeaser=../../_isTeaser
69
70
  }}
70
71
  {{else}}
71
72
  {{> components/voting/voting_result
@@ -74,6 +75,7 @@
74
75
  _hideVotingResult=this.hideVotingResult
75
76
  _resultBoxMessageTitle=(loca "votingform_title_success")
76
77
  _resultBoxMessageText=../this.votingSuccessText.richtext
78
+ _isTeaser=../../_isTeaser
77
79
  }}
78
80
  {{/if}}
79
81
  </script>
@@ -85,6 +87,7 @@
85
87
  _showBackButton=true
86
88
  _resultBoxMessageTitle=(loca "votingform_title_error")
87
89
  _resultBoxMessageText=(loca "votingform_text_error")
90
+ _isTeaser=../../_isTeaser
88
91
  }}
89
92
  </script>
90
93
  {{#unless this.hideVotingResult}}
@@ -95,6 +98,7 @@
95
98
  _statusDone=true
96
99
  _addClass=../_addClass
97
100
  _hideVotingResult=this.hideVotingResult
101
+ _isTeaser=../../_isTeaser
98
102
  }}
99
103
  {{/unless}}
100
104
  </script>
@@ -103,7 +107,7 @@
103
107
  </div>
104
108
  </div>
105
109
  {{else}}
106
- {{> components/voting/voting_result ../this _hideVotingResult=this.hideVotingResult}}
110
+ {{> components/voting/voting_result _hideVotingResult=this.hideVotingResult}}
107
111
  {{/unless}}
108
112
  {{/with}}
109
113
  {{/components/forms/components/backgroundBox }}
@@ -7,30 +7,23 @@ hbsTemplates['default'] = handlebars.compile(`
7
7
  {{> components/voting/voting }}
8
8
  `)
9
9
 
10
- hbsTemplates['result'] = handlebars.compile(`
11
- {{#>components/forms/components/backgroundBox }}
12
- {{> components/voting/voting_result this
13
- _isInline=true
14
- _statusDone=true
15
- _hideVotingResult=false
16
- _resultBoxMessageText="Danke für Ihre Abstimmung!"
17
- }}
18
- {{/components/forms/components/backgroundBox }}
10
+ hbsTemplates['teaser_50'] = handlebars.compile(`
11
+ {{> components/voting/voting _isTeaser=true}}
19
12
  `)
20
13
 
21
14
  hbsTemplates['success'] = handlebars.compile(`
22
15
  {{#>components/forms/components/backgroundBox }}
23
16
  {{> components/voting/voting_result this
24
- _statusDone=true
25
- _resultBoxMessageTitle="Vielen Dank für Ihre Stimme."
26
- _resultBoxMessageText="Eine E-Mail zur Bestätigung Ihrer Abstimmung wurde Ihnen geschickt. Bitte prüfen Sie gegebenenfalls auch Ihren Spam-Ordner."
17
+ _statusDone=true
18
+ _hideVotingResult=true
19
+ _resultBoxMessageText="Vielen Dank für Ihre Stimme.</br>Eine E-Mail zur Bestätigung Ihrer Abstimmung wurde Ihnen geschickt. Bitte prüfen Sie gegebenenfalls auch Ihren Spam-Ordner."
27
20
  }}
28
21
  {{/components/forms/components/backgroundBox }}
29
22
  `)
30
23
 
31
24
  hbsTemplates['error'] = handlebars.compile(`
32
- {{#>components/forms/components/backgroundBox }}
33
- {{> components/voting/voting_result this
25
+ {{#>components/forms/components/backgroundBox }}
26
+ {{> components/voting/voting_result this
34
27
  _isInline=true
35
28
  _statusDone=false
36
29
  _hideVotingResult=true
@@ -45,8 +38,8 @@ const TemplateVoting = (args) => {
45
38
  return hbsTemplates['default']({ ...args })
46
39
  }
47
40
 
48
- const TemplateResult = (args) => {
49
- return hbsTemplates['result']({ ...args })
41
+ const TemplateVotingTeaser50 = (args) => {
42
+ return hbsTemplates['teaser_50']({ ...args })
50
43
  }
51
44
 
52
45
  const TemplateSuccess = (args) => {
@@ -139,6 +132,31 @@ export const voting_media_video_horizontal = {
139
132
  args: fixtures.voting_media_video_horizontal.args,
140
133
  }
141
134
 
135
+ export const voting_teaser_50 = {
136
+ render: TemplateVotingTeaser50.bind({}),
137
+ name: 'Voting-Teaser 50%',
138
+ decorators: [
139
+ (Story) => {
140
+ return `<div class="sm:w-1/2 mt-12">
141
+ ${Story()}
142
+ </div>`
143
+ },
144
+ ],
145
+ args: fixtures.voting_teaser_50.args,
146
+ }
147
+
148
+ export const voting_error = {
149
+ render: TemplateError.bind({}),
150
+ name: 'Error-Meldung',
151
+ args: fixtures.voting.args,
152
+ }
153
+
154
+ export const voting_success = {
155
+ render: TemplateSuccess.bind({}),
156
+ name: 'Success-Meldung',
157
+ args: fixtures.voting_email.args,
158
+ }
159
+
142
160
  export const Snapshot = {
143
161
  render: snapshotTemplate.bind({}),
144
162
  name: 'Snapshot',
@@ -1,5 +1,5 @@
1
1
  {{#if ../this.is2FSecured}}
2
- {{> components/voting/components/voting_header _title=this.title _topline=this.topline}}
2
+ {{> components/voting/components/voting_header _isTeaser=_isTeaser _title=this.title _topline=this.topline}}
3
3
  {{~> components/base/image/icon _icon=(if _statusDone "status-done" "error-ds") _iconmap="icons" _addClass=(if _statusDone "float-left w-6 h-6 text-success dark:text-success-dark fill-current mt-6 sm:mt-12" "float-left w-6 h-6 text-error dark:text-error-dark fill-current mt-6 sm:mt-12")}}
4
4
  <p class="{{#if _statusDone}}text-success dark:text-success-dark{{else}}text-error dark:text-error-dark{{/if}} mt-6 ml-8 text-base font-bold sm:ml-9 sm:text-xl font-heading sm:mt-12">{{#if _statusDone}}{{{_resultBoxMessageTitle}}}<br/>{{/if}}{{{_resultBoxMessageText}}}</p>
5
5
  {{#if _showBackButton}}
@@ -17,7 +17,7 @@
17
17
  >
18
18
 
19
19
  {{#unless ../this.hasRedirect}}
20
- {{> components/voting/components/voting_header _title=this.title _topline=this.topline}}
20
+ {{> components/voting/components/voting_header _isTeaser=_isTeaser _title=this.title _topline=this.topline}}
21
21
  {{/unless}}
22
22
 
23
23
  {{#if _hideVotingResult}}