@pocketprep/ui-kit 3.8.4 → 3.9.0
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/dist/@pocketprep/ui-kit.css +1 -1
- package/dist/@pocketprep/ui-kit.js +14469 -17731
- package/dist/@pocketprep/ui-kit.js.map +1 -1
- package/dist/@pocketprep/ui-kit.umd.cjs +19 -29
- package/dist/@pocketprep/ui-kit.umd.cjs.map +1 -1
- package/eslint.config.ts +38 -11
- package/lib/SVGDefinitions.vue +32 -35
- package/lib/components/Banners/Banner.vue +10 -14
- package/lib/components/Blobs/Blob.vue +6 -14
- package/lib/components/Blobs/BlobEmptyState.vue +9 -8
- package/lib/components/Blobs/blob.d.ts +1 -1
- package/lib/components/BundleIcons/BundleIcon.vue +36 -63
- package/lib/components/BundleIcons/bundleIcon.d.ts +1 -1
- package/lib/components/Bundles/BundleList.vue +71 -59
- package/lib/components/Bundles/BundleSearch.vue +93 -117
- package/lib/components/Bundles/PremiumPill.vue +6 -12
- package/lib/components/Buttons/Button.vue +32 -35
- package/lib/components/Buttons/Link.vue +32 -31
- package/lib/components/Buttons/Tab.vue +14 -17
- package/lib/components/Calendar/Calendar.vue +87 -85
- package/lib/components/Charts/Bar.vue +192 -263
- package/lib/components/Charts/Pie.vue +55 -61
- package/lib/components/Charts/highcharts-wrap.ts +81 -0
- package/lib/components/Controls/SegmentControl.vue +26 -24
- package/lib/components/Controls/Slider.vue +51 -47
- package/lib/components/Controls/ToggleSwitch.vue +33 -31
- package/lib/components/EmptyStates/EmptyState.vue +69 -73
- package/lib/components/Exams/ExamCard.vue +59 -47
- package/lib/components/Exams/ExamMenuCard.vue +30 -28
- package/lib/components/Filters/FilterDropdown.vue +83 -86
- package/lib/components/Filters/FilterOptions.vue +83 -88
- package/lib/components/Forms/Checkbox.vue +27 -27
- package/lib/components/Forms/CheckboxOption.vue +30 -30
- package/lib/components/Forms/Errors.vue +21 -24
- package/lib/components/Forms/Input.vue +71 -59
- package/lib/components/Forms/Radio.vue +2 -2
- package/lib/components/Forms/RadioButton.vue +8 -8
- package/lib/components/Forms/Select.vue +265 -257
- package/lib/components/Forms/Textarea.vue +49 -35
- package/lib/components/Icons/IconAccordionArrow.vue +7 -9
- package/lib/components/Icons/IconActivity.vue +7 -9
- package/lib/components/Icons/IconAdd.vue +7 -11
- package/lib/components/Icons/IconAddCircle.vue +7 -9
- package/lib/components/Icons/IconArrow.vue +7 -9
- package/lib/components/Icons/IconBarChart.vue +7 -9
- package/lib/components/Icons/IconCalendar.vue +7 -9
- package/lib/components/Icons/IconCalendarPicker.vue +7 -9
- package/lib/components/Icons/IconChat.vue +7 -9
- package/lib/components/Icons/IconCheck.vue +7 -9
- package/lib/components/Icons/IconClose.vue +7 -9
- package/lib/components/Icons/IconConcept.vue +1 -1
- package/lib/components/Icons/IconCorrect.vue +7 -9
- package/lib/components/Icons/IconEdit.vue +7 -11
- package/lib/components/Icons/IconExam.vue +7 -9
- package/lib/components/Icons/IconExternalLink.vue +7 -9
- package/lib/components/Icons/IconEyeHide.vue +7 -9
- package/lib/components/Icons/IconEyeShow.vue +7 -9
- package/lib/components/Icons/IconFilter.vue +7 -9
- package/lib/components/Icons/IconFilterActive.vue +7 -9
- package/lib/components/Icons/IconFlag.vue +7 -9
- package/lib/components/Icons/IconFlagContent.vue +8 -9
- package/lib/components/Icons/IconFlagFeedback.vue +8 -10
- package/lib/components/Icons/IconFlagFilled.vue +7 -9
- package/lib/components/Icons/IconFullView.vue +7 -9
- package/lib/components/Icons/IconFullViewActive.vue +7 -9
- package/lib/components/Icons/IconGridDrag.vue +2 -2
- package/lib/components/Icons/IconHandle.vue +7 -9
- package/lib/components/Icons/IconHeart.vue +7 -9
- package/lib/components/Icons/IconHelp.vue +7 -9
- package/lib/components/Icons/IconHighlight.vue +2 -2
- package/lib/components/Icons/IconHourglass.vue +7 -9
- package/lib/components/Icons/IconImage.vue +7 -9
- package/lib/components/Icons/IconIncorrect.vue +7 -9
- package/lib/components/Icons/IconInfo.vue +7 -9
- package/lib/components/Icons/IconKeyboard.vue +7 -9
- package/lib/components/Icons/IconLaunch.vue +7 -9
- package/lib/components/Icons/IconLevelUp.vue +7 -9
- package/lib/components/Icons/IconLightbulb.vue +7 -9
- package/lib/components/Icons/IconLightning.vue +7 -9
- package/lib/components/Icons/IconLink.vue +7 -9
- package/lib/components/Icons/IconList.vue +7 -9
- package/lib/components/Icons/IconLoading.vue +7 -9
- package/lib/components/Icons/IconLoading2.vue +11 -11
- package/lib/components/Icons/IconLock.vue +7 -9
- package/lib/components/Icons/IconMissedQuestions.vue +7 -9
- package/lib/components/Icons/IconMoon.vue +7 -9
- package/lib/components/Icons/IconPaginationArrow.vue +7 -9
- package/lib/components/Icons/IconPaginationArrowDouble.vue +7 -9
- package/lib/components/Icons/IconPassage.vue +7 -9
- package/lib/components/Icons/IconPencil.vue +7 -9
- package/lib/components/Icons/IconPeople.vue +7 -9
- package/lib/components/Icons/IconPercent.vue +7 -9
- package/lib/components/Icons/IconPerson.vue +8 -9
- package/lib/components/Icons/IconPresent.vue +7 -9
- package/lib/components/Icons/IconPreview.vue +7 -9
- package/lib/components/Icons/IconQuestions.vue +7 -9
- package/lib/components/Icons/IconQuick10.vue +7 -9
- package/lib/components/Icons/IconQuickActions.vue +2 -2
- package/lib/components/Icons/IconRecommendedFilter.vue +1 -1
- package/lib/components/Icons/IconRemoveCircle.vue +7 -9
- package/lib/components/Icons/IconReviewFlag.vue +7 -9
- package/lib/components/Icons/IconSearch.vue +7 -9
- package/lib/components/Icons/IconShare.vue +7 -9
- package/lib/components/Icons/IconSideBar.vue +7 -9
- package/lib/components/Icons/IconSideBarActive.vue +7 -9
- package/lib/components/Icons/IconStar.vue +1 -1
- package/lib/components/Icons/IconStopwatch.vue +7 -9
- package/lib/components/Icons/IconStrike.vue +7 -9
- package/lib/components/Icons/IconSubject.vue +7 -9
- package/lib/components/Icons/IconText.vue +7 -9
- package/lib/components/Icons/IconTimer.vue +8 -9
- package/lib/components/Icons/IconWarning.vue +7 -9
- package/lib/components/Icons/icon.d.ts +1 -1
- package/lib/components/Loaders/SkeletonLoader.vue +1 -5
- package/lib/components/Modal/Modal.vue +23 -29
- package/lib/components/Modal/ModalContainer.vue +135 -133
- package/lib/components/Onboarding/EmailAuth.vue +66 -70
- package/lib/components/Onboarding/MagicCodeEntry.vue +88 -83
- package/lib/components/Pagination/QuestionReviewPagination.vue +3 -3
- package/lib/components/Pagination/TablePagination.vue +47 -44
- package/lib/components/PhonePerson/PhonePerson.vue +18 -18
- package/lib/components/PhonePerson/phonePerson.d.ts +1 -1
- package/lib/components/Quiz/FlagToggle.vue +45 -44
- package/lib/components/Quiz/GlobalMetricsToggle.vue +29 -28
- package/lib/components/Quiz/KeyboardShortcutsButton.vue +16 -23
- package/lib/components/Quiz/KeyboardShortcutsModal.vue +36 -37
- package/lib/components/Quiz/Question/BuildListChoicesContainer.vue +65 -65
- package/lib/components/Quiz/Question/ChoicesContainer.vue +5 -5
- package/lib/components/Quiz/Question/DropdownExplanation.vue +5 -5
- package/lib/components/Quiz/Question/Explanation.vue +6 -6
- package/lib/components/Quiz/Question/MPMCChoicesContainer.vue +17 -17
- package/lib/components/Quiz/Question/MPMCRadioGroup.vue +2 -2
- package/lib/components/Quiz/Question/MatrixChoicesContainer.vue +39 -39
- package/lib/components/Quiz/Question/MatrixRadioGroup.vue +6 -6
- package/lib/components/Quiz/Question/MobileMatrixChoicesContainer.vue +27 -28
- package/lib/components/Quiz/Question/MobileMatrixRadioGroup.vue +2 -2
- package/lib/components/Quiz/Question/PassageAndImage.vue +3 -3
- package/lib/components/Quiz/Question/PassageAndImageDropdown.vue +7 -7
- package/lib/components/Quiz/Question/Paywall.vue +2 -2
- package/lib/components/Quiz/Question/QuestionContext.vue +1 -1
- package/lib/components/Quiz/Question/StatsSummary.vue +2 -2
- package/lib/components/Quiz/Question/Summary.vue +11 -11
- package/lib/components/Quiz/Question.vue +90 -82
- package/lib/components/Quiz/QuizContainer.vue +1 -1
- package/lib/components/Quiz/QuizProgressBar.vue +23 -23
- package/lib/components/Quiz/question.d.ts +3 -3
- package/lib/components/Search/Pill.vue +16 -19
- package/lib/components/Search/Search.vue +52 -47
- package/lib/components/SidePanels/SidePanel.vue +168 -174
- package/lib/components/Tables/Table.vue +135 -122
- package/lib/components/Tables/TableActions.vue +81 -76
- package/lib/components/Tables/table.d.ts +1 -1
- package/lib/components/Tags/Tag.vue +49 -39
- package/lib/components/Toasts/Toast.vue +44 -42
- package/lib/components/Tooltips/OverflowTooltip.vue +39 -45
- package/lib/components/Tooltips/Tooltip.vue +69 -70
- package/lib/directives.ts +4 -4
- package/lib/utils.ts +13 -12
- package/package.json +27 -28
|
@@ -28,101 +28,106 @@
|
|
|
28
28
|
</div>
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
|
-
<script lang="ts">
|
|
32
|
-
import {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// Allow tab, refresh, and paste events to pass through, otherwise prevent default keydown behavior
|
|
58
|
-
if (
|
|
59
|
-
!event.metaKey
|
|
60
|
-
&& (
|
|
61
|
-
event.key.match(/^[0-9]$/)
|
|
62
|
-
|| event.key === 'ArrowLeft'
|
|
63
|
-
|| event.key === 'ArrowRight'
|
|
64
|
-
|| event.key === 'Backspace'
|
|
65
|
-
|| event.key === 'Enter'
|
|
66
|
-
)
|
|
67
|
-
) {
|
|
68
|
-
event.preventDefault()
|
|
31
|
+
<script setup lang="ts">
|
|
32
|
+
import { onMounted, ref } from 'vue'
|
|
33
|
+
|
|
34
|
+
const {
|
|
35
|
+
error = false,
|
|
36
|
+
modelValue = '',
|
|
37
|
+
} = defineProps<{
|
|
38
|
+
error?: boolean
|
|
39
|
+
modelValue?: string
|
|
40
|
+
}>()
|
|
41
|
+
|
|
42
|
+
const emit = defineEmits<{
|
|
43
|
+
'submit': []
|
|
44
|
+
'error': [errorMessage: string]
|
|
45
|
+
'update:modelValue': [code: string]
|
|
46
|
+
}>()
|
|
47
|
+
|
|
48
|
+
const highlightInput = ref(false)
|
|
49
|
+
const cursorIndex = ref(0)
|
|
50
|
+
|
|
51
|
+
onMounted(() => {
|
|
52
|
+
// Ensure proper letter spacing for magic code in case of a11y browser extension overrides
|
|
53
|
+
setTimeout(() => {
|
|
54
|
+
const codeInputEl = document.querySelector('.uikit-magic-code__code-input')
|
|
55
|
+
if (codeInputEl instanceof HTMLElement) {
|
|
56
|
+
codeInputEl.style.letterSpacing = '35.5px'
|
|
69
57
|
}
|
|
58
|
+
}, 500)
|
|
59
|
+
})
|
|
70
60
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
this.emitUpdateModelValue(code)
|
|
75
|
-
this.cursorIndex = Math.min(this.cursorIndex + 1, 5)
|
|
76
|
-
} else if (event.key === 'ArrowLeft') {
|
|
77
|
-
this.cursorIndex = Math.max(this.cursorIndex - 1, 0)
|
|
78
|
-
} else if (event.key === 'ArrowRight') {
|
|
79
|
-
this.cursorIndex = Math.min(this.cursorIndex + 1, 5)
|
|
80
|
-
} else if (event.key === 'Backspace') {
|
|
81
|
-
if (this.modelValue[this.cursorIndex]) {
|
|
82
|
-
const code = (
|
|
83
|
-
this.modelValue.slice(0, this.cursorIndex) + ' ' + this.modelValue.slice(this.cursorIndex + 1)
|
|
84
|
-
).trimEnd()
|
|
85
|
-
this.emitUpdateModelValue(code)
|
|
86
|
-
}
|
|
87
|
-
this.cursorIndex = Math.min(Math.max(this.cursorIndex - 1, 0), this.modelValue.length)
|
|
88
|
-
} else if (event.key === 'Enter') {
|
|
89
|
-
this.emitSubmit()
|
|
90
|
-
}
|
|
61
|
+
const handleKeyDown = (event: Event | KeyboardEvent) => {
|
|
62
|
+
if (!('key' in event)) {
|
|
63
|
+
return
|
|
91
64
|
}
|
|
92
65
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
66
|
+
// Allow tab, refresh, and paste events to pass through, otherwise prevent default keydown behavior
|
|
67
|
+
if (
|
|
68
|
+
!event.metaKey
|
|
69
|
+
&& (
|
|
70
|
+
event.key.match(/^[0-9]$/)
|
|
71
|
+
|| event.key === 'ArrowLeft'
|
|
72
|
+
|| event.key === 'ArrowRight'
|
|
73
|
+
|| event.key === 'Backspace'
|
|
74
|
+
|| event.key === 'Enter'
|
|
75
|
+
)
|
|
76
|
+
) {
|
|
77
|
+
event.preventDefault()
|
|
98
78
|
}
|
|
99
79
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
80
|
+
if (event.key.match(/[0-9]/)) {
|
|
81
|
+
const code = modelValue.slice(0, cursorIndex.value)
|
|
82
|
+
+ event.key + modelValue.slice(cursorIndex.value + 1)
|
|
83
|
+
emitUpdateModelValue(code)
|
|
84
|
+
cursorIndex.value = Math.min(cursorIndex.value + 1, 5)
|
|
85
|
+
} else if (event.key === 'ArrowLeft') {
|
|
86
|
+
cursorIndex.value = Math.max(cursorIndex.value - 1, 0)
|
|
87
|
+
} else if (event.key === 'ArrowRight') {
|
|
88
|
+
cursorIndex.value = Math.min(cursorIndex.value + 1, 5)
|
|
89
|
+
} else if (event.key === 'Backspace') {
|
|
90
|
+
if (modelValue[cursorIndex.value]) {
|
|
91
|
+
const code = (
|
|
92
|
+
modelValue.slice(0, cursorIndex.value) + ' ' + modelValue.slice(cursorIndex.value + 1)
|
|
93
|
+
).trimEnd()
|
|
94
|
+
emitUpdateModelValue(code)
|
|
109
95
|
}
|
|
96
|
+
cursorIndex.value = Math.min(Math.max(cursorIndex.value - 1, 0), modelValue.length)
|
|
97
|
+
} else if (event.key === 'Enter') {
|
|
98
|
+
emitSubmit()
|
|
110
99
|
}
|
|
100
|
+
}
|
|
111
101
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
102
|
+
const handleClick = (event: MouseEvent) => {
|
|
103
|
+
const selectionEnd = (event.target as HTMLInputElement)?.selectionEnd
|
|
104
|
+
if (selectionEnd !== null) {
|
|
105
|
+
cursorIndex.value = selectionEnd
|
|
115
106
|
}
|
|
107
|
+
}
|
|
116
108
|
|
|
117
|
-
|
|
118
|
-
emitError
|
|
119
|
-
|
|
109
|
+
const handlePaste = (event: ClipboardEvent) => {
|
|
110
|
+
emitError('')
|
|
111
|
+
const pasteValue = event.clipboardData?.getData('text')
|
|
112
|
+
if (pasteValue && typeof Number(pasteValue) === 'number' && pasteValue.length === 6) {
|
|
113
|
+
emitUpdateModelValue('')
|
|
114
|
+
cursorIndex.value = Math.min(pasteValue.length, 5)
|
|
115
|
+
} else if (pasteValue) {
|
|
116
|
+
emitError(`Invalid code: ${pasteValue}. Code must be six digits`)
|
|
117
|
+
event.preventDefault()
|
|
120
118
|
}
|
|
119
|
+
}
|
|
121
120
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
121
|
+
const emitSubmit = () => {
|
|
122
|
+
emit('submit')
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const emitError = (errorMessage: string) => {
|
|
126
|
+
emit('error', errorMessage)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const emitUpdateModelValue = (code: string) => {
|
|
130
|
+
emit('update:modelValue', code)
|
|
126
131
|
}
|
|
127
132
|
</script>
|
|
128
133
|
|
|
@@ -188,4 +193,4 @@ export default class MagicCodeEntry extends Vue {
|
|
|
188
193
|
}
|
|
189
194
|
}
|
|
190
195
|
}
|
|
191
|
-
</style>
|
|
196
|
+
</style>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<Icon
|
|
16
16
|
type="paginationArrow"
|
|
17
17
|
class="uikit-question-review-pagination__previous-icon"
|
|
18
|
-
/>
|
|
18
|
+
/>
|
|
19
19
|
</div>
|
|
20
20
|
<span class="uikit-question-review-pagination__info">
|
|
21
21
|
{{ currentPage + 1 }} / {{ total }} <slot />
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
<Icon
|
|
36
36
|
type="paginationArrow"
|
|
37
37
|
class="uikit-question-review-pagination__next-icon"
|
|
38
|
-
/>
|
|
38
|
+
/>
|
|
39
39
|
</div>
|
|
40
40
|
</div>
|
|
41
41
|
</template>
|
|
@@ -119,4 +119,4 @@ const changePage = (direction: 'next' | 'previous') => {
|
|
|
119
119
|
height: 24px;
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
</style>
|
|
122
|
+
</style>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
3
|
v-dark="isDarkMode"
|
|
4
4
|
class="uikit-table-pagination"
|
|
5
5
|
>
|
|
6
|
-
<div
|
|
6
|
+
<div
|
|
7
7
|
ref="pagination_info"
|
|
8
8
|
v-dark="isDarkMode"
|
|
9
9
|
class="uikit-table-pagination__info"
|
|
@@ -70,52 +70,55 @@
|
|
|
70
70
|
</div>
|
|
71
71
|
</template>
|
|
72
72
|
|
|
73
|
-
<script lang="ts">
|
|
74
|
-
import { Vue, Component, Prop, Emit } from 'vue-facing-decorator'
|
|
73
|
+
<script setup lang="ts">
|
|
75
74
|
import Icon from '../Icons/Icon.vue'
|
|
76
|
-
import { dark } from '../../directives'
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
75
|
+
import { dark as vDark } from '../../directives'
|
|
76
|
+
import { computed, useTemplateRef } from 'vue'
|
|
77
|
+
|
|
78
|
+
const {
|
|
79
|
+
perPage = 10,
|
|
80
|
+
currentPage = 0,
|
|
81
|
+
total,
|
|
82
|
+
unit,
|
|
83
|
+
isDarkMode = false,
|
|
84
|
+
showFirstAndLastBtn = false,
|
|
85
|
+
} = defineProps<{
|
|
86
|
+
perPage?: number
|
|
87
|
+
currentPage?: number
|
|
88
|
+
total: number
|
|
89
|
+
unit: string
|
|
90
|
+
isDarkMode?: boolean
|
|
91
|
+
showFirstAndLastBtn?: boolean
|
|
92
|
+
}>()
|
|
93
|
+
|
|
94
|
+
const emit = defineEmits<{
|
|
95
|
+
'changePage': [pageNum: number]
|
|
96
|
+
}>()
|
|
97
|
+
|
|
98
|
+
const paginationInfoRef = useTemplateRef<HTMLElement>('pagination_info')
|
|
99
|
+
|
|
100
|
+
const nextPageDisabled = computed(() => {
|
|
101
|
+
return currentPage >= Math.floor((total - 1) / perPage)
|
|
85
102
|
})
|
|
86
|
-
export default class TablePagination extends Vue {
|
|
87
|
-
@Prop({ default: 10 }) perPage!: number
|
|
88
|
-
@Prop({ default: 0 }) currentPage!: number
|
|
89
|
-
@Prop() total!: number
|
|
90
|
-
@Prop() unit!: string
|
|
91
|
-
@Prop({ default: false }) isDarkMode!: boolean
|
|
92
|
-
@Prop({ default: false }) showFirstAndLastBtn!: boolean
|
|
93
|
-
|
|
94
|
-
get nextPageDisabled () {
|
|
95
|
-
return this.currentPage >= Math.floor((this.total - 1) / this.perPage)
|
|
96
|
-
}
|
|
97
103
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
+
const showAdvancedPagination = computed(() => {
|
|
105
|
+
if (!showFirstAndLastBtn) {
|
|
106
|
+
return false
|
|
107
|
+
} else {
|
|
108
|
+
return Math.floor((total - 1) / perPage) >= 3
|
|
104
109
|
}
|
|
110
|
+
})
|
|
105
111
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
} else {
|
|
117
|
-
return Math.max(0, this.currentPage - 1)
|
|
118
|
-
}
|
|
112
|
+
const changePage = (direction: 'next' | 'previous' | 'first' | 'last') => {
|
|
113
|
+
paginationInfoRef.value?.focus()
|
|
114
|
+
if (direction === 'next') {
|
|
115
|
+
emit('changePage', nextPageDisabled.value ? currentPage : currentPage + 1)
|
|
116
|
+
} else if (direction === 'first') {
|
|
117
|
+
emit('changePage', 0)
|
|
118
|
+
} else if (direction === 'last') {
|
|
119
|
+
emit('changePage', Math.floor((total - 1) / perPage))
|
|
120
|
+
} else {
|
|
121
|
+
emit('changePage', Math.max(0, currentPage - 1))
|
|
119
122
|
}
|
|
120
123
|
}
|
|
121
124
|
</script>
|
|
@@ -234,4 +237,4 @@ export default class TablePagination extends Vue {
|
|
|
234
237
|
}
|
|
235
238
|
}
|
|
236
239
|
}
|
|
237
|
-
</style>
|
|
240
|
+
</style>
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
<img v-else-if="bundleId === 'k9T5L3kC0U'" :src="urls.PhonePersonProfessional">
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
|
-
<script lang="ts">
|
|
16
|
-
import { Component, Vue, Prop } from 'vue-facing-decorator'
|
|
15
|
+
<script setup lang="ts">
|
|
17
16
|
import type { TBundleIds } from './phonePerson'
|
|
18
17
|
import PhonePersonBehavioralHealth from './phoneperson-behavioralhealth@2x.png'
|
|
19
18
|
import PhonePersonEMT from './phoneperson-emt@2x.png'
|
|
@@ -27,22 +26,23 @@ import PhonePersonNursingSchool from './phoneperson-nursingschool@2x.png'
|
|
|
27
26
|
import PhonePersonProfessional from './phoneperson-professional@2x.png'
|
|
28
27
|
import PhonePersonSkilledTrades from './phoneperson-skilledtrades@2x.png'
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
const {
|
|
30
|
+
bundleId = 'mO5EIsoZ9H',
|
|
31
|
+
} = defineProps<{
|
|
32
|
+
bundleId?: TBundleIds
|
|
33
|
+
}>()
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
35
|
+
const urls = {
|
|
36
|
+
PhonePersonBehavioralHealth,
|
|
37
|
+
PhonePersonEMT,
|
|
38
|
+
PhonePersonEssentials,
|
|
39
|
+
PhonePersonFinance,
|
|
40
|
+
PhonePersonFitness,
|
|
41
|
+
PhonePersonIT,
|
|
42
|
+
PhonePersonMedical,
|
|
43
|
+
PhonePersonNursing,
|
|
44
|
+
PhonePersonNursingSchool,
|
|
45
|
+
PhonePersonProfessional,
|
|
46
|
+
PhonePersonSkilledTrades,
|
|
47
47
|
}
|
|
48
48
|
</script>
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
>
|
|
17
17
|
<Tooltip
|
|
18
18
|
v-if="showFlagTooltip && enableFlagTooltip && !disabled"
|
|
19
|
-
:key="isFlagged"
|
|
19
|
+
:key="String(isFlagged)"
|
|
20
20
|
class="uikit-flag-toggle__tooltip"
|
|
21
21
|
:styles="{
|
|
22
|
-
backgroundColor:
|
|
23
|
-
color:
|
|
22
|
+
backgroundColor: BrandColors.grayDivider || 'gray',
|
|
23
|
+
color: BrandColors.brandBlack || 'black',
|
|
24
24
|
}"
|
|
25
25
|
>
|
|
26
26
|
{{ isFlagged ? 'Unflag' : 'Flag' }}
|
|
@@ -36,59 +36,60 @@
|
|
|
36
36
|
</div>
|
|
37
37
|
</template>
|
|
38
38
|
|
|
39
|
-
<script lang="ts">
|
|
40
|
-
import { Component, Emit, Prop, Vue } from 'vue-facing-decorator'
|
|
39
|
+
<script setup lang="ts">
|
|
41
40
|
import Tooltip from '../Tooltips/Tooltip.vue'
|
|
42
41
|
import Icon from '../Icons/Icon.vue'
|
|
43
42
|
import BrandColors from '../../pocketprep-export.module.scss'
|
|
43
|
+
import { onBeforeUnmount, onMounted, ref } from 'vue'
|
|
44
|
+
|
|
45
|
+
const {
|
|
46
|
+
isFlagged = false,
|
|
47
|
+
enableFlagKeyboardShortcut = false,
|
|
48
|
+
enableFlagTooltip = true,
|
|
49
|
+
disabled = false,
|
|
50
|
+
} = defineProps<{
|
|
51
|
+
isFlagged?: boolean
|
|
52
|
+
enableFlagKeyboardShortcut?: boolean
|
|
53
|
+
enableFlagTooltip?: boolean
|
|
54
|
+
disabled?: boolean
|
|
55
|
+
}>()
|
|
56
|
+
|
|
57
|
+
const emit = defineEmits<{
|
|
58
|
+
'toggleFlag': [isFlagged: boolean]
|
|
59
|
+
}>()
|
|
60
|
+
|
|
61
|
+
const showFlagTooltip = ref(false)
|
|
62
|
+
|
|
63
|
+
onMounted(() => {
|
|
64
|
+
if (enableFlagKeyboardShortcut) {
|
|
65
|
+
window.addEventListener('keydown', keydownListener)
|
|
66
|
+
}
|
|
67
|
+
})
|
|
44
68
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Tooltip,
|
|
48
|
-
Icon,
|
|
49
|
-
},
|
|
69
|
+
onBeforeUnmount(() => {
|
|
70
|
+
window.removeEventListener('keydown', keydownListener)
|
|
50
71
|
})
|
|
51
|
-
export default class FlagToggle extends Vue {
|
|
52
|
-
@Prop() isFlagged!: boolean
|
|
53
|
-
@Prop({ default: false }) enableFlagKeyboardShortcut!: boolean
|
|
54
|
-
@Prop({ default: true }) enableFlagTooltip!: boolean
|
|
55
|
-
@Prop({ default: false }) disabled!: boolean
|
|
56
|
-
|
|
57
|
-
brandColors = BrandColors
|
|
58
|
-
showFlagTooltip = false
|
|
59
|
-
|
|
60
|
-
mounted () {
|
|
61
|
-
if (this.enableFlagKeyboardShortcut) {
|
|
62
|
-
window.addEventListener('keydown', this.keydownListener)
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
72
|
|
|
66
|
-
|
|
67
|
-
|
|
73
|
+
const keydownListener = (e: KeyboardEvent) => {
|
|
74
|
+
if (disabled) {
|
|
75
|
+
return
|
|
68
76
|
}
|
|
69
77
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (e.code === 'KeyP') {
|
|
76
|
-
this.emitToggleFlag(!this.isFlagged)
|
|
77
|
-
}
|
|
78
|
+
if (e.code === 'KeyP') {
|
|
79
|
+
emitToggleFlag(!isFlagged)
|
|
78
80
|
}
|
|
81
|
+
}
|
|
79
82
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
this.emitToggleFlag(!this.isFlagged)
|
|
83
|
+
const toggleFlag = () => {
|
|
84
|
+
if (disabled) {
|
|
85
|
+
return
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
emitToggleFlag(!isFlagged)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const emitToggleFlag = (newIsFlagged: boolean) => {
|
|
92
|
+
emit('toggleFlag', newIsFlagged)
|
|
92
93
|
}
|
|
93
94
|
</script>
|
|
94
95
|
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
>
|
|
17
17
|
<Tooltip
|
|
18
18
|
v-if="!disabled && showGlobalMetricsToolTip"
|
|
19
|
-
:key="showGlobalMetrics"
|
|
19
|
+
:key="String(showGlobalMetrics)"
|
|
20
20
|
:theme="tooltipTheme"
|
|
21
21
|
:styles="{
|
|
22
|
-
backgroundColor:
|
|
23
|
-
color:
|
|
22
|
+
backgroundColor: BrandColors.grayDivider || 'gray',
|
|
23
|
+
color: BrandColors.brandBlack || 'black',
|
|
24
24
|
...customTooltipStyles,
|
|
25
25
|
}"
|
|
26
26
|
:is-dark-mode="isDarkMode"
|
|
@@ -40,37 +40,38 @@
|
|
|
40
40
|
</div>
|
|
41
41
|
</template>
|
|
42
42
|
|
|
43
|
-
<script lang="ts">
|
|
44
|
-
import { Component, Emit, Prop, Vue } from 'vue-facing-decorator'
|
|
43
|
+
<script setup lang="ts">
|
|
45
44
|
import Tooltip from '../Tooltips/Tooltip.vue'
|
|
46
45
|
import Icon from '../Icons/Icon.vue'
|
|
47
46
|
import BrandColors from '../../pocketprep-export.module.scss'
|
|
47
|
+
import { ref } from 'vue'
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
49
|
+
const {
|
|
50
|
+
showGlobalMetrics,
|
|
51
|
+
disabled = false,
|
|
52
|
+
customTooltipStyles = {},
|
|
53
|
+
tooltipTheme = '',
|
|
54
|
+
isDarkMode = false,
|
|
55
|
+
} = defineProps<{
|
|
56
|
+
showGlobalMetrics?: boolean
|
|
57
|
+
disabled?: boolean
|
|
58
|
+
customTooltipStyles?: Record<string, unknown>
|
|
59
|
+
tooltipTheme?: 'leftalign' | 'rightalign' | ''
|
|
60
|
+
isDarkMode?: boolean
|
|
61
|
+
}>()
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
const emit = defineEmits<{
|
|
64
|
+
'toggleGlobalMetrics': [showGlobalMetrics: boolean]
|
|
65
|
+
}>()
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
this.emitToggleGlobalMetrics(!this.showGlobalMetrics)
|
|
68
|
-
}
|
|
67
|
+
const showGlobalMetricsToolTip = ref(false)
|
|
69
68
|
|
|
70
|
-
|
|
71
|
-
emitToggleGlobalMetrics
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
const toggleGlobalMetrics = () => {
|
|
70
|
+
emitToggleGlobalMetrics(!showGlobalMetrics)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const emitToggleGlobalMetrics = (newShowGlobalMetrics: boolean) => {
|
|
74
|
+
emit('toggleGlobalMetrics', newShowGlobalMetrics)
|
|
74
75
|
}
|
|
75
76
|
</script>
|
|
76
77
|
|
|
@@ -124,4 +125,4 @@ export default class GlobalMetricsToggle extends Vue {
|
|
|
124
125
|
}
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
|
-
</style>
|
|
128
|
+
</style>
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
v-if="showKeyboardTooltip"
|
|
25
25
|
:theme="tooltipTheme"
|
|
26
26
|
:styles="{
|
|
27
|
-
backgroundColor:
|
|
28
|
-
color:
|
|
27
|
+
...(BrandColors.grayDivider && { backgroundColor: BrandColors.grayDivider}),
|
|
28
|
+
...(BrandColors.brandBlack && { color: BrandColors.brandBlack }),
|
|
29
29
|
}"
|
|
30
30
|
>
|
|
31
31
|
Keyboard Shortcuts
|
|
@@ -38,33 +38,26 @@
|
|
|
38
38
|
</div>
|
|
39
39
|
</template>
|
|
40
40
|
|
|
41
|
-
<script lang="ts">
|
|
42
|
-
import { Component, Prop, Vue } from 'vue-facing-decorator'
|
|
43
|
-
import KeyboardShortcutsModal from '../Quiz/KeyboardShortcutsModal.vue'
|
|
41
|
+
<script setup lang="ts">
|
|
44
42
|
import Tooltip from '../Tooltips/Tooltip.vue'
|
|
45
43
|
import Icon from '../Icons/Icon.vue'
|
|
46
44
|
import BrandColors from '../../pocketprep-export.module.scss'
|
|
45
|
+
import { ref } from 'vue'
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
})
|
|
55
|
-
export default class KeyboardShortcutsButton extends Vue {
|
|
56
|
-
@Prop() tooltipTheme!: 'leftalign' | 'rightalign'
|
|
57
|
-
@Prop({ default: false }) isDarkMode!: boolean
|
|
58
|
-
@Prop() disabled?: boolean
|
|
47
|
+
const {
|
|
48
|
+
tooltipTheme = '',
|
|
49
|
+
disabled = false,
|
|
50
|
+
} = defineProps<{
|
|
51
|
+
tooltipTheme?: 'leftalign' | 'rightalign'
|
|
52
|
+
disabled?: boolean
|
|
53
|
+
}>()
|
|
59
54
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
showKeyboardShortcutsModal = false
|
|
55
|
+
const showKeyboardTooltip = ref(false)
|
|
56
|
+
const showKeyboardShortcutsModal = ref(false)
|
|
63
57
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
58
|
+
const toggleShowModal = () => {
|
|
59
|
+
if (!disabled) {
|
|
60
|
+
showKeyboardShortcutsModal.value = !showKeyboardShortcutsModal.value
|
|
68
61
|
}
|
|
69
62
|
}
|
|
70
63
|
</script>
|