@worksafevictoria/wcl7.5 1.9.0-beta.3 → 1.9.0-beta.5

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 (38) hide show
  1. package/package.json +1 -1
  2. package/src/components/Common/CardGridItem/card-grid-item-caret.vue +39 -45
  3. package/src/components/Common/CardGridItem/card-grid-item-icon.vue +1 -1
  4. package/src/components/Common/CardGridItem/index.vue +6 -2
  5. package/src/components/Containers/Carousel/index.stories.js +2 -1
  6. package/src/components/Containers/Carousel/index.vue +68 -69
  7. package/src/components/Containers/HomepageHeader/index.stories.js +1 -1
  8. package/src/components/Containers/HomepageHeaderNew/index.stories.js +3 -15
  9. package/src/components/Containers/HomepageHeaderNew/index.vue +0 -5
  10. package/src/components/Global/AppFooter/index.vue +115 -129
  11. package/src/components/Global/AppHeader/ModalSearch/index.vue +7 -1
  12. package/src/components/Global/AppHeader/index.stories.js +2 -2
  13. package/src/components/Global/AppHeaderNew/ModalSearch/index.vue +21 -17
  14. package/src/components/Global/AppHeaderNew/index.stories.js +2 -2
  15. package/src/components/Global/AppHeaderNew/index.vue +22 -22
  16. package/src/components/Global/BackToTop/index.vue +16 -16
  17. package/src/components/Global/ContrastMode/index.stories.js +1 -1
  18. package/src/components/Global/HeroHeader/index.vue +62 -73
  19. package/src/components/Global/SocialShare/index.vue +62 -66
  20. package/src/components/Global/Strip/index.vue +9 -5
  21. package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +21 -23
  22. package/src/components/Paragraphs/Accordion/StepperItem/index.vue +15 -15
  23. package/src/components/Paragraphs/Calculator/CardContainer/index.vue +74 -75
  24. package/src/components/Paragraphs/Calculator/RiskLevel/index.vue +31 -39
  25. package/src/components/Paragraphs/Directory/Asbestos/Records/SingleRecord/index.vue +104 -107
  26. package/src/components/Paragraphs/Directory/Asbestos/Records/index.vue +152 -120
  27. package/src/components/Paragraphs/Directory/HSCP/Records/SingleRecord/index.vue +127 -133
  28. package/src/components/Paragraphs/Directory/HSCP/Records/index.vue +158 -128
  29. package/src/components/Paragraphs/TabulatedData/index.vue +3 -2
  30. package/src/components/SubComponents/CtaButton/index.vue +47 -44
  31. package/src/components/SubComponents/Icon/README.md +2 -2
  32. package/src/components/SubComponents/Icon/example.js +1 -0
  33. package/src/components/SubComponents/Icon/index.stories.js +1 -1
  34. package/src/components/SubComponents/Icon/index.vue +47 -47
  35. package/src/components/SubComponents/ResourceGroup/cardbody.vue +49 -61
  36. package/src/components/SubComponents/Search/index.vue +4 -0
  37. package/src/components/SubComponents/VideoThumbnail/index.vue +30 -28
  38. package/src/mock/carousel-items.js +46 -81
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worksafevictoria/wcl7.5",
3
- "version": "1.9.0-beta.3",
3
+ "version": "1.9.0-beta.5",
4
4
  "main": "src/index.js",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,73 +1,71 @@
1
1
  <template>
2
2
  <div
3
3
  v-if="caretSrc && loaded"
4
- :class="
5
- `card-grid-item-caret__container card-grid-item-caret__container--${computedCaret}`
6
- "
4
+ :class="`card-grid-item-caret__container card-grid-item-caret__container--${computedCaret}`"
7
5
  >
8
6
  <span v-if="caret === 'external'" class="visually-hidden">External link</span>
9
7
  <div
10
8
  class="tabCaretContainer"
11
9
  :class="{
