@worksafevictoria/wcl7.5 1.4.0 → 1.6.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/.storybook/preview.js +20 -13
- package/bin/deploy.sh +1 -1
- package/lib/utility.js +10 -8
- package/package.json +4 -5
- package/src/assets/icons/AppFooter/x-ws-footer.svg +10 -0
- package/src/assets/icons/AppFooter/x-ww-footer.svg +28 -0
- package/src/assets/icons/SocialShare/x-icon-white.svg +28 -0
- package/src/assets/styles/modal.scss +51 -0
- package/src/components/Common/CardGrid/index.vue +69 -49
- package/src/components/Common/CardGridItem/card-grid-item-caret.vue +7 -4
- package/src/components/Common/CardGridItem/index.vue +95 -71
- package/src/components/Containers/Carousel/index.vue +14 -7
- package/src/components/Containers/HomepageHeader/index.stories.js +60 -36
- package/src/components/Containers/HomepageHeader/index.vue +2 -26
- package/src/components/Containers/HomepageHeaderNew/index.stories.js +15 -15
- package/src/components/Containers/HomepageHeaderNew/index.vue +97 -68
- package/src/components/Containers/SectionGroup/index.vue +1 -1
- package/src/components/Containers/Subheader/index.vue +5 -1
- package/src/components/Global/AppFooter/FooterSocialShare/index.vue +1 -1
- package/src/components/Global/AppFooter/index.vue +14 -7
- package/src/components/Global/AppHeaderNew/index.vue +304 -233
- package/src/components/Global/AppHeaderNew/styles.scss +29 -8
- package/src/components/Global/BackToTop/index.vue +8 -8
- package/src/components/Global/ContrastMode/index.vue +1 -1
- package/src/components/Global/Cookies/index.stories.js +16 -10
- package/src/components/Global/Cookies/index.vue +281 -237
- package/src/components/Global/Cookies/styles.scss +54 -54
- package/src/components/Global/DirectoryFilters/SingleTaxonomy/index.vue +50 -133
- package/src/components/Global/GlobalNotice/index.vue +79 -100
- package/src/components/Global/SocialShare/index.vue +1 -1
- package/src/components/Global/Strip/index.vue +1 -1
- package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +8 -4
- package/src/components/Paragraphs/Accordion/StepperItem/index.vue +23 -23
- package/src/components/Paragraphs/Accordion/index.stories.js +21 -18
- package/src/components/Paragraphs/Accordion/index.vue +52 -48
- package/src/components/Paragraphs/BrowseContent/index.vue +1 -1
- package/src/components/Paragraphs/BrowseContent/setup.vue +284 -0
- package/src/components/Paragraphs/Chart/Constants.js +485 -485
- package/src/components/Paragraphs/Chart/index.vue +232 -241
- package/src/components/Paragraphs/Directory/Records/HSCP/index.stories.js +33 -0
- package/src/components/Paragraphs/Directory/Records/HSCP/index.vue +334 -0
- package/src/components/Paragraphs/Directory/Records/ISP/index.vue +2 -2
- package/src/components/Paragraphs/Directory/Records/index.vue +63 -27
- package/src/components/Paragraphs/Directory/Records/styles.scss +1 -0
- package/src/components/Paragraphs/Directory/constants.js +23 -5
- package/src/components/Paragraphs/Directory/index.vue +14 -14
- package/src/components/Paragraphs/ListGroup/index.vue +5 -1
- package/src/components/Paragraphs/ScrollSpy/index.vue +23 -14
- package/src/components/Paragraphs/SelectableCards/index.vue +15 -12
- package/src/components/Paragraphs/TabbedCards/index.vue +13 -14
- package/src/components/Paragraphs/Tabs/index.vue +19 -17
- package/src/components/Paragraphs/TextMedia/MediaTypes/Video/index.vue +9 -9
- package/src/components/Paragraphs/TextMedia/index.vue +20 -16
- package/src/components/Paragraphs/VideoGrid/index.stories.js +43 -19
- package/src/components/Paragraphs/VideoGrid/index.vue +13 -13
- package/src/components/Paragraphs/Webform/index.stories.js +82 -69
- package/src/components/SubComponents/CardGroup/index.vue +5 -1
- package/src/components/SubComponents/FormAddressPostcode/index.vue +35 -37
- package/src/components/SubComponents/FormInstance/components/handler/index.vue +25 -29
- package/src/components/SubComponents/FormInstance/components/renderer/index.vue +63 -28
- package/src/components/SubComponents/FormInstance/models/overrides/file.js +33 -40
- package/src/components/SubComponents/FormInstance/services/form-submit-parser.js +22 -15
- package/src/components/SubComponents/FormInstance/services/registry-factory.js +1 -1
- package/src/components/SubComponents/FormInstance/stories/fileupload.stories.js +57 -0
- package/src/components/SubComponents/FormInstance/stories/mocks/fileupload.json +25 -0
- package/src/components/SubComponents/FormInstance/style.scss +2 -2
- package/src/components/SubComponents/FormInstance/tests/address.test.js +4 -4
- package/src/components/SubComponents/FormInstance/tests/checkboxes.test.js +7 -7
- package/src/components/SubComponents/FormInstance/tests/customcomposite.test.js +15 -15
- package/src/components/SubComponents/FormInstance/tests/date.test.js +8 -8
- package/src/components/SubComponents/FormInstance/tests/form-test-utils.js +9 -9
- package/src/components/SubComponents/FormInstance/tests/multiple.test.js +13 -13
- package/src/components/SubComponents/FormInstance/tests/rule-visible.test.js +120 -120
- package/src/components/SubComponents/FormInstance/tests/scale.test.js +6 -6
- package/src/components/SubComponents/FormInstance/tests/url.test.js +13 -10
- package/src/components/SubComponents/Pagination/index.vue +19 -18
- package/src/components/SubComponents/ResourceGroup/index.vue +5 -1
- package/src/components/SubComponents/Search/SearchListing/index.vue +20 -20
- package/src/components/SubComponents/Search/index.vue +35 -33
- package/src/components/SubComponents/VideoThumbnail/index.vue +48 -133
- package/src/includes/scss/mixins/src/units.scss +25 -4
- package/src/includes/scss/vars/src/colors.module.scss +28 -1
- package/src/index.js +21 -3
- package/src/main.js +2 -10
- package/src/mock/app-header-new.js +27 -15
- package/src/mock/carousel-items.js +71 -46
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<single-taxonomy
|
|
6
6
|
v-for="(t, i) in computedPropFilters"
|
|
7
7
|
:key="i"
|
|
8
|
-
|
|
8
|
+
ref="items"
|
|
9
9
|
:data="t"
|
|
10
10
|
:results="filteredList.length"
|
|
11
11
|
:loading="isFiltering"
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
? chart.filter === 'primary'
|
|
43
43
|
? by_primary()
|
|
44
44
|
: chart.filter === 'months'
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
? by_months()
|
|
46
|
+
: compare()
|
|
47
47
|
: noData()
|
|
48
48
|
"
|
|
49
49
|
:options="chart.options"
|
|
@@ -54,264 +54,255 @@
|
|
|
54
54
|
</container>
|
|
55
55
|
</template>
|
|
56
56
|
|
|
57
|
-
<script>
|
|
57
|
+
<script setup>
|
|
58
58
|
import { GChart } from 'vue-google-charts'
|
|
59
|
-
import Container from '../../Containers/Container/index.vue'
|
|
59
|
+
import Container from '../../Containers/Container/index.vue'
|
|
60
60
|
import Column from '../../Containers/Column/index.vue'
|
|
61
61
|
import Row from '../../Containers/Row/index.vue'
|
|
62
62
|
import FilterButton from '../../Common/FilterButton/index.vue' // Reset
|
|
63
63
|
import SingleTaxonomy from '../../Global/DirectoryFilters/SingleTaxonomy/index.vue'
|
|
64
64
|
import { BFormGroup, BFormSelect } from 'bootstrap-vue-next'
|
|
65
|
+
import { defineProps, computed, toRefs, ref, useTemplateRef } from 'vue'
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
67
|
+
const props = defineProps({
|
|
68
|
+
statsData: { type: Array, default: () => [] },
|
|
69
|
+
filterFields: { type: Array, default: () => [] },
|
|
70
|
+
chart: { type: Object, default: () => {} },
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
const { statsData, filterFields, chart } = toRefs(props)
|
|
74
|
+
|
|
75
|
+
const hideReset = ref(true)
|
|
76
|
+
const isFiltering = ref(false)
|
|
77
|
+
const filters = ref({
|
|
78
|
+
taxonomies: [],
|
|
79
|
+
selected: {},
|
|
80
|
+
availableBundles: [],
|
|
81
|
+
})
|
|
82
|
+
const graphSelected = ref(null)
|
|
83
|
+
const chartHeight = ref(
|
|
84
|
+
chart.value.options.height ? chart.value.options.height : 600,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
const itemRefs = useTemplateRef('items')
|
|
88
|
+
|
|
89
|
+
const graphOptions = computed(() => {
|
|
90
|
+
return filterFields.value.slice(1).map((field) => {
|
|
91
|
+
if (!graphSelected.value) {
|
|
92
|
+
graphSelected.value = field.record_id
|
|
93
|
+
}
|
|
94
|
+
return { value: field.record_id, text: field.name }
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
const computedPropFilters = computed(() => {
|
|
99
|
+
let fields = filterFields.value.map((field) => {
|
|
100
|
+
let terms = null
|
|
101
|
+
if (field.date) {
|
|
102
|
+
terms = statsData.value
|
|
103
|
+
.map((item) => item[field.record_id].split('/')[2]) // Date field get year
|
|
104
|
+
.filter((value, index, self) => self.indexOf(value) === index)
|
|
105
|
+
.map((value) => {
|
|
106
|
+
return { tid: value, name: value, preselected: false }
|
|
107
|
+
})
|
|
108
|
+
.sort((a, b) => a.name.localeCompare(b.name))
|
|
109
|
+
} else {
|
|
110
|
+
terms = statsData.value
|
|
111
|
+
.map((item) => item[field.record_id])
|
|
112
|
+
.filter((value, index, self) => self.indexOf(value) === index)
|
|
113
|
+
.map((value) => {
|
|
114
|
+
return { tid: value, name: value, preselected: false }
|
|
115
|
+
})
|
|
116
|
+
.sort((a, b) => a.name.localeCompare(b.name))
|
|
117
|
+
}
|
|
84
118
|
return {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
taxonomies: [],
|
|
89
|
-
selected: {},
|
|
90
|
-
availableBundles: []
|
|
91
|
-
},
|
|
92
|
-
graphSelected: null,
|
|
93
|
-
chartHeight: this.chart.options.height ? this.chart.options.height : 600
|
|
119
|
+
name: field.name,
|
|
120
|
+
record_id: field.record_id,
|
|
121
|
+
terms,
|
|
94
122
|
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
if (
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
123
|
+
})
|
|
124
|
+
return fields
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
const filteredList = computed(() => {
|
|
128
|
+
let filterKeys = Object.keys(filters.value.selected).map((key) => key)
|
|
129
|
+
let list = statsData.value.filter((element) => {
|
|
130
|
+
let include = true
|
|
131
|
+
for (var i = 0, n = filterKeys.length; i < n; ++i) {
|
|
132
|
+
if (filters.value.selected[filterKeys[i]].length > 0) {
|
|
133
|
+
let filterType = filterFields.value.find(
|
|
134
|
+
(item) => item.record_id === filterKeys[i],
|
|
135
|
+
)
|
|
136
|
+
if (filterType.date) {
|
|
137
|
+
// Filter by year
|
|
138
|
+
if (
|
|
139
|
+
filters.value.selected[filterKeys[i]].indexOf(
|
|
140
|
+
element[filterKeys[i]].split('/')[2],
|
|
141
|
+
) === -1
|
|
142
|
+
) {
|
|
143
|
+
include = false
|
|
144
|
+
}
|
|
116
145
|
} else {
|
|
117
|
-
|
|
118
|
-
.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
.sort((a, b) => a.name.localeCompare(b.name))
|
|
124
|
-
}
|
|
125
|
-
return {
|
|
126
|
-
name: field.name,
|
|
127
|
-
record_id: field.record_id,
|
|
128
|
-
terms
|
|
129
|
-
}
|
|
130
|
-
})
|
|
131
|
-
return fields
|
|
132
|
-
},
|
|
133
|
-
filteredList: function() {
|
|
134
|
-
let filterKeys = Object.keys(this.filters.selected).map((key) => key)
|
|
135
|
-
let list = this.statsData.filter((element) => {
|
|
136
|
-
let include = true
|
|
137
|
-
for (var i = 0, n = filterKeys.length; i < n; ++i) {
|
|
138
|
-
if (this.filters.selected[filterKeys[i]].length > 0) {
|
|
139
|
-
let filterType = this.filterFields.find(
|
|
140
|
-
(item) => item.record_id === filterKeys[i]
|
|
141
|
-
)
|
|
142
|
-
if (filterType.date) {
|
|
143
|
-
// Filter by year
|
|
144
|
-
if (
|
|
145
|
-
this.filters.selected[filterKeys[i]].indexOf(
|
|
146
|
-
element[filterKeys[i]].split('/')[2]
|
|
147
|
-
) === -1
|
|
148
|
-
) {
|
|
149
|
-
include = false
|
|
150
|
-
}
|
|
151
|
-
} else {
|
|
152
|
-
if (
|
|
153
|
-
this.filters.selected[filterKeys[i]].indexOf(
|
|
154
|
-
element[filterKeys[i]]
|
|
155
|
-
) === -1
|
|
156
|
-
) {
|
|
157
|
-
include = false
|
|
158
|
-
}
|
|
159
|
-
}
|
|
146
|
+
if (
|
|
147
|
+
filters.value.selected[filterKeys[i]].indexOf(
|
|
148
|
+
element[filterKeys[i]],
|
|
149
|
+
) === -1
|
|
150
|
+
) {
|
|
151
|
+
include = false
|
|
160
152
|
}
|
|
161
153
|
}
|
|
162
|
-
|
|
163
|
-
return element
|
|
164
|
-
}
|
|
165
|
-
})
|
|
166
|
-
return list
|
|
154
|
+
}
|
|
167
155
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
156
|
+
if (include) {
|
|
157
|
+
return element
|
|
158
|
+
}
|
|
159
|
+
})
|
|
160
|
+
return list
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
const onFilter = (filterParam) => {
|
|
164
|
+
hideReset.value = false
|
|
165
|
+
const allFiltersUnselected = Object.values(itemRefs.value).every(
|
|
166
|
+
(taxonomy) => {
|
|
167
|
+
return Object.values(taxonomy.selectedFilters).every(
|
|
168
|
+
(filter) => filter.filter((item) => !item.preselected).length === 0,
|
|
178
169
|
)
|
|
179
|
-
if (allFiltersUnselected) {
|
|
180
|
-
this.hideReset = true
|
|
181
|
-
}
|
|
182
|
-
Object.keys(filters).forEach((filter) => {
|
|
183
|
-
this.filters.selected[filter] = filters[filter].map((obj) => obj.tid)
|
|
184
|
-
})
|
|
185
170
|
},
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
171
|
+
)
|
|
172
|
+
if (allFiltersUnselected) {
|
|
173
|
+
hideReset.value = true
|
|
174
|
+
}
|
|
175
|
+
Object.keys(filterParam).forEach((filter) => {
|
|
176
|
+
filters.value.selected[filter] = filterParam[filter].map((obj) => obj.tid)
|
|
177
|
+
})
|
|
178
|
+
}
|
|
179
|
+
const reset = () => {
|
|
180
|
+
hideReset.value = true
|
|
181
|
+
Object.keys(itemRefs.value).forEach((key) => {
|
|
182
|
+
itemRefs.value[key].reset()
|
|
183
|
+
})
|
|
184
|
+
filters.value.selected = {}
|
|
185
|
+
}
|
|
186
|
+
const by_primary = () => {
|
|
187
|
+
let primaryFilter = filterFields.value[0]
|
|
188
|
+
let data = [[primaryFilter.name, chart.value.header]]
|
|
189
|
+
let keys = {}
|
|
197
190
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
191
|
+
filteredList.value.forEach((element) => {
|
|
192
|
+
// Work off primary field
|
|
193
|
+
let group = null
|
|
194
|
+
if (primaryFilter.date) {
|
|
195
|
+
group = `${element[primaryFilter.record_id].split('/')[2]} `
|
|
196
|
+
} else {
|
|
197
|
+
group = element[primaryFilter.record_id]
|
|
198
|
+
}
|
|
206
199
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
})
|
|
290
|
-
}
|
|
291
|
-
keys[group][element[this.graphSelected]]++
|
|
292
|
-
})
|
|
293
|
-
Object.keys(keys).forEach((key) => {
|
|
294
|
-
data.push([key, ...Object.entries(keys[key]).map(([k, v]) => v)])
|
|
200
|
+
if (group in keys) {
|
|
201
|
+
keys[group]++
|
|
202
|
+
} else {
|
|
203
|
+
keys[group] = 1
|
|
204
|
+
}
|
|
205
|
+
})
|
|
206
|
+
Object.keys(keys).forEach((item) => {
|
|
207
|
+
data.push([item, keys[item]])
|
|
208
|
+
})
|
|
209
|
+
if (chart.value.type === 'BarChart') {
|
|
210
|
+
chart.value.options.height = data[0].length * 200
|
|
211
|
+
} else {
|
|
212
|
+
chart.value.options.height = chartHeight.value
|
|
213
|
+
}
|
|
214
|
+
return data
|
|
215
|
+
}
|
|
216
|
+
const by_months = () => {
|
|
217
|
+
let primaryFilter = filterFields.value[0]
|
|
218
|
+
if (!primaryFilter.date) {
|
|
219
|
+
return ['Requires date in primary field']
|
|
220
|
+
}
|
|
221
|
+
let data = [
|
|
222
|
+
['Month'],
|
|
223
|
+
['Jan'],
|
|
224
|
+
['Feb'],
|
|
225
|
+
['Mar'],
|
|
226
|
+
['Apr'],
|
|
227
|
+
['May'],
|
|
228
|
+
['Jun'],
|
|
229
|
+
['Jul'],
|
|
230
|
+
['Aug'],
|
|
231
|
+
['Sep'],
|
|
232
|
+
['Oct'],
|
|
233
|
+
['Nov'],
|
|
234
|
+
['Dec'],
|
|
235
|
+
]
|
|
236
|
+
let years = filteredList.value
|
|
237
|
+
.map((item) => item[primaryFilter.record_id].split('/')[2])
|
|
238
|
+
.filter((value, index, self) => self.indexOf(value) === index)
|
|
239
|
+
data[0].push(...years)
|
|
240
|
+
for (var i = 1, n = data.length; i < n; ++i) {
|
|
241
|
+
for (var j = 0, m = years.length; j < m; ++j) {
|
|
242
|
+
data[i].push(0)
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
filteredList.value.forEach((element) => {
|
|
246
|
+
let year = element[primaryFilter.record_id].split('/')[2]
|
|
247
|
+
let month = element[primaryFilter.record_id].split('/')[1]
|
|
248
|
+
data[month][data[0].indexOf(year)]++
|
|
249
|
+
})
|
|
250
|
+
for (var i = 2; i < data.length; i++) {
|
|
251
|
+
for (var j = 1; j < data[i].length; j++) {
|
|
252
|
+
data[i][j] = data[i][j] + data[i - 1][j]
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
if (chart.value.type === 'BarChart') {
|
|
256
|
+
chart.value.options.height = data[0].length * 200
|
|
257
|
+
} else {
|
|
258
|
+
chart.value.options.height = chartHeight.value
|
|
259
|
+
}
|
|
260
|
+
return data
|
|
261
|
+
}
|
|
262
|
+
const compare = () => {
|
|
263
|
+
let primaryFilter = filterFields.value[0]
|
|
264
|
+
let comparison = filteredList.value
|
|
265
|
+
.map((item) => item[graphSelected.value])
|
|
266
|
+
.filter((value, index, self) => self.indexOf(value) === index)
|
|
267
|
+
.sort((a, b) => a.localeCompare(b))
|
|
268
|
+
let data = [['Year', ...comparison]]
|
|
269
|
+
let keys = {}
|
|
270
|
+
filteredList.value.forEach((element) => {
|
|
271
|
+
let group = null
|
|
272
|
+
if (primaryFilter.date) {
|
|
273
|
+
group = `${element[primaryFilter.record_id].split('/')[2]} `
|
|
274
|
+
} else {
|
|
275
|
+
group = element[primaryFilter.record_id]
|
|
276
|
+
}
|
|
277
|
+
if (group in keys) {
|
|
278
|
+
} else {
|
|
279
|
+
keys[group] = {}
|
|
280
|
+
comparison.forEach((co) => {
|
|
281
|
+
keys[group][co] = 0
|
|
295
282
|
})
|
|
296
|
-
if (this.chart.type === 'BarChart') {
|
|
297
|
-
this.chart.options.height = data[0].length * 200
|
|
298
|
-
} else {
|
|
299
|
-
this.chart.options.height = this.chartHeight
|
|
300
|
-
}
|
|
301
|
-
return data
|
|
302
|
-
},
|
|
303
|
-
noData() {
|
|
304
|
-
return [
|
|
305
|
-
[
|
|
306
|
-
{ label: 'Results', type: 'string' },
|
|
307
|
-
{ label: 'Results', type: 'number' },
|
|
308
|
-
{ role: 'style', type: 'string' },
|
|
309
|
-
{ role: 'annotation', type: 'string' }
|
|
310
|
-
],
|
|
311
|
-
['', 0, null, 'No results found']
|
|
312
|
-
]
|
|
313
283
|
}
|
|
284
|
+
keys[group][element[graphSelected.value]]++
|
|
285
|
+
})
|
|
286
|
+
Object.keys(keys).forEach((key) => {
|
|
287
|
+
data.push([key, ...Object.entries(keys[key]).map(([k, v]) => v)])
|
|
288
|
+
})
|
|
289
|
+
if (chart.value.type === 'BarChart') {
|
|
290
|
+
chart.value.options.height = data[0].length * 200
|
|
291
|
+
} else {
|
|
292
|
+
chart.value.options.height = chartHeight.value
|
|
314
293
|
}
|
|
294
|
+
return data
|
|
295
|
+
}
|
|
296
|
+
const noData = () => {
|
|
297
|
+
return [
|
|
298
|
+
[
|
|
299
|
+
{ label: 'Results', type: 'string' },
|
|
300
|
+
{ label: 'Results', type: 'number' },
|
|
301
|
+
{ role: 'style', type: 'string' },
|
|
302
|
+
{ role: 'annotation', type: 'string' },
|
|
303
|
+
],
|
|
304
|
+
['', 0, null, 'No results found'],
|
|
305
|
+
]
|
|
315
306
|
}
|
|
316
307
|
</script>
|
|
317
308
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import hscpRecord from './index.vue'
|
|
2
|
+
|
|
3
|
+
const cpData =
|
|
4
|
+
{
|
|
5
|
+
title: 'Australian Nurses and Midwifery Federation - Victorian Branch',
|
|
6
|
+
fullAddress: 'Level 8/535 Elizabeth St Melbourne VIC 3000',
|
|
7
|
+
workPhone: '03 9555 9333',
|
|
8
|
+
tollfreePhone: '1800 555 333',
|
|
9
|
+
email: 'ohs@test.com.au',
|
|
10
|
+
website: 'https://www.anmfvic.asn.au/education-and-training/hsr-training/events',
|
|
11
|
+
contact1: 'Christina Groebl',
|
|
12
|
+
phone1: '03 9555 0222',
|
|
13
|
+
email1: 'cgroebl@test.com.au',
|
|
14
|
+
contact2: 'Joey Bradford',
|
|
15
|
+
phone2: '03 9555 0666',
|
|
16
|
+
email2: 'jbradford@test.com.au',
|
|
17
|
+
courses: ['HSR Initial', 'HSR Refresher'],
|
|
18
|
+
trainingVenues: ['Melbourne CBD', 'All Regional Victoria - HQ in Melbourne'],
|
|
19
|
+
id: '1'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
title: 'Paragraphs/Directory/SingleRecord',
|
|
25
|
+
component: hscpRecord,
|
|
26
|
+
tags: ['autodocs']
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const CourseProvider = {}
|
|
30
|
+
|
|
31
|
+
CourseProvider.args = {
|
|
32
|
+
item: cpData,
|
|
33
|
+
}
|