reflex 0.6.6.post3__py3-none-any.whl → 0.6.7a1__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/stateful_component.js.jinja2 +5 -1
- reflex/.templates/web/utils/state.js +36 -28
- reflex/__init__.py +1 -1
- reflex/__init__.pyi +1 -0
- reflex/app.py +41 -16
- reflex/assets.py +2 -2
- reflex/base.py +8 -7
- reflex/compiler/templates.py +1 -0
- reflex/compiler/utils.py +2 -3
- reflex/components/base/bare.py +2 -2
- reflex/components/component.py +54 -29
- reflex/components/core/banner.py +2 -2
- reflex/components/core/banner.pyi +1 -1
- reflex/components/core/client_side_routing.py +2 -2
- reflex/components/core/client_side_routing.pyi +1 -1
- reflex/components/core/clipboard.py +11 -9
- reflex/components/core/clipboard.pyi +1 -1
- reflex/components/core/cond.py +3 -3
- reflex/components/core/foreach.py +1 -1
- reflex/components/core/html.pyi +1 -1
- reflex/components/core/upload.py +8 -8
- reflex/components/datadisplay/code.py +5 -5
- reflex/components/datadisplay/dataeditor.py +8 -28
- reflex/components/datadisplay/dataeditor.pyi +1 -1
- reflex/components/datadisplay/shiki_code_block.py +7 -7
- reflex/components/dynamic.py +2 -2
- reflex/components/el/elements/__init__.py +1 -1
- reflex/components/el/elements/__init__.pyi +1 -1
- reflex/components/el/elements/base.py +2 -2
- reflex/components/el/elements/base.pyi +1 -1
- reflex/components/el/elements/forms.py +40 -10
- reflex/components/el/elements/forms.pyi +17 -15
- reflex/components/el/elements/inline.py +1 -1
- reflex/components/el/elements/inline.pyi +28 -28
- reflex/components/el/elements/media.py +1 -4
- reflex/components/el/elements/media.pyi +25 -26
- reflex/components/el/elements/metadata.py +6 -6
- reflex/components/el/elements/metadata.pyi +4 -4
- reflex/components/el/elements/other.py +17 -9
- reflex/components/el/elements/other.pyi +7 -7
- reflex/components/el/elements/scripts.py +1 -2
- reflex/components/el/elements/scripts.pyi +3 -3
- reflex/components/el/elements/sectioning.py +16 -16
- reflex/components/el/elements/sectioning.pyi +15 -15
- reflex/components/el/elements/tables.py +1 -1
- reflex/components/el/elements/tables.pyi +10 -10
- reflex/components/el/elements/typography.py +1 -1
- reflex/components/el/elements/typography.pyi +15 -15
- reflex/components/markdown/markdown.py +3 -3
- reflex/components/next/image.py +1 -1
- reflex/components/next/image.pyi +1 -1
- reflex/components/plotly/plotly.py +2 -2
- reflex/components/radix/primitives/accordion.py +2 -1
- reflex/components/radix/primitives/form.pyi +3 -3
- reflex/components/radix/primitives/slider.py +1 -1
- reflex/components/radix/themes/base.py +4 -10
- reflex/components/radix/themes/color_mode.pyi +2 -2
- reflex/components/radix/themes/components/alert_dialog.pyi +1 -1
- reflex/components/radix/themes/components/badge.pyi +1 -1
- reflex/components/radix/themes/components/button.pyi +1 -1
- reflex/components/radix/themes/components/callout.pyi +5 -5
- reflex/components/radix/themes/components/card.pyi +1 -1
- reflex/components/radix/themes/components/checkbox.pyi +3 -3
- reflex/components/radix/themes/components/context_menu.py +11 -0
- reflex/components/radix/themes/components/context_menu.pyi +155 -0
- reflex/components/radix/themes/components/dialog.pyi +1 -1
- reflex/components/radix/themes/components/hover_card.pyi +1 -1
- reflex/components/radix/themes/components/icon_button.py +1 -1
- reflex/components/radix/themes/components/icon_button.pyi +1 -1
- reflex/components/radix/themes/components/inset.pyi +1 -1
- reflex/components/radix/themes/components/popover.pyi +1 -1
- reflex/components/radix/themes/components/radio_group.py +2 -4
- reflex/components/radix/themes/components/radio_group.pyi +1 -1
- reflex/components/radix/themes/components/select.pyi +3 -3
- reflex/components/radix/themes/components/slider.pyi +1 -1
- reflex/components/radix/themes/components/switch.pyi +1 -1
- reflex/components/radix/themes/components/table.pyi +7 -7
- reflex/components/radix/themes/components/tabs.pyi +2 -2
- reflex/components/radix/themes/components/text_area.py +3 -0
- reflex/components/radix/themes/components/text_area.pyi +3 -1
- reflex/components/radix/themes/components/text_field.py +16 -1
- reflex/components/radix/themes/components/text_field.pyi +105 -17
- reflex/components/radix/themes/layout/box.pyi +1 -1
- reflex/components/radix/themes/layout/center.pyi +1 -1
- reflex/components/radix/themes/layout/flex.pyi +1 -1
- reflex/components/radix/themes/layout/grid.pyi +1 -1
- reflex/components/radix/themes/layout/list.py +0 -4
- reflex/components/radix/themes/layout/list.pyi +3 -8
- reflex/components/radix/themes/layout/section.pyi +1 -1
- reflex/components/radix/themes/layout/spacer.pyi +1 -1
- reflex/components/radix/themes/layout/stack.pyi +3 -3
- reflex/components/radix/themes/typography/blockquote.pyi +1 -1
- reflex/components/radix/themes/typography/code.pyi +1 -1
- reflex/components/radix/themes/typography/heading.pyi +1 -1
- reflex/components/radix/themes/typography/link.py +5 -1
- reflex/components/radix/themes/typography/link.pyi +1 -1
- reflex/components/radix/themes/typography/text.pyi +7 -7
- reflex/components/recharts/cartesian.py +1 -1
- reflex/components/recharts/charts.py +4 -4
- reflex/components/recharts/polar.py +1 -1
- reflex/components/recharts/polar.pyi +1 -1
- reflex/components/sonner/toast.py +4 -7
- reflex/components/suneditor/editor.py +6 -6
- reflex/components/suneditor/editor.pyi +6 -6
- reflex/config.py +25 -10
- reflex/constants/compiler.py +6 -0
- reflex/constants/config.py +2 -0
- reflex/constants/custom_components.py +1 -1
- reflex/constants/route.py +1 -1
- reflex/custom_components/custom_components.py +21 -21
- reflex/event.py +57 -22
- reflex/experimental/client_state.py +2 -1
- reflex/experimental/layout.py +0 -6
- reflex/model.py +125 -9
- reflex/reflex.py +5 -6
- reflex/state.py +203 -88
- reflex/style.py +1 -4
- reflex/testing.py +10 -11
- reflex/utils/build.py +1 -1
- reflex/utils/console.py +75 -6
- reflex/utils/exceptions.py +12 -0
- reflex/utils/exec.py +10 -10
- reflex/utils/export.py +1 -2
- reflex/utils/format.py +11 -8
- reflex/utils/path_ops.py +2 -2
- reflex/utils/prerequisites.py +31 -28
- reflex/utils/processes.py +4 -4
- reflex/utils/pyi_generator.py +12 -11
- reflex/utils/types.py +6 -3
- reflex/vars/__init__.py +1 -0
- reflex/vars/base.py +75 -38
- reflex/vars/datetime.py +222 -0
- reflex/vars/function.py +3 -3
- reflex/vars/number.py +3 -3
- reflex/vars/object.py +5 -5
- reflex/vars/sequence.py +7 -7
- {reflex-0.6.6.post3.dist-info → reflex-0.6.7a1.dist-info}/METADATA +2 -2
- {reflex-0.6.6.post3.dist-info → reflex-0.6.7a1.dist-info}/RECORD +141 -140
- {reflex-0.6.6.post3.dist-info → reflex-0.6.7a1.dist-info}/LICENSE +0 -0
- {reflex-0.6.6.post3.dist-info → reflex-0.6.7a1.dist-info}/WHEEL +0 -0
- {reflex-0.6.6.post3.dist-info → reflex-0.6.7a1.dist-info}/entry_points.txt +0 -0
|
@@ -270,11 +270,11 @@ const extractPoints = (points) => {
|
|
|
270
270
|
tag.special_props.append(
|
|
271
271
|
# Merge all dictionaries and spread the result over props.
|
|
272
272
|
Var(
|
|
273
|
-
_js_expr=f"{{...mergician({
|
|
273
|
+
_js_expr=f"{{...mergician({figure!s},"
|
|
274
274
|
f"{','.join(str(md) for md in merge_dicts)})}}",
|
|
275
275
|
),
|
|
276
276
|
)
|
|
277
277
|
else:
|
|
278
278
|
# Spread the figure dict over props, nothing to merge.
|
|
279
|
-
tag.special_props.append(Var(_js_expr=f"{{...{
|
|
279
|
+
tag.special_props.append(Var(_js_expr=f"{{...{figure!s}}}"))
|
|
280
280
|
return tag
|
|
@@ -129,7 +129,8 @@ class AccordionRoot(AccordionComponent):
|
|
|
129
129
|
on_value_change: EventHandler[on_value_change]
|
|
130
130
|
|
|
131
131
|
def _exclude_props(self) -> list[str]:
|
|
132
|
-
return
|
|
132
|
+
return [
|
|
133
|
+
*super()._exclude_props(),
|
|
133
134
|
"radius",
|
|
134
135
|
"duration",
|
|
135
136
|
"easing",
|
|
@@ -160,7 +160,7 @@ class FormRoot(FormComponent, HTMLForm):
|
|
|
160
160
|
reset_on_submit: If true, the form will be cleared after submit.
|
|
161
161
|
handle_submit_unique_name: The name used to make this form's submit handler function unique.
|
|
162
162
|
on_submit: Fired when the form is submitted
|
|
163
|
-
access_key:
|
|
163
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
164
164
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
165
165
|
content_editable: Indicates whether the element's content is editable.
|
|
166
166
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
@@ -636,7 +636,7 @@ class Form(FormRoot):
|
|
|
636
636
|
reset_on_submit: If true, the form will be cleared after submit.
|
|
637
637
|
handle_submit_unique_name: The name used to make this form's submit handler function unique.
|
|
638
638
|
on_submit: Fired when the form is submitted
|
|
639
|
-
access_key:
|
|
639
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
640
640
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
641
641
|
content_editable: Indicates whether the element's content is editable.
|
|
642
642
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
@@ -769,7 +769,7 @@ class FormNamespace(ComponentNamespace):
|
|
|
769
769
|
reset_on_submit: If true, the form will be cleared after submit.
|
|
770
770
|
handle_submit_unique_name: The name used to make this form's submit handler function unique.
|
|
771
771
|
on_submit: Fired when the form is submitted
|
|
772
|
-
access_key:
|
|
772
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
773
773
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
774
774
|
content_editable: Indicates whether the element's content is editable.
|
|
775
775
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
@@ -188,7 +188,7 @@ class Slider(ComponentNamespace):
|
|
|
188
188
|
else:
|
|
189
189
|
children = [
|
|
190
190
|
track,
|
|
191
|
-
# Foreach.create(props.get("value"), lambda e: SliderThumb.create()), # foreach doesn't render Thumbs properly
|
|
191
|
+
# Foreach.create(props.get("value"), lambda e: SliderThumb.create()), # foreach doesn't render Thumbs properly # noqa: ERA001
|
|
192
192
|
]
|
|
193
193
|
|
|
194
194
|
return SliderRoot.create(*children, **props)
|
|
@@ -53,7 +53,7 @@ LiteralAccentColor = Literal[
|
|
|
53
53
|
class CommonMarginProps(Component):
|
|
54
54
|
"""Many radix-themes elements accept shorthand margin props."""
|
|
55
55
|
|
|
56
|
-
# Margin: "0" - "9"
|
|
56
|
+
# Margin: "0" - "9" # noqa: ERA001
|
|
57
57
|
m: Var[LiteralSpacing]
|
|
58
58
|
|
|
59
59
|
# Margin horizontal: "0" - "9"
|
|
@@ -78,7 +78,7 @@ class CommonMarginProps(Component):
|
|
|
78
78
|
class CommonPaddingProps(Component):
|
|
79
79
|
"""Many radix-themes elements accept shorthand padding props."""
|
|
80
80
|
|
|
81
|
-
# Padding: "0" - "9"
|
|
81
|
+
# Padding: "0" - "9" # noqa: ERA001
|
|
82
82
|
p: Var[Responsive[LiteralSpacing]]
|
|
83
83
|
|
|
84
84
|
# Padding horizontal: "0" - "9"
|
|
@@ -139,14 +139,7 @@ class RadixThemesComponent(Component):
|
|
|
139
139
|
component = super().create(*children, **props)
|
|
140
140
|
if component.library is None:
|
|
141
141
|
component.library = RadixThemesComponent.__fields__["library"].default
|
|
142
|
-
component.alias = "RadixThemes" + (
|
|
143
|
-
component.tag or component.__class__.__name__
|
|
144
|
-
)
|
|
145
|
-
# value = props.get("value")
|
|
146
|
-
# if value is not None and component.alias == "RadixThemesSelect.Root":
|
|
147
|
-
# lv = LiteralVar.create(value)
|
|
148
|
-
# print(repr(lv))
|
|
149
|
-
# print(f"Warning: Value {value} is not used in {component.alias}.")
|
|
142
|
+
component.alias = "RadixThemes" + (component.tag or type(component).__name__)
|
|
150
143
|
return component
|
|
151
144
|
|
|
152
145
|
@staticmethod
|
|
@@ -268,6 +261,7 @@ class Theme(RadixThemesComponent):
|
|
|
268
261
|
_js_expr="{...theme.styles.global[':root'], ...theme.styles.global.body}"
|
|
269
262
|
),
|
|
270
263
|
)
|
|
264
|
+
tag.remove_props("appearance")
|
|
271
265
|
return tag
|
|
272
266
|
|
|
273
267
|
|
|
@@ -257,7 +257,7 @@ class ColorModeIconButton(IconButton):
|
|
|
257
257
|
name: Name of the button, used when sending form data
|
|
258
258
|
type: Type of the button (submit, reset, or button)
|
|
259
259
|
value: Value of the button, used when sending form data
|
|
260
|
-
access_key:
|
|
260
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
261
261
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
262
262
|
content_editable: Indicates whether the element's content is editable.
|
|
263
263
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
@@ -427,7 +427,7 @@ class ColorModeSwitch(Switch):
|
|
|
427
427
|
color_scheme: Override theme color for switch
|
|
428
428
|
high_contrast: Whether to render the switch with higher contrast color against background
|
|
429
429
|
radius: Override theme radius for switch: "none" | "small" | "full"
|
|
430
|
-
on_change:
|
|
430
|
+
on_change: Fired when the value of the switch changes
|
|
431
431
|
style: The style of the component.
|
|
432
432
|
key: A unique key for the component.
|
|
433
433
|
id: The id for the component.
|
|
@@ -194,7 +194,7 @@ class AlertDialogContent(elements.Div, RadixThemesComponent):
|
|
|
194
194
|
on_open_auto_focus: Fired when the dialog is opened.
|
|
195
195
|
on_close_auto_focus: Fired when the dialog is closed.
|
|
196
196
|
on_escape_key_down: Fired when the escape key is pressed.
|
|
197
|
-
access_key:
|
|
197
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
198
198
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
199
199
|
content_editable: Indicates whether the element's content is editable.
|
|
200
200
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
@@ -164,7 +164,7 @@ class Badge(elements.Span, RadixThemesComponent):
|
|
|
164
164
|
color_scheme: Color theme of the badge
|
|
165
165
|
high_contrast: Whether to render the badge with higher contrast color against background
|
|
166
166
|
radius: Override theme radius for badge: "none" | "small" | "medium" | "large" | "full"
|
|
167
|
-
access_key:
|
|
167
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
168
168
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
169
169
|
content_editable: Indicates whether the element's content is editable.
|
|
170
170
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
@@ -196,7 +196,7 @@ class Button(elements.Button, RadixLoadingProp, RadixThemesComponent):
|
|
|
196
196
|
name: Name of the button, used when sending form data
|
|
197
197
|
type: Type of the button (submit, reset, or button)
|
|
198
198
|
value: Value of the button, used when sending form data
|
|
199
|
-
access_key:
|
|
199
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
200
200
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
201
201
|
content_editable: Indicates whether the element's content is editable.
|
|
202
202
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
@@ -162,7 +162,7 @@ class CalloutRoot(elements.Div, RadixThemesComponent):
|
|
|
162
162
|
variant: Variant of button: "soft" | "surface" | "outline"
|
|
163
163
|
color_scheme: Override theme color for button
|
|
164
164
|
high_contrast: Whether to render the button with higher contrast color against background
|
|
165
|
-
access_key:
|
|
165
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
166
166
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
167
167
|
content_editable: Indicates whether the element's content is editable.
|
|
168
168
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
@@ -251,7 +251,7 @@ class CalloutIcon(elements.Div, RadixThemesComponent):
|
|
|
251
251
|
|
|
252
252
|
Args:
|
|
253
253
|
*children: Child components.
|
|
254
|
-
access_key:
|
|
254
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
255
255
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
256
256
|
content_editable: Indicates whether the element's content is editable.
|
|
257
257
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
@@ -340,7 +340,7 @@ class CalloutText(elements.P, RadixThemesComponent):
|
|
|
340
340
|
|
|
341
341
|
Args:
|
|
342
342
|
*children: Child components.
|
|
343
|
-
access_key:
|
|
343
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
344
344
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
345
345
|
content_editable: Indicates whether the element's content is editable.
|
|
346
346
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
@@ -516,7 +516,7 @@ class Callout(CalloutRoot):
|
|
|
516
516
|
variant: Variant of button: "soft" | "surface" | "outline"
|
|
517
517
|
color_scheme: Override theme color for button
|
|
518
518
|
high_contrast: Whether to render the button with higher contrast color against background
|
|
519
|
-
access_key:
|
|
519
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
520
520
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
521
521
|
content_editable: Indicates whether the element's content is editable.
|
|
522
522
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
@@ -694,7 +694,7 @@ class CalloutNamespace(ComponentNamespace):
|
|
|
694
694
|
variant: Variant of button: "soft" | "surface" | "outline"
|
|
695
695
|
color_scheme: Override theme color for button
|
|
696
696
|
high_contrast: Whether to render the button with higher contrast color against background
|
|
697
|
-
access_key:
|
|
697
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
698
698
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
699
699
|
content_editable: Indicates whether the element's content is editable.
|
|
700
700
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
@@ -95,7 +95,7 @@ class Card(elements.Div, RadixThemesComponent):
|
|
|
95
95
|
as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
96
96
|
size: Card size: "1" - "5"
|
|
97
97
|
variant: Variant of Card: "solid" | "soft" | "outline" | "ghost"
|
|
98
|
-
access_key:
|
|
98
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
99
99
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
100
100
|
content_editable: Indicates whether the element's content is editable.
|
|
101
101
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
@@ -153,7 +153,7 @@ class Checkbox(RadixThemesComponent):
|
|
|
153
153
|
required: Whether the checkbox is required
|
|
154
154
|
name: The name of the checkbox control when submitting the form.
|
|
155
155
|
value: The value of the checkbox control when submitting the form.
|
|
156
|
-
on_change:
|
|
156
|
+
on_change: Fired when the checkbox is checked or unchecked.
|
|
157
157
|
style: The style of the component.
|
|
158
158
|
key: A unique key for the component.
|
|
159
159
|
id: The id for the component.
|
|
@@ -302,7 +302,7 @@ class HighLevelCheckbox(RadixThemesComponent):
|
|
|
302
302
|
required: Whether the checkbox is required
|
|
303
303
|
name: The name of the checkbox control when submitting the form.
|
|
304
304
|
value: The value of the checkbox control when submitting the form.
|
|
305
|
-
on_change:
|
|
305
|
+
on_change: Fired when the checkbox is checked or unchecked.
|
|
306
306
|
style: The style of the component.
|
|
307
307
|
key: A unique key for the component.
|
|
308
308
|
id: The id for the component.
|
|
@@ -449,7 +449,7 @@ class CheckboxNamespace(ComponentNamespace):
|
|
|
449
449
|
required: Whether the checkbox is required
|
|
450
450
|
name: The name of the checkbox control when submitting the form.
|
|
451
451
|
value: The value of the checkbox control when submitting the form.
|
|
452
|
-
on_change:
|
|
452
|
+
on_change: Fired when the checkbox is checked or unchecked.
|
|
453
453
|
style: The style of the component.
|
|
454
454
|
key: A unique key for the component.
|
|
455
455
|
id: The id for the component.
|
|
@@ -8,6 +8,7 @@ from reflex.event import EventHandler, no_args_event_spec, passthrough_event_spe
|
|
|
8
8
|
from reflex.vars.base import Var
|
|
9
9
|
|
|
10
10
|
from ..base import LiteralAccentColor, RadixThemesComponent
|
|
11
|
+
from .checkbox import Checkbox
|
|
11
12
|
|
|
12
13
|
LiteralDirType = Literal["ltr", "rtl"]
|
|
13
14
|
|
|
@@ -232,6 +233,15 @@ class ContextMenuSeparator(RadixThemesComponent):
|
|
|
232
233
|
tag = "ContextMenu.Separator"
|
|
233
234
|
|
|
234
235
|
|
|
236
|
+
class ContextMenuCheckbox(Checkbox):
|
|
237
|
+
"""The component that contains the checkbox."""
|
|
238
|
+
|
|
239
|
+
tag = "ContextMenu.CheckboxItem"
|
|
240
|
+
|
|
241
|
+
# Text to render as shortcut.
|
|
242
|
+
shortcut: Var[str]
|
|
243
|
+
|
|
244
|
+
|
|
235
245
|
class ContextMenu(ComponentNamespace):
|
|
236
246
|
"""Menu representing a set of actions, displayed at the origin of a pointer right-click or long-press."""
|
|
237
247
|
|
|
@@ -243,6 +253,7 @@ class ContextMenu(ComponentNamespace):
|
|
|
243
253
|
sub_content = staticmethod(ContextMenuSubContent.create)
|
|
244
254
|
item = staticmethod(ContextMenuItem.create)
|
|
245
255
|
separator = staticmethod(ContextMenuSeparator.create)
|
|
256
|
+
checkbox = staticmethod(ContextMenuCheckbox.create)
|
|
246
257
|
|
|
247
258
|
|
|
248
259
|
context_menu = ContextMenu()
|
|
@@ -12,6 +12,7 @@ from reflex.style import Style
|
|
|
12
12
|
from reflex.vars.base import Var
|
|
13
13
|
|
|
14
14
|
from ..base import RadixThemesComponent
|
|
15
|
+
from .checkbox import Checkbox
|
|
15
16
|
|
|
16
17
|
LiteralDirType = Literal["ltr", "rtl"]
|
|
17
18
|
LiteralSizeType = Literal["1", "2"]
|
|
@@ -672,6 +673,159 @@ class ContextMenuSeparator(RadixThemesComponent):
|
|
|
672
673
|
"""
|
|
673
674
|
...
|
|
674
675
|
|
|
676
|
+
class ContextMenuCheckbox(Checkbox):
|
|
677
|
+
@overload
|
|
678
|
+
@classmethod
|
|
679
|
+
def create( # type: ignore
|
|
680
|
+
cls,
|
|
681
|
+
*children,
|
|
682
|
+
shortcut: Optional[Union[Var[str], str]] = None,
|
|
683
|
+
as_child: Optional[Union[Var[bool], bool]] = None,
|
|
684
|
+
size: Optional[
|
|
685
|
+
Union[
|
|
686
|
+
Breakpoints[str, Literal["1", "2", "3"]],
|
|
687
|
+
Literal["1", "2", "3"],
|
|
688
|
+
Var[
|
|
689
|
+
Union[
|
|
690
|
+
Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"]
|
|
691
|
+
]
|
|
692
|
+
],
|
|
693
|
+
]
|
|
694
|
+
] = None,
|
|
695
|
+
variant: Optional[
|
|
696
|
+
Union[
|
|
697
|
+
Literal["classic", "soft", "surface"],
|
|
698
|
+
Var[Literal["classic", "soft", "surface"]],
|
|
699
|
+
]
|
|
700
|
+
] = None,
|
|
701
|
+
color_scheme: Optional[
|
|
702
|
+
Union[
|
|
703
|
+
Literal[
|
|
704
|
+
"amber",
|
|
705
|
+
"blue",
|
|
706
|
+
"bronze",
|
|
707
|
+
"brown",
|
|
708
|
+
"crimson",
|
|
709
|
+
"cyan",
|
|
710
|
+
"gold",
|
|
711
|
+
"grass",
|
|
712
|
+
"gray",
|
|
713
|
+
"green",
|
|
714
|
+
"indigo",
|
|
715
|
+
"iris",
|
|
716
|
+
"jade",
|
|
717
|
+
"lime",
|
|
718
|
+
"mint",
|
|
719
|
+
"orange",
|
|
720
|
+
"pink",
|
|
721
|
+
"plum",
|
|
722
|
+
"purple",
|
|
723
|
+
"red",
|
|
724
|
+
"ruby",
|
|
725
|
+
"sky",
|
|
726
|
+
"teal",
|
|
727
|
+
"tomato",
|
|
728
|
+
"violet",
|
|
729
|
+
"yellow",
|
|
730
|
+
],
|
|
731
|
+
Var[
|
|
732
|
+
Literal[
|
|
733
|
+
"amber",
|
|
734
|
+
"blue",
|
|
735
|
+
"bronze",
|
|
736
|
+
"brown",
|
|
737
|
+
"crimson",
|
|
738
|
+
"cyan",
|
|
739
|
+
"gold",
|
|
740
|
+
"grass",
|
|
741
|
+
"gray",
|
|
742
|
+
"green",
|
|
743
|
+
"indigo",
|
|
744
|
+
"iris",
|
|
745
|
+
"jade",
|
|
746
|
+
"lime",
|
|
747
|
+
"mint",
|
|
748
|
+
"orange",
|
|
749
|
+
"pink",
|
|
750
|
+
"plum",
|
|
751
|
+
"purple",
|
|
752
|
+
"red",
|
|
753
|
+
"ruby",
|
|
754
|
+
"sky",
|
|
755
|
+
"teal",
|
|
756
|
+
"tomato",
|
|
757
|
+
"violet",
|
|
758
|
+
"yellow",
|
|
759
|
+
]
|
|
760
|
+
],
|
|
761
|
+
]
|
|
762
|
+
] = None,
|
|
763
|
+
high_contrast: Optional[Union[Var[bool], bool]] = None,
|
|
764
|
+
default_checked: Optional[Union[Var[bool], bool]] = None,
|
|
765
|
+
checked: Optional[Union[Var[bool], bool]] = None,
|
|
766
|
+
disabled: Optional[Union[Var[bool], bool]] = None,
|
|
767
|
+
required: Optional[Union[Var[bool], bool]] = None,
|
|
768
|
+
name: Optional[Union[Var[str], str]] = None,
|
|
769
|
+
value: Optional[Union[Var[str], str]] = None,
|
|
770
|
+
style: Optional[Style] = None,
|
|
771
|
+
key: Optional[Any] = None,
|
|
772
|
+
id: Optional[Any] = None,
|
|
773
|
+
class_name: Optional[Any] = None,
|
|
774
|
+
autofocus: Optional[bool] = None,
|
|
775
|
+
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
|
|
776
|
+
on_blur: Optional[EventType[[], BASE_STATE]] = None,
|
|
777
|
+
on_change: Optional[
|
|
778
|
+
Union[EventType[[], BASE_STATE], EventType[[bool], BASE_STATE]]
|
|
779
|
+
] = None,
|
|
780
|
+
on_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
781
|
+
on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
|
|
782
|
+
on_double_click: Optional[EventType[[], BASE_STATE]] = None,
|
|
783
|
+
on_focus: Optional[EventType[[], BASE_STATE]] = None,
|
|
784
|
+
on_mount: Optional[EventType[[], BASE_STATE]] = None,
|
|
785
|
+
on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
|
|
786
|
+
on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
|
|
787
|
+
on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
|
|
788
|
+
on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
|
|
789
|
+
on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
|
|
790
|
+
on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
|
|
791
|
+
on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
|
|
792
|
+
on_scroll: Optional[EventType[[], BASE_STATE]] = None,
|
|
793
|
+
on_unmount: Optional[EventType[[], BASE_STATE]] = None,
|
|
794
|
+
**props,
|
|
795
|
+
) -> "ContextMenuCheckbox":
|
|
796
|
+
"""Create a new component instance.
|
|
797
|
+
|
|
798
|
+
Will prepend "RadixThemes" to the component tag to avoid conflicts with
|
|
799
|
+
other UI libraries for common names, like Text and Button.
|
|
800
|
+
|
|
801
|
+
Args:
|
|
802
|
+
*children: Child components.
|
|
803
|
+
shortcut: Text to render as shortcut.
|
|
804
|
+
as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
805
|
+
size: Checkbox size "1" - "3"
|
|
806
|
+
variant: Variant of checkbox: "classic" | "surface" | "soft"
|
|
807
|
+
color_scheme: Override theme color for checkbox
|
|
808
|
+
high_contrast: Whether to render the checkbox with higher contrast color against background
|
|
809
|
+
default_checked: Whether the checkbox is checked by default
|
|
810
|
+
checked: Whether the checkbox is checked
|
|
811
|
+
disabled: Whether the checkbox is disabled
|
|
812
|
+
required: Whether the checkbox is required
|
|
813
|
+
name: The name of the checkbox control when submitting the form.
|
|
814
|
+
value: The value of the checkbox control when submitting the form.
|
|
815
|
+
on_change: Fired when the checkbox is checked or unchecked.
|
|
816
|
+
style: The style of the component.
|
|
817
|
+
key: A unique key for the component.
|
|
818
|
+
id: The id for the component.
|
|
819
|
+
class_name: The class name for the component.
|
|
820
|
+
autofocus: Whether the component should take the focus once the page is loaded
|
|
821
|
+
custom_attrs: custom attribute
|
|
822
|
+
**props: Component properties.
|
|
823
|
+
|
|
824
|
+
Returns:
|
|
825
|
+
A new component instance.
|
|
826
|
+
"""
|
|
827
|
+
...
|
|
828
|
+
|
|
675
829
|
class ContextMenu(ComponentNamespace):
|
|
676
830
|
root = staticmethod(ContextMenuRoot.create)
|
|
677
831
|
trigger = staticmethod(ContextMenuTrigger.create)
|
|
@@ -681,5 +835,6 @@ class ContextMenu(ComponentNamespace):
|
|
|
681
835
|
sub_content = staticmethod(ContextMenuSubContent.create)
|
|
682
836
|
item = staticmethod(ContextMenuItem.create)
|
|
683
837
|
separator = staticmethod(ContextMenuSeparator.create)
|
|
838
|
+
checkbox = staticmethod(ContextMenuCheckbox.create)
|
|
684
839
|
|
|
685
840
|
context_menu = ContextMenu()
|
|
@@ -243,7 +243,7 @@ class DialogContent(elements.Div, RadixThemesComponent):
|
|
|
243
243
|
on_escape_key_down: Fired when the escape key is pressed.
|
|
244
244
|
on_pointer_down_outside: Fired when the pointer is down outside the dialog.
|
|
245
245
|
on_interact_outside: Fired when the pointer interacts outside the dialog.
|
|
246
|
-
access_key:
|
|
246
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
247
247
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
248
248
|
content_editable: Indicates whether the element's content is editable.
|
|
249
249
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
@@ -228,7 +228,7 @@ class HoverCardContent(elements.Div, RadixThemesComponent):
|
|
|
228
228
|
sticky: The sticky behavior on the align axis. "partial" will keep the content in the boundary as long as the trigger is at least partially in the boundary whilst "always" will keep the content in the boundary regardless
|
|
229
229
|
hide_when_detached: Whether to hide the content when the trigger becomes fully occluded.
|
|
230
230
|
size: Hovercard size "1" - "3"
|
|
231
|
-
access_key:
|
|
231
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
232
232
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
233
233
|
content_editable: Indicates whether the element's content is editable.
|
|
234
234
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
@@ -79,7 +79,7 @@ class IconButton(elements.Button, RadixLoadingProp, RadixThemesComponent):
|
|
|
79
79
|
else:
|
|
80
80
|
size_map_var = Match.create(
|
|
81
81
|
props["size"],
|
|
82
|
-
*
|
|
82
|
+
*list(RADIX_TO_LUCIDE_SIZE.items()),
|
|
83
83
|
12,
|
|
84
84
|
)
|
|
85
85
|
if not isinstance(size_map_var, Var):
|
|
@@ -193,7 +193,7 @@ class IconButton(elements.Button, RadixLoadingProp, RadixThemesComponent):
|
|
|
193
193
|
name: Name of the button, used when sending form data
|
|
194
194
|
type: Type of the button (submit, reset, or button)
|
|
195
195
|
value: Value of the button, used when sending form data
|
|
196
|
-
access_key:
|
|
196
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
197
197
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
198
198
|
content_editable: Indicates whether the element's content is editable.
|
|
199
199
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
@@ -166,7 +166,7 @@ class Inset(elements.Div, RadixThemesComponent):
|
|
|
166
166
|
pr: Padding on the right
|
|
167
167
|
pb: Padding on the bottom
|
|
168
168
|
pl: Padding on the left
|
|
169
|
-
access_key:
|
|
169
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
170
170
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
171
171
|
content_editable: Indicates whether the element's content is editable.
|
|
172
172
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
@@ -233,7 +233,7 @@ class PopoverContent(elements.Div, RadixThemesComponent):
|
|
|
233
233
|
on_pointer_down_outside: Fired when the pointer is down outside the dialog.
|
|
234
234
|
on_focus_outside: Fired when focus moves outside the dialog.
|
|
235
235
|
on_interact_outside: Fired when the pointer interacts outside the dialog.
|
|
236
|
-
access_key:
|
|
236
|
+
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
|
237
237
|
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
|
|
238
238
|
content_editable: Indicates whether the element's content is editable.
|
|
239
239
|
context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
@@ -140,10 +140,8 @@ class HighLevelRadioGroup(RadixThemesComponent):
|
|
|
140
140
|
color_scheme = props.pop("color_scheme", None)
|
|
141
141
|
default_value = props.pop("default_value", "")
|
|
142
142
|
|
|
143
|
-
if (
|
|
144
|
-
|
|
145
|
-
or isinstance(items, Var)
|
|
146
|
-
and not types._issubclass(items._var_type, list)
|
|
143
|
+
if not isinstance(items, (list, Var)) or (
|
|
144
|
+
isinstance(items, Var) and not types._issubclass(items._var_type, list)
|
|
147
145
|
):
|
|
148
146
|
items_type = type(items) if not isinstance(items, Var) else items._var_type
|
|
149
147
|
raise TypeError(
|
|
@@ -148,7 +148,7 @@ class RadioGroupRoot(RadixThemesComponent):
|
|
|
148
148
|
disabled: Whether the radio group is disabled
|
|
149
149
|
name: The name of the group. Submitted with its owning form as part of a name/value pair.
|
|
150
150
|
required: Whether the radio group is required
|
|
151
|
-
on_change:
|
|
151
|
+
on_change: Fired when the value of the radio group changes.
|
|
152
152
|
style: The style of the component.
|
|
153
153
|
key: A unique key for the component.
|
|
154
154
|
id: The id for the component.
|
|
@@ -81,7 +81,7 @@ class SelectRoot(RadixThemesComponent):
|
|
|
81
81
|
name: The name of the select control when submitting the form.
|
|
82
82
|
disabled: When True, prevents the user from interacting with select.
|
|
83
83
|
required: When True, indicates that the user must select a value before the owning form can be submitted.
|
|
84
|
-
on_change:
|
|
84
|
+
on_change: Fired when the value of the select changes.
|
|
85
85
|
on_open_change: Fired when the select is opened or closed.
|
|
86
86
|
style: The style of the component.
|
|
87
87
|
key: A unique key for the component.
|
|
@@ -732,7 +732,7 @@ class HighLevelSelect(SelectRoot):
|
|
|
732
732
|
name: The name of the select control when submitting the form.
|
|
733
733
|
disabled: When True, prevents the user from interacting with select.
|
|
734
734
|
required: When True, indicates that the user must select a value before the owning form can be submitted.
|
|
735
|
-
on_change:
|
|
735
|
+
on_change: Fired when the value of the select changes.
|
|
736
736
|
on_open_change: Fired when the select is opened or closed.
|
|
737
737
|
style: The style of the component.
|
|
738
738
|
key: A unique key for the component.
|
|
@@ -912,7 +912,7 @@ class Select(ComponentNamespace):
|
|
|
912
912
|
name: The name of the select control when submitting the form.
|
|
913
913
|
disabled: When True, prevents the user from interacting with select.
|
|
914
914
|
required: When True, indicates that the user must select a value before the owning form can be submitted.
|
|
915
|
-
on_change:
|
|
915
|
+
on_change: Fired when the value of the select changes.
|
|
916
916
|
on_open_change: Fired when the select is opened or closed.
|
|
917
917
|
style: The style of the component.
|
|
918
918
|
key: A unique key for the component.
|
|
@@ -195,7 +195,7 @@ class Slider(RadixThemesComponent):
|
|
|
195
195
|
step: The step value of the slider.
|
|
196
196
|
disabled: Whether the slider is disabled
|
|
197
197
|
orientation: The orientation of the slider.
|
|
198
|
-
on_change:
|
|
198
|
+
on_change: Fired when the value of the slider changes.
|
|
199
199
|
on_value_commit: Fired when a thumb is released after being dragged.
|
|
200
200
|
style: The style of the component.
|
|
201
201
|
key: A unique key for the component.
|
|
@@ -157,7 +157,7 @@ class Switch(RadixThemesComponent):
|
|
|
157
157
|
color_scheme: Override theme color for switch
|
|
158
158
|
high_contrast: Whether to render the switch with higher contrast color against background
|
|
159
159
|
radius: Override theme radius for switch: "none" | "small" | "full"
|
|
160
|
-
on_change:
|
|
160
|
+
on_change: Fired when the value of the switch changes
|
|
161
161
|
style: The style of the component.
|
|
162
162
|
key: A unique key for the component.
|
|
163
163
|
id: The id for the component.
|