Releases: bhch/react-json-form
Releases · bhch/react-json-form
Version 2.1.0
13 Sep, 2022
This is a minor release, nevertheless brings some exciting new features and some bugfixes.
What's new
New features
- Data validation
APIs for data validation and displaying error messages under input fields. - Validation keywords
Support for validation keywords such as:required
,uniqueItems
,minLength
,maxLength
,minimum
,maximum
,exclusiveMinimum
,exclusiveMaximum
,multipleOf
. - Autocomplete widget
New autocomplete widget which can be used to load options from the server via AJAX. - File deletion
A delete button has been added in Media Library thumbnails which will send aDELETE
request to file handler endpoint. In addition to that,DELETE
requests will automatically be sent to the server when Clear button is clicked or when exiting page without form submission. - Rename choices
label
keyword totitle
For consistency with JSON schema, choicelabel
keyword has been renamed totitle
. However, thelabel
keyword will still continue to work. - Time widget improvements
Time widget's input spinner is now circular i.e. after reaching maximum value, it will go back to 0 (e.g. after 12 for hours, it will go to 0 if the hour is incremented and will go from 0 to 12 if decremented). - Range input widget
Support for range input widget. Earlier range input was added using theformat
keyword, but as a range input also returns a number value (no need for a specialised format). Hence, it didn't make sense to use range as a format. So, now range inputs can be created using thewidget
keyword.
Version 2.0.2
30 Aug, 2022
Minor release. Previous release (v2.0.1) still didn't fix the following bugs.
Bugfixes
- Fix #43: Multiselect widget only worked with string but failed with integer or other types. This fixes that issue.
Version 2.0.1
30 Aug, 2022
Minor release.
Bugfixes
- Fix #43: Multiselect widget only worked with string but failed with integer or other types. This fixes that issue.
Version 2.0.0
14 Aug, 2022
This is a major release with lots of new features, plenty of bugfixes, significant internal rewrite and, therefore, some breaking changes.
What's new
New features
EditorState
Now the form component and its state are separate. This will allow for the component to be used as a library in other Node projects.- Schema validation
Schema will be validated for errors while new form component is created. - File uploads
New keyword calledhandler
has been added for file uploads. Use this to provide the URL endpoint where files will be uploaded to. - New APIs for browser component
APIs for controlling the form component in the browser such as handling change events and dynamically updating the schema. - Exception reporter for browser component
New exception reporter will now display schema errors in the browser. Currently, it's primitive but will evolve in future. - Docs, Live demos, Interactive playground
https://bhch.github.io/react-json-form/.
Bugfixes
- #32: Display help text under "Select file" button (of
file-url
field). - #33: If default value for integer type was
0
, it was being overwritten bynull
. - #34: Make multiselect widget work on top level arrays.
- #35: Boolean type will be
null
by default. Earlier, the default for boolean wasfalse
. - #36: Make select input respect falsy values.
- #37: Add support for
date-time
(from the standard spec) as an alias fordatetime
. - #39: Respect
minItems
when creating or syncing arrays.
Breaking changes
Main Form component (src/form.js
)
If you directly use the Form component (such as in Node projects), the following notes are for you.
- Renamed
Form
component toReactJSONForm
. - Removed
fileListEndpoint
andfileUploadEndpoint
props. Now usefileHandler
prop instead. - The form component will requires two compulsory props:
state
(instance ofEditorState
) andonChange
(a callback function for handling the changes). - Boolean type will be
null
by default. Earlier, the default for boolean wasfalse
.
Browser component (src/renderer.js
)
If you use the component in the browser (and not in Node projects), the following notes are for you
- Removed
JsonForm
function which was used for creating the form component in browsers. Instead use the newcreateForm
function. - Removed
uid
config option. - Removed
fileListEndpoint
andfileUploadEndpoint
config options. Use the newfileHandler
option which serves the purpose of both.
Version 1.13.0
07 Jul, 2022
What's new
- Ability to choose existing files from the server
Now a modal will open for file uploads where user can choose already existing files on the server. - placeholder
Support for placeholder text on inputs using theplaceholder
keyword. - enum
enum
keyword has been added as an alias tochoices
keyword.
Version 1.12.1
03 Jun, 2022
Bugfixes
- Fixed a bug if
array.items
was a$ref
, it wasn't rendering properly.
Version 1.12.0
01 Jun, 2022
What's new
- Support for references and recursive nesting
Added support for$ref
and$def
keywords for referencing other parts of schema. additionalProperties
keyword now accepts a schema
Earlier,additionalProperties
keyword was only a boolean and the new properties could only be of string type. Now you can provide a schema for the new properties through this keyword.
Bugfixes
- #28: If an array has
minItems
set to 0 or undefined, then it will be kept empty initially. If the array has a default, it will use the default value instead of being blank. Earlier, an item was automatically added to the arrays which was not expected behaviour.
Version 1.11.1
11 May, 2022
What's new
Minor updates
- #25: Read csrftoken value from form input if cookie is not available.