@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
@@ -1,26 +1,93 @@
1
1
  import RTWPlanner from './index.vue'
2
-
3
- const textMedia = {
4
- title: 'Return to Work Planner',
5
- content:
6
- '<p>An easy-to-use online guide that steps employers through the return to work process and meeting legal obligations for non major injuries.</p>',
7
- image: {
8
- url:
9
- process.env.CONTENT_API_URL +
10
- '/sites/default/files/2020-04/Topic-Coronavirus-COVID-19.jpg',
11
- alt: 'Some alt text',
12
- },
13
- rtl: true,
14
- titleTag: 'h1',
15
- }
2
+ import {
3
+ textMedia,
4
+ selectInjuries,
5
+ heroHeader,
6
+ cardTitles,
7
+ cardPhysicalBreakout,
8
+ cardPhysical,
9
+ cardRTWCards,
10
+ cardContactInformaton,
11
+ cardRTWMentalCards,
12
+ cardRTWOtherCards,
13
+ cardAgentContactInformaton,
14
+ } from './Constants'
16
15
 
17
16
  export default {
18
17
  title: 'Paragraphs/RTWPlanner',
19
18
  component: RTWPlanner,
20
19
  tags: ['autodocs'],
20
+ argTypes: {
21
+ homePage: {
22
+ control: 'boolean',
23
+ table: { disable: true },
24
+ },
25
+ injuryPage: {
26
+ type: String,
27
+ default: null,
28
+ },
29
+ },
30
+ }
31
+
32
+ export const ReturnToWork = {
21
33
  args: {
34
+ homePage: true,
22
35
  textMedia: textMedia,
36
+ selectInjuries: selectInjuries,
23
37
  },
24
38
  }
25
39
 
26
- export const ReturnToWork = {}
40
+ export const PhysicalInjury = {
41
+ args: {
42
+ breadcrumbItems: [{ text: 'Nature of the injury', to: '/' }],
43
+ homePage: false,
44
+ injuryPage: 'physicalInjury',
45
+ titles: cardTitles,
46
+ heroHeader: heroHeader,
47
+ cards: cardPhysical,
48
+ breakout: cardPhysicalBreakout,
49
+ rtwCards: cardRTWCards,
50
+ contactCards: cardContactInformaton,
51
+ },
52
+ }
53
+
54
+ export const Mentalnjury = {
55
+ args: {
56
+ breadcrumbItems: [{ text: 'Mental Injury', to: '/' }],
57
+ homePage: false,
58
+ injuryPage: 'mentalInjury',
59
+ titles: cardTitles,
60
+ heroHeader: heroHeader,
61
+ cards: selectInjuries.mental,
62
+ breakout: cardPhysicalBreakout,
63
+ rtwCards: cardRTWMentalCards,
64
+ contactCards: cardContactInformaton,
65
+ },
66
+ }
67
+
68
+ export const Otherlnjury = {
69
+ args: {
70
+ breadcrumbItems: [{ text: 'Injury', to: '/' }],
71
+ homePage: false,
72
+ injuryPage: 'otherInjury',
73
+ titles: cardTitles,
74
+ heroHeader: heroHeader,
75
+ cards: selectInjuries.other,
76
+ breakout: cardPhysicalBreakout,
77
+ rtwCards: cardRTWOtherCards,
78
+ contactCards: cardContactInformaton,
79
+ },
80
+ }
81
+
82
+ export const SelectYourAgent = {
83
+ args: {
84
+ breadcrumbItems: [{ text: 'Physical Injury', to: '/' }],
85
+ injuryPage: 'selectAgent',
86
+ titles: cardTitles,
87
+ contactCards: cardAgentContactInformaton,
88
+ },
89
+ }
90
+
91
+ export const MyPlanner = {
92
+ args: {},
93
+ }
@@ -1,41 +1,119 @@
1
+ <script setup>
2
+ import { computed } from 'vue'
3
+ import SectionGroup from './../../Containers/SectionGroup/index.vue'
4
+ import Header from './Header/index.vue'
5
+ import HomePage from './HomePage/index.vue'
6
+ import Injuries from './Injuries/index.vue'
7
+ import MyPlanner from './Planners/index.vue'
8
+ import Footer from './Footer/index.vue'
9
+
10
+ const props = defineProps({
11
+ homePage: {
12
+ type: Boolean,
13
+ default: false,
14
+ },
15
+ injuryPage: {
16
+ type: String,
17
+ default: null,
18
+ },
19
+ textMedia: {
20
+ type: Object,
21
+ required: false,
22
+ },
23
+ selectInjuries: {
24
+ type: Object,
25
+ required: false,
26
+ },
27
+ titles: {
28
+ type: Object,
29
+ default: () => {},
30
+ },
31
+ heroHeader: {
32
+ type: Object,
33
+ default: () => {},
34
+ },
35
+ cards: {
36
+ type: Array,
37
+ default: () => [],
38
+ },
39
+ breakout: {
40
+ type: Object,
41
+ default: () => {},
42
+ },
43
+ rtwCards: {
44
+ type: Array,
45
+ default: () => [],
46
+ },
47
+ contactCards: {
48
+ type: Array,
49
+ default: () => [],
50
+ },
51
+ breadcrumbItems: {
52
+ type: Array,
53
+ default: () => [],
54
+ },
55
+ })
56
+
57
+ const showInjuries = computed(() =>
58
+ ['selectAgent', 'otherInjury', 'mentalInjury', 'physicalInjury'].includes(
59
+ props.injuryPage,
60
+ ),
61
+ )
62
+ </script>
63
+
1
64
  <template>
2
65
  <section-group
3
66
  backgroundVariant="white"
4
67
  size="page"
5
68
  applyBackgroundOn="container"
69
+ class="rtw-app"
6
70
  >
7
- <NavBar />
8
-
9
- <div>
10
- <!-- ✅ forward the prop -->
11
- <Home :textMedia="textMedia" />
12
- </div>
13
-
14
- <div class="d-flex justify-content-end gap-3 my-4 small fw-bold">
15
- <a href="/return-work-help">Help</a>
16
- <a href="/return-work-faq">FAQs</a>
17
- <a href="/return-work-privacy">Privacy Policy</a>
18
- </div>
71
+ <Header />
72
+
73
+ <!-- ✅ forward the prop -->
74
+ <HomePage
75
+ v-if="homePage"
76
+ :textMedia="textMedia"
77
+ :selectInjuries="selectInjuries"
78
+ />
79
+
80
+ <Injuries
81
+ v-if="showInjuries"
82
+ :breadcrumbItems="breadcrumbItems"
83
+ :injuryPage="injuryPage"
84
+ :titles="titles"
85
+ :heroHeader="heroHeader"
86
+ :cards="cards"
87
+ :breakout="breakout"
88
+ :rtwCards="rtwCards"
89
+ :contactCards="contactCards"
90
+ />
91
+
92
+ <MyPlanner v-if="!showInjuries" />
93
+
94
+ <Footer />
19
95
  </section-group>
20
96
  </template>
21
97
 
22
- <script>
23
- import SectionGroup from './../../Containers/SectionGroup/index.vue'
24
- import NavBar from './NavBar/index.vue'
25
- import Home from './Home/index.vue'
26
-
27
- export default {
28
- name: 'RTWPlanner',
29
- components: {
30
- SectionGroup,
31
- NavBar,
32
- Home,
33
- },
34
- props: {
35
- textMedia: {
36
- type: Object,
37
- default: () => ({}),
38
- },
39
- },
98
+ <style lang="scss" scoped>
99
+ .rtw-app {
100
+ &__footer {
101
+ border-top: 1px solid #bababa;
102
+ padding: 20px 0;
103
+
104
+ a {
105
+ color: black;
106
+ font-size: 16px;
107
+ font-style: normal;
108
+ font-weight: 700;
109
+ line-height: 20px;
110
+ letter-spacing: 0px;
111
+ margin-left: 20px;
112
+ }
113
+ }
114
+
115
+ :deep(.wcl-media-text__content) {
116
+ padding-left: 20px;
117
+ }
40
118
  }
41
- </script>
119
+ </style>
@@ -1,5 +1,8 @@
1
1
  import SelectableCards from './../index.vue'
2
- import { mockSelectableCards } from '../../../../mock/control-selectable-cards'
2
+ import {
3
+ mockSelectableCards,
4
+ mockModalSelectableCards,
5
+ } from '../../../../mock/control-selectable-cards'
3
6
 
4
7
  export default {
5
8
  title: 'Paragraphs/SelectableCards',
@@ -7,24 +10,41 @@ export default {
7
10
  tags: ['autodocs'],
8
11
  argTypes: {
9
12
  cardType: {
10
- table: { disable: true }
13
+ table: { disable: true },
11
14
  },
12
15
  cardTextAlign: {
13
- table: { disable: true }
14
- }
16
+ table: { disable: true },
17
+ },
15
18
  },
19
+ template:
20
+ '<selectable-cards v-bind="args" class="control-selectablecards" />',
21
+ }
22
+
23
+ export const Control = {
16
24
  args: {
17
25
  cards: mockSelectableCards,
18
26
  title: 'Pick an object?',
19
27
  headingTag: 'h2',
20
- subHeading: 'Pick an object from the selections or if you know exactly how heavy is the object that is being dropped, enter the height in input box below.',
28
+ subHeading:
29
+ 'Pick an object from the selections or if you know exactly how heavy is the object that is being dropped, enter the height in input box below.',
21
30
  iconIsBordered: false,
22
31
  columns: 4,
23
32
  cardType: 'control-selectcards',
24
- cardTextAlign: 'center'
25
- },
26
- template:
27
- '<selectable-cards v-bind="args" class="control-selectablecards" />'
28
- }
33
+ cardTextAlign: 'center',
34
+ },
35
+ }
29
36
 
30
- export const Control = {}
37
+ export const Modal = {
38
+ args: {
39
+ cards: mockModalSelectableCards,
40
+ title: 'The following physical injury types are not supported',
41
+ headingTag: 'h2',
42
+ subHeading:
43
+ '<p>If you have multiple conditions apply, please select the most severe condition.</p>',
44
+ iconIsBordered: false,
45
+ columns: 4,
46
+ cardType: 'control-selectcards',
47
+ cardTextAlign: 'center',
48
+ buttonRole: 'modal-quest',
49
+ },
50
+ }
@@ -1,17 +1,16 @@
1
+ <script setup>
2
+ const props = defineProps({
3
+ card: {
4
+ type: Object,
5
+ required: true,
6
+ },
7
+ })
8
+ </script>
9
+
1
10
  <template>
2
11
  <p v-if="card.value" class="card-unit">{{ card.value }} {{ card.units }}</p>
3
12
  </template>
4
13
 
5
- <script>
6
- export default {
7
- props: {
8
- card: {
9
- type: Object,
10
- required: true
11
- }
12
- }
13
- }
14
- </script>
15
14
  <style lang="scss" scoped>
16
15
  .card-unit {
17
16
  margin: 0;
@@ -4,42 +4,49 @@
4
4
  v-if="card.pillText"
5
5
  class="card_item__pillTop pillTop"
6
6
  :class="{
7
- [`card_item__pillTop--rtl-${!!card.rtl}`]: true
7
+ [`card_item__pillTop--rtl-${!!card.rtl}`]: true,
8
8
  }"
9
9
  aria-hidden="true"
10
10
  >
11
11
  {{ card.pillText }}
12
12
  </div>
13
+
13
14
  <div class="card_item__pillTop pillTopText card_item__pillTop--rtl-true">
14
15
  <label
15
16
  class="card_item__control"
16
17
  :class="{ [`card_item__control-${buttonRole}`]: true }"
17
- ><span></span
18
- ></label>
18
+ @click.stop="buttonRoleClicked"
19
+ >
20
+ <span></span>
21
+ </label>
19
22
  </div>
23
+
20
24
  <div class="card_item__spacer card_item__spacer--withTextOnly"></div>
21
25
  </div>
22
26
  </template>
23
27
 
24
28
  <script>
25
29
  export default {
26
- components: {},
30
+ name: 'CardTop',
31
+ emits: {
32
+ 'button-role-clicked': false,
33
+ },
27
34
  props: {
28
- card: {
29
- type: Object,
30
- required: true
31
- },
32
- buttonRole: {
33
- type: String,
34
- default: 'radio'
35
+ card: { type: Object, required: true },
36
+ buttonRole: { type: String, default: 'radio' },
37
+ isSelectable: { type: Boolean, default: false },
38
+ },
39
+ methods: {
40
+ buttonRoleClicked() {
41
+ if (this.isSelectable) {
42
+ // Emit the raw card object (no wrapper, no stringify)
43
+ this.$emit('button-role-clicked', this.card)
44
+ }
35
45
  },
36
- isSelectable: {
37
- type: Boolean,
38
- default: false
39
- }
40
- }
46
+ },
41
47
  }
42
48
  </script>
49
+
43
50
  <style lang="scss" scoped>
44
51
  @import '../../../includes/scss/all';
45
52
  $borderRadius: 8px;
@@ -6,22 +6,43 @@ export default {
6
6
  component: SelectableCards,
7
7
  argTypes: {
8
8
  cardType: {
9
- table: { disable: true }
9
+ table: { disable: true },
10
10
  },
11
11
  cardTextAlign: {
12
- table: { disable: true }
12
+ table: { disable: true },
13
13
  },
14
14
  iconIsBordered: {
15
- table: { disable: true }
16
- }
15
+ table: { disable: true },
16
+ },
17
+ buttonRole: {
18
+ type: String,
19
+ default: 'link',
20
+ },
17
21
  },
22
+ }
23
+
24
+ export const Default = {
18
25
  args: {
19
26
  cards: mockSelectableCards,
20
27
  title: 'Selectable cards',
21
28
  headingTag: 'h2',
22
29
  columns: 4,
23
- subHeading: null
24
- }
25
- }
30
+ subHeading: null,
31
+ buttonRole: 'link',
32
+ },
33
+ }
26
34
 
27
- export const Default = {}
35
+ export const Simple = {
36
+ args: {
37
+ cards: mockSelectableCards,
38
+ title: 'Agent contact information',
39
+ headingTag: 'h2',
40
+ columns: 4,
41
+ subHeading: null,
42
+ iconIsBordered: false,
43
+ cardType: 'control-selectcards',
44
+ isSelectable: false,
45
+ buttonRole: 'none',
46
+ cardTextAlign: 'center',
47
+ },
48
+ }