react-jsonschema-form
Advanced tools
Comparing version 0.17.1 to 0.18.0
@@ -21,2 +21,9 @@ "use strict"; | ||
function buildOptions(schema) { | ||
return (0, _utils.optionsList)(Object.assign({ | ||
enumNames: ["true", "false"], | ||
"enum": [true, false] | ||
}, { enumNames: schema.enumNames })); | ||
} | ||
function BooleanField(props) { | ||
@@ -45,3 +52,3 @@ var schema = props.schema; | ||
var Widget = (0, _utils.getAlternativeWidget)(schema.type, widget, widgets); | ||
return _react2["default"].createElement(Widget, _extends({ options: (0, _utils.optionsList)({ "enum": [true, false] }) }, commonProps)); | ||
return _react2["default"].createElement(Widget, _extends({ options: buildOptions(schema) }, commonProps)); | ||
} | ||
@@ -48,0 +55,0 @@ return _react2["default"].createElement(_widgetsCheckboxWidget2["default"], commonProps); |
{ | ||
"name": "react-jsonschema-form", | ||
"version": "0.17.1", | ||
"version": "0.18.0", | ||
"description": "A simple React component capable of building HTML forms out of a JSON schema.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -168,2 +168,4 @@ react-jsonschema-form | ||
> Note: To set the labels for a boolean field, instead of using `true` and `false` you can set `enumNames` in your schema. Note that `enumNames` belongs in your `schema`, not the `uiSchema`, and the order is always `[true, false]`. | ||
#### For `string` fields | ||
@@ -170,0 +172,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
677133
1866
515