@worksafevictoria/wcl7.5 1.18.1 → 1.19.0-beta.6
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.
- package/package.json +1 -1
- package/src/components/Global/AppHeaderNew/mobile.scss +0 -2
- package/src/components/Paragraphs/RTWPlanner/CardContainer/index.vue +3 -27
- package/src/components/Paragraphs/RTWPlanner/CardContainer/styles.scss +28 -0
- package/src/components/Paragraphs/RTWPlanner/Constants.js +135 -3
- package/src/components/Paragraphs/RTWPlanner/Footer/index.vue +3 -3
- package/src/components/Paragraphs/RTWPlanner/Header/index.vue +3 -3
- package/src/components/Paragraphs/RTWPlanner/HomePage/index.vue +8 -27
- package/src/components/Paragraphs/RTWPlanner/Injuries/HowTo.vue +168 -0
- package/src/components/Paragraphs/RTWPlanner/Injuries/index.vue +67 -14
- package/src/components/Paragraphs/RTWPlanner/Planners/PlanTasks.vue +411 -108
- package/src/components/Paragraphs/RTWPlanner/Planners/PlannerNameModal.vue +47 -50
- package/src/components/Paragraphs/RTWPlanner/Planners/PlannersStorage.js +29 -0
- package/src/components/Paragraphs/RTWPlanner/Planners/index.vue +119 -223
- package/src/components/Paragraphs/RTWPlanner/index.vue +1 -2
- package/src/components/Paragraphs/TextMedia/index.vue +5 -11
- package/src/index.js +2 -1
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed } from 'vue'
|
|
2
|
+
import { ref, computed } from 'vue'
|
|
3
3
|
import { BModal, BFormInput } from 'bootstrap-vue-next'
|
|
4
4
|
import CtaButton from './../../../SubComponents/CtaButton/index.vue'
|
|
5
|
+
import { PlannerToStorage } from './PlannersStorage.js'
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
/* -----------------------
|
|
8
|
+
Props / Emits
|
|
9
|
+
------------------------ */
|
|
7
10
|
const props = defineProps({
|
|
8
11
|
modelValue: {
|
|
9
12
|
type: Boolean,
|
|
10
|
-
default: false,
|
|
11
|
-
},
|
|
12
|
-
value: {
|
|
13
|
-
type: String,
|
|
14
|
-
default: '', // used by v-model:value on PlannerNameModal
|
|
13
|
+
default: false,
|
|
15
14
|
},
|
|
16
15
|
})
|
|
17
16
|
|
|
18
|
-
const emit = defineEmits([
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
const emit = defineEmits(['update:modelValue', 'onsubmit'])
|
|
18
|
+
|
|
19
|
+
/* -----------------------
|
|
20
|
+
State
|
|
21
|
+
------------------------ */
|
|
22
|
+
const inputValue = ref('')
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
/* -----------------------
|
|
25
|
+
Modal proxy
|
|
26
|
+
------------------------ */
|
|
25
27
|
const show = computed({
|
|
26
28
|
get: () => props.modelValue,
|
|
27
29
|
set: (val) => emit('update:modelValue', val),
|
|
28
30
|
})
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
set: (val) => emit('update:value', val),
|
|
34
|
-
})
|
|
35
|
-
|
|
32
|
+
/* -----------------------
|
|
33
|
+
Submit
|
|
34
|
+
------------------------ */
|
|
36
35
|
function handleSubmit() {
|
|
37
36
|
const trimmed = inputValue.value.trim()
|
|
38
|
-
console.log('
|
|
37
|
+
console.log('handleSubmit:', trimmed)
|
|
39
38
|
|
|
40
39
|
if (!trimmed) return
|
|
41
40
|
|
|
42
|
-
//
|
|
43
|
-
|
|
41
|
+
// ✅ Save to localStorage
|
|
42
|
+
const planner = PlannerToStorage(trimmed)
|
|
44
43
|
|
|
45
|
-
//
|
|
46
|
-
emit('
|
|
44
|
+
// notify parent
|
|
45
|
+
emit('onsubmit', planner)
|
|
47
46
|
|
|
48
|
-
//
|
|
49
|
-
|
|
47
|
+
// reset + close
|
|
48
|
+
inputValue.value = ''
|
|
49
|
+
emit('update:modelValue', false)
|
|
50
50
|
}
|
|
51
51
|
</script>
|
|
52
52
|
|
|
@@ -59,30 +59,27 @@ function handleSubmit() {
|
|
|
59
59
|
no-footer
|
|
60
60
|
size="lg"
|
|
61
61
|
>
|
|
62
|
-
<
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
<CtaButton ref="calNextBtn" @click="handleSubmit">Next</CtaButton>
|
|
84
|
-
</div>
|
|
85
|
-
</template>
|
|
62
|
+
<div class="p-3">
|
|
63
|
+
<h3 class="fw-bold mb-3 modal-title__new-planner">Name your planner</h3>
|
|
64
|
+
|
|
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 you
|
|
67
|
+
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
|
+
v-model="inputValue"
|
|
77
|
+
class="mb-4 input__new-planner"
|
|
78
|
+
@keyup.enter="handleSubmit"
|
|
79
|
+
/>
|
|
80
|
+
|
|
81
|
+
<CtaButton @click="handleSubmit">Next</CtaButton>
|
|
82
|
+
</div>
|
|
86
83
|
</b-modal>
|
|
87
84
|
</template>
|
|
88
85
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ref } from 'vue'
|
|
2
|
+
|
|
3
|
+
const STORAGE_KEY = 'planners'
|
|
4
|
+
|
|
5
|
+
export function getPlanners() {
|
|
6
|
+
const saved = localStorage.getItem(STORAGE_KEY)
|
|
7
|
+
return saved ? JSON.parse(saved) : []
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function savePlanners(planners) {
|
|
11
|
+
localStorage.setItem(STORAGE_KEY, JSON.stringify(planners))
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function PlannerToStorage(name) {
|
|
15
|
+
if (!name.trim()) return null
|
|
16
|
+
|
|
17
|
+
const planners = getPlanners()
|
|
18
|
+
|
|
19
|
+
const planner = {
|
|
20
|
+
id: Date.now(),
|
|
21
|
+
name,
|
|
22
|
+
tasksCompleted: [],
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
planners.push(planner)
|
|
26
|
+
savePlanners(planners)
|
|
27
|
+
|
|
28
|
+
return planner
|
|
29
|
+
}
|