@@ -12,6 +12,12 @@ import { registerDestructor } from '@ember/destroyable';
12
12
export interface HdsAppHeaderSignature {
13
13
Args : {
14
14
breakpoint ?: string ;
15
+ hasA11yRefocus ?: boolean ;
16
+ a11yRefocusSkipTo ?: string ;
17
+ a11yRefocusSkipText ?: string ;
18
+ a11yRefocusNavigationText ?: string ;
19
+ a11yRefocusRouteChangeValidator ?: string ;
20
+ a11yRefocusExcludeAllQueryParams ?: boolean ;
15
21
} ;
16
22
Blocks : {
17
23
logo ?: [ ] ;
@@ -24,11 +30,20 @@ export interface HdsAppHeaderSignature {
24
30
export default class HdsAppHeaderComponent extends Component < HdsAppHeaderSignature > {
25
31
@tracked isOpen = false ;
26
32
@tracked isDesktop = true ;
33
+ @tracked hasOverflowContent = false ;
27
34
desktopMQ : MediaQueryList ;
35
+ hasA11yRefocus = this . args . hasA11yRefocus ?? true ;
36
+ a11yRefocusSkipTo = '#' + ( this . args . a11yRefocusSkipTo ?? 'main' ) ;
28
37
29
38
// Generates a unique ID for the Menu Content
30
39
menuContentId = 'hds-menu-content-' + guidFor ( this ) ;
31
40
41
+ breakpoint = parseInt (
42
+ getComputedStyle ( document . documentElement ) . getPropertyValue (
43
+ '--hds-app-desktop-breakpoint'
44
+ )
45
+ ) ;
46
+
32
47
desktopMQVal =
33
48
this . args . breakpoint ??
34
49
getComputedStyle ( document . documentElement ) . getPropertyValue (
@@ -65,19 +80,20 @@ export default class HdsAppHeaderComponent extends Component<HdsAppHeaderSignatu
65
80
) ;
66
81
}
67
82
68
- // Menu items display if is desktop, or if is mobile and the menu is open
69
- get showItems ( ) : boolean {
70
- return this . isDesktop || this . isOpen ;
71
- }
72
-
73
83
// Get the class names to apply to the component.
74
84
get classNames ( ) : string {
75
85
const classes = [ 'hds-app-header' ] ;
76
86
77
- if ( ! this . isDesktop ) {
87
+ if ( this . isDesktop ) {
88
+ classes . push ( 'hds-app-header--is-desktop' ) ;
89
+ } else {
78
90
classes . push ( 'hds-app-header--is-mobile' ) ;
91
+ }
92
+
93
+ if ( this . isOpen ) {
94
+ classes . push ( 'hds-app-header--menu-is-open' ) ;
79
95
} else {
80
- classes . push ( 'hds-app-header--is-desktop ' ) ;
96
+ classes . push ( 'hds-app-header--menu- is-closed ' ) ;
81
97
}
82
98
83
99
return classes . join ( ' ' ) ;
0 commit comments