reflex 0.5.9.dev1__py3-none-any.whl → 0.5.10__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/web/utils/client_side_routing.js +6 -1
- reflex/__init__.py +21 -2
- reflex/__init__.pyi +0 -1
- reflex/app.py +1 -1
- reflex/components/__init__.py +0 -1
- reflex/components/__init__.pyi +0 -1
- reflex/components/markdown/markdown.py +1 -1
- reflex/components/recharts/cartesian.py +3 -0
- reflex/components/recharts/cartesian.pyi +2 -0
- reflex/components/sonner/toast.py +27 -1
- reflex/components/sonner/toast.pyi +5 -0
- reflex/constants/base.py +2 -0
- reflex/constants/installer.py +2 -0
- reflex/experimental/hooks.py +1 -1
- reflex/reflex.py +0 -15
- reflex/state.py +22 -22
- reflex/testing.py +8 -3
- reflex/utils/net.py +43 -0
- reflex/utils/prerequisites.py +27 -126
- reflex/utils/registry.py +48 -0
- reflex/utils/types.py +1 -1
- reflex/vars.py +4 -2
- {reflex-0.5.9.dev1.dist-info → reflex-0.5.10.dist-info}/METADATA +2 -1
- {reflex-0.5.9.dev1.dist-info → reflex-0.5.10.dist-info}/RECORD +27 -168
- reflex/components/chakra/__init__.py +0 -204
- reflex/components/chakra/base.py +0 -210
- reflex/components/chakra/base.pyi +0 -319
- reflex/components/chakra/datadisplay/__init__.py +0 -10
- reflex/components/chakra/datadisplay/badge.py +0 -16
- reflex/components/chakra/datadisplay/badge.pyi +0 -96
- reflex/components/chakra/datadisplay/code.py +0 -11
- reflex/components/chakra/datadisplay/code.pyi +0 -87
- reflex/components/chakra/datadisplay/divider.py +0 -20
- reflex/components/chakra/datadisplay/divider.pyi +0 -100
- reflex/components/chakra/datadisplay/keyboard_key.py +0 -9
- reflex/components/chakra/datadisplay/keyboard_key.pyi +0 -87
- reflex/components/chakra/datadisplay/list.py +0 -60
- reflex/components/chakra/datadisplay/list.pyi +0 -339
- reflex/components/chakra/datadisplay/stat.py +0 -80
- reflex/components/chakra/datadisplay/stat.pyi +0 -477
- reflex/components/chakra/datadisplay/table.py +0 -305
- reflex/components/chakra/datadisplay/table.pyi +0 -737
- reflex/components/chakra/datadisplay/tag.py +0 -85
- reflex/components/chakra/datadisplay/tag.pyi +0 -433
- reflex/components/chakra/disclosure/__init__.py +0 -14
- reflex/components/chakra/disclosure/accordion.py +0 -110
- reflex/components/chakra/disclosure/accordion.pyi +0 -411
- reflex/components/chakra/disclosure/tabs.py +0 -117
- reflex/components/chakra/disclosure/tabs.pyi +0 -496
- reflex/components/chakra/disclosure/transition.py +0 -73
- reflex/components/chakra/disclosure/transition.pyi +0 -509
- reflex/components/chakra/disclosure/visuallyhidden.py +0 -9
- reflex/components/chakra/disclosure/visuallyhidden.pyi +0 -87
- reflex/components/chakra/feedback/__init__.py +0 -7
- reflex/components/chakra/feedback/alert.py +0 -68
- reflex/components/chakra/feedback/alert.pyi +0 -335
- reflex/components/chakra/feedback/circularprogress.py +0 -68
- reflex/components/chakra/feedback/circularprogress.pyi +0 -185
- reflex/components/chakra/feedback/progress.py +0 -33
- reflex/components/chakra/feedback/progress.pyi +0 -101
- reflex/components/chakra/feedback/skeleton.py +0 -70
- reflex/components/chakra/feedback/skeleton.pyi +0 -271
- reflex/components/chakra/feedback/spinner.py +0 -25
- reflex/components/chakra/feedback/spinner.pyi +0 -102
- reflex/components/chakra/forms/__init__.py +0 -49
- reflex/components/chakra/forms/button.py +0 -83
- reflex/components/chakra/forms/button.pyi +0 -262
- reflex/components/chakra/forms/checkbox.py +0 -77
- reflex/components/chakra/forms/checkbox.pyi +0 -247
- reflex/components/chakra/forms/colormodeswitch.py +0 -104
- reflex/components/chakra/forms/colormodeswitch.pyi +0 -473
- reflex/components/chakra/forms/date_picker.py +0 -11
- reflex/components/chakra/forms/date_picker.pyi +0 -129
- reflex/components/chakra/forms/date_time_picker.py +0 -11
- reflex/components/chakra/forms/date_time_picker.pyi +0 -129
- reflex/components/chakra/forms/editable.py +0 -67
- reflex/components/chakra/forms/editable.pyi +0 -343
- reflex/components/chakra/forms/email.py +0 -11
- reflex/components/chakra/forms/email.pyi +0 -129
- reflex/components/chakra/forms/form.py +0 -103
- reflex/components/chakra/forms/form.pyi +0 -484
- reflex/components/chakra/forms/iconbutton.py +0 -38
- reflex/components/chakra/forms/iconbutton.pyi +0 -108
- reflex/components/chakra/forms/input.py +0 -130
- reflex/components/chakra/forms/input.pyi +0 -566
- reflex/components/chakra/forms/multiselect.py +0 -355
- reflex/components/chakra/forms/numberinput.py +0 -128
- reflex/components/chakra/forms/numberinput.pyi +0 -442
- reflex/components/chakra/forms/password.py +0 -11
- reflex/components/chakra/forms/password.pyi +0 -129
- reflex/components/chakra/forms/pininput.py +0 -201
- reflex/components/chakra/forms/pininput.pyi +0 -215
- reflex/components/chakra/forms/radio.py +0 -101
- reflex/components/chakra/forms/radio.pyi +0 -197
- reflex/components/chakra/forms/rangeslider.py +0 -149
- reflex/components/chakra/forms/rangeslider.pyi +0 -354
- reflex/components/chakra/forms/select.py +0 -103
- reflex/components/chakra/forms/select.pyi +0 -204
- reflex/components/chakra/forms/slider.py +0 -130
- reflex/components/chakra/forms/slider.pyi +0 -449
- reflex/components/chakra/forms/switch.py +0 -49
- reflex/components/chakra/forms/switch.pyi +0 -159
- reflex/components/chakra/forms/textarea.py +0 -79
- reflex/components/chakra/forms/textarea.pyi +0 -123
- reflex/components/chakra/forms/time_picker.py +0 -11
- reflex/components/chakra/forms/time_picker.pyi +0 -129
- reflex/components/chakra/layout/__init__.py +0 -14
- reflex/components/chakra/layout/aspect_ratio.py +0 -13
- reflex/components/chakra/layout/aspect_ratio.pyi +0 -89
- reflex/components/chakra/layout/box.py +0 -31
- reflex/components/chakra/layout/box.pyi +0 -93
- reflex/components/chakra/layout/card.py +0 -100
- reflex/components/chakra/layout/card.pyi +0 -379
- reflex/components/chakra/layout/center.py +0 -21
- reflex/components/chakra/layout/center.pyi +0 -239
- reflex/components/chakra/layout/container.py +0 -13
- reflex/components/chakra/layout/container.pyi +0 -89
- reflex/components/chakra/layout/flex.py +0 -33
- reflex/components/chakra/layout/flex.pyi +0 -101
- reflex/components/chakra/layout/grid.py +0 -125
- reflex/components/chakra/layout/grid.pyi +0 -293
- reflex/components/chakra/layout/spacer.py +0 -9
- reflex/components/chakra/layout/spacer.pyi +0 -87
- reflex/components/chakra/layout/stack.py +0 -48
- reflex/components/chakra/layout/stack.pyi +0 -305
- reflex/components/chakra/layout/wrap.py +0 -57
- reflex/components/chakra/layout/wrap.pyi +0 -179
- reflex/components/chakra/media/__init__.py +0 -7
- reflex/components/chakra/media/avatar.py +0 -58
- reflex/components/chakra/media/avatar.pyi +0 -267
- reflex/components/chakra/media/icon.py +0 -111
- reflex/components/chakra/media/icon.pyi +0 -171
- reflex/components/chakra/media/image.py +0 -74
- reflex/components/chakra/media/image.pyi +0 -118
- reflex/components/chakra/navigation/__init__.py +0 -18
- reflex/components/chakra/navigation/breadcrumb.py +0 -98
- reflex/components/chakra/navigation/breadcrumb.pyi +0 -351
- reflex/components/chakra/navigation/link.py +0 -62
- reflex/components/chakra/navigation/link.pyi +0 -105
- reflex/components/chakra/navigation/linkoverlay.py +0 -22
- reflex/components/chakra/navigation/linkoverlay.pyi +0 -167
- reflex/components/chakra/navigation/stepper.py +0 -113
- reflex/components/chakra/navigation/stepper.pyi +0 -762
- reflex/components/chakra/overlay/__init__.py +0 -50
- reflex/components/chakra/overlay/alertdialog.py +0 -153
- reflex/components/chakra/overlay/alertdialog.pyi +0 -612
- reflex/components/chakra/overlay/drawer.py +0 -168
- reflex/components/chakra/overlay/drawer.pyi +0 -652
- reflex/components/chakra/overlay/menu.py +0 -225
- reflex/components/chakra/overlay/menu.pyi +0 -708
- reflex/components/chakra/overlay/modal.py +0 -166
- reflex/components/chakra/overlay/modal.pyi +0 -600
- reflex/components/chakra/overlay/popover.py +0 -183
- reflex/components/chakra/overlay/popover.pyi +0 -757
- reflex/components/chakra/overlay/tooltip.py +0 -70
- reflex/components/chakra/overlay/tooltip.pyi +0 -129
- reflex/components/chakra/typography/__init__.py +0 -10
- reflex/components/chakra/typography/heading.py +0 -16
- reflex/components/chakra/typography/heading.pyi +0 -96
- reflex/components/chakra/typography/highlight.py +0 -23
- reflex/components/chakra/typography/highlight.pyi +0 -91
- reflex/components/chakra/typography/span.py +0 -15
- reflex/components/chakra/typography/span.pyi +0 -89
- reflex/components/chakra/typography/text.py +0 -18
- reflex/components/chakra/typography/text.pyi +0 -91
- reflex/components/media/__init__.py +0 -1
- reflex/components/media/icon.py +0 -3
- {reflex-0.5.9.dev1.dist-info → reflex-0.5.10.dist-info}/LICENSE +0 -0
- {reflex-0.5.9.dev1.dist-info → reflex-0.5.10.dist-info}/WHEEL +0 -0
- {reflex-0.5.9.dev1.dist-info → reflex-0.5.10.dist-info}/entry_points.txt +0 -0
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
"""Menu components."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from typing import List, Optional
|
|
6
|
-
|
|
7
|
-
from reflex.components.chakra import (
|
|
8
|
-
ChakraComponent,
|
|
9
|
-
LiteralChakraDirection,
|
|
10
|
-
LiteralMenuOption,
|
|
11
|
-
LiteralMenuStrategy,
|
|
12
|
-
)
|
|
13
|
-
from reflex.components.chakra.forms.button import Button
|
|
14
|
-
from reflex.components.component import Component
|
|
15
|
-
from reflex.event import EventHandler
|
|
16
|
-
from reflex.vars import Var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class Menu(ChakraComponent):
|
|
20
|
-
"""The wrapper component provides context, state, and focus management."""
|
|
21
|
-
|
|
22
|
-
tag = "Menu"
|
|
23
|
-
|
|
24
|
-
# The padding required to prevent the arrow from reaching the very edge of the popper.
|
|
25
|
-
arrow_padding: Var[int]
|
|
26
|
-
|
|
27
|
-
# If true, the first enabled menu item will receive focus and be selected when the menu opens.
|
|
28
|
-
auto_select: Var[bool]
|
|
29
|
-
|
|
30
|
-
# The boundary area for the popper. Used within the preventOverflow modifier
|
|
31
|
-
boundary: Var[str]
|
|
32
|
-
|
|
33
|
-
# If true, the menu will close when you click outside the menu list
|
|
34
|
-
close_on_blur: Var[bool]
|
|
35
|
-
|
|
36
|
-
# If true, the menu will close when a menu item is clicked
|
|
37
|
-
close_on_select: Var[bool]
|
|
38
|
-
|
|
39
|
-
# If by default the menu is open.
|
|
40
|
-
default_is_open: Var[bool]
|
|
41
|
-
|
|
42
|
-
# If rtl, popper placement positions will be flipped i.e. 'top-right' will become 'top-left' and vice-verse ("ltr" | "rtl")
|
|
43
|
-
direction: Var[LiteralChakraDirection]
|
|
44
|
-
|
|
45
|
-
# If true, the popper will change its placement and flip when it's about to overflow its boundary area.
|
|
46
|
-
flip: Var[bool]
|
|
47
|
-
|
|
48
|
-
# The distance or margin between the reference and popper. It is used internally to create an offset modifier. NB: If you define offset prop, it'll override the gutter.
|
|
49
|
-
gutter: Var[int]
|
|
50
|
-
|
|
51
|
-
# Performance 🚀: If true, the MenuItem rendering will be deferred until the menu is open.
|
|
52
|
-
is_lazy: Var[bool]
|
|
53
|
-
|
|
54
|
-
# Performance 🚀: The lazy behavior of menu's content when not visible. Only works when `isLazy={true}` - "unmount": The menu's content is always unmounted when not open. - "keepMounted": The menu's content initially unmounted, but stays mounted when menu is open.
|
|
55
|
-
lazy_behavior: Var[str]
|
|
56
|
-
|
|
57
|
-
# Determines if the menu is open or not.
|
|
58
|
-
is_open: Var[bool]
|
|
59
|
-
|
|
60
|
-
# If true, the popper will match the width of the reference at all times. It's useful for autocomplete, `date-picker` and select patterns.
|
|
61
|
-
match_width: Var[bool]
|
|
62
|
-
|
|
63
|
-
# The placement of the popper relative to its reference.
|
|
64
|
-
placement: Var[str]
|
|
65
|
-
|
|
66
|
-
# If true, will prevent the popper from being cut off and ensure it's visible within the boundary area.
|
|
67
|
-
prevent_overflow: Var[bool]
|
|
68
|
-
|
|
69
|
-
# The CSS positioning strategy to use. ("fixed" | "absolute")
|
|
70
|
-
strategy: Var[LiteralMenuStrategy]
|
|
71
|
-
|
|
72
|
-
# Fired when the menu is closed.
|
|
73
|
-
on_close: EventHandler[lambda: []]
|
|
74
|
-
|
|
75
|
-
# Fired when the menu is opened.
|
|
76
|
-
on_open: EventHandler[lambda: []]
|
|
77
|
-
|
|
78
|
-
@classmethod
|
|
79
|
-
def create(
|
|
80
|
-
cls,
|
|
81
|
-
*children,
|
|
82
|
-
button: Optional[Component] = None,
|
|
83
|
-
items: Optional[List] = None,
|
|
84
|
-
**props,
|
|
85
|
-
) -> Component:
|
|
86
|
-
"""Create a menu component.
|
|
87
|
-
|
|
88
|
-
Args:
|
|
89
|
-
*children: The children of the component.
|
|
90
|
-
button: the button that open the menu.
|
|
91
|
-
items (list): The items of the menu.
|
|
92
|
-
**props: The properties of the component.
|
|
93
|
-
|
|
94
|
-
Returns:
|
|
95
|
-
The menu component.
|
|
96
|
-
"""
|
|
97
|
-
if len(children) == 0:
|
|
98
|
-
children = []
|
|
99
|
-
|
|
100
|
-
if button:
|
|
101
|
-
if not isinstance(button, (MenuButton, Button)):
|
|
102
|
-
children.append(MenuButton.create(button))
|
|
103
|
-
else:
|
|
104
|
-
children.append(button)
|
|
105
|
-
if not items:
|
|
106
|
-
items = []
|
|
107
|
-
children.append(MenuList.create(items=items))
|
|
108
|
-
return super().create(*children, **props)
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
class MenuButton(ChakraComponent):
|
|
112
|
-
"""The trigger for the menu list. Must be a direct child of Menu."""
|
|
113
|
-
|
|
114
|
-
tag = "MenuButton"
|
|
115
|
-
|
|
116
|
-
# The variant of the menu button.
|
|
117
|
-
variant: Var[str]
|
|
118
|
-
|
|
119
|
-
# Components that are not allowed as children.
|
|
120
|
-
_invalid_children: List[str] = ["Button", "MenuButton"]
|
|
121
|
-
|
|
122
|
-
# The tag to use for the menu button.
|
|
123
|
-
as_: Var[str]
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
class MenuList(ChakraComponent):
|
|
127
|
-
"""The wrapper for the menu items. Must be a direct child of Menu."""
|
|
128
|
-
|
|
129
|
-
tag = "MenuList"
|
|
130
|
-
|
|
131
|
-
@classmethod
|
|
132
|
-
def create(cls, *children, items: Optional[list] = None, **props) -> Component:
|
|
133
|
-
"""Create a MenuList component, and automatically wrap in MenuItem if not already one.
|
|
134
|
-
|
|
135
|
-
Args:
|
|
136
|
-
*children: The children of the component.
|
|
137
|
-
items: A list of item to add as child of the component.
|
|
138
|
-
**props: The properties of the component.
|
|
139
|
-
|
|
140
|
-
Returns:
|
|
141
|
-
The MenuList component.
|
|
142
|
-
"""
|
|
143
|
-
if len(children) == 0:
|
|
144
|
-
if items is None:
|
|
145
|
-
items = []
|
|
146
|
-
children = [
|
|
147
|
-
child if isinstance(child, MenuItem) else MenuItem.create(child)
|
|
148
|
-
for child in items
|
|
149
|
-
]
|
|
150
|
-
return super().create(*children, **props)
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
class MenuItem(ChakraComponent):
|
|
154
|
-
"""The trigger that handles menu selection. Must be a direct child of a MenuList."""
|
|
155
|
-
|
|
156
|
-
tag = "MenuItem"
|
|
157
|
-
|
|
158
|
-
# Overrides the parent menu's closeOnSelect prop.
|
|
159
|
-
close_on_select: Var[bool]
|
|
160
|
-
|
|
161
|
-
# Right-aligned label text content, useful for displaying hotkeys.
|
|
162
|
-
command: Var[str]
|
|
163
|
-
|
|
164
|
-
# The spacing between the command and menu item's label.
|
|
165
|
-
command_spacing: Var[int]
|
|
166
|
-
|
|
167
|
-
# If true, the menuitem will be disabled.
|
|
168
|
-
is_disabled: Var[bool]
|
|
169
|
-
|
|
170
|
-
# If true and the menuitem is disabled, it'll remain keyboard-focusable
|
|
171
|
-
is_focusable: Var[bool]
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
class MenuItemOption(ChakraComponent):
|
|
175
|
-
"""The checkable menu item, to be used with MenuOptionGroup."""
|
|
176
|
-
|
|
177
|
-
tag = "MenuItemOption"
|
|
178
|
-
|
|
179
|
-
# Overrides the parent menu's closeOnSelect prop.
|
|
180
|
-
close_on_select: Var[bool]
|
|
181
|
-
|
|
182
|
-
# Right-aligned label text content, useful for displaying hotkeys.
|
|
183
|
-
command: Var[str]
|
|
184
|
-
|
|
185
|
-
# The spacing between the command and menu item's label.
|
|
186
|
-
command_spacing: Var[int]
|
|
187
|
-
|
|
188
|
-
# Determines if menu item is checked.
|
|
189
|
-
is_checked: Var[bool]
|
|
190
|
-
|
|
191
|
-
# If true, the menuitem will be disabled.
|
|
192
|
-
is_disabled: Var[bool]
|
|
193
|
-
|
|
194
|
-
# If true and the menuitem is disabled, it'll remain keyboard-focusable
|
|
195
|
-
is_focusable: Var[bool]
|
|
196
|
-
|
|
197
|
-
# "checkbox" | "radio"
|
|
198
|
-
type_: Var[LiteralMenuOption]
|
|
199
|
-
|
|
200
|
-
# Value of the menu item.
|
|
201
|
-
value: Var[str]
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
class MenuGroup(ChakraComponent):
|
|
205
|
-
"""A wrapper to group related menu items."""
|
|
206
|
-
|
|
207
|
-
tag = "MenuGroup"
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
class MenuOptionGroup(ChakraComponent):
|
|
211
|
-
"""A wrapper for checkable menu items (radio and checkbox)."""
|
|
212
|
-
|
|
213
|
-
tag = "MenuOptionGroup"
|
|
214
|
-
|
|
215
|
-
# "checkbox" | "radio"
|
|
216
|
-
type_: Var[LiteralMenuOption]
|
|
217
|
-
|
|
218
|
-
# Value of the option group.
|
|
219
|
-
value: Var[str]
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
class MenuDivider(ChakraComponent):
|
|
223
|
-
"""A visual separator for menu items and groups."""
|
|
224
|
-
|
|
225
|
-
tag = "MenuDivider"
|