@worksafevictoria/wcl7.5 1.6.0 → 1.7.1

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 (34) hide show
  1. package/package.json +3 -2
  2. package/src/components/Common/CardGridItem/card-grid-item-icon.vue +15 -19
  3. package/src/components/Common/CardGridItem/index.vue +108 -139
  4. package/src/components/Global/AppFooter/styles.scss +3 -0
  5. package/src/components/Global/DirectoryFilters/index.vue +3 -0
  6. package/src/components/Paragraphs/Chart/Constants.js +479 -479
  7. package/src/components/Paragraphs/Directory/{Records/HSCP → HSCP/Records/SingleRecord}/index.stories.js +4 -3
  8. package/src/components/Paragraphs/Directory/HSCP/Records/SingleRecord/index.vue +322 -0
  9. package/src/components/Paragraphs/Directory/HSCP/Records/index.stories.js +19 -0
  10. package/src/components/Paragraphs/Directory/HSCP/Records/index.vue +343 -0
  11. package/src/components/Paragraphs/Directory/HSCP/Records/pagination.vue +179 -0
  12. package/src/components/Paragraphs/Directory/Records/CJ/index.vue +1 -1
  13. package/src/components/Paragraphs/Directory/Records/ISP/index.vue +1 -1
  14. package/src/components/Paragraphs/Directory/Records/PRS/index.stories.js +34 -0
  15. package/src/components/Paragraphs/Directory/Records/PRS/index.vue +5 -1
  16. package/src/components/Paragraphs/Directory/Records/index.storieshide.js +47 -0
  17. package/src/components/Paragraphs/Directory/Records/index.vue +18 -35
  18. package/src/components/Paragraphs/Directory/{Records/styles.scss → styles.scss} +4 -3
  19. package/src/components/Paragraphs/Map/Constants.js +4790 -0
  20. package/src/components/Paragraphs/Map/index.mdx +29 -0
  21. package/src/components/Paragraphs/Map/index.stories.js +15 -0
  22. package/src/components/Paragraphs/Map/index.vue +313 -0
  23. package/src/components/Paragraphs/Map/lga-map.json +33462 -0
  24. package/src/components/Paragraphs/Map/postcode_location.json +3543 -0
  25. package/src/components/Paragraphs/TabulatedData/index.vue +27 -36
  26. package/src/components/SubComponents/Breadcrumb/index.vue +4 -0
  27. package/src/components/SubComponents/FormInstance/components/renderer/index.vue +23 -7
  28. package/src/components/SubComponents/FormInstance/models/overrides/file.js +7 -2
  29. package/src/components/SubComponents/ResourceGroup/index.vue +158 -184
  30. package/src/components/SubComponents/ResourceGroup/styles.scss +2 -0
  31. package/src/components/SubComponents/Search/index.vue +8 -3
  32. package/src/index.js +4 -0
  33. package/src/mock/course-provider.js +273 -0
  34. package/src/components/Paragraphs/Directory/Records/HSCP/index.vue +0 -334
@@ -16,6 +16,7 @@
16
16
  :borderless="false"
17
17
  :responsive="!isFluid"
18
18
  :stacked="!isFluid ? 'sm' : false"
19
+ :must-sort="true"
19
20
  >
20
21
  <template #head()="data">
21
22
  <span
@@ -26,23 +27,17 @@
26
27
  >
27
28
  {{ data.label }}
28
29
  <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
30
  <img
36
31
  v-if="data.field.thAttr['aria-sort'] === 'ascending'"
37
- :src="sortIconAsc"
32
+ :src="CaretUp"
38
33
  alt="image indicating ascending sort"
39
- style="width: 0.55rem; height: 0.9rem"
34
+ class="iconAsc"
40
35
  />
41
36
  <img
42
37
  v-else-if="data.field.thAttr['aria-sort'] === 'descending'"
43
- :src="sortIconDesc"
38
+ :src="CaretDown"
44
39
  alt="image indicating descending sort"
45
- style="width: 0.55rem; height: 0.9rem"
40
+ class="iconDesc"
46
41
  />
47
42
  </span>
48
43
  </span>
@@ -56,12 +51,14 @@
56
51
  </template>
57
52
 
58
53
  <script>
59
- import SectionGroup from './../../Containers/SectionGroup/index.vue'
60
- import RichText from '../../Paragraphs/RichText/index.vue'
61
- import { BTable } from 'bootstrap-vue-next'
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";
62
59
 
63
60
  export default {
64
- name: 'TabulatedData',
61
+ name: "TabulatedData",
65
62
  components: { SectionGroup, RichText, BTable },
66
63
  props: {
67
64
  items: {
@@ -82,7 +79,7 @@ export default {
82
79
  },
83
80
  caption: {
84
81
  type: String,
85
- default: '',
82
+ default: "",
86
83
  required: false,
87
84
  },
88
85
  sortBy: {
@@ -93,42 +90,33 @@ export default {
93
90
  },
94
91
  data() {
95
92
  return {
96
- newSortBy: this.sortBy ? [{ key: this.sortBy, order: 'asc' }] : [],
93
+ newSortBy: this.sortBy ? [{ key: this.sortBy, order: "asc" }] : [],
97
94
  //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
- }
95
+ CaretUp,
96
+ CaretDown,
97
+ };
105
98
  },
106
99
  computed: {
107
100
  isFluid() {
108
- return this.isFixedWidth
101
+ return this.isFixedWidth;
109
102
  },
110
103
  },
111
104
  methods: {
112
105
  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
106
+ const currentSort = fieldVar.thAttr["aria-sort"];
107
+ if (currentSort === "ascending") {
108
+ this.newSortBy = [{ key: fieldVar.key, order: "desc" }];
120
109
  } else {
121
- this.newSortBy = [{ key: fieldVar.key, order: 'desc' }]
122
- //this.sortDesc = true
110
+ this.newSortBy = [{ key: fieldVar.key, order: "asc" }];
123
111
  }
124
112
  },
125
113
  },
126
- }
114
+ };
127
115
  </script>
128
116
 
129
117
  <style lang="scss">
130
118
  .paragraph--tabulated-data {
131
- @import '../../../includes/scss/all';
119
+ @import "../../../includes/scss/all";
132
120
 
133
121
  .section-group__block {
134
122
  margin-top: -32px;
@@ -146,6 +134,7 @@ export default {
146
134
  .table td {
147
135
  margin: 1rem;
148
136
  vertical-align: middle;
137
+ padding: 12px;
149
138
  @media screen and (max-width: 540px) {
150
139
  margin: 0.5rem;
151
140
  }
@@ -155,6 +144,8 @@ export default {
155
144
  display: flex;
156
145
  flex-direction: row;
157
146
  flex-wrap: nowrap;
147
+ align-items: center;
148
+ width: 100%;
158
149
  }
159
150
 
160
151
  .rtl {
@@ -163,7 +154,7 @@ export default {
163
154
 
164
155
  .sortImg {
165
156
  vertical-align: middle;
166
- margin-left: 5px;
157
+ margin-left: auto;
167
158
  }
168
159
 
169
160
  .b-table-sortable-column svg {
@@ -42,6 +42,10 @@ export default {
42
42
 
43
43
  .breadcrumb-item a {
44
44
  color: $black !important;
45
+ text-decoration: none;
46
+ &:hover {
47
+ text-decoration: underline;
48
+ }
45
49
  }
46
50
  }
47
51
 
@@ -12,10 +12,14 @@
12
12
  @nextPage="next($event)"
13
13
  @prevPage="prev($event)"
14
14
  ></formio>
15
+ <BModal centered v-model="modal" title="File Error" ok-only>
16
+ {{ fileMessage }}</BModal
17
+ >
15
18
  </div>
16
19
  </template>
17
20
 
18
21
  <script>
22
+ import { BModal } from 'bootstrap-vue-next'
19
23
  import { Form, Formio } from '@formio/vue'
20
24
  import '@fortawesome/fontawesome-free/css/all.min.css'
21
25
  import '@fortawesome/fontawesome-free/css/v4-shims.min.css'
@@ -23,7 +27,7 @@ import 'formiojs/dist/formio.builder.min.css'
23
27
 
24
28
  export default {
25
29
  name: 'FormRenderer',
26
- components: { formio: Form },
30
+ components: { formio: Form, BModal },
27
31
  props: {
28
32
  formiodefinition: {
29
33
  type: Object,
@@ -46,6 +50,8 @@ export default {
46
50
  debouncedSubmission: this.debounce(this.submit, 250),
47
51
  firstEl: null,
48
52
  started: false,
53
+ modal: false,
54
+ fileMessage: '',
49
55
  }
50
56
  },
51
57
  mounted() {
@@ -100,7 +106,7 @@ export default {
100
106
  }
101
107
  }
102
108
  },
103
- changed(_e, event) {
109
+ async changed(_e, event) {
104
110
  // File upload validation
105
111
  if (event.changed?.component.type === 'file') {
106
112
  const maxFiles = event.changed.component.fileMaxCount || 1
@@ -122,17 +128,27 @@ export default {
122
128
  const maxTotalBytes = convertToBytes(maxTotalSize)
123
129
  const files = event.changed.instance.dataValue || []
124
130
  if (files.length > maxFiles) {
125
- event.changed.instance.dataValue = files.slice(0, files.length - 1)
131
+ event.changed.instance.dataValue = files.slice(0, maxFiles)
132
+ this.fileMessage = `You have exceeded the maximum number of files allowed. Only the first ${maxFiles} files have been uploaded.`
133
+ this.modal = true
134
+
126
135
  event.changed.instance.triggerChange()
127
136
  event.changed.instance.triggerRedraw()
128
- alert(`You can only upload up to ${maxFiles} files.`)
129
137
  }
130
- const totalSize = files.reduce((sum, file) => sum + (file.size || 0), 0)
138
+ let totalSize = files.reduce((sum, file) => sum + (file.size || 0), 0)
131
139
  if (totalSize > maxTotalBytes) {
132
- event.changed.instance.dataValue = files.slice(0, files.length - 1)
140
+ let limit = []
141
+ while (totalSize > maxTotalBytes) {
142
+ const file = files.pop()
143
+ limit.push(file.name)
144
+ totalSize -= file.size
145
+ }
146
+ event.changed.instance.dataValue = files //.slice(0, files.length - 1)
147
+ this.fileMessage = `You have exceeded the maximum total file size allowed. Only ${files.length} files have been uploaded.`
148
+ this.modal = true
149
+ console.log('🚀 ~ changed ~ limit.length:', limit.length)
133
150
  event.changed.instance.triggerChange()
134
151
  event.changed.instance.triggerRedraw()
135
- alert(`Total file size cannot exceed ${maxTotalSize}.`)
136
152
  return
137
153
  }
138
154
  }
@@ -39,8 +39,13 @@ export class FileFormElement extends BaseFormElement {
39
39
  webcam: false,
40
40
  multiple: true,
41
41
  description: `No more than ${this.webformElement['#multiple']} files accepted. Maximum total size is ${this.webformElement['#max_filesize']}MB.`,
42
- filePattern:
43
- '*.png,*.jpg,*.jpeg,*.pdf,*.doc,*.docx,*.xls,*.xlsx,*.csv,*.txt',
42
+ filePattern: this.webformElement['#file_extensions']
43
+ ? this.webformElement['#file_extensions']
44
+ .split(' ')
45
+ .map((ext) => `.${ext}`)
46
+ .join(',')
47
+ : '',
48
+
44
49
  fileKey: `files[${this.webformElement['#name']}]`,
45
50
  fileMaxSize: `${this.webformElement['#max_filesize']}MB`,
46
51
  fileMaxCount: this.webformElement['#multiple'],