@worksafevictoria/wcl7.5 1.1.0-beta.111 → 1.1.0-beta.113

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worksafevictoria/wcl7.5",
3
- "version": "1.1.0-beta.111",
3
+ "version": "1.1.0-beta.113",
4
4
  "main": "src/index.js",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -3,51 +3,51 @@
3
3
  <!-- Main details -->
4
4
  <container>
5
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 }}
6
+ <column md="2" sm="12" class="title" >
7
+ <a name="titleLink" v-if="item.title" href="javascript:void(0)" :aria-expanded="visible ? 'true' : 'false'" @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">
26
42
  </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 }}
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">
32
49
  </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>
50
+ </div>
51
51
  </container>
52
52
 
53
53
  <!-- Additional Content -->
@@ -156,7 +156,7 @@ export default {
156
156
  item: {
157
157
  type: Object,
158
158
  required: true
159
- }
159
+ },
160
160
  },
161
161
  data() {
162
162
  return {
@@ -169,6 +169,7 @@ export default {
169
169
  gMapLink() {
170
170
  return `https://google.com/maps?q=${this.item.title}%20${this.item.fullAddress}`
171
171
  },
172
+
172
173
  },
173
174
  methods: {
174
175
  handleClick(title) {
@@ -42,9 +42,9 @@
42
42
  </column>
43
43
  </row>
44
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" />
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
48
  </template>
49
49
  </div>
50
50
  <div v-if="filteredRecords.length > 0" align-items="center">
@@ -137,7 +137,7 @@ export default {
137
137
 
138
138
  filteredRecords() {
139
139
  let results = this.flatRecords
140
-
140
+
141
141
  if (this.searchOrg.length) {
142
142
  this.hideReset = false
143
143
  results = results.filter(item => item.title.toLowerCase().includes(this.searchOrg.toLowerCase()))
@@ -155,6 +155,11 @@ export default {
155
155
  results = results.filter(item => item.courses.toLowerCase().includes(this.searchThemes.toLowerCase()))
156
156
  }
157
157
  this.filteredItems = results
158
+
159
+ if (this.searchOrg.length || this.searchSub.length || this.searchCourse.length || this.searchThemes.length) {
160
+ this.pageChanged(1)
161
+ }
162
+
158
163
  return results
159
164
  },
160
165
 
@@ -244,30 +249,18 @@ export default {
244
249
 
245
250
  pageChanged(ev) {
246
251
  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
- }
252
+
253
+ const aLinks = document.getElementsByName('titleLink')
254
+ // Convert nodelist to array
255
+ let linksArr = Array.from(aLinks)
256
+ if (Array.isArray(linksArr) && linksArr.length > 0) {
257
+ linksArr
258
+ .filter((link) => link.getAttribute('aria-expanded') === 'true')
259
+ .forEach((link) => link.click())
265
260
 
266
- window.scrollTo({
267
- top,
268
- behavior: 'smooth',
269
- })
261
+ linksArr[0].focus()
270
262
  }
263
+
271
264
  },
272
265
  }
273
266
  }
@@ -26,23 +26,17 @@
26
26
  >
27
27
  {{ data.label }}
28
28
  <span class="sortImg" v-if="data.field.sortable">
29
- <img
30
- v-if="data.field.thAttr['aria-sort'] === 'none'"
31
- :src="sortIconNeutral"
32
- alt="image indicating no sort"
33
- style="width: 0.55rem; height: 0.9rem"
34
- />
35
29
  <img
36
30
  v-if="data.field.thAttr['aria-sort'] === 'ascending'"
37
- :src="sortIconAsc"
31
+ :src="CaretUp"
38
32
  alt="image indicating ascending sort"
39
- style="width: 0.55rem; height: 0.9rem"
33
+ class="iconAsc"
40
34
  />
41
35
  <img
42
36
  v-else-if="data.field.thAttr['aria-sort'] === 'descending'"
43
- :src="sortIconDesc"
37
+ :src="CaretDown"
44
38
  alt="image indicating descending sort"
45
- style="width: 0.55rem; height: 0.9rem"
39
+ class="iconDesc"
46
40
  />
47
41
  </span>
48
42
  </span>
@@ -56,12 +50,14 @@
56
50
  </template>
57
51
 
58
52
  <script>
59
- import SectionGroup from './../../Containers/SectionGroup/index.vue'
60
- import RichText from '../../Paragraphs/RichText/index.vue'
61
- import { BTable } from 'bootstrap-vue-next'
53
+ import SectionGroup from "./../../Containers/SectionGroup/index.vue";
54
+ import RichText from "../../Paragraphs/RichText/index.vue";
55
+ import { BTable } from "bootstrap-vue-next";
56
+ import CaretUp from "./../../../assets/icons/caret-up.svg?url";
57
+ import CaretDown from "./../../../assets/icons/caret-down.svg?url";
62
58
 
63
59
  export default {
64
- name: 'TabulatedData',
60
+ name: "TabulatedData",
65
61
  components: { SectionGroup, RichText, BTable },
66
62
  props: {
67
63
  items: {
@@ -82,7 +78,7 @@ export default {
82
78
  },
83
79
  caption: {
84
80
  type: String,
85
- default: '',
81
+ default: "",
86
82
  required: false,
87
83
  },
88
84
  sortBy: {
@@ -93,42 +89,33 @@ export default {
93
89
  },
94
90
  data() {
95
91
  return {
96
- newSortBy: this.sortBy ? [{ key: this.sortBy, order: 'asc' }] : [],
92
+ newSortBy: this.sortBy ? [{ key: this.sortBy, order: "asc" }] : [],
97
93
  //sortDesc: false,
98
- sortIconNeutral:
99
- "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='101' height='101' view-box='0 0 101 101' preserveAspectRatio='none'%3e%3cpath fill='black' opacity='.3' d='M51 1l25 23 24 22H1l25-22zM51 101l25-23 24-22H1l25 22z'/%3e%3c/svg%3e",
100
- sortIconDesc:
101
- "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='101' height='101' view-box='0 0 101 101' preserveAspectRatio='none'%3e%3cpath fill='black' d='M51 1l25 23 24 22H1l25-22z'/%3e%3cpath fill='black' opacity='.3' d='M51 101l25-23 24-22H1l25 22z'/%3e%3c/svg%3e",
102
- sortIconAsc:
103
- "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='101' height='101' view-box='0 0 101 101' preserveAspectRatio='none'%3e%3cpath fill='black' opacity='.3' d='M51 1l25 23 24 22H1l25-22z'/%3e%3cpath fill='black' d='M51 101l25-23 24-22H1l25 22z'/%3e%3c/svg%3e",
104
- }
94
+ CaretUp,
95
+ CaretDown,
96
+ };
105
97
  },
106
98
  computed: {
107
99
  isFluid() {
108
- return this.isFixedWidth
100
+ return this.isFixedWidth;
109
101
  },
110
102
  },
111
103
  methods: {
112
104
  accessSort(fieldVar) {
113
- //this.sortBy = fieldVar.key
114
- if (
115
- fieldVar.thAttr['aria-sort'] === 'none' ||
116
- fieldVar.thAttr['aria-sort'] === 'descending'
117
- ) {
118
- this.newSortBy = [{ key: fieldVar.key, order: 'asc' }]
119
- //this.sortDesc = false
105
+ const currentSort = fieldVar.thAttr["aria-sort"];
106
+ if (currentSort === "ascending") {
107
+ this.newSortBy = [{ key: fieldVar.key, order: "desc" }];
120
108
  } else {
121
- this.newSortBy = [{ key: fieldVar.key, order: 'desc' }]
122
- //this.sortDesc = true
109
+ this.newSortBy = [{ key: fieldVar.key, order: "asc" }];
123
110
  }
124
111
  },
125
112
  },
126
- }
113
+ };
127
114
  </script>
128
115
 
129
116
  <style lang="scss">
130
117
  .paragraph--tabulated-data {
131
- @import '../../../includes/scss/all';
118
+ @import "../../../includes/scss/all";
132
119
 
133
120
  .section-group__block {
134
121
  margin-top: -32px;