-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
Showing
42 changed files
with
1,509 additions
and
31 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
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -38,6 +38,5 @@ | |
], | ||
"sourceMap": false, | ||
"instrument": false | ||
}, | ||
"dependencies": {} | ||
} | ||
} |
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
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
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
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,11 @@ | ||
# uniforms-material | ||
|
||
> Material UI components for `uniforms`. | ||
## Install | ||
|
||
```sh | ||
$ npm install uniforms-material | ||
``` | ||
|
||
For more in depth documentation see: [https://github.com/vazco/uniforms/](https://github.com/vazco/uniforms/). |
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,109 @@ | ||
{ | ||
"name": "uniforms-material", | ||
"version": "1.9.0", | ||
"main": "index.js", | ||
"jsnext:main": "src/index.js", | ||
"description": "Material UI components for uniforms.", | ||
"repository": "https://github.com/vazco/uniforms/tree/master/packages/uniforms-material", | ||
"homepage": "https://github.com/vazco/uniforms/", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/vazco/uniforms/issues" | ||
}, | ||
"keyword": [ | ||
"form", | ||
"forms", | ||
"meteor", | ||
"react", | ||
"react-component", | ||
"schema", | ||
"validation" | ||
], | ||
"files": [ | ||
"*.js", | ||
"src/" | ||
], | ||
"scripts": { | ||
"build": "babel --out-dir . src", | ||
"clean": "rimraf *.js coverage .nyc_output", | ||
"cover": "cross-env NODE_ENV=cover nyc npm test", | ||
"lint": "eslint src test", | ||
"prepublish": "npm run build", | ||
"pretest": "npm run lint", | ||
"reset": "rimraf node_modules", | ||
"test": "babel-node node_modules/.bin/_mocha --require test/index.js test --reporter list" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "6.22.2", | ||
"babel-eslint": "7.1.1", | ||
"babel-plugin-istanbul": "3.1.2", | ||
"babel-plugin-transform-object-assign": "6.22.0", | ||
"babel-plugin-transform-react-inline-elements": "6.22.0", | ||
"babel-plugin-transform-runtime": "6.22.0", | ||
"babel-preset-es2015": "6.22.0", | ||
"babel-preset-react": "6.22.0", | ||
"babel-preset-stage-0": "6.22.0", | ||
"babel-runtime": "6.22.0", | ||
"chai": "4.0.0-canary.1", | ||
"cross-env": "3.1.4", | ||
"enzyme": "2.7.1", | ||
"eslint": "3.15.0", | ||
"eslint-config-vazco": "2.2.1", | ||
"eslint-plugin-babel": "4.0.1", | ||
"eslint-plugin-react": "6.9.0", | ||
"eslint-plugin-vazco": "1.0.0", | ||
"jsdom": "9.10.0", | ||
"material-ui": "0.16.7", | ||
"mocha": "3.2.0", | ||
"nyc": "10.1.2", | ||
"react": "15.4.2", | ||
"react-addons-test-utils": "15.4.2", | ||
"react-dom": "15.4.2", | ||
"react-tap-event-plugin": "2.0.1", | ||
"rimraf": "2.5.4", | ||
"sinon": "2.0.0-pre.5" | ||
}, | ||
"peerDependencies": { | ||
"material-ui": "^0.16.7", | ||
"react": "^15.0.0 || ^0.14.0", | ||
"uniforms": "^1.9.0" | ||
}, | ||
"babel": { | ||
"plugins": [ | ||
"transform-object-assign", | ||
"transform-react-inline-elements", | ||
"transform-runtime" | ||
], | ||
"presets": [ | ||
"es2015", | ||
"react", | ||
"stage-0" | ||
], | ||
"env": { | ||
"cover": { | ||
"plugins": [ | ||
"istanbul" | ||
] | ||
} | ||
} | ||
}, | ||
"eslintConfig": { | ||
"root": true, | ||
"extends": [ | ||
"vazco" | ||
] | ||
}, | ||
"nyc": { | ||
"reporter": [ | ||
"html" | ||
], | ||
"require": [ | ||
"babel-register" | ||
], | ||
"sourceMap": false, | ||
"instrument": false | ||
}, | ||
"dependencies": { | ||
"babel-runtime": "^6.20.0" | ||
} | ||
} |
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,39 @@ | ||
import connectField from 'uniforms/connectField'; | ||
import invariant from 'fbjs/lib/invariant'; | ||
import {createElement} from 'react'; | ||
|
||
import NumField from './NumField'; | ||
import BoolField from './BoolField'; | ||
import DateField from './DateField'; | ||
import ListField from './ListField'; | ||
import NestField from './NestField'; | ||
import TextField from './TextField'; | ||
import RadioField from './RadioField'; | ||
import SelectField from './SelectField'; | ||
|
||
const Auto = ({component, ...props}) => { | ||
if (component === undefined) { | ||
if (props.allowedValues) { | ||
if (props.checkboxes && props.fieldType !== Array) { | ||
component = RadioField; | ||
} else { | ||
component = SelectField; | ||
} | ||
} else { | ||
switch (props.fieldType) { | ||
case Date: component = DateField; break; | ||
case Array: component = ListField; break; | ||
case Number: component = NumField; break; | ||
case Object: component = NestField; break; | ||
case String: component = TextField; break; | ||
case Boolean: component = BoolField; break; | ||
} | ||
|
||
invariant(component, 'Unsupported field type: %s', props.fieldType.toString()); | ||
} | ||
} | ||
|
||
return createElement(component, props); | ||
}; | ||
|
||
export default connectField(Auto, {ensureValue: false, includeInChain: false, initialValue: false}); |
Oops, something went wrong.