@worksafevictoria/wcl7.5 1.8.0 → 1.9.0-beta.10

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 (50) hide show
  1. package/.storybook/preview.js +1 -1
  2. package/lib/utility.js +0 -2
  3. package/package.json +1 -1
  4. package/src/components/Common/CardGrid/index.vue +0 -3
  5. package/src/components/Common/CardGridItem/card-grid-item-caret.vue +39 -45
  6. package/src/components/Common/CardGridItem/card-grid-item-icon.vue +29 -32
  7. package/src/components/Common/CardGridItem/index.vue +6 -5
  8. package/src/components/Containers/Carousel/index.stories.js +6 -4
  9. package/src/components/Containers/Carousel/index.vue +131 -120
  10. package/src/components/Containers/HomepageHeader/index.stories.js +1 -1
  11. package/src/components/Containers/HomepageHeaderNew/index.stories.js +3 -15
  12. package/src/components/Containers/HomepageHeaderNew/index.vue +0 -5
  13. package/src/components/Global/AppFooter/index.vue +130 -133
  14. package/src/components/Global/AppHeader/ModalSearch/index.vue +7 -1
  15. package/src/components/Global/AppHeader/index.stories.js +2 -2
  16. package/src/components/Global/AppHeaderNew/ModalSearch/index.vue +21 -17
  17. package/src/components/Global/AppHeaderNew/index.stories.js +2 -2
  18. package/src/components/Global/AppHeaderNew/index.vue +53 -24
  19. package/src/components/Global/AppHeaderNew/styles.scss +1 -4
  20. package/src/components/Global/BackToTop/index.vue +16 -16
  21. package/src/components/Global/ContrastMode/index.stories.js +1 -1
  22. package/src/components/Global/HeroHeader/index.vue +62 -73
  23. package/src/components/Global/SocialShare/index.vue +62 -66
  24. package/src/components/Global/Strip/index.vue +82 -70
  25. package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +21 -23
  26. package/src/components/Paragraphs/Accordion/StepperItem/index.vue +15 -15
  27. package/src/components/Paragraphs/Calculator/CardContainer/index.vue +74 -75
  28. package/src/components/Paragraphs/Calculator/RiskLevel/index.vue +31 -39
  29. package/src/components/Paragraphs/Directory/Asbestos/Records/SingleRecord/index.stories.js +1 -1
  30. package/src/components/Paragraphs/Directory/Asbestos/Records/SingleRecord/index.vue +105 -108
  31. package/src/components/Paragraphs/Directory/Asbestos/Records/index.vue +152 -117
  32. package/src/components/Paragraphs/Directory/HSCP/Records/SingleRecord/index.vue +127 -133
  33. package/src/components/Paragraphs/Directory/HSCP/Records/index.vue +157 -124
  34. package/src/components/Paragraphs/ScrollSpy/index.stories.js +23 -25
  35. package/src/components/Paragraphs/ScrollSpy/index.vue +33 -40
  36. package/src/components/Paragraphs/TabulatedData/index.vue +3 -2
  37. package/src/components/SubComponents/CtaButton/index.vue +47 -44
  38. package/src/components/SubComponents/Icon/README.md +2 -2
  39. package/src/components/SubComponents/Icon/example.js +1 -0
  40. package/src/components/SubComponents/Icon/index.stories.js +1 -1
  41. package/src/components/SubComponents/Icon/index.vue +47 -47
  42. package/src/components/SubComponents/ResourceGroup/cardbody.vue +49 -61
  43. package/src/components/SubComponents/ResourceGroup/index.vue +2 -1
  44. package/src/components/SubComponents/Search/SearchListing/index.vue +0 -2
  45. package/src/components/SubComponents/Search/index.vue +4 -2
  46. package/src/components/SubComponents/VideoThumbnail/index.vue +29 -28
  47. package/src/index.js +1 -1
  48. package/src/mock/asbestos-removalists.js +1 -1
  49. package/src/mock/carousel-items.js +46 -81
  50. package/src/mock/course-provider.js +2 -2
@@ -1,35 +1,51 @@
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="searchRem" placeholder="Removalist" class="search">
10
+ <input type="text" v-model="searchRem" placeholder="Removalist" class="search" />
11
11
  </column>
12
12
  <column xxl="2" xl="3" md="4" sm="6">
13
13
  <label class="visually-hidden" for="search-directory">
14
14
  Search by suburb (typed suburb automatically filters below results)
15
15
  </label>
16
- <input type="text" v-model="searchSub" placeholder="Address" class="search">
16
+ <input type="text" v-model="searchSub" placeholder="Location" class="search" />
17
17
  </column>
18
18
  <!-- Other Filters -->
