reflex 0.7.13a2__py3-none-any.whl → 0.7.14__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/apps/blank/code/blank.py +0 -2
- reflex/app.py +85 -89
- reflex/app_mixins/lifespan.py +2 -3
- reflex/app_mixins/middleware.py +1 -0
- reflex/app_mixins/mixin.py +0 -1
- reflex/assets.py +7 -4
- reflex/base.py +3 -2
- reflex/compiler/compiler.py +79 -65
- reflex/compiler/utils.py +8 -6
- reflex/components/base/app_wrap.pyi +0 -1
- reflex/components/base/bare.py +22 -12
- reflex/components/base/body.pyi +0 -1
- reflex/components/base/document.pyi +0 -5
- reflex/components/base/error_boundary.pyi +0 -1
- reflex/components/base/fragment.pyi +0 -1
- reflex/components/base/head.pyi +0 -2
- reflex/components/base/link.pyi +0 -2
- reflex/components/base/meta.py +2 -1
- reflex/components/base/meta.pyi +0 -4
- reflex/components/base/script.py +2 -1
- reflex/components/base/script.pyi +0 -1
- reflex/components/base/strict_mode.pyi +0 -1
- reflex/components/component.py +85 -45
- reflex/components/core/auto_scroll.pyi +0 -1
- reflex/components/core/banner.py +1 -1
- reflex/components/core/banner.pyi +0 -6
- reflex/components/core/breakpoints.py +9 -11
- reflex/components/core/client_side_routing.pyi +0 -2
- reflex/components/core/clipboard.pyi +0 -1
- reflex/components/core/colors.py +10 -7
- reflex/components/core/cond.py +4 -2
- reflex/components/core/debounce.py +5 -3
- reflex/components/core/debounce.pyi +0 -1
- reflex/components/core/foreach.py +8 -6
- reflex/components/core/html.py +3 -3
- reflex/components/core/html.pyi +0 -1
- reflex/components/core/match.py +19 -17
- reflex/components/core/sticky.pyi +0 -4
- reflex/components/core/upload.py +1 -1
- reflex/components/core/upload.pyi +0 -5
- reflex/components/datadisplay/code.py +1 -2
- reflex/components/datadisplay/code.pyi +0 -2
- reflex/components/datadisplay/dataeditor.py +7 -10
- reflex/components/datadisplay/dataeditor.pyi +0 -1
- reflex/components/datadisplay/logo.py +3 -4
- reflex/components/datadisplay/shiki_code_block.py +8 -11
- reflex/components/datadisplay/shiki_code_block.pyi +0 -3
- reflex/components/dynamic.py +2 -3
- reflex/components/el/__init__.pyi +2 -0
- reflex/components/el/element.pyi +0 -1
- reflex/components/el/elements/__init__.py +1 -0
- reflex/components/el/elements/__init__.pyi +3 -0
- reflex/components/el/elements/base.pyi +0 -1
- reflex/components/el/elements/forms.py +14 -15
- reflex/components/el/elements/forms.pyi +15 -32
- reflex/components/el/elements/inline.pyi +0 -28
- reflex/components/el/elements/media.py +26 -0
- reflex/components/el/elements/media.pyi +259 -25
- reflex/components/el/elements/metadata.py +0 -1
- reflex/components/el/elements/metadata.pyi +0 -6
- reflex/components/el/elements/other.pyi +0 -7
- reflex/components/el/elements/scripts.pyi +0 -3
- reflex/components/el/elements/sectioning.pyi +0 -15
- reflex/components/el/elements/tables.pyi +0 -10
- reflex/components/el/elements/typography.pyi +0 -15
- reflex/components/gridjs/datatable.py +10 -13
- reflex/components/gridjs/datatable.pyi +0 -2
- reflex/components/lucide/icon.py +10 -9
- reflex/components/lucide/icon.pyi +0 -3
- reflex/components/markdown/markdown.py +6 -8
- reflex/components/markdown/markdown.pyi +0 -1
- reflex/components/moment/moment.pyi +0 -1
- reflex/components/next/base.py +0 -2
- reflex/components/next/base.pyi +0 -3
- reflex/components/next/image.pyi +0 -1
- reflex/components/next/link.pyi +0 -1
- reflex/components/next/video.pyi +0 -1
- reflex/components/plotly/plotly.pyi +0 -9
- reflex/components/props.py +4 -3
- reflex/components/radix/primitives/accordion.pyi +0 -7
- reflex/components/radix/primitives/base.py +1 -3
- reflex/components/radix/primitives/base.pyi +0 -2
- reflex/components/radix/primitives/drawer.pyi +0 -11
- reflex/components/radix/primitives/form.py +4 -8
- reflex/components/radix/primitives/form.pyi +0 -12
- reflex/components/radix/primitives/progress.py +1 -1
- reflex/components/radix/primitives/progress.pyi +0 -5
- reflex/components/radix/primitives/slider.py +1 -1
- reflex/components/radix/primitives/slider.pyi +0 -5
- reflex/components/radix/themes/base.pyi +0 -8
- reflex/components/radix/themes/color_mode.pyi +0 -3
- reflex/components/radix/themes/components/alert_dialog.py +4 -2
- reflex/components/radix/themes/components/alert_dialog.pyi +4 -9
- reflex/components/radix/themes/components/aspect_ratio.py +1 -2
- reflex/components/radix/themes/components/aspect_ratio.pyi +1 -3
- reflex/components/radix/themes/components/avatar.py +5 -2
- reflex/components/radix/themes/components/avatar.pyi +1 -3
- reflex/components/radix/themes/components/badge.py +5 -2
- reflex/components/radix/themes/components/badge.pyi +1 -3
- reflex/components/radix/themes/components/button.py +2 -3
- reflex/components/radix/themes/components/button.pyi +1 -3
- reflex/components/radix/themes/components/callout.py +1 -2
- reflex/components/radix/themes/components/callout.pyi +1 -7
- reflex/components/radix/themes/components/card.py +1 -2
- reflex/components/radix/themes/components/card.pyi +1 -3
- reflex/components/radix/themes/components/checkbox.py +7 -4
- reflex/components/radix/themes/components/checkbox.pyi +1 -5
- reflex/components/radix/themes/components/checkbox_cards.py +1 -2
- reflex/components/radix/themes/components/checkbox_cards.pyi +1 -4
- reflex/components/radix/themes/components/checkbox_group.py +1 -2
- reflex/components/radix/themes/components/checkbox_group.pyi +1 -4
- reflex/components/radix/themes/components/context_menu.py +1 -1
- reflex/components/radix/themes/components/context_menu.pyi +1 -14
- reflex/components/radix/themes/components/data_list.py +1 -2
- reflex/components/radix/themes/components/data_list.pyi +1 -6
- reflex/components/radix/themes/components/dialog.py +4 -2
- reflex/components/radix/themes/components/dialog.pyi +4 -9
- reflex/components/radix/themes/components/dropdown_menu.py +5 -2
- reflex/components/radix/themes/components/dropdown_menu.pyi +4 -10
- reflex/components/radix/themes/components/hover_card.py +4 -2
- reflex/components/radix/themes/components/hover_card.pyi +4 -6
- reflex/components/radix/themes/components/icon_button.py +7 -8
- reflex/components/radix/themes/components/icon_button.pyi +1 -3
- reflex/components/radix/themes/components/inset.py +1 -2
- reflex/components/radix/themes/components/inset.pyi +1 -3
- reflex/components/radix/themes/components/popover.py +4 -2
- reflex/components/radix/themes/components/popover.pyi +4 -6
- reflex/components/radix/themes/components/progress.py +1 -2
- reflex/components/radix/themes/components/progress.pyi +1 -3
- reflex/components/radix/themes/components/radio.py +1 -2
- reflex/components/radix/themes/components/radio.pyi +1 -3
- reflex/components/radix/themes/components/radio_cards.py +1 -2
- reflex/components/radix/themes/components/radio_cards.pyi +1 -4
- reflex/components/radix/themes/components/radio_group.py +7 -5
- reflex/components/radix/themes/components/radio_group.pyi +1 -6
- reflex/components/radix/themes/components/scroll_area.py +1 -2
- reflex/components/radix/themes/components/scroll_area.pyi +1 -3
- reflex/components/radix/themes/components/segmented_control.py +1 -2
- reflex/components/radix/themes/components/segmented_control.pyi +1 -4
- reflex/components/radix/themes/components/select.py +5 -2
- reflex/components/radix/themes/components/select.pyi +1 -11
- reflex/components/radix/themes/components/separator.py +1 -2
- reflex/components/radix/themes/components/separator.pyi +1 -3
- reflex/components/radix/themes/components/skeleton.py +1 -2
- reflex/components/radix/themes/components/skeleton.pyi +1 -3
- reflex/components/radix/themes/components/slider.py +1 -2
- reflex/components/radix/themes/components/slider.pyi +1 -3
- reflex/components/radix/themes/components/spinner.py +1 -2
- reflex/components/radix/themes/components/spinner.pyi +1 -3
- reflex/components/radix/themes/components/switch.py +1 -2
- reflex/components/radix/themes/components/switch.pyi +1 -3
- reflex/components/radix/themes/components/table.py +1 -2
- reflex/components/radix/themes/components/table.pyi +1 -9
- reflex/components/radix/themes/components/tabs.py +1 -2
- reflex/components/radix/themes/components/tabs.pyi +1 -7
- reflex/components/radix/themes/components/text_area.py +5 -2
- reflex/components/radix/themes/components/text_area.pyi +2 -4
- reflex/components/radix/themes/components/text_field.py +5 -2
- reflex/components/radix/themes/components/text_field.pyi +1 -5
- reflex/components/radix/themes/components/tooltip.py +1 -2
- reflex/components/radix/themes/components/tooltip.pyi +1 -3
- reflex/components/radix/themes/layout/base.py +5 -2
- reflex/components/radix/themes/layout/base.pyi +5 -3
- reflex/components/radix/themes/layout/box.py +1 -2
- reflex/components/radix/themes/layout/box.pyi +1 -3
- reflex/components/radix/themes/layout/center.pyi +0 -1
- reflex/components/radix/themes/layout/container.py +1 -2
- reflex/components/radix/themes/layout/container.pyi +1 -3
- reflex/components/radix/themes/layout/flex.py +6 -2
- reflex/components/radix/themes/layout/flex.pyi +1 -3
- reflex/components/radix/themes/layout/grid.py +6 -2
- reflex/components/radix/themes/layout/grid.pyi +1 -3
- reflex/components/radix/themes/layout/list.py +2 -1
- reflex/components/radix/themes/layout/list.pyi +0 -5
- reflex/components/radix/themes/layout/section.py +1 -2
- reflex/components/radix/themes/layout/section.pyi +1 -3
- reflex/components/radix/themes/layout/spacer.pyi +0 -1
- reflex/components/radix/themes/layout/stack.py +1 -1
- reflex/components/radix/themes/layout/stack.pyi +0 -3
- reflex/components/radix/themes/typography/blockquote.py +1 -1
- reflex/components/radix/themes/typography/blockquote.pyi +1 -3
- reflex/components/radix/themes/typography/code.py +5 -1
- reflex/components/radix/themes/typography/code.pyi +1 -3
- reflex/components/radix/themes/typography/heading.py +1 -1
- reflex/components/radix/themes/typography/heading.pyi +1 -3
- reflex/components/radix/themes/typography/link.py +3 -2
- reflex/components/radix/themes/typography/link.pyi +1 -3
- reflex/components/radix/themes/typography/text.py +1 -1
- reflex/components/radix/themes/typography/text.pyi +1 -9
- reflex/components/react_player/audio.py +0 -2
- reflex/components/react_player/audio.pyi +0 -3
- reflex/components/react_player/react_player.pyi +0 -1
- reflex/components/react_player/video.py +0 -2
- reflex/components/react_player/video.pyi +0 -3
- reflex/components/recharts/__init__.py +1 -1
- reflex/components/recharts/__init__.pyi +1 -1
- reflex/components/recharts/cartesian.py +20 -25
- reflex/components/recharts/cartesian.pyi +20 -37
- reflex/components/recharts/charts.py +2 -1
- reflex/components/recharts/charts.pyi +0 -12
- reflex/components/recharts/general.pyi +0 -6
- reflex/components/recharts/polar.py +5 -4
- reflex/components/recharts/polar.pyi +4 -10
- reflex/components/recharts/recharts.py +12 -10
- reflex/components/recharts/recharts.pyi +10 -11
- reflex/components/sonner/toast.py +2 -2
- reflex/components/sonner/toast.pyi +0 -2
- reflex/components/suneditor/editor.py +2 -1
- reflex/components/suneditor/editor.pyi +0 -1
- reflex/components/tags/iter_tag.py +4 -2
- reflex/config.py +41 -615
- reflex/constants/base.py +6 -6
- reflex/constants/compiler.py +8 -6
- reflex/constants/installer.py +25 -16
- reflex/custom_components/custom_components.py +1 -2
- reflex/environment.py +606 -0
- reflex/event.py +58 -60
- reflex/experimental/__init__.py +2 -2
- reflex/experimental/client_state.py +9 -4
- reflex/experimental/layout.pyi +0 -5
- reflex/istate/manager.py +17 -20
- reflex/istate/proxy.py +19 -12
- reflex/model.py +8 -5
- reflex/plugins/base.py +8 -0
- reflex/plugins/tailwind_v3.py +8 -0
- reflex/plugins/tailwind_v4.py +8 -0
- reflex/reflex.py +11 -12
- reflex/route.py +7 -9
- reflex/state.py +67 -71
- reflex/style.py +3 -1
- reflex/testing.py +49 -30
- reflex/utils/build.py +2 -1
- reflex/utils/console.py +70 -17
- reflex/utils/exec.py +113 -39
- reflex/utils/export.py +2 -1
- reflex/utils/format.py +21 -24
- reflex/utils/imports.py +4 -3
- reflex/utils/lazy_loader.py +3 -3
- reflex/utils/misc.py +2 -1
- reflex/utils/net.py +2 -2
- reflex/utils/path_ops.py +4 -2
- reflex/utils/prerequisites.py +69 -39
- reflex/utils/processes.py +5 -7
- reflex/utils/pyi_generator.py +46 -41
- reflex/utils/redir.py +1 -1
- reflex/utils/registry.py +1 -1
- reflex/utils/serializers.py +4 -4
- reflex/utils/telemetry.py +36 -3
- reflex/utils/types.py +16 -13
- reflex/vars/base.py +96 -109
- reflex/vars/datetime.py +2 -1
- reflex/vars/dep_tracking.py +19 -28
- reflex/vars/number.py +6 -7
- reflex/vars/object.py +5 -6
- reflex/vars/sequence.py +11 -11
- {reflex-0.7.13a2.dist-info → reflex-0.7.14.dist-info}/METADATA +1 -1
- reflex-0.7.14.dist-info/RECORD +408 -0
- reflex-0.7.13a2.dist-info/RECORD +0 -407
- {reflex-0.7.13a2.dist-info → reflex-0.7.14.dist-info}/WHEEL +0 -0
- {reflex-0.7.13a2.dist-info → reflex-0.7.14.dist-info}/entry_points.txt +0 -0
- {reflex-0.7.13a2.dist-info → reflex-0.7.14.dist-info}/licenses/LICENSE +0 -0
|
@@ -256,7 +256,6 @@ class Caption(BaseHTML):
|
|
|
256
256
|
Returns:
|
|
257
257
|
The component.
|
|
258
258
|
"""
|
|
259
|
-
...
|
|
260
259
|
|
|
261
260
|
class Col(BaseHTML):
|
|
262
261
|
@overload
|
|
@@ -504,7 +503,6 @@ class Col(BaseHTML):
|
|
|
504
503
|
Returns:
|
|
505
504
|
The component.
|
|
506
505
|
"""
|
|
507
|
-
...
|
|
508
506
|
|
|
509
507
|
class Colgroup(BaseHTML):
|
|
510
508
|
@overload
|
|
@@ -752,7 +750,6 @@ class Colgroup(BaseHTML):
|
|
|
752
750
|
Returns:
|
|
753
751
|
The component.
|
|
754
752
|
"""
|
|
755
|
-
...
|
|
756
753
|
|
|
757
754
|
class Table(BaseHTML):
|
|
758
755
|
@overload
|
|
@@ -1004,7 +1001,6 @@ class Table(BaseHTML):
|
|
|
1004
1001
|
Returns:
|
|
1005
1002
|
The component.
|
|
1006
1003
|
"""
|
|
1007
|
-
...
|
|
1008
1004
|
|
|
1009
1005
|
class Tbody(BaseHTML):
|
|
1010
1006
|
@overload
|
|
@@ -1250,7 +1246,6 @@ class Tbody(BaseHTML):
|
|
|
1250
1246
|
Returns:
|
|
1251
1247
|
The component.
|
|
1252
1248
|
"""
|
|
1253
|
-
...
|
|
1254
1249
|
|
|
1255
1250
|
class Td(BaseHTML):
|
|
1256
1251
|
@overload
|
|
@@ -1506,7 +1501,6 @@ class Td(BaseHTML):
|
|
|
1506
1501
|
Returns:
|
|
1507
1502
|
The component.
|
|
1508
1503
|
"""
|
|
1509
|
-
...
|
|
1510
1504
|
|
|
1511
1505
|
class Tfoot(BaseHTML):
|
|
1512
1506
|
@overload
|
|
@@ -1752,7 +1746,6 @@ class Tfoot(BaseHTML):
|
|
|
1752
1746
|
Returns:
|
|
1753
1747
|
The component.
|
|
1754
1748
|
"""
|
|
1755
|
-
...
|
|
1756
1749
|
|
|
1757
1750
|
class Th(BaseHTML):
|
|
1758
1751
|
@overload
|
|
@@ -2010,7 +2003,6 @@ class Th(BaseHTML):
|
|
|
2010
2003
|
Returns:
|
|
2011
2004
|
The component.
|
|
2012
2005
|
"""
|
|
2013
|
-
...
|
|
2014
2006
|
|
|
2015
2007
|
class Thead(BaseHTML):
|
|
2016
2008
|
@overload
|
|
@@ -2256,7 +2248,6 @@ class Thead(BaseHTML):
|
|
|
2256
2248
|
Returns:
|
|
2257
2249
|
The component.
|
|
2258
2250
|
"""
|
|
2259
|
-
...
|
|
2260
2251
|
|
|
2261
2252
|
class Tr(BaseHTML):
|
|
2262
2253
|
@overload
|
|
@@ -2502,7 +2493,6 @@ class Tr(BaseHTML):
|
|
|
2502
2493
|
Returns:
|
|
2503
2494
|
The component.
|
|
2504
2495
|
"""
|
|
2505
|
-
...
|
|
2506
2496
|
|
|
2507
2497
|
caption = Caption.create
|
|
2508
2498
|
col = Col.create
|
|
@@ -258,7 +258,6 @@ class Blockquote(BaseHTML):
|
|
|
258
258
|
Returns:
|
|
259
259
|
The component.
|
|
260
260
|
"""
|
|
261
|
-
...
|
|
262
261
|
|
|
263
262
|
class Dd(BaseHTML):
|
|
264
263
|
@overload
|
|
@@ -504,7 +503,6 @@ class Dd(BaseHTML):
|
|
|
504
503
|
Returns:
|
|
505
504
|
The component.
|
|
506
505
|
"""
|
|
507
|
-
...
|
|
508
506
|
|
|
509
507
|
class Div(BaseHTML):
|
|
510
508
|
@overload
|
|
@@ -750,7 +748,6 @@ class Div(BaseHTML):
|
|
|
750
748
|
Returns:
|
|
751
749
|
The component.
|
|
752
750
|
"""
|
|
753
|
-
...
|
|
754
751
|
|
|
755
752
|
class Dl(BaseHTML):
|
|
756
753
|
@overload
|
|
@@ -996,7 +993,6 @@ class Dl(BaseHTML):
|
|
|
996
993
|
Returns:
|
|
997
994
|
The component.
|
|
998
995
|
"""
|
|
999
|
-
...
|
|
1000
996
|
|
|
1001
997
|
class Dt(BaseHTML):
|
|
1002
998
|
@overload
|
|
@@ -1242,7 +1238,6 @@ class Dt(BaseHTML):
|
|
|
1242
1238
|
Returns:
|
|
1243
1239
|
The component.
|
|
1244
1240
|
"""
|
|
1245
|
-
...
|
|
1246
1241
|
|
|
1247
1242
|
class Figcaption(BaseHTML):
|
|
1248
1243
|
@overload
|
|
@@ -1488,7 +1483,6 @@ class Figcaption(BaseHTML):
|
|
|
1488
1483
|
Returns:
|
|
1489
1484
|
The component.
|
|
1490
1485
|
"""
|
|
1491
|
-
...
|
|
1492
1486
|
|
|
1493
1487
|
class Hr(BaseHTML):
|
|
1494
1488
|
@overload
|
|
@@ -1734,7 +1728,6 @@ class Hr(BaseHTML):
|
|
|
1734
1728
|
Returns:
|
|
1735
1729
|
The component.
|
|
1736
1730
|
"""
|
|
1737
|
-
...
|
|
1738
1731
|
|
|
1739
1732
|
class Li(BaseHTML):
|
|
1740
1733
|
@overload
|
|
@@ -1980,7 +1973,6 @@ class Li(BaseHTML):
|
|
|
1980
1973
|
Returns:
|
|
1981
1974
|
The component.
|
|
1982
1975
|
"""
|
|
1983
|
-
...
|
|
1984
1976
|
|
|
1985
1977
|
class Menu(BaseHTML):
|
|
1986
1978
|
@overload
|
|
@@ -2228,7 +2220,6 @@ class Menu(BaseHTML):
|
|
|
2228
2220
|
Returns:
|
|
2229
2221
|
The component.
|
|
2230
2222
|
"""
|
|
2231
|
-
...
|
|
2232
2223
|
|
|
2233
2224
|
class Ol(BaseHTML):
|
|
2234
2225
|
@overload
|
|
@@ -2482,7 +2473,6 @@ class Ol(BaseHTML):
|
|
|
2482
2473
|
Returns:
|
|
2483
2474
|
The component.
|
|
2484
2475
|
"""
|
|
2485
|
-
...
|
|
2486
2476
|
|
|
2487
2477
|
class P(BaseHTML):
|
|
2488
2478
|
@overload
|
|
@@ -2728,7 +2718,6 @@ class P(BaseHTML):
|
|
|
2728
2718
|
Returns:
|
|
2729
2719
|
The component.
|
|
2730
2720
|
"""
|
|
2731
|
-
...
|
|
2732
2721
|
|
|
2733
2722
|
class Pre(BaseHTML):
|
|
2734
2723
|
@overload
|
|
@@ -2974,7 +2963,6 @@ class Pre(BaseHTML):
|
|
|
2974
2963
|
Returns:
|
|
2975
2964
|
The component.
|
|
2976
2965
|
"""
|
|
2977
|
-
...
|
|
2978
2966
|
|
|
2979
2967
|
class Ul(BaseHTML):
|
|
2980
2968
|
@overload
|
|
@@ -3220,7 +3208,6 @@ class Ul(BaseHTML):
|
|
|
3220
3208
|
Returns:
|
|
3221
3209
|
The component.
|
|
3222
3210
|
"""
|
|
3223
|
-
...
|
|
3224
3211
|
|
|
3225
3212
|
class Ins(BaseHTML):
|
|
3226
3213
|
@overload
|
|
@@ -3470,7 +3457,6 @@ class Ins(BaseHTML):
|
|
|
3470
3457
|
Returns:
|
|
3471
3458
|
The component.
|
|
3472
3459
|
"""
|
|
3473
|
-
...
|
|
3474
3460
|
|
|
3475
3461
|
class Del(BaseHTML):
|
|
3476
3462
|
@overload
|
|
@@ -3720,7 +3706,6 @@ class Del(BaseHTML):
|
|
|
3720
3706
|
Returns:
|
|
3721
3707
|
The component.
|
|
3722
3708
|
"""
|
|
3723
|
-
...
|
|
3724
3709
|
|
|
3725
3710
|
blockquote = Blockquote.create
|
|
3726
3711
|
dd = Dd.create
|
|
@@ -67,36 +67,32 @@ class DataTable(Gridjs):
|
|
|
67
67
|
# The annotation should be provided if data is a computed var. We need this to know how to
|
|
68
68
|
# render pandas dataframes.
|
|
69
69
|
if is_computed_var(data) and data._var_type == Any:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
)
|
|
70
|
+
msg = "Annotation of the computed var assigned to the data field should be provided."
|
|
71
|
+
raise ValueError(msg)
|
|
73
72
|
|
|
74
73
|
if (
|
|
75
74
|
columns is not None
|
|
76
75
|
and is_computed_var(columns)
|
|
77
76
|
and columns._var_type == Any
|
|
78
77
|
):
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
)
|
|
78
|
+
msg = "Annotation of the computed var assigned to the column field should be provided."
|
|
79
|
+
raise ValueError(msg)
|
|
82
80
|
|
|
83
81
|
# If data is a pandas dataframe and columns are provided throw an error.
|
|
84
82
|
if (
|
|
85
83
|
types.is_dataframe(type(data))
|
|
86
84
|
or (isinstance(data, Var) and types.is_dataframe(data._var_type))
|
|
87
85
|
) and columns is not None:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
)
|
|
86
|
+
msg = "Cannot pass in both a pandas dataframe and columns to the data_table component."
|
|
87
|
+
raise ValueError(msg)
|
|
91
88
|
|
|
92
89
|
# If data is a list and columns are not provided, throw an error
|
|
93
90
|
if (
|
|
94
91
|
(isinstance(data, Var) and types.typehint_issubclass(data._var_type, list))
|
|
95
92
|
or isinstance(data, list)
|
|
96
93
|
) and columns is None:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
)
|
|
94
|
+
msg = "column field should be specified when the data field is a list type"
|
|
95
|
+
raise ValueError(msg)
|
|
100
96
|
|
|
101
97
|
# Create the component.
|
|
102
98
|
return super().create(
|
|
@@ -126,7 +122,8 @@ class DataTable(Gridjs):
|
|
|
126
122
|
# If given a pandas df break up the data and columns
|
|
127
123
|
data = serialize(self.data)
|
|
128
124
|
if not isinstance(data, dict):
|
|
129
|
-
|
|
125
|
+
msg = "Serialized dataframe should be a dict."
|
|
126
|
+
raise ValueError(msg)
|
|
130
127
|
self.columns = LiteralVar.create(data["columns"])
|
|
131
128
|
self.data = LiteralVar.create(data["data"])
|
|
132
129
|
|
|
@@ -62,7 +62,6 @@ class Gridjs(Component):
|
|
|
62
62
|
Returns:
|
|
63
63
|
The component.
|
|
64
64
|
"""
|
|
65
|
-
...
|
|
66
65
|
|
|
67
66
|
class DataTable(Gridjs):
|
|
68
67
|
@overload
|
|
@@ -129,6 +128,5 @@ class DataTable(Gridjs):
|
|
|
129
128
|
Raises:
|
|
130
129
|
ValueError: If a pandas dataframe is passed in and columns are also provided.
|
|
131
130
|
"""
|
|
132
|
-
...
|
|
133
131
|
|
|
134
132
|
def add_imports(self) -> ImportDict: ...
|
reflex/components/lucide/icon.py
CHANGED
|
@@ -42,27 +42,28 @@ class Icon(LucideIconComponent):
|
|
|
42
42
|
if len(children) == 1:
|
|
43
43
|
child = Var.create(children[0]).guess_type()
|
|
44
44
|
if not isinstance(child, StringVar):
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
)
|
|
45
|
+
msg = f"Icon name must be a string, got {children[0]._var_type if isinstance(children[0], Var) else children[0]}"
|
|
46
|
+
raise AttributeError(msg)
|
|
48
47
|
props["tag"] = children[0]
|
|
49
48
|
else:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
)
|
|
49
|
+
msg = f"Passing multiple children to Icon component is not allowed: remove positional arguments {children[1:]} to fix"
|
|
50
|
+
raise AttributeError(msg)
|
|
53
51
|
if "tag" not in props:
|
|
54
|
-
|
|
52
|
+
msg = "Missing 'tag' keyword-argument for Icon"
|
|
53
|
+
raise AttributeError(msg)
|
|
55
54
|
|
|
56
55
|
tag_var: Var | LiteralVar = Var.create(props.pop("tag"))
|
|
57
56
|
if isinstance(tag_var, LiteralVar):
|
|
58
57
|
if isinstance(tag_var, LiteralStringVar):
|
|
59
58
|
tag = format.to_snake_case(tag_var._var_value.lower())
|
|
60
59
|
else:
|
|
61
|
-
|
|
60
|
+
msg = f"Icon name must be a string, got {type(tag_var)}"
|
|
61
|
+
raise TypeError(msg)
|
|
62
62
|
elif isinstance(tag_var, Var):
|
|
63
63
|
tag_stringified = tag_var.guess_type()
|
|
64
64
|
if not isinstance(tag_stringified, StringVar):
|
|
65
|
-
|
|
65
|
+
msg = f"Icon name must be a string, got {tag_var._var_type}"
|
|
66
|
+
raise TypeError(msg)
|
|
66
67
|
return DynamicIcon.create(name=tag_stringified.replace("_", "-"), **props)
|
|
67
68
|
|
|
68
69
|
if tag not in LUCIDE_ICON_LIST:
|
|
@@ -61,7 +61,6 @@ class LucideIconComponent(Component):
|
|
|
61
61
|
Returns:
|
|
62
62
|
The component.
|
|
63
63
|
"""
|
|
64
|
-
...
|
|
65
64
|
|
|
66
65
|
class Icon(LucideIconComponent):
|
|
67
66
|
@overload
|
|
@@ -121,7 +120,6 @@ class Icon(LucideIconComponent):
|
|
|
121
120
|
Returns:
|
|
122
121
|
The created component.
|
|
123
122
|
"""
|
|
124
|
-
...
|
|
125
123
|
|
|
126
124
|
class DynamicIcon(LucideIconComponent):
|
|
127
125
|
@overload
|
|
@@ -174,7 +172,6 @@ class DynamicIcon(LucideIconComponent):
|
|
|
174
172
|
Returns:
|
|
175
173
|
The component.
|
|
176
174
|
"""
|
|
177
|
-
...
|
|
178
175
|
|
|
179
176
|
LUCIDE_ICON_LIST = [
|
|
180
177
|
"a_arrow_down",
|
|
@@ -170,9 +170,8 @@ class Markdown(Component):
|
|
|
170
170
|
The markdown component.
|
|
171
171
|
"""
|
|
172
172
|
if len(children) != 1 or not isinstance(children[0], (str, Var)):
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
)
|
|
173
|
+
msg = "Markdown component must have exactly one child containing the markdown source."
|
|
174
|
+
raise ValueError(msg)
|
|
176
175
|
|
|
177
176
|
# Update the base component map with the custom component map.
|
|
178
177
|
component_map = {**get_base_component_map(), **props.pop("component_map", {})}
|
|
@@ -319,7 +318,8 @@ let {_LANGUAGE!s} = match ? match[1] : '';
|
|
|
319
318
|
"""
|
|
320
319
|
# Check the tag is valid.
|
|
321
320
|
if tag not in self.component_map:
|
|
322
|
-
|
|
321
|
+
msg = f"No markdown component found for tag: {tag}."
|
|
322
|
+
raise ValueError(msg)
|
|
323
323
|
|
|
324
324
|
special_props = [_PROPS]
|
|
325
325
|
children = [
|
|
@@ -342,10 +342,9 @@ let {_LANGUAGE!s} = match ? match[1] : '';
|
|
|
342
342
|
if children_prop is not None:
|
|
343
343
|
children = []
|
|
344
344
|
# Get the component.
|
|
345
|
-
|
|
345
|
+
return self.component_map[tag](*children, **props).set(
|
|
346
346
|
special_props=special_props
|
|
347
347
|
)
|
|
348
|
-
return component
|
|
349
348
|
|
|
350
349
|
def format_component(self, tag: str, **props) -> str:
|
|
351
350
|
"""Format a component for rendering in the component map.
|
|
@@ -437,7 +436,7 @@ let {_LANGUAGE!s} = match ? match[1] : '';
|
|
|
437
436
|
"""
|
|
438
437
|
|
|
439
438
|
def _render(self) -> Tag:
|
|
440
|
-
|
|
439
|
+
return (
|
|
441
440
|
super()
|
|
442
441
|
._render()
|
|
443
442
|
.add_props(
|
|
@@ -447,4 +446,3 @@ let {_LANGUAGE!s} = match ? match[1] : '';
|
|
|
447
446
|
)
|
|
448
447
|
.remove_props("componentMap", "componentMapHash")
|
|
449
448
|
)
|
|
450
|
-
return tag
|
reflex/components/next/base.py
CHANGED
reflex/components/next/base.pyi
CHANGED
|
@@ -12,8 +12,6 @@ from reflex.event import EventType
|
|
|
12
12
|
from reflex.vars.base import Var
|
|
13
13
|
|
|
14
14
|
class NextComponent(Component):
|
|
15
|
-
...
|
|
16
|
-
|
|
17
15
|
@overload
|
|
18
16
|
@classmethod
|
|
19
17
|
def create( # type: ignore
|
|
@@ -63,4 +61,3 @@ class NextComponent(Component):
|
|
|
63
61
|
Returns:
|
|
64
62
|
The component.
|
|
65
63
|
"""
|
|
66
|
-
...
|
reflex/components/next/image.pyi
CHANGED
reflex/components/next/link.pyi
CHANGED
reflex/components/next/video.pyi
CHANGED
|
@@ -145,7 +145,6 @@ class Plotly(NoSSRComponent):
|
|
|
145
145
|
Returns:
|
|
146
146
|
The Plotly component.
|
|
147
147
|
"""
|
|
148
|
-
...
|
|
149
148
|
|
|
150
149
|
CREATE_PLOTLY_COMPONENT: ImportDict
|
|
151
150
|
|
|
@@ -250,7 +249,6 @@ class PlotlyBasic(Plotly):
|
|
|
250
249
|
Returns:
|
|
251
250
|
The Plotly component.
|
|
252
251
|
"""
|
|
253
|
-
...
|
|
254
252
|
|
|
255
253
|
class PlotlyCartesian(Plotly):
|
|
256
254
|
def add_imports(self) -> ImportDict | list[ImportDict]: ...
|
|
@@ -351,7 +349,6 @@ class PlotlyCartesian(Plotly):
|
|
|
351
349
|
Returns:
|
|
352
350
|
The Plotly component.
|
|
353
351
|
"""
|
|
354
|
-
...
|
|
355
352
|
|
|
356
353
|
class PlotlyGeo(Plotly):
|
|
357
354
|
def add_imports(self) -> ImportDict | list[ImportDict]: ...
|
|
@@ -452,7 +449,6 @@ class PlotlyGeo(Plotly):
|
|
|
452
449
|
Returns:
|
|
453
450
|
The Plotly component.
|
|
454
451
|
"""
|
|
455
|
-
...
|
|
456
452
|
|
|
457
453
|
class PlotlyGl3d(Plotly):
|
|
458
454
|
def add_imports(self) -> ImportDict | list[ImportDict]: ...
|
|
@@ -553,7 +549,6 @@ class PlotlyGl3d(Plotly):
|
|
|
553
549
|
Returns:
|
|
554
550
|
The Plotly component.
|
|
555
551
|
"""
|
|
556
|
-
...
|
|
557
552
|
|
|
558
553
|
class PlotlyGl2d(Plotly):
|
|
559
554
|
def add_imports(self) -> ImportDict | list[ImportDict]: ...
|
|
@@ -654,7 +649,6 @@ class PlotlyGl2d(Plotly):
|
|
|
654
649
|
Returns:
|
|
655
650
|
The Plotly component.
|
|
656
651
|
"""
|
|
657
|
-
...
|
|
658
652
|
|
|
659
653
|
class PlotlyMapbox(Plotly):
|
|
660
654
|
def add_imports(self) -> ImportDict | list[ImportDict]: ...
|
|
@@ -755,7 +749,6 @@ class PlotlyMapbox(Plotly):
|
|
|
755
749
|
Returns:
|
|
756
750
|
The Plotly component.
|
|
757
751
|
"""
|
|
758
|
-
...
|
|
759
752
|
|
|
760
753
|
class PlotlyFinance(Plotly):
|
|
761
754
|
def add_imports(self) -> ImportDict | list[ImportDict]: ...
|
|
@@ -856,7 +849,6 @@ class PlotlyFinance(Plotly):
|
|
|
856
849
|
Returns:
|
|
857
850
|
The Plotly component.
|
|
858
851
|
"""
|
|
859
|
-
...
|
|
860
852
|
|
|
861
853
|
class PlotlyStrict(Plotly):
|
|
862
854
|
def add_imports(self) -> ImportDict | list[ImportDict]: ...
|
|
@@ -957,4 +949,3 @@ class PlotlyStrict(Plotly):
|
|
|
957
949
|
Returns:
|
|
958
950
|
The Plotly component.
|
|
959
951
|
"""
|
|
960
|
-
...
|
reflex/components/props.py
CHANGED
|
@@ -31,6 +31,7 @@ class PropsBase(Base):
|
|
|
31
31
|
"""Convert the object to a dictionary.
|
|
32
32
|
|
|
33
33
|
Keys will be converted to camelCase.
|
|
34
|
+
By default, None values are excluded (exclude_none=True).
|
|
34
35
|
|
|
35
36
|
Args:
|
|
36
37
|
*args: Arguments to pass to the parent class.
|
|
@@ -39,6 +40,7 @@ class PropsBase(Base):
|
|
|
39
40
|
Returns:
|
|
40
41
|
The object as a dictionary.
|
|
41
42
|
"""
|
|
43
|
+
kwargs.setdefault("exclude_none", True)
|
|
42
44
|
return {
|
|
43
45
|
format.to_camel_case(key): value
|
|
44
46
|
for key, value in super().dict(*args, **kwargs).items()
|
|
@@ -64,9 +66,8 @@ class NoExtrasAllowedProps(Base):
|
|
|
64
66
|
except ValidationError as e:
|
|
65
67
|
invalid_fields = ", ".join([error["loc"][0] for error in e.errors()]) # pyright: ignore [reportCallIssue, reportArgumentType]
|
|
66
68
|
supported_props_str = ", ".join(f'"{field}"' for field in self.get_fields())
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
) from None
|
|
69
|
+
msg = f"Invalid prop(s) {invalid_fields} for {component_name!r}. Supported props are {supported_props_str}"
|
|
70
|
+
raise InvalidPropValueError(msg) from None
|
|
70
71
|
|
|
71
72
|
class Config: # pyright: ignore [reportIncompatibleVariableOverride]
|
|
72
73
|
"""Pydantic config."""
|
|
@@ -137,7 +137,6 @@ class AccordionComponent(RadixPrimitiveComponent):
|
|
|
137
137
|
Returns:
|
|
138
138
|
The component.
|
|
139
139
|
"""
|
|
140
|
-
...
|
|
141
140
|
|
|
142
141
|
def on_value_change(value: Var[str | list[str]]) -> tuple[Var[str | list[str]]]: ...
|
|
143
142
|
|
|
@@ -288,7 +287,6 @@ class AccordionRoot(AccordionComponent):
|
|
|
288
287
|
Returns:
|
|
289
288
|
The component.
|
|
290
289
|
"""
|
|
291
|
-
...
|
|
292
290
|
|
|
293
291
|
class AccordionItem(AccordionComponent):
|
|
294
292
|
@overload
|
|
@@ -414,7 +412,6 @@ class AccordionItem(AccordionComponent):
|
|
|
414
412
|
Returns:
|
|
415
413
|
The accordion item.
|
|
416
414
|
"""
|
|
417
|
-
...
|
|
418
415
|
|
|
419
416
|
def add_style(self) -> dict[str, Any] | None: ...
|
|
420
417
|
|
|
@@ -534,7 +531,6 @@ class AccordionHeader(AccordionComponent):
|
|
|
534
531
|
Returns:
|
|
535
532
|
The Accordion header Component.
|
|
536
533
|
"""
|
|
537
|
-
...
|
|
538
534
|
|
|
539
535
|
def add_style(self) -> dict[str, Any] | None: ...
|
|
540
536
|
|
|
@@ -654,7 +650,6 @@ class AccordionTrigger(AccordionComponent):
|
|
|
654
650
|
Returns:
|
|
655
651
|
The Accordion trigger Component.
|
|
656
652
|
"""
|
|
657
|
-
...
|
|
658
653
|
|
|
659
654
|
def add_style(self) -> dict[str, Any] | None: ...
|
|
660
655
|
|
|
@@ -710,7 +705,6 @@ class AccordionIcon(Icon):
|
|
|
710
705
|
Returns:
|
|
711
706
|
The Accordion icon Component.
|
|
712
707
|
"""
|
|
713
|
-
...
|
|
714
708
|
|
|
715
709
|
class AccordionContent(AccordionComponent):
|
|
716
710
|
def add_imports(self) -> dict: ...
|
|
@@ -829,7 +823,6 @@ class AccordionContent(AccordionComponent):
|
|
|
829
823
|
Returns:
|
|
830
824
|
The Accordion content Component.
|
|
831
825
|
"""
|
|
832
|
-
...
|
|
833
826
|
|
|
834
827
|
def add_custom_code(self) -> list[str]: ...
|
|
835
828
|
def add_style(self) -> dict[str, Any] | None: ...
|
|
@@ -21,8 +21,6 @@ class RadixPrimitiveComponentWithClassName(RadixPrimitiveComponent):
|
|
|
21
21
|
super()
|
|
22
22
|
._render()
|
|
23
23
|
.add_props(
|
|
24
|
-
|
|
25
|
-
"class_name": f"{format.to_title_case(self.tag or '')} {self.class_name or ''}",
|
|
26
|
-
}
|
|
24
|
+
class_name=f"{format.to_title_case(self.tag or '')} {self.class_name or ''}"
|
|
27
25
|
)
|
|
28
26
|
)
|
|
@@ -63,7 +63,6 @@ class RadixPrimitiveComponent(Component):
|
|
|
63
63
|
Returns:
|
|
64
64
|
The component.
|
|
65
65
|
"""
|
|
66
|
-
...
|
|
67
66
|
|
|
68
67
|
class RadixPrimitiveComponentWithClassName(RadixPrimitiveComponent):
|
|
69
68
|
@overload
|
|
@@ -117,4 +116,3 @@ class RadixPrimitiveComponentWithClassName(RadixPrimitiveComponent):
|
|
|
117
116
|
Returns:
|
|
118
117
|
The component.
|
|
119
118
|
"""
|
|
120
|
-
...
|
|
@@ -64,7 +64,6 @@ class DrawerComponent(RadixPrimitiveComponent):
|
|
|
64
64
|
Returns:
|
|
65
65
|
The component.
|
|
66
66
|
"""
|
|
67
|
-
...
|
|
68
67
|
|
|
69
68
|
LiteralDirectionType = Literal["top", "bottom", "left", "right"]
|
|
70
69
|
|
|
@@ -150,7 +149,6 @@ class DrawerRoot(DrawerComponent):
|
|
|
150
149
|
Returns:
|
|
151
150
|
The component.
|
|
152
151
|
"""
|
|
153
|
-
...
|
|
154
152
|
|
|
155
153
|
class DrawerTrigger(DrawerComponent):
|
|
156
154
|
@overload
|
|
@@ -204,7 +202,6 @@ class DrawerTrigger(DrawerComponent):
|
|
|
204
202
|
Returns:
|
|
205
203
|
The new DrawerTrigger instance.
|
|
206
204
|
"""
|
|
207
|
-
...
|
|
208
205
|
|
|
209
206
|
class DrawerPortal(DrawerComponent):
|
|
210
207
|
@overload
|
|
@@ -258,7 +255,6 @@ class DrawerPortal(DrawerComponent):
|
|
|
258
255
|
Returns:
|
|
259
256
|
The component.
|
|
260
257
|
"""
|
|
261
|
-
...
|
|
262
258
|
|
|
263
259
|
class DrawerContent(DrawerComponent):
|
|
264
260
|
@overload
|
|
@@ -321,7 +317,6 @@ class DrawerContent(DrawerComponent):
|
|
|
321
317
|
Returns:
|
|
322
318
|
The drawer content.
|
|
323
319
|
"""
|
|
324
|
-
...
|
|
325
320
|
|
|
326
321
|
class DrawerOverlay(DrawerComponent):
|
|
327
322
|
@overload
|
|
@@ -375,7 +370,6 @@ class DrawerOverlay(DrawerComponent):
|
|
|
375
370
|
Returns:
|
|
376
371
|
The component.
|
|
377
372
|
"""
|
|
378
|
-
...
|
|
379
373
|
|
|
380
374
|
class DrawerClose(DrawerTrigger):
|
|
381
375
|
@overload
|
|
@@ -429,7 +423,6 @@ class DrawerClose(DrawerTrigger):
|
|
|
429
423
|
Returns:
|
|
430
424
|
The new DrawerTrigger instance.
|
|
431
425
|
"""
|
|
432
|
-
...
|
|
433
426
|
|
|
434
427
|
class DrawerTitle(DrawerComponent):
|
|
435
428
|
@overload
|
|
@@ -483,7 +476,6 @@ class DrawerTitle(DrawerComponent):
|
|
|
483
476
|
Returns:
|
|
484
477
|
The component.
|
|
485
478
|
"""
|
|
486
|
-
...
|
|
487
479
|
|
|
488
480
|
class DrawerDescription(DrawerComponent):
|
|
489
481
|
@overload
|
|
@@ -537,7 +529,6 @@ class DrawerDescription(DrawerComponent):
|
|
|
537
529
|
Returns:
|
|
538
530
|
The component.
|
|
539
531
|
"""
|
|
540
|
-
...
|
|
541
532
|
|
|
542
533
|
class DrawerHandle(DrawerComponent):
|
|
543
534
|
@overload
|
|
@@ -591,7 +582,6 @@ class DrawerHandle(DrawerComponent):
|
|
|
591
582
|
Returns:
|
|
592
583
|
The component.
|
|
593
584
|
"""
|
|
594
|
-
...
|
|
595
585
|
|
|
596
586
|
class Drawer(ComponentNamespace):
|
|
597
587
|
root = staticmethod(DrawerRoot.create)
|
|
@@ -683,6 +673,5 @@ class Drawer(ComponentNamespace):
|
|
|
683
673
|
Returns:
|
|
684
674
|
The component.
|
|
685
675
|
"""
|
|
686
|
-
...
|
|
687
676
|
|
|
688
677
|
drawer = Drawer()
|