@worksafevictoria/wcl7.5 1.10.0 → 1.11.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.
Files changed (39) hide show
  1. package/package.json +1 -1
  2. package/src/assets/styles/generated-icons.scss +46 -46
  3. package/src/components/Common/CardGridItem/card-grid-item-caret.vue +39 -45
  4. package/src/components/Common/CardGridItem/card-grid-item-icon.vue +1 -1
  5. package/src/components/Common/CardGridItem/index.vue +8 -2
  6. package/src/components/Containers/Carousel/index.stories.js +6 -4
  7. package/src/components/Containers/Carousel/index.vue +131 -120
  8. package/src/components/Containers/HomepageHeader/index.stories.js +1 -1
  9. package/src/components/Containers/HomepageHeaderNew/index.stories.js +3 -15
  10. package/src/components/Containers/HomepageHeaderNew/index.vue +3 -7
  11. package/src/components/Global/AppFooter/index.vue +130 -137
  12. package/src/components/Global/AppHeader/ModalSearch/index.vue +7 -1
  13. package/src/components/Global/AppHeader/index.stories.js +2 -2
  14. package/src/components/Global/AppHeaderNew/ModalSearch/index.vue +21 -17
  15. package/src/components/Global/AppHeaderNew/index.stories.js +2 -2
  16. package/src/components/Global/AppHeaderNew/index.vue +53 -24
  17. package/src/components/Global/BackToTop/index.vue +16 -16
  18. package/src/components/Global/ContrastMode/index.stories.js +1 -1
  19. package/src/components/Global/HeroHeader/index.vue +62 -73
  20. package/src/components/Global/SocialShare/index.vue +114 -129
  21. package/src/components/Global/Strip/index.vue +9 -5
  22. package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +22 -24
  23. package/src/components/Paragraphs/Accordion/StepperItem/index.vue +15 -15
  24. package/src/components/Paragraphs/Calculator/CardContainer/index.vue +74 -75
  25. package/src/components/Paragraphs/Calculator/RiskLevel/index.vue +31 -39
  26. package/src/components/Paragraphs/Directory/Asbestos/Records/SingleRecord/index.vue +104 -107
  27. package/src/components/Paragraphs/Directory/Asbestos/Records/index.vue +152 -120
  28. package/src/components/Paragraphs/Directory/HSCP/Records/SingleRecord/index.vue +127 -133
  29. package/src/components/Paragraphs/Directory/HSCP/Records/index.vue +158 -128
  30. package/src/components/Paragraphs/Tabs/index.vue +4 -4
  31. package/src/components/Paragraphs/TabulatedData/index.vue +21 -20
  32. package/src/components/SubComponents/CtaButton/index.vue +47 -44
  33. package/src/components/SubComponents/Icon/README.md +2 -2
  34. package/src/components/SubComponents/Icon/example.js +1 -0
  35. package/src/components/SubComponents/Icon/index.stories.js +1 -1
  36. package/src/components/SubComponents/Icon/index.vue +47 -47
  37. package/src/components/SubComponents/ResourceGroup/cardbody.vue +49 -61
  38. package/src/components/SubComponents/VideoThumbnail/index.vue +8 -6
  39. package/src/mock/carousel-items.js +46 -81
@@ -1,30 +1,48 @@
1
1
  <template>
2
2
  <section-group class="paragraph--directory dir-filters">
3
3
  <!-- Filters -->
4
- <row style="column-gap: 16px;">
4
+ <row style="column-gap: 16px">
5
5
  <!-- Keyword Filters -->
6
6
  <column xxl="2" xl="3" md="4" sm="6">
7
7
  <label class="visually-hidden" for="search-directory">
8
8
  Search by keyword (typed keyword automatically filters below results)
9
9
  </label>
10
- <input type="text" v-model="searchOrg" placeholder="Organisation" class="search">
10
+ <input
11
+ type="text"
12
+ v-model="searchOrg"
13
+ placeholder="Organisation"
14
+ class="search"
15
+ />
11
16
  </column>
12
17
  <column xxl="2" xl="3" md="4" sm="6">