19
19
  <column xxl="2" xl="3" md="4" sm="6">
20
+ <label class="visually-hidden" for="filterType"> Filter Type </label>
20
21
  <select id="filterType" v-model="searchClass" name="filter" class="selectClass">
21
- <option class="placeholder" value="" disabled hidden selected>Service class</option>
22
- <option value="Class A Asbestos Removalists">Class A Asbestos Removalists</option>
23
- <option value="Class B Asbestos Removalists">Class B Asbestos Removalists</option>
24
- <option value="Class A - Restricted - Asbestos Removalists">Class A - Restricted - Asbestos Removalists</option>
25
- <option value="Class B - Restricted - Asbestos Removalists">Class B - Restricted - Asbestos Removalists</option>
22
+ <option class="placeholder" value="" disabled hidden selected>
23
+ Service class
24
+ </option>
25
+ <option value="Class A Asbestos Removalists">
26
+ Class A Asbestos Removalists
27
+ </option>
28
+ <option value="Class B Asbestos Removalists">
29
+ Class B Asbestos Removalists
30
+ </option>
31
+ <option value="Class A - Restricted - Asbestos Removalists">
32
+ Class A - Restricted - Asbestos Removalists
33
+ </option>
34
+ <option value="Class B - Restricted - Asbestos Removalists">
35
+ Class B - Restricted - Asbestos Removalists
36
+ </option>
26
37
  </select>
27
38
  </column>
28
39
  <column xxl="2" xl="3" md="4" sm="6">
29
40
  <label class="visually-hidden" for="search-directory">
30
41
  Search by suburb (typed suburb automatically filters below results)
31
42
  </label>
32
- <input type="text" v-model="searchServices" placeholder="Services" class="search">
43
+ <input
44
+ type="text"
45
+ v-model="searchServices"
46
+ placeholder="Services"
47
+ class="search"
48
+ />
33
49
  </column>
34
50
  <column md="2">
35
51
  <filter-button
@@ -42,54 +58,51 @@
42
58
  </column>
43
59
  </row>
44
60
  <!-- AR Records -->
45
- <div class="dirRecords" >
46
- <template v-for="(item, index) in resultChunks[page]" >
47
- <ar-record v-if="item.type === 'ar'" :key="index" :item="item"/>
61
+ <div class="dirRecords">
62
+ <template v-for="(item, index) in resultChunks[page]">
63
+ <ar-record v-if="item.type === 'ar'" :key="index" :item="item" />
48
64
  </template>
49
65
  </div>
50
66
  <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>
67
+ <pagination
68
+ :total-pages="totalPages"
69
+ :total="totalResults"
70
+ :per-page="perPage"
71
+ :current-page="page + 1"
72
+ @pagechanged="pageChanged($event)"
73
+ />
74
+ </div>
59
75
  <h4 v-if="filteredRecords.length === 0">No records found</h4>
60
-
61
76
  </section-group>
62
-
63
77
  </template>
64
78
 
65
79
  <script>
66
-
67
- import arRecord 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 '../../HSCP/Records/pagination.vue'
80
+ import arRecord from "./SingleRecord/index.vue";
81
+ import searchIcon from "./../../../../../assets/icons/search.svg?url";
82
+ import SectionGroup from "../../../../Containers/SectionGroup/index.vue";
83
+ import FilterButton from "../../../../Common/FilterButton/index.vue"; //Reset
84
+ import Pagination from "../../HSCP/Records/pagination.vue";
72
85
 
73
86
  export default {
74
- name: 'Asbestos',
87
+ name: "Asbestos",
75
88
  components: {
76
89
  arRecord,
77
90
  SectionGroup,
78
91
  FilterButton,
79
- Pagination
92
+ Pagination,
80
93
  },
81
94
  data() {
82
95
  return {
83
- searchRem: '',
84
- searchSub: '',
85
- searchClass: '',
86
- searchServices: '',
96
+ searchRem: "",
97
+ searchSub: "",
98
+ searchClass: "",
99
+ searchServices: "",
87
100
  filteredItems: null,
88
101
  perPage: 10,
89
102
  page: 0,
90
103
  searchIcon,
91
- hideReset: true
92
- }
104
+ hideReset: true,
105
+ };
93
106
  },
