Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount() {
this.autonumeric = new AutoNumeric(this.input, this.props.value, {
...this.props.preDefined,
...this.props,
onChange: undefined,
onFocus: undefined,
onBlur: undefined,
onKeyPress: undefined,
onKeyUp: undefined,
onKeyDown: undefined,
watchExternalChanges: false,
});
}
componentWillUnmount() {
componentDidMount() {
const { currencySymbol, ...others } = this.props
this.autonumeric = new AutoNumeric(this.input, this.props.value, {
...this.props.preDefined,
...others,
onChange: undefined,
onFocus: undefined,
onBlur: undefined,
onKeyPress: undefined,
onKeyUp: undefined,
onKeyDown: undefined,
watchExternalChanges: false,
});
}
componentWillUnmount() {
unformatOnHover: PropTypes.bool,
unformatOnSubmit: PropTypes.bool,
valuesToStrings: PropTypes.object,
wheelOn: PropTypes.oneOf(["focus", "hover"]),
wheelStep: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
preDefined: PropTypes.object,
};
ReactNumeric.defaultProps = {
type: "text",
outputFormat: "number",
preDefined: {},
className: "asdf",
};
export const predefinedOptions = AutoNumeric.getPredefinedOptions();
/** Defines if the element should be set as read only on initialization. */
readOnly: PropTypes.bool,
/** predefined objects are available in <a href="https://www.nodenpm.com/autonumeric/4.5.1/detail.html#predefined-options">AutoNumeric</a>*/
preDefined: PropTypes.object,
};
CurrencyTextField.defaultProps = {
type: "text",
variant: "standard",
currencySymbol: "$",
outputFormat: "number",
textAlign: "right"
};
export default withStyles(styles)(CurrencyTextField)
export const predefinedOptions = AutoNumeric.getPredefinedOptions();