@visa/nova-angular
Version:
Visa Product Design System Nova Angular library
91 lines (90 loc) • 3.42 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 } 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 * as i0 from "@angular/core";
export declare class SwitchDirective implements ControlValueAccessor {
private el;
private uuidService;
private appReadyService;
constructor(el: ElementRef, uuidService: UUIDService, appReadyService: AppReadyService);
/**
* Sets custom id.
* @default this.uuidService.getUUID('v-switch-')
* @builtin true
*/
id: string;
get hostId(): string;
/**
* Provides custom class(es) for custom styling.
* @default .v-switch
*/
class: string;
get hostClasses(): string;
/**
* Sets switch 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 switch as invalid when true.
* @default false
*/
get invalid(): boolean;
set invalid(value: BooleanInput);
_invalid: boolean;
get hostAriaInvalid(): boolean;
/**
* Marks switch 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;
get hostAriaChecked(): boolean;
get hostRole(): string;
get hostType(): string;
val: string | null;
set value(value: string | null);
handleChange(event: Event): void;
handleFocus(event: Event): void;
handleBlur(event: Event): void;
onChange: (_: any) => void;
onTouched: (_: any) => void;
registerOnChange(fn: any): void;
registerOnTouched(fn: any): void;
writeValue(value: string): void;
static ɵfac: i0.ɵɵFactoryDeclaration<SwitchDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<SwitchDirective, "[v-switch]", never, { "id": { "alias": "id"; "required": false; }; "class": { "alias": "class"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; "required": { "alias": "required"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; }, {}, never, never, true, never>;
}