primeng
Version:
PrimeNG is an open source UI library for Angular featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeB
152 lines (151 loc) • 5.81 kB
TypeScript
import { ElementRef, EventEmitter, Injector, OnDestroy, OnInit } from '@angular/core';
import { ControlValueAccessor, NgControl } from '@angular/forms';
import { BaseComponent } from 'primeng/basecomponent';
import { Nullable } from 'primeng/ts-helpers';
import { RadioButtonClickEvent } from './radiobutton.interface';
import { RadioButtonStyle } from './style/radiobuttonstyle';
import * as i0 from "@angular/core";
import * as i1 from "primeng/api";
export declare const RADIO_VALUE_ACCESSOR: any;
export declare class RadioControlRegistry {
private accessors;
add(control: NgControl, accessor: RadioButton): void;
remove(accessor: RadioButton): void;
select(accessor: RadioButton): void;
private isSameGroup;
static ɵfac: i0.ɵɵFactoryDeclaration<RadioControlRegistry, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<RadioControlRegistry>;
}
/**
* RadioButton is an extension to standard radio button element with theming.
* @group Components
*/
export declare class RadioButton extends BaseComponent implements ControlValueAccessor, OnInit, OnDestroy {
/**
* Value of the radiobutton.
* @group Props
*/
value: any;
/**
* The name of the form control.
* @group Props
*/
formControlName: string | undefined;
/**
* Name of the radiobutton group.
* @group Props
*/
name: string | undefined;
/**
* When present, it specifies that the element should be disabled.
* @group Props
*/
disabled: boolean | undefined;
/**
* Specifies the input variant of the component.
* @group Props
*/
variant: 'filled' | 'outlined';
/**
* Defines the size of the component.
* @group Props
*/
size: 'large' | 'small';
/**
* Index of the element in tabbing order.
* @group Props
*/
tabindex: number | undefined;
/**
* Identifier of the focus input to match a label defined for the component.
* @group Props
*/
inputId: string | undefined;
/**
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
* @group Props
*/
ariaLabelledBy: string | undefined;
/**
* Used to define a string that labels the input element.
* @group Props
*/
ariaLabel: string | undefined;
/**
* Inline style of the component.
* @group Props
*/
style: {
[klass: string]: any;
} | null | undefined;
/**
* Style class of the component.
* @group Props
*/
styleClass: string | undefined;
/**
* When present, it specifies that the component should automatically get focus on load.
* @group Props
*/
autofocus: boolean | undefined;
/**
* Allows to select a boolean value.
* @group Props
*/
binary: boolean | undefined;
/**
* Callback to invoke on radio button click.
* @param {RadioButtonClickEvent} event - Custom click event.
* @group Emits
*/
onClick: EventEmitter<RadioButtonClickEvent>;
/**
* Callback to invoke when the receives focus.
* @param {Event} event - Browser event.
* @group Emits
*/
onFocus: EventEmitter<Event>;
/**
* Callback to invoke when the loses focus.
* @param {Event} event - Browser event.
* @group Emits
*/
onBlur: EventEmitter<Event>;
inputViewChild: ElementRef;
onModelChange: Function;
onModelTouched: Function;
checked: Nullable<boolean>;
focused: Nullable<boolean>;
control: Nullable<NgControl>;
_componentStyle: RadioButtonStyle;
injector: Injector;
registry: RadioControlRegistry;
ngOnInit(): void;
onChange(event: any): void;
select(event: Event): void;
writeValue(value: any): void;
registerOnChange(fn: Function): void;
registerOnTouched(fn: Function): void;
setDisabledState(val: boolean): void;
onInputFocus(event: Event): void;
onInputBlur(event: Event): void;
/**
* Applies focus to input field.
* @group Method
*/
focus(): void;
ngOnDestroy(): void;
private checkName;
private throwNameError;
static ɵfac: i0.ɵɵFactoryDeclaration<RadioButton, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<RadioButton, "p-radioButton, p-radiobutton, p-radio-button", never, { "value": { "alias": "value"; "required": false; }; "formControlName": { "alias": "formControlName"; "required": false; }; "name": { "alias": "name"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "size": { "alias": "size"; "required": false; }; "tabindex": { "alias": "tabindex"; "required": false; }; "inputId": { "alias": "inputId"; "required": false; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "style": { "alias": "style"; "required": false; }; "styleClass": { "alias": "styleClass"; "required": false; }; "autofocus": { "alias": "autofocus"; "required": false; }; "binary": { "alias": "binary"; "required": false; }; }, { "onClick": "onClick"; "onFocus": "onFocus"; "onBlur": "onBlur"; }, never, never, true, never>;
static ngAcceptInputType_disabled: unknown;
static ngAcceptInputType_tabindex: unknown;
static ngAcceptInputType_autofocus: unknown;
static ngAcceptInputType_binary: unknown;
}
export declare class RadioButtonModule {
static ɵfac: i0.ɵɵFactoryDeclaration<RadioButtonModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<RadioButtonModule, never, [typeof RadioButton, typeof i1.SharedModule], [typeof RadioButton, typeof i1.SharedModule]>;
static ɵinj: i0.ɵɵInjectorDeclaration<RadioButtonModule>;
}