UNPKG

@awsui/components-react

Version:

AWS UI is a collection of [React](https://reactjs.org/) components that help create intuitive, responsive, and accessible user experiences for web applications. It is developed by Amazon Web Services (AWS). This work is available under the terms of the [A

52 lines (51 loc) 1.78 kB
import { KeyboardEvent } from 'react'; import { TableProps } from './interfaces'; export declare function useFocusMove(selectionType: TableProps['selectionType'], totalItems: number): { moveFocusDown?: undefined; moveFocusUp?: undefined; moveFocus?: undefined; } | { moveFocusDown: (event: KeyboardEvent) => void; moveFocusUp: (event: KeyboardEvent) => void; moveFocus: (sourceElement: HTMLElement, fromIndex: number, direction: -1 | 1) => void; }; interface AriaLabels<T> { allItemsSelectionLabel?: (data: TableProps.SelectionState<T>) => string; itemSelectionLabel: (data: TableProps.SelectionState<T>, row: T) => string; selectionGroupLabel: string; } export declare const focusMarkers: { item: { [x: string]: string; }; all: { [x: string]: string; }; root: { [x: string]: string; }; }; export declare function useSelection<T>({ items, selectedItems, selectionType, isItemDisabled, trackBy, onSelectionChange, ariaLabels }: Pick<TableProps<T>, 'items' | 'selectedItems' | 'selectionType' | 'isItemDisabled' | 'trackBy' | 'onSelectionChange'> & { ariaLabels?: AriaLabels<T>; }): { isItemSelected: (item: T) => boolean; selectAllProps: { name: string; disabled: boolean; selectionType: "single" | "multi" | undefined; indeterminate: boolean; checked: boolean; onChange: () => void; ariaLabel: string | undefined; }; getItemSelectionProps: (item: T) => { name: string; selectionType: "single" | "multi" | undefined; ariaLabel: string | undefined; onChange: () => void; checked: boolean; disabled: boolean; }; updateShiftToggle: (value: boolean) => void; }; export {};