reflex 0.6.4a3__py3-none-any.whl → 0.6.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of reflex might be problematic. Click here for more details.
- reflex/.templates/jinja/web/pages/custom_component.js.jinja2 +0 -14
- reflex/.templates/jinja/web/pages/utils.js.jinja2 +4 -8
- reflex/.templates/web/components/shiki/code.js +16 -11
- reflex/.templates/web/utils/state.js +29 -21
- reflex/__init__.py +4 -0
- reflex/__init__.pyi +4 -0
- reflex/app.py +148 -154
- reflex/app_mixins/lifespan.py +5 -1
- reflex/app_mixins/middleware.py +3 -1
- reflex/app_mixins/mixin.py +3 -2
- reflex/base.py +2 -4
- reflex/compiler/compiler.py +111 -37
- reflex/components/base/app_wrap.pyi +17 -17
- reflex/components/base/bare.py +72 -3
- reflex/components/base/body.pyi +17 -17
- reflex/components/base/document.pyi +81 -81
- reflex/components/base/error_boundary.pyi +25 -18
- reflex/components/base/fragment.pyi +17 -17
- reflex/components/base/head.pyi +33 -33
- reflex/components/base/link.pyi +33 -33
- reflex/components/base/meta.pyi +65 -65
- reflex/components/base/script.py +4 -4
- reflex/components/base/script.pyi +23 -20
- reflex/components/component.py +250 -31
- reflex/components/core/banner.py +1 -1
- reflex/components/core/banner.pyi +81 -81
- reflex/components/core/client_side_routing.pyi +33 -33
- reflex/components/core/clipboard.py +2 -2
- reflex/components/core/clipboard.pyi +24 -18
- reflex/components/core/debounce.py +2 -2
- reflex/components/core/debounce.pyi +18 -18
- reflex/components/core/html.pyi +17 -17
- reflex/components/core/upload.py +90 -28
- reflex/components/core/upload.pyi +128 -72
- reflex/components/datadisplay/code.py +55 -40
- reflex/components/datadisplay/code.pyi +46 -44
- reflex/components/datadisplay/dataeditor.py +21 -20
- reflex/components/datadisplay/dataeditor.pyi +103 -35
- reflex/components/datadisplay/shiki_code_block.py +60 -27
- reflex/components/datadisplay/shiki_code_block.pyi +86 -65
- reflex/components/dynamic.py +9 -5
- reflex/components/el/element.pyi +17 -17
- reflex/components/el/elements/base.pyi +17 -17
- reflex/components/el/elements/forms.py +12 -3
- reflex/components/el/elements/forms.pyi +293 -233
- reflex/components/el/elements/inline.pyi +449 -449
- reflex/components/el/elements/media.pyi +401 -401
- reflex/components/el/elements/metadata.pyi +97 -97
- reflex/components/el/elements/other.pyi +113 -113
- reflex/components/el/elements/scripts.pyi +49 -49
- reflex/components/el/elements/sectioning.pyi +241 -241
- reflex/components/el/elements/tables.pyi +161 -161
- reflex/components/el/elements/typography.pyi +241 -241
- reflex/components/gridjs/datatable.pyi +33 -33
- reflex/components/lucide/icon.py +1 -1
- reflex/components/lucide/icon.pyi +33 -33
- reflex/components/markdown/markdown.py +180 -49
- reflex/components/markdown/markdown.pyi +36 -19
- reflex/components/moment/moment.py +17 -21
- reflex/components/moment/moment.pyi +26 -21
- reflex/components/next/base.pyi +17 -17
- reflex/components/next/image.py +3 -3
- reflex/components/next/image.pyi +21 -19
- reflex/components/next/link.pyi +17 -17
- reflex/components/next/video.pyi +17 -17
- reflex/components/plotly/plotly.py +79 -78
- reflex/components/plotly/plotly.pyi +91 -41
- reflex/components/props.py +34 -0
- reflex/components/radix/primitives/accordion.py +15 -8
- reflex/components/radix/primitives/accordion.pyi +121 -118
- reflex/components/radix/primitives/base.pyi +33 -33
- reflex/components/radix/primitives/drawer.py +41 -20
- reflex/components/radix/primitives/drawer.pyi +279 -190
- reflex/components/radix/primitives/form.py +2 -2
- reflex/components/radix/primitives/form.pyi +200 -167
- reflex/components/radix/primitives/progress.pyi +81 -81
- reflex/components/radix/primitives/slider.pyi +89 -83
- reflex/components/radix/themes/base.py +30 -1
- reflex/components/radix/themes/base.pyi +286 -113
- reflex/components/radix/themes/color_mode.py +17 -9
- reflex/components/radix/themes/color_mode.pyi +68 -56
- reflex/components/radix/themes/components/alert_dialog.py +8 -5
- reflex/components/radix/themes/components/alert_dialog.pyi +125 -117
- reflex/components/radix/themes/components/aspect_ratio.pyi +17 -17
- reflex/components/radix/themes/components/avatar.py +1 -5
- reflex/components/radix/themes/components/avatar.pyi +17 -17
- reflex/components/radix/themes/components/badge.py +1 -5
- reflex/components/radix/themes/components/badge.pyi +17 -17
- reflex/components/radix/themes/components/button.pyi +18 -21
- reflex/components/radix/themes/components/callout.py +1 -4
- reflex/components/radix/themes/components/callout.pyi +81 -81
- reflex/components/radix/themes/components/card.py +1 -3
- reflex/components/radix/themes/components/card.pyi +17 -17
- reflex/components/radix/themes/components/checkbox.py +4 -8
- reflex/components/radix/themes/components/checkbox.pyi +61 -52
- reflex/components/radix/themes/components/checkbox_cards.pyi +33 -33
- reflex/components/radix/themes/components/checkbox_group.pyi +33 -33
- reflex/components/radix/themes/components/context_menu.py +121 -28
- reflex/components/radix/themes/components/context_menu.pyi +250 -147
- reflex/components/radix/themes/components/data_list.pyi +65 -65
- reflex/components/radix/themes/components/dialog.py +11 -11
- reflex/components/radix/themes/components/dialog.pyi +135 -120
- reflex/components/radix/themes/components/dropdown_menu.py +14 -25
- reflex/components/radix/themes/components/dropdown_menu.pyi +157 -145
- reflex/components/radix/themes/components/hover_card.py +19 -7
- reflex/components/radix/themes/components/hover_card.pyi +102 -67
- reflex/components/radix/themes/components/icon_button.pyi +18 -21
- reflex/components/radix/themes/components/inset.py +1 -3
- reflex/components/radix/themes/components/inset.pyi +17 -17
- reflex/components/radix/themes/components/popover.py +22 -13
- reflex/components/radix/themes/components/popover.pyi +98 -72
- reflex/components/radix/themes/components/progress.pyi +17 -17
- reflex/components/radix/themes/components/radio.pyi +17 -17
- reflex/components/radix/themes/components/radio_cards.py +2 -2
- reflex/components/radix/themes/components/radio_cards.pyi +37 -34
- reflex/components/radix/themes/components/radio_group.py +3 -7
- reflex/components/radix/themes/components/radio_group.pyi +69 -66
- reflex/components/radix/themes/components/scroll_area.py +1 -3
- reflex/components/radix/themes/components/scroll_area.pyi +17 -17
- reflex/components/radix/themes/components/segmented_control.pyi +37 -34
- reflex/components/radix/themes/components/select.py +7 -11
- reflex/components/radix/themes/components/select.pyi +175 -154
- reflex/components/radix/themes/components/separator.py +1 -4
- reflex/components/radix/themes/components/separator.pyi +17 -17
- reflex/components/radix/themes/components/skeleton.pyi +17 -17
- reflex/components/radix/themes/components/slider.py +12 -21
- reflex/components/radix/themes/components/slider.pyi +47 -25
- reflex/components/radix/themes/components/spinner.py +1 -4
- reflex/components/radix/themes/components/spinner.pyi +17 -17
- reflex/components/radix/themes/components/switch.py +3 -6
- reflex/components/radix/themes/components/switch.pyi +21 -18
- reflex/components/radix/themes/components/table.py +21 -5
- reflex/components/radix/themes/components/table.pyi +392 -116
- reflex/components/radix/themes/components/tabs.py +3 -6
- reflex/components/radix/themes/components/tabs.pyi +89 -83
- reflex/components/radix/themes/components/text_area.py +1 -5
- reflex/components/radix/themes/components/text_area.pyi +43 -20
- reflex/components/radix/themes/components/text_field.py +1 -5
- reflex/components/radix/themes/components/text_field.pyi +101 -55
- reflex/components/radix/themes/components/tooltip.py +5 -7
- reflex/components/radix/themes/components/tooltip.pyi +25 -22
- reflex/components/radix/themes/layout/base.py +2 -27
- reflex/components/radix/themes/layout/base.pyi +82 -82
- reflex/components/radix/themes/layout/box.pyi +17 -17
- reflex/components/radix/themes/layout/center.pyi +17 -17
- reflex/components/radix/themes/layout/container.pyi +17 -17
- reflex/components/radix/themes/layout/flex.py +1 -6
- reflex/components/radix/themes/layout/flex.pyi +17 -17
- reflex/components/radix/themes/layout/grid.py +1 -6
- reflex/components/radix/themes/layout/grid.pyi +17 -17
- reflex/components/radix/themes/layout/list.py +20 -15
- reflex/components/radix/themes/layout/list.pyi +175 -92
- reflex/components/radix/themes/layout/section.pyi +17 -17
- reflex/components/radix/themes/layout/spacer.pyi +17 -17
- reflex/components/radix/themes/layout/stack.py +6 -6
- reflex/components/radix/themes/layout/stack.pyi +91 -62
- reflex/components/radix/themes/typography/blockquote.py +2 -8
- reflex/components/radix/themes/typography/blockquote.pyi +17 -17
- reflex/components/radix/themes/typography/code.py +4 -10
- reflex/components/radix/themes/typography/code.pyi +19 -18
- reflex/components/radix/themes/typography/heading.py +4 -11
- reflex/components/radix/themes/typography/heading.pyi +19 -18
- reflex/components/radix/themes/typography/link.py +4 -10
- reflex/components/radix/themes/typography/link.pyi +19 -18
- reflex/components/radix/themes/typography/text.py +4 -11
- reflex/components/radix/themes/typography/text.pyi +115 -114
- reflex/components/react_player/audio.pyi +58 -33
- reflex/components/react_player/react_player.py +17 -17
- reflex/components/react_player/react_player.pyi +55 -33
- reflex/components/react_player/video.pyi +58 -33
- reflex/components/recharts/cartesian.py +45 -45
- reflex/components/recharts/cartesian.pyi +389 -304
- reflex/components/recharts/charts.py +22 -22
- reflex/components/recharts/charts.pyi +226 -179
- reflex/components/recharts/general.py +26 -27
- reflex/components/recharts/general.pyi +106 -99
- reflex/components/recharts/polar.py +33 -33
- reflex/components/recharts/polar.pyi +70 -64
- reflex/components/recharts/recharts.pyi +33 -33
- reflex/components/sonner/toast.py +9 -36
- reflex/components/sonner/toast.pyi +20 -24
- reflex/components/suneditor/editor.py +8 -8
- reflex/components/suneditor/editor.pyi +50 -25
- reflex/components/tags/iter_tag.py +1 -10
- reflex/components/tags/tag.py +1 -4
- reflex/config.py +198 -35
- reflex/constants/__init__.py +4 -16
- reflex/constants/base.py +7 -14
- reflex/constants/colors.py +0 -1
- reflex/constants/installer.py +12 -7
- reflex/constants/state.py +4 -0
- reflex/custom_components/custom_components.py +6 -6
- reflex/event.py +486 -241
- reflex/experimental/client_state.py +9 -9
- reflex/experimental/layout.py +2 -2
- reflex/experimental/layout.pyi +95 -87
- reflex/experimental/misc.py +1 -1
- reflex/istate/__init__.py +1 -0
- reflex/istate/proxy.py +33 -0
- reflex/istate/wrappers.py +27 -0
- reflex/model.py +7 -7
- reflex/page.py +2 -1
- reflex/reflex.py +142 -8
- reflex/state.py +133 -46
- reflex/testing.py +9 -7
- reflex/utils/console.py +0 -1
- reflex/utils/exceptions.py +31 -3
- reflex/utils/exec.py +33 -14
- reflex/utils/format.py +15 -12
- reflex/utils/net.py +1 -1
- reflex/utils/path_ops.py +2 -2
- reflex/utils/prerequisites.py +82 -46
- reflex/utils/pyi_generator.py +63 -20
- reflex/utils/registry.py +1 -1
- reflex/utils/serializers.py +75 -36
- reflex/utils/telemetry.py +3 -2
- reflex/utils/types.py +125 -10
- reflex/vars/base.py +131 -119
- reflex/vars/function.py +59 -12
- reflex/vars/number.py +3 -1
- reflex/vars/object.py +30 -24
- reflex/vars/sequence.py +7 -7
- {reflex-0.6.4a3.dist-info → reflex-0.6.5.dist-info}/METADATA +3 -3
- reflex-0.6.5.dist-info/RECORD +394 -0
- reflex-0.6.4a3.dist-info/RECORD +0 -391
- {reflex-0.6.4a3.dist-info → reflex-0.6.5.dist-info}/LICENSE +0 -0
- {reflex-0.6.4a3.dist-info → reflex-0.6.5.dist-info}/WHEEL +0 -0
- {reflex-0.6.4a3.dist-info → reflex-0.6.5.dist-info}/entry_points.txt +0 -0
|
@@ -6,13 +6,11 @@
|
|
|
6
6
|
from typing import Any, Dict, List, Literal, Optional, Union, overload
|
|
7
7
|
|
|
8
8
|
from reflex.constants.colors import Color
|
|
9
|
-
from reflex.event import EventType
|
|
9
|
+
from reflex.event import BASE_STATE, EventType
|
|
10
10
|
from reflex.style import Style
|
|
11
11
|
from reflex.vars.base import Var
|
|
12
12
|
|
|
13
|
-
from .recharts import
|
|
14
|
-
Recharts,
|
|
15
|
-
)
|
|
13
|
+
from .recharts import Recharts
|
|
16
14
|
|
|
17
15
|
class Pie(Recharts):
|
|
18
16
|
def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ...
|
|
@@ -83,15 +81,15 @@ class Pie(Recharts):
|
|
|
83
81
|
id: Optional[Any] = None,
|
|
84
82
|
class_name: Optional[Any] = None,
|
|
85
83
|
autofocus: Optional[bool] = None,
|
|
86
|
-
custom_attrs: Optional[Dict[str, Union[Var,
|
|
87
|
-
on_animation_end: Optional[EventType[[]]] = None,
|
|
88
|
-
on_animation_start: Optional[EventType[[]]] = None,
|
|
89
|
-
on_click: Optional[EventType[[]]] = None,
|
|
90
|
-
on_mouse_enter: Optional[EventType[[]]] = None,
|
|
91
|
-
on_mouse_leave: Optional[EventType[[]]] = None,
|
|
92
|
-
on_mouse_move: Optional[EventType[[]]] = None,
|
|
93
|
-
on_mouse_out: Optional[EventType[[]]] = None,
|
|
94
|
-
on_mouse_over: Optional[EventType[[]]] = None,
|
|
84
|
+
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
|
|
85
|
+
on_animation_end: Optional[EventType[[], BASE_STATE]] = None,
|
|
86
|
+
on_animation_start: Optional[EventType[[], BASE_STATE]] = None,
|
|
87
|
+
on_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
88
|
+
on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
|
|
89
|
+
on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
|
|
90
|
+
on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
|
|
91
|
+
on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
|
|
92
|
+
on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
|
|
95
93
|
**props,
|
|
96
94
|
) -> "Pie":
|
|
97
95
|
"""Create the component.
|
|
@@ -192,9 +190,9 @@ class Radar(Recharts):
|
|
|
192
190
|
id: Optional[Any] = None,
|
|
193
191
|
class_name: Optional[Any] = None,
|
|
194
192
|
autofocus: Optional[bool] = None,
|
|
195
|
-
custom_attrs: Optional[Dict[str, Union[Var,
|
|
196
|
-
on_animation_end: Optional[EventType[[]]] = None,
|
|
197
|
-
on_animation_start: Optional[EventType[[]]] = None,
|
|
193
|
+
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
|
|
194
|
+
on_animation_end: Optional[EventType[[], BASE_STATE]] = None,
|
|
195
|
+
on_animation_start: Optional[EventType[[], BASE_STATE]] = None,
|
|
198
196
|
**props,
|
|
199
197
|
) -> "Radar":
|
|
200
198
|
"""Create the component.
|
|
@@ -288,15 +286,15 @@ class RadialBar(Recharts):
|
|
|
288
286
|
id: Optional[Any] = None,
|
|
289
287
|
class_name: Optional[Any] = None,
|
|
290
288
|
autofocus: Optional[bool] = None,
|
|
291
|
-
custom_attrs: Optional[Dict[str, Union[Var,
|
|
292
|
-
on_animation_end: Optional[EventType[[]]] = None,
|
|
293
|
-
on_animation_start: Optional[EventType[[]]] = None,
|
|
294
|
-
on_click: Optional[EventType[[]]] = None,
|
|
295
|
-
on_mouse_enter: Optional[EventType[[]]] = None,
|
|
296
|
-
on_mouse_leave: Optional[EventType[[]]] = None,
|
|
297
|
-
on_mouse_move: Optional[EventType[[]]] = None,
|
|
298
|
-
on_mouse_out: Optional[EventType[[]]] = None,
|
|
299
|
-
on_mouse_over: Optional[EventType[[]]] = None,
|
|
289
|
+
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
|
|
290
|
+
on_animation_end: Optional[EventType[[], BASE_STATE]] = None,
|
|
291
|
+
on_animation_start: Optional[EventType[[], BASE_STATE]] = None,
|
|
292
|
+
on_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
293
|
+
on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
|
|
294
|
+
on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
|
|
295
|
+
on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
|
|
296
|
+
on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
|
|
297
|
+
on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
|
|
300
298
|
**props,
|
|
301
299
|
) -> "RadialBar":
|
|
302
300
|
"""Create the component.
|
|
@@ -357,22 +355,22 @@ class PolarAngleAxis(Recharts):
|
|
|
357
355
|
id: Optional[Any] = None,
|
|
358
356
|
class_name: Optional[Any] = None,
|
|
359
357
|
autofocus: Optional[bool] = None,
|
|
360
|
-
custom_attrs: Optional[Dict[str, Union[Var,
|
|
361
|
-
on_blur: Optional[EventType[[]]] = None,
|
|
362
|
-
on_click: Optional[EventType[[]]] = None,
|
|
363
|
-
on_context_menu: Optional[EventType[[]]] = None,
|
|
364
|
-
on_double_click: Optional[EventType[[]]] = None,
|
|
365
|
-
on_focus: Optional[EventType[[]]] = None,
|
|
366
|
-
on_mount: Optional[EventType[[]]] = None,
|
|
367
|
-
on_mouse_down: Optional[EventType[[]]] = None,
|
|
368
|
-
on_mouse_enter: Optional[EventType[[]]] = None,
|
|
369
|
-
on_mouse_leave: Optional[EventType[[]]] = None,
|
|
370
|
-
on_mouse_move: Optional[EventType[[]]] = None,
|
|
371
|
-
on_mouse_out: Optional[EventType[[]]] = None,
|
|
372
|
-
on_mouse_over: Optional[EventType[[]]] = None,
|
|
373
|
-
on_mouse_up: Optional[EventType[[]]] = None,
|
|
374
|
-
on_scroll: Optional[EventType[[]]] = None,
|
|
375
|
-
on_unmount: Optional[EventType[[]]] = None,
|
|
358
|
+
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
|
|
359
|
+
on_blur: Optional[EventType[[], BASE_STATE]] = None,
|
|
360
|
+
on_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
361
|
+
on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
|
|
362
|
+
on_double_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
363
|
+
on_focus: Optional[EventType[[], BASE_STATE]] = None,
|
|
364
|
+
on_mount: Optional[EventType[[], BASE_STATE]] = None,
|
|
365
|
+
on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
|
|
366
|
+
on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
|
|
367
|
+
on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
|
|
368
|
+
on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
|
|
369
|
+
on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
|
|
370
|
+
on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
|
|
371
|
+
on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
|
|
372
|
+
on_scroll: Optional[EventType[[], BASE_STATE]] = None,
|
|
373
|
+
on_unmount: Optional[EventType[[], BASE_STATE]] = None,
|
|
376
374
|
**props,
|
|
377
375
|
) -> "PolarAngleAxis":
|
|
378
376
|
"""Create the component.
|
|
@@ -391,6 +389,14 @@ class PolarAngleAxis(Recharts):
|
|
|
391
389
|
orientation: The orientation of axis text. Default: "outer"
|
|
392
390
|
stroke: The stroke color of axis. Default: rx.color("gray", 10)
|
|
393
391
|
allow_duplicated_category: Allow the axis has duplicated categorys or not when the type of axis is "category". Default: True
|
|
392
|
+
on_click: The customized event handler of click on the ticks of this axis.
|
|
393
|
+
on_mouse_down: The customized event handler of mousedown on the the ticks of this axis.
|
|
394
|
+
on_mouse_up: The customized event handler of mouseup on the ticks of this axis.
|
|
395
|
+
on_mouse_move: The customized event handler of mousemove on the ticks of this axis.
|
|
396
|
+
on_mouse_over: The customized event handler of mouseover on the ticks of this axis.
|
|
397
|
+
on_mouse_out: The customized event handler of mouseout on the ticks of this axis.
|
|
398
|
+
on_mouse_enter: The customized event handler of moustenter on the ticks of this axis.
|
|
399
|
+
on_mouse_leave: The customized event handler of mouseleave on the ticks of this axis.
|
|
394
400
|
style: The style of the component.
|
|
395
401
|
key: A unique key for the component.
|
|
396
402
|
id: The id for the component.
|
|
@@ -425,22 +431,22 @@ class PolarGrid(Recharts):
|
|
|
425
431
|
id: Optional[Any] = None,
|
|
426
432
|
class_name: Optional[Any] = None,
|
|
427
433
|
autofocus: Optional[bool] = None,
|
|
428
|
-
custom_attrs: Optional[Dict[str, Union[Var,
|
|
429
|
-
on_blur: Optional[EventType[[]]] = None,
|
|
430
|
-
on_click: Optional[EventType[[]]] = None,
|
|
431
|
-
on_context_menu: Optional[EventType[[]]] = None,
|
|
432
|
-
on_double_click: Optional[EventType[[]]] = None,
|
|
433
|
-
on_focus: Optional[EventType[[]]] = None,
|
|
434
|
-
on_mount: Optional[EventType[[]]] = None,
|
|
435
|
-
on_mouse_down: Optional[EventType[[]]] = None,
|
|
436
|
-
on_mouse_enter: Optional[EventType[[]]] = None,
|
|
437
|
-
on_mouse_leave: Optional[EventType[[]]] = None,
|
|
438
|
-
on_mouse_move: Optional[EventType[[]]] = None,
|
|
439
|
-
on_mouse_out: Optional[EventType[[]]] = None,
|
|
440
|
-
on_mouse_over: Optional[EventType[[]]] = None,
|
|
441
|
-
on_mouse_up: Optional[EventType[[]]] = None,
|
|
442
|
-
on_scroll: Optional[EventType[[]]] = None,
|
|
443
|
-
on_unmount: Optional[EventType[[]]] = None,
|
|
434
|
+
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
|
|
435
|
+
on_blur: Optional[EventType[[], BASE_STATE]] = None,
|
|
436
|
+
on_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
437
|
+
on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
|
|
438
|
+
on_double_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
439
|
+
on_focus: Optional[EventType[[], BASE_STATE]] = None,
|
|
440
|
+
on_mount: Optional[EventType[[], BASE_STATE]] = None,
|
|
441
|
+
on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
|
|
442
|
+
on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
|
|
443
|
+
on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
|
|
444
|
+
on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
|
|
445
|
+
on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
|
|
446
|
+
on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
|
|
447
|
+
on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
|
|
448
|
+
on_scroll: Optional[EventType[[], BASE_STATE]] = None,
|
|
449
|
+
on_unmount: Optional[EventType[[], BASE_STATE]] = None,
|
|
444
450
|
**props,
|
|
445
451
|
) -> "PolarGrid":
|
|
446
452
|
"""Create the component.
|
|
@@ -545,13 +551,13 @@ class PolarRadiusAxis(Recharts):
|
|
|
545
551
|
id: Optional[Any] = None,
|
|
546
552
|
class_name: Optional[Any] = None,
|
|
547
553
|
autofocus: Optional[bool] = None,
|
|
548
|
-
custom_attrs: Optional[Dict[str, Union[Var,
|
|
549
|
-
on_click: Optional[EventType[[]]] = None,
|
|
550
|
-
on_mouse_enter: Optional[EventType[[]]] = None,
|
|
551
|
-
on_mouse_leave: Optional[EventType[[]]] = None,
|
|
552
|
-
on_mouse_move: Optional[EventType[[]]] = None,
|
|
553
|
-
on_mouse_out: Optional[EventType[[]]] = None,
|
|
554
|
-
on_mouse_over: Optional[EventType[[]]] = None,
|
|
554
|
+
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
|
|
555
|
+
on_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
556
|
+
on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
|
|
557
|
+
on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
|
|
558
|
+
on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
|
|
559
|
+
on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
|
|
560
|
+
on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
|
|
555
561
|
**props,
|
|
556
562
|
) -> "PolarRadiusAxis":
|
|
557
563
|
"""Create the component.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
from typing import Any, Dict, Literal, Optional, Union, overload
|
|
7
7
|
|
|
8
8
|
from reflex.components.component import Component, MemoizationLeaf, NoSSRComponent
|
|
9
|
-
from reflex.event import EventType
|
|
9
|
+
from reflex.event import BASE_STATE, EventType
|
|
10
10
|
from reflex.style import Style
|
|
11
11
|
from reflex.vars.base import Var
|
|
12
12
|
|
|
@@ -22,22 +22,22 @@ class Recharts(Component):
|
|
|
22
22
|
id: Optional[Any] = None,
|
|
23
23
|
class_name: Optional[Any] = None,
|
|
24
24
|
autofocus: Optional[bool] = None,
|
|
25
|
-
custom_attrs: Optional[Dict[str, Union[Var,
|
|
26
|
-
on_blur: Optional[EventType[[]]] = None,
|
|
27
|
-
on_click: Optional[EventType[[]]] = None,
|
|
28
|
-
on_context_menu: Optional[EventType[[]]] = None,
|
|
29
|
-
on_double_click: Optional[EventType[[]]] = None,
|
|
30
|
-
on_focus: Optional[EventType[[]]] = None,
|
|
31
|
-
on_mount: Optional[EventType[[]]] = None,
|
|
32
|
-
on_mouse_down: Optional[EventType[[]]] = None,
|
|
33
|
-
on_mouse_enter: Optional[EventType[[]]] = None,
|
|
34
|
-
on_mouse_leave: Optional[EventType[[]]] = None,
|
|
35
|
-
on_mouse_move: Optional[EventType[[]]] = None,
|
|
36
|
-
on_mouse_out: Optional[EventType[[]]] = None,
|
|
37
|
-
on_mouse_over: Optional[EventType[[]]] = None,
|
|
38
|
-
on_mouse_up: Optional[EventType[[]]] = None,
|
|
39
|
-
on_scroll: Optional[EventType[[]]] = None,
|
|
40
|
-
on_unmount: Optional[EventType[[]]] = None,
|
|
25
|
+
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
|
|
26
|
+
on_blur: Optional[EventType[[], BASE_STATE]] = None,
|
|
27
|
+
on_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
28
|
+
on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
|
|
29
|
+
on_double_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
30
|
+
on_focus: Optional[EventType[[], BASE_STATE]] = None,
|
|
31
|
+
on_mount: Optional[EventType[[], BASE_STATE]] = None,
|
|
32
|
+
on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
|
|
33
|
+
on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
|
|
34
|
+
on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
|
|
35
|
+
on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
|
|
36
|
+
on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
|
|
37
|
+
on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
|
|
38
|
+
on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
|
|
39
|
+
on_scroll: Optional[EventType[[], BASE_STATE]] = None,
|
|
40
|
+
on_unmount: Optional[EventType[[], BASE_STATE]] = None,
|
|
41
41
|
**props,
|
|
42
42
|
) -> "Recharts":
|
|
43
43
|
"""Create the component.
|
|
@@ -68,22 +68,22 @@ class RechartsCharts(NoSSRComponent, MemoizationLeaf):
|
|
|
68
68
|
id: Optional[Any] = None,
|
|
69
69
|
class_name: Optional[Any] = None,
|
|
70
70
|
autofocus: Optional[bool] = None,
|
|
71
|
-
custom_attrs: Optional[Dict[str, Union[Var,
|
|
72
|
-
on_blur: Optional[EventType[[]]] = None,
|
|
73
|
-
on_click: Optional[EventType[[]]] = None,
|
|
74
|
-
on_context_menu: Optional[EventType[[]]] = None,
|
|
75
|
-
on_double_click: Optional[EventType[[]]] = None,
|
|
76
|
-
on_focus: Optional[EventType[[]]] = None,
|
|
77
|
-
on_mount: Optional[EventType[[]]] = None,
|
|
78
|
-
on_mouse_down: Optional[EventType[[]]] = None,
|
|
79
|
-
on_mouse_enter: Optional[EventType[[]]] = None,
|
|
80
|
-
on_mouse_leave: Optional[EventType[[]]] = None,
|
|
81
|
-
on_mouse_move: Optional[EventType[[]]] = None,
|
|
82
|
-
on_mouse_out: Optional[EventType[[]]] = None,
|
|
83
|
-
on_mouse_over: Optional[EventType[[]]] = None,
|
|
84
|
-
on_mouse_up: Optional[EventType[[]]] = None,
|
|
85
|
-
on_scroll: Optional[EventType[[]]] = None,
|
|
86
|
-
on_unmount: Optional[EventType[[]]] = None,
|
|
71
|
+
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
|
|
72
|
+
on_blur: Optional[EventType[[], BASE_STATE]] = None,
|
|
73
|
+
on_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
74
|
+
on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
|
|
75
|
+
on_double_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
76
|
+
on_focus: Optional[EventType[[], BASE_STATE]] = None,
|
|
77
|
+
on_mount: Optional[EventType[[], BASE_STATE]] = None,
|
|
78
|
+
on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
|
|
79
|
+
on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
|
|
80
|
+
on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
|
|
81
|
+
on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
|
|
82
|
+
on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
|
|
83
|
+
on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
|
|
84
|
+
on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
|
|
85
|
+
on_scroll: Optional[EventType[[], BASE_STATE]] = None,
|
|
86
|
+
on_unmount: Optional[EventType[[], BASE_STATE]] = None,
|
|
87
87
|
**props,
|
|
88
88
|
) -> "RechartsCharts":
|
|
89
89
|
"""Create a new memoization leaf component.
|
|
@@ -4,16 +4,11 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
from typing import Any, ClassVar, Literal, Optional, Union
|
|
6
6
|
|
|
7
|
-
from pydantic import ValidationError
|
|
8
|
-
|
|
9
7
|
from reflex.base import Base
|
|
10
8
|
from reflex.components.component import Component, ComponentNamespace
|
|
11
9
|
from reflex.components.lucide.icon import Icon
|
|
12
|
-
from reflex.components.props import PropsBase
|
|
13
|
-
from reflex.event import
|
|
14
|
-
EventSpec,
|
|
15
|
-
call_script,
|
|
16
|
-
)
|
|
10
|
+
from reflex.components.props import NoExtrasAllowedProps, PropsBase
|
|
11
|
+
from reflex.event import EventSpec, run_script
|
|
17
12
|
from reflex.style import Style, resolved_color_mode
|
|
18
13
|
from reflex.utils import format
|
|
19
14
|
from reflex.utils.imports import ImportVar
|
|
@@ -72,7 +67,7 @@ def _toast_callback_signature(toast: Var) -> list[Var]:
|
|
|
72
67
|
]
|
|
73
68
|
|
|
74
69
|
|
|
75
|
-
class ToastProps(PropsBase):
|
|
70
|
+
class ToastProps(PropsBase, NoExtrasAllowedProps):
|
|
76
71
|
"""Props for the toast component."""
|
|
77
72
|
|
|
78
73
|
# Toast's title, renders above the description.
|
|
@@ -119,6 +114,9 @@ class ToastProps(PropsBase):
|
|
|
119
114
|
# Custom style for the toast.
|
|
120
115
|
style: Optional[Style]
|
|
121
116
|
|
|
117
|
+
# Class name for the toast.
|
|
118
|
+
class_name: Optional[str]
|
|
119
|
+
|
|
122
120
|
# XXX: These still do not seem to work
|
|
123
121
|
# Custom style for the toast primary button.
|
|
124
122
|
action_button_styles: Optional[Style]
|
|
@@ -132,24 +130,6 @@ class ToastProps(PropsBase):
|
|
|
132
130
|
# Function that gets called when the toast disappears automatically after it's timeout (duration` prop).
|
|
133
131
|
on_auto_close: Optional[Any]
|
|
134
132
|
|
|
135
|
-
def __init__(self, **kwargs):
|
|
136
|
-
"""Initialize the props.
|
|
137
|
-
|
|
138
|
-
Args:
|
|
139
|
-
kwargs: Kwargs to initialize the props.
|
|
140
|
-
|
|
141
|
-
Raises:
|
|
142
|
-
ValueError: If invalid props are passed on instantiation.
|
|
143
|
-
"""
|
|
144
|
-
try:
|
|
145
|
-
super().__init__(**kwargs)
|
|
146
|
-
except ValidationError as e:
|
|
147
|
-
invalid_fields = ", ".join([error["loc"][0] for error in e.errors()]) # type: ignore
|
|
148
|
-
supported_props_str = ", ".join(f'"{field}"' for field in self.get_fields())
|
|
149
|
-
raise ValueError(
|
|
150
|
-
f"Invalid prop(s) {invalid_fields} for rx.toast. Supported props are {supported_props_str}"
|
|
151
|
-
) from None
|
|
152
|
-
|
|
153
133
|
def dict(self, *args, **kwargs) -> dict[str, Any]:
|
|
154
134
|
"""Convert the object to a dictionary.
|
|
155
135
|
|
|
@@ -181,13 +161,6 @@ class ToastProps(PropsBase):
|
|
|
181
161
|
)
|
|
182
162
|
return d
|
|
183
163
|
|
|
184
|
-
class Config:
|
|
185
|
-
"""Pydantic config."""
|
|
186
|
-
|
|
187
|
-
arbitrary_types_allowed = True
|
|
188
|
-
use_enum_values = True
|
|
189
|
-
extra = "forbid"
|
|
190
|
-
|
|
191
164
|
|
|
192
165
|
class Toaster(Component):
|
|
193
166
|
"""A Toaster Component for displaying toast notifications."""
|
|
@@ -281,13 +254,13 @@ class Toaster(Component):
|
|
|
281
254
|
if message == "" and ("title" not in props or "description" not in props):
|
|
282
255
|
raise ValueError("Toast message or title or description must be provided.")
|
|
283
256
|
if props:
|
|
284
|
-
args = LiteralVar.create(ToastProps(**props))
|
|
257
|
+
args = LiteralVar.create(ToastProps(component_name="rx.toast", **props)) # type: ignore
|
|
285
258
|
toast = f"{toast_command}(`{message}`, {str(args)})"
|
|
286
259
|
else:
|
|
287
260
|
toast = f"{toast_command}(`{message}`)"
|
|
288
261
|
|
|
289
262
|
toast_action = Var(_js_expr=toast)
|
|
290
|
-
return
|
|
263
|
+
return run_script(toast_action)
|
|
291
264
|
|
|
292
265
|
@staticmethod
|
|
293
266
|
def toast_info(message: str = "", **kwargs):
|
|
@@ -363,7 +336,7 @@ class Toaster(Component):
|
|
|
363
336
|
dismiss_action = Var(
|
|
364
337
|
_js_expr=dismiss, _var_data=VarData.merge(dismiss_var_data)
|
|
365
338
|
)
|
|
366
|
-
return
|
|
339
|
+
return run_script(dismiss_action)
|
|
367
340
|
|
|
368
341
|
@classmethod
|
|
369
342
|
def create(cls, *children, **props) -> Component:
|
|
@@ -8,8 +8,8 @@ from typing import Any, ClassVar, Dict, Literal, Optional, Union, overload
|
|
|
8
8
|
from reflex.base import Base
|
|
9
9
|
from reflex.components.component import Component, ComponentNamespace
|
|
10
10
|
from reflex.components.lucide.icon import Icon
|
|
11
|
-
from reflex.components.props import PropsBase
|
|
12
|
-
from reflex.event import EventSpec, EventType
|
|
11
|
+
from reflex.components.props import NoExtrasAllowedProps, PropsBase
|
|
12
|
+
from reflex.event import BASE_STATE, EventSpec, EventType
|
|
13
13
|
from reflex.style import Style
|
|
14
14
|
from reflex.utils.serializers import serializer
|
|
15
15
|
from reflex.vars.base import Var
|
|
@@ -31,7 +31,7 @@ class ToastAction(Base):
|
|
|
31
31
|
@serializer
|
|
32
32
|
def serialize_action(action: ToastAction) -> dict: ...
|
|
33
33
|
|
|
34
|
-
class ToastProps(PropsBase):
|
|
34
|
+
class ToastProps(PropsBase, NoExtrasAllowedProps):
|
|
35
35
|
title: Optional[Union[str, Var]]
|
|
36
36
|
description: Optional[Union[str, Var]]
|
|
37
37
|
close_button: Optional[bool]
|
|
@@ -45,6 +45,7 @@ class ToastProps(PropsBase):
|
|
|
45
45
|
id: Optional[Union[str, Var]]
|
|
46
46
|
unstyled: Optional[bool]
|
|
47
47
|
style: Optional[Style]
|
|
48
|
+
class_name: Optional[str]
|
|
48
49
|
action_button_styles: Optional[Style]
|
|
49
50
|
cancel_button_styles: Optional[Style]
|
|
50
51
|
on_dismiss: Optional[Any]
|
|
@@ -52,11 +53,6 @@ class ToastProps(PropsBase):
|
|
|
52
53
|
|
|
53
54
|
def dict(self, *args, **kwargs) -> dict[str, Any]: ...
|
|
54
55
|
|
|
55
|
-
class Config:
|
|
56
|
-
arbitrary_types_allowed = True
|
|
57
|
-
use_enum_values = True
|
|
58
|
-
extra = "forbid"
|
|
59
|
-
|
|
60
56
|
class Toaster(Component):
|
|
61
57
|
is_used: ClassVar[bool] = False
|
|
62
58
|
|
|
@@ -120,22 +116,22 @@ class Toaster(Component):
|
|
|
120
116
|
id: Optional[Any] = None,
|
|
121
117
|
class_name: Optional[Any] = None,
|
|
122
118
|
autofocus: Optional[bool] = None,
|
|
123
|
-
custom_attrs: Optional[Dict[str, Union[Var,
|
|
124
|
-
on_blur: Optional[EventType[[]]] = None,
|
|
125
|
-
on_click: Optional[EventType[[]]] = None,
|
|
126
|
-
on_context_menu: Optional[EventType[[]]] = None,
|
|
127
|
-
on_double_click: Optional[EventType[[]]] = None,
|
|
128
|
-
on_focus: Optional[EventType[[]]] = None,
|
|
129
|
-
on_mount: Optional[EventType[[]]] = None,
|
|
130
|
-
on_mouse_down: Optional[EventType[[]]] = None,
|
|
131
|
-
on_mouse_enter: Optional[EventType[[]]] = None,
|
|
132
|
-
on_mouse_leave: Optional[EventType[[]]] = None,
|
|
133
|
-
on_mouse_move: Optional[EventType[[]]] = None,
|
|
134
|
-
on_mouse_out: Optional[EventType[[]]] = None,
|
|
135
|
-
on_mouse_over: Optional[EventType[[]]] = None,
|
|
136
|
-
on_mouse_up: Optional[EventType[[]]] = None,
|
|
137
|
-
on_scroll: Optional[EventType[[]]] = None,
|
|
138
|
-
on_unmount: Optional[EventType[[]]] = None,
|
|
119
|
+
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
|
|
120
|
+
on_blur: Optional[EventType[[], BASE_STATE]] = None,
|
|
121
|
+
on_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
122
|
+
on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
|
|
123
|
+
on_double_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
124
|
+
on_focus: Optional[EventType[[], BASE_STATE]] = None,
|
|
125
|
+
on_mount: Optional[EventType[[], BASE_STATE]] = None,
|
|
126
|
+
on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
|
|
127
|
+
on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
|
|
128
|
+
on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
|
|
129
|
+
on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
|
|
130
|
+
on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
|
|
131
|
+
on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
|
|
132
|
+
on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
|
|
133
|
+
on_scroll: Optional[EventType[[], BASE_STATE]] = None,
|
|
134
|
+
on_unmount: Optional[EventType[[], BASE_STATE]] = None,
|
|
139
135
|
**props,
|
|
140
136
|
) -> "Toaster":
|
|
141
137
|
"""Create a toaster component.
|
|
@@ -7,7 +7,7 @@ from typing import Dict, List, Literal, Optional, Tuple, Union
|
|
|
7
7
|
|
|
8
8
|
from reflex.base import Base
|
|
9
9
|
from reflex.components.component import Component, NoSSRComponent
|
|
10
|
-
from reflex.event import EventHandler,
|
|
10
|
+
from reflex.event import EventHandler, no_args_event_spec, passthrough_event_spec
|
|
11
11
|
from reflex.utils.format import to_camel_case
|
|
12
12
|
from reflex.utils.imports import ImportDict, ImportVar
|
|
13
13
|
from reflex.vars.base import Var
|
|
@@ -207,31 +207,31 @@ class Editor(NoSSRComponent):
|
|
|
207
207
|
disable_toolbar: Var[bool]
|
|
208
208
|
|
|
209
209
|
# Fired when the editor content changes.
|
|
210
|
-
on_change: EventHandler[
|
|
210
|
+
on_change: EventHandler[passthrough_event_spec(str)]
|
|
211
211
|
|
|
212
212
|
# Fired when the something is inputted in the editor.
|
|
213
|
-
on_input: EventHandler[
|
|
213
|
+
on_input: EventHandler[no_args_event_spec]
|
|
214
214
|
|
|
215
215
|
# Fired when the editor loses focus.
|
|
216
216
|
on_blur: EventHandler[on_blur_spec]
|
|
217
217
|
|
|
218
218
|
# Fired when the editor is loaded.
|
|
219
|
-
on_load: EventHandler[
|
|
219
|
+
on_load: EventHandler[passthrough_event_spec(bool)]
|
|
220
220
|
|
|
221
221
|
# Fired when the editor content is copied.
|
|
222
|
-
on_copy: EventHandler[
|
|
222
|
+
on_copy: EventHandler[no_args_event_spec]
|
|
223
223
|
|
|
224
224
|
# Fired when the editor content is cut.
|
|
225
|
-
on_cut: EventHandler[
|
|
225
|
+
on_cut: EventHandler[no_args_event_spec]
|
|
226
226
|
|
|
227
227
|
# Fired when the editor content is pasted.
|
|
228
228
|
on_paste: EventHandler[on_paste_spec]
|
|
229
229
|
|
|
230
230
|
# Fired when the code view is toggled.
|
|
231
|
-
toggle_code_view: EventHandler[
|
|
231
|
+
toggle_code_view: EventHandler[passthrough_event_spec(bool)]
|
|
232
232
|
|
|
233
233
|
# Fired when the full screen mode is toggled.
|
|
234
|
-
toggle_full_screen: EventHandler[
|
|
234
|
+
toggle_full_screen: EventHandler[passthrough_event_spec(bool)]
|
|
235
235
|
|
|
236
236
|
def add_imports(self) -> ImportDict:
|
|
237
237
|
"""Add imports for the Editor component.
|
|
@@ -8,7 +8,7 @@ from typing import Any, Dict, List, Literal, Optional, Tuple, Union, overload
|
|
|
8
8
|
|
|
9
9
|
from reflex.base import Base
|
|
10
10
|
from reflex.components.component import NoSSRComponent
|
|
11
|
-
from reflex.event import EventType
|
|
11
|
+
from reflex.event import BASE_STATE, EventType
|
|
12
12
|
from reflex.style import Style
|
|
13
13
|
from reflex.utils.imports import ImportDict
|
|
14
14
|
from reflex.vars.base import Var
|
|
@@ -126,30 +126,46 @@ class Editor(NoSSRComponent):
|
|
|
126
126
|
id: Optional[Any] = None,
|
|
127
127
|
class_name: Optional[Any] = None,
|
|
128
128
|
autofocus: Optional[bool] = None,
|
|
129
|
-
custom_attrs: Optional[Dict[str, Union[Var,
|
|
130
|
-
on_blur: Optional[
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
129
|
+
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
|
|
130
|
+
on_blur: Optional[
|
|
131
|
+
Union[EventType[[], BASE_STATE], EventType[[str], BASE_STATE]]
|
|
132
|
+
] = None,
|
|
133
|
+
on_change: Optional[
|
|
134
|
+
Union[EventType[[], BASE_STATE], EventType[[str], BASE_STATE]]
|
|
135
|
+
] = None,
|
|
136
|
+
on_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
137
|
+
on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
|
|
138
|
+
on_copy: Optional[EventType[[], BASE_STATE]] = None,
|
|
139
|
+
on_cut: Optional[EventType[[], BASE_STATE]] = None,
|
|
140
|
+
on_double_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
141
|
+
on_focus: Optional[EventType[[], BASE_STATE]] = None,
|
|
142
|
+
on_input: Optional[EventType[[], BASE_STATE]] = None,
|
|
143
|
+
on_load: Optional[
|
|
144
|
+
Union[EventType[[], BASE_STATE], EventType[[bool], BASE_STATE]]
|
|
145
|
+
] = None,
|
|
146
|
+
on_mount: Optional[EventType[[], BASE_STATE]] = None,
|
|
147
|
+
on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
|
|
148
|
+
on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
|
|
149
|
+
on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
|
|
150
|
+
on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
|
|
151
|
+
on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
|
|
152
|
+
on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
|
|
153
|
+
on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
|
|
154
|
+
on_paste: Optional[
|
|
155
|
+
Union[
|
|
156
|
+
EventType[[], BASE_STATE],
|
|
157
|
+
EventType[[str], BASE_STATE],
|
|
158
|
+
EventType[[str, bool], BASE_STATE],
|
|
159
|
+
]
|
|
160
|
+
] = None,
|
|
161
|
+
on_scroll: Optional[EventType[[], BASE_STATE]] = None,
|
|
162
|
+
on_unmount: Optional[EventType[[], BASE_STATE]] = None,
|
|
163
|
+
toggle_code_view: Optional[
|
|
164
|
+
Union[EventType[[], BASE_STATE], EventType[[bool], BASE_STATE]]
|
|
165
|
+
] = None,
|
|
166
|
+
toggle_full_screen: Optional[
|
|
167
|
+
Union[EventType[[], BASE_STATE], EventType[[bool], BASE_STATE]]
|
|
168
|
+
] = None,
|
|
153
169
|
**props,
|
|
154
170
|
) -> "Editor":
|
|
155
171
|
"""Create an instance of Editor. No children allowed.
|
|
@@ -172,6 +188,15 @@ class Editor(NoSSRComponent):
|
|
|
172
188
|
hide: Hide the editor default: False
|
|
173
189
|
hide_toolbar: Hide the editor toolbar default: False
|
|
174
190
|
disable_toolbar: Disable the editor toolbar default: False
|
|
191
|
+
on_change: Fired when the editor content changes.
|
|
192
|
+
on_input: Fired when the something is inputted in the editor.
|
|
193
|
+
on_blur: Fired when the editor loses focus.
|
|
194
|
+
on_load: Fired when the editor is loaded.
|
|
195
|
+
on_copy: Fired when the editor content is copied.
|
|
196
|
+
on_cut: Fired when the editor content is cut.
|
|
197
|
+
on_paste: Fired when the editor content is pasted.
|
|
198
|
+
toggle_code_view: Fired when the code view is toggled.
|
|
199
|
+
toggle_full_screen: Fired when the full screen mode is toggled.
|
|
175
200
|
style: The style of the component.
|
|
176
201
|
key: A unique key for the component.
|
|
177
202
|
id: The id for the component.
|
|
@@ -4,16 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import dataclasses
|
|
6
6
|
import inspect
|
|
7
|
-
from typing import
|
|
8
|
-
TYPE_CHECKING,
|
|
9
|
-
Any,
|
|
10
|
-
Callable,
|
|
11
|
-
Iterable,
|
|
12
|
-
Tuple,
|
|
13
|
-
Type,
|
|
14
|
-
Union,
|
|
15
|
-
get_args,
|
|
16
|
-
)
|
|
7
|
+
from typing import TYPE_CHECKING, Any, Callable, Iterable, Tuple, Type, Union, get_args
|
|
17
8
|
|
|
18
9
|
from reflex.components.tags.tag import Tag
|
|
19
10
|
from reflex.vars import LiteralArrayVar, Var, get_unique_variable_name
|
reflex/components/tags/tag.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import dataclasses
|
|
6
|
-
from typing import Any, Dict, List, Optional,
|
|
6
|
+
from typing import Any, Dict, List, Optional, Union
|
|
7
7
|
|
|
8
8
|
from reflex.event import EventChain
|
|
9
9
|
from reflex.utils import format, types
|
|
@@ -23,9 +23,6 @@ class Tag:
|
|
|
23
23
|
# The inner contents of the tag.
|
|
24
24
|
contents: str = ""
|
|
25
25
|
|
|
26
|
-
# Args to pass to the tag.
|
|
27
|
-
args: Optional[Tuple[str, ...]] = None
|
|
28
|
-
|
|
29
26
|
# Special props that aren't key value pairs.
|
|
30
27
|
special_props: List[Var] = dataclasses.field(default_factory=list)
|
|
31
28
|
|