UNPKG

@maherunlocker/custom-react-table

Version:

**Custom-react-table** is based on <code>React-Table v7</code>: collection of hooks for **building powerful tables and datagrid experiences**. These hooks are lightweight, composable, and ultra-extensible, but **do not render any markup or styles for you*

38 lines (37 loc) 2.14 kB
import React, { MouseEventHandler, PropsWithChildren, ReactElement } from 'react'; import { TableInstance } from 'react-table'; import { TableMouseEventHandler } from '../../types/react-table-config'; export declare const useStyles: (props?: any) => Record<"toolbar" | "leftButtons" | "rightButtons" | "leftIcons" | "rightIcons", string>; declare type InstanceActionButton<T extends Record<string, unknown>> = { instance: TableInstance<T>; icon?: JSX.Element; onClick: TableMouseEventHandler; enabled?: (instance: TableInstance<T>) => boolean; label: string; variant?: 'right' | 'left'; }; declare type ActionButton = { icon?: JSX.Element; onClick?: MouseEventHandler; enabled?: boolean; label: string; variant?: 'right' | 'left'; }; export declare const InstanceLabeledActionButton: <T extends Record<string, unknown>>({ instance, icon, onClick, label, enabled, }: InstanceActionButton<T>) => ReactElement; export declare const LabeledActionButton: ({ icon, onClick, label, enabled }: ActionButton) => ReactElement; export declare const InstanceSmallIconActionButton: <T extends Record<string, unknown>>({ instance, icon, onClick, label, enabled, variant, }: InstanceActionButton<T>) => ReactElement; export declare const SmallIconActionButton: ({ icon, onClick, label, enabled, variant, }: ActionButton) => ReactElement; declare type TableToolbarProps<T extends Record<string, unknown>> = { instance: TableInstance<T>; onAdd?: TableMouseEventHandler; onDelete?: TableMouseEventHandler; onEdit?: TableMouseEventHandler; showGlobalFilter?: boolean; showFilter?: boolean; showColumnIcon?: boolean; filterActive?: boolean; setLocalFilterActive?: React.Dispatch<React.SetStateAction<boolean>> | undefined; customJsxSideFilterButton?: React.ReactNode; }; export declare function TableToolbar<T extends Record<string, unknown>>({ instance, showGlobalFilter, showFilter, showColumnIcon, filterActive, setLocalFilterActive, customJsxSideFilterButton, }: PropsWithChildren<TableToolbarProps<T>>): ReactElement | null; export {};