@worksafevictoria/wcl7.5 1.17.0 → 1.18.0-beta.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 (66) hide show
  1. package/package.json +1 -1
  2. package/src/assets/icons/chevron-right-icon.svg +14 -0
  3. package/src/assets/icons/notepad.svg +93 -0
  4. package/src/assets/icons/question.svg +7 -0
  5. package/src/components/Common/CardGrid/index.vue +83 -74
  6. package/src/components/Common/CardGridItem/index.vue +31 -4
  7. package/src/components/Containers/Carousel/index.vue +24 -4
  8. package/src/components/Containers/SectionGroup/index.stories.js +28 -27
  9. package/src/components/Containers/SectionGroup/index.vue +5 -0
  10. package/src/components/Global/AppHeaderNew/index.vue +9 -1
  11. package/src/components/Global/AppHeaderNew/mobile.scss +5 -2
  12. package/src/components/Global/AppHeaderNew/styles.scss +6 -5
  13. package/src/components/Global/HeroHeader/index.vue +74 -57
  14. package/src/components/Paragraphs/Calculator/CardContainer/index.vue +68 -60
  15. package/src/components/Paragraphs/Calculator/index.vue +24 -22
  16. package/src/components/Paragraphs/RTWPlanner/CardContainer/index.vue +133 -0
  17. package/src/components/Paragraphs/RTWPlanner/Constants.js +433 -0
  18. package/src/components/Paragraphs/RTWPlanner/Footer/index.vue +32 -0
  19. package/src/components/Paragraphs/RTWPlanner/{NavBar → Header}/index.vue +20 -9
  20. package/src/components/Paragraphs/RTWPlanner/HomePage/index.vue +72 -0
  21. package/src/components/Paragraphs/RTWPlanner/Injuries/index.vue +226 -0
  22. package/src/components/Paragraphs/RTWPlanner/Planners/PlanTasks.vue +9 -8
  23. package/src/components/Paragraphs/RTWPlanner/Planners/PlannerNameModal.vue +97 -0
  24. package/src/components/Paragraphs/RTWPlanner/Planners/index.vue +367 -175
  25. package/src/components/Paragraphs/RTWPlanner/index.stories.js +82 -15
  26. package/src/components/Paragraphs/RTWPlanner/index.vue +109 -31
  27. package/src/components/Paragraphs/SelectableCards/Control/index.stories.js +31 -11
  28. package/src/components/Paragraphs/SelectableCards/cardbody.vue +9 -10
  29. package/src/components/Paragraphs/SelectableCards/cardtop.vue +23 -16
  30. package/src/components/Paragraphs/SelectableCards/index.stories.js +29 -8
  31. package/src/components/Paragraphs/SelectableCards/index.vue +124 -50
  32. package/src/components/Paragraphs/TextMedia/index.vue +4 -0
  33. package/src/components/Paragraphs/VideoPlayer/index.vue +1 -1
  34. package/src/components/SubComponents/Breadcrumb/index.vue +40 -7
  35. package/src/components/SubComponents/FormInstance/models/base-form-element.js +4 -3
  36. package/src/components/SubComponents/FormInstance/services/form-render-parser.js +51 -16
  37. package/src/components/SubComponents/FormInstance/services/logic-parser.js +122 -18
  38. package/src/components/SubComponents/FormInstance/services/registry-factory.js +52 -50
  39. package/src/components/SubComponents/FormInstance/stories/mocks/checkboxesother.json +1 -10
  40. package/src/components/SubComponents/FormInstance/stories/mocks/emailconfirm.json +1 -10
  41. package/src/components/SubComponents/FormInstance/stories/mocks/jahd.json +1 -5
  42. package/src/components/SubComponents/FormInstance/stories/mocks/quad.json +1 -5
  43. package/src/components/SubComponents/FormInstance/stories/mocks/radiosother.json +1 -9
  44. package/src/components/SubComponents/FormInstance/stories/mocks/sameas.json +1 -5
  45. package/src/components/SubComponents/FormInstance/stories/mocks/selectother.json +1 -10
  46. package/src/components/SubComponents/FormInstance/stories/mocks/styles.json +1 -5
  47. package/src/components/SubComponents/FormInstance/stories/mocks/table-select.json +1 -15
  48. package/src/components/SubComponents/FormInstance/stories/mocks/token.json +1 -5
  49. package/src/components/SubComponents/FormInstance/stories/mocks/twig.json +1 -13
  50. package/src/components/SubComponents/FormInstance/stories/mocks/wizard.json +1 -13
  51. package/src/components/SubComponents/FormInstance/tests/form-test-utils.js +3 -0
  52. package/src/components/SubComponents/FormInstance/tests/form.test.js +2 -1
  53. package/src/components/SubComponents/FormInstance/tests/radiosother.test.js +12 -11
  54. package/src/components/SubComponents/FormInstance/tests/rule-disabled.test.js +13 -45
  55. package/src/components/SubComponents/FormInstance/tests/rule-enabled-value.test.js +8 -24
  56. package/src/components/SubComponents/FormInstance/tests/rule-hidden.test.js +13 -45
  57. package/src/components/SubComponents/FormInstance/tests/rule-required-value.test.js +15 -55
  58. package/src/components/SubComponents/FormInstance/tests/rule-visible.test.js +0 -413
  59. package/src/components/SubComponents/FormInstance/tests/sameas.test.js +9 -25
  60. package/src/components/SubComponents/FormInstance/tests/twig.test.js +7 -5
  61. package/src/components/SubComponents/ResourceGroup/index.vue +1 -1
  62. package/src/includes/scss/vars/src/colors.module.scss +3 -0
  63. package/src/includes/scss/vars/src/colors.scss +3 -0
  64. package/src/index.js +6 -0
  65. package/src/mock/control-selectable-cards.js +68 -25
  66. package/src/components/Paragraphs/RTWPlanner/Home/index.vue +0 -83
