@uva-glass/component-library
Version:
React components UvA
24 lines (23 loc) • 1.25 kB
TypeScript
import { ReactElement } from 'react';
import { SortableItemProps } from './components/SortableItem';
export type Index = string | number;
export type SortableItemColors = 'grey-200' | 'white';
export interface SortableProps<T = unknown> {
/** The elements to show inside the Sortable. */
children: ReactElement[] | string[];
/** The data objects that are actually being sorted. */
childrenData?: T[];
/** The placement of each item Handle (6 dots 2x3). */
ItemHandlePlacement?: SortableItemProps['handlePlacement'];
/** If true, a scrollable version of the list will be rendered (max height 21rem/336px). */
scrollable?: boolean;
/** If true, the sorting will be disabled. */
disabled?: boolean;
/** Hide the numbers shown next to the sortable elements. */
hideNumbers?: boolean;
/** Change the color of the SortableItem wrapper. */
sortableItemColor?: SortableItemColors;
/** The callback function that is invoked when new sorting takes place. */
onSort?: (items: T[]) => void;
}
export declare const Sortable: <T>({ children, childrenData, ItemHandlePlacement, scrollable, disabled, onSort, hideNumbers, sortableItemColor, }: SortableProps<T>) => import("react/jsx-runtime").JSX.Element;