UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

146 lines • 5.2 kB
import React from 'react'; /** * This elemProps hook is the base of all item component hooks. It registers an item with a * collection and sets the `data-id` that is used by other hooks. It should always be the last * defined hook when using `composeHooks` (`composeHooks` executes hooks right to left and merges * props left to right). It is used by `ListBox.Item` and all `*.Item` subcomponents. * * ```ts * const useMyItem = composeHooks( * useListItemSelect, // additional hooks go here * useListItemRegister // always last * ); * ``` */ export declare const useListItemRegister: import("@workday/canvas-kit-react/common").BehaviorHook<{ state: { selectedIds: string[] | "all"; unselectedIds: string[]; cursorId: string | string[]; columnCount: number; pageSizeRef: React.MutableRefObject<number>; cursorIndexRef: { readonly current: number; }; UNSTABLE_virtual: import("@tanstack/virtual-core").Virtualizer<HTMLDivElement, Element>; UNSTABLE_defaultItemHeight: number; containerRef: React.RefObject<HTMLDivElement>; id: string; orientation: "horizontal" | "vertical"; indexRef: React.MutableRefObject<number>; nonInteractiveIds: string[]; isVirtualized: boolean; items: import("./useBaseListModel").Item<any>[]; }; events: { select(data: { id: string; }): void; selectAll(): void; unselectAll(): void; setSelectedIds(ids: string[] | "all"): void; remove(data: { id: string; nextId?: string | undefined; event?: Event | React.SyntheticEvent<Element, Event> | undefined; }): void; 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; }; selection: import("./useSelectionListModel").SelectionManager; navigation: import("./useCursorListModel").NavigationManager; getId: (item: any) => string; getTextValue: (item: any) => string; UNSTABLE_parentModel: { state: { selectedIds: string[] | "all"; unselectedIds: string[]; cursorId: string | string[]; columnCount: number; pageSizeRef: React.MutableRefObject<number>; cursorIndexRef: { readonly current: number; }; UNSTABLE_virtual: import("@tanstack/virtual-core").Virtualizer<HTMLDivElement, Element>; UNSTABLE_defaultItemHeight: number; containerRef: React.RefObject<HTMLDivElement>; id: string; orientation: "horizontal" | "vertical"; indexRef: React.MutableRefObject<number>; nonInteractiveIds: string[]; isVirtualized: boolean; items: import("./useBaseListModel").Item<any>[]; }; events: { select(data: { id: string; }): void; selectAll(): void; unselectAll(): void; setSelectedIds(ids: string[] | "all"): void; remove(data: { id: string; nextId?: string | undefined; event?: Event | React.SyntheticEvent<Element, Event> | undefined; }): void; 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; }; selection: import("./useSelectionListModel").SelectionManager; navigation: import("./useCursorListModel").NavigationManager; getId: (item: any) => string; getTextValue: (item: any) => string; } | undefined; }, { readonly ref: (instance: Element | null | undefined) => void; readonly 'data-id': string; readonly disabled: true | undefined; readonly 'aria-setsize': number | undefined; readonly 'aria-posinset': number | undefined; readonly 'data-index': number | undefined; readonly style: React.CSSProperties; readonly id: string; }>; //# sourceMappingURL=useListItemRegister.d.ts.map