@@ -7,7 +7,7 @@ export default {
7
7
  component: SectionGroup,
8
8
  argTypes: {
9
9
  backgroundImage: {
10
- control: 'boolean'
10
+ control: 'boolean',
11
11
  },
12
12
  backgroundVariant: {
13
13
  control: 'select',
@@ -18,69 +18,70 @@ export default {
18
18
  'grey',
19
19
  'yellow',
20
20
  'white',
21
- 'lightblue'
22
- ]
21
+ 'lightblue',
22
+ 'lavendergray',
23
+ ],
23
24
  },
24
25
  applyBackgroundOn: {
25
26
  control: 'select',
26
- options: ['content', 'block', 'container', 'section']
27
+ options: ['content', 'block', 'container', 'section'],
27
28
  },
28
29
  titleTag: {
29
30
  control: 'select',
30
- options: ['h2', 'h3']
31
+ options: ['h2', 'h3'],
31
32
  },
32
33
  footer: {
33
- control: 'boolean'
34
+ control: 'boolean',
34
35
  },
35
36
  preContent: {
36
- control: 'boolean'
37
+ control: 'boolean',
37
38
  },
38
39
  headerRight: {
39
- control: 'boolean'
40
+ control: 'boolean',
40
41
  },
41
42
  size: {
42
43
  control: 'select',
43
- options: ['half-content', 'content', 'page', 'full']
44
+ options: ['half-content', 'content', 'page', 'full'],
44
45
  },
45
46
  headingRightSlot: {
46
- control: 'text'
47
+ control: 'text',
47
48
  },
48
49
  preContentSlot: {
49
- control: 'text'
50
+ control: 'text',
50
51
  },
51
52
  contentSlot: {
52
- control: 'text'
53
+ control: 'text',
53
54
  },
54
55
  footerSlot: {
55
- control: 'text'
56
+ control: 'text',
56
57
  },
57
58
  top: {
58
59
  control: 'text',
59
- table: { disable: true }
60
+ table: { disable: true },
60
61
  },
61
62
  headerTop: {
62
63
  control: 'text',
63
- table: { disable: true }
64
+ table: { disable: true },
64
65
  },
65
66
  headerBottom: {
66
67
  control: 'text',
67
- table: { disable: true }
68
+ table: { disable: true },
68
69
  },
69
70
  content: {
70
71
  control: 'text',
71
- table: { disable: true }
72
+ table: { disable: true },
72
73
  },
73
74
  default: {
74
75
  control: 'text',
75
- table: { disable: true }
76
- }
77
- }
78
- };
76
+ table: { disable: true },
77
+ },
78
+ },
79
+ }
79
80
 
