Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-jsonschema-form

Package Overview
Dependencies
Maintainers
4
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-jsonschema-form - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

dist/react-jsonschema-form-0.3.0.js

74

lib/components/ErrorList.js

@@ -6,13 +6,6 @@ "use strict";

});
exports["default"] = ErrorList;
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 _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _react = require("react");

@@ -22,46 +15,27 @@

var ErrorList = (function (_Component) {
_inherits(ErrorList, _Component);
function ErrorList(_ref) {
var errors = _ref.errors;
function ErrorList() {
_classCallCheck(this, ErrorList);
return _react2["default"].createElement(
"div",
{ className: "errors" },
_react2["default"].createElement(
"h2",
null,
"Errors"
),
_react2["default"].createElement(
"ul",
null,
errors.map(function (error, i) {
return _react2["default"].createElement(
"li",
{ key: i },
error.stack
);
})
)
);
}
_get(Object.getPrototypeOf(ErrorList.prototype), "constructor", this).apply(this, arguments);
}
_createClass(ErrorList, [{
key: "render",
value: function render() {
var errors = this.props.errors;
if (errors.length === 0) {
return null;
}
return _react2["default"].createElement(
"div",
{ className: "errors" },
_react2["default"].createElement(
"h2",
null,
"Errors"
),
_react2["default"].createElement(
"ul",
null,
errors.map(function (error, i) {
return _react2["default"].createElement(
"li",
{ key: i },
error.stack
);
})
)
);
}
}]);
return ErrorList;
})(_react.Component);
exports["default"] = ErrorList;
module.exports = exports["default"];

@@ -23,5 +23,5 @@ "use strict";

var _SchemaField = require("./SchemaField");
var _fieldsSchemaField = require("./fields/SchemaField");
var _SchemaField2 = _interopRequireDefault(_SchemaField);
var _fieldsSchemaField2 = _interopRequireDefault(_fieldsSchemaField);

@@ -58,4 +58,9 @@ var _ErrorList = require("./ErrorList");

value: function renderErrors() {
if (this.state.edit && this.state.status !== "editing") {
return _react2["default"].createElement(_ErrorList2["default"], { errors: this.state.errors });
var _state = this.state;
var edit = _state.edit;
var status = _state.status;
var errors = _state.errors;
if (edit && status !== "editing" && errors.length) {
return _react2["default"].createElement(_ErrorList2["default"], { errors: errors });
}

@@ -111,3 +116,3 @@ return null;

this.renderErrors(),
_react2["default"].createElement(_SchemaField2["default"], {
_react2["default"].createElement(_fieldsSchemaField2["default"], {
schema: schema,

@@ -114,0 +119,0 @@ formData: formData,

{
"name": "react-jsonschema-form",
"version": "0.2.0",
"description": "A simple React component capable of building forms from a JSON schema.",
"version": "0.3.0",
"description": "A simple React component capable of building HTML forms out of a JSON schema.",
"scripts": {
"dist": "babel -d lib/ src/ && rimraf dist && webpack --config webpack.config.dist.js --optimize-minimize",
"build:lib": "rimraf lib && babel -d lib/ src/",
"build:dist": "rimraf dist && webpack --config webpack.config.dist.js --optimize-minimize",
"dist": "npm run build:lib && npm run build:dist",
"lint": "eslint src test",

@@ -8,0 +10,0 @@ "publish": "npm run dist && npm publish",

@@ -7,3 +7,3 @@ react-jsonschema-form

A simple [React](http://facebook.github.io/react/) component capable of building
forms from a [JSON schema](http://jsonschema.net/).
HTML forms out of a [JSON schema](http://jsonschema.net/).

@@ -10,0 +10,0 @@ Requires React 0.14+.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc