Skip to content

Commit

Permalink
Bugfixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
m.volkov authored and m.volkov committed Feb 23, 2017
1 parent b761978 commit 44bd22c
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ import { ValidatorComponent } from 'react-material-ui-form-validator';
export default class CustomCheckboxValidator extends ValidatorComponent {
render() {
const { errorMessage, validators, requiredError, ...rest } = this.props;
const { errorMessages, validators, requiredError, ...rest } = this.props;
const { isValid } = this.state;
const errorMessage = !isValid && this.getErrorMessage();
return (
Expand Down
4 changes: 2 additions & 2 deletions lib/AutoCompleteValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ var AutoCompleteValidator = function (_ValidatorComponent) {
value: function render() {
// eslint-disable-next-line
var _props = this.props,
errorMessage = _props.errorMessage,
errorMessages = _props.errorMessages,
validators = _props.validators,
requiredError = _props.requiredError,
rest = _objectWithoutProperties(_props, ['errorMessage', 'validators', 'requiredError']);
rest = _objectWithoutProperties(_props, ['errorMessages', 'validators', 'requiredError']);

var isValid = this.state.isValid;

Expand Down
4 changes: 2 additions & 2 deletions lib/DateValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ var DateValidator = function (_ValidatorComponent) {
value: function render() {
// eslint-disable-next-line
var _props = this.props,
errorMessage = _props.errorMessage,
errorMessages = _props.errorMessages,
validators = _props.validators,
requiredError = _props.requiredError,
rest = _objectWithoutProperties(_props, ['errorMessage', 'validators', 'requiredError']);
rest = _objectWithoutProperties(_props, ['errorMessages', 'validators', 'requiredError']);

var isValid = this.state.isValid;

Expand Down
4 changes: 2 additions & 2 deletions lib/SelectValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ var SelectValidator = function (_ValidatorComponent) {
value: function render() {
// eslint-disable-next-line
var _props = this.props,
errorMessage = _props.errorMessage,
errorMessages = _props.errorMessages,
validators = _props.validators,
requiredError = _props.requiredError,
rest = _objectWithoutProperties(_props, ['errorMessage', 'validators', 'requiredError']);
rest = _objectWithoutProperties(_props, ['errorMessages', 'validators', 'requiredError']);

var isValid = this.state.isValid;

Expand Down
4 changes: 2 additions & 2 deletions lib/TextValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ var TextValidator = function (_ValidatorComponent) {
value: function render() {
// eslint-disable-next-line
var _props = this.props,
errorMessage = _props.errorMessage,
errorMessages = _props.errorMessages,
validators = _props.validators,
requiredError = _props.requiredError,
rest = _objectWithoutProperties(_props, ['errorMessage', 'validators', 'requiredError']);
rest = _objectWithoutProperties(_props, ['errorMessages', 'validators', 'requiredError']);

var isValid = this.state.isValid;

Expand Down
4 changes: 2 additions & 2 deletions lib/TimeValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ var TimeValidator = function (_ValidatorComponent) {
value: function render() {
// eslint-disable-next-line
var _props = this.props,
errorMessage = _props.errorMessage,
errorMessages = _props.errorMessages,
validators = _props.validators,
requiredError = _props.requiredError,
rest = _objectWithoutProperties(_props, ['errorMessage', 'validators', 'requiredError']);
rest = _objectWithoutProperties(_props, ['errorMessages', 'validators', 'requiredError']);

var isValid = this.state.isValid;

Expand Down
8 changes: 4 additions & 4 deletions lib/ValidatorComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var ValidatorComponent = function (_React$Component) {
};

_this.validate = _this.validate.bind(_this);
_this.getErrorMessages = _this.getErrorMessages.bind(_this);
_this.getErrorMessage = _this.getErrorMessage.bind(_this);
_this.makeInvalid = _this.makeInvalid.bind(_this);
_this.instantValidate = true;
_this.configure = _this.configure.bind(_this);
Expand Down Expand Up @@ -71,8 +71,8 @@ var ValidatorComponent = function (_React$Component) {
this.context.form.detachFromForm(this);
}
}, {
key: 'getErrorMessages',
value: function getErrorMessages() {
key: 'getErrorMessage',
value: function getErrorMessage() {
var type = _typeof(this.state.errorMessages);

if (type === 'string') {
Expand Down Expand Up @@ -143,7 +143,7 @@ ValidatorComponent.propTypes = {
errorMessages: _react2.default.PropTypes.array,
validators: _react2.default.PropTypes.array,
name: _react2.default.PropTypes.string,
value: _react2.default.PropTypes.oneOf([_react2.default.PropTypes.string, _react2.default.PropTypes.number]).isRequired
value: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.number]).isRequired
};

ValidatorComponent.defaultProps = {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-material-ui-form-validator",
"version": "0.0.2",
"version": "0.0.5",
"description": "Simple validator for forms designed with material-ui components.",
"main": "./lib/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/AutoCompleteValidator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default class AutoCompleteValidator extends ValidatorComponent {

render() {
// eslint-disable-next-line
const { errorMessage, validators, requiredError, ...rest } = this.props;
const { errorMessages, validators, requiredError, ...rest } = this.props;
const { isValid } = this.state;
return (
<AutoComplete
Expand Down
2 changes: 1 addition & 1 deletion src/DateValidator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default class DateValidator extends ValidatorComponent {

render() {
// eslint-disable-next-line
const { errorMessage, validators, requiredError, ...rest } = this.props;
const { errorMessages, validators, requiredError, ...rest } = this.props;
const { isValid } = this.state;
return (
<DatePicker
Expand Down
2 changes: 1 addition & 1 deletion src/SelectValidator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default class SelectValidator extends ValidatorComponent {

render() {
// eslint-disable-next-line
const { errorMessage, validators, requiredError, ...rest } = this.props;
const { errorMessages, validators, requiredError, ...rest } = this.props;
const { isValid } = this.state;
return (
<SelectField
Expand Down
2 changes: 1 addition & 1 deletion src/TextValidator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default class TextValidator extends ValidatorComponent {

render() {
// eslint-disable-next-line
const { errorMessage, validators, requiredError, ...rest } = this.props;
const { errorMessages, validators, requiredError, ...rest } = this.props;
const { isValid } = this.state;
return (
<TextField
Expand Down
2 changes: 1 addition & 1 deletion src/TimeValidator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default class TimeValidator extends ValidatorComponent {

render() {
// eslint-disable-next-line
const { errorMessage, validators, requiredError, ...rest } = this.props;
const { errorMessages, validators, requiredError, ...rest } = this.props;
const { isValid } = this.state;
return (
<TimePicker
Expand Down
2 changes: 1 addition & 1 deletion src/ValidatorComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ ValidatorComponent.propTypes = {
errorMessages: React.PropTypes.array,
validators: React.PropTypes.array,
name: React.PropTypes.string,
value: React.PropTypes.oneOf([
value: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number,
]).isRequired,
Expand Down

0 comments on commit 44bd22c

Please sign in to comment.