Releases: rjsf-team/react-jsonschema-form
Releases · rjsf-team/react-jsonschema-form
6.0.0-beta.21
New feature added
- Optional Data Controls - see docs
@rjsf/antd
- Updated
ArrayFieldTemplate
,ObjectFieldTemplate
,TitleField
to add support for the newoptionalDataControl
feature- Added the new
OptionalDataControlTemplate
to the theme, adding it to thetemplates
list
- Added the new
- Updated the
ButtonTemplates
classes to fix up the props inAntdIconButtonProps
and theIconButton
s associated with them to better support theOptionalDataControlTemplate
@rjsf/chakra-ui
- Updated
ArrayFieldTemplate
,ObjectFieldTemplate
,TitleField
to add support for the newoptionalDataControl
feature- Added the new
OptionalDataControlTemplate
to the theme, adding it to thetemplates
list
- Added the new
- Updated the
ButtonTemplates
classes to addChakraIconButtonProps
and theIconButton
s associated with them to better support theOptionalDataControlTemplate
@rjsf/core
- Added
initialDefaultsGenerated
flag to state, which indicates whether the initial generation of defaults has been completed - Added
ObjectField
tests for additionalProperties with defaults - Added a new
OptionalDataControlsField
to thefields
that renders either undefined (when there is data for a readonly/disabled field) or gets theOptionalDataControlsTemplate
and renders thelabel
and potentially anonAddClick
oronRemoveClick
function - Updated
ArrayField
andObjectField
to check whether itshouldRenderOptionalData()
and if true, callsObjectDataControlsField
and passes the result to its associated render template asoptionalDataControl
- Updated
ArrayFieldTemplate
,ObjectFieldTemplate
,TitleField
to add support for the newoptionalDataControl
feature- Added the new
OptionalDataControlTemplate
to the theme, adding it to thetemplates
list
- Added the new
- Updated
Form
as follows to fix #4796- Refactored the
liveValidate()
andmergeErrors()
functions out ofgetStateFromProp()
andprocessPendingChange()
- Added new, optional
customErrors?: ErrorSchemaBuilder<T>
to theFormState
, updating theIChangeEvent
interface to remove all of the private variables - Reworked the
newErrorSchema
handling inprocessPendingChange()
to simplify the handling sincenewErrorSchema
is now path-specific, addingnewErrorSchema
tocustomErrors
when they don't match an existing validator-based validation- This rework resulted in any custom errors passed from custom widgets/fields will now be remembered during the validation stage
- Removed the now unused
getPreviousCustomValidateErrors()
andfilterErrorsBasedOnSchema()
methods
- Refactored the
- Updated
LayoutGridField
to simplifyonFieldChange()
to just return the givenerrorSchema
now that it is path-specific, fixing #4796 - Updated
NullField
to passfieldPathId.path
for theonChange()
instead of[name]
@rjsf/daisyui
- Updated
ArrayFieldTemplate
,ArrayFieldTitleTemplate
,ObjectFieldTemplate
,TitleField
to add support for the newoptionalDataControl
feature- Added the new
OptionalDataControlTemplate
to the theme, adding it to thetemplates
list
- Added the new
- Updated the
ButtonTemplates
classes to better support theOptionalDataControlTemplate
@rjsf/fluentui-rc
- Updated
ArrayFieldTemplate
,ObjectFieldTemplate
,TitleField
to add support for the newoptionalDataControl
feature- Added the new
OptionalDataControlTemplate
to the theme, adding it to thetemplates
list
- Added the new
- Updated the
ButtonTemplates
classes to addFluentIconButtonProps
and theIconButton
s associated with them to better support theOptionalDataControlTemplate
@rjsf/mantine
- Updated
ArrayFieldTemplate
,ObjectFieldTemplate
,TitleField
to add support for the newoptionalDataControl
feature- Added the new
OptionalDataControlTemplate
to the theme, adding it to thetemplates
list
- Added the new
@rjsf/mui
- Updated
ArrayFieldTemplate
,ObjectFieldTemplate
,TitleField
to add support for the newoptionalDataControl
feature- Added the new
OptionalDataControlTemplate
to the theme, adding it to thetemplates
list
- Added the new
@rjsf/primereact
- Updated
ArrayFieldTemplate
,ObjectFieldTemplate
,TitleField
to add support for the newoptionalDataControl
feature- Added the new
OptionalDataControlTemplate
to the theme, adding it to thetemplates
list
- Added the new
- Updated the
ButtonTemplates
classes to addPrimeIconButtonProps
and theIconButton
s associated with them to better support theOptionalDataControlTemplate
@rjsf/react-bootstrap
- Updated
ArrayFieldTemplate
,ObjectFieldTemplate
,TitleField
to add support for the newoptionalDataControl
feature- Added the new
OptionalDataControlTemplate
to the theme, adding it to thetemplates
list
- Added the new
- Updated the
ButtonTemplates
classes to addBootstrapIconButtonProps
and theIconButton
s associated with them to better support theOptionalDataControlTemplate
@rjsf/semantic-ui
- Updated
ArrayFieldTemplate
,ObjectFieldTemplate
,TitleField
to add support for the newoptionalDataControl
feature- Added the new
OptionalDataControlTemplate
to the theme, adding it to thetemplates
list
- Added the new
- Updated the
ButtonTemplates
classes to addSemanticIconButtonProps
and theIconButton
s associated with them to better support theOptionalDataControlTemplate
@rjsf/shadcn
- Updated
ArrayFieldTemplate
,ObjectFieldTemplate
,TitleField
to add support for the newoptionalDataControl
feature- Added the new
OptionalDataControlTemplate
to the theme, adding it to thetemplates
list
- Added the new
- Updated the
ButtonTemplates
classes to addShadIconButtonProps
and theIconButton
s associated with them to better support theOptionalDataControlTemplate
@rjsf/utils
- Updated
getDefaultFormState
to add a newinitialDefaultsGenerated
prop flag, along with type definitions, fixing uneditable & permanent defaults with additional properties 3759 - Updated
createSchemaUtils
definition to reflect addition ofinitialDefaultsGenerated
- Updated existing tests where
getDefaultFormState
is used to reflect addition ofinitialDefaultsGenerated
- Updated
types.ts
to support the newOptional Data Controls
feature as follows:- Added new
OptionalDataControlsTemplateProps
and refactored the common props fromArrayFieldTemplateProps
andObjectFieldTemplateProps
into a new super type,ContainerFieldTemplateProps
- Added new
optionalDataControl?: ReactNode
to theArrayFieldTitleProps
,TitleFieldProps
andContainerFieldTemplateProps
- Updated
GlobalFormOptions
to add newenableOptionalDataFieldForType?: ('object' | 'array')[]
prop - Updated
SchemaUtilsType
'sretrieveSchema()
function to add an additional, propertyresolveAnyOfOrOneOfRefs?: boolean
- Added new
- Updated the
Templates
interface to add a new required templateOptionalDataControlsTemplate: ComponentType<OptionalDataControlsTemplateProps<T, S, F>>
- Updated
retrieveSchema()
to add an additional propertyresolveAnyOfOrOneOfRefs?: boolean
which causesresolveAllSchemas()
to resolve$ref
s inside of the options ofanyOf
/oneOf
schemas - Updated
getDefaultFormState
to fix an issue where optional array props had their default set to an empty array when they shouldn't be - Updated the
TranslatableString
enum to add three new strings in support of the new feature:OptionalObjectAdd
,OptionalObjectRemove
andOptionalObjectEmptyMsg
- Added four new utility functions:
isFormDataAvailable()
,isRootSchema()
,optionalControlsId()
, andshouldRenderOptionalField()
- Updated
validationDataMerge()
to add an additional, optional parameterpreventDuplicates = false
, that causes themergeObjects()
call to receivepreventDuplicates
instead oftrue
Dev / docs / playground
- Updated docs for
getDefaultFormState
to reflect addition of theinitialDefaultsGenerated
prop - Updated
utility-function.me
docs to add documentation for the new functions and to update thevalidationDataMerge()
function's new parameter- Also updated docs for
retrieveSchema
andSchemaUtilsType
for the new prop
- Also updated docs for
- Updated
uiSchema.md
to add documentation for the newenableOptionalDataFieldForType
prop - Updated the playground to add a new
Optional Data Controls
example - Updated the snapshot and jest tests for
Form
to test the newOptional Data Controls
feature - Updated
custom-widgets-fields.md
to change the documentation around passing errors viaonChange()
to reflect the new reality - Updated the
v6x upgrade guide.md
to document the new feature, utility functions and changes to existing method parameters
6.0.0-beta.20
Significant Breaking Changes in this release
In order to support future features and to improve performance, IdSchema
was replaced with FieldPathId
. See below
@rjsf/antd
- BREAKING CHANGES - Updated all of the templates and widgets to change
idSchema
tofieldPathId
or to remove the<T>
off of the idGenerator functions
@rjsf/chakra-ui
- BREAKING CHANGES - Updated all of the templates and widgets to change
idSchema
tofieldPathId
or to remove the<T>
off of the idGenerator functions
@rjsf/core
- BREAKING CHANGES
- Updated all of the fields, templates and widgets to change
idSchema
tofieldPathId
or to remove the<T>
off of the idGenerator functions ObjectField
andArrayField
to usetoFieldPathId
instead oftoIdSchema()
to generate thefieldPathId
s of all its children- Updated the
onChange
handling of fields to makepath
required and either pass it straight through, or use thefieldPathId.path
instead of using an empty array or appending path information - Updated
Form
to usetoFieldPathId()
to generatefieldPathId
instead ofidSchema
, always providing theidPrefix
andidSeparator
in theglobalFormOptions
and make thepath: FieldPathList
required - Updated
LayoutGridField
to remove theIdSchema
related code in favor ofFieldPathId
code
- Updated all of the fields, templates and widgets to change
- Also exported the
getTestRegistry()
function from the mainindex.ts
to assist developers in creatingregistry
object for tests - Updated all of the test to deal with the
idSchema
->fieldPathId
changes
@rjsf/daisyui
- BREAKING CHANGES - Updated all of the templates and widgets to change
idSchema
tofieldPathId
or to remove the<T>
off of the idGenerator functions - Also fixed the
FieldTemplate
to extract thedescription
element so that it was not spread onto thediv
, fixing the snapshots
@rjsf/fluent-ui
- BREAKING CHANGES - Updated all of the templates and widgets to change
idSchema
tofieldPathId
or to remove the<T>
off of the idGenerator functions
@rjsf/mantine
- BREAKING CHANGES - Updated all of the templates and widgets to change
idSchema
tofieldPathId
or to remove the<T>
off of the idGenerator functions
@rjsf/mui
- BREAKING CHANGES - Updated all of the templates and widgets to change
idSchema
tofieldPathId
or to remove the<T>
off of the idGenerator functions
@rjsf/primereact
- BREAKING CHANGES - Updated all of the templates and widgets to change
idSchema
tofieldPathId
or to remove the<T>
off of the idGenerator functions
@rjsf/react-bootstrap
- BREAKING CHANGES - Updated all of the templates and widgets to change
idSchema
tofieldPathId
or to remove the<T>
off of the idGenerator functions
@rjsf/semantic-ui
- BREAKING CHANGES - Updated all of the templates and widgets to change
idSchema
tofieldPathId
or to remove the<T>
off of the idGenerator functions
@rjsf/shadcn
- BREAKING CHANGES - Updated all of the templates and widgets to change
idSchema
tofieldPathId
or to remove the<T>
off of the idGenerator functions
@rjsf/utils
- Added new
FieldPathList
andFieldPathId
types andDEFAULT_ID_PREFIX
andDEFAULT_ID_SEPARATOR
toconstants.ts
- Added the new
toFieldPathId()
function to generateFieldPathId
s, exporting it from the library - Deprecated the
ui:rootFieldId
in theUiSchema
sinceidPrefix
does the same exact thing - BREAKING CHANGES
- Removed the
IdSchema
type, replacingidSchema: IdSchema<T>
in all types withfieldPathId: FieldPathId
- Updated the
idGenerators
to replaceid: IdSchema<T> | string
withid: FieldPathId | string
removing the need for the<T = any>
generic on the functions - Removed the
toIdSchema()
function in theschema
directory - Updated the
FieldProps
type'sonChange()
callback to make thepath: FieldPathList
parameter be required instead of optional - Updated the
SchemaUtilsType
andcreateSchemaUtils()
to remove thetoIdSchema()
function
- Removed the
@rjsf/validator-ajv8
- Updated the test to no longer try to test the delete
toIdSchema
function
Dev / docs / playground
- Updated
custom-templates.md
,custom-widgets-fields.md
andlayout-grid.md
to change theidSchema
documentation tofieldPathId
- Updated
uiSchema.md
to mark theui:rootFieldId
as deprecated in the documentation - Updated
utility-functions.md
deletetoIdSchema()
, addtoFieldPathId()
and to remove the<T>
from the id generator functions - Updated
v6.x upgrade guide.md
to document all the breaking changes, new functions and deprecations made in6.0.0-beta.20
6.0.0-beta.19
@rjsf/core
- Updated
Form
to fix live validation ingetStateFromProps()
broken by an optimization, fixing #4782 - Updated
Form
to fix error messages being displayed abnormally whencustomValidate
is provided, fixing #4783 - Updated
Form
to fixomitExtraData
when the leaf node happens to have an object value, fixing #4784
@rjsf/utils
- Updated
resolveSchema()
to pass theexperimental_customMergeAllOf
options properly toresolveReference()
andresolveDependencies()
called within it
6.0.0-beta.18
@rjsf/chakra-ui
- Updated
ObjectFieldTemplate
to always generate the "Add" button whencanExpand()
is true, fixing #4772
@rjsf/core
- Updated
Form
to add theglobalFormOptions
to theregistry
when there areGlobalFormOptions
provided, also stopped passingidPrefix
andidSeparator
toSchemaField
- Updated
ArrayField
,LayoutGridField
,ObjectField
andSchemaField
to getidPrefix
,idSeparator
from theregistry.globalFormOptions
, no longer passing them onFieldProps
- Updated
SchemaField
to getexperimental_componentUpdateStrategy
from theregistry.globalFormOptions
as well
- Updated
@rjsf/utils
- Update
getDefaultFormState()
to add support fornull
defaults for["null", "object"]
and["null", "array"]
, fixing #1581 - Added a new
GlobalFormProps
interface which contains the following props and replaced theexperimental_componentUpdateStrategy
inRegistry
withglobalFormProps?: GlobalFormProps
experimental_componentUpdateStrategy
(refactored fromRegistry
) andidPrefix
&idSeparator
(refactored fromFieldProps
)
- BREAKING CHANGE: Removed the optional
idPrefix
andidSeparator
props from theFieldProps
interface
Dev / docs / playground
- Updated the
custom-widget-fields.md
andv6.x upgrade guide.md
to document the refactor of theidPrefix
andidSeparator
refactor
6.0.0-beta.17
@rjsf/core
- Updated
ObjectField
to remove thename
from the path passed toonChange()
callback inhandleAddClick()
andonDropPropertyClick()
, fixing #4763 - Updated
Form
to restore the passing of an empty string forname
to avoid accidentally showing it as the title for the whole schema
@rjsf/shadcn
- Update
ArrayFieldItemTemplate
to align buttons with the input field, fixing #4753
6.0.0-beta.16
@rjsf/antd
- Updated the
ArrayFieldTemplate
,FieldTemplate
andObjectFieldTemplate
to getformContext
from theregistry
@rjsf/core
- Updated
ArrayField
,Form
,LayoutMultiSchemaField
andSchemaField
to stop passingformContext
@rjsf/daisyui
- Updated
FieldTemplate
to removeformContext
as it is never used
@rjsf/semantic-ui
- Updated the
ArrayFieldTemplate
,BaseInputTemplate
,CheckboxWidget
,FieldTemplate
,RadioWidget
,RangeSelect
,SelectWidget
,TextareaWidget
andObjectFieldTemplate
to getformContext
from theregistry
@rjsf/utils
- BREAKING CHANGE: Removed
formContext
from the following interfaces because it is available onregistry
:ErrorListProps
,FieldProps
,FieldTemplateProps
,ArrayFieldTemplateProps
andWidgetProps
- Update
mergeDefaultsWithFormData
to properly handle overridingundefined
formData with anull
default value, fixing #4734 - Fixed object reference sharing in arrays with minItems when using oneOf schemas, fixing #4756
- Updated
getWigets()
to output theschema
when throwing errors, fixing #4731
Dev / docs / playground
- Updated the documentation to remove
formContext
from the interface documentation, adding a BREAKING CHANGE notification in thev6.x upgrade guide
- POTENTIAL BREAKING CHANGE: Updated the
cjs
build for all packages to generate.cjs
files instead of.js
files and updating theexports
to make therequire
statements use.cjs
, fixing [#4754]#4754) - Updated
v6.x upgrade guide.md
to note the change to thecjs
builds
6.0.0-beta.15
@rjsf/chakra-ui
- Updated
package.json
for to makelucide-react
a dependency rather than a devDependency, fixing #4739
@rjsf/core
- Updated
ArrayField
onSelectChange
to not passname
in thepath
since theObjectField
will automatically add it #4733 - Updated
Form
to optimize the need for live validation in an attempt to improve performance, potentially fixing #3616
@rjsf/semantic-ui
- Updated
ArrayField
to stop usingnanoid
and instead uselodash/uniqueId
to fix #4762
@rjsf/shadcn
- Update
README.md
with picture of the theme! - Allow passing
className
props toAddButton
,BaseInputTemplate
,CheckboxWidget
,CheckboxesWidget
,RadioWidget
,SelectWidget
,SubmitButton
,TextareaWidget
for extra Tailwind CSS customization throughui:className
@rjsf/utils
- Updated
getTestIds
to stop usingnanoid
and instead uselodash/uniqueId
to fix #4762
Dev / docs / playground
- Removed
nanoid
from the build system andjest.config.js
files
5.24.13
6.0.0-beta.14
- A BREAKING CHANGE to the FieldProps.onChange callback function was made that COULD affect custom fields, depending on the implementation.
@rjsf/core
- Added support for dynamic UI schema in array fields - the
items
property inuiSchema
can now accept a function that returns a UI schema based on the array item's data, index, and form context (#4706) - Fixed checkbox widget to use current value instead of event target in onFocus/onBlur handlers, fixing #4704
- Updated all of the
XxxxField
components andForm
to handle the newpath
parameter inFieldProps.onChange
, makingForm
queue up changes so that they are all processed and no data is lost, fixing #3367 - Updated a bug in
AltDateWidget
related to theclear
button not working after the fix for #3367 - Fixed the missing hook dependencies for the
CheckboxesWidget
so that they work properly
@rjsf/chakra-ui
- Fixed checkbox widget to use current value instead of event target in onFocus/onBlur handlers, fixing #4704
@rjsf/daisyui
- Fixed checkbox widget to use current value instead of event target in onFocus/onBlur handlers, fixing #4704
- Fixed additional properties rendering by properly connecting the
FieldTemplate
andWrapIfAdditionalTemplate
, fixing 4707 - Fixed the missing hook dependencies in the
DateTimeWidget
andDateWidget
so that they work properly
@rjsf/fluentui-rc
- Fixed checkbox widget to use current value instead of event target in onFocus/onBlur handlers, fixing #4704
@rjsf/mantine
- Added new theme!
@rjsf/mui
- Fixed checkbox widget to use current value instead of event target in onFocus/onBlur handlers, fixing #4704
@rjsf/primereact
- Fixed checkbox widget to use current value instead of event target in onFocus/onBlur handlers, fixing #4704
@rjsf/semantic-ui
- Fixed checkbox widget to use current value instead of event target in onFocus/onBlur handlers, fixing #4704
@rjsf/shadcn
- Bump
@shadcn/ui
components to use latest version from https://ui.shadcn.com/ - Bump
tailwindcss
to using v4 and css compiling process to use latest@tailwindcss/cli
- Remove
postcss
due to new Oxide compiler of tailwindcss - Update playground themes with
default
,Amethyst Haze
,Caffeine
,Claude
,Neo Brutalism
,Pastel Dreams
,Soft Pop
,Twitter
,Vercel
- Radio widget labels are now accessible and can be clicked on to select the associated option.
@rjsf/utils
- Updated
UiSchema
type to support dynamic array item UI schemas - theitems
property can now be either aUiSchema
object or a function that returns aUiSchema
(#4706) - Added
title
property toRJSFValidationError
PR - BREAKING CHANGE: Updated the
FieldProps
interface'sonChange
handler to inject a new optionalpath
before theErrorSchema
parameter as part of the fix for #3367
@rjsf/validator-ajv8
- Updated
transformRJSFValidationErrors()
to include thetitle
property of a field with error fixing #4504 with PR - Updated
AJVValidator
to handle the attempted compile of a bad schema, fixing #4357
Dev / docs / playground
- Added comprehensive documentation for dynamic UI schema feature with TypeScript examples #4706
- Updated array documentation to reference the new dynamic UI schema capabilities #4706
- Updated nearly all of the libraries in the
package.json
files to the latest non-breaking versions - Fixed the broken
Custom Array
sample - Improved the
Any Of with Custom Field
sample so that it renders using the appropriate theme components - Updated the
custom-widgets-fields.md
andv6.x upgrade guide.md
to document the BREAKING CHANGE to theFieldProps.onChange
behavior - Updated the playground to properly output the
validationError
when runningRaw Validate
6.0.0-beta.13
@rjsf/shadcn
- Updated
lodash
import infancy-multi-select.tsx
to to be direct import, fixing #4696
6.0.0-beta.13
@rjsf/core
- Added
experimental_componentUpdateStrategy
prop toForm
component to control re-render optimization behavior. Supports'customDeep'
(default, uses deep equality checks that ignore functions),'shallow'
, and'always'
@rjsf/utils
- Extended
Registry
interface to include optionalexperimental_componentUpdateStrategy
property - Added
shallowEquals()
utility function for shallow equality comparisons - Fixed boolean fields incorrectly set to
{}
when switching oneOf/anyOf options withmergeDefaultsIntoFormData
set touseDefaultIfFormDataUndefined
, fixing #4709 (#4710) - Always make all references absolute in nested bundled schemas