hr-design-system-handlebars 0.44.2 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/.storybook/preview.js +1 -1
  2. package/CHANGELOG.md +37 -0
  3. package/dist/assets/index.css +31 -37
  4. package/dist/views/components/base/load_dynamic.hbs +2 -2
  5. package/dist/views/components/{Header/AnchorNavigation/AnchorNavigation.hbs → header/anchor_navigation/anchor_navigation.hbs} +0 -0
  6. package/dist/views/components/{Header/AnchorNavigation/FeatureBoxAnchor.hbs → header/anchor_navigation/featurebox_anchor.hbs} +0 -0
  7. package/{src/stories/views/components/Header/BrandNavigation/BrandNavigation.hbs → dist/views/components/header/brand_navigation/brand_navigation.hbs} +1 -1
  8. package/dist/views/components/{Header/BrandNavigation/BrandNavigationItem.hbs → header/brand_navigation/brand_navigation_item.hbs} +0 -0
  9. package/dist/views/components/{Header/Burger.hbs → header/burger.hbs} +2 -1
  10. package/dist/views/components/header/header.hbs +85 -0
  11. package/dist/views/components/header/header_alpine.js +255 -0
  12. package/dist/views/components/{Header/NavigationFlyout/NavigationFlyout.hbs → header/navigation_flyout/navigation_flyout.hbs} +2 -2
  13. package/dist/views/components/header/navigation_flyout/navigation_flyout_column.hbs +9 -0
  14. package/dist/views/components/{Header/NavigationFlyout/NavigationFlyoutItem.hbs → header/navigation_flyout/navigation_flyout_item.hbs} +0 -0
  15. package/dist/views/components/{Header/Search/QuickSearchButton.hbs → header/search/quick_search_button.hbs} +0 -0
  16. package/dist/views/components/{Header/Search/QuickSearchForm.hbs → header/search/quick_search_form.hbs} +0 -0
  17. package/dist/views/components/{Header/SectionNavigation/SectionNavigation.hbs → header/section_navigation/section_navigation.hbs} +2 -2
  18. package/{src/stories/views/components/Header/SectionNavigation/SectionNavigationItem.hbs → dist/views/components/header/section_navigation/section_navigation_item.hbs} +2 -2
  19. package/dist/views/components/{Header/ServiceLogo.hbs → header/service_logo.hbs} +0 -0
  20. package/dist/views/components/{Header/ServiceNavigation/ServiceList.hbs → header/service_navigation/service_list.hbs} +1 -1
  21. package/dist/views/components/{Header/ServiceNavigation/ServiceNavigationItem.hbs → header/service_navigation/service_navigation_item.hbs} +1 -1
  22. package/dist/views/components/page/page.hbs +1 -1
  23. package/dist/views/components/teaser/components/teaser_heading.hbs +2 -2
  24. package/dist/views/components/teaser/teaser_alternativ.hbs +1 -1
  25. package/dist/views/components/teaser/teaser_standard.hbs +1 -1
  26. package/package.json +1 -1
  27. package/src/assets/fixtures/teaser/teasers.inc.json +2 -2
  28. package/src/stories/views/components/base/load_dynamic.hbs +2 -2
  29. package/src/stories/views/components/{Header/AnchorNavigation/AnchorNavigation.hbs → header/anchor_navigation/anchor_navigation.hbs} +0 -0
  30. package/src/stories/views/components/{Header/AnchorNavigation/FeatureBoxAnchor.hbs → header/anchor_navigation/featurebox_anchor.hbs} +0 -0
  31. package/src/stories/views/components/{Header → header}/brandNavigationData.json +0 -0
  32. package/{dist/views/components/Header/BrandNavigation/BrandNavigation.hbs → src/stories/views/components/header/brand_navigation/brand_navigation.hbs} +1 -1
  33. package/src/stories/views/components/{Header/BrandNavigation/BrandNavigation.stories.mdx → header/brand_navigation/brand_navigation.stories.mdx} +1 -1
  34. package/src/stories/views/components/{Header/BrandNavigation/BrandNavigationItem.hbs → header/brand_navigation/brand_navigation_item.hbs} +0 -0
  35. package/src/stories/views/components/{Header/BrandNavigation/BrandNavigationItem.stories.mdx → header/brand_navigation/brand_navigation_item.stories.mdx} +1 -1
  36. package/src/stories/views/components/{Header/Burger.hbs → header/burger.hbs} +2 -1
  37. package/src/stories/views/components/header/header.hbs +85 -0
  38. package/src/stories/views/components/{Header/Header.stories.mdx → header/header_.stories.mdx} +1 -1
  39. package/src/stories/views/components/header/header_alpine.js +255 -0
  40. package/src/stories/views/components/{Header → header}/navigation.json +0 -0
  41. package/src/stories/views/components/{Header → header}/navigation2.json +0 -0
  42. package/src/stories/views/components/{Header → header}/navigation3.json +0 -0
  43. package/src/stories/views/components/{Header → header}/navigation4.json +0 -0
  44. package/src/stories/views/components/{Header/NavigationFlyout/NavigationFlyout.hbs → header/navigation_flyout/navigation_flyout.hbs} +2 -2
  45. package/src/stories/views/components/{Header/NavigationFlyout/NavigationFlyout.stories.mdx → header/navigation_flyout/navigation_flyout.stories.mdx} +1 -1
  46. package/src/stories/views/components/header/navigation_flyout/navigation_flyout_column.hbs +9 -0
  47. package/src/stories/views/components/{Header/NavigationFlyout/NavigationFlyoutItem.hbs → header/navigation_flyout/navigation_flyout_item.hbs} +0 -0
  48. package/src/stories/views/components/{Header/Search/QuickSearchButton.hbs → header/search/quick_search_button.hbs} +0 -0
  49. package/src/stories/views/components/{Header/Search/QuickSearchButton.stories.mdx → header/search/quick_search_button.stories.mdx} +1 -1
  50. package/src/stories/views/components/{Header/Search/QuickSearchForm.hbs → header/search/quick_search_form.hbs} +0 -0
  51. package/src/stories/views/components/{Header/Search/QuickSearchForm.stories.mdx → header/search/quick_search_form.stories.mdx} +1 -1
  52. package/src/stories/views/components/{Header → header}/sectionNavigationData.json +0 -0
  53. package/src/stories/views/components/{Header/SectionNavigation/SectionNavigation.hbs → header/section_navigation/section_navigation.hbs} +2 -2
  54. package/src/stories/views/components/{Header/SectionNavigation/SectionNavigation.stories.mdx → header/section_navigation/section_navigation.stories.mdx} +1 -1
  55. package/{dist/views/components/Header/SectionNavigation/SectionNavigationItem.hbs → src/stories/views/components/header/section_navigation/section_navigation_item.hbs} +2 -2
  56. package/src/stories/views/components/{Header/SectionNavigation/SectionNavigationItem.stories.mdx → header/section_navigation/section_navigation_item.stories.mdx} +1 -1
  57. package/src/stories/views/components/{Header → header}/serviceNavigationData.json +0 -0
  58. package/src/stories/views/components/{Header/ServiceLogo.hbs → header/service_logo.hbs} +0 -0
  59. package/src/stories/views/components/{Header/ServiceNavigation/ServiceList.hbs → header/service_navigation/service_list.hbs} +1 -1
  60. package/src/stories/views/components/{Header/ServiceNavigation/ServiceList.stories.mdx → header/service_navigation/service_list.stories.mdx} +1 -1
  61. package/src/stories/views/components/{Header/ServiceNavigation/ServiceNavigationItem.hbs → header/service_navigation/service_navigation_item.hbs} +1 -1
  62. package/src/stories/views/components/{Header/ServiceNavigation/ServiceNavigationItem.stories.mdx → header/service_navigation/service_navigation_item.stories.mdx} +1 -1
  63. package/src/stories/views/components/page/page.hbs +1 -1
  64. package/src/stories/views/components/page/page.stories.mdx +4 -4
  65. package/src/stories/views/components/teaser/components/teaser_heading.hbs +2 -2
  66. package/src/stories/views/components/teaser/data/teaser_alternativ_lg_serif.json +1 -1
  67. package/src/stories/views/components/teaser/data/teaser_alternativ_md_serif.json +1 -1
  68. package/src/stories/views/components/teaser/data/teaser_alternativ_sm_serif.json +1 -1
  69. package/src/stories/views/components/teaser/data/teaser_alternativ_xl_serif.json +1 -1
  70. package/src/stories/views/components/teaser/data/teaser_alternativ_xxl_serif.json +1 -1
  71. package/src/stories/views/components/teaser/data/teaser_article.json +1 -1
  72. package/src/stories/views/components/teaser/data/teaser_standard_lg_serif.json +1 -1
  73. package/src/stories/views/components/teaser/data/teaser_standard_md_serif.json +1 -1
  74. package/src/stories/views/components/teaser/data/teaser_standard_sm_serif.json +1 -1
  75. package/src/stories/views/components/teaser/data/teaser_standard_xl_serif.json +1 -1
  76. package/src/stories/views/components/teaser/data/teaser_standard_xxl_serif.json +1 -1
  77. package/src/stories/views/components/teaser/fixtures/teaser_index.json +1 -1
  78. package/src/stories/views/components/teaser/fixtures/teaser_standard_lg_serif.json +1 -1
  79. package/src/stories/views/components/teaser/fixtures/teaser_standard_md_serif.json +1 -1
  80. package/src/stories/views/components/teaser/fixtures/teaser_standard_sm_serif.json +1 -1
  81. package/src/stories/views/components/teaser/fixtures/teaser_standard_xl_serif.json +1 -1
  82. package/src/stories/views/components/teaser/fixtures/teaser_standard_xxl_serif.json +1 -1
  83. package/src/stories/views/components/teaser/fixtures/teaser_standard_xxl_serif_comments.json +1 -1
  84. package/src/stories/views/components/teaser/fixtures/teaser_standard_xxl_serif_label.json +1 -1
  85. package/src/stories/views/components/teaser/teaser_alternativ.hbs +1 -1
  86. package/src/stories/views/components/teaser/teaser_standard.hbs +1 -1
  87. package/dist/views/components/Header/Header.hbs +0 -343
  88. package/dist/views/components/Header/NavigationFlyout/NavigationFlyoutColumn.hbs +0 -9
  89. package/src/stories/views/components/Header/Header.hbs +0 -343
  90. package/src/stories/views/components/Header/NavigationFlyout/NavigationFlyoutColumn.hbs +0 -9
