Skip to content

Commit 4a2257d

Browse files
authored
Merge pull request #1058 from CopperGiraffe/fix-radio-button-rich
fix: 🐛 ajoute la notion de rich sans icone pour les DsfrRadioButton
2 parents ae9d17f + abd292a commit 4a2257d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/components/DsfrRadioButton/DsfrRadioButton.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export type DsfrRadioButtonProps = {
88
value: string | number | boolean
99
label?: string
1010
hint?: string
11+
rich?: boolean
1112
img?: string
1213
imgTitle?: string
1314
svgPath?: string

src/components/DsfrRadioButton/DsfrRadioButton.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ const props = withDefaults(defineProps<DsfrRadioButtonProps>(), {
1414
hint: '',
1515
img: undefined,
1616
svgPath: undefined,
17+
rich: false,
1718
svgAttrs: () => ({ viewBox: '0 0 80 80', width: '80px', height: '80px' }),
1819
})
1920
2021
defineEmits<{ (e: 'update:modelValue', payload: string | number | boolean): void }>()
2122
2223
const defaultSvgAttrs = { viewBox: '0 0 80 80', width: '80px', height: '80px' }
2324
24-
const rich = computed(() => !!props.img || !!props.svgPath)
25+
const richComputed = computed(() => props.rich || (!!props.img || !!props.svgPath))
2526
</script>
2627

2728
<template>
@@ -32,7 +33,7 @@ const rich = computed(() => !!props.img || !!props.svgPath)
3233
<div
3334
class="fr-radio-group"
3435
:class="{
35-
'fr-radio-rich': rich,
36+
'fr-radio-rich': richComputed,
3637
'fr-radio-group--sm': small,
3738
}"
3839
>

0 commit comments

Comments
 (0)