@worksafevictoria/wcl7.5 1.3.0 → 1.5.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/lib/utility.js +1 -1
- package/package.json +1 -2
- package/src/components/Common/CardGrid/index.vue +17 -2
- package/src/components/Common/CardGridItem/index.vue +20 -10
- package/src/components/Containers/Carousel/index.stories.js +30 -0
- package/src/components/Containers/Carousel/index.vue +165 -0
- package/src/components/Containers/HomepageHeaderNew/index.stories.js +75 -0
- package/src/components/Containers/HomepageHeaderNew/index.vue +198 -0
- package/src/components/Containers/Subheader/index.vue +8 -2
- package/src/components/Global/AppFooter/index.vue +30 -28
- package/src/components/Global/AppHeader/index.vue +9 -10
- package/src/components/Global/AppHeaderNew/index.vue +313 -242
- package/src/components/Global/AppHeaderNew/styles.scss +26 -0
- package/src/components/Global/ContrastMode/index.vue +1 -1
- package/src/components/Global/Cookies/index.vue +7 -0
- package/src/components/Global/HeroHeader/index.vue +12 -13
- package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +21 -17
- package/src/components/Paragraphs/BrowseContent/index.vue +1 -5
- package/src/components/Paragraphs/Directory/Records/ISP/index.vue +2 -2
- package/src/components/Paragraphs/ListGroup/index.vue +55 -46
- package/src/components/Paragraphs/Statistics/index.vue +1 -0
- package/src/components/Paragraphs/TabbedCards/index.vue +42 -38
- package/src/components/SubComponents/CardGroup/index.vue +33 -27
- package/src/components/SubComponents/CtaButton/index.vue +27 -25
- package/src/components/SubComponents/ResourceGroup/index.vue +13 -4
- package/src/includes/scss/mixins/src/grid.scss +4 -2
- package/src/includes/scss/mixins/src/units.scss +25 -4
- package/src/mock/app-header-new.js +27 -15
- package/src/mock/carousel-items.js +57 -0
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
&__wrap {
|
|
12
12
|
position: relative;
|
|
13
|
+
white-space: nowrap;
|
|
14
|
+
overflow-y: scroll;
|
|
13
15
|
background: $app-header-background-colour;
|
|
14
16
|
border-radius: 3px;
|
|
15
17
|
height: 70px;
|
|
@@ -111,6 +113,7 @@
|
|
|
111
113
|
margin-right: 0;
|
|
112
114
|
}
|
|
113
115
|
|
|
116
|
+
|
|
114
117
|
.search-string {
|
|
115
118
|
@media screen and (max-width: 1065px) and (min-width: 981px) {
|
|
116
119
|
display: none;
|
|
@@ -206,6 +209,19 @@
|
|
|
206
209
|
position: relative;
|
|
207
210
|
}
|
|
208
211
|
|
|
212
|
+
&__innermore {
|
|
213
|
+
overflow-x: auto;
|
|
214
|
+
height: max-content;
|
|
215
|
+
left: 25px;
|
|
216
|
+
right: 25px;
|
|
217
|
+
top: 180px;
|
|
218
|
+
position: fixed;
|
|
219
|
+
padding-top: 15px !important;
|
|
220
|
+
background-color: $app-menu-black !important;
|
|
221
|
+
border-radius: 3px;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
|
|
209
225
|
&__wrap {
|
|
210
226
|
position: relative;
|
|
211
227
|
margin: 0 auto;
|
|
@@ -232,9 +248,11 @@
|
|
|
232
248
|
|
|
233
249
|
&:last-of-type {
|
|
234
250
|
> a {
|
|
251
|
+
|
|
235
252
|
svg {
|
|
236
253
|
height: 23px;
|
|
237
254
|
width: 23px;
|
|
255
|
+
|
|
238
256
|
}
|
|
239
257
|
& > span {
|
|
240
258
|
margin-right: 10px;
|
|
@@ -342,6 +360,7 @@
|
|
|
342
360
|
|
|
343
361
|
.styled-scrollbar {
|
|
344
362
|
overflow-y: scroll;
|
|
363
|
+
white-space: normal !important;
|
|
345
364
|
//firefox
|
|
346
365
|
scrollbar-color: $app-header-active $app-menu-black;
|
|
347
366
|
scrollbar-width: thin;
|
|
@@ -365,6 +384,13 @@
|
|
|
365
384
|
left: -9999px !important;
|
|
366
385
|
}
|
|
367
386
|
}
|
|
387
|
+
|
|
388
|
+
.more-menu {
|
|
389
|
+
height: 56px;
|
|
390
|
+
vertical-align: middle;
|
|
391
|
+
padding: 0px 10px !important;
|
|
392
|
+
}
|
|
393
|
+
|
|
368
394
|
.skip-link {
|
|
369
395
|
@include visually-hidden;
|
|
370
396
|
color: $app-menu-black;
|
|
@@ -281,22 +281,21 @@ export default {
|
|
|
281
281
|
// }
|
|
282
282
|
},
|
|
283
283
|
mounted() {
|
|
284
|
-
if (this.$
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
// })
|
|
284
|
+
if (this.$bus) {
|
|
285
|
+
this.$bus.$on('scrollToTop', () => {
|
|
286
|
+
setTimeout(() => {
|
|
287
|
+
const title = this.$refs.title
|
|
288
|
+
if (title) {
|
|
289
|
+
title.$el.setAttribute('tabindex', 0)
|
|
290
|
+
title.$el.focus()
|
|
291
|
+
}
|
|
292
|
+
}, 500)
|
|
293
|
+
})
|
|
295
294
|
}
|
|
296
295
|
},
|
|
297
296
|
beforeDestroy() {
|
|
298
|
-
if (this.$
|
|
299
|
-
this.$
|
|
297
|
+
if (this.$bus) {
|
|
298
|
+
this.$bus.$off('scrollToTop')
|
|
300
299
|
}
|
|
301
300
|
},
|
|
302
301
|
methods: {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
class="accordion-item"
|
|
7
7
|
:class="{
|
|
8
8
|
rtl: rtl,
|
|
9
|
-
'--with-pre-heading': preHeading && showPreHeading
|
|
9
|
+
'--with-pre-heading': preHeading && showPreHeading,
|
|
10
10
|
}"
|
|
11
11
|
>
|
|
12
12
|
<a
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
:icon-alt="'collapse'"
|
|
34
34
|
:glyph="CaretUp"
|
|
35
35
|
:class="{
|
|
36
|
-
'--with-pre-heading': preHeading && showPreHeading
|
|
36
|
+
'--with-pre-heading': preHeading && showPreHeading,
|
|
37
37
|
}"
|
|
38
38
|
/>
|
|
39
39
|
<icon
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
:icon-alt="'expand'"
|
|
45
45
|
:glyph="CaretDown"
|
|
46
46
|
:class="{
|
|
47
|
-
'--with-pre-heading': preHeading && showPreHeading
|
|
47
|
+
'--with-pre-heading': preHeading && showPreHeading,
|
|
48
48
|
}"
|
|
49
49
|
/>
|
|
50
50
|
</a>
|
|
@@ -76,42 +76,42 @@ export default {
|
|
|
76
76
|
RichText,
|
|
77
77
|
Icon,
|
|
78
78
|
BCard,
|
|
79
|
-
BCardBody
|
|
79
|
+
BCardBody,
|
|
80
80
|
},
|
|
81
81
|
props: {
|
|
82
82
|
title: {
|
|
83
83
|
type: String,
|
|
84
|
-
default: 'Item'
|
|
84
|
+
default: 'Item',
|
|
85
85
|
},
|
|
86
86
|
preHeading: {
|
|
87
87
|
type: String,
|
|
88
|
-
default: 'PRE-HEADING'
|
|
88
|
+
default: 'PRE-HEADING',
|
|
89
89
|
},
|
|
90
90
|
content: {
|
|
91
91
|
type: String,
|
|
92
|
-
default: null
|
|
92
|
+
default: null,
|
|
93
93
|
},
|
|
94
94
|
rtl: {
|
|
95
95
|
type: Boolean,
|
|
96
|
-
default: false
|
|
96
|
+
default: false,
|
|
97
97
|
},
|
|
98
98
|
open: {
|
|
99
99
|
type: Boolean,
|
|
100
|
-
default: false
|
|
100
|
+
default: false,
|
|
101
101
|
},
|
|
102
102
|
showPreHeading: {
|
|
103
103
|
type: Boolean,
|
|
104
|
-
default: false
|
|
104
|
+
default: false,
|
|
105
105
|
},
|
|
106
106
|
meta: {
|
|
107
107
|
type: Array,
|
|
108
|
-
default: () => []
|
|
109
|
-
}
|
|
108
|
+
default: () => [],
|
|
109
|
+
},
|
|
110
110
|
},
|
|
111
111
|
data: () => ({
|
|
112
112
|
showAccordion: false,
|
|
113
113
|
CaretDown,
|
|
114
|
-
CaretUp
|
|
114
|
+
CaretUp,
|
|
115
115
|
}),
|
|
116
116
|
mounted() {
|
|
117
117
|
this.$nextTick(() => {
|
|
@@ -122,12 +122,16 @@ export default {
|
|
|
122
122
|
toggleAccordion() {
|
|
123
123
|
this.showAccordion = !this.showAccordion
|
|
124
124
|
if (this.showAccordion) {
|
|
125
|
-
this.$
|
|
125
|
+
if (this.$bus) {
|
|
126
|
+
this.$bus.$emit('accordionItemOpen', this.meta) // this.$root.$emit('accordionItemOpen', this.meta)
|
|
127
|
+
}
|
|
126
128
|
} else {
|
|
127
|
-
this.$
|
|
129
|
+
if (this.$bus) {
|
|
130
|
+
this.$bus.$emit('accordionItemClose', this.meta) // this.$root.$emit('accordionItemClose', this.meta)
|
|
131
|
+
}
|
|
128
132
|
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
133
|
+
},
|
|
134
|
+
},
|
|
131
135
|
}
|
|
132
136
|
</script>
|
|
133
137
|
|
|
@@ -166,12 +166,8 @@ export default {
|
|
|
166
166
|
return allCards
|
|
167
167
|
},
|
|
168
168
|
async loadMoreCards(init) {
|
|
169
|
-
// Preference pinia
|
|
170
169
|
const attrs = {
|
|
171
|
-
group: this.$
|
|
172
|
-
? this.$pinia?.state?.value?.page?.content?.title
|
|
173
|
-
: this.$store?.state?.page?.content?.title,
|
|
174
|
-
// group: this.$store?.state?.page?.content?.title ? this.$store?.state?.page?.content?.title : this.$pinia?.state?.page?.content?.title
|
|
170
|
+
group: this.$pageStore?.content?.title,
|
|
175
171
|
}
|
|
176
172
|
if (this.$gtm && !init) {
|
|
177
173
|
this.$gtm.push({ event: 'custom.interaction.showmore.click', ...attrs })
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
<column class="contact">
|
|
14
14
|
<div>Phone</div>
|
|
15
15
|
<a :href="`tel:${item.contact.mobile || item.contact.phone}`"
|
|
16
|
-
><span class="sr-only">Phone number</span
|
|
16
|
+
><span class="sr-only visually-hidden">Phone number</span
|
|
17
17
|
>{{ item.contact.mobile || item.contact.phone }}</a
|
|
18
18
|
>
|
|
19
19
|
</column>
|
|
20
20
|
<column v-if="baseLocation && recordLocation" class="distance">
|
|
21
21
|
<div>Distance</div>
|
|
22
22
|
<div tabindex="0">
|
|
23
|
-
<span class="sr-only">Distance from your specified location</span>
|
|
23
|
+
<span class="sr-only visually-hidden">Distance from your specified location</span>
|
|
24
24
|
{{
|
|
25
25
|
calcDistance(
|
|
26
26
|
baseLocation.lat,
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
:taxonomies="{
|
|
49
49
|
industry: card.industry,
|
|
50
50
|
topic: card.topic,
|
|
51
|
-
language: card.language
|
|
51
|
+
language: card.language,
|
|
52
52
|
}"
|
|
53
53
|
/>
|
|
54
54
|
</template>
|
|
@@ -69,7 +69,7 @@ import RichText from './../../Paragraphs/RichText/index.vue'
|
|
|
69
69
|
import {
|
|
70
70
|
isAbsoluteUrl,
|
|
71
71
|
navigateToPath,
|
|
72
|
-
isGovSite
|
|
72
|
+
isGovSite,
|
|
73
73
|
} from './../../../../lib/utility'
|
|
74
74
|
|
|
75
75
|
export default {
|
|
@@ -80,48 +80,48 @@ export default {
|
|
|
80
80
|
type: Array,
|
|
81
81
|
default() {
|
|
82
82
|
return []
|
|
83
|
-
}
|
|
83
|
+
},
|
|
84
84
|
},
|
|
85
85
|
role: {
|
|
86
86
|
type: String,
|
|
87
|
-
default: 'button'
|
|
87
|
+
default: 'button',
|
|
88
88
|
},
|
|
89
89
|
darkBackground: {
|
|
90
90
|
type: Boolean,
|
|
91
|
-
default: false
|
|
91
|
+
default: false,
|
|
92
92
|
},
|
|
93
93
|
title: {
|
|
94
94
|
type: String,
|
|
95
|
-
default: ''
|
|
95
|
+
default: '',
|
|
96
96
|
},
|
|
97
97
|
titleTag: {
|
|
98
98
|
type: String,
|
|
99
|
-
default: 'h3'
|
|
99
|
+
default: 'h3',
|
|
100
100
|
},
|
|
101
101
|
subHeading: {
|
|
102
102
|
type: String,
|
|
103
|
-
default: null
|
|
103
|
+
default: null,
|
|
104
104
|
},
|
|
105
105
|
footerHeading: {
|
|
106
106
|
type: String,
|
|
107
|
-
default: null
|
|
107
|
+
default: null,
|
|
108
108
|
},
|
|
109
109
|
rtl: {
|
|
110
110
|
type: Boolean,
|
|
111
|
-
default: false
|
|
111
|
+
default: false,
|
|
112
112
|
},
|
|
113
113
|
showListItemNavigationArrow: {
|
|
114
114
|
type: Boolean,
|
|
115
|
-
default: false
|
|
115
|
+
default: false,
|
|
116
116
|
},
|
|
117
117
|
showLargeSpacing: {
|
|
118
118
|
type: Boolean,
|
|
119
|
-
default: false
|
|
119
|
+
default: false,
|
|
120
120
|
},
|
|
121
121
|
showListLink: {
|
|
122
122
|
type: Boolean,
|
|
123
|
-
default: false
|
|
124
|
-
}
|
|
123
|
+
default: false,
|
|
124
|
+
},
|
|
125
125
|
},
|
|
126
126
|
methods: {
|
|
127
127
|
getCaret(card) {
|
|
@@ -138,37 +138,43 @@ export default {
|
|
|
138
138
|
// Some custom logic for gov caretaker logic
|
|
139
139
|
if (process.env.CARETAKER && process.env.CARETAKER === 'true') {
|
|
140
140
|
if (!isGovSite(card?.selectedCard?.link)) {
|
|
141
|
-
this.$store.commit('page/SET_CARETAKER_REF', 'list-group')
|
|
142
|
-
this.$root.$emit('caretaker-open', card?.selectedCard?.link)
|
|
141
|
+
// this.$store.commit('page/SET_CARETAKER_REF', 'list-group')
|
|
142
|
+
// this.$root.$emit('caretaker-open', card?.selectedCard?.link)
|
|
143
|
+
if (this.$pageStore) {
|
|
144
|
+
this.$pageStore.caretaker.referrer = 'list-group'
|
|
145
|
+
}
|
|
146
|
+
if (this.$bus) {
|
|
147
|
+
this.$bus.$emit('caretaker-open', card?.selectedCard?.link)
|
|
148
|
+
}
|
|
143
149
|
} else {
|
|
144
150
|
navigateToPath.call(
|
|
145
151
|
this,
|
|
146
152
|
card?.selectedCard?.link,
|
|
147
|
-
card?.ev?.ctrlKey === true || card?.ev?.metaKey === true
|
|
153
|
+
card?.ev?.ctrlKey === true || card?.ev?.metaKey === true,
|
|
148
154
|
)
|
|
149
155
|
}
|
|
150
156
|
} else {
|
|
151
157
|
navigateToPath.call(
|
|
152
158
|
this,
|
|
153
159
|
card?.selectedCard?.link,
|
|
154
|
-
card?.ev?.ctrlKey === true || card?.ev?.metaKey === true
|
|
160
|
+
card?.ev?.ctrlKey === true || card?.ev?.metaKey === true,
|
|
155
161
|
)
|
|
156
162
|
}
|
|
157
163
|
},
|
|
158
164
|
focussed(ev) {
|
|
159
165
|
const path = ev.path || (ev.composedPath && ev.composedPath())
|
|
160
166
|
const theTabbedCards = path.find(
|
|
161
|
-
(el) => el['_prevClass'] === 'tabbed-cards'
|
|
167
|
+
(el) => el['_prevClass'] === 'tabbed-cards',
|
|
162
168
|
)
|
|
163
169
|
if (ev.shiftKey && theTabbedCards) {
|
|
164
170
|
ev.preventDefault()
|
|
165
|
-
let selectedTabbedCards =
|
|
166
|
-
'isSelected'
|
|
167
|
-
)
|
|
171
|
+
let selectedTabbedCards =
|
|
172
|
+
theTabbedCards.getElementsByClassName('isSelected')
|
|
168
173
|
let selectedCard = selectedTabbedCards[0].getElementsByTagName('button')
|
|
169
|
-
let thePrevLGItem =
|
|
170
|
-
|
|
171
|
-
|
|
174
|
+
let thePrevLGItem =
|
|
175
|
+
ev.target?.parentElement?.parentElement?.previousSibling?.getElementsByTagName(
|
|
176
|
+
'button',
|
|
177
|
+
)
|
|
172
178
|
if (thePrevLGItem) {
|
|
173
179
|
thePrevLGItem[0].focus()
|
|
174
180
|
} else {
|
|
@@ -176,22 +182,25 @@ export default {
|
|
|
176
182
|
}
|
|
177
183
|
} else if (!ev.shiftKey && theTabbedCards) {
|
|
178
184
|
ev.preventDefault()
|
|
179
|
-
let selectedTabbedCards =
|
|
180
|
-
'isSelected'
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
let theNextLGItem =
|
|
186
|
-
|
|
187
|
-
|
|
185
|
+
let selectedTabbedCards =
|
|
186
|
+
theTabbedCards.getElementsByClassName('isSelected')
|
|
187
|
+
let nextTabbedCard =
|
|
188
|
+
selectedTabbedCards[0]?.parentElement?.nextSibling?.getElementsByTagName(
|
|
189
|
+
'button',
|
|
190
|
+
)
|
|
191
|
+
let theNextLGItem =
|
|
192
|
+
ev.target?.parentElement?.parentElement?.nextSibling?.getElementsByTagName(
|
|
193
|
+
'button',
|
|
194
|
+
)
|
|
188
195
|
if (theNextLGItem) {
|
|
189
196
|
theNextLGItem[0].focus()
|
|
190
197
|
} else if (nextTabbedCard) {
|
|
191
198
|
nextTabbedCard[0].focus()
|
|
192
199
|
} else {
|
|
193
200
|
let nextFocus = this.focusNextElement()
|
|
194
|
-
this.$
|
|
201
|
+
if (this.$bus) {
|
|
202
|
+
this.$bus.$emit('last-focus-out')
|
|
203
|
+
}
|
|
195
204
|
nextFocus.focus()
|
|
196
205
|
}
|
|
197
206
|
} else {
|
|
@@ -208,7 +217,7 @@ export default {
|
|
|
208
217
|
'button:not([disabled]):not([tabindex="-1"])',
|
|
209
218
|
'input:not([disabled]):not([tabindex="-1"])',
|
|
210
219
|
'select:not([disabled]):not([tabindex="-1"])',
|
|
211
|
-
'[tabindex]:not([disabled]):not([tabindex="-1"])'
|
|
220
|
+
'[tabindex]:not([disabled]):not([tabindex="-1"])',
|
|
212
221
|
/* add custom queries here */
|
|
213
222
|
].join(','),
|
|
214
223
|
queryResult = Array.prototype.filter.call(
|
|
@@ -220,7 +229,7 @@ export default {
|
|
|
220
229
|
elem.offsetHeight > 0 ||
|
|
221
230
|
elem === activeElem
|
|
222
231
|
)
|
|
223
|
-
}
|
|
232
|
+
},
|
|
224
233
|
),
|
|
225
234
|
indexedList = queryResult
|
|
226
235
|
.slice()
|
|
@@ -234,20 +243,20 @@ export default {
|
|
|
234
243
|
? a.tabIndex < b.tabIndex
|
|
235
244
|
? -1
|
|
236
245
|
: b.tabIndex < a.tabIndex
|
|
237
|
-
|
|
238
|
-
|
|
246
|
+
? 1
|
|
247
|
+
: 0
|
|
239
248
|
: a.tabIndex != 0
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
249
|
+
? -1
|
|
250
|
+
: b.tabIndex != 0
|
|
251
|
+
? 1
|
|
252
|
+
: 0
|
|
244
253
|
}),
|
|
245
254
|
focusable = [].concat(
|
|
246
255
|
indexedList,
|
|
247
256
|
queryResult.filter((elem) => {
|
|
248
257
|
/* filter out all indexes above 0 */
|
|
249
258
|
return elem.tabIndex == 0 || elem.tabIndex == -1 ? true : false
|
|
250
|
-
})
|
|
259
|
+
}),
|
|
251
260
|
)
|
|
252
261
|
|
|
253
262
|
/* if reverse is true return the previous focusable element
|
|
@@ -256,8 +265,8 @@ export default {
|
|
|
256
265
|
? focusable[focusable.indexOf(activeElem) - 1] ||
|
|
257
266
|
focusable[focusable.length - 1]
|
|
258
267
|
: focusable[focusable.indexOf(activeElem) + 1] || focusable[0]
|
|
259
|
-
}
|
|
260
|
-
}
|
|
268
|
+
},
|
|
269
|
+
},
|
|
261
270
|
}
|
|
262
271
|
</script>
|
|
263
272
|
<style lang="scss" scoped>
|
|
@@ -40,10 +40,11 @@
|
|
|
40
40
|
:is-expandable="true"
|
|
41
41
|
/>
|
|
42
42
|
</template>
|
|
43
|
-
<template
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
<template v-slot:cardGridFooter>
|
|
44
|
+
<column
|
|
45
|
+
v-if="selectedRow === rIndex && selectedCard"
|
|
46
|
+
class="listgroup-column"
|
|
47
|
+
>
|
|
47
48
|
<div ref="listgroup" class="tabbed-cards__listGroup">
|
|
48
49
|
<list-group
|
|
49
50
|
:list="selectedCard.links"
|
|
@@ -77,24 +78,24 @@ export default {
|
|
|
77
78
|
props: {
|
|
78
79
|
heading: {
|
|
79
80
|
type: String,
|
|
80
|
-
default: ''
|
|
81
|
+
default: '',
|
|
81
82
|
},
|
|
82
83
|
description: {
|
|
83
84
|
type: String,
|
|
84
|
-
default: ''
|
|
85
|
+
default: '',
|
|
85
86
|
},
|
|
86
87
|
tabbedCards: {
|
|
87
88
|
type: Array,
|
|
88
|
-
default: () => []
|
|
89
|
+
default: () => [],
|
|
89
90
|
},
|
|
90
91
|
rtl: {
|
|
91
92
|
type: Boolean,
|
|
92
|
-
default: false
|
|
93
|
+
default: false,
|
|
93
94
|
},
|
|
94
95
|
workwell: {
|
|
95
96
|
type: Boolean,
|
|
96
|
-
default: false
|
|
97
|
-
}
|
|
97
|
+
default: false,
|
|
98
|
+
},
|
|
98
99
|
},
|
|
99
100
|
data() {
|
|
100
101
|
return {
|
|
@@ -102,7 +103,7 @@ export default {
|
|
|
102
103
|
selectedRow: undefined,
|
|
103
104
|
screenWidth: 0,
|
|
104
105
|
loaded: false,
|
|
105
|
-
tabList: null
|
|
106
|
+
tabList: null,
|
|
106
107
|
}
|
|
107
108
|
},
|
|
108
109
|
computed: {
|
|
@@ -122,15 +123,18 @@ export default {
|
|
|
122
123
|
} else {
|
|
123
124
|
return 3
|
|
124
125
|
}
|
|
125
|
-
}
|
|
126
|
+
},
|
|
126
127
|
},
|
|
127
128
|
mounted() {
|
|
128
129
|
window.addEventListener('resize', this.updateScreenWidth)
|
|
129
130
|
this.screenWidth = document.documentElement.clientWidth
|
|
130
|
-
|
|
131
|
-
this
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
if (this.$bus) {
|
|
132
|
+
this.$bus.$on('last-focus-out', () => {
|
|
133
|
+
this.selectedCard = null
|
|
134
|
+
this.selectedRow = null
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
|
|
134
138
|
this.loaded = true
|
|
135
139
|
},
|
|
136
140
|
beforeDestroy() {
|
|
@@ -171,7 +175,7 @@ export default {
|
|
|
171
175
|
easing: 'ease-in',
|
|
172
176
|
offset: -100,
|
|
173
177
|
force: true,
|
|
174
|
-
cancelable: true
|
|
178
|
+
cancelable: true,
|
|
175
179
|
}
|
|
176
180
|
setTimeout(() => {
|
|
177
181
|
const listGroup = this.$refs.listgroup[0]
|
|
@@ -193,14 +197,17 @@ export default {
|
|
|
193
197
|
focussed(ev) {
|
|
194
198
|
ev.preventDefault()
|
|
195
199
|
let activeElem = ev.target
|
|
196
|
-
if(!this.tabList){
|
|
200
|
+
if (!this.tabList) {
|
|
197
201
|
this.tabList = this.getFocusElements()
|
|
198
202
|
} else {
|
|
199
|
-
let newList = this.getFocusElements().filter(
|
|
200
|
-
|
|
203
|
+
let newList = this.getFocusElements().filter(
|
|
204
|
+
(item) => this.tabList.indexOf(item) == -1,
|
|
205
|
+
)
|
|
206
|
+
this.tabList.splice(this.tabList.indexOf(activeElem) + 1, 0, ...newList)
|
|
201
207
|
}
|
|
202
|
-
let newTab = ev.shiftKey
|
|
203
|
-
|
|
208
|
+
let newTab = ev.shiftKey
|
|
209
|
+
? this.tabList[this.tabList.indexOf(activeElem) - 1] ||
|
|
210
|
+
this.tabList[this.tabList.length - 1]
|
|
204
211
|
: this.tabList[this.tabList.indexOf(activeElem) + 1] || this.tabList[0]
|
|
205
212
|
newTab.focus()
|
|
206
213
|
},
|
|
@@ -211,17 +218,14 @@ export default {
|
|
|
211
218
|
'button:not([disabled]):not([tabindex="-1"])',
|
|
212
219
|
'input:not([disabled]):not([tabindex="-1"])',
|
|
213
220
|
'select:not([disabled]):not([tabindex="-1"])',
|
|
214
|
-
'[tabindex]:not([disabled]):not([tabindex="-1"])'
|
|
221
|
+
'[tabindex]:not([disabled]):not([tabindex="-1"])',
|
|
215
222
|
/* add custom queries here */
|
|
216
223
|
].join(','),
|
|
217
224
|
queryResult = Array.prototype.filter.call(
|
|
218
225
|
document.querySelectorAll(queryString),
|
|
219
226
|
(elem) => {
|
|
220
|
-
return
|
|
221
|
-
|
|
222
|
-
elem.offsetHeight > 0
|
|
223
|
-
)
|
|
224
|
-
}
|
|
227
|
+
return elem.offsetWidth > 0 || elem.offsetHeight > 0
|
|
228
|
+
},
|
|
225
229
|
),
|
|
226
230
|
indexedList = queryResult
|
|
227
231
|
.slice()
|
|
@@ -235,24 +239,24 @@ export default {
|
|
|
235
239
|
? a.tabIndex < b.tabIndex
|
|
236
240
|
? -1
|
|
237
241
|
: b.tabIndex < a.tabIndex
|
|
238
|
-
|
|
239
|
-
|
|
242
|
+
? 1
|
|
243
|
+
: 0
|
|
240
244
|
: a.tabIndex != 0
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
+
? -1
|
|
246
|
+
: b.tabIndex != 0
|
|
247
|
+
? 1
|
|
248
|
+
: 0
|
|
245
249
|
}),
|
|
246
250
|
focusable = [].concat(
|
|
247
251
|
indexedList,
|
|
248
252
|
queryResult.filter((elem) => {
|
|
249
253
|
/* filter out all indexes above 0 */
|
|
250
254
|
return elem.tabIndex == 0 || elem.tabIndex == -1 ? true : false
|
|
251
|
-
})
|
|
255
|
+
}),
|
|
252
256
|
)
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
}
|
|
257
|
+
return focusable
|
|
258
|
+
},
|
|
259
|
+
},
|
|
256
260
|
}
|
|
257
261
|
</script>
|
|
258
262
|
<style lang="scss" scoped>
|