|
@@ -11,7 +11,86 @@ from typing import Union
|
|
from reflex.components.chakra import ChakraComponent
|
|
from reflex.components.chakra import ChakraComponent
|
|
from reflex.vars import Var
|
|
from reflex.vars import Var
|
|
|
|
|
|
-class Transition(ChakraComponent):
|
|
|
|
|
|
+class BaseTransition(ChakraComponent):
|
|
|
|
+ @overload
|
|
|
|
+ @classmethod
|
|
|
|
+ def create( # type: ignore
|
|
|
|
+ cls,
|
|
|
|
+ *children,
|
|
|
|
+ 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_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_unmount: Optional[
|
|
|
|
+ Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
|
+ ] = None,
|
|
|
|
+ **props
|
|
|
|
+ ) -> "BaseTransition":
|
|
|
|
+ """Create the component.
|
|
|
|
+
|
|
|
|
+ Args:
|
|
|
|
+ *children: The children of the component.
|
|
|
|
+ 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 props of the component.
|
|
|
|
+
|
|
|
|
+ Returns:
|
|
|
|
+ The component.
|
|
|
|
+
|
|
|
|
+ Raises:
|
|
|
|
+ TypeError: If an invalid child is passed.
|
|
|
|
+ """
|
|
|
|
+ ...
|
|
|
|
+
|
|
|
|
+class Transition(BaseTransition):
|
|
@overload
|
|
@overload
|
|
@classmethod
|
|
@classmethod
|
|
def create( # type: ignore
|
|
def create( # type: ignore
|
|
@@ -94,14 +173,12 @@ class Transition(ChakraComponent):
|
|
"""
|
|
"""
|
|
...
|
|
...
|
|
|
|
|
|
-class Fade(Transition):
|
|
|
|
|
|
+class Fade(BaseTransition):
|
|
@overload
|
|
@overload
|
|
@classmethod
|
|
@classmethod
|
|
def create( # type: ignore
|
|
def create( # type: ignore
|
|
cls,
|
|
cls,
|
|
*children,
|
|
*children,
|
|
- in_: Optional[Union[Var[bool], bool]] = None,
|
|
|
|
- unmount_on_exit: Optional[Union[Var[bool], bool]] = None,
|
|
|
|
style: Optional[Style] = None,
|
|
style: Optional[Style] = None,
|
|
key: Optional[Any] = None,
|
|
key: Optional[Any] = None,
|
|
id: Optional[Any] = None,
|
|
id: Optional[Any] = None,
|
|
@@ -159,8 +236,6 @@ class Fade(Transition):
|
|
|
|
|
|
Args:
|
|
Args:
|
|
*children: The children of the component.
|
|
*children: The children of the component.
|
|
- in_: Show the component; triggers when enter or exit states
|
|
|
|
- unmount_on_exit: If true, the element will unmount when `in={false}` and animation is done
|
|
|
|
style: The style of the component.
|
|
style: The style of the component.
|
|
key: A unique key for the component.
|
|
key: A unique key for the component.
|
|
id: The id for the component.
|
|
id: The id for the component.
|
|
@@ -177,7 +252,7 @@ class Fade(Transition):
|
|
"""
|
|
"""
|
|
...
|
|
...
|
|
|
|
|
|
-class ScaleFade(Transition):
|
|
|
|
|
|
+class ScaleFade(BaseTransition):
|
|
@overload
|
|
@overload
|
|
@classmethod
|
|
@classmethod
|
|
def create( # type: ignore
|
|
def create( # type: ignore
|
|
@@ -185,8 +260,6 @@ class ScaleFade(Transition):
|
|
*children,
|
|
*children,
|
|
initial_scale: Optional[Union[Var[float], float]] = None,
|
|
initial_scale: Optional[Union[Var[float], float]] = None,
|
|
reverse: Optional[Union[Var[bool], bool]] = None,
|
|
reverse: Optional[Union[Var[bool], bool]] = None,
|
|
- in_: Optional[Union[Var[bool], bool]] = None,
|
|
|
|
- unmount_on_exit: Optional[Union[Var[bool], bool]] = None,
|
|
|
|
style: Optional[Style] = None,
|
|
style: Optional[Style] = None,
|
|
key: Optional[Any] = None,
|
|
key: Optional[Any] = None,
|
|
id: Optional[Any] = None,
|
|
id: Optional[Any] = None,
|
|
@@ -246,8 +319,6 @@ class ScaleFade(Transition):
|
|
*children: The children of the component.
|
|
*children: The children of the component.
|
|
initial_scale: The initial scale of the element
|
|
initial_scale: The initial scale of the element
|
|
reverse: If true, the element will transition back to exit state
|
|
reverse: If true, the element will transition back to exit state
|
|
- in_: Show the component; triggers when enter or exit states
|
|
|
|
- unmount_on_exit: If true, the element will unmount when `in={false}` and animation is done
|
|
|
|
style: The style of the component.
|
|
style: The style of the component.
|
|
key: A unique key for the component.
|
|
key: A unique key for the component.
|
|
id: The id for the component.
|
|
id: The id for the component.
|
|
@@ -264,15 +335,13 @@ class ScaleFade(Transition):
|
|
"""
|
|
"""
|
|
...
|
|
...
|
|
|
|
|
|
-class Slide(Transition):
|
|
|
|
|
|
+class Slide(BaseTransition):
|
|
@overload
|
|
@overload
|
|
@classmethod
|
|
@classmethod
|
|
def create( # type: ignore
|
|
def create( # type: ignore
|
|
cls,
|
|
cls,
|
|
*children,
|
|
*children,
|
|
direction: Optional[Union[Var[str], str]] = None,
|
|
direction: Optional[Union[Var[str], str]] = None,
|
|
- in_: Optional[Union[Var[bool], bool]] = None,
|
|
|
|
- unmount_on_exit: Optional[Union[Var[bool], bool]] = None,
|
|
|
|
style: Optional[Style] = None,
|
|
style: Optional[Style] = None,
|
|
key: Optional[Any] = None,
|
|
key: Optional[Any] = None,
|
|
id: Optional[Any] = None,
|
|
id: Optional[Any] = None,
|
|
@@ -331,8 +400,6 @@ class Slide(Transition):
|
|
Args:
|
|
Args:
|
|
*children: The children of the component.
|
|
*children: The children of the component.
|
|
direction: The direction to slide from
|
|
direction: The direction to slide from
|
|
- in_: Show the component; triggers when enter or exit states
|
|
|
|
- unmount_on_exit: If true, the element will unmount when `in={false}` and animation is done
|
|
|
|
style: The style of the component.
|
|
style: The style of the component.
|
|
key: A unique key for the component.
|
|
key: A unique key for the component.
|
|
id: The id for the component.
|
|
id: The id for the component.
|
|
@@ -349,7 +416,7 @@ class Slide(Transition):
|
|
"""
|
|
"""
|
|
...
|
|
...
|
|
|
|
|
|
-class SlideFade(Transition):
|
|
|
|
|
|
+class SlideFade(BaseTransition):
|
|
@overload
|
|
@overload
|
|
@classmethod
|
|
@classmethod
|
|
def create( # type: ignore
|
|
def create( # type: ignore
|
|
@@ -358,8 +425,6 @@ class SlideFade(Transition):
|
|
offsetX: Optional[Union[Var[Union[str, int]], Union[str, int]]] = None,
|
|
offsetX: Optional[Union[Var[Union[str, int]], Union[str, int]]] = None,
|
|
offsetY: Optional[Union[Var[Union[str, int]], Union[str, int]]] = None,
|
|
offsetY: Optional[Union[Var[Union[str, int]], Union[str, int]]] = None,
|
|
reverse: Optional[Union[Var[bool], bool]] = None,
|
|
reverse: Optional[Union[Var[bool], bool]] = None,
|
|
- in_: Optional[Union[Var[bool], bool]] = None,
|
|
|
|
- unmount_on_exit: Optional[Union[Var[bool], bool]] = None,
|
|
|
|
style: Optional[Style] = None,
|
|
style: Optional[Style] = None,
|
|
key: Optional[Any] = None,
|
|
key: Optional[Any] = None,
|
|
id: Optional[Any] = None,
|
|
id: Optional[Any] = None,
|
|
@@ -420,8 +485,6 @@ class SlideFade(Transition):
|
|
offsetX: The offset on the horizontal or x axis
|
|
offsetX: The offset on the horizontal or x axis
|
|
offsetY: The offset on the vertical or y axis
|
|
offsetY: The offset on the vertical or y axis
|
|
reverse: If true, the element will be transitioned back to the offset when it leaves. Otherwise, it'll only fade out
|
|
reverse: If true, the element will be transitioned back to the offset when it leaves. Otherwise, it'll only fade out
|
|
- in_: Show the component; triggers when enter or exit states
|
|
|
|
- unmount_on_exit: If true, the element will unmount when `in={false}` and animation is done
|
|
|
|
style: The style of the component.
|
|
style: The style of the component.
|
|
key: A unique key for the component.
|
|
key: A unique key for the component.
|
|
id: The id for the component.
|
|
id: The id for the component.
|
|
@@ -438,7 +501,7 @@ class SlideFade(Transition):
|
|
"""
|
|
"""
|
|
...
|
|
...
|
|
|
|
|
|
-class Collapse(Transition):
|
|
|
|
|
|
+class Collapse(BaseTransition):
|
|
@overload
|
|
@overload
|
|
@classmethod
|
|
@classmethod
|
|
def create( # type: ignore
|
|
def create( # type: ignore
|
|
@@ -447,8 +510,6 @@ class Collapse(Transition):
|
|
animateOpacity: Optional[Union[Var[bool], bool]] = None,
|
|
animateOpacity: Optional[Union[Var[bool], bool]] = None,
|
|
endingHeight: Optional[Union[Var[str], str]] = None,
|
|
endingHeight: Optional[Union[Var[str], str]] = None,
|
|
startingHeight: Optional[Union[Var[Union[str, int]], Union[str, int]]] = None,
|
|
startingHeight: Optional[Union[Var[Union[str, int]], Union[str, int]]] = None,
|
|
- in_: Optional[Union[Var[bool], bool]] = None,
|
|
|
|
- unmount_on_exit: Optional[Union[Var[bool], bool]] = None,
|
|
|
|
style: Optional[Style] = None,
|
|
style: Optional[Style] = None,
|
|
key: Optional[Any] = None,
|
|
key: Optional[Any] = None,
|
|
id: Optional[Any] = None,
|
|
id: Optional[Any] = None,
|
|
@@ -509,8 +570,6 @@ class Collapse(Transition):
|
|
animateOpacity: If true, the opacity of the content will be animated
|
|
animateOpacity: If true, the opacity of the content will be animated
|
|
endingHeight: The height you want the content in its expanded state.
|
|
endingHeight: The height you want the content in its expanded state.
|
|
startingHeight: The height you want the content in its collapsed state.
|
|
startingHeight: The height you want the content in its collapsed state.
|
|
- in_: Show the component; triggers when enter or exit states
|
|
|
|
- unmount_on_exit: If true, the element will unmount when `in={false}` and animation is done
|
|
|
|
style: The style of the component.
|
|
style: The style of the component.
|
|
key: A unique key for the component.
|
|
key: A unique key for the component.
|
|
id: The id for the component.
|
|
id: The id for the component.
|