@@ -20,7 +20,7 @@
20
20
  <body itemscope itemtype="http://schema.org/WebPage">
21
21
  <div class="js-pageSwap">
22
22
 
23
- {{> components/Header/Header }}
23
+ {{> components/header/header }}
24
24
 
25
25
  <main
26
26
  onclick="void(0)"
@@ -4,10 +4,10 @@
4
4
  {{> components/label/label type=loca text=type}}
5
5
  </div>
6
6
  {{/with~}}
7
- <{{~ ../headlineTag }} class="{{../class}}" >
7
+ <{{~ ../headlineTag ~}}>
8
8
  {{#with this.content.topline}}
9
9
  {{> components/teaser/components/teaser_topline text=this readMore=../this.readMoreText.readMoreScreenreader}}
10
10
  {{/with}}
11
11
  {{> components/teaser/components/teaser_title text=../this.title font=../font size=../size }}
12
- </{{~ ../headlineTag }}>
12
+ </{{~ ../headlineTag ~}}>
13
13
  {{/components/base/link}}
@@ -6,7 +6,7 @@
6
6
  </figure>
7
7
  <div class="{{inline-switch teasersize '["sm", "xxl"]' '["basis-3/5 md:flex-full" , "basis-2/5"]'}} ">
8
8
  <header class="md:px-0 {{inline-switch teasersize '["sm"]' '["","px-5"]'}}">
9
- {{> components/teaser/components/teaser_heading headlineTag="h2" size=teasersize font=(inline-switch serifHeading '[true, false]' '["font-headingSerif","font-heading font-bold"]') headline=title topline=topline}}
9
+ {{> components/teaser/components/teaser_heading headlineTag="h2" size=teasersize font=(inline-switch isSerifHeading '[true, false]' '["font-headingSerif","font-heading font-bold"]')}}
10
10
  </header>
11
11
  <section class="md:px-0 {{inline-switch teasersize '["sm"]' '["","px-5"]'}}">
12
12
  {{> components/teaser/components/teaser_text text=shorttext size=teasersize }}
@@ -6,7 +6,7 @@
6
6
  </figure>
7
7
  <div class="{{inline-switch teasersize '["sm"]' '["basis-3/5 md:flex-full"]'}} ">
8
8
  <header class="md:px-0 {{inline-switch teasersize '["sm"]' '["","px-5"]'}}">
9
- {{> components/teaser/components/teaser_heading headlineTag="h2" size=teasersize font=(inline-switch serifHeading '[true, false]' '["font-headingSerif","font-heading font-bold"]') headline=title topline=topline}}
9
+ {{> components/teaser/components/teaser_heading headlineTag="h2" size=teasersize font=(inline-switch isSerifHeading '[true, false]' '["font-headingSerif","font-heading font-bold"]') }}
10
10
  </header>
11
11
  <section class="md:px-0 {{inline-switch teasersize '["sm"]' '["","px-5"]'}}">
12
12
  {{> components/teaser/components/teaser_text text=shorttext size=teasersize }}
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.44.2",
9
+ "version": "0.45.0",
10
10
  "scripts": {
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
12
  "storybook": "start-storybook -p 6006 public",
@@ -7,7 +7,7 @@
7
7
  "byline": "Byline",
8
8
  "title": "Abgeschobene Geschwister aus Syrien zurück in Wolfhagen",
9
9
  "topline": "Überglücklich, aber ohne Mama",
10
- "serifHeading": true,
10
+ "isSerifHeading": true,
11
11
  "extendedTitle": "",
12
12
  "teasertype": "standard",
13
13
  "teasersize": "xxl",
@@ -112,7 +112,7 @@
112
112
  "byline": "Byline",
113
113
  "title": "Abgeschobene Geschwister aus Syrien zurück in Wolfhagen",
114
114
  "topline": "Überglücklich, aber ohne Mama",
115
- "serifHeading": true,
115
+ "isSerifHeading": true,
116
116
  "extendedTitle": "",
117
117
  "teasertype": "standard",
118
118
  "teasersize": "xxl",
@@ -1,6 +1,6 @@
1
1
  {{#switch templatePath}}
2
- {{#case "components/Header/ServiceNavigation/ServiceNavigationItem"}}
3
- {{> components/Header/ServiceNavigation/ServiceNavigationItem}}
2
+ {{#case "components/header/service_navigation/service_navigation_item"}}
3
+ {{> components/header/service_navigation/service_navigation_item}}
4
4
  {{/case}}
5
5
  {{#case "components/teaser/group_teaser/group_teaser"}}
6
6
  {{> components/teaser/group_teaser/group_teaser}}
@@ -21,7 +21,7 @@
21
21
  {{#with this.brandNavigationItems}}
22
22
  <ul class="flex pl-0.5 pr-3 md:px-0 flex-nowrap lg:mr-0">
23
23
  {{#each this}}
24
- {{> components/Header/BrandNavigation/BrandNavigationItem }}
24
+ {{> components/header/brand_navigation/brand_navigation_item }}
25
25
  {{/each}}
26
26
  </ul>
27
27
  {{/with}}
@@ -1,6 +1,6 @@
1
1
  import { ArgsTable, Meta, Story, Canvas, Preview } from '@storybook/addon-docs'
2
2
 
3
- import menu from './BrandNavigation.hbs'
3
+ import menu from './brand_navigation.hbs'
4
4
 
5
5
  import JsonData from '../brandNavigationData.json'
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { ArgsTable, Meta, Story, Canvas, Preview } from '@storybook/addon-docs'
2
2
 
3
- import item from './BrandNavigationItem.hbs'
3
+ import item from './brand_navigation_item.hbs'
4
4
 
5
5
  import JsonData from '../navigation.json'
6
6
 
@@ -1,4 +1,4 @@
1
- <div x-data="burger()" class="sb-burger flex items-center justify-center h-full fill-current">
1
+ <div x-data="burger()" class="flex items-center justify-center h-full fill-current sb-burger">
2
2
  <nav>
3
3
  <button {{!-- :class="$store.burgeropen ? 'text-blue-congress' : 'text-white'" --}}
4
4
  class="relative w-10 h-10 text-white tablet:w-18 tablet:h-12 focus:outline-none bg-brand"
@@ -18,6 +18,7 @@
18
18
  </button>
19
19
  </nav>
20
20
  </div>
21
+
21
22
  <script>
22
23
  var burger = () => {
23
24
  return {
@@ -0,0 +1,85 @@
1
+ <div class="sb-main-navigation" x-data="mainNavigationHandler()" x-init="init()">
2
+
3
+ <header class="relative z-101 {{#if this.hasOpenSubNavigation}}lg:h-header-lg-big{{else}}lg:h-header-lg-small{{/if}} md:h-header-md h-header-sm">
4
+ <div x-data
5
+ id="headerWrapper"
6
+ @resize.window="resetNav()"
7
+ :class="shouldBrandNavBeHidden() ? '-mt-10 lg:-mt-8' : '' "
8
+ class="fixed top-0 left-0 flex flex-wrap max-w-full transition-all duration-500 transform font-copy lg:justify-center lg:w-full ">
9
+
10
+ <div id="anchorNavWrapper"
11
+ class="hidden">
12
+ {{> components/header/anchor_navigation/anchor_navigation }}
13
+ </div>
14
+
15
+ <div id="brandNavWrapper"
16
+ class="relative flex items-center justify-center order-1 w-full bg-white z-101 print:hidden">
17
+ {{> components/header/brand_navigation/brand_navigation }}
18
+ </div>
19
+
20
+ <div id="serviceNavWrapper"
21
+ :class="shouldServiceNavBeHidden() ? '-mt-40' : ''"
22
+
23
+ class="relative flex justify-center order-2 w-full transition-all duration-500 ease-in-out md:border-white lg:border-b bg-blue-congress z-102">
24
+ <div id="serviceNavMainContainer"
25
+ class="flex w-full h-10 lg:container md:h-12 lg:px-10 lg:h-16 z-101">
26
+
27
+ <span id="serviceNavHeadline" class="hidden print:hidden">Service Navigation</span>
28
+
29
+ <div id="serviceLogoWrapper"
30
+ class="flex items-center order-1 w-full pl-4 pr-2 tablet:pl-5 lg:items-end lg:pb-3 bg-blue-congress md:px-0 md:h-12 lg:h-16 md:w-1/2 md:max-w-1/2 lg:w-1/4 lg:max-w-1/4">
31
+ {{> components/header/service_logo }}
32
+ </div>
33
+
34
+ <div id="serviceItemsWrapper"
35
+ class="flex items-center justify-end flex-initial order-2 inline-block w-full max-w-full align-top bg-blue-congress md:h-12 lg:h-16 lg:order-2 lg:w-3/4 lg:max-w-3/4 md:mt-0 md:w-1/2 md:max-w-1/2 md:order-2 md:border-0 print:hidden ">
36
+ {{> components/header/service_navigation/service_list }}
37
+
38
+ {{> components/header/search/quick_search_button }}
39
+
40
+ <div class="hidden lg:flex">
41
+ {{> components/header/search/quick_search_form }}
42
+ </div>
43
+
44
+ <div id="burgerWrapper"
45
+ class="flex justify-end flex-none order-2 lg:order-4 md:order-4 lg:hidden ">
46
+ {{> components/header/burger }}
47
+ </div>
48
+
49
+ </div>
50
+ </div>
51
+ </div>
52
+
53
+ <div id="sectionNavWrapper"
54
+ x-ref="sectionnavigation"
55
+ @toggle-sectionnav.window="toggleSectionNav"
56
+ :class="shouldSectionNavBeHidden() ? '-mt-40 md:-mt-40 lg:-mt-40' : ''"
57
+ class="flex justify-center order-3 w-full overflow-hidden duration-500 transition-max-height lg:transition-margin-top lg:duration-500 tablet:absolute tablet:top-22 tablet:w-half-screen tablet:ml-half-screen max-h-0 lg:overflow-visible md:mt-0 lg:flex lg:max-h-full lg:h-auto bg-blue-congress z-100 print:hidden"
58
+ >
59
+ {{> components/header/section_navigation/section_navigation }}
60
+ </div>
61
+
62
+ <div x-cloak :class="shouldServiceNavBeHidden() ? 'hidden -mt-40' : ''"
63
+ x-effect="$el.setAttribute('id', 'flyout-' + $store.searchID.current + '-2');$el.setAttribute('aria-expanded', $store.searchFieldOpen);$el.setAttribute('aria-hidden', !$store.searchFieldOpen);$el.setAttribute('aria-labelledby', 'flyout-' + $store.searchID.current + '-1')"
64
+ x-show="$store.searchFieldOpen"
65
+ class="sb-quick-search-flyout flex tablet:w-half-screen tablet:ml-half-screen justify-end order-4 w-full max-w-full p-2 px-5 py-3.5 bg-white drop-shadow-md md:mt-0 z-102 lg:hidden print:hidden"
66
+ @search-close.window="$store.searchFieldOpen = false"
67
+ @click.outside="$store.searchFieldOpen = false; $dispatch('search-mobile-click-outside'); dropped = false; toggleScrolling(!$store.serviceNavIsOpensearchFieldOpen && !$store.burgeropen)"
68
+ x-transition:enter="transition ease-out duration-200"
69
+ x-transition:enter-start="opacity-0 transform scale-y-90"
70
+ x-transition:enter-end="opacity-100 transform scale-y-100"
71
+ x-transition:leave="transition ease-in duration-100"
72
+ x-transition:leave-start="opacity-100 transform scale-y-100"
73
+ x-transition:leave-end="opacity-0 transform scale-y-90">
74
+
75
+ {{> components/header/search/quick_search_form }}
76
+
77
+ </div>
78
+
79
+ </div>
80
+
81
+ </header>
82
+ <div x-ref="myOverlay">
83
+ <div x-cloak x-data="overlayHandler()" @click.debounce="overlayWasClicked()" x-show="shouldOverlayBeShown()" class="fixed top-0 left-0 w-screen h-screen bg-gray-800 z-100 lg:hidden opacity-70"></div>
84
+ </div>
85
+ </div>
@@ -1,6 +1,6 @@
1
1
  import { ArgsTable, Meta, Story, Canvas, Preview } from '@storybook/addon-docs'
2
2
 
3
- import navigation from './Header.hbs'
3
+ import navigation from './header.hbs'
4
4
  import JsonData from './navigation.json'
5
5
  import JsonData2 from './navigation2.json'
6
6
  import JsonData3 from './navigation3.json'
@@ -0,0 +1,255 @@
1
+ //Main Alpine Init Listener
2
+ document.addEventListener('alpine:init', () => {
3
+ // Alpine.stores for global variables
4
+ Alpine.store('clientHeight', document.documentElement.clientHeight || document.body.clientHeight)
5
+ Alpine.store('clientWidth', document.documentElement.clientWidth || document.body.clientWidth)
6
+ Alpine.store('burgeropen', false);
7
+ Alpine.store('searchFieldOpen', false);
8
+ Alpine.store('serviceNavIsOpen', false);
9
+ Alpine.store('searchID', {
10
+ current: '{{nextRandom}}'
11
+ });
12
+ Alpine.store('serviceID', {
13
+ open: false,
14
+ current: '0'
15
+ });
16
+ Alpine.store('navIsVisible', true);
17
+
18
+ // context for the main header element
19
+ Alpine.data('mainNavigationHandler', () =>({
20
+
21
+ debounce (callback, wait) {
22
+ let timeoutId = null;
23
+ return (...args) => {
24
+ window.clearTimeout(timeoutId);
25
+ timeoutId = window.setTimeout(() => {
26
+ callback.apply(null, args);
27
+ }, wait);
28
+ };
29
+
30
+ },
31
+ init(){
32
+ let lastScrollTop = 0
33
+ let height = top.innerHeight
34
+
35
+ window.addEventListener('scroll', this.debounce( () => {
36
+ let winScroll = document.body.scrollTop || document.documentElement.scrollTop
37
+ winScroll > lastScrollTop ? this.scrollingDown = true : this.scrollingDown = false
38
+ //let height = document.documentElement.scrollHeight - document.documentElement.clientHeight
39
+ this.percent = Math.round((winScroll / height) * 100)
40
+ lastScrollTop = winScroll
41
+ //console.log('winscroll: '+winScroll+' height: '+height + ' percent: '+ this.percent)
42
+ this.$store.navIsVisible = !this.isNavHidden()
43
+ //console.log(this.$store.navIsVisible);
44
+ },50))
45
+ },
46
+ percent: 0,
47
+ scrollingDown: true,
48
+ isNavHidden() {
49
+ if(this.$screen('lg')) {
50
+ return this.shouldSectionNavBeHidden()
51
+ } else {
52
+ return this.shouldServiceNavBeHidden()
53
+ }
54
+ },
55
+ shouldBrandNavBeHidden() {
56
+ return this.percent > 0
57
+ },
58
+ shouldSectionNavBeHidden() {
59
+ return this.percent > 50 && this.scrollingDown && this.$store.burgeropen == false && this.$screen('lg')
60
+ },
61
+ shouldServiceNavBeHidden() {
62
+ return (this.percent > 90 && !this.$screen('lg') && this.scrollingDown && this.$store.burgeropen == false)
63
+ },
64
+ shouldServiceIconsBeHidden() {
65
+ 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)
66
+ },
67
+ shouldFlyoutBeHidden() {
68
+ return (this.percent > 50 && this.scrollingDown && this.$screen('lg') )
69
+ },
70
+ resetNav() {
71
+ if(window.innerWidth > 1023) {
72
+ this.$refs.sectionnavigation.setAttribute("style","")
73
+ } else {
74
+ // hidden needs to be set here to avoid flickering of the sectionNav on viewport change, gets removed in timeout
75
+ // this.$refs.sectionnavigation.classList.add('hidden')
76
+ // this.$refs.sectionnavigation.style.maxHeight="0px"
77
+ }
78
+
79
+ let nowClientHeight = document.documentElement.clientHeight || document.body.clientHeight;
80
+ let nowClientWidth = document.documentElement.clientWidth || document.body.clientWidth;
81
+ let nextNowClientHeight = this.$store.clientHeight;
82
+ if (nextNowClientHeight >= nowClientHeight && this.$store.clientWidth == nowClientWidth) {
83
+ // Event handling of keyboard pop-up
84
+ nextNowClientHeight = nowClientHeight
85
+ this.$store.clientWidth = nowClientWidth
86
+ }
87
+ else{
88
+ // timeout is used to dispatch events after the resize is done
89
+ let timeout
90
+ clearTimeout(timeout)
91
+ timeout = setTimeout(() => {
92
+ this.$refs.sectionnavigation.classList.remove('hidden')
93
+ this.$store.burgeropen == true ? this.$dispatch('burger-close') :null
94
+ this.$store.searchFieldOpen === true ? this.$dispatch('search-mobile-click-outside') :null
95
+ this.$store.searchFieldOpen === true ? this.$dispatch('search-close') :null
96
+ this.$store.serviceNavIsOpen === true ? this.$dispatch('close-servicemenu') :null
97
+ this.toggleScrolling(true)
98
+ }, 250)
99
+ // Event handling of keyboard pop-up
100
+ nextNowClientHeight = nowClientHeight
101
+ this.$store.clientWidth = nowClientWidth
102
+ }
103
+ },
104
+ toggleSectionNav() {
105
+ //false = sectionNav schließt ( mobile/tablet? --> maxHeight = 0 /// desktop? just clear maxHeight attribute )
106
+ //true = sectionNav öffnet (maxheight = scrollheight)
107
+ console.log('toggleSectionNav, Event: ' + this.$event.detail )
108
+ if(this.$event.detail === false) {
109
+ if (window.innerWidth < 1024) {
110
+ this.$refs.sectionnavigation.style.maxHeight='0px'
111
+ } else {
112
+ this.$refs.sectionnavigation.style.maxHeight = ''
113
+ }
114
+ } else {
115
+ let winheightcorr = parseInt(window.innerHeight) - this.$refs.sectionnavigation.offsetTop
116
+ let navheight = parseInt(this.$refs.sectionnavigation.scrollHeight)
117
+ let brandNavHeight = this.percent > 0 ? 40 : 0
118
+
119
+ if(navheight > winheightcorr){
120
+ this.$refs.sectionnavigation.style.overflowY = 'scroll'
121
+ this.$refs.sectionnavigation.style.maxHeight = winheightcorr + brandNavHeight +'px'
122
+
123
+ } else {
124
+ this.$refs.sectionnavigation.style.overflowY = 'hidden'
125
+ this.$refs.sectionnavigation.style.maxHeight = this.$el.scrollHeight + 'px'
126
+ }
127
+ }
128
+ },
129
+ disableScrolling() {
130
+ document.body.classList.add('overflow-hidden','h-full','w-full')
131
+ this.$refs.myOverlay.ontouchmove = (e) => e.preventDefault();
132
+ console.log("disableScrolling")
133
+ },
134
+ enableScrolling() {
135
+ document.body.classList.remove('overflow-hidden','h-full','w-full')
136
+ this.$refs.myOverlay.ontouchmove = (e) => true;
137
+ console.log("enableScrolling")
138
+ },
139
+ toggleScrolling(mode){
140
+ if(this.$screen(0) && !this.$screen('lg')){
141
+ mode == false ? this.disableScrolling() : this.enableScrolling()
142
+ }
143
+ if(this.$screen('lg') && mode == true){
144
+ this.enableScrolling()
145
+ }
146
+ }
147
+
148
+ }))
149
+
150
+ // context for the overlay
151
+ Alpine.data('overlayHandler', () => ({
152
+ shouldOverlayBeShown() {
153
+ return (!this.$screen('lg') && ( this.$store.burgeropen == true || this.$store.serviceNavIsOpen == true || this.$store.searchFieldOpen == true ))
154
+ },
155
+ overlayWasClicked() {
156
+ this.$store.serviceNavIsOpen ? this.$store.serviceNavIsOpen = false : null
157
+ this.$dispatch('burger-close')
158
+ this.$dispatch('close-servicemenu')
159
+ // this.$dispatch('toggleScrolling', true )
160
+ this.toggleScrolling(true)
161
+ }
162
+ }))
163
+
164
+ // context for all dropdowns
165
+ Alpine.data('dropdown', () => ({
166
+ dropped: false,
167
+ toggle() {
168
+ this.dropped = ! this.dropped;
169
+ },
170
+ toggleServiceNav(){
171
+ this.dropped = ! this.dropped;
172
+ this.$store.searchFieldOpen = false;
173
+
174
+ 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;
175
+
176
+ this.$store.burgeropen == true ? this.$dispatch('burger-close') : null
177
+
178
+ console.log('currentID: '+ this.$store.serviceID.current)
179
+ console.log('target-id: '+this.$event.target.id)
180
+ console.log('element-id: '+this.$el.id)
181
+ console.log('serviceNav is open:'+ this.$store.serviceNavIsOpen)
182
+
183
+ this.$store.serviceID.current = this.$el.id
184
+
185
+ this.toggleScrolling(!this.$store.serviceNavIsOpen)
186
+
187
+ let myFlyout = document.querySelector('#flyout-'+this.$el.id)
188
+ let brandNavHeight = this.percent > 0 ? 40 : 0
189
+
190
+ if (this.$store.serviceNavIsOpen == true && this.dropped == true) {
191
+ window.setTimeout(function(){
192
+ if (myFlyout.scrollHeight > window.innerHeight-myFlyout.offsetTop) {
193
+ myFlyout.style.height = 'auto'
194
+ window.innerWidth < 768 ? myFlyout.style.maxHeight = window.innerHeight-myFlyout.offsetTop - 80 + brandNavHeight +'px' : myFlyout.style.maxHeight = window.innerHeight-myFlyout.offsetTop - 40 + brandNavHeight +'px'
195
+ myFlyout.style.overflowY = 'scroll'
196
+ } else {
197
+ myFlyout.style.maxHeight = ''
198
+ //myFlyout.style.overflowY = 'hidden'
199
+ }
200
+ },150)
201
+ }
202
+ }
203
+ }))
204
+
205
+ // There are several Flyouts sharing the same functionality and context, so put the data in an Alpine.data to make it reusable
206
+ Alpine.data('flyoutHandler', () => ({
207
+ init() {
208
+ //Initial: x-collapse only on mobile/tablet
209
+ if(window.innerWidth < 1024) {
210
+ this.$el.setAttribute("x-collapse","")
211
+ }
212
+ },
213
+ sectionNavFlyoutWatcher() {
214
+ //Adds scrollheight of the flyout to sectionNav container to make sure all following items stay visible
215
+ this.$watch('dropped', value => {
216
+ let a = this.$refs.sectionnavigation.scrollHeight + this.$el.scrollHeight;
217
+ let brandNavHeight = this.percent > 0 ? 40 : 0
218
+ if(window.innerWidth < 1024) {
219
+ if(value == true ) {
220
+
221
+ if (a < window.innerHeight - this.$refs.sectionnavigation.offsetTop) {
222
+ this.$refs.sectionnavigation.style.maxHeight = a +'px'
223
+ this.$refs.sectionnavigation.style.overflowY = 'hidden'
224
+ } else {
225
+ this.$refs.sectionnavigation.style.maxHeight = window.innerHeight - this.$refs.sectionnavigation.offsetTop + brandNavHeight +'px'
226
+ this.$refs.sectionnavigation.style.overflowY = 'scroll'
227
+ }
228
+ } else {
229
+ if (a < window.innerHeight - this.$refs.sectionnavigation.offsetTop) {
230
+ this.$refs.sectionnavigation.style.overflowY = 'hidden'
231
+ } else {
232
+ this.$refs.sectionnavigation.style.overflowY = 'scroll'
233
+ }
234
+ }
235
+ }
236
+ })
237
+ },
238
+ setFlyoutAnimationStyle() {
239
+ //sets/cleansup the x-collapse attributes depending on window.innerWidth, gets fired @resize.window in NavigationFlyout.hbs
240
+ if(window.innerWidth > 1023) {
241
+ if(this.$el.hasAttribute("x-collapse.duration.500ms")) {
242
+ this.$el.removeAttribute("x-collapse.duration.500ms")
243
+ delete this.$el._x_transition;
244
+ this.$el.style.removeProperty('overflow');
245
+ this.$el.style.removeProperty('height');
246
+ if (! this.$el._x_isShown) this.$el.style.display = 'none'
247
+ if(this.$el.hasAttribute("hidden")) this.$el.removeAttribute("hidden")
248
+ }
249
+
250
+ } else {
251
+ if(!this.$el.hasAttribute("x-collapse.duration.500ms")) this.$el.setAttribute("x-collapse.duration.500ms","")
252
+ }
253
+ }
254
+ }))
255
+ })
@@ -44,11 +44,11 @@
44
44
  <div class="{{#if this.showAsFlyout}}lg:flex lg:flex-row -columnCount--{{this.columnCount}} lg:divide-x lg:divide-gray-200 {{else}} {{#if ../this.selected}} w-full lg:px-10 lg:container {{/if}}{{/if}}">
45
45
  {{#if this.showAsFlyout}}
46
46
  {{#each this.columns}}
47
- {{> components/Header/NavigationFlyout/NavigationFlyoutColumn count=../this.columnCount navtype=../../_navigationType _parent=../../_parent _flyout=true~}}
47
+ {{> components/header/navigation_flyout/navigation_flyout_column count=../this.columnCount navtype=../../_navigationType _parent=../../_parent _flyout=true~}}
48
48
  {{/each}}
49
49
  {{else}}
50
50
  {{#with this.items}}
51
- {{> components/Header/NavigationFlyout/NavigationFlyoutColumn selected=../../this.selected navtype=../../_navigationType _parent=../../_parent _flyout=false ~}}
51
+ {{> components/header/navigation_flyout/navigation_flyout_column selected=../../this.selected navtype=../../_navigationType _parent=../../_parent _flyout=false ~}}
52
52
  {{/with}}
53
53
  {{/if}}
54
54
  </div>
@@ -1,6 +1,6 @@
1
1
  import { ArgsTable, Meta, Story, Canvas, Preview } from '@storybook/addon-docs'
2
2
 
3
- import flyout from './NavigationFlyout.hbs'
3
+ import flyout from './navigation_flyout.hbs'
4
4
 
5
5
  import JsonData from '../navigation.json'
6
6
 
@@ -0,0 +1,9 @@
1
+ <ul class="{{inline-switch count '["1","2"]' '["md:w-1/1", "md:w-1/1 lg:w-1/2"]'}} {{inline-switch navtype '["ServiceNavigation","RubrikNavigation"]' '["border-b border-gray-200 md:border-0","border-0"]'}} lg:even:pl-4 lg:odd:pr-4 {{#if selected}} lg:container lg:flex lg:h-9 {{/if}} ">
2
+
3
+ {{~#each this ~}}
4
+ {{~#if this.title~}}
5
+ {{> components/header/navigation_flyout/navigation_flyout_item _parentselected=../selected _fromNav=../navtype _flyout=../_flyout _parent=../_parent ~}}
6
+ {{~/if~}}
7
+ {{~/each~}}
8
+
9
+ </ul>
@@ -1,6 +1,6 @@
1
1
  import { ArgsTable, Meta, Story, Canvas, Preview } from '@storybook/addon-docs'
2
2
 
3
- import QuickSearchButton from './QuickSearchButton.hbs'
3
+ import QuickSearchButton from './quick_search_button.hbs'
4
4
 
5
5
  <Meta title="Komponenten/Header/Search/QuickSearchButton" argTypes={{}} />
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { ArgsTable, Meta, Story, Canvas, Preview } from '@storybook/addon-docs'
2
2
 
3
- import QuickSearchForm from './QuickSearchForm.hbs'
3
+ import QuickSearchForm from './quick_search_form.hbs'
4
4
 
5
5
  <Meta title="Komponenten/Header/Search/QuickSearchForm" argTypes={{}} />
6
6
 
@@ -1,6 +1,6 @@
1
1
  <div
2
2
  id="sectionNav"
3
- class="sb-section-navigation w-full px-0 mt-10 md:mt-0 lg:px-10 lg:container bg-blue-congress"
3
+ class="w-full px-0 mt-10 sb-section-navigation md:mt-0 lg:px-10 lg:container bg-blue-congress"
4
4
  x-effect="$el.setAttribute('aria-expanded', $store.burgeropen || $screen('lg')); $el.setAttribute('aria-hidden', ! ($store.burgeropen || $screen('lg')))"
5
5
  >
6
6
  <div class="flex content-start mb-0">
@@ -10,7 +10,7 @@
10
10
  <ul class="flex flex-col items-center w-full text-left text-white list-none lg:flex-row lg:h-auto lg:mt-1">
11
11
  {{#each this}}
12
12
  {{#if (isStorybook)}}
13
- {{> components/Header/SectionNavigation/SectionNavigationItem }}
13
+ {{> components/header/section_navigation/section_navigation_item }}
14
14
  {{else}}
15
15
  {{{this}}}
16
16
  {{/if}}
@@ -1,6 +1,6 @@
1
1
  import { ArgsTable, Meta, Story, Canvas, Preview } from '@storybook/addon-docs'
2
2
 
3
- import menu from './SectionNavigation.hbs'
3
+ import menu from './section_navigation.hbs'
4
4
 
5
5
  import JsonData from '../navigation.json'
6
6
 
@@ -3,7 +3,7 @@
3
3
  @click.outside="dropped = false"
4
4
  @close-servicemenu.window="dropped = false"
5
5
  :class="dropped ? 'border-b-0 lg:bg-white lg:text-blue-congress h-auto' : 'h-10 lg:hover:underline'"
6
- class="sb-section-navigation-item flex flex-wrap justify-start w-full text-white list-none border-b border-white first:lg:-ml-4 md:pl-0 lg:first:pl-0 first:border-t lg:first:border-t-0 first:font-normal last:border-b-0 lg:border-0 lg:w-auto bg-blue-congress lg:rounded-t">
6
+ class="flex flex-wrap justify-start w-full text-white list-none border-b border-white sb-section-navigation-item first:lg:-ml-4 md:pl-0 lg:first:pl-0 first:border-t lg:first:border-t-0 first:font-normal last:border-b-0 lg:border-0 lg:w-auto bg-blue-congress lg:rounded-t">
7
7
  {{#if this.isCluster ~}}
8
8
  {{!-- Gilt z.B. für REGIONEN: --}}
9
9
  <button id="button-{{nextRandom}}-1"
@@ -94,7 +94,7 @@
94
94
 
95
95
  {{/if}}
96
96
 
97
- {{> components/Header/NavigationFlyout/NavigationFlyout _isSectionNav=true _navigationType="RubrikNavigation" _parent=this.text }}
97
+ {{> components/header/navigation_flyout/navigation_flyout _isSectionNav=true _navigationType="RubrikNavigation" _parent=this.text }}
98
98
 
99
99
  </li>
100
100
  {{/each}}
@@ -1,6 +1,6 @@
1
1
  import { ArgsTable, Meta, Story, Canvas, Preview } from '@storybook/addon-docs'
2
2
 
3
- import item from './SectionNavigationItem.hbs'
3
+ import item from './section_navigation_item.hbs'
4
4
 
5
5
  import JsonData from '../navigation.json'
6
6