decent
This commit is contained in:
45
web-components/dist/components/DataTable/DataTable.d.ts
vendored
Normal file
45
web-components/dist/components/DataTable/DataTable.d.ts
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
import React from 'react';
|
||||
import { ListItem, FilterOptions } from '../../types';
|
||||
export interface TableColumn {
|
||||
key: string;
|
||||
label: string;
|
||||
sortable?: boolean;
|
||||
filterable?: boolean;
|
||||
width?: string | number;
|
||||
render?: (value: any, item: ListItem) => React.ReactNode;
|
||||
}
|
||||
export interface TableAction {
|
||||
key: string;
|
||||
label: string;
|
||||
icon?: React.ReactNode;
|
||||
color?: string;
|
||||
onClick: (item: ListItem) => void;
|
||||
show?: (item: ListItem) => boolean;
|
||||
}
|
||||
export interface DataTableProps {
|
||||
data: ListItem[];
|
||||
columns: TableColumn[];
|
||||
loading?: boolean;
|
||||
error?: string | null;
|
||||
title?: string;
|
||||
total?: number;
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
onPageChange?: (page: number) => void;
|
||||
onAdd?: () => void;
|
||||
onEdit?: (item: ListItem) => void;
|
||||
onDelete?: (item: ListItem) => Promise<void>;
|
||||
onRefresh?: () => void;
|
||||
customActions?: TableAction[];
|
||||
searchable?: boolean;
|
||||
filterable?: boolean;
|
||||
filters?: FilterOptions;
|
||||
onFiltersChange?: (filters: FilterOptions) => void;
|
||||
withBorder?: boolean;
|
||||
withColumnBorders?: boolean;
|
||||
striped?: boolean;
|
||||
highlightOnHover?: boolean;
|
||||
emptyMessage?: string;
|
||||
}
|
||||
declare const DataTable: React.FC<DataTableProps>;
|
||||
export default DataTable;
|
||||
Reference in New Issue
Block a user