@illinois-toolkit/ilw-header-megamenu 0.0.1 → 1.0.1
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/LICENSE +20 -20
- package/README.md +229 -261
- package/builder/ilw-header-megamenu.json +12 -12
- package/builder/versions/ilw-header-megamenu.1.0-alpha.json +70 -70
- package/builder/versions/ilw-header-megamenu.1.0.1.json +70 -0
- package/builder/versions/ilw-header-megamenu.1.0.json +70 -0
- package/builder/versions/ilw-header-megamenu.2.0-alpha.json +76 -0
- package/dist/MegaMenu.d.ts.map +1 -1
- package/dist/MegaMenuSection.d.ts +2 -8
- package/dist/MegaMenuSection.d.ts.map +1 -1
- package/dist/cdn/ilw-header-megamenu.css +1 -1
- package/dist/cdn/ilw-header-megamenu.js +317 -329
- package/dist/ilw-header-megamenu.css +1 -1
- package/dist/ilw-header-megamenu.js +111 -123
- package/package.json +49 -49
- package/src/MegaMenu.css +82 -79
- package/src/MegaMenu.styles.css +37 -36
- package/src/MegaMenu.ts +169 -144
- package/src/MegaMenuSection.css +231 -347
- package/src/MegaMenuSection.styles.css +242 -162
- package/src/MegaMenuSection.ts +220 -284
- package/src/ilw-header-megamenu.ts +1 -1
package/src/MegaMenu.css
CHANGED
|
@@ -1,80 +1,83 @@
|
|
|
1
|
-
ilw-header-megamenu[compact] {
|
|
2
|
-
--ilw-header-megamenu--background: #e8e9eb;
|
|
3
|
-
--ilw-header-megamenu--flex-direction: column;
|
|
4
|
-
--ilw-header-megamenu--items--position: relative;
|
|
5
|
-
--ilw-header-megamenu--items--border: none;
|
|
6
|
-
--ilw-header-megamenu--items--box-shadow: none;
|
|
7
|
-
--ilw-header-megamenu--items--width: 100%;
|
|
8
|
-
--ilw-header-megamenu--font: 600 18px / 28px var(--il-font-sans);
|
|
9
|
-
--ilw-header-megamenu--grid-template-columns: auto 52px;
|
|
10
|
-
--ilw-header-megamenu--link-border-left-highlight: 4px solid transparent;
|
|
11
|
-
--ilw-header-megamenu--link-border-left-highlight--hover: 4px solid var(--il-orange);
|
|
12
|
-
--ilw-header-megamenu--link-border-left-highlight--focus: 4px solid var(--il-blue);
|
|
13
|
-
--ilw-header-megamenu--link-
|
|
14
|
-
--ilw-header-megamenu--link-border-bottom-highlight
|
|
15
|
-
--ilw-header-megamenu--link-border-bottom-highlight--
|
|
16
|
-
--ilw-header-megamenu--
|
|
17
|
-
--ilw-header-megamenu
|
|
18
|
-
--ilw-header-megamenu--grid-template-columns: auto
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
border-
|
|
54
|
-
border-
|
|
55
|
-
border-
|
|
56
|
-
border-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
1
|
+
ilw-header-megamenu[compact] {
|
|
2
|
+
--ilw-header-megamenu--background: #e8e9eb;
|
|
3
|
+
--ilw-header-megamenu--flex-direction: column;
|
|
4
|
+
--ilw-header-megamenu--items--position: relative;
|
|
5
|
+
--ilw-header-megamenu--items--border: none;
|
|
6
|
+
--ilw-header-megamenu--items--box-shadow: none;
|
|
7
|
+
--ilw-header-megamenu--items--width: 100%;
|
|
8
|
+
--ilw-header-megamenu--font: 600 18px / 28px var(--il-font-sans);
|
|
9
|
+
--ilw-header-megamenu--grid-template-columns: auto 52px;
|
|
10
|
+
--ilw-header-megamenu--link-border-left-highlight: 4px solid transparent;
|
|
11
|
+
--ilw-header-megamenu--link-border-left-highlight--hover: 4px solid var(--il-orange);
|
|
12
|
+
--ilw-header-megamenu--link-border-left-highlight--focus: 4px solid var(--il-blue);
|
|
13
|
+
--ilw-header-megamenu--link-color--focus: var(--il-blue);
|
|
14
|
+
--ilw-header-megamenu--link-border-bottom-highlight: none;
|
|
15
|
+
--ilw-header-megamenu--link-border-bottom-highlight--hover: none;
|
|
16
|
+
--ilw-header-megamenu--link-border-bottom-highlight--focus: none;
|
|
17
|
+
--ilw-header-megamenu--items--position: initial;
|
|
18
|
+
--ilw-header-megamenu-section--grid-template-columns--header: auto 22px;
|
|
19
|
+
--ilw-header-megamenu--grid-template-columns: auto 51px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
ilw-header-megamenu {
|
|
23
|
+
all: initial;
|
|
24
|
+
display: block;
|
|
25
|
+
background: var(--ilw-header-megamenu--background);
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
&>ul {
|
|
29
|
+
all: initial;
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: var(--ilw-header-megamenu--flex-direction);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&>ul>li {
|
|
35
|
+
all: initial;
|
|
36
|
+
display: block;
|
|
37
|
+
background: var(--ilw-header-megamenu--background);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&>ul>li>a {
|
|
41
|
+
all: initial;
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
height: 100%;
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
position: relative;
|
|
47
|
+
padding: 6px 20px 6px;
|
|
48
|
+
font: var(--ilw-header-megamenu--font);
|
|
49
|
+
background: var(--ilw-header-megamenu--link-background);
|
|
50
|
+
color: var(--ilw-header-megamenu--link-color);
|
|
51
|
+
outline: 0;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
border-width: 0 0 3px 0;
|
|
54
|
+
border-style: solid;
|
|
55
|
+
border-color: transparent;
|
|
56
|
+
border-bottom: var(--ilw-header-megamenu--link-border-bottom-highlight);
|
|
57
|
+
border-left: var(--ilw-header-megamenu--link-border-left-highlight);
|
|
58
|
+
|
|
59
|
+
&[aria-current="true"],
|
|
60
|
+
&[aria-current="page"] {
|
|
61
|
+
border-color: var(--il-blue);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&:hover {
|
|
65
|
+
background: var(--ilw-header-megamenu--link-background--hover);
|
|
66
|
+
border-bottom: var(--ilw-header-megamenu--link-border-bottom-highlight--hover);
|
|
67
|
+
border-left: var(--ilw-header-megamenu--link-border-left-highlight--hover);
|
|
68
|
+
color: var(--ilw-header-megamenu--link-color--hover);
|
|
69
|
+
text-decoration: underline;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&:focus {
|
|
73
|
+
background: var(--ilw-header-megamenu--link-background--focus);
|
|
74
|
+
border-bottom: var(--ilw-header-megamenu--link-border-bottom-highlight--focus);
|
|
75
|
+
border-left: var(--ilw-header-megamenu--link-border-left-highlight--focus);
|
|
76
|
+
color: var(--ilw-header-megamenu--link-color--focus);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
ilw-header-megamenu[compact]>ul>li>a {
|
|
82
|
+
border-bottom: 1px solid var(--il-storm-lighter-3);
|
|
80
83
|
}
|
package/src/MegaMenu.styles.css
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
/* Styleable variables are in the base layer so they can be overridden easily */
|
|
2
|
-
@layer base {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
/* Styleable variables are in the base layer so they can be overridden easily */
|
|
2
|
+
@layer base {
|
|
3
|
+
:host {
|
|
4
|
+
--ilw-header-megamenu--link-color: var(--il-blue);
|
|
5
|
+
--ilw-header-megamenu--link-color--hover: var(--il-altgeld);
|
|
6
|
+
--ilw-header-megamenu--link-background: transparent;
|
|
7
|
+
--ilw-header-megamenu--link-background--hover: white;
|
|
8
|
+
--ilw-header-megamenu--link-background--focus: var(--ilw-color--focus--background);
|
|
9
|
+
--ilw-header-megamenu--link-background--sub--focus: var(--ilw-color--focus--background);
|
|
10
|
+
--ilw-header-megamenu--link-color--focus: var(--il-blue);
|
|
11
|
+
--ilw-header-megamenu--link-border-bottom-highlight: 4px solid transparent;
|
|
12
|
+
--ilw-header-megamenu--link-border-bottom-highlight--hover: 4px solid var(--il-orange);
|
|
13
|
+
--ilw-header-megamenu--link-border-bottom-highlight--focus: 4px solid var(--il-blue);
|
|
14
|
+
--ilw-header-megamenu--link-border-left-highlight: none;
|
|
15
|
+
--ilw-header-megamenu--link-border-left-highlight--focus: none;
|
|
16
|
+
--ilw-header-megamenu--background: #E8E9EB;
|
|
17
|
+
--ilw-header-megamenu--flex-direction: row;
|
|
18
|
+
--ilw-header-megamenu--items--position: absolute;
|
|
19
|
+
--ilw-header-megamenu--items--border: 1px solid rgb(0, 0, 0, .01);
|
|
20
|
+
--ilw-header-megamenu--items--box-shadow: 0 0 4px #00000040;
|
|
21
|
+
--ilw-header-megamenu--items--width: 1270px;
|
|
22
|
+
--ilw-header-megamenu--items--top: initial;
|
|
23
|
+
--ilw-header-megamenu--items--left: calc(var(--ilw-margin--side) - 39px);
|
|
24
|
+
--ilw-header-megamenu--font: 700 16px/22px var(--il-font-sans);
|
|
25
|
+
--ilw-header-megamenu--grid-template-columns: auto auto;
|
|
26
|
+
--ilw-header-megamenu-section--grid-template-columns--header: auto 24px;
|
|
27
|
+
--ilw-header-megamenu-section--anchor--padding: 6px 20px;
|
|
28
|
+
--ilw-header-megamenu-section--anchor--border: none;
|
|
29
|
+
--ilw-header-megamenu-section--anchor--text-indent: 0;
|
|
30
|
+
--ilw-header-megamenu-section--transform: none;
|
|
31
|
+
--ilw-header-megamenu-section--transform--selected: rotate(180deg);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
div.parent.full {
|
|
36
|
+
padding-top: 6px;
|
|
37
|
+
margin: 0 calc(var(--ilw-margin--side) - 9px);
|
|
37
38
|
}
|
package/src/MegaMenu.ts
CHANGED
|
@@ -1,145 +1,170 @@
|
|
|
1
|
-
import { LitElement, html, unsafeCSS, CSSResultGroup } from "lit";
|
|
2
|
-
// @ts-ignore
|
|
3
|
-
import styles from './MegaMenu.styles.css?inline';
|
|
4
|
-
import './MegaMenu.css';
|
|
5
|
-
import { customElement, property } from "lit/decorators.js";
|
|
6
|
-
import MegaMenuSection from "./MegaMenuSection";
|
|
7
|
-
|
|
8
|
-
@customElement("ilw-header-megamenu")
|
|
9
|
-
export default class MegaMenu extends LitElement {
|
|
10
|
-
|
|
11
|
-
@property({
|
|
12
|
-
type: Boolean,
|
|
13
|
-
reflect: true
|
|
14
|
-
})
|
|
15
|
-
compact = false;
|
|
16
|
-
|
|
17
|
-
@property({
|
|
18
|
-
type: Number
|
|
19
|
-
})
|
|
20
|
-
width = 990;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
this.
|
|
30
|
-
this.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
window.addEventListener('
|
|
37
|
-
this.handleWindowResize
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
window.removeEventListener('
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (evt.key === '
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
this.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
this.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
1
|
+
import { LitElement, html, unsafeCSS, CSSResultGroup } from "lit";
|
|
2
|
+
// @ts-ignore
|
|
3
|
+
import styles from './MegaMenu.styles.css?inline';
|
|
4
|
+
import './MegaMenu.css';
|
|
5
|
+
import { customElement, property } from "lit/decorators.js";
|
|
6
|
+
import MegaMenuSection from "./MegaMenuSection";
|
|
7
|
+
|
|
8
|
+
@customElement("ilw-header-megamenu")
|
|
9
|
+
export default class MegaMenu extends LitElement {
|
|
10
|
+
|
|
11
|
+
@property({
|
|
12
|
+
type: Boolean,
|
|
13
|
+
reflect: true
|
|
14
|
+
})
|
|
15
|
+
compact = false;
|
|
16
|
+
|
|
17
|
+
@property({
|
|
18
|
+
type: Number
|
|
19
|
+
})
|
|
20
|
+
width = 990;
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
static get styles() : CSSResultGroup {
|
|
24
|
+
return unsafeCSS(styles);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
constructor() {
|
|
28
|
+
super();
|
|
29
|
+
this.addEventListener('keydown', this.handleWindowKeydown.bind(this));
|
|
30
|
+
this.handleWindowResize = this.handleWindowResize.bind(this);
|
|
31
|
+
this.handleWindowClick = this.handleWindowClick.bind(this);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
connectedCallback() {
|
|
35
|
+
super.connectedCallback();
|
|
36
|
+
window.addEventListener('click', this.handleWindowClick.bind(this));
|
|
37
|
+
window.addEventListener('resize', this.handleWindowResize);
|
|
38
|
+
this.handleWindowResize();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
disconnectedCallback() {
|
|
42
|
+
super.disconnectedCallback();
|
|
43
|
+
window.removeEventListener('click', this.handleWindowClick.bind(this));
|
|
44
|
+
window.removeEventListener('resize', this.handleWindowResize);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
handleWindowClick(evt: MouseEvent) {
|
|
48
|
+
if (!this.contains(evt.target as HTMLElement)) this.closeAllExceptOneSections(null);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
handleWindowKeydown(evt: KeyboardEvent) {
|
|
52
|
+
if (evt.key === 'Escape') this.closeAllExceptOneSections(null);
|
|
53
|
+
if (evt.key === 'ArrowRight') {
|
|
54
|
+
evt.preventDefault();
|
|
55
|
+
this.closeAllExceptOneSections(null);
|
|
56
|
+
this.gotoNextSection();
|
|
57
|
+
}
|
|
58
|
+
if (evt.key === 'ArrowLeft') {
|
|
59
|
+
evt.preventDefault();
|
|
60
|
+
this.closeAllExceptOneSections(null);
|
|
61
|
+
this.gotoPreviousSection();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
handleNavigationSectionToggleClick(evt: CustomEvent) {
|
|
66
|
+
this.closeAllExceptOneSections(evt.target);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
gotoPreviousSection() {
|
|
70
|
+
const activeElement = document.activeElement;
|
|
71
|
+
if (!activeElement) return;
|
|
72
|
+
|
|
73
|
+
const currentSection = activeElement.closest(
|
|
74
|
+
'ilw-header-megamenu-section'
|
|
75
|
+
) || activeElement.closest('li a');
|
|
76
|
+
|
|
77
|
+
if (!currentSection) return;
|
|
78
|
+
|
|
79
|
+
const parentLi = currentSection.parentElement;
|
|
80
|
+
const previousLi = parentLi?.previousElementSibling;
|
|
81
|
+
|
|
82
|
+
if (!previousLi) return;
|
|
83
|
+
|
|
84
|
+
const previousSection = previousLi.querySelector(
|
|
85
|
+
'ilw-header-megamenu-section'
|
|
86
|
+
) || previousLi.querySelector('a');
|
|
87
|
+
|
|
88
|
+
if (!previousSection) return;
|
|
89
|
+
|
|
90
|
+
if ('setFocus' in previousSection) {
|
|
91
|
+
(previousSection as MegaMenuSection).setFocus();
|
|
92
|
+
} else {
|
|
93
|
+
(previousSection as HTMLAnchorElement).focus();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
gotoNextSection() {
|
|
98
|
+
const activeElement = document.activeElement;
|
|
99
|
+
if (!activeElement) return;
|
|
100
|
+
|
|
101
|
+
const currentSection = activeElement.closest(
|
|
102
|
+
'ilw-header-megamenu-section'
|
|
103
|
+
) || activeElement.closest('li a');
|
|
104
|
+
|
|
105
|
+
if (!currentSection) return;
|
|
106
|
+
|
|
107
|
+
const parentLi = currentSection.parentElement;
|
|
108
|
+
const nextLi = parentLi?.nextElementSibling;
|
|
109
|
+
|
|
110
|
+
if (!nextLi) return;
|
|
111
|
+
|
|
112
|
+
const nextSection = nextLi.querySelector(
|
|
113
|
+
'ilw-header-megamenu-section'
|
|
114
|
+
) || nextLi.querySelector('a');
|
|
115
|
+
|
|
116
|
+
if (!nextSection) return;
|
|
117
|
+
|
|
118
|
+
if ('setFocus' in nextSection) {
|
|
119
|
+
(nextSection as MegaMenuSection).setFocus();
|
|
120
|
+
} else {
|
|
121
|
+
(nextSection as HTMLAnchorElement).focus();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
handleWindowResize() {
|
|
126
|
+
let currentWidth = this.offsetWidth == 0 ? window.innerWidth : this.offsetWidth;
|
|
127
|
+
if (currentWidth < this.width) {
|
|
128
|
+
if (!this.compact) this.setCompactTrue();
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
if (this.compact) this.setCompactFalse();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
setCompactTrue() {
|
|
136
|
+
this.compact = true;
|
|
137
|
+
this.querySelectorAll('ilw-header-megamenu-section').forEach(s => { s.compact = true; });
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
setCompactFalse() {
|
|
141
|
+
this.compact = false;
|
|
142
|
+
this.querySelectorAll('ilw-header-megamenu-section').forEach(s => { s.compact = false; });
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
getSections() {
|
|
146
|
+
return this.querySelectorAll('ilw-header-megamenu-section');
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
closeAllExceptOneSections(target: EventTarget | null) {
|
|
150
|
+
this.getSections().forEach(s => { if (target == null || target != s) { s.expanded = false; } });
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
render() {
|
|
156
|
+
return html`
|
|
157
|
+
<nav aria-label="Header Menu Navigation" @ilw-header-megamenu-section-expanded=${this.handleNavigationSectionToggleClick}>
|
|
158
|
+
<div class="parent ${this.compact ? 'compact' : 'full'}">
|
|
159
|
+
<slot></slot>
|
|
160
|
+
</div>
|
|
161
|
+
</nav>
|
|
162
|
+
`;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
declare global {
|
|
167
|
+
interface HTMLElementTagNameMap {
|
|
168
|
+
"ilw-header-megamenu": MegaMenu;
|
|
169
|
+
}
|
|
145
170
|
}
|