diff --git a/CHANGELOG.md b/CHANGELOG.md index 113d93822e..d4dc1c5759 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,55 +20,76 @@ should change the heading of the (upcoming) version to include a major version b ## @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](https://github.com/rjsf-team/react-jsonschema-form/issues/3296) -## @rjsf/antd - -- Added support for rendering `ui:help` as markdown via new `ui:enableMarkdownInHelp` flag in `FieldHelpTemplate` - -## @rjsf/antd +## @rjsf/chakra-ui - Added support for rendering `ui:help` as markdown via new `ui:enableMarkdownInHelp` flag in `FieldHelpTemplate` -## @rjsf/mui +## @rjsf/core -- Added support for rendering `ui:help` as markdown via new `ui:enableMarkdownInHelp` flag in `FieldHelpTemplate` +- Added new `RichHelp` component for use in all the themes for help rendering, fixing [#4601](https://github.com/rjsf-team/react-jsonschema-form/issues/4601) +- Updated `ArrayField` to compute and pass `displayLabel` and `hasDescription` to the rendered `ArrayFieldItemTemplate` to support fixing [#3296](https://github.com/rjsf-team/react-jsonschema-form/issues/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](https://github.com/rjsf-team/react-jsonschema-form/issues/3296) +- Updated `AddButton` to improve it's responsiveness in relation to the `ArrayFieldItemTemplate` changes -## @rjsf/shadcn +## @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](https://github.com/rjsf-team/react-jsonschema-form/issues/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 -## @rjsf/primereact +## @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](https://github.com/rjsf-team/react-jsonschema-form/issues/3296) +- Updated `WrapIfAdditionalTemplate` to add `flexGrow` to allow the array item fields to grow properly for non-container elements -## @rjsf/react-bootstrap +## @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` -## @rjsf/semantic-ui +## @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](https://github.com/rjsf-team/react-jsonschema-form/issues/3296) -## @rjsf/daisyui +## @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](https://github.com/rjsf-team/react-jsonschema-form/issues/3296) -## @rjsf/fluentui-rc +## @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](https://github.com/rjsf-team/react-jsonschema-form/issues/3296) +- Updated `ArrayFieldTemplate` to improve it's responsiveness in relation to the `ArrayFieldItemTemplate` changes -## @rjsf/chakra-ui +## @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](https://github.com/rjsf-team/react-jsonschema-form/issues/3296) -## @rjsf/mantine +## @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](https://github.com/rjsf-team/react-jsonschema-form/issues/3296) +- Updated `ArrayFieldTemplate` to add `justify-end` to the `AddButton` rendering ## @rjsf/utils -- Added support for rendering `ui:help` as markdown via new `ui:enableMarkdownInHelp` flag in `FieldHelpTemplate` +- Added new `enableMarkdownInHelp` to the `GlobalUISchemaOptions` type, fixing [#4601](https://github.com/rjsf-team/react-jsonschema-form/issues/4601) +- Added new `displayLabel` and `hasDescription` flags in the `ArrayFieldItemTemplateProps` to support fixing [#3296](https://github.com/rjsf-team/react-jsonschema-form/issues/3296) +- Updated the three hooks to add `use client` directive to support NextJS builds + +## Dev / docs / playground +- Updated `uiSchema.md` in the docs to document the new `enableMarkdownInHelp` flag # 6.0.2 diff --git a/packages/antd/src/templates/ArrayFieldItemTemplate/index.tsx b/packages/antd/src/templates/ArrayFieldItemTemplate/index.tsx index 9cfad610ae..397cdbbb9f 100644 --- a/packages/antd/src/templates/ArrayFieldItemTemplate/index.tsx +++ b/packages/antd/src/templates/ArrayFieldItemTemplate/index.tsx @@ -10,6 +10,7 @@ import { const BTN_GRP_STYLE = { width: '100%', + justifyContent: 'flex-end', }; const BTN_STYLE = { @@ -25,21 +26,21 @@ export default function ArrayFieldItemTemplate< S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any, >(props: ArrayFieldItemTemplateProps) { - const { children, buttonsProps, hasToolbar, index, registry, uiSchema } = props; + const { children, buttonsProps, displayLabel, hasDescription, hasToolbar, index, registry, uiSchema } = props; const uiOptions = getUiOptions(uiSchema); const ArrayFieldItemButtonsTemplate = getTemplate<'ArrayFieldItemButtonsTemplate', T, S, F>( 'ArrayFieldItemButtonsTemplate', registry, uiOptions, ); - const { rowGutter = 24, toolbarAlign = 'top' } = registry.formContext; + const { rowGutter = 24, toolbarAlign = displayLabel ? 'middle' : 'top' } = registry.formContext; + const margin = hasDescription ? -8 : 16; return ( {children} - {hasToolbar && ( - + diff --git a/packages/antd/src/templates/ArrayFieldTemplate/index.tsx b/packages/antd/src/templates/ArrayFieldTemplate/index.tsx index ec685d6d99..494cfb6891 100644 --- a/packages/antd/src/templates/ArrayFieldTemplate/index.tsx +++ b/packages/antd/src/templates/ArrayFieldTemplate/index.tsx @@ -82,7 +82,7 @@ export default function ArrayFieldTemplate< {canAdd && ( - +
- Test item + Test field-2