mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-02-27 11:12:45 +00:00
mui-datatables - Add missing types for arguments of customToolbarSelect (#33836)
* Add types for custom selected toolbar args * Fix lint errors * remove whitespaces
This commit is contained in:
parent
70fbf57f7b
commit
569a9c76fd
10
types/mui-datatables/index.d.ts
vendored
10
types/mui-datatables/index.d.ts
vendored
@ -1,6 +1,7 @@
|
||||
// Type definitions for mui-datatables 2.0
|
||||
// Project: https://github.com/gregnb/mui-datatables
|
||||
// Definitions by: Jeroen "Favna" Claassens <https://github.com/favna>
|
||||
// Ankith Konda <https://github.com/ankithkonda>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@ -122,7 +123,14 @@ export interface MUIDataTableOptions {
|
||||
expandableRows?: boolean;
|
||||
renderExpandableRow?: (rowData: string[], rowMeta: { dataIndex: number; rowIndex: number }) => React.ReactNode;
|
||||
customToolbar?: () => React.ReactNode;
|
||||
customToolbarSelect?: () => React.ReactNode;
|
||||
customToolbarSelect?: (
|
||||
selectedRows: {
|
||||
data: Array<{ index: number; dataIndex: number }>;
|
||||
lookup: { [key: number]: boolean };
|
||||
},
|
||||
displayData: Array<{ data: any[]; dataIndex: number }>,
|
||||
setSelectedRows: (rows: number[]) => void
|
||||
) => React.ReactNode;
|
||||
customFooter?: () => React.ReactNode;
|
||||
customSort?: (data: any[], colIndex: number, order: string) => any[];
|
||||
elevation?: number;
|
||||
|
||||
@ -25,6 +25,21 @@ class MuiCustomTable extends React.Component<Props> {
|
||||
separator: ','
|
||||
},
|
||||
sortFilterList: false,
|
||||
customToolbarSelect: (selectedRows, displayData, setSelectedRows) => {
|
||||
return (
|
||||
<span>
|
||||
Custom Selected Toolbar:{' '}
|
||||
{`${selectedRows.data.length} - ${JSON.stringify(displayData[0])}`}
|
||||
<button
|
||||
onClick={() => {
|
||||
setSelectedRows([]);
|
||||
}}
|
||||
>
|
||||
Set Selected Row to none
|
||||
</button>
|
||||
</span>
|
||||
);
|
||||
},
|
||||
textLabels: {
|
||||
body: {
|
||||
noMatch: 'Sorry, no matching records found',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user