@pocketprep/ui-kit 3.5.0 → 3.5.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.
- package/README.md +2 -2
- package/dist/@pocketprep/ui-kit.css +1 -0
- package/dist/@pocketprep/ui-kit.js +14256 -14792
- package/dist/@pocketprep/ui-kit.js.map +1 -1
- package/dist/@pocketprep/ui-kit.umd.cjs +11 -11
- package/dist/@pocketprep/ui-kit.umd.cjs.map +1 -1
- package/eslint.config.ts +111 -0
- package/lib/components/Banners/Banner.vue +2 -2
- package/lib/components/Bundles/BundleList.vue +1 -1
- package/lib/components/Bundles/BundleSearch.vue +2 -1
- package/lib/components/Bundles/PremiumPill.vue +2 -2
- package/lib/components/Buttons/Button.vue +19 -18
- package/lib/components/Buttons/Link.vue +9 -8
- package/lib/components/Buttons/Tab.vue +4 -3
- package/lib/components/Calendar/Calendar.vue +14 -2
- package/lib/components/Charts/Bar.vue +3 -3
- package/lib/components/Charts/Pie.vue +4 -4
- package/lib/components/Controls/SegmentControl.vue +8 -7
- package/lib/components/Controls/Slider.vue +2 -3
- package/lib/components/Controls/ToggleSwitch.vue +3 -2
- package/lib/components/EmptyStates/EmptyState.vue +3 -2
- package/lib/components/Exams/ExamCard.vue +3 -3
- package/lib/components/Exams/ExamMenuCard.vue +2 -2
- package/lib/components/Filters/FilterDropdown.vue +2 -2
- package/lib/components/Filters/FilterOptions.vue +2 -2
- package/lib/components/Forms/Checkbox.vue +2 -2
- package/lib/components/Forms/CheckboxOption.vue +2 -2
- package/lib/components/Forms/Errors.vue +2 -2
- package/lib/components/Forms/Input.vue +2 -2
- package/lib/components/Forms/Radio.vue +37 -39
- package/lib/components/Forms/RadioButton.vue +1 -1
- package/lib/components/Forms/Select.vue +7 -6
- package/lib/components/Forms/Textarea.vue +2 -2
- package/lib/components/Icons/Icon.vue +1 -0
- package/lib/components/Icons/IconEdit.vue +4 -2
- package/lib/components/Icons/IconFullViewActive.vue +1 -1
- package/lib/components/Icons/IconLoading2.vue +1 -3
- package/lib/components/Loaders/SkeletonLoader.vue +2 -2
- package/lib/components/Messaging/InfoMessage.vue +2 -2
- package/lib/components/Modal/Modal.vue +2 -2
- package/lib/components/Modal/ModalContainer.vue +2 -2
- package/lib/components/Onboarding/EmailAuth.vue +5 -5
- package/lib/components/Onboarding/MagicCodeEntry.vue +3 -4
- package/lib/components/Pagination/QuestionReviewPagination.vue +4 -4
- package/lib/components/Pagination/TablePagination.vue +2 -2
- package/lib/components/Quiz/FlagToggle.vue +2 -2
- package/lib/components/Quiz/GlobalMetricsToggle.vue +3 -2
- package/lib/components/Quiz/KeyboardShortcutsButton.vue +1 -1
- package/lib/components/Quiz/KeyboardShortcutsModal.vue +1 -1
- package/lib/components/Quiz/Question/ChoicesContainer.vue +4 -3
- package/lib/components/Quiz/Question/DropdownExplanation.vue +2 -2
- package/lib/components/Quiz/Question/Explanation.vue +2 -2
- package/lib/components/Quiz/Question/MatrixChoicesContainer.vue +12 -17
- package/lib/components/Quiz/Question/MatrixRadioGroup.vue +2 -2
- package/lib/components/Quiz/Question/MobileMatrixChoicesContainer.vue +19 -26
- package/lib/components/Quiz/Question/MobileMatrixRadioGroup.vue +7 -5
- package/lib/components/Quiz/Question/PassageAndImage.vue +2 -2
- package/lib/components/Quiz/Question/PassageAndImageDropdown.vue +7 -6
- package/lib/components/Quiz/Question/Paywall.vue +2 -2
- package/lib/components/Quiz/Question/QuestionContext.vue +2 -3
- package/lib/components/Quiz/Question/StatsSummary.vue +2 -2
- package/lib/components/Quiz/Question/Summary.vue +2 -2
- package/lib/components/Quiz/Question.vue +29 -28
- package/lib/components/Quiz/QuizContainer.vue +31 -37
- package/lib/components/Quiz/QuizProgress.vue +73 -77
- package/lib/components/Quiz/QuizProgressBar.vue +3 -2
- package/lib/components/Search/Pill.vue +2 -2
- package/lib/components/Search/Search.vue +2 -2
- package/lib/components/SidePanels/SidePanel.vue +8 -3
- package/lib/components/Tables/Table.vue +4 -3
- package/lib/components/Tables/TableActions.vue +3 -3
- package/lib/components/Tags/Tag.vue +2 -2
- package/lib/components/Toasts/Toast.vue +5 -3
- package/lib/components/Tooltips/OverflowTooltip.vue +2 -2
- package/lib/components/Tooltips/Tooltip.vue +2 -2
- package/lib/directives.ts +1 -1
- package/lib/pocketprep-export.module.scss +3 -2
- package/lib/pocketprep.scss +2 -2
- package/lib/styles/_breakpoints.scss +6 -12
- package/lib/styles/_colors.scss +0 -1
- package/package.json +36 -27
- package/stylelint.config.js +38 -0
- package/.eslintrc.cjs +0 -74
- package/dist/style.css +0 -1
- package/stylelint.config.cjs +0 -22
|
@@ -70,8 +70,8 @@ export default class CheckboxOption extends Vue {
|
|
|
70
70
|
</script>
|
|
71
71
|
|
|
72
72
|
<style lang="scss">
|
|
73
|
-
@
|
|
74
|
-
@
|
|
73
|
+
@use '@/styles/breakpoints' as *;
|
|
74
|
+
@use '@/styles/colors' as *;
|
|
75
75
|
|
|
76
76
|
.uikit-checkbox-option {
|
|
77
77
|
font-size: 15px;
|
|
@@ -55,8 +55,8 @@ export default class Errors extends Vue {
|
|
|
55
55
|
</script>
|
|
56
56
|
|
|
57
57
|
<style lang="scss">
|
|
58
|
-
@
|
|
59
|
-
@
|
|
58
|
+
@use '@/styles/breakpoints' as *;
|
|
59
|
+
@use '@/styles/colors' as *;
|
|
60
60
|
|
|
61
61
|
.uikit-errors {
|
|
62
62
|
border: 1px solid rgba($red-pegasus, 0.5);
|
|
@@ -146,8 +146,8 @@ export default class Input extends Vue {
|
|
|
146
146
|
</script>
|
|
147
147
|
|
|
148
148
|
<style lang="scss">
|
|
149
|
-
@
|
|
150
|
-
@
|
|
149
|
+
@use '@/styles/breakpoints' as *;
|
|
150
|
+
@use '@/styles/colors' as *;
|
|
151
151
|
|
|
152
152
|
.uikit-input {
|
|
153
153
|
&__input {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
'uikit-radio__item--has-helper-text': !!(item.helperText)
|
|
36
36
|
}"
|
|
37
37
|
role="radio"
|
|
38
|
-
:aria-checked="modelValue && item.value === modelValue.value"
|
|
38
|
+
:aria-checked="!!modelValue && item.value === modelValue.value"
|
|
39
39
|
:aria-label="`${item.label}${ item.helperText ? ` ${item.helperText}` : '' }`"
|
|
40
40
|
@click="!(disabled || item.disabled ) && selectItem(item)"
|
|
41
41
|
@keydown.enter.space="keyPressedItem"
|
|
@@ -66,59 +66,57 @@
|
|
|
66
66
|
</div>
|
|
67
67
|
</template>
|
|
68
68
|
|
|
69
|
-
<script lang="ts">
|
|
70
|
-
import {
|
|
71
|
-
import { dark } from '../../directives'
|
|
69
|
+
<script setup lang="ts">
|
|
70
|
+
import { ref } from 'vue'
|
|
71
|
+
import { dark as vDark } from '../../directives'
|
|
72
72
|
import RadioButton from './RadioButton.vue'
|
|
73
73
|
|
|
74
74
|
interface IItem {
|
|
75
|
-
value: string
|
|
76
|
-
label
|
|
75
|
+
value: string | number
|
|
76
|
+
label?: string
|
|
77
77
|
helperText?: string
|
|
78
78
|
disabled?: boolean
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
const props = withDefaults(defineProps<{
|
|
82
|
+
label?: string
|
|
83
|
+
data: IItem[]
|
|
84
|
+
center?: boolean
|
|
85
|
+
modelValue: IItem | null
|
|
86
|
+
disabled?: boolean
|
|
87
|
+
isDarkMode?: boolean
|
|
88
|
+
labelledBy?: string | false
|
|
89
|
+
}>(), {
|
|
90
|
+
label: '',
|
|
91
|
+
isDarkMode: false,
|
|
92
|
+
labelledBy: false,
|
|
88
93
|
})
|
|
89
|
-
export default class Radio extends Vue {
|
|
90
|
-
@Prop() label?: string
|
|
91
|
-
@Prop() data!: IItem[]
|
|
92
|
-
@Prop() center?: boolean
|
|
93
|
-
@Prop() modelValue!: IItem
|
|
94
|
-
@Prop() disabled?: boolean
|
|
95
|
-
@Prop({ default: false }) isDarkMode!: boolean
|
|
96
|
-
@Prop({ default: false }) labelledBy!: string | false
|
|
97
|
-
|
|
98
|
-
uid = Math.floor(Math.random() * 1e9)
|
|
99
|
-
hover = false
|
|
100
|
-
focus = false
|
|
101
94
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
95
|
+
const emit = defineEmits<{
|
|
96
|
+
'update:modelValue': [ item: IItem ]
|
|
97
|
+
}>()
|
|
106
98
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
99
|
+
const uid = Math.floor(Math.random() * 1e9)
|
|
100
|
+
const hover = ref(false)
|
|
101
|
+
|
|
102
|
+
const selectItem = (item: IItem) => {
|
|
103
|
+
emit('update:modelValue', item)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const keyPressedItem = (e: KeyboardEvent) => {
|
|
107
|
+
// select option on enter or space
|
|
108
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
109
|
+
e.preventDefault()
|
|
110
|
+
const itemValue = (e.target as HTMLElement).getAttribute('data-value')
|
|
111
|
+
const item = props.data.find(i => String(i.value) === itemValue)
|
|
112
|
+
item && selectItem(item)
|
|
115
113
|
}
|
|
116
114
|
}
|
|
117
115
|
</script>
|
|
118
116
|
|
|
119
117
|
<style lang="scss">
|
|
120
|
-
@
|
|
121
|
-
@
|
|
118
|
+
@use '@/styles/breakpoints' as *;
|
|
119
|
+
@use '@/styles/colors' as *;
|
|
122
120
|
|
|
123
121
|
.uikit-radio {
|
|
124
122
|
&__label {
|
|
@@ -163,6 +163,7 @@ interface IItem {
|
|
|
163
163
|
* @see [Designs for Inputs](https://marvelapp.com/adf8ab3/screen/70331421)
|
|
164
164
|
*/
|
|
165
165
|
@Component({
|
|
166
|
+
name: 'PocketSelect',
|
|
166
167
|
components: {
|
|
167
168
|
Icon,
|
|
168
169
|
},
|
|
@@ -447,8 +448,8 @@ export default class Select extends Vue {
|
|
|
447
448
|
</script>
|
|
448
449
|
|
|
449
450
|
<style lang="scss">
|
|
450
|
-
@
|
|
451
|
-
@
|
|
451
|
+
@use '@/styles/breakpoints' as *;
|
|
452
|
+
@use '@/styles/colors' as *;
|
|
452
453
|
|
|
453
454
|
.uikit-select {
|
|
454
455
|
position: relative;
|
|
@@ -595,13 +596,13 @@ export default class Select extends Vue {
|
|
|
595
596
|
margin: 4px 0 0 0;
|
|
596
597
|
|
|
597
598
|
&--dark {
|
|
598
|
-
&--hover {
|
|
599
|
-
background-color: $charcoal;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
599
|
border-color: $pewter;
|
|
603
600
|
color: $fog;
|
|
604
601
|
caret-color: $banana-bread;
|
|
602
|
+
|
|
603
|
+
&--hover {
|
|
604
|
+
background-color: $charcoal;
|
|
605
|
+
}
|
|
605
606
|
}
|
|
606
607
|
}
|
|
607
608
|
|
|
@@ -100,8 +100,8 @@ export default class Textarea extends Vue {
|
|
|
100
100
|
</script>
|
|
101
101
|
|
|
102
102
|
<style lang="scss">
|
|
103
|
-
@
|
|
104
|
-
@
|
|
103
|
+
@use '@/styles/breakpoints' as *;
|
|
104
|
+
@use '@/styles/colors' as *;
|
|
105
105
|
|
|
106
106
|
.uikit-textarea {
|
|
107
107
|
&__container {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- eslint-disable -->
|
|
3
3
|
<svg width="28px" height="20px" viewBox="0 0 28 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
4
|
-
<title>
|
|
4
|
+
<title>{{ title }}</title>
|
|
5
5
|
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
6
6
|
<g transform="translate(-50.000000, -9.000000)">
|
|
7
7
|
<g transform="translate(52.000000, 10.500000)">
|
|
@@ -15,7 +15,7 @@ export default class IconLoading2 extends Vue {
|
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
17
|
<style lang="scss">
|
|
18
|
-
@
|
|
18
|
+
@use '@/styles/colors' as *;
|
|
19
19
|
|
|
20
20
|
.uikit-loading {
|
|
21
21
|
height: 100%;
|
|
@@ -40,12 +40,10 @@ export default class IconLoading2 extends Vue {
|
|
|
40
40
|
|
|
41
41
|
@keyframes spin {
|
|
42
42
|
from {
|
|
43
|
-
-webkit-transform: rotate(0deg);
|
|
44
43
|
transform: rotate(0deg);
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
to {
|
|
48
|
-
-webkit-transform: rotate(359deg);
|
|
49
47
|
transform: rotate(359deg);
|
|
50
48
|
}
|
|
51
49
|
}
|
|
@@ -12,8 +12,8 @@ export default class SkeletonLoader extends Vue {}
|
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<style lang="scss" scoped>
|
|
15
|
-
@
|
|
16
|
-
@
|
|
15
|
+
@use '@/styles/breakpoints' as *;
|
|
16
|
+
@use '@/styles/colors' as *;
|
|
17
17
|
|
|
18
18
|
.uikit-skeleton-loader {
|
|
19
19
|
// Using width and height of parent
|
|
@@ -51,8 +51,8 @@ export default class Modal extends Vue {
|
|
|
51
51
|
</script>
|
|
52
52
|
|
|
53
53
|
<style lang="scss">
|
|
54
|
-
@
|
|
55
|
-
@
|
|
54
|
+
@use '@/styles/breakpoints' as *;
|
|
55
|
+
@use '@/styles/colors' as *;
|
|
56
56
|
|
|
57
57
|
.uikit-modal {
|
|
58
58
|
border-radius: 12px;
|
|
@@ -163,8 +163,8 @@ export default class ModalContainer extends Vue {
|
|
|
163
163
|
</script>
|
|
164
164
|
|
|
165
165
|
<style lang="scss">
|
|
166
|
-
@
|
|
167
|
-
@
|
|
166
|
+
@use '@/styles/breakpoints' as *;
|
|
167
|
+
@use '@/styles/colors' as *;
|
|
168
168
|
|
|
169
169
|
.uikit-modal-container {
|
|
170
170
|
position: absolute;
|
|
@@ -84,7 +84,7 @@ export default class EmailAuth extends Vue {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
submitSignIn () {
|
|
88
88
|
this.isLoading = true
|
|
89
89
|
this.errorMessage = ''
|
|
90
90
|
|
|
@@ -99,7 +99,7 @@ export default class EmailAuth extends Vue {
|
|
|
99
99
|
this.isLoading = false
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
resendEmail () {
|
|
103
103
|
this.errorMessage = ''
|
|
104
104
|
this.isResending = true
|
|
105
105
|
this.emitResend({ email: this.email })
|
|
@@ -107,7 +107,7 @@ export default class EmailAuth extends Vue {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
@Emit('submit')
|
|
110
|
-
emitSubmit (results: { email: string; code: string}) {
|
|
110
|
+
emitSubmit (results: { email: string; code: string }) {
|
|
111
111
|
return results
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -124,8 +124,8 @@ export default class EmailAuth extends Vue {
|
|
|
124
124
|
</script>
|
|
125
125
|
|
|
126
126
|
<style lang="scss">
|
|
127
|
-
@
|
|
128
|
-
@
|
|
127
|
+
@use '@/styles/breakpoints' as *;
|
|
128
|
+
@use '@/styles/colors' as *;
|
|
129
129
|
|
|
130
130
|
.uikit-email-auth {
|
|
131
131
|
&__form {
|
|
@@ -42,8 +42,8 @@ export default class MagicCodeEntry extends Vue {
|
|
|
42
42
|
mounted () {
|
|
43
43
|
// Ensure proper letter spacing for magic code in case of a11y browser extension overrides
|
|
44
44
|
setTimeout(() => {
|
|
45
|
-
const codeInputEl = document.querySelector('.uikit-magic-code__code-input')
|
|
46
|
-
if (codeInputEl) {
|
|
45
|
+
const codeInputEl = document.querySelector('.uikit-magic-code__code-input')
|
|
46
|
+
if (codeInputEl instanceof HTMLElement) {
|
|
47
47
|
codeInputEl.style.letterSpacing = '35.5px'
|
|
48
48
|
}
|
|
49
49
|
}, 500)
|
|
@@ -127,7 +127,7 @@ export default class MagicCodeEntry extends Vue {
|
|
|
127
127
|
</script>
|
|
128
128
|
|
|
129
129
|
<style lang="scss">
|
|
130
|
-
@
|
|
130
|
+
@use '@/styles/colors' as *;
|
|
131
131
|
|
|
132
132
|
.uikit-magic-code {
|
|
133
133
|
position: relative;
|
|
@@ -184,7 +184,6 @@ export default class MagicCodeEntry extends Vue {
|
|
|
184
184
|
appearance: none;
|
|
185
185
|
|
|
186
186
|
&::selection {
|
|
187
|
-
color: none;
|
|
188
187
|
background: none;
|
|
189
188
|
}
|
|
190
189
|
}
|
|
@@ -45,8 +45,8 @@ import { computed } from 'vue'
|
|
|
45
45
|
import Icon from '../Icons/Icon.vue'
|
|
46
46
|
|
|
47
47
|
const props = withDefaults(defineProps<{
|
|
48
|
-
currentPage
|
|
49
|
-
total
|
|
48
|
+
currentPage?: number
|
|
49
|
+
total?: number
|
|
50
50
|
}>(), {
|
|
51
51
|
currentPage: 0,
|
|
52
52
|
total: 0,
|
|
@@ -71,8 +71,8 @@ const changePage = (direction: 'next' | 'previous') => {
|
|
|
71
71
|
</script>
|
|
72
72
|
|
|
73
73
|
<style lang="scss" scoped>
|
|
74
|
-
@
|
|
75
|
-
@
|
|
74
|
+
@use '@/styles/breakpoints' as *;
|
|
75
|
+
@use '@/styles/colors' as *;
|
|
76
76
|
|
|
77
77
|
.uikit-question-review-pagination {
|
|
78
78
|
display: flex;
|
|
@@ -121,8 +121,8 @@ export default class TablePagination extends Vue {
|
|
|
121
121
|
</script>
|
|
122
122
|
|
|
123
123
|
<style lang="scss" scoped>
|
|
124
|
-
@
|
|
125
|
-
@
|
|
124
|
+
@use '@/styles/breakpoints' as *;
|
|
125
|
+
@use '@/styles/colors' as *;
|
|
126
126
|
|
|
127
127
|
.uikit-table-pagination {
|
|
128
128
|
display: flex;
|
|
@@ -93,8 +93,8 @@ export default class FlagToggle extends Vue {
|
|
|
93
93
|
</script>
|
|
94
94
|
|
|
95
95
|
<style lang="scss">
|
|
96
|
-
@
|
|
97
|
-
@
|
|
96
|
+
@use '@/styles/breakpoints' as *;
|
|
97
|
+
@use '@/styles/colors' as *;
|
|
98
98
|
|
|
99
99
|
.uikit-flag-toggle {
|
|
100
100
|
position: relative;
|
|
@@ -47,6 +47,7 @@ import Icon from '../Icons/Icon.vue'
|
|
|
47
47
|
import BrandColors from '../../pocketprep-export.module.scss'
|
|
48
48
|
|
|
49
49
|
@Component({
|
|
50
|
+
name: 'GlobalMetricsToggle',
|
|
50
51
|
components: {
|
|
51
52
|
Tooltip,
|
|
52
53
|
Icon,
|
|
@@ -74,8 +75,8 @@ export default class GlobalMetricsToggle extends Vue {
|
|
|
74
75
|
</script>
|
|
75
76
|
|
|
76
77
|
<style lang="scss">
|
|
77
|
-
@
|
|
78
|
-
@
|
|
78
|
+
@use '@/styles/breakpoints' as *;
|
|
79
|
+
@use '@/styles/colors' as *;
|
|
79
80
|
|
|
80
81
|
.uikit-global-metrics-toggle {
|
|
81
82
|
position: relative;
|
|
@@ -377,8 +377,9 @@ const handleClick = (event: MouseEvent) => {
|
|
|
377
377
|
</script>
|
|
378
378
|
|
|
379
379
|
<style lang="scss">
|
|
380
|
-
@
|
|
381
|
-
@
|
|
380
|
+
@use 'sass:color';
|
|
381
|
+
@use '@/styles/breakpoints' as *;
|
|
382
|
+
@use '@/styles/colors' as *;
|
|
382
383
|
|
|
383
384
|
.uikit-question-choices-container {
|
|
384
385
|
display: contents;
|
|
@@ -814,7 +815,7 @@ const handleClick = (event: MouseEvent) => {
|
|
|
814
815
|
color: $white;
|
|
815
816
|
|
|
816
817
|
&:hover {
|
|
817
|
-
background-color: mix($brand-blue, black, 90%);
|
|
818
|
+
background-color: color.mix($brand-blue, black, 90%);
|
|
818
819
|
}
|
|
819
820
|
|
|
820
821
|
&:focus {
|
|
@@ -113,8 +113,8 @@ const toggleDropdownExplanationImageLongAlt = () => {
|
|
|
113
113
|
</script>
|
|
114
114
|
|
|
115
115
|
<style lang="scss">
|
|
116
|
-
@
|
|
117
|
-
@
|
|
116
|
+
@use '@/styles/breakpoints' as *;
|
|
117
|
+
@use '@/styles/colors' as *;
|
|
118
118
|
|
|
119
119
|
.uikit-question-dropdown-explanation {
|
|
120
120
|
&__dropdown-explanation {
|
|
@@ -138,8 +138,8 @@ const toggleExplanation = () => {
|
|
|
138
138
|
</script>
|
|
139
139
|
|
|
140
140
|
<style lang="scss">
|
|
141
|
-
@
|
|
142
|
-
@
|
|
141
|
+
@use '@/styles/breakpoints' as *;
|
|
142
|
+
@use '@/styles/colors' as *;
|
|
143
143
|
|
|
144
144
|
.uikit-question-explanation {
|
|
145
145
|
position: relative;
|
|
@@ -204,7 +204,6 @@ const emit = defineEmits<{
|
|
|
204
204
|
|
|
205
205
|
const {
|
|
206
206
|
// questionEl is used by the breakpoint directive
|
|
207
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
208
207
|
questionEl,
|
|
209
208
|
question,
|
|
210
209
|
isMatrixQuestionCorrect,
|
|
@@ -272,7 +271,7 @@ const convertSelectedMatrixChoiceToCheckboxGrid = () => {
|
|
|
272
271
|
selectedMatrixChoices.value.forEach(choice => {
|
|
273
272
|
const rowIndex = Number(choice.substring(1, choice.indexOf('_'))) - 1
|
|
274
273
|
const colIndex = Number(choice.split('_').pop()) - 1
|
|
275
|
-
const row = checkboxGrid
|
|
274
|
+
const row = checkboxGrid?.[rowIndex]
|
|
276
275
|
if (row) {
|
|
277
276
|
row[colIndex] = true
|
|
278
277
|
}
|
|
@@ -284,7 +283,7 @@ const convertSelectedMatrixChoiceToRadioBtnGrid = () => {
|
|
|
284
283
|
const radioBtnGrid = defaultRadioButtonGrid.value
|
|
285
284
|
selectedMatrixChoices.value.forEach(choice => {
|
|
286
285
|
const rowIndex = Number(choice.substring(1, choice.indexOf('_'))) - 1
|
|
287
|
-
const row = radioBtnGrid
|
|
286
|
+
const row = radioBtnGrid?.[rowIndex]
|
|
288
287
|
if (row) {
|
|
289
288
|
row.value = choice
|
|
290
289
|
}
|
|
@@ -334,7 +333,7 @@ const correctlySelectedChoice = (rowIndex: number, colIndex: number) => {
|
|
|
334
333
|
const incorrectlySelectedChoice = (rowIndex: number, colIndex: number) => {
|
|
335
334
|
if (selectedMatrixChoices.value && matrixAnswerKeys.value) {
|
|
336
335
|
const selectedChoice = selectedChoiceKey(rowIndex, colIndex)
|
|
337
|
-
if (selectedChoice
|
|
336
|
+
if (selectedChoice?.startsWith('d')) {
|
|
338
337
|
return true
|
|
339
338
|
}
|
|
340
339
|
}
|
|
@@ -348,11 +347,11 @@ const correctAnswerButNotSelected = (rowIndex: number, colIndex: number) => {
|
|
|
348
347
|
}
|
|
349
348
|
|
|
350
349
|
const checkboxContainerStyling = (rowIndex: number, columnIndex: number) => {
|
|
351
|
-
const isReviewMode = showMatrixAnswers.value || reviewMode
|
|
350
|
+
const isReviewMode = showMatrixAnswers.value || reviewMode.value
|
|
352
351
|
|
|
353
352
|
// check box is correctlySelected
|
|
354
353
|
if (isReviewMode && correctlySelectedChoice(rowIndex, columnIndex)) {
|
|
355
|
-
const borderColor = isDarkMode ? brandColors.jungleGreen : brandColors.cadaverous
|
|
354
|
+
const borderColor = isDarkMode.value ? brandColors.jungleGreen : brandColors.cadaverous
|
|
356
355
|
return {
|
|
357
356
|
borderColor: `${borderColor} !important`,
|
|
358
357
|
background: `${borderColor} !important`,
|
|
@@ -375,9 +374,9 @@ const checkboxContainerStyling = (rowIndex: number, columnIndex: number) => {
|
|
|
375
374
|
}
|
|
376
375
|
|
|
377
376
|
const checkboxCheckStyling = (rowIndex: number, columnIndex: number) => {
|
|
378
|
-
const isReviewMode = showMatrixAnswers.value || reviewMode
|
|
377
|
+
const isReviewMode = showMatrixAnswers.value || reviewMode.value
|
|
379
378
|
if (isReviewMode && correctAnswerButNotSelected(rowIndex, columnIndex)) {
|
|
380
|
-
const color = isDarkMode ? brandColors.jungleGreen : brandColors.cadaverous
|
|
379
|
+
const color = isDarkMode.value ? brandColors.jungleGreen : brandColors.cadaverous
|
|
381
380
|
return {
|
|
382
381
|
color: `${color} !important`,
|
|
383
382
|
}
|
|
@@ -401,11 +400,7 @@ watch(matrixCheckboxGrid, () => {
|
|
|
401
400
|
|
|
402
401
|
matrixCheckboxGrid.value?.forEach((row, rowIndex) => {
|
|
403
402
|
row.forEach((choice, choiceIndex) => {
|
|
404
|
-
if (
|
|
405
|
-
choice &&
|
|
406
|
-
matrixChoiceLayout.value?.[rowIndex] &&
|
|
407
|
-
matrixChoiceLayout.value?.[rowIndex]?.[choiceIndex]
|
|
408
|
-
) {
|
|
403
|
+
if (choice && matrixChoiceLayout?.value?.[rowIndex]?.[choiceIndex]) {
|
|
409
404
|
const choiceKey = matrixChoiceLayout.value?.[rowIndex]?.[choiceIndex] as TMatrixChoiceKey | null
|
|
410
405
|
if (choiceKey) {
|
|
411
406
|
selectedCheckboxChoices.push(choiceKey)
|
|
@@ -432,12 +427,12 @@ watch(matrixRadioGrid, () => {
|
|
|
432
427
|
}, { deep: true })
|
|
433
428
|
|
|
434
429
|
watch(selectedMatrixChoices, () => {
|
|
435
|
-
if ((reviewMode || showMatrixAnswers.value) && question.value.type === 'Matrix Checkbox') {
|
|
430
|
+
if ((reviewMode.value || showMatrixAnswers.value) && question.value.type === 'Matrix Checkbox') {
|
|
436
431
|
const selectedCheckboxGrid = convertSelectedMatrixChoiceToCheckboxGrid()
|
|
437
432
|
matrixCheckboxGrid.value = selectedCheckboxGrid ? selectedCheckboxGrid : defaultCheckboxGrid.value
|
|
438
433
|
}
|
|
439
434
|
|
|
440
|
-
if ((reviewMode || showMatrixAnswers.value) && question.value.type === 'Matrix Radio Button') {
|
|
435
|
+
if ((reviewMode.value || showMatrixAnswers.value) && question.value.type === 'Matrix Radio Button') {
|
|
441
436
|
const selectedRadioBtnGrid = convertSelectedMatrixChoiceToRadioBtnGrid()
|
|
442
437
|
matrixRadioGrid.value = selectedRadioBtnGrid
|
|
443
438
|
}
|
|
@@ -446,8 +441,8 @@ watch(selectedMatrixChoices, () => {
|
|
|
446
441
|
</script>
|
|
447
442
|
|
|
448
443
|
<style lang="scss">
|
|
449
|
-
@
|
|
450
|
-
@
|
|
444
|
+
@use '@/styles/breakpoints' as *;
|
|
445
|
+
@use '@/styles/colors' as *;
|
|
451
446
|
|
|
452
447
|
.uikit-question-matrix-choices-container {
|
|
453
448
|
width: 100%;
|
|
@@ -74,8 +74,8 @@ const selectChoice = (choiceKey: TMatrixChoiceKey) => {
|
|
|
74
74
|
</template>
|
|
75
75
|
|
|
76
76
|
<style lang="scss" scoped>
|
|
77
|
-
@
|
|
78
|
-
@
|
|
77
|
+
@use '@/styles/breakpoints' as *;
|
|
78
|
+
@use '@/styles/colors' as *;
|
|
79
79
|
|
|
80
80
|
.uikit-matrix-radio-group {
|
|
81
81
|
display: flex;
|