UNPKG

@visa/nova-angular

Version:

Visa Product Design System Nova Angular library

122 lines (121 loc) 5.07 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, NumberInput } from '@angular/cdk/coercion'; import { AfterContentInit, ElementRef, EventEmitter } from '@angular/core'; import { BaseInteractiveDirective } from '../_utilities/angular-specific-directives/base-interactive.directive'; import { UUIDService } from '../_utilities/services/uuid.service'; import { CheckboxDirective } from '../checkbox/checkbox.directive'; import { RadioDirective } from '../radio/radio.directive'; import { ToggleControlService } from '../toggle-control/toggle-control.service'; import * as i0 from "@angular/core"; export declare class ListboxItemComponent extends BaseInteractiveDirective implements AfterContentInit { private uuidService; private toggleControlService; radio: RadioDirective; checkbox: CheckboxDirective; _isRoleOptionVariant: boolean; _multi: boolean; _disabledEmitter: EventEmitter<boolean>; _invalidEmitter: EventEmitter<boolean>; /** * Provides custom class&#40;es&#41; for custom styling. * @default .v-listbox-item */ get class(): string; set class(value: string); _class: string; get hostClass(): string; /** * Marks item as selected when true. * @default false */ get active(): boolean; set active(value: BooleanInput); _active: boolean; /** * Marks item as highlighted when true. Occurs natively with :focus-visible. * @default false * @builtin true */ get highlighted(): boolean; set highlighted(value: BooleanInput); _highlighted: boolean; /** @ignore */ get index(): number; set index(value: NumberInput); _index: number; /** * Sets custom role. * @default 'option' if no child radio or checkbox is present. * @default not present if child radio or checkbox is present. * @builtin true */ role: string; get hostRole(): string; /** * Value of listbox item. <br /> * A value <strong>must</strong> be present on every list item if it does not have a child radio or checkbox. */ get value(): string | number; set value(value: string | number); _value: string | number; get hostValue(): string | number | void; /** * Sets list item with <strong>no child radio or checkbox</strong> as disabled. <br /> * If using a child radio or checkbox, set <code>disabled</code> directly on those components. * @default false */ get disabled(): boolean; set disabled(value: BooleanInput); _disabled: boolean; get hostDisabled(): null; get hostAriaDisabled(): string | null | void; /** * Sets list item with <strong>no child radio or checkbox</strong> as invalid. <br /> * If using a child radio or checkbox, set <code>invalid</code> directly on those components. * @default false */ get invalid(): boolean; set invalid(value: BooleanInput); _invalid: boolean; get hostInvalid(): string | null | void; /** * Sets custom id. * @default uuidService.getUUID('v-listbox-item-') * @builtin true */ id: string; get hostId(): string; get hostAriaSelected(): boolean | void; /** * Emits active state of item when toggled. */ itemChanged: EventEmitter<boolean>; /** * Emits when this item is focused. */ onFocus: EventEmitter<FocusEvent>; handleFocus(event: FocusEvent): void; constructor(el: ElementRef, uuidService: UUIDService, toggleControlService: ToggleControlService); ngAfterContentInit(): void; onClick(event: Event): void; handleKeyup(event: KeyboardEvent): void; handleKeyDown(event: KeyboardEvent): void; selectItem(): void; static ɵfac: i0.ɵɵFactoryDeclaration<ListboxItemComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<ListboxItemComponent, "[v-listbox-item] ", never, { "class": { "alias": "class"; "required": false; }; "active": { "alias": "active"; "required": false; }; "highlighted": { "alias": "highlighted"; "required": false; }; "index": { "alias": "index"; "required": false; }; "role": { "alias": "role"; "required": false; }; "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; "id": { "alias": "id"; "required": false; }; }, { "itemChanged": "itemChanged"; "onFocus": "onFocus"; }, ["radio", "checkbox"], ["*"], true, never>; }