@worksafevictoria/wcl7.5 1.6.0 → 1.7.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 +3 -2
- package/src/components/Common/CardGridItem/card-grid-item-icon.vue +15 -19
- 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 +321 -0
- package/src/components/Paragraphs/Directory/HSCP/Records/index.stories.js +19 -0
- package/src/components/Paragraphs/Directory/HSCP/Records/index.vue +345 -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 +295 -0
- package/src/components/Paragraphs/Map/postcode_location.json +3543 -0
- 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/Search/index.vue +7 -2
- 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
|
@@ -4,6 +4,7 @@ const cpData =
|
|
|
4
4
|
{
|
|
5
5
|
title: 'Australian Nurses and Midwifery Federation - Victorian Branch',
|
|
6
6
|
fullAddress: 'Level 8/535 Elizabeth St Melbourne VIC 3000',
|
|
7
|
+
orgAcronym: 'ANMF',
|
|
7
8
|
workPhone: '03 9555 9333',
|
|
8
9
|
tollfreePhone: '1800 555 333',
|
|
9
10
|
email: 'ohs@test.com.au',
|
|
@@ -14,14 +15,14 @@ const cpData =
|
|
|
14
15
|
contact2: 'Joey Bradford',
|
|
15
16
|
phone2: '03 9555 0666',
|
|
16
17
|
email2: 'jbradford@test.com.au',
|
|
17
|
-
courses:
|
|
18
|
-
trainingVenues:
|
|
18
|
+
courses: 'HSR Initial, HSR Refresher',
|
|
19
|
+
trainingVenues: 'Melbourne CBD, All Regional Victoria - HQ in Melbourne',
|
|
19
20
|
id: '1'
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
|
|
23
24
|
export default {
|
|
24
|
-
title: 'Paragraphs/Directory/SingleRecord',
|
|
25
|
+
title: 'Paragraphs/Directory/HSCP/SingleRecord',
|
|
25
26
|
component: hscpRecord,
|
|
26
27
|
tags: ['autodocs']
|
|
27
28
|
}
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="paragraph--directory__records--hscp">
|
|
3
|
+
<!-- Main details -->
|
|
4
|
+
<container>
|
|
5
|
+
<row class="records">
|
|
6
|
+
<column md="2" sm="12" class="title" >
|
|
7
|
+
<a v-if="item.title" href="javascript:void(0)" @click="this.visible = !this.visible">
|
|
8
|
+
{{ item.title }}
|
|
9
|
+
</a>
|
|
10
|
+
</column>
|
|
11
|
+
<column md="2" sm="12" class="address" >
|
|
12
|
+
<a v-if="item.fullAddress" target="_blank" :href="gMapLink"><span class="sr-only visually-hidden">Address</span>
|
|
13
|
+
{{ item.fullAddress }}
|
|
14
|
+
</a>
|
|
15
|
+
</column>
|
|
16
|
+
<column md="2" sm="12" class="coldata longstring" >
|
|
17
|
+
<div class="label">Email</div>
|
|
18
|
+
<a v-if="item.email" target="_blank" :href="`mailto:${item.email}`"><span class="sr-only visually-hidden">Email address</span>
|
|
19
|
+
{{ item.email }}
|
|
20
|
+
</a>
|
|
21
|
+
</column>
|
|
22
|
+
<column md="3" sm="12" class="coldata longstring" >
|
|
23
|
+
<div class="label">Website</div>
|
|
24
|
+
<a v-if="item.website" target="_blank" :href="`${item.website}`"><span class="sr-only visually-hidden">Website address</span>
|
|
25
|
+
{{ item.website }}
|
|
26
|
+
</a>
|
|
27
|
+
</column>
|
|
28
|
+
<column md="2" sm="12" class="coldata" >
|
|
29
|
+
<div class="label">Phone</div>
|
|
30
|
+
<a v-if="item.tollfreePhone || item.workPhone" :href="`tel:${item.tollfreephone || item.workphone}`"><span class="sr-only visually-hidden">Phone number</span>
|
|
31
|
+
{{ item.tollfreePhone || item.workPhone }}
|
|
32
|
+
</a>
|
|
33
|
+
</column>
|
|
34
|
+
</row>
|
|
35
|
+
<div class="hscp-caret" >
|
|
36
|
+
<a v-if="visible" href="javascript:void(0)" @click="this.visible = false">
|
|
37
|
+
<img
|
|
38
|
+
:src="CaretUp"
|
|
39
|
+
height="12"
|
|
40
|
+
width="17"
|
|
41
|
+
alt="Expand Detail">
|
|
42
|
+
</a>
|
|
43
|
+
<a v-if="!visible" href="javascript:void(0)" @click="this.visible = true">
|
|
44
|
+
<img
|
|
45
|
+
:src="CaretDown"
|
|
46
|
+
height="12"
|
|
47
|
+
width="17"
|
|
48
|
+
alt="Expand Detail">
|
|
49
|
+
</a>
|
|
50
|
+
</div>
|
|
51
|
+
</container>
|
|
52
|
+
|
|
53
|
+
<!-- Additional Content -->
|
|
54
|
+
<container>
|
|
55
|
+
<div v-if="this.visible">
|
|
56
|
+
<div style="padding-top: 20px;">
|
|
57
|
+
<hr>
|
|
58
|
+
</div>
|
|
59
|
+
<row >
|
|
60
|
+
<column >
|
|
61
|
+
<h4>Contact Information</h4>
|
|
62
|
+
</column>
|
|
63
|
+
</row>
|
|
64
|
+
<row>
|
|
65
|
+
<column sm="2" class="label">
|
|
66
|
+
Contact
|
|
67
|
+
</column>
|
|
68
|
+
<column sm="4" class="hscp-additional-records">
|
|
69
|
+
{{item.contact1}}
|
|
70
|
+
</column>
|
|
71
|
+
<column sm="2" class="label">
|
|
72
|
+
Contact
|
|
73
|
+
</column>
|
|
74
|
+
<column sm="4" class="hscp-additional-records">
|
|
75
|
+
{{item.contact2}}
|
|
76
|
+
</column>
|
|
77
|
+
</row>
|
|
78
|
+
<row>
|
|
79
|
+
<column sm="2" class="label">
|
|
80
|
+
Phone
|
|
81
|
+
</column>
|
|
82
|
+
<column sm="4" class="hscp-additional-records">
|
|
83
|
+
{{item.phone1}}
|
|
84
|
+
</column>
|
|
85
|
+
<column sm="2" class="label">
|
|
86
|
+
Phone
|
|
87
|
+
</column>
|
|
88
|
+
<column sm="4" class="hscp-additional-records">
|
|
89
|
+
{{item.phone2}}
|
|
90
|
+
</column>
|
|
91
|
+
</row>
|
|
92
|
+
<row>
|
|
93
|
+
<column sm="2" class="label">
|
|
94
|
+
Email
|
|
95
|
+
</column>
|
|
96
|
+
<column sm="4" class="hscp-additional-records">
|
|
97
|
+
{{item.email1}}
|
|
98
|
+
</column>
|
|
99
|
+
<column sm="2" class="label">
|
|
100
|
+
Email
|
|
101
|
+
</column>
|
|
102
|
+
<column sm="4" class="hscp-additional-records">
|
|
103
|
+
{{item.email2}}
|
|
104
|
+
</column>
|
|
105
|
+
</row>
|
|
106
|
+
<row class="row-hscp-additional">
|
|
107
|
+
<column>
|
|
108
|
+
<h4>Training Venue Locations</h4>
|
|
109
|
+
</column>
|
|
110
|
+
</row>
|
|
111
|
+
<row class="hscp-additional-records">
|
|
112
|
+
<column v-if="item.trainingVenues.length" >
|
|
113
|
+
<ul>
|
|
114
|
+
<li v-for="(venue) in item.trainingVenues.split(',')" :key="venue.id">
|
|
115
|
+
{{venue}}
|
|
116
|
+
</li>
|
|
117
|
+
</ul>
|
|
118
|
+
</column>
|
|
119
|
+
<column v-else-if="!item.trainingVenues.length">
|
|
120
|
+
<p>No training venues</p>
|
|
121
|
+
</column>
|
|
122
|
+
</row>
|
|
123
|
+
<row class="row-hscp-additional">
|
|
124
|
+
<column>
|
|
125
|
+
<h4>Training Courses</h4>
|
|
126
|
+
</column>
|
|
127
|
+
</row>
|
|
128
|
+
<row class="hscp-additional-records">
|
|
129
|
+
<column>
|
|
130
|
+
<ul>
|
|
131
|
+
<li v-for="(course) in item.courses.split(',')" :key="course.id">
|
|
132
|
+
{{course}}
|
|
133
|
+
</li>
|
|
134
|
+
</ul>
|
|
135
|
+
</column>
|
|
136
|
+
</row>
|
|
137
|
+
</div>
|
|
138
|
+
</container>
|
|
139
|
+
|
|
140
|
+
</div>
|
|
141
|
+
</template>
|
|
142
|
+
<script>
|
|
143
|
+
import Container from '../../../../../Containers/Container/index.vue'
|
|
144
|
+
import Row from '../../../../../Containers/Row/index.vue'
|
|
145
|
+
import Column from '../../../../../Containers/Column/index.vue'
|
|
146
|
+
import CaretUp from './../../../../../../assets/icons/caret-up.svg?url'
|
|
147
|
+
import CaretDown from './../../../../../../assets/icons/caret-down.svg?url'
|
|
148
|
+
|
|
149
|
+
export default {
|
|
150
|
+
components: {
|
|
151
|
+
Container,
|
|
152
|
+
Row,
|
|
153
|
+
Column,
|
|
154
|
+
},
|
|
155
|
+
props: {
|
|
156
|
+
item: {
|
|
157
|
+
type: Object,
|
|
158
|
+
required: true
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
data() {
|
|
162
|
+
return {
|
|
163
|
+
visible: false,
|
|
164
|
+
CaretUp,
|
|
165
|
+
CaretDown,
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
computed: {
|
|
169
|
+
gMapLink() {
|
|
170
|
+
return `https://google.com/maps?q=${this.item.title}%20${this.item.fullAddress}`
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
methods: {
|
|
174
|
+
handleClick(title) {
|
|
175
|
+
this.visible = !this.visible
|
|
176
|
+
if (this.$gtm) {
|
|
177
|
+
if (this.visible) {
|
|
178
|
+
this.$gtm.push({ event: 'custom.search.prs.open', title })
|
|
179
|
+
} else {
|
|
180
|
+
this.$gtm.push({
|
|
181
|
+
event: 'custom.search.prs.close',
|
|
182
|
+
title
|
|
183
|
+
})
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
</script>
|
|
190
|
+
|
|
191
|
+
<style lang="scss" scoped>
|
|
192
|
+
@import '../../../styles.scss';
|
|
193
|
+
|
|
194
|
+
.row-hscp-additional {
|
|
195
|
+
margin-top: 20px;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.hscp-additional-records {
|
|
199
|
+
font-size: 16px;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.hscp-caret {
|
|
203
|
+
justify-content: end;
|
|
204
|
+
align-content: end;
|
|
205
|
+
max-width: 20px;
|
|
206
|
+
padding-right: 0px;
|
|
207
|
+
padding-bottom: 10px;
|
|
208
|
+
float:right;
|
|
209
|
+
}
|
|
210
|
+
.paragraph--directory__records--hscp {
|
|
211
|
+
|
|
212
|
+
padding-bottom: 20px !important;
|
|
213
|
+
|
|
214
|
+
a {
|
|
215
|
+
color: $black;
|
|
216
|
+
text-decoration: none;
|
|
217
|
+
}
|
|
218
|
+
a:hover {
|
|
219
|
+
text-decoration: underline;
|
|
220
|
+
}
|
|
221
|
+
a:focus {
|
|
222
|
+
text-decoration: underline;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.name {
|
|
226
|
+
font-size: 1rem;
|
|
227
|
+
color: $black;
|
|
228
|
+
font-weight: 700;
|
|
229
|
+
}
|
|
230
|
+
.address {
|
|
231
|
+
font-size: 15px;
|
|
232
|
+
a {
|
|
233
|
+
color: inherit;
|
|
234
|
+
text-decoration: none;
|
|
235
|
+
}
|
|
236
|
+
a:hover {
|
|
237
|
+
text-decoration: underline;
|
|
238
|
+
}
|
|
239
|
+
a:focus {
|
|
240
|
+
text-decoration: underline;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
.coldata {
|
|
244
|
+
a {
|
|
245
|
+
color: inherit;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
.label {
|
|
249
|
+
font-size: 16px;
|
|
250
|
+
font-weight: bold;
|
|
251
|
+
}
|
|
252
|
+
.longstring {
|
|
253
|
+
word-break: break-all;
|
|
254
|
+
}
|
|
255
|
+
.search {
|
|
256
|
+
color: $black;
|
|
257
|
+
border: 1px solid $gray;
|
|
258
|
+
border-radius: 8px;
|
|
259
|
+
padding: 10px 12px;
|
|
260
|
+
height: 42px;
|
|
261
|
+
background-repeat: no-repeat;
|
|
262
|
+
background-position: 96% 12px;
|
|
263
|
+
margin-bottom: 16px;
|
|
264
|
+
transition: none;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.paragraph--directory.hscp-filters {
|
|
269
|
+
.search {
|
|
270
|
+
color: $black;
|
|
271
|
+
border: 1px solid $gray;
|
|
272
|
+
border-radius: 8px;
|
|
273
|
+
padding: 10px 12px;
|
|
274
|
+
height: 42px;
|
|
275
|
+
background-repeat: no-repeat;
|
|
276
|
+
background-position: 96% 12px;
|
|
277
|
+
margin-bottom: 16px;
|
|
278
|
+
transition: none;
|
|
279
|
+
}
|
|
280
|
+
select {
|
|
281
|
+
-moz-appearance: none; /* Firefox */
|
|
282
|
+
-webkit-appearance: none; /* Safari and Chrome */
|
|
283
|
+
appearance: none;
|
|
284
|
+
height: 42px;
|
|
285
|
+
border-radius: 8px;
|
|
286
|
+
padding: 10px 12px;
|
|
287
|
+
width: 100%;
|
|
288
|
+
border: 1px solid $gray;
|
|
289
|
+
background-image: url('@worksafevictoria/wcl7.5/src/assets/icons/caret-down.svg');
|
|
290
|
+
background-position: 95% 50%;
|
|
291
|
+
background-repeat: no-repeat;
|
|
292
|
+
text-transform: capitalise;
|
|
293
|
+
}
|
|
294
|
+
.grid-column {
|
|
295
|
+
display: inline-block;
|
|
296
|
+
width: 25%;
|
|
297
|
+
|
|
298
|
+
@media (max-width: 767px) {
|
|
299
|
+
width: 50%;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
@media (max-width: 539px) {
|
|
303
|
+
display: block;
|
|
304
|
+
width: 100%;
|
|
305
|
+
float: none;
|
|
306
|
+
margin-bottom: 16px;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
.right {
|
|
310
|
+
float: right;
|
|
311
|
+
position: relative;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.records {
|
|
315
|
+
padding: 0px;
|
|
316
|
+
margin: 0;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
}
|
|
320
|
+
</style>
|
|
321
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Records from './index.vue'
|
|
2
|
+
import { hscpData } from '../../../../../mock/course-provider'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Paragraphs/Directory/HSCP/Records',
|
|
7
|
+
component: Records,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
data() {
|
|
10
|
+
return {
|
|
11
|
+
hscpData
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
args: {
|
|
15
|
+
items: hscpData,
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const CourseProvider = {}
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section-group class="paragraph--directory hscp-filters">
|
|
3
|
+
<!-- Filters -->
|
|
4
|
+
<row style="column-gap: 16px;">
|
|
5
|
+
<!-- Keyword Filters -->
|
|
6
|
+
<column xxl="2" xl="3" md="4" sm="6">
|
|
7
|
+
<label class="visually-hidden" for="search-directory">
|
|
8
|
+
Search by keyword (typed keyword automatically filters below results)
|
|
9
|
+
</label>
|
|
10
|
+
<input type="text" v-model="searchOrg" placeholder="Search organisation" class="search">
|
|
11
|
+
</column>
|
|
12
|
+
<column xxl="2" xl="3" md="4" sm="6">
|
|
13
|
+
<label class="visually-hidden" for="search-directory">
|
|
14
|
+
Search by suburb (typed suburb automatically filters below results)
|
|
15
|
+
</label>
|
|
16
|
+
<input type="text" v-model="searchSub" placeholder="Search suburb" class="search">
|
|
17
|
+
</column>
|
|
18
|
+
<!-- Other Filters -->
|
|
19
|
+
<column xxl="2" xl="3" md="4" sm="6">
|
|
20
|
+
<select id="filterType" v-model="searchCourse" name="filter" class="selectClass">
|
|
21
|
+
<option class="placeholder" value="" disabled hidden selected>Search course type</option>
|
|
22
|
+
<option value="HSR Initial">HSR Initial</option>
|
|
23
|
+
<option value="HSR Refresher">HSR Refresher</option>
|
|
24
|
+
</select>
|
|
25
|
+
</column>
|
|
26
|
+
<column xxl="2" xl="3" md="4" sm="6">
|
|
27
|
+
<select id="filterTheme" v-model="searchThemes" name="filter1" class="selectClass">
|
|
28
|
+
<option class="placeholder" value="" disabled hidden selected>Search theme</option>
|
|
29
|
+
<option v-for="(opt, i) in themeOptions" :key="i" :value="opt">
|
|
30
|
+
{{ opt }}
|
|
31
|
+
</option>
|
|
32
|
+
</select>
|
|
33
|
+
</column>
|
|
34
|
+
<column md="2">
|
|
35
|
+
<filter-button
|
|
36
|
+
v-if="!hideReset"
|
|
37
|
+
filter-button="!hideReset"
|
|
38
|
+
:is-reset="true"
|
|
39
|
+
class="filterButton__button filterButton__button--reset"
|
|
40
|
+
@clicked="reset"
|
|
41
|
+
/>
|
|
42
|
+
</column>
|
|
43
|
+
</row>
|
|
44
|
+
<!-- HSCP Records -->
|
|
45
|
+
<div class="hscpRecords">
|
|
46
|
+
<template v-for="(item, index) in resultChunks[page]">
|
|
47
|
+
<hscp-record v-if="item.type === 'hscp'" :key="index" :item="item" />
|
|
48
|
+
</template>
|
|
49
|
+
</div>
|
|
50
|
+
<div v-if="filteredRecords.length > 0" align-items="center">
|
|
51
|
+
<pagination
|
|
52
|
+
:total-pages="totalPages"
|
|
53
|
+
:total="totalResults"
|
|
54
|
+
:per-page="perPage"
|
|
55
|
+
:current-page="page + 1"
|
|
56
|
+
@pagechanged="pageChanged($event)"
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
<h2 v-if="filteredRecords.length === 0">No records found</h2>
|
|
60
|
+
|
|
61
|
+
</section-group>
|
|
62
|
+
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<script>
|
|
66
|
+
|
|
67
|
+
import hscpRecord from './SingleRecord/index.vue'
|
|
68
|
+
import searchIcon from './../../../../../assets/icons/search.svg?url'
|
|
69
|
+
import SectionGroup from '../../../../Containers/SectionGroup/index.vue'
|
|
70
|
+
import FilterButton from '../../../../Common/FilterButton/index.vue' //Reset
|
|
71
|
+
import Pagination from './pagination.vue'
|
|
72
|
+
|
|
73
|
+
export default {
|
|
74
|
+
name: 'HSCP',
|
|
75
|
+
components: {
|
|
76
|
+
hscpRecord,
|
|
77
|
+
SectionGroup,
|
|
78
|
+
FilterButton,
|
|
79
|
+
Pagination
|
|
80
|
+
},
|
|
81
|
+
data() {
|
|
82
|
+
return {
|
|
83
|
+
searchOrg: '',
|
|
84
|
+
searchSub: '',
|
|
85
|
+
searchCourse: '',
|
|
86
|
+
searchThemes: '',
|
|
87
|
+
filteredItems: null,
|
|
88
|
+
perPage: 10,
|
|
89
|
+
page: 0,
|
|
90
|
+
searchIcon,
|
|
91
|
+
hideReset: true,
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
props: {
|
|
95
|
+
items: {
|
|
96
|
+
type: Array,
|
|
97
|
+
required: true,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
computed: {
|
|
102
|
+
|
|
103
|
+
themeOptions() {
|
|
104
|
+
// Requirement to remove certain values from original courses
|
|
105
|
+
let allThemes = this.flatRecords.map(a => a.courses)
|
|
106
|
+
allThemes = allThemes.join(',')
|
|
107
|
+
allThemes = allThemes.replace(/HSR initial/g, '')
|
|
108
|
+
allThemes = allThemes.replace(/HSR Initial/g, '')
|
|
109
|
+
allThemes = allThemes.replace(/HSR refresher - /g, '')
|
|
110
|
+
allThemes = allThemes.replace(/HSR Refresher - /g, '')
|
|
111
|
+
allThemes = allThemes.replace(/HSR refresher/g, '')
|
|
112
|
+
allThemes = allThemes.replace(/HSR Refresher/g, '')
|
|
113
|
+
allThemes = allThemes.trim()
|
|
114
|
+
allThemes = allThemes.split(',')
|
|
115
|
+
// Remove duplicates
|
|
116
|
+
let s = new Set(allThemes)
|
|
117
|
+
allThemes = [...s]
|
|
118
|
+
// Remove blank values - not completely successful
|
|
119
|
+
allThemes = allThemes.filter(n => n)
|
|
120
|
+
|
|
121
|
+
// Sort the themes
|
|
122
|
+
let sortedThemes = allThemes.sort((a, b) => {
|
|
123
|
+
if (a.trim() < b.trim()) {
|
|
124
|
+
return -1;
|
|
125
|
+
}
|
|
126
|
+
if (a.trim() > b.trim()) {
|
|
127
|
+
return 1;
|
|
128
|
+
}
|
|
129
|
+
return 0;
|
|
130
|
+
})
|
|
131
|
+
if (sortedThemes[0].type === undefined) {
|
|
132
|
+
sortedThemes.splice(0, 1)
|
|
133
|
+
}
|
|
134
|
+
allThemes = sortedThemes
|
|
135
|
+
return allThemes
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
filteredRecords() {
|
|
139
|
+
let results = this.flatRecords
|
|
140
|
+
|
|
141
|
+
if (this.searchOrg.length) {
|
|
142
|
+
this.hideReset = false
|
|
143
|
+
results = results.filter(item => item.title.toLowerCase().includes(this.searchOrg.toLowerCase()))
|
|
144
|
+
}
|
|
145
|
+
if (this.searchSub.length) {
|
|
146
|
+
this.hideReset = false
|
|
147
|
+
results = results.filter(item => item.trainingVenues.toLowerCase().includes(this.searchSub.toLowerCase()))
|
|
148
|
+
}
|
|
149
|
+
if (this.searchCourse.length) {
|
|
150
|
+
this.hideReset = false
|
|
151
|
+
results = results.filter(item => item.courses.toLowerCase().includes(this.searchCourse.toLowerCase()))
|
|
152
|
+
}
|
|
153
|
+
if (this.searchThemes.length) {
|
|
154
|
+
this.hideReset = false
|
|
155
|
+
results = results.filter(item => item.courses.toLowerCase().includes(this.searchThemes.toLowerCase()))
|
|
156
|
+
}
|
|
157
|
+
this.filteredItems = results
|
|
158
|
+
return results
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
flatRecords() {
|
|
162
|
+
let flatRecords = []
|
|
163
|
+
const sortedItems = this.items.sort((a, b) => {
|
|
164
|
+
if (a.Organisation < b.Organisation) {
|
|
165
|
+
return -1;
|
|
166
|
+
}
|
|
167
|
+
if (a.Organisation > b.Organisation) {
|
|
168
|
+
return 1;
|
|
169
|
+
}
|
|
170
|
+
return 0;
|
|
171
|
+
})
|
|
172
|
+
sortedItems.forEach((record) => {
|
|
173
|
+
flatRecords.push({
|
|
174
|
+
type: 'hscp',
|
|
175
|
+
title: record.Organisation,
|
|
176
|
+
fullAddress: record.Main_office_address,
|
|
177
|
+
orgAcronym: record.Organisation_acronym,
|
|
178
|
+
workPhone: record.Work_phone,
|
|
179
|
+
tollfreePhone: record.Toll_free_phone,
|
|
180
|
+
email: record.Email1,
|
|
181
|
+
website: this.formatWebsite(record.Website),
|
|
182
|
+
contact1: record.Contact_1,
|
|
183
|
+
email1: record.Contact_1_Email,
|
|
184
|
+
phone1: record.Contact_1_Phone,
|
|
185
|
+
contact2: record.Contact_2_Name,
|
|
186
|
+
email2: record.Contact_2_Email,
|
|
187
|
+
phone2: record.Contact_2_Phone,
|
|
188
|
+
courses: record.Training_courses.replace(/,$/, ''),
|
|
189
|
+
trainingVenues: record.Training_venues
|
|
190
|
+
})
|
|
191
|
+
})
|
|
192
|
+
return flatRecords
|
|
193
|
+
},
|
|
194
|
+
resultChunks() {
|
|
195
|
+
return this.chunkify(this.filteredItems || this.items, this.perPage)
|
|
196
|
+
},
|
|
197
|
+
noRecordsFound() {
|
|
198
|
+
return this.resultChunks[0].length === 0
|
|
199
|
+
},
|
|
200
|
+
totalResults() {
|
|
201
|
+
return Array.isArray(this.filteredItems) ? this.filteredItems.length : 0
|
|
202
|
+
},
|
|
203
|
+
totalPages() {
|
|
204
|
+
return this.resultChunks.length
|
|
205
|
+
},
|
|
206
|
+
pageResultCount() {
|
|
207
|
+
return this.resultChunks[this.page].length
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
methods: {
|
|
212
|
+
|
|
213
|
+
formatWebsite(url) {
|
|
214
|
+
let startUrl = url.slice(0, 3)
|
|
215
|
+
if (startUrl.toLowerCase() === 'www') {
|
|
216
|
+
return 'http://' + url
|
|
217
|
+
} else {
|
|
218
|
+
return url
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
|
|
222
|
+
chunkify(arr, n) {
|
|
223
|
+
if (arr) {
|
|
224
|
+
const chunked = arr.reduce(
|
|
225
|
+
(chunk, val) => {
|
|
226
|
+
if (chunk[chunk.length - 1].length === n) chunk.push([])
|
|
227
|
+
chunk[chunk.length - 1].push(val)
|
|
228
|
+
return chunk
|
|
229
|
+
},
|
|
230
|
+
[[]]
|
|
231
|
+
)
|
|
232
|
+
return chunked
|
|
233
|
+
}
|
|
234
|
+
return [[]]
|
|
235
|
+
},
|
|
236
|
+
|
|
237
|
+
reset() {
|
|
238
|
+
this.hideReset = true
|
|
239
|
+
this.searchOrg = ''
|
|
240
|
+
this.searchCourse = ''
|
|
241
|
+
this.searchSub = ''
|
|
242
|
+
this.searchThemes = ''
|
|
243
|
+
},
|
|
244
|
+
|
|
245
|
+
pageChanged(ev) {
|
|
246
|
+
this.page = ev - 1
|
|
247
|
+
if (this.pageResultCount < this.perPage) {
|
|
248
|
+
console.log('scroll to records')
|
|
249
|
+
this.scrollToRecords()
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
scrollToRecords() {
|
|
253
|
+
if (this.$refs.records) {
|
|
254
|
+
const element = this.$refs.records
|
|
255
|
+
const top = element.offsetTop
|
|
256
|
+
|
|
257
|
+
const buttons = [...element.querySelectorAll('button')]
|
|
258
|
+
if (Array.isArray(buttons) && buttons.length > 0) {
|
|
259
|
+
buttons
|
|
260
|
+
.filter((button) => button.getAttribute('aria-expanded') === 'true')
|
|
261
|
+
.forEach((button) => button.click())
|
|
262
|
+
|
|
263
|
+
buttons[0].focus()
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
window.scrollTo({
|
|
267
|
+
top,
|
|
268
|
+
behavior: 'smooth',
|
|
269
|
+
})
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
</script>
|
|
275
|
+
|
|
276
|
+
<style lang="scss" scoped>
|
|
277
|
+
@import '../../styles.scss';
|
|
278
|
+
.paragraph--directory.hscp-filters {
|
|
279
|
+
|
|
280
|
+
.selectClass {
|
|
281
|
+
display:inline-block;
|
|
282
|
+
height: 42px;
|
|
283
|
+
border-radius: 8px;
|
|
284
|
+
padding: 10px 12px;
|
|
285
|
+
width: 200px;
|
|
286
|
+
border: 1px solid $gray;
|
|
287
|
+
margin-right: 16px;
|
|
288
|
+
margin-bottom: 16px;
|
|
289
|
+
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.search {
|
|
293
|
+
display: inline-block;
|
|
294
|
+
color: $black;
|
|
295
|
+
border: 1px solid $gray;
|
|
296
|
+
border-radius: 8px;
|
|
297
|
+
padding: 10px 12px;
|
|
298
|
+
height: 42px;
|
|
299
|
+
background-image: url('./../../../../../assets/icons/search.svg');
|
|
300
|
+
background-repeat: no-repeat !important;
|
|
301
|
+
background-position: 96% 12px;
|
|
302
|
+
margin-bottom: 16px;
|
|
303
|
+
margin-right: 16px;
|
|
304
|
+
transition: none;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.grid-column {
|
|
308
|
+
display: inline-block;
|
|
309
|
+
width: 25%;
|
|
310
|
+
|
|
311
|
+
@media (max-width: 767px) {
|
|
312
|
+
width: 50%;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
@media (max-width: 539px) {
|
|
316
|
+
display: block;
|
|
317
|
+
width: 100%;
|
|
318
|
+
float: none;
|
|
319
|
+
margin-bottom: 16px;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
}
|
|
323
|
+
.right {
|
|
324
|
+
float: right;
|
|
325
|
+
position: relative;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.records {
|
|
329
|
+
padding: 0;
|
|
330
|
+
margin: 0;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.filterButton__button--reset {
|
|
335
|
+
display: inline-block !important;
|
|
336
|
+
float: right;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.hscpRecords {
|
|
340
|
+
padding-top: 16px;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
</style>
|