projects/ui-kit-lib/src/lib/v2/radio-button/radio.ts
Single radio button component.
Responsibilities:
MDRadioGroup.change when user selects it.
OnInit
AfterViewInit
DoCheck
OnDestroy
| changeDetection | ChangeDetectionStrategy.OnPush |
| encapsulation | ViewEncapsulation.None |
| exportAs | mdRadioButton |
| host | { |
| selector | md-radio-button |
| templateUrl | radio.html |
| styleUrl | radio.scss |
Properties |
|
Methods |
Inputs |
Outputs |
Accessors |
constructor()
|
|
Inject parent group (optional) and host tabindex. Also initializes disabledInteractive default. |
| aria-describedby |
Type : string
|
|
Id of element that describes this input. |
| aria-label |
Type : string
|
|
ARIA label text for input (if no external label). |
| aria-labelledby |
Type : string
|
|
Id of element that labels this input. |
| checked |
Type : boolean
|
|
Checked state with group coordination and dispatcher notify. |
| disabled |
Type : boolean
|
|
Disabled state; considers group-level disabled as well. |
| disabledInteractive |
Type : boolean
|
|
If true, item remains interactive/focusable even when disabled. Also considers group-level disabledInteractive. |
| id |
Type : string
|
Default value : this._uniqueId
|
|
Element id (defaults to unique id). |
| name |
Type : string
|
|
Shared group name; set by group or consumer. |
| required |
Type : boolean
|
|
Required state; considers group-level required as well. |
| tabIndex |
Type : number
|
Default value : 0
|
|
Tabindex for internal input; normalized via numberAttribute. Default is 0 so item can be focused when selected. |
| value |
Type : any
|
|
Arbitrary value associated with this radio. |
| change |
Type : EventEmitter<RadioChange>
|
|
Emits when this particular radio is selected by the user. |
| _markForCheck |
_markForCheck()
|
|
Ask view to update (used by group).
Returns :
void
|
| _onInputInteraction | ||||||
_onInputInteraction(event: Event)
|
||||||
|
Handles interaction on the real input. Ensures single selection, emits change, updates group model.
Parameters :
Returns :
void
|
| _onTouchTargetClick | ||||||
_onTouchTargetClick(event: Event)
|
||||||
|
Click on the visual/touch target should behave like clicking the input. Also refocus the input if allowed.
Parameters :
Returns :
void
|
| Protected _setDisabled | ||||||
_setDisabled(value: boolean)
|
||||||
|
Setter for disabled that triggers CD when value changes.
Parameters :
Returns :
void
|
| focus | |||||||||
focus(options?: FocusOptions, origin?: FocusOrigin)
|
|||||||||
|
Programmatic focus API.
If
Parameters :
Returns :
void
|
| Protected _elementRef |
Type : unknown
|
Default value : inject(ElementRef)
|
|
Host element reference (used by FocusMonitor and listeners). |
| _inputElement |
Type : ElementRef<HTMLInputElement>
|
Decorators :
@ViewChild('input')
|
|
Template refs. |
| _noopAnimations |
Type : unknown
|
Default value : false
|
Decorators :
@ViewChild('formField', {read: ElementRef, static: true})
|
|
Placeholder for potential animations flag (wired via template). |
| radioGroup |
Type : MDRadioGroup
|
|
Optional reference to parent group (injected). |
| checked | ||||||
getchecked()
|
||||||
|
Checked state with group coordination and dispatcher notify.
Returns :
boolean
|
||||||
setchecked(value: boolean)
|
||||||
|
Parameters :
Returns :
void
|
| value | ||||||
getvalue()
|
||||||
|
Arbitrary value associated with this radio.
Returns :
any
|
||||||
setvalue(value: any)
|
||||||
|
Parameters :
Returns :
void
|
| disabled | ||||||
getdisabled()
|
||||||
|
Disabled state; considers group-level disabled as well.
Returns :
boolean
|
||||||
setdisabled(value: boolean)
|
||||||
|
Parameters :
Returns :
void
|
| required | ||||||
getrequired()
|
||||||
|
Required state; considers group-level required as well.
Returns :
boolean
|
||||||
setrequired(value: boolean)
|
||||||
|
Parameters :
Returns :
void
|
| disabledInteractive | ||||||
getdisabledInteractive()
|
||||||
|
If true, item remains interactive/focusable even when disabled. Also considers group-level disabledInteractive.
Returns :
boolean
|
||||||
setdisabledInteractive(value: boolean)
|
||||||
|
Parameters :
Returns :
void
|
| inputId |
getinputId()
|
|
Id for internal input element.
Returns :
string
|