13
18
  <label class="visually-hidden" for="search-directory">
14
19
  Search by suburb (typed suburb automatically filters below results)
15
20
  </label>
16
- <input type="text" v-model="searchSub" placeholder="Training location" class="search">
21
+ <input
22
+ type="text"
23
+ v-model="searchSub"
24
+ placeholder="Training location"
25
+ class="search"
26
+ />
17
27
  </column>
18
28
  <!-- Other Filters -->
19
29
  <column xxl="2" xl="3" md="4" sm="6">
30
+ <label class="visually-hidden" for="filterType"> Filter Type </label>
20
31
  <select id="filterType" v-model="searchCourse" name="filter" class="selectClass">
21
- <option class="placeholder" value="" disabled hidden selected>Course type</option>
32
+ <option class="placeholder" value="" disabled hidden selected>
33
+ Course type
34
+ </option>
22
35
  <option value="HSR Initial">HSR Initial</option>
23
36
  <option value="HSR Refresher">HSR Refresher</option>
24
37
  </select>
25
38
  </column>
26
39
  <column xxl="2" xl="3" md="4" sm="6">
27
- <select id="filterTheme" v-model="searchThemes" name="filter1" class="selectClass">
40
+ <select
41
+ id="filterTheme"
42
+ v-model="searchThemes"
43
+ name="filter1"
44
+ class="selectClass"
45
+ >
28
46
  <option class="placeholder" value="" disabled hidden selected>Theme</option>
29
47
  <option v-for="(opt, i) in themeOptions" :key="i" :value="opt">
30
48
  {{ opt }}
@@ -42,54 +60,51 @@
42
60
  </column>
43
61
  </row>
44
62
  <!-- HSCP Records -->
45
- <div class="dirRecords" >
46
- <template v-for="(item, index) in resultChunks[page]" >
47
- <hscp-record v-if="item.type === 'hscp'" :key="index" :item="item"/>
63
+ <div class="dirRecords">
64
+ <template v-for="(item, index) in resultChunks[page]">
65
+ <hscp-record v-if="item.type === 'hscp'" :key="index" :item="item" />
48
66
  </template>
49
67
  </div>
50
68
  <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>
69
+ <pagination
70
+ :total-pages="totalPages"
71
+ :total="totalResults"
72
+ :per-page="perPage"
73
+ :current-page="page + 1"
74
+ @pagechanged="pageChanged($event)"
75
+ />
76
+ </div>
59
77
  <h4 v-if="filteredRecords.length === 0">No records found</h4>
60
-
61
78
  </section-group>
62
-
63
79
  </template>
64
80
 
65
81
  <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'
82
+ import hscpRecord from "./SingleRecord/index.vue";
83
+ import searchIcon from "./../../../../../assets/icons/search.svg?url";
84
+ import SectionGroup from "../../../../Containers/SectionGroup/index.vue";
85
+ import FilterButton from "../../../../Common/FilterButton/index.vue"; //Reset
86
+ import Pagination from "./pagination.vue";
72
87
 
73
88
  export default {
74
- name: 'HSCP',
89
+ name: "HSCP",
75
90
  components: {
76
91
  hscpRecord,
77
92
  SectionGroup,
78
93
  FilterButton,
79
- Pagination
94
+ Pagination,
80
95
  },
81
96
  data() {
82
97
  return {
83
- searchOrg: '',
84
- searchSub: '',
85
- searchCourse: '',
86
- searchThemes: '',
98
+ searchOrg: "",
99
+ searchSub: "",
100
+ searchCourse: "",
101
+ searchThemes: "",
87
102
  filteredItems: null,
88
103
  perPage: 10,
89
104
  page: 0,
90
105
  searchIcon,
91
- hideReset: true
92
- }
106
+ hideReset: true,
107
+ };
93
108
  },
