Skip to content

Releases: rjsf-team/react-jsonschema-form

6.1.2

21 Nov 21:19

Choose a tag to compare

@rjsf/antd

  • Updated SelectWidget to add a static getPopupContainerCallback to the SelectWidget component, partially fixing #3609
    • Also, added the explicit open state to the Select in conjunction with providing the setOpen as the onOpenChange prop
  • In BaseInputTemplate added comments explaining why step='1' is returned, closing #4022

@rjsf/mantine

  • Align Mantine’s behavior with other themes when clearing string fields: clearing an input now removes the key from formData instead of setting it to an empty string. (#4875)

@rjsf/utils

@rjsf/validator-ajv8

  • Updated CustomValidatorOptionsType to add new extenderFn?: (ajv: Ajv) => Ajv prop
  • Updated createAjvInstance() to add new extenderFn?: (ajv: Ajv) => Ajv parameter, using it to extend the ajv instance, fixing #4746
    • Updated the AJV8Validator and compileSchemaValidatorsCode() to pass extenderFn from the options into createAjvInstance()
  • Updated transformRJSFValidationErrors() to add filtering of duplicate anyOf/oneOf based errors from the returned errors, fixing #4167

Dev / docs / playground

  • Updated DemoFrame as follows to fix #3609
    • Override antd's SelectWidget.getPopupContainerCallback callback function to return undefined
    • Added a AntdSelectPatcher component that observes the creation of antd select dropdowns and makes sure they open in the correct location
    • Update the antd theme wrapper to render the AntdSelectPatcher, AntdStyleProvider and ConfigProvider with it's own getPopupContainer() function inside of a FrameContextConsumer
  • Updated the base TypeScript configuration to use "moduleResolution": "bundler"
  • Updated the validation.md documentation to note that HTML 5 validation is not translatable via RJSF translation mechanisms and should be turned off, fixing #4092
    • Also added documentation for the new extenderFn prop on CustomValidatorOptionsType

6.1.1

14 Nov 23:40

Choose a tag to compare

@rjsf/core

  • Updated ObjectField to get errors and formData by wrapping name in brackets to prevent names that have dots in them incorrectly getting data from a lower level, fixing #3846

@rjsf/shadcn

  • Updated package.json to copy css files to new resources directory

Dev / docs / playground

  • Updated the playground to use the css files for @rjsf/shadcn from the CDN connected with github, pointing to the new resources directory
  • Added new antdIconsReplacer.ts and used it in @rjsf/antd during build time to append .js onto imports of @antd/icons to fix es build issues on webpack and vite

6.1.0

11 Nov 16:18

Choose a tag to compare

@rjsf/antd

  • Added support for rendering ui:help as markdown via new ui:enableMarkdownInHelp flag in FieldHelpTemplate
  • Updated ArrayFieldItemTemplate and ArrayFieldTemplate to adjust sizes and buttons location using displayLabel and hasDescription, fixing #3296
  • Updated FieldTemplate, ObjectFieldTemplate and WrapIfAdditionalTemplate to adjust the sizes and buttons location using displayLabel

@rjsf/chakra-ui

  • Added support for rendering ui:help as markdown via new ui:enableMarkdownInHelp flag in FieldHelpTemplate
  • Updated FieldTemplate and WrapIfAdditionalTemplate to adjust the sizes and buttons location using displayLabel and rawDescription

@rjsf/core

  • Added new RichHelp component for use in all the themes for help rendering, fixing #4601
  • Updated ArrayField to compute and pass displayLabel and hasDescription to the rendered ArrayFieldItemTemplate to support fixing #3296
  • Updated StringField to extract the title from the props and pass it down to the widget if provided
  • Updated ArrayFieldItemTemplate to adjust buttons location using displayLabel and hasDescription, fixing #3296
  • Updated AddButton to improve it's responsiveness in relation to the ArrayFieldItemTemplate changes
  • Updated WrapIfAdditionalTemplate to adjust the sizes and buttons location using displayLabel and rawDescription

@rjsf/daisyui

  • Added support for rendering ui:help as markdown via new ui:enableMarkdownInHelp flag in FieldHelpTemplate
  • Updated ArrayFieldItemTemplate to adjust buttons location using displayLabel and hasDescription, fixing #3296
  • Updated WrapIfAdditionalTemplate to add flexGrow and BaseInputTemplate to add w-full to allow the array item fields to grow properly
  • Updated FieldTemplate to render the description which was missing in the theme
  • Updated FieldTemplate and WrapIfAdditionalTemplate to adjust the sizes and buttons location using displayLabel and rawDescription

@rjsf/fluentui-rc

  • Added support for rendering ui:help as markdown via new ui:enableMarkdownInHelp flag in FieldHelpTemplate
  • Updated ArrayFieldItemTemplate to adjust buttons location using displayLabel, fixing #3296
  • Updated WrapIfAdditionalTemplate to add flexGrow to allow the array item fields to grow properly for non-container elements
  • Updated FieldTemplate and WrapIfAdditionalTemplate to adjust the sizes and buttons location using displayLabel and rawDescription

@rjsf/mantine

  • Added support for rendering ui:help as markdown via new ui:enableMarkdownInHelp flag in FieldHelpTemplate
  • Updated utils.ts to add label to the cleanup fields to filter it from the uiOptions
  • Updated BaseInputTemplate to display description which was missing in the theme
  • Updated ArrayFieldTitleTemplate to support the optionalData
  • Updated FieldTemplate and WrapIfAdditionalTemplate to adjust the sizes and buttons location using displayLabel and rawDescription

@rjsf/mui

  • Added support for rendering ui:help as markdown via new ui:enableMarkdownInHelp flag in FieldHelpTemplate
  • Updated ArrayFieldItemTemplate to adjust buttons location using displayLabel and hasDescription, fixing #3296
  • Updated FieldTemplate, ObjectFieldTemplate and WrapIfAdditionalTemplate to adjust the sizes and buttons location using displayLabel

@rjsf/primereact

  • Added support for rendering ui:help as markdown via new ui:enableMarkdownInHelp flag in FieldHelpTemplate
  • Updated ArrayFieldItemTemplate to adjust buttons location using displayLabel, fixing #3296
  • Updated WrapIfAdditionalTemplate to adjust the sizes and buttons location using displayLabel and rawDescription

@rjsf/react-bootstrap

  • Added support for rendering ui:help as markdown via new ui:enableMarkdownInHelp flag in FieldHelpTemplate
  • Updated ArrayFieldItemTemplate to adjust buttons location using displayLabel and hasDescription, fixing #3296
  • Updated ArrayFieldTemplate to improve it's responsiveness in relation to the ArrayFieldItemTemplate changes
  • Updated FieldTemplate, ObjectFieldTemplate and WrapIfAdditionalTemplate to adjust the sizes and buttons location using displayLabel and rawDescription

@rjsf/semantic-ui

  • Added support for rendering ui:help as markdown via new ui:enableMarkdownInHelp flag in FieldHelpTemplate
  • Updated ArrayFieldItemTemplate to adjust buttons location using displayLabel and hasDescription, fixing #3296
  • Updated FieldTemplate and WrapIfAdditionalTemplate to adjust the sizes and buttons location using displayLabel and rawDescription

@rjsf/shadcn

  • Added support for rendering ui:help as markdown via new ui:enableMarkdownInHelp flag in FieldHelpTemplate
  • Updated ArrayFieldItemTemplate to adjust buttons location using displayLabel and hasDescription, fixing #3296
  • Updated ArrayFieldTemplate to add justify-end to the AddButton rendering
  • Updated FieldTemplate, ObjectFieldTemplate and WrapIfAdditionalTemplate to adjust the sizes and buttons location using displayLabel and rawDescription

@rjsf/utils

  • Added new enableMarkdownInHelp to the GlobalUISchemaOptions type, fixing #4601
  • Added new displayLabel and hasDescription flags in the ArrayFieldItemTemplateProps to support fixing #3296
  • Updated the three hooks to add use client directive to support NextJS builds
  • Updated WrapIfAdditionalTemplateProps to also pick the displayLabel and rawDescription props from FieldProps for use in adjusting the Additional Properties buttons location
  • Fixed bug in getDisplayLabel() to return false ALWAYS, when the ui:options is set to false AND to return true for array and object types when they were added via additionalProperties

Dev / docs / playground

  • Updated uiSchema.md in the docs to document the new enableMarkdownInHelp flag
  • Updated objectTests.tsx to increase the variations of the additionalProperties tests to include labels off, descriptions and object and array types

6.0.2

07 Nov 17:47

Choose a tag to compare

@rjsf/antd

  • Updated FieldTemplate to skip label and description rendering for checkbox widgets, fixing (#4742)
  • Updated ArrayFieldTemplate and ObjectFieldTemplate to remove the rendering of a duplicate description (since the FieldTemplate already does it), fixing #3624

@rjsf/chakra-ui

  • Modified CheckboxesWidget to render the Title, fixing (#4840)
  • Updated CheckboxWidget to handle label and description rendering consistently, fixing (#4742)

@rjsf/core

  • Fixed duplicate label and description rendering in CheckboxWidget by conditionally rendering them based on widget type
    • Updated CheckboxWidget to handle label and description rendering consistently
    • Modified FieldTemplate to skip label and description rendering for checkbox widgets, fixing (#4742)
  • Updated ObjectField to change the removal of an additional property to defer the work to the processPendingChange() handler in Form, fixing #4850
  • Updated FallbackField to support object and array types, and improved ArrayField so that it handles missing items properly with the fallback field

@rjsf/fluentui-rc

  • Updated FieldTemplate to skip label and description rendering for checkbox widgets, fixing (#4742)

@rjsf/mantine

  • Updated CheckboxWidget to handle label and description rendering consistently, fixing (#4742)

@rjsf/mui

  • Updated FieldTemplate to skip label and description rendering for checkbox widgets, fixing (#4742)
  • Updated ArrayFieldItemTemplate to switch size from 'auto' to responsive values on the Grid, fixing #4838

@rjsf/primereact

  • Updated FieldTemplate to skip label and description rendering for checkbox widgets, fixing (#4742)

@rjsf/react-bootstrap

  • Updated FieldTemplate to skip label and description rendering for checkbox widgets, fixing (#4742)

@rjsf/semantic-ui

  • Updated FieldTemplate to skip label and description rendering for checkbox widgets, fixing (#4742)

@rjsf/shadcn

  • Updated FieldTemplate to skip label and description rendering for checkbox widgets, fixing (#4742)
  • Updated the Command component to properly handle forwardRef

@rjsf/utils

  • Updated getDefaultFormState() to not save an undefined field value into an object when the type is null and excludeObjectChildren is provided, fixing #4821

Dev / docs / playground

  • Updated the OptionsDrawer of the playground to add idPrefix and idSeparator fields
  • Updated test files to switch to using the React Testing library instead of react-test-renderer, updating all snapshots accordingly
  • Updated Fluent libraries to latest, with updated snapshots
  • Added Node 24 to ci.yml, removing v5 and old Node 14 non-docs builds

6.0.1

31 Oct 19:40

Choose a tag to compare

Dev / docs / playground

  • Updated peer dependencies for packages to ^6.x

6.0.0

31 Oct 19:19

Choose a tag to compare

RJSF is proud to release the new major 6.0.0 release

There are many breaking change as mentioned in the beta changelogs and described in detail in the 6.x upgrade guide

Enjoy!

Also the following changes were made since the last beta release

@rjsf/antd

  • Updated the README.md to show the theme snapshot with the latest theme UI from the playground, making it a link to the theme

@rjsf/chakra-ui

  • Updated the README.md to show the theme snapshot with the latest theme UI from the playground, making it a link to the theme

@rjsf/core

  • Updated SchemaField to add a new optional property childFieldPathId to the FieldComponent render to prevent duplicate ids, fixing (#4819)[https://github.com//issues/4819]
    • Also updated ObjectField and ArrayField to make children use the childFieldPathId if present, falling back to the fieldPathId if not

Dev / docs / playground

  • Updated the libraries to the latest ones that aren't problematic
    Updated the playground to modernize the UI using MUI components
  • Updated the documentation to switch to using an animated gif based on the latest modernized playground UI
  • Updated the README.md in all themes to show the theme snapshot with the latest theme UI from the playground, making it a link to the theme

6.0.0-beta.23

28 Oct 22:48

Choose a tag to compare

6.0.0-beta.23 Pre-release
Pre-release

Small potential BREAKING CHANGES

  • If you are overriding the AltDateWidget or AltDateTimeWidget these changes may affect you

@rjsf/antd

  • Updated AltDateWidget to use the new useAltDateWidgetProps() hook, renaming showTime to time
  • Potentially BREAKING CHANGE: Updated AltDateTimeWidget to rename showTime prop to time

@rjsf/chakra-ui

  • Updated AltDateWidget to use the new useAltDateWidgetProps() hook, renaming showTime to time
  • Potentially BREAKING CHANGE: Updated AltDateTimeWidget to rename showTime prop to time

@rjsf/core

  • Updated FormProps to add new onChange/onBlur values for the liveValidate and liveOmit props, deprecating the boolean aspect of them
  • Updated Form to support the new feature to do onBlur handling of liveValidate and liveOmit
  • Updated FormProps to add the new initialFormData prop
  • Updated Form so that is behaves as a "controlled" form when formData is passed and uncontrolled when initialFormData is passed, fixing #391
    • Also fixed an issue where live validation was called on the initial form render, causing errors to show immediately, partially fixing #512
  • Updated Form to add a new programmatic function, setFieldValue(fieldPath: string | FieldPathList, newValue?: T): void, fixing #2099
  • Added new FallbackField to add opt-in functionality to control form data that is of an unsupported or unknown type (#4736).
  • Refactored much of the FileWidget implementation into a new useFileWidgetProps() hook, fixing #3146
  • Refactored much of the AltDateWidget implementation into a new useAltDateWidgetProps() hook, fixing #3352

@rjsf/daisyui

  • Deleted the FileWidget component, moving the className and isMulti logic directly into the BaseInputTemplate so that the @rjsf/core's FileWidget works properly for the theme, fixing #4803
  • Updated AltDateWidget to use the new useAltDateWidgetProps() hook

@rjsf/mantine

  • Updated FieldHelpTemplate to avoid issue when help and fieldPathId` are undefined
  • Updated AltDateWidget to use the new useAltDateWidgetProps() hook, renaming showTime to time
  • Potentially BREAKING CHANGE: Updated AltDateTimeWidget to rename showTime prop to time
  • Updated FileWidget to use the useFileWidgetProps() hook

@rjsf/utils

  • Added the useFileWidgetProps() hook implementation, refactored from @rjsf/core
  • Added the useAltDateWidgetProps() hook implementation, refactored from @rjsf/core

Dev / docs / playground

  • Updated the playground to switch liveValidate and liveOmit from checkboxes to radio buttons for the new options
  • Updated internals.md, form-props.md, utility-functions.md and v6x upgrade guide.md to document the new features, potential breaking changes and deprecations

6.0.0-beta.22

22 Oct 16:33

Choose a tag to compare

6.0.0-beta.22 Pre-release
Pre-release

Many BREAKING CHANGES

  • Due to some refactoring and performance improvements, every theme and @rjsf/utils have breaking changes that MAY affect your code base, especially if you have custom fields, template or widgets.

@rjsf/antd

  • Updated most of the widgets to get formContext from the registry instead of the props since it will no longer be passed
  • BREAKING CHANGE: Updated FieldTemplate, ObjectFieldTemplate and WrapIfAdditionalTemplate to rename the old additionalProperties interface props to the new ones
  • Updated BaseInputTemplate, CheckboxesWidget, CheckboxWidget, RadioWidget, SelectWidget, and TextareaWidget to use htmlName for the HTML name attribute
  • BREAKING CHANGE: Updated ArrayFieldTemplate to remove the ArrayFieldItemTemplate render in favor of simply using items due to ArrayField changes

@rjsf/chakra-ui

  • BREAKING CHANGE: Updated FieldTemplate, ObjectFieldTemplate and WrapIfAdditionalTemplate to rename the old additionalProperties interface props to the new ones
  • Updated BaseInputTemplate, CheckboxesWidget, CheckboxWidget, RadioWidget, SelectWidget, and TextareaWidget to use htmlName for the HTML name attribute
  • BREAKING CHANGE: Updated ArrayFieldTemplate to remove the ArrayFieldItemTemplate render in favor of simply using items due to ArrayField changes

@rjsf/core

  • Updated MultiSchemaField and SchemaField to properly display anyOf/oneOf optional data fields by hiding the label and selector control when it is an optional field AND there is no form data
  • Updated ArrayField, BooleanField, LayoutMultiSchemaField, MultiSchemaField, ObjectField, SchemaField, StringField and BaseInputTemplate to remove formContext from the props
  • Updated ObjectField to refactor the code from a class component to two stateless functional components, replacing the 3 generator-props with the 4 memoized props mentioned in the @rjsf/utils changes
  • Updated Form to "memoize" the fieldPathId and registry into the FormState, adding a toIChangeEvent() helper to restrict the state returned on the IChangeEvent interface callbacks
  • BREAKING CHANGE: Updated FieldTemplate, ObjectFieldTemplate and WrapIfAdditionalTemplate to rename the old additionalProperties interface props to the new ones
  • Added nameGenerator prop to Form component to enable custom HTML name attribute generation for form fields
  • Updated ArrayField to refactor code from a class component to seven stateless functional components, replacing the 4 generator-props with the 5 memoized props mentioned in the @rjsf/utils changes
    • BREAKING CHANGE: The refactor included rendering the ArrayFieldItemTemplate directly by the ArrayField rather than deferring it to the ArrayFieldTemplate
    • Updated the ArrayField tests to adjust for the rendering change AND to remove 2 tests due to them no longer being valid
  • BREAKING CHANGE: Updated ArrayFieldTemplate to remove the ArrayFieldItemTemplate render in favor of simply using items due to ArrayField changes
  • BREAKING CHANGE: Updated ArrayFieldItemButtonsTemplate to replace the old callback-generator functions with the new memoizable callback functions
  • Fixed a bug in Form to avoid getting errors being reported at the root level via onChange when there aren't
  • Refactored LayoutGridField as function components instead of a single class component.

@rjsf/daisyui

  • Updated the test mocks to remove formContext for the widget mock
  • BREAKING CHANGE: Updated FieldTemplate, ObjectFieldTemplate and WrapIfAdditionalTemplate to rename the old additionalProperties interface props to the new ones
  • Updated BaseInputTemplate, CheckboxesWidget, CheckboxWidget, RadioWidget, and TextareaWidget to use htmlName for the HTML name attribute
  • BREAKING CHANGE: Updated ArrayFieldTemplate to remove the ArrayFieldItemTemplate render in favor of simply using items due to ArrayField changes
  • BREAKING CHANGE: Updated ArrayFieldItemButtonsTemplate to replace the old callback-generator functions with the new memoizable callback functions

@rjsf/fluentui-rc

  • BREAKING CHANGE: Updated FieldTemplate, ObjectFieldTemplate and WrapIfAdditionalTemplate to rename the old additionalProperties interface props to the new ones
  • Updated BaseInputTemplate, CheckboxesWidget, CheckboxWidget, RadioWidget, SelectWidget, and TextareaWidget to use htmlName for the HTML name attribute
  • BREAKING CHANGE: Updated ArrayFieldTemplate to remove the ArrayFieldItemTemplate render in favor of simply using items due to ArrayField changes

@rjsf/mantine

  • BREAKING CHANGE: Updated FieldTemplate, ObjectFieldTemplate and WrapIfAdditionalTemplate to rename the old additionalProperties interface props to the new ones
  • Updated BaseInputTemplate, CheckboxesWidget, CheckboxWidget, RadioWidget, SelectWidget, and TextareaWidget to use htmlName for the HTML name attribute
  • BREAKING CHANGE: Updated ArrayFieldTemplate to remove the ArrayFieldItemTemplate render in favor of simply using items due to ArrayField changes

@rjsf/mui

  • Updated BaseInputTemplate and SelectWidget to remove formContext from the props
  • BREAKING CHANGE: Updated FieldTemplate, ObjectFieldTemplate and WrapIfAdditionalTemplate to rename the old additionalProperties interface props to the new ones
  • Updated BaseInputTemplate, CheckboxesWidget, CheckboxWidget, RadioWidget, SelectWidget, and TextareaWidget to use htmlName for the HTML name attribute
  • BREAKING CHANGE: Updated ArrayFieldTemplate to remove the ArrayFieldItemTemplate render in favor of simply using items due to ArrayField changes

@rjsf/primereact

  • Updated SelectWidget to remove formContext from the props
  • BREAKING CHANGE: Updated FieldTemplate, ObjectFieldTemplate and WrapIfAdditionalTemplate to rename the old additionalProperties interface props to the new ones
  • Updated BaseInputTemplate, CheckboxesWidget, CheckboxWidget, RadioWidget, SelectWidget, and TextareaWidget to use htmlName for the HTML name attribute
  • BREAKING CHANGE: Updated ArrayFieldTemplate to remove the ArrayFieldItemTemplate render in favor of simply using items due to ArrayField changes

@rjsf/react-bootstrap

  • BREAKING CHANGE: Updated FieldTemplate, ObjectFieldTemplate and WrapIfAdditionalTemplate to rename the old additionalProperties interface props to the new ones
  • Updated BaseInputTemplate, CheckboxesWidget, CheckboxWidget, RadioWidget, SelectWidget, and TextareaWidget to use htmlName for the HTML name attribute
  • BREAKING CHANGE: Updated ArrayFieldTemplate to remove the ArrayFieldItemTemplate render in favor of simply using items due to ArrayField changes

@rjsf/semantic-ui

  • BREAKING CHANGE: Updated FieldTemplate, ObjectFieldTemplate and WrapIfAdditionalTemplate to rename the old additionalProperties interface props to the new ones
  • Updated BaseInputTemplate, CheckboxesWidget, CheckboxWidget, RadioWidget, SelectWidget, and TextareaWidget to use htmlName for the HTML name attribute
  • BREAKING CHANGE: Updated ArrayFieldTemplate to remove the ArrayFieldItemTemplate render in favor of simply using items due to ArrayField changes
  • Updated ArrayFieldItemTemplate to refactor the getting of the semanticProps from ArrayFieldTemplate, using the new parentUiSchema prop to maintain the feature

@rjsf/shadcn

  • Updated the test mocks to remove formContext for the widget mock and added globalFormOptions in the registry mock
  • BREAKING CHANGE: Updated FieldTemplate, ObjectFieldTemplate and WrapIfAdditionalTemplate to rename the old additionalProperties interface props to the new ones
  • Updated BaseInputTemplate, CheckboxesWidget, CheckboxWidget, SelectWidget, and TextareaWidget to use htmlName for the HTML name attribute (Note: RadioWidget does not support htmlName due to Radix UI RadioGroup limitations)
  • BREAKING CHANGE: Updated ArrayFieldTemplate to remove the ArrayFieldItemTemplate render in favor of simply using items due to ArrayField changes

@rjsf/utils

  • BREAKING CHANGE: Updated FieldTemplateProps and WrapIfAdditionalTemplateProps to replace the onKeyChange() and onDropPropertyClick() callback-generator props with the onKeyRename(), onKeyRenameBlur() and onRemoveProperty() callback props
  • BREAKING CHANGE: Updated ObjectFieldTemplateProps to replace the onAddClick() callback-generator prop with the onAddProperty() callback prop
  • Added new hook useDeepCompareMemo() and its associated tests
  • Added NameGeneratorFunction type and two built-in name generators: bracketNameGenerator and dotNotationNameGenerator
  • Updated GlobalFormOptions type to include optional nameGenerator field
  • Updated toFieldPathId() function to support name generation via the nameGenerator option in GlobalFormOptions
  • Added htmlName field to WidgetProps interface to provide the generated HTML name attribute to widgets
  • BREAKING CHANGE: Renamed ArrayFieldItemTemplateType to ArrayFieldItemTemplateProps and updated it to change key: string to itemKey: string to avoid a name collision with React
  • BREAKING CHANGE: Updated ArrayFieldTemplateProps to change the type of the items prop from ArrayFieldItemTemplateType<T, S, F>[] to ReactElement[]
  • BREAKING CHANGE: Updated ArrayFieldItemButtonsTemplateType to replace the onAddIndexClick(), onCopyIndexClick(), onDropIndexClick() and onReorderClick() callback-generator props with the onAddItem(), onCopyItem(), onMoveUpItem(), onMoveDownItem() and onRemoveItem() callback props
  • BREAKING CHANGE: Updated `Ar...
Read more

6.0.0-beta.21

08 Oct 20:27

Choose a tag to compare

6.0.0-beta.21 Pre-release
Pre-release

New feature added

@rjsf/antd

  • Updated ArrayFieldTemplate, ObjectFieldTemplate, TitleField to add support for the new optionalDataControl feature
    • Added the new OptionalDataControlTemplate to the theme, adding it to the templates list
  • Updated the ButtonTemplates classes to fix up the props in AntdIconButtonProps and the IconButtons associated with them to better support the OptionalDataControlTemplate

@rjsf/chakra-ui

  • Updated ArrayFieldTemplate, ObjectFieldTemplate, TitleField to add support for the new optionalDataControl feature
    • Added the new OptionalDataControlTemplate to the theme, adding it to the templates list
  • Updated the ButtonTemplates classes to add ChakraIconButtonProps and the IconButtons associated with them to better support the OptionalDataControlTemplate

@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 the fields that renders either undefined (when there is data for a readonly/disabled field) or gets the OptionalDataControlsTemplate and renders the label and potentially an onAddClick or onRemoveClick function
  • Updated ArrayField and ObjectField to check whether it shouldRenderOptionalData() and if true, calls ObjectDataControlsField and passes the result to its associated render template as optionalDataControl
  • Updated ArrayFieldTemplate, ObjectFieldTemplate, TitleField to add support for the new optionalDataControl feature
    • Added the new OptionalDataControlTemplate to the theme, adding it to the templates list
  • Updated Form as follows to fix #4796
    • Refactored the liveValidate() and mergeErrors() functions out of getStateFromProp() and processPendingChange()
    • Added new, optional customErrors?: ErrorSchemaBuilder<T> to the FormState, updating the IChangeEvent interface to remove all of the private variables
    • Reworked the newErrorSchema handling in processPendingChange() to simplify the handling since newErrorSchema is now path-specific, adding newErrorSchema to customErrors 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() and filterErrorsBasedOnSchema() methods
  • Updated LayoutGridField to simplify onFieldChange() to just return the given errorSchema now that it is path-specific, fixing #4796
  • Updated NullField to pass fieldPathId.path for the onChange() instead of [name]

@rjsf/daisyui

  • Updated ArrayFieldTemplate, ArrayFieldTitleTemplate, ObjectFieldTemplate, TitleField to add support for the new optionalDataControl feature
    • Added the new OptionalDataControlTemplate to the theme, adding it to the templates list
  • Updated the ButtonTemplates classes to better support the OptionalDataControlTemplate

@rjsf/fluentui-rc

  • Updated ArrayFieldTemplate, ObjectFieldTemplate, TitleField to add support for the new optionalDataControl feature
    • Added the new OptionalDataControlTemplate to the theme, adding it to the templates list
  • Updated the ButtonTemplates classes to add FluentIconButtonProps and the IconButtons associated with them to better support the OptionalDataControlTemplate

@rjsf/mantine

  • Updated ArrayFieldTemplate, ObjectFieldTemplate, TitleField to add support for the new optionalDataControl feature
    • Added the new OptionalDataControlTemplate to the theme, adding it to the templates list

@rjsf/mui

  • Updated ArrayFieldTemplate, ObjectFieldTemplate, TitleField to add support for the new optionalDataControl feature
    • Added the new OptionalDataControlTemplate to the theme, adding it to the templates list

@rjsf/primereact

  • Updated ArrayFieldTemplate, ObjectFieldTemplate, TitleField to add support for the new optionalDataControl feature
    • Added the new OptionalDataControlTemplate to the theme, adding it to the templates list
  • Updated the ButtonTemplates classes to add PrimeIconButtonProps and the IconButtons associated with them to better support the OptionalDataControlTemplate

@rjsf/react-bootstrap

  • Updated ArrayFieldTemplate, ObjectFieldTemplate, TitleField to add support for the new optionalDataControl feature
    • Added the new OptionalDataControlTemplate to the theme, adding it to the templates list
  • Updated the ButtonTemplates classes to add BootstrapIconButtonProps and the IconButtons associated with them to better support the OptionalDataControlTemplate

@rjsf/semantic-ui

  • Updated ArrayFieldTemplate, ObjectFieldTemplate, TitleField to add support for the new optionalDataControl feature
    • Added the new OptionalDataControlTemplate to the theme, adding it to the templates list
  • Updated the ButtonTemplates classes to add SemanticIconButtonProps and the IconButtons associated with them to better support the OptionalDataControlTemplate

@rjsf/shadcn

  • Updated ArrayFieldTemplate, ObjectFieldTemplate, TitleField to add support for the new optionalDataControl feature
    • Added the new OptionalDataControlTemplate to the theme, adding it to the templates list
  • Updated the ButtonTemplates classes to add ShadIconButtonProps and the IconButtons associated with them to better support the OptionalDataControlTemplate

@rjsf/utils

  • Updated getDefaultFormState to add a new initialDefaultsGenerated prop flag, along with type definitions, fixing uneditable & permanent defaults with additional properties 3759
  • Updated createSchemaUtils definition to reflect addition of initialDefaultsGenerated
  • Updated existing tests where getDefaultFormState is used to reflect addition of initialDefaultsGenerated
  • Updated types.ts to support the new Optional Data Controls feature as follows:
    • Added new OptionalDataControlsTemplateProps and refactored the common props from ArrayFieldTemplateProps and ObjectFieldTemplateProps into a new super type, ContainerFieldTemplateProps
    • Added new optionalDataControl?: ReactNode to the ArrayFieldTitleProps, TitleFieldProps and ContainerFieldTemplateProps
    • Updated GlobalFormOptions to add new enableOptionalDataFieldForType?: ('object' | 'array')[] prop
    • Updated SchemaUtilsType's retrieveSchema() function to add an additional, property resolveAnyOfOrOneOfRefs?: boolean
  • Updated the Templates interface to add a new required template OptionalDataControlsTemplate: ComponentType<OptionalDataControlsTemplateProps<T, S, F>>
  • Updated retrieveSchema() to add an additional property resolveAnyOfOrOneOfRefs?: boolean which causes resolveAllSchemas() to resolve $refs inside of the options of anyOf/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 and OptionalObjectEmptyMsg
  • Added four new utility functions: isFormDataAvailable(), isRootSchema(), optionalControlsId(), and shouldRenderOptionalField()
  • Updated validationDataMerge() to add an additional, optional parameter preventDuplicates = false, that causes the mergeObjects() call to receive preventDuplicates instead of true

Dev / docs / playground

  • Updated docs for getDefaultFormState to reflect addition of the initialDefaultsGenerated prop
  • Updated utility-function.me docs to add documentation for the new functions and to update the validationDataMerge() function's new parameter
    • Also updated docs for retrieveSchema and SchemaUtilsType for the new prop
  • Updated uiSchema.md to add documentation for the new enableOptionalDataFieldForType prop
  • Updated the playground to add a new Optional Data Controls example
  • Updated the snapshot and jest tests for Form to test the new Optional Data Controls feature
  • Updated custom-widgets-fields.md to change the documentation around passing errors via onChange() 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

02 Oct 00:53

Choose a tag to compare

6.0.0-beta.20 Pre-release
Pre-release

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 to fieldPathId 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 to fieldPathId 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 to fieldPathId or to remove the <T> off of the idGenerator functions
    • ObjectField and ArrayField to use toFieldPathId instead of toIdSchema() to generate the fieldPathIds of all its children
    • Updated the onChange handling of fields to make path required and either pass it straight through, or use the fieldPathId.path instead of using an empty array or appending path information
    • Updated Form to use toFieldPathId() to generate fieldPathId instead of idSchema, always providing the idPrefix and idSeparator in the globalFormOptions and make the path: FieldPathList required
    • Updated LayoutGridField to remove the IdSchema related code in favor of FieldPathId code
  • Also exported the getTestRegistry() function from the main index.ts to assist developers in creating registry 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 to fieldPathId or to remove the <T> off of the idGenerator functions
  • Also fixed the FieldTemplate to extract the description element so that it was not spread onto the div, fixing the snapshots

@rjsf/fluent-ui

  • BREAKING CHANGES - Updated all of the templates and widgets to change idSchema to fieldPathId or to remove the <T> off of the idGenerator functions

@rjsf/mantine

  • BREAKING CHANGES - Updated all of the templates and widgets to change idSchema to fieldPathId or to remove the <T> off of the idGenerator functions

@rjsf/mui

  • BREAKING CHANGES - Updated all of the templates and widgets to change idSchema to fieldPathId or to remove the <T> off of the idGenerator functions

@rjsf/primereact

  • BREAKING CHANGES - Updated all of the templates and widgets to change idSchema to fieldPathId 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 to fieldPathId 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 to fieldPathId or to remove the <T> off of the idGenerator functions

@rjsf/shadcn

  • BREAKING CHANGES - Updated all of the templates and widgets to change idSchema to fieldPathId or to remove the <T> off of the idGenerator functions

@rjsf/utils

  • Added new FieldPathList and FieldPathId types and DEFAULT_ID_PREFIX and DEFAULT_ID_SEPARATOR to constants.ts
  • Added the new toFieldPathId() function to generate FieldPathIds, exporting it from the library
  • Deprecated the ui:rootFieldId in the UiSchema since idPrefix does the same exact thing
  • BREAKING CHANGES
    • Removed the IdSchema type, replacing idSchema: IdSchema<T> in all types with fieldPathId: FieldPathId
    • Updated the idGenerators to replace id: IdSchema<T> | string with id: FieldPathId | string removing the need for the <T = any> generic on the functions
    • Removed the toIdSchema() function in the schema directory
    • Updated the FieldProps type's onChange() callback to make the path: FieldPathList parameter be required instead of optional
    • Updated the SchemaUtilsType and createSchemaUtils() to remove the toIdSchema() function

@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 and layout-grid.md to change the idSchema documentation to fieldPathId
  • Updated uiSchema.md to mark the ui:rootFieldId as deprecated in the documentation
  • Updated utility-functions.md delete toIdSchema(), add toFieldPathId() 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 in 6.0.0-beta.20