UNPKG

igniteui-webcomponents

Version:

Ignite UI for Web Components is a complete library of UI components, giving you the ability to build modern web applications using encapsulation and the concept of reusable components in a dependency-free approach.

33 lines (32 loc) 1.32 kB
import type { ReactiveController, ReactiveControllerHost } from 'lit'; /** * A controller class which determines whether a focus ring should be shown to indicate keyboard focus. * Focus rings are visible only when the user is interacting with a keyboard, not with a mouse, touch, or other input methods. * * By default the class attaches a keyup event handler on the component host and will update its keyboard focus * state based on it. */ export declare class KeyboardFocusRingController implements ReactiveController { readonly host: ReactiveControllerHost & HTMLElement; private readonly _host; private _focused; /** * Gets whether the current focus state is activated through a keyboard interaction. */ get focused(): boolean; constructor(host: ReactiveControllerHost & HTMLElement); hostConnected(): void; hostDisconnected(): void; handleEvent(): void; /** * Resets the keyboard focus state. * * Usually called on blur of the component or when a pointer based interaction * is executed. */ reset: () => void; } /** * Adds a {@link KeyboardFocusRingController} responsible for managing keyboard focus state. */ export declare function addKeyboardFocusRing(host: ReactiveControllerHost & HTMLElement): KeyboardFocusRingController;