94
109
  props: {
95
110
  items: {
@@ -97,23 +112,22 @@ export default {
97
112
  required: true,
98
113
  },
99
114
  },
100
-
101
- computed: {
102
115
 
116
+ computed: {
103
117
  themeOptions() {
104
118
  // Concatenate all themes, remove duplicates, sort and use for a drop-down list
105
- let allThemes = this.flatRecords.map(a => a.themes)
106
- allThemes = allThemes.join(',')
107
- allThemes = allThemes.trim()
108
- allThemes = allThemes.split(',')
119
+ let allThemes = this.flatRecords.map((a) => a.themes);
120
+ allThemes = allThemes.join(",");
121
+ allThemes = allThemes.trim();
122
+ allThemes = allThemes.split(",");
109
123
  // Change all themes to title case
110
124
  for (var i = 0; i < allThemes.length; i++) {
111
- let newVal = this.toTitleCase(allThemes[i])
112
- allThemes[i] = newVal
125
+ let newVal = this.toTitleCase(allThemes[i]);
126
+ allThemes[i] = newVal;
113
127
  }
114
128
  // Remove duplicates
115
- let s = new Set(allThemes)
116
- allThemes = [...s]
129
+ let s = new Set(allThemes);
130
+ allThemes = [...s];
117
131
 
118
132
  // Sort the themes
119
133
  let sortedThemes = allThemes.sort((a, b) => {
@@ -124,42 +138,55 @@ export default {
124
138
  return 1;
125
139
  }
126
140
  return 0;
127
- })
128
- allThemes = sortedThemes
141
+ });
142
+ allThemes = sortedThemes;
129
143
 
130
- return allThemes
144
+ return allThemes;
131
145
  },
132
146
 
133
147
  filteredRecords() {
134
- let results = this.flatRecords
135
-
148
+ let results = this.flatRecords;
149
+
136
150
  if (this.searchOrg.length) {
137
- this.hideReset = false
138
- results = results.filter(item => item.title.toLowerCase().includes(this.searchOrg.toLowerCase()))
151
+ this.hideReset = false;
152
+ results = results.filter((item) =>
153
+ item.title.toLowerCase().includes(this.searchOrg.toLowerCase())
154
+ );
139
155
  }
140
156
  if (this.searchSub.length) {
141
- this.hideReset = false
142
- results = results.filter(item => item.trainingVenues.toLowerCase().includes(this.searchSub.toLowerCase()))
157
+ this.hideReset = false;
158
+ results = results.filter((item) =>
159
+ item.trainingVenues.toLowerCase().includes(this.searchSub.toLowerCase())
160
+ );
143
161
  }
144
162
  if (this.searchCourse.length) {
145
- this.hideReset = false
146
- results = results.filter(item => item.courses.toLowerCase().includes(this.searchCourse.toLowerCase()))
163
+ this.hideReset = false;
164
+ results = results.filter((item) =>
165
+ item.courses.toLowerCase().includes(this.searchCourse.toLowerCase())
166
+ );
147
167
  }
148
168
  if (this.searchThemes.length) {
149
- this.hideReset = false
150
- results = results.filter(item => item.themes.toLowerCase().includes(this.searchThemes.toLowerCase()))
169
+ this.hideReset = false;
170
+ results = results.filter((item) =>
171
+ item.themes.toLowerCase().includes(this.searchThemes.toLowerCase())
172
+ );
151
173
  }
152
- this.filteredItems = results
174
+ this.filteredItems = results;
153
175
 
154
- if (this.searchOrg.length || this.searchSub.length || this.searchCourse.length || this.searchThemes.length) {
155
- this.pageChanged(1)
176
+ if (
177
+ this.searchOrg.length ||
178
+ this.searchSub.length ||
179
+ this.searchCourse.length ||
180
+ this.searchThemes.length
181
+ ) {
182
+ this.pageChanged(1);
156
183
  }
157
184
 
158
- return results
185
+ return results;
159
186
  },
160
-
187
+
161
188
  flatRecords() {
162
- let flatRecords = []
189
+ let flatRecords = [];
163
190
  const sortedItems = this.items.sort((a, b) => {
164
191
  if (a.Organisation < b.Organisation) {
165
192
  return -1;
@@ -168,10 +195,10 @@ export default {
168
195
  return 1;
169
196
  }
170
197
  return 0;
171
- })
172
- sortedItems.forEach((record) => {
198
+ });
199
+ sortedItems.forEach((record) => {
173
200
  flatRecords.push({
174
- type: 'hscp',
201
+ type: "hscp",
175
202
  title: record.Organisation,
176
203
  fullAddress: record.Main_office_address,
177
204
  orgAcronym: record.Organisation_acronym,
@@ -185,116 +212,119 @@ export default {
185
212
  contact2: record.Contact_2_Name,
186
213
  email2: record.Contact_2_Email,
187
214
  phone2: record.Contact_2_Phone,
188
- courses: record.Training_courses.replace(/,$/, ''),
189
- themes: record.Themes.replace(/,$/, ''),
190
- trainingVenues: record.Training_venues
191
- })
192
- })
193
- return flatRecords
215
+ courses: record.Training_courses.replace(/,$/, ""),
216
+ themes: record.Themes.replace(/,$/, ""),
217
+ trainingVenues: record.Training_venues,
218
+ });
219
+ });
220
+ return flatRecords;
194
221
  },
195
222
  resultChunks() {
196
- return this.chunkify(this.filteredItems || this.items, this.perPage)
223
+ return this.chunkify(this.filteredItems || this.items, this.perPage);
197
224
  },
198
225
  noRecordsFound() {
199
- return this.resultChunks[0].length === 0
226
+ return this.resultChunks[0].length === 0;
200
227
  },
201
228
  totalResults() {
202
- return Array.isArray(this.filteredItems) ? this.filteredItems.length : 0
229
+ return Array.isArray(this.filteredItems) ? this.filteredItems.length : 0;
203
230
  },
204
231
  totalPages() {
205
- return this.resultChunks.length
232
+ return this.resultChunks.length;
206
233
  },
207
234
  pageResultCount() {
208
- return this.resultChunks[this.page].length
209
- }
235
+ return this.resultChunks[this.page].length;
236
+ },
210
237
  },
211
-
212
- methods: {
213
238
 
239
+ methods: {
214
240
  formatWebsite(url) {
215
- let startUrl = url.slice(0, 3)
216
- let returnUrl = url
217
- if (startUrl.toLowerCase() === 'www') {
218
- returnUrl = 'https://' + url
219
- }
220
- if (startUrl.toLowerCase() !== 'htt' && startUrl.toLowerCase() !== 'www' && url !== '') {
221
- returnUrl = 'https://www.' + url
222
- }
223
- return returnUrl
241
+ let startUrl = url.slice(0, 3);
242
+ let returnUrl = url;
243
+ if (startUrl.toLowerCase() === "www") {
244
+ returnUrl = "https://" + url;
245
+ }
246
+ if (
247
+ startUrl.toLowerCase() !== "htt" &&
248
+ startUrl.toLowerCase() !== "www" &&
249
+ url !== ""
250
+ ) {
251
+ returnUrl = "https://www." + url;
252
+ }
253
+ return returnUrl;
224
254
  },
225
255
 
226
256
  chunkify(arr, n) {
227
257
  if (arr) {
228
258
  const chunked = arr.reduce(
229
259
  (chunk, val) => {
230
- if (chunk[chunk.length - 1].length === n) chunk.push([])
231
- chunk[chunk.length - 1].push(val)
232
- return chunk
260
+ if (chunk[chunk.length - 1].length === n) chunk.push([]);
261
+ chunk[chunk.length - 1].push(val);
262
+ return chunk;
233
263
  },
234
264
  [[]]
235
- )
236
- return chunked
265
+ );
266
+ return chunked;
237
267
  }
238
- return [[]]
268
+ return [[]];
239
269
  },
240
-
270
+
241
271
  reset() {
242
- this.collapseOrgs('No')
243
- this.hideReset = true
244
- this.searchOrg = ''
245
- this.searchCourse = ''
246
- this.searchSub = ''
247
- this.searchThemes = ''
272
+ this.collapseOrgs("No");
273
+ this.hideReset = true;
274
+ this.searchOrg = "";
275
+ this.searchCourse = "";
276
+ this.searchSub = "";
277
+ this.searchThemes = "";
248
278
  },
249
279
 
250
280
  pageChanged(ev) {
251
- this.page = ev - 1
281
+ this.page = ev - 1;
252
282
 
253
- if (this.searchOrg.length || this.searchSub.length || this.searchCourse.length || this.searchThemes.length) {
254
- // don't set focus
255
- // don't collapseOrgs
256
- } else {
257
- // set focus to top element - used instead of scrollTo
258
- this.collapseOrgs('Yes')
259
- }
283
+ if (
284
+ this.searchOrg.length ||
285
+ this.searchSub.length ||
286
+ this.searchCourse.length ||
287
+ this.searchThemes.length
288
+ ) {
289
+ // don't set focus
290
+ // don't collapseOrgs
291
+ } else {
292
+ // set focus to top element - used instead of scrollTo
293
+ this.collapseOrgs("Yes");
294
+ }
260
295
  },
261
296
 
262
297
  collapseOrgs(focusLink) {
263
298
  // called by pageChanged and reset. pageChanged called by filter and by pagination links
264
- const aLinks = document.getElementsByName('titleLink')
299
+ const aLinks = document.getElementsByName("titleLink");
265
300
  // Convert nodelist to array
266
- let linksArr = Array.from(aLinks)
301
+ let linksArr = Array.from(aLinks);
267
302
  if (Array.isArray(linksArr) && linksArr.length > 0) {
268
303
  linksArr
269
- .filter((link) => link.getAttribute('aria-expanded') === 'true')
270
- .forEach((link) => link.click())
304
+ .filter((link) => link.getAttribute("aria-expanded") === "true")
305
+ .forEach((link) => link.click());
271
306
 
272
- if (focusLink === 'Yes') {
273
- linksArr[0].focus()
307
+ if (focusLink === "Yes") {
308
+ linksArr[0].focus();
274
309
  }
275
310
  }
276
-
277
311
  },
278
312
 
279
313
  toTitleCase(strVal) {
314
+ let retVal = strVal.trim();
280
315
 
281
- let retVal = strVal.trim()
282
-
283
- const firstChar = retVal.charAt(0)
284
- const firstCharU = firstChar.toUpperCase()
285
- const remChar = retVal.slice(1)
316
+ const firstChar = retVal.charAt(0);
317
+ const firstCharU = firstChar.toUpperCase();
318
+ const remChar = retVal.slice(1);
286
319
 
287
- retVal = firstCharU + remChar
320
+ retVal = firstCharU + remChar;
288
321
 
289
- return retVal
322
+ return retVal;
290
323
  },
291
- }
292
- }
324
+ },
325
+ };
293
326
  </script>