12
- tabCaretContainerBottom: isTabbedCard
10
+ tabCaretContainerBottom: isTabbedCard,
13
11
  }"
14
12
  >
15
13
  <div class="tabCaretText" aria-hidden="true">
16
14
  {{ supportText }}
17
15
  </div>
18
- <icon :glyph="caretSrc" icon-alt="arrow" width="18" float: right
19
- :height="caret === 'external' ? 18 : 16" :class=" `item-icon-${ isChev ?
20
- 'chev' : 'caret'} card-grid-item-caret--${computedCaret}`" />
16
+ <icon :glyph="caretSrc" icon-alt="Show more" width="18" float: right :height="caret
17
+ === 'external' ? 18 : 16" :class=" `item-icon-${ isChev ? 'chev' : 'caret'}
18
+ card-grid-item-caret--${computedCaret}`" />
21
19
  </div>
22
20
  </div>
23
21
  </template>
24
22
 
25
23
  <script>
26
- import { getCurrentInstance } from 'vue'
27
- import Icon from './../../SubComponents/Icon/index.vue'
28
- import ChevUp from './../../../assets/icons/chev-up.svg?raw'
29
- import CaretUp from './../../../assets/icons/caret-up.svg?url'
30
- import ExternalLink from './../../../assets/icons/external-link.svg?raw'
24
+ import { getCurrentInstance } from "vue";
25
+ import Icon from "./../../SubComponents/Icon/index.vue";
26
+ import ChevUp from "./../../../assets/icons/chev-up.svg?raw";
27
+ import CaretUp from "./../../../assets/icons/caret-up.svg?url";
28
+ import ExternalLink from "./../../../assets/icons/external-link.svg?raw";
31
29
 
32
30
  export default {
33
- name: 'CardGridItemCaret',
31
+ name: "CardGridItemCaret",
34
32
  components: { Icon },
35
33
  props: {
36
34
  caret: {
37
35
  type: String,
38
- default: null
36
+ default: null,
39
37
  },
40
38
  rtl: {
41
39
  type: Boolean,
42
- default: false
43
- }
40
+ default: false,
41
+ },
44
42
  },
45
43
  data() {
46
44
  return {
47
45
  loaded: false,
48
- isChev: false
49
- }
46
+ isChev: false,
47
+ };
50
48
  },
51
49
  computed: {
52
50
  computedCaret() {
53
51
  if (this.rtl) {
54
- if (this.caret === 'right') {
55
- return 'left'
56
- } else if (this.caret === 'left') {
57
- return 'right'
52
+ if (this.caret === "right") {
53
+ return "left";
54
+ } else if (this.caret === "left") {
55
+ return "right";
58
56
  }
59
57
  }
60
- return this.caret
58
+ return this.caret;
61
59
  },
62
60
  caretSrc() {
63
- if (this.caret === 'external') {
64
- return ExternalLink
61
+ if (this.caret === "external") {
62
+ return ExternalLink;
65
63
  } else if (!this.isChev && this.computedCaret) {
66
- return CaretUp
64
+ return CaretUp;
67
65
  } else if (this.isChev && this.computedCaret) {
68
- return ChevUp
66
+ return ChevUp;
69
67
  } else {
70
- return undefined
68
+ return undefined;
71
69
  }
72
70
  },
73
71
  //Identify if this is a tabbed card WSV2-374
@@ -75,7 +73,7 @@ export default {
75
73
  const instance = getCurrentInstance();
76
74
  const parentEl = instance?.parent?.proxy?.$el.parentNode;
77
75
 
78
- if (parentEl && parentEl.classList.contains('tabbed-card')) {
76
+ if (parentEl && parentEl.classList.contains("tabbed-card")) {
79
77
  return true;
80
78
  } else {
81
79
  return false;
@@ -83,22 +81,18 @@ export default {
83
81
  },
84
82
  //If isTabbedCard, then supportive text must be displayed for up and down carets. WSV2-374
85
83
  supportText() {
86
- if (
87
- this.isTabbedCard &&
88
- this.computedCaret &&
89
- this.computedCaret === 'up'
90
- ) {
91
- return 'Hide links'
84
+ if (this.isTabbedCard && this.computedCaret && this.computedCaret === "up") {
85
+ return "Hide links";
92
86
  } else if (
93
87
  this.isTabbedCard &&
94
88
  this.computedCaret &&
95
- this.computedCaret === 'down'
89
+ this.computedCaret === "down"
96
90
  ) {
97
- return 'Show links'
91
+ return "Show links";
98
92
  } else {
99
- return null
93
+ return null;
100
94
  }
101
- }
95
+ },
102
96
  },
103
97
  mounted() {
104
98
  /* The code below has been removed as part of WSV2-735
@@ -109,13 +103,13 @@ export default {
109
103
  .$el['_prevClass'].includes('task-finder-column')
110
104
  ? (this.isChev = false)
111
105
  : true */
112
-
113
- this.loaded = true
114
- }
115
- }
106
+
107
+ this.loaded = true;
108
+ },
109
+ };
116
110
  </script>
117
111
  <style lang="scss" scoped>
118
- @import '../../../includes/scss/all';
112
+ @import "../../../includes/scss/all";
119
113
  .card-grid-item-caret {
120
114
  &__container {
121
115
  padding-left: 4px;
@@ -149,7 +143,7 @@ export default {
149
143
  }
150
144
  }
151
145
  .tabCaretText {
152
- font-style: 'normal';
146
+ font-style: "normal";
153
147
  font-weight: 400;
154
148
  font-size: 12px;
155
149
  padding-right: 10px;
@@ -21,7 +21,7 @@
21
21
  }"
22
22
  :glyph="glyphSrc"
23
23
  :key="computedIconSize"
24
- icon-alt="alt"
24
+ icon-alt="card gid item icon"
25
25
  :bordered="iconIsBordered"
26
26
  :height="computedIconSize"
27
27
  :width="computedIconSize"
@@ -9,10 +9,14 @@
9
9
  :class="cardClass"
10
10
  :role="buttonRole"
11
11
  :aria-checked="
12
- buttonRole === 'radio' ? (isSelectable && selected ? 'true' : 'false') : false
12
+ buttonRole === 'radio' ? (isSelectable && selected ? 'true' : 'false') : undefined
13
13
  "
14
14
  :aria-expanded="
15
- isExpandable ? (isSelectable && selected ? 'true' : 'false') : false
15
+ buttonRole === 'button' && isExpandable
16
+ ? isSelectable && selected
17
+ ? 'true'
18
+ : 'false'
19
+ : undefined
16
20
  "
17
21
  :data-href="link"
18
22
  @click="cardClicked($event)"
@@ -2,8 +2,9 @@ import CarouselComponent from './index.vue'
2
2
  import { mockCarouselItems } from '../../../mock/carousel-items'
3
3
 
4
4
  export default {
5
- title: 'Website-Redesign/Carousel',
5
+ title: 'Containers/Carousel',
6
6
  component: CarouselComponent,
7
+ tags: ['autodocs'],
7
8
  data() {
8
9
  return {
9
10
  mockCarouselItems
@@ -1,9 +1,9 @@
1
1
  <template>
2
- <div>
2
+ <div>
3
3
  <b-carousel
4
4
  id="carousel-1"
5
5
  v-model="slide"
6
- interval=0
6
+ interval="0"
7
7
  controls
8
8
  indicators
9
9
  keyboard
@@ -13,92 +13,92 @@
13
13
  <b-carousel-slide
14
14
  v-for="item in filteredCarouselItems"
15
15
  :key="item.id"
16
- :img-src="getImageURL(item.field_image.field_media_image?.uri?.url)"
17
- @click.prevent="handleClick(item.field_link.url)"
16
+ :img-src="getImageURL(item.imageURL)"
17
+ :img-alt="item.imageAlt"
18
+ @click.prevent="handleClick(item.linkURL)"
18
19
  >
19
- <h4>{{ item.field_title}}</h4>
20
+ <h4>{{ item.title }}</h4>
20
21
  </b-carousel-slide>
21
22
  </b-carousel>
22
23
  </div>
23
24
  </template>
24
25
 
25
26
  <script>
26
- import { BCarousel, BCarouselSlide } from 'bootstrap-vue-next'
27
- import { isAbsoluteUrl, navigateToPath } from '../../../../lib/utility'
27
+ import { BCarousel, BCarouselSlide } from "bootstrap-vue-next"
28
+ import { isAbsoluteUrl, navigateToPath } from "../../../../lib/utility"
28
29
 
29
30
  export default {
30
- name: 'CarouselComponent',
31
- data() {
32
- return {
33
- slide: 0,
34
- }
35
- },
36
- components: {
37
- BCarousel,
38
- BCarouselSlide
39
- },
40
- props: {
41
- carouselItems: {
42
- type: Array,
43
- required: true,
44
- default: () => [],
45
- },
46
- storybook: {
47
- type: Boolean,
48
- default: false
49
- }
31
+ name: "CarouselComponent",
32
+ data() {
33
+ return {
34
+ slide: 0,
35
+ }
36
+ },
37
+ components: {
38
+ BCarousel,
39
+ BCarouselSlide,
40
+ },
41
+ props: {
42
+ carouselItems: {
43
+ type: Array,
44
+ required: true,
45
+ default: () => [],
50
46
  },
51
- computed: {
52
- filteredCarouselItems() {
53
-
54
- var todayDate = new Date()
55
-
56
- for (var i = 0, length = this.carouselItems.length; i < length; i++) {
57
- if (this.carouselItems[i].field_favorite === true) {
47
+ storybook: {
48
+ type: Boolean,
49
+ default: false,
50
+ }
51
+ },
52
+ computed: {
53
+ filteredCarouselItems() {
54
+
55
+ var todayDate = new Date();
56
+
57
+ for (var i = 0, length = this.carouselItems.length; i < length; i++) {
58
+ if (this.carouselItems[i].favourite === true) {
59
+ this.carouselItems[i].active = 'Yes';
60
+ } else if (new Date(this.carouselItems[i].dateStart).valueOf() <= todayDate.valueOf()) {
61
+ if (new Date(this.carouselItems[i].dateEnd).valueOf() >= todayDate.valueOf()) {
58
62
  this.carouselItems[i].active = 'Yes'
59
- } else if (new Date(this.carouselItems[i].field_date_start).valueOf() <= todayDate.valueOf()) {
60
- if (new Date(this.carouselItems[i].field_date_end).valueOf() >= todayDate.valueOf()) {
61
- this.carouselItems[i].active = 'Yes'
62
- }
63
63
  }
64
64
  }
65
-
66
- let filtered = this.carouselItems.filter(e =>
67
- e.active === 'Yes');
68
- return filtered
69
65
  }
70
- },
71
- methods: {
72
-
73
- handleClick(link) {
74
- if (link) {
75
- if (isAbsoluteUrl(link)) {
76
- navigateToPath(link, true)
66
+
67
+ let filtered = this.carouselItems.filter(e => e.active === "Yes");
68
+ return filtered;
69
+ }
70
+ },
71
+ methods: {
72
+
73
+ handleClick(link) {
74
+ if (link) {
75
+ if (isAbsoluteUrl(link)) {
76
+ navigateToPath(link, true);
77
+ } else {
78
+ if (this.storybook) {
79
+ alert('This link will go to: ' + link);
77
80
  } else {
78
- if (this.storybook) {
79
- alert('This link will go to: ' + link)
80
- } else {
81
- this.$router.push({ path: link })
82
- }
81
+ this.$router.push({ path: link });
83
82
  }
84
83
  }
85
- },
86
-
87
- getImageURL(imagePath) {
88
- let apiPath = this.$config ? this.$config.public.apiURL : process.env.CONTENT_API_URL;
89
- let fullPath = apiPath.concat(imagePath)
90
- return fullPath
91
- },
92
-
93
- formatDate(date) {
94
- return [
95
- date.getFullYear(),
96
- ('0' + date.getDate()).slice(-2),
97
- ('0' + (date.getMonth() + 1)).slice(-2)
98
- ].join('-')
99
84
  }
85
+ },
86
+
87
+ getImageURL(imagePath) {
88
+ let apiPath = this.$config ? this.$config.public.apiURL : process.env.CONTENT_API_URL;
89
+ let fullPath = apiPath.concat(imagePath);
90
+ return fullPath;
91
+ },
92
+
93
+ formatDate(date) {
94
+ return [
95
+ date.getFullYear(),
96
+ ('0' + date.getDate()).slice(-2),
97
+ ('0' + (date.getMonth() + 1)).slice(-2)
98
+ ].join('-');
100
99
  }
101
100
  }
101
+ }
102
102
  </script>
103
103
 
104
104
  <style lang="scss" scoped>
@@ -137,7 +137,6 @@ export default {
137
137
  .carousel-indicators button:active {
138
138
  outline: none !important;
139
139
  box-shadow: none;
140
-
141
140
  }
142
141
 
143
142
  .carousel-caption {
@@ -99,4 +99,4 @@ const DefaultHH = (args) => ({
99
99
  template: '<homepage-header v-bind="args" ref="hh" />',
100
100
  })
101
101
 
102
- export const Default = DefaultHH.bind({})
102
+ export const Former = DefaultHH.bind({})
@@ -39,8 +39,9 @@ const headerLinks = [
39
39
  }
40
40
 
41
41
  export default {
42
- title: 'Website_Redesign/HomepageHeader',
42
+ title: 'Containers/HomepageHeader',
43
43
  component: HomepageHeader,
44
+ tags: ['autodocs'],
44
45
  argTypes: {
45
46
  fetchMenu: {
46
47
  control: 'function',
@@ -59,17 +60,4 @@ export default {
59
60
  }
60
61
  }
61
62
 
62
- const DefaultHH = (args) => ({
63
- components: { HomepageHeader },
64
- setup() {
65
- return { args };
66
- },
67
- mounted() {
68
- setTimeout(() => {
69
- this.$refs.hh.renderMenu()
70
- })
71
- },
72
- template: '<homepage-header v-bind="args" ref="hh" />'
73
- })
74
-
75
- export const Default = DefaultHH.bind({})
63
+ export const New = {}
@@ -1,5 +1,3 @@
1
- <!-- When implemented, importing mock values for carousel to be removed. This was only for testing locally, while values not available from drupal. -->
2
-
3
1
  <template>
4
2
  <div class="homepage-header">
5
3
  <container>
@@ -56,7 +54,6 @@ import earthIcon from './../../../assets/icons/earth.svg?url'
56
54
  import CarouselComponent from './../../Containers/Carousel/index.vue'
57
55
  import Row from './../../Containers/Row/index.vue'
58
56
  import Column from './../../Containers/Column/index.vue'
59
- // import { mockCarouselItems } from '../../../mock/carousel-items'
60
57
 
61
58
  export default {
62
59
  name: 'HomepageHeader',
@@ -66,7 +63,6 @@ export default {
66
63
  CarouselComponent,
67
64
  Row,
68
65
  Column,
69
- // mockCarouselItems
70
66
  },
71
67
  props: {
72
68
  contentParser: {
@@ -76,7 +72,6 @@ export default {
76
72
  slideList: {
77
73
  type: Array,
78
74
  required: true,
79
- // default: mockCarouselItems
80
75
  },
81
76
  isStorybook: {
82
77
  type: Boolean,