@angular-mdc/web
Version:
90 lines (89 loc) • 3.43 kB
TypeScript
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, InjectionToken, OnDestroy } from '@angular/core';
import { UniqueSelectionDispatcher } from '@angular/cdk/collections';
import { MDCRadioFoundation } from '@material/radio';
import { MdcRipple, MDCRippleCapableSurface } from '@angular-mdc/web/ripple';
import { MdcFormField, MdcFormFieldControl } from '@angular-mdc/web/form-field';
import { MDCComponent } from '@angular-mdc/web/base';
/**
* Describes a parent MdcRadioGroup component.
* Contains properties that MdcRadio can inherit.
*/
export interface MdcRadioGroupParentComponent {
name: string;
selected: MdcRadio | null;
value: any;
disabled: boolean;
required: boolean;
emitChangeEvent(): void;
_controlValueAccessorChangeFn(value: any): void;
_touch(): void;
}
/**
* Injection token used to provide the parent MdcRadioGroup component to MdcRadio.
*/
export declare const MDC_RADIO_GROUP_PARENT_COMPONENT: InjectionToken<MdcRadioGroupParentComponent>;
/** Change event object emitted by MdcRadio. */
export declare class MdcRadioChange {
/** The source MdcRadio of the event. */
source: MdcRadio;
/** The value of the radio button. */
value: any;
constructor(
/** The source MdcRadio of the event. */
source: MdcRadio,
/** The value of the radio button. */
value: any);
}
export declare class MdcRadio extends MDCComponent<MDCRadioFoundation> implements AfterViewInit, OnDestroy, MdcFormFieldControl<any>, MDCRippleCapableSurface {
private _changeDetectorRef;
elementRef: ElementRef<HTMLElement>;
ripple: MdcRipple;
private _radioDispatcher;
radioGroup: MdcRadioGroupParentComponent;
private _parentFormField;
private _uniqueId;
private _initialized;
_root: Element;
/** The unique ID for the radio button. */
id: string;
/** Analog to HTML 'name' attribute used to group radios for unique selection. */
name: string;
tabIndex: number;
ariaLabel?: string;
ariaLabelledby?: string;
/** The 'aria-describedby' attribute is read after the element's label and field type. */
ariaDescribedby?: string;
get inputId(): string;
get touch(): boolean;
set touch(value: boolean);
private _touch;
get value(): any;
set value(newValue: any);
private _value;
get checked(): boolean;
set checked(value: boolean);
private _checked;
get disabled(): boolean;
set disabled(value: boolean);
private _disabled;
get required(): boolean;
set required(value: boolean);
private _required;
readonly change: EventEmitter<MdcRadioChange>;
input: ElementRef<HTMLInputElement>;
/** Unregister function for _radioDispatcher */
private _removeUniqueSelectionListener;
getDefaultFoundation(): MDCRadioFoundation;
constructor(_changeDetectorRef: ChangeDetectorRef, elementRef: ElementRef<HTMLElement>, ripple: MdcRipple, _radioDispatcher: UniqueSelectionDispatcher, radioGroup: MdcRadioGroupParentComponent, _parentFormField: MdcFormField);
ngAfterViewInit(): void;
ngOnDestroy(): void;
onInputClick(event: Event): void;
onInputChange(event: Event): void;
setChecked(checked: boolean): void;
setValue(value: any): void;
focus(): void;
markForCheck(): void;
private _createRipple;
/** Dispatch change event with current value. */
private _emitChangeEvent;
}