You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I would love the ability to render a singular field using RJSF. This would be useful for places where you are supposed to give in a singular field.
For example, using ant design pro components's ProTable, if you want to specify the filter component (component shown in the filter form above the table) you have to specify one singular component that takes care of filtering that column of data, but I want to request this data from the backend as a JSON schema (and UI schema) and render the fields based on what the backend gave me.
Describe the solution you'd like
I would see this done through 3 components:
RJSF Provider;
RJSF Form;
RJSF Field.
The <Provider /> component would provide common logic to both Form and Field (like the available widgets).
The <Form /> component would work as it works right now, except, if it has a provider above it, it will take some props from there (like widgets).
The <Field /> component would take a schema (and an UI schema) for a single field, for example:
{
"type": "integer",
"min": 1,
"max": 5
}
and a UI schema like
{
"ui:widget": "stars",
"ui:color": "yellow"
}
and render a singular field.
Describe alternatives you've considered
Creating my own mapping of components that I allowed my backend to render.
The text was updated successfully, but these errors were encountered:
@ferretwithaberet The simplest approach for you to use is the tagName property on Form. If you set this to span or div you can use it to simply generate the inputs. No need for the complex design you are asking for.
@ferretwithaberet The simplest approach for you to use is the tagName property on Form. If you set this to span or div you can use it to simply generate the inputs. No need for the complex design you are asking for.
My issue with this is that ProTable wraps it's form items in ProForm.Item, so then I would have the label added by ProTable's ProForm.Item and the one from Form.Item from @rjsf/antd. I will look into a way to provide noStyle to the Form.Item inside of RJSF and make a PR if I have the time for it.
@ferretwithaberet Since the Form.Item compenents are in Templates, you could provide your own override versions of them without needing to update RJSF directly. See the Custom Templates documentation for more details
Prerequisites
What theme are you using?
antd
Is your feature request related to a problem? Please describe.
I would love the ability to render a singular field using RJSF. This would be useful for places where you are supposed to give in a singular field.
For example, using ant design pro components's ProTable, if you want to specify the filter component (component shown in the filter form above the table) you have to specify one singular component that takes care of filtering that column of data, but I want to request this data from the backend as a JSON schema (and UI schema) and render the fields based on what the backend gave me.
Describe the solution you'd like
I would see this done through 3 components:
The
<Provider />
component would provide common logic to bothForm
andField
(like the available widgets).The
<Form />
component would work as it works right now, except, if it has a provider above it, it will take some props from there (likewidgets
).The
<Field />
component would take a schema (and an UI schema) for a single field, for example:and a UI schema like
and render a singular field.
Describe alternatives you've considered
Creating my own mapping of components that I allowed my backend to render.
The text was updated successfully, but these errors were encountered: