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