UNPKG

@visa/nova-angular

Version:

Visa Product Design System Nova Angular library

190 lines (189 loc) 7.47 kB
/** * 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 { UUIDService } from '../_utilities/services/uuid.service'; import { BaseInteractiveDirective } from '../_utilities/angular-specific-directives/base-interactive.directive'; import * as i0 from "@angular/core"; export declare class InputDirective extends BaseInteractiveDirective implements ControlValueAccessor { private uuidService; private appReadyService; _inCombobox: boolean; /** * Provides custom class&#40;es&#41; for custom styling. * @default .v-input */ get class(): string; set class(value: string); _class: string; get hostClass(): string; /** * Sets custom id. * @default uuidService.getUUID('v-input-') * @builtin true */ id: string; get hostId(): string; /** * Sets custom role. * @default null * @default 'combobox' when input is used within combobox and no custom role is provided. * @builtin true */ get role(): string; set role(value: string); _role: string; get hostRole(): string; /** * Sets input as readonly when true. * @default false */ get readonly(): boolean; set readonly(value: BooleanInput); _readonly: boolean; get hostReadonly(): "readonly" | null; /** * 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; /** * Sets input to one-time-passcode (OTP) variant when true. * @default false */ get otp(): boolean; set otp(value: BooleanInput); _otp: boolean; /** * Removes resize from textarea when true. * @default false */ get noResize(): boolean; set noResize(value: BooleanInput); _noResize: boolean; /** Below needed for combobox */ /** * Aria attribute relaying whether input is expanded. * @default null * @builtin true */ get ariaExpanded(): boolean | null; set ariaExpanded(value: BooleanInput); _ariaExpanded: boolean | null; get hostAriaExpanded(): string | void; /** * Aria attribute relaying autocomplete type. * @default null * @default 'list' when input is used within combobox and no custom value is provided. * @builtin true */ get ariaAutocomplete(): string; set ariaAutocomplete(value: string); _ariaAutocomplete: string; get hostAriaAutocomplete(): string | void; /** * Sets input aria-haspopup attribute. * @default null * @default 'listbox' when input is used within combobox and no custom value is given. * @builtin true */ get ariaHaspopup(): boolean | null; set ariaHaspopup(value: BooleanInput); _ariaHaspopup: boolean | null; get hostAriaHaspopup(): string | void; /** * Sets input aria-owns attribute. * @default null * @default '&lt;listbox-container-id&gt;' when input is used within combobox and no custom value is given. * @builtin true */ get ariaOwns(): string; set ariaOwns(value: string); _ariaOwns: string; get hostAriaOwns(): string | void; /** * Aria attribute relaying what element the input controls. * @default null * @default '&lt;listbox-id&gt;' when input is used within combobox and combobox menu is open. * @builtin true */ get ariaControls(): string | null; set ariaControls(value: string | null); _ariaControls: string | null; get hostAriaControls(): string | void; /** * Aria attribute relaying what active element the input refers to. * @default null * @default '&lt;listbox-item-id&gt;' when input is used within combobox and an option is highlighted or active. * @builtin true */ get ariaActiveDescendant(): string | null; set ariaActiveDescendant(value: string | null); _ariaActiveDescendant: string | null; get hostAriaActiveDescendant(): string | void; /** * Value of input. */ get value(): string; set value(value: string); get val(): string; set val(value: string); _value: string; /** * Emits value when the input event is triggered or backspace key is pressed. */ inputEvent: EventEmitter<any>; /** * Emits readonly, disabled, invalid, and required state of input when any of these states change. */ communicateState: EventEmitter<any>; handleInput(event: Event): void; handleFocus(event: Event): void; handleBlur(event: Event): void; handleReadonlySpace(event: KeyboardEvent): 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): void; informState(): void; static ɵfac: i0.ɵɵFactoryDeclaration<InputDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<InputDirective, "[v-input]", never, { "class": { "alias": "class"; "required": false; }; "id": { "alias": "id"; "required": false; }; "role": { "alias": "role"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; "required": { "alias": "required"; "required": false; }; "otp": { "alias": "otp"; "required": false; }; "noResize": { "alias": "noResize"; "required": false; }; "ariaExpanded": { "alias": "aria-expanded"; "required": false; }; "ariaAutocomplete": { "alias": "aria-autocomplete"; "required": false; }; "ariaHaspopup": { "alias": "aria-haspopup"; "required": false; }; "ariaOwns": { "alias": "aria-owns"; "required": false; }; "ariaControls": { "alias": "aria-controls"; "required": false; }; "ariaActiveDescendant": { "alias": "aria-activedescendant"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, { "inputEvent": "inputEvent"; "communicateState": "communicateState"; }, never, never, true, never>; }