94
107
  props: {
95
108
  items: {
@@ -97,46 +110,60 @@ export default {
97
110
  required: true,
98
111
  },
99
112
  },
100
-
101
- computed: {
102
113
 
114
+ computed: {
103
115
  filteredRecords() {
104
- let results = this.flatRecords
105
-
116
+ let results = this.flatRecords;
117
+
106
118
  if (this.searchRem.length) {
107
- this.hideReset = false
108
- results = results.filter(item => item.title.toLowerCase().includes(this.searchRem.toLowerCase()))
119
+ this.hideReset = false;
120
+ results = results.filter((item) =>
121
+ item.title.toLowerCase().includes(this.searchRem.toLowerCase())
122
+ );
109
123
  }
110
124
  if (this.searchSub.length) {
111
- this.hideReset = false
112
- results = results.filter(item => item.fullAddress.toLowerCase().includes(this.searchSub.toLowerCase()))
125
+ this.hideReset = false;
126
+ results = results.filter((item) =>
127
+ item.fullAddress.toLowerCase().includes(this.searchSub.toLowerCase())
128
+ );
113
129
  }
114
130
  if (this.searchClass.length) {
115
- this.hideReset = false
116
- results = results.filter(item => item.serviceCategory.toLowerCase().includes(this.searchClass.toLowerCase()))
131
+ this.hideReset = false;
132
+ results = results.filter((item) =>
133
+ item.serviceCategory.toLowerCase().includes(this.searchClass.toLowerCase())
134
+ );
117
135
  }
118
136
  if (this.searchServices.length) {
119
- this.hideReset = false
120
- results = results.filter(item => item.services.toLowerCase().includes(this.searchServices.toLowerCase()))
137
+ this.hideReset = false;
138
+ results = results.filter((item) =>
139
+ item.services.toLowerCase().includes(this.searchServices.toLowerCase())
140
+ );
121
141
  }
122
- this.filteredItems = results
142
+ this.filteredItems = results;
123
143
 
124
- if (this.searchRem.length || this.searchSub.length || this.searchClass.length || this.searchServices.length) {
125
- this.pageChanged(1)
144
+ if (
145
+ this.searchRem.length ||
146
+ this.searchSub.length ||
147
+ this.searchClass.length ||
148
+ this.searchServices.length
149
+ ) {
150
+ this.pageChanged(1);
126
151
  }
127
152
 
128
- return results
153
+ return results;
129
154
  },
130
-
155
+
131
156
  flatRecords() {
132
- let flatRecords = []
133
- const sortedItems = this.items.sort((a, b) => a.ResourceName.localeCompare(b.ResourceName, 'en', {'sensitivity': 'base'}))
134
-
157
+ let flatRecords = [];
158
+ const sortedItems = this.items.sort((a, b) =>
159
+ a.ResourceName.localeCompare(b.ResourceName, "en", { sensitivity: "base" })
160
+ );
161
+
135
162
  sortedItems.forEach((record) => {
136
163
  flatRecords.push({
137
- type: 'ar',
164
+ type: "ar",
138
165
  title: record.ResourceName,
139
- fullAddress: record.CompanyAddress + ' ' + record.AddressLine2,
166
+ fullAddress: record.AddressLine2,
140
167
  workPhone: record.Phone,
141
168
  mobilePhone: record.CompanyMobile,
142
169
  email: record.CompanyEmailDisp,
@@ -145,115 +172,123 @@ export default {
145
172
  email1: record.ContactEmail,
146
173
  phone1: record.ContactPhoneDisp,
147
174
  mobile1: record.ContactMobileDisp,
148
- services: record.ServicesAll.replace(/,$/, ''),
149
- serviceCategory: record.ServiceAll
150
- })
151
- })
152
- return flatRecords
175
+ services: record.ServicesAll.replace(/,$/, ""),
176
+ serviceCategory: record.ServiceAll,
177
+ });
178
+ });
179
+ return flatRecords;
153
180
  },
154
181
  resultChunks() {
155
- return this.chunkify(this.filteredItems || this.items, this.perPage)
182
+ return this.chunkify(this.filteredItems || this.items, this.perPage);
156
183
  },
157
184
  noRecordsFound() {
158
- return this.resultChunks[0].length === 0
185
+ return this.resultChunks[0].length === 0;
159
186
  },
160
187
  totalResults() {
161
- return Array.isArray(this.filteredItems) ? this.filteredItems.length : 0
188
+ return Array.isArray(this.filteredItems) ? this.filteredItems.length : 0;
162
189
  },
163
190
  totalPages() {
164
- return this.resultChunks.length
191
+ return this.resultChunks.length;
165
192
  },
166
193
  pageResultCount() {
167
- return this.resultChunks[this.page].length
168
- }
194
+ return this.resultChunks[this.page].length;
195
+ },
169
196
  },
