Coverage 100% 😎 🤗
This commit is contained in:
parent
53a9ef5270
commit
bbddab3c80
5 changed files with 142 additions and 4 deletions
|
|
@ -8,13 +8,19 @@ const defaultProps = {
|
|||
class CSVDownload extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={};
|
||||
}
|
||||
|
||||
buildURI() {
|
||||
return buildURI(...arguments);
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
this.page = window.open(buildURI(this.props.data, this.props.headers), this.props.target, this.props.specs, this.props.replace);
|
||||
this.state.page = window.open(this.buildURI(this.props.data, this.props.headers), this.props.target, this.props.specs, this.props.replace);
|
||||
}
|
||||
|
||||
getWindow() {
|
||||
return this.page;
|
||||
return this.state.page;
|
||||
}
|
||||
|
||||
render(){
|
||||
|
|
|
|||
|
|
@ -6,12 +6,17 @@ import XObject from 'x-object/safe';
|
|||
class CSVLink extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.buildURI= this.buildURI.bind(this);
|
||||
}
|
||||
|
||||
buildURI() {
|
||||
return buildURI(...arguments);
|
||||
}
|
||||
|
||||
render(){
|
||||
return (
|
||||
<a {...XObject.filter(this.props, (k, v) => !PropsNotForwarded.includes(k))}
|
||||
href={buildURI(this.props.data, this.props.headers)}>
|
||||
href={this.buildURI(this.props.data, this.props.headers)}>
|
||||
{this.props.children}
|
||||
</a>
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue