hr-design-system-handlebars 0.49.18 → 0.50.2
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/.storybook/main.js +12 -0
- package/CHANGELOG.md +37 -0
- package/build/webpack/feature-loader/initializer/initializer.js +3 -3
- package/dist/assets/index.css +10 -0
- package/dist/views/components/Button.hbs +8 -6
- package/dist/views/components/audio/audio_element.hbs +2 -2
- package/dist/views/components/base/link.hbs +3 -3
- package/dist/views/components/site_header/brand_navigation/brand_navigation_item.hbs +1 -1
- package/dist/views/components/site_header/header_alpine.js +56 -9
- package/dist/views/components/site_header/navigation_flyout/navigation_flyout.hbs +1 -1
- package/dist/views/components/site_header/section_navigation/section_navigation_item.hbs +4 -4
- package/dist/views/components/site_header/service_navigation/service_navigation_item.hbs +3 -3
- package/dist/views/components/teaser/cluster/teaser_cluster.hbs +18 -0
- package/dist/views/components/teaser/tabbox/teaser_tabbox.hbs +1 -1
- package/dist/views/components/video/livestream/video_livestream.hbs +1 -1
- package/dist/views/components/video/video_element.hbs +1 -1
- package/package.json +1 -1
- package/src/assets/fixtures/teaser/teaser_cluster.json +26 -0
- package/src/assets/images/navi_default.png +0 -0
- package/src/assets/images/navi_flyout_section.PNG +0 -0
- package/src/assets/images/navi_flyout_service.PNG +0 -0
- package/src/assets/images/navi_mobil_burger_open.PNG +0 -0
- package/src/assets/images/navi_mobil_default.PNG +0 -0
- package/src/assets/images/navi_mobil_scroll_1percent.PNG +0 -0
- package/src/assets/images/navi_mobil_scroll_50percent.PNG +0 -0
- package/src/assets/images/navi_mobil_search.PNG +0 -0
- package/src/assets/images/navi_mobil_search.jpg +0 -0
- package/src/assets/images/navi_scroll_50percent.PNG +0 -0
- package/src/assets/images/navi_scroll_90percent.PNG +0 -0
- package/src/assets/images/navi_tablet.PNG +0 -0
- package/src/assets/images/navi_tablet_flyout_service.PNG +0 -0
- package/src/assets/images/navi_tablet_scroll_1percent.PNG +0 -0
- package/src/assets/images/navi_tablet_scroll_50percent.PNG +0 -0
- package/src/assets/tailwind.css +4 -0
- package/src/stories/example.hbs +8 -6
- package/src/stories/views/components/Button.hbs +8 -6
- package/src/stories/views/components/audio/audio_element.hbs +2 -2
- package/src/stories/views/components/base/link.hbs +3 -3
- package/src/stories/views/components/site_header/brand_navigation/brand_navigation_item.hbs +1 -1
- package/src/stories/views/components/site_header/header.stories.mdx +317 -5
- package/src/stories/views/components/site_header/header_alpine.js +56 -9
- package/src/stories/views/components/site_header/navigation_flyout/navigation_flyout.hbs +1 -1
- package/src/stories/views/components/site_header/section_navigation/section_navigation_item.hbs +4 -4
- package/src/stories/views/components/site_header/service_navigation/service_navigation_item.hbs +3 -3
- package/src/stories/views/components/teaser/cluster/teaser_cluster.hbs +18 -0
- package/src/stories/views/components/teaser/cluster/teaser_cluster.stories.mdx +28 -0
- package/src/stories/views/components/teaser/fixtures/teaser_cluster.json +1 -0
- package/src/stories/views/components/teaser/tabbox/teaser_tabbox.hbs +1 -1
- package/src/stories/views/components/video/livestream/video_livestream.hbs +1 -1
- package/src/stories/views/components/video/video_element.hbs +1 -1
package/.storybook/main.js
CHANGED
|
@@ -72,6 +72,18 @@ module.exports = {
|
|
|
72
72
|
},
|
|
73
73
|
],
|
|
74
74
|
include: path.resolve(__dirname, '../'),
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
test: /\.(png|woff|woff2|eot|ttf|jpg|jpeg|gif|svg)$/,
|
|
78
|
+
use: [
|
|
79
|
+
{
|
|
80
|
+
loader: "file-loader",
|
|
81
|
+
options: {
|
|
82
|
+
name: "[path][name].[ext]",
|
|
83
|
+
context: "",
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
],
|
|
75
87
|
}
|
|
76
88
|
)
|
|
77
89
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
1
|
+
# v0.50.2 (Fri Jul 15 2022)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- refactor header.stories.mdx [#276](https://github.com/mumprod/hr-design-system-handlebars/pull/276) ([@StefanVesper](https://github.com/StefanVesper))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- SonicSoulSurfer ([@StefanVesper](https://github.com/StefanVesper))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# v0.50.1 (Fri Jul 15 2022)
|
|
14
|
+
|
|
15
|
+
#### 🐛 Bug Fix
|
|
16
|
+
|
|
17
|
+
- add json for ClusterTeaser [#278](https://github.com/mumprod/hr-design-system-handlebars/pull/278) (zouhair1 [@selbaciri](https://github.com/selbaciri))
|
|
18
|
+
|
|
19
|
+
#### Authors: 2
|
|
20
|
+
|
|
21
|
+
- Saad El Baciri ([@selbaciri](https://github.com/selbaciri))
|
|
22
|
+
- selbaciri (zouhair1)
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
# v0.50.0 (Fri Jul 15 2022)
|
|
27
|
+
|
|
28
|
+
#### 🚀 Enhancement
|
|
29
|
+
|
|
30
|
+
- FEATURE: Changes the name of the js feature [#277](https://github.com/mumprod/hr-design-system-handlebars/pull/277) ([@szuelch](https://github.com/szuelch))
|
|
31
|
+
|
|
32
|
+
#### Authors: 1
|
|
33
|
+
|
|
34
|
+
- [@szuelch](https://github.com/szuelch)
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
1
38
|
# v0.49.18 (Thu Jul 14 2022)
|
|
2
39
|
|
|
3
40
|
#### 🐛 Bug Fix
|
|
@@ -3,8 +3,8 @@ import FeatureList from './featureList'
|
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
run: (rootElement, loader) => {
|
|
6
|
-
DomElementList(rootElement, '.js-load').forEach(domElement =>
|
|
7
|
-
FeatureList(domElement, 'data-
|
|
6
|
+
DomElementList(rootElement, '.js-load').forEach((domElement) =>
|
|
7
|
+
FeatureList(domElement, 'data-hr-').forEach((feature) => feature.execute(loader))
|
|
8
8
|
)
|
|
9
|
-
}
|
|
9
|
+
},
|
|
10
10
|
}
|
package/dist/assets/index.css
CHANGED
|
@@ -596,6 +596,10 @@ video {
|
|
|
596
596
|
.relative {
|
|
597
597
|
position: relative;
|
|
598
598
|
}
|
|
599
|
+
.sticky {
|
|
600
|
+
position: -webkit-sticky;
|
|
601
|
+
position: sticky;
|
|
602
|
+
}
|
|
599
603
|
.bottom-0 {
|
|
600
604
|
bottom: 0px;
|
|
601
605
|
}
|
|
@@ -1298,6 +1302,9 @@ video {
|
|
|
1298
1302
|
.p-2 {
|
|
1299
1303
|
padding: 0.5rem;
|
|
1300
1304
|
}
|
|
1305
|
+
.p-5 {
|
|
1306
|
+
padding: 1.25rem;
|
|
1307
|
+
}
|
|
1301
1308
|
.py-3\.5 {
|
|
1302
1309
|
padding-top: 0.875rem;
|
|
1303
1310
|
padding-bottom: 0.875rem;
|
|
@@ -2414,6 +2421,9 @@ video {
|
|
|
2414
2421
|
--color-topline: #c20016;
|
|
2415
2422
|
}
|
|
2416
2423
|
/*! purgecss end ignore */
|
|
2424
|
+
.sbdocs-content {
|
|
2425
|
+
max-width:1140px !important;
|
|
2426
|
+
}
|
|
2417
2427
|
.hide-scroll-bar {
|
|
2418
2428
|
-ms-overflow-style: none;
|
|
2419
2429
|
scrollbar-width: none;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
<button
|
|
1
|
+
<button
|
|
2
|
+
class='js-load btn
|
|
3
|
+
{{inline-switch size '["sm","lg","xl"]' '["btn--sm","btn--lg","btn--xl","btn--md"]'}}
|
|
4
|
+
{{inline-switch type '["secondary"]' '["btn--secondary","btn--primary"]'}}'
|
|
5
|
+
>
|
|
2
6
|
{{label}}
|
|
3
7
|
</button>
|
|
4
|
-
<div class=
|
|
5
|
-
<div class=
|
|
6
|
-
</div>
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
<div class='js-load outer' data-hr-foo='{"test":"bar"}'>
|
|
9
|
+
<div class='inner'></div>
|
|
10
|
+
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<div class="c-audioElement">
|
|
2
2
|
<div id="{{nextRandom}}" class="{{~#with _addClass }} {{this}}{{/with}} js-load"
|
|
3
|
-
data-
|
|
3
|
+
data-hr-mediaplayer-loader-ds='{
|
|
4
4
|
"type": "audio",
|
|
5
5
|
"position": "{{if _isTeaser 'teaser' 'page'}}",
|
|
6
6
|
"teaserSize" : "{{if _teaserSize _teaserSize '00' }}",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
{{~#if ../this.isPodcast~}}
|
|
63
63
|
<a href="{{../this.podcastDownloadUrl}}" class="downloadLink button-invert js-load"{{#with
|
|
64
64
|
../this.trackingData}}
|
|
65
|
-
data-
|
|
65
|
+
data-hr-click-tracking='{"settings": [{"type": "download", "clickLabel": "{{this.pageName}}", "secondLevelId": "{{this.secondLevelId}}"}, {"type": "uxAction", "clickLabel": "medienDownload::podcast::{{_type}}", "secondLevelId": "{{this.secondLevelId}}" }]}'{{/with}}>
|
|
66
66
|
{{> components/base/image/icon _icon='download-button' _addClass="icon--media"}}
|
|
67
67
|
</a>
|
|
68
68
|
{{~/if~}}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
<a {{#with this.webviewUrl}}data-webviewurl="{{this}}"{{/with}} href="{{this.url}}" {{#with this.webviewUrl}}{{/with}}
|
|
3
3
|
class="sb-link{{#if ../css}} {{../css}}{{/if}}{{#if ../doTracking}} js-load{{else}}{{#if ../this.content.isFileDownload}} js-loadScript{{/if}}{{/if}}{{#if ../isSelected}} {{defaultIfEmpty ../selectedCssClass "-current"}}{{/if}}"
|
|
4
4
|
{{#if ../doNavigationTracking}}
|
|
5
|
-
data-
|
|
5
|
+
data-hr-click-tracking='{"settings": [{"type":"uxAction","secondLevelId": "1","clickLabel":"{{../clickLabelType}}{{#if ../clickLabelPrefix1}}::{{../clickLabelPrefix1}}{{/if}}::{{../clickLabelPrefix2}}-Link geklickt"}]}'
|
|
6
6
|
{{/if}}
|
|
7
7
|
{{#if ../doTracking}}
|
|
8
|
-
{{#with this.content.trackingData}}data-
|
|
8
|
+
{{#with this.content.trackingData}}data-hr-click-tracking='{"settings": [{"type":"uxAction","secondLevelId": "{{this.secondLevelId}}","clickLabel": "{{#if ../this.content.isFileDownload}}{{this.pageName}}{{else}}mediabuttonclick::{{../../clickLabelPrefix1}}::{{../../clickLabelPrefix2}}{{/if}}"}]}'{{/with}}
|
|
9
9
|
{{else}}
|
|
10
10
|
{{#if ../this.content.isFileDownload}}
|
|
11
|
-
{{#with this.content.trackingData}}data-
|
|
11
|
+
{{#with this.content.trackingData}}data-hr-click-tracking='{"settings": [{"type":"download","secondLevelId": "{{this.secondLevelId}}","clickLabel": "{{this.pageName}}"}]}'{{/with}}
|
|
12
12
|
{{/if}}
|
|
13
13
|
{{/if}}
|
|
14
14
|
{{#if this.isTargetBlank}} target="_blank" rel="noopener{{#if this.hasNoReferrerFlag}} noreferrer{{/if}}"{{/if}}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<li class="sb-brand-navigation-item{{#if this.selected}} h-10 lg:h-8 font-bold text-blue-congress {{/if}} cursor-pointer inline-block lg:hover:underline active:font-bold active:text-blue-science">
|
|
2
|
-
<a class="link-focus-inset leading-10 lg:leading-8 flex-col px-3 {{#if @first }}pl-0 {{/if}}lg:flex-row js-load w-max flex justify-center {{#if this.selected}} -currentBrand {{/if}}" aria-label="{{this.name}}" href="{{resourceUrl "index.html" _site=this.site}}"{{#if this.extern}} target="_blank" rel="noopener noreferrer"{{/if}} data-
|
|
2
|
+
<a class="link-focus-inset leading-10 lg:leading-8 flex-col px-3 {{#if @first }}pl-0 {{/if}}lg:flex-row js-load w-max flex justify-center {{#if this.selected}} -currentBrand {{/if}}" aria-label="{{this.name}}" href="{{resourceUrl "index.html" _site=this.site}}"{{#if this.extern}} target="_blank" rel="noopener noreferrer"{{/if}} data-hr-click-tracking='{"settings": [{"type": "uxAction", "secondLevelId": "1", "clickLabel": "Brandnavigation::{{this.text}}-Link geklickt"}]}'>{{this.text}}</a>
|
|
3
3
|
</li>
|
|
@@ -32,23 +32,25 @@ document.addEventListener('alpine:init', () => {
|
|
|
32
32
|
init(){
|
|
33
33
|
let lastScrollTop = 0
|
|
34
34
|
let height = window.innerHeight
|
|
35
|
+
|
|
36
|
+
//Globale Variable, true = user initiated scroll / false = programmatic scroll via JS (e.g. click on Anchor Link)
|
|
35
37
|
let userScroll = false;
|
|
36
38
|
window.userScroll = userScroll;
|
|
37
39
|
|
|
40
|
+
// gets fired when user initated scroll happened, global variable is used in Ticker-Topnews and other anchor links to prevent expanding of the navigation if scrollposition gets corrected by JS.
|
|
38
41
|
const mouseEvent = () => {
|
|
39
42
|
userScroll = true;
|
|
40
43
|
window.userScroll = true;
|
|
41
|
-
//console.log('user action detected')
|
|
42
44
|
}
|
|
43
|
-
|
|
45
|
+
// detect if the user clicked/dragged the scrollbar manually
|
|
44
46
|
const clickedOnScrollbar = mouseX => {
|
|
45
47
|
return document.documentElement.offsetWidth <= mouseX ? true : false;
|
|
46
48
|
}
|
|
47
|
-
|
|
49
|
+
// if clicked on scrollbar, fire user initiated mouse event
|
|
48
50
|
const mouseDownHandler = e => {
|
|
49
51
|
clickedOnScrollbar(e.clientX) ? mouseEvent() : null
|
|
50
52
|
};
|
|
51
|
-
|
|
53
|
+
// main scroll handler, defines scroll direction, percent of viewport scrolled, visibility of navigation and subnavigation
|
|
52
54
|
const scrollHandler = () => {
|
|
53
55
|
let winScroll = document.body.scrollTop || document.documentElement.scrollTop
|
|
54
56
|
winScroll > lastScrollTop ? this.scrollingDown = true : this.scrollingDown = false
|
|
@@ -59,14 +61,19 @@ document.addEventListener('alpine:init', () => {
|
|
|
59
61
|
//console.log('winscroll: '+winScroll+' screen height: '+height + ' percent scrolled: '+ this.percent)
|
|
60
62
|
//console.log('Scroll initiated by ' + (window.userScroll == true ? "user" : "browser"));
|
|
61
63
|
}
|
|
62
|
-
|
|
64
|
+
// Listeners
|
|
63
65
|
window.addEventListener('mousedown', mouseDownHandler, false)
|
|
64
66
|
window.addEventListener('wheel', mouseEvent, false);
|
|
65
67
|
window.addEventListener('touchmove', mouseEvent, false)
|
|
66
68
|
window.addEventListener('scroll', this.debounce( scrollHandler,50), { passive: true })
|
|
67
69
|
},
|
|
70
|
+
//Holds the percentage of scrolled viewport
|
|
68
71
|
percent: 0,
|
|
72
|
+
|
|
73
|
+
//defines the scroll direction
|
|
69
74
|
scrollingDown: true,
|
|
75
|
+
|
|
76
|
+
//returns true if section navigation is hidden on desktop OR service navigation is hidden on mobile
|
|
70
77
|
isNavHidden() {
|
|
71
78
|
if(this.$screen('lg')) {
|
|
72
79
|
return this.shouldSectionNavBeHidden()
|
|
@@ -74,6 +81,8 @@ document.addEventListener('alpine:init', () => {
|
|
|
74
81
|
return this.shouldServiceNavBeHidden()
|
|
75
82
|
}
|
|
76
83
|
},
|
|
84
|
+
|
|
85
|
+
//returns false if subnav is visible and true if subnav is hidden
|
|
77
86
|
isSubNavHidden() {
|
|
78
87
|
if(this.$screen('lg')){
|
|
79
88
|
if (document.querySelector('.isSelectedAndOpen') !== null) {
|
|
@@ -85,9 +94,13 @@ document.addEventListener('alpine:init', () => {
|
|
|
85
94
|
return true
|
|
86
95
|
}
|
|
87
96
|
},
|
|
97
|
+
|
|
98
|
+
// returns true if the user scrolled at least 1px from top
|
|
88
99
|
shouldBrandNavBeHidden() {
|
|
89
100
|
return this.percent > 0
|
|
90
101
|
},
|
|
102
|
+
|
|
103
|
+
// returns true if user scrolled >50% and scrolls down, no burger menu is open and the screen size is desktop. If scroll was initiated by script, ignore scroll direction.
|
|
91
104
|
shouldSectionNavBeHidden() {
|
|
92
105
|
if(window.userScroll == true){
|
|
93
106
|
return this.percent > 50 && this.scrollingDown && this.$store.burgeropen == false && this.$screen('lg')
|
|
@@ -96,6 +109,8 @@ document.addEventListener('alpine:init', () => {
|
|
|
96
109
|
}
|
|
97
110
|
|
|
98
111
|
},
|
|
112
|
+
|
|
113
|
+
// returns true if user scrolled >90% and scrolls further down, no burger menu is open and the screen is NOT desktop. If scroll was initiated by script, ignore scroll direction.
|
|
99
114
|
shouldServiceNavBeHidden() {
|
|
100
115
|
if(window.userScroll == true) {
|
|
101
116
|
return (this.percent > 90 && !this.$screen('lg') && this.scrollingDown && this.$store.burgeropen == false)
|
|
@@ -103,12 +118,18 @@ document.addEventListener('alpine:init', () => {
|
|
|
103
118
|
return (this.percent > 90 && !this.$screen('lg') && this.$store.burgeropen == false)
|
|
104
119
|
}
|
|
105
120
|
},
|
|
121
|
+
|
|
122
|
+
//returns true if user scrolled >50% and scrolls further down, no burger menu is open, no serviceNav is open and screen is not larger than mobile. OR: same same, but scrolling up.
|
|
106
123
|
shouldServiceIconsBeHidden() {
|
|
107
124
|
return (this.percent > 50 && !this.$screen('md') && this.$store.burgeropen == false && this.$store.serviceNavIsOpen == false && this.scrollingDown == true) || (this.percent > 50 && !this.$screen('md') && this.$store.burgeropen == false && this.$store.serviceNavIsOpen == false && this.scrollingDown == false)
|
|
108
125
|
},
|
|
126
|
+
|
|
127
|
+
// returns true if user scrolled >50% and scrolls further down and is a desktop viewport
|
|
109
128
|
shouldFlyoutBeHidden() {
|
|
110
129
|
return (this.percent > 50 && this.scrollingDown && this.$screen('lg') )
|
|
111
130
|
},
|
|
131
|
+
|
|
132
|
+
// resets the navigation back to the initial state. Happens f.ex. on resize of window.
|
|
112
133
|
resetNav() {
|
|
113
134
|
if(window.innerWidth > 1023) {
|
|
114
135
|
this.$refs.sectionnavigation.setAttribute("style","")
|
|
@@ -143,6 +164,8 @@ document.addEventListener('alpine:init', () => {
|
|
|
143
164
|
this.$store.clientWidth = nowClientWidth
|
|
144
165
|
}
|
|
145
166
|
},
|
|
167
|
+
|
|
168
|
+
// toggles the maxHeight of the section nav and makes sure there is enough space to display all items.
|
|
146
169
|
toggleSectionNav() {
|
|
147
170
|
//false = sectionNav schließt ( mobile/tablet? --> maxHeight = 0 /// desktop? just clear maxHeight attribute )
|
|
148
171
|
//true = sectionNav öffnet (maxheight = scrollheight)
|
|
@@ -168,16 +191,22 @@ document.addEventListener('alpine:init', () => {
|
|
|
168
191
|
}
|
|
169
192
|
}
|
|
170
193
|
},
|
|
194
|
+
|
|
195
|
+
// no scrolling when overlay is visible
|
|
171
196
|
disableScrolling() {
|
|
172
197
|
document.body.classList.add('overflow-hidden','h-full','w-full')
|
|
173
198
|
this.$refs.myOverlay.ontouchmove = (e) => e.preventDefault();
|
|
174
199
|
console.log("disableScrolling")
|
|
175
200
|
},
|
|
201
|
+
|
|
202
|
+
//only scroll when no overlay is visible
|
|
176
203
|
enableScrolling() {
|
|
177
204
|
document.body.classList.remove('overflow-hidden','h-full','w-full')
|
|
178
205
|
this.$refs.myOverlay.ontouchmove = (e) => true;
|
|
179
206
|
console.log("enableScrolling")
|
|
180
207
|
},
|
|
208
|
+
|
|
209
|
+
// toggles scrolling ability
|
|
181
210
|
toggleScrolling(mode){
|
|
182
211
|
if(this.$screen(0) && !this.$screen('lg')){
|
|
183
212
|
mode == false ? this.disableScrolling() : this.enableScrolling()
|
|
@@ -191,9 +220,13 @@ document.addEventListener('alpine:init', () => {
|
|
|
191
220
|
|
|
192
221
|
// context for the overlay
|
|
193
222
|
Alpine.data('overlayHandler', () => ({
|
|
223
|
+
|
|
224
|
+
// show the overlay on mobile and tablet if burger menu is open OR service nav is open OR search field is open
|
|
194
225
|
shouldOverlayBeShown() {
|
|
195
226
|
return (!this.$screen('lg') && ( this.$store.burgeropen == true || this.$store.serviceNavIsOpen == true || this.$store.searchFieldOpen == true ))
|
|
196
227
|
},
|
|
228
|
+
|
|
229
|
+
// on click on overlay change global var for servicenav, dispatch events to close burger and service menu, re-enable scrolling.
|
|
197
230
|
overlayWasClicked() {
|
|
198
231
|
this.$store.serviceNavIsOpen ? this.$store.serviceNavIsOpen = false : null
|
|
199
232
|
this.$dispatch('burger-close')
|
|
@@ -203,18 +236,28 @@ document.addEventListener('alpine:init', () => {
|
|
|
203
236
|
}
|
|
204
237
|
}))
|
|
205
238
|
|
|
206
|
-
// context for all dropdowns
|
|
239
|
+
// context for all dropdowns, used in section nav submenus and service nav flyout submenus
|
|
207
240
|
Alpine.data('dropdown', () => ({
|
|
241
|
+
|
|
242
|
+
// state of the dropdown
|
|
208
243
|
dropped: false,
|
|
244
|
+
|
|
245
|
+
// toggle() interpolates state
|
|
209
246
|
toggle() {
|
|
210
247
|
this.dropped = ! this.dropped;
|
|
211
248
|
},
|
|
249
|
+
|
|
250
|
+
// toggles visibility of service nav and sets global variables in stores
|
|
212
251
|
toggleServiceNav(){
|
|
213
252
|
this.dropped = ! this.dropped;
|
|
253
|
+
|
|
254
|
+
// close search if open
|
|
214
255
|
this.$store.searchFieldOpen = false;
|
|
215
256
|
|
|
257
|
+
// if clicked element is not the current serviceID, leave the servicenav open, else interpolate servicenav state
|
|
216
258
|
this.$el.id != this.$store.serviceID.current ? this.$store.serviceNavIsOpen = true : this.$el.id == this.$store.serviceID.current ? this.$store.serviceNavIsOpen = !this.$store.serviceNavIsOpen : null;
|
|
217
259
|
|
|
260
|
+
//if burger is open, dispatch event to close it
|
|
218
261
|
this.$store.burgeropen == true ? this.$dispatch('burger-close') : null
|
|
219
262
|
|
|
220
263
|
console.log('currentID: '+ this.$store.serviceID.current)
|
|
@@ -222,10 +265,13 @@ document.addEventListener('alpine:init', () => {
|
|
|
222
265
|
console.log('element-id: '+this.$el.id)
|
|
223
266
|
console.log('serviceNav is open:'+ this.$store.serviceNavIsOpen)
|
|
224
267
|
|
|
268
|
+
//set the serviceID to the current element´s ID.
|
|
225
269
|
this.$store.serviceID.current = this.$el.id
|
|
226
270
|
|
|
271
|
+
//enable/disable scrolling
|
|
227
272
|
this.toggleScrolling(!this.$store.serviceNavIsOpen)
|
|
228
273
|
|
|
274
|
+
//defines behaviour for servicenav on mobile viewports, taking care of viewport sizes
|
|
229
275
|
let myFlyout = document.querySelector('#flyout-'+this.$el.id)
|
|
230
276
|
let brandNavHeight = this.percent > 0 ? 40 : 0
|
|
231
277
|
|
|
@@ -252,8 +298,9 @@ document.addEventListener('alpine:init', () => {
|
|
|
252
298
|
this.$el.setAttribute("x-collapse","")
|
|
253
299
|
}
|
|
254
300
|
},
|
|
301
|
+
|
|
302
|
+
//Adds scrollheight of the flyout to sectionNav container to make sure all following items stay visible
|
|
255
303
|
sectionNavFlyoutWatcher() {
|
|
256
|
-
//Adds scrollheight of the flyout to sectionNav container to make sure all following items stay visible
|
|
257
304
|
this.$watch('dropped', value => {
|
|
258
305
|
let a = this.$refs.sectionnavigation.scrollHeight + this.$el.scrollHeight;
|
|
259
306
|
let brandNavHeight = this.percent > 0 ? 40 : 0
|
|
@@ -278,8 +325,9 @@ document.addEventListener('alpine:init', () => {
|
|
|
278
325
|
|
|
279
326
|
})
|
|
280
327
|
},
|
|
328
|
+
|
|
329
|
+
//sets/cleansup the x-collapse attributes depending on window.innerWidth, gets fired @resize.window in NavigationFlyout.hbs
|
|
281
330
|
setFlyoutAnimationStyle() {
|
|
282
|
-
//sets/cleansup the x-collapse attributes depending on window.innerWidth, gets fired @resize.window in NavigationFlyout.hbs
|
|
283
331
|
if(window.innerWidth > 1023) {
|
|
284
332
|
if(this.$el.hasAttribute("x-collapse.duration.500ms")) {
|
|
285
333
|
this.$el.removeAttribute("x-collapse.duration.500ms")
|
|
@@ -289,7 +337,6 @@ document.addEventListener('alpine:init', () => {
|
|
|
289
337
|
if (! this.$el._x_isShown) this.$el.style.display = 'none'
|
|
290
338
|
if(this.$el.hasAttribute("hidden")) this.$el.removeAttribute("hidden")
|
|
291
339
|
}
|
|
292
|
-
|
|
293
340
|
} else {
|
|
294
341
|
if(!this.$el.hasAttribute("x-collapse.duration.500ms")) this.$el.setAttribute("x-collapse.duration.500ms","")
|
|
295
342
|
}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
{{#unless ../_isSectionNav}}
|
|
33
33
|
<div class="w-full">
|
|
34
34
|
<div class="flex pt-4 pb-2 pl-4 text-base font-bold bg-white lg:pl-0 md:pt-4 lg:pt-1 lg:pb-0 justify-left text-blue-congress ">
|
|
35
|
-
<a href="{{resourceUrl ../this.url}}" class="-isHeaderLink lg:leading-10 link-focus-inset js-load" data-
|
|
35
|
+
<a href="{{resourceUrl ../this.url}}" class="-isHeaderLink lg:leading-10 link-focus-inset js-load" data-hr-click-tracking='{"settings": [{"type": "uxAction", "secondLevelId": "1", "clickLabel": "{{../_navigationType}}::{{../_parent}}::{{../this.flyoutStartLinkText}}-Link geklickt"}]}' >
|
|
36
36
|
{{../this.flyoutStartLinkText}}
|
|
37
37
|
</a>
|
|
38
38
|
</div>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
x-effect="$el.setAttribute('aria-expanded', dropped);$el.setAttribute('tabindex', $store.burgeropen || $screen('lg') ? '0' : '-1')"
|
|
14
14
|
aria-owns="flyout-{{getRandom}}"
|
|
15
15
|
aria-controls="flyout-{{getRandom}}"
|
|
16
|
-
data-
|
|
16
|
+
data-hr-click-tracking='{"settings": [{"type": "uxAction", "secondLevelId": "1", "clickLabel": "Rubriknavigation::{{this.text}}-Toggle-Link geklickt"}]}'>
|
|
17
17
|
|
|
18
18
|
{{~else ~}}
|
|
19
19
|
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
x-effect="$el.setAttribute('aria-expanded', dropped || $screen('lg'));$el.setAttribute('tabindex', $store.burgeropen || $screen('lg') ? '0' : '-1')"
|
|
30
30
|
aria-owns="flyout-{{getRandom}}"
|
|
31
31
|
aria-controls="flyout-{{getRandom}}"
|
|
32
|
-
data-
|
|
32
|
+
data-hr-click-tracking='{"settings": [{"type": "uxAction", "secondLevelId": "1", "clickLabel": "Rubriknavigation::{{this.text}}-Link geklickt"}]}'>
|
|
33
33
|
{{~else ~}}
|
|
34
34
|
{{!-- Gilt für START/GESELLSCHAFT/WIRTSCHAFT usw: --}}
|
|
35
35
|
<a href="{{resourceUrl this.url}}"
|
|
36
36
|
class="{{#if this.selected}}-currentSection lg:justify-center {{/if}} link-focus-inset-white js-load flex justify-start pl-4 pr-4 h-10 lg:justify-center items-center w-full{{#if this.selected}} font-bold{{/if}}"
|
|
37
37
|
{{#if this.labelText}} aria-label="{{this.labelText}}"{{/if}}
|
|
38
|
-
data-
|
|
38
|
+
data-hr-click-tracking='{"settings": [{"type": "uxAction", "secondLevelId": "1", "clickLabel": "Rubriknavigation::{{this.text}}-Link geklickt"}]}'
|
|
39
39
|
x-effect="$el.setAttribute('tabindex', $store.burgeropen || $screen('lg') ? '0' : '-1')"
|
|
40
40
|
>
|
|
41
41
|
{{~/if}}
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
aria-owns="flyout-{{getRandom}}"
|
|
82
82
|
aria-controls="flyout-{{getRandom}}"
|
|
83
83
|
aria-labelledby="flyout-{{getRandom}}-1"
|
|
84
|
-
data-
|
|
84
|
+
data-hr-click-tracking='{"settings": [{"type": "uxAction", "secondLevelId": "1", "clickLabel": "Rubriknavigation::{{this.text}}-Toggle-Link geklickt"}]}'>
|
|
85
85
|
|
|
86
86
|
<span class="hidden">{{~this.text~}}</span>
|
|
87
87
|
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
aria-owns="flyout-{{getRandom}}"
|
|
18
18
|
aria-controls="flyout-{{getRandom}}"
|
|
19
19
|
x-effect="$el.setAttribute('aria-expanded', dropped);$el.setAttribute('aria-label', dropped ? '{{this.text}}-Menü schließen' : '{{this.text}}-Menü öffnen')"
|
|
20
|
-
data-
|
|
20
|
+
data-hr-click-tracking='{"settings": [{"type": "uxAction", "secondLevelId": "1", "clickLabel": "Servicenavigation::{{this.text}}-Link geklickt"}]}'
|
|
21
21
|
>
|
|
22
22
|
|
|
23
23
|
{{else}}
|
|
24
24
|
|
|
25
25
|
{{#if this.extern}}
|
|
26
|
-
<a href="{{this.url}}" target="_blank" x-init="dropped = false" class="flex flex-col items-center justify-center h-full px-4 lg:justify-start lg:px-3 lg:rounded-t link-focus-inset-white js-load" id="flyout-{{nextRandom}}-1" data-
|
|
26
|
+
<a href="{{this.url}}" target="_blank" x-init="dropped = false" class="flex flex-col items-center justify-center h-full px-4 lg:justify-start lg:px-3 lg:rounded-t link-focus-inset-white js-load" id="flyout-{{nextRandom}}-1" data-hr-click-tracking='{"settings": [{"type": "uxAction", "secondLevelId": "1", "clickLabel": "Servicenavigation::{{this.text}}-Link geklickt"}]}'>
|
|
27
27
|
{{else}}
|
|
28
|
-
<a href="{{resourceUrl this.url}}" x-init="dropped = false" class="flex flex-col items-center justify-center h-full px-4 lg:justify-start lg:px-3 lg:pt-1 lg:rounded-t link-focus-inset-white js-load" id="flyout-{{nextRandom}}-1" data-
|
|
28
|
+
<a href="{{resourceUrl this.url}}" x-init="dropped = false" class="flex flex-col items-center justify-center h-full px-4 lg:justify-start lg:px-3 lg:pt-1 lg:rounded-t link-focus-inset-white js-load" id="flyout-{{nextRandom}}-1" data-hr-click-tracking='{"settings": [{"type": "uxAction", "secondLevelId": "1", "clickLabel": "Servicenavigation::{{this.text}}-Link geklickt"}]}'>
|
|
29
29
|
{{/if}}
|
|
30
30
|
|
|
31
31
|
{{/if}}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<div class="w-full p-5">
|
|
2
|
+
|
|
3
|
+
<b><u>Schlagzeilen-Box</u></b><br/><br/>
|
|
4
|
+
<b>Title:</b> {{this.title}}<br/>
|
|
5
|
+
<b>teaserLogo:</b> {{this.teaserLogo}}<br/>
|
|
6
|
+
<b>showFirstImageOrGenreImage:</b> {{this.showFirstImageOrGenreImage}}<br/>
|
|
7
|
+
<b>HideTitle:</b> {{this.HideTitle}}<br/>
|
|
8
|
+
<b>showGenreImage:</b> {{this.showGenreImage}}<br/>
|
|
9
|
+
<b>showFirstImage:</b> {{this.showFirstImage}}<br/>
|
|
10
|
+
<br/>
|
|
11
|
+
|
|
12
|
+
<b>clusterTeaserItems:</b><br/>
|
|
13
|
+
{{~#each this.clusterTeaserItems}}
|
|
14
|
+
{{this.logicItem.includeModel.title}}<br/>
|
|
15
|
+
{{/each~}}
|
|
16
|
+
<br/><hr/>
|
|
17
|
+
|
|
18
|
+
</div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
x-data="{ tab: '{{this.tabbedGroup.[0].title}}' }"
|
|
3
3
|
class="grid grid-cols-12 pt-6 md:pt-7 bg-[#dce8f0] mx-0 md:rounded-tl-3xl md:rounded-br-3xl col-main gap-x-6 gap-y-6"
|
|
4
4
|
>
|
|
5
|
-
<section class="col-span-full" data-
|
|
5
|
+
<section class="col-span-full" data-hr-group-tabbed='{"wandaPageId":"{{this.wandaPageId}}"}'>
|
|
6
6
|
<div class="flex flex-wrap justify-center mb-7 mx-1.5" role="tablist">
|
|
7
7
|
{{~#each this.tabbedGroup~}}
|
|
8
8
|
<button onclick="window.location.href='#tgp{{@index}}';"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div x-show="avStart" id="{{nextRandom}}" class="ar-16-9 js-load" data-
|
|
1
|
+
<div x-show="avStart" id="{{nextRandom}}" class="ar-16-9 js-load" data-hr-mediaplayer-loader-ds='{
|
|
2
2
|
"type": "live",
|
|
3
3
|
"position": "{{if _isTeaser 'teaser' 'page'}}",
|
|
4
4
|
"teaserSize" : "{{if _teaserSize _teaserSize '00' }}",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div x-show="avStart" id="{{nextRandom}}" class="ar-16-9 js-load" data-
|
|
1
|
+
<div x-show="avStart" id="{{nextRandom}}" class="ar-16-9 js-load" data-hr-mediaplayer-loader-ds='{
|
|
2
2
|
"type": "ondemand",
|
|
3
3
|
"position": "{{if _isTeaser 'teaser' 'page'}}",
|
|
4
4
|
"teaserSize" : "{{if _teaserSize _teaserSize '00' }}",
|
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": "0.
|
|
9
|
+
"version": "0.50.2",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
12
|
"storybook": "start-storybook -p 6006 public",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title" : "Schlagzeilen",
|
|
3
|
+
"teaserLogo" : "hessenschau_de",
|
|
4
|
+
"showFirstImageOrGenreImage" : false,
|
|
5
|
+
"HideTitle" : false,
|
|
6
|
+
"showGenreImage" : false,
|
|
7
|
+
"showFirstImage" : false,
|
|
8
|
+
|
|
9
|
+
"clusterTeaserItems": [
|
|
10
|
+
{
|
|
11
|
+
"@->jsoninclude": "teaser/teaser_standard_100_serif.json"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"@->jsoninclude": "teaser/teaser_standard_100_serif.json"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"@->jsoninclude": "teaser/teaser_standard_100_serif.json"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"@->jsoninclude": "teaser/teaser_standard_100_serif.json"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"@->jsoninclude": "teaser/teaser_standard_100_serif.json"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/assets/tailwind.css
CHANGED
package/src/stories/example.hbs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
<button
|
|
1
|
+
<button
|
|
2
|
+
class='js-load btn
|
|
3
|
+
{{inline-switch size '["sm","lg","xl"]' '["btn--sm","btn--lg","btn--xl","btn--md"]'}}
|
|
4
|
+
{{inline-switch type '["secondary"]' '["btn--secondary","btn--primary"]'}}'
|
|
5
|
+
>
|
|
2
6
|
{{label}}
|
|
3
7
|
</button>
|
|
4
|
-
<div class=
|
|
5
|
-
<div class=
|
|
6
|
-
</div>
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
<div class='js-load outer' data-hr-foo='{"test":"bar"}'>
|
|
9
|
+
<div class='inner'></div>
|
|
10
|
+
</div>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
<button
|
|
1
|
+
<button
|
|
2
|
+
class='js-load btn
|
|
3
|
+
{{inline-switch size '["sm","lg","xl"]' '["btn--sm","btn--lg","btn--xl","btn--md"]'}}
|
|
4
|
+
{{inline-switch type '["secondary"]' '["btn--secondary","btn--primary"]'}}'
|
|
5
|
+
>
|
|
2
6
|
{{label}}
|
|
3
7
|
</button>
|
|
4
|
-
<div class=
|
|
5
|
-
<div class=
|
|
6
|
-
</div>
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
<div class='js-load outer' data-hr-foo='{"test":"bar"}'>
|
|
9
|
+
<div class='inner'></div>
|
|
10
|
+
</div>
|