Skip to content

Commit

Permalink
feat: Add properties to match form rework (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-martinez authored Sep 12, 2022
1 parent 2b705d1 commit e0147d0
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/components/button.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
]
}
}
},
"submit": {
"description": "Whether the button is a submit button for a form.",
"type": "boolean",
"default": false
}
},
"required": [
Expand Down
4 changes: 4 additions & 0 deletions api/components/checkbox.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
"autofocus": {
"description": "Whether the checkbox is focused initially.",
"type": "boolean"
},
"name": {
"description": "The name that will be used in the form.",
"type": "string"
}
},
"required": [
Expand Down
27 changes: 27 additions & 0 deletions api/components/form.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "https://raw.githubusercontent.com/lenra-io/ex_component_schema/beta/priv/static/draft-lenra.json",
"$id": "form.schema.json",
"title": "Form",
"description": "Element of type Form",
"type": "component",
"properties": {
"type": {
"description": "The type of the element",
"enum": [
"form"
]
},
"child": {
"type": "component"
},
"onSubmit": {
"description": "Callback when the user submits the form.",
"$ref": "defs/listener.schema.json"
}
},
"required": [
"type",
"child"
],
"additionalProperties": false
}
4 changes: 4 additions & 0 deletions api/components/radio.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
},
"style": {
"$ref": "defs/radioStyle.schema.json"
},
"name": {
"description": "The name that will be used in the form.",
"type": "string"
}
},
"required": [
Expand Down
4 changes: 4 additions & 0 deletions api/components/slider.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
"description": "The current value of the slider.",
"type": "number",
"default": 0.0
},
"name": {
"description": "The name that will be used in the form.",
"type": "string"
}
},
"required": [
Expand Down
4 changes: 4 additions & 0 deletions api/components/textfield.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@
"toolbarOptions": {
"description": "Configuration of toolbar options",
"$ref": "defs/toolbarOptions.schema.json"
},
"name": {
"description": "The name that will be used in the form.",
"type": "string"
}
},
"required": [
Expand Down
9 changes: 9 additions & 0 deletions api/components/toggle.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
},
"style": {
"$ref": "defs/toggleStyle.schema.json"
},
"name": {
"description": "The name that will be used in the form.",
"type": "string"
},
"disabled": {
"description": "The toggle is disabled if true",
"type": "boolean",
"default": false
}
},
"required": [
Expand Down

0 comments on commit e0147d0

Please sign in to comment.