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
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"""General components for Recharts."""
|
|
2
|
+
|
|
2
3
|
from __future__ import annotations
|
|
3
4
|
|
|
4
5
|
from typing import Any, Dict, List, Union
|
|
5
6
|
|
|
6
7
|
from reflex.components.component import MemoizationLeaf
|
|
7
|
-
from reflex.
|
|
8
|
+
from reflex.event import EventHandler
|
|
8
9
|
from reflex.vars import Var
|
|
9
10
|
|
|
10
11
|
from .recharts import (
|
|
12
|
+
LiteralAnimationEasing,
|
|
11
13
|
LiteralIconType,
|
|
12
14
|
LiteralLayout,
|
|
13
15
|
LiteralLegendAlign,
|
|
@@ -53,6 +55,7 @@ class ResponsiveContainer(Recharts, MemoizationLeaf):
|
|
|
53
55
|
"ScatterChart",
|
|
54
56
|
"Treemap",
|
|
55
57
|
"ComposedChart",
|
|
58
|
+
"FunnelChart",
|
|
56
59
|
]
|
|
57
60
|
|
|
58
61
|
|
|
@@ -93,20 +96,29 @@ class Legend(Recharts):
|
|
|
93
96
|
# The margin of chart container, usually calculated internally.
|
|
94
97
|
margin: Var[Dict[str, Any]]
|
|
95
98
|
|
|
96
|
-
|
|
97
|
-
|
|
99
|
+
# The customized event handler of click on the items in this group
|
|
100
|
+
on_click: EventHandler[lambda: []]
|
|
101
|
+
|
|
102
|
+
# The customized event handler of mousedown on the items in this group
|
|
103
|
+
on_mouse_down: EventHandler[lambda: []]
|
|
104
|
+
|
|
105
|
+
# The customized event handler of mouseup on the items in this group
|
|
106
|
+
on_mouse_up: EventHandler[lambda: []]
|
|
107
|
+
|
|
108
|
+
# The customized event handler of mousemove on the items in this group
|
|
109
|
+
on_mouse_move: EventHandler[lambda: []]
|
|
110
|
+
|
|
111
|
+
# The customized event handler of mouseover on the items in this group
|
|
112
|
+
on_mouse_over: EventHandler[lambda: []]
|
|
98
113
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
EventTriggers.ON_MOUSE_ENTER: lambda: [],
|
|
108
|
-
EventTriggers.ON_MOUSE_LEAVE: lambda: [],
|
|
109
|
-
}
|
|
114
|
+
# The customized event handler of mouseout on the items in this group
|
|
115
|
+
on_mouse_out: EventHandler[lambda: []]
|
|
116
|
+
|
|
117
|
+
# The customized event handler of mouseenter on the items in this group
|
|
118
|
+
on_mouse_enter: EventHandler[lambda: []]
|
|
119
|
+
|
|
120
|
+
# The customized event handler of mouseleave on the items in this group
|
|
121
|
+
on_mouse_leave: EventHandler[lambda: []]
|
|
110
122
|
|
|
111
123
|
|
|
112
124
|
class GraphingTooltip(Recharts):
|
|
@@ -131,6 +143,23 @@ class GraphingTooltip(Recharts):
|
|
|
131
143
|
# The box of viewing area, which has the shape of {x: someVal, y: someVal, width: someVal, height: someVal}, usually calculated internally.
|
|
132
144
|
view_box: Var[Dict[str, Any]]
|
|
133
145
|
|
|
146
|
+
# The style of default tooltip content item which is a li element. DEFAULT: {}
|
|
147
|
+
item_style: Var[Dict[str, Any]]
|
|
148
|
+
|
|
149
|
+
# The style of tooltip wrapper which is a dom element. DEFAULT: {}
|
|
150
|
+
wrapper_style: Var[Dict[str, Any]]
|
|
151
|
+
|
|
152
|
+
# The style of tooltip content which is a dom element. DEFAULT: {}
|
|
153
|
+
content_style: Var[Dict[str, Any]]
|
|
154
|
+
|
|
155
|
+
# The style of default tooltip label which is a p element. DEFAULT: {}
|
|
156
|
+
label_style: Var[Dict[str, Any]]
|
|
157
|
+
|
|
158
|
+
# This option allows the tooltip to extend beyond the viewBox of the chart itself. DEFAULT: { x: false, y: false }
|
|
159
|
+
allow_escape_view_box: Var[Dict[str, bool]] = Var.create_safe(
|
|
160
|
+
{"x": False, "y": False}
|
|
161
|
+
)
|
|
162
|
+
|
|
134
163
|
# If set true, the tooltip is displayed. If set false, the tooltip is hidden, usually calculated internally.
|
|
135
164
|
active: Var[bool]
|
|
136
165
|
|
|
@@ -140,6 +169,15 @@ class GraphingTooltip(Recharts):
|
|
|
140
169
|
# The coordinate of tooltip which is usually calculated internally.
|
|
141
170
|
coordinate: Var[Dict[str, Any]]
|
|
142
171
|
|
|
172
|
+
# If set false, animation of tooltip will be disabled. DEFAULT: true in CSR, and false in SSR
|
|
173
|
+
is_animation_active: Var[bool]
|
|
174
|
+
|
|
175
|
+
# Specifies the duration of animation, the unit of this option is ms. DEFAULT: 1500
|
|
176
|
+
animation_duration: Var[int]
|
|
177
|
+
|
|
178
|
+
# The type of easing function. DEFAULT: 'ease'
|
|
179
|
+
animation_easing: Var[LiteralAnimationEasing]
|
|
180
|
+
|
|
143
181
|
|
|
144
182
|
class Label(Recharts):
|
|
145
183
|
"""A Label component in Recharts."""
|
|
@@ -177,12 +215,6 @@ class LabelList(Recharts):
|
|
|
177
215
|
# The offset to the specified "position"
|
|
178
216
|
offset: Var[int]
|
|
179
217
|
|
|
180
|
-
# Color of the fill
|
|
181
|
-
fill: Var[str]
|
|
182
|
-
|
|
183
|
-
# Color of the stroke
|
|
184
|
-
stroke: Var[str]
|
|
185
|
-
|
|
186
218
|
|
|
187
219
|
responsive_container = ResponsiveContainer.create
|
|
188
220
|
legend = Legend.create
|
|
@@ -9,9 +9,10 @@ from reflex.event import EventChain, EventHandler, EventSpec
|
|
|
9
9
|
from reflex.style import Style
|
|
10
10
|
from typing import Any, Dict, List, Union
|
|
11
11
|
from reflex.components.component import MemoizationLeaf
|
|
12
|
-
from reflex.
|
|
12
|
+
from reflex.event import EventHandler
|
|
13
13
|
from reflex.vars import Var
|
|
14
14
|
from .recharts import (
|
|
15
|
+
LiteralAnimationEasing,
|
|
15
16
|
LiteralIconType,
|
|
16
17
|
LiteralLayout,
|
|
17
18
|
LiteralLegendAlign,
|
|
@@ -109,7 +110,6 @@ class ResponsiveContainer(Recharts, MemoizationLeaf):
|
|
|
109
110
|
...
|
|
110
111
|
|
|
111
112
|
class Legend(Recharts):
|
|
112
|
-
def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ...
|
|
113
113
|
@overload
|
|
114
114
|
@classmethod
|
|
115
115
|
def create( # type: ignore
|
|
@@ -175,9 +175,27 @@ class Legend(Recharts):
|
|
|
175
175
|
class_name: Optional[Any] = None,
|
|
176
176
|
autofocus: Optional[bool] = None,
|
|
177
177
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
178
|
+
on_blur: Optional[
|
|
179
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
180
|
+
] = None,
|
|
178
181
|
on_click: Optional[
|
|
179
182
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
180
183
|
] = None,
|
|
184
|
+
on_context_menu: Optional[
|
|
185
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
186
|
+
] = None,
|
|
187
|
+
on_double_click: Optional[
|
|
188
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
189
|
+
] = None,
|
|
190
|
+
on_focus: Optional[
|
|
191
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
192
|
+
] = None,
|
|
193
|
+
on_mount: Optional[
|
|
194
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
195
|
+
] = None,
|
|
196
|
+
on_mouse_down: Optional[
|
|
197
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
198
|
+
] = None,
|
|
181
199
|
on_mouse_enter: Optional[
|
|
182
200
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
183
201
|
] = None,
|
|
@@ -193,6 +211,15 @@ class Legend(Recharts):
|
|
|
193
211
|
on_mouse_over: Optional[
|
|
194
212
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
195
213
|
] = None,
|
|
214
|
+
on_mouse_up: Optional[
|
|
215
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
216
|
+
] = None,
|
|
217
|
+
on_scroll: Optional[
|
|
218
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
219
|
+
] = None,
|
|
220
|
+
on_unmount: Optional[
|
|
221
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
222
|
+
] = None,
|
|
196
223
|
**props
|
|
197
224
|
) -> "Legend":
|
|
198
225
|
"""Create the component.
|
|
@@ -233,9 +260,24 @@ class GraphingTooltip(Recharts):
|
|
|
233
260
|
filter_null: Optional[Union[Var[bool], bool]] = None,
|
|
234
261
|
cursor: Optional[Union[Var[bool], bool]] = None,
|
|
235
262
|
view_box: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None,
|
|
263
|
+
item_style: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None,
|
|
264
|
+
wrapper_style: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None,
|
|
265
|
+
content_style: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None,
|
|
266
|
+
label_style: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None,
|
|
267
|
+
allow_escape_view_box: Optional[
|
|
268
|
+
Union[Var[Dict[str, bool]], Dict[str, bool]]
|
|
269
|
+
] = None,
|
|
236
270
|
active: Optional[Union[Var[bool], bool]] = None,
|
|
237
271
|
position: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None,
|
|
238
272
|
coordinate: Optional[Union[Var[Dict[str, Any]], Dict[str, Any]]] = None,
|
|
273
|
+
is_animation_active: Optional[Union[Var[bool], bool]] = None,
|
|
274
|
+
animation_duration: Optional[Union[Var[int], int]] = None,
|
|
275
|
+
animation_easing: Optional[
|
|
276
|
+
Union[
|
|
277
|
+
Var[Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"]],
|
|
278
|
+
Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"],
|
|
279
|
+
]
|
|
280
|
+
] = None,
|
|
239
281
|
style: Optional[Style] = None,
|
|
240
282
|
key: Optional[Any] = None,
|
|
241
283
|
id: Optional[Any] = None,
|
|
@@ -298,9 +340,17 @@ class GraphingTooltip(Recharts):
|
|
|
298
340
|
filter_null: When an item of the payload has value null or undefined, this item won't be displayed.
|
|
299
341
|
cursor: If set false, no cursor will be drawn when tooltip is active.
|
|
300
342
|
view_box: The box of viewing area, which has the shape of {x: someVal, y: someVal, width: someVal, height: someVal}, usually calculated internally.
|
|
343
|
+
item_style: The style of default tooltip content item which is a li element. DEFAULT: {}
|
|
344
|
+
wrapper_style: The style of tooltip wrapper which is a dom element. DEFAULT: {}
|
|
345
|
+
content_style: The style of tooltip content which is a dom element. DEFAULT: {}
|
|
346
|
+
label_style: The style of default tooltip label which is a p element. DEFAULT: {}
|
|
347
|
+
allow_escape_view_box: This option allows the tooltip to extend beyond the viewBox of the chart itself. DEFAULT: { x: false, y: false }
|
|
301
348
|
active: If set true, the tooltip is displayed. If set false, the tooltip is hidden, usually calculated internally.
|
|
302
349
|
position: If this field is set, the tooltip position will be fixed and will not move anymore.
|
|
303
350
|
coordinate: The coordinate of tooltip which is usually calculated internally.
|
|
351
|
+
is_animation_active: If set false, animation of tooltip will be disabled. DEFAULT: true in CSR, and false in SSR
|
|
352
|
+
animation_duration: Specifies the duration of animation, the unit of this option is ms. DEFAULT: 1500
|
|
353
|
+
animation_easing: The type of easing function. DEFAULT: 'ease'
|
|
304
354
|
style: The style of the component.
|
|
305
355
|
key: A unique key for the component.
|
|
306
356
|
id: The id for the component.
|
|
@@ -497,8 +547,6 @@ class LabelList(Recharts):
|
|
|
497
547
|
]
|
|
498
548
|
] = None,
|
|
499
549
|
offset: Optional[Union[Var[int], int]] = None,
|
|
500
|
-
fill: Optional[Union[Var[str], str]] = None,
|
|
501
|
-
stroke: Optional[Union[Var[str], str]] = None,
|
|
502
550
|
style: Optional[Style] = None,
|
|
503
551
|
key: Optional[Any] = None,
|
|
504
552
|
id: Optional[Any] = None,
|
|
@@ -559,8 +607,6 @@ class LabelList(Recharts):
|
|
|
559
607
|
data_key: The key of a group of label values in data.
|
|
560
608
|
position: The position of each label relative to it view box。"Top" | "left" | "right" | "bottom" | "inside" | "outside" | "insideLeft" | "insideRight" | "insideTop" | "insideBottom" | "insideTopLeft" | "insideBottomLeft" | "insideTopRight" | "insideBottomRight" | "insideStart" | "insideEnd" | "end" | "center"
|
|
561
609
|
offset: The offset to the specified "position"
|
|
562
|
-
fill: Color of the fill
|
|
563
|
-
stroke: Color of the stroke
|
|
564
610
|
style: The style of the component.
|
|
565
611
|
key: A unique key for the component.
|
|
566
612
|
id: The id for the component.
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"""Polar charts in Recharts."""
|
|
2
|
+
|
|
2
3
|
from __future__ import annotations
|
|
3
4
|
|
|
4
5
|
from typing import Any, Dict, List, Union
|
|
5
6
|
|
|
6
7
|
from reflex.constants import EventTriggers
|
|
8
|
+
from reflex.event import EventHandler
|
|
7
9
|
from reflex.vars import Var
|
|
8
10
|
|
|
9
11
|
from .recharts import (
|
|
10
12
|
LiteralAnimationEasing,
|
|
11
13
|
LiteralGridType,
|
|
14
|
+
LiteralLegendType,
|
|
12
15
|
LiteralPolarRadiusType,
|
|
13
16
|
LiteralScale,
|
|
14
17
|
Recharts,
|
|
@@ -56,7 +59,7 @@ class Pie(Recharts):
|
|
|
56
59
|
name_key: Var[str]
|
|
57
60
|
|
|
58
61
|
# The type of icon in legend. If set to 'none', no legend item will be rendered.
|
|
59
|
-
legend_type: Var[
|
|
62
|
+
legend_type: Var[LiteralLegendType]
|
|
60
63
|
|
|
61
64
|
# If false set, labels will not be drawn.
|
|
62
65
|
label: Var[bool] = False # type: ignore
|
|
@@ -140,8 +143,8 @@ class RadialBar(Recharts):
|
|
|
140
143
|
|
|
141
144
|
alias = "RechartsRadialBar"
|
|
142
145
|
|
|
143
|
-
# The
|
|
144
|
-
|
|
146
|
+
# The key of a group of data which should be unique to show the meaning of angle axis.
|
|
147
|
+
data_key: Var[Union[str, int]]
|
|
145
148
|
|
|
146
149
|
# Min angle of each bar. A positive value between 0 and 360.
|
|
147
150
|
min_angle: Var[int]
|
|
@@ -150,7 +153,7 @@ class RadialBar(Recharts):
|
|
|
150
153
|
legend_type: Var[str]
|
|
151
154
|
|
|
152
155
|
# If false set, labels will not be drawn.
|
|
153
|
-
label: Var[bool]
|
|
156
|
+
label: Var[Union[bool, Dict[str, Any]]]
|
|
154
157
|
|
|
155
158
|
# If false set, background sector will not be drawn.
|
|
156
159
|
background: Var[bool]
|
|
@@ -214,23 +217,32 @@ class PolarAngleAxis(Recharts):
|
|
|
214
217
|
# Allow the axis has duplicated categorys or not when the type of axis is "category".
|
|
215
218
|
allow_duplicated_category: Var[bool]
|
|
216
219
|
|
|
217
|
-
# Valid children components
|
|
220
|
+
# Valid children components.
|
|
218
221
|
_valid_children: List[str] = ["Label"]
|
|
219
222
|
|
|
220
|
-
|
|
221
|
-
|
|
223
|
+
# The customized event handler of click on the ticks of this axis.
|
|
224
|
+
on_click: EventHandler[lambda: []]
|
|
222
225
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
226
|
+
# The customized event handler of mousedown on the the ticks of this axis.
|
|
227
|
+
on_mouse_down: EventHandler[lambda: []]
|
|
228
|
+
|
|
229
|
+
# The customized event handler of mouseup on the ticks of this axis.
|
|
230
|
+
on_mouse_up: EventHandler[lambda: []]
|
|
231
|
+
|
|
232
|
+
# The customized event handler of mousemove on the ticks of this axis.
|
|
233
|
+
on_mouse_move: EventHandler[lambda: []]
|
|
234
|
+
|
|
235
|
+
# The customized event handler of mouseover on the ticks of this axis.
|
|
236
|
+
on_mouse_over: EventHandler[lambda: []]
|
|
237
|
+
|
|
238
|
+
# The customized event handler of mouseout on the ticks of this axis.
|
|
239
|
+
on_mouse_out: EventHandler[lambda: []]
|
|
240
|
+
|
|
241
|
+
# The customized event handler of moustenter on the ticks of this axis.
|
|
242
|
+
on_mouse_enter: EventHandler[lambda: []]
|
|
243
|
+
|
|
244
|
+
# The customized event handler of mouseleave on the ticks of this axis.
|
|
245
|
+
on_mouse_leave: EventHandler[lambda: []]
|
|
234
246
|
|
|
235
247
|
|
|
236
248
|
class PolarGrid(Recharts):
|
|
@@ -9,10 +9,12 @@ from reflex.event import EventChain, EventHandler, EventSpec
|
|
|
9
9
|
from reflex.style import Style
|
|
10
10
|
from typing import Any, Dict, List, Union
|
|
11
11
|
from reflex.constants import EventTriggers
|
|
12
|
+
from reflex.event import EventHandler
|
|
12
13
|
from reflex.vars import Var
|
|
13
14
|
from .recharts import (
|
|
14
15
|
LiteralAnimationEasing,
|
|
15
16
|
LiteralGridType,
|
|
17
|
+
LiteralLegendType,
|
|
16
18
|
LiteralPolarRadiusType,
|
|
17
19
|
LiteralScale,
|
|
18
20
|
Recharts,
|
|
@@ -36,7 +38,38 @@ class Pie(Recharts):
|
|
|
36
38
|
min_angle: Optional[Union[Var[int], int]] = None,
|
|
37
39
|
padding_angle: Optional[Union[Var[int], int]] = None,
|
|
38
40
|
name_key: Optional[Union[Var[str], str]] = None,
|
|
39
|
-
legend_type: Optional[
|
|
41
|
+
legend_type: Optional[
|
|
42
|
+
Union[
|
|
43
|
+
Var[
|
|
44
|
+
Literal[
|
|
45
|
+
"line",
|
|
46
|
+
"plainline",
|
|
47
|
+
"square",
|
|
48
|
+
"rect",
|
|
49
|
+
"circle",
|
|
50
|
+
"cross",
|
|
51
|
+
"diamond",
|
|
52
|
+
"star",
|
|
53
|
+
"triangle",
|
|
54
|
+
"wye",
|
|
55
|
+
"none",
|
|
56
|
+
]
|
|
57
|
+
],
|
|
58
|
+
Literal[
|
|
59
|
+
"line",
|
|
60
|
+
"plainline",
|
|
61
|
+
"square",
|
|
62
|
+
"rect",
|
|
63
|
+
"circle",
|
|
64
|
+
"cross",
|
|
65
|
+
"diamond",
|
|
66
|
+
"star",
|
|
67
|
+
"triangle",
|
|
68
|
+
"wye",
|
|
69
|
+
"none",
|
|
70
|
+
],
|
|
71
|
+
]
|
|
72
|
+
] = None,
|
|
40
73
|
label: Optional[Union[Var[bool], bool]] = None,
|
|
41
74
|
label_line: Optional[Union[Var[bool], bool]] = None,
|
|
42
75
|
fill: Optional[Union[Var[str], str]] = None,
|
|
@@ -210,10 +243,12 @@ class RadialBar(Recharts):
|
|
|
210
243
|
def create( # type: ignore
|
|
211
244
|
cls,
|
|
212
245
|
*children,
|
|
213
|
-
|
|
246
|
+
data_key: Optional[Union[Var[Union[str, int]], Union[str, int]]] = None,
|
|
214
247
|
min_angle: Optional[Union[Var[int], int]] = None,
|
|
215
248
|
legend_type: Optional[Union[Var[str], str]] = None,
|
|
216
|
-
label: Optional[
|
|
249
|
+
label: Optional[
|
|
250
|
+
Union[Var[Union[bool, Dict[str, Any]]], Union[bool, Dict[str, Any]]]
|
|
251
|
+
] = None,
|
|
217
252
|
background: Optional[Union[Var[bool], bool]] = None,
|
|
218
253
|
style: Optional[Style] = None,
|
|
219
254
|
key: Optional[Any] = None,
|
|
@@ -245,7 +280,7 @@ class RadialBar(Recharts):
|
|
|
245
280
|
|
|
246
281
|
Args:
|
|
247
282
|
*children: The children of the component.
|
|
248
|
-
|
|
283
|
+
data_key: The key of a group of data which should be unique to show the meaning of angle axis.
|
|
249
284
|
min_angle: Min angle of each bar. A positive value between 0 and 360.
|
|
250
285
|
legend_type: Type of legend
|
|
251
286
|
label: If false set, labels will not be drawn.
|
|
@@ -264,7 +299,6 @@ class RadialBar(Recharts):
|
|
|
264
299
|
...
|
|
265
300
|
|
|
266
301
|
class PolarAngleAxis(Recharts):
|
|
267
|
-
def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ...
|
|
268
302
|
@overload
|
|
269
303
|
@classmethod
|
|
270
304
|
def create( # type: ignore
|
|
@@ -291,9 +325,27 @@ class PolarAngleAxis(Recharts):
|
|
|
291
325
|
class_name: Optional[Any] = None,
|
|
292
326
|
autofocus: Optional[bool] = None,
|
|
293
327
|
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
|
|
328
|
+
on_blur: Optional[
|
|
329
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
330
|
+
] = None,
|
|
294
331
|
on_click: Optional[
|
|
295
332
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
296
333
|
] = None,
|
|
334
|
+
on_context_menu: Optional[
|
|
335
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
336
|
+
] = None,
|
|
337
|
+
on_double_click: Optional[
|
|
338
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
339
|
+
] = None,
|
|
340
|
+
on_focus: Optional[
|
|
341
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
342
|
+
] = None,
|
|
343
|
+
on_mount: Optional[
|
|
344
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
345
|
+
] = None,
|
|
346
|
+
on_mouse_down: Optional[
|
|
347
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
348
|
+
] = None,
|
|
297
349
|
on_mouse_enter: Optional[
|
|
298
350
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
299
351
|
] = None,
|
|
@@ -309,6 +361,15 @@ class PolarAngleAxis(Recharts):
|
|
|
309
361
|
on_mouse_over: Optional[
|
|
310
362
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
311
363
|
] = None,
|
|
364
|
+
on_mouse_up: Optional[
|
|
365
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
366
|
+
] = None,
|
|
367
|
+
on_scroll: Optional[
|
|
368
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
369
|
+
] = None,
|
|
370
|
+
on_unmount: Optional[
|
|
371
|
+
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
372
|
+
] = None,
|
|
312
373
|
**props
|
|
313
374
|
) -> "PolarAngleAxis":
|
|
314
375
|
"""Create the component.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""A component that wraps a recharts lib."""
|
|
2
|
+
|
|
2
3
|
from typing import Literal
|
|
3
4
|
|
|
4
5
|
from reflex.components.component import Component, MemoizationLeaf, NoSSRComponent
|
|
@@ -7,13 +8,13 @@ from reflex.components.component import Component, MemoizationLeaf, NoSSRCompone
|
|
|
7
8
|
class Recharts(Component):
|
|
8
9
|
"""A component that wraps a recharts lib."""
|
|
9
10
|
|
|
10
|
-
library = "recharts@2.
|
|
11
|
+
library = "recharts@2.12.7"
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
class RechartsCharts(NoSSRComponent, MemoizationLeaf):
|
|
14
15
|
"""A component that wraps a recharts lib."""
|
|
15
16
|
|
|
16
|
-
library = "recharts@2.
|
|
17
|
+
library = "recharts@2.12.7"
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
LiteralAnimationEasing = Literal["ease", "ease-in", "ease-out", "ease-in-out", "linear"]
|
|
@@ -25,6 +26,7 @@ LiteralLineType = Literal["joint", "fitting"]
|
|
|
25
26
|
LiteralOrientation = Literal["top", "bottom", "left", "right", "middle"]
|
|
26
27
|
LiteralOrientationLeftRightMiddle = Literal["left", "right", "middle"]
|
|
27
28
|
LiteralOrientationTopBottom = Literal["top", "bottom"]
|
|
29
|
+
LiteralOrientationLeftRight = Literal["left", "right"]
|
|
28
30
|
LiteralOrientationTopBottomLeftRight = Literal["top", "bottom", "left", "right"]
|
|
29
31
|
LiteralScale = Literal[
|
|
30
32
|
"auto",
|
|
@@ -78,7 +80,7 @@ LiteralIconType = Literal[
|
|
|
78
80
|
"triangle",
|
|
79
81
|
"wye",
|
|
80
82
|
]
|
|
81
|
-
LiteralLegendType = [
|
|
83
|
+
LiteralLegendType = Literal[
|
|
82
84
|
"line",
|
|
83
85
|
"plainline",
|
|
84
86
|
"square",
|
|
@@ -171,6 +171,7 @@ LiteralLineType = Literal["joint", "fitting"]
|
|
|
171
171
|
LiteralOrientation = Literal["top", "bottom", "left", "right", "middle"]
|
|
172
172
|
LiteralOrientationLeftRightMiddle = Literal["left", "right", "middle"]
|
|
173
173
|
LiteralOrientationTopBottom = Literal["top", "bottom"]
|
|
174
|
+
LiteralOrientationLeftRight = Literal["left", "right"]
|
|
174
175
|
LiteralOrientationTopBottomLeftRight = Literal["top", "bottom", "left", "right"]
|
|
175
176
|
LiteralScale = Literal[
|
|
176
177
|
"auto",
|
|
@@ -224,7 +225,7 @@ LiteralIconType = Literal[
|
|
|
224
225
|
"triangle",
|
|
225
226
|
"wye",
|
|
226
227
|
]
|
|
227
|
-
LiteralLegendType = [
|
|
228
|
+
LiteralLegendType = Literal[
|
|
228
229
|
"line",
|
|
229
230
|
"plainline",
|
|
230
231
|
"square",
|
|
@@ -12,7 +12,7 @@ from reflex.event import (
|
|
|
12
12
|
EventSpec,
|
|
13
13
|
call_script,
|
|
14
14
|
)
|
|
15
|
-
from reflex.style import Style,
|
|
15
|
+
from reflex.style import Style, resolved_color_mode
|
|
16
16
|
from reflex.utils import format
|
|
17
17
|
from reflex.utils.imports import ImportVar
|
|
18
18
|
from reflex.utils.serializers import serialize, serializer
|
|
@@ -168,7 +168,7 @@ class Toaster(Component):
|
|
|
168
168
|
tag = "Toaster"
|
|
169
169
|
|
|
170
170
|
# the theme of the toast
|
|
171
|
-
theme: Var[str] =
|
|
171
|
+
theme: Var[str] = resolved_color_mode
|
|
172
172
|
|
|
173
173
|
# whether to show rich colors
|
|
174
174
|
rich_colors: Var[bool] = Var.create_safe(True)
|
|
@@ -13,7 +13,7 @@ from reflex.components.component import Component, ComponentNamespace
|
|
|
13
13
|
from reflex.components.lucide.icon import Icon
|
|
14
14
|
from reflex.components.props import PropsBase
|
|
15
15
|
from reflex.event import EventSpec, call_script
|
|
16
|
-
from reflex.style import Style,
|
|
16
|
+
from reflex.style import Style, resolved_color_mode
|
|
17
17
|
from reflex.utils import format
|
|
18
18
|
from reflex.utils.imports import ImportVar
|
|
19
19
|
from reflex.utils.serializers import serialize, serializer
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"""A Rich Text Editor based on SunEditor."""
|
|
2
|
+
|
|
2
3
|
from __future__ import annotations
|
|
3
4
|
|
|
4
5
|
import enum
|
|
5
|
-
from typing import
|
|
6
|
+
from typing import Dict, List, Literal, Optional, Union
|
|
6
7
|
|
|
7
8
|
from reflex.base import Base
|
|
8
9
|
from reflex.components.component import Component, NoSSRComponent
|
|
9
|
-
from reflex.
|
|
10
|
+
from reflex.event import EventHandler
|
|
10
11
|
from reflex.utils.format import to_camel_case
|
|
11
|
-
from reflex.utils.imports import ImportVar
|
|
12
|
+
from reflex.utils.imports import ImportDict, ImportVar
|
|
12
13
|
from reflex.vars import Var
|
|
13
14
|
|
|
14
15
|
|
|
@@ -176,34 +177,46 @@ class Editor(NoSSRComponent):
|
|
|
176
177
|
# default: False
|
|
177
178
|
disable_toolbar: Var[bool]
|
|
178
179
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
180
|
+
# Fired when the editor content changes.
|
|
181
|
+
on_change: EventHandler[lambda content: [content]]
|
|
182
|
+
|
|
183
|
+
# Fired when the something is inputted in the editor.
|
|
184
|
+
on_input: EventHandler[lambda e: [e]]
|
|
185
|
+
|
|
186
|
+
# Fired when the editor loses focus.
|
|
187
|
+
on_blur: EventHandler[lambda e, content: [content]]
|
|
188
|
+
|
|
189
|
+
# Fired when the editor is loaded.
|
|
190
|
+
on_load: EventHandler[lambda reload: [reload]]
|
|
191
|
+
|
|
192
|
+
# Fired when the editor is resized.
|
|
193
|
+
on_resize_editor: EventHandler[lambda height, prev_height: [height, prev_height]]
|
|
194
|
+
|
|
195
|
+
# Fired when the editor content is copied.
|
|
196
|
+
on_copy: EventHandler[lambda e, clipboard_data: [clipboard_data]]
|
|
185
197
|
|
|
186
|
-
|
|
187
|
-
|
|
198
|
+
# Fired when the editor content is cut.
|
|
199
|
+
on_cut: EventHandler[lambda e, clipboard_data: [clipboard_data]]
|
|
200
|
+
|
|
201
|
+
# Fired when the editor content is pasted.
|
|
202
|
+
on_paste: EventHandler[
|
|
203
|
+
lambda e, clean_data, max_char_count: [clean_data, max_char_count]
|
|
204
|
+
]
|
|
205
|
+
|
|
206
|
+
# Fired when the code view is toggled.
|
|
207
|
+
toggle_code_view: EventHandler[lambda is_code_view: [is_code_view]]
|
|
208
|
+
|
|
209
|
+
# Fired when the full screen mode is toggled.
|
|
210
|
+
toggle_full_screen: EventHandler[lambda is_full_screen: [is_full_screen]]
|
|
211
|
+
|
|
212
|
+
def add_imports(self) -> ImportDict:
|
|
213
|
+
"""Add imports for the Editor component.
|
|
188
214
|
|
|
189
215
|
Returns:
|
|
190
|
-
|
|
216
|
+
The import dict.
|
|
191
217
|
"""
|
|
192
218
|
return {
|
|
193
|
-
|
|
194
|
-
EventTriggers.ON_CHANGE: lambda content: [content],
|
|
195
|
-
"on_input": lambda _e: [_e],
|
|
196
|
-
EventTriggers.ON_BLUR: lambda _e, content: [content],
|
|
197
|
-
"on_load": lambda reload: [reload],
|
|
198
|
-
"on_resize_editor": lambda height, prev_height: [height, prev_height],
|
|
199
|
-
"on_copy": lambda _e, clipboard_data: [clipboard_data],
|
|
200
|
-
"on_cut": lambda _e, clipboard_data: [clipboard_data],
|
|
201
|
-
"on_paste": lambda _e, clean_data, max_char_count: [
|
|
202
|
-
clean_data,
|
|
203
|
-
max_char_count,
|
|
204
|
-
],
|
|
205
|
-
"toggle_code_view": lambda is_code_view: [is_code_view],
|
|
206
|
-
"toggle_full_screen": lambda is_full_screen: [is_full_screen],
|
|
219
|
+
"": ImportVar(tag="suneditor/dist/css/suneditor.min.css", install=False)
|
|
207
220
|
}
|
|
208
221
|
|
|
209
222
|
@classmethod
|
|
@@ -8,12 +8,12 @@ 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
|
import enum
|
|
11
|
-
from typing import
|
|
11
|
+
from typing import Dict, List, Literal, Optional, Union
|
|
12
12
|
from reflex.base import Base
|
|
13
13
|
from reflex.components.component import Component, NoSSRComponent
|
|
14
|
-
from reflex.
|
|
14
|
+
from reflex.event import EventHandler
|
|
15
15
|
from reflex.utils.format import to_camel_case
|
|
16
|
-
from reflex.utils.imports import ImportVar
|
|
16
|
+
from reflex.utils.imports import ImportDict, ImportVar
|
|
17
17
|
from reflex.vars import Var
|
|
18
18
|
|
|
19
19
|
class EditorButtonList(list, enum.Enum):
|
|
@@ -48,7 +48,7 @@ class EditorOptions(Base):
|
|
|
48
48
|
button_list: Optional[List[Union[List[str], str]]]
|
|
49
49
|
|
|
50
50
|
class Editor(NoSSRComponent):
|
|
51
|
-
def
|
|
51
|
+
def add_imports(self) -> ImportDict: ...
|
|
52
52
|
@overload
|
|
53
53
|
@classmethod
|
|
54
54
|
def create( # type: ignore
|