294
327
 
295
328
  <style lang="scss" scoped>
296
-
297
- @import '../styles.scss'
298
-
299
-
329
+ @import "../styles.scss";
300
330
  </style>
@@ -13,8 +13,8 @@
13
13
  :class="`paragraph--tabs ${workwell ? 'workwell' : ''}`"
14
14
  >
15
15
  <template v-slot:cardItem>
16
- <b-tabs v-model="tabIndex">
17
- <b-tab
16
+ <BTabs v-model:index="tabIndex" card>
17
+ <BTab
18
18
  v-for="(item, index) in items"
19
19
  :key="`${index}-${$.uid}`"
20
20
  :title="item.title"
@@ -24,8 +24,8 @@
24
24
  :content="item.content.value"
25
25
  :without-container="true"
26
26
  />
27
- </b-tab>
28
- </b-tabs>
27
+ </BTab>
28
+ </BTabs>
29
29
  </template>
30
30
  </card-grid>
31
31
  <container v-else class="pdf-tabs">
@@ -5,7 +5,7 @@
5
5
  :size="'content'"
6
6
  >
7
7
  <div :class="isFluid ? 'table-scrolled' : ''">
8
- <b-table
8
+ <BTable
9
9
  v-if="items"
10
10
  :items="items"
11
11
  :fields="fields"
