react-bsonschema-form
Advanced tools
Comparing version 0.41.7 to 0.41.8
@@ -44,26 +44,31 @@ "use strict"; | ||
function ObjectIdField(props) { | ||
function ObjectIdField() { | ||
_classCallCheck(this, ObjectIdField); | ||
var _this = _possibleConstructorReturn(this, (ObjectIdField.__proto__ || Object.getPrototypeOf(ObjectIdField)).call(this, props)); | ||
_this.state = { | ||
objectID: props.formData || createObjectID() | ||
}; | ||
return _this; | ||
return _possibleConstructorReturn(this, (ObjectIdField.__proto__ || Object.getPrototypeOf(ObjectIdField)).apply(this, arguments)); | ||
} | ||
_createClass(ObjectIdField, [{ | ||
key: "updateObjectID", | ||
value: function updateObjectID(formData) { | ||
if (!formData) { | ||
this.props.onChange(createObjectID()); | ||
} | ||
} | ||
}, { | ||
key: "componentWillMount", | ||
value: function componentWillMount() { | ||
if (!this.props.formData) { | ||
this.props.onChange(this.state.objectID); | ||
} | ||
this.updateObjectID(this.props.formData); | ||
} | ||
}, { | ||
key: "componentWillReceiveProps", | ||
value: function componentWillReceiveProps(nextProps) { | ||
this.updateObjectID(nextProps.formData); | ||
} | ||
}, { | ||
key: "render", | ||
value: function render() { | ||
var objectID = this.state.objectID; | ||
var formData = this.props.formData; | ||
var formData = objectID._str || objectID.toString(); | ||
var formDataStr = formData && (formData._str || formData.toString()); | ||
return _react2.default.createElement(_StringField2.default, _extends({}, this.props, { | ||
@@ -70,0 +75,0 @@ formData: formData, |
{ | ||
"name": "react-bsonschema-form", | ||
"version": "0.41.7", | ||
"version": "0.41.8", | ||
"description": "A simple React component capable of building HTML forms out of a JSON schema.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
3887332
5114