feat(radio) : contexte de groupe injectable pour RadioButton
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import type {ComputedRef, InjectionKey} from 'vue'
|
||||
|
||||
export type RadioValue = string | number | boolean | null | undefined
|
||||
|
||||
export interface RadioGroupContext {
|
||||
name: ComputedRef<string>
|
||||
isSelected: (value: RadioValue) => boolean
|
||||
select: (value: RadioValue) => void
|
||||
hasError: ComputedRef<boolean>
|
||||
hasSuccess: ComputedRef<boolean>
|
||||
disabled: ComputedRef<boolean>
|
||||
readonly: ComputedRef<boolean>
|
||||
required: ComputedRef<boolean>
|
||||
describedBy: ComputedRef<string | undefined>
|
||||
}
|
||||
|
||||
export const radioGroupContextKey: InjectionKey<RadioGroupContext> = Symbol('MalioRadioGroup')
|
||||
Reference in New Issue
Block a user