|
@@ -736,7 +736,97 @@ class FormSubmit(FormComponent):
|
|
|
"""
|
|
|
...
|
|
|
|
|
|
-class Form(SimpleNamespace):
|
|
|
+class Form(FormRoot):
|
|
|
+ pass
|
|
|
+
|
|
|
+ @overload
|
|
|
+ @classmethod
|
|
|
+ def create( # type: ignore
|
|
|
+ cls,
|
|
|
+ *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,
|
|
|
+ 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
|
|
|
+ ) -> "Form":
|
|
|
+ """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
|
|
|
+ custom_attrs: custom attribute
|
|
|
+ **props: The properties of the form.
|
|
|
+
|
|
|
+ Returns:
|
|
|
+ The form component.
|
|
|
+ """
|
|
|
+ ...
|
|
|
+
|
|
|
+class FormNamespace(SimpleNamespace):
|
|
|
root = staticmethod(FormRoot.create)
|
|
|
control = staticmethod(FormControl.create)
|
|
|
field = staticmethod(FormField.create)
|
|
@@ -809,7 +899,7 @@ class Form(SimpleNamespace):
|
|
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
] = None,
|
|
|
**props
|
|
|
- ) -> "FormRoot":
|
|
|
+ ) -> "Form":
|
|
|
"""Create a form component.
|
|
|
|
|
|
Args:
|
|
@@ -830,4 +920,4 @@ class Form(SimpleNamespace):
|
|
|
"""
|
|
|
...
|
|
|
|
|
|
-form = Form()
|
|
|
+form = FormNamespace()
|