diff --git a/packages/grafana-ui/src/components/Table/TableInputCSV.story.tsx b/packages/grafana-ui/src/components/Table/TableInputCSV.story.tsx index 94a9484b42a..4eaa1dca9ff 100644 --- a/packages/grafana-ui/src/components/Table/TableInputCSV.story.tsx +++ b/packages/grafana-ui/src/components/Table/TableInputCSV.story.tsx @@ -12,14 +12,14 @@ TableInputStories.addDecorator(withCenteredStory); TableInputStories.add('default', () => { return ( -
- { - console.log('Data', data, text); - action('Data')(data, text); - }} - /> -
+ { + console.log('Data', data, text); + action('Data')(data, text); + }} + /> ); }); diff --git a/packages/grafana-ui/src/components/Table/TableInputCSV.test.tsx b/packages/grafana-ui/src/components/Table/TableInputCSV.test.tsx index 62d63a9df45..7052c69fa4b 100644 --- a/packages/grafana-ui/src/components/Table/TableInputCSV.test.tsx +++ b/packages/grafana-ui/src/components/Table/TableInputCSV.test.tsx @@ -9,6 +9,8 @@ describe('TableInputCSV', () => { const tree = renderer .create( { // console.log('Table:', table, 'from:', text); diff --git a/packages/grafana-ui/src/components/Table/TableInputCSV.tsx b/packages/grafana-ui/src/components/Table/TableInputCSV.tsx index b75f0935276..b45a8fba4c0 100644 --- a/packages/grafana-ui/src/components/Table/TableInputCSV.tsx +++ b/packages/grafana-ui/src/components/Table/TableInputCSV.tsx @@ -1,12 +1,13 @@ import React from 'react'; import debounce from 'lodash/debounce'; import { SeriesData } from '../../types/data'; -import { AutoSizer } from 'react-virtualized'; import { CSVConfig, readCSV } from '../../utils/csv'; interface Props { config?: CSVConfig; text: string; + width: string | number; + height: string | number; onSeriesParsed: (data: SeriesData[], text: string) => void; } @@ -18,7 +19,7 @@ interface State { /** * Expects the container div to have size set and will fill it 100% */ -class TableInputCSV extends React.PureComponent { +export class TableInputCSV extends React.PureComponent { constructor(props: Props) { super(props); @@ -58,28 +59,30 @@ class TableInputCSV extends React.PureComponent { }; render() { + const { width, height } = this.props; const { data } = this.state; - return ( - - {({ height, width }) => ( -
-