@visa/nova-angular
Version:
Visa Product Design System Nova Angular library
103 lines (102 loc) • 4.05 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 { ElementRef, EventEmitter } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { AppReadyService } from '../_utilities/services/app-stable-check.service';
import { BaseInteractiveDirective } from '../_utilities/angular-specific-directives/base-interactive.directive';
import { UUIDService } from '../_utilities/services/uuid.service';
import * as i0 from "@angular/core";
export declare class CheckboxDirective extends BaseInteractiveDirective implements ControlValueAccessor {
private uuidService;
private appReadyService;
_disabledEmitter: EventEmitter<any>;
_invalidEmitter: EventEmitter<any>;
/**
* Provides custom class(es) for custom styling.
* @default .v-checkbox
*/
class: string;
get hostClasses(): string;
get hostType(): string;
/**
* Sets custom id.
* @default uuidService.getUUID('v-checkbox-')
* @builtin true
*/
id: string;
get hostId(): string;
/**
* Sets checkbox to 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 checkbox as invalid when true.
* @default false
*/
get invalid(): boolean;
set invalid(value: BooleanInput);
_invalid: boolean;
get hostAriaInvalid(): boolean;
/**
* Sets checkbox to indeterminate when true.
* @default false
*/
get indeterminate(): boolean;
set indeterminate(value: BooleanInput);
_indeterminate: boolean;
/**
* Marks checkbox as required when true.
* @default false
*/
get required(): boolean;
set required(value: BooleanInput);
_required: boolean;
get hostRequired(): "required" | null;
/**
* Sets checked state of component.
* @default false
*/
get checked(): boolean;
set checked(value: BooleanInput);
_checked: boolean;
get hostAttrChecked(): "checked" | null;
/**
* Value of checkbox input.
*/
checkboxValue: string | number;
get hostValue(): string | number;
val: string | number | null;
set value(value: string | number);
handleChange(event: Event): void;
handleFocus(event: Event): void;
handleBlur(event: Event): void;
constructor(el: ElementRef, uuidService: UUIDService, appReadyService: AppReadyService);
onChange: (_: any) => void;
onTouched: (_: any) => void;
registerOnChange(fn: any): void;
registerOnTouched(fn: any): void;
writeValue(value: string | number): void;
static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<CheckboxDirective, "[v-checkbox]", never, { "class": { "alias": "class"; "required": false; }; "id": { "alias": "id"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; "indeterminate": { "alias": "indeterminate"; "required": false; }; "required": { "alias": "required"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "checkboxValue": { "alias": "value"; "required": false; }; }, {}, never, never, true, never>;
}