@iamproperty/components 3.9.0-beta-1 → 4.0.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.
- package/assets/css/components/collapsible-side.css +1 -0
- package/assets/css/components/collapsible-side.css.map +1 -0
- package/assets/css/components/nav-global.css +1 -1
- package/assets/css/components/nav-global.css.map +1 -1
- package/assets/css/core.min.css +1 -1
- package/assets/css/core.min.css.map +1 -1
- package/assets/css/style.min.css +1 -1
- package/assets/css/style.min.css.map +1 -1
- package/assets/js/components/accordion/accordion.component.min.js +2 -2
- package/assets/js/components/actionbar/actionbar.component.min.js +1 -1
- package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
- package/assets/js/components/card/card.component.min.js +1 -1
- package/assets/js/components/collapsible-side/collapsible-side.component.js +96 -0
- package/assets/js/components/collapsible-side/collapsible-side.component.min.js +27 -0
- package/assets/js/components/collapsible-side/collapsible-side.component.min.js.map +1 -0
- package/assets/js/components/filterlist/filterlist.component.min.js +1 -1
- package/assets/js/components/header/header.component.min.js +1 -1
- package/assets/js/components/nav/nav.component.min.js +1 -1
- package/assets/js/components/notification/notification.component.min.js +1 -1
- package/assets/js/components/pagination/pagination.component.min.js +1 -1
- package/assets/js/components/table/table.component.min.js +1 -1
- package/assets/js/components/table/table.component.min.js.map +1 -1
- package/assets/js/components/tabs/tabs.component.min.js +1 -1
- package/assets/js/dynamic.min.js +3 -3
- package/assets/js/dynamic.min.js.map +1 -1
- package/assets/js/modules/helpers.js +0 -13
- package/assets/js/scripts.bundle.js +8 -8
- package/assets/js/scripts.bundle.js.map +1 -1
- package/assets/js/scripts.bundle.min.js +2 -2
- package/assets/js/scripts.bundle.min.js.map +1 -1
- package/assets/sass/components/collapsible-side.scss +327 -0
- package/assets/sass/components/nav-global.scss +11 -0
- package/assets/ts/components/collapsible-side/README.md +38 -0
- package/assets/ts/components/collapsible-side/collapsible-side.component.ts +134 -0
- package/assets/ts/modules/helpers.ts +0 -17
- package/dist/components.es.js +1394 -886
- package/dist/components.umd.js +131 -37
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/CollapsibleSideMenu/CollapsibleSideMenu.vue +20 -0
- package/src/components/CollapsibleSideMenu/README.md +23 -0
- package/src/index.js +8 -0
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
@use "../_func" as *;
|
|
2
|
+
// Host
|
|
3
|
+
:host {
|
|
4
|
+
--colour-border: #e9e9e9;
|
|
5
|
+
--side-link-hover: var(--colour-canvas-2);
|
|
6
|
+
|
|
7
|
+
@media screen and (prefers-color-scheme: light) {
|
|
8
|
+
|
|
9
|
+
--side-link-hover: #eeeeee;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
display: block;
|
|
13
|
+
min-height: calc(100vh - var(--nav-height));
|
|
14
|
+
padding-top: 0!important;
|
|
15
|
+
margin-inline: auto;
|
|
16
|
+
max-width: 80rem;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
position: relative;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.container {
|
|
22
|
+
position: static;
|
|
23
|
+
min-height: 100%;
|
|
24
|
+
padding-top: 0!important;
|
|
25
|
+
padding-bottom: 0!important;
|
|
26
|
+
padding-left: 0!important;
|
|
27
|
+
|
|
28
|
+
@include media-breakpoint-up(md) {
|
|
29
|
+
|
|
30
|
+
padding-left: 5.25rem!important;
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// #region Side menu
|
|
36
|
+
.side-menu {
|
|
37
|
+
position: absolute;
|
|
38
|
+
top: 0;
|
|
39
|
+
left: 0;
|
|
40
|
+
height: 100%;
|
|
41
|
+
min-height: calc(100vh - var(--nav-height));
|
|
42
|
+
width: rem(30);
|
|
43
|
+
height: 100%;
|
|
44
|
+
background-color: var(--colour-canvas);
|
|
45
|
+
transition: width 1s;
|
|
46
|
+
|
|
47
|
+
&:before {
|
|
48
|
+
content: "";
|
|
49
|
+
position: absolute;
|
|
50
|
+
top: 0;
|
|
51
|
+
right: 0;
|
|
52
|
+
height: 100%;
|
|
53
|
+
border-right: 2px solid var(--colour-border);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@include media-breakpoint-up(sm) {
|
|
57
|
+
|
|
58
|
+
left: 0;
|
|
59
|
+
width: rem(40);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@include media-breakpoint-up(md) {
|
|
63
|
+
|
|
64
|
+
left: calc(50% - #{rem(556)});
|
|
65
|
+
margin-left: #{rem(-84)};
|
|
66
|
+
|
|
67
|
+
&:after {
|
|
68
|
+
content: "";
|
|
69
|
+
position: absolute;
|
|
70
|
+
top: 0;
|
|
71
|
+
height: 100%;
|
|
72
|
+
border-right: 2px solid var(--colour-border);
|
|
73
|
+
left: 0;
|
|
74
|
+
opacity: 1;
|
|
75
|
+
transition: all 1s;
|
|
76
|
+
//margin-left: rem(-260);
|
|
77
|
+
width: rem(40);
|
|
78
|
+
background: var(--colour-canvas);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&:not(.open).hover {
|
|
82
|
+
width: rem(344);
|
|
83
|
+
|
|
84
|
+
.btn[class*=fa-]:before {
|
|
85
|
+
content: "\f023" !important;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.btn {
|
|
91
|
+
position: absolute;
|
|
92
|
+
top: rem(32);
|
|
93
|
+
right: 0;
|
|
94
|
+
margin-bottom: 0;
|
|
95
|
+
margin-right: rem(-20);
|
|
96
|
+
background-color: var(--colour-canvas-2);
|
|
97
|
+
border: 2px solid var(--colour-border);
|
|
98
|
+
z-index: 99;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&:is(.open) {
|
|
102
|
+
|
|
103
|
+
width: calc(100% - var(--container-padding-x));
|
|
104
|
+
|
|
105
|
+
// Change icon
|
|
106
|
+
.btn[class*=fa-]:before {
|
|
107
|
+
content: "\f053"!important;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@include media-breakpoint-up(sm) {
|
|
111
|
+
|
|
112
|
+
width: rem(382);
|
|
113
|
+
}
|
|
114
|
+
@include media-breakpoint-up(md) {
|
|
115
|
+
|
|
116
|
+
width: rem(344);
|
|
117
|
+
|
|
118
|
+
.btn {
|
|
119
|
+
opacity: 0;
|
|
120
|
+
transition: opacity 0.5s;
|
|
121
|
+
|
|
122
|
+
&:is(:hover,:focus,:active) {
|
|
123
|
+
opacity: 1;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Content
|
|
130
|
+
|
|
131
|
+
.side-menu-content {
|
|
132
|
+
position: absolute;
|
|
133
|
+
top: 0;
|
|
134
|
+
right: 0;
|
|
135
|
+
padding: rem(32) rem(40) 0 0;
|
|
136
|
+
width: rem(351);
|
|
137
|
+
opacity: 0;
|
|
138
|
+
transition: opacity 1s;
|
|
139
|
+
min-height: 100%;
|
|
140
|
+
overflow: auto;
|
|
141
|
+
max-height: 100%;
|
|
142
|
+
|
|
143
|
+
&.closed {
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.h3 {
|
|
147
|
+
padding-left: rem(24);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
@include media-breakpoint-up(sm) {
|
|
151
|
+
|
|
152
|
+
.h3 {
|
|
153
|
+
padding-left: rem(40);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
width: rem(382);
|
|
157
|
+
}
|
|
158
|
+
@include media-breakpoint-up(md) {
|
|
159
|
+
|
|
160
|
+
width: rem(304);
|
|
161
|
+
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&:not(.hover):not(.open) .side-menu-content.closed {
|
|
166
|
+
|
|
167
|
+
display: none;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&.open .side-menu-content {
|
|
171
|
+
opacity: 1;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@include media-breakpoint-up(md) {
|
|
175
|
+
|
|
176
|
+
&.hover .side-menu-content {
|
|
177
|
+
opacity: 1;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Links
|
|
183
|
+
::slotted(*[slot="menu"]) {
|
|
184
|
+
padding-left: rem(24);
|
|
185
|
+
|
|
186
|
+
@include media-breakpoint-up(sm) {
|
|
187
|
+
padding-left: rem(40)!important;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
::slotted(hr) {
|
|
192
|
+
border-bottom: 2px solid var(--colour-border)!important;
|
|
193
|
+
margin-right: rem(-40)!important;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
::slotted(a[slot="menu"]) {
|
|
197
|
+
display: block;
|
|
198
|
+
|
|
199
|
+
display: block!important;
|
|
200
|
+
line-height: rem(20)!important;
|
|
201
|
+
padding: rem(16) rem(40) rem(16) rem(24)!important;
|
|
202
|
+
margin: 0!important;
|
|
203
|
+
flex-shrink: 0;
|
|
204
|
+
font-size: 1rem!important;
|
|
205
|
+
font-weight: normal!important;
|
|
206
|
+
text-decoration: none;
|
|
207
|
+
|
|
208
|
+
border-bottom: 2px solid var(--colour-border)!important;
|
|
209
|
+
|
|
210
|
+
margin-right: rem(-40)!important;
|
|
211
|
+
|
|
212
|
+
@include media-breakpoint-up(sm) {
|
|
213
|
+
padding-left: rem(40)!important;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
&:after {
|
|
217
|
+
display: none;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
border-right: 2px solid var(--colour-border)!important;
|
|
222
|
+
/*
|
|
223
|
+
&:before {
|
|
224
|
+
content: "";
|
|
225
|
+
position: absolute;
|
|
226
|
+
top: 0;
|
|
227
|
+
right: 0;
|
|
228
|
+
height: calc(100%);
|
|
229
|
+
margin-top: 0;
|
|
230
|
+
width: 2px;
|
|
231
|
+
background-color: var(--colour-border);
|
|
232
|
+
}
|
|
233
|
+
*/
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
::slotted(a[slot="menu"]:where(:hover,:focus,.selected)) {
|
|
237
|
+
|
|
238
|
+
background-color: var(--side-link-hover)!important;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
::slotted(a[slot="menu"]:active) {
|
|
242
|
+
|
|
243
|
+
background-color: var(--side-link-hover)!important;
|
|
244
|
+
font-weight: bold!important;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
::slotted(a[slot="menu"].selected) {
|
|
248
|
+
|
|
249
|
+
background-color: var(--side-link-hover)!important;
|
|
250
|
+
font-weight: bold!important;
|
|
251
|
+
margin-right: #{rem(-40)}!important;
|
|
252
|
+
position: relative;
|
|
253
|
+
|
|
254
|
+
border-right: 2px solid var(--colour-info)!important;
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
&:before {
|
|
258
|
+
content: "";
|
|
259
|
+
position: absolute;
|
|
260
|
+
top: 0;
|
|
261
|
+
right: 0;
|
|
262
|
+
height: calc(100% + 4px);
|
|
263
|
+
margin-top: -2px;
|
|
264
|
+
width: 2px;
|
|
265
|
+
border-right: 2px solid var(--colour-info);
|
|
266
|
+
margin-right: -2px;
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
@media (forced-colors: active) {
|
|
270
|
+
|
|
271
|
+
border-right: 10px solid var(--colour-info);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
// #endregion
|
|
276
|
+
|
|
277
|
+
// #region main content
|
|
278
|
+
.main-content {
|
|
279
|
+
|
|
280
|
+
padding-top: rem(24);
|
|
281
|
+
padding-left: rem(60);
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
@include media-breakpoint-up(sm) {
|
|
285
|
+
|
|
286
|
+
padding-left: rem(80);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
@include media-breakpoint-up(md) {
|
|
290
|
+
|
|
291
|
+
padding-top: rem(40)!important;
|
|
292
|
+
padding-left: 0;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
> span.h3 {
|
|
296
|
+
padding-top: 0.75rem;
|
|
297
|
+
|
|
298
|
+
border-bottom: 2px solid var(--colour-border);
|
|
299
|
+
margin-bottom: rem(40)!important;
|
|
300
|
+
|
|
301
|
+
@include media-breakpoint-up(md) {
|
|
302
|
+
|
|
303
|
+
display: none;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
::slotted(.main-content__title){
|
|
309
|
+
|
|
310
|
+
border-bottom: 2px solid var(--colour-border);
|
|
311
|
+
margin-bottom: rem(40)!important;
|
|
312
|
+
max-width: 100%!important;
|
|
313
|
+
display: block;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
@include media-breakpoint-up(md) {
|
|
317
|
+
|
|
318
|
+
.side-menu.open + .main-content {
|
|
319
|
+
|
|
320
|
+
padding-left: rem(300);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
::slotted(.main-content__title){
|
|
324
|
+
display: none;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
// #endregion
|
|
@@ -4,6 +4,17 @@
|
|
|
4
4
|
body:has(iam-nav.open:not(.nav--sticky):not(.nav--xs-sticky)) {
|
|
5
5
|
max-height: 100vh;
|
|
6
6
|
overflow: hidden;
|
|
7
|
+
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
body {
|
|
11
|
+
|
|
12
|
+
--nav-height: #{rem(96)};
|
|
13
|
+
|
|
14
|
+
&:has(iam-nav a[slot="secondary"]){
|
|
15
|
+
|
|
16
|
+
--nav-height: #{rem(96 + 40)};
|
|
17
|
+
}
|
|
7
18
|
}
|
|
8
19
|
|
|
9
20
|
// #region Create the correct padding top of the page
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
**Add the below to your initialise script**
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
import('../node_modules/@iamproperty/components/assets/js/components/collapsible-side/collapsible-side.component.min').then(module => { // Might need to update the path
|
|
5
|
+
|
|
6
|
+
if (!window.customElements.get(`iam-collapsible-side`))
|
|
7
|
+
window.customElements.define(`iam-collapsible-side`, module.default);
|
|
8
|
+
|
|
9
|
+
}).catch((err) => {
|
|
10
|
+
console.log(err.message);
|
|
11
|
+
});
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
**Add the below HTML code to where you want the component to live.**
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
<iam-collapsible-side data-title="Configuration">
|
|
18
|
+
|
|
19
|
+
<div slot="menu">
|
|
20
|
+
<label for="test1">Active branch</label>
|
|
21
|
+
<select class="form-select" name="test1" id="test1">
|
|
22
|
+
<option value="1" selected>Newcastle</option>
|
|
23
|
+
<option value="2">Two</option>
|
|
24
|
+
<option value="2">Three</option>
|
|
25
|
+
<option value="2">Four</option>
|
|
26
|
+
</select>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<hr slot="menu"/>
|
|
30
|
+
<a href="/" slot="menu">Agency settings</a>
|
|
31
|
+
<a href="/" slot="menu">Control panel</a>
|
|
32
|
+
<a href="/" slot="menu" class="selected">Contact us</a>
|
|
33
|
+
|
|
34
|
+
<h1>Inspections</h1>
|
|
35
|
+
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
|
|
36
|
+
|
|
37
|
+
</iam-collapsible-side>
|
|
38
|
+
```
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// Data layer Web component created
|
|
3
|
+
window.dataLayer = window.dataLayer || [];
|
|
4
|
+
window.dataLayer.push({
|
|
5
|
+
"event": "customElementRegistered",
|
|
6
|
+
"element": "collapsible side menu"
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
class iamCollapsibleSideMenu extends HTMLElement {
|
|
10
|
+
|
|
11
|
+
constructor(){
|
|
12
|
+
super();
|
|
13
|
+
this.attachShadow({ mode: 'open'});
|
|
14
|
+
|
|
15
|
+
const assetLocation = document.body.hasAttribute('data-assets-location') ? document.body.getAttribute('data-assets-location') : '/assets'
|
|
16
|
+
const coreCSS = document.body.hasAttribute('data-core-css') ? document.body.getAttribute('data-core-css') : `${assetLocation}/css/core.min.css`;
|
|
17
|
+
const loadCSS = `@import "${assetLocation}/css/components/collapsible-side.css";`;
|
|
18
|
+
|
|
19
|
+
const template = document.createElement('template');
|
|
20
|
+
template.innerHTML = `
|
|
21
|
+
<style class="styles">
|
|
22
|
+
@import "${coreCSS}";
|
|
23
|
+
${loadCSS}
|
|
24
|
+
${this.hasAttribute('css') ? `@import "${this.getAttribute('css')}";` : ``}
|
|
25
|
+
</style>
|
|
26
|
+
<link rel="stylesheet" href="https://kit.fontawesome.com/26fdbf0179.css" crossorigin="anonymous">
|
|
27
|
+
<div class="container">
|
|
28
|
+
|
|
29
|
+
<div class="side-menu">
|
|
30
|
+
<button class="btn btn-compact fa-chevron-right btn-secondary btn-sm">Open or close Collapsible menu</button>
|
|
31
|
+
<div class="side-menu-content closed">
|
|
32
|
+
<slot name="menu"></slot>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div class="main-content">
|
|
37
|
+
<slot></slot>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
</div>
|
|
41
|
+
`;
|
|
42
|
+
this.shadowRoot.appendChild(template.content.cloneNode(true));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
connectedCallback() {
|
|
46
|
+
|
|
47
|
+
const sideMenu = this.shadowRoot.querySelector('.side-menu');
|
|
48
|
+
const sideMenuContent = this.shadowRoot.querySelector('.side-menu-content');
|
|
49
|
+
const mainContent = this.shadowRoot.querySelector('.main-content')
|
|
50
|
+
const button = this.shadowRoot.querySelector('.side-menu > .btn');
|
|
51
|
+
|
|
52
|
+
// Load external CSS if needed
|
|
53
|
+
if(this.hasAttribute('data-css'))
|
|
54
|
+
this.shadowRoot.querySelector('.styles').insertAdjacentHTML('beforeend', `@import "${this.getAttribute('data-css')}";`);
|
|
55
|
+
|
|
56
|
+
// Set sde nav title
|
|
57
|
+
if(!this.hasAttribute('data-title'))
|
|
58
|
+
this.setAttribute('data-title','configuration')
|
|
59
|
+
|
|
60
|
+
sideMenuContent.insertAdjacentHTML('afterbegin',`<span class="h3">${this.getAttribute('data-title')}</span>`);
|
|
61
|
+
mainContent.insertAdjacentHTML('afterbegin',`<span class="h3">${this.getAttribute('data-title')}</span>`);
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
if(this.querySelector(':scope > :is(h1,h2,h3,h4,h5,h6)')){
|
|
65
|
+
this.querySelector(':scope > :is(h1,h2,h3,h4,h5,h6)').classList.add('h4');
|
|
66
|
+
this.querySelector(':scope > :is(h1,h2,h3,h4,h5,h6)').classList.add('main-content__title');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Open the menu
|
|
70
|
+
button.addEventListener('click', (event) => {
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
if(!sideMenu.classList.contains('open')){
|
|
74
|
+
|
|
75
|
+
sideMenuContent.classList.remove('closed');
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
setTimeout(function(){
|
|
79
|
+
sideMenu.classList.add('open');
|
|
80
|
+
}, 100);
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
|
|
86
|
+
sideMenu.classList.remove('open');
|
|
87
|
+
setTimeout(function(){ sideMenuContent.classList.add('closed') }, 1000); // Delay until its close so the animation is broken
|
|
88
|
+
|
|
89
|
+
// While the menu is closing dont allow the hover to re-open it until its fully closed.
|
|
90
|
+
sideMenu.classList.add('pe-none');
|
|
91
|
+
setTimeout(function(){ sideMenu.classList.remove('pe-none')}, 1000);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// Mimic hover event on desktop so that we can control when classes are set and which order
|
|
96
|
+
sideMenu.addEventListener('mouseenter', (event) => {
|
|
97
|
+
|
|
98
|
+
if(window.innerWidth > 992){
|
|
99
|
+
|
|
100
|
+
if(!sideMenu.classList.contains('open'))
|
|
101
|
+
sideMenuContent.classList.remove('closed');
|
|
102
|
+
|
|
103
|
+
sideMenu.classList.add('hover');
|
|
104
|
+
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
sideMenu.addEventListener('mousemove', (event) => {
|
|
109
|
+
|
|
110
|
+
if(window.innerWidth > 992){
|
|
111
|
+
|
|
112
|
+
if(!sideMenu.classList.contains('open'))
|
|
113
|
+
sideMenuContent.classList.remove('closed');
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
sideMenu.addEventListener('mouseleave', (event) => {
|
|
118
|
+
|
|
119
|
+
if(window.innerWidth > 992){
|
|
120
|
+
|
|
121
|
+
sideMenu.classList.remove('hover');
|
|
122
|
+
|
|
123
|
+
if(!sideMenu.classList.contains('open'))
|
|
124
|
+
setTimeout(function(){ sideMenuContent.classList.add('closed') }, 1000); // Delay until its close so the animation is broken
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export default iamCollapsibleSideMenu;
|
|
@@ -17,23 +17,6 @@ export const addBodyClasses = (body) => {
|
|
|
17
17
|
body.classList.add("ie");
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
let nav = document.querySelector('nav');
|
|
21
|
-
if(nav) {
|
|
22
|
-
let navHeight = nav.offsetHeight;
|
|
23
|
-
document.querySelector('body').style.setProperty("--nav-height", `${navHeight}px`);
|
|
24
|
-
|
|
25
|
-
function outputsize() {
|
|
26
|
-
|
|
27
|
-
navHeight = nav.offsetHeight;
|
|
28
|
-
document.querySelector('body').style.setProperty("--nav-height", `${navHeight}px`);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
new ResizeObserver(outputsize).observe(nav);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
document.querySelector('body').style.setProperty("--nav-height", `0px`);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
20
|
return null
|
|
38
21
|
}
|
|
39
22
|
|