feat(select) : tags SelectCheckbox radius 20px + couleur de texte par option (MUI-49)
- Radius des tags et du badge +N porté à 20px - Champ textColor optionnel par option (couleur du texte du tag, ignorée en disabled) - Tests, COMPONENTS.md et CHANGELOG.md mis à jour Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ type Option = {
|
||||
label: string
|
||||
value: string | number
|
||||
color?: string
|
||||
textColor?: string
|
||||
}
|
||||
|
||||
type SelectCheckboxProps = {
|
||||
@@ -441,4 +442,23 @@ describe('MalioSelectCheckbox', () => {
|
||||
expect(tag.classes()).toContain('bg-m-bg')
|
||||
expect(tag.attributes('style')).toBeFalsy()
|
||||
})
|
||||
|
||||
it('applique la couleur de texte fournie par l’option', () => {
|
||||
const wrapper = mount(SelectCheckboxForTest, {
|
||||
props: {modelValue: ['fr'], options: [{label: 'France', value: 'fr', textColor: '#ffffff'}], displayTag: true},
|
||||
})
|
||||
|
||||
const tag = wrapper.findAll('span.inline-flex')[0]
|
||||
expect(tag.attributes('style')).toContain('color')
|
||||
})
|
||||
|
||||
it('n’applique pas la couleur de texte custom en disabled (reste grisé)', () => {
|
||||
const wrapper = mount(SelectCheckboxForTest, {
|
||||
props: {modelValue: ['fr'], options: [{label: 'France', value: 'fr', textColor: '#ffffff'}], displayTag: true, disabled: true},
|
||||
})
|
||||
|
||||
const tag = wrapper.findAll('span.inline-flex')[0]
|
||||
expect(tag.classes()).toContain('text-black/60')
|
||||
expect(tag.attributes('style') ?? '').not.toContain('color')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user