@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
@@ -0,0 +1,226 @@
1
+ <script setup>
2
+ import { ref, watch } from 'vue'
3
+ import HeroHeader from './../../../Global/HeroHeader/index.vue'
4
+ import CardContainer from './../CardContainer/index.vue'
5
+ import Breakout from './../../Breakout/index.vue'
6
+ import SectionGroup from './../../../Containers/SectionGroup/index.vue'
7
+ import CardGroup from './../../../SubComponents/CardGroup/index.vue'
8
+ import Breadcrumb from './../../../SubComponents/Breadcrumb/index.vue'
9
+ import RichText from './../../RichText/index.vue'
10
+ import SelectableCards from './../../SelectableCards/index.vue'
11
+ import PlannerNameModal from './../Planners/PlannerNameModal.vue'
12
+
13
+ const props = defineProps({
14
+ injuryPage: {
15
+ type: String,
16
+ default: null,
17
+ },
18
+ titles: {
19
+ type: Object,
20
+ default: () => {},
21
+ },
22
+ heroHeader: {
23
+ type: Object,
24
+ default: () => {},
25
+ },
26
+ cards: {
27
+ type: Array,
28
+ default: () => [],
29
+ },
30
+ breakout: {
31
+ type: Object,
32
+ default: () => {},
33
+ },
34
+ rtwCards: {
35
+ type: Array,
36
+ default: () => [],
37
+ },
38
+ contactCards: {
39
+ type: Array,
40
+ default: () => [],
41
+ },
42
+ breadcrumbItems: {
43
+ type: Array,
44
+ default: () => [],
45
+ },
46
+ })
47
+
48
+ const screen = ref(1)
49
+ const selectedCard = ref(null)
50
+ const showModal = ref(false)
51
+
52
+ // local copy of breadcrumb items allowed to mutate
53
+ const breadcrumbItemsLocal = ref([...props.breadcrumbItems])
54
+
55
+ // keep local in sync with incoming props when we're on screen 1
56
+ watch(
57
+ () => props.breadcrumbItems,
58
+ (val) => {
59
+ if (screen.value === 1) {
60
+ breadcrumbItemsLocal.value = [...val]
61
+ }
62
+ },
63
+ { immediate: true },
64
+ )
65
+
66
+ function nextScreen(card) {
67
+ selectedCard.value = card
68
+ screen.value = 2
69
+
70
+ if (props.injuryPage === 'physicalInjury') {
71
+ breadcrumbItemsLocal.value = [
72
+ {
73
+ text: 'Physical Injury',
74
+ to: '/',
75
+ },
76
+ ]
77
+ }
78
+ }
79
+
80
+ function onCrumbClick({ index }) {
81
+ // clicking the first crumb → back to screen 1
82
+ if (index === 0) {
83
+ screen.value = 1
84
+ selectedCard.value = null
85
+ breadcrumbItemsLocal.value = [...props.breadcrumbItems]
86
+ }
87
+
88
+ // if you want the second crumb clickable to stay on screen 2,
89
+ // you can add logic for index === 1 here, or just leave it as no-op.
90
+ }
91
+
92
+ function nextScreenAgent(card) {
93
+ showModal.value = true
94
+ }
95
+ </script>
96
+
97
+ <template>
98
+ <div class="injuries-app">
99
+ <breadcrumb
100
+ :breadcrumb-items="breadcrumbItemsLocal"
101
+ :intercept-clicks="true"
102
+ @item-click="onCrumbClick"
103
+ />
104
+
105
+ <div v-if="injuryPage === 'physicalInjury' && screen === 1">
106
+ <hero-header
107
+ :image="null"
108
+ :show-mask="false"
109
+ :title="heroHeader.title"
110
+ :description="heroHeader.description"
111
+ :bg-color="null"
112
+ :show-social="false"
113
+ class="hero-header"
114
+ />
115
+ <breakout :title="breakout.title" :body="breakout.body" />
116
+
117
+ <card-container
118
+ ref="physicalCardContainer"
119
+ :titles="titles.physical"
120
+ :cards="cards"
121
+ :button-role="'modal-quest'"
122
+ @nextScreen="nextScreen"
123
+ />
124
+ </div>
125
+
126
+ <div
127
+ v-if="
128
+ injuryPage === 'mentalInjury' ||
129
+ injuryPage === 'otherInjury' ||
130
+ screen === 2
131
+ "
132
+ >
133
+ <section-group
134
+ v-if="selectedCard?.value || cards.content"
135
+ :background-variant="'lavendergray'"
136
+ class="injuries-app__injury"
137
+ >
138
+ <rich-text
139
+ :content="selectedCard?.value || cards.content"
140
+ :without-container="true"
141
+ />
142
+ </section-group>
143
+
144
+ <card-group
145
+ v-if="rtwCards.length > 0"
146
+ class="injuries-app__rtw-cards"
147
+ :title="titles.rtwCards?.heading"
148
+ :title-tag="'h3'"
149
+ :cards="rtwCards"
150
+ :loading="false"
151
+ :columns="3"
152
+ :show-load-more="false"
153
+ :background="'white'"
154
+ />
155
+
156
+ <selectable-cards
157
+ class="injuries-app__contact-info"
158
+ :title="titles.cardContactInformaton?.heading"
159
+ :button-role="'none'"
160
+ :columns-per-row="4"
161
+ :cards="contactCards"
162
+ :icon-is-bordered="false"
163
+ :card-type="'control-selectcards'"
164
+ :card-text-align="'center'"
165
+ :is-selectable="'false'"
166
+ ></selectable-cards>
167
+ </div>
168
+
169
+ <div v-if="injuryPage === 'selectAgent'">
170
+ <card-container
171
+ ref="selectAgentContainer"
172
+ :columns="4"
173
+ :title="titles.cardContactInformaton?.heading"
174
+ :cards="contactCards"
175
+ :button-role="'link'"
176
+ @nextScreen="nextScreenAgent"
177
+ />
178
+ </div>
179
+
180
+ <PlannerNameModal class="injuries-app__new-planner" v-model="showModal" />
181
+ </div>
182
+ </template>
183
+
184
+ <style lang="scss" scoped>
185
+ .injuries-app {
186
+ .wcl-hero-header {
187
+ border: none;
188
+ }
189
+
190
+ .wcl-breadcrumb {
191
+ margin: 50px 0 20px 0;
192
+ :deep(.breadcrumb) {
193
+ font-size: 12px;
194
+ }
195
+
196
+ &--ltr {
197
+ :deep(.breadcrumb-item:first-of-type::before) {
198
+ content: '<';
199
+ margin-right: 10px;
200
+ }
201
+ }
202
+ }
203
+
204
+ &__injury {
205
+ border-radius: 8px !important;
206
+ :deep(a.cta-button) {
207
+ display: none;
208
+ }
209
+ }
210
+
211
+ &__rtw-cards {
212
+ @media (min-width: 1024px) {
213
+ :deep(.section-group__heading) {
214
+ width: 75%;
215
+ }
216
+ }
217
+ }
218
+
219
+ &__contact-info {
220
+ :deep(.card-unit) {
221
+ padding: 0;
222
+ font-weight: bold;
223
+ }
224
+ }
225
+ }
226
+ </style>
@@ -56,8 +56,8 @@
56
56
  ? 'bg-success-subtle text-dark fw-bold active-done'
