Skip to content

Commit d45af8b

Browse files
Fix 2280 by moving the bootstrap 3 classes out of SchemaField (#4579)
* Fix 2280 by moving the bootstrap 3 marker classes out of SchemaField Fixed #2280 by moving marker classes from `SchemaField` to `WrapIfAdditionalTemplate` - In `@rjsf/utils`, updated `WrapIfAdditionalTemplateProps` to pick up the `hideError` and `rawErrors` props from `FieldTemplateProps` - In `@rjsf/core`, updated `SchemaField` to move the `form-group` and `field` marker classes to the `WrapIfAdditionalTemplate` - Also moved the `field-error`, `has-error` and `has-danger` error marker classes - Updated the grid snapshot due to the change - Updated the snapshots in other themes due to the removed marker classes - Updated the `CHANGELOG_v6.md` and `v6x upgrade guide.md` to reflect these changes * - prefixed all rjsf marker classes with `rjsf-` * - Added `field-hidden` to docs * - Fixed build by redoing snapshots after running build
1 parent 3aabe37 commit d45af8b

File tree

91 files changed

+3186
-3147
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+3186
-3147
lines changed

CHANGELOG_v6.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ should change the heading of the (upcoming) version to include a major version b
2525
- BREAKING CHANGE: Removed support for version 4 of `antd`
2626
- Updated `ArrayFieldItemTemplate` to replace `Button.Group` with `Space.Compact` since `Button.Group` is deprecated in `antd` version 5
2727
- Upgraded to `@ant-design/icon@5`
28+
- BREAKING CHANGE: Removed the addition of `Bootstrap 3` classes from the `SchemaField` and added `rjsf-` prefix to marker classes, thereby changing theme `FieldTemplate` className prop output and associated snapshots
2829

2930
## @rjsf/chakra-ui
3031

@@ -33,6 +34,7 @@ should change the heading of the (upcoming) version to include a major version b
3334
- BREAKING CHANGE: Refactored `ArrayFieldItemTemplate` to use the new `ArrayFieldItemButtonsTemplate`
3435
- Updated the `ArrayFieldTemplate`, `ObjectFieldTemplate`, and `WrapIfAdditionalTemplate` to a unique id using the `buttonId()` function and adding consistent marker classes
3536
- Implemented the `GridTemplate` component, adding it to the `templates` for the theme
37+
- BREAKING CHANGE: Removed the addition of `Bootstrap 3` classes from the `SchemaField` and added `rjsf-` prefix to marker classes, thereby changing theme `FieldTemplate` className prop output and associated snapshots
3638

3739
## @rjsf/core
3840

@@ -43,6 +45,9 @@ should change the heading of the (upcoming) version to include a major version b
4345
- Implemented the `GridTemplate` component, adding it to the `templates` for the theme
4446
- Implemented the new `LayoutGridField`, `LayoutMultiSchemaField` and `LayoutHeaderField` fields, adding them to the `fields` list
4547
- BREAKING CHANGE: Removed support for the deprecated `schema.enumNames` and `uiSchema.classNames` as well as the deprecated `acceptcharset` prop on `Form`
48+
- BREAKING CHANGE: Moved the addition of `Bootstrap 3` classes from the `SchemaField` to the `WrapIfAdditionalTemplate`, thereby affecting all the other themes, fixing [#2280](https://github.com/rjsf-team/react-jsonschema-form/issues/2280)
49+
- BREAKING CHANGE: Added `rjsf-` prefix onto the following marker classes used in the fields and templates:
50+
- `field`, `field-<schema.type>`, `field-error`, `field-hidden`, `field-array`, `field-array-of-<schema.type>`, `field-array-fixed-items`, `array-item`, `config-error`, `array-item-add`, `array-item-copy`, `array-item-move-down`, `array-item-move-up`, `array-item-remove`, `object-property-expand`
4651

4752
## @rjsf/daisyui
4853

@@ -57,19 +62,26 @@ should change the heading of the (upcoming) version to include a major version b
5762
- BREAKING CHANGE: Refactored `ArrayFieldItemTemplate` to use the new `ArrayFieldItemButtonsTemplate`
5863
- Updated the `ArrayFieldTemplate`, `ObjectFieldTemplate`, and `WrapIfAdditionalTemplate` to a unique id using the `buttonId()` function and adding consistent marker classes
5964
- Implemented the `GridTemplate` component, adding it to the `templates` for the theme
65+
- BREAKING CHANGE: Removed the addition of `Bootstrap 3` classes from the `SchemaField` and added `rjsf-` prefix to marker classes, thereby changing theme `FieldTemplate` className prop output and associated snapshots
66+
67+
## @rjsf/material-ui
68+
69+
- BREAKING CHANGE: Deleted this theme in favor of `mui`
6070

6171
## @rjsf/mui
6272

6373
- BREAKING CHANGE: Refactored `ArrayFieldItemTemplate` to use the new `ArrayFieldItemButtonsTemplate`
6474
- Updated the `ArrayFieldTemplate`, `ObjectFieldTemplate`, and `WrapIfAdditionalTemplate` to a unique id using the `buttonId()` function and adding consistent marker classes
6575
- Updated the theme to use `Grid2` instead of the deprecated `Grid`
6676
- Implemented the `GridTemplate` component, adding it to the `templates` for the theme
77+
- BREAKING CHANGE: Removed the addition of `Bootstrap 3` classes from the `SchemaField` and added `rjsf-` prefix to marker classes, thereby changing theme `FieldTemplate` className prop output and associated snapshots
6778

6879
## @rjsf/semantic-ui
6980

7081
- BREAKING CHANGE: Refactored `ArrayFieldItemTemplate` to use the new `ArrayFieldItemButtonsTemplate`
7182
- Updated the `ArrayFieldTemplate`, `ObjectFieldTemplate`, and `WrapIfAdditionalTemplate` to a unique id using the `buttonId()` function and adding consistent marker classes
7283
- Implemented the `GridTemplate` component, adding it to the `templates` for the theme
84+
- BREAKING CHANGE: Removed the addition of `Bootstrap 3` classes from the `SchemaField` and added `rjsf-` prefix to marker classes, thereby changing theme `FieldTemplate` className prop output and associated snapshots
7385

7486
## @rjsf/shadcn
7587

@@ -98,6 +110,7 @@ should change the heading of the (upcoming) version to include a major version b
98110
- BREAKING CHANGE: Removed the deprecated `getMatchingOption()` and `mergeValidationData()` from the library export and the `SchemaUtilsType` interface
99111
- BREAKING CHANGE: Removed the deprecated `toErrorList()` function from the `ValidatorType` interface
100112
- BREAKING CHANGE: Removed the deprecated `RJSF_ADDITONAL_PROPERTIES_FLAG` constant
113+
- Updated the `WrapIfAdditionalTemplateProps` to include `hideError` and `rawErrors` in support of moving `Bootstrap 3` marker classes out of `SchemaField`
101114

102115
## @rjsf/validator-ajv6
103116

packages/antd/src/templates/ArrayFieldItemTemplate/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default function ArrayFieldItemTemplate<
3535
const { rowGutter = 24, toolbarAlign = 'top' } = registry.formContext;
3636

3737
return (
38-
<Row align={toolbarAlign} key={`array-item-${index}`} gutter={rowGutter}>
38+
<Row align={toolbarAlign} key={`rjsf-array-item-${index}`} gutter={rowGutter}>
3939
<Col flex='1'>{children}</Col>
4040

4141
{hasToolbar && (

packages/antd/src/templates/ArrayFieldTemplate/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export default function ArrayFieldTemplate<
111111
<Col flex='192px'>
112112
<AddButton
113113
id={buttonId<T>(idSchema, 'add')}
114-
className='array-item-add'
114+
className='rjsf-array-item-add'
115115
disabled={disabled || readonly}
116116
onClick={onAddClick}
117117
uiSchema={uiSchema}

packages/antd/src/templates/FieldTemplate/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default function FieldTemplate<
6262
);
6363

6464
if (hidden) {
65-
return <div className='field-hidden'>{children}</div>;
65+
return <div className='rjsf-field-hidden'>{children}</div>;
6666
}
6767

6868
// check to see if there is rawDescription(string) before using description(ReactNode)

packages/antd/src/templates/ObjectFieldTemplate/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export default function ObjectFieldTemplate<
155155
<Col flex='192px'>
156156
<AddButton
157157
id={buttonId<T>(idSchema, 'add')}
158-
className='object-property-expand'
158+
className='rjsf-object-property-expand'
159159
disabled={disabled || readonly}
160160
onClick={onAddClick(schema)}
161161
uiSchema={uiSchema}

packages/antd/src/templates/WrapIfAdditionalTemplate/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export default function WrapIfAdditionalTemplate<
110110
<Col flex='192px'>
111111
<RemoveButton
112112
id={buttonId<T>(id, 'remove')}
113-
className='array-item-remove'
113+
className='rjsf-object-property-remove'
114114
disabled={disabled || readonly}
115115
onClick={onDropPropertyClick(label)}
116116
uiSchema={buttonUiOptions}

0 commit comments

Comments
 (0)