@worksafevictoria/wcl7.5 1.9.0-beta.15 → 1.9.0-beta.16

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.
@@ -12,7 +12,7 @@
12
12
  <div
13
13
  :role="mini ? 'link' : null"
14
14
  :class="type + '-strip__inner-wrap'"
15
- :tabindex="mini ? 0 : false"
15
+ :tabindex="mini ? 0 : -1"
16
16
  :style="mini ? 'cursor: pointer;' : false"
17
17
  @click="mini ? handleClick() : false"
18
18
  @keypress.enter="mini ? handleClick() : false"
@@ -59,16 +59,16 @@
59
59
  </template>
60
60
 
61
61
  <script>
62
- import exclamationIcon from "../../../assets/icons/Strip/Exclamation triangle fill.svg?url";
63
- import arrowIcon from "../../../assets/icons/Strip/Arrow right.svg?url";
64
- import dismissIcon from "../../../assets/icons/Strip/Dismiss.svg?url";
65
- import infoIcon from "../../../assets/icons/Strip/Info circle fill.svg?url";
66
- import chevronIcon from "../../../assets/icons/caret-right.svg?url";
67
- import RichText from "../../Paragraphs/RichText/index.vue";
68
- import { BAlert } from "bootstrap-vue-next";
62
+ import exclamationIcon from '../../../assets/icons/Strip/Exclamation triangle fill.svg?url'
63
+ import arrowIcon from '../../../assets/icons/Strip/Arrow right.svg?url'
64
+ import dismissIcon from '../../../assets/icons/Strip/Dismiss.svg?url'
65
+ import infoIcon from '../../../assets/icons/Strip/Info circle fill.svg?url'
66
+ import chevronIcon from '../../../assets/icons/caret-right.svg?url'
67
+ import RichText from '../../Paragraphs/RichText/index.vue'
68
+ import { BAlert } from 'bootstrap-vue-next'
69
69
 
70
70
  export default {
71
- name: "Strip",
71
+ name: 'Strip',
72
72
  components: {
73
73
  RichText,
74
74
  BAlert,
@@ -80,15 +80,15 @@ export default {
80
80
  },
81
81
  stripHeading: {
82
82
  type: String,
83
- default: "",
83
+ default: '',
84
84
  },
85
85
  stripContent: {
86
86
  type: String,
87
- default: "",
87
+ default: '',
88
88
  },
89
89
  url: {
90
90
  type: String,
91
- default: "#",
91
+ default: '#',
92
92
  },
93
93
  type: {
94
94
  type: String,
@@ -103,7 +103,7 @@ export default {
103
103
  default: false,
104
104
  },
105
105
  },
106
- emits: ["update:modelValue", "dismissed"],
106
+ emits: ['update:modelValue', 'dismissed'],
107
107
  data() {
108
108
  return {
109
109
  dismissibleAlert: this.modelValue,
@@ -112,34 +112,34 @@ export default {
112
112
  dismissIcon,
113
113
  infoIcon,
114
114
  chevronIcon,
115
- };
115
+ }
116
116
  },
117
117
  watch: {
118
118
  modelValue(val) {
119
- this.dismissibleAlert = val;
119
+ this.dismissibleAlert = val
120
120
  },
121
121
  dismissibleAlert(val) {
122
122
  if (val !== this.modelValue) {
123
- this.$emit("update:modelValue", val);
123
+ this.$emit('update:modelValue', val)
124
124
  }
125
125
  },
126
126
  },
127
127
  computed: {
128
128
  layout() {
129
- return this.mini ? "mini" : "full";
129
+ return this.mini ? 'mini' : 'full'
130
130
  },
131
131
  themeColor() {
132
- return this.type === "alert" ? "red" : "blue";
132
+ return this.type === 'alert' ? 'red' : 'blue'
133
133
  },
134
134
  stripTitle() {
135
- if (this.mini && this.type === "alert") {
136
- return "Safety alert";
137
- } else if (this.mini && this.type === "notice") {
138
- return "Information";
135
+ if (this.mini && this.type === 'alert') {
136
+ return 'Safety alert'
137
+ } else if (this.mini && this.type === 'notice') {
138
+ return 'Information'
139
139
  } else if (this.stripHeading) {
140
- return this.stripHeading;
140
+ return this.stripHeading
141
141
  } else {
142
- return "";
142
+ return ''
143
143
  }
144
144
  },
145
145
  },
@@ -151,18 +151,18 @@ export default {
151
151
  link: this.mini ? this.url : false,
152
152
  clickedOnPage: this.$route.path,
153
153
  globalStrip: false,
154
- };
154
+ }
155
155
  if (this.$gtm) {
156
156
  this.$gtm.push({
157
157
  event: `custom.interaction.${this.type}.click`,
158
158
  ...attrs,
159
- });
159
+ })
160
160
  }
