alias form to form.root (#2579)
This commit is contained in:
parent
93c0091aad
commit
6e946631f3
@ -293,11 +293,11 @@ class FormSubmit(FormComponent):
|
|||||||
class Form(SimpleNamespace):
|
class Form(SimpleNamespace):
|
||||||
"""Form components."""
|
"""Form components."""
|
||||||
|
|
||||||
|
root = __call__ = staticmethod(FormRoot.create)
|
||||||
control = staticmethod(FormControl.create)
|
control = staticmethod(FormControl.create)
|
||||||
field = staticmethod(FormField.create)
|
field = staticmethod(FormField.create)
|
||||||
label = staticmethod(FormLabel.create)
|
label = staticmethod(FormLabel.create)
|
||||||
message = staticmethod(FormMessage.create)
|
message = staticmethod(FormMessage.create)
|
||||||
root = staticmethod(FormRoot.create)
|
|
||||||
submit = staticmethod(FormSubmit.create)
|
submit = staticmethod(FormSubmit.create)
|
||||||
validity_state = staticmethod(FormValidityState.create)
|
validity_state = staticmethod(FormValidityState.create)
|
||||||
|
|
||||||
|
@ -753,12 +753,99 @@ class FormSubmit(FormComponent):
|
|||||||
...
|
...
|
||||||
|
|
||||||
class Form(SimpleNamespace):
|
class Form(SimpleNamespace):
|
||||||
|
root = staticmethod(FormRoot.create)
|
||||||
control = staticmethod(FormControl.create)
|
control = staticmethod(FormControl.create)
|
||||||
field = staticmethod(FormField.create)
|
field = staticmethod(FormField.create)
|
||||||
label = staticmethod(FormLabel.create)
|
label = staticmethod(FormLabel.create)
|
||||||
message = staticmethod(FormMessage.create)
|
message = staticmethod(FormMessage.create)
|
||||||
root = staticmethod(FormRoot.create)
|
|
||||||
submit = staticmethod(FormSubmit.create)
|
submit = staticmethod(FormSubmit.create)
|
||||||
validity_state = staticmethod(FormValidityState.create)
|
validity_state = staticmethod(FormValidityState.create)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def __call__(
|
||||||
|
*children,
|
||||||
|
reset_on_submit: Optional[Union[Var[bool], bool]] = None,
|
||||||
|
handle_submit_unique_name: Optional[Union[Var[str], str]] = None,
|
||||||
|
as_child: Optional[Union[Var[bool], bool]] = None,
|
||||||
|
style: Optional[Style] = None,
|
||||||
|
key: Optional[Any] = None,
|
||||||
|
id: Optional[Any] = None,
|
||||||
|
class_name: Optional[Any] = None,
|
||||||
|
autofocus: Optional[bool] = None,
|
||||||
|
_rename_props: Optional[Dict[str, str]] = None,
|
||||||
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
||||||
|
on_blur: Optional[
|
||||||
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
||||||
|
] = None,
|
||||||
|
on_clear_server_errors: Optional[
|
||||||
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
||||||
|
] = None,
|
||||||
|
on_click: Optional[
|
||||||
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
||||||
|
] = None,
|
||||||
|
on_context_menu: Optional[
|
||||||
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
||||||
|
] = None,
|
||||||
|
on_double_click: Optional[
|
||||||
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
||||||
|
] = None,
|
||||||
|
on_focus: Optional[
|
||||||
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
||||||
|
] = None,
|
||||||
|
on_mount: Optional[
|
||||||
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
||||||
|
] = None,
|
||||||
|
on_mouse_down: Optional[
|
||||||
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
||||||
|
] = None,
|
||||||
|
on_mouse_enter: Optional[
|
||||||
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
||||||
|
] = None,
|
||||||
|
on_mouse_leave: Optional[
|
||||||
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
||||||
|
] = None,
|
||||||
|
on_mouse_move: Optional[
|
||||||
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
||||||
|
] = None,
|
||||||
|
on_mouse_out: Optional[
|
||||||
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
||||||
|
] = None,
|
||||||
|
on_mouse_over: Optional[
|
||||||
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
||||||
|
] = None,
|
||||||
|
on_mouse_up: Optional[
|
||||||
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
||||||
|
] = None,
|
||||||
|
on_scroll: Optional[
|
||||||
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
||||||
|
] = None,
|
||||||
|
on_submit: Optional[
|
||||||
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
||||||
|
] = None,
|
||||||
|
on_unmount: Optional[
|
||||||
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
||||||
|
] = None,
|
||||||
|
**props
|
||||||
|
) -> "FormRoot":
|
||||||
|
"""Create a form component.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
*children: The children of the form.
|
||||||
|
reset_on_submit: If true, the form will be cleared after submit.
|
||||||
|
handle_submit_unique_name: The name used to make this form's submit handler function unique.
|
||||||
|
as_child: Change the default rendered element for the one passed as a child.
|
||||||
|
style: The style of the component.
|
||||||
|
key: A unique key for the component.
|
||||||
|
id: The id for the component.
|
||||||
|
class_name: The class name for the component.
|
||||||
|
autofocus: Whether the component should take the focus once the page is loaded
|
||||||
|
_rename_props: props to change the name of
|
||||||
|
custom_attrs: custom attribute
|
||||||
|
**props: The properties of the form.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The form component.
|
||||||
|
"""
|
||||||
|
...
|
||||||
|
|
||||||
form = Form()
|
form = Form()
|
||||||
|
Loading…
Reference in New Issue
Block a user