hr-design-system-handlebars 0.49.7 → 0.49.10

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.
@@ -110,8 +110,9 @@ export const parameters = {
110
110
  [
111
111
  'Page',
112
112
  'Header',
113
- ['Header', 'BrandNavigation', 'ServiceNavigation', 'SectionNavigation'],
114
- 'Flyout',
113
+ 'Teaser',
114
+ 'grid',
115
+ 'Label'
115
116
  ],
116
117
  '*',
117
118
  ],
package/CHANGELOG.md CHANGED
@@ -1,3 +1,39 @@
1
+ # v0.49.10 (Tue Jul 12 2022)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - refactoring and better component order [#268](https://github.com/mumprod/hr-design-system-handlebars/pull/268) ([@StefanVesper](https://github.com/StefanVesper))
6
+
7
+ #### Authors: 1
8
+
9
+ - SonicSoulSurfer ([@StefanVesper](https://github.com/StefanVesper))
10
+
11
+ ---
12
+
13
+ # v0.49.9 (Fri Jul 08 2022)
14
+
15
+ #### 🐛 Bug Fix
16
+
17
+ - adds detection for scrollbar use [#266](https://github.com/mumprod/hr-design-system-handlebars/pull/266) ([@StefanVesper](https://github.com/StefanVesper))
18
+
19
+ #### Authors: 1
20
+
21
+ - SonicSoulSurfer ([@StefanVesper](https://github.com/StefanVesper))
22
+
23
+ ---
24
+
25
+ # v0.49.8 (Thu Jul 07 2022)
26
+
27
+ #### 🐛 Bug Fix
28
+
29
+ - adds listener for touchmove (mobile) [#265](https://github.com/mumprod/hr-design-system-handlebars/pull/265) ([@StefanVesper](https://github.com/StefanVesper))
30
+
31
+ #### Authors: 1
32
+
33
+ - SonicSoulSurfer ([@StefanVesper](https://github.com/StefanVesper))
34
+
35
+ ---
36
+
1
37
  # v0.49.7 (Wed Jul 06 2022)
2
38
 
3
39
  #### 🐛 Bug Fix
@@ -31,30 +31,39 @@ document.addEventListener('alpine:init', () => {
31
31
  },
32
32
  init(){
33
33
  let lastScrollTop = 0
34
- let height = top.innerHeight
35
-
34
+ let height = window.innerHeight
36
35
  let userScroll = false;
37
36
  window.userScroll = userScroll;
38
37
 
39
- function mouseEvent(e) {
38
+ const mouseEvent = () => {
40
39
  userScroll = true;
41
40
  window.userScroll = true;
41
+ //console.log('user action detected')
42
42
  }
43
- window.addEventListener('wheel', mouseEvent, false);
44
43
 
45
- window.addEventListener('scroll', this.debounce( () => {
44
+ const clickedOnScrollbar = mouseX => {
45
+ return document.documentElement.offsetWidth <= mouseX ? true : false;
46
+ }
47
+
48
+ const mouseDownHandler = e => {
49
+ clickedOnScrollbar(e.clientX) ? mouseEvent() : null
50
+ };
51
+
52
+ const scrollHandler = () => {
46
53
  let winScroll = document.body.scrollTop || document.documentElement.scrollTop
47
54
  winScroll > lastScrollTop ? this.scrollingDown = true : this.scrollingDown = false
48
- //let height = document.documentElement.scrollHeight - document.documentElement.clientHeight
49
55
  this.percent = Math.round((winScroll / height) * 100)
50
56
  lastScrollTop = winScroll
51
- //console.log('winscroll: '+winScroll+' height: '+height + ' percent: '+ this.percent)
52
57
  this.$store.navIsVisible = !this.isNavHidden()
53
58
  this.$store.subNavIsVisible = !this.isSubNavHidden()
54
-
59
+ //console.log('winscroll: '+winScroll+' screen height: '+height + ' percent scrolled: '+ this.percent)
55
60
  //console.log('Scroll initiated by ' + (window.userScroll == true ? "user" : "browser"));
61
+ }
56
62
 
57
- },50), {passive: true})
63
+ window.addEventListener('mousedown', mouseDownHandler, false)
64
+ window.addEventListener('wheel', mouseEvent, false);
65
+ window.addEventListener('touchmove', mouseEvent, false)
66
+ window.addEventListener('scroll', this.debounce( scrollHandler,50), { passive: true })
58
67
  },
59
68
  percent: 0,
60
69
  scrollingDown: true,
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.49.7",
9
+ "version": "0.49.10",
10
10
  "scripts": {
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
12
  "storybook": "start-storybook -p 6006 public",
@@ -31,30 +31,39 @@ document.addEventListener('alpine:init', () => {
31
31
  },
32
32
  init(){
33
33
  let lastScrollTop = 0
34
- let height = top.innerHeight
35
-
34
+ let height = window.innerHeight
36
35
  let userScroll = false;
37
36
  window.userScroll = userScroll;
38
37
 
39
- function mouseEvent(e) {
38
+ const mouseEvent = () => {
40
39
  userScroll = true;
41
40
  window.userScroll = true;
41
+ //console.log('user action detected')
42
42
  }
43
- window.addEventListener('wheel', mouseEvent, false);
44
43
 
45
- window.addEventListener('scroll', this.debounce( () => {
44
+ const clickedOnScrollbar = mouseX => {
45
+ return document.documentElement.offsetWidth <= mouseX ? true : false;
46
+ }
47
+
48
+ const mouseDownHandler = e => {
49
+ clickedOnScrollbar(e.clientX) ? mouseEvent() : null
50
+ };
51
+
52
+ const scrollHandler = () => {
46
53
  let winScroll = document.body.scrollTop || document.documentElement.scrollTop
47
54
  winScroll > lastScrollTop ? this.scrollingDown = true : this.scrollingDown = false
48
- //let height = document.documentElement.scrollHeight - document.documentElement.clientHeight
49
55
  this.percent = Math.round((winScroll / height) * 100)
50
56
  lastScrollTop = winScroll
51
- //console.log('winscroll: '+winScroll+' height: '+height + ' percent: '+ this.percent)
52
57
  this.$store.navIsVisible = !this.isNavHidden()
53
58
  this.$store.subNavIsVisible = !this.isSubNavHidden()
54
-
59
+ //console.log('winscroll: '+winScroll+' screen height: '+height + ' percent scrolled: '+ this.percent)
55
60
  //console.log('Scroll initiated by ' + (window.userScroll == true ? "user" : "browser"));
61
+ }
56
62
 
57
- },50), {passive: true})
63
+ window.addEventListener('mousedown', mouseDownHandler, false)
64
+ window.addEventListener('wheel', mouseEvent, false);
65
+ window.addEventListener('touchmove', mouseEvent, false)
66
+ window.addEventListener('scroll', this.debounce( scrollHandler,50), { passive: true })
58
67
  },
59
68
  percent: 0,
60
69
  scrollingDown: true,