10000 Update dependencies. Some minor changes. · coderabsolute/formsy-react@112819f · GitHub
[go: up one dir, main page]

Skip to content

Commit 112819f

Browse files
author
Semigradsky
committed
Update dependencies. Some minor changes.
1 parent 4931256 commit 112819f

16 files changed

+66
-159
lines changed

.babelrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"presets": [
3+
"react",
4+
"es2015",
5+
"stage-2"
6+
]
7+
}

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
.DS_Store
2-
build
31
node_modules
42
lib

.npmignore

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
build/
2-
bower.json
3-
Gulpfile.js
1+
.babelrc
2+
.editorconfig
3+
.travis.yml
4+
testrunner.js
5+
webpack.production.config.js
6+
examples/
7+
release/
8+
tests/

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014 Gloppens EDB Lag
3+
Copyright (c) 2014-2016 Gloppens EDB Lag
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 21 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ A form input builder and validator for React JS
66
| [How to use](#how-to-use) | [API](/API.md) | [Examples](/examples) |
77
|---|---|---|
88

9-
### From version 0.12.0 Formsy only supports React 0.13.1 and up
10-
119
## <a name="background">Background</a>
1210
I wrote an article on forms and validation with React JS, [Nailing that validation with React JS](http://christianalfoni.github.io/javascript/2014/10/22/nailing-that-validation-with-reactjs.html), the result of that was this extension.
1311

@@ -48,29 +46,29 @@ Complete API reference is available [here](/API.md).
4846

4947
#### Formsy gives you a form straight out of the box
5048

51-
```javascript
52-
/** @jsx React.DOM */
53-
var Formsy = require('formsy-react');
54-
var MyAppForm = React.createClass({
55-
getInitialState: function () {
49+
```jsx
50+
import Formsy from 'formsy-react';
51+
52+
const MyAppForm = React.createClass({
53+
getInitialState() {
5654
return {
5755
canSubmit: false
5856
}
5957
},
60-
enableButton: function () {
58+
enableButton() {
6159
this.setState({
6260
canSubmit: true
6361
});
6462
},
65-
disableButton: function () {
63+
disableButton() {
6664
this.setState({
6765
canSubmit: false
6866
});
6967
},
70-
submit: function (model) {
68+
submit(model) {
7169
someDep.saveEmail(model.email);
7270
},
73-
render: function () {
71+
render() {
7472
return (
7573
<Formsy.Form onValidSubmit={this.submit} onValid={this.enableButton} onInvalid={this.disableButton}>
7674
<MyOwnInput name="email" validations="isEmail" validationError="This is not a valid email" required/>
@@ -84,31 +82,31 @@ Complete API reference is available [here](/API.md).
8482
This code results in a form with a submit button that will run the `submit` method when the submit button is clicked with a valid email. The submit button is disabled as long as the input is empty ([required](/API.md#required)) or the value is not an email ([isEmail](/API.md#validators)). On validation error it will show the message: "This is not a valid email".
8583

8684
#### Building a form element (required)
87-
```javascript
88-
/** @jsx React.DOM */
89-
var Formsy = require('formsy-react');
90-
var MyOwnInput = React.createClass({
85+
```jsx
86+
import Formsy from 'formsy-react';
87+
88+
const MyOwnInput = React.createClass({
9189

9290
// Add the Formsy Mixin
9391
mixins: [Formsy.Mixin],
9492

9593
// setValue() will set the value of the component, which in
9694
// turn will validate it and the rest of the form
97-
changeValue: function (event) {
95+
changeValue(event) {
9896
this.setValue(event.currentTarget.value);
9997
},
100-
render: function () {
10198

99+
render() {
102100
// Set a specific className based on the validation
103101
// state of this component. showRequired() is true
104102
// when the value is empty and the required prop is
105103
// passed to the input. showError() is true when the
106104
// value typed is invalid
107-
var className = this.showRequired() ? 'required' : this.showError() ? 'error' : null;
105+
const className = this.showRequired() ? 'required' : this.showError() ? 'error' : null;
108106

109107
// An error message is returned ONLY if the component is invalid
110108
// or the server has returned an error message
111-
var errorMessage = this.getErrorMessage();
109+
const errorMessage = this.getErrorMessage();
112110

113111
return (
114112
<div className={className}>
@@ -130,32 +128,9 @@ The form element component is what gives the form validation functionality to wh
130128
## Contribute
131129
- Fork repo
132130
- `npm install`
133-
- `npm start` runs the development server on `localhost:8080`
131+
- `npm run examples` runs the development server on `localhost:8080`
134132
- `npm test` runs the tests
135133

136-
License
137-
-------
138-
139-
formsy-react is licensed under the [MIT license](LICENSE).
140-
141-
> The MIT License (MIT)
142-
>
143-
> Copyright (c) 2015 Gloppens EDB Lag
144-
>
145-
> Permission is hereby granted, free of charge, to any person obtaining a copy
146-
> of this software and associated documentation files (the "Software"), to deal
147-
> in the Software without restriction, including without limitation the rights
148-
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
149-
> copies of the Software, and to permit persons to whom the Software is
150-
> furnished to do so, subject to the following conditions:
151-
>
152-
> The above copyright notice and this permission notice shall be included in
153-
> all copies or substantial portions of the Software.
154-
>
155-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
156-
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
157-
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
158-
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
159-
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
160-
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
161-
> THE SOFTWARE.
134+
## License
135+
136+
[MIT](/LICENSE)

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "formsy-react",
3-
"version": "0.16.0",
3+
"version": "0.18.0",
44
"description": "A form input builder and validator for React JS",
55
"repository": {
66
"type": "git",
@@ -13,7 +13,7 @@
1313
"Gulpfile.js"
1414
],
1515
"dependencies": {
16-
"react": "^0.13.1"
16+
"react": "^0.14.7 || ^15.0.0"
1717
},
1818
"keywords": [
1919
"react",

build/index.html

Lines changed: 0 additions & 9 deletions
This file was deleted.

build/test.js

Lines changed: 0 additions & 55 deletions
This file was deleted.

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
},
99
"main": "lib/main.js",
1010
"scripts": {
11-
"start": "webpack-dev-server --content-base build",
1211
"deploy": "NODE_ENV=production webpack -p --config webpack.production.config.js",
1312
"test": "babel-node testrunner",
1413
"examples": "webpack-dev-server --config examples/webpack.config.js --content-base examples",
@@ -24,24 +23,25 @@
2423
"react-component"
2524
],
2625
"dependencies": {
27-
"form-data-to-object": "^0.1.0"
26+
"form-data-to-object": "^0.2.0"
2827
},
2928
"devDependencies": {
30-
"babel": "^5.6.4",
31-
"babel-core": "^5.1.11",
32-
"babel-loader": "^5.0.0",
29+
"babel-cli": "^6.6.5",
30+
"babel-loader": "^6.2.4",
31+
"babel-preset-es2015": "^6.6.0",
32+
"babel-preset-react": "^6.5.0",
33+
"babel-preset-stage-2": "^6.5.0",
3334
"jsdom": "^6.5.1",
34-
"lolex": "^1.3.2",
3535
"nodeunit": "^0.9.1",
36-
"react": "^0.14.0-rc1",
37-
"react-addons-pure-render-mixin": "^0.14.2",
38-
"react-addons-test-utils": "^0.14.0-rc1",
39-
"react-dom": "^0.14.0-rc1",
40-
"sinon": "^1.17.1",
41-
"webpack": "^1.7.3",
42-
"webpack-dev-server": "^1.7.0"
36+
"react": "^15.0.0",
37+
"react-addons-pure-render-mixin": "^15.0.0",
38+
"react-addons-test-utils": "^15.0.0",
39+
"react-dom": "^15.0.0",
40+
"sinon": "^1.17.3",
41+
"webpack": "^1.12.14",
42+
"webpack-dev-server": "^1.14.1"
4343
},
4444
"peerDependencies": {
45-
"react": "^0.14.0"
45+
"react": "^0.14.0 || ^15.0.0"
4646
}
4747
}

0 commit comments

Comments
 (0)
0