@visa/nova-angular
Version:
Visa Product Design System Nova Angular library
103 lines (102 loc) • 4.48 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, QueryList } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { AppReadyService } from '../_utilities/services/app-stable-check.service';
import { UUIDService } from '../_utilities/services/uuid.service';
import { CheckboxDirective } from '../checkbox/checkbox.directive';
import { RadioDirective } from '../radio/radio.directive';
import { ToggleButtonDirective } from '../toggle-button/toggle-button.directive';
import * as i0 from "@angular/core";
export declare class ToggleContainerDirective implements ControlValueAccessor, AfterContentInit {
private uuidService;
private cdRef;
private appReadyService;
radios: QueryList<RadioDirective>;
checkboxes: QueryList<CheckboxDirective>;
buttons: QueryList<ToggleButtonDirective>;
/**
* Sets custom name.
* @default this.uuidService.getUUID('v-toggle-');
* @builtin true
*/
name: string;
/**
* Provides custom class(es) for custom styling.
* @default .v-toggle-container
*/
class: string;
get hostClasses(): string;
/**
* Allows multiple buttons to be selected when true. <br />
* To be used with child Button components, not Radio or Checkbox.
* @default false
*/
get multiselect(): boolean;
set multiselect(value: BooleanInput);
_multiselect: boolean;
/**
* Sets component as disabled when true.
* @default false
*/
get disabled(): boolean;
set disabled(value: BooleanInput);
_disabled: boolean;
get hostDisabled(): "disabled" | null;
/** Fires when a formControl's disabled state updates. */
setDisabledState(isDisabled: boolean): void;
/**
* Marks component as invalid when true.
* @default false
*/
get invalid(): boolean;
set invalid(value: BooleanInput);
_invalid: boolean;
get ariaInvalid(): boolean;
/**
* Marks component as required when true.
* @default false
*/
get required(): boolean;
set required(value: BooleanInput);
_required: boolean;
/**
* Value of toggle button.
*/
get value(): (string | number)[] | string | number | null;
set value(value: (string | number)[] | string | number | null);
_value: (string | number)[] | string | number | null;
updateValue(value: (string | number)[] | string | number | null): void;
constructor(uuidService: UUIDService, cdRef: ChangeDetectorRef, appReadyService: AppReadyService);
ngAfterContentInit(): void;
handleBlur(event: Event): void;
setUpButtons(): void;
setUpRadios(): void;
setUpCheckboxes(): void;
onChange: (_: any) => void;
onTouched: (_: any) => void;
registerOnChange(fn: any): void;
registerOnTouched(fn: any): void;
writeValue(value: (string | number)[] | string | number | null): void;
clear(): void;
updateCheckboxRadioVal(item: RadioDirective | CheckboxDirective, checked?: boolean): void;
unsubscribeFromListeners(items: QueryList<RadioDirective> | QueryList<CheckboxDirective> | QueryList<ToggleButtonDirective>): void;
informDisabledState(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<ToggleContainerDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<ToggleContainerDirective, "[v-toggle-container]", never, { "name": { "alias": "name"; "required": false; }; "class": { "alias": "class"; "required": false; }; "multiselect": { "alias": "multiselect"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; "required": { "alias": "required"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, {}, ["radios", "checkboxes", "buttons"], never, true, never>;
}