reflex 0.6.0__py3-none-any.whl → 0.6.0a1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of reflex might be problematic. Click here for more details.
- reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 +2 -2
- reflex/.templates/jinja/web/pages/_app.js.jinja2 +1 -1
- reflex/.templates/jinja/web/pages/utils.js.jinja2 +2 -2
- reflex/.templates/web/components/reflex/chakra_color_mode_provider.js +36 -0
- reflex/.templates/web/utils/state.js +1 -3
- reflex/__init__.py +2 -8
- reflex/__init__.pyi +1 -2
- reflex/app.py +2 -4
- reflex/app_module_for_backend.py +1 -1
- reflex/base.py +1 -1
- reflex/compiler/compiler.py +2 -2
- reflex/compiler/utils.py +3 -3
- reflex/components/base/app_wrap.py +2 -2
- reflex/components/base/app_wrap.pyi +27 -17
- reflex/components/base/bare.py +5 -4
- reflex/components/base/body.pyi +27 -17
- reflex/components/base/document.pyi +131 -81
- reflex/components/base/error_boundary.py +7 -6
- reflex/components/base/error_boundary.pyi +33 -20
- reflex/components/base/fragment.pyi +27 -17
- reflex/components/base/head.pyi +53 -33
- reflex/components/base/link.py +1 -1
- reflex/components/base/link.pyi +54 -33
- reflex/components/base/meta.pyi +105 -65
- reflex/components/base/script.py +2 -1
- reflex/components/base/script.pyi +38 -21
- reflex/components/component.py +47 -53
- reflex/components/core/banner.py +27 -23
- reflex/components/core/banner.pyi +171 -134
- reflex/components/core/client_side_routing.py +3 -2
- reflex/components/core/client_side_routing.pyi +54 -33
- reflex/components/core/clipboard.py +1 -2
- reflex/components/core/clipboard.pyi +33 -20
- reflex/components/core/cond.py +5 -5
- reflex/components/core/debounce.py +5 -5
- reflex/components/core/debounce.pyi +33 -20
- reflex/components/core/foreach.py +4 -3
- reflex/components/core/html.py +1 -1
- reflex/components/core/html.pyi +46 -35
- reflex/components/core/match.py +17 -17
- reflex/components/core/upload.py +23 -17
- reflex/components/core/upload.pyi +124 -78
- reflex/components/datadisplay/code.py +10 -9
- reflex/components/datadisplay/code.pyi +409 -299
- reflex/components/datadisplay/dataeditor.py +10 -8
- reflex/components/datadisplay/dataeditor.pyi +53 -40
- reflex/components/el/element.pyi +27 -17
- reflex/components/el/elements/base.py +1 -1
- reflex/components/el/elements/base.pyi +45 -34
- reflex/components/el/elements/forms.py +16 -16
- reflex/components/el/elements/forms.pyi +707 -554
- reflex/components/el/elements/inline.py +1 -1
- reflex/components/el/elements/inline.pyi +1218 -937
- reflex/components/el/elements/media.py +1 -1
- reflex/components/el/elements/media.pyi +997 -786
- reflex/components/el/elements/metadata.py +6 -3
- reflex/components/el/elements/metadata.pyi +242 -181
- reflex/components/el/elements/other.py +1 -1
- reflex/components/el/elements/other.pyi +306 -235
- reflex/components/el/elements/scripts.py +1 -1
- reflex/components/el/elements/scripts.pyi +140 -109
- reflex/components/el/elements/sectioning.py +2 -0
- reflex/components/el/elements/sectioning.pyi +647 -496
- reflex/components/el/elements/tables.py +1 -1
- reflex/components/el/elements/tables.pyi +452 -351
- reflex/components/el/elements/typography.py +1 -1
- reflex/components/el/elements/typography.pyi +657 -506
- reflex/components/gridjs/datatable.py +9 -6
- reflex/components/gridjs/datatable.pyi +56 -35
- reflex/components/lucide/icon.py +1 -1
- reflex/components/lucide/icon.pyi +54 -33
- reflex/components/markdown/markdown.py +31 -26
- reflex/components/markdown/markdown.pyi +37 -27
- reflex/components/moment/moment.py +12 -13
- reflex/components/moment/moment.pyi +35 -23
- reflex/components/next/base.pyi +27 -17
- reflex/components/next/image.py +1 -1
- reflex/components/next/image.pyi +37 -22
- reflex/components/next/link.py +1 -1
- reflex/components/next/link.pyi +28 -17
- reflex/components/next/video.py +1 -1
- reflex/components/next/video.pyi +28 -17
- reflex/components/plotly/plotly.py +13 -12
- reflex/components/plotly/plotly.pyi +54 -39
- reflex/components/props.py +1 -1
- reflex/components/radix/__init__.pyi +0 -1
- reflex/components/radix/primitives/__init__.pyi +0 -1
- reflex/components/radix/primitives/accordion.py +4 -4
- reflex/components/radix/primitives/accordion.pyi +495 -424
- reflex/components/radix/primitives/base.py +1 -1
- reflex/components/radix/primitives/base.pyi +54 -33
- reflex/components/radix/primitives/drawer.py +1 -1
- reflex/components/radix/primitives/drawer.pyi +273 -172
- reflex/components/radix/primitives/form.py +1 -1
- reflex/components/radix/primitives/form.pyi +364 -257
- reflex/components/radix/primitives/progress.py +1 -1
- reflex/components/radix/primitives/progress.pyi +282 -231
- reflex/components/radix/primitives/slider.py +1 -1
- reflex/components/radix/primitives/slider.pyi +138 -87
- reflex/components/radix/themes/base.py +24 -3
- reflex/components/radix/themes/base.pyi +250 -178
- reflex/components/radix/themes/color_mode.py +5 -5
- reflex/components/radix/themes/color_mode.pyi +220 -187
- reflex/components/radix/themes/components/alert_dialog.py +1 -1
- reflex/components/radix/themes/components/alert_dialog.pyi +207 -136
- reflex/components/radix/themes/components/aspect_ratio.py +1 -1
- reflex/components/radix/themes/components/aspect_ratio.pyi +28 -17
- reflex/components/radix/themes/components/avatar.py +1 -1
- reflex/components/radix/themes/components/avatar.pyi +81 -70
- reflex/components/radix/themes/components/badge.py +1 -1
- reflex/components/radix/themes/components/badge.pyi +99 -88
- reflex/components/radix/themes/components/button.py +1 -1
- reflex/components/radix/themes/components/button.pyi +109 -98
- reflex/components/radix/themes/components/callout.py +1 -1
- reflex/components/radix/themes/components/callout.pyi +373 -322
- reflex/components/radix/themes/components/card.py +1 -1
- reflex/components/radix/themes/components/card.pyi +49 -38
- reflex/components/radix/themes/components/checkbox.py +2 -1
- reflex/components/radix/themes/components/checkbox.pyi +245 -208
- reflex/components/radix/themes/components/checkbox_cards.py +1 -1
- reflex/components/radix/themes/components/checkbox_cards.pyi +115 -94
- reflex/components/radix/themes/components/checkbox_group.py +1 -1
- reflex/components/radix/themes/components/checkbox_group.pyi +107 -86
- reflex/components/radix/themes/components/context_menu.py +1 -1
- reflex/components/radix/themes/components/context_menu.pyi +319 -238
- reflex/components/radix/themes/components/data_list.py +1 -1
- reflex/components/radix/themes/components/data_list.pyi +171 -130
- reflex/components/radix/themes/components/dialog.py +1 -1
- reflex/components/radix/themes/components/dialog.pyi +210 -139
- reflex/components/radix/themes/components/dropdown_menu.py +1 -1
- reflex/components/radix/themes/components/dropdown_menu.pyi +332 -249
- reflex/components/radix/themes/components/hover_card.py +1 -1
- reflex/components/radix/themes/components/hover_card.pyi +131 -90
- reflex/components/radix/themes/components/icon_button.py +3 -2
- reflex/components/radix/themes/components/icon_button.pyi +109 -98
- reflex/components/radix/themes/components/inset.py +1 -1
- reflex/components/radix/themes/components/inset.pyi +58 -47
- reflex/components/radix/themes/components/popover.py +1 -1
- reflex/components/radix/themes/components/popover.pyi +136 -95
- reflex/components/radix/themes/components/progress.py +1 -1
- reflex/components/radix/themes/components/progress.pyi +82 -71
- reflex/components/radix/themes/components/radio.py +1 -1
- reflex/components/radix/themes/components/radio.pyi +80 -69
- reflex/components/radix/themes/components/radio_cards.py +1 -1
- reflex/components/radix/themes/components/radio_cards.pyi +119 -98
- reflex/components/radix/themes/components/radio_group.py +11 -8
- reflex/components/radix/themes/components/radio_group.pyi +271 -228
- reflex/components/radix/themes/components/scroll_area.py +1 -1
- reflex/components/radix/themes/components/scroll_area.pyi +32 -21
- reflex/components/radix/themes/components/segmented_control.py +1 -1
- reflex/components/radix/themes/components/segmented_control.pyi +113 -90
- reflex/components/radix/themes/components/select.py +3 -2
- reflex/components/radix/themes/components/select.pyi +471 -374
- reflex/components/radix/themes/components/separator.py +2 -1
- reflex/components/radix/themes/components/separator.pyi +80 -69
- reflex/components/radix/themes/components/skeleton.py +1 -1
- reflex/components/radix/themes/components/skeleton.pyi +34 -23
- reflex/components/radix/themes/components/slider.py +3 -2
- reflex/components/radix/themes/components/slider.pyi +88 -75
- reflex/components/radix/themes/components/spinner.py +1 -1
- reflex/components/radix/themes/components/spinner.pyi +30 -19
- reflex/components/radix/themes/components/switch.py +1 -1
- reflex/components/radix/themes/components/switch.pyi +84 -71
- reflex/components/radix/themes/components/table.py +1 -1
- reflex/components/radix/themes/components/table.pyi +332 -261
- reflex/components/radix/themes/components/tabs.py +1 -1
- reflex/components/radix/themes/components/tabs.pyi +194 -139
- reflex/components/radix/themes/components/text_area.py +1 -1
- reflex/components/radix/themes/components/text_area.pyi +111 -96
- reflex/components/radix/themes/components/text_field.py +1 -1
- reflex/components/radix/themes/components/text_field.pyi +286 -247
- reflex/components/radix/themes/components/tooltip.py +1 -1
- reflex/components/radix/themes/components/tooltip.pyi +37 -26
- reflex/components/radix/themes/layout/__init__.pyi +0 -1
- reflex/components/radix/themes/layout/base.py +1 -1
- reflex/components/radix/themes/layout/base.pyi +67 -56
- reflex/components/radix/themes/layout/box.pyi +45 -34
- reflex/components/radix/themes/layout/center.pyi +67 -56
- reflex/components/radix/themes/layout/container.py +2 -1
- reflex/components/radix/themes/layout/container.pyi +47 -36
- reflex/components/radix/themes/layout/flex.py +1 -1
- reflex/components/radix/themes/layout/flex.pyi +67 -56
- reflex/components/radix/themes/layout/grid.py +1 -1
- reflex/components/radix/themes/layout/grid.pyi +75 -64
- reflex/components/radix/themes/layout/list.py +6 -5
- reflex/components/radix/themes/layout/list.pyi +244 -193
- reflex/components/radix/themes/layout/section.py +2 -1
- reflex/components/radix/themes/layout/section.pyi +47 -36
- reflex/components/radix/themes/layout/spacer.pyi +67 -56
- reflex/components/radix/themes/layout/stack.py +1 -1
- reflex/components/radix/themes/layout/stack.pyi +159 -128
- reflex/components/radix/themes/typography/blockquote.py +1 -1
- reflex/components/radix/themes/typography/blockquote.pyi +100 -89
- reflex/components/radix/themes/typography/code.py +1 -1
- reflex/components/radix/themes/typography/code.pyi +101 -90
- reflex/components/radix/themes/typography/heading.py +1 -1
- reflex/components/radix/themes/typography/heading.pyi +107 -96
- reflex/components/radix/themes/typography/link.py +1 -1
- reflex/components/radix/themes/typography/link.pyi +113 -102
- reflex/components/radix/themes/typography/text.py +1 -1
- reflex/components/radix/themes/typography/text.pyi +572 -501
- reflex/components/react_player/audio.pyi +60 -33
- reflex/components/react_player/react_player.py +1 -1
- reflex/components/react_player/react_player.pyi +60 -33
- reflex/components/react_player/video.pyi +60 -33
- reflex/components/recharts/cartesian.py +3 -2
- reflex/components/recharts/cartesian.pyi +861 -678
- reflex/components/recharts/charts.py +5 -4
- reflex/components/recharts/charts.pyi +357 -252
- reflex/components/recharts/general.py +2 -1
- reflex/components/recharts/general.pyi +231 -180
- reflex/components/recharts/polar.py +5 -4
- reflex/components/recharts/polar.pyi +181 -144
- reflex/components/recharts/recharts.pyi +53 -33
- reflex/components/sonner/toast.py +17 -16
- reflex/components/sonner/toast.pyi +47 -36
- reflex/components/suneditor/editor.py +3 -2
- reflex/components/suneditor/editor.pyi +78 -55
- reflex/components/tags/cond_tag.py +4 -6
- reflex/components/tags/iter_tag.py +16 -28
- reflex/components/tags/match_tag.py +4 -6
- reflex/components/tags/tag.py +23 -40
- reflex/custom_components/custom_components.py +1 -3
- reflex/event.py +65 -113
- reflex/experimental/client_state.py +24 -25
- reflex/experimental/hooks.py +16 -16
- reflex/experimental/layout.py +5 -5
- reflex/experimental/layout.pyi +187 -136
- reflex/{vars → ivars}/__init__.py +2 -6
- reflex/{vars → ivars}/base.py +216 -599
- reflex/{vars → ivars}/function.py +19 -15
- reflex/{vars → ivars}/number.py +20 -41
- reflex/{vars → ivars}/object.py +30 -28
- reflex/{vars → ivars}/sequence.py +50 -53
- reflex/middleware/hydrate_middleware.py +0 -2
- reflex/middleware/middleware.py +3 -3
- reflex/state.py +82 -148
- reflex/style.py +22 -21
- reflex/utils/exceptions.py +0 -20
- reflex/utils/format.py +34 -54
- reflex/utils/imports.py +73 -16
- reflex/utils/prerequisites.py +15 -35
- reflex/utils/pyi_generator.py +8 -13
- reflex/utils/serializers.py +22 -12
- reflex/utils/telemetry.py +2 -3
- reflex/utils/types.py +5 -10
- reflex/vars.py +501 -0
- {reflex-0.6.0.dist-info → reflex-0.6.0a1.dist-info}/METADATA +5 -4
- reflex-0.6.0a1.dist-info/RECORD +384 -0
- reflex-0.6.0.dist-info/RECORD +0 -382
- {reflex-0.6.0.dist-info → reflex-0.6.0a1.dist-info}/LICENSE +0 -0
- {reflex-0.6.0.dist-info → reflex-0.6.0a1.dist-info}/WHEEL +0 -0
- {reflex-0.6.0.dist-info → reflex-0.6.0a1.dist-info}/entry_points.txt +0 -0
|
@@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload
|
|
|
7
7
|
|
|
8
8
|
from reflex.components.component import Component, MemoizationLeaf, NoSSRComponent
|
|
9
9
|
from reflex.event import EventHandler, EventSpec
|
|
10
|
+
from reflex.ivars.base import ImmutableVar
|
|
10
11
|
from reflex.style import Style
|
|
11
|
-
from reflex.vars.base import Var
|
|
12
12
|
|
|
13
13
|
class Recharts(Component):
|
|
14
14
|
def render(self) -> Dict: ...
|
|
@@ -22,41 +22,51 @@ class Recharts(Component):
|
|
|
22
22
|
id: Optional[Any] = None,
|
|
23
23
|
class_name: Optional[Any] = None,
|
|
24
24
|
autofocus: Optional[bool] = None,
|
|
25
|
-
custom_attrs: Optional[Dict[str, Union[
|
|
26
|
-
on_blur: Optional[
|
|
27
|
-
|
|
25
|
+
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
|
26
|
+
on_blur: Optional[
|
|
27
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
28
|
+
] = None,
|
|
29
|
+
on_click: Optional[
|
|
30
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
31
|
+
] = None,
|
|
28
32
|
on_context_menu: Optional[
|
|
29
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
33
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
30
34
|
] = None,
|
|
31
35
|
on_double_click: Optional[
|
|
32
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
36
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
37
|
+
] = None,
|
|
38
|
+
on_focus: Optional[
|
|
39
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
40
|
+
] = None,
|
|
41
|
+
on_mount: Optional[
|
|
42
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
33
43
|
] = None,
|
|
34
|
-
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
35
|
-
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
36
44
|
on_mouse_down: Optional[
|
|
37
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
45
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
38
46
|
] = None,
|
|
39
47
|
on_mouse_enter: Optional[
|
|
40
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
48
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
41
49
|
] = None,
|
|
42
50
|
on_mouse_leave: Optional[
|
|
43
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
51
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
44
52
|
] = None,
|
|
45
53
|
on_mouse_move: Optional[
|
|
46
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
54
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
47
55
|
] = None,
|
|
48
56
|
on_mouse_out: Optional[
|
|
49
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
57
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
50
58
|
] = None,
|
|
51
59
|
on_mouse_over: Optional[
|
|
52
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
60
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
53
61
|
] = None,
|
|
54
62
|
on_mouse_up: Optional[
|
|
55
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
63
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
64
|
+
] = None,
|
|
65
|
+
on_scroll: Optional[
|
|
66
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
56
67
|
] = None,
|
|
57
|
-
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
58
68
|
on_unmount: Optional[
|
|
59
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
69
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
60
70
|
] = None,
|
|
61
71
|
**props,
|
|
62
72
|
) -> "Recharts":
|
|
@@ -88,41 +98,51 @@ class RechartsCharts(NoSSRComponent, MemoizationLeaf):
|
|
|
88
98
|
id: Optional[Any] = None,
|
|
89
99
|
class_name: Optional[Any] = None,
|
|
90
100
|
autofocus: Optional[bool] = None,
|
|
91
|
-
custom_attrs: Optional[Dict[str, Union[
|
|
92
|
-
on_blur: Optional[
|
|
93
|
-
|
|
101
|
+
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
|
102
|
+
on_blur: Optional[
|
|
103
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
104
|
+
] = None,
|
|
105
|
+
on_click: Optional[
|
|
106
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
107
|
+
] = None,
|
|
94
108
|
on_context_menu: Optional[
|
|
95
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
109
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
96
110
|
] = None,
|
|
97
111
|
on_double_click: Optional[
|
|
98
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
112
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
113
|
+
] = None,
|
|
114
|
+
on_focus: Optional[
|
|
115
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
116
|
+
] = None,
|
|
117
|
+
on_mount: Optional[
|
|
118
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
99
119
|
] = None,
|
|
100
|
-
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
101
|
-
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
102
120
|
on_mouse_down: Optional[
|
|
103
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
121
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
104
122
|
] = None,
|
|
105
123
|
on_mouse_enter: Optional[
|
|
106
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
124
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
107
125
|
] = None,
|
|
108
126
|
on_mouse_leave: Optional[
|
|
109
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
127
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
110
128
|
] = None,
|
|
111
129
|
on_mouse_move: Optional[
|
|
112
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
130
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
113
131
|
] = None,
|
|
114
132
|
on_mouse_out: Optional[
|
|
115
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
133
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
116
134
|
] = None,
|
|
117
135
|
on_mouse_over: Optional[
|
|
118
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
136
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
119
137
|
] = None,
|
|
120
138
|
on_mouse_up: Optional[
|
|
121
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
139
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
140
|
+
] = None,
|
|
141
|
+
on_scroll: Optional[
|
|
142
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
122
143
|
] = None,
|
|
123
|
-
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
124
144
|
on_unmount: Optional[
|
|
125
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
145
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
126
146
|
] = None,
|
|
127
147
|
**props,
|
|
128
148
|
) -> "RechartsCharts":
|
|
@@ -14,12 +14,12 @@ from reflex.event import (
|
|
|
14
14
|
EventSpec,
|
|
15
15
|
call_script,
|
|
16
16
|
)
|
|
17
|
+
from reflex.ivars.base import ImmutableVar, LiteralVar
|
|
17
18
|
from reflex.style import Style, resolved_color_mode
|
|
18
19
|
from reflex.utils import format
|
|
19
20
|
from reflex.utils.imports import ImportVar
|
|
20
21
|
from reflex.utils.serializers import serialize, serializer
|
|
21
|
-
from reflex.vars import VarData
|
|
22
|
-
from reflex.vars.base import LiteralVar, Var
|
|
22
|
+
from reflex.vars import Var, VarData
|
|
23
23
|
|
|
24
24
|
LiteralPosition = Literal[
|
|
25
25
|
"top-left",
|
|
@@ -30,7 +30,7 @@ LiteralPosition = Literal[
|
|
|
30
30
|
"bottom-right",
|
|
31
31
|
]
|
|
32
32
|
|
|
33
|
-
toast_ref =
|
|
33
|
+
toast_ref = ImmutableVar.create_safe("refs['__toast']")
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
class ToastAction(Base):
|
|
@@ -56,7 +56,7 @@ def serialize_action(action: ToastAction) -> dict:
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
def _toast_callback_signature(toast: Var) -> list[
|
|
59
|
+
def _toast_callback_signature(toast: Var) -> list[ImmutableVar]:
|
|
60
60
|
"""The signature for the toast callback, stripping out unserializable keys.
|
|
61
61
|
|
|
62
62
|
Args:
|
|
@@ -66,8 +66,8 @@ def _toast_callback_signature(toast: Var) -> list[Var]:
|
|
|
66
66
|
A function call stripping non-serializable members of the toast object.
|
|
67
67
|
"""
|
|
68
68
|
return [
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
ImmutableVar.create_safe(
|
|
70
|
+
f"(() => {{let {{action, cancel, onDismiss, onAutoClose, ...rest}} = {str(toast)}; return rest}})()"
|
|
71
71
|
)
|
|
72
72
|
]
|
|
73
73
|
|
|
@@ -76,10 +76,10 @@ class ToastProps(PropsBase):
|
|
|
76
76
|
"""Props for the toast component."""
|
|
77
77
|
|
|
78
78
|
# Toast's title, renders above the description.
|
|
79
|
-
title: Optional[Union[str,
|
|
79
|
+
title: Optional[Union[str, ImmutableVar]]
|
|
80
80
|
|
|
81
81
|
# Toast's description, renders underneath the title.
|
|
82
|
-
description: Optional[Union[str,
|
|
82
|
+
description: Optional[Union[str, ImmutableVar]]
|
|
83
83
|
|
|
84
84
|
# Whether to show the close button.
|
|
85
85
|
close_button: Optional[bool]
|
|
@@ -111,7 +111,7 @@ class ToastProps(PropsBase):
|
|
|
111
111
|
cancel: Optional[ToastAction]
|
|
112
112
|
|
|
113
113
|
# Custom id for the toast.
|
|
114
|
-
id: Optional[Union[str,
|
|
114
|
+
id: Optional[Union[str, ImmutableVar]]
|
|
115
115
|
|
|
116
116
|
# Removes the default styling, which allows for easier customization.
|
|
117
117
|
unstyled: Optional[bool]
|
|
@@ -241,14 +241,14 @@ class Toaster(Component):
|
|
|
241
241
|
# Marked True when any Toast component is created.
|
|
242
242
|
is_used: ClassVar[bool] = False
|
|
243
243
|
|
|
244
|
-
def add_hooks(self) -> list[
|
|
244
|
+
def add_hooks(self) -> list[ImmutableVar | str]:
|
|
245
245
|
"""Add hooks for the toaster component.
|
|
246
246
|
|
|
247
247
|
Returns:
|
|
248
248
|
The hooks for the toaster component.
|
|
249
249
|
"""
|
|
250
|
-
hook =
|
|
251
|
-
|
|
250
|
+
hook = ImmutableVar.create_safe(
|
|
251
|
+
f"{toast_ref} = toast",
|
|
252
252
|
_var_data=VarData(
|
|
253
253
|
imports={
|
|
254
254
|
"/utils/state": [ImportVar(tag="refs")],
|
|
@@ -286,7 +286,7 @@ class Toaster(Component):
|
|
|
286
286
|
else:
|
|
287
287
|
toast = f"{toast_command}(`{message}`)"
|
|
288
288
|
|
|
289
|
-
toast_action =
|
|
289
|
+
toast_action = ImmutableVar.create_safe(toast)
|
|
290
290
|
return call_script(toast_action)
|
|
291
291
|
|
|
292
292
|
@staticmethod
|
|
@@ -353,15 +353,16 @@ class Toaster(Component):
|
|
|
353
353
|
"""
|
|
354
354
|
dismiss_var_data = None
|
|
355
355
|
|
|
356
|
-
if isinstance(id,
|
|
356
|
+
if isinstance(id, ImmutableVar):
|
|
357
357
|
dismiss = f"{toast_ref}.dismiss({str(id)})"
|
|
358
358
|
dismiss_var_data = id._get_all_var_data()
|
|
359
359
|
elif isinstance(id, str):
|
|
360
360
|
dismiss = f"{toast_ref}.dismiss('{id}')"
|
|
361
361
|
else:
|
|
362
362
|
dismiss = f"{toast_ref}.dismiss()"
|
|
363
|
-
dismiss_action =
|
|
364
|
-
|
|
363
|
+
dismiss_action = ImmutableVar.create_safe(
|
|
364
|
+
dismiss,
|
|
365
|
+
_var_data=VarData.merge(dismiss_var_data),
|
|
365
366
|
)
|
|
366
367
|
return call_script(dismiss_action)
|
|
367
368
|
|
|
@@ -10,9 +10,10 @@ from reflex.components.component import Component, ComponentNamespace
|
|
|
10
10
|
from reflex.components.lucide.icon import Icon
|
|
11
11
|
from reflex.components.props import PropsBase
|
|
12
12
|
from reflex.event import EventHandler, EventSpec
|
|
13
|
+
from reflex.ivars.base import ImmutableVar
|
|
13
14
|
from reflex.style import Style
|
|
14
15
|
from reflex.utils.serializers import serializer
|
|
15
|
-
from reflex.vars
|
|
16
|
+
from reflex.vars import Var
|
|
16
17
|
|
|
17
18
|
LiteralPosition = Literal[
|
|
18
19
|
"top-left",
|
|
@@ -22,7 +23,7 @@ LiteralPosition = Literal[
|
|
|
22
23
|
"bottom-center",
|
|
23
24
|
"bottom-right",
|
|
24
25
|
]
|
|
25
|
-
toast_ref =
|
|
26
|
+
toast_ref = ImmutableVar.create_safe("refs['__toast']")
|
|
26
27
|
|
|
27
28
|
class ToastAction(Base):
|
|
28
29
|
label: str
|
|
@@ -32,8 +33,8 @@ class ToastAction(Base):
|
|
|
32
33
|
def serialize_action(action: ToastAction) -> dict: ...
|
|
33
34
|
|
|
34
35
|
class ToastProps(PropsBase):
|
|
35
|
-
title: Optional[Union[str,
|
|
36
|
-
description: Optional[Union[str,
|
|
36
|
+
title: Optional[Union[str, ImmutableVar]]
|
|
37
|
+
description: Optional[Union[str, ImmutableVar]]
|
|
37
38
|
close_button: Optional[bool]
|
|
38
39
|
invert: Optional[bool]
|
|
39
40
|
important: Optional[bool]
|
|
@@ -42,7 +43,7 @@ class ToastProps(PropsBase):
|
|
|
42
43
|
dismissible: Optional[bool]
|
|
43
44
|
action: Optional[ToastAction]
|
|
44
45
|
cancel: Optional[ToastAction]
|
|
45
|
-
id: Optional[Union[str,
|
|
46
|
+
id: Optional[Union[str, ImmutableVar]]
|
|
46
47
|
unstyled: Optional[bool]
|
|
47
48
|
style: Optional[Style]
|
|
48
49
|
action_button_styles: Optional[Style]
|
|
@@ -60,7 +61,7 @@ class ToastProps(PropsBase):
|
|
|
60
61
|
class Toaster(Component):
|
|
61
62
|
is_used: ClassVar[bool] = False
|
|
62
63
|
|
|
63
|
-
def add_hooks(self) -> list[
|
|
64
|
+
def add_hooks(self) -> list[ImmutableVar | str]: ...
|
|
64
65
|
@staticmethod
|
|
65
66
|
def send_toast(
|
|
66
67
|
message: str = "", level: str | None = None, **props
|
|
@@ -86,24 +87,24 @@ class Toaster(Component):
|
|
|
86
87
|
visible_toasts: Optional[Union[Var[int], int]] = None,
|
|
87
88
|
position: Optional[
|
|
88
89
|
Union[
|
|
89
|
-
Literal[
|
|
90
|
-
"bottom-center",
|
|
91
|
-
"bottom-left",
|
|
92
|
-
"bottom-right",
|
|
93
|
-
"top-center",
|
|
94
|
-
"top-left",
|
|
95
|
-
"top-right",
|
|
96
|
-
],
|
|
97
90
|
Var[
|
|
98
91
|
Literal[
|
|
99
|
-
"bottom-center",
|
|
100
|
-
"bottom-left",
|
|
101
|
-
"bottom-right",
|
|
102
|
-
"top-center",
|
|
103
92
|
"top-left",
|
|
93
|
+
"top-center",
|
|
104
94
|
"top-right",
|
|
95
|
+
"bottom-left",
|
|
96
|
+
"bottom-center",
|
|
97
|
+
"bottom-right",
|
|
105
98
|
]
|
|
106
99
|
],
|
|
100
|
+
Literal[
|
|
101
|
+
"top-left",
|
|
102
|
+
"top-center",
|
|
103
|
+
"top-right",
|
|
104
|
+
"bottom-left",
|
|
105
|
+
"bottom-center",
|
|
106
|
+
"bottom-right",
|
|
107
|
+
],
|
|
107
108
|
]
|
|
108
109
|
] = None,
|
|
109
110
|
close_button: Optional[Union[Var[bool], bool]] = None,
|
|
@@ -111,50 +112,60 @@ class Toaster(Component):
|
|
|
111
112
|
dir: Optional[Union[Var[str], str]] = None,
|
|
112
113
|
hotkey: Optional[Union[Var[str], str]] = None,
|
|
113
114
|
invert: Optional[Union[Var[bool], bool]] = None,
|
|
114
|
-
toast_options: Optional[Union[ToastProps,
|
|
115
|
+
toast_options: Optional[Union[Var[ToastProps], ToastProps]] = None,
|
|
115
116
|
gap: Optional[Union[Var[int], int]] = None,
|
|
116
|
-
loading_icon: Optional[Union[Icon,
|
|
117
|
+
loading_icon: Optional[Union[Var[Icon], Icon]] = None,
|
|
117
118
|
pause_when_page_is_hidden: Optional[Union[Var[bool], bool]] = None,
|
|
118
119
|
style: Optional[Style] = None,
|
|
119
120
|
key: Optional[Any] = None,
|
|
120
121
|
id: Optional[Any] = None,
|
|
121
122
|
class_name: Optional[Any] = None,
|
|
122
123
|
autofocus: Optional[bool] = None,
|
|
123
|
-
custom_attrs: Optional[Dict[str, Union[
|
|
124
|
-
on_blur: Optional[
|
|
125
|
-
|
|
124
|
+
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
|
125
|
+
on_blur: Optional[
|
|
126
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
127
|
+
] = None,
|
|
128
|
+
on_click: Optional[
|
|
129
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
130
|
+
] = None,
|
|
126
131
|
on_context_menu: Optional[
|
|
127
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
132
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
128
133
|
] = None,
|
|
129
134
|
on_double_click: Optional[
|
|
130
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
135
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
136
|
+
] = None,
|
|
137
|
+
on_focus: Optional[
|
|
138
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
139
|
+
] = None,
|
|
140
|
+
on_mount: Optional[
|
|
141
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
131
142
|
] = None,
|
|
132
|
-
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
133
|
-
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
134
143
|
on_mouse_down: Optional[
|
|
135
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
144
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
136
145
|
] = None,
|
|
137
146
|
on_mouse_enter: Optional[
|
|
138
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
147
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
139
148
|
] = None,
|
|
140
149
|
on_mouse_leave: Optional[
|
|
141
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
150
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
142
151
|
] = None,
|
|
143
152
|
on_mouse_move: Optional[
|
|
144
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
153
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
145
154
|
] = None,
|
|
146
155
|
on_mouse_out: Optional[
|
|
147
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
156
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
148
157
|
] = None,
|
|
149
158
|
on_mouse_over: Optional[
|
|
150
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
159
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
151
160
|
] = None,
|
|
152
161
|
on_mouse_up: Optional[
|
|
153
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
162
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
163
|
+
] = None,
|
|
164
|
+
on_scroll: Optional[
|
|
165
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
154
166
|
] = None,
|
|
155
|
-
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
156
167
|
on_unmount: Optional[
|
|
157
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
168
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
158
169
|
] = None,
|
|
159
170
|
**props,
|
|
160
171
|
) -> "Toaster":
|
|
@@ -8,9 +8,10 @@ from typing import Dict, List, Literal, Optional, Union
|
|
|
8
8
|
from reflex.base import Base
|
|
9
9
|
from reflex.components.component import Component, NoSSRComponent
|
|
10
10
|
from reflex.event import EventHandler
|
|
11
|
+
from reflex.ivars.base import ImmutableVar
|
|
11
12
|
from reflex.utils.format import to_camel_case
|
|
12
13
|
from reflex.utils.imports import ImportDict, ImportVar
|
|
13
|
-
from reflex.vars
|
|
14
|
+
from reflex.vars import Var
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
class EditorButtonList(list, enum.Enum):
|
|
@@ -234,7 +235,7 @@ class Editor(NoSSRComponent):
|
|
|
234
235
|
ValueError: If set_options is a state Var.
|
|
235
236
|
"""
|
|
236
237
|
if set_options is not None:
|
|
237
|
-
if isinstance(set_options,
|
|
238
|
+
if isinstance(set_options, ImmutableVar):
|
|
238
239
|
raise ValueError("EditorOptions cannot be a state Var")
|
|
239
240
|
props["set_options"] = {
|
|
240
241
|
to_camel_case(k): v
|
|
@@ -9,9 +9,10 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload
|
|
|
9
9
|
from reflex.base import Base
|
|
10
10
|
from reflex.components.component import NoSSRComponent
|
|
11
11
|
from reflex.event import EventHandler, EventSpec
|
|
12
|
+
from reflex.ivars.base import ImmutableVar
|
|
12
13
|
from reflex.style import Style
|
|
13
14
|
from reflex.utils.imports import ImportDict
|
|
14
|
-
from reflex.vars
|
|
15
|
+
from reflex.vars import Var
|
|
15
16
|
|
|
16
17
|
class EditorButtonList(list, enum.Enum):
|
|
17
18
|
BASIC = [["font", "fontSize"], ["fontColor"], ["horizontalRule"], ["link", "image"]]
|
|
@@ -53,51 +54,51 @@ class Editor(NoSSRComponent):
|
|
|
53
54
|
*children,
|
|
54
55
|
lang: Optional[
|
|
55
56
|
Union[
|
|
56
|
-
Literal[
|
|
57
|
-
"ckb",
|
|
58
|
-
"da",
|
|
59
|
-
"de",
|
|
60
|
-
"en",
|
|
61
|
-
"es",
|
|
62
|
-
"fr",
|
|
63
|
-
"he",
|
|
64
|
-
"it",
|
|
65
|
-
"ja",
|
|
66
|
-
"ko",
|
|
67
|
-
"lv",
|
|
68
|
-
"pl",
|
|
69
|
-
"pt_br",
|
|
70
|
-
"ro",
|
|
71
|
-
"ru",
|
|
72
|
-
"se",
|
|
73
|
-
"ua",
|
|
74
|
-
"zh_cn",
|
|
75
|
-
],
|
|
76
57
|
Var[
|
|
77
58
|
Union[
|
|
78
59
|
Literal[
|
|
79
|
-
"
|
|
60
|
+
"en",
|
|
80
61
|
"da",
|
|
81
62
|
"de",
|
|
82
|
-
"en",
|
|
83
63
|
"es",
|
|
84
64
|
"fr",
|
|
85
|
-
"he",
|
|
86
|
-
"it",
|
|
87
65
|
"ja",
|
|
88
66
|
"ko",
|
|
89
|
-
"lv",
|
|
90
|
-
"pl",
|
|
91
67
|
"pt_br",
|
|
92
|
-
"ro",
|
|
93
68
|
"ru",
|
|
69
|
+
"zh_cn",
|
|
70
|
+
"ro",
|
|
71
|
+
"pl",
|
|
72
|
+
"ckb",
|
|
73
|
+
"lv",
|
|
94
74
|
"se",
|
|
95
75
|
"ua",
|
|
96
|
-
"
|
|
76
|
+
"he",
|
|
77
|
+
"it",
|
|
97
78
|
],
|
|
98
79
|
dict,
|
|
99
80
|
]
|
|
100
81
|
],
|
|
82
|
+
Literal[
|
|
83
|
+
"en",
|
|
84
|
+
"da",
|
|
85
|
+
"de",
|
|
86
|
+
"es",
|
|
87
|
+
"fr",
|
|
88
|
+
"ja",
|
|
89
|
+
"ko",
|
|
90
|
+
"pt_br",
|
|
91
|
+
"ru",
|
|
92
|
+
"zh_cn",
|
|
93
|
+
"ro",
|
|
94
|
+
"pl",
|
|
95
|
+
"ckb",
|
|
96
|
+
"lv",
|
|
97
|
+
"se",
|
|
98
|
+
"ua",
|
|
99
|
+
"he",
|
|
100
|
+
"it",
|
|
101
|
+
],
|
|
101
102
|
dict,
|
|
102
103
|
]
|
|
103
104
|
] = None,
|
|
@@ -107,7 +108,7 @@ class Editor(NoSSRComponent):
|
|
|
107
108
|
height: Optional[Union[Var[str], str]] = None,
|
|
108
109
|
placeholder: Optional[Union[Var[str], str]] = None,
|
|
109
110
|
auto_focus: Optional[Union[Var[bool], bool]] = None,
|
|
110
|
-
set_options: Optional[Union[Dict,
|
|
111
|
+
set_options: Optional[Union[Var[Dict], Dict]] = None,
|
|
111
112
|
set_all_plugins: Optional[Union[Var[bool], bool]] = None,
|
|
112
113
|
set_contents: Optional[Union[Var[str], str]] = None,
|
|
113
114
|
append_contents: Optional[Union[Var[str], str]] = None,
|
|
@@ -121,56 +122,78 @@ class Editor(NoSSRComponent):
|
|
|
121
122
|
id: Optional[Any] = None,
|
|
122
123
|
class_name: Optional[Any] = None,
|
|
123
124
|
autofocus: Optional[bool] = None,
|
|
124
|
-
custom_attrs: Optional[Dict[str, Union[
|
|
125
|
-
on_blur: Optional[
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
|
|
126
|
+
on_blur: Optional[
|
|
127
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
128
|
+
] = None,
|
|
129
|
+
on_change: Optional[
|
|
130
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
131
|
+
] = None,
|
|
132
|
+
on_click: Optional[
|
|
133
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
134
|
+
] = None,
|
|
128
135
|
on_context_menu: Optional[
|
|
129
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
136
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
137
|
+
] = None,
|
|
138
|
+
on_copy: Optional[
|
|
139
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
140
|
+
] = None,
|
|
141
|
+
on_cut: Optional[
|
|
142
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
130
143
|
] = None,
|
|
131
|
-
on_copy: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
132
|
-
on_cut: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
133
144
|
on_double_click: Optional[
|
|
134
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
145
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
146
|
+
] = None,
|
|
147
|
+
on_focus: Optional[
|
|
148
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
149
|
+
] = None,
|
|
150
|
+
on_input: Optional[
|
|
151
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
152
|
+
] = None,
|
|
153
|
+
on_load: Optional[
|
|
154
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
155
|
+
] = None,
|
|
156
|
+
on_mount: Optional[
|
|
157
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
135
158
|
] = None,
|
|
136
|
-
on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
137
|
-
on_input: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
138
|
-
on_load: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
139
|
-
on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
140
159
|
on_mouse_down: Optional[
|
|
141
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
160
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
142
161
|
] = None,
|
|
143
162
|
on_mouse_enter: Optional[
|
|
144
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
163
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
145
164
|
] = None,
|
|
146
165
|
on_mouse_leave: Optional[
|
|
147
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
166
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
148
167
|
] = None,
|
|
149
168
|
on_mouse_move: Optional[
|
|
150
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
169
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
151
170
|
] = None,
|
|
152
171
|
on_mouse_out: Optional[
|
|
153
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
172
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
154
173
|
] = None,
|
|
155
174
|
on_mouse_over: Optional[
|
|
156
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
175
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
157
176
|
] = None,
|
|
158
177
|
on_mouse_up: Optional[
|
|
159
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
178
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
179
|
+
] = None,
|
|
180
|
+
on_paste: Optional[
|
|
181
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
160
182
|
] = None,
|
|
161
|
-
on_paste: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
162
183
|
on_resize_editor: Optional[
|
|
163
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
184
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
185
|
+
] = None,
|
|
186
|
+
on_scroll: Optional[
|
|
187
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
164
188
|
] = None,
|
|
165
|
-
on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None,
|
|
166
189
|
on_unmount: Optional[
|
|
167
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
190
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
168
191
|
] = None,
|
|
169
192
|
toggle_code_view: Optional[
|
|
170
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
193
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
171
194
|
] = None,
|
|
172
195
|
toggle_full_screen: Optional[
|
|
173
|
-
Union[EventHandler, EventSpec, list, Callable,
|
|
196
|
+
Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
|
|
174
197
|
] = None,
|
|
175
198
|
**props,
|
|
176
199
|
) -> "Editor":
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
"""Tag to conditionally render components."""
|
|
2
2
|
|
|
3
|
-
import dataclasses
|
|
4
3
|
from typing import Any, Dict, Optional
|
|
5
4
|
|
|
6
5
|
from reflex.components.tags.tag import Tag
|
|
7
|
-
from reflex.vars
|
|
6
|
+
from reflex.vars import Var
|
|
8
7
|
|
|
9
8
|
|
|
10
|
-
@dataclasses.dataclass()
|
|
11
9
|
class CondTag(Tag):
|
|
12
10
|
"""A conditional tag."""
|
|
13
11
|
|
|
14
12
|
# The condition to determine which component to render.
|
|
15
|
-
cond: Var[Any]
|
|
13
|
+
cond: Var[Any]
|
|
16
14
|
|
|
17
15
|
# The code to render if the condition is true.
|
|
18
|
-
true_value: Dict
|
|
16
|
+
true_value: Dict
|
|
19
17
|
|
|
20
18
|
# The code to render if the condition is false.
|
|
21
|
-
false_value: Optional[Dict]
|
|
19
|
+
false_value: Optional[Dict]
|