Skip to content

Commit

Permalink
generate docs for event handlers (#4277)
Browse files Browse the repository at this point in the history
  • Loading branch information
adhami3310 authored Oct 31, 2024
1 parent 4254ead commit a2126be
Show file tree
Hide file tree
Showing 41 changed files with 389 additions and 8 deletions.
1 change: 1 addition & 0 deletions reflex/components/base/error_boundary.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class ErrorBoundary(Component):
Args:
*children: The children of the component.
on_error: Fired when the boundary catches an error.
Fallback_component: Rendered instead of the children when an error is caught.
style: The style of the component.
key: A unique key for the component.
Expand Down
3 changes: 3 additions & 0 deletions reflex/components/base/script.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ class Script(Component):
*children: The children of the component.
src: Required unless inline script is used
strategy: When the script will execute: afterInteractive (defer-like behavior) | beforeInteractive | lazyOnload (async-like behavior)
on_load: Triggered when the script is loading
on_ready: Triggered when the script has loaded
on_error: Triggered when the script has errored
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
Expand Down
1 change: 1 addition & 0 deletions reflex/components/core/clipboard.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class Clipboard(Fragment):
Args:
*children: The children of the component.
targets: The element ids to attach the event listener to. Defaults to all child components or the document.
on_paste: Called when the user pastes data into the document. Data is a list of tuples of (mime_type, data). Binary types will be base64 encoded as a data uri.
on_paste_event_actions: Save the original event actions for the on_paste event.
style: The style of the component.
key: A unique key for the component.
Expand Down
3 changes: 3 additions & 0 deletions reflex/components/core/upload.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ class Upload(MemoizationLeaf):
no_click: Whether to disable click to upload.
no_drag: Whether to disable drag and drop.
no_keyboard: Whether to disable using the space/enter keys to upload.
on_drop: Fired when files are dropped.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
Expand Down Expand Up @@ -211,6 +212,7 @@ class StyledUpload(Upload):
no_click: Whether to disable click to upload.
no_drag: Whether to disable drag and drop.
no_keyboard: Whether to disable using the space/enter keys to upload.
on_drop: Fired when files are dropped.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
Expand Down Expand Up @@ -276,6 +278,7 @@ class UploadNamespace(ComponentNamespace):
no_click: Whether to disable click to upload.
no_drag: Whether to disable drag and drop.
no_keyboard: Whether to disable using the space/enter keys to upload.
on_drop: Fired when files are dropped.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
Expand Down
16 changes: 16 additions & 0 deletions reflex/components/datadisplay/dataeditor.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,22 @@ class DataEditor(NoSSRComponent):
scroll_offset_x: Initial scroll offset on the horizontal axis.
scroll_offset_y: Initial scroll offset on the vertical axis.
theme: global theme
on_cell_activated: Fired when a cell is activated.
on_cell_clicked: Fired when a cell is clicked.
on_cell_context_menu: Fired when a cell is right-clicked.
on_cell_edited: Fired when a cell is edited.
on_group_header_clicked: Fired when a group header is clicked.
on_group_header_context_menu: Fired when a group header is right-clicked.
on_group_header_renamed: Fired when a group header is renamed.
on_header_clicked: Fired when a header is clicked.
on_header_context_menu: Fired when a header is right-clicked.
on_header_menu_click: Fired when a header menu item is clicked.
on_item_hovered: Fired when an item is hovered.
on_delete: Fired when a selection is deleted.
on_finished_editing: Fired when editing is finished.
on_row_appended: Fired when a row is appended.
on_selection_cleared: Fired when the selection is cleared.
on_column_resize: Fired when a column is resized.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
Expand Down
12 changes: 12 additions & 0 deletions reflex/components/el/elements/forms.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ class Form(BaseHTML):
target: Where to display the response after submitting the form
reset_on_submit: If true, the form will be cleared after submit.
handle_submit_unique_name: The name used to make this form's submit handler function unique.
on_submit: Fired when the form is submitted
access_key: Provides a hint for generating a keyboard shortcut for the current element.
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
content_editable: Indicates whether the element's content is editable.
Expand Down Expand Up @@ -520,6 +521,11 @@ class Input(BaseHTML):
type: Specifies the type of input
use_map: Name of the image map used with the input
value: Value of the input
on_change: Fired when the input value changes
on_focus: Fired when the input gains focus
on_blur: Fired when the input loses focus
on_key_down: Fired when a key is pressed down
on_key_up: Fired when a key is released
access_key: Provides a hint for generating a keyboard shortcut for the current element.
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
content_editable: Indicates whether the element's content is editable.
Expand Down Expand Up @@ -1269,6 +1275,7 @@ class Select(BaseHTML):
name: Name of the select, used when submitting the form
required: Indicates that the select control must have a selected option
size: Number of visible options in a drop-down list
on_change: Fired when the select value changes
access_key: Provides a hint for generating a keyboard shortcut for the current element.
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
content_editable: Indicates whether the element's content is editable.
Expand Down Expand Up @@ -1397,6 +1404,11 @@ class Textarea(BaseHTML):
rows: Visible number of lines in the text control
value: The controlled value of the textarea, read only unless used with on_change
wrap: How the text in the textarea is to be wrapped when submitting the form
on_change: Fired when the input value changes
on_focus: Fired when the input gains focus
on_blur: Fired when the input loses focus
on_key_down: Fired when a key is pressed down
on_key_up: Fired when a key is released
access_key: Provides a hint for generating a keyboard shortcut for the current element.
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
content_editable: Indicates whether the element's content is editable.
Expand Down
1 change: 1 addition & 0 deletions reflex/components/moment/moment.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class Moment(NoSSRComponent):
local: Outputs the result in local time.
tz: Display the date in the given timezone.
locale: The locale to use when rendering.
on_change: Fires when the date changes.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
Expand Down
2 changes: 2 additions & 0 deletions reflex/components/next/image.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class Image(NextComponent):
placeholder: A placeholder to use while the image is loading. Possible values are blur, empty, or data:image/.... Defaults to empty.
loading: Allows passing CSS styles to the underlying image element. style: Var[Any] The loading behavior of the image. Defaults to lazy. Can hurt performance, recommended to use `priority` instead.
blurDataURL: A Data URL to be used as a placeholder image before the src image successfully loads. Only takes effect when combined with placeholder="blur".
on_load: Fires when the image has loaded.
on_error: Fires when the image has an error.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
Expand Down
20 changes: 20 additions & 0 deletions reflex/components/plotly/plotly.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,26 @@ class Plotly(NoSSRComponent):
template: The template for visual appearance of the graph.
config: The config of the graph.
use_resize_handler: If true, the graph will resize when the window is resized.
on_after_plot: Fired after the plot is redrawn.
on_animated: Fired after the plot was animated.
on_animating_frame: Fired while animating a single frame (does not currently pass data through).
on_animation_interrupted: Fired when an animation is interrupted (to start a new animation for example).
on_autosize: Fired when the plot is responsively sized.
on_before_hover: Fired whenever mouse moves over a plot.
on_button_clicked: Fired when a plotly UI button is clicked.
on_click: Fired when the plot is clicked.
on_deselect: Fired when a selection is cleared (via double click).
on_double_click: Fired when the plot is double clicked.
on_hover: Fired when a plot element is hovered over.
on_relayout: Fired after the plot is layed out (zoom, pan, etc).
on_relayouting: Fired while the plot is being layed out.
on_restyle: Fired after the plot style is changed.
on_redraw: Fired after the plot is redrawn.
on_selected: Fired after selecting plot elements.
on_selecting: Fired while dragging a selection.
on_transitioning: Fired while an animation is occuring.
on_transition_interrupted: Fired when a transition is stopped early.
on_unhover: Fired when a hovered element is no longer hovered.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
Expand Down
1 change: 1 addition & 0 deletions reflex/components/radix/primitives/accordion.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ class AccordionRoot(AccordionComponent):
duration: The time in milliseconds to animate open and close
easing: The easing function to use for the animation.
show_dividers: Whether to show divider lines between items.
on_value_change: Fired when the opened the accordions changes.
color_scheme: The color scheme of the component.
variant: The variant of the component.
as_child: Change the default rendered element for the one passed as a child.
Expand Down
6 changes: 3 additions & 3 deletions reflex/components/radix/primitives/drawer.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class DrawerRoot(DrawerComponent):
# When `True`, it prevents scroll restoration. Defaults to `True`.
preventScrollRestoration: Var[bool]

# Fires when the drawer is opened.
# Fires when the drawer is opened or closed.
on_open_change: EventHandler[identity_event(bool)]


Expand All @@ -79,8 +79,8 @@ def create(cls, *children: Any, **props: Any) -> Component:
"""Create a new DrawerTrigger instance.
Args:
children: The children of the element.
props: The properties of the element.
*children: The children of the element.
**props: The properties of the element.
Returns:
The new DrawerTrigger instance.
Expand Down
24 changes: 20 additions & 4 deletions reflex/components/radix/primitives/drawer.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class DrawerRoot(DrawerComponent):
modal: When `False`, it allows to interact with elements outside of the drawer without closing it. Defaults to `True`.
direction: Direction of the drawer. Defaults to `"bottom"`
preventScrollRestoration: When `True`, it prevents scroll restoration. Defaults to `True`.
on_open_change: Fires when the drawer is opened or closed.
as_child: Change the default rendered element for the one passed as a child.
style: The style of the component.
key: A unique key for the component.
Expand Down Expand Up @@ -166,8 +167,15 @@ class DrawerTrigger(DrawerComponent):
"""Create a new DrawerTrigger instance.
Args:
children: The children of the element.
props: The properties of the element.
*children: The children of the element.
as_child: Change the default rendered element for the one passed as a child.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the element.
Returns:
The new DrawerTrigger instance.
Expand Down Expand Up @@ -360,8 +368,15 @@ class DrawerClose(DrawerTrigger):
"""Create a new DrawerTrigger instance.
Args:
children: The children of the element.
props: The properties of the element.
*children: The children of the element.
as_child: Change the default rendered element for the one passed as a child.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
class_name: The class name for the component.
autofocus: Whether the component should take the focus once the page is loaded
custom_attrs: custom attribute
**props: The properties of the element.
Returns:
The new DrawerTrigger instance.
Expand Down Expand Up @@ -529,6 +544,7 @@ class Drawer(ComponentNamespace):
modal: When `False`, it allows to interact with elements outside of the drawer without closing it. Defaults to `True`.
direction: Direction of the drawer. Defaults to `"bottom"`
preventScrollRestoration: When `True`, it prevents scroll restoration. Defaults to `True`.
on_open_change: Fires when the drawer is opened or closed.
as_child: Change the default rendered element for the one passed as a child.
style: The style of the component.
key: A unique key for the component.
Expand Down
6 changes: 6 additions & 0 deletions reflex/components/radix/primitives/form.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ class FormRoot(FormComponent, HTMLForm):
Args:
*children: The children of the form.
on_clear_server_errors: Fired when the errors are cleared.
as_child: Change the default rendered element for the one passed as a child.
accept: MIME types the server accepts for file upload
accept_charset: Character encodings to be used for form submission
Expand All @@ -149,6 +150,7 @@ class FormRoot(FormComponent, HTMLForm):
target: Where to display the response after submitting the form
reset_on_submit: If true, the form will be cleared after submit.
handle_submit_unique_name: The name used to make this form's submit handler function unique.
on_submit: Fired when the form is submitted
access_key: Provides a hint for generating a keyboard shortcut for the current element.
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
content_editable: Indicates whether the element's content is editable.
Expand Down Expand Up @@ -602,6 +604,7 @@ class Form(FormRoot):
Args:
*children: The children of the form.
on_clear_server_errors: Fired when the errors are cleared.
as_child: Change the default rendered element for the one passed as a child.
accept: MIME types the server accepts for file upload
accept_charset: Character encodings to be used for form submission
Expand All @@ -614,6 +617,7 @@ class Form(FormRoot):
target: Where to display the response after submitting the form
reset_on_submit: If true, the form will be cleared after submit.
handle_submit_unique_name: The name used to make this form's submit handler function unique.
on_submit: Fired when the form is submitted
access_key: Provides a hint for generating a keyboard shortcut for the current element.
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
content_editable: Indicates whether the element's content is editable.
Expand Down Expand Up @@ -724,6 +728,7 @@ class FormNamespace(ComponentNamespace):
Args:
*children: The children of the form.
on_clear_server_errors: Fired when the errors are cleared.
as_child: Change the default rendered element for the one passed as a child.
accept: MIME types the server accepts for file upload
accept_charset: Character encodings to be used for form submission
Expand All @@ -736,6 +741,7 @@ class FormNamespace(ComponentNamespace):
target: Where to display the response after submitting the form
reset_on_submit: If true, the form will be cleared after submit.
handle_submit_unique_name: The name used to make this form's submit handler function unique.
on_submit: Fired when the form is submitted
access_key: Provides a hint for generating a keyboard shortcut for the current element.
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
content_editable: Indicates whether the element's content is editable.
Expand Down
2 changes: 2 additions & 0 deletions reflex/components/radix/primitives/slider.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ class SliderRoot(SliderComponent):
Args:
*children: The children of the component.
on_value_change: Fired when the value of a thumb changes.
on_value_commit: Fired when a thumb is released.
as_child: Change the default rendered element for the one passed as a child.
style: The style of the component.
key: A unique key for the component.
Expand Down
1 change: 1 addition & 0 deletions reflex/components/radix/themes/color_mode.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ class ColorModeSwitch(Switch):
color_scheme: Override theme color for switch
high_contrast: Whether to render the switch with higher contrast color against background
radius: Override theme radius for switch: "none" | "small" | "full"
on_change: Props to rename Fired when the value of the switch changes
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
Expand Down
4 changes: 4 additions & 0 deletions reflex/components/radix/themes/components/alert_dialog.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class AlertDialogRoot(RadixThemesComponent):
Args:
*children: Child components.
open: The controlled open state of the dialog.
on_open_change: Fired when the open state changes.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
Expand Down Expand Up @@ -186,6 +187,9 @@ class AlertDialogContent(elements.Div, RadixThemesComponent):
*children: Child components.
size: The size of the content.
force_mount: Whether to force mount the content on open.
on_open_auto_focus: Fired when the dialog is opened.
on_close_auto_focus: Fired when the dialog is closed.
on_escape_key_down: Fired when the escape key is pressed.
access_key: Provides a hint for generating a keyboard shortcut for the current element.
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
content_editable: Indicates whether the element's content is editable.
Expand Down
Loading

0 comments on commit a2126be

Please sign in to comment.