hr-design-system-handlebars 0.56.8 → 0.56.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/build/helpers/ifCond.js +28 -0
- package/dist/assets/index.css +25 -13
- package/dist/assets/js/views/base/autosuggest/autoSuggest.feature.js +1 -1
- package/dist/assets/js/views/generic/hrQuery.subfeature.js +154 -54
- package/dist/views/base/autosuggest/autoSuggest.feature.js +1 -1
- package/dist/views/components/content_nav/content_nav.hbs +6 -14
- package/dist/views/components/content_nav/content_nav_container.hbs +8 -4
- package/dist/views/components/content_nav/content_nav_item.hbs +5 -4
- package/dist/views/components/content_nav/content_nav_list.hbs +3 -3
- package/dist/views/components/content_nav/dropdown.hbs +8 -10
- package/dist/views/components/site_header/header_alpine.js +26 -10
- package/dist/views/components/teaser/cluster/teaser_cluster_item.hbs +1 -1
- package/dist/views/components/teaser/content_nav/teaser_content_nav.hbs +4 -8
- package/dist/views/generic/hrQuery.subfeature.js +154 -54
- package/package.json +1 -1
- package/src/assets/fixtures/teaser/teaser_content_nav_flow_100.json +3 -3
- package/src/assets/fixtures/teaser/teaser_content_nav_flow_autosuggest.json +183 -0
- package/src/assets/fixtures/teaser/teaser_content_nav_list_100.json +4 -5
- package/src/assets/fixtures/teaser/teaser_content_nav_list_autosuggest.json +181 -0
- package/src/assets/fixtures/teaser/teaser_content_nav_mixed_100.json +2 -2
- package/src/assets/fixtures/teaser/teaser_content_nav_mixed_autosuggest.json +1 -1
- package/src/stories/views/base/autosuggest/autoSuggest.feature.js +1 -1
- package/src/stories/views/components/content_nav/content_nav.hbs +6 -14
- package/src/stories/views/components/content_nav/content_nav_container.hbs +8 -4
- package/src/stories/views/components/content_nav/content_nav_item.hbs +5 -4
- package/src/stories/views/components/content_nav/content_nav_list.hbs +3 -3
- package/src/stories/views/components/content_nav/dropdown.hbs +8 -10
- package/src/stories/views/components/site_header/header_alpine.js +26 -10
- package/src/stories/views/components/teaser/cluster/teaser_cluster_item.hbs +1 -1
- package/src/stories/views/components/teaser/content_nav/teaser_content_nav.hbs +4 -8
- package/src/stories/views/components/teaser/content_nav/teaser_content_nav.stories.mdx +14 -5
- package/src/stories/views/components/teaser/fixtures/teaser_content_nav_flow_100.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_content_nav_flow_autosuggest.json +1 -0
- package/src/stories/views/components/teaser/fixtures/teaser_content_nav_list_100.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_content_nav_list_autosuggest.json +1 -0
- package/src/stories/views/components/teaser/fixtures/teaser_content_nav_mixed_100.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_content_nav_mixed_autosuggest.json +1 -1
- package/src/stories/views/components/teaser/fixtures/teaser_group_100_contentNav.json +1 -1
- package/src/stories/views/generic/hrQuery.subfeature.js +154 -54
- package/tailwind.config.js +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
1
|
+
# v0.56.11 (Mon Sep 05 2022)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- Dpe 1656 [#300](https://github.com/mumprod/hr-design-system-handlebars/pull/300) (zouhair1 [@selbaciri](https://github.com/selbaciri))
|
|
6
|
+
|
|
7
|
+
#### Authors: 2
|
|
8
|
+
|
|
9
|
+
- Saad El Baciri ([@selbaciri](https://github.com/selbaciri))
|
|
10
|
+
- selbaciri (zouhair1)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# v0.56.10 (Fri Sep 02 2022)
|
|
15
|
+
|
|
16
|
+
#### 🐛 Bug Fix
|
|
17
|
+
|
|
18
|
+
- DPE-1689 : new JSON Key 'isListOrFlow' and some design tweaks [#315](https://github.com/mumprod/hr-design-system-handlebars/pull/315) ([@StefanVesper](https://github.com/StefanVesper))
|
|
19
|
+
|
|
20
|
+
#### Authors: 1
|
|
21
|
+
|
|
22
|
+
- SonicSoulSurfer ([@StefanVesper](https://github.com/StefanVesper))
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
# v0.56.9 (Fri Sep 02 2022)
|
|
27
|
+
|
|
28
|
+
#### 🐛 Bug Fix
|
|
29
|
+
|
|
30
|
+
- Feature/dpe 1567 [#314](https://github.com/mumprod/hr-design-system-handlebars/pull/314) ([@szuelch](https://github.com/szuelch))
|
|
31
|
+
|
|
32
|
+
#### Authors: 1
|
|
33
|
+
|
|
34
|
+
- [@szuelch](https://github.com/szuelch)
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
1
38
|
# v0.56.8 (Thu Sep 01 2022)
|
|
2
39
|
|
|
3
40
|
#### 🐛 Bug Fix
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const handlebars = require("handlebars");
|
|
2
|
+
module.exports = function (v1, operator, v2, options) {
|
|
3
|
+
var options = arguments[3];
|
|
4
|
+
switch (operator) {
|
|
5
|
+
case '==':
|
|
6
|
+
return (v1 == v2) ? options.fn(this) : options.inverse(this);
|
|
7
|
+
case '===':
|
|
8
|
+
return (v1 === v2) ? options.fn(this) : options.inverse(this);
|
|
9
|
+
case '!=':
|
|
10
|
+
return (v1 != v2) ? options.fn(this) : options.inverse(this);
|
|
11
|
+
case '!==':
|
|
12
|
+
return (v1 !== v2) ? options.fn(this) : options.inverse(this);
|
|
13
|
+
case '<':
|
|
14
|
+
return (v1 < v2) ? options.fn(this) : options.inverse(this);
|
|
15
|
+
case '<=':
|
|
16
|
+
return (v1 <= v2) ? options.fn(this) : options.inverse(this);
|
|
17
|
+
case '>':
|
|
18
|
+
return (v1 > v2) ? options.fn(this) : options.inverse(this);
|
|
19
|
+
case '>=':
|
|
20
|
+
return (v1 >= v2) ? options.fn(this) : options.inverse(this);
|
|
21
|
+
case '&&':
|
|
22
|
+
return (v1 && v2) ? options.fn(this) : options.inverse(this);
|
|
23
|
+
case '||':
|
|
24
|
+
return (v1 || v2) ? options.fn(this) : options.inverse(this);
|
|
25
|
+
default:
|
|
26
|
+
return options.inverse(this);
|
|
27
|
+
}
|
|
28
|
+
};
|
package/dist/assets/index.css
CHANGED
|
@@ -1296,6 +1296,10 @@ video {
|
|
|
1296
1296
|
.bg-transparent {
|
|
1297
1297
|
background-color: transparent;
|
|
1298
1298
|
}
|
|
1299
|
+
.bg-grey-light {
|
|
1300
|
+
--tw-bg-opacity: 1;
|
|
1301
|
+
background-color: rgba(248, 248, 248, var(--tw-bg-opacity));
|
|
1302
|
+
}
|
|
1299
1303
|
.bg-gray-200 {
|
|
1300
1304
|
--tw-bg-opacity: 1;
|
|
1301
1305
|
background-color: rgba(229, 231, 235, var(--tw-bg-opacity));
|
|
@@ -1684,6 +1688,10 @@ video {
|
|
|
1684
1688
|
--tw-text-opacity: 1 !important;
|
|
1685
1689
|
color: rgba(20, 83, 45, var(--tw-text-opacity)) !important;
|
|
1686
1690
|
}
|
|
1691
|
+
.text-yellow-400 {
|
|
1692
|
+
--tw-text-opacity: 1;
|
|
1693
|
+
color: rgba(250, 204, 21, var(--tw-text-opacity));
|
|
1694
|
+
}
|
|
1687
1695
|
.text-white {
|
|
1688
1696
|
--tw-text-opacity: 1;
|
|
1689
1697
|
color: rgba(255, 255, 255, var(--tw-text-opacity));
|
|
@@ -1700,6 +1708,10 @@ video {
|
|
|
1700
1708
|
--tw-text-opacity: 1;
|
|
1701
1709
|
color: rgba(29, 78, 216, var(--tw-text-opacity));
|
|
1702
1710
|
}
|
|
1711
|
+
.text-grey-dark {
|
|
1712
|
+
--tw-text-opacity: 1;
|
|
1713
|
+
color: rgba(112, 112, 112, var(--tw-text-opacity));
|
|
1714
|
+
}
|
|
1703
1715
|
.text-blue-congress {
|
|
1704
1716
|
--tw-text-opacity: 1;
|
|
1705
1717
|
color: rgba(0, 82, 147, var(--tw-text-opacity));
|
|
@@ -1897,7 +1909,7 @@ video {
|
|
|
1897
1909
|
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
|
1898
1910
|
}
|
|
1899
1911
|
.counter-reset {
|
|
1900
|
-
counter-reset:
|
|
1912
|
+
counter-reset: cnt1662392589209;
|
|
1901
1913
|
}
|
|
1902
1914
|
.placeholder-text-xs::-webkit-input-placeholder {
|
|
1903
1915
|
font-size: 0.75rem;
|
|
@@ -2280,7 +2292,7 @@ video {
|
|
|
2280
2292
|
--tw-ring-color: rgba(255, 255, 255, 0.5);
|
|
2281
2293
|
}
|
|
2282
2294
|
.-ordered {
|
|
2283
|
-
counter-increment:
|
|
2295
|
+
counter-increment: cnt1662392589209 1;
|
|
2284
2296
|
}
|
|
2285
2297
|
.-ordered::before {
|
|
2286
2298
|
position: absolute;
|
|
@@ -2297,7 +2309,7 @@ video {
|
|
|
2297
2309
|
letter-spacing: .0125em;
|
|
2298
2310
|
--tw-text-opacity: 1;
|
|
2299
2311
|
color: rgba(0, 0, 0, var(--tw-text-opacity));
|
|
2300
|
-
content: counter(
|
|
2312
|
+
content: counter(cnt1662392589209);
|
|
2301
2313
|
}
|
|
2302
2314
|
/*! purgecss start ignore */
|
|
2303
2315
|
:root,
|
|
@@ -2665,25 +2677,25 @@ video {
|
|
|
2665
2677
|
right: 0;
|
|
2666
2678
|
bottom: 0;
|
|
2667
2679
|
}
|
|
2668
|
-
.placeholder\:text-
|
|
2680
|
+
.placeholder\:text-grey-dark::-webkit-input-placeholder {
|
|
2669
2681
|
--tw-text-opacity: 1;
|
|
2670
|
-
color: rgba(
|
|
2682
|
+
color: rgba(112, 112, 112, var(--tw-text-opacity));
|
|
2671
2683
|
}
|
|
2672
|
-
.placeholder\:text-
|
|
2684
|
+
.placeholder\:text-grey-dark::-moz-placeholder {
|
|
2673
2685
|
--tw-text-opacity: 1;
|
|
2674
|
-
color: rgba(
|
|
2686
|
+
color: rgba(112, 112, 112, var(--tw-text-opacity));
|
|
2675
2687
|
}
|
|
2676
|
-
.placeholder\:text-
|
|
2688
|
+
.placeholder\:text-grey-dark:-ms-input-placeholder {
|
|
2677
2689
|
--tw-text-opacity: 1;
|
|
2678
|
-
color: rgba(
|
|
2690
|
+
color: rgba(112, 112, 112, var(--tw-text-opacity));
|
|
2679
2691
|
}
|
|
2680
|
-
.placeholder\:text-
|
|
2692
|
+
.placeholder\:text-grey-dark::-ms-input-placeholder {
|
|
2681
2693
|
--tw-text-opacity: 1;
|
|
2682
|
-
color: rgba(
|
|
2694
|
+
color: rgba(112, 112, 112, var(--tw-text-opacity));
|
|
2683
2695
|
}
|
|
2684
|
-
.placeholder\:text-
|
|
2696
|
+
.placeholder\:text-grey-dark::placeholder {
|
|
2685
2697
|
--tw-text-opacity: 1;
|
|
2686
|
-
color: rgba(
|
|
2698
|
+
color: rgba(112, 112, 112, var(--tw-text-opacity));
|
|
2687
2699
|
}
|
|
2688
2700
|
.first\:border-t:first-child {
|
|
2689
2701
|
border-top-width: 1px;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Initializer from 'initializer'
|
|
2
2
|
import loadFeature from 'loadFeature'
|
|
3
3
|
|
|
4
|
-
const hr$ = (selector, element)
|
|
4
|
+
const hr$ = function (selector, element) {
|
|
5
5
|
// if element set, use it
|
|
6
6
|
// if not use document as default
|
|
7
7
|
const rootElement = element || document
|
|
@@ -34,24 +34,19 @@ const hr$ = (selector, element) => {
|
|
|
34
34
|
return rootElement.querySelectorAll(selector)
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
const stripTags = text =>
|
|
38
|
-
if (text) {
|
|
39
|
-
return text.replace(/(<([^>]+)>)/gi, '')
|
|
40
|
-
}
|
|
41
|
-
return false
|
|
42
|
-
}
|
|
37
|
+
const stripTags = (text) => (text ? text.replace(/(<([^>]+)>)/gi, '') : false)
|
|
43
38
|
|
|
44
39
|
const getViewportWidth = () =>
|
|
45
40
|
Math.max(document.documentElement.clientWidth, window.innerWidth || 0)
|
|
46
41
|
|
|
47
|
-
const isString = value => Object.prototype.toString.call(value) === '[object String]'
|
|
42
|
+
const isString = (value) => Object.prototype.toString.call(value) === '[object String]'
|
|
48
43
|
|
|
49
|
-
const isElementInViewport = el => {
|
|
44
|
+
const isElementInViewport = (el) => {
|
|
50
45
|
const rect = el.getBoundingClientRect()
|
|
51
46
|
return rect.top <= (document.documentElement || document.body).clientHeight
|
|
52
47
|
}
|
|
53
48
|
|
|
54
|
-
const getClosestParentWithTag = (tagName, node)
|
|
49
|
+
const getClosestParentWithTag = function (tagName, node) {
|
|
55
50
|
while (node !== null && node.tagName !== 'BODY') {
|
|
56
51
|
if (node.tagName && node.tagName.toLowerCase() === tagName) {
|
|
57
52
|
return node
|
|
@@ -61,7 +56,7 @@ const getClosestParentWithTag = (tagName, node) => {
|
|
|
61
56
|
return false
|
|
62
57
|
}
|
|
63
58
|
|
|
64
|
-
const getNodeWithClassInPath = (className, startNode)
|
|
59
|
+
const getNodeWithClassInPath = function (className, startNode) {
|
|
65
60
|
let node = startNode
|
|
66
61
|
|
|
67
62
|
while (node && node !== document) {
|
|
@@ -73,7 +68,7 @@ const getNodeWithClassInPath = (className, startNode) => {
|
|
|
73
68
|
return false
|
|
74
69
|
}
|
|
75
70
|
|
|
76
|
-
const isDescendant = (parent, child)
|
|
71
|
+
const isDescendant = function (parent, child) {
|
|
77
72
|
let node = child.parentNode
|
|
78
73
|
while (node !== null) {
|
|
79
74
|
if (node === parent) {
|
|
@@ -85,9 +80,9 @@ const isDescendant = (parent, child) => {
|
|
|
85
80
|
}
|
|
86
81
|
|
|
87
82
|
/* wartet x ms seit dem letzen aufruf bis es ausgeführt wird */
|
|
88
|
-
const debounce = (fn, delay)
|
|
83
|
+
const debounce = function (fn, delay) {
|
|
89
84
|
let timer = null
|
|
90
|
-
return (...args)
|
|
85
|
+
return function (...args) {
|
|
91
86
|
const context = this
|
|
92
87
|
clearTimeout(timer)
|
|
93
88
|
timer = setTimeout(() => {
|
|
@@ -96,11 +91,11 @@ const debounce = (fn, delay) => {
|
|
|
96
91
|
}
|
|
97
92
|
}
|
|
98
93
|
/* feuert all x ms */
|
|
99
|
-
const throttle = (fn, threshhold, scope)
|
|
94
|
+
const throttle = function (fn, threshhold, scope) {
|
|
100
95
|
threshhold = threshhold || 250
|
|
101
96
|
let last
|
|
102
97
|
let deferTimer
|
|
103
|
-
return (...args)
|
|
98
|
+
return function (...args) {
|
|
104
99
|
const context = scope || this
|
|
105
100
|
|
|
106
101
|
const now = +new Date()
|
|
@@ -128,10 +123,10 @@ const throttle = (fn, threshhold, scope) => {
|
|
|
128
123
|
canOnlyFireOnce(); // nada
|
|
129
124
|
*
|
|
130
125
|
*/
|
|
131
|
-
const once = (fn, context)
|
|
126
|
+
const once = function (fn, context) {
|
|
132
127
|
let result
|
|
133
128
|
|
|
134
|
-
return (...args)
|
|
129
|
+
return function (...args) {
|
|
135
130
|
if (fn) {
|
|
136
131
|
result = fn.apply(context || this, args)
|
|
137
132
|
fn = null
|
|
@@ -141,16 +136,25 @@ const once = (fn, context) => {
|
|
|
141
136
|
}
|
|
142
137
|
}
|
|
143
138
|
|
|
144
|
-
const listen = (eventName, fn, documentNode)
|
|
139
|
+
const listen = function (eventName, fn, documentNode, forceActive = false) {
|
|
145
140
|
documentNode = documentNode === undefined ? document : documentNode
|
|
146
141
|
|
|
142
|
+
// Use passive listeners to improve scrolling performance
|
|
143
|
+
// See:
|
|
144
|
+
// https://web.dev/uses-passive-event-listeners/
|
|
145
|
+
// https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
|
|
146
|
+
|
|
147
|
+
const isTouchOrMouseEvent =
|
|
148
|
+
eventName === 'touchstart' || eventName === 'touchmove' || eventName === 'wheel'
|
|
149
|
+
const isPassive = Modernizr.passiveeventlisteners && !forceActive && isTouchOrMouseEvent
|
|
150
|
+
|
|
147
151
|
if (window.attachEvent) {
|
|
148
152
|
documentNode.attachEvent(eventName, fn)
|
|
149
153
|
} else {
|
|
150
|
-
documentNode.addEventListener(eventName, fn)
|
|
154
|
+
documentNode.addEventListener(eventName, fn, isPassive ? { passive: true } : false)
|
|
151
155
|
}
|
|
152
156
|
}
|
|
153
|
-
const unlisten = (eventName, fn, documentNode)
|
|
157
|
+
const unlisten = function (eventName, fn, documentNode) {
|
|
154
158
|
documentNode = documentNode === undefined ? document : documentNode
|
|
155
159
|
|
|
156
160
|
if (window.attachEvent) {
|
|
@@ -159,7 +163,7 @@ const unlisten = (eventName, fn, documentNode) => {
|
|
|
159
163
|
documentNode.removeEventListener(eventName, fn)
|
|
160
164
|
}
|
|
161
165
|
}
|
|
162
|
-
const listenOnce = (eventName, fn, documentNode)
|
|
166
|
+
const listenOnce = function (eventName, fn, documentNode) {
|
|
163
167
|
documentNode = documentNode === undefined ? document : documentNode
|
|
164
168
|
|
|
165
169
|
documentNode.addEventListener(eventName, fn, { once: true })
|
|
@@ -194,7 +198,7 @@ const setJSONCookie = (cookieName, cookieValue, cookieLifetime) => {
|
|
|
194
198
|
setCookie(cookieName, JSON.stringify(cookieValue), cookieLifetime)
|
|
195
199
|
}
|
|
196
200
|
|
|
197
|
-
const setCookie = (cookieName, cookieValue, cookieLifetime)
|
|
201
|
+
const setCookie = function (cookieName, cookieValue, cookieLifetime) {
|
|
198
202
|
let expires
|
|
199
203
|
|
|
200
204
|
const domain = getDomain()
|
|
@@ -211,7 +215,7 @@ const setCookie = (cookieName, cookieValue, cookieLifetime) => {
|
|
|
211
215
|
cookieName + '=' + cookieValue + ';expires=' + expires + ';domain=' + domain + ';path=/;'
|
|
212
216
|
}
|
|
213
217
|
|
|
214
|
-
const getJSONCookie = cookieName => {
|
|
218
|
+
const getJSONCookie = (cookieName) => {
|
|
215
219
|
let cookie
|
|
216
220
|
|
|
217
221
|
try {
|
|
@@ -221,12 +225,12 @@ const getJSONCookie = cookieName => {
|
|
|
221
225
|
return cookie
|
|
222
226
|
}
|
|
223
227
|
|
|
224
|
-
const getCookie = cookieName => {
|
|
228
|
+
const getCookie = (cookieName) => {
|
|
225
229
|
let cookieString = RegExp('' + cookieName + '[^;]+').exec(document.cookie)
|
|
226
230
|
return unescape(!!cookieString ? cookieString.toString().replace(/^[^=]+./, '') : '')
|
|
227
231
|
}
|
|
228
232
|
|
|
229
|
-
const deleteCookie = cookieName => {
|
|
233
|
+
const deleteCookie = (cookieName) => {
|
|
230
234
|
const domain = getDomain()
|
|
231
235
|
document.cookie =
|
|
232
236
|
cookieName + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT;domain=' + domain + ';path=/;'
|
|
@@ -235,17 +239,18 @@ const deleteCookie = cookieName => {
|
|
|
235
239
|
const getDomain = () => {
|
|
236
240
|
return window.location.hostname.substring(window.location.hostname.indexOf('.') + 1)
|
|
237
241
|
}
|
|
238
|
-
const requestTimeout = (fn, delay)
|
|
239
|
-
var requestAnimFrame = (function() {
|
|
242
|
+
const requestTimeout = function (fn, delay) {
|
|
243
|
+
var requestAnimFrame = (function () {
|
|
240
244
|
return (
|
|
241
245
|
window.requestAnimationFrame ||
|
|
242
|
-
function(callback, element) {
|
|
246
|
+
function (callback, element) {
|
|
243
247
|
window.setTimeout(callback, 1000 / 60)
|
|
244
248
|
}
|
|
245
249
|
)
|
|
246
250
|
})(),
|
|
247
251
|
start = new Date().getTime(),
|
|
248
252
|
handle = {}
|
|
253
|
+
|
|
249
254
|
function loop() {
|
|
250
255
|
var current = new Date().getTime(),
|
|
251
256
|
delta = current - start
|
|
@@ -255,11 +260,12 @@ const requestTimeout = (fn, delay) => {
|
|
|
255
260
|
handle.value = requestAnimFrame(loop)
|
|
256
261
|
}
|
|
257
262
|
}
|
|
263
|
+
|
|
258
264
|
handle.value = requestAnimFrame(loop)
|
|
259
265
|
return handle
|
|
260
266
|
}
|
|
261
267
|
|
|
262
|
-
const replaceAnimated = (
|
|
268
|
+
const replaceAnimated = function (
|
|
263
269
|
elem,
|
|
264
270
|
data,
|
|
265
271
|
rescan,
|
|
@@ -269,7 +275,7 @@ const replaceAnimated = (
|
|
|
269
275
|
valueTo,
|
|
270
276
|
easing,
|
|
271
277
|
duration
|
|
272
|
-
)
|
|
278
|
+
) {
|
|
273
279
|
const property = 'opacity'
|
|
274
280
|
timeoutDelay = timeoutDelay || 800
|
|
275
281
|
valueFrom = valueFrom || 0.2
|
|
@@ -283,7 +289,7 @@ const replaceAnimated = (
|
|
|
283
289
|
|
|
284
290
|
elem.style[property] = valueFrom
|
|
285
291
|
|
|
286
|
-
requestTimeout(function() {
|
|
292
|
+
requestTimeout(function () {
|
|
287
293
|
if (data) {
|
|
288
294
|
elem.innerHTML = data
|
|
289
295
|
}
|
|
@@ -300,33 +306,33 @@ const replaceAnimated = (
|
|
|
300
306
|
}, timeoutDelay)
|
|
301
307
|
}
|
|
302
308
|
|
|
303
|
-
|
|
304
|
-
|
|
309
|
+
const getScrollY = () =>
|
|
310
|
+
window.pageYOffset !== undefined
|
|
311
|
+
? window.pageYOffset
|
|
312
|
+
: (document.documentElement || document.body.parentNode || document.body).scrollTop
|
|
305
313
|
|
|
306
|
-
|
|
307
|
-
|
|
314
|
+
//Funktion um X & Y Offset eines Elements zu ermitteln
|
|
315
|
+
const getElementOffset = function (el) {
|
|
316
|
+
let _x = 0
|
|
317
|
+
let _y = 0
|
|
318
|
+
_x = Math.round(el.getBoundingClientRect().left)
|
|
319
|
+
_y = Math.round(el.getBoundingClientRect().top)
|
|
308
320
|
|
|
309
|
-
|
|
310
|
-
|
|
321
|
+
return { top: _y, left: _x }
|
|
322
|
+
}
|
|
311
323
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
324
|
+
const reinitializeFeature = function (element) {
|
|
325
|
+
Initializer.run(element, loadFeature)
|
|
326
|
+
}
|
|
315
327
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
callback(null, e)
|
|
321
|
-
},
|
|
322
|
-
false
|
|
323
|
-
)
|
|
328
|
+
const removeScript = function (id) {
|
|
329
|
+
const element = document.getElementById(id)
|
|
330
|
+
if (element) {
|
|
331
|
+
element.parentNode.removeChild(element)
|
|
324
332
|
}
|
|
325
|
-
|
|
326
|
-
firstScriptTagInPage.parentNode.insertBefore(scriptTag, firstScriptTagInPage)
|
|
327
333
|
}
|
|
328
334
|
|
|
329
|
-
const loadScript = (id, scriptUrl, async, callback)
|
|
335
|
+
const loadScript = function (id, scriptUrl, async, callback) {
|
|
330
336
|
if (document.getElementById(id)) return
|
|
331
337
|
|
|
332
338
|
let firstScriptTagInPage = hr$('script')[0],
|
|
@@ -342,7 +348,7 @@ const loadScript = (id, scriptUrl, async, callback) => {
|
|
|
342
348
|
if (callback) {
|
|
343
349
|
scriptTag.addEventListener(
|
|
344
350
|
'load',
|
|
345
|
-
function(e) {
|
|
351
|
+
function (e) {
|
|
346
352
|
callback(null, e)
|
|
347
353
|
},
|
|
348
354
|
false
|
|
@@ -352,7 +358,94 @@ const loadScript = (id, scriptUrl, async, callback) => {
|
|
|
352
358
|
firstScriptTagInPage.parentNode.insertBefore(scriptTag, firstScriptTagInPage)
|
|
353
359
|
}
|
|
354
360
|
|
|
361
|
+
/*
|
|
362
|
+
* Fügt ein "style" bereich zum dokument hinzu
|
|
363
|
+
* und gibt eine referenz darauf zurück
|
|
364
|
+
* auf der man dann mit insertRule arbeiten kann
|
|
365
|
+
*/
|
|
366
|
+
const addStyle = function (css, mediaQuery) {
|
|
367
|
+
// Create the <style> tag
|
|
368
|
+
const style = document.createElement('style')
|
|
369
|
+
|
|
370
|
+
if (mediaQuery) {
|
|
371
|
+
style.setAttribute('media', mediaQuery)
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// Add the <style> element to the page
|
|
375
|
+
if (style.styleSheet) {
|
|
376
|
+
style.styleSheet.cssText = css || ''
|
|
377
|
+
} else {
|
|
378
|
+
style.appendChild(document.createTextNode(css || ''))
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
document.head.appendChild(style)
|
|
382
|
+
|
|
383
|
+
return style.sheet
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
const simulateClickOn = function (elem) {
|
|
387
|
+
elem.dispatchEvent(
|
|
388
|
+
new MouseEvent('click', {
|
|
389
|
+
view: window,
|
|
390
|
+
bubbles: true,
|
|
391
|
+
cancelable: true,
|
|
392
|
+
})
|
|
393
|
+
)
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/*!
|
|
397
|
+
* Behaves the same as setInterval except uses requestAnimationFrame() where possible for better performance
|
|
398
|
+
* modified gist.github.com/joelambert/1002116
|
|
399
|
+
* the fallback function requestAnimFrame is incorporated
|
|
400
|
+
* gist.github.com/joelambert/1002116
|
|
401
|
+
* gist.github.com/englishextra/873c8f78bfda7cafc905f48a963df07b
|
|
402
|
+
* jsfiddle.net/englishextra/sxrzktkz/
|
|
403
|
+
* @param {Object} fn The callback function
|
|
404
|
+
* @param {Int} delay The delay in milliseconds
|
|
405
|
+
* requestInterval(fn, delay);
|
|
406
|
+
*/
|
|
407
|
+
const requestInterval = function (fn, delay) {
|
|
408
|
+
const requestAnimFrame = (function () {
|
|
409
|
+
return (
|
|
410
|
+
window.requestAnimationFrame ||
|
|
411
|
+
function (callback, element) {
|
|
412
|
+
window.setTimeout(callback, 1000 / 60)
|
|
413
|
+
}
|
|
414
|
+
)
|
|
415
|
+
})(),
|
|
416
|
+
handle = {}
|
|
417
|
+
let start = new Date().getTime()
|
|
418
|
+
|
|
419
|
+
function loop() {
|
|
420
|
+
handle.value = requestAnimFrame(loop)
|
|
421
|
+
const current = new Date().getTime(),
|
|
422
|
+
delta = current - start
|
|
423
|
+
if (delta >= delay) {
|
|
424
|
+
fn.call()
|
|
425
|
+
start = new Date().getTime()
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
handle.value = requestAnimFrame(loop)
|
|
430
|
+
return handle
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/*!
|
|
434
|
+
* Behaves the same as clearInterval except uses cancelRequestAnimationFrame()
|
|
435
|
+
* where possible for better performance
|
|
436
|
+
* gist.github.com/joelambert/1002116
|
|
437
|
+
* gist.github.com/englishextra/873c8f78bfda7cafc905f48a963df07b
|
|
438
|
+
* jsfiddle.net/englishextra/sxrzktkz/
|
|
439
|
+
* @param {Int|Object} handle function handle, or function
|
|
440
|
+
* clearRequestInterval(handle);
|
|
441
|
+
*/
|
|
442
|
+
const clearRequestInterval = (handle) =>
|
|
443
|
+
window.cancelAnimationFrame && handle
|
|
444
|
+
? window.cancelAnimationFrame(handle.value)
|
|
445
|
+
: window.clearInterval(handle)
|
|
446
|
+
|
|
355
447
|
export {
|
|
448
|
+
addStyle,
|
|
356
449
|
hr$,
|
|
357
450
|
stripTags,
|
|
358
451
|
getViewportWidth,
|
|
@@ -373,8 +466,15 @@ export {
|
|
|
373
466
|
setJSONCookie,
|
|
374
467
|
getJSONCookie,
|
|
375
468
|
getCookie,
|
|
469
|
+
getScrollY,
|
|
470
|
+
getElementOffset,
|
|
376
471
|
deleteCookie,
|
|
472
|
+
requestInterval,
|
|
473
|
+
clearRequestInterval,
|
|
377
474
|
requestTimeout,
|
|
378
475
|
replaceAnimated,
|
|
379
|
-
loadScript
|
|
476
|
+
loadScript,
|
|
477
|
+
removeScript,
|
|
478
|
+
reinitializeFeature,
|
|
479
|
+
simulateClickOn,
|
|
380
480
|
}
|
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
{{#with this.contentNav}}
|
|
2
|
-
{{#if this.
|
|
3
|
-
<nav class="c-content-nav">
|
|
2
|
+
{{#if this.isListOrFlow}}
|
|
3
|
+
<nav class="w-full c-content-nav">
|
|
4
4
|
{{> components/content_nav/content_nav_container
|
|
5
5
|
_teasersize=../_teasersize
|
|
6
6
|
_maindivclass="flex flex-wrap mt-2 md:mt-0"
|
|
7
|
-
_inputcontainerclass="flex w-full h-10 mx-2 md:mx-0 border-blue-congress align-center"
|
|
8
|
-
}}
|
|
9
|
-
</nav>
|
|
10
|
-
{{else if this.isFlow}}
|
|
11
|
-
<nav class="c-content-nav">
|
|
12
|
-
{{> components/content_nav/content_nav_container
|
|
13
|
-
_teasersize=../_teasersize
|
|
14
|
-
_maindivclass="flex flex-wrap mt-2 md:mt-0"
|
|
15
|
-
_inputcontainerclass="flex w-full h-10 mx-2 md:mx-0 border-blue-congress align-center "
|
|
7
|
+
_inputcontainerclass="flex bg-grey-light w-full h-10 mx-2 md:mx-0 border-blue-congress align-center"
|
|
16
8
|
}}
|
|
17
9
|
</nav>
|
|
18
|
-
{{else}}
|
|
10
|
+
{{else}}
|
|
19
11
|
{{#>components/content_nav/dropdown
|
|
20
|
-
_componentClass="c-content-nav"
|
|
12
|
+
_componentClass="c-content-nav w-full"
|
|
21
13
|
_teasersize=../_teasersize
|
|
22
14
|
_iconOpen="arrow-down"
|
|
23
15
|
_iconClose="arrow-up"
|
|
@@ -27,7 +19,7 @@
|
|
|
27
19
|
{{> components/content_nav/content_nav_container
|
|
28
20
|
_teasersize=_teasersize
|
|
29
21
|
_maindivclass="flex flex-wrap mt-0"
|
|
30
|
-
_inputcontainerclass="flex w-full h-10 mx-0 border-blue-congress align-center "
|
|
22
|
+
_inputcontainerclass="flex bg-grey-light w-full h-10 mx-0 border-blue-congress align-center "
|
|
31
23
|
}}
|
|
32
24
|
{{/components/content_nav/dropdown}}
|
|
33
25
|
{{/if}}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
<div
|
|
1
|
+
<div class="{{_maindivclass}} {{#if this.isAutosuggest}} autoSuggest js-load{{/if}}"
|
|
2
|
+
@click.outside ="$store.contentNavDropdownIsOpen = false;"
|
|
2
3
|
{{#if this.isAutosuggest}}
|
|
3
4
|
data-hr-auto-suggest='{"filterGroupsSelector":".c-content-nav__group", "filterElementSelector":".c-content-nav__item", "filterTextSelector":".js-title", "inputElementSelector":".js-autosuggest-input", "matchedClass":"", "unmatchedClass":"hidden"}'
|
|
4
5
|
{{/if}}
|
|
5
|
-
|
|
6
|
+
>
|
|
6
7
|
{{#if this.isAutosuggest}}
|
|
7
8
|
<div class="{{_inputcontainerclass}} c-content-nav__autosuggest ">
|
|
8
|
-
<input x-ref="autosuggestInput"
|
|
9
|
-
|
|
9
|
+
<input x-ref="autosuggestInput"
|
|
10
|
+
class="w-full h-8 pl-2 bg-gray-200 text-grey-dark placeholder:text-grey-dark focus:outline-none js-autosuggest-input"
|
|
11
|
+
type="text"
|
|
12
|
+
placeholder="Eintrag filtern"/>
|
|
10
13
|
</div>
|
|
11
14
|
{{/if}}
|
|
12
15
|
|
|
13
16
|
{{> components/content_nav/content_nav_list _teasersize=_teasersize }}
|
|
17
|
+
|
|
14
18
|
</div>
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
<li x-init="chooseListItemStyles({{_teasersize}},{{_islist}},{{_ismixed}},{{_isdropdown}},{{_isflow}})"
|
|
2
|
-
class="h-10 md:mx-0 overflow-hidden text-base font-copy list-none border-blue-congress fill-congress text-blue-congress bg-white hover:bg-blue-congress hover:fill-white hover:text-white hover:underline {{#if this.isSelected}} font-bold -current{{/if}} c-content-nav__item"
|
|
3
|
-
|
|
2
|
+
class="h-10 md:mx-0 overflow-hidden text-base font-copy list-none border-blue-congress fill-congress text-blue-congress bg-white hover:bg-blue-congress hover:fill-white hover:text-white hover:underline {{#if this.isSelected}} font-bold -current{{/if}} c-content-nav__item"
|
|
3
|
+
>
|
|
4
|
+
{{#>components/base/link.hbs
|
|
4
5
|
_doNavigationTracking="true"
|
|
5
6
|
_clickLabelType="Contentnavigation"
|
|
6
7
|
_clickLabelPrefix1=this.title
|
|
7
8
|
_css="flex items-center py-2 px-2 h-10 whitespace-nowrap overflow-hidden"
|
|
8
9
|
_isSelected=this.isSelected
|
|
9
10
|
_selectedCssClass="is-selected"
|
|
10
|
-
|
|
11
|
+
}}
|
|
11
12
|
|
|
12
|
-
<span class="
|
|
13
|
+
<span class="block text-base grow font-copy js-title truncate ... ">{{this.title}}</span>
|
|
13
14
|
|
|
14
15
|
{{#if this.link.hasIcon}}
|
|
15
16
|
{{> components/base/image/icon _icon=this.link.iconName _addClass="ml-2 h-4 w-4" _iconmap="icons"}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<ul :class="(({{this.isMixed}} && {{_teasersize}} < 50) || ({{this.isMixed}} && window.innerWidth < 768) || {{this.isDropdown}}) && $store.contentNavDropdownIsOpen === true ? '!shadow-[1px_8px_9px_0px_rgba(50,50,93,0.10)] !px-0 mt-0' : ''"
|
|
2
|
-
class="flex flex-wrap w-full px-2 z-10000 md:!px-0 last:border-b-0">
|
|
1
|
+
<ul :class="(({{this.isMixed}} && {{_teasersize}} < 50) || ({{this.isMixed}} && window.innerWidth < 768) || {{this.isDropdown}}) && $store.contentNavDropdownIsOpen === true ? '!shadow-[1px_8px_9px_0px_rgba(50,50,93,0.10)] !px-0 mt-0' : ''"
|
|
2
|
+
class="flex flex-wrap w-full px-2 z-10000 md:!px-0 last:border-b-0">
|
|
3
3
|
|
|
4
4
|
{{~#each this.contentNavEntries~}}
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
<li class="w-full h-auto overflow-hidden text-base list-none border-b border-gray-400 bg-blue-accented text-blue-congress md:mx-0 font-copy fill-congress c-content-nav__group">
|
|
11
11
|
<div class="flex items-center h-10 p-2 c-content-nav__group-title">{{this.title}}</div>
|
|
12
|
-
<ul class="c-content-nav__group-list !px-0 mt-0
|
|
12
|
+
<ul class="c-content-nav__group-list !px-0 mt-0">
|
|
13
13
|
{{~#each this.navigationGroup~}}
|
|
14
14
|
{{> components/content_nav/content_nav_item _teasersize=../../_teasersize _isdropdown=../../isDropdown _ismixed=../../isMixed _islist=../../isList _isflow=../../isFlow}}
|
|
15
15
|
{{~/each~}}
|