UNPKG

2.29 kBTypeScriptView Raw
1import { ChangeDetectorRef, ElementRef, OnChanges, Provider, Renderer2, SimpleChanges } from '@angular/core';
2import { ControlValueAccessor } from '@angular/forms';
3import { ButtonRadioGroupDirective } from './button-radio-group.directive';
4import * as ɵngcc0 from '@angular/core';
5export declare const RADIO_CONTROL_VALUE_ACCESSOR: Provider;
6/**
7 * Create radio buttons or groups of buttons.
8 * A value of a selected button is bound to a variable specified via ngModel.
9 */
10export declare class ButtonRadioDirective implements ControlValueAccessor, OnChanges {
11 private el;
12 private cdr;
13 private renderer;
14 private group;
15 onChange: Function;
16 onTouched: Function;
17 /** Radio button value, will be set to `ngModel` */
18 btnRadio?: string;
19 /** If `true` — radio button can be unchecked */
20 uncheckable: boolean;
21 /** Current value of radio component or group */
22 get value(): string | undefined;
23 set value(value: string | undefined);
24 /** If `true` — radio button is disabled */
25 get disabled(): boolean;
26 set disabled(disabled: boolean);
27 get controlOrGroupDisabled(): true | undefined;
28 get hasDisabledClass(): boolean | undefined;
29 get isActive(): boolean;
30 readonly role: string;
31 get tabindex(): undefined | number;
32 get hasFocus(): boolean;
33 private _value?;
34 private _disabled;
35 private _hasFocus;
36 constructor(el: ElementRef, cdr: ChangeDetectorRef, renderer: Renderer2, group: ButtonRadioGroupDirective);
37 toggleIfAllowed(): void;
38 onSpacePressed(event: KeyboardEvent): void;
39 focus(): void;
40 onFocus(): void;
41 onBlur(): void;
42 canToggle(): boolean;
43 ngOnChanges(changes: SimpleChanges): void;
44 _onChange(value?: string): void;
45 writeValue(value: string): void;
46 registerOnChange(fn: () => void): void;
47 registerOnTouched(fn: () => void): void;
48 setDisabledState(disabled: boolean): void;
49 static ɵfac: ɵngcc0.ɵɵFactoryDef<ButtonRadioDirective, [null, null, null, { optional: true; }]>;
50 static ɵdir: ɵngcc0.ɵɵDirectiveDefWithMeta<ButtonRadioDirective, "[btnRadio]", never, { "uncheckable": "uncheckable"; "value": "value"; "disabled": "disabled"; "btnRadio": "btnRadio"; }, {}, never>;
51}
52
53//# sourceMappingURL=button-radio.directive.d.ts.map
\No newline at end of file