igniteui-webcomponents
Version:
Ignite UI for Web Components is a complete library of UI components, giving you the ability to build modern web applications using encapsulation and the concept of reusable components in a dependency-free approach.
109 lines (108 loc) • 4.31 kB
TypeScript
import { LitElement, type TemplateResult } from 'lit';
import type { Constructor } from '../common/mixins/constructor.js';
import { type FormValue } from '../common/mixins/forms/form-value.js';
import type { ToggleLabelPosition } from '../types.js';
export interface IgcRadioChangeEventArgs {
checked: boolean;
value?: string;
}
export interface IgcRadioComponentEventMap {
igcChange: CustomEvent<IgcRadioChangeEventArgs>;
focus: FocusEvent;
blur: FocusEvent;
}
declare const IgcRadioComponent_base: Constructor<import("../common/mixins/forms/types.js").FormRequiredInterface & import("../common/mixins/forms/types.js").FormAssociatedCheckboxElementInterface> & Constructor<import("../common/mixins/event-emitter.js").EventEmitterInterface<IgcRadioComponentEventMap>> & Constructor<LitElement>;
/**
* @element igc-radio
*
* @slot - The radio label.
* @slot helper-text - Renders content below the input.
* @slot value-missing - Renders content when the required validation fails.
* @slot custom-error - Renders content when setCustomValidity(message) is set.
* @slot invalid - Renders content when the component is in invalid state (validity.valid = false).
*
* @fires igcChange - Emitted when the control's checked state changes.
*
* @csspart base - The radio control base wrapper.
* @csspart control - The radio input control.
* @csspart label - The radio control label.
*/
export default class IgcRadioComponent extends IgcRadioComponent_base {
static readonly tagName = "igc-radio";
protected static styles: import("lit").CSSResult[];
static register(): void;
private static readonly increment;
protected get __validators(): import("../common/validators.js").Validator<IgcRadioComponent>[];
protected _formValue: FormValue<boolean>;
private inputId;
private labelId;
private _kbFocus;
protected _value: string;
protected input: HTMLInputElement;
protected label: Array<Node>;
protected hideLabel: boolean;
private _tabIndex;
/** Returns all radio elements from the group, that is having the same name property. */
private get _radios();
/** All sibling radio elements of the one invoking the getter. */
private get _siblings();
/** All non-disabled radio elements from the group. */
private get _active();
/** All checked radio elements from the group. */
private get _checkedRadios();
set required(value: boolean);
get required(): boolean;
/**
* The value attribute of the control.
* @attr
*/
set value(value: string);
get value(): string;
/**
* The checked state of the control.
* @attr
*/
set checked(value: boolean);
get checked(): boolean;
/**
* The label position of the radio control.
* @attr label-position
*/
labelPosition: ToggleLabelPosition;
constructor();
protected createRenderRoot(): HTMLElement | DocumentFragment;
protected firstUpdated(): Promise<void>;
protected _setDefaultValue(current: string | null): void;
/** Simulates a click on the radio control. */
click(): void;
/** Sets focus on the radio control. */
focus(options?: FocusOptions): void;
/** Removes focus from the radio control. */
blur(): void;
private _checkValidity;
private _reportValidity;
/** Checks for validity of the control and emits the invalid event if it invalid. */
checkValidity(): boolean;
/** Checks for validity of the control and shows the browser message if it invalid. */
reportValidity(): boolean;
/**
* Sets a custom validation message for the control.
* As long as `message` is not empty, the control is considered invalid.
*/
setCustomValidity(message: string): void;
private _updateCheckedState;
protected formResetCallback(): void;
/** Called after a form reset callback to restore default keyboard navigation. */
private _resetTabIndexes;
protected handleClick(event: PointerEvent): void;
protected handleBlur(): void;
protected navigate(idx: number): void;
protected renderValidatorContainer(): TemplateResult;
protected render(): TemplateResult<1>;
}
declare global {
interface HTMLElementTagNameMap {
'igc-radio': IgcRadioComponent;
}
}
export {};