UNPKG

@aveonline/ui-react

Version:

Home base for Aveonline design system - ecosystem react

55 lines (54 loc) 1.91 kB
import { ReactNode } from 'react'; import { ColumnDef, Row, Table } from '@tanstack/react-table'; import { IOptionDropdownButton } from '../../Dropdowns/DropdownButton/IDropdownButton'; import type { ISortItem as IAsyncSortItem, IPagination as IAsyncPagination, ISortTable as IAsyncSortTable, IOptionPagination } from './atoms'; import { IPropsEmptyState } from '../../EmptyState'; interface IAsyncTableToolbar<TData> { table: Table<TData>; } interface IAsyncPropsTable<TData, TValue> { columns: ColumnDef<TData, TValue>[]; data: TData[]; searchFilter?: boolean; placeholder?: string; hasPagination?: boolean; paginationOptionList?: number[]; sortTable?: boolean; sortItem?: IAsyncSortItem[]; rowItemSelected?: (item: TData[]) => void; optionDropdown?: IOptionDropdownButton[]; stateEmpty?: { title?: string; subtitle?: string; }; titleSortTable?: string; classNameTable?: string; classNameContainerTable?: string; classNameContainer?: string; emptyDataTable?: IPropsEmptyState; valueRow?: (rowData: TData) => void; totalRows?: { id: string; text: string; }[]; isLoading?: boolean; stickyHeader?: boolean; toolbar?: (table: IAsyncTableToolbar<TData>) => ReactNode; columnsVisibility?: { [keyColumn: string]: boolean; }; colorRow?: { color: string; condition: (value: TData) => boolean; }; optionPagination?: IOptionPagination; search?: (value: string) => void; } interface AsyncColorRowTable<TData extends Record<keyof TData, unknown>> { row: Row<TData>; data: TData[]; color: string; condition: (value: TData) => boolean; } declare type IAsyncEmptyState = IPropsEmptyState; export type { IAsyncPropsTable, IAsyncSortItem, IAsyncPagination, IAsyncSortTable, IAsyncEmptyState, IAsyncTableToolbar, AsyncColorRowTable };