dromo-uploader-react
Advanced tools
Comparing version 2.0.8 to 2.0.9
@@ -16,3 +16,3 @@ import * as React from 'react'; | ||
}) & IImporterOptions; | ||
declare type CommonOptionalProps = { | ||
declare type CommonProps = { | ||
style?: React.CSSProperties; | ||
@@ -28,10 +28,14 @@ className?: string; | ||
onCancel?: () => void; | ||
children: React.ReactNode; | ||
children?: React.ReactNode; | ||
open?: boolean; | ||
}; | ||
declare type Props = (VerboseRequiredProps | SavedSchemaProps) & CommonOptionalProps; | ||
declare type Props = (VerboseRequiredProps | SavedSchemaProps) & CommonProps; | ||
export default class DromoReactUploader extends React.Component<Props> { | ||
dromo: any; | ||
open: () => void; | ||
componentDidMount(): void; | ||
componentDidUpdate(prevProps: Props): void; | ||
componentWillUnmount(): void; | ||
render(): JSX.Element; | ||
} | ||
export { IDeveloperField, IDeveloperSettings, IUser, IColumnHookInput, IColumnHookOutput, IColumnHook, IRowHookInput, IRowHookOutput, IRowHook, IValidatorField, IDeveloperStyleOverrides, IResultMetadata, IStepHook, IRowDeleteHook, IBeforeFinishCallback, IBulkRowHook, IImporterOptions }; |
@@ -90,3 +90,24 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } | ||
_proto.componentDidMount = function componentDidMount() { | ||
if (this.props.open) this.open(); | ||
}; | ||
_proto.componentDidUpdate = function componentDidUpdate(prevProps) { | ||
if (!prevProps.open && this.props.open) { | ||
this.open(); | ||
} | ||
if (prevProps.open && !this.props.open) { | ||
this.dromo.close(); | ||
} | ||
}; | ||
_proto.componentWillUnmount = function componentWillUnmount() { | ||
if (this.props.open) { | ||
this.dromo.close(); | ||
} | ||
}; | ||
_proto.render = function render() { | ||
if (this.props.children === undefined) return React.createElement(React.Fragment, null); | ||
return React.createElement("button", { | ||
@@ -93,0 +114,0 @@ style: this.props.style, |
@@ -1,2 +0,2 @@ | ||
import { createElement, Component } from 'react'; | ||
import { createElement, Fragment, Component } from 'react'; | ||
import DromoUploader from 'dromo-uploader-js'; | ||
@@ -88,3 +88,24 @@ | ||
_proto.componentDidMount = function componentDidMount() { | ||
if (this.props.open) this.open(); | ||
}; | ||
_proto.componentDidUpdate = function componentDidUpdate(prevProps) { | ||
if (!prevProps.open && this.props.open) { | ||
this.open(); | ||
} | ||
if (prevProps.open && !this.props.open) { | ||
this.dromo.close(); | ||
} | ||
}; | ||
_proto.componentWillUnmount = function componentWillUnmount() { | ||
if (this.props.open) { | ||
this.dromo.close(); | ||
} | ||
}; | ||
_proto.render = function render() { | ||
if (this.props.children === undefined) return createElement(Fragment, null); | ||
return createElement("button", { | ||
@@ -91,0 +112,0 @@ style: this.props.style, |
{ | ||
"name": "dromo-uploader-react", | ||
"version": "2.0.8", | ||
"version": "2.0.9", | ||
"description": "Easy to use data (CSV, TSV, Excel) importer", | ||
@@ -64,4 +64,4 @@ "author": "ankitgoyal100", | ||
"dependencies": { | ||
"dromo-uploader-js": "^2.0.8" | ||
"dromo-uploader-js": "^2.0.9" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
30531
233
Updateddromo-uploader-js@^2.0.9