57
57
  : 'bg-success-subtle text-dark fw-bold'
58
58
  : activeContent.id === content.id
59
- ? 'active'
60
- : 'bg-light text-muted'
59
+ ? 'active'
60
+ : 'bg-light text-muted'
61
61
  "
62
62
  @click="setActiveContent(task, content)"
63
63
  >
@@ -90,26 +90,26 @@
90
90
 
91
91
  <script setup>
92
92
  import { ref } from 'vue'
93
- import { CtaButton, Row, Column, Container } from '@worksafevictoria/wcl7.5'
94
- import TickCircleIcon from './icons/TickCircleIcon.vue'
93
+ // import { CtaButton, Row, Column, Container }
94
+ import TickCircleIcon from './../icons/TickCircleIcon.vue'
95
95
 
96
96
  const props = defineProps({
97
97
  activePlanner: { type: Object, required: true },
98
- tasks: { type: Array, required: true }
98
+ tasks: { type: Array, required: true },
99
99
  })
100
100
 
101
101
  const emit = defineEmits(['updatePlanner'])
102
102
  const tasks = ref([])
103
103
  const activeTask = ref(props.tasks[0] || { id: '', title: '', content: [] })
104
104
  const activeContent = ref(
105
- props.tasks[0]?.content[0] || { btnText: '', html: '' }
105
+ props.tasks[0]?.content[0] || { btnText: '', html: '' },
106
106
  )
