@worksafevictoria/wcl7.5 1.10.0 → 1.12.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/package.json +1 -1
- package/src/assets/styles/generated-icons.scss +46 -46
- package/src/components/Common/CardGridItem/card-grid-item-caret.vue +40 -46
- package/src/components/Common/CardGridItem/card-grid-item-icon.vue +1 -1
- package/src/components/Common/CardGridItem/index.vue +153 -115
- package/src/components/Containers/Carousel/index.stories.js +6 -4
- package/src/components/Containers/Carousel/index.vue +131 -120
- package/src/components/Containers/HomepageHeader/index.stories.js +1 -1
- package/src/components/Containers/HomepageHeaderNew/index.stories.js +3 -15
- package/src/components/Containers/HomepageHeaderNew/index.vue +3 -7
- package/src/components/Global/AppFooter/index.vue +29 -19
- package/src/components/Global/AppHeader/ModalSearch/index.vue +7 -1
- package/src/components/Global/AppHeader/index.stories.js +2 -2
- package/src/components/Global/AppHeaderNew/ModalSearch/index.vue +21 -17
- package/src/components/Global/AppHeaderNew/includes.scss +4 -2
- package/src/components/Global/AppHeaderNew/index.stories.js +2 -2
- package/src/components/Global/AppHeaderNew/index.vue +126 -386
- package/src/components/Global/AppHeaderNew/mobile.scss +41 -6
- package/src/components/Global/AppHeaderNew/styles.scss +57 -45
- package/src/components/Global/BackToTop/index.vue +16 -16
- package/src/components/Global/ContrastMode/index.stories.js +1 -1
- package/src/components/Global/DirectoryFilters/index.vue +24 -18
- package/src/components/Global/HeroHeader/index.vue +62 -73
- package/src/components/Global/SocialShare/index.vue +114 -129
- package/src/components/Global/Strip/index.vue +43 -39
- package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +22 -24
- package/src/components/Paragraphs/Accordion/StepperItem/index.vue +15 -15
- package/src/components/Paragraphs/Calculator/CardContainer/index.vue +74 -75
- package/src/components/Paragraphs/Calculator/RiskLevel/index.vue +31 -39
- package/src/components/Paragraphs/Directory/Asbestos/Records/SingleRecord/index.vue +104 -107
- package/src/components/Paragraphs/Directory/Asbestos/Records/index.vue +129 -64
- package/src/components/Paragraphs/Directory/HSCP/Records/SingleRecord/index.vue +127 -133
- package/src/components/Paragraphs/Directory/HSCP/Records/index.vue +112 -66
- package/src/components/Paragraphs/Statistics/index.vue +9 -9
- package/src/components/Paragraphs/Tabs/index.vue +4 -4
- package/src/components/Paragraphs/TabulatedData/index.vue +27 -20
- package/src/components/SubComponents/CtaButton/index.vue +47 -44
- package/src/components/SubComponents/Icon/README.md +2 -2
- package/src/components/SubComponents/Icon/example.js +1 -0
- package/src/components/SubComponents/Icon/index.stories.js +1 -1
- package/src/components/SubComponents/Icon/index.vue +47 -47
- package/src/components/SubComponents/ResourceGroup/cardbody.vue +18 -16
- package/src/components/SubComponents/VideoThumbnail/index.vue +8 -6
- package/src/mock/carousel-items.js +46 -81
|
@@ -2,47 +2,58 @@
|
|
|
2
2
|
<div>
|
|
3
3
|
<header
|
|
4
4
|
v-if="headerMenu"
|
|
5
|
-
:class="'app-header' + (
|
|
5
|
+
:class="'app-header' + (screen === 'mobile' ? ' ' + 'isMobile' : '')"
|
|
6
6
|
>
|
|
7
7
|
<!-- Top menu -->
|
|
8
8
|
<div class="logo">
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
<!-- Mobile Menu -->
|
|
10
|
+
<div v-if="screen === 'mobile'" class="app-header__mobile-menu-container">
|
|
11
|
+
<a class="dark" role="button" @click.prevent="showMobileMenu">
|
|
12
|
+
<menu-icon class="menu-icon" />
|
|
13
|
+
</a>
|
|
14
|
+
</div>
|
|
15
|
+
<!-- Logo -->
|
|
16
|
+
<nuxt-link class="dark" to="/">
|
|
17
|
+
<img
|
|
18
|
+
:class="screen === 'mobile' ? 'LogoImgMobile' : 'LogoImg'"
|
|
19
|
+
:alt="
|
|
20
|
+
isWorkWell
|
|
21
|
+
? 'Work Well Victoria - Logo'
|
|
22
|
+
: 'Work Safe Victoria - Logo'
|
|
23
|
+
"
|
|
24
|
+
:src="isWorkWell ? WorkWellLogo : WorkSafeLogo"
|
|
25
|
+
/>
|
|
26
|
+
</nuxt-link>
|
|
27
|
+
<span :class="screen === 'mobile' ? 'logo__nav_mobile' : 'logo__nav'">
|
|
28
|
+
<!-- Roles added for accessibility -->
|
|
29
|
+
<table role="presentation" >
|
|
30
|
+
<tbody role="presentation">
|
|
31
|
+
<tr role="presentation">
|
|
32
|
+
<td :class="screen === 'mobile' ? 'td_mobile' : ''">
|
|
33
|
+
<!-- Language link -->
|
|
26
34
|
<nuxt-link
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
:class="screen === 'mobile' ? 'mobile-link' : ''"
|
|
36
|
+
to="/languages"
|
|
37
|
+
@click.native="fireAnalytics('Choose your language', '/languages')"
|
|
38
|
+
title="Language"
|
|
39
|
+
>
|
|
40
|
+
<span v-if="screen !== 'mobile'">Choose your language </span>
|
|
41
|
+
<img alt="Language Icon" width="15px" height="15px" :src=LanguageIcon />
|
|
42
|
+
</nuxt-link>
|
|
34
43
|
</td>
|
|
35
|
-
<td>
|
|
36
|
-
|
|
37
|
-
|
|
44
|
+
<td :class="screen === 'mobile' ? 'td_mobile' : ''">
|
|
45
|
+
<!-- Contrast link -->
|
|
46
|
+
<a href="javascript:void(0)" :class="screen === 'mobile' ? 'mobile-link' : ''" @click="show = !show" @keyup.esc="show = !show" title="Contrast" ref="selectContrast">
|
|
47
|
+
<span v-if="screen !== 'mobile'">Adjust contrast</span> <img alt="Contrast Icon" width="15px" height="15px" :src=ContrastIcon />
|
|
38
48
|
</a>
|
|
39
49
|
<div
|
|
50
|
+
ref="contrastChoices"
|
|
40
51
|
class="flex-container"
|
|
41
52
|
v-if="show"
|
|
42
53
|
>
|
|
43
|
-
<div class="contrast_slide--box-list">
|
|
54
|
+
<div class="flex-item contrast_slide--box-list">
|
|
44
55
|
<div v-for="list in lists" :key="list.value">
|
|
45
|
-
<label>
|
|
56
|
+
<label :class="{'last-radio': list.label==='Greyscale'}">
|
|
46
57
|
<input
|
|
47
58
|
type="radio"
|
|
48
59
|
:name="list.name"
|
|
@@ -56,20 +67,23 @@
|
|
|
56
67
|
</div>
|
|
57
68
|
</div>
|
|
58
69
|
</td>
|
|
59
|
-
<td>
|
|
70
|
+
<td :class="screen === 'mobile' ? 'td_mobile' : ''">
|
|
71
|
+
<!-- Search link -->
|
|
60
72
|
<nuxt-link
|
|
73
|
+
style="height: 40px;"
|
|
61
74
|
class="cta-button cta-button--text-only cta-button--slim"
|
|
62
75
|
to="/search"
|
|
63
76
|
title="Search"
|
|
64
|
-
><span v-if="
|
|
77
|
+
><span v-if="screen !== 'mobile'">Search </span> <img alt="Search Icon" width="15px" height="15px" :src=NavSearchIcon />
|
|
65
78
|
</nuxt-link>
|
|
66
79
|
</td>
|
|
67
|
-
<td>
|
|
80
|
+
<td :class="screen === 'mobile' ? 'td_mobile-last' : ''">
|
|
81
|
+
<!-- Login link -->
|
|
68
82
|
<nuxt-link
|
|
69
83
|
class="cta-button cta-button--text-only cta-button--slim cta-button--dark-no-filter"
|
|
70
84
|
to="/login"
|
|
71
85
|
title="Login"
|
|
72
|
-
><span v-if="
|
|
86
|
+
><span v-if="screen !== 'mobile'">Login </span><span><img alt="Login Icon" width="15px" height="15px" :src=LoginLeft /></span>
|
|
73
87
|
</nuxt-link>
|
|
74
88
|
</td>
|
|
75
89
|
</tr>
|
|
@@ -78,11 +92,12 @@
|
|
|
78
92
|
</span>
|
|
79
93
|
</div>
|
|
80
94
|
<!-- Bottom menu -->
|
|
81
|
-
<div class="app-header__wrap" @keyup.esc="closeMegaMenu">
|
|
82
|
-
<div class="app-header__close-button mobile-close">
|
|
95
|
+
<div class="app-header__wrap" :class="screen === 'mobile' ? 'app-header__wrap_mobile' : ''" @keyup.esc="closeMegaMenu">
|
|
96
|
+
<div class="app-header__close-button mobile-close">
|
|
97
|
+
<!-- Close Button -->
|
|
83
98
|
<button
|
|
84
99
|
v-if="
|
|
85
|
-
(isMobileMenuOpen &&
|
|
100
|
+
(isMobileMenuOpen && screen === 'mobile' && !isSecondLevelOpen)
|
|
86
101
|
"
|
|
87
102
|
ref="closeMenuButton"
|
|
88
103
|
class="dark"
|
|
@@ -92,19 +107,11 @@
|
|
|
92
107
|
Close menu
|
|
93
108
|
</button>
|
|
94
109
|
</div>
|
|
95
|
-
|
|
96
|
-
v-if="
|
|
97
|
-
(!isSecondLevelOpen && this.screen === 'desktop') ||
|
|
98
|
-
(!isMobileMenuOpen && this.screen === 'mobile')
|
|
99
|
-
"
|
|
100
|
-
class="app-header__app-branding"
|
|
101
|
-
>
|
|
102
|
-
|
|
103
|
-
</div>
|
|
110
|
+
<!-- Bottom menu Items -->
|
|
104
111
|
<nav
|
|
105
|
-
v-if="isMobileMenuOpen ||
|
|
112
|
+
v-if="isMobileMenuOpen || screen === 'desktop'"
|
|
106
113
|
:class="{
|
|
107
|
-
'styled-scrollbar':
|
|
114
|
+
'styled-scrollbar': screen === 'mobile' && !isSecondLevelOpen,
|
|
108
115
|
}"
|
|
109
116
|
>
|
|
110
117
|
<ul class="app-header__nav-menu" id="navitems">
|
|
@@ -128,7 +135,7 @@
|
|
|
128
135
|
>
|
|
129
136
|
<span>{{ firstLevelLink.title }}</span>
|
|
130
137
|
|
|
131
|
-
<caret-down v-if="
|
|
138
|
+
<caret-down v-if="screen === 'desktop'" class="caret-down" />
|
|
132
139
|
<caret-right
|
|
133
140
|
v-else-if="!isSecondLevelOpen && !isThirdLevelOpen"
|
|
134
141
|
class="caret-right"
|
|
@@ -150,10 +157,11 @@
|
|
|
150
157
|
>
|
|
151
158
|
<span>{{ firstLevelLink.title }}</span>
|
|
152
159
|
</nuxt-link>
|
|
160
|
+
<!-- Sub-Menu 2nd Level -->
|
|
153
161
|
<div v-if="isSecondLevelOpen" class="sub-nav-container">
|
|
154
162
|
<div class="app-header__close-button">
|
|
155
163
|
<button
|
|
156
|
-
v-if="
|
|
164
|
+
v-if="screen === 'mobile'"
|
|
157
165
|
ref="menuBackButton"
|
|
158
166
|
class="dark"
|
|
159
167
|
@click="mobileGoBack"
|
|
@@ -164,8 +172,8 @@
|
|
|
164
172
|
</button>
|
|
165
173
|
<button
|
|
166
174
|
v-if="
|
|
167
|
-
(isSecondLevelOpen &&
|
|
168
|
-
(isMobileMenuOpen &&
|
|
175
|
+
(isSecondLevelOpen && screen === 'desktop') ||
|
|
176
|
+
(isMobileMenuOpen && screen === 'mobile')
|
|
169
177
|
"
|
|
170
178
|
ref="closeMenuButton"
|
|
171
179
|
class="dark"
|
|
@@ -177,15 +185,16 @@
|
|
|
177
185
|
</div>
|
|
178
186
|
<div
|
|
179
187
|
class="sub-nav-container__inner"
|
|
180
|
-
:class="{ 'styled-scrollbar':
|
|
188
|
+
:class="{ 'styled-scrollbar': screen === 'desktop' }"
|
|
181
189
|
>
|
|
182
190
|
<div
|
|
183
191
|
class="sub-nav-container__wrap"
|
|
184
192
|
:class="{
|
|
185
193
|
'styled-scrollbar':
|
|
186
|
-
|
|
194
|
+
screen === 'mobile' && isSecondLevelOpen,
|
|
187
195
|
}"
|
|
188
196
|
>
|
|
197
|
+
<!-- Selected Title -->
|
|
189
198
|
<div
|
|
190
199
|
class="selected-title"
|
|
191
200
|
:class="{ 'selected-title--chrome': isChrome }"
|
|
@@ -202,6 +211,7 @@
|
|
|
202
211
|
</nuxt-link>
|
|
203
212
|
<span v-else>{{ firstLevelLink.title }}</span>
|
|
204
213
|
</div>
|
|
214
|
+
<!-- Selected Items -->
|
|
205
215
|
<div class="selected-items">
|
|
206
216
|
<ul v-if="firstLevelLink.below" class="sub-nav-group">
|
|
207
217
|
<li
|
|
@@ -227,7 +237,7 @@
|
|
|
227
237
|
>
|
|
228
238
|
<span>{{ secondLevelLink.title }}</span>
|
|
229
239
|
<caret-right
|
|
230
|
-
v-if="!(
|
|
240
|
+
v-if="!(screen === 'mobile' && isThirdLevelOpen)"
|
|
231
241
|
class="caret-right"
|
|
232
242
|
/>
|
|
233
243
|
</a>
|
|
@@ -251,6 +261,7 @@
|
|
|
251
261
|
>
|
|
252
262
|
<span>{{ secondLevelLink.title }}</span>
|
|
253
263
|
</nuxt-link>
|
|
264
|
+
<!-- Sub Menu - Third Level Menu -->
|
|
254
265
|
<div v-if="isThirdLevelOpen" class="sub-nav">
|
|
255
266
|
<div class="sub-nav__wrap">
|
|
256
267
|
<div class="selected-title">
|
|
@@ -310,255 +321,18 @@
|
|
|
310
321
|
</div>
|
|
311
322
|
</div>
|
|
312
323
|
</li>
|
|
313
|
-
|
|
314
|
-
<!-- More action button in bottom menu -->
|
|
315
|
-
|
|
316
|
-
<li class="nav-item" id="moreDesktop" v-if="this.screen === 'desktop' && this.moreList.length > 0">
|
|
317
|
-
<a class="dark" role="button" @click="showMore = !showMore">
|
|
318
|
-
<span>More</span>
|
|
319
|
-
<caret-down class="caret-down" style="padding-top: 4px; height: 16px; width: 16px"/>
|
|
320
|
-
</a>
|
|
321
|
-
<div
|
|
322
|
-
v-if="showMore"
|
|
323
|
-
class="styled-scrollbar"
|
|
324
|
-
>
|
|
325
|
-
<div >
|
|
326
|
-
<div class="sub-nav-container__innermore">
|
|
327
|
-
<ul id="moreMenu">
|
|
328
|
-
<li v-for="(firstLevelLink, parentIndex) in this.moreList"
|
|
329
|
-
:key="firstLevelLink.key"
|
|
330
|
-
:ref="`firstLevelMenuItemM-${parentIndex}`"
|
|
331
|
-
class="nav-item more-menu"
|
|
332
|
-
>
|
|
333
|
-
<a
|
|
334
|
-
v-if="firstLevelLink.below"
|
|
335
|
-
class="dark"
|
|
336
|
-
href
|
|
337
|
-
role="button"
|
|
338
|
-
aria-expanded="false"
|
|
339
|
-
@click.prevent="firstLevelClick(firstLevelLink,`firstLevelMenuItemM-${parentIndex}`,)"
|
|
340
|
-
@mouseover="mouseHover('firstLevelMenuItemM', parentIndex)"
|
|
341
|
-
@mouseleave="mouseLeave('firstLevelMenuItemM', parentIndex)"
|
|
342
|
-
@focusin="mouseHover('firstLevelMenuItemM', parentIndex)"
|
|
343
|
-
@focusout="mouseLeave('firstLevelMenuItemM', parentIndex)"
|
|
344
|
-
>
|
|
345
|
-
<span>{{ firstLevelLink.title }}</span>
|
|
346
|
-
|
|
347
|
-
<caret-right
|
|
348
|
-
v-if="!isSecondLevelOpen && !isThirdLevelOpen"
|
|
349
|
-
class="caret-right"
|
|
350
|
-
/>
|
|
351
|
-
</a>
|
|
352
|
-
<a
|
|
353
|
-
v-else-if="!firstLevelLink.relative"
|
|
354
|
-
:href="firstLevelLink.absolute"
|
|
355
|
-
target="_blank"
|
|
356
|
-
@click.native="showMore = !showMore"
|
|
357
|
-
class="dark"
|
|
358
|
-
>
|
|
359
|
-
<span>{{ firstLevelLink.title }}</span>
|
|
360
|
-
|
|
361
|
-
</a>
|
|
362
|
-
<nuxt-link
|
|
363
|
-
v-else
|
|
364
|
-
class="dark"
|
|
365
|
-
:to="firstLevelLink.relative"
|
|
366
|
-
@click.native="showMore = !showMore; fireAnalytics(firstLevelLink.title, firstLevelLink.relative)"
|
|
367
|
-
>
|
|
368
|
-
<span>{{ firstLevelLink.title }}</span>
|
|
369
|
-
<caret-right
|
|
370
|
-
v-if="!isSecondLevelOpen && !isThirdLevelOpen"
|
|
371
|
-
class="caret-right"
|
|
372
|
-
/>
|
|
373
|
-
</nuxt-link>
|
|
374
|
-
<div v-if="isSecondLevelOpen" class="sub-nav-container">
|
|
375
|
-
<div class="app-header__close-button">
|
|
376
|
-
<button
|
|
377
|
-
v-if="this.screen === 'mobile'"
|
|
378
|
-
ref="menuBackButton"
|
|
379
|
-
class="dark"
|
|
380
|
-
@click="mobileGoBack"
|
|
381
|
-
@keydown.tab="submenuFocus"
|
|
382
|
-
>
|
|
383
|
-
<caret-left/>
|
|
384
|
-
{{ isThirdLevelOpen ? firstLevelItemName : 'Main menu' }}
|
|
385
|
-
</button>
|
|
386
|
-
<button
|
|
387
|
-
v-if="
|
|
388
|
-
(isSecondLevelOpen && this.screen === 'desktop') ||
|
|
389
|
-
(isMobileMenuOpen && this.screen === 'mobile')
|
|
390
|
-
"
|
|
391
|
-
ref="closeMenuButton"
|
|
392
|
-
class="dark"
|
|
393
|
-
@click="closeMegaMenu"
|
|
394
|
-
>
|
|
395
|
-
<img :alt="Close" width="12" height="12" :src="Close"/>
|
|
396
|
-
Close menu
|
|
397
|
-
</button>
|
|
398
|
-
</div>
|
|
399
|
-
<div
|
|
400
|
-
class="sub-nav-container__inner"
|
|
401
|
-
:class="{ 'styled-scrollbar': this.screen === 'desktop' }"
|
|
402
|
-
>
|
|
403
|
-
<div
|
|
404
|
-
class="sub-nav-container__wrap"
|
|
405
|
-
:class="{'styled-scrollbar': this.screen === 'mobile' && isSecondLevelOpen,}"
|
|
406
|
-
>
|
|
407
|
-
<div
|
|
408
|
-
class="selected-title"
|
|
409
|
-
:class="{ 'selected-title--chrome': isChrome }"
|
|
410
|
-
>
|
|
411
|
-
<nuxt-link
|
|
412
|
-
v-if="firstLevelLink.relative"
|
|
413
|
-
:ref="`secondLevelSelectedTitleM-${parentIndex}`"
|
|
414
|
-
:to="firstLevelLink.relative"
|
|
415
|
-
class="dark"
|
|
416
|
-
@click.native="fireAnalytics(firstLevelLink.title, firstLevelLink.relative)"
|
|
417
|
-
@keydown.tab.native="backBtnFocus($event)"
|
|
418
|
-
>
|
|
419
|
-
<span>{{ firstLevelLink.title }}</span>
|
|
420
|
-
</nuxt-link>
|
|
421
|
-
<span v-else>{{ firstLevelLink.title }}</span>
|
|
422
|
-
</div>
|
|
423
|
-
<div class="selected-items">
|
|
424
|
-
<ul v-if="firstLevelLink.below" class="sub-nav-group">
|
|
425
|
-
<li
|
|
426
|
-
v-for="(
|
|
427
|
-
secondLevelLink, secondIndex
|
|
428
|
-
) in firstLevelLink.below"
|
|
429
|
-
:key="secondLevelLink.key"
|
|
430
|
-
:ref="`secondLevelMenuItemM-${parentIndex}-${secondIndex}`"
|
|
431
|
-
class="sub-nav-parent-item"
|
|
432
|
-
>
|
|
433
|
-
<a
|
|
434
|
-
v-if="secondLevelLink.below"
|
|
435
|
-
href
|
|
436
|
-
class="dark"
|
|
437
|
-
role="button"
|
|
438
|
-
aria-expanded="false"
|
|
439
|
-
@keydown.tab="searchFocus(secondIndex,firstLevelLink.below.length,$event,)"
|
|
440
|
-
@click.prevent="secondLevelClick(secondLevelLink,`secondLevelMenuItemM-${parentIndex}-${secondIndex}`,)"
|
|
441
|
-
@mouseover="mouseHover('secondLevelMenuItemM',parentIndex,secondIndex,)"
|
|
442
|
-
@mouseleave="mouseLeave('secondLevelMenuItemM',parentIndex,secondIndex,)"
|
|
443
|
-
@focusin="mouseHover('secondLevelMenuItemM',parentIndex,secondIndex,)"
|
|
444
|
-
@focusout="mouseLeave('secondLevelMenuItemM',parentIndex,secondIndex,)"
|
|
445
|
-
>
|
|
446
|
-
<span>{{ secondLevelLink.title }}</span>
|
|
447
|
-
<caret-right
|
|
448
|
-
v-if="!(this.screen === 'mobile' && isThirdLevelOpen)"
|
|
449
|
-
class="caret-right"
|
|
450
|
-
/>
|
|
451
|
-
</a>
|
|
452
|
-
<a
|
|
453
|
-
v-else-if="!secondLevelLink.relative"
|
|
454
|
-
:href="secondLevelLink.absolute"
|
|
455
|
-
class="dark"
|
|
456
|
-
>
|
|
457
|
-
<span>{{ secondLevelLink.title }}</span>
|
|
458
|
-
</a>
|
|
459
|
-
<nuxt-link
|
|
460
|
-
v-else
|
|
461
|
-
class="dark"
|
|
462
|
-
:to="secondLevelLink.relative"
|
|
463
|
-
@keydown.tab.native="searchFocus( secondIndex,firstLevelLink.below.length,$event,)"
|
|
464
|
-
@mouseover.native="mouseHover('secondLevelMenuItemM',parentIndex,secondIndex,)"
|
|
465
|
-
@mouseleave.native="mouseLeave('secondLevelMenuItemM',parentIndex,secondIndex,)"
|
|
466
|
-
@focusin.native="mouseHover('secondLevelMenuItemM',parentIndex,secondIndex,)"
|
|
467
|
-
@focusout.native="mouseLeave('secondLevelMenuItemM',parentIndex,secondIndex,)"
|
|
468
|
-
@click.native="fireAnalytics(secondLevelLink.title, secondLevelLink.relative)"
|
|
469
|
-
>
|
|
470
|
-
<span>{{ secondLevelLink.title }}</span>
|
|
471
|
-
</nuxt-link>
|
|
472
|
-
<div v-if="isThirdLevelOpen" class="sub-nav">
|
|
473
|
-
<div class="sub-nav__wrap">
|
|
474
|
-
<div class="selected-title">
|
|
475
|
-
<nuxt-link
|
|
476
|
-
v-if="secondLevelLink.relative"
|
|
477
|
-
:ref="`secondLevelSelectedTitleM-${parentIndex}-${secondIndex}`"
|
|
478
|
-
:to="secondLevelLink.relative"
|
|
479
|
-
class="dark"
|
|
480
|
-
@click.native="fireAnalytics(secondLevelLink.title, secondLevelLink.relative)"
|
|
481
|
-
@keydown.tab.native="backBtnFocus($event)"
|
|
482
|
-
>
|
|
483
|
-
<span>{{ secondLevelLink.title }}</span>
|
|
484
|
-
</nuxt-link>
|
|
485
|
-
<span v-else>{{ secondLevelLink.title }}</span>
|
|
486
|
-
</div>
|
|
487
|
-
<div class="selected-sub-nav">
|
|
488
|
-
<ul
|
|
489
|
-
v-if="secondLevelLink.below"
|
|
490
|
-
class="sub-nav-group"
|
|
491
|
-
>
|
|
492
|
-
<li
|
|
493
|
-
v-for="(
|
|
494
|
-
thirdLevelLink, thirdIndex
|
|
495
|
-
) in secondLevelLink.below"
|
|
496
|
-
:key="thirdLevelLink.key"
|
|
497
|
-
:ref="`thirdLevelMenuItemM-${parentIndex}-${secondIndex}-${thirdIndex}`"
|
|
498
|
-
>
|
|
499
|
-
<nuxt-link
|
|
500
|
-
v-if="thirdLevelLink.relative"
|
|
501
|
-
class="dark"
|
|
502
|
-
:to="thirdLevelLink.relative"
|
|
503
|
-
@keydown.tab.native="searchFocus(thirdIndex,secondLevelLink.below.length,$event,)"
|
|
504
|
-
@mouseover.native="mouseHover('thirdLevelMenuItemM',parentIndex,secondIndex,thirdIndex,)"
|
|
505
|
-
@mouseleave.native="mouseLeave('thirdLevelMenuItemM',parentIndex,secondIndex,thirdIndex,)"
|
|
506
|
-
@focusin.native="mouseHover('thirdLevelMenuItemM',parentIndex,secondIndex,thirdIndex,)"
|
|
507
|
-
@focusout.native="mouseLeave('thirdLevelMenuItemM',parentIndex,secondIndex,thirdIndex,)"
|
|
508
|
-
@click.native="fireAnalytics(thirdLevelLink.title, thirdLevelLink.relative)"
|
|
509
|
-
>
|
|
510
|
-
<span>{{ thirdLevelLink.title }}</span>
|
|
511
|
-
</nuxt-link>
|
|
512
|
-
<a
|
|
513
|
-
v-else
|
|
514
|
-
class="dark"
|
|
515
|
-
:href="thirdLevelLink.absolute"
|
|
516
|
-
>
|
|
517
|
-
<span>{{ thirdLevelLink.title }}</span>
|
|
518
|
-
</a>
|
|
519
|
-
</li>
|
|
520
|
-
</ul>
|
|
521
|
-
</div>
|
|
522
|
-
</div>
|
|
523
|
-
</div>
|
|
524
|
-
</li>
|
|
525
|
-
</ul>
|
|
526
|
-
</div>
|
|
527
|
-
</div>
|
|
528
|
-
</div>
|
|
529
|
-
</div>
|
|
530
|
-
</li>
|
|
531
|
-
</ul>
|
|
532
|
-
</div>
|
|
533
|
-
</div>
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
</div>
|
|
537
|
-
</li>
|
|
538
|
-
<li v-if="isWorkWell && this.screen === 'desktop'" class="nav-item hide">
|
|
324
|
+
<li v-if="isWorkWell && screen === 'desktop'" class="nav-item hide">
|
|
539
325
|
<a href="#" class="dark" @focus="resetTab"></a>
|
|
540
326
|
</li>
|
|
541
|
-
</ul>
|
|
542
|
-
|
|
543
|
-
|
|
327
|
+
</ul>
|
|
544
328
|
</nav>
|
|
545
|
-
<div v-if="this.screen === 'mobile'" class="app-header__mobile-menu-container">
|
|
546
|
-
<ul id="mobileitems">
|
|
547
|
-
<li v-if="!isMobileMenuOpen">
|
|
548
|
-
<a class="dark" role="button" @click.prevent="showMobileMenu">
|
|
549
|
-
<span>Menu</span>
|
|
550
|
-
<menu-icon class="menu-icon" />
|
|
551
|
-
</a>
|
|
552
|
-
</li>
|
|
553
|
-
</ul>
|
|
554
|
-
</div>
|
|
555
329
|
</div>
|
|
556
330
|
</header>
|
|
557
331
|
</div>
|
|
558
332
|
</template>
|
|
559
333
|
|
|
560
334
|
<script>
|
|
561
|
-
|
|
335
|
+
|
|
562
336
|
import Close from './../../../assets/icons/close.svg?url'
|
|
563
337
|
import WorkSafeLogo from './../../../assets/icons/WSV-reversed.svg?url'
|
|
564
338
|
import WorkWellLogo from './../../../assets/icons/AppFooter/logo-workwell-reversed.svg?url'
|
|
@@ -578,16 +352,11 @@ import { ref } from "vue";
|
|
|
578
352
|
export default {
|
|
579
353
|
setup() {
|
|
580
354
|
const show = ref(false);
|
|
581
|
-
const showMore = ref(false);
|
|
582
|
-
const moreList = [];
|
|
583
355
|
return {
|
|
584
356
|
show,
|
|
585
|
-
showMore,
|
|
586
|
-
moreList
|
|
587
357
|
};
|
|
588
358
|
},
|
|
589
359
|
components: {
|
|
590
|
-
ModalSearch,
|
|
591
360
|
Close,
|
|
592
361
|
CaretRight,
|
|
593
362
|
CaretDown,
|
|
@@ -618,8 +387,6 @@ export default {
|
|
|
618
387
|
data() {
|
|
619
388
|
return {
|
|
620
389
|
screen: null,
|
|
621
|
-
topLevelIconsOnly: false,
|
|
622
|
-
topLevelButtonIconsOnly: false,
|
|
623
390
|
isMobileMenuOpen: false,
|
|
624
391
|
isSecondLevelOpen: false,
|
|
625
392
|
isThirdLevelOpen: false,
|
|
@@ -661,6 +428,9 @@ export default {
|
|
|
661
428
|
selectedValue: null
|
|
662
429
|
}
|
|
663
430
|
},
|
|
431
|
+
|
|
432
|
+
emits: ['handleContrast'],
|
|
433
|
+
|
|
664
434
|
computed: {
|
|
665
435
|
showSecondLevelCaret() {
|
|
666
436
|
return (
|
|
@@ -690,29 +460,23 @@ export default {
|
|
|
690
460
|
this.isMobileMenuOpen = true
|
|
691
461
|
}
|
|
692
462
|
}
|
|
693
|
-
// added code to check if val < 760, when top menu should revert to icons, not labels.
|
|
694
|
-
if (val < 760) {
|
|
695
|
-
this.topLevelIconsOnly = true
|
|
696
|
-
} else {
|
|
697
|
-
this.topLevelIconsOnly = false
|
|
698
|
-
}
|
|
699
|
-
if (val < 500) {
|
|
700
|
-
this.topLevelButtonIconsOnly = true
|
|
701
|
-
} else {
|
|
702
|
-
this.topLevelButtonIconsOnly = false
|
|
703
|
-
}
|
|
704
|
-
this.updateMoreMenu(val)
|
|
705
463
|
},
|
|
706
464
|
},
|
|
707
465
|
mounted() {
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
466
|
+
|
|
467
|
+
let selectedMode = document
|
|
468
|
+
.getElementById('contrastStyle')
|
|
469
|
+
?.getAttribute('data-sel')
|
|
470
|
+
this.selectedValue = selectedMode ?? 'default'
|
|
471
|
+
window.addEventListener('click', this.handleOutsideClick)
|
|
472
|
+
window.addEventListener('scroll', this.resetContrast)
|
|
473
|
+
},
|
|
474
|
+
beforeDestroy() {
|
|
475
|
+
window.removeEventListener('click', this.handleOutsideClick)
|
|
476
|
+
window.removeEventListener('scroll', this.resetContrast)
|
|
712
477
|
},
|
|
713
478
|
destroyed() {
|
|
714
|
-
window.removeEventListener('resize', this.screenWidth)
|
|
715
|
-
window.removeEventListener('resize', this.updateMoreMenu)
|
|
479
|
+
window.removeEventListener('resize', this.screenWidth);
|
|
716
480
|
},
|
|
717
481
|
created() {
|
|
718
482
|
if (typeof window !== 'undefined' && window) {
|
|
@@ -732,64 +496,29 @@ export default {
|
|
|
732
496
|
screenWidth() {
|
|
733
497
|
this.windowWidth = window.innerWidth;
|
|
734
498
|
},
|
|
735
|
-
updateMoreMenu(screenVal) {
|
|
736
|
-
const nItems = document.getElementById('navitems')
|
|
737
|
-
var scrollWidth = nItems?.scrollWidth
|
|
738
|
-
|
|
739
|
-
if (scrollWidth > this.windowWidth) {
|
|
740
|
-
scrollWidth = scrollWidth + this.addWidth
|
|
741
|
-
|
|
742
|
-
while (scrollWidth > this.windowWidth) {
|
|
743
|
-
if ( this.headerMenu.length > 1) { // check that there's more than one item in header
|
|
744
|
-
var tempItem = this.headerMenu.pop()
|
|
745
|
-
this.moreList.unshift(tempItem)
|
|
746
|
-
scrollWidth = scrollWidth - tempItem.title.length
|
|
747
|
-
} else {
|
|
748
|
-
scrollWidth = this.windowWidth
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
} else if ( this.moreList.length > 0 ) {
|
|
752
|
-
let tempWidth = scrollWidth
|
|
753
|
-
let ctr = 1
|
|
754
|
-
while (ctr <= this.moreList.length) {
|
|
755
|
-
var tempItem1 = this.moreList[0]
|
|
756
|
-
tempWidth = tempWidth + tempItem1.title.length
|
|
757
|
-
if (tempWidth > this.windoWidth) { //stop if newWidth would be greater than the windowWidth
|
|
758
|
-
ctr = this.moreList.length
|
|
759
|
-
} else { // move item fron dropdownArray to headerArray
|
|
760
|
-
var tempItem2 = this.moreList.shift()
|
|
761
|
-
this.headerMenu.push(tempItem2)
|
|
762
|
-
scrollWidth = tempWidth
|
|
763
|
-
}
|
|
764
|
-
ctr++
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
},
|
|
768
499
|
firstLevelClick(item, ref) {
|
|
769
500
|
// Reset screen to fix whitespace
|
|
770
|
-
if (window && window.scrollTo && this.screen ===
|
|
771
|
-
window.scrollTo(0, 0)
|
|
501
|
+
if (window && window.scrollTo && this.screen === "desktop") {
|
|
502
|
+
window.scrollTo(0, 0);
|
|
772
503
|
}
|
|
773
504
|
|
|
774
|
-
let selectedItem = this.$refs[ref][0]
|
|
775
|
-
let previouslyOpenItem = this.getActiveParent()
|
|
505
|
+
let selectedItem = this.$refs[ref][0];
|
|
506
|
+
let previouslyOpenItem = this.getActiveParent();
|
|
776
507
|
|
|
777
508
|
// Set this for mobile
|
|
778
|
-
this.firstLevelItemName = item.title
|
|
779
|
-
this.firstLevelItemRef = ref
|
|
780
|
-
|
|
509
|
+
this.firstLevelItemName = item.title;
|
|
510
|
+
this.firstLevelItemRef = ref;
|
|
511
|
+
|
|
781
512
|
// Set the first item to the variable
|
|
782
513
|
if (previouslyOpenItem.length) {
|
|
783
|
-
previouslyOpenItem = previouslyOpenItem[0]
|
|
514
|
+
previouslyOpenItem = previouslyOpenItem[0];
|
|
784
515
|
}
|
|
785
516
|
// If the menu is not open, open it
|
|
786
517
|
if (item.below && this.isSecondLevelOpen === false) {
|
|
787
|
-
selectedItem.classList.add(
|
|
788
|
-
selectedItem
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
this.isSecondLevelOpen = true
|
|
792
|
-
this.letBodyOverflow(false)
|
|
518
|
+
selectedItem.classList.add("isActiveParent");
|
|
519
|
+
selectedItem.getElementsByTagName("a")[0].setAttribute("aria-expanded", "true");
|
|
520
|
+
this.isSecondLevelOpen = true;
|
|
521
|
+
this.letBodyOverflow(false);
|
|
793
522
|
}
|
|
794
523
|
// If the menu is already open and the same item is clicked,
|
|
795
524
|
// close it
|
|
@@ -798,33 +527,29 @@ export default {
|
|
|
798
527
|
this.isSecondLevelOpen === true &&
|
|
799
528
|
selectedItem === previouslyOpenItem
|
|
800
529
|
) {
|
|
801
|
-
selectedItem.classList.remove(
|
|
802
|
-
selectedItem
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
this.isSecondLevelOpen = false
|
|
806
|
-
this.letBodyOverflow(true)
|
|
530
|
+
selectedItem.classList.remove("isActiveParent");
|
|
531
|
+
selectedItem.getElementsByTagName("a")[0].setAttribute("aria-expanded", "false");
|
|
532
|
+
this.isSecondLevelOpen = false;
|
|
533
|
+
this.letBodyOverflow(true);
|
|
807
534
|
}
|
|
808
535
|
// If the link has no children then go to that page
|
|
809
536
|
else if (!item.below) {
|
|
810
|
-
if (item.relative !==
|
|
811
|
-
this.$router.push(item.relative)
|
|
537
|
+
if (item.relative !== "/") {
|
|
538
|
+
this.$router.push(item.relative);
|
|
812
539
|
}
|
|
813
540
|
}
|
|
814
541
|
// Otherwise just remove the existing open menu and add
|
|
815
542
|
// the isActive class on the new selected item
|
|
816
543
|
else {
|
|
817
|
-
previouslyOpenItem.classList.remove(
|
|
818
|
-
selectedItem.classList.add(
|
|
544
|
+
previouslyOpenItem.classList.remove("isActiveParent");
|
|
545
|
+
selectedItem.classList.add("isActiveParent");
|
|
819
546
|
previouslyOpenItem
|
|
820
|
-
.getElementsByTagName(
|
|
821
|
-
.setAttribute(
|
|
822
|
-
selectedItem
|
|
823
|
-
.getElementsByTagName('a')[0]
|
|
824
|
-
.setAttribute('aria-expanded', 'true')
|
|
547
|
+
.getElementsByTagName("a")[0]
|
|
548
|
+
.setAttribute("aria-expanded", "false");
|
|
549
|
+
selectedItem.getElementsByTagName("a")[0].setAttribute("aria-expanded", "true");
|
|
825
550
|
}
|
|
826
|
-
if (this.screen ===
|
|
827
|
-
this.focusOnNext(selectedItem)
|
|
551
|
+
if (this.screen === "mobile") {
|
|
552
|
+
this.focusOnNext(selectedItem);
|
|
828
553
|
}
|
|
829
554
|
},
|
|
830
555
|
secondLevelClick(item, ref) {
|
|
@@ -888,7 +613,6 @@ export default {
|
|
|
888
613
|
|
|
889
614
|
this.isMobileMenuOpen = true
|
|
890
615
|
this.letBodyOverflow(false)
|
|
891
|
-
// this.showMore = false
|
|
892
616
|
this.$nextTick(() => {
|
|
893
617
|
this.$refs['firstLevelMenuItem-0'][0].firstElementChild.focus()
|
|
894
618
|
})
|
|
@@ -1112,8 +836,18 @@ export default {
|
|
|
1112
836
|
goToLocation(path) {
|
|
1113
837
|
this.$router.push(path)
|
|
1114
838
|
},
|
|
839
|
+
handleOutsideClick(event) {
|
|
840
|
+
const contentChoices = this.$refs.contrastChoices
|
|
841
|
+
const contentSelect = this.$refs.selectContrast
|
|
842
|
+
|
|
843
|
+
// Check if the click is outside the content - both radios and Adjust contrast link
|
|
844
|
+
if ((contentChoices && !contentChoices.contains(event.target)) && (contentSelect && !contentSelect.contains(event.target))) {
|
|
845
|
+
this.show = !this.show
|
|
846
|
+
}
|
|
847
|
+
},
|
|
1115
848
|
handleContrast(event) {
|
|
1116
849
|
const selMode = event.target.value
|
|
850
|
+
this.selectedValue = selMode
|
|
1117
851
|
// the css we are going to inject
|
|
1118
852
|
let cssVar = ''
|
|
1119
853
|
if (selMode === 'high_contrast') {
|
|
@@ -1165,7 +899,13 @@ export default {
|
|
|
1165
899
|
style.setAttribute('data-sel', selMode) // Set a data attribute on the style element
|
|
1166
900
|
// panel collapsing after making selection
|
|
1167
901
|
this.show = !this.show
|
|
1168
|
-
}
|
|
902
|
+
},
|
|
903
|
+
resetContrast() {
|
|
904
|
+
if (this.show) {
|
|
905
|
+
this.show = !this.show
|
|
906
|
+
}
|
|
907
|
+
},
|
|
908
|
+
|
|
1169
909
|
},
|
|
1170
910
|
}
|
|
1171
911
|
</script>
|