@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
|
@@ -37,38 +37,38 @@
|
|
|
37
37
|
</div>
|
|
38
38
|
</template>
|
|
39
39
|
|
|
40
|
-
<script lang="ts">
|
|
41
|
-
import { Component, Vue, Prop, Emit } from 'vue-facing-decorator'
|
|
40
|
+
<script setup lang="ts">
|
|
42
41
|
import Icon from '../Icons/Icon.vue'
|
|
43
|
-
import { dark } from '../../directives'
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
/******* Element-specific style props *******/
|
|
42
|
+
import { dark as vDark } from '../../directives'
|
|
43
|
+
import { ref } from 'vue'
|
|
44
|
+
|
|
45
|
+
const {
|
|
46
|
+
modelValue = undefined,
|
|
47
|
+
disabled = false,
|
|
48
|
+
isDarkMode = false,
|
|
49
|
+
hasLabel = false,
|
|
50
|
+
checkboxStyles = null,
|
|
51
|
+
checkboxCheckStyles = null,
|
|
52
|
+
} = defineProps<{
|
|
53
|
+
modelValue?: boolean | null
|
|
54
|
+
disabled?: boolean
|
|
55
|
+
isDarkMode?: boolean
|
|
56
|
+
hasLabel?: boolean
|
|
57
|
+
/* ****** Element-specific style props ****** */
|
|
60
58
|
// .uikit-checkbox
|
|
61
|
-
|
|
59
|
+
checkboxStyles?: Record<string, string> | null
|
|
62
60
|
// .uikit-checkbox__check
|
|
63
|
-
|
|
61
|
+
checkboxCheckStyles?: Record<string, string> | null
|
|
62
|
+
}>()
|
|
64
63
|
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
const emit = defineEmits<{
|
|
65
|
+
'update:modelValue': [modelVal: boolean]
|
|
66
|
+
}>()
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
const focus = ref(false)
|
|
69
|
+
|
|
70
|
+
const toggleCheckbox = () => {
|
|
71
|
+
emit('update:modelValue', !modelValue)
|
|
72
72
|
}
|
|
73
73
|
</script>
|
|
74
74
|
|
|
@@ -33,38 +33,38 @@
|
|
|
33
33
|
</div>
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
|
-
<script lang="ts">
|
|
37
|
-
import { Vue, Component, Prop, Emit } from 'vue-facing-decorator'
|
|
36
|
+
<script setup lang="ts">
|
|
38
37
|
import Checkbox from '../Forms/Checkbox.vue'
|
|
39
|
-
import { dark } from '../../directives'
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
import { dark as vDark } from '../../directives'
|
|
39
|
+
import { onMounted, ref } from 'vue'
|
|
40
|
+
|
|
41
|
+
const {
|
|
42
|
+
modelValue = false,
|
|
43
|
+
isDarkMode = false,
|
|
44
|
+
label = '',
|
|
45
|
+
disabled = false,
|
|
46
|
+
} = defineProps<{
|
|
47
|
+
modelValue?: boolean
|
|
48
|
+
isDarkMode?: boolean
|
|
49
|
+
label?: string
|
|
50
|
+
disabled?: boolean
|
|
51
|
+
}>()
|
|
52
|
+
|
|
53
|
+
const emit = defineEmits<{
|
|
54
|
+
'update:modelValue': [modelVal: boolean]
|
|
55
|
+
}>()
|
|
56
|
+
|
|
57
|
+
const checkboxId = ref<null | string>(null)
|
|
58
|
+
|
|
59
|
+
onMounted(() => {
|
|
60
|
+
checkboxId.value = `checkbox-${Math.round(Math.random() * 1000000)}`
|
|
48
61
|
})
|
|
49
|
-
export default class CheckboxOption extends Vue {
|
|
50
|
-
@Prop({ default: false }) modelValue!: boolean | null
|
|
51
|
-
@Prop({ default: false }) isDarkMode!: boolean
|
|
52
|
-
@Prop() label!: string
|
|
53
|
-
@Prop({ default: false }) disabled!: boolean
|
|
54
62
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
@Emit('update:modelValue')
|
|
62
|
-
emitUpdateModelValue (val: boolean) {
|
|
63
|
-
if (this.disabled) {
|
|
64
|
-
return this.modelValue
|
|
65
|
-
} else {
|
|
66
|
-
return val
|
|
67
|
-
}
|
|
63
|
+
const emitUpdateModelValue = (val: boolean) => {
|
|
64
|
+
if (disabled) {
|
|
65
|
+
emit('update:modelValue', modelValue)
|
|
66
|
+
} else {
|
|
67
|
+
emit('update:modelValue', val)
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
</script>
|
|
@@ -194,4 +194,4 @@ export default class CheckboxOption extends Vue {
|
|
|
194
194
|
margin-top: 1px;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
</style>
|
|
197
|
+
</style>
|
|
@@ -33,33 +33,30 @@
|
|
|
33
33
|
</div>
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
|
-
<script lang="ts">
|
|
37
|
-
import { Vue, Component, Prop } from 'vue-facing-decorator'
|
|
36
|
+
<script setup lang="ts">
|
|
38
37
|
import Icon from '../Icons/Icon.vue'
|
|
39
|
-
import { dark } from '../../directives'
|
|
38
|
+
import { dark as vDark } from '../../directives'
|
|
39
|
+
import { computed, onMounted, useTemplateRef } from 'vue'
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
@Prop({ default: () => ([]) }) errors!: string[]
|
|
51
|
-
@Prop({ default: false }) isDarkMode!: boolean
|
|
52
|
-
@Prop() errorHeader!: string
|
|
41
|
+
const {
|
|
42
|
+
errors = [],
|
|
43
|
+
isDarkMode = false,
|
|
44
|
+
errorHeader = '',
|
|
45
|
+
} = defineProps<{
|
|
46
|
+
errors?: string[]
|
|
47
|
+
isDarkMode?: boolean
|
|
48
|
+
errorHeader?: string
|
|
49
|
+
}>()
|
|
53
50
|
|
|
54
|
-
|
|
55
|
-
return [ ...new Set(this.errors) ]
|
|
56
|
-
}
|
|
51
|
+
const errorsRef = useTemplateRef<HTMLElement | undefined>('uikit-errors')
|
|
57
52
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
const filteredErrors = computed(() => {
|
|
54
|
+
return [ ...new Set(errors) ]
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
onMounted(() => {
|
|
58
|
+
errorsRef.value?.focus()
|
|
59
|
+
})
|
|
63
60
|
</script>
|
|
64
61
|
|
|
65
62
|
<style lang="scss">
|
|
@@ -115,4 +112,4 @@ export default class Errors extends Vue {
|
|
|
115
112
|
}
|
|
116
113
|
}
|
|
117
114
|
}
|
|
118
|
-
</style>
|
|
115
|
+
</style>
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
:id="`${componentId}--label`"
|
|
10
10
|
v-dark="isDarkMode"
|
|
11
11
|
class="uikit-input__label"
|
|
12
|
-
:class="{
|
|
13
|
-
'uikit-input__label--hover': hover || forceHoverStyle,
|
|
14
|
-
'uikit-input__label--focus': focus || forceFocusStyle,
|
|
12
|
+
:class="{
|
|
13
|
+
'uikit-input__label--hover': hover || forceHoverStyle,
|
|
14
|
+
'uikit-input__label--focus': focus || forceFocusStyle,
|
|
15
15
|
'uikit-input__label--error': error,
|
|
16
16
|
'uikit-input__input--hide-caret': hideInputCaret,
|
|
17
17
|
'uikit-input__label--with-subtext': !!labelSubtext,
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
:autofocus="autoFocus"
|
|
40
40
|
:tabindex="tabindex"
|
|
41
41
|
class="uikit-input__input"
|
|
42
|
-
:class="{
|
|
43
|
-
'uikit-input__input--hover': hover || forceHoverStyle,
|
|
44
|
-
'uikit-input__input--focus': focus || forceFocusStyle,
|
|
42
|
+
:class="{
|
|
43
|
+
'uikit-input__input--hover': hover || forceHoverStyle,
|
|
44
|
+
'uikit-input__input--focus': focus || forceFocusStyle,
|
|
45
45
|
'uikit-input__input--error': error,
|
|
46
46
|
'uikit-input__input--hide-caret': hideInputCaret,
|
|
47
47
|
}"
|
|
@@ -82,9 +82,9 @@
|
|
|
82
82
|
class="uikit-input__input"
|
|
83
83
|
:name="name"
|
|
84
84
|
:aria-required="ariaRequired"
|
|
85
|
-
:class="{
|
|
86
|
-
'uikit-input__input--hover': hover || forceHoverStyle,
|
|
87
|
-
'uikit-input__input--focus': focus || forceFocusStyle,
|
|
85
|
+
:class="{
|
|
86
|
+
'uikit-input__input--hover': hover || forceHoverStyle,
|
|
87
|
+
'uikit-input__input--focus': focus || forceFocusStyle,
|
|
88
88
|
'uikit-input__input--error': error,
|
|
89
89
|
'uikit-input__input--hide-caret': hideInputCaret,
|
|
90
90
|
}"
|
|
@@ -97,61 +97,73 @@
|
|
|
97
97
|
</div>
|
|
98
98
|
</template>
|
|
99
99
|
|
|
100
|
-
<script lang="ts">
|
|
101
|
-
import { Component, Vue, Prop, Emit } from 'vue-facing-decorator'
|
|
100
|
+
<script setup lang="ts">
|
|
102
101
|
import Icon from '../Icons/Icon.vue'
|
|
103
|
-
import { dark } from '../../directives'
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
102
|
+
import { dark as vDark } from '../../directives'
|
|
103
|
+
import { computed, ref } from 'vue'
|
|
104
|
+
|
|
105
|
+
const {
|
|
106
|
+
label = '',
|
|
107
|
+
labelSubtext = '',
|
|
108
|
+
fieldType = 'text',
|
|
109
|
+
minNumber = undefined,
|
|
110
|
+
placeholder = '',
|
|
111
|
+
maxlength = '524288',
|
|
112
|
+
modelValue = null,
|
|
113
|
+
disabled = false,
|
|
114
|
+
autoFocus = false,
|
|
115
|
+
error = false,
|
|
116
|
+
tabindex = 0,
|
|
117
|
+
isDarkMode = false,
|
|
118
|
+
ariaRequired = false,
|
|
119
|
+
name = '',
|
|
120
|
+
forceHoverStyle = false,
|
|
121
|
+
forceFocusStyle = false,
|
|
122
|
+
hideInputCaret = false,
|
|
123
|
+
} = defineProps<{
|
|
124
|
+
label?: string
|
|
125
|
+
labelSubtext?: string
|
|
126
|
+
fieldType?: string
|
|
127
|
+
minNumber?: number
|
|
128
|
+
placeholder?: string
|
|
129
|
+
maxlength?: string // default input field length
|
|
130
|
+
modelValue?: string | null
|
|
131
|
+
disabled?: boolean
|
|
132
|
+
autoFocus?: boolean
|
|
133
|
+
error?: boolean
|
|
134
|
+
tabindex?: number
|
|
135
|
+
isDarkMode?: boolean
|
|
136
|
+
ariaRequired?: boolean
|
|
137
|
+
name?: string
|
|
138
|
+
forceHoverStyle?: boolean
|
|
139
|
+
forceFocusStyle?: boolean
|
|
140
|
+
hideInputCaret?: boolean
|
|
141
|
+
}>()
|
|
142
|
+
|
|
143
|
+
const emit = defineEmits<{
|
|
144
|
+
'update:modelValue': [modelVal: string]
|
|
145
|
+
}>()
|
|
146
|
+
|
|
147
|
+
const hover = ref(false)
|
|
148
|
+
const focus = ref(false)
|
|
149
|
+
const showPassword = ref(false)
|
|
150
|
+
|
|
151
|
+
const componentId = computed(() => {
|
|
152
|
+
if (label) {
|
|
153
|
+
return `input-${label.toLowerCase().replace(/ /g, '-')}`
|
|
154
|
+
} else {
|
|
155
|
+
return `input-${Math.round(Math.random() * 1000000)}`
|
|
143
156
|
}
|
|
157
|
+
})
|
|
144
158
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
159
|
+
const keydownListener = (e: Event | KeyboardEvent) => {
|
|
160
|
+
if (focus.value && 'key' in e && e.key.match(/^[A-Za-z0-9\s\-_@]$/)) {
|
|
161
|
+
e.stopPropagation()
|
|
149
162
|
}
|
|
163
|
+
}
|
|
150
164
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
return ($event.target as HTMLInputElement).value
|
|
154
|
-
}
|
|
165
|
+
const valueChange = ($event: Event) => {
|
|
166
|
+
emit('update:modelValue', ($event.target as HTMLInputElement).value)
|
|
155
167
|
}
|
|
156
168
|
</script>
|
|
157
169
|
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
class="uikit-radio__item"
|
|
30
30
|
:data-value="item.value"
|
|
31
31
|
:tabindex="(disabled || item.disabled) ? -1 : 0"
|
|
32
|
-
:class="{
|
|
32
|
+
:class="{
|
|
33
33
|
'uikit-radio__item--selected': modelValue && item.value === modelValue.value,
|
|
34
34
|
'uikit-radio__item--disabled': disabled || item.disabled,
|
|
35
35
|
'uikit-radio__item--has-helper-text': !!(item.helperText)
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
v-if="item.helperText"
|
|
59
59
|
v-dark="isDarkMode"
|
|
60
60
|
class="uikit-radio__item-helper-text"
|
|
61
|
-
v-html="item.helperText"
|
|
61
|
+
v-html="item.helperText"
|
|
62
62
|
/>
|
|
63
63
|
</slot>
|
|
64
64
|
</div>
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import { dark as vDark } from '../../directives'
|
|
3
3
|
|
|
4
4
|
defineProps<{
|
|
5
|
-
selected
|
|
6
|
-
disabled
|
|
7
|
-
isDarkMode
|
|
5
|
+
selected?: boolean
|
|
6
|
+
disabled?: boolean
|
|
7
|
+
isDarkMode?: boolean
|
|
8
8
|
color: 'blue' | 'green' | 'gray'
|
|
9
9
|
}>()
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<template>
|
|
13
|
-
<div
|
|
14
|
-
v-dark="isDarkMode"
|
|
15
|
-
class="uikit-radio-btn"
|
|
16
|
-
:class="{
|
|
13
|
+
<div
|
|
14
|
+
v-dark="isDarkMode"
|
|
15
|
+
class="uikit-radio-btn"
|
|
16
|
+
:class="{
|
|
17
17
|
'uikit-radio-btn--selected': selected,
|
|
18
18
|
'uikit-radio-btn--disabled': disabled,
|
|
19
19
|
[`uikit-radio-btn--${color}`]: true,
|
|
@@ -125,7 +125,7 @@ defineProps<{
|
|
|
125
125
|
|
|
126
126
|
&--gray {
|
|
127
127
|
border-color: $slate;
|
|
128
|
-
|
|
128
|
+
|
|
129
129
|
&::before {
|
|
130
130
|
background: $slate;
|
|
131
131
|
}
|