UNPKG

@cds/core

Version:

Clarity Design System - common components, themes, and utilties

29 lines (28 loc) 1.08 kB
import { ReactiveController, ReactiveElement } from 'lit'; export interface KeyNavigationGridConfig { keyNavGrid?: HTMLElement; columnRow?: HTMLElement; columns?: NodeListOf<HTMLElement> | HTMLElement[]; rows: NodeListOf<HTMLElement> | HTMLElement[]; cells: NodeListOf<HTMLElement> | HTMLElement[]; } /** * Given a 2d array grid structure provide keyboard navigation following aria grid spec * https://w3c.github.io/aria-practices/#gridNav_focus */ export declare function keyNavigationGrid<T extends ReactiveElement & KeyNavigationGridConfig>(): ClassDecorator; export declare class KeyNavigationGridController<T extends ReactiveElement & KeyNavigationGridConfig> implements ReactiveController { private host; private observers; private get hostGrid(); private get hostRows(); private get hostCells(); private get activeCell(); constructor(host: T); hostConnected(): Promise<void>; hostDisconnected(): void; private clickCell; private keynavCell; private setActiveCell; private updateCellActivation; }