@@ -22,6 +22,7 @@
22
22
  <span
23
23
  class="iconHeader table-active"
24
24
  tabindex="0"
25
+ role="button"
25
26
  @keypress.enter="accessSort(data.field)"
26
27
  scope="colgroup"
27
28
  >
@@ -31,13 +32,13 @@
31
32
  v-if="data.field.thAttr['aria-sort'] === 'ascending'"
32
33
  :src="CaretUp"
33
34
  alt="image indicating ascending sort"
34
- class="iconAsc"
35
+ class="collapse icon"
35
36
  />
36
37
  <img
37
38
  v-else-if="data.field.thAttr['aria-sort'] === 'descending'"
38
39
  :src="CaretDown"
39
40
  alt="image indicating descending sort"
40
- class="iconDesc"
41
+ class="expand icon"
41
42
  />
42
43
  </span>
43
44
  </span>
@@ -45,20 +46,20 @@
45
46
  <template #cell()="data">
46
47
  <rich-text :content="data.value" />
47
48
  </template>
48
- </b-table>
49
+ </BTable>
49
50
  </div>
50
51
  </section-group>
51
52
  </template>
52
53
 
53
54
  <script>
54
- import SectionGroup from "./../../Containers/SectionGroup/index.vue";
55
- import RichText from "../../Paragraphs/RichText/index.vue";
56
- import { BTable } from "bootstrap-vue-next";
57
- import CaretUp from "./../../../assets/icons/caret-up.svg?url";
58
- import CaretDown from "./../../../assets/icons/caret-down.svg?url";
55
+ import SectionGroup from './../../Containers/SectionGroup/index.vue'
56
+ import RichText from '../../Paragraphs/RichText/index.vue'
57
+ import { BTable } from 'bootstrap-vue-next'
58
+ import CaretUp from './../../../assets/icons/caret-up.svg?url'
59
+ import CaretDown from './../../../assets/icons/caret-down.svg?url'
59
60
 
60
61
  export default {
61
- name: "TabulatedData",
62
+ name: 'TabulatedData',
62
63
  components: { SectionGroup, RichText, BTable },
63
64
  props: {
64
65
  items: {
@@ -79,7 +80,7 @@ export default {
79
80
  },
80
81
  caption: {
81
82
  type: String,
82
- default: "",
83
+ default: '',
83
84
  required: false,
84
85
  },
85
86
  sortBy: {
@@ -90,33 +91,33 @@ export default {
90
91
  },
91
92
  data() {
92
93
  return {
93
- newSortBy: this.sortBy ? [{ key: this.sortBy, order: "asc" }] : [],
94
+ newSortBy: this.sortBy ? [{ key: this.sortBy, order: 'asc' }] : [],
94
95
  //sortDesc: false,
95
96
  CaretUp,
96
97
  CaretDown,
97
- };
98
+ }
98
99
  },
99
100
  computed: {
100
101
  isFluid() {
101
- return this.isFixedWidth;
102
+ return this.isFixedWidth
102
103
  },
103
104
  },
104
105
  methods: {
105
106
  accessSort(fieldVar) {
106
- const currentSort = fieldVar.thAttr["aria-sort"];
107
- if (currentSort === "ascending") {
108
- this.newSortBy = [{ key: fieldVar.key, order: "desc" }];
107
+ const currentSort = fieldVar.thAttr['aria-sort']
108
+ if (currentSort === 'ascending') {
109
+ this.newSortBy = [{ key: fieldVar.key, order: 'desc' }]
109
110
  } else {
110
- this.newSortBy = [{ key: fieldVar.key, order: "asc" }];
111
+ this.newSortBy = [{ key: fieldVar.key, order: 'asc' }]
111
112
  }
112
113
  },
113
114
  },
114
- };
115
+ }
115
116
  </script>
116
117
 
117
118
  <style lang="scss">
118
119
  .paragraph--tabulated-data {
119
- @import "../../../includes/scss/all";
120
+ @import '../../../includes/scss/all';
120
121
 
121
122
  .section-group__block {
122
123
  margin-top: -32px;