-
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
✨ Add support for a custom style in uiSchema #1256
Conversation
Looks good! Can we make style an attribute under ui:options? That way, this change won't impact schemas that already have properties named "style". |
@epicfaace, that is a good point. I wanted to keep it under Just wanted to make sure I understood your concern. When you say schemas that already have properties named |
@justtonytone Both. If a schema has a property named I think it's unfortunate how |
@justtonytone I'd be glad to merge this PR if you are able to change it so that the style attribute is accepted as follows:
|
hi @epicfaace do you have an eta on when this feature might be included? thanks! |
Fixes rjsf-team#1200 by reimplementing rjsf-team#1256 - In `@rjsf/utils`, added the new `styles` prop onto `FieldTemplateProps`, `WrapIfAdditionalTemplateProps` and `UIOptionsBaseType` - In `@rjsf/core`, added support for the new `styles` prop in `uiSchema` as follows: - Updated `SchemaField` to handle the new `styles` 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 `styles` prop on `FieldTemplate` and `WrapIfAdditionalTemplate` rendering them on the outermost wrapper - Added or updated tests to verify the `styles` prop functionality - In all the themes, added support for new `styles` 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 `styles` 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
Reimplemented in #3378 |
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
…3378) * fix: Add support for custom styles in a manner similar to classNames Fixes #1200 by reimplementing #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>
…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
More flexibility to use inline styles. Handles #1200
If this is related to existing tickets, include links to them as well.
Checklist
npm run cs-format
on my branch to conform my code to prettier coding style