reflex 0.7.4a2__py3-none-any.whl → 0.7.5__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/__init__.py +1 -0
- reflex/__init__.pyi +1 -0
- reflex/app.py +10 -8
- reflex/app_mixins/middleware.py +13 -20
- reflex/compiler/compiler.py +10 -3
- reflex/compiler/utils.py +4 -4
- reflex/components/base/app_wrap.pyi +7 -3
- reflex/components/base/body.pyi +7 -3
- reflex/components/base/document.pyi +27 -7
- reflex/components/base/error_boundary.pyi +7 -3
- reflex/components/base/fragment.pyi +7 -3
- reflex/components/base/head.pyi +12 -4
- reflex/components/base/link.pyi +12 -4
- reflex/components/base/meta.pyi +22 -6
- reflex/components/base/script.pyi +7 -3
- reflex/components/base/strict_mode.pyi +7 -3
- reflex/components/component.py +64 -23
- reflex/components/core/auto_scroll.pyi +7 -3
- reflex/components/core/banner.py +6 -2
- reflex/components/core/banner.pyi +32 -8
- reflex/components/core/client_side_routing.pyi +12 -4
- reflex/components/core/clipboard.pyi +7 -3
- reflex/components/core/debounce.pyi +7 -3
- reflex/components/core/foreach.py +5 -1
- reflex/components/core/html.pyi +7 -3
- reflex/components/core/match.py +5 -5
- reflex/components/core/sticky.pyi +21 -6
- reflex/components/core/upload.pyi +27 -7
- reflex/components/datadisplay/code.pyi +12 -4
- reflex/components/datadisplay/dataeditor.py +2 -2
- reflex/components/datadisplay/dataeditor.pyi +17 -3
- reflex/components/datadisplay/shiki_code_block.pyi +17 -4
- reflex/components/el/__init__.pyi +1 -1
- reflex/components/el/element.pyi +7 -3
- reflex/components/el/elements/__init__.py +3 -1
- reflex/components/el/elements/__init__.pyi +3 -2
- reflex/components/el/elements/base.pyi +7 -3
- reflex/components/el/elements/forms.py +1 -1
- reflex/components/el/elements/forms.pyi +72 -16
- reflex/components/el/elements/inline.pyi +142 -30
- reflex/components/el/elements/media.pyi +127 -27
- reflex/components/el/elements/metadata.pyi +32 -8
- reflex/components/el/elements/other.pyi +37 -9
- reflex/components/el/elements/scripts.pyi +17 -5
- reflex/components/el/elements/sectioning.pyi +77 -17
- reflex/components/el/elements/tables.pyi +52 -12
- reflex/components/el/elements/typography.pyi +77 -17
- reflex/components/gridjs/datatable.py +2 -2
- reflex/components/gridjs/datatable.pyi +12 -4
- reflex/components/lucide/icon.py +7 -6
- reflex/components/lucide/icon.pyi +22 -7
- reflex/components/markdown/markdown.py +1 -1
- reflex/components/markdown/markdown.pyi +7 -3
- reflex/components/moment/moment.pyi +7 -3
- reflex/components/next/base.pyi +7 -3
- reflex/components/next/image.pyi +7 -3
- reflex/components/next/link.pyi +7 -3
- reflex/components/next/video.pyi +7 -3
- reflex/components/plotly/plotly.pyi +47 -11
- reflex/components/radix/primitives/accordion.pyi +37 -9
- reflex/components/radix/primitives/base.pyi +12 -4
- reflex/components/radix/primitives/drawer.pyi +57 -13
- reflex/components/radix/primitives/form.pyi +52 -12
- reflex/components/radix/primitives/progress.pyi +27 -7
- reflex/components/radix/primitives/slider.pyi +27 -7
- reflex/components/radix/themes/base.pyi +41 -10
- reflex/components/radix/themes/color_mode.py +2 -2
- reflex/components/radix/themes/color_mode.pyi +17 -5
- reflex/components/radix/themes/components/alert_dialog.pyi +36 -9
- reflex/components/radix/themes/components/aspect_ratio.pyi +7 -3
- reflex/components/radix/themes/components/avatar.pyi +6 -3
- reflex/components/radix/themes/components/badge.pyi +6 -3
- reflex/components/radix/themes/components/button.pyi +6 -3
- reflex/components/radix/themes/components/callout.pyi +26 -7
- reflex/components/radix/themes/components/card.pyi +6 -3
- reflex/components/radix/themes/components/checkbox.pyi +16 -5
- reflex/components/radix/themes/components/checkbox_cards.pyi +11 -4
- reflex/components/radix/themes/components/checkbox_group.pyi +11 -4
- reflex/components/radix/themes/components/context_menu.pyi +66 -15
- reflex/components/radix/themes/components/data_list.pyi +21 -6
- reflex/components/radix/themes/components/dialog.pyi +36 -9
- reflex/components/radix/themes/components/dropdown_menu.pyi +41 -10
- reflex/components/radix/themes/components/hover_card.pyi +21 -6
- reflex/components/radix/themes/components/icon_button.pyi +6 -3
- reflex/components/radix/themes/components/inset.pyi +6 -3
- reflex/components/radix/themes/components/popover.pyi +21 -6
- reflex/components/radix/themes/components/progress.pyi +6 -3
- reflex/components/radix/themes/components/radio.pyi +6 -3
- reflex/components/radix/themes/components/radio_cards.pyi +11 -4
- reflex/components/radix/themes/components/radio_group.py +6 -1
- reflex/components/radix/themes/components/radio_group.pyi +21 -6
- reflex/components/radix/themes/components/scroll_area.pyi +7 -3
- reflex/components/radix/themes/components/segmented_control.pyi +11 -4
- reflex/components/radix/themes/components/select.pyi +46 -11
- reflex/components/radix/themes/components/separator.pyi +6 -3
- reflex/components/radix/themes/components/skeleton.pyi +6 -3
- reflex/components/radix/themes/components/slider.pyi +6 -3
- reflex/components/radix/themes/components/spinner.pyi +6 -3
- reflex/components/radix/themes/components/switch.pyi +6 -3
- reflex/components/radix/themes/components/table.pyi +36 -9
- reflex/components/radix/themes/components/tabs.pyi +26 -7
- reflex/components/radix/themes/components/text_area.pyi +6 -3
- reflex/components/radix/themes/components/text_field.py +3 -2
- reflex/components/radix/themes/components/text_field.pyi +16 -5
- reflex/components/radix/themes/components/tooltip.pyi +7 -3
- reflex/components/radix/themes/layout/base.pyi +6 -3
- reflex/components/radix/themes/layout/box.pyi +7 -3
- reflex/components/radix/themes/layout/center.pyi +6 -3
- reflex/components/radix/themes/layout/container.pyi +6 -3
- reflex/components/radix/themes/layout/flex.pyi +6 -3
- reflex/components/radix/themes/layout/grid.pyi +6 -3
- reflex/components/radix/themes/layout/list.pyi +27 -7
- reflex/components/radix/themes/layout/section.pyi +6 -3
- reflex/components/radix/themes/layout/spacer.pyi +6 -3
- reflex/components/radix/themes/layout/stack.pyi +16 -5
- reflex/components/radix/themes/typography/blockquote.pyi +6 -3
- reflex/components/radix/themes/typography/code.pyi +6 -3
- reflex/components/radix/themes/typography/heading.pyi +6 -3
- reflex/components/radix/themes/typography/link.pyi +6 -3
- reflex/components/radix/themes/typography/text.pyi +36 -9
- reflex/components/react_player/audio.pyi +7 -3
- reflex/components/react_player/react_player.pyi +7 -3
- reflex/components/react_player/video.pyi +7 -3
- reflex/components/recharts/cartesian.pyi +97 -21
- reflex/components/recharts/charts.pyi +62 -14
- reflex/components/recharts/general.pyi +32 -8
- reflex/components/recharts/polar.py +1 -1
- reflex/components/recharts/polar.pyi +33 -9
- reflex/components/recharts/recharts.pyi +12 -4
- reflex/components/sonner/toast.pyi +7 -2
- reflex/components/suneditor/editor.pyi +7 -3
- reflex/config.py +18 -1
- reflex/constants/installer.py +22 -1
- reflex/custom_components/custom_components.py +12 -7
- reflex/event.py +26 -10
- reflex/experimental/__init__.py +17 -6
- reflex/experimental/layout.pyi +27 -7
- reflex/model.py +3 -3
- reflex/reflex.py +33 -18
- reflex/state.py +4 -4
- reflex/style.py +2 -2
- reflex/testing.py +17 -5
- reflex/utils/console.py +2 -3
- reflex/utils/exec.py +4 -0
- reflex/utils/imports.py +14 -7
- reflex/utils/net.py +107 -18
- reflex/utils/prerequisites.py +92 -13
- reflex/utils/processes.py +52 -19
- reflex/utils/pyi_generator.py +66 -53
- reflex/utils/redir.py +3 -1
- reflex/utils/registry.py +15 -5
- reflex/utils/serializers.py +1 -2
- reflex/utils/types.py +4 -4
- reflex/vars/base.py +58 -22
- reflex/vars/number.py +23 -6
- reflex/vars/sequence.py +2 -0
- {reflex-0.7.4a2.dist-info → reflex-0.7.5.dist-info}/METADATA +2 -2
- {reflex-0.7.4a2.dist-info → reflex-0.7.5.dist-info}/RECORD +162 -162
- /reflex/{experimental → utils}/misc.py +0 -0
- {reflex-0.7.4a2.dist-info → reflex-0.7.5.dist-info}/WHEEL +0 -0
- {reflex-0.7.4a2.dist-info → reflex-0.7.5.dist-info}/entry_points.txt +0 -0
- {reflex-0.7.4a2.dist-info → reflex-0.7.5.dist-info}/licenses/LICENSE +0 -0
reflex/components/component.py
CHANGED
|
@@ -18,17 +18,18 @@ from typing import (
|
|
|
18
18
|
ClassVar,
|
|
19
19
|
Iterator,
|
|
20
20
|
List,
|
|
21
|
+
Mapping,
|
|
21
22
|
Sequence,
|
|
22
23
|
Set,
|
|
23
24
|
Type,
|
|
24
25
|
TypeVar,
|
|
25
26
|
Union,
|
|
27
|
+
cast,
|
|
26
28
|
get_args,
|
|
27
29
|
get_origin,
|
|
28
30
|
)
|
|
29
31
|
|
|
30
32
|
import pydantic.v1
|
|
31
|
-
import pydantic.v1.fields
|
|
32
33
|
|
|
33
34
|
import reflex.state
|
|
34
35
|
from reflex.base import Base
|
|
@@ -48,12 +49,13 @@ from reflex.constants import (
|
|
|
48
49
|
from reflex.constants.compiler import SpecialAttributes
|
|
49
50
|
from reflex.constants.state import FRONTEND_EVENT_STATE
|
|
50
51
|
from reflex.event import (
|
|
51
|
-
EventActionsMixin,
|
|
52
52
|
EventCallback,
|
|
53
53
|
EventChain,
|
|
54
54
|
EventHandler,
|
|
55
55
|
EventSpec,
|
|
56
56
|
no_args_event_spec,
|
|
57
|
+
parse_args_spec,
|
|
58
|
+
run_script,
|
|
57
59
|
)
|
|
58
60
|
from reflex.style import Style, format_as_emotion
|
|
59
61
|
from reflex.utils import console, format, imports, types
|
|
@@ -65,7 +67,7 @@ from reflex.vars.base import (
|
|
|
65
67
|
Var,
|
|
66
68
|
cached_property_no_lock,
|
|
67
69
|
)
|
|
68
|
-
from reflex.vars.function import ArgsFunctionOperation, FunctionStringVar
|
|
70
|
+
from reflex.vars.function import ArgsFunctionOperation, FunctionStringVar, FunctionVar
|
|
69
71
|
from reflex.vars.number import ternary_operation
|
|
70
72
|
from reflex.vars.object import ObjectVar
|
|
71
73
|
from reflex.vars.sequence import LiteralArrayVar
|
|
@@ -179,7 +181,7 @@ def evaluate_style_namespaces(style: ComponentStyle) -> dict:
|
|
|
179
181
|
# Map from component to styling.
|
|
180
182
|
ComponentStyle = dict[str | Type[BaseComponent] | Callable | ComponentNamespace, Any]
|
|
181
183
|
ComponentChild = types.PrimitiveType | Var | BaseComponent
|
|
182
|
-
ComponentChildTypes = (*types.PrimitiveTypes, Var, BaseComponent)
|
|
184
|
+
ComponentChildTypes = (*types.PrimitiveTypes, Var, BaseComponent, type(None))
|
|
183
185
|
|
|
184
186
|
|
|
185
187
|
def _satisfies_type_hint(obj: Any, type_hint: Any) -> bool:
|
|
@@ -576,9 +578,15 @@ class Component(BaseComponent, ABC):
|
|
|
576
578
|
|
|
577
579
|
# Add style props to the component.
|
|
578
580
|
style = kwargs.get("style", {})
|
|
579
|
-
if isinstance(style,
|
|
581
|
+
if isinstance(style, Sequence):
|
|
582
|
+
if any(not isinstance(s, Mapping) for s in style):
|
|
583
|
+
raise TypeError("Style must be a dictionary or a list of dictionaries.")
|
|
580
584
|
# Merge styles, the later ones overriding keys in the earlier ones.
|
|
581
|
-
style = {
|
|
585
|
+
style = {
|
|
586
|
+
k: v
|
|
587
|
+
for style_dict in style
|
|
588
|
+
for k, v in cast(Mapping, style_dict).items()
|
|
589
|
+
}
|
|
582
590
|
|
|
583
591
|
if isinstance(style, (Breakpoints, Var)):
|
|
584
592
|
style = {
|
|
@@ -886,7 +894,7 @@ class Component(BaseComponent, ABC):
|
|
|
886
894
|
_style.update(s)
|
|
887
895
|
return _style
|
|
888
896
|
|
|
889
|
-
def _get_component_style(self, styles: ComponentStyle) -> Style | None:
|
|
897
|
+
def _get_component_style(self, styles: ComponentStyle | Style) -> Style | None:
|
|
890
898
|
"""Get the style to the component from `App.style`.
|
|
891
899
|
|
|
892
900
|
Args:
|
|
@@ -896,14 +904,14 @@ class Component(BaseComponent, ABC):
|
|
|
896
904
|
The style of the component.
|
|
897
905
|
"""
|
|
898
906
|
component_style = None
|
|
899
|
-
if type(self)
|
|
900
|
-
component_style = Style(
|
|
901
|
-
if self.create
|
|
902
|
-
component_style = Style(
|
|
907
|
+
if (style := styles.get(type(self))) is not None: # pyright: ignore [reportArgumentType]
|
|
908
|
+
component_style = Style(style)
|
|
909
|
+
if (style := styles.get(self.create)) is not None: # pyright: ignore [reportArgumentType]
|
|
910
|
+
component_style = Style(style)
|
|
903
911
|
return component_style
|
|
904
912
|
|
|
905
913
|
def _add_style_recursive(
|
|
906
|
-
self, style: ComponentStyle, theme: Component | None = None
|
|
914
|
+
self, style: ComponentStyle | Style, theme: Component | None = None
|
|
907
915
|
) -> Component:
|
|
908
916
|
"""Add additional style to the component and its children.
|
|
909
917
|
|
|
@@ -1228,7 +1236,9 @@ class Component(BaseComponent, ABC):
|
|
|
1228
1236
|
Yields:
|
|
1229
1237
|
The parent classes that define the method (differently than the base).
|
|
1230
1238
|
"""
|
|
1231
|
-
seen_methods =
|
|
1239
|
+
seen_methods = (
|
|
1240
|
+
{getattr(Component, method)} if hasattr(Component, method) else set()
|
|
1241
|
+
)
|
|
1232
1242
|
for clz in cls.mro():
|
|
1233
1243
|
if clz is Component:
|
|
1234
1244
|
break
|
|
@@ -1893,7 +1903,44 @@ class CustomComponent(Component):
|
|
|
1893
1903
|
|
|
1894
1904
|
return custom_components
|
|
1895
1905
|
|
|
1896
|
-
|
|
1906
|
+
@staticmethod
|
|
1907
|
+
def _get_event_spec_from_args_spec(name: str, event: EventChain) -> Callable:
|
|
1908
|
+
"""Get the event spec from the args spec.
|
|
1909
|
+
|
|
1910
|
+
Args:
|
|
1911
|
+
name: The name of the event
|
|
1912
|
+
event: The args spec.
|
|
1913
|
+
|
|
1914
|
+
Returns:
|
|
1915
|
+
The event spec.
|
|
1916
|
+
"""
|
|
1917
|
+
|
|
1918
|
+
def fn(*args):
|
|
1919
|
+
return run_script(Var(name).to(FunctionVar).call(*args))
|
|
1920
|
+
|
|
1921
|
+
if event.args_spec:
|
|
1922
|
+
arg_spec = (
|
|
1923
|
+
event.args_spec
|
|
1924
|
+
if not isinstance(event.args_spec, Sequence)
|
|
1925
|
+
else event.args_spec[0]
|
|
1926
|
+
)
|
|
1927
|
+
names = inspect.getfullargspec(arg_spec).args
|
|
1928
|
+
fn.__signature__ = inspect.Signature( # pyright: ignore[reportFunctionMemberAccess]
|
|
1929
|
+
parameters=[
|
|
1930
|
+
inspect.Parameter(
|
|
1931
|
+
name=name,
|
|
1932
|
+
kind=inspect.Parameter.POSITIONAL_ONLY,
|
|
1933
|
+
annotation=arg._var_type,
|
|
1934
|
+
)
|
|
1935
|
+
for name, arg in zip(
|
|
1936
|
+
names, parse_args_spec(event.args_spec), strict=True
|
|
1937
|
+
)
|
|
1938
|
+
]
|
|
1939
|
+
)
|
|
1940
|
+
|
|
1941
|
+
return fn
|
|
1942
|
+
|
|
1943
|
+
def get_prop_vars(self) -> List[Var | Callable]:
|
|
1897
1944
|
"""Get the prop vars.
|
|
1898
1945
|
|
|
1899
1946
|
Returns:
|
|
@@ -1902,16 +1949,10 @@ class CustomComponent(Component):
|
|
|
1902
1949
|
return [
|
|
1903
1950
|
Var(
|
|
1904
1951
|
_js_expr=name,
|
|
1905
|
-
_var_type=(
|
|
1906
|
-
prop._var_type
|
|
1907
|
-
if isinstance(prop, Var)
|
|
1908
|
-
else (
|
|
1909
|
-
type(prop)
|
|
1910
|
-
if not isinstance(prop, EventActionsMixin)
|
|
1911
|
-
else EventChain
|
|
1912
|
-
)
|
|
1913
|
-
),
|
|
1952
|
+
_var_type=(prop._var_type if isinstance(prop, Var) else type(prop)),
|
|
1914
1953
|
).guess_type()
|
|
1954
|
+
if isinstance(prop, Var) or not isinstance(prop, EventChain)
|
|
1955
|
+
else CustomComponent._get_event_spec_from_args_spec(name, prop)
|
|
1915
1956
|
for name, prop in self.props.items()
|
|
1916
1957
|
]
|
|
1917
1958
|
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
|
-
from typing import Any, Literal, Optional, overload
|
|
6
|
+
from typing import Any, Literal, Mapping, Optional, Sequence, overload
|
|
7
7
|
|
|
8
|
+
from reflex.components.core.breakpoints import Breakpoints
|
|
8
9
|
from reflex.components.el.elements.typography import Div
|
|
9
10
|
from reflex.event import EventType
|
|
10
|
-
from reflex.style import Style
|
|
11
11
|
from reflex.utils.imports import ImportDict
|
|
12
12
|
from reflex.vars.base import Var
|
|
13
13
|
|
|
@@ -195,7 +195,11 @@ class AutoScroll(Div):
|
|
|
195
195
|
spell_check: Var[bool] | bool | None = None,
|
|
196
196
|
tab_index: Var[int] | int | None = None,
|
|
197
197
|
title: Var[str] | str | None = None,
|
|
198
|
-
style:
|
|
198
|
+
style: Sequence[Mapping[str, Any]]
|
|
199
|
+
| Mapping[str, Any]
|
|
200
|
+
| Var[Mapping[str, Any]]
|
|
201
|
+
| Breakpoints
|
|
202
|
+
| None = None,
|
|
199
203
|
key: Any | None = None,
|
|
200
204
|
id: Any | None = None,
|
|
201
205
|
class_name: Any | None = None,
|
reflex/components/core/banner.py
CHANGED
|
@@ -149,8 +149,12 @@ setTimeout(() => {{
|
|
|
149
149
|
"useEffect",
|
|
150
150
|
_var_data=VarData(
|
|
151
151
|
imports={
|
|
152
|
-
"react":
|
|
153
|
-
**
|
|
152
|
+
"react": ("useEffect", "useState"),
|
|
153
|
+
**(
|
|
154
|
+
dict(var_data.imports)
|
|
155
|
+
if (var_data := target_url._get_all_var_data()) is not None
|
|
156
|
+
else {}
|
|
157
|
+
),
|
|
154
158
|
}
|
|
155
159
|
),
|
|
156
160
|
).call(
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
|
-
from typing import Any, Literal, Optional, overload
|
|
6
|
+
from typing import Any, Literal, Mapping, Optional, Sequence, overload
|
|
7
7
|
|
|
8
8
|
from reflex.components.base.fragment import Fragment
|
|
9
9
|
from reflex.components.component import Component
|
|
10
|
+
from reflex.components.core.breakpoints import Breakpoints
|
|
10
11
|
from reflex.components.el.elements.typography import Div
|
|
11
12
|
from reflex.components.lucide.icon import Icon
|
|
12
13
|
from reflex.constants.compiler import CompileVars
|
|
13
14
|
from reflex.event import EventType
|
|
14
|
-
from reflex.style import Style
|
|
15
15
|
from reflex.utils.imports import ImportVar
|
|
16
16
|
from reflex.vars import VarData
|
|
17
17
|
from reflex.vars.base import Var
|
|
@@ -48,7 +48,11 @@ class ConnectionToaster(Fragment):
|
|
|
48
48
|
def create( # type: ignore
|
|
49
49
|
cls,
|
|
50
50
|
*children,
|
|
51
|
-
style:
|
|
51
|
+
style: Sequence[Mapping[str, Any]]
|
|
52
|
+
| Mapping[str, Any]
|
|
53
|
+
| Var[Mapping[str, Any]]
|
|
54
|
+
| Breakpoints
|
|
55
|
+
| None = None,
|
|
52
56
|
key: Any | None = None,
|
|
53
57
|
id: Any | None = None,
|
|
54
58
|
class_name: Any | None = None,
|
|
@@ -94,7 +98,11 @@ class ConnectionBanner(Component):
|
|
|
94
98
|
def create( # type: ignore
|
|
95
99
|
cls,
|
|
96
100
|
*children,
|
|
97
|
-
style:
|
|
101
|
+
style: Sequence[Mapping[str, Any]]
|
|
102
|
+
| Mapping[str, Any]
|
|
103
|
+
| Var[Mapping[str, Any]]
|
|
104
|
+
| Breakpoints
|
|
105
|
+
| None = None,
|
|
98
106
|
key: Any | None = None,
|
|
99
107
|
id: Any | None = None,
|
|
100
108
|
class_name: Any | None = None,
|
|
@@ -133,7 +141,11 @@ class ConnectionModal(Component):
|
|
|
133
141
|
def create( # type: ignore
|
|
134
142
|
cls,
|
|
135
143
|
*children,
|
|
136
|
-
style:
|
|
144
|
+
style: Sequence[Mapping[str, Any]]
|
|
145
|
+
| Mapping[str, Any]
|
|
146
|
+
| Var[Mapping[str, Any]]
|
|
147
|
+
| Breakpoints
|
|
148
|
+
| None = None,
|
|
137
149
|
key: Any | None = None,
|
|
138
150
|
id: Any | None = None,
|
|
139
151
|
class_name: Any | None = None,
|
|
@@ -173,7 +185,11 @@ class WifiOffPulse(Icon):
|
|
|
173
185
|
cls,
|
|
174
186
|
*children,
|
|
175
187
|
size: Var[int] | int | None = None,
|
|
176
|
-
style:
|
|
188
|
+
style: Sequence[Mapping[str, Any]]
|
|
189
|
+
| Mapping[str, Any]
|
|
190
|
+
| Var[Mapping[str, Any]]
|
|
191
|
+
| Breakpoints
|
|
192
|
+
| None = None,
|
|
177
193
|
key: Any | None = None,
|
|
178
194
|
id: Any | None = None,
|
|
179
195
|
class_name: Any | None = None,
|
|
@@ -400,7 +416,11 @@ class ConnectionPulser(Div):
|
|
|
400
416
|
spell_check: Var[bool] | bool | None = None,
|
|
401
417
|
tab_index: Var[int] | int | None = None,
|
|
402
418
|
title: Var[str] | str | None = None,
|
|
403
|
-
style:
|
|
419
|
+
style: Sequence[Mapping[str, Any]]
|
|
420
|
+
| Mapping[str, Any]
|
|
421
|
+
| Var[Mapping[str, Any]]
|
|
422
|
+
| Breakpoints
|
|
423
|
+
| None = None,
|
|
404
424
|
key: Any | None = None,
|
|
405
425
|
id: Any | None = None,
|
|
406
426
|
class_name: Any | None = None,
|
|
@@ -639,7 +659,11 @@ class BackendDisabled(Div):
|
|
|
639
659
|
spell_check: Var[bool] | bool | None = None,
|
|
640
660
|
tab_index: Var[int] | int | None = None,
|
|
641
661
|
title: Var[str] | str | None = None,
|
|
642
|
-
style:
|
|
662
|
+
style: Sequence[Mapping[str, Any]]
|
|
663
|
+
| Mapping[str, Any]
|
|
664
|
+
| Var[Mapping[str, Any]]
|
|
665
|
+
| Breakpoints
|
|
666
|
+
| None = None,
|
|
643
667
|
key: Any | None = None,
|
|
644
668
|
id: Any | None = None,
|
|
645
669
|
class_name: Any | None = None,
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
|
-
from typing import Any, Optional, overload
|
|
6
|
+
from typing import Any, Mapping, Optional, Sequence, overload
|
|
7
7
|
|
|
8
8
|
from reflex.components.component import Component
|
|
9
|
+
from reflex.components.core.breakpoints import Breakpoints
|
|
9
10
|
from reflex.event import EventType
|
|
10
|
-
from reflex.style import Style
|
|
11
11
|
from reflex.vars.base import Var
|
|
12
12
|
|
|
13
13
|
route_not_found: Var
|
|
@@ -20,7 +20,11 @@ class ClientSideRouting(Component):
|
|
|
20
20
|
def create( # type: ignore
|
|
21
21
|
cls,
|
|
22
22
|
*children,
|
|
23
|
-
style:
|
|
23
|
+
style: Sequence[Mapping[str, Any]]
|
|
24
|
+
| Mapping[str, Any]
|
|
25
|
+
| Var[Mapping[str, Any]]
|
|
26
|
+
| Breakpoints
|
|
27
|
+
| None = None,
|
|
24
28
|
key: Any | None = None,
|
|
25
29
|
id: Any | None = None,
|
|
26
30
|
class_name: Any | None = None,
|
|
@@ -69,7 +73,11 @@ class Default404Page(Component):
|
|
|
69
73
|
cls,
|
|
70
74
|
*children,
|
|
71
75
|
status_code: Var[int] | int | None = None,
|
|
72
|
-
style:
|
|
76
|
+
style: Sequence[Mapping[str, Any]]
|
|
77
|
+
| Mapping[str, Any]
|
|
78
|
+
| Var[Mapping[str, Any]]
|
|
79
|
+
| Breakpoints
|
|
80
|
+
| None = None,
|
|
73
81
|
key: Any | None = None,
|
|
74
82
|
id: Any | None = None,
|
|
75
83
|
class_name: Any | None = None,
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
|
-
from typing import Any, Optional, Sequence, overload
|
|
6
|
+
from typing import Any, Mapping, Optional, Sequence, overload
|
|
7
7
|
|
|
8
8
|
from reflex.components.base.fragment import Fragment
|
|
9
|
+
from reflex.components.core.breakpoints import Breakpoints
|
|
9
10
|
from reflex.event import EventType
|
|
10
|
-
from reflex.style import Style
|
|
11
11
|
from reflex.utils.imports import ImportVar
|
|
12
12
|
from reflex.vars.base import Var
|
|
13
13
|
|
|
@@ -21,7 +21,11 @@ class Clipboard(Fragment):
|
|
|
21
21
|
on_paste_event_actions: Var[dict[str, bool | int]]
|
|
22
22
|
| dict[str, bool | int]
|
|
23
23
|
| None = None,
|
|
24
|
-
style:
|
|
24
|
+
style: Sequence[Mapping[str, Any]]
|
|
25
|
+
| Mapping[str, Any]
|
|
26
|
+
| Var[Mapping[str, Any]]
|
|
27
|
+
| Breakpoints
|
|
28
|
+
| None = None,
|
|
25
29
|
key: Any | None = None,
|
|
26
30
|
id: Any | None = None,
|
|
27
31
|
class_name: Any | None = None,
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
|
-
from typing import Any, Optional, Type, overload
|
|
6
|
+
from typing import Any, Mapping, Optional, Sequence, Type, overload
|
|
7
7
|
|
|
8
8
|
from reflex.components.component import Component
|
|
9
|
+
from reflex.components.core.breakpoints import Breakpoints
|
|
9
10
|
from reflex.event import EventType
|
|
10
|
-
from reflex.style import Style
|
|
11
11
|
from reflex.vars.base import Var
|
|
12
12
|
|
|
13
13
|
DEFAULT_DEBOUNCE_TIMEOUT = 300
|
|
@@ -25,7 +25,11 @@ class DebounceInput(Component):
|
|
|
25
25
|
value: Var[float | int | str] | float | int | str | None = None,
|
|
26
26
|
input_ref: Var[str] | str | None = None,
|
|
27
27
|
element: Type[Component] | Var[Type[Component]] | None = None,
|
|
28
|
-
style:
|
|
28
|
+
style: Sequence[Mapping[str, Any]]
|
|
29
|
+
| Mapping[str, Any]
|
|
30
|
+
| Var[Mapping[str, Any]]
|
|
31
|
+
| Breakpoints
|
|
32
|
+
| None = None,
|
|
29
33
|
key: Any | None = None,
|
|
30
34
|
id: Any | None = None,
|
|
31
35
|
class_name: Any | None = None,
|
|
@@ -58,7 +58,11 @@ class Foreach(Component):
|
|
|
58
58
|
"""
|
|
59
59
|
from reflex.vars import ArrayVar, ObjectVar, StringVar
|
|
60
60
|
|
|
61
|
-
iterable =
|
|
61
|
+
iterable = (
|
|
62
|
+
LiteralVar.create(iterable).guess_type()
|
|
63
|
+
if not isinstance(iterable, Var)
|
|
64
|
+
else iterable.guess_type()
|
|
65
|
+
)
|
|
62
66
|
|
|
63
67
|
if iterable._var_type == Any:
|
|
64
68
|
raise ForeachVarError(
|
reflex/components/core/html.pyi
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
|
-
from typing import Any, Literal, Optional, overload
|
|
6
|
+
from typing import Any, Literal, Mapping, Optional, Sequence, overload
|
|
7
7
|
|
|
8
|
+
from reflex.components.core.breakpoints import Breakpoints
|
|
8
9
|
from reflex.components.el.elements.typography import Div
|
|
9
10
|
from reflex.event import EventType
|
|
10
|
-
from reflex.style import Style
|
|
11
11
|
from reflex.vars.base import Var
|
|
12
12
|
|
|
13
13
|
class Html(Div):
|
|
@@ -195,7 +195,11 @@ class Html(Div):
|
|
|
195
195
|
spell_check: Var[bool] | bool | None = None,
|
|
196
196
|
tab_index: Var[int] | int | None = None,
|
|
197
197
|
title: Var[str] | str | None = None,
|
|
198
|
-
style:
|
|
198
|
+
style: Sequence[Mapping[str, Any]]
|
|
199
|
+
| Mapping[str, Any]
|
|
200
|
+
| Var[Mapping[str, Any]]
|
|
201
|
+
| Breakpoints
|
|
202
|
+
| None = None,
|
|
199
203
|
key: Any | None = None,
|
|
200
204
|
id: Any | None = None,
|
|
201
205
|
class_name: Any | None = None,
|
reflex/components/core/match.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""rx.match."""
|
|
2
2
|
|
|
3
3
|
import textwrap
|
|
4
|
-
from typing import Any, Dict
|
|
4
|
+
from typing import Any, Dict
|
|
5
5
|
|
|
6
6
|
from reflex.components.base import Fragment
|
|
7
7
|
from reflex.components.component import BaseComponent, Component, MemoizationLeaf
|
|
@@ -123,7 +123,7 @@ class Match(MemoizationLeaf):
|
|
|
123
123
|
return case_element
|
|
124
124
|
|
|
125
125
|
@classmethod
|
|
126
|
-
def _process_match_cases(cls, cases:
|
|
126
|
+
def _process_match_cases(cls, cases: list) -> list[list[Var]]:
|
|
127
127
|
"""Process the individual match cases.
|
|
128
128
|
|
|
129
129
|
Args:
|
|
@@ -232,13 +232,13 @@ class Match(MemoizationLeaf):
|
|
|
232
232
|
_js_expr=format.format_match(
|
|
233
233
|
cond=str(match_cond_var),
|
|
234
234
|
match_cases=match_cases,
|
|
235
|
-
default=default,
|
|
235
|
+
default=default,
|
|
236
236
|
),
|
|
237
|
-
_var_type=default._var_type,
|
|
237
|
+
_var_type=default._var_type,
|
|
238
238
|
_var_data=VarData.merge(
|
|
239
239
|
match_cond_var._get_all_var_data(),
|
|
240
240
|
*[el._get_all_var_data() for case in match_cases for el in case],
|
|
241
|
-
default._get_all_var_data(),
|
|
241
|
+
default._get_all_var_data(),
|
|
242
242
|
),
|
|
243
243
|
)
|
|
244
244
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# ------------------- DO NOT EDIT ----------------------
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
|
-
from typing import Any, Literal, Optional, overload
|
|
6
|
+
from typing import Any, Literal, Mapping, Optional, Sequence, overload
|
|
7
7
|
|
|
8
8
|
from reflex.components.component import ComponentNamespace
|
|
9
9
|
from reflex.components.core.breakpoints import Breakpoints
|
|
@@ -11,7 +11,6 @@ from reflex.components.el.elements.inline import A
|
|
|
11
11
|
from reflex.components.el.elements.media import Svg
|
|
12
12
|
from reflex.components.radix.themes.typography.text import Text
|
|
13
13
|
from reflex.event import EventType
|
|
14
|
-
from reflex.style import Style
|
|
15
14
|
from reflex.vars.base import Var
|
|
16
15
|
|
|
17
16
|
class StickyLogo(Svg):
|
|
@@ -201,7 +200,11 @@ class StickyLogo(Svg):
|
|
|
201
200
|
spell_check: Var[bool] | bool | None = None,
|
|
202
201
|
tab_index: Var[int] | int | None = None,
|
|
203
202
|
title: Var[str] | str | None = None,
|
|
204
|
-
style:
|
|
203
|
+
style: Sequence[Mapping[str, Any]]
|
|
204
|
+
| Mapping[str, Any]
|
|
205
|
+
| Var[Mapping[str, Any]]
|
|
206
|
+
| Breakpoints
|
|
207
|
+
| None = None,
|
|
205
208
|
key: Any | None = None,
|
|
206
209
|
id: Any | None = None,
|
|
207
210
|
class_name: Any | None = None,
|
|
@@ -549,7 +552,11 @@ class StickyLabel(Text):
|
|
|
549
552
|
spell_check: Var[bool] | bool | None = None,
|
|
550
553
|
tab_index: Var[int] | int | None = None,
|
|
551
554
|
title: Var[str] | str | None = None,
|
|
552
|
-
style:
|
|
555
|
+
style: Sequence[Mapping[str, Any]]
|
|
556
|
+
| Mapping[str, Any]
|
|
557
|
+
| Var[Mapping[str, Any]]
|
|
558
|
+
| Breakpoints
|
|
559
|
+
| None = None,
|
|
553
560
|
key: Any | None = None,
|
|
554
561
|
id: Any | None = None,
|
|
555
562
|
class_name: Any | None = None,
|
|
@@ -800,7 +807,11 @@ class StickyBadge(A):
|
|
|
800
807
|
spell_check: Var[bool] | bool | None = None,
|
|
801
808
|
tab_index: Var[int] | int | None = None,
|
|
802
809
|
title: Var[str] | str | None = None,
|
|
803
|
-
style:
|
|
810
|
+
style: Sequence[Mapping[str, Any]]
|
|
811
|
+
| Mapping[str, Any]
|
|
812
|
+
| Var[Mapping[str, Any]]
|
|
813
|
+
| Breakpoints
|
|
814
|
+
| None = None,
|
|
804
815
|
key: Any | None = None,
|
|
805
816
|
id: Any | None = None,
|
|
806
817
|
class_name: Any | None = None,
|
|
@@ -1052,7 +1063,11 @@ class StickyNamespace(ComponentNamespace):
|
|
|
1052
1063
|
spell_check: Var[bool] | bool | None = None,
|
|
1053
1064
|
tab_index: Var[int] | int | None = None,
|
|
1054
1065
|
title: Var[str] | str | None = None,
|
|
1055
|
-
style:
|
|
1066
|
+
style: Sequence[Mapping[str, Any]]
|
|
1067
|
+
| Mapping[str, Any]
|
|
1068
|
+
| Var[Mapping[str, Any]]
|
|
1069
|
+
| Breakpoints
|
|
1070
|
+
| None = None,
|
|
1056
1071
|
key: Any | None = None,
|
|
1057
1072
|
id: Any | None = None,
|
|
1058
1073
|
class_name: Any | None = None,
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
6
|
from pathlib import Path
|
|
7
|
-
from typing import Any, ClassVar, Optional, Sequence, overload
|
|
7
|
+
from typing import Any, ClassVar, Mapping, Optional, Sequence, overload
|
|
8
8
|
|
|
9
9
|
from reflex.components.base.fragment import Fragment
|
|
10
10
|
from reflex.components.component import Component, ComponentNamespace, MemoizationLeaf
|
|
11
|
+
from reflex.components.core.breakpoints import Breakpoints
|
|
11
12
|
from reflex.constants import Dirs
|
|
12
13
|
from reflex.event import CallableEventSpec, EventSpec, EventType
|
|
13
|
-
from reflex.style import Style
|
|
14
14
|
from reflex.utils.imports import ImportVar
|
|
15
15
|
from reflex.vars import VarData
|
|
16
16
|
from reflex.vars.base import Var
|
|
@@ -43,7 +43,11 @@ class UploadFilesProvider(Component):
|
|
|
43
43
|
def create( # type: ignore
|
|
44
44
|
cls,
|
|
45
45
|
*children,
|
|
46
|
-
style:
|
|
46
|
+
style: Sequence[Mapping[str, Any]]
|
|
47
|
+
| Mapping[str, Any]
|
|
48
|
+
| Var[Mapping[str, Any]]
|
|
49
|
+
| Breakpoints
|
|
50
|
+
| None = None,
|
|
47
51
|
key: Any | None = None,
|
|
48
52
|
id: Any | None = None,
|
|
49
53
|
class_name: Any | None = None,
|
|
@@ -89,7 +93,11 @@ class GhostUpload(Fragment):
|
|
|
89
93
|
def create( # type: ignore
|
|
90
94
|
cls,
|
|
91
95
|
*children,
|
|
92
|
-
style:
|
|
96
|
+
style: Sequence[Mapping[str, Any]]
|
|
97
|
+
| Mapping[str, Any]
|
|
98
|
+
| Var[Mapping[str, Any]]
|
|
99
|
+
| Breakpoints
|
|
100
|
+
| None = None,
|
|
93
101
|
key: Any | None = None,
|
|
94
102
|
id: Any | None = None,
|
|
95
103
|
class_name: Any | None = None,
|
|
@@ -148,7 +156,11 @@ class Upload(MemoizationLeaf):
|
|
|
148
156
|
no_click: Var[bool] | bool | None = None,
|
|
149
157
|
no_drag: Var[bool] | bool | None = None,
|
|
150
158
|
no_keyboard: Var[bool] | bool | None = None,
|
|
151
|
-
style:
|
|
159
|
+
style: Sequence[Mapping[str, Any]]
|
|
160
|
+
| Mapping[str, Any]
|
|
161
|
+
| Var[Mapping[str, Any]]
|
|
162
|
+
| Breakpoints
|
|
163
|
+
| None = None,
|
|
152
164
|
key: Any | None = None,
|
|
153
165
|
id: Any | None = None,
|
|
154
166
|
class_name: Any | None = None,
|
|
@@ -214,7 +226,11 @@ class StyledUpload(Upload):
|
|
|
214
226
|
no_click: Var[bool] | bool | None = None,
|
|
215
227
|
no_drag: Var[bool] | bool | None = None,
|
|
216
228
|
no_keyboard: Var[bool] | bool | None = None,
|
|
217
|
-
style:
|
|
229
|
+
style: Sequence[Mapping[str, Any]]
|
|
230
|
+
| Mapping[str, Any]
|
|
231
|
+
| Var[Mapping[str, Any]]
|
|
232
|
+
| Breakpoints
|
|
233
|
+
| None = None,
|
|
218
234
|
key: Any | None = None,
|
|
219
235
|
id: Any | None = None,
|
|
220
236
|
class_name: Any | None = None,
|
|
@@ -280,7 +296,11 @@ class UploadNamespace(ComponentNamespace):
|
|
|
280
296
|
no_click: Var[bool] | bool | None = None,
|
|
281
297
|
no_drag: Var[bool] | bool | None = None,
|
|
282
298
|
no_keyboard: Var[bool] | bool | None = None,
|
|
283
|
-
style:
|
|
299
|
+
style: Sequence[Mapping[str, Any]]
|
|
300
|
+
| Mapping[str, Any]
|
|
301
|
+
| Var[Mapping[str, Any]]
|
|
302
|
+
| Breakpoints
|
|
303
|
+
| None = None,
|
|
284
304
|
key: Any | None = None,
|
|
285
305
|
id: Any | None = None,
|
|
286
306
|
class_name: Any | None = None,
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
# This file was generated by `reflex/utils/pyi_generator.py`!
|
|
5
5
|
# ------------------------------------------------------
|
|
6
6
|
import dataclasses
|
|
7
|
-
from typing import Any, ClassVar, Literal, Optional, overload
|
|
7
|
+
from typing import Any, ClassVar, Literal, Mapping, Optional, Sequence, overload
|
|
8
8
|
|
|
9
9
|
from reflex.components.component import Component, ComponentNamespace
|
|
10
|
+
from reflex.components.core.breakpoints import Breakpoints
|
|
10
11
|
from reflex.components.markdown.markdown import MarkdownComponentMap
|
|
11
12
|
from reflex.constants.colors import Color
|
|
12
13
|
from reflex.event import EventType
|
|
13
|
-
from reflex.style import Style
|
|
14
14
|
from reflex.vars.base import Var
|
|
15
15
|
|
|
16
16
|
LiteralCodeLanguage = Literal[
|
|
@@ -929,7 +929,11 @@ class CodeBlock(Component, MarkdownComponentMap):
|
|
|
929
929
|
code_tag_props: Var[dict[str, str]] | dict[str, str] | None = None,
|
|
930
930
|
can_copy: bool | None = None,
|
|
931
931
|
copy_button: Component | bool | None = None,
|
|
932
|
-
style:
|
|
932
|
+
style: Sequence[Mapping[str, Any]]
|
|
933
|
+
| Mapping[str, Any]
|
|
934
|
+
| Var[Mapping[str, Any]]
|
|
935
|
+
| Breakpoints
|
|
936
|
+
| None = None,
|
|
933
937
|
key: Any | None = None,
|
|
934
938
|
id: Any | None = None,
|
|
935
939
|
class_name: Any | None = None,
|
|
@@ -1564,7 +1568,11 @@ class CodeblockNamespace(ComponentNamespace):
|
|
|
1564
1568
|
code_tag_props: Var[dict[str, str]] | dict[str, str] | None = None,
|
|
1565
1569
|
can_copy: bool | None = None,
|
|
1566
1570
|
copy_button: Component | bool | None = None,
|
|
1567
|
-
style:
|
|
1571
|
+
style: Sequence[Mapping[str, Any]]
|
|
1572
|
+
| Mapping[str, Any]
|
|
1573
|
+
| Var[Mapping[str, Any]]
|
|
1574
|
+
| Breakpoints
|
|
1575
|
+
| None = None,
|
|
1568
1576
|
key: Any | None = None,
|
|
1569
1577
|
id: Any | None = None,
|
|
1570
1578
|
class_name: Any | None = None,
|