Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Domino987 committed Jun 6, 2021
2 parents 3718162 + d31df8b commit 5e9ec31
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 36 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#### 3.0.2 (2021-06-03)

#### 3.0.1 (2021-06-01)

##### Bug Fixes
Expand Down
13 changes: 13 additions & 0 deletions __tests__/demo/demo-components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,19 @@ export function Basic() {
);
}

export function BasicRef() {
const tableref = React.useRef();
console.log(tableref);
return (
<MaterialTable
tableRef={tableref}
title="Basic"
columns={global_cols}
data={global_data}
/>
);
}

/*
export function CustomExport() {
return (
Expand Down
4 changes: 4 additions & 0 deletions __tests__/demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
DefaultOrderIssue,
TestingNewActionHandlersProp,
BulkEdit,
BasicRef,
BulkEditWithDetailPanel,
ExportData,
CustomExport,
Expand All @@ -43,6 +44,9 @@ render(
<h1>Basic</h1>
<Basic />

<h1>Basic Ref</h1>
<BasicRef />

{/*
<h1>Export Data</h1>
<ExportData />
Expand Down
34 changes: 14 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "3.0.1",
"version": "3.0.2",
"description": "Datatable for React based on https://material-ui.com/api/table/ with additional features",
"main": "dist/index.js",
"types": "types/index.d.ts",
Expand Down
16 changes: 1 addition & 15 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,6 @@ import { IconProps } from '@material-ui/core/Icon';
import SvgIcon from '@material-ui/core/SvgIcon';
import { OnHandlers } from './helper';

declare module '@material-table/core/exporters' {
export function ExportCsv(
columns: Array<any>,
data: Array<any>,
filename: string,
delimeter?: string
): void;
export function ExportPdf(
columns: Array<any>,
data: Array<any>,
filename: string
): void;
}

type SvgIconComponent = typeof SvgIcon;

export interface MaterialTableProps<RowData extends object> {
Expand Down Expand Up @@ -99,7 +85,7 @@ export interface MaterialTableProps<RowData extends object> {
currentData: RowData[];
}) => { value: unknown; style: React.CSSProperties } | unknown;
style?: React.CSSProperties;
tableRef?: any;
tableRef?: React.RefObject<any> | React.MutableRefObject<undefined>;
page?: number;
totalCount?: number;
}
Expand Down

0 comments on commit 5e9ec31

Please sign in to comment.