forked from ssbeefeater/react-jsonschema-form-semanticui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0764819
Showing
11 changed files
with
784 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"stage": 0, | ||
"env": { | ||
"development": { | ||
"plugins": ["react-transform"] | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"parser": "babel-eslint", | ||
"rules": { | ||
"react/jsx-uses-react": 2, | ||
"react/jsx-uses-vars": 2, | ||
"react/react-in-jsx-scope": 2, | ||
|
||
"curly": [2], | ||
"indent": [2, 2], | ||
"quotes": [2, "double"], | ||
"linebreak-style": [2, "unix"], | ||
"semi": [2, "always"], | ||
"comma-dangle": [0], | ||
"no-unused-vars": [2, {"vars": "all", "args": "none"}], | ||
"no-console": [0] | ||
}, | ||
"env": { | ||
"es6": true, | ||
"browser": true, | ||
"node": true | ||
}, | ||
"extends": "eslint:recommended", | ||
"ecmaFeatures": { | ||
"modules": true, | ||
"jsx": true, | ||
"experimentalObjectRestSpread": true | ||
}, | ||
"plugins": [ | ||
"react" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
lib |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
sudo: false | ||
language: | ||
- node_js | ||
node_js: | ||
- "4" | ||
env: | ||
- ACTION=test | ||
- ACTION="run lint" | ||
script: | ||
- npm $ACTION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
react-jsonschema-form | ||
===================== | ||
|
||
A simple [React]() component capable of building forms from a [JSON schema](). | ||
|
||
Requires React 0.14+. | ||
|
||
## Installation | ||
|
||
``` | ||
$ npm install react-jsonschema-form --save | ||
``` | ||
|
||
## Usage | ||
|
||
```js | ||
import React, { Component } from "react"; | ||
import { render } from "react-dom"; | ||
|
||
import Form from "react-jsonschema-form"; | ||
|
||
const schema = { | ||
title: "Todo Tasks", | ||
type: "object", | ||
required: ["title"], | ||
properties: { | ||
title: {type: "string", title: "Title", default: "A new task"}, | ||
done: {type: "boolean", title: "Done?", default: false} | ||
} | ||
}; | ||
|
||
const log = (type) => console.log.bind(console, type); | ||
|
||
const App = ({schema}) => { | ||
return <Form schema={schema} | ||
onChange={log("changed")} | ||
onSubmit={log("submitted")} | ||
onError={log("errors")} />; | ||
}; | ||
|
||
render(<App schema={schema} />, document.getElementById("app")); | ||
``` | ||
|
||
## License | ||
|
||
Apache 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"name": "react-jsonschema-form", | ||
"version": "0.1.0", | ||
"description": "A simple React component capable of building forms from a JSON schema.", | ||
"scripts": { | ||
"build": "babel-node -d lib/ src/", | ||
"lint": "eslint src test", | ||
"tdd": "npm run test -- -w", | ||
"test": "NODE_ENV=test mocha --compilers js:babel/register --recursive --require ./test/setup-jsdom.js $(find test -name '*_test.js')" | ||
}, | ||
"main": "lib/index.js", | ||
"files": [ | ||
"lib" | ||
], | ||
"peerDependencies": { | ||
"react": "^0.14.3", | ||
"react-dom": "^0.14.3" | ||
}, | ||
"dependencies": { | ||
"jsonschema": "^1.0.2" | ||
}, | ||
"devDependencies": { | ||
"babel": "^5.8.20", | ||
"babel-eslint": "^4.1.6", | ||
"babel-loader": "^5.3.2", | ||
"babel-plugin-react-transform": "^1.1.1", | ||
"chai": "^3.3.0", | ||
"css-loader": "^0.15.6", | ||
"eslint": "^1.8.0", | ||
"eslint-plugin-react": "^3.6.3", | ||
"gh-pages": "^0.4.0", | ||
"jsdom": "^7.1.0", | ||
"json-loader": "^0.5.4", | ||
"mocha": "^2.3.0", | ||
"react-addons-test-utils": "^0.14.3", | ||
"rimraf": "^2.4.4", | ||
"sinon": "^1.17.2", | ||
"style-loader": "^0.12.3" | ||
}, | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/mozilla-services/react-jsonschema-form.git" | ||
}, | ||
"author": "Nicolas Perriault <[email protected]>", | ||
"keywords": [ | ||
"react", | ||
"form", | ||
"json-schema" | ||
], | ||
"license": "Apache-2.0", | ||
"homepage": "https://github.com/mozilla-services/react-jsonschema-form#readme" | ||
} |
Oops, something went wrong.