reflex 0.3.9a2__py3-none-any.whl → 0.3.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/__init__.py +3 -1
- reflex/__init__.pyi +3 -1
- reflex/app.py +13 -5
- reflex/compiler/utils.py +13 -12
- reflex/components/base/app_wrap.pyi +1 -0
- reflex/components/base/body.pyi +2 -0
- reflex/components/base/document.pyi +10 -0
- reflex/components/base/fragment.pyi +2 -0
- reflex/components/base/head.pyi +4 -0
- reflex/components/base/link.pyi +4 -0
- reflex/components/base/meta.pyi +8 -0
- reflex/components/base/script.pyi +2 -0
- reflex/components/chakra/base.pyi +7 -0
- reflex/components/chakra/datadisplay/badge.pyi +2 -0
- reflex/components/chakra/datadisplay/code.pyi +4 -0
- reflex/components/chakra/datadisplay/divider.pyi +2 -0
- reflex/components/chakra/datadisplay/keyboard_key.pyi +2 -0
- reflex/components/chakra/datadisplay/list.pyi +8 -0
- reflex/components/chakra/datadisplay/stat.pyi +12 -0
- reflex/components/chakra/datadisplay/table.pyi +18 -0
- reflex/components/chakra/datadisplay/tag.pyi +9 -0
- reflex/components/chakra/disclosure/accordion.pyi +10 -0
- reflex/components/chakra/disclosure/tabs.py +8 -0
- reflex/components/chakra/disclosure/tabs.pyi +10 -0
- reflex/components/chakra/disclosure/transition.pyi +12 -0
- reflex/components/chakra/disclosure/visuallyhidden.pyi +2 -0
- reflex/components/chakra/feedback/alert.pyi +8 -0
- reflex/components/chakra/feedback/circularprogress.pyi +4 -0
- reflex/components/chakra/feedback/progress.pyi +2 -0
- reflex/components/chakra/feedback/skeleton.pyi +6 -0
- reflex/components/chakra/feedback/spinner.pyi +2 -0
- reflex/components/chakra/forms/button.pyi +4 -0
- reflex/components/chakra/forms/checkbox.pyi +4 -0
- reflex/components/chakra/forms/colormodeswitch.pyi +7 -0
- reflex/components/chakra/forms/date_picker.pyi +2 -0
- reflex/components/chakra/forms/date_time_picker.pyi +2 -0
- reflex/components/chakra/forms/editable.pyi +8 -0
- reflex/components/chakra/forms/email.pyi +2 -0
- reflex/components/chakra/forms/form.pyi +10 -0
- reflex/components/chakra/forms/iconbutton.py +1 -0
- reflex/components/chakra/forms/iconbutton.pyi +2 -0
- reflex/components/chakra/forms/input.pyi +12 -0
- reflex/components/chakra/forms/numberinput.pyi +10 -0
- reflex/components/chakra/forms/password.pyi +2 -0
- reflex/components/chakra/forms/pininput.pyi +4 -0
- reflex/components/chakra/forms/radio.pyi +4 -0
- reflex/components/chakra/forms/rangeslider.pyi +8 -0
- reflex/components/chakra/forms/select.pyi +4 -0
- reflex/components/chakra/forms/slider.pyi +10 -0
- reflex/components/chakra/forms/switch.pyi +2 -0
- reflex/components/chakra/forms/textarea.pyi +2 -0
- reflex/components/chakra/forms/time_picker.pyi +2 -0
- reflex/components/chakra/layout/aspect_ratio.pyi +2 -0
- reflex/components/chakra/layout/box.pyi +2 -0
- reflex/components/chakra/layout/card.pyi +7 -0
- reflex/components/chakra/layout/center.pyi +6 -0
- reflex/components/chakra/layout/container.pyi +2 -0
- reflex/components/chakra/layout/flex.pyi +2 -0
- reflex/components/chakra/layout/grid.pyi +6 -0
- reflex/components/chakra/layout/html.pyi +2 -0
- reflex/components/chakra/layout/spacer.pyi +2 -0
- reflex/components/chakra/layout/stack.pyi +6 -0
- reflex/components/chakra/layout/wrap.pyi +4 -0
- reflex/components/chakra/media/avatar.pyi +6 -0
- reflex/components/chakra/media/icon.pyi +4 -0
- reflex/components/chakra/media/image.pyi +2 -0
- reflex/components/chakra/navigation/breadcrumb.pyi +8 -0
- reflex/components/chakra/navigation/link.pyi +2 -0
- reflex/components/chakra/navigation/linkoverlay.pyi +4 -0
- reflex/components/chakra/navigation/stepper.pyi +18 -0
- reflex/components/chakra/overlay/alertdialog.pyi +14 -0
- reflex/components/chakra/overlay/drawer.pyi +14 -0
- reflex/components/chakra/overlay/menu.pyi +16 -0
- reflex/components/chakra/overlay/modal.pyi +14 -0
- reflex/components/chakra/overlay/popover.pyi +18 -0
- reflex/components/chakra/overlay/tooltip.pyi +2 -0
- reflex/components/chakra/typography/heading.pyi +2 -0
- reflex/components/chakra/typography/highlight.pyi +2 -0
- reflex/components/chakra/typography/span.pyi +2 -0
- reflex/components/chakra/typography/text.pyi +2 -0
- reflex/components/component.py +41 -3
- reflex/components/core/__init__.py +2 -0
- reflex/components/core/banner.pyi +3 -0
- reflex/components/core/client_side_routing.pyi +4 -0
- reflex/components/core/colors.py +21 -0
- reflex/components/core/cond.py +11 -2
- reflex/components/core/debounce.pyi +1 -0
- reflex/components/core/layout/__init__.py +1 -0
- reflex/components/core/match.py +44 -18
- reflex/components/core/upload.py +8 -2
- reflex/components/core/upload.pyi +7 -1
- reflex/components/datadisplay/dataeditor.pyi +2 -0
- reflex/components/el/element.pyi +2 -0
- reflex/components/el/elements/base.pyi +2 -0
- reflex/components/el/elements/forms.py +3 -0
- reflex/components/el/elements/forms.pyi +32 -0
- reflex/components/el/elements/inline.pyi +56 -0
- reflex/components/el/elements/media.pyi +28 -0
- reflex/components/el/elements/metadata.pyi +10 -0
- reflex/components/el/elements/other.pyi +14 -0
- reflex/components/el/elements/scripts.pyi +6 -0
- reflex/components/el/elements/sectioning.pyi +30 -0
- reflex/components/el/elements/tables.pyi +20 -0
- reflex/components/el/elements/typography.pyi +30 -0
- reflex/components/gridjs/datatable.pyi +4 -0
- reflex/components/lucide/__init__.py +5 -0
- reflex/components/lucide/icon.py +1484 -0
- reflex/components/lucide/icon.pyi +1594 -0
- reflex/components/markdown/markdown.pyi +2 -0
- reflex/components/moment/moment.pyi +2 -0
- reflex/components/next/base.pyi +2 -0
- reflex/components/next/image.pyi +2 -0
- reflex/components/next/link.pyi +2 -0
- reflex/components/next/video.pyi +2 -0
- reflex/components/plotly/plotly.pyi +4 -0
- reflex/components/radix/primitives/__init__.py +10 -0
- reflex/components/radix/primitives/accordion.py +51 -32
- reflex/components/radix/primitives/accordion.pyi +16 -3
- reflex/components/radix/primitives/base.pyi +4 -0
- reflex/components/radix/primitives/drawer.py +240 -0
- reflex/components/radix/primitives/drawer.pyi +814 -0
- reflex/components/radix/primitives/form.py +40 -7
- reflex/components/radix/primitives/form.pyi +32 -10
- reflex/components/radix/primitives/progress.py +2 -2
- reflex/components/radix/primitives/progress.pyi +6 -0
- reflex/components/radix/primitives/slider.pyi +10 -0
- reflex/components/radix/themes/base.py +46 -12
- reflex/components/radix/themes/base.pyi +23 -9
- reflex/components/radix/themes/components/__init__.py +4 -2
- reflex/components/radix/themes/components/alertdialog.py +13 -12
- reflex/components/radix/themes/components/alertdialog.pyi +23 -351
- reflex/components/radix/themes/components/aspectratio.py +2 -5
- reflex/components/radix/themes/components/aspectratio.pyi +4 -51
- reflex/components/radix/themes/components/avatar.py +3 -4
- reflex/components/radix/themes/components/avatar.pyi +4 -57
- reflex/components/radix/themes/components/badge.py +3 -4
- reflex/components/radix/themes/components/badge.pyi +4 -56
- reflex/components/radix/themes/components/button.py +2 -3
- reflex/components/radix/themes/components/button.pyi +3 -51
- reflex/components/radix/themes/components/callout.py +9 -12
- reflex/components/radix/themes/components/callout.pyi +24 -217
- reflex/components/radix/themes/components/card.py +1 -2
- reflex/components/radix/themes/components/card.pyi +4 -51
- reflex/components/radix/themes/components/checkbox.py +11 -5
- reflex/components/radix/themes/components/checkbox.pyi +13 -112
- reflex/components/radix/themes/components/contextmenu.py +21 -21
- reflex/components/radix/themes/components/contextmenu.pyi +26 -401
- reflex/components/radix/themes/components/dialog.py +13 -16
- reflex/components/radix/themes/components/dialog.pyi +20 -303
- reflex/components/radix/themes/components/dropdownmenu.py +196 -32
- reflex/components/radix/themes/components/dropdownmenu.pyi +147 -389
- reflex/components/radix/themes/components/hovercard.py +5 -5
- reflex/components/radix/themes/components/hovercard.pyi +11 -151
- reflex/components/radix/themes/components/iconbutton.py +56 -4
- reflex/components/radix/themes/components/iconbutton.pyi +25 -71
- reflex/components/radix/themes/components/icons.pyi +4 -0
- reflex/components/radix/themes/components/inset.py +1 -2
- reflex/components/radix/themes/components/inset.pyi +4 -51
- reflex/components/radix/themes/components/popover.py +12 -12
- reflex/components/radix/themes/components/popover.pyi +14 -201
- reflex/components/radix/themes/components/radiogroup.py +47 -20
- reflex/components/radix/themes/components/radiogroup.pyi +26 -171
- reflex/components/radix/themes/components/scrollarea.py +2 -3
- reflex/components/radix/themes/components/scrollarea.pyi +4 -51
- reflex/components/radix/themes/components/select.py +28 -25
- reflex/components/radix/themes/components/select.pyi +43 -419
- reflex/components/radix/themes/components/separator.py +4 -5
- reflex/components/radix/themes/components/separator.pyi +5 -52
- reflex/components/radix/themes/components/slider.py +8 -5
- reflex/components/radix/themes/components/slider.pyi +9 -60
- reflex/components/radix/themes/components/switch.py +6 -4
- reflex/components/radix/themes/components/switch.pyi +5 -53
- reflex/components/radix/themes/components/table.py +14 -15
- reflex/components/radix/themes/components/table.pyi +22 -351
- reflex/components/radix/themes/components/tabs.py +9 -6
- reflex/components/radix/themes/components/tabs.pyi +18 -205
- reflex/components/radix/themes/components/textarea.py +2 -3
- reflex/components/radix/themes/components/textarea.pyi +10 -53
- reflex/components/radix/themes/components/textfield.py +105 -4
- reflex/components/radix/themes/components/textfield.pyi +200 -108
- reflex/components/radix/themes/components/tooltip.py +102 -2
- reflex/components/radix/themes/components/tooltip.pyi +66 -110
- reflex/components/radix/themes/layout/__init__.py +7 -0
- reflex/components/radix/themes/layout/base.pyi +2 -0
- reflex/components/radix/themes/layout/box.py +2 -2
- reflex/components/radix/themes/layout/box.pyi +4 -104
- reflex/components/radix/themes/layout/center.py +19 -0
- reflex/components/radix/themes/layout/center.pyi +261 -0
- reflex/components/radix/themes/layout/container.py +2 -2
- reflex/components/radix/themes/layout/container.pyi +4 -104
- reflex/components/radix/themes/layout/flex.py +2 -2
- reflex/components/radix/themes/layout/flex.pyi +4 -105
- reflex/components/radix/themes/layout/grid.pyi +2 -0
- reflex/components/radix/themes/layout/section.py +2 -2
- reflex/components/radix/themes/layout/section.pyi +4 -104
- reflex/components/radix/themes/layout/spacer.py +19 -0
- reflex/components/radix/themes/layout/spacer.pyi +261 -0
- reflex/components/radix/themes/layout/stack.py +60 -0
- reflex/components/radix/themes/layout/stack.pyi +537 -0
- reflex/components/radix/themes/typography/blockquote.py +2 -3
- reflex/components/radix/themes/typography/blockquote.pyi +4 -51
- reflex/components/radix/themes/typography/code.py +2 -3
- reflex/components/radix/themes/typography/code.pyi +4 -56
- reflex/components/radix/themes/typography/em.py +1 -2
- reflex/components/radix/themes/typography/em.pyi +4 -51
- reflex/components/radix/themes/typography/heading.py +2 -3
- reflex/components/radix/themes/typography/heading.pyi +4 -51
- reflex/components/radix/themes/typography/kbd.py +1 -2
- reflex/components/radix/themes/typography/kbd.pyi +4 -51
- reflex/components/radix/themes/typography/link.py +34 -3
- reflex/components/radix/themes/typography/link.pyi +41 -86
- reflex/components/radix/themes/typography/quote.py +1 -2
- reflex/components/radix/themes/typography/quote.pyi +4 -51
- reflex/components/radix/themes/typography/strong.py +1 -2
- reflex/components/radix/themes/typography/strong.pyi +4 -51
- reflex/components/radix/themes/typography/text.py +2 -3
- reflex/components/radix/themes/typography/text.pyi +4 -51
- reflex/components/radix/themes/typography.py +10 -11
- reflex/components/react_player/audio.pyi +2 -0
- reflex/components/react_player/react_player.pyi +2 -0
- reflex/components/react_player/video.pyi +2 -0
- reflex/components/recharts/cartesian.pyi +38 -0
- reflex/components/recharts/charts.pyi +22 -0
- reflex/components/recharts/general.pyi +10 -0
- reflex/components/recharts/polar.pyi +12 -0
- reflex/components/recharts/recharts.pyi +4 -0
- reflex/components/suneditor/editor.pyi +2 -0
- reflex/components/tags/tag.py +1 -1
- reflex/constants/base.py +5 -1
- reflex/constants/colors.py +80 -0
- reflex/constants/event.py +10 -1
- reflex/page.py +1 -1
- reflex/reflex.py +4 -0
- reflex/style.py +8 -3
- reflex/testing.py +21 -10
- reflex/utils/format.py +13 -9
- reflex/utils/prerequisites.py +41 -3
- reflex/utils/serializers.py +14 -0
- reflex/utils/telemetry.py +8 -2
- reflex/utils/types.py +36 -2
- reflex/vars.py +53 -18
- {reflex-0.3.9a2.dist-info → reflex-0.3.10.dist-info}/METADATA +1 -2
- {reflex-0.3.9a2.dist-info → reflex-0.3.10.dist-info}/RECORD +246 -232
- {reflex-0.3.9a2.dist-info → reflex-0.3.10.dist-info}/WHEEL +1 -1
- {reflex-0.3.9a2.dist-info → reflex-0.3.10.dist-info}/LICENSE +0 -0
- {reflex-0.3.9a2.dist-info → reflex-0.3.10.dist-info}/entry_points.txt +0 -0
|
@@ -8,10 +8,11 @@ from reflex.vars import Var, BaseVar, ComputedVar
|
|
|
8
8
|
from reflex.event import EventChain, EventHandler, EventSpec
|
|
9
9
|
from reflex.style import Style
|
|
10
10
|
from typing import Any, Dict, Literal
|
|
11
|
+
from reflex.constants import EventTriggers
|
|
11
12
|
from reflex.vars import Var
|
|
12
|
-
from ..base import
|
|
13
|
+
from ..base import RadixThemesComponent
|
|
13
14
|
|
|
14
|
-
class TabsRoot(
|
|
15
|
+
class TabsRoot(RadixThemesComponent):
|
|
15
16
|
def get_event_triggers(self) -> Dict[str, Any]: ...
|
|
16
17
|
@overload
|
|
17
18
|
@classmethod
|
|
@@ -92,57 +93,19 @@ class TabsRoot(CommonMarginProps, RadixThemesComponent):
|
|
|
92
93
|
Literal["horizontal", "vertical"],
|
|
93
94
|
]
|
|
94
95
|
] = None,
|
|
95
|
-
m: Optional[
|
|
96
|
-
Union[
|
|
97
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
98
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
99
|
-
]
|
|
100
|
-
] = None,
|
|
101
|
-
mx: Optional[
|
|
102
|
-
Union[
|
|
103
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
104
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
105
|
-
]
|
|
106
|
-
] = None,
|
|
107
|
-
my: Optional[
|
|
108
|
-
Union[
|
|
109
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
110
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
111
|
-
]
|
|
112
|
-
] = None,
|
|
113
|
-
mt: Optional[
|
|
114
|
-
Union[
|
|
115
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
116
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
117
|
-
]
|
|
118
|
-
] = None,
|
|
119
|
-
mr: Optional[
|
|
120
|
-
Union[
|
|
121
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
122
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
123
|
-
]
|
|
124
|
-
] = None,
|
|
125
|
-
mb: Optional[
|
|
126
|
-
Union[
|
|
127
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
128
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
129
|
-
]
|
|
130
|
-
] = None,
|
|
131
|
-
ml: Optional[
|
|
132
|
-
Union[
|
|
133
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
134
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
135
|
-
]
|
|
136
|
-
] = None,
|
|
137
96
|
style: Optional[Style] = None,
|
|
138
97
|
key: Optional[Any] = None,
|
|
139
98
|
id: Optional[Any] = None,
|
|
140
99
|
class_name: Optional[Any] = None,
|
|
141
100
|
autofocus: Optional[bool] = None,
|
|
101
|
+
_rename_props: Optional[Dict[str, str]] = None,
|
|
142
102
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
143
103
|
on_blur: Optional[
|
|
144
104
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
145
105
|
] = None,
|
|
106
|
+
on_change: Optional[
|
|
107
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
108
|
+
] = None,
|
|
146
109
|
on_click: Optional[
|
|
147
110
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
148
111
|
] = None,
|
|
@@ -185,9 +148,6 @@ class TabsRoot(CommonMarginProps, RadixThemesComponent):
|
|
|
185
148
|
on_unmount: Optional[
|
|
186
149
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
187
150
|
] = None,
|
|
188
|
-
on_value_change: Optional[
|
|
189
|
-
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
190
|
-
] = None,
|
|
191
151
|
**props
|
|
192
152
|
) -> "TabsRoot":
|
|
193
153
|
"""Create a new component instance.
|
|
@@ -203,18 +163,12 @@ class TabsRoot(CommonMarginProps, RadixThemesComponent):
|
|
|
203
163
|
default_value: The value of the tab that should be active when initially rendered. Use when you do not need to control the state of the tabs.
|
|
204
164
|
value: The controlled value of the tab that should be active. Use when you need to control the state of the tabs.
|
|
205
165
|
orientation: The orientation of the tabs.
|
|
206
|
-
|
|
207
|
-
mx: Margin horizontal: "0" - "9"
|
|
208
|
-
my: Margin vertical: "0" - "9"
|
|
209
|
-
mt: Margin top: "0" - "9"
|
|
210
|
-
mr: Margin right: "0" - "9"
|
|
211
|
-
mb: Margin bottom: "0" - "9"
|
|
212
|
-
ml: Margin left: "0" - "9"
|
|
213
|
-
style: The style of the component.
|
|
166
|
+
style: Props to rename The style of the component.
|
|
214
167
|
key: A unique key for the component.
|
|
215
168
|
id: The id for the component.
|
|
216
169
|
class_name: The class name for the component.
|
|
217
170
|
autofocus: Whether the component should take the focus once the page is loaded
|
|
171
|
+
_rename_props: props to change the name of
|
|
218
172
|
custom_attrs: custom attribute
|
|
219
173
|
**props: Component properties.
|
|
220
174
|
|
|
@@ -223,7 +177,7 @@ class TabsRoot(CommonMarginProps, RadixThemesComponent):
|
|
|
223
177
|
"""
|
|
224
178
|
...
|
|
225
179
|
|
|
226
|
-
class TabsList(
|
|
180
|
+
class TabsList(RadixThemesComponent):
|
|
227
181
|
@overload
|
|
228
182
|
@classmethod
|
|
229
183
|
def create( # type: ignore
|
|
@@ -292,53 +246,12 @@ class TabsList(CommonMarginProps, RadixThemesComponent):
|
|
|
292
246
|
],
|
|
293
247
|
]
|
|
294
248
|
] = None,
|
|
295
|
-
m: Optional[
|
|
296
|
-
Union[
|
|
297
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
298
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
299
|
-
]
|
|
300
|
-
] = None,
|
|
301
|
-
mx: Optional[
|
|
302
|
-
Union[
|
|
303
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
304
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
305
|
-
]
|
|
306
|
-
] = None,
|
|
307
|
-
my: Optional[
|
|
308
|
-
Union[
|
|
309
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
310
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
311
|
-
]
|
|
312
|
-
] = None,
|
|
313
|
-
mt: Optional[
|
|
314
|
-
Union[
|
|
315
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
316
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
317
|
-
]
|
|
318
|
-
] = None,
|
|
319
|
-
mr: Optional[
|
|
320
|
-
Union[
|
|
321
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
322
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
323
|
-
]
|
|
324
|
-
] = None,
|
|
325
|
-
mb: Optional[
|
|
326
|
-
Union[
|
|
327
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
328
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
329
|
-
]
|
|
330
|
-
] = None,
|
|
331
|
-
ml: Optional[
|
|
332
|
-
Union[
|
|
333
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
334
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
335
|
-
]
|
|
336
|
-
] = None,
|
|
337
249
|
style: Optional[Style] = None,
|
|
338
250
|
key: Optional[Any] = None,
|
|
339
251
|
id: Optional[Any] = None,
|
|
340
252
|
class_name: Optional[Any] = None,
|
|
341
253
|
autofocus: Optional[bool] = None,
|
|
254
|
+
_rename_props: Optional[Dict[str, str]] = None,
|
|
342
255
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
343
256
|
on_blur: Optional[
|
|
344
257
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
@@ -396,18 +309,12 @@ class TabsList(CommonMarginProps, RadixThemesComponent):
|
|
|
396
309
|
*children: Child components.
|
|
397
310
|
color: map to CSS default color property.
|
|
398
311
|
color_scheme: map to radix color property.
|
|
399
|
-
m: Margin: "0" - "9"
|
|
400
|
-
mx: Margin horizontal: "0" - "9"
|
|
401
|
-
my: Margin vertical: "0" - "9"
|
|
402
|
-
mt: Margin top: "0" - "9"
|
|
403
|
-
mr: Margin right: "0" - "9"
|
|
404
|
-
mb: Margin bottom: "0" - "9"
|
|
405
|
-
ml: Margin left: "0" - "9"
|
|
406
312
|
style: The style of the component.
|
|
407
313
|
key: A unique key for the component.
|
|
408
314
|
id: The id for the component.
|
|
409
315
|
class_name: The class name for the component.
|
|
410
316
|
autofocus: Whether the component should take the focus once the page is loaded
|
|
317
|
+
_rename_props: props to change the name of
|
|
411
318
|
custom_attrs: custom attribute
|
|
412
319
|
**props: Component properties.
|
|
413
320
|
|
|
@@ -416,7 +323,7 @@ class TabsList(CommonMarginProps, RadixThemesComponent):
|
|
|
416
323
|
"""
|
|
417
324
|
...
|
|
418
325
|
|
|
419
|
-
class TabsTrigger(
|
|
326
|
+
class TabsTrigger(RadixThemesComponent):
|
|
420
327
|
@overload
|
|
421
328
|
@classmethod
|
|
422
329
|
def create( # type: ignore
|
|
@@ -487,53 +394,12 @@ class TabsTrigger(CommonMarginProps, RadixThemesComponent):
|
|
|
487
394
|
] = None,
|
|
488
395
|
value: Optional[Union[Var[str], str]] = None,
|
|
489
396
|
disabled: Optional[Union[Var[bool], bool]] = None,
|
|
490
|
-
m: Optional[
|
|
491
|
-
Union[
|
|
492
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
493
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
494
|
-
]
|
|
495
|
-
] = None,
|
|
496
|
-
mx: Optional[
|
|
497
|
-
Union[
|
|
498
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
499
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
500
|
-
]
|
|
501
|
-
] = None,
|
|
502
|
-
my: Optional[
|
|
503
|
-
Union[
|
|
504
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
505
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
506
|
-
]
|
|
507
|
-
] = None,
|
|
508
|
-
mt: Optional[
|
|
509
|
-
Union[
|
|
510
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
511
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
512
|
-
]
|
|
513
|
-
] = None,
|
|
514
|
-
mr: Optional[
|
|
515
|
-
Union[
|
|
516
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
517
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
518
|
-
]
|
|
519
|
-
] = None,
|
|
520
|
-
mb: Optional[
|
|
521
|
-
Union[
|
|
522
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
523
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
524
|
-
]
|
|
525
|
-
] = None,
|
|
526
|
-
ml: Optional[
|
|
527
|
-
Union[
|
|
528
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
529
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
530
|
-
]
|
|
531
|
-
] = None,
|
|
532
397
|
style: Optional[Style] = None,
|
|
533
398
|
key: Optional[Any] = None,
|
|
534
399
|
id: Optional[Any] = None,
|
|
535
400
|
class_name: Optional[Any] = None,
|
|
536
401
|
autofocus: Optional[bool] = None,
|
|
402
|
+
_rename_props: Optional[Dict[str, str]] = None,
|
|
537
403
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
538
404
|
on_blur: Optional[
|
|
539
405
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
@@ -593,18 +459,12 @@ class TabsTrigger(CommonMarginProps, RadixThemesComponent):
|
|
|
593
459
|
color_scheme: map to radix color property.
|
|
594
460
|
value: The value of the tab. Must be unique for each tab.
|
|
595
461
|
disabled: Whether the tab is disabled
|
|
596
|
-
m: Margin: "0" - "9"
|
|
597
|
-
mx: Margin horizontal: "0" - "9"
|
|
598
|
-
my: Margin vertical: "0" - "9"
|
|
599
|
-
mt: Margin top: "0" - "9"
|
|
600
|
-
mr: Margin right: "0" - "9"
|
|
601
|
-
mb: Margin bottom: "0" - "9"
|
|
602
|
-
ml: Margin left: "0" - "9"
|
|
603
462
|
style: The style of the component.
|
|
604
463
|
key: A unique key for the component.
|
|
605
464
|
id: The id for the component.
|
|
606
465
|
class_name: The class name for the component.
|
|
607
466
|
autofocus: Whether the component should take the focus once the page is loaded
|
|
467
|
+
_rename_props: props to change the name of
|
|
608
468
|
custom_attrs: custom attribute
|
|
609
469
|
**props: Component properties.
|
|
610
470
|
|
|
@@ -613,7 +473,7 @@ class TabsTrigger(CommonMarginProps, RadixThemesComponent):
|
|
|
613
473
|
"""
|
|
614
474
|
...
|
|
615
475
|
|
|
616
|
-
class TabsContent(
|
|
476
|
+
class TabsContent(RadixThemesComponent):
|
|
617
477
|
@overload
|
|
618
478
|
@classmethod
|
|
619
479
|
def create( # type: ignore
|
|
@@ -683,53 +543,12 @@ class TabsContent(CommonMarginProps, RadixThemesComponent):
|
|
|
683
543
|
]
|
|
684
544
|
] = None,
|
|
685
545
|
value: Optional[Union[Var[str], str]] = None,
|
|
686
|
-
m: Optional[
|
|
687
|
-
Union[
|
|
688
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
689
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
690
|
-
]
|
|
691
|
-
] = None,
|
|
692
|
-
mx: Optional[
|
|
693
|
-
Union[
|
|
694
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
695
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
696
|
-
]
|
|
697
|
-
] = None,
|
|
698
|
-
my: Optional[
|
|
699
|
-
Union[
|
|
700
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
701
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
702
|
-
]
|
|
703
|
-
] = None,
|
|
704
|
-
mt: Optional[
|
|
705
|
-
Union[
|
|
706
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
707
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
708
|
-
]
|
|
709
|
-
] = None,
|
|
710
|
-
mr: Optional[
|
|
711
|
-
Union[
|
|
712
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
713
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
714
|
-
]
|
|
715
|
-
] = None,
|
|
716
|
-
mb: Optional[
|
|
717
|
-
Union[
|
|
718
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
719
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
720
|
-
]
|
|
721
|
-
] = None,
|
|
722
|
-
ml: Optional[
|
|
723
|
-
Union[
|
|
724
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
725
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
726
|
-
]
|
|
727
|
-
] = None,
|
|
728
546
|
style: Optional[Style] = None,
|
|
729
547
|
key: Optional[Any] = None,
|
|
730
548
|
id: Optional[Any] = None,
|
|
731
549
|
class_name: Optional[Any] = None,
|
|
732
550
|
autofocus: Optional[bool] = None,
|
|
551
|
+
_rename_props: Optional[Dict[str, str]] = None,
|
|
733
552
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
734
553
|
on_blur: Optional[
|
|
735
554
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
@@ -788,18 +607,12 @@ class TabsContent(CommonMarginProps, RadixThemesComponent):
|
|
|
788
607
|
color: map to CSS default color property.
|
|
789
608
|
color_scheme: map to radix color property.
|
|
790
609
|
value: The value of the tab. Must be unique for each tab.
|
|
791
|
-
m: Margin: "0" - "9"
|
|
792
|
-
mx: Margin horizontal: "0" - "9"
|
|
793
|
-
my: Margin vertical: "0" - "9"
|
|
794
|
-
mt: Margin top: "0" - "9"
|
|
795
|
-
mr: Margin right: "0" - "9"
|
|
796
|
-
mb: Margin bottom: "0" - "9"
|
|
797
|
-
ml: Margin left: "0" - "9"
|
|
798
610
|
style: The style of the component.
|
|
799
611
|
key: A unique key for the component.
|
|
800
612
|
id: The id for the component.
|
|
801
613
|
class_name: The class name for the component.
|
|
802
614
|
autofocus: Whether the component should take the focus once the page is loaded
|
|
615
|
+
_rename_props: props to change the name of
|
|
803
616
|
custom_attrs: custom attribute
|
|
804
617
|
**props: Component properties.
|
|
805
618
|
|
|
@@ -8,7 +8,6 @@ from reflex.constants import EventTriggers
|
|
|
8
8
|
from reflex.vars import Var
|
|
9
9
|
|
|
10
10
|
from ..base import (
|
|
11
|
-
CommonMarginProps,
|
|
12
11
|
LiteralAccentColor,
|
|
13
12
|
RadixThemesComponent,
|
|
14
13
|
)
|
|
@@ -16,7 +15,7 @@ from ..base import (
|
|
|
16
15
|
LiteralTextAreaSize = Literal["1", "2", "3"]
|
|
17
16
|
|
|
18
17
|
|
|
19
|
-
class TextArea(
|
|
18
|
+
class TextArea(RadixThemesComponent, el.Textarea):
|
|
20
19
|
"""The input part of a TextArea, may be used by itself."""
|
|
21
20
|
|
|
22
21
|
tag = "TextArea"
|
|
@@ -28,7 +27,7 @@ class TextArea(CommonMarginProps, RadixThemesComponent, el.Textarea):
|
|
|
28
27
|
variant: Var[Literal["classic", "surface", "soft"]]
|
|
29
28
|
|
|
30
29
|
# The color of the text area
|
|
31
|
-
|
|
30
|
+
color_scheme: Var[LiteralAccentColor]
|
|
32
31
|
|
|
33
32
|
@classmethod
|
|
34
33
|
def create(cls, *children, **props) -> Component:
|
|
@@ -13,11 +13,11 @@ from reflex.components.component import Component
|
|
|
13
13
|
from reflex.components.core.debounce import DebounceInput
|
|
14
14
|
from reflex.constants import EventTriggers
|
|
15
15
|
from reflex.vars import Var
|
|
16
|
-
from ..base import
|
|
16
|
+
from ..base import LiteralAccentColor, RadixThemesComponent
|
|
17
17
|
|
|
18
18
|
LiteralTextAreaSize = Literal["1", "2", "3"]
|
|
19
19
|
|
|
20
|
-
class TextArea(
|
|
20
|
+
class TextArea(RadixThemesComponent, el.Textarea):
|
|
21
21
|
@overload
|
|
22
22
|
@classmethod
|
|
23
23
|
def create( # type: ignore
|
|
@@ -32,7 +32,7 @@ class TextArea(CommonMarginProps, RadixThemesComponent, el.Textarea):
|
|
|
32
32
|
Literal["classic", "surface", "soft"],
|
|
33
33
|
]
|
|
34
34
|
] = None,
|
|
35
|
-
|
|
35
|
+
color_scheme: Optional[
|
|
36
36
|
Union[
|
|
37
37
|
Var[
|
|
38
38
|
Literal[
|
|
@@ -94,48 +94,6 @@ class TextArea(CommonMarginProps, RadixThemesComponent, el.Textarea):
|
|
|
94
94
|
],
|
|
95
95
|
]
|
|
96
96
|
] = None,
|
|
97
|
-
m: Optional[
|
|
98
|
-
Union[
|
|
99
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
100
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
101
|
-
]
|
|
102
|
-
] = None,
|
|
103
|
-
mx: Optional[
|
|
104
|
-
Union[
|
|
105
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
106
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
107
|
-
]
|
|
108
|
-
] = None,
|
|
109
|
-
my: Optional[
|
|
110
|
-
Union[
|
|
111
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
112
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
113
|
-
]
|
|
114
|
-
] = None,
|
|
115
|
-
mt: Optional[
|
|
116
|
-
Union[
|
|
117
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
118
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
119
|
-
]
|
|
120
|
-
] = None,
|
|
121
|
-
mr: Optional[
|
|
122
|
-
Union[
|
|
123
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
124
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
125
|
-
]
|
|
126
|
-
] = None,
|
|
127
|
-
mb: Optional[
|
|
128
|
-
Union[
|
|
129
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
130
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
131
|
-
]
|
|
132
|
-
] = None,
|
|
133
|
-
ml: Optional[
|
|
134
|
-
Union[
|
|
135
|
-
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
136
|
-
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
137
|
-
]
|
|
138
|
-
] = None,
|
|
139
97
|
auto_complete: Optional[
|
|
140
98
|
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
141
99
|
] = None,
|
|
@@ -167,6 +125,9 @@ class TextArea(CommonMarginProps, RadixThemesComponent, el.Textarea):
|
|
|
167
125
|
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
168
126
|
] = None,
|
|
169
127
|
rows: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
128
|
+
value: Optional[
|
|
129
|
+
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
130
|
+
] = None,
|
|
170
131
|
wrap: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
171
132
|
access_key: Optional[
|
|
172
133
|
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
@@ -216,6 +177,7 @@ class TextArea(CommonMarginProps, RadixThemesComponent, el.Textarea):
|
|
|
216
177
|
id: Optional[Any] = None,
|
|
217
178
|
class_name: Optional[Any] = None,
|
|
218
179
|
autofocus: Optional[bool] = None,
|
|
180
|
+
_rename_props: Optional[Dict[str, str]] = None,
|
|
219
181
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
220
182
|
on_blur: Optional[
|
|
221
183
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
@@ -279,14 +241,7 @@ class TextArea(CommonMarginProps, RadixThemesComponent, el.Textarea):
|
|
|
279
241
|
*children: The children of the component.
|
|
280
242
|
size: The size of the text area: "1" | "2" | "3"
|
|
281
243
|
variant: The variant of the text area
|
|
282
|
-
|
|
283
|
-
m: Margin: "0" - "9"
|
|
284
|
-
mx: Margin horizontal: "0" - "9"
|
|
285
|
-
my: Margin vertical: "0" - "9"
|
|
286
|
-
mt: Margin top: "0" - "9"
|
|
287
|
-
mr: Margin right: "0" - "9"
|
|
288
|
-
mb: Margin bottom: "0" - "9"
|
|
289
|
-
ml: Margin left: "0" - "9"
|
|
244
|
+
color_scheme: The color of the text area
|
|
290
245
|
auto_complete: Whether the form control should have autocomplete enabled
|
|
291
246
|
auto_focus: Automatically focuses the textarea when the page loads
|
|
292
247
|
cols: Visible width of the text control, in average character widths
|
|
@@ -300,6 +255,7 @@ class TextArea(CommonMarginProps, RadixThemesComponent, el.Textarea):
|
|
|
300
255
|
read_only: Indicates whether the textarea is read-only
|
|
301
256
|
required: Indicates that the textarea is required
|
|
302
257
|
rows: Visible number of lines in the text control
|
|
258
|
+
value: The controlled value of the textarea, read only unless used with on_change
|
|
303
259
|
wrap: How the text in the textarea is to be wrapped when submitting the form
|
|
304
260
|
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
305
261
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
@@ -323,6 +279,7 @@ class TextArea(CommonMarginProps, RadixThemesComponent, el.Textarea):
|
|
|
323
279
|
id: The id for the component.
|
|
324
280
|
class_name: The class name for the component.
|
|
325
281
|
autofocus: Whether the component should take the focus once the page is loaded
|
|
282
|
+
_rename_props: props to change the name of
|
|
326
283
|
custom_attrs: custom attribute
|
|
327
284
|
**props: The properties of the component.
|
|
328
285
|
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"""Interactive components provided by @radix-ui/themes."""
|
|
2
2
|
from typing import Any, Dict, Literal
|
|
3
3
|
|
|
4
|
+
import reflex as rx
|
|
4
5
|
from reflex.components import el
|
|
5
6
|
from reflex.components.component import Component
|
|
6
7
|
from reflex.components.core.debounce import DebounceInput
|
|
8
|
+
from reflex.components.radix.themes.components.icons import Icon
|
|
7
9
|
from reflex.constants import EventTriggers
|
|
8
10
|
from reflex.vars import Var
|
|
9
11
|
|
|
10
12
|
from ..base import (
|
|
11
|
-
CommonMarginProps,
|
|
12
13
|
LiteralAccentColor,
|
|
13
14
|
LiteralRadius,
|
|
14
15
|
LiteralSize,
|
|
@@ -19,7 +20,7 @@ LiteralTextFieldSize = Literal["1", "2", "3"]
|
|
|
19
20
|
LiteralTextFieldVariant = Literal["classic", "surface", "soft"]
|
|
20
21
|
|
|
21
22
|
|
|
22
|
-
class TextFieldRoot(el.Div,
|
|
23
|
+
class TextFieldRoot(el.Div, RadixThemesComponent):
|
|
23
24
|
"""Captures user input with an optional slot for buttons and icons."""
|
|
24
25
|
|
|
25
26
|
tag = "TextField.Root"
|
|
@@ -31,7 +32,7 @@ class TextFieldRoot(el.Div, CommonMarginProps, RadixThemesComponent):
|
|
|
31
32
|
variant: Var[LiteralTextFieldVariant]
|
|
32
33
|
|
|
33
34
|
# Override theme color for text field
|
|
34
|
-
|
|
35
|
+
color_scheme: Var[LiteralAccentColor]
|
|
35
36
|
|
|
36
37
|
# Override theme radius for text field: "none" | "small" | "medium" | "large" | "full"
|
|
37
38
|
radius: Var[LiteralRadius]
|
|
@@ -86,7 +87,107 @@ class TextFieldSlot(RadixThemesComponent):
|
|
|
86
87
|
tag = "TextField.Slot"
|
|
87
88
|
|
|
88
89
|
# Override theme color for text field slot
|
|
89
|
-
|
|
90
|
+
color_scheme: Var[LiteralAccentColor]
|
|
90
91
|
|
|
91
92
|
# Override the gap spacing between slot and input: "1" - "9"
|
|
92
93
|
gap: Var[LiteralSize]
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class Input(RadixThemesComponent):
|
|
97
|
+
"""High level wrapper for the Input component."""
|
|
98
|
+
|
|
99
|
+
# The icon to render before the input.
|
|
100
|
+
icon: Var[str]
|
|
101
|
+
|
|
102
|
+
# Text field size "1" - "3"
|
|
103
|
+
size: Var[LiteralTextFieldSize]
|
|
104
|
+
|
|
105
|
+
# Variant of text field: "classic" | "surface" | "soft"
|
|
106
|
+
variant: Var[LiteralTextFieldVariant]
|
|
107
|
+
|
|
108
|
+
# Override theme color for text field
|
|
109
|
+
color_scheme: Var[LiteralAccentColor]
|
|
110
|
+
|
|
111
|
+
# Override theme radius for text field: "none" | "small" | "medium" | "large" | "full"
|
|
112
|
+
radius: Var[LiteralRadius]
|
|
113
|
+
|
|
114
|
+
# Whether the input should have autocomplete enabled
|
|
115
|
+
auto_complete: Var[bool]
|
|
116
|
+
|
|
117
|
+
# The value of the input when initially rendered.
|
|
118
|
+
default_value: Var[str]
|
|
119
|
+
|
|
120
|
+
# Disables the input
|
|
121
|
+
disabled: Var[bool]
|
|
122
|
+
|
|
123
|
+
# Specifies the maximum number of characters allowed in the input
|
|
124
|
+
max_length: Var[str]
|
|
125
|
+
|
|
126
|
+
# Specifies the minimum number of characters required in the input
|
|
127
|
+
min_length: Var[str]
|
|
128
|
+
|
|
129
|
+
# Name of the input, used when sending form data
|
|
130
|
+
name: Var[str]
|
|
131
|
+
|
|
132
|
+
# Placeholder text in the input
|
|
133
|
+
placeholder: Var[str]
|
|
134
|
+
|
|
135
|
+
# Indicates that the input is required
|
|
136
|
+
required: Var[bool]
|
|
137
|
+
|
|
138
|
+
# Value of the input
|
|
139
|
+
value: Var[str]
|
|
140
|
+
|
|
141
|
+
@classmethod
|
|
142
|
+
def create(cls, **props):
|
|
143
|
+
"""Create an Input component.
|
|
144
|
+
|
|
145
|
+
Args:
|
|
146
|
+
**props: The properties of the component.
|
|
147
|
+
|
|
148
|
+
Returns:
|
|
149
|
+
The component.
|
|
150
|
+
"""
|
|
151
|
+
input_props = {
|
|
152
|
+
prop: props.pop(prop)
|
|
153
|
+
for prop in [
|
|
154
|
+
"auto_complete",
|
|
155
|
+
"default_value",
|
|
156
|
+
"disabled",
|
|
157
|
+
"max_length",
|
|
158
|
+
"min_length",
|
|
159
|
+
"name",
|
|
160
|
+
"placeholder",
|
|
161
|
+
"required",
|
|
162
|
+
"value",
|
|
163
|
+
"on_change",
|
|
164
|
+
"on_focus",
|
|
165
|
+
"on_blur",
|
|
166
|
+
"on_key_down",
|
|
167
|
+
"on_key_up",
|
|
168
|
+
]
|
|
169
|
+
if prop in props
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
icon = props.pop("icon", None)
|
|
173
|
+
|
|
174
|
+
return TextFieldRoot.create(
|
|
175
|
+
TextFieldSlot.create(Icon.create(tag=icon)) if icon else rx.fragment(),
|
|
176
|
+
TextFieldInput.create(**input_props),
|
|
177
|
+
**props,
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
def get_event_triggers(self) -> Dict[str, Any]:
|
|
181
|
+
"""Get the event triggers that pass the component's value to the handler.
|
|
182
|
+
|
|
183
|
+
Returns:
|
|
184
|
+
A dict mapping the event trigger to the var that is passed to the handler.
|
|
185
|
+
"""
|
|
186
|
+
return {
|
|
187
|
+
**super().get_event_triggers(),
|
|
188
|
+
EventTriggers.ON_CHANGE: lambda e0: [e0.target.value],
|
|
189
|
+
EventTriggers.ON_FOCUS: lambda e0: [e0.target.value],
|
|
190
|
+
EventTriggers.ON_BLUR: lambda e0: [e0.target.value],
|
|
191
|
+
EventTriggers.ON_KEY_DOWN: lambda e0: [e0.key],
|
|
192
|
+
EventTriggers.ON_KEY_UP: lambda e0: [e0.key],
|
|
193
|
+
}
|