Skip to content

Releases: bhch/react-json-form

Version 2.1.0

13 Sep 09:42
Compare
Choose a tag to compare

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 a DELETE 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 to title
    For consistency with JSON schema, choice label keyword has been renamed to title. However, the label 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 the format 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 the widget keyword.

Version 2.0.2

30 Aug 12:54
Compare
Choose a tag to compare

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 11:22
Compare
Choose a tag to compare

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 11:47
Compare
Choose a tag to compare

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 called handler 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 by null.
  • #34: Make multiselect widget work on top level arrays.
  • #35: Boolean type will be null by default. Earlier, the default for boolean was false.
  • #36: Make select input respect falsy values.
  • #37: Add support for date-time (from the standard spec) as an alias for datetime.
  • #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 to ReactJSONForm.
  • Removed fileListEndpoint and fileUploadEndpoint props. Now use fileHandler prop instead.
  • The form component will requires two compulsory props: state (instance of EditorState) and onChange (a callback function for handling the changes).
  • Boolean type will be null by default. Earlier, the default for boolean was false.

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 new createForm function.
  • Removed uid config option.
  • Removed fileListEndpoint and fileUploadEndpoint config options. Use the new fileHandler option which serves the purpose of both.

Version 1.13.0

07 Jul 05:33
Compare
Choose a tag to compare

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 the placeholder keyword.
  • enum
    enum keyword has been added as an alias to choices keyword.

Version 1.12.1

03 Jun 05:18
Compare
Choose a tag to compare

03 Jun, 2022

Bugfixes

  • Fixed a bug if array.items was a $ref, it wasn't rendering properly.

Version 1.12.0

01 Jun 16:11
Compare
Choose a tag to compare

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 15:47
Compare
Choose a tag to compare

11 May, 2022

What's new

Minor updates

  • #25: Read csrftoken value from form input if cookie is not available.

Version 1.11.0

22 Apr 14:58
Compare
Choose a tag to compare

22 Apr, 2022

What's new

New features

  • #24: Added support for help text for inputs using help_text or helpText keywords.

Bugfixes

  • #22: Fixed a bug when clearing a file, the file input still had a file attached and wasn't reset.

Version 1.10.0

11 Mar 05:45
Compare
Choose a tag to compare

11 Mar, 2022

What's new

New features

  • #21 : Ask for confirmation before clearing file inputs