forked from mbrn/material-table
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
161 lines (151 loc) · 5.11 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
import * as React from 'react';
import { IconProps } from '@material-ui/core/Icon';
import { string } from 'prop-types';
export interface MaterialTableProps {
actions?: (Action | ((rowData: any) => Action))[];
columns: Column[];
components?: Components;
data: object;
detailPanel?: ((rowData: any) => React.ReactNode) | {
icon?: string | React.ReactElement<any>;
openIcon?: string | React.ReactElement<any>;
tooltip?: string;
render: (rowData: any) => string | React.ReactNode;
}[];
icons?: Icons;
isLoading?: boolean;
title: string;
options?: Options;
localization?: Localization;
onChangeRowsPerPage?: (pageSize: number) => void;
onChangePage?: (page: number) => void;
onOrderChange?: (orderBy: number, orderDirection: ("asc" | "desc")) => void;
onRowClick?: (event?: React.MouseEvent, rowData?: any, toggleDetailPanel?: (panelIndex?: number) => void) => void;
onRowSelected?: (rowData: any) => void;
onSelectionChange?: (data: any[]) => void;
}
export interface Action {
icon: string | (() => React.ReactElement<any>);
isFreeAction?: boolean;
tooltip?: string;
onClick: (event: any, data: any) => void;
iconProps?: IconProps;
}
export interface Column {
cellStyle?: React.CSSProperties | ((data: any) => React.CSSProperties);
currencySetting?: { locale?: string, currencyCode?: string, minimumFractionDigits?: number, maximumFractionDigits?: number };
customFilterAndSearch?: (filter: any, rowData: any, columnDef: Column) => boolean;
customSort?: (data1: any, data2: any, type: (('row' | 'group'))) => number;
defaultFilter?: any;
defaultGroupOrder?: number;
defaultGroupSort?: ('asc' | 'desc');
defaultSort?: ('asc' | 'desc');
emptyValue?: string | React.ReactElement<any> | ((data: any) => React.ReactElement<any> | string);
field?: string;
filtering?: boolean;
headerStyle?: React.CSSProperties;
hidden?: boolean;
lookup?: object;
removable?: boolean;
render?: (data: any, type: ('row' | 'group')) => any;
searchable?: boolean;
sorting?: boolean;
title?: string;
type?: ('string' | 'boolean' | 'numeric' | 'date' | 'datetime' | 'time' | 'currency');
}
export interface Components {
Actions?: React.ComponentType<any>;
Body?: React.ComponentType<any>;
Cell?: React.ComponentType<any>;
Container?: React.ComponentType<any>;
FilterRow?: React.ComponentType<any>;
Header?: React.ComponentType<any>;
Pagination?: React.ComponentType<any>;
Row?: React.ComponentType<any>;
GroupRow?: React.ComponentType<any>;
Toolbar?: React.ComponentType<any>;
}
export const MTableToolbar: () => React.ReactElement<any>;
export const MTableActions: () => React.ReactElement<any>;
export const MTableBody: () => React.ReactElement<any>;
export const MTableCell: () => React.ReactElement<any>;
export const Container: () => React.ReactElement<any>;
export const MTableFilterRow: () => React.ReactElement<any>;
export const MTableHeader: () => React.ReactElement<any>;
export const MTablePagination: () => React.ReactElement<any>;
export const MTableBodyRow: () => React.ReactElement<any>;
export const MTableGroupRow: () => React.ReactElement<any>;
export interface Icons {
SortArrow: () => React.ReactElement<any>;
Check: () => React.ReactElement<any>;
DetailPanel: () => React.ReactElement<any>;
Export: () => React.ReactElement<any>;
Filter: () => React.ReactElement<any>;
FirstPage: () => React.ReactElement<any>;
LastPage: () => React.ReactElement<any>;
NextPage: () => React.ReactElement<any>;
PreviousPage: () => React.ReactElement<any>;
Search: () => React.ReactElement<any>;
ThirdStateCheck: () => React.ReactElement<any>;
ViewColumn: () => React.ReactElement<any>;
}
export interface Options {
actionsColumnIndex?: number;
columnsButton?: boolean;
doubleHorizontalScroll?: boolean;
emptyRowsWhenPaging?: boolean;
exportButton?: boolean;
exportDelimiter?: string;
exportFileName?: string;
filtering?: boolean;
header?: boolean;
headerStyle?: React.CSSProperties;
initialPage?: number;
loadingType?: ('overlay' | 'linear');
paging?: boolean;
grouping?: boolean;
pageSize?: number;
pageSizeOptions?: number[];
rowStyle?: React.CSSProperties | ((data: any) => React.CSSProperties);
showEmptyDataSourceMessage?: boolean;
search?: boolean;
searchFieldStyle?: React.CSSProperties;
selection?: boolean;
sorting?: boolean;
toolbar?: boolean;
}
export interface Localization {
body?: {
emptyDataSourceMessage?: string;
filterRow?: {
filterTooltip?: string;
};
};
header?: {
actions?: string;
};
grouping?: {
groupedBy?: string;
placeholder?: string;
};
pagination?: {
firstTooltip?: string;
previousTooltip?: string;
nextTooltip?: string;
lastTooltip?: string;
labelDisplayedRows?: string;
labelRowsPerPage?: string;
};
toolbar?: {
addRemoveColumns?: string;
nRowsSelected?: string;
showColumnsTitle?: string;
showColumnsAriaLabel?: string;
exportTitle?: string;
exportAriaLabel?: string;
exportName?: string;
searchTooltip?: string;
};
}
declare const MaterialTable: React.ComponentType<MaterialTableProps>;
export default MaterialTable;