@usssa/component-library 1.0.0-alpha.132 → 1.0.0-alpha.133
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 +1 -1
- package/package.json +1 -1
- package/src/components/core/URadioBtn.vue +40 -23
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from 'vue'
|
|
3
|
+
import { useScreenType } from '../../composables/useScreenType'
|
|
3
4
|
import URadioStd from './URadioStd.vue'
|
|
4
5
|
|
|
5
6
|
const emit = defineEmits(['onClick', 'onButtonClick'])
|
|
6
|
-
|
|
7
7
|
const model = defineModel()
|
|
8
|
-
|
|
9
8
|
const props = defineProps({
|
|
10
9
|
altText: {
|
|
11
10
|
type: String,
|
|
@@ -46,6 +45,8 @@ const props = defineProps({
|
|
|
46
45
|
},
|
|
47
46
|
})
|
|
48
47
|
|
|
48
|
+
const $screen = useScreenType()
|
|
49
|
+
|
|
49
50
|
const activeClass = computed(() => {
|
|
50
51
|
if (model.value === props.value) {
|
|
51
52
|
return 'active'
|
|
@@ -53,6 +54,8 @@ const activeClass = computed(() => {
|
|
|
53
54
|
return ''
|
|
54
55
|
})
|
|
55
56
|
|
|
57
|
+
const isMobile = computed(() => $screen.value.isMobile)
|
|
58
|
+
|
|
56
59
|
const handleChange = () => {
|
|
57
60
|
model.value = props.value
|
|
58
61
|
}
|
|
@@ -60,33 +63,44 @@ const handleChange = () => {
|
|
|
60
63
|
|
|
61
64
|
<template>
|
|
62
65
|
<q-btn
|
|
63
|
-
:class="`u-radio-btn ${activeClass}`"
|
|
66
|
+
:class="`u-radio-btn ${activeClass}${isMobile ? ' full-width' : ''}`"
|
|
64
67
|
:dataTestId="dataTestId"
|
|
65
68
|
flat
|
|
66
69
|
@click="handleChange"
|
|
67
70
|
>
|
|
68
|
-
<div class="radio-btn-content flex items-center">
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
<
|
|
71
|
+
<div class="radio-btn-content flex items-center justify-between full-width">
|
|
72
|
+
<div
|
|
73
|
+
class="flex items-center justify-center radio-btn-text-wrapper no-wrap"
|
|
74
|
+
>
|
|
75
|
+
<URadioStd
|
|
76
|
+
v-model="model"
|
|
77
|
+
:aria-label="label"
|
|
78
|
+
:id="id"
|
|
79
|
+
:value="value"
|
|
80
|
+
/>
|
|
81
|
+
<div class="button-text">
|
|
82
|
+
<div class="text-caption-lg">{{ label }}</div>
|
|
83
|
+
<div class="description-text text-body-sm">{{ description }}</div>
|
|
84
|
+
</div>
|
|
73
85
|
</div>
|
|
74
86
|
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
<div class="flex items-center">
|
|
88
|
+
<img
|
|
89
|
+
v-if="image"
|
|
90
|
+
class="radio-btn-img"
|
|
91
|
+
:alt="altText"
|
|
92
|
+
:aria-label="imgAriaLabel"
|
|
93
|
+
size="1.5rem"
|
|
94
|
+
:src="image"
|
|
95
|
+
/>
|
|
96
|
+
<q-icon
|
|
97
|
+
v-if="iconClass"
|
|
98
|
+
:class="iconClass"
|
|
99
|
+
:aria-label="imgAriaLabel"
|
|
100
|
+
:color="iconColor"
|
|
101
|
+
size="1.5rem"
|
|
102
|
+
/>
|
|
103
|
+
</div>
|
|
90
104
|
</div>
|
|
91
105
|
</q-btn>
|
|
92
106
|
</template>
|
|
@@ -123,4 +137,7 @@ const handleChange = () => {
|
|
|
123
137
|
|
|
124
138
|
.q-radio .q-radio__inner
|
|
125
139
|
color: $primary !important
|
|
140
|
+
|
|
141
|
+
.radio-btn-text-wrapper
|
|
142
|
+
gap: $xs
|
|
126
143
|
</style>
|