-
Notifications
You must be signed in to change notification settings - Fork 1
Element Groups
Pratyush Kumar edited this page Dec 28, 2022
·
2 revisions
There are two types of element groups:
-
ElementGroup
- normal element groups that simply group input fields together. -
OptionalFieldGroup
- group of elements that is only rendered when specified conditions are met.
They are defined as shown below.
Defines a normal element group
Schema:
{
"sort": someNumber
"uiType": "Group",
"jsonKey": "someValue",
"level": someNumber,
"label": "Name of the group to be display above them",
"description": "Tooltip info to be shown when an ℹ️ icon next to the label is hovered",
"icon": "Any icon to be shown next to the label",
"validate": {
"required": booleanValue,
"subParameters": [
...,
FormElementSchema,
...
]
}
}
Defines optional element group that is rendered only when specified conditions are met.
Schema:
{
"sort": someNumber
"uiType": "Group",
"jsonKey": "someValue",
"level": someNumber,
"label": "Name of the group to be display above them",
"description": "Tooltip info to be shown when an ℹ️ icon next to the label is hovered",
"icon": "Any icon to be shown next to the label",
"validate": {
"required": booleanValue,
"conditions": [
...,
{
"jsonKey": "jsonKey of the form element you want to watch the value of",
"value": "value that you want to compare with the value of the element whose 'jsonKey' is provided",
"op": "logical operation you want to perform between the 'value' and the value of the element whose 'jsonKey' is provided",
"action": "action you want to take when the comparison done using the above three parameters is true. Currently on supports 'enable' which makes the fields visible within it visible when the condition is satisfied"
},
...
],
"subParameters": [
...,
FormElementSchema,
...
]
}
}