- Remove deprecated `babel-plugin-react-transform` with `@babel/plugin-transform-react-jsx`
- Update a few files with default exports as they were throwing warnings while running `dev`
* fix: populate defaults for nested dependencies when formData is undefined
* test: add test for null
* fix: handle null case as per @jrose-carecloud's suggestion
I have a use case where I'd like to be able to define an anyOf in the schema, but still render items from the schema. This should be allowable if I create my own AnyOfField, but currently SchemaField doesn't pass through my schema.
* react-dom is external peerDependency, just like react.
fixes version conflicts, e.g. I got an error
Uncaught TypeError: this.updater.enqueueCallback is not a function when using setState callback
because I use React 16.x and react-jsonschema-form bundled react-dom 15.x
See https://github.com/facebook/react/issues/10320#issuecomment-318754280
* Fix for new submit() method (PR #1058) also submitting the HTML form
..., navigating away from current page at least in Firefox. Reason:
dispatched event was not cancelable, so preventDefault in onSubmit
couldn't cancel it.
Links:
* <https://stackoverflow.com/a/40916998>
* <https://developer.mozilla.org/en-US/docs/Web/API/Event/cancelable>
* Synchronous call to onSubmit() from props
Due to the use of setImmediate() hack in setState utility function (utils.js),
onSubmit() handler from props is called asynchronously. This leads to massive
problems for operations requiring "trusted events", like window.open() or
programmatically submitting forms with target "_blank" (which we needed)
Because onSubmit() should not need the performance-related setImmiate() hack, I
replaced call to setState utility function with proper this.setState() from
React.
* fix failing FileWidget tests
by changing to proper use of setState() without setImmediate() hacks (see #1197)
* fix input type, fix test name
* Test with newer node versions
* Add node 12
* Correctly use $ref when matching options with oneOf
Fixes#1173
Additionally, if a matching option isn't found, preserve the currently
selected option
Change-type: patch
Signed-off-by: Lucian <lucian.buzzo@gmail.com>
* Update src/components/fields/MultiSchemaField.js
* Support `readOnly` property from draft-handrews-json-schema-validation-01
* Fix failing test
* Add note in docs about using the readOnly property
* Update to be consistent with the changes done in commit 497620f
* fix: console warn on unknown format errors instead of showing an error
* fix: default to default widget if string format is not found
* test: update tests
* Accept custom string formats via `additionalFormats` prop
Follow AJV extension pattern established for meta schemas and passthrough to AJV's addFormat method
* Wire additionalFormats prop
* additionalFormats → customFormats
* Fix and test custom format prop updates
* Update docs/validation.md
Co-Authored-By: pushred <eric@pushred.co>
* use select widget to render oneOf / anyOf control
* pass more props to widget
* change schema type to number
* get uiOptions to pass to widget
* do not pass props to custom widget in test
* update tests to actually pass custom widget
* Removed throwing error when there's an extraneous property in ui:order
* Adding tests form orderProperties()
* Updated ObjectField tests to test extraneous properties handling in order list
* fix: keep order warning
* Basic support for 'nullable' types
Modifies the implementation of `getSchemaType` so that when a property
has a type of `[<any>, 'null']`, then `<any>` will be passed. This
allows the library to render and validate the field correctly. For the
sake of simplicity, this change does not attempt any further
assumptions, coercions or transformations.
References #465
* Add some test cases to `getSchemaType` spec
* Add FAQ entry detailing nullable type behaviour
* Add Playground example for nullable field
* Tweak FAQ entry wording and fix typo
Co-Authored-By: warrenseymour <warren@fountainhead.tech>
* Correct example in FAQ entry
Co-Authored-By: warrenseymour <warren@fountainhead.tech>