-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Add support for custom styles in a manner similar to classNames #3378
fix: Add support for custom styles in a manner similar to classNames #3378
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@heath-freenome WDYT about using style
to match the React property rather than styles
? It seemed like @epicfaace also suggested the same in the original issue and PR.
Code changes otherwise LGTM.
Fixes rjsf-team#1200 by reimplementing rjsf-team#1256 - In `@rjsf/utils`, added the new `style` prop onto `FieldTemplateProps`, `WrapIfAdditionalTemplateProps` and `UIOptionsBaseType` - In `@rjsf/core`, added support for the new `style` prop in `uiSchema` as follows: - Updated `SchemaField` to handle the new `style` prop in the `uiSchema` similarly to `classNames`, passing it to the `FieldTemplate` and removing it from being passed down to children. - Also, added support for new `style` prop on `FieldTemplate` and `WrapIfAdditionalTemplate` rendering them on the outermost wrapper - Added or updated tests to verify the `style` prop functionality - In all the themes, added support for new `style` prop on `FieldTemplate` and `WrapIfAdditionalTemplate` rendering them on the outermost wrapper - Fluent-ui is a special case since it doesn't currently implement `WrapIfAdditionalTemplate` fully - Updated the documentation to describe this new `style` prop - Also updated the `validation` documentation to describe the `uiSchema` prop that can be passed to the `customValidate()` and `transformError()` functions - Updated the `CHANGELOG.md` accordingly
29b58f9
to
1cb0ef3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed a couple in the changelog, won't block you from merging
Co-authored-by: Nick Grosenbacher <nickgrosenbacher@gmail.com>
…jsf-team#3378) * fix: Add support for custom styles in a manner similar to classNames Fixes rjsf-team#1200 by reimplementing rjsf-team#1256 - In `@rjsf/utils`, added the new `style` prop onto `FieldTemplateProps`, `WrapIfAdditionalTemplateProps` and `UIOptionsBaseType` - In `@rjsf/core`, added support for the new `style` prop in `uiSchema` as follows: - Updated `SchemaField` to handle the new `style` prop in the `uiSchema` similarly to `classNames`, passing it to the `FieldTemplate` and removing it from being passed down to children. - Also, added support for new `style` prop on `FieldTemplate` and `WrapIfAdditionalTemplate` rendering them on the outermost wrapper - Added or updated tests to verify the `style` prop functionality - In all the themes, added support for new `style` prop on `FieldTemplate` and `WrapIfAdditionalTemplate` rendering them on the outermost wrapper - Fluent-ui is a special case since it doesn't currently implement `WrapIfAdditionalTemplate` fully - Updated the documentation to describe this new `style` prop - Also updated the `validation` documentation to describe the `uiSchema` prop that can be passed to the `customValidate()` and `transformError()` functions - Updated the `CHANGELOG.md` accordingly * - Renamed `styles` to `style` * Apply suggestions from code review Co-authored-by: Nick Grosenbacher <nickgrosenbacher@gmail.com> Co-authored-by: Nick Grosenbacher <nickgrosenbacher@gmail.com>
…jsf-team#3378) * fix: Add support for custom styles in a manner similar to classNames Fixes rjsf-team#1200 by reimplementing rjsf-team#1256 - In `@rjsf/utils`, added the new `style` prop onto `FieldTemplateProps`, `WrapIfAdditionalTemplateProps` and `UIOptionsBaseType` - In `@rjsf/core`, added support for the new `style` prop in `uiSchema` as follows: - Updated `SchemaField` to handle the new `style` prop in the `uiSchema` similarly to `classNames`, passing it to the `FieldTemplate` and removing it from being passed down to children. - Also, added support for new `style` prop on `FieldTemplate` and `WrapIfAdditionalTemplate` rendering them on the outermost wrapper - Added or updated tests to verify the `style` prop functionality - In all the themes, added support for new `style` prop on `FieldTemplate` and `WrapIfAdditionalTemplate` rendering them on the outermost wrapper - Fluent-ui is a special case since it doesn't currently implement `WrapIfAdditionalTemplate` fully - Updated the documentation to describe this new `style` prop - Also updated the `validation` documentation to describe the `uiSchema` prop that can be passed to the `customValidate()` and `transformError()` functions - Updated the `CHANGELOG.md` accordingly * - Renamed `styles` to `style` * Apply suggestions from code review Co-authored-by: Nick Grosenbacher <nickgrosenbacher@gmail.com> Co-authored-by: Nick Grosenbacher <nickgrosenbacher@gmail.com>
Reasons for making this change
Fixes #1200 by reimplementing #1256
@rjsf/utils
, added the newstyle
prop ontoFieldTemplateProps
,WrapIfAdditionalTemplateProps
andUIOptionsBaseType
@rjsf/core
, added support for the newstyle
prop inuiSchema
as follows:SchemaField
to handle the newstyle
prop in theuiSchema
similarly toclassNames
, passing it to theFieldTemplate
and removing it from being passed down to children.style
prop onFieldTemplate
andWrapIfAdditionalTemplate
rendering them on the outermost wrapperstyle
prop functionalitystyle
prop onFieldTemplate
andWrapIfAdditionalTemplate
rendering them on the outermost wrapperWrapIfAdditionalTemplate
fullystyle
propvalidation
documentation to describe theuiSchema
prop that can be passed to thecustomValidate()
andtransformError()
functionsCHANGELOG.md
accordinglyChecklist
npm run test:update
to update snapshots, if needed.