@visa/nova-angular
Version:
Visa Product Design System Nova Angular library
92 lines (91 loc) • 3.79 kB
TypeScript
/**
* Copyright (c) 2025 Visa, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
**/
import { BooleanInput } from '@angular/cdk/coercion';
import { AfterContentInit, ChangeDetectorRef, ElementRef, QueryList } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { UUIDService } from '../_utilities/services/uuid.service';
import { AppReadyService } from '../_utilities/services/app-stable-check.service';
import { RadioDirective } from '../radio/radio.directive';
import * as i0 from "@angular/core";
/**
* This directive is used to group radio buttons together and manage their state. <br />
* Typically used for a required group to relay that one of the group is required to be selected.
*/
export declare class RadioGroupDirective implements ControlValueAccessor, AfterContentInit {
el: ElementRef;
private appReadyService;
private cdRef;
private uuidService;
radios: QueryList<RadioDirective>;
/**
* Marks radio group as required when true.
* @default false
*/
get groupRequired(): boolean;
set groupRequired(value: BooleanInput);
_groupRequired: boolean;
get ariaRequired(): string | void;
/**
* Sets radio group as disabled when true.
* @default false
*/
get groupDisabled(): boolean;
set groupDisabled(value: BooleanInput);
_groupDisabled: boolean;
/** Fires when a formControl's disabled state updates */
setDisabledState(isDisabled: boolean): void;
/**
* Marks radio group as invalid when true.
* @default false
*/
get groupInvalid(): boolean;
set groupInvalid(value: BooleanInput);
_groupInvalid: boolean;
/**
* Sets custom role.
* @default radiogroup
* @builtin true
*/
role: string;
get hostRole(): string;
/**
* Value of radio group.
*/
get value(): string | number | null | undefined;
set value(value: string | number | null | undefined);
_value: string | number | null | undefined;
/**
* Shared name of radio group.
* @default this.uuidService.getUUID('v-radio-group-');
* @builtin true
*/
name: string;
handleChange(event: Event): void;
handleBlur(event: Event): void;
constructor(el: ElementRef, appReadyService: AppReadyService, cdRef: ChangeDetectorRef, uuidService: UUIDService);
ngAfterContentInit(): void;
onChange: (_: any) => void;
onTouched: (_: any) => void;
registerOnChange(fn: any): void;
registerOnTouched(fn: any): void;
writeValue(value: string | number): void;
selectRadio(): void;
clear(): void;
updateChildrenState(prop: 'disabled' | 'invalid' | 'required', groupProp: boolean): void;
static ɵfac: i0.ɵɵFactoryDeclaration<RadioGroupDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<RadioGroupDirective, "[v-radio-group]", never, { "groupRequired": { "alias": "required"; "required": false; }; "groupDisabled": { "alias": "disabled"; "required": false; }; "groupInvalid": { "alias": "invalid"; "required": false; }; "role": { "alias": "role"; "required": false; }; "value": { "alias": "value"; "required": false; }; "name": { "alias": "name"; "required": false; }; }, {}, ["radios"], never, true, never>;
}