161
- this.$router.push(this.url);
161
+ this.$router.push(this.url)
162
162
  },
163
163
  handleDismissed() {
164
- this.$emit("update:modelValue", false);
165
- this.$emit("dismissed");
164
+ this.$emit('update:modelValue', false)
165
+ this.$emit('dismissed')
166
166
 
167
167
  if (this.$gtm) {
168
168
  const attrs = {
@@ -170,19 +170,19 @@ export default {
170
170
  label: this.stripHeading,
171
171
  clickedOnPage: this.$route.path,
172
172
  globalStrip: false,
173
- };
173
+ }
174
174
  this.$gtm.push({
175
175
  event: `custom.interaction.${this.type}.close`,
176
176
  ...attrs,
177
- });
177
+ })
178
178
  }
179
179
  },
180
180
  },
181
- };
181
+ }
182
182
  </script>
183
183
 
184
184
  <style lang="scss" scoped>
185
- @import "../../../includes/scss/all";
185
+ @import '../../../includes/scss/all';
186
186
  .red {
187
187
  .alert-strip {
188
188
  &__inner {
@@ -316,7 +316,7 @@ export default {
316
316
  max-width: 794px;
317
317
  }
318
318
 
319
- @include mq("sm") {
319
+ @include mq('sm') {
320
320
  flex-direction: column;
321
321
  margin-right: 16px;
322
322
 
@@ -4,21 +4,43 @@
4
4
  <row style="column-gap: 16px">
5
5
  <!-- Keyword Filters -->
6
6
  <column xxl="2" xl="3" md="4" sm="6">
7
- <label class="visually-hidden" for="search-directory">
7
+ <label class="col-form-label visually-hidden" for="keyword-search">
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
11
+ id="keyword-search"
12
+ type="text"
13
+ v-model="searchRem"
14
+ placeholder="Removalist"
15
+ aria-label="Search by keyword (typed keyword automatically filters below results)"
16
+ class="search"
17
+ />
11
18
  </column>
12
19
  <column xxl="2" xl="3" md="4" sm="6">
13
- <label class="visually-hidden" for="search-directory">
20
+ <label class="col-form-label visually-hidden" for="suburb-search">
14
21
  Search by suburb (typed suburb automatically filters below results)
15
22
  </label>
16
- <input type="text" v-model="searchSub" placeholder="Location" class="search" />
23
+ <input
24
+ id="suburb-search"
25
+ type="text"
26
+ v-model="searchSub"
27
+ placeholder="Location"
28
+ aria-label="Search by suburb (typed suburb automatically filters below results)"
29
+ class="search"
30
+ />
17
31
  </column>
18
32
  <!-- Other Filters -->
19
33
  <column xxl="2" xl="3" md="4" sm="6">
20
- <label class="visually-hidden" for="filterType"> Filter Type </label>
21
- <select id="filterType" v-model="searchClass" name="filter" class="selectClass">
34
+ <label class="col-form-label visually-hidden" for="filterType">
35
+ Filter Type
36
+ </label>
37
+ <select
38
+ id="filterType"
39
+ v-model="searchClass"
40
+ name="filter"
41
+ class="selectClass"
42
+ aria-label="Filter Type"
43
+ >
22
44
  <option class="placeholder" value="" disabled hidden selected>
23
45
  Service class
24
46
  </option>
@@ -37,13 +59,15 @@
37
59
  </select>
38
60
  </column>
39
61
  <column xxl="2" xl="3" md="4" sm="6">
40
- <label class="visually-hidden" for="search-directory">
62
+ <label class="col-form-label visually-hidden" for="search-services">
41
63
  Search by suburb (typed suburb automatically filters below results)
42
64
  </label>
43
65
  <input
66
+ id="search-services"
44
67
  type="text"
45
68
  v-model="searchServices"
46
69
  placeholder="Services"
70
+ aria-label="Search by suburb (typed suburb automatically filters below results)"
47
71
  class="search"
48
72
  />
49
73
  </column>
@@ -77,14 +101,14 @@
77
101
  </template>
78
102
 
79
103
  <script>
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";
104
+ import arRecord from './SingleRecord/index.vue'
105
+ import searchIcon from './../../../../../assets/icons/search.svg?url'
106
+ import SectionGroup from '../../../../Containers/SectionGroup/index.vue'
107
+ import FilterButton from '../../../../Common/FilterButton/index.vue' //Reset
108
+ import Pagination from '../../HSCP/Records/pagination.vue'
85
109
 
86
110
  export default {
87
- name: "Asbestos",
111
+ name: 'Asbestos',
88
112
  components: {
89
113
  arRecord,
90
114
  SectionGroup,
@@ -93,16 +117,16 @@ export default {
93
117
  },
94
118
  data() {
95
119
  return {
96
- searchRem: "",
97
- searchSub: "",
98
- searchClass: "",
99
- searchServices: "",
120
+ searchRem: '',
121
+ searchSub: '',
122
+ searchClass: '',
123
+ searchServices: '',
100
124
  filteredItems: null,
101
125
  perPage: 10,
102
126
  page: 0,
103
127
  searchIcon,
104
128
  hideReset: true,
105
- };
129
+ }
106
130
  },
107
131
  props: {
108
132
  items: {
@@ -113,33 +137,37 @@ export default {
113
137
 
114
138
  computed: {
115
139
  filteredRecords() {
116
- let results = this.flatRecords;
140
+ let results = this.flatRecords
117
141
 
118
142
  if (this.searchRem.length) {
119
- this.hideReset = false;
143
+ this.hideReset = false
120
144
  results = results.filter((item) =>
121
- item.title.toLowerCase().includes(this.searchRem.toLowerCase())
122
- );
145
+ item.title.toLowerCase().includes(this.searchRem.toLowerCase()),
146
+ )
123
147
  }
124
148
  if (this.searchSub.length) {
125
- this.hideReset = false;
149
+ this.hideReset = false
126
150
  results = results.filter((item) =>
127
- item.fullAddress.toLowerCase().includes(this.searchSub.toLowerCase())
128
- );
151
+ item.fullAddress.toLowerCase().includes(this.searchSub.toLowerCase()),
152
+ )
129
153
  }
130
154
  if (this.searchClass.length) {
131
- this.hideReset = false;
155
+ this.hideReset = false
132
156
  results = results.filter((item) =>
133
- item.serviceCategory.toLowerCase().includes(this.searchClass.toLowerCase())
134
- );
157
+ item.serviceCategory
158
+ .toLowerCase()
159
+ .includes(this.searchClass.toLowerCase()),
160
+ )
135
161
  }
136
162
  if (this.searchServices.length) {
137
- this.hideReset = false;
163
+ this.hideReset = false
138
164
  results = results.filter((item) =>
139
- item.services.toLowerCase().includes(this.searchServices.toLowerCase())
140
- );
165
+ item.services
166
+ .toLowerCase()
167
+ .includes(this.searchServices.toLowerCase()),
168
+ )
141
169
  }
142
- this.filteredItems = results;
170
+ this.filteredItems = results
143
171
 
144
172
  if (
145
173
  this.searchRem.length ||
@@ -147,102 +175,107 @@ export default {
147
175
  this.searchClass.length ||
148
176
  this.searchServices.length
149
177
  ) {
150
- this.pageChanged(1);
178
+ this.pageChanged(1)
151
179
  }
152
180
 
153
- return results;
181
+ return results
154
182
  },
155
183
 
156
184
  flatRecords() {
157
- let flatRecords = [];
185
+ let flatRecords = []
158
186
  const sortedItems = this.items.sort((a, b) =>
159
- a.ResourceName.localeCompare(b.ResourceName, "en", { sensitivity: "base" })
160
- );
187
+ a.ResourceName.localeCompare(b.ResourceName, 'en', {
188
+ sensitivity: 'base',
189
+ }),
190
+ )
161
191
 
162
192
  sortedItems.forEach((record) => {
163
193
  flatRecords.push({
164
- type: "ar",
194
+ type: 'ar',
165
195
  title: record.ResourceName,
166
196
  fullAddress: record.AddressLine2,
167
197
  workPhone: record.Phone,
168
198
  mobilePhone: record.CompanyMobile,
169
199
  email: record.CompanyEmailDisp,
170
200
  website: this.formatWebsite(record.CompanyWebURLDisp),
171
- contact1: this.returnContact(record.ContactFirstName, record.ContactLastName),
201
+ contact1: this.returnContact(
202
+ record.ContactFirstName,
203
+ record.ContactLastName,
204
+ ),
172
205
  email1: record.ContactEmail,
173
206
  phone1: record.ContactPhoneDisp,
174
207
  mobile1: record.ContactMobileDisp,
175
- services: record.ServicesAll.replace(/,$/, ""),
208
+ services: record.ServicesAll.replace(/,$/, ''),
176
209
  serviceCategory: record.ServiceAll,
177
- });
178
- });
179
- return flatRecords;
210
+ })
211
+ })
212
+ return flatRecords
180
213
  },
181
214
  resultChunks() {
182
- return this.chunkify(this.filteredItems || this.items, this.perPage);
215
+ return this.chunkify(this.filteredItems || this.items, this.perPage)
183
216
  },
184
217
  noRecordsFound() {
185
- return this.resultChunks[0].length === 0;
218
+ return this.resultChunks[0].length === 0
186
219
  },
187
220
  totalResults() {
188
- return Array.isArray(this.filteredItems) ? this.filteredItems.length : 0;
221
+ return Array.isArray(this.filteredItems) ? this.filteredItems.length : 0
189
222
  },
190
223
  totalPages() {
191
- return this.resultChunks.length;
224
+ return this.resultChunks.length
192
225
  },
193
226
  pageResultCount() {
194
- return this.resultChunks[this.page].length;
227
+ return this.resultChunks[this.page].length
195
228
  },
196
229
  },
197
230
 
198
231
  methods: {
199
232
  formatWebsite(url) {
200
- let startUrl = url.slice(0, 3);
201
- let returnUrl = url;
202
- if (startUrl.toLowerCase() === "www") {
203
- returnUrl = "https://" + url;
233
+ let startUrl = url.slice(0, 3)
234
+ let returnUrl = url
235
+ if (startUrl.toLowerCase() === 'www') {
236
+ returnUrl = 'https://' + url
204
237
  }
205
238
  if (
206
- startUrl.toLowerCase() !== "htt" &&
207
- startUrl.toLowerCase() !== "www" &&
208
- url !== ""
239
+ startUrl.toLowerCase() !== 'htt' &&
240
+ startUrl.toLowerCase() !== 'www' &&
241
+ url !== ''
209
242
  ) {
210
- returnUrl = "https://www." + url;
243
+ returnUrl = 'https://www.' + url
211
244
  }
212
- return returnUrl;
245
+ return returnUrl
213
246
  },
214
247
 
215
248
  returnContact(firstN, lastN) {
216
- let retContact = [firstN, lastN].filter(Boolean).join(" ");
217
- return retContact;
249
+ let retContact = [firstN, lastN].filter(Boolean).join(' ')
250
+ return retContact
218
251
  },
219
252
 
220
253
  chunkify(arr, n) {
221
254
  if (arr) {
222
255
  const chunked = arr.reduce(
223
256
  (chunk, val) => {
224
- if (chunk[chunk.length - 1].length === n) chunk.push([]);
225
- chunk[chunk.length - 1].push(val);
226
- return chunk;
257
+ if (chunk[chunk.length - 1].length === n) chunk.push([])
258
+ chunk[chunk.length - 1].push(val)
259
+ return chunk
227
260
  },
228
- [[]]
229
- );
230
- return chunked;
261
+ [[]],
262
+ )
263
+ return chunked
231
264
  }
232
- return [[]];
265
+ return [[]]
233
266
  },
234
267
 
235
268
  reset() {
236
- this.collapseOrgs("No");
237
- this.hideReset = true;
238
- this.searchRem = "";
239
- this.searchClass = "";
240
- this.searchSub = "";
241
- this.searchServices = "";
269
+ this.collapseOrgs('No')
270
+ this.hideReset = true
271
+ this.searchRem = ''
272
+ this.searchClass = ''
273
+ this.searchSub = ''
274
+ this.searchServices = ''
242
275
  },
243
276
 
244
277
  pageChanged(ev) {
245
- this.page = ev - 1;
278
+ this.page = ev - 1
246
279
 
247
280
  if (
248
281
  this.searchRem.length ||
@@ -254,41 +287,41 @@ export default {
254
287
  // don't collapseOrgs
255
288
  } else {
256
289
  // set focus to top element - used instead of scrollTo
257
- this.collapseOrgs("Yes");
290
+ this.collapseOrgs('Yes')
258
291
  }
259
292
  },
260
293
 
261
294
  collapseOrgs(focusLink) {
262
295
  // called by pageChanged and reset. pageChanged called by filter and by pagination links
263
- const aLinks = document.getElementsByName("titleLink");
296
+ const aLinks = document.getElementsByName('titleLink')
264
297
  // Convert nodelist to array
265
- let linksArr = Array.from(aLinks);
298
+ let linksArr = Array.from(aLinks)
266
299
  if (Array.isArray(linksArr) && linksArr.length > 0) {
267
300
  linksArr
268
- .filter((link) => link.getAttribute("aria-expanded") === "true")
269
- .forEach((link) => link.click());
301
+ .filter((link) => link.getAttribute('aria-expanded') === 'true')
302
+ .forEach((link) => link.click())
270
303
 
271
- if (focusLink === "Yes") {
272
- linksArr[0].focus();
304
+ if (focusLink === 'Yes') {
305
+ linksArr[0].focus()
273
306
  }
274
307
  }
275
308
  },
276
309
 
277
310
  toTitleCase(strVal) {
278
- let retVal = strVal.trim();
311
+ let retVal = strVal.trim()
279
312
 
280
- const firstChar = retVal.charAt(0);
281
- const firstCharU = firstChar.toUpperCase();
282
- const remChar = retVal.slice(1);
313
+ const firstChar = retVal.charAt(0)
314
+ const firstCharU = firstChar.toUpperCase()
315
+ const remChar = retVal.slice(1)
283
316
 
284
- retVal = firstCharU + remChar;
317
+ retVal = firstCharU + remChar
285
318
 
286
- return retVal;
319
+ return retVal
287
320
  },
288
321
  },
289
- };
322
+ }
290
323
  </script>
291
324
 
292
325
  <style lang="scss" scoped>
293
- @import "../../HSCP/styles.scss";
326
+ @import '../../HSCP/styles.scss';
294
327
  </style>