80
81
  const Template = (args) => ({
81
82
  components: { SectionGroup, Row, Column },
82
83
  setup() {
83
- return { args };
84
+ return { args }
84
85
  },
85
86
  template: `
86
87
  <div>
@@ -119,10 +120,10 @@ const Template = (args) => ({
119
120
 
120
121
  {{args.sectionBottom}}
121
122
  </div>
122
- `
123
- });
124
-
125
- export const Default = Template.bind({});
123
+ `,
124
+ })
125
+
126
+ export const Default = Template.bind({})
126
127
 
127
128
  Default.args = {
128
129
  noPaddingTop: false,
@@ -144,5 +145,5 @@ Default.args = {
144
145
  footer: true,
145
146
  preContent: true,
146
147
  headerRight: true,
147
- size: 'page'
148
+ size: 'page',
148
149
  }
@@ -114,6 +114,7 @@ export default {
114
114
  'white',
115
115
  'lightblue',
116
116
  'lightred',
117
+ 'lavendergray',
117
118
  ].indexOf(value) >= 0,
118
119
  },
119
120
  applyBackgroundOn: {
@@ -200,9 +201,13 @@ export default {
200
201
  case 'lightred':
201
202
  bgColour = colors.lightred
202
203
  break
204
+ case 'lavendergray':
205
+ bgColour = colors.lavendergray
206
+ break
203
207
  default:
204
208
  bgColour = 'transparent'
205
209
  }
210
+
206
211
  styles = {
207
212
  ...(styles || {}),
208
213
  [`background-color`]: bgColour,
@@ -351,6 +351,7 @@ import CtaButton from '../../SubComponents/CtaButton/index.vue'
351
351
  import chevronIcon from '../../../assets/icons/caret-right.svg?url'
352
352
  import { ref } from "vue";
353
353
 
354
+
354
355
  export default {
355
356
  setup() {
356
357
  const show = ref(false);
@@ -613,7 +614,7 @@ export default {
613
614
  },
614
615
 
615
616
  showMobileMenu() {
616
- // Reset screen to top to fix whitespace issues
617
+ // Reset screen to top to fix whitespace issues
617
618
  if (window) {
618
619
  window.scrollTo(0, 0)
619
620
  }
@@ -776,7 +777,14 @@ export default {
776
777
  .getElementsByTagName('a')[0]
777
778
  .setAttribute('aria-expanded', 'false')
778
779
  this.isSecondLevelOpen = false
780
+ // fix introduced to re-open mobile menu after going back from 2nd level, ie "Main Menu" action
781
+ this.closeMegaMenu()
782
+ this.$nextTick(() => {
783
+ this.showMobileMenu()
784
+ })
785
+
779
786
  }
787
+
780
788
  },
781
789
  searchFocus(index, length, event) {
782
790
  if (index === length - 1 && this.isMobileMenuOpen && !event.shiftKey) {
@@ -1,9 +1,12 @@
1
1
  @import './includes.scss';
2
2
 
3
+ // $app-menu-white is used for mobile menu text colour instead of $app-header-text-colour
4
+
3
5
  .app-header {
4
6
  &.isMobile {
5
7
  padding: 0;
6
8
  width: 100vw;
9
+ overflow-x: visible;
7
10
 
8
11
  .app-header {
9
12
  &__wrap {
@@ -185,7 +188,7 @@
185
188
  margin-left: 10px;
186
189
 
187
190
  span {
188
- color: $app-header-active;
191
+ color: $app-menu-white;
189
192
  font-size: 18px !important;
190
193
  }
191
194
 
@@ -247,7 +250,7 @@
247
250
  border-bottom: none;
248
251
 
249
252
  span {
250
- color: $app-header-active;
253
+ color: $app-menu-white;
251
254
 
252
255
  &:hover,
253
256
  &:focus {
@@ -5,8 +5,9 @@
5
5
  z-index: 27;
6
6
  position: relative;
7
7
  padding: 0px;
8
- width: 100vw;
8
+ width: 100%;
9
9
  font-size: 14px;
10
+ overflow-x: hidden;
10
11
 
11
12
  &__wrap {
12
13
  position: relative;
@@ -386,11 +387,11 @@
386
387
 
387
388
  .logo {
388
389
  height: 85px;
389
- padding: 15px 0%;
390
+ padding: 15px 10px 15px 0px;
390
391
  width: 100%;
391
392
  display: flex;
392
393
  align-items: center;
393
- margin-right: 50px;
394
+ margin-right: 0;
394
395
  margin-left: -10px;
395
396
  background-color: white;
396
397
  width: 100vw;
@@ -398,12 +399,12 @@
398
399
  &__nav {
399
400
  display:inline-block;
400
401
  margin-left: 15px;
401
- margin-right: 10px;
402
+ margin-right: 0;
402
403
  color: #000;
403
404
  width: 100%;
404
405
  text-align: right;
405
406
  font-weight: bold;
406
- overflow-y:auto;
407
+ overflow-y: auto;
407
408
 
408
409
  a:focus {
409
410
  border: 1px solid #BABABA !important;
@@ -12,8 +12,14 @@
12
12
  : false
13
13
  "
14
14
  >
15
- <row v-if="type === 'hero'" class="wcl-hero-header__wrap wcl-hero-header__showmore">
16
- <container class="wcl-hero-header__content-wrapper__content" :class="{ rtl }">
15
+ <row
16
+ v-if="type === 'hero'"
17
+ class="wcl-hero-header__wrap wcl-hero-header__showmore"
18
+ >
19
+ <container
20
+ class="wcl-hero-header__content-wrapper__content"
21
+ :class="{ rtl }"
22
+ >
17
23
  <row>
18
24
  <column class="wcl-hero-header__content-wrapper__content-col">
19
25
  <div>
@@ -37,14 +43,18 @@
37
43
  </row>
38
44
  <row class="wcl-hero-header__wrap">
39
45
  <div class="wcl-hero-header__content-wrapper">
40
- <container class="wcl-hero-header__content-wrapper__content" :class="{ rtl }">
46
+ <container
47
+ class="wcl-hero-header__content-wrapper__content"
48
+ :class="{ rtl }"
49
+ >
41
50
  <row>
42
51
  <column
43
52
  :xs="generateGridValue(type)"
44
53
  class="wcl-hero-header__content-wrapper__content-col"
45
54
  :md="7"
46
55
  :class="{
47
- [`wcl-hero-header__content-wrapper__content-col--split`]: $slots.side,
56
+ [`wcl-hero-header__content-wrapper__content-col--split`]:
57
+ $slots.side,
48
58
  }"
49
59
  >
50
60
  <breadcrumb
@@ -59,7 +69,10 @@
59
69
  :content="strippedTitle"
60
70
  class="wcl-hero-header__title"
61
71
  />
62
- <div v-if="subTitle || $slots.description" class="header-rich-text-wrap">
72
+ <div
73
+ v-if="subTitle || $slots.description"
74
+ class="header-rich-text-wrap"
75
+ >
63
76
  <rich-text
64
77
  v-if="subTitle"
65
78
  :content="subTitle"
@@ -96,7 +109,7 @@
96
109
  </div>
97
110
  <!-- Type Default -->
98
111
  <column
99
- v-if="type === 'default' && showMask"
112
+ v-if="type === 'default'"
100
113
  :md="'5'"
101
114
  :xs="'5'"
102
115
  class="wcl-hero-header__right"
@@ -104,7 +117,7 @@
104
117
  :offset-md="rtl ? 0 : 7"
105
118
  :offset-xs="rtl ? 0 : 7"
106
119
  >
107
- <div class="wcl-hero-header__mask">
120
+ <div class="wcl-hero-header__mask" v-if="showMask">
108
121
  <hero-header-chevron />
109
122
  </div>
110
123
  </column>
@@ -112,7 +125,9 @@
112
125
  <column
113
126
  v-if="type === 'collection' && showMask"
114
127
  :sm="'7'"
115
- :style="image && image.url ? `background-image:url(${image.url})` : false"
128
+ :style="
129
+ image && image.url ? `background-image:url(${image.url})` : false
130
+ "
116
131
  class="wcl-hero-header__right type-collection"
117
132
  :class="{ 'rtl-flip': rtl }"
118
133
  :offset-sm="rtl ? 0 : 5"
@@ -134,7 +149,9 @@
134
149
  :class="{ 'rtl-flip': rtl }"
135
150
  :offset-md="rtl ? 0 : 7"
136
151
  :offset-xs="rtl ? 0 : 7"
137
- :style="image && image.url ? `background-image:url(${image.url})` : false"
152
+ :style="
153
+ image && image.url ? `background-image:url(${image.url})` : false
154
+ "
138
155
  >
139
156
  &nbsp;
140
157
  </column>
@@ -144,19 +161,19 @@
144
161
  </container>
145
162
  </template>
146
163
  <script>
147
- import SocialShare from "./../SocialShare/index.vue";
148
- import Container from "./../../Containers/Container/index.vue";
149
- import Row from "./../../Containers/Row/index.vue";
150
- import Column from "./../../Containers/Column/index.vue";
151
- import Breadcrumb from "./../../SubComponents/Breadcrumb/index.vue";
152
- import CtaButton from "./../../SubComponents/CtaButton/index.vue";
153
- import Icon from "./../../SubComponents/Icon/index.vue";
154
- import HeroHeaderChevron from "./../../../assets/images/hero-header-chevron.svg?component";
155
- import CaretDown from "./../../../assets/icons/chev-down-white.svg?url";
156
- import RichText from "./../../Paragraphs/RichText/index.vue";
164
+ import SocialShare from './../SocialShare/index.vue'
165
+ import Container from './../../Containers/Container/index.vue'
166
+ import Row from './../../Containers/Row/index.vue'
167
+ import Column from './../../Containers/Column/index.vue'
168
+ import Breadcrumb from './../../SubComponents/Breadcrumb/index.vue'
169
+ import CtaButton from './../../SubComponents/CtaButton/index.vue'
170
+ import Icon from './../../SubComponents/Icon/index.vue'
171
+ import HeroHeaderChevron from './../../../assets/images/hero-header-chevron.svg?component'
172
+ import CaretDown from './../../../assets/icons/chev-down-white.svg?url'
173
+ import RichText from './../../Paragraphs/RichText/index.vue'
157
174
 
158
175
  export default {
159
- name: "HeroHeader",
176
+ name: 'HeroHeader',
160
177
  components: {
161
178
  Container,
162
179
  Row,
@@ -171,15 +188,15 @@ export default {
171
188
  props: {
172
189
  type: {
173
190
  type: String,
174
- default: "default",
191
+ default: 'default',
175
192
  },
176
193
  title: {
177
194
  type: String,
178
- default: "",
195
+ default: '',
179
196
  },
180
197
  description: {
181
198
  type: String,
182
- default: "",
199
+ default: '',
183
200
  },
184
201
  image: {
185
202
  type: Object,
@@ -223,33 +240,33 @@ export default {
223
240
  socialShareToggle: false,
224
241
  HeroHeaderChevron,
225
242
  CaretDown,
226
- };
243
+ }
227
244
  },
228
245
  computed: {
229
246
  generatedClass() {
230
- let c = `wcl-hero-header type-${this.type}`;
247
+ let c = `wcl-hero-header type-${this.type}`
231
248
  if (this.bgColor) {
232
- c = c + " -with-bg";
249
+ c = c + ' -with-bg'
233
250
  }
234
- return c;
251
+ return c
235
252
  },
236
253
  subTitle() {
237
- let content = undefined;
254
+ let content = undefined
238
255
  if (this.description) {
239
- if (typeof this.description === "string") {
240
- content = this.description;
241
- } else if (typeof this.description === "object") {
242
- content = this.description.processed;
256
+ if (typeof this.description === 'string') {
257
+ content = this.description
258
+ } else if (typeof this.description === 'object') {
259
+ content = this.description.processed
243
260
  }
244
261
  }
245
- if (content && !content.startsWith("<") && !this.tag?.startsWith("h")) {
246
- content = `<p class="intro">${content}</p>`;
262
+ if (content && !content.startsWith('<') && !this.tag?.startsWith('h')) {
263
+ content = `<p class="intro">${content}</p>`
247
264
  }
248
- return content;
265
+ return content
249
266
  },
250
267
  strippedTitle() {
251
- if (this.type === "hero" && this.title.length > 122) {
252
- return this.title.slice(0, 122) + "...";
268
+ if (this.type === 'hero' && this.title.length > 122) {
269
+ return this.title.slice(0, 122) + '...'
253
270
  }
254
271
  // Will reintroduce if business requirement
255
272
  // if (this.title?.includes('.')) {
@@ -258,7 +275,7 @@ export default {
258
275
  // return sentences.map((sentence) => sentence.trim()).join('.<br/>')
259
276
  // }
260
277
  // }
261
- return this.title;
278
+ return this.title
262
279
  },
263
280
  // Will reintroduce if business requirement
264
281
  // strippedDescription() {
@@ -271,57 +288,57 @@ export default {
271
288
  },
272
289
  mounted() {
273
290
  if (this.$bus) {
274
- this.$bus.$on("scrollToTop", () => {
291
+ this.$bus.$on('scrollToTop', () => {
275
292
  setTimeout(() => {
276
- const title = this.$refs.title;
293
+ const title = this.$refs.title
277
294
  if (title) {
278
- title.$el.setAttribute("tabindex", 0);
279
- title.$el.focus();
295
+ title.$el.setAttribute('tabindex', 0)
296
+ title.$el.focus()
280
297
  }
281
- }, 500);
282
- });
298
+ }, 500)
299
+ })
283
300
  }
284
301
  },
285
302
  beforeDestroy() {
286
303
  if (this.$bus) {
287
- this.$bus.$off("scrollToTop");
304
+ this.$bus.$off('scrollToTop')
288
305
  }
289
306
  },
290
307
  methods: {
291
308
  generateGridValue(type) {
292
309
  switch (type) {
293
310
  //the prop type default
294
- case "default":
295
- return "6";
296
- case "image":
297
- return "6";
311
+ case 'default':
312
+ return '6'
313
+ case 'image':
314
+ return '6'
298
315
  default:
299
- return "7";
316
+ return '7'
300
317
  }
301
318
  },
302
319
  showMore(ev) {
303
320
  if (ev?.target?.scrollIntoView) {
304
321
  ev.target.scrollIntoView({
305
- behavior: "smooth",
322
+ behavior: 'smooth',
306
323
  alignToTop: true,
307
- block: "start",
308
- });
324
+ block: 'start',
325
+ })
309
326
  }
310
327
  },
311
328
  fireGTM() {
312
329
  let attrs = {
313
330
  label: this.cta.uri,
314
331
  document_title: this.cta.filename,
315
- };
332
+ }
316
333
  if (this.$gtm) {
317
- this.$gtm.push({ event: "custom.interaction.download", ...attrs });
334
+ this.$gtm.push({ event: 'custom.interaction.download', ...attrs })
318
335
  }
319
336
  },
320
337
  },
321
- };
338
+ }
322
339
  </script>
323
340
  <style lang="scss" scoped>
324
- @import "./styles";
341
+ @import './styles';
325
342
 
326
343
  .wysiwyg {
327
344
  :deep(.cta-button:last-child) {