170
-
171
- methods: {
172
197
 
198
+ methods: {
173
199
  formatWebsite(url) {
174
- let startUrl = url.slice(0, 3)
175
- if (startUrl.toLowerCase() === 'www') {
176
- return 'https://' + url
177
- } else {
178
- return url
200
+ let startUrl = url.slice(0, 3);
201
+ let returnUrl = url;
202
+ if (startUrl.toLowerCase() === "www") {
203
+ returnUrl = "https://" + url;
179
204
  }
205
+ if (
206
+ startUrl.toLowerCase() !== "htt" &&
207
+ startUrl.toLowerCase() !== "www" &&
208
+ url !== ""
209
+ ) {
210
+ returnUrl = "https://www." + url;
211
+ }
212
+ return returnUrl;
180
213
  },
181
214
 
182
215
  returnContact(firstN, lastN) {
183
- let retContact = [firstN, lastN].filter(Boolean).join(' ')
184
- return retContact
216
+ let retContact = [firstN, lastN].filter(Boolean).join(" ");
217
+ return retContact;
185
218
  },
186
219
 
187
220
  chunkify(arr, n) {
188
221
  if (arr) {
189
222
  const chunked = arr.reduce(
190
223
  (chunk, val) => {
191
- if (chunk[chunk.length - 1].length === n) chunk.push([])
192
- chunk[chunk.length - 1].push(val)
193
- return chunk
224
+ if (chunk[chunk.length - 1].length === n) chunk.push([]);
225
+ chunk[chunk.length - 1].push(val);
226
+ return chunk;
194
227
  },
195
228
  [[]]
196
- )
197
- return chunked
229
+ );
230
+ return chunked;
198
231
  }
199
- return [[]]
232
+ return [[]];
200
233
  },
201
-
234
+
202
235
  reset() {
203
- this.collapseOrgs('No')
204
- this.hideReset = true
205
- this.searchRem = ''
206
- this.searchClass = ''
207
- this.searchSub = ''
208
- this.searchServices = ''
236
+ this.collapseOrgs("No");
237
+ this.hideReset = true;
238
+ this.searchRem = "";
239
+ this.searchClass = "";
240
+ this.searchSub = "";
241
+ this.searchServices = "";
209
242
  },
210
243
 
211
244
  pageChanged(ev) {
212
- this.page = ev - 1
245
+ this.page = ev - 1;
213
246
 
214
- if (this.searchRem.length || this.searchSub.length || this.searchClass.length || this.searchServices.length) {
215
- // don't set focus
216
- // don't collapseOrgs
217
- } else {
218
- // set focus to top element - used instead of scrollTo
219
- this.collapseOrgs('Yes')
220
- }
247
+ if (
248
+ this.searchRem.length ||
249
+ this.searchSub.length ||
250
+ this.searchClass.length ||
251
+ this.searchServices.length
252
+ ) {
253
+ // don't set focus
254
+ // don't collapseOrgs
255
+ } else {
256
+ // set focus to top element - used instead of scrollTo
257
+ this.collapseOrgs("Yes");
258
+ }
221
259
  },
222
260
 
223
261
  collapseOrgs(focusLink) {
224
262
  // called by pageChanged and reset. pageChanged called by filter and by pagination links
225
- const aLinks = document.getElementsByName('titleLink')
263
+ const aLinks = document.getElementsByName("titleLink");
226
264
  // Convert nodelist to array
227
- let linksArr = Array.from(aLinks)
265
+ let linksArr = Array.from(aLinks);
228
266
  if (Array.isArray(linksArr) && linksArr.length > 0) {
229
267
  linksArr
230
- .filter((link) => link.getAttribute('aria-expanded') === 'true')
231
- .forEach((link) => link.click())
268
+ .filter((link) => link.getAttribute("aria-expanded") === "true")
269
+ .forEach((link) => link.click());
232
270
 
233
- if (focusLink === 'Yes') {
234
- linksArr[0].focus()
271
+ if (focusLink === "Yes") {
272
+ linksArr[0].focus();
235
273
  }
236
274
  }
237
-
238
275
  },
239
276
 
240
277
  toTitleCase(strVal) {
278
+ let retVal = strVal.trim();
241
279
 
242
- let retVal = strVal.trim()
243
-
244
- const firstChar = retVal.charAt(0)
245
- const firstCharU = firstChar.toUpperCase()
246
- const remChar = retVal.slice(1)
280
+ const firstChar = retVal.charAt(0);
281
+ const firstCharU = firstChar.toUpperCase();
282
+ const remChar = retVal.slice(1);
247
283
 
248
- retVal = firstCharU + remChar
284
+ retVal = firstCharU + remChar;
249
285
 
250
- return retVal
286
+ return retVal;
251
287
  },
252
- }
253
- }
288
+ },
289
+ };
254
290
  </script>
255
291
 
256
292
  <style lang="scss" scoped>
257
- @import '../../HSCP/styles.scss'
258
-
293
+ @import "../../HSCP/styles.scss";
259
294
  </style>