reflex 0.5.4a3__py3-none-any.whl → 0.5.5a1__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/demo/code/demo.py +1 -0
- reflex/.templates/apps/demo/code/pages/__init__.py +1 -0
- reflex/.templates/apps/demo/code/pages/datatable.py +1 -0
- reflex/.templates/apps/demo/code/pages/forms.py +1 -0
- reflex/.templates/apps/demo/code/pages/graphing.py +1 -0
- reflex/.templates/apps/demo/code/pages/home.py +1 -0
- reflex/.templates/apps/demo/code/styles.py +1 -0
- reflex/.templates/apps/demo/code/webui/components/loading_icon.py +1 -8
- reflex/.templates/web/components/reflex/chakra_color_mode_provider.js +27 -12
- reflex/.templates/web/components/reflex/radix_themes_color_mode_provider.js +19 -5
- reflex/.templates/web/utils/state.js +73 -7
- reflex/__init__.py +3 -0
- reflex/__init__.pyi +3 -0
- reflex/admin.py +1 -0
- reflex/app.py +8 -6
- reflex/app_module_for_backend.py +2 -1
- reflex/base.py +4 -4
- reflex/compiler/compiler.py +4 -3
- reflex/compiler/templates.py +2 -0
- reflex/compiler/utils.py +58 -35
- reflex/components/__init__.py +1 -0
- reflex/components/base/__init__.py +1 -0
- reflex/components/base/app_wrap.py +1 -0
- reflex/components/base/fragment.py +1 -0
- reflex/components/base/link.py +0 -1
- reflex/components/base/script.py +11 -15
- reflex/components/base/script.pyi +1 -2
- reflex/components/chakra/base.py +15 -13
- reflex/components/chakra/base.pyi +3 -1
- reflex/components/chakra/datadisplay/code.py +1 -0
- reflex/components/chakra/datadisplay/divider.py +1 -0
- reflex/components/chakra/datadisplay/table.py +1 -0
- reflex/components/chakra/datadisplay/table.pyi +3 -0
- reflex/components/chakra/datadisplay/tag.py +1 -0
- reflex/components/chakra/disclosure/transition.py +1 -0
- reflex/components/chakra/feedback/circularprogress.py +1 -0
- reflex/components/chakra/forms/button.py +1 -0
- reflex/components/chakra/forms/checkbox.py +4 -13
- reflex/components/chakra/forms/checkbox.pyi +1 -3
- reflex/components/chakra/forms/colormodeswitch.py +1 -0
- reflex/components/chakra/forms/editable.py +13 -16
- reflex/components/chakra/forms/editable.pyi +1 -3
- reflex/components/chakra/forms/form.py +1 -0
- reflex/components/chakra/forms/input.py +22 -21
- reflex/components/chakra/forms/input.pyi +4 -4
- reflex/components/chakra/forms/multiselect.py +1 -0
- reflex/components/chakra/forms/numberinput.py +3 -12
- reflex/components/chakra/forms/numberinput.pyi +1 -3
- reflex/components/chakra/forms/pininput.py +8 -14
- reflex/components/chakra/forms/pininput.pyi +2 -3
- reflex/components/chakra/forms/radio.py +4 -13
- reflex/components/chakra/forms/radio.pyi +2 -3
- reflex/components/chakra/forms/rangeslider.py +10 -13
- reflex/components/chakra/forms/rangeslider.pyi +2 -3
- reflex/components/chakra/forms/select.py +4 -12
- reflex/components/chakra/forms/select.pyi +2 -3
- reflex/components/chakra/forms/slider.py +10 -13
- reflex/components/chakra/forms/slider.pyi +2 -3
- reflex/components/chakra/forms/switch.py +4 -13
- reflex/components/chakra/forms/switch.pyi +1 -3
- reflex/components/chakra/forms/textarea.py +16 -17
- reflex/components/chakra/forms/textarea.pyi +1 -3
- reflex/components/chakra/media/avatar.py +4 -12
- reflex/components/chakra/media/avatar.pyi +1 -2
- reflex/components/chakra/media/icon.py +1 -0
- reflex/components/chakra/media/image.py +7 -11
- reflex/components/chakra/media/image.pyi +2 -2
- reflex/components/chakra/navigation/link.py +8 -4
- reflex/components/chakra/navigation/link.pyi +2 -1
- reflex/components/chakra/overlay/alertdialog.py +12 -14
- reflex/components/chakra/overlay/alertdialog.pyi +1 -2
- reflex/components/chakra/overlay/drawer.py +12 -14
- reflex/components/chakra/overlay/drawer.pyi +1 -2
- reflex/components/chakra/overlay/menu.py +7 -11
- reflex/components/chakra/overlay/menu.pyi +2 -2
- reflex/components/chakra/overlay/modal.py +13 -13
- reflex/components/chakra/overlay/modal.pyi +2 -2
- reflex/components/chakra/overlay/popover.py +6 -12
- reflex/components/chakra/overlay/popover.pyi +1 -2
- reflex/components/chakra/overlay/tooltip.py +7 -13
- reflex/components/chakra/overlay/tooltip.pyi +1 -2
- reflex/components/chakra/typography/heading.py +0 -1
- reflex/components/chakra/typography/span.py +1 -0
- reflex/components/chakra/typography/text.py +1 -0
- reflex/components/component.py +70 -43
- reflex/components/core/__init__.py +1 -0
- reflex/components/core/banner.py +27 -24
- reflex/components/core/banner.pyi +6 -2
- reflex/components/core/client_side_routing.py +1 -0
- reflex/components/core/cond.py +19 -17
- reflex/components/core/debounce.py +4 -11
- reflex/components/core/debounce.pyi +1 -1
- reflex/components/core/foreach.py +1 -0
- reflex/components/core/html.py +1 -0
- reflex/components/core/match.py +9 -6
- reflex/components/core/upload.py +26 -25
- reflex/components/core/upload.pyi +3 -4
- reflex/components/datadisplay/__init__.py +1 -0
- reflex/components/datadisplay/code.py +27 -23
- reflex/components/datadisplay/code.pyi +4 -2
- reflex/components/datadisplay/dataeditor.py +73 -80
- reflex/components/datadisplay/dataeditor.pyi +52 -4
- reflex/components/datadisplay/logo.py +1 -0
- reflex/components/el/__init__.py +1 -0
- reflex/components/el/__init__.pyi +8 -0
- reflex/components/el/element.py +0 -1
- reflex/components/el/elements/__init__.py +5 -0
- reflex/components/el/elements/__init__.pyi +12 -1
- reflex/components/el/elements/base.py +1 -0
- reflex/components/el/elements/forms.py +44 -61
- reflex/components/el/elements/forms.pyi +4 -6
- reflex/components/el/elements/inline.py +1 -0
- reflex/components/el/elements/media.py +53 -0
- reflex/components/el/elements/media.pyi +428 -0
- reflex/components/el/elements/metadata.py +11 -0
- reflex/components/el/elements/metadata.pyi +80 -0
- reflex/components/el/elements/other.py +1 -0
- reflex/components/el/elements/scripts.py +1 -0
- reflex/components/el/elements/tables.py +1 -0
- reflex/components/el/elements/typography.py +1 -0
- reflex/components/gridjs/datatable.py +9 -6
- reflex/components/gridjs/datatable.pyi +4 -1
- reflex/components/markdown/markdown.py +36 -41
- reflex/components/markdown/markdown.pyi +4 -3
- reflex/components/media/icon.py +1 -0
- reflex/components/moment/moment.py +11 -17
- reflex/components/moment/moment.pyi +4 -3
- reflex/components/next/base.py +1 -0
- reflex/components/next/image.py +6 -11
- reflex/components/next/image.pyi +2 -2
- reflex/components/plotly/plotly.py +1 -0
- reflex/components/props.py +1 -0
- reflex/components/radix/__init__.py +1 -0
- reflex/components/radix/primitives/__init__.py +1 -0
- reflex/components/radix/primitives/accordion.py +7 -15
- reflex/components/radix/primitives/accordion.pyi +7 -4
- reflex/components/radix/primitives/base.py +1 -0
- reflex/components/radix/primitives/drawer.py +17 -27
- reflex/components/radix/primitives/drawer.pyi +2 -4
- reflex/components/radix/primitives/form.py +4 -12
- reflex/components/radix/primitives/form.pyi +2 -3
- reflex/components/radix/primitives/slider.py +6 -11
- reflex/components/radix/primitives/slider.pyi +2 -2
- reflex/components/radix/themes/__init__.py +1 -0
- reflex/components/radix/themes/base.py +3 -3
- reflex/components/radix/themes/base.pyi +3 -2
- reflex/components/radix/themes/color_mode.py +31 -2
- reflex/components/radix/themes/color_mode.pyi +10 -1
- reflex/components/radix/themes/components/__init__.py +1 -0
- reflex/components/radix/themes/components/alert_dialog.py +13 -24
- reflex/components/radix/themes/components/alert_dialog.pyi +2 -4
- reflex/components/radix/themes/components/aspect_ratio.py +1 -0
- reflex/components/radix/themes/components/card.py +1 -0
- reflex/components/radix/themes/components/checkbox.py +6 -22
- reflex/components/radix/themes/components/checkbox.pyi +2 -4
- reflex/components/radix/themes/components/checkbox_group.py +15 -3
- reflex/components/radix/themes/components/checkbox_group.pyi +10 -2
- reflex/components/radix/themes/components/context_menu.py +29 -38
- reflex/components/radix/themes/components/context_menu.pyi +2 -5
- reflex/components/radix/themes/components/dialog.py +18 -26
- reflex/components/radix/themes/components/dialog.pyi +2 -4
- reflex/components/radix/themes/components/dropdown_menu.py +32 -57
- reflex/components/radix/themes/components/dropdown_menu.pyi +2 -7
- reflex/components/radix/themes/components/hover_card.py +5 -12
- reflex/components/radix/themes/components/hover_card.pyi +2 -3
- reflex/components/radix/themes/components/icon_button.py +1 -0
- reflex/components/radix/themes/components/icon_button.pyi +1 -0
- reflex/components/radix/themes/components/inset.py +1 -0
- reflex/components/radix/themes/components/popover.py +22 -27
- reflex/components/radix/themes/components/popover.pyi +2 -4
- reflex/components/radix/themes/components/radio_group.py +25 -17
- reflex/components/radix/themes/components/radio_group.pyi +2 -3
- reflex/components/radix/themes/components/scroll_area.py +1 -0
- reflex/components/radix/themes/components/segmented_control.py +18 -5
- reflex/components/radix/themes/components/segmented_control.pyi +16 -7
- reflex/components/radix/themes/components/select.py +13 -23
- reflex/components/radix/themes/components/select.pyi +1 -4
- reflex/components/radix/themes/components/separator.py +1 -0
- reflex/components/radix/themes/components/slider.py +7 -12
- reflex/components/radix/themes/components/slider.pyi +2 -3
- reflex/components/radix/themes/components/switch.py +5 -12
- reflex/components/radix/themes/components/switch.pyi +2 -3
- reflex/components/radix/themes/components/table.py +1 -0
- reflex/components/radix/themes/components/tabs.py +4 -11
- reflex/components/radix/themes/components/tabs.pyi +2 -2
- reflex/components/radix/themes/components/text_area.py +19 -18
- reflex/components/radix/themes/components/text_area.pyi +2 -3
- reflex/components/radix/themes/components/text_field.py +19 -18
- reflex/components/radix/themes/components/text_field.pyi +3 -3
- reflex/components/radix/themes/components/tooltip.py +10 -13
- reflex/components/radix/themes/components/tooltip.pyi +2 -3
- reflex/components/radix/themes/layout/__init__.py +1 -0
- reflex/components/radix/themes/layout/box.py +1 -0
- reflex/components/radix/themes/layout/container.py +1 -0
- reflex/components/radix/themes/layout/list.py +1 -0
- reflex/components/radix/themes/layout/list.pyi +1 -0
- reflex/components/radix/themes/layout/section.py +1 -0
- reflex/components/radix/themes/typography/__init__.py +1 -0
- reflex/components/radix/themes/typography/base.py +1 -0
- reflex/components/radix/themes/typography/blockquote.py +1 -0
- reflex/components/radix/themes/typography/code.py +1 -0
- reflex/components/radix/themes/typography/heading.py +1 -0
- reflex/components/radix/themes/typography/link.py +8 -3
- reflex/components/radix/themes/typography/link.pyi +2 -1
- reflex/components/react_player/audio.py +1 -0
- reflex/components/react_player/audio.pyi +48 -0
- reflex/components/react_player/react_player.py +49 -0
- reflex/components/react_player/react_player.pyi +49 -0
- reflex/components/react_player/video.py +1 -0
- reflex/components/react_player/video.pyi +48 -0
- reflex/components/recharts/__init__.py +1 -0
- reflex/components/recharts/cartesian.py +264 -74
- reflex/components/recharts/cartesian.pyi +573 -58
- reflex/components/recharts/charts.py +68 -78
- reflex/components/recharts/charts.pyi +373 -156
- reflex/components/recharts/general.py +52 -20
- reflex/components/recharts/general.pyi +52 -6
- reflex/components/recharts/polar.py +30 -18
- reflex/components/recharts/polar.pyi +66 -5
- reflex/components/recharts/recharts.py +5 -3
- reflex/components/recharts/recharts.pyi +2 -1
- reflex/components/sonner/toast.py +2 -2
- reflex/components/sonner/toast.pyi +1 -1
- reflex/components/suneditor/editor.py +39 -26
- reflex/components/suneditor/editor.pyi +4 -4
- reflex/components/tags/iter_tag.py +1 -0
- reflex/constants/__init__.py +3 -2
- reflex/constants/base.py +20 -21
- reflex/constants/compiler.py +3 -1
- reflex/constants/config.py +1 -0
- reflex/constants/event.py +1 -0
- reflex/constants/installer.py +3 -2
- reflex/constants/style.py +2 -8
- reflex/event.py +36 -6
- reflex/experimental/assets.py +1 -0
- reflex/experimental/client_state.py +9 -3
- reflex/experimental/hooks.py +1 -0
- reflex/experimental/misc.py +12 -3
- reflex/middleware/hydrate_middleware.py +1 -0
- reflex/middleware/middleware.py +1 -0
- reflex/state.py +38 -1
- reflex/style.py +67 -20
- reflex/testing.py +6 -2
- reflex/utils/build.py +76 -72
- reflex/utils/exec.py +17 -9
- reflex/utils/export.py +13 -9
- reflex/utils/imports.py +34 -5
- reflex/utils/lazy_loader.py +1 -0
- reflex/utils/path_ops.py +39 -33
- reflex/utils/prerequisites.py +35 -27
- reflex/utils/processes.py +1 -1
- reflex/utils/serializers.py +3 -6
- reflex/utils/watch.py +3 -1
- reflex/vars.py +26 -10
- reflex/vars.pyi +3 -3
- {reflex-0.5.4a3.dist-info → reflex-0.5.5a1.dist-info}/METADATA +2 -2
- {reflex-0.5.4a3.dist-info → reflex-0.5.5a1.dist-info}/RECORD +260 -260
- {reflex-0.5.4a3.dist-info → reflex-0.5.5a1.dist-info}/LICENSE +0 -0
- {reflex-0.5.4a3.dist-info → reflex-0.5.5a1.dist-info}/WHEEL +0 -0
- {reflex-0.5.4a3.dist-info → reflex-0.5.5a1.dist-info}/entry_points.txt +0 -0
|
@@ -99,6 +99,9 @@ from .media import picture as picture
|
|
|
99
99
|
from .media import portal as portal
|
|
100
100
|
from .media import source as source
|
|
101
101
|
from .media import svg as svg
|
|
102
|
+
from .media import defs as defs
|
|
103
|
+
from .media import lineargradient as lineargradient
|
|
104
|
+
from .media import stop as stop
|
|
102
105
|
from .media import path as path
|
|
103
106
|
from .media import Area as Area
|
|
104
107
|
from .media import Audio as Audio
|
|
@@ -113,17 +116,22 @@ from .media import Picture as Picture
|
|
|
113
116
|
from .media import Portal as Portal
|
|
114
117
|
from .media import Source as Source
|
|
115
118
|
from .media import Svg as Svg
|
|
119
|
+
from .media import Defs as Defs
|
|
120
|
+
from .media import Lineargradient as Lineargradient
|
|
121
|
+
from .media import Stop as Stop
|
|
116
122
|
from .media import Path as Path
|
|
117
123
|
from .metadata import base as base
|
|
118
124
|
from .metadata import head as head
|
|
119
125
|
from .metadata import link as link
|
|
120
126
|
from .metadata import meta as meta
|
|
121
127
|
from .metadata import title as title
|
|
128
|
+
from .metadata import style as style
|
|
122
129
|
from .metadata import Base as Base
|
|
123
130
|
from .metadata import Head as Head
|
|
124
131
|
from .metadata import Link as Link
|
|
125
132
|
from .metadata import Meta as Meta
|
|
126
133
|
from .metadata import Title as Title
|
|
134
|
+
from .metadata import Style as Style
|
|
127
135
|
from .other import details as details
|
|
128
136
|
from .other import dialog as dialog
|
|
129
137
|
from .other import summary as summary
|
|
@@ -285,9 +293,12 @@ _MAPPING = {
|
|
|
285
293
|
"portal",
|
|
286
294
|
"source",
|
|
287
295
|
"svg",
|
|
296
|
+
"defs",
|
|
297
|
+
"lineargradient",
|
|
298
|
+
"stop",
|
|
288
299
|
"path",
|
|
289
300
|
],
|
|
290
|
-
"metadata": ["base", "head", "link", "meta", "title"],
|
|
301
|
+
"metadata": ["base", "head", "link", "meta", "title", "style"],
|
|
291
302
|
"other": ["details", "dialog", "summary", "slot", "template", "math", "html"],
|
|
292
303
|
"scripts": ["canvas", "noscript", "script"],
|
|
293
304
|
"sectioning": [
|
|
@@ -10,9 +10,9 @@ from jinja2 import Environment
|
|
|
10
10
|
from reflex.components.el.element import Element
|
|
11
11
|
from reflex.components.tags.tag import Tag
|
|
12
12
|
from reflex.constants import Dirs, EventTriggers
|
|
13
|
-
from reflex.event import EventChain
|
|
14
|
-
from reflex.utils import imports
|
|
13
|
+
from reflex.event import EventChain, EventHandler
|
|
15
14
|
from reflex.utils.format import format_event_chain
|
|
15
|
+
from reflex.utils.imports import ImportDict
|
|
16
16
|
from reflex.vars import BaseVar, Var
|
|
17
17
|
|
|
18
18
|
from .base import BaseHTML
|
|
@@ -134,16 +134,8 @@ class Form(BaseHTML):
|
|
|
134
134
|
# The name used to make this form's submit handler function unique.
|
|
135
135
|
handle_submit_unique_name: Var[str]
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
Returns:
|
|
141
|
-
The triggers for event supported by Root.
|
|
142
|
-
"""
|
|
143
|
-
return {
|
|
144
|
-
**super().get_event_triggers(),
|
|
145
|
-
EventTriggers.ON_SUBMIT: lambda e0: [FORM_DATA],
|
|
146
|
-
}
|
|
137
|
+
# Fired when the form is submitted
|
|
138
|
+
on_submit: EventHandler[lambda e0: [FORM_DATA]]
|
|
147
139
|
|
|
148
140
|
@classmethod
|
|
149
141
|
def create(cls, *children, **props):
|
|
@@ -169,17 +161,16 @@ class Form(BaseHTML):
|
|
|
169
161
|
).hexdigest()
|
|
170
162
|
return form
|
|
171
163
|
|
|
172
|
-
def
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
)
|
|
164
|
+
def add_imports(self) -> ImportDict:
|
|
165
|
+
"""Add imports needed by the form component.
|
|
166
|
+
|
|
167
|
+
Returns:
|
|
168
|
+
The imports for the form component.
|
|
169
|
+
"""
|
|
170
|
+
return {
|
|
171
|
+
"react": "useCallback",
|
|
172
|
+
f"/{Dirs.STATE_PATH}": ["getRefValue", "getRefValues"],
|
|
173
|
+
}
|
|
183
174
|
|
|
184
175
|
def add_hooks(self) -> list[str]:
|
|
185
176
|
"""Add hooks for the form.
|
|
@@ -353,20 +344,20 @@ class Input(BaseHTML):
|
|
|
353
344
|
# Value of the input
|
|
354
345
|
value: Var[Union[str, int, float]]
|
|
355
346
|
|
|
356
|
-
|
|
357
|
-
|
|
347
|
+
# Fired when the input value changes
|
|
348
|
+
on_change: EventHandler[lambda e0: [e0.target.value]]
|
|
358
349
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
350
|
+
# Fired when the input gains focus
|
|
351
|
+
on_focus: EventHandler[lambda e0: [e0.target.value]]
|
|
352
|
+
|
|
353
|
+
# Fired when the input loses focus
|
|
354
|
+
on_blur: EventHandler[lambda e0: [e0.target.value]]
|
|
355
|
+
|
|
356
|
+
# Fired when a key is pressed down
|
|
357
|
+
on_key_down: EventHandler[lambda e0: [e0.key]]
|
|
358
|
+
|
|
359
|
+
# Fired when a key is released
|
|
360
|
+
on_key_up: EventHandler[lambda e0: [e0.key]]
|
|
370
361
|
|
|
371
362
|
|
|
372
363
|
class Label(BaseHTML):
|
|
@@ -504,16 +495,8 @@ class Select(BaseHTML):
|
|
|
504
495
|
# Number of visible options in a drop-down list
|
|
505
496
|
size: Var[Union[str, int, bool]]
|
|
506
497
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
Returns:
|
|
511
|
-
A dict mapping the event trigger to the var that is passed to the handler.
|
|
512
|
-
"""
|
|
513
|
-
return {
|
|
514
|
-
**super().get_event_triggers(),
|
|
515
|
-
EventTriggers.ON_CHANGE: lambda e0: [e0.target.value],
|
|
516
|
-
}
|
|
498
|
+
# Fired when the select value changes
|
|
499
|
+
on_change: EventHandler[lambda e0: [e0.target.value]]
|
|
517
500
|
|
|
518
501
|
|
|
519
502
|
AUTO_HEIGHT_JS = """
|
|
@@ -602,6 +585,21 @@ class Textarea(BaseHTML):
|
|
|
602
585
|
# How the text in the textarea is to be wrapped when submitting the form
|
|
603
586
|
wrap: Var[Union[str, int, bool]]
|
|
604
587
|
|
|
588
|
+
# Fired when the input value changes
|
|
589
|
+
on_change: EventHandler[lambda e0: [e0.target.value]]
|
|
590
|
+
|
|
591
|
+
# Fired when the input gains focus
|
|
592
|
+
on_focus: EventHandler[lambda e0: [e0.target.value]]
|
|
593
|
+
|
|
594
|
+
# Fired when the input loses focus
|
|
595
|
+
on_blur: EventHandler[lambda e0: [e0.target.value]]
|
|
596
|
+
|
|
597
|
+
# Fired when a key is pressed down
|
|
598
|
+
on_key_down: EventHandler[lambda e0: [e0.key]]
|
|
599
|
+
|
|
600
|
+
# Fired when a key is released
|
|
601
|
+
on_key_up: EventHandler[lambda e0: [e0.key]]
|
|
602
|
+
|
|
605
603
|
def _exclude_props(self) -> list[str]:
|
|
606
604
|
return super()._exclude_props() + [
|
|
607
605
|
"auto_height",
|
|
@@ -647,21 +645,6 @@ class Textarea(BaseHTML):
|
|
|
647
645
|
)
|
|
648
646
|
return tag
|
|
649
647
|
|
|
650
|
-
def get_event_triggers(self) -> Dict[str, Any]:
|
|
651
|
-
"""Get the event triggers that pass the component's value to the handler.
|
|
652
|
-
|
|
653
|
-
Returns:
|
|
654
|
-
A dict mapping the event trigger to the var that is passed to the handler.
|
|
655
|
-
"""
|
|
656
|
-
return {
|
|
657
|
-
**super().get_event_triggers(),
|
|
658
|
-
EventTriggers.ON_CHANGE: lambda e0: [e0.target.value],
|
|
659
|
-
EventTriggers.ON_FOCUS: lambda e0: [e0.target.value],
|
|
660
|
-
EventTriggers.ON_BLUR: lambda e0: [e0.target.value],
|
|
661
|
-
EventTriggers.ON_KEY_DOWN: lambda e0: [e0.key],
|
|
662
|
-
EventTriggers.ON_KEY_UP: lambda e0: [e0.key],
|
|
663
|
-
}
|
|
664
|
-
|
|
665
648
|
|
|
666
649
|
button = Button.create
|
|
667
650
|
fieldset = Fieldset.create
|
|
@@ -13,9 +13,9 @@ from jinja2 import Environment
|
|
|
13
13
|
from reflex.components.el.element import Element
|
|
14
14
|
from reflex.components.tags.tag import Tag
|
|
15
15
|
from reflex.constants import Dirs, EventTriggers
|
|
16
|
-
from reflex.event import EventChain
|
|
17
|
-
from reflex.utils import imports
|
|
16
|
+
from reflex.event import EventChain, EventHandler
|
|
18
17
|
from reflex.utils.format import format_event_chain
|
|
18
|
+
from reflex.utils.imports import ImportDict
|
|
19
19
|
from reflex.vars import BaseVar, Var
|
|
20
20
|
from .base import BaseHTML
|
|
21
21
|
|
|
@@ -409,7 +409,6 @@ class Fieldset(Element):
|
|
|
409
409
|
...
|
|
410
410
|
|
|
411
411
|
class Form(BaseHTML):
|
|
412
|
-
def get_event_triggers(self) -> Dict[str, Any]: ...
|
|
413
412
|
@overload
|
|
414
413
|
@classmethod
|
|
415
414
|
def create( # type: ignore
|
|
@@ -581,10 +580,11 @@ class Form(BaseHTML):
|
|
|
581
580
|
The form component.
|
|
582
581
|
"""
|
|
583
582
|
...
|
|
583
|
+
|
|
584
|
+
def add_imports(self) -> ImportDict: ...
|
|
584
585
|
def add_hooks(self) -> list[str]: ...
|
|
585
586
|
|
|
586
587
|
class Input(BaseHTML):
|
|
587
|
-
def get_event_triggers(self) -> Dict[str, Any]: ...
|
|
588
588
|
@overload
|
|
589
589
|
@classmethod
|
|
590
590
|
def create( # type: ignore
|
|
@@ -1822,7 +1822,6 @@ class Progress(BaseHTML):
|
|
|
1822
1822
|
...
|
|
1823
1823
|
|
|
1824
1824
|
class Select(BaseHTML):
|
|
1825
|
-
def get_event_triggers(self) -> Dict[str, Any]: ...
|
|
1826
1825
|
@overload
|
|
1827
1826
|
@classmethod
|
|
1828
1827
|
def create( # type: ignore
|
|
@@ -1987,7 +1986,6 @@ AUTO_HEIGHT_JS = '\nconst autoHeightOnInput = (e, is_enabled) => {\n if (is_e
|
|
|
1987
1986
|
ENTER_KEY_SUBMIT_JS = "\nconst enterKeySubmitOnKeyDown = (e, is_enabled) => {\n if (is_enabled && e.which === 13 && !e.shiftKey) {\n e.preventDefault();\n if (!e.repeat) {\n if (e.target.form) {\n e.target.form.requestSubmit();\n }\n }\n }\n}\n"
|
|
1988
1987
|
|
|
1989
1988
|
class Textarea(BaseHTML):
|
|
1990
|
-
def get_event_triggers(self) -> Dict[str, Any]: ...
|
|
1991
1989
|
@overload
|
|
1992
1990
|
@classmethod
|
|
1993
1991
|
def create( # type: ignore
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py."""
|
|
2
|
+
|
|
2
3
|
from typing import Any, Union
|
|
3
4
|
|
|
4
5
|
from reflex import Component
|
|
6
|
+
from reflex.constants.colors import Color
|
|
5
7
|
from reflex.vars import Var as Var
|
|
6
8
|
|
|
7
9
|
from .base import BaseHTML
|
|
@@ -309,6 +311,54 @@ class Svg(BaseHTML):
|
|
|
309
311
|
tag = "svg"
|
|
310
312
|
|
|
311
313
|
|
|
314
|
+
class Defs(BaseHTML):
|
|
315
|
+
"""Display the defs element."""
|
|
316
|
+
|
|
317
|
+
tag = "defs"
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
class Lineargradient(BaseHTML):
|
|
321
|
+
"""Display the linearGradient element."""
|
|
322
|
+
|
|
323
|
+
tag = "linearGradient"
|
|
324
|
+
|
|
325
|
+
# Units for the gradient
|
|
326
|
+
gradient_units: Var[Union[str, bool]]
|
|
327
|
+
|
|
328
|
+
# Transform applied to the gradient
|
|
329
|
+
gradient_transform: Var[Union[str, bool]]
|
|
330
|
+
|
|
331
|
+
# Method used to spread the gradient
|
|
332
|
+
spread_method: Var[Union[str, bool]]
|
|
333
|
+
|
|
334
|
+
# X coordinate of the starting point of the gradient
|
|
335
|
+
x1: Var[Union[str, int, bool]]
|
|
336
|
+
|
|
337
|
+
# X coordinate of the ending point of the gradient
|
|
338
|
+
x2: Var[Union[str, int, bool]]
|
|
339
|
+
|
|
340
|
+
# Y coordinate of the starting point of the gradient
|
|
341
|
+
y1: Var[Union[str, int, bool]]
|
|
342
|
+
|
|
343
|
+
# Y coordinate of the ending point of the gradient
|
|
344
|
+
y2: Var[Union[str, int, bool]]
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
class Stop(BaseHTML):
|
|
348
|
+
"""Display the stop element."""
|
|
349
|
+
|
|
350
|
+
tag = "stop"
|
|
351
|
+
|
|
352
|
+
# Offset of the gradient stop
|
|
353
|
+
offset: Var[Union[str, float, int]]
|
|
354
|
+
|
|
355
|
+
# Color of the gradient stop
|
|
356
|
+
stop_color: Var[Union[str, Color, bool]]
|
|
357
|
+
|
|
358
|
+
# Opacity of the gradient stop
|
|
359
|
+
stop_opacity: Var[Union[str, float, int, bool]]
|
|
360
|
+
|
|
361
|
+
|
|
312
362
|
class Path(BaseHTML):
|
|
313
363
|
"""Display the path element."""
|
|
314
364
|
|
|
@@ -331,4 +381,7 @@ picture = Picture.create
|
|
|
331
381
|
portal = Portal.create
|
|
332
382
|
source = Source.create
|
|
333
383
|
svg = Svg.create
|
|
384
|
+
defs = Defs.create
|
|
385
|
+
lineargradient = Lineargradient.create
|
|
386
|
+
stop = Stop.create
|
|
334
387
|
path = Path.create
|