@workday/canvas-kit-react
Version:
The parent module that contains all Workday Canvas Kit React components
128 lines • 4.08 kB
TypeScript
/**
* This elemProps hook measures a list item and reports it to an `OverflowListModel`. This is used
* in overflow detection.
*
* ```ts
* const useMyItem = composeHooks(
* useOverflowListItemMeasure,
* useListRegisterItem,
* )
* ```
*/
export declare const useOverflowListItemMeasure: import("@workday/canvas-kit-react/common").BehaviorHook<{
state: {
hiddenIds: string[];
itemSizeCache: Record<string, number>;
itemWidthCache: Record<string, number>;
containerSize: number;
containerWidth: number;
containerGap: number;
overflowTargetWidth: number;
selectedIds: string[] | "all";
unselectedIds: string[];
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: {
select(data: {
id: string;
}): void;
setContainerSize(data: {
width?: number | undefined;
height?: number | undefined;
}): void;
setContainerWidth(data: {
width?: number | undefined;
}): void;
setContainerGap(data: {
size: number;
}): void;
setOverflowTargetSize(data: {
width: number;
height: number;
}): void;
setOverflowTargetWidth(data: {
width: number;
}): void;
addItemWidth(data: {
id: string;
width: number;
}): void;
addItemSize(data: {
id: string;
width: number;
height: number;
}): void;
removeItemSize(data: {
id: string;
}): void;
removeItemWidth(data: {
id: string;
}): void;
addHiddenKey(data: {
id: string;
}): void;
removeHiddenKey(data: {
id: string;
}): void;
selectAll(): void;
unselectAll(): void;
setSelectedIds(ids: string[] | "all"): void;
remove(data: {
id: string;
nextId?: string | undefined;
event?: Event | import("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;
}, {
readonly ref: (instance: HTMLElement | null) => void;
readonly 'aria-hidden': true | undefined;
readonly style: {};
readonly inert: "" | undefined;
}>;
//# sourceMappingURL=useOverflowListItemMeasure.d.ts.map