💄 cleanup
This commit is contained in:
parent
e5d27b832c
commit
49d7d39005
|
|
@ -1,5 +1,5 @@
|
|||
var React = require('react');
|
||||
var Formsy = require('./../..');
|
||||
var Formsy = require('formsy-react');
|
||||
|
||||
var currentYear = new Date().getFullYear();
|
||||
|
||||
|
|
@ -120,4 +120,4 @@ var Validations = React.createClass({
|
|||
}
|
||||
});
|
||||
|
||||
React.render(<App/>, document.getElementById('example'));
|
||||
React.render(<App/>, document.getElementById('example'));
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
var React = require('react');
|
||||
var Formsy = require('./../..');
|
||||
var Formsy = require('formsy-react');
|
||||
|
||||
var App = React.createClass({
|
||||
getInitialState: function() {
|
||||
|
|
@ -34,7 +34,7 @@ var MyOwnInput = React.createClass({
|
|||
// Add the Formsy Mixin
|
||||
mixins: [Formsy.Mixin],
|
||||
|
||||
// setValue() will set the value of the component, which in
|
||||
// setValue() will set the value of the component, which in
|
||||
// turn will validate it and the rest of the form
|
||||
changeValue: function (event) {
|
||||
this.setValue(event.currentTarget.value);
|
||||
|
|
@ -42,9 +42,9 @@ var MyOwnInput = React.createClass({
|
|||
render: function () {
|
||||
|
||||
// Set a specific className based on the validation
|
||||
// state of this component. showRequired() is true
|
||||
// when the value is empty and the required prop is
|
||||
// passed to the input. showError() is true when the
|
||||
// state of this component. showRequired() is true
|
||||
// when the value is empty and the required prop is
|
||||
// passed to the input. showError() is true when the
|
||||
// value typed is invalid
|
||||
var className = this.props.className + ' ' + (this.showRequired() ? 'required' : this.showError() ? 'error' : null);
|
||||
|
||||
|
|
@ -62,4 +62,4 @@ var MyOwnInput = React.createClass({
|
|||
}
|
||||
});
|
||||
|
||||
React.render(<App/>, document.getElementById('example'));
|
||||
React.render(<App/>, document.getElementById('example'));
|
||||
|
|
|
|||
|
|
@ -13,8 +13,9 @@ module.exports = {
|
|||
entry: fs.readdirSync(__dirname).reduce(function (entries, dir) {
|
||||
var isDraft = dir.charAt(0) === '_';
|
||||
|
||||
if (!isDraft && isDirectory(path.join(__dirname, dir)))
|
||||
if (!isDraft && isDirectory(path.join(__dirname, dir))) {
|
||||
entries[dir] = path.join(__dirname, dir, 'app.js');
|
||||
}
|
||||
|
||||
return entries;
|
||||
}, {}),
|
||||
|
|
@ -34,7 +35,7 @@ module.exports = {
|
|||
|
||||
resolve: {
|
||||
alias: {
|
||||
'react-router': '../../modules/index'
|
||||
'formsy-react': '../../src/main'
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -45,4 +46,4 @@ module.exports = {
|
|||
})
|
||||
]
|
||||
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ module.exports = {
|
|||
}
|
||||
return isDifferent;
|
||||
},
|
||||
|
||||
objectsDiffer: function (a, b) {
|
||||
var isDifferent = false;
|
||||
if (Object.keys(a).length !== Object.keys(b).length) {
|
||||
|
|
@ -23,10 +24,10 @@ module.exports = {
|
|||
}
|
||||
}, this);
|
||||
}
|
||||
return isDifferent;
|
||||
return isDifferent;
|
||||
},
|
||||
isSame: function (a, b) {
|
||||
|
||||
isSame: function (a, b) {
|
||||
if (typeof a !== typeof b) {
|
||||
return false;
|
||||
} else if (Array.isArray(a)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue