@worksafevictoria/wcl7.5 1.6.0 → 1.7.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/package.json +3 -2
- package/src/components/Common/CardGridItem/card-grid-item-icon.vue +15 -19
- package/src/components/Common/CardGridItem/index.vue +108 -139
- package/src/components/Global/AppFooter/styles.scss +3 -0
- package/src/components/Global/DirectoryFilters/index.vue +3 -0
- package/src/components/Paragraphs/Chart/Constants.js +479 -479
- package/src/components/Paragraphs/Directory/{Records/HSCP → HSCP/Records/SingleRecord}/index.stories.js +4 -3
- package/src/components/Paragraphs/Directory/HSCP/Records/SingleRecord/index.vue +322 -0
- package/src/components/Paragraphs/Directory/HSCP/Records/index.stories.js +19 -0
- package/src/components/Paragraphs/Directory/HSCP/Records/index.vue +343 -0
- package/src/components/Paragraphs/Directory/HSCP/Records/pagination.vue +179 -0
- package/src/components/Paragraphs/Directory/Records/CJ/index.vue +1 -1
- package/src/components/Paragraphs/Directory/Records/ISP/index.vue +1 -1
- package/src/components/Paragraphs/Directory/Records/PRS/index.stories.js +34 -0
- package/src/components/Paragraphs/Directory/Records/PRS/index.vue +5 -1
- package/src/components/Paragraphs/Directory/Records/index.storieshide.js +47 -0
- package/src/components/Paragraphs/Directory/Records/index.vue +18 -35
- package/src/components/Paragraphs/Directory/{Records/styles.scss → styles.scss} +4 -3
- package/src/components/Paragraphs/Map/Constants.js +4790 -0
- package/src/components/Paragraphs/Map/index.mdx +29 -0
- package/src/components/Paragraphs/Map/index.stories.js +15 -0
- package/src/components/Paragraphs/Map/index.vue +313 -0
- package/src/components/Paragraphs/Map/lga-map.json +33462 -0
- package/src/components/Paragraphs/Map/postcode_location.json +3543 -0
- package/src/components/Paragraphs/TabulatedData/index.vue +27 -36
- package/src/components/SubComponents/Breadcrumb/index.vue +4 -0
- package/src/components/SubComponents/FormInstance/components/renderer/index.vue +23 -7
- package/src/components/SubComponents/FormInstance/models/overrides/file.js +7 -2
- package/src/components/SubComponents/ResourceGroup/index.vue +158 -184
- package/src/components/SubComponents/ResourceGroup/styles.scss +2 -0
- package/src/components/SubComponents/Search/index.vue +8 -3
- package/src/index.js +4 -0
- package/src/mock/course-provider.js +273 -0
- package/src/components/Paragraphs/Directory/Records/HSCP/index.vue +0 -334
|
@@ -14,10 +14,7 @@
|
|
|
14
14
|
:background-variant="background"
|
|
15
15
|
@selected="selectedCard"
|
|
16
16
|
>
|
|
17
|
-
<template
|
|
18
|
-
v-if="enableBundleFilter && bundle.length > 1"
|
|
19
|
-
v-slot:gridHeaderRight
|
|
20
|
-
>
|
|
17
|
+
<template v-if="enableBundleFilter && bundle.length > 1" v-slot:gridHeaderRight>
|
|
21
18
|
<switcher
|
|
22
19
|
v-if="enableBundleFilter"
|
|
23
20
|
:options="bundle"
|
|
@@ -48,8 +45,7 @@
|
|
|
48
45
|
:class="{
|
|
49
46
|
[`card_group__card--${card.colour}`]: card.pillText,
|
|
50
47
|
[`card_group__card--none`]: !card.pillText,
|
|
51
|
-
[`card_group__card--${cardResourseType}`]:
|
|
52
|
-
'card_group__card--resourse-group',
|
|
48
|
+
[`card_group__card--${cardResourseType}`]: 'card_group__card--resourse-group',
|
|
53
49
|
}"
|
|
54
50
|
:card-header-title="card.title"
|
|
55
51
|
:caret="getCaret(card)"
|
|
@@ -75,10 +71,7 @@
|
|
|
75
71
|
</template>
|
|
76
72
|
|
|
77
73
|
<!-- footer - download button -->
|
|
78
|
-
<template
|
|
79
|
-
v-if="cardResourseType === 'resource-group'"
|
|
80
|
-
v-slot:cardFooter
|
|
81
|
-
>
|
|
74
|
+
<template v-if="cardResourseType === 'resource-group'" v-slot:cardFooter>
|
|
82
75
|
<card-footer :card="card" :resource-type="cardResourseType" />
|
|
83
76
|
</template>
|
|
84
77
|
</card-grid-item>
|
|
@@ -120,24 +113,20 @@
|
|
|
120
113
|
</template>
|
|
121
114
|
|
|
122
115
|
<script>
|
|
123
|
-
import Column from
|
|
124
|
-
import CardGrid from
|
|
125
|
-
import CardGridItem from
|
|
126
|
-
import CardTop from
|
|
127
|
-
import CardBody from
|
|
128
|
-
import CardFooter from
|
|
129
|
-
import CtaButton from
|
|
130
|
-
import DirectoryFilters from
|
|
131
|
-
import Switcher from
|
|
132
|
-
import {
|
|
133
|
-
|
|
134
|
-
navigateToPath,
|
|
135
|
-
isGovSite,
|
|
136
|
-
} from './../../../../lib/utility'
|
|
137
|
-
import { BSpinner } from 'bootstrap-vue-next'
|
|
116
|
+
import Column from "./../../Containers/Column/index.vue";
|
|
117
|
+
import CardGrid from "./../../Common/CardGrid/index.vue";
|
|
118
|
+
import CardGridItem from "./../../Common/CardGridItem/index.vue";
|
|
119
|
+
import CardTop from "./cardtop.vue";
|
|
120
|
+
import CardBody from "./cardbody.vue";
|
|
121
|
+
import CardFooter from "./cardfooter.vue";
|
|
122
|
+
import CtaButton from "./../CtaButton/index.vue";
|
|
123
|
+
import DirectoryFilters from "./../../Global/DirectoryFilters/index.vue";
|
|
124
|
+
import Switcher from "./switcher.vue";
|
|
125
|
+
import { isAbsoluteUrl, navigateToPath, isGovSite } from "./../../../../lib/utility";
|
|
126
|
+
import { BSpinner } from "bootstrap-vue-next";
|
|
138
127
|
|
|
139
128
|
export default {
|
|
140
|
-
name:
|
|
129
|
+
name: "ResourceGroup",
|
|
141
130
|
components: {
|
|
142
131
|
Column,
|
|
143
132
|
CardGrid,
|
|
@@ -153,15 +142,15 @@ export default {
|
|
|
153
142
|
props: {
|
|
154
143
|
background: {
|
|
155
144
|
type: String,
|
|
156
|
-
default:
|
|
145
|
+
default: "white",
|
|
157
146
|
},
|
|
158
147
|
title: {
|
|
159
148
|
type: String,
|
|
160
|
-
default:
|
|
149
|
+
default: "",
|
|
161
150
|
},
|
|
162
151
|
titleTag: {
|
|
163
152
|
type: String,
|
|
164
|
-
default:
|
|
153
|
+
default: "h2",
|
|
165
154
|
},
|
|
166
155
|
rtl: {
|
|
167
156
|
type: Boolean,
|
|
@@ -169,7 +158,7 @@ export default {
|
|
|
169
158
|
},
|
|
170
159
|
bundle: {
|
|
171
160
|
type: Array,
|
|
172
|
-
default: () => [
|
|
161
|
+
default: () => [""],
|
|
173
162
|
},
|
|
174
163
|
columns: {
|
|
175
164
|
type: Number,
|
|
@@ -202,7 +191,7 @@ export default {
|
|
|
202
191
|
},
|
|
203
192
|
resourceType: {
|
|
204
193
|
type: String,
|
|
205
|
-
default:
|
|
194
|
+
default: "resource-group",
|
|
206
195
|
},
|
|
207
196
|
showLoadMore: {
|
|
208
197
|
type: Boolean,
|
|
@@ -210,7 +199,7 @@ export default {
|
|
|
210
199
|
},
|
|
211
200
|
emptyCardsText: {
|
|
212
201
|
type: String,
|
|
213
|
-
default:
|
|
202
|
+
default: "No results returned",
|
|
214
203
|
},
|
|
215
204
|
loading: {
|
|
216
205
|
type: Boolean,
|
|
@@ -221,10 +210,10 @@ export default {
|
|
|
221
210
|
async mounted() {
|
|
222
211
|
if (this.displayedCards.length === 0) {
|
|
223
212
|
console.log(
|
|
224
|
-
|
|
225
|
-
this.displayedCards.length
|
|
226
|
-
)
|
|
227
|
-
await this.loadFiltersAndContent()
|
|
213
|
+
"🚀 ~ mounted ~ this.displayedCards.length:",
|
|
214
|
+
this.displayedCards.length
|
|
215
|
+
);
|
|
216
|
+
await this.loadFiltersAndContent();
|
|
228
217
|
}
|
|
229
218
|
},
|
|
230
219
|
// TODO useAsyncData <script setup>
|
|
@@ -248,96 +237,91 @@ export default {
|
|
|
248
237
|
selected: {},
|
|
249
238
|
availableBundles: [],
|
|
250
239
|
},
|
|
251
|
-
}
|
|
240
|
+
};
|
|
252
241
|
},
|
|
253
242
|
computed: {
|
|
254
243
|
allCardsRTL() {
|
|
255
244
|
if (this.displayedCards.length === 0) {
|
|
256
|
-
return this.rtl
|
|
245
|
+
return this.rtl;
|
|
257
246
|
}
|
|
258
|
-
return this.displayedCards.every((card) => this.rtl || card.rtl)
|
|
247
|
+
return this.displayedCards.every((card) => this.rtl || card.rtl);
|
|
259
248
|
},
|
|
260
249
|
},
|
|
261
250
|
fetchOnServer: true,
|
|
262
|
-
fetchKey:
|
|
251
|
+
fetchKey: "wcl-card-group",
|
|
263
252
|
methods: {
|
|
264
253
|
async loadFiltersAndContent() {
|
|
265
254
|
await Promise.all([
|
|
266
255
|
this.fetchFilters ? this.loadFilters() : Promise.resolve(),
|
|
267
256
|
this.loadMoreCards(true),
|
|
268
|
-
])
|
|
269
|
-
console.log(
|
|
270
|
-
'🚀 ~ loadFiltersAndContent ~ this.fetchFilters:',
|
|
271
|
-
this.fetchFilters,
|
|
272
|
-
)
|
|
257
|
+
]);
|
|
258
|
+
console.log("🚀 ~ loadFiltersAndContent ~ this.fetchFilters:", this.fetchFilters);
|
|
273
259
|
},
|
|
274
260
|
init() {
|
|
275
261
|
this.allCards = {
|
|
276
262
|
total: 0,
|
|
277
263
|
cards: [],
|
|
278
|
-
}
|
|
279
|
-
this.displayLimit = 0
|
|
280
|
-
this.hasMorePages = false
|
|
281
|
-
this.displayedCards = []
|
|
282
|
-
this.bundleCache = {}
|
|
264
|
+
};
|
|
265
|
+
this.displayLimit = 0;
|
|
266
|
+
this.hasMorePages = false;
|
|
267
|
+
this.displayedCards = [];
|
|
268
|
+
this.bundleCache = {};
|
|
283
269
|
},
|
|
284
270
|
async fetchCards(currentDisplayedCards, allCards, addMoreBy, bundles) {
|
|
285
271
|
const shouldMakeNewFetchCall =
|
|
286
|
-
currentDisplayedCards.length + addMoreBy > allCards.cards.length
|
|
272
|
+
currentDisplayedCards.length + addMoreBy > allCards.cards.length;
|
|
287
273
|
|
|
288
274
|
if (shouldMakeNewFetchCall) {
|
|
289
275
|
const cardBundles = await Promise.all(
|
|
290
|
-
bundles.map((bundle, index) =>
|
|
291
|
-
|
|
292
|
-
),
|
|
293
|
-
)
|
|
276
|
+
bundles.map((bundle, index) => this.getBundle(bundle, addMoreBy, index))
|
|
277
|
+
);
|
|
294
278
|
|
|
295
|
-
allCards = this.getShuffledCards(cardBundles)
|
|
279
|
+
allCards = this.getShuffledCards(cardBundles);
|
|
296
280
|
|
|
297
281
|
if (
|
|
298
|
-
this.type ===
|
|
299
|
-
this.type ===
|
|
300
|
-
this.type ===
|
|
301
|
-
this.type ===
|
|
282
|
+
this.type === "paragraph--cards_group_latest" ||
|
|
283
|
+
this.type === "paragraph--browse_content" ||
|
|
284
|
+
this.type === "paragraph--resource_group" ||
|
|
285
|
+
this.type === "paragraph--resource_list"
|
|
302
286
|
) {
|
|
303
|
-
allCards.cards = this.sortByDate(allCards.cards)
|
|
287
|
+
allCards.cards = this.sortByDate(allCards.cards);
|
|
304
288
|
}
|
|
305
289
|
}
|
|
306
|
-
return allCards
|
|
290
|
+
return allCards;
|
|
307
291
|
},
|
|
308
292
|
async loadMoreCards(init) {
|
|
309
293
|
const attrs = {
|
|
310
294
|
group: this.$pageStore?.content?.title,
|
|
311
295
|
//group: this.$store?.state?.page?.content?.title,
|
|
312
|
-
}
|
|
296
|
+
};
|
|
313
297
|
if (this.$gtm && !init) {
|
|
314
|
-
this.$gtm.push({ event:
|
|
298
|
+
this.$gtm.push({ event: "custom.interaction.showmore.click", ...attrs });
|
|
315
299
|
}
|
|
316
300
|
if (init) {
|
|
317
|
-
this.init()
|
|
301
|
+
this.init();
|
|
318
302
|
}
|
|
319
|
-
this.loader = true
|
|
320
|
-
const addMoreBy = this.initialDisplyLimit
|
|
321
|
-
this.displayLimit += addMoreBy
|
|
303
|
+
this.loader = true;
|
|
304
|
+
const addMoreBy = this.initialDisplyLimit;
|
|
305
|
+
this.displayLimit += addMoreBy;
|
|
322
306
|
const bundles =
|
|
323
307
|
this.filters.availableBundles.length > 0
|
|
324
308
|
? this.filters.availableBundles
|
|
325
|
-
: this.bundle
|
|
309
|
+
: this.bundle;
|
|
326
310
|
this.allCards = await this.fetchCards(
|
|
327
311
|
this.displayedCards,
|
|
328
312
|
this.allCards,
|
|
329
313
|
addMoreBy,
|
|
330
|
-
bundles
|
|
331
|
-
)
|
|
314
|
+
bundles
|
|
315
|
+
);
|
|
332
316
|
|
|
333
|
-
this.hasMorePages = this.allCards.total > this.allCards.cards.length
|
|
334
|
-
this.displayedCards = this.allCards.cards.slice(0, this.displayLimit)
|
|
317
|
+
this.hasMorePages = this.allCards.total > this.allCards.cards.length;
|
|
318
|
+
this.displayedCards = this.allCards.cards.slice(0, this.displayLimit);
|
|
335
319
|
|
|
336
|
-
this.loader = false
|
|
320
|
+
this.loader = false;
|
|
337
321
|
},
|
|
338
322
|
getBundle(bundle, addMoreBy, index) {
|
|
339
|
-
let start
|
|
340
|
-
const rows = addMoreBy
|
|
323
|
+
let start;
|
|
324
|
+
const rows = addMoreBy;
|
|
341
325
|
const cache = (this.bundleCache[bundle] = this.bundleCache[bundle] || {
|
|
342
326
|
response: {
|
|
343
327
|
results: [],
|
|
@@ -346,177 +330,166 @@ export default {
|
|
|
346
330
|
qs: {
|
|
347
331
|
start,
|
|
348
332
|
},
|
|
349
|
-
})
|
|
333
|
+
});
|
|
350
334
|
|
|
351
335
|
if (cache.qs.start === undefined) {
|
|
352
|
-
start = 0
|
|
336
|
+
start = 0;
|
|
353
337
|
} else if (cache.response.numFound > cache.response.results.length) {
|
|
354
|
-
start = cache.response.results.length
|
|
338
|
+
start = cache.response.results.length;
|
|
355
339
|
} else {
|
|
356
|
-
return Promise.resolve(cache.response)
|
|
340
|
+
return Promise.resolve(cache.response);
|
|
357
341
|
}
|
|
358
342
|
|
|
359
343
|
const qs = {
|
|
360
344
|
bundle,
|
|
361
345
|
rows,
|
|
362
346
|
start,
|
|
363
|
-
}
|
|
364
|
-
return this.fetchContent(qs, this.filters.selected, index).then(
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
},
|
|
371
|
-
)
|
|
347
|
+
};
|
|
348
|
+
return this.fetchContent(qs, this.filters.selected, index).then((response) => {
|
|
349
|
+
cache.qs.start = qs.start;
|
|
350
|
+
cache.response.numFound = response.numFound;
|
|
351
|
+
cache.response.results.push(...response.results);
|
|
352
|
+
return cache.response;
|
|
353
|
+
});
|
|
372
354
|
},
|
|
373
355
|
getShuffledCards(cardBundles) {
|
|
374
|
-
const shuffled = []
|
|
356
|
+
const shuffled = [];
|
|
375
357
|
const bundleWithMostCards = cardBundles.reduce(
|
|
376
358
|
(a, b) => (a.results.length > b.results.length ? a : b),
|
|
377
|
-
{ results: [] }
|
|
378
|
-
).results.length
|
|
359
|
+
{ results: [] }
|
|
360
|
+
).results.length;
|
|
379
361
|
|
|
380
362
|
for (let i = 0; i < bundleWithMostCards; i++) {
|
|
381
363
|
cardBundles.forEach((bundle) => {
|
|
382
364
|
if (bundle.results[i]) {
|
|
383
|
-
shuffled.push(bundle.results[i])
|
|
365
|
+
shuffled.push(bundle.results[i]);
|
|
384
366
|
}
|
|
385
|
-
})
|
|
367
|
+
});
|
|
386
368
|
}
|
|
387
369
|
|
|
388
370
|
const total = cardBundles.reduce((acc, bundle) => {
|
|
389
|
-
return acc + bundle.numFound
|
|
390
|
-
}, 0)
|
|
371
|
+
return acc + bundle.numFound;
|
|
372
|
+
}, 0);
|
|
391
373
|
|
|
392
|
-
return { cards: shuffled, total }
|
|
374
|
+
return { cards: shuffled, total };
|
|
393
375
|
},
|
|
394
376
|
loadFilters() {
|
|
395
377
|
return this.fetchFilters().then((taxonomies) => {
|
|
396
|
-
console.log(
|
|
397
|
-
this.filters.taxonomies = taxonomies
|
|
398
|
-
return Promise.resolve(taxonomies)
|
|
399
|
-
})
|
|
378
|
+
console.log("🚀 ~ returnthis.fetchFilters ~ taxonomies:", taxonomies);
|
|
379
|
+
this.filters.taxonomies = taxonomies;
|
|
380
|
+
return Promise.resolve(taxonomies);
|
|
381
|
+
});
|
|
400
382
|
},
|
|
401
383
|
onFilter(filters) {
|
|
402
|
-
this.bundleCache = {}
|
|
384
|
+
this.bundleCache = {};
|
|
403
385
|
Object.keys(filters).forEach((filter) => {
|
|
404
|
-
this.filters.selected[filter] = filters[filter].map((obj) => obj.tid)
|
|
405
|
-
})
|
|
406
|
-
this.loadMoreCards(true)
|
|
386
|
+
this.filters.selected[filter] = filters[filter].map((obj) => obj.tid);
|
|
387
|
+
});
|
|
388
|
+
this.loadMoreCards(true);
|
|
407
389
|
},
|
|
408
390
|
onSwitcher(switchToBundle) {
|
|
409
|
-
this.filters.selected = {}
|
|
410
|
-
this.filters.availableBundles.length = 0
|
|
391
|
+
this.filters.selected = {};
|
|
392
|
+
this.filters.availableBundles.length = 0;
|
|
411
393
|
if (switchToBundle) {
|
|
412
|
-
this.filters.availableBundles.push(switchToBundle)
|
|
394
|
+
this.filters.availableBundles.push(switchToBundle);
|
|
413
395
|
}
|
|
414
|
-
this.loadMoreCards(true)
|
|
396
|
+
this.loadMoreCards(true);
|
|
415
397
|
},
|
|
416
398
|
async reset() {
|
|
417
|
-
this.bundleCache = {}
|
|
418
|
-
this.filters.selected = {}
|
|
419
|
-
this.filters.availableBundles.length = 0
|
|
420
|
-
await this.loadMoreCards(true)
|
|
399
|
+
this.bundleCache = {};
|
|
400
|
+
this.filters.selected = {};
|
|
401
|
+
this.filters.availableBundles.length = 0;
|
|
402
|
+
await this.loadMoreCards(true);
|
|
421
403
|
},
|
|
422
404
|
sortByDate(cards) {
|
|
423
405
|
const sorted = cards.sort((a, b) => {
|
|
424
|
-
return new Date(b.dateSort) - new Date(a.dateSort)
|
|
425
|
-
})
|
|
426
|
-
return sorted
|
|
406
|
+
return new Date(b.dateSort) - new Date(a.dateSort);
|
|
407
|
+
});
|
|
408
|
+
return sorted;
|
|
427
409
|
},
|
|
428
410
|
handleLoadMore() {
|
|
429
|
-
this.loadMoreCards(false)
|
|
411
|
+
this.loadMoreCards(false);
|
|
430
412
|
},
|
|
431
413
|
|
|
432
414
|
getCaret(card) {
|
|
433
415
|
if (card.link && isAbsoluteUrl(card.link)) {
|
|
434
|
-
return
|
|
416
|
+
return "external";
|
|
435
417
|
} else {
|
|
436
|
-
return undefined
|
|
418
|
+
return undefined;
|
|
437
419
|
}
|
|
438
420
|
},
|
|
439
421
|
selectedCard(card) {
|
|
440
422
|
// Some custom logic for gov caretaker logic
|
|
441
423
|
if (
|
|
442
|
-
(this.$config
|
|
443
|
-
? this.$config.public.caretaker
|
|
444
|
-
: process.env.CARETAKER) === 'true'
|
|
424
|
+
(this.$config ? this.$config.public.caretaker : process.env.CARETAKER) === "true"
|
|
445
425
|
) {
|
|
446
426
|
if (!isGovSite(card?.selectedCard?.link)) {
|
|
447
427
|
// this.$store.commit('page/SET_CARETAKER_REF', 'list-group')
|
|
448
428
|
// this.$root.$emit('caretaker-open', card?.selectedCard?.link)
|
|
449
429
|
if (this.$pageStore) {
|
|
450
|
-
this.$pageStore.caretaker.referrer =
|
|
430
|
+
this.$pageStore.caretaker.referrer = "list-group";
|
|
451
431
|
}
|
|
452
432
|
if (this.$bus) {
|
|
453
|
-
this.$bus.$emit(
|
|
433
|
+
this.$bus.$emit("caretaker-open", card?.selectedCard?.link);
|
|
454
434
|
}
|
|
455
435
|
} else {
|
|
456
436
|
navigateToPath.call(
|
|
457
437
|
this,
|
|
458
438
|
card?.selectedCard?.link,
|
|
459
|
-
card?.ev?.ctrlKey === true || card?.ev?.metaKey === true
|
|
460
|
-
)
|
|
439
|
+
card?.ev?.ctrlKey === true || card?.ev?.metaKey === true
|
|
440
|
+
);
|
|
461
441
|
}
|
|
462
442
|
} else {
|
|
463
443
|
navigateToPath.call(
|
|
464
444
|
this,
|
|
465
445
|
card?.selectedCard?.link,
|
|
466
|
-
card?.ev?.ctrlKey === true || card?.ev?.metaKey === true
|
|
467
|
-
)
|
|
446
|
+
card?.ev?.ctrlKey === true || card?.ev?.metaKey === true
|
|
447
|
+
);
|
|
468
448
|
}
|
|
469
449
|
},
|
|
470
450
|
focussed(ev) {
|
|
471
|
-
const path = ev.path || (ev.composedPath && ev.composedPath())
|
|
472
|
-
const theTabbedCards = path.find(
|
|
473
|
-
(el) => el['_prevClass'] === 'tabbed-cards',
|
|
474
|
-
)
|
|
451
|
+
const path = ev.path || (ev.composedPath && ev.composedPath());
|
|
452
|
+
const theTabbedCards = path.find((el) => el["_prevClass"] === "tabbed-cards");
|
|
475
453
|
if (ev.shiftKey && theTabbedCards) {
|
|
476
|
-
ev.preventDefault()
|
|
477
|
-
let selectedTabbedCards =
|
|
478
|
-
|
|
479
|
-
let
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
'button',
|
|
483
|
-
)
|
|
454
|
+
ev.preventDefault();
|
|
455
|
+
let selectedTabbedCards = theTabbedCards.getElementsByClassName("isSelected");
|
|
456
|
+
let selectedCard = selectedTabbedCards[0].getElementsByTagName("button");
|
|
457
|
+
let thePrevLGItem = ev.target?.parentElement?.parentElement?.previousSibling?.getElementsByTagName(
|
|
458
|
+
"button"
|
|
459
|
+
);
|
|
484
460
|
if (thePrevLGItem) {
|
|
485
|
-
thePrevLGItem[0].focus()
|
|
461
|
+
thePrevLGItem[0].focus();
|
|
486
462
|
} else {
|
|
487
|
-
selectedCard[0].focus()
|
|
463
|
+
selectedCard[0].focus();
|
|
488
464
|
}
|
|
489
465
|
} else if (!ev.shiftKey && theTabbedCards) {
|
|
490
|
-
ev.preventDefault()
|
|
491
|
-
let selectedTabbedCards =
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
ev.target?.parentElement?.parentElement?.nextSibling?.getElementsByTagName(
|
|
499
|
-
'button',
|
|
500
|
-
)
|
|
466
|
+
ev.preventDefault();
|
|
467
|
+
let selectedTabbedCards = theTabbedCards.getElementsByClassName("isSelected");
|
|
468
|
+
let nextTabbedCard = selectedTabbedCards[0]?.parentElement?.nextSibling?.getElementsByTagName(
|
|
469
|
+
"button"
|
|
470
|
+
);
|
|
471
|
+
let theNextLGItem = ev.target?.parentElement?.parentElement?.nextSibling?.getElementsByTagName(
|
|
472
|
+
"button"
|
|
473
|
+
);
|
|
501
474
|
if (theNextLGItem) {
|
|
502
|
-
theNextLGItem[0].focus()
|
|
475
|
+
theNextLGItem[0].focus();
|
|
503
476
|
} else if (nextTabbedCard) {
|
|
504
|
-
nextTabbedCard[0].focus()
|
|
477
|
+
nextTabbedCard[0].focus();
|
|
505
478
|
} else {
|
|
506
|
-
let nextFocus = this.focusNextElement()
|
|
479
|
+
let nextFocus = this.focusNextElement();
|
|
507
480
|
if (this.$bus) {
|
|
508
|
-
this.$bus.$emit(
|
|
481
|
+
this.$bus.$emit("last-focus-out");
|
|
509
482
|
}
|
|
510
|
-
nextFocus.focus()
|
|
483
|
+
nextFocus.focus();
|
|
511
484
|
}
|
|
512
485
|
} else {
|
|
513
|
-
return true
|
|
486
|
+
return true;
|
|
514
487
|
}
|
|
515
488
|
},
|
|
516
489
|
focusNextElement(reverse, activeElem) {
|
|
517
490
|
/*check if an element is defined or use activeElement*/
|
|
518
491
|
activeElem =
|
|
519
|
-
activeElem instanceof HTMLElement ? activeElem : document.activeElement
|
|
492
|
+
activeElem instanceof HTMLElement ? activeElem : document.activeElement;
|
|
520
493
|
|
|
521
494
|
let queryString = [
|
|
522
495
|
'a:not([disabled]):not([tabindex="-1"])',
|
|
@@ -525,23 +498,19 @@ export default {
|
|
|
525
498
|
'select:not([disabled]):not([tabindex="-1"])',
|
|
526
499
|
'[tabindex]:not([disabled]):not([tabindex="-1"])',
|
|
527
500
|
/* add custom queries here */
|
|
528
|
-
].join(
|
|
501
|
+
].join(","),
|
|
529
502
|
queryResult = Array.prototype.filter.call(
|
|
530
503
|
document.querySelectorAll(queryString),
|
|
531
504
|
(elem) => {
|
|
532
505
|
/*check for visibility while always include the current activeElement*/
|
|
533
|
-
return
|
|
534
|
-
|
|
535
|
-
elem.offsetHeight > 0 ||
|
|
536
|
-
elem === activeElem
|
|
537
|
-
)
|
|
538
|
-
},
|
|
506
|
+
return elem.offsetWidth > 0 || elem.offsetHeight > 0 || elem === activeElem;
|
|
507
|
+
}
|
|
539
508
|
),
|
|
540
509
|
indexedList = queryResult
|
|
541
510
|
.slice()
|
|
542
511
|
.filter((elem) => {
|
|
543
512
|
/* filter out all indexes not greater than 0 */
|
|
544
|
-
return elem.tabIndex == 0 || elem.tabIndex == -1 ? false : true
|
|
513
|
+
return elem.tabIndex == 0 || elem.tabIndex == -1 ? false : true;
|
|
545
514
|
})
|
|
546
515
|
.sort((a, b) => {
|
|
547
516
|
/* sort the array by index from smallest to largest */
|
|
@@ -549,34 +518,33 @@ export default {
|
|
|
549
518
|
? a.tabIndex < b.tabIndex
|
|
550
519
|
? -1
|
|
551
520
|
: b.tabIndex < a.tabIndex
|
|
552
|
-
|
|
553
|
-
|
|
521
|
+
? 1
|
|
522
|
+
: 0
|
|
554
523
|
: a.tabIndex != 0
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
524
|
+
? -1
|
|
525
|
+
: b.tabIndex != 0
|
|
526
|
+
? 1
|
|
527
|
+
: 0;
|
|
559
528
|
}),
|
|
560
529
|
focusable = [].concat(
|
|
561
530
|
indexedList,
|
|
562
531
|
queryResult.filter((elem) => {
|
|
563
532
|
/* filter out all indexes above 0 */
|
|
564
|
-
return elem.tabIndex == 0 || elem.tabIndex == -1 ? true : false
|
|
565
|
-
})
|
|
566
|
-
)
|
|
533
|
+
return elem.tabIndex == 0 || elem.tabIndex == -1 ? true : false;
|
|
534
|
+
})
|
|
535
|
+
);
|
|
567
536
|
|
|
568
537
|
/* if reverse is true return the previous focusable element
|
|
569
538
|
if reverse is false return the next focusable element */
|
|
570
539
|
return reverse
|
|
571
|
-
? focusable[focusable.indexOf(activeElem) - 1] ||
|
|
572
|
-
|
|
573
|
-
: focusable[focusable.indexOf(activeElem) + 1] || focusable[0]
|
|
540
|
+
? focusable[focusable.indexOf(activeElem) - 1] || focusable[focusable.length - 1]
|
|
541
|
+
: focusable[focusable.indexOf(activeElem) + 1] || focusable[0];
|
|
574
542
|
},
|
|
575
543
|
},
|
|
576
|
-
}
|
|
544
|
+
};
|
|
577
545
|
</script>
|
|
578
546
|
<style lang="scss" scoped>
|
|
579
|
-
@import
|
|
547
|
+
@import "../../../includes/scss/all";
|
|
580
548
|
$cardTextPadding: 16px;
|
|
581
549
|
$borderRadius: 8px;
|
|
582
550
|
|
|
@@ -597,8 +565,14 @@ $borderRadius: 8px;
|
|
|
597
565
|
.card_group {
|
|
598
566
|
&--resource-list {
|
|
599
567
|
:deep(.card-body) {
|
|
600
|
-
padding-left:
|
|
601
|
-
padding-right:
|
|
568
|
+
padding-left: 13px !important;
|
|
569
|
+
padding-right: 13px !important;
|
|
570
|
+
}
|
|
571
|
+
@media screen and (min-width: 768px) {
|
|
572
|
+
:deep(.card-body) {
|
|
573
|
+
padding-left: $cardTextPadding !important;
|
|
574
|
+
padding-right: $cardTextPadding !important;
|
|
575
|
+
}
|
|
602
576
|
}
|
|
603
577
|
}
|
|
604
578
|
}
|
|
@@ -185,6 +185,7 @@ $white: #ffffff !default;
|
|
|
185
185
|
&--resource-list {
|
|
186
186
|
flex: 0 0 100%;
|
|
187
187
|
max-width: 100%;
|
|
188
|
+
padding: 0;
|
|
188
189
|
@media screen and (min-width: 768px) {
|
|
189
190
|
flex: 0 0 29%;
|
|
190
191
|
max-width: 29%;
|
|
@@ -209,6 +210,7 @@ $white: #ffffff !default;
|
|
|
209
210
|
background-color: $lightgray;
|
|
210
211
|
border-radius: 0 0px 5px 5px;
|
|
211
212
|
margin-left: -16px;
|
|
213
|
+
margin-right: -16px;
|
|
212
214
|
justify-content: space-between;
|
|
213
215
|
}
|
|
214
216
|
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
v-model="searchQuery"
|
|
17
17
|
name="search"
|
|
18
18
|
aria-label="searchbar"
|
|
19
|
-
debounce="600"
|
|
20
19
|
autocomplete="off"
|
|
21
20
|
trim
|
|
22
21
|
@update="searchType !== 'googlerest' ? onChange : () => {}"
|
|
@@ -58,6 +57,7 @@ import searchIcon from '../../../assets/icons/search.svg?url'
|
|
|
58
57
|
import SearchListing from './SearchListing/index.vue'
|
|
59
58
|
import { BButton, BInputGroup, BFormInput } from 'bootstrap-vue-next'
|
|
60
59
|
|
|
60
|
+
|
|
61
61
|
export default {
|
|
62
62
|
components: { SearchListing, BButton, BInputGroup, BFormInput },
|
|
63
63
|
props: {
|
|
@@ -235,11 +235,14 @@ export default {
|
|
|
235
235
|
}
|
|
236
236
|
},
|
|
237
237
|
onSearch(e) {
|
|
238
|
+
// debugger
|
|
238
239
|
const { path } = this.$route || {}
|
|
239
240
|
|
|
241
|
+
|
|
242
|
+
|
|
240
243
|
// Home page
|
|
241
244
|
if (
|
|
242
|
-
(e?.type === 'click' || e?.key
|
|
245
|
+
(e?.type === 'click' || e?.key == 'Enter') &&
|
|
243
246
|
this.searchQuery &&
|
|
244
247
|
this.searchQuery.length > 2 &&
|
|
245
248
|
path === '/'
|
|
@@ -279,6 +282,8 @@ export default {
|
|
|
279
282
|
}
|
|
280
283
|
},
|
|
281
284
|
onChange(e) {
|
|
285
|
+
//debugger
|
|
286
|
+
|
|
282
287
|
if (this.searchQuery && this.searchQuery.length > 2) {
|
|
283
288
|
this.onSearch(e)
|
|
284
289
|
}
|
|
@@ -741,4 +746,4 @@ export default {
|
|
|
741
746
|
width: 85% !important;
|
|
742
747
|
}
|
|
743
748
|
}
|
|
744
|
-
</style>
|
|
749
|
+
</style>
|