@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
69 lines • 2.52 kB
TypeScript
/**
* This elemProps hook is used for cursor navigation by using [Active
* Descendant](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_focus_activedescendant).
* This hook should be applied to List Items, not the list (use {@link useListActiveDescendant} for the list).
* This hook adds the focus class so that lists using `aria-activedescendant` get the correct
* visual cue for visual users.
*
* ```ts
* const useMyItem = composeHooks(
* useListItemActiveDescendant, // adds `aria-activedescendant` support
* useListItemRegister
* );
```
*/
export declare const useListItemActiveDescendant: import("@workday/canvas-kit-react/common").BehaviorHook<{
state: {
cursorId: string;
columnCount: number;
pageSizeRef: import("react").MutableRefObject<number>;
cursorIndexRef: {
readonly current: number;
};
UNSTABLE_virtual: {
virtualItems: import("./react-virtual").VirtualItem[];
totalSize: number;
scrollToOffset: (index: number, options?: import("./react-virtual").ScrollToOffsetOptions | undefined) => void;
scrollToIndex: (index: number, options?: import("./react-virtual").ScrollToIndexOptions | undefined) => void;
measure: () => void;
};
UNSTABLE_defaultItemHeight: number;
containerRef: import("react").RefObject<HTMLDivElement>;
id: string;
orientation: "horizontal" | "vertical";
indexRef: import("react").MutableRefObject<number>;
nonInteractiveIds: string[];
isVirtualized: boolean;
items: import("./useBaseListModel").Item<any>[];
};
events: {
goTo(data: {
id: string;
}): void;
goToNext(): void;
goToPrevious(): void;
goToPreviousRow(): void;
goToNextRow(): void;
goToFirst(): void;
goToLast(): void;
goToFirstOfRow(): void;
goToLastOfRow(): void;
goToNextPage(): void;
goToPreviousPage(): void;
registerItem(data: {
id: string;
textValue: string;
}): void;
unregisterItem(data: {
id: string;
}): void;
updateItemHeight(data: {
value: number;
}): void;
};
navigation: import("./useCursorListModel").NavigationManager;
getId: (item: any) => string;
}, {
readonly className: "" | "focus";
}>;
//# sourceMappingURL=useListItemActiveDescendant.d.ts.map