107
107
 
108
108
  const toggleTask = (taskId, contentId) => {
109
109
  const key = `${taskId}_${contentId}`
110
110
  const updatedPlanner = {
111
111
  ...props.activePlanner,
112
- tasksCompleted: [...props.activePlanner.tasksCompleted]
112
+ tasksCompleted: [...props.activePlanner.tasksCompleted],
113
113
  }
114
114
  const index = updatedPlanner.tasksCompleted.indexOf(key)
115
115
  if (index === -1) {
@@ -153,7 +153,8 @@ const getNextTask = () => {
153
153
  </script>
154
154
 
155
155
  <style lang="scss" scoped>
156
- @import '@worksafevictoria/wcl7.5/src/includes/scss/all.scss';
156
+ @import './../../../../includes/scss/all.scss';
157
+
157
158
  .active {
158
159
  color: black !important;
159
160
  background-color: $yellow !important;
@@ -0,0 +1,97 @@
1
+ <script setup>
2
+ import { computed } from 'vue'
3
+ import { BModal, BFormInput } from 'bootstrap-vue-next'
4
+ import CtaButton from './../../../SubComponents/CtaButton/index.vue'
5
+
6
+ // props from parent
7
+ const props = defineProps({
8
+ modelValue: {
9
+ type: Boolean,
10
+ default: false, // used by v-model on PlannerNameModal
11
+ },
12
+ value: {
13
+ type: String,
14
+ default: '', // used by v-model:value on PlannerNameModal
15
+ },
16
+ })
17
+
18
+ const emit = defineEmits([
19
+ 'update:modelValue', // for v-model (show/hide)
20
+ 'update:value', // for v-model:value (input text)
21
+ 'onsubmit', // custom event to send value to parent
22
+ ])
23
+
24
+ // proxy for v-model on <b-modal>
25
+ const show = computed({
26
+ get: () => props.modelValue,
27
+ set: (val) => emit('update:modelValue', val),
28
+ })
29
+
30
+ // proxy for v-model on input (goes to parent)
31
+ const inputValue = computed({
32
+ get: () => props.value,
33
+ set: (val) => emit('update:value', val),
34
+ })
35
+
36
+ function handleSubmit() {
37
+ const trimmed = inputValue.value.trim()
38
+ console.log('handle Submit', trimmed)
39
+
40
+ if (!trimmed) return
41
+
42
+ // emit value to parent
43
+ emit('onsubmit', trimmed)
44
+
45
+ // close modal
46
+ emit('update:modelValue', false)
47
+
48
+ // optional: clear input in parent
49
+ emit('update:value', '')
50
+ }
51
+ </script>
52
+
53
+ <template>
54
+ <b-modal
55
+ v-model="show"
56
+ aria-labelledby="injuries-app__modal"
57
+ no-close-on-backdrop
58
+ centered
59
+ no-footer
60
+ size="lg"
61
+ >
62
+ <template #default="{ close }">
63
+ <div class="p-3">
64
+ <h3 class="fw-bold mb-3 modal-title__new-planner">Name your planner</h3>
65
+ <p class="mb-4 modal-description__new-planner">
66
+ Give your planner a name so you can easily find it and pick up where
67
+ you left off.
68
+ </p>
69
+
70
+ <label for="modal2CB" class="fw-bold mb-2">
71
+ Injured workers first name
72
+ </label>
73
+
74
+ <BFormInput
75
+ id="modal2CB"
76
+ name="modal2CB"
77
+ placeholder=""
78
+ v-model="inputValue"
79
+ class="mb-4 input__new-planner"
80
+ @keyup.enter="handleSubmit"
81
+ />
82
+
83
+ <CtaButton ref="calNextBtn" @click="handleSubmit">Next</CtaButton>
84
+ </div>
85
+ </template>
86
+ </b-modal>
87
+ </template>
88
+
89
+ <style lang="scss" scoped>
90
+ :deep(.modal-description__new-planner) {
91
+ width: 65%;
92
+ }
93
+
94
+ :deep(.input__new-planner) {
95
+ width: 60%;
96
+ }
97
+ </style>