react-jsonschema-form
Advanced tools
Comparing version 0.19.1 to 0.19.2
@@ -7,14 +7,8 @@ "use strict"; | ||
var _react2 = require("react"); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _react3 = _interopRequireDefault(_react2); | ||
var _react = require("react"); | ||
var _reactTransformHmr3 = require("react-transform-hmr"); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _reactTransformHmr4 = _interopRequireDefault(_reactTransformHmr3); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _class, _temp; | ||
var _utils = require("../../utils"); | ||
@@ -34,22 +28,3 @@ | ||
var _components = { | ||
ArrayField: { | ||
displayName: "ArrayField" | ||
} | ||
}; | ||
var _reactTransformHmr2 = (0, _reactTransformHmr4.default)({ | ||
filename: "src/components/fields/ArrayField.js", | ||
components: _components, | ||
locals: [module], | ||
imports: [_react3.default] | ||
}); | ||
function _wrapComponent(id) { | ||
return function (Component) { | ||
return _reactTransformHmr2(Component, id); | ||
}; | ||
} | ||
var ArrayField = _wrapComponent("ArrayField")((_temp = _class = function (_Component) { | ||
var ArrayField = function (_Component) { | ||
_inherits(ArrayField, _Component); | ||
@@ -170,3 +145,3 @@ | ||
if ((0, _utils.isMultiSelect)(schema)) { | ||
return _react3.default.createElement(_SelectWidget2.default, { | ||
return _react2.default.createElement(_SelectWidget2.default, { | ||
multiple: true, | ||
@@ -182,7 +157,7 @@ onChange: this._onSelectChange, | ||
return _react3.default.createElement( | ||
return _react2.default.createElement( | ||
"fieldset", | ||
{ | ||
className: "field field-array field-array-of-" + itemsSchema.type }, | ||
title ? _react3.default.createElement( | ||
title ? _react2.default.createElement( | ||
"legend", | ||
@@ -192,3 +167,3 @@ null, | ||
) : null, | ||
schema.description ? _react3.default.createElement( | ||
schema.description ? _react2.default.createElement( | ||
"div", | ||
@@ -198,3 +173,3 @@ { className: "field-description" }, | ||
) : null, | ||
_react3.default.createElement( | ||
_react2.default.createElement( | ||
"div", | ||
@@ -204,6 +179,6 @@ { className: "array-item-list" }, | ||
var itemErrorSchema = errorSchema ? errorSchema[index] : undefined; | ||
return _react3.default.createElement( | ||
return _react2.default.createElement( | ||
"div", | ||
{ key: index }, | ||
_react3.default.createElement(SchemaField, { | ||
_react2.default.createElement(SchemaField, { | ||
schema: itemsSchema, | ||
@@ -216,6 +191,6 @@ uiSchema: uiSchema.items, | ||
registry: _this3.props.registry }), | ||
_react3.default.createElement( | ||
_react2.default.createElement( | ||
"p", | ||
{ className: "array-item-remove" }, | ||
_react3.default.createElement( | ||
_react2.default.createElement( | ||
"button", | ||
@@ -230,6 +205,6 @@ { type: "button", | ||
), | ||
_react3.default.createElement( | ||
_react2.default.createElement( | ||
"p", | ||
{ className: "array-item-add" }, | ||
_react3.default.createElement( | ||
_react2.default.createElement( | ||
"button", | ||
@@ -252,16 +227,19 @@ { type: "button", onClick: this._onAddClick }, | ||
return ArrayField; | ||
}(_react2.Component), _class.defaultProps = { | ||
}(_react.Component); | ||
ArrayField.defaultProps = { | ||
uiSchema: {} | ||
}, _temp)); | ||
}; | ||
if (process.env.NODE_ENV !== "production") { | ||
ArrayField.propTypes = { | ||
schema: _react2.PropTypes.object.isRequired, | ||
uiSchema: _react2.PropTypes.object, | ||
errorSchema: _react2.PropTypes.object, | ||
onChange: _react2.PropTypes.func.isRequired, | ||
formData: _react2.PropTypes.array, | ||
registry: _react2.PropTypes.shape({ | ||
widgets: _react2.PropTypes.objectOf(_react2.PropTypes.func).isRequired, | ||
fields: _react2.PropTypes.objectOf(_react2.PropTypes.func).isRequired | ||
schema: _react.PropTypes.object.isRequired, | ||
uiSchema: _react.PropTypes.object, | ||
errorSchema: _react.PropTypes.object, | ||
onChange: _react.PropTypes.func.isRequired, | ||
formData: _react.PropTypes.array, | ||
registry: _react.PropTypes.shape({ | ||
widgets: _react.PropTypes.objectOf(_react.PropTypes.func).isRequired, | ||
fields: _react.PropTypes.objectOf(_react.PropTypes.func).isRequired | ||
}) | ||
@@ -268,0 +246,0 @@ }; |
@@ -7,14 +7,8 @@ "use strict"; | ||
var _react2 = require("react"); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _react3 = _interopRequireDefault(_react2); | ||
var _react = require("react"); | ||
var _reactTransformHmr3 = require("react-transform-hmr"); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _reactTransformHmr4 = _interopRequireDefault(_reactTransformHmr3); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _class, _temp; | ||
var _utils = require("../../utils"); | ||
@@ -32,22 +26,3 @@ | ||
var _components = { | ||
ObjectField: { | ||
displayName: "ObjectField" | ||
} | ||
}; | ||
var _reactTransformHmr2 = (0, _reactTransformHmr4.default)({ | ||
filename: "src/components/fields/ObjectField.js", | ||
components: _components, | ||
locals: [module], | ||
imports: [_react3.default] | ||
}); | ||
function _wrapComponent(id) { | ||
return function (Component) { | ||
return _reactTransformHmr2(Component, id); | ||
}; | ||
} | ||
var ObjectField = _wrapComponent("ObjectField")((_temp = _class = function (_Component) { | ||
var ObjectField = function (_Component) { | ||
_inherits(ObjectField, _Component); | ||
@@ -131,6 +106,6 @@ | ||
} catch (err) { | ||
return _react3.default.createElement( | ||
return _react2.default.createElement( | ||
"div", | ||
null, | ||
_react3.default.createElement( | ||
_react2.default.createElement( | ||
"p", | ||
@@ -141,3 +116,3 @@ { className: "config-error", style: { color: "red" } }, | ||
" object field configuration:", | ||
_react3.default.createElement( | ||
_react2.default.createElement( | ||
"em", | ||
@@ -149,3 +124,3 @@ null, | ||
), | ||
_react3.default.createElement( | ||
_react2.default.createElement( | ||
"pre", | ||
@@ -157,7 +132,7 @@ null, | ||
} | ||
return _react3.default.createElement( | ||
return _react2.default.createElement( | ||
"fieldset", | ||
null, | ||
title ? _react3.default.createElement(TitleField, { title: title }) : null, | ||
schema.description ? _react3.default.createElement( | ||
title ? _react2.default.createElement(TitleField, { title: title }) : null, | ||
schema.description ? _react2.default.createElement( | ||
"div", | ||
@@ -168,3 +143,3 @@ { className: "field-description" }, | ||
orderedProperties.map(function (name, index) { | ||
return _react3.default.createElement(SchemaField, { key: index, | ||
return _react2.default.createElement(SchemaField, { key: index, | ||
name: name, | ||
@@ -184,17 +159,20 @@ required: _this3.isRequired(name), | ||
return ObjectField; | ||
}(_react2.Component), _class.defaultProps = { | ||
}(_react.Component); | ||
ObjectField.defaultProps = { | ||
uiSchema: {}, | ||
errorSchema: {} | ||
}, _temp)); | ||
}; | ||
if (process.env.NODE_ENV !== "production") { | ||
ObjectField.propTypes = { | ||
schema: _react2.PropTypes.object.isRequired, | ||
uiSchema: _react2.PropTypes.object, | ||
onChange: _react2.PropTypes.func.isRequired, | ||
formData: _react2.PropTypes.object, | ||
required: _react2.PropTypes.bool, | ||
registry: _react2.PropTypes.shape({ | ||
widgets: _react2.PropTypes.objectOf(_react2.PropTypes.func).isRequired, | ||
fields: _react2.PropTypes.objectOf(_react2.PropTypes.func).isRequired | ||
schema: _react.PropTypes.object.isRequired, | ||
uiSchema: _react.PropTypes.object, | ||
onChange: _react.PropTypes.func.isRequired, | ||
formData: _react.PropTypes.object, | ||
required: _react.PropTypes.bool, | ||
registry: _react.PropTypes.shape({ | ||
widgets: _react.PropTypes.objectOf(_react.PropTypes.func).isRequired, | ||
fields: _react.PropTypes.objectOf(_react.PropTypes.func).isRequired | ||
}) | ||
@@ -201,0 +179,0 @@ }; |
@@ -7,14 +7,8 @@ "use strict"; | ||
var _react2 = require("react"); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _react3 = _interopRequireDefault(_react2); | ||
var _react = require("react"); | ||
var _reactTransformHmr3 = require("react-transform-hmr"); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _reactTransformHmr4 = _interopRequireDefault(_reactTransformHmr3); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _class, _temp; | ||
var _jsonschema = require("jsonschema"); | ||
@@ -44,22 +38,3 @@ | ||
var _components = { | ||
Form: { | ||
displayName: "Form" | ||
} | ||
}; | ||
var _reactTransformHmr2 = (0, _reactTransformHmr4.default)({ | ||
filename: "src/components/Form.js", | ||
components: _components, | ||
locals: [module], | ||
imports: [_react3.default] | ||
}); | ||
function _wrapComponent(id) { | ||
return function (Component) { | ||
return _reactTransformHmr2(Component, id); | ||
}; | ||
} | ||
var Form = _wrapComponent("Form")((_temp = _class = function (_Component) { | ||
var Form = function (_Component) { | ||
_inherits(Form, _Component); | ||
@@ -115,3 +90,3 @@ | ||
if (status !== "editing" && errors.length) { | ||
return _react3.default.createElement(_ErrorList2.default, { errors: errors }); | ||
return _react2.default.createElement(_ErrorList2.default, { errors: errors }); | ||
} | ||
@@ -193,7 +168,7 @@ return null; | ||
var _SchemaField = registry.fields.SchemaField; | ||
return _react3.default.createElement( | ||
return _react2.default.createElement( | ||
"form", | ||
{ className: "rjsf", onSubmit: this._onSubmit }, | ||
this.renderErrors(), | ||
_react3.default.createElement(_SchemaField, { | ||
_react2.default.createElement(_SchemaField, { | ||
schema: schema, | ||
@@ -205,6 +180,6 @@ uiSchema: uiSchema, | ||
registry: registry }), | ||
children ? children : _react3.default.createElement( | ||
children ? children : _react2.default.createElement( | ||
"p", | ||
null, | ||
_react3.default.createElement( | ||
_react2.default.createElement( | ||
"button", | ||
@@ -220,6 +195,7 @@ { type: "submit" }, | ||
return Form; | ||
}(_react2.Component), _class.defaultProps = { | ||
}(_react.Component); | ||
Form.defaultProps = { | ||
uiSchema: {} | ||
}, _temp)); | ||
}; | ||
exports.default = Form; | ||
@@ -230,10 +206,10 @@ | ||
Form.propTypes = { | ||
schema: _react2.PropTypes.object.isRequired, | ||
uiSchema: _react2.PropTypes.object, | ||
formData: _react2.PropTypes.any, | ||
widgets: _react2.PropTypes.objectOf(_react2.PropTypes.func), | ||
fields: _react2.PropTypes.objectOf(_react2.PropTypes.func), | ||
onChange: _react2.PropTypes.func, | ||
onError: _react2.PropTypes.func, | ||
onSubmit: _react2.PropTypes.func | ||
schema: _react.PropTypes.object.isRequired, | ||
uiSchema: _react.PropTypes.object, | ||
formData: _react.PropTypes.any, | ||
widgets: _react.PropTypes.objectOf(_react.PropTypes.func), | ||
fields: _react.PropTypes.objectOf(_react.PropTypes.func), | ||
onChange: _react.PropTypes.func, | ||
onError: _react.PropTypes.func, | ||
onSubmit: _react.PropTypes.func | ||
}; | ||
@@ -240,0 +216,0 @@ } |
{ | ||
"name": "react-jsonschema-form", | ||
"version": "0.19.1", | ||
"version": "0.19.2", | ||
"description": "A simple React component capable of building HTML forms out of a JSON schema.", | ||
@@ -8,3 +8,3 @@ "scripts": { | ||
"build:css": "cp css/react-jsonschema-form.css dist/", | ||
"build:lib": "rimraf lib && babel -d lib/ src/", | ||
"build:lib": "rimraf lib && NODE_ENV=production babel -d lib/ src/", | ||
"build:dist": "rimraf dist && NODE_ENV=production webpack --config webpack.config.dist.js --optimize-minimize", | ||
@@ -11,0 +11,0 @@ "build:playground": "rimraf build && NODE_ENV=production webpack --config webpack.config.prod.js --optimize-minimize && cp playground/index.prod.html build/index.html", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
528104
1860