@worksafevictoria/wcl7.5 1.9.0 → 1.10.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.
@@ -28,7 +28,7 @@ setup((app) => {
28
28
  },
29
29
  },
30
30
  template:
31
- '<a target="_blank" :href="`https://ws-ui.wsvdigital.com.au${this.to}`"><slot></slot></a>',
31
+ '<a target="_blank" :href="`https://ws-dev.worksafe.vic.gov.au${this.to}`"><slot></slot></a>',
32
32
  })
33
33
  app.use(createBootstrap())
34
34
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worksafevictoria/wcl7.5",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "main": "src/index.js",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,8 +1,5 @@
1
1
  <template>
2
- <div
3
- v-if="imageSrc || glyphSrc || glyphIconComponent"
4
- class="card-grid-item-icon"
5
- >
2
+ <div v-if="imageSrc || glyphSrc || glyphIconComponent" class="card-grid-item-icon">
6
3
  <div
7
4
  v-if="imageSrc"
8
5
  :aria-description="imageAlt"
@@ -10,7 +7,7 @@
10
7
  :class="{
11
8
  [`card-grid-item-icon--img-${
12
9
  isMobileView ? 'sm' : isTabletView ? 'md' : 'lg'
13
- }-${gridColumnSize}`]: true
10
+ }-${gridColumnSize}`]: true,
14
11
  }"
15
12
  :style="`background-image:url(${imageSrc})`"
16
13
  >
@@ -20,7 +17,7 @@
20
17
  v-else-if="glyphSrc"
21
18
  class="card-grid-item-icon--icon"
22
19
  :class="{
23
- [`card-grid-item-icon--icon-bordered-${iconSize}`]: iconIsBordered
20
+ [`card-grid-item-icon--icon-bordered-${iconSize}`]: iconIsBordered,
24
21
  }"
25
22
  :glyph="glyphSrc"
26
23
  :key="computedIconSize"
@@ -38,72 +35,72 @@
38
35
  </div>
39
36
  </template>
40
37
  <script>
41
- import Icon from './../../SubComponents/Icon/index.vue'
42
- import arrowRight from './../../../assets/icons/right-arrow.svg?component'
38
+ import Icon from "./../../SubComponents/Icon/index.vue";
39
+ import arrowRight from "./../../../assets/icons/right-arrow.svg?component";
43
40
 
44
41
  export default {
45
- name: 'CardGridItemIcon',
42
+ name: "CardGridItemIcon",
46
43
  components: { Icon, arrowRight },
47
44
  props: {
48
45
  imageSrc: {
49
46
  type: String,
50
- default: null
47
+ default: null,
51
48
  },
52
49
  imageAlt: {
53
50
  type: String,
54
- default: null
51
+ default: null,
55
52
  },
56
53
  glyphSrc: {
57
54
  type: [Object, String],
58
- default: null
55
+ default: null,
59
56
  },
60
57
  glyphIconComponent: {
61
58
  type: String,
62
- default: null
59
+ default: null,
63
60
  },
64
61
  alt: {
65
62
  type: String,
66
- default: ''
63
+ default: "",
67
64
  },
68
65
  isMobileView: {
69
- type: Boolean
66
+ type: Boolean,
70
67
  },
71
68
  isTabletView: {
72
- type: Boolean
69
+ type: Boolean,
73
70
  },
74
71
  gridColumnSize: {
75
72
  type: Number,
76
- default: null
73
+ default: null,
77
74
  },
78
75
  iconSize: {
79
76
  type: String,
80
- default: ''
77
+ default: "",
81
78
  },
82
79
  iconIsBordered: {
83
- type: Boolean
84
- }
80
+ type: Boolean,
81
+ },
85
82
  },
86
83
  computed: {
87
84
  computedIconSize() {
88
- return this.iconSize === 'xsmall'
85
+ return this.iconSize === "xsmall"
89
86
  ? 16
90
- : this.iconSize === 'small'
87
+ : this.iconSize === "small"
91
88
  ? 32
92
- : this.iconSize === 'medium'
89
+ : this.iconSize === "medium"
93
90
  ? 64
94
91
  : 80;
95
- }
92
+ },
96
93
  },
97
94
  data() {
98
95
  return {
99
96
  arrowRight,
100
- glyphComponent: this.glyphIconComponent
101
- }
102
- }
103
- }
97
+ glyphComponent: this.glyphIconComponent,
98
+ };
99
+ },
100
+ };
104
101
  </script>
105
102
  <style lang="scss" scoped>
106
- @import '../../../includes/scss/all';
103
+ @import "../../../includes/scss/all";
107
104
  .card-grid-item-icon {
108
105
  width: 100%;
109
106
 
@@ -115,9 +112,8 @@ export default {
115
112
  border-radius: 8px;
116
113
  width: 100%;
117
114
  height: 170px;
118
- background-size: contain;
119
115
  background-position: center center;
120
-
116
+ background: no-repeat;
121
117
  &-lg {
122
118
  &-3,
123
119
  &-2,
@@ -142,6 +138,7 @@ export default {
142
138
  height: 233px;
143
139
  }
144
140
  }
141
+ background-size: contain;
145
142
  }
146
143
 
147
144
  &--icon {
@@ -246,10 +246,7 @@
246
246
 
247
247
  &:last-of-type {
248
248
  > a {
249
- svg {
250
- height: 23px;
251
- width: 23px;
252
- }
249
+
253
250
  & > span {
254
251
  margin-right: 10px;
255
252
  @media screen and (max-width: 1010px) and (min-width: 981px) {
@@ -1,15 +1,13 @@
1
1
  <template>
2
- <div v-show="showStrip" :class="`${type}-strip ${themeColor} ${layout}`">
2
+ <div :class="`${type}-strip ${themeColor} ${layout}`">
3
3
  <b-alert
4
4
  :class="`${type}-strip__inner`"
5
- show
6
5
  v-model="dismissibleAlert"
7
6
  :dismissible="!mini"
7
+ show
8
8
  :variant="`${type === 'alert' ? 'danger' : 'information'}`"
9
- :dismiss-label="
10
- `Close ${type === 'alert' ? 'alert' : 'information'} message`
11
- "
12
- @dismissed="handleDismissed()"
9
+ :dismiss-label="`Close ${type === 'alert' ? 'alert' : 'information'} message`"
10
+ @dismissed="handleDismissed"
13
11
  >
14
12
  <div
15
13
  :role="mini ? 'link' : null"
@@ -27,17 +25,18 @@
27
25
  :class="{
28
26
  [`${type}-strip__content`]: true,
29
27
  [`${type}-strip__content--left`]: !rtl,
30
- [`${type}-strip__content--right`]: rtl
28
+ [`${type}-strip__content--right`]: rtl,
31
29
  }"
32
30
  >
33
31
  <span
34
32
  :class="{
35
33
  [`${type}-strip__heading`]: true,
36
34
  [`${type}-strip__heading--left`]: !rtl,
37
- [`${type}-strip__heading--right`]: rtl
35
+ [`${type}-strip__heading--right`]: rtl,
38
36
  }"
39
- >{{ stripTitle }}</span
40
37
  >
38
+ {{ stripTitle }}
39
+ </span>
41
40
  <rich-text :content="stripContent" :without-container="true" />
42
41
  </div>
43
42
  <img
@@ -50,86 +49,95 @@
50
49
  </div>
51
50
  </b-alert>
52
51
  <div v-if="mini && type === 'alert'" class="alert-strip__link">
53
- <nuxt-link :to="'/safety-alerts'">All safety alerts</nuxt-link>
52
+ <nuxt-link to="/safety-alerts">All safety alerts</nuxt-link>
54
53
  </div>
55
54
  </div>
56
55
  </template>
57
56
 
58
- <script setup>
59
- import { ref } from 'vue'
60
-
61
- const dismissibleAlert = ref(true)
62
- </script>
63
-
64
57
  <script>
65
- import exclamationIcon from '../../../assets/icons/Strip/Exclamation triangle fill.svg?url'
66
- import arrowIcon from '../../../assets/icons/Strip/Arrow right.svg?url'
67
- import dismissIcon from '../../../assets/icons/Strip/Dismiss.svg?url'
68
- import infoIcon from '../../../assets/icons/Strip/Info circle fill.svg?url'
69
- import chevronIcon from '../../../assets/icons/caret-right.svg?url'
70
- import RichText from '../../Paragraphs/RichText/index.vue'
71
- import { BAlert } from 'bootstrap-vue-next'
58
+ import exclamationIcon from "../../../assets/icons/Strip/Exclamation triangle fill.svg?url";
59
+ import arrowIcon from "../../../assets/icons/Strip/Arrow right.svg?url";
60
+ import dismissIcon from "../../../assets/icons/Strip/Dismiss.svg?url";
61
+ import infoIcon from "../../../assets/icons/Strip/Info circle fill.svg?url";
62
+ import chevronIcon from "../../../assets/icons/caret-right.svg?url";
63
+ import RichText from "../../Paragraphs/RichText/index.vue";
64
+ import { BAlert } from "bootstrap-vue-next";
72
65
 
73
66
  export default {
74
- name: 'Strip',
67
+ name: "Strip",
75
68
  components: {
76
69
  RichText,
77
- BAlert
70
+ BAlert,
78
71
  },
79
72
  props: {
73
+ modelValue: {
74
+ type: Boolean,
75
+ default: true,
76
+ },
80
77
  stripHeading: {
81
78
  type: String,
82
- default: ''
79
+ default: "",
83
80
  },
84
81
  stripContent: {
85
82
  type: String,
86
- default: ''
83
+ default: "",
87
84
  },
88
85
  url: {
89
86
  type: String,
90
- default: '#'
87
+ default: "#",
91
88
  },
92
89
  type: {
93
90
  type: String,
94
- required: true
91
+ required: true,
95
92
  },
96
93
  mini: {
97
94
  type: Boolean,
98
- default: true
95
+ default: true,
99
96
  },
100
97
  rtl: {
101
98
  type: Boolean,
102
- default: false
103
- }
99
+ default: false,
100
+ },
104
101
  },
102
+ emits: ["update:modelValue", "dismissed"],
105
103
  data() {
106
104
  return {
107
- showStrip: true,
105
+ dismissibleAlert: this.modelValue,
108
106
  exclamationIcon,
109
107
  arrowIcon,
110
108
  dismissIcon,
111
109
  infoIcon,
112
- chevronIcon
113
- }
110
+ chevronIcon,
111
+ };
112
+ },
113
+ watch: {
114
+ modelValue(val) {
115
+ this.dismissibleAlert = val;
116
+ },
117
+ dismissibleAlert(val) {
118
+ if (val !== this.modelValue) {
119
+ this.$emit("update:modelValue", val);
120
+ }
121
+ },
114
122
  },
115
123
  computed: {
116
124
  layout() {
117
- return this.mini ? 'mini' : 'full'
125
+ return this.mini ? "mini" : "full";
118
126
  },
119
127
  themeColor() {
120
- return this.type === 'alert' ? 'red' : 'blue'
128
+ return this.type === "alert" ? "red" : "blue";
121
129
  },
122
130
  stripTitle() {
123
- if (this.mini && this.type === 'alert') {
124
- return 'Safety alert'
125
- } else if (this.mini && this.type === 'notice') {
126
- return 'Information'
131
+ if (this.mini && this.type === "alert") {
132
+ return "Safety alert";
133
+ } else if (this.mini && this.type === "notice") {
134
+ return "Information";
127
135
  } else if (this.stripHeading) {
128
- return this.stripHeading
136
+ return this.stripHeading;
129
137
  } else {
130
- return ''
138
+ return "";
131
139
  }
132
- }
140
+ },
133
141
  },
134
142
  methods: {
135
143
  handleClick() {
@@ -138,38 +146,39 @@ export default {
138
146
  label: this.stripContent,
139
147
  link: this.mini ? this.url : false,
140
148
  clickedOnPage: this.$route.path,
141
- globalStrip: false
142
- }
149
+ globalStrip: false,
150
+ };
143
151
  if (this.$gtm) {
144
152
  this.$gtm.push({
145
153
  event: `custom.interaction.${this.type}.click`,
146
- ...attrs
147
- })
154
+ ...attrs,
155
+ });
148
156
  }
149
- this.$router.push(this.url)
157
+ this.$router.push(this.url);
150
158
  },
151
159
  handleDismissed() {
152
- this.showStrip = false
153
- this.$emit('dismissed')
160
+ this.$emit("update:modelValue", false);
161
+ this.$emit("dismissed");
154
162
 
155
163
  if (this.$gtm) {
156
164
  const attrs = {
157
165
  group: this.type,
158
166
  label: this.stripHeading,
159
167
  clickedOnPage: this.$route.path,
160
- globalStrip: false
161
- }
168
+ globalStrip: false,
169
+ };
162
170
  this.$gtm.push({
163
171
  event: `custom.interaction.${this.type}.close`,
164
- ...attrs
165
- })
172
+ ...attrs,
173
+ });
166
174
  }
167
- }
168
- }
169
- }
175
+ },
176
+ },
177
+ };
170
178
  </script>
179
+
171
180
  <style lang="scss" scoped>
172
- @import '../../../includes/scss/all';
181
+ @import "../../../includes/scss/all";
173
182
  .red {
174
183
  .alert-strip {
175
184
  &__inner {
@@ -303,7 +312,7 @@ export default {
303
312
  max-width: 794px;
304
313
  }
305
314
 
306
- @include mq('sm') {
315
+ @include mq("sm") {
307
316
  flex-direction: column;
308
317
  margin-right: 16px;
309
318
 
@@ -333,13 +342,12 @@ export default {
333
342
  color: $black;
334
343
  text-decoration: none;
335
344
  }
336
- a:hover {
337
- text-decoration: underline;
338
- }
345
+ a:hover {
346
+ text-decoration: underline;
347
+ }
339
348
  a:focus {
340
- text-decoration: underline;
341
- }
342
-
349
+ text-decoration: underline;
350
+ }
343
351
  }
344
352
  &__icon {
345
353
  &--caret {
@@ -12,6 +12,8 @@
12
12
  >
13
13
  <b-form-input
14
14
  id="site-search"
15
+ autofocus
16
+ ref="siteSearch"
15
17
  v-model="searchQuery"
16
18
  name="search"
17
19
  aria-label="searchbar"
@@ -59,6 +61,7 @@ import { BButton, BInputGroup, BFormInput } from "bootstrap-vue-next";
59
61
 
60
62
  export default {
61
63
  components: { SearchListing, BButton, BInputGroup, BFormInput },
64
+
62
65
  props: {
63
66
  pageLimit: {
64
67
  type: Number,
@@ -106,6 +109,7 @@ export default {
106
109
  },
107
110
  },
108
111
  mounted() {
112
+
109
113
  if (this.searchType === "google") {
110
114
  this.setupGoogleStyle();
111
115
  } else {