From a5c73ad8e51ceb97a2a5c639b6a1941edb3f74d2 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Tue, 10 Sep 2024 11:43:37 -0700 Subject: [PATCH] Use old serializer system in LiteralVar (#3875) * use serializer system * add checks for unsupported operands * and and or are now supported * format * remove unnecessary call to JSON * put base before rest * fix failing testcase * add hinting to get static analysis to complain * damn * big changes * get typeguard from extensions * please darglint * dangit darglint * remove one from vars * add without data and use it in plotly * DARGLINT * change format for special props * add pyi * delete instances of Var.create * modify client state to work * fixed so much * remove every Var.create * delete all basevar stuff * checkpoint * fix pyi * get older python to work * dangit darglint * add simple fix to last failing testcase * remove var name unwrapped and put client state on immutable var * fix older python * fox event issues * change forms pyi * make test less strict * use rx state directly * add typeignore to page_id * implement foreach * delete .web states folder silly * update reflex chakra * fix issue when on mount or on unmount is not set * nuke Var * run pyi * import immutablevar in critical location * delete unwrap vars * bring back array ref * fix style props in app * /health endpoint for K8 Liveness and Readiness probes (#3855) * Added API Endpoint * Added API Endpoint * Added Unit Tests * Added Unit Tests * main * Apply suggestions from Code Review * Fix Ruff Formatting * Update Socket Events * Async Functions * Update find_replace (#3886) * [REF-3592]Promote `rx.progress` from radix themes (#3878) * Promote `rx.progress` from radix themes * fix pyi * add warning when accessing `rx._x.progress` * Use correct flexgen backend URL (#3891) * Remove demo template (#3888) * gitignore .web (#3885) * update overflowY in AUTO_HEIGHT_JS from hidden to scroll (#3882) * Retain mutability inside `async with self` block (#3884) When emitting a state update, restore `_self_mutable` to the value it had previously so that `yield` in the middle of `async with self` does not result in an immutable StateProxy. Fix #3869 * Include child imports in markdown component_map (#3883) If a component in the markdown component_map contains children components, use `_get_all_imports` to recursively enumerate them. Fix #3880 * [REF-3570] Remove deprecated REDIS_URL syntax (#3892) * mixin computed vars should only be applied to highest level state (#3833) * improve state hierarchy validation, drop old testing special case (#3894) * fix var dependency dicts (#3842) * Adding array to array pluck operation. (#3868) * fix initial state without cv fallback (#3670) * add fragment to foreach (#3877) * Update docker-example (#3324) * /health endpoint for K8 Liveness and Readiness probes (#3855) * Added API Endpoint * Added API Endpoint * Added Unit Tests * Added Unit Tests * main * Apply suggestions from Code Review * Fix Ruff Formatting * Update Socket Events * Async Functions * /health endpoint for K8 Liveness and Readiness probes (#3855) * Added API Endpoint * Added API Endpoint * Added Unit Tests * Added Unit Tests * main * Apply suggestions from Code Review * Fix Ruff Formatting * Update Socket Events * Async Functions * Merge branch 'main' into use-old-serializer-in-literalvar * [REF-3570] Remove deprecated REDIS_URL syntax (#3892) * /health endpoint for K8 Liveness and Readiness probes (#3855) * Added API Endpoint * Added API Endpoint * Added Unit Tests * Added Unit Tests * main * Apply suggestions from Code Review * Fix Ruff Formatting * Update Socket Events * Async Functions * [REF-3570] Remove deprecated REDIS_URL syntax (#3892) * remove extra var Co-authored-by: Masen Furer * resolve typo * write better doc for var.create * return var value when we know it's literal var * fix unit test * less bloat for ToOperations * simplify ImmutableComputedVar.__get__ (#3902) * simplify ImmutableComputedVar.__get__ * ruff it --------- Co-authored-by: Samarth Bhadane Co-authored-by: Elijah Ahianyo Co-authored-by: Masen Furer Co-authored-by: benedikt-bartscher <31854409+benedikt-bartscher@users.noreply.github.com> Co-authored-by: Vishnu Deva Co-authored-by: abulvenz --- integration/test_dynamic_routes.py | 5 +- integration/test_tailwind.py | 2 +- poetry.lock | 632 ++--- .../jinja/web/pages/utils.js.jinja2 | 4 +- .../jinja/web/utils/theme.js.jinja2 | 2 +- reflex/compiler/compiler.py | 9 +- reflex/compiler/utils.py | 4 +- reflex/components/base/app_wrap.pyi | 44 +- reflex/components/base/bare.py | 4 +- reflex/components/base/body.pyi | 44 +- reflex/components/base/document.pyi | 212 +- reflex/components/base/error_boundary.py | 2 +- reflex/components/base/error_boundary.pyi | 49 +- reflex/components/base/fragment.pyi | 44 +- reflex/components/base/head.pyi | 86 +- reflex/components/base/link.pyi | 85 +- reflex/components/base/meta.pyi | 170 +- reflex/components/base/script.pyi | 55 +- reflex/components/component.py | 99 +- reflex/components/core/banner.py | 6 +- reflex/components/core/banner.pyi | 212 +- reflex/components/core/client_side_routing.py | 3 +- .../components/core/client_side_routing.pyi | 85 +- reflex/components/core/clipboard.py | 4 +- reflex/components/core/clipboard.pyi | 47 +- reflex/components/core/cond.py | 13 +- reflex/components/core/debounce.py | 14 +- reflex/components/core/debounce.pyi | 47 +- reflex/components/core/foreach.py | 6 +- reflex/components/core/html.pyi | 43 +- reflex/components/core/match.py | 37 +- reflex/components/core/upload.py | 29 +- reflex/components/core/upload.pyi | 192 +- reflex/components/datadisplay/code.py | 6 +- reflex/components/datadisplay/code.pyi | 43 +- reflex/components/datadisplay/dataeditor.py | 23 +- reflex/components/datadisplay/dataeditor.pyi | 77 +- reflex/components/el/element.pyi | 44 +- reflex/components/el/elements/base.pyi | 43 +- reflex/components/el/elements/forms.py | 23 +- reflex/components/el/elements/forms.pyi | 618 +++-- reflex/components/el/elements/inline.pyi | 1177 +++++---- reflex/components/el/elements/media.pyi | 883 ++++--- reflex/components/el/elements/metadata.py | 5 +- reflex/components/el/elements/metadata.pyi | 253 +- reflex/components/el/elements/other.pyi | 295 ++- reflex/components/el/elements/scripts.pyi | 127 +- reflex/components/el/elements/sectioning.pyi | 631 +++-- reflex/components/el/elements/tables.pyi | 421 +-- reflex/components/el/elements/typography.pyi | 631 +++-- reflex/components/gridjs/datatable.py | 25 +- reflex/components/gridjs/datatable.pyi | 85 +- reflex/components/lucide/icon.pyi | 85 +- reflex/components/markdown/markdown.py | 27 +- reflex/components/markdown/markdown.pyi | 46 +- reflex/components/moment/moment.pyi | 47 +- reflex/components/next/base.pyi | 44 +- reflex/components/next/image.pyi | 51 +- reflex/components/next/link.pyi | 43 +- reflex/components/next/video.pyi | 43 +- reflex/components/plotly/plotly.py | 44 +- reflex/components/plotly/plotly.pyi | 83 +- reflex/components/props.py | 14 +- .../components/radix/primitives/accordion.py | 6 +- .../components/radix/primitives/accordion.pyi | 301 ++- reflex/components/radix/primitives/base.pyi | 85 +- reflex/components/radix/primitives/drawer.pyi | 435 ++-- reflex/components/radix/primitives/form.pyi | 439 ++-- .../components/radix/primitives/progress.pyi | 211 +- reflex/components/radix/primitives/slider.pyi | 215 +- reflex/components/radix/themes/base.pyi | 295 ++- reflex/components/radix/themes/color_mode.py | 14 +- reflex/components/radix/themes/color_mode.pyi | 151 +- .../radix/themes/components/alert_dialog.pyi | 303 ++- .../radix/themes/components/aspect_ratio.pyi | 43 +- .../radix/themes/components/avatar.pyi | 43 +- .../radix/themes/components/badge.pyi | 43 +- .../radix/themes/components/button.pyi | 43 +- .../radix/themes/components/callout.pyi | 211 +- .../radix/themes/components/card.pyi | 43 +- .../radix/themes/components/checkbox.pyi | 139 +- .../themes/components/checkbox_cards.pyi | 85 +- .../themes/components/checkbox_group.pyi | 85 +- .../radix/themes/components/context_menu.pyi | 357 ++- .../radix/themes/components/data_list.pyi | 169 +- .../radix/themes/components/dialog.pyi | 309 ++- .../radix/themes/components/dropdown_menu.pyi | 363 ++- .../radix/themes/components/hover_card.pyi | 173 +- .../radix/themes/components/icon_button.py | 3 +- .../radix/themes/components/icon_button.pyi | 43 +- .../radix/themes/components/inset.pyi | 43 +- .../radix/themes/components/popover.pyi | 183 +- .../radix/themes/components/progress.pyi | 43 +- .../radix/themes/components/radio.pyi | 43 +- .../radix/themes/components/radio_cards.pyi | 87 +- .../radix/themes/components/radio_group.py | 14 +- .../radix/themes/components/radio_group.pyi | 173 +- .../radix/themes/components/scroll_area.pyi | 43 +- .../themes/components/segmented_control.pyi | 89 +- .../radix/themes/components/select.py | 3 +- .../radix/themes/components/select.pyi | 403 +-- .../radix/themes/components/separator.pyi | 43 +- .../radix/themes/components/skeleton.pyi | 43 +- .../radix/themes/components/slider.py | 3 +- .../radix/themes/components/slider.pyi | 49 +- .../radix/themes/components/spinner.pyi | 43 +- .../radix/themes/components/switch.pyi | 47 +- .../radix/themes/components/table.pyi | 295 ++- .../radix/themes/components/tabs.pyi | 219 +- .../radix/themes/components/text_area.pyi | 53 +- .../radix/themes/components/text_field.pyi | 147 +- .../radix/themes/components/tooltip.pyi | 49 +- .../components/radix/themes/layout/base.pyi | 43 +- reflex/components/radix/themes/layout/box.pyi | 43 +- .../components/radix/themes/layout/center.pyi | 43 +- .../radix/themes/layout/container.pyi | 43 +- .../components/radix/themes/layout/flex.pyi | 43 +- .../components/radix/themes/layout/grid.pyi | 43 +- reflex/components/radix/themes/layout/list.py | 9 +- .../components/radix/themes/layout/list.pyi | 219 +- .../radix/themes/layout/section.pyi | 43 +- .../components/radix/themes/layout/spacer.pyi | 43 +- .../components/radix/themes/layout/stack.pyi | 127 +- .../radix/themes/typography/blockquote.pyi | 43 +- .../radix/themes/typography/code.pyi | 43 +- .../radix/themes/typography/heading.pyi | 43 +- .../radix/themes/typography/link.pyi | 43 +- .../radix/themes/typography/text.pyi | 295 ++- reflex/components/react_player/audio.pyi | 91 +- .../components/react_player/react_player.pyi | 91 +- reflex/components/react_player/video.pyi | 91 +- reflex/components/recharts/cartesian.py | 4 +- reflex/components/recharts/cartesian.pyi | 773 +++--- reflex/components/recharts/charts.py | 8 +- reflex/components/recharts/charts.pyi | 459 ++-- reflex/components/recharts/general.pyi | 211 +- reflex/components/recharts/polar.py | 8 +- reflex/components/recharts/polar.pyi | 185 +- reflex/components/recharts/recharts.pyi | 86 +- reflex/components/sonner/toast.py | 33 +- reflex/components/sonner/toast.pyi | 53 +- reflex/components/suneditor/editor.py | 3 +- reflex/components/suneditor/editor.pyi | 73 +- reflex/components/tags/iter_tag.py | 11 +- reflex/components/tags/tag.py | 7 +- reflex/event.py | 34 +- reflex/experimental/client_state.py | 64 +- reflex/experimental/hooks.py | 31 +- reflex/experimental/layout.py | 10 +- reflex/experimental/layout.pyi | 215 +- reflex/ivars/base.py | 699 +++-- reflex/ivars/function.py | 75 +- reflex/ivars/number.py | 422 +-- reflex/ivars/object.py | 88 +- reflex/ivars/sequence.py | 705 ++++- reflex/state.py | 46 +- reflex/style.py | 34 +- reflex/utils/format.py | 259 +- reflex/utils/pyi_generator.py | 9 +- reflex/utils/serializers.py | 44 +- reflex/utils/types.py | 14 +- reflex/vars.py | 2306 +---------------- reflex/vars.pyi | 221 -- tests/components/core/test_banner.py | 28 +- tests/components/core/test_colors.py | 4 +- tests/components/core/test_cond.py | 13 +- tests/components/core/test_debounce.py | 4 +- tests/components/core/test_foreach.py | 8 +- tests/components/core/test_match.py | 8 +- tests/components/core/test_upload.py | 6 +- tests/components/forms/test_form.py | 4 +- tests/components/radix/test_icon_button.py | 4 +- tests/components/test_component.py | 72 +- tests/components/test_tag.py | 9 +- tests/test_app.py | 10 +- tests/test_event.py | 51 +- tests/test_state.py | 20 +- tests/test_style.py | 6 +- tests/test_var.py | 779 +++--- tests/utils/test_format.py | 240 +- tests/utils/test_serializers.py | 59 +- tests/utils/test_utils.py | 10 +- 182 files changed, 13597 insertions(+), 11316 deletions(-) delete mode 100644 reflex/vars.pyi diff --git a/integration/test_dynamic_routes.py b/integration/test_dynamic_routes.py index 0ce4ef2c91..2352324617 100644 --- a/integration/test_dynamic_routes.py +++ b/integration/test_dynamic_routes.py @@ -23,7 +23,6 @@ def DynamicRoute(): class DynamicState(rx.State): order: List[str] = [] - page_id: str = "" def on_load(self): self.order.append(f"{self.router.page.path}-{self.page_id or 'no page id'}") @@ -47,7 +46,7 @@ def index(): is_read_only=True, id="token", ), - rc.input(value=DynamicState.page_id, is_read_only=True, id="page_id"), + rc.input(value=rx.State.page_id, is_read_only=True, id="page_id"), # type: ignore rc.input( value=DynamicState.router.page.raw_path, is_read_only=True, @@ -74,9 +73,9 @@ def redirect_page(): return rx.fragment(rx.text("redirecting...")) app = rx.App(state=rx.State) - app.add_page(index) app.add_page(index, route="/page/[page_id]", on_load=DynamicState.on_load) # type: ignore app.add_page(index, route="/static/x", on_load=DynamicState.on_load) # type: ignore + app.add_page(index) app.add_custom_404_page(on_load=DynamicState.on_load) # type: ignore diff --git a/integration/test_tailwind.py b/integration/test_tailwind.py index a3d90e6452..491eba5386 100644 --- a/integration/test_tailwind.py +++ b/integration/test_tailwind.py @@ -109,7 +109,7 @@ def test_tailwind_app(tailwind_app: AppHarness, tailwind_disabled: bool): assert len(paragraphs) == 3 for p in paragraphs: assert tailwind_app.poll_for_content(p, exp_not_equal="") == PARAGRAPH_TEXT - assert p.value_of_css_property("font-family") == '"monospace"' + assert p.value_of_css_property("font-family") == "monospace" if tailwind_disabled: # expect default color, not "text-red-500" from tailwind utility class assert p.value_of_css_property("color") not in TEXT_RED_500_COLOR diff --git a/poetry.lock b/poetry.lock index 0ef22ebd42..6604a361a2 100644 --- a/poetry.lock +++ b/poetry.lock @@ -126,13 +126,13 @@ files = [ [[package]] name = "build" -version = "1.2.1" +version = "1.2.2" description = "A simple, correct Python build frontend" optional = false python-versions = ">=3.8" files = [ - {file = "build-1.2.1-py3-none-any.whl", hash = "sha256:75e10f767a433d9a86e50d83f418e83efc18ede923ee5ff7df93b6cb0306c5d4"}, - {file = "build-1.2.1.tar.gz", hash = "sha256:526263f4870c26f26c433545579475377b2b7588b6f1eac76a001e873ae3e19d"}, + {file = "build-1.2.2-py3-none-any.whl", hash = "sha256:277ccc71619d98afdd841a0e96ac9fe1593b823af481d3b0cea748e8894e0613"}, + {file = "build-1.2.2.tar.gz", hash = "sha256:119b2fb462adef986483438377a13b2f42064a2a3a4161f24a0cca698a07ac8c"}, ] [package.dependencies] @@ -162,78 +162,78 @@ files = [ [[package]] name = "cffi" -version = "1.17.0" +version = "1.17.1" description = "Foreign Function Interface for Python calling C code." optional = false python-versions = ">=3.8" files = [ - {file = "cffi-1.17.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f9338cc05451f1942d0d8203ec2c346c830f8e86469903d5126c1f0a13a2bcbb"}, - {file = "cffi-1.17.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a0ce71725cacc9ebf839630772b07eeec220cbb5f03be1399e0457a1464f8e1a"}, - {file = "cffi-1.17.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c815270206f983309915a6844fe994b2fa47e5d05c4c4cef267c3b30e34dbe42"}, - {file = "cffi-1.17.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d6bdcd415ba87846fd317bee0774e412e8792832e7805938987e4ede1d13046d"}, - {file = "cffi-1.17.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8a98748ed1a1df4ee1d6f927e151ed6c1a09d5ec21684de879c7ea6aa96f58f2"}, - {file = "cffi-1.17.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0a048d4f6630113e54bb4b77e315e1ba32a5a31512c31a273807d0027a7e69ab"}, - {file = "cffi-1.17.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:24aa705a5f5bd3a8bcfa4d123f03413de5d86e497435693b638cbffb7d5d8a1b"}, - {file = "cffi-1.17.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:856bf0924d24e7f93b8aee12a3a1095c34085600aa805693fb7f5d1962393206"}, - {file = "cffi-1.17.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:4304d4416ff032ed50ad6bb87416d802e67139e31c0bde4628f36a47a3164bfa"}, - {file = "cffi-1.17.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:331ad15c39c9fe9186ceaf87203a9ecf5ae0ba2538c9e898e3a6967e8ad3db6f"}, - {file = "cffi-1.17.0-cp310-cp310-win32.whl", hash = "sha256:669b29a9eca6146465cc574659058ed949748f0809a2582d1f1a324eb91054dc"}, - {file = "cffi-1.17.0-cp310-cp310-win_amd64.whl", hash = "sha256:48b389b1fd5144603d61d752afd7167dfd205973a43151ae5045b35793232aa2"}, - {file = "cffi-1.17.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c5d97162c196ce54af6700949ddf9409e9833ef1003b4741c2b39ef46f1d9720"}, - {file = "cffi-1.17.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5ba5c243f4004c750836f81606a9fcb7841f8874ad8f3bf204ff5e56332b72b9"}, - {file = "cffi-1.17.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bb9333f58fc3a2296fb1d54576138d4cf5d496a2cc118422bd77835e6ae0b9cb"}, - {file = "cffi-1.17.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:435a22d00ec7d7ea533db494da8581b05977f9c37338c80bc86314bec2619424"}, - {file = "cffi-1.17.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d1df34588123fcc88c872f5acb6f74ae59e9d182a2707097f9e28275ec26a12d"}, - {file = "cffi-1.17.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:df8bb0010fdd0a743b7542589223a2816bdde4d94bb5ad67884348fa2c1c67e8"}, - {file = "cffi-1.17.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8b5b9712783415695663bd463990e2f00c6750562e6ad1d28e072a611c5f2a6"}, - {file = "cffi-1.17.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ffef8fd58a36fb5f1196919638f73dd3ae0db1a878982b27a9a5a176ede4ba91"}, - {file = "cffi-1.17.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:4e67d26532bfd8b7f7c05d5a766d6f437b362c1bf203a3a5ce3593a645e870b8"}, - {file = "cffi-1.17.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:45f7cd36186db767d803b1473b3c659d57a23b5fa491ad83c6d40f2af58e4dbb"}, - {file = "cffi-1.17.0-cp311-cp311-win32.whl", hash = "sha256:a9015f5b8af1bb6837a3fcb0cdf3b874fe3385ff6274e8b7925d81ccaec3c5c9"}, - {file = "cffi-1.17.0-cp311-cp311-win_amd64.whl", hash = "sha256:b50aaac7d05c2c26dfd50c3321199f019ba76bb650e346a6ef3616306eed67b0"}, - {file = "cffi-1.17.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:aec510255ce690d240f7cb23d7114f6b351c733a74c279a84def763660a2c3bc"}, - {file = "cffi-1.17.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2770bb0d5e3cc0e31e7318db06efcbcdb7b31bcb1a70086d3177692a02256f59"}, - {file = "cffi-1.17.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:db9a30ec064129d605d0f1aedc93e00894b9334ec74ba9c6bdd08147434b33eb"}, - {file = "cffi-1.17.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a47eef975d2b8b721775a0fa286f50eab535b9d56c70a6e62842134cf7841195"}, - {file = "cffi-1.17.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f3e0992f23bbb0be00a921eae5363329253c3b86287db27092461c887b791e5e"}, - {file = "cffi-1.17.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6107e445faf057c118d5050560695e46d272e5301feffda3c41849641222a828"}, - {file = "cffi-1.17.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eb862356ee9391dc5a0b3cbc00f416b48c1b9a52d252d898e5b7696a5f9fe150"}, - {file = "cffi-1.17.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c1c13185b90bbd3f8b5963cd8ce7ad4ff441924c31e23c975cb150e27c2bf67a"}, - {file = "cffi-1.17.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:17c6d6d3260c7f2d94f657e6872591fe8733872a86ed1345bda872cfc8c74885"}, - {file = "cffi-1.17.0-cp312-cp312-win32.whl", hash = "sha256:c3b8bd3133cd50f6b637bb4322822c94c5ce4bf0d724ed5ae70afce62187c492"}, - {file = "cffi-1.17.0-cp312-cp312-win_amd64.whl", hash = "sha256:dca802c8db0720ce1c49cce1149ff7b06e91ba15fa84b1d59144fef1a1bc7ac2"}, - {file = "cffi-1.17.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:6ce01337d23884b21c03869d2f68c5523d43174d4fc405490eb0091057943118"}, - {file = "cffi-1.17.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:cab2eba3830bf4f6d91e2d6718e0e1c14a2f5ad1af68a89d24ace0c6b17cced7"}, - {file = "cffi-1.17.0-cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:14b9cbc8f7ac98a739558eb86fabc283d4d564dafed50216e7f7ee62d0d25377"}, - {file = "cffi-1.17.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b00e7bcd71caa0282cbe3c90966f738e2db91e64092a877c3ff7f19a1628fdcb"}, - {file = "cffi-1.17.0-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:41f4915e09218744d8bae14759f983e466ab69b178de38066f7579892ff2a555"}, - {file = "cffi-1.17.0-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e4760a68cab57bfaa628938e9c2971137e05ce48e762a9cb53b76c9b569f1204"}, - {file = "cffi-1.17.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:011aff3524d578a9412c8b3cfaa50f2c0bd78e03eb7af7aa5e0df59b158efb2f"}, - {file = "cffi-1.17.0-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:a003ac9edc22d99ae1286b0875c460351f4e101f8c9d9d2576e78d7e048f64e0"}, - {file = "cffi-1.17.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ef9528915df81b8f4c7612b19b8628214c65c9b7f74db2e34a646a0a2a0da2d4"}, - {file = "cffi-1.17.0-cp313-cp313-win32.whl", hash = "sha256:70d2aa9fb00cf52034feac4b913181a6e10356019b18ef89bc7c12a283bf5f5a"}, - {file = "cffi-1.17.0-cp313-cp313-win_amd64.whl", hash = "sha256:b7b6ea9e36d32582cda3465f54c4b454f62f23cb083ebc7a94e2ca6ef011c3a7"}, - {file = "cffi-1.17.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:964823b2fc77b55355999ade496c54dde161c621cb1f6eac61dc30ed1b63cd4c"}, - {file = "cffi-1.17.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:516a405f174fd3b88829eabfe4bb296ac602d6a0f68e0d64d5ac9456194a5b7e"}, - {file = "cffi-1.17.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dec6b307ce928e8e112a6bb9921a1cb00a0e14979bf28b98e084a4b8a742bd9b"}, - {file = "cffi-1.17.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e4094c7b464cf0a858e75cd14b03509e84789abf7b79f8537e6a72152109c76e"}, - {file = "cffi-1.17.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2404f3de742f47cb62d023f0ba7c5a916c9c653d5b368cc966382ae4e57da401"}, - {file = "cffi-1.17.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3aa9d43b02a0c681f0bfbc12d476d47b2b2b6a3f9287f11ee42989a268a1833c"}, - {file = "cffi-1.17.0-cp38-cp38-win32.whl", hash = "sha256:0bb15e7acf8ab35ca8b24b90af52c8b391690ef5c4aec3d31f38f0d37d2cc499"}, - {file = "cffi-1.17.0-cp38-cp38-win_amd64.whl", hash = "sha256:93a7350f6706b31f457c1457d3a3259ff9071a66f312ae64dc024f049055f72c"}, - {file = "cffi-1.17.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1a2ddbac59dc3716bc79f27906c010406155031a1c801410f1bafff17ea304d2"}, - {file = "cffi-1.17.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6327b572f5770293fc062a7ec04160e89741e8552bf1c358d1a23eba68166759"}, - {file = "cffi-1.17.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dbc183e7bef690c9abe5ea67b7b60fdbca81aa8da43468287dae7b5c046107d4"}, - {file = "cffi-1.17.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5bdc0f1f610d067c70aa3737ed06e2726fd9d6f7bfee4a351f4c40b6831f4e82"}, - {file = "cffi-1.17.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6d872186c1617d143969defeadac5a904e6e374183e07977eedef9c07c8953bf"}, - {file = "cffi-1.17.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0d46ee4764b88b91f16661a8befc6bfb24806d885e27436fdc292ed7e6f6d058"}, - {file = "cffi-1.17.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f76a90c345796c01d85e6332e81cab6d70de83b829cf1d9762d0a3da59c7932"}, - {file = "cffi-1.17.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0e60821d312f99d3e1569202518dddf10ae547e799d75aef3bca3a2d9e8ee693"}, - {file = "cffi-1.17.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:eb09b82377233b902d4c3fbeeb7ad731cdab579c6c6fda1f763cd779139e47c3"}, - {file = "cffi-1.17.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:24658baf6224d8f280e827f0a50c46ad819ec8ba380a42448e24459daf809cf4"}, - {file = "cffi-1.17.0-cp39-cp39-win32.whl", hash = "sha256:0fdacad9e0d9fc23e519efd5ea24a70348305e8d7d85ecbb1a5fa66dc834e7fb"}, - {file = "cffi-1.17.0-cp39-cp39-win_amd64.whl", hash = "sha256:7cbc78dc018596315d4e7841c8c3a7ae31cc4d638c9b627f87d52e8abaaf2d29"}, - {file = "cffi-1.17.0.tar.gz", hash = "sha256:f3157624b7558b914cb039fd1af735e5e8049a87c817cc215109ad1c8779df76"}, + {file = "cffi-1.17.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:df8b1c11f177bc2313ec4b2d46baec87a5f3e71fc8b45dab2ee7cae86d9aba14"}, + {file = "cffi-1.17.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8f2cdc858323644ab277e9bb925ad72ae0e67f69e804f4898c070998d50b1a67"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:edae79245293e15384b51f88b00613ba9f7198016a5948b5dddf4917d4d26382"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:45398b671ac6d70e67da8e4224a065cec6a93541bb7aebe1b198a61b58c7b702"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ad9413ccdeda48c5afdae7e4fa2192157e991ff761e7ab8fdd8926f40b160cc3"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5da5719280082ac6bd9aa7becb3938dc9f9cbd57fac7d2871717b1feb0902ab6"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2bb1a08b8008b281856e5971307cc386a8e9c5b625ac297e853d36da6efe9c17"}, + {file = "cffi-1.17.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:045d61c734659cc045141be4bae381a41d89b741f795af1dd018bfb532fd0df8"}, + {file = "cffi-1.17.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:6883e737d7d9e4899a8a695e00ec36bd4e5e4f18fabe0aca0efe0a4b44cdb13e"}, + {file = "cffi-1.17.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:6b8b4a92e1c65048ff98cfe1f735ef8f1ceb72e3d5f0c25fdb12087a23da22be"}, + {file = "cffi-1.17.1-cp310-cp310-win32.whl", hash = "sha256:c9c3d058ebabb74db66e431095118094d06abf53284d9c81f27300d0e0d8bc7c"}, + {file = "cffi-1.17.1-cp310-cp310-win_amd64.whl", hash = "sha256:0f048dcf80db46f0098ccac01132761580d28e28bc0f78ae0d58048063317e15"}, + {file = "cffi-1.17.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a45e3c6913c5b87b3ff120dcdc03f6131fa0065027d0ed7ee6190736a74cd401"}, + {file = "cffi-1.17.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:30c5e0cb5ae493c04c8b42916e52ca38079f1b235c2f8ae5f4527b963c401caf"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f75c7ab1f9e4aca5414ed4d8e5c0e303a34f4421f8a0d47a4d019ceff0ab6af4"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1ed2dd2972641495a3ec98445e09766f077aee98a1c896dcb4ad0d303628e41"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:46bf43160c1a35f7ec506d254e5c890f3c03648a4dbac12d624e4490a7046cd1"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a24ed04c8ffd54b0729c07cee15a81d964e6fee0e3d4d342a27b020d22959dc6"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:610faea79c43e44c71e1ec53a554553fa22321b65fae24889706c0a84d4ad86d"}, + {file = "cffi-1.17.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:a9b15d491f3ad5d692e11f6b71f7857e7835eb677955c00cc0aefcd0669adaf6"}, + {file = "cffi-1.17.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:de2ea4b5833625383e464549fec1bc395c1bdeeb5f25c4a3a82b5a8c756ec22f"}, + {file = "cffi-1.17.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:fc48c783f9c87e60831201f2cce7f3b2e4846bf4d8728eabe54d60700b318a0b"}, + {file = "cffi-1.17.1-cp311-cp311-win32.whl", hash = "sha256:85a950a4ac9c359340d5963966e3e0a94a676bd6245a4b55bc43949eee26a655"}, + {file = "cffi-1.17.1-cp311-cp311-win_amd64.whl", hash = "sha256:caaf0640ef5f5517f49bc275eca1406b0ffa6aa184892812030f04c2abf589a0"}, + {file = "cffi-1.17.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:805b4371bf7197c329fcb3ead37e710d1bca9da5d583f5073b799d5c5bd1eee4"}, + {file = "cffi-1.17.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:733e99bc2df47476e3848417c5a4540522f234dfd4ef3ab7fafdf555b082ec0c"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1257bdabf294dceb59f5e70c64a3e2f462c30c7ad68092d01bbbfb1c16b1ba36"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da95af8214998d77a98cc14e3a3bd00aa191526343078b530ceb0bd710fb48a5"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d63afe322132c194cf832bfec0dc69a99fb9bb6bbd550f161a49e9e855cc78ff"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f79fc4fc25f1c8698ff97788206bb3c2598949bfe0fef03d299eb1b5356ada99"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b62ce867176a75d03a665bad002af8e6d54644fad99a3c70905c543130e39d93"}, + {file = "cffi-1.17.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:386c8bf53c502fff58903061338ce4f4950cbdcb23e2902d86c0f722b786bbe3"}, + {file = "cffi-1.17.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:4ceb10419a9adf4460ea14cfd6bc43d08701f0835e979bf821052f1805850fe8"}, + {file = "cffi-1.17.1-cp312-cp312-win32.whl", hash = "sha256:a08d7e755f8ed21095a310a693525137cfe756ce62d066e53f502a83dc550f65"}, + {file = "cffi-1.17.1-cp312-cp312-win_amd64.whl", hash = "sha256:51392eae71afec0d0c8fb1a53b204dbb3bcabcb3c9b807eedf3e1e6ccf2de903"}, + {file = "cffi-1.17.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f3a2b4222ce6b60e2e8b337bb9596923045681d71e5a082783484d845390938e"}, + {file = "cffi-1.17.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0984a4925a435b1da406122d4d7968dd861c1385afe3b45ba82b750f229811e2"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d01b12eeeb4427d3110de311e1774046ad344f5b1a7403101878976ecd7a10f3"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:706510fe141c86a69c8ddc029c7910003a17353970cff3b904ff0686a5927683"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:de55b766c7aa2e2a3092c51e0483d700341182f08e67c63630d5b6f200bb28e5"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c59d6e989d07460165cc5ad3c61f9fd8f1b4796eacbd81cee78957842b834af4"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd398dbc6773384a17fe0d3e7eeb8d1a21c2200473ee6806bb5e6a8e62bb73dd"}, + {file = "cffi-1.17.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:3edc8d958eb099c634dace3c7e16560ae474aa3803a5df240542b305d14e14ed"}, + {file = "cffi-1.17.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:72e72408cad3d5419375fc87d289076ee319835bdfa2caad331e377589aebba9"}, + {file = "cffi-1.17.1-cp313-cp313-win32.whl", hash = "sha256:e03eab0a8677fa80d646b5ddece1cbeaf556c313dcfac435ba11f107ba117b5d"}, + {file = "cffi-1.17.1-cp313-cp313-win_amd64.whl", hash = "sha256:f6a16c31041f09ead72d69f583767292f750d24913dadacf5756b966aacb3f1a"}, + {file = "cffi-1.17.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:636062ea65bd0195bc012fea9321aca499c0504409f413dc88af450b57ffd03b"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c7eac2ef9b63c79431bc4b25f1cd649d7f061a28808cbc6c47b534bd789ef964"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e221cf152cff04059d011ee126477f0d9588303eb57e88923578ace7baad17f9"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:31000ec67d4221a71bd3f67df918b1f88f676f1c3b535a7eb473255fdc0b83fc"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6f17be4345073b0a7b8ea599688f692ac3ef23ce28e5df79c04de519dbc4912c"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e2b1fac190ae3ebfe37b979cc1ce69c81f4e4fe5746bb401dca63a9062cdaf1"}, + {file = "cffi-1.17.1-cp38-cp38-win32.whl", hash = "sha256:7596d6620d3fa590f677e9ee430df2958d2d6d6de2feeae5b20e82c00b76fbf8"}, + {file = "cffi-1.17.1-cp38-cp38-win_amd64.whl", hash = "sha256:78122be759c3f8a014ce010908ae03364d00a1f81ab5c7f4a7a5120607ea56e1"}, + {file = "cffi-1.17.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b2ab587605f4ba0bf81dc0cb08a41bd1c0a5906bd59243d56bad7668a6fc6c16"}, + {file = "cffi-1.17.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:28b16024becceed8c6dfbc75629e27788d8a3f9030691a1dbf9821a128b22c36"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1d599671f396c4723d016dbddb72fe8e0397082b0a77a4fab8028923bec050e8"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca74b8dbe6e8e8263c0ffd60277de77dcee6c837a3d0881d8c1ead7268c9e576"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f7f5baafcc48261359e14bcd6d9bff6d4b28d9103847c9e136694cb0501aef87"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:98e3969bcff97cae1b2def8ba499ea3d6f31ddfdb7635374834cf89a1a08ecf0"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cdf5ce3acdfd1661132f2a9c19cac174758dc2352bfe37d98aa7512c6b7178b3"}, + {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9755e4345d1ec879e3849e62222a18c7174d65a6a92d5b346b1863912168b595"}, + {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f1e22e8c4419538cb197e4dd60acc919d7696e5ef98ee4da4e01d3f8cfa4cc5a"}, + {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:c03e868a0b3bc35839ba98e74211ed2b05d2119be4e8a0f224fba9384f1fe02e"}, + {file = "cffi-1.17.1-cp39-cp39-win32.whl", hash = "sha256:e31ae45bc2e29f6b2abd0de1cc3b9d5205aa847cafaecb8af1476a609a2f6eb7"}, + {file = "cffi-1.17.1-cp39-cp39-win_amd64.whl", hash = "sha256:d016c76bdd850f3c626af19b0542c9677ba156e4ee4fccfdd7848803533ef662"}, + {file = "cffi-1.17.1.tar.gz", hash = "sha256:1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824"}, ] [package.dependencies] @@ -463,38 +463,38 @@ toml = ["tomli"] [[package]] name = "cryptography" -version = "43.0.0" +version = "43.0.1" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." optional = false python-versions = ">=3.7" files = [ - {file = "cryptography-43.0.0-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:64c3f16e2a4fc51c0d06af28441881f98c5d91009b8caaff40cf3548089e9c74"}, - {file = "cryptography-43.0.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3dcdedae5c7710b9f97ac6bba7e1052b95c7083c9d0e9df96e02a1932e777895"}, - {file = "cryptography-43.0.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d9a1eca329405219b605fac09ecfc09ac09e595d6def650a437523fcd08dd22"}, - {file = "cryptography-43.0.0-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:ea9e57f8ea880eeea38ab5abf9fbe39f923544d7884228ec67d666abd60f5a47"}, - {file = "cryptography-43.0.0-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:9a8d6802e0825767476f62aafed40532bd435e8a5f7d23bd8b4f5fd04cc80ecf"}, - {file = "cryptography-43.0.0-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:cc70b4b581f28d0a254d006f26949245e3657d40d8857066c2ae22a61222ef55"}, - {file = "cryptography-43.0.0-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:4a997df8c1c2aae1e1e5ac49c2e4f610ad037fc5a3aadc7b64e39dea42249431"}, - {file = "cryptography-43.0.0-cp37-abi3-win32.whl", hash = "sha256:6e2b11c55d260d03a8cf29ac9b5e0608d35f08077d8c087be96287f43af3ccdc"}, - {file = "cryptography-43.0.0-cp37-abi3-win_amd64.whl", hash = "sha256:31e44a986ceccec3d0498e16f3d27b2ee5fdf69ce2ab89b52eaad1d2f33d8778"}, - {file = "cryptography-43.0.0-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:7b3f5fe74a5ca32d4d0f302ffe6680fcc5c28f8ef0dc0ae8f40c0f3a1b4fca66"}, - {file = "cryptography-43.0.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ac1955ce000cb29ab40def14fd1bbfa7af2017cca696ee696925615cafd0dce5"}, - {file = "cryptography-43.0.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:299d3da8e00b7e2b54bb02ef58d73cd5f55fb31f33ebbf33bd00d9aa6807df7e"}, - {file = "cryptography-43.0.0-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:ee0c405832ade84d4de74b9029bedb7b31200600fa524d218fc29bfa371e97f5"}, - {file = "cryptography-43.0.0-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:cb013933d4c127349b3948aa8aaf2f12c0353ad0eccd715ca789c8a0f671646f"}, - {file = "cryptography-43.0.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:fdcb265de28585de5b859ae13e3846a8e805268a823a12a4da2597f1f5afc9f0"}, - {file = "cryptography-43.0.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:2905ccf93a8a2a416f3ec01b1a7911c3fe4073ef35640e7ee5296754e30b762b"}, - {file = "cryptography-43.0.0-cp39-abi3-win32.whl", hash = "sha256:47ca71115e545954e6c1d207dd13461ab81f4eccfcb1345eac874828b5e3eaaf"}, - {file = "cryptography-43.0.0-cp39-abi3-win_amd64.whl", hash = "sha256:0663585d02f76929792470451a5ba64424acc3cd5227b03921dab0e2f27b1709"}, - {file = "cryptography-43.0.0-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:2c6d112bf61c5ef44042c253e4859b3cbbb50df2f78fa8fae6747a7814484a70"}, - {file = "cryptography-43.0.0-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:844b6d608374e7d08f4f6e6f9f7b951f9256db41421917dfb2d003dde4cd6b66"}, - {file = "cryptography-43.0.0-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:51956cf8730665e2bdf8ddb8da0056f699c1a5715648c1b0144670c1ba00b48f"}, - {file = "cryptography-43.0.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:aae4d918f6b180a8ab8bf6511a419473d107df4dbb4225c7b48c5c9602c38c7f"}, - {file = "cryptography-43.0.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:232ce02943a579095a339ac4b390fbbe97f5b5d5d107f8a08260ea2768be8cc2"}, - {file = "cryptography-43.0.0-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:5bcb8a5620008a8034d39bce21dc3e23735dfdb6a33a06974739bfa04f853947"}, - {file = "cryptography-43.0.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:08a24a7070b2b6804c1940ff0f910ff728932a9d0e80e7814234269f9d46d069"}, - {file = "cryptography-43.0.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:e9c5266c432a1e23738d178e51c2c7a5e2ddf790f248be939448c0ba2021f9d1"}, - {file = "cryptography-43.0.0.tar.gz", hash = "sha256:b88075ada2d51aa9f18283532c9f60e72170041bba88d7f37e49cbb10275299e"}, + {file = "cryptography-43.0.1-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:8385d98f6a3bf8bb2d65a73e17ed87a3ba84f6991c155691c51112075f9ffc5d"}, + {file = "cryptography-43.0.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:27e613d7077ac613e399270253259d9d53872aaf657471473ebfc9a52935c062"}, + {file = "cryptography-43.0.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:68aaecc4178e90719e95298515979814bda0cbada1256a4485414860bd7ab962"}, + {file = "cryptography-43.0.1-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:de41fd81a41e53267cb020bb3a7212861da53a7d39f863585d13ea11049cf277"}, + {file = "cryptography-43.0.1-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:f98bf604c82c416bc829e490c700ca1553eafdf2912a91e23a79d97d9801372a"}, + {file = "cryptography-43.0.1-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:61ec41068b7b74268fa86e3e9e12b9f0c21fcf65434571dbb13d954bceb08042"}, + {file = "cryptography-43.0.1-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:014f58110f53237ace6a408b5beb6c427b64e084eb451ef25a28308270086494"}, + {file = "cryptography-43.0.1-cp37-abi3-win32.whl", hash = "sha256:2bd51274dcd59f09dd952afb696bf9c61a7a49dfc764c04dd33ef7a6b502a1e2"}, + {file = "cryptography-43.0.1-cp37-abi3-win_amd64.whl", hash = "sha256:666ae11966643886c2987b3b721899d250855718d6d9ce41b521252a17985f4d"}, + {file = "cryptography-43.0.1-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:ac119bb76b9faa00f48128b7f5679e1d8d437365c5d26f1c2c3f0da4ce1b553d"}, + {file = "cryptography-43.0.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1bbcce1a551e262dfbafb6e6252f1ae36a248e615ca44ba302df077a846a8806"}, + {file = "cryptography-43.0.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:58d4e9129985185a06d849aa6df265bdd5a74ca6e1b736a77959b498e0505b85"}, + {file = "cryptography-43.0.1-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:d03a475165f3134f773d1388aeb19c2d25ba88b6a9733c5c590b9ff7bbfa2e0c"}, + {file = "cryptography-43.0.1-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:511f4273808ab590912a93ddb4e3914dfd8a388fed883361b02dea3791f292e1"}, + {file = "cryptography-43.0.1-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:80eda8b3e173f0f247f711eef62be51b599b5d425c429b5d4ca6a05e9e856baa"}, + {file = "cryptography-43.0.1-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:38926c50cff6f533f8a2dae3d7f19541432610d114a70808f0926d5aaa7121e4"}, + {file = "cryptography-43.0.1-cp39-abi3-win32.whl", hash = "sha256:a575913fb06e05e6b4b814d7f7468c2c660e8bb16d8d5a1faf9b33ccc569dd47"}, + {file = "cryptography-43.0.1-cp39-abi3-win_amd64.whl", hash = "sha256:d75601ad10b059ec832e78823b348bfa1a59f6b8d545db3a24fd44362a1564cb"}, + {file = "cryptography-43.0.1-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:ea25acb556320250756e53f9e20a4177515f012c9eaea17eb7587a8c4d8ae034"}, + {file = "cryptography-43.0.1-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:c1332724be35d23a854994ff0b66530119500b6053d0bd3363265f7e5e77288d"}, + {file = "cryptography-43.0.1-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:fba1007b3ef89946dbbb515aeeb41e30203b004f0b4b00e5e16078b518563289"}, + {file = "cryptography-43.0.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:5b43d1ea6b378b54a1dc99dd8a2b5be47658fe9a7ce0a58ff0b55f4b43ef2b84"}, + {file = "cryptography-43.0.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:88cce104c36870d70c49c7c8fd22885875d950d9ee6ab54df2745f83ba0dc365"}, + {file = "cryptography-43.0.1-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:9d3cdb25fa98afdd3d0892d132b8d7139e2c087da1712041f6b762e4f807cc96"}, + {file = "cryptography-43.0.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:e710bf40870f4db63c3d7d929aa9e09e4e7ee219e703f949ec4073b4294f6172"}, + {file = "cryptography-43.0.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7c05650fe8023c5ed0d46793d4b7d7e6cd9c04e68eabe5b0aeea836e37bdcec2"}, + {file = "cryptography-43.0.1.tar.gz", hash = "sha256:203e92a75716d8cfb491dc47c79e17d0d9207ccffcbcb35f598fbe463ae3444d"}, ] [package.dependencies] @@ -507,7 +507,7 @@ nox = ["nox"] pep8test = ["check-sdist", "click", "mypy", "ruff"] sdist = ["build"] ssh = ["bcrypt (>=3.1.5)"] -test = ["certifi", "cryptography-vectors (==43.0.0)", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] +test = ["certifi", "cryptography-vectors (==43.0.1)", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] test-randomorder = ["pytest-randomly"] [[package]] @@ -582,13 +582,13 @@ test = ["pytest (>=6)"] [[package]] name = "fastapi" -version = "0.112.2" +version = "0.114.0" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" optional = false python-versions = ">=3.8" files = [ - {file = "fastapi-0.112.2-py3-none-any.whl", hash = "sha256:db84b470bd0e2b1075942231e90e3577e12a903c4dc8696f0d206a7904a7af1c"}, - {file = "fastapi-0.112.2.tar.gz", hash = "sha256:3d4729c038414d5193840706907a41839d839523da6ed0c2811f1168cac1798c"}, + {file = "fastapi-0.114.0-py3-none-any.whl", hash = "sha256:fee75aa1b1d3d73f79851c432497e4394e413e1dece6234f68d3ce250d12760a"}, + {file = "fastapi-0.114.0.tar.gz", hash = "sha256:9908f2a5cc733004de6ca5e1412698f35085cefcbfd41d539245b9edf87b73c1"}, ] [package.dependencies] @@ -1098,13 +1098,13 @@ files = [ [[package]] name = "more-itertools" -version = "10.4.0" +version = "10.5.0" description = "More routines for operating on iterables, beyond itertools" optional = false python-versions = ">=3.8" files = [ - {file = "more-itertools-10.4.0.tar.gz", hash = "sha256:fe0e63c4ab068eac62410ab05cccca2dc71ec44ba8ef29916a0090df061cf923"}, - {file = "more_itertools-10.4.0-py3-none-any.whl", hash = "sha256:0f7d9f83a0a8dcfa8a2694a770590d98a67ea943e3d9f5298309a484758c4e27"}, + {file = "more-itertools-10.5.0.tar.gz", hash = "sha256:5482bfef7849c25dc3c6dd53a6173ae4795da2a41a80faea6700d9f5846c5da6"}, + {file = "more_itertools-10.5.0-py3-none-any.whl", hash = "sha256:037b0d3203ce90cca8ab1defbbdac29d5f993fc20131f3664dc8d6acfa872aef"}, ] [[package]] @@ -1236,63 +1236,64 @@ files = [ [[package]] name = "numpy" -version = "2.1.0" +version = "2.1.1" description = "Fundamental package for array computing in Python" optional = false python-versions = ">=3.10" files = [ - {file = "numpy-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6326ab99b52fafdcdeccf602d6286191a79fe2fda0ae90573c5814cd2b0bc1b8"}, - {file = "numpy-2.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:0937e54c09f7a9a68da6889362ddd2ff584c02d015ec92672c099b61555f8911"}, - {file = "numpy-2.1.0-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:30014b234f07b5fec20f4146f69e13cfb1e33ee9a18a1879a0142fbb00d47673"}, - {file = "numpy-2.1.0-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:899da829b362ade41e1e7eccad2cf274035e1cb36ba73034946fccd4afd8606b"}, - {file = "numpy-2.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:08801848a40aea24ce16c2ecde3b756f9ad756586fb2d13210939eb69b023f5b"}, - {file = "numpy-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:398049e237d1aae53d82a416dade04defed1a47f87d18d5bd615b6e7d7e41d1f"}, - {file = "numpy-2.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0abb3916a35d9090088a748636b2c06dc9a6542f99cd476979fb156a18192b84"}, - {file = "numpy-2.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:10e2350aea18d04832319aac0f887d5fcec1b36abd485d14f173e3e900b83e33"}, - {file = "numpy-2.1.0-cp310-cp310-win32.whl", hash = "sha256:f6b26e6c3b98adb648243670fddc8cab6ae17473f9dc58c51574af3e64d61211"}, - {file = "numpy-2.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:f505264735ee074250a9c78247ee8618292091d9d1fcc023290e9ac67e8f1afa"}, - {file = "numpy-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:76368c788ccb4f4782cf9c842b316140142b4cbf22ff8db82724e82fe1205dce"}, - {file = "numpy-2.1.0-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:f8e93a01a35be08d31ae33021e5268f157a2d60ebd643cfc15de6ab8e4722eb1"}, - {file = "numpy-2.1.0-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:9523f8b46485db6939bd069b28b642fec86c30909cea90ef550373787f79530e"}, - {file = "numpy-2.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54139e0eb219f52f60656d163cbe67c31ede51d13236c950145473504fa208cb"}, - {file = "numpy-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f5ebbf9fbdabed208d4ecd2e1dfd2c0741af2f876e7ae522c2537d404ca895c3"}, - {file = "numpy-2.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:378cb4f24c7d93066ee4103204f73ed046eb88f9ad5bb2275bb9fa0f6a02bd36"}, - {file = "numpy-2.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d8f699a709120b220dfe173f79c73cb2a2cab2c0b88dd59d7b49407d032b8ebd"}, - {file = "numpy-2.1.0-cp311-cp311-win32.whl", hash = "sha256:ffbd6faeb190aaf2b5e9024bac9622d2ee549b7ec89ef3a9373fa35313d44e0e"}, - {file = "numpy-2.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:0af3a5987f59d9c529c022c8c2a64805b339b7ef506509fba7d0556649b9714b"}, - {file = "numpy-2.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:fe76d75b345dc045acdbc006adcb197cc680754afd6c259de60d358d60c93736"}, - {file = "numpy-2.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f358ea9e47eb3c2d6eba121ab512dfff38a88db719c38d1e67349af210bc7529"}, - {file = "numpy-2.1.0-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:dd94ce596bda40a9618324547cfaaf6650b1a24f5390350142499aa4e34e53d1"}, - {file = "numpy-2.1.0-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:b47c551c6724960479cefd7353656498b86e7232429e3a41ab83be4da1b109e8"}, - {file = "numpy-2.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0756a179afa766ad7cb6f036de622e8a8f16ffdd55aa31f296c870b5679d745"}, - {file = "numpy-2.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:24003ba8ff22ea29a8c306e61d316ac74111cebf942afbf692df65509a05f111"}, - {file = "numpy-2.1.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:b34fa5e3b5d6dc7e0a4243fa0f81367027cb6f4a7215a17852979634b5544ee0"}, - {file = "numpy-2.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:c4f982715e65036c34897eb598d64aef15150c447be2cfc6643ec7a11af06574"}, - {file = "numpy-2.1.0-cp312-cp312-win32.whl", hash = "sha256:c4cd94dfefbefec3f8b544f61286584292d740e6e9d4677769bc76b8f41deb02"}, - {file = "numpy-2.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0cdef204199278f5c461a0bed6ed2e052998276e6d8ab2963d5b5c39a0500bc"}, - {file = "numpy-2.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8ab81ccd753859ab89e67199b9da62c543850f819993761c1e94a75a814ed667"}, - {file = "numpy-2.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:442596f01913656d579309edcd179a2a2f9977d9a14ff41d042475280fc7f34e"}, - {file = "numpy-2.1.0-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:848c6b5cad9898e4b9ef251b6f934fa34630371f2e916261070a4eb9092ffd33"}, - {file = "numpy-2.1.0-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:54c6a63e9d81efe64bfb7bcb0ec64332a87d0b87575f6009c8ba67ea6374770b"}, - {file = "numpy-2.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:652e92fc409e278abdd61e9505649e3938f6d04ce7ef1953f2ec598a50e7c195"}, - {file = "numpy-2.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ab32eb9170bf8ffcbb14f11613f4a0b108d3ffee0832457c5d4808233ba8977"}, - {file = "numpy-2.1.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:8fb49a0ba4d8f41198ae2d52118b050fd34dace4b8f3fb0ee34e23eb4ae775b1"}, - {file = "numpy-2.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:44e44973262dc3ae79e9063a1284a73e09d01b894b534a769732ccd46c28cc62"}, - {file = "numpy-2.1.0-cp313-cp313-win32.whl", hash = "sha256:ab83adc099ec62e044b1fbb3a05499fa1e99f6d53a1dde102b2d85eff66ed324"}, - {file = "numpy-2.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:de844aaa4815b78f6023832590d77da0e3b6805c644c33ce94a1e449f16d6ab5"}, - {file = "numpy-2.1.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:343e3e152bf5a087511cd325e3b7ecfd5b92d369e80e74c12cd87826e263ec06"}, - {file = "numpy-2.1.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:f07fa2f15dabe91259828ce7d71b5ca9e2eb7c8c26baa822c825ce43552f4883"}, - {file = "numpy-2.1.0-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:5474dad8c86ee9ba9bb776f4b99ef2d41b3b8f4e0d199d4f7304728ed34d0300"}, - {file = "numpy-2.1.0-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:1f817c71683fd1bb5cff1529a1d085a57f02ccd2ebc5cd2c566f9a01118e3b7d"}, - {file = "numpy-2.1.0-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3a3336fbfa0d38d3deacd3fe7f3d07e13597f29c13abf4d15c3b6dc2291cbbdd"}, - {file = "numpy-2.1.0-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7a894c51fd8c4e834f00ac742abad73fc485df1062f1b875661a3c1e1fb1c2f6"}, - {file = "numpy-2.1.0-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:9156ca1f79fc4acc226696e95bfcc2b486f165a6a59ebe22b2c1f82ab190384a"}, - {file = "numpy-2.1.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:624884b572dff8ca8f60fab591413f077471de64e376b17d291b19f56504b2bb"}, - {file = "numpy-2.1.0-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:15ef8b2177eeb7e37dd5ef4016f30b7659c57c2c0b57a779f1d537ff33a72c7b"}, - {file = "numpy-2.1.0-pp310-pypy310_pp73-macosx_14_0_x86_64.whl", hash = "sha256:e5f0642cdf4636198a4990de7a71b693d824c56a757862230454629cf62e323d"}, - {file = "numpy-2.1.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f15976718c004466406342789f31b6673776360f3b1e3c575f25302d7e789575"}, - {file = "numpy-2.1.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:6c1de77ded79fef664d5098a66810d4d27ca0224e9051906e634b3f7ead134c2"}, - {file = "numpy-2.1.0.tar.gz", hash = "sha256:7dc90da0081f7e1da49ec4e398ede6a8e9cc4f5ebe5f9e06b443ed889ee9aaa2"}, + {file = "numpy-2.1.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c8a0e34993b510fc19b9a2ce7f31cb8e94ecf6e924a40c0c9dd4f62d0aac47d9"}, + {file = "numpy-2.1.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:7dd86dfaf7c900c0bbdcb8b16e2f6ddf1eb1fe39c6c8cca6e94844ed3152a8fd"}, + {file = "numpy-2.1.1-cp310-cp310-macosx_14_0_arm64.whl", hash = "sha256:5889dd24f03ca5a5b1e8a90a33b5a0846d8977565e4ae003a63d22ecddf6782f"}, + {file = "numpy-2.1.1-cp310-cp310-macosx_14_0_x86_64.whl", hash = "sha256:59ca673ad11d4b84ceb385290ed0ebe60266e356641428c845b39cd9df6713ab"}, + {file = "numpy-2.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:13ce49a34c44b6de5241f0b38b07e44c1b2dcacd9e36c30f9c2fcb1bb5135db7"}, + {file = "numpy-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:913cc1d311060b1d409e609947fa1b9753701dac96e6581b58afc36b7ee35af6"}, + {file = "numpy-2.1.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:caf5d284ddea7462c32b8d4a6b8af030b6c9fd5332afb70e7414d7fdded4bfd0"}, + {file = "numpy-2.1.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:57eb525e7c2a8fdee02d731f647146ff54ea8c973364f3b850069ffb42799647"}, + {file = "numpy-2.1.1-cp310-cp310-win32.whl", hash = "sha256:9a8e06c7a980869ea67bbf551283bbed2856915f0a792dc32dd0f9dd2fb56728"}, + {file = "numpy-2.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:d10c39947a2d351d6d466b4ae83dad4c37cd6c3cdd6d5d0fa797da56f710a6ae"}, + {file = "numpy-2.1.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0d07841fd284718feffe7dd17a63a2e6c78679b2d386d3e82f44f0108c905550"}, + {file = "numpy-2.1.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b5613cfeb1adfe791e8e681128f5f49f22f3fcaa942255a6124d58ca59d9528f"}, + {file = "numpy-2.1.1-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:0b8cc2715a84b7c3b161f9ebbd942740aaed913584cae9cdc7f8ad5ad41943d0"}, + {file = "numpy-2.1.1-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:b49742cdb85f1f81e4dc1b39dcf328244f4d8d1ded95dea725b316bd2cf18c95"}, + {file = "numpy-2.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8d5f8a8e3bc87334f025194c6193e408903d21ebaeb10952264943a985066ca"}, + {file = "numpy-2.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d51fc141ddbe3f919e91a096ec739f49d686df8af254b2053ba21a910ae518bf"}, + {file = "numpy-2.1.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:98ce7fb5b8063cfdd86596b9c762bf2b5e35a2cdd7e967494ab78a1fa7f8b86e"}, + {file = "numpy-2.1.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:24c2ad697bd8593887b019817ddd9974a7f429c14a5469d7fad413f28340a6d2"}, + {file = "numpy-2.1.1-cp311-cp311-win32.whl", hash = "sha256:397bc5ce62d3fb73f304bec332171535c187e0643e176a6e9421a6e3eacef06d"}, + {file = "numpy-2.1.1-cp311-cp311-win_amd64.whl", hash = "sha256:ae8ce252404cdd4de56dcfce8b11eac3c594a9c16c231d081fb705cf23bd4d9e"}, + {file = "numpy-2.1.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:7c803b7934a7f59563db459292e6aa078bb38b7ab1446ca38dd138646a38203e"}, + {file = "numpy-2.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6435c48250c12f001920f0751fe50c0348f5f240852cfddc5e2f97e007544cbe"}, + {file = "numpy-2.1.1-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:3269c9eb8745e8d975980b3a7411a98976824e1fdef11f0aacf76147f662b15f"}, + {file = "numpy-2.1.1-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:fac6e277a41163d27dfab5f4ec1f7a83fac94e170665a4a50191b545721c6521"}, + {file = "numpy-2.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fcd8f556cdc8cfe35e70efb92463082b7f43dd7e547eb071ffc36abc0ca4699b"}, + {file = "numpy-2.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b9cd92c8f8e7b313b80e93cedc12c0112088541dcedd9197b5dee3738c1201"}, + {file = "numpy-2.1.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:afd9c680df4de71cd58582b51e88a61feed4abcc7530bcd3d48483f20fc76f2a"}, + {file = "numpy-2.1.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8661c94e3aad18e1ea17a11f60f843a4933ccaf1a25a7c6a9182af70610b2313"}, + {file = "numpy-2.1.1-cp312-cp312-win32.whl", hash = "sha256:950802d17a33c07cba7fd7c3dcfa7d64705509206be1606f196d179e539111ed"}, + {file = "numpy-2.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:3fc5eabfc720db95d68e6646e88f8b399bfedd235994016351b1d9e062c4b270"}, + {file = "numpy-2.1.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:046356b19d7ad1890c751b99acad5e82dc4a02232013bd9a9a712fddf8eb60f5"}, + {file = "numpy-2.1.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:6e5a9cb2be39350ae6c8f79410744e80154df658d5bea06e06e0ac5bb75480d5"}, + {file = "numpy-2.1.1-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:d4c57b68c8ef5e1ebf47238e99bf27657511ec3f071c465f6b1bccbef12d4136"}, + {file = "numpy-2.1.1-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:8ae0fd135e0b157365ac7cc31fff27f07a5572bdfc38f9c2d43b2aff416cc8b0"}, + {file = "numpy-2.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:981707f6b31b59c0c24bcda52e5605f9701cb46da4b86c2e8023656ad3e833cb"}, + {file = "numpy-2.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2ca4b53e1e0b279142113b8c5eb7d7a877e967c306edc34f3b58e9be12fda8df"}, + {file = "numpy-2.1.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:e097507396c0be4e547ff15b13dc3866f45f3680f789c1a1301b07dadd3fbc78"}, + {file = "numpy-2.1.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f7506387e191fe8cdb267f912469a3cccc538ab108471291636a96a54e599556"}, + {file = "numpy-2.1.1-cp313-cp313-win32.whl", hash = "sha256:251105b7c42abe40e3a689881e1793370cc9724ad50d64b30b358bbb3a97553b"}, + {file = "numpy-2.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:f212d4f46b67ff604d11fff7cc62d36b3e8714edf68e44e9760e19be38c03eb0"}, + {file = "numpy-2.1.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:920b0911bb2e4414c50e55bd658baeb78281a47feeb064ab40c2b66ecba85553"}, + {file = "numpy-2.1.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:bab7c09454460a487e631ffc0c42057e3d8f2a9ddccd1e60c7bb8ed774992480"}, + {file = "numpy-2.1.1-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:cea427d1350f3fd0d2818ce7350095c1a2ee33e30961d2f0fef48576ddbbe90f"}, + {file = "numpy-2.1.1-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:e30356d530528a42eeba51420ae8bf6c6c09559051887196599d96ee5f536468"}, + {file = "numpy-2.1.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8dfa9e94fc127c40979c3eacbae1e61fda4fe71d84869cc129e2721973231ef"}, + {file = "numpy-2.1.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:910b47a6d0635ec1bd53b88f86120a52bf56dcc27b51f18c7b4a2e2224c29f0f"}, + {file = "numpy-2.1.1-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:13cc11c00000848702322af4de0147ced365c81d66053a67c2e962a485b3717c"}, + {file = "numpy-2.1.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:53e27293b3a2b661c03f79aa51c3987492bd4641ef933e366e0f9f6c9bf257ec"}, + {file = "numpy-2.1.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:7be6a07520b88214ea85d8ac8b7d6d8a1839b0b5cb87412ac9f49fa934eb15d5"}, + {file = "numpy-2.1.1-pp310-pypy310_pp73-macosx_14_0_x86_64.whl", hash = "sha256:52ac2e48f5ad847cd43c4755520a2317f3380213493b9d8a4c5e37f3b87df504"}, + {file = "numpy-2.1.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:50a95ca3560a6058d6ea91d4629a83a897ee27c00630aed9d933dff191f170cd"}, + {file = "numpy-2.1.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:99f4a9ee60eed1385a86e82288971a51e71df052ed0b2900ed30bc840c0f2e39"}, + {file = "numpy-2.1.1.tar.gz", hash = "sha256:d0cf7d55b1051387807405b3898efafa862997b4cba8aa5dbe657be794afeafd"}, ] [[package]] @@ -1694,122 +1695,123 @@ files = [ [[package]] name = "pydantic" -version = "2.8.2" +version = "2.9.0" description = "Data validation using Python type hints" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic-2.8.2-py3-none-any.whl", hash = "sha256:73ee9fddd406dc318b885c7a2eab8a6472b68b8fb5ba8150949fc3db939f23c8"}, - {file = "pydantic-2.8.2.tar.gz", hash = "sha256:6f62c13d067b0755ad1c21a34bdd06c0c12625a22b0fc09c6b149816604f7c2a"}, + {file = "pydantic-2.9.0-py3-none-any.whl", hash = "sha256:f66a7073abd93214a20c5f7b32d56843137a7a2e70d02111f3be287035c45370"}, + {file = "pydantic-2.9.0.tar.gz", hash = "sha256:c7a8a9fdf7d100afa49647eae340e2d23efa382466a8d177efcd1381e9be5598"}, ] [package.dependencies] annotated-types = ">=0.4.0" -pydantic-core = "2.20.1" +pydantic-core = "2.23.2" typing-extensions = [ {version = ">=4.6.1", markers = "python_version < \"3.13\""}, {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, ] +tzdata = {version = "*", markers = "python_version >= \"3.9\""} [package.extras] email = ["email-validator (>=2.0.0)"] [[package]] name = "pydantic-core" -version = "2.20.1" +version = "2.23.2" description = "Core functionality for Pydantic validation and serialization" optional = false python-versions = ">=3.8" files = [ - {file = "pydantic_core-2.20.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:3acae97ffd19bf091c72df4d726d552c473f3576409b2a7ca36b2f535ffff4a3"}, - {file = "pydantic_core-2.20.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:41f4c96227a67a013e7de5ff8f20fb496ce573893b7f4f2707d065907bffdbd6"}, - {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5f239eb799a2081495ea659d8d4a43a8f42cd1fe9ff2e7e436295c38a10c286a"}, - {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:53e431da3fc53360db73eedf6f7124d1076e1b4ee4276b36fb25514544ceb4a3"}, - {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f1f62b2413c3a0e846c3b838b2ecd6c7a19ec6793b2a522745b0869e37ab5bc1"}, - {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5d41e6daee2813ecceea8eda38062d69e280b39df793f5a942fa515b8ed67953"}, - {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d482efec8b7dc6bfaedc0f166b2ce349df0011f5d2f1f25537ced4cfc34fd98"}, - {file = "pydantic_core-2.20.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e93e1a4b4b33daed65d781a57a522ff153dcf748dee70b40c7258c5861e1768a"}, - {file = "pydantic_core-2.20.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e7c4ea22b6739b162c9ecaaa41d718dfad48a244909fe7ef4b54c0b530effc5a"}, - {file = "pydantic_core-2.20.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:4f2790949cf385d985a31984907fecb3896999329103df4e4983a4a41e13e840"}, - {file = "pydantic_core-2.20.1-cp310-none-win32.whl", hash = "sha256:5e999ba8dd90e93d57410c5e67ebb67ffcaadcea0ad973240fdfd3a135506250"}, - {file = "pydantic_core-2.20.1-cp310-none-win_amd64.whl", hash = "sha256:512ecfbefef6dac7bc5eaaf46177b2de58cdf7acac8793fe033b24ece0b9566c"}, - {file = "pydantic_core-2.20.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:d2a8fa9d6d6f891f3deec72f5cc668e6f66b188ab14bb1ab52422fe8e644f312"}, - {file = "pydantic_core-2.20.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:175873691124f3d0da55aeea1d90660a6ea7a3cfea137c38afa0a5ffabe37b88"}, - {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:37eee5b638f0e0dcd18d21f59b679686bbd18917b87db0193ae36f9c23c355fc"}, - {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:25e9185e2d06c16ee438ed39bf62935ec436474a6ac4f9358524220f1b236e43"}, - {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:150906b40ff188a3260cbee25380e7494ee85048584998c1e66df0c7a11c17a6"}, - {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8ad4aeb3e9a97286573c03df758fc7627aecdd02f1da04516a86dc159bf70121"}, - {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d3f3ed29cd9f978c604708511a1f9c2fdcb6c38b9aae36a51905b8811ee5cbf1"}, - {file = "pydantic_core-2.20.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b0dae11d8f5ded51699c74d9548dcc5938e0804cc8298ec0aa0da95c21fff57b"}, - {file = "pydantic_core-2.20.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:faa6b09ee09433b87992fb5a2859efd1c264ddc37280d2dd5db502126d0e7f27"}, - {file = "pydantic_core-2.20.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9dc1b507c12eb0481d071f3c1808f0529ad41dc415d0ca11f7ebfc666e66a18b"}, - {file = "pydantic_core-2.20.1-cp311-none-win32.whl", hash = "sha256:fa2fddcb7107e0d1808086ca306dcade7df60a13a6c347a7acf1ec139aa6789a"}, - {file = "pydantic_core-2.20.1-cp311-none-win_amd64.whl", hash = "sha256:40a783fb7ee353c50bd3853e626f15677ea527ae556429453685ae32280c19c2"}, - {file = "pydantic_core-2.20.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:595ba5be69b35777474fa07f80fc260ea71255656191adb22a8c53aba4479231"}, - {file = "pydantic_core-2.20.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a4f55095ad087474999ee28d3398bae183a66be4823f753cd7d67dd0153427c9"}, - {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f9aa05d09ecf4c75157197f27cdc9cfaeb7c5f15021c6373932bf3e124af029f"}, - {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e97fdf088d4b31ff4ba35db26d9cc472ac7ef4a2ff2badeabf8d727b3377fc52"}, - {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bc633a9fe1eb87e250b5c57d389cf28998e4292336926b0b6cdaee353f89a237"}, - {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d573faf8eb7e6b1cbbcb4f5b247c60ca8be39fe2c674495df0eb4318303137fe"}, - {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:26dc97754b57d2fd00ac2b24dfa341abffc380b823211994c4efac7f13b9e90e"}, - {file = "pydantic_core-2.20.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:33499e85e739a4b60c9dac710c20a08dc73cb3240c9a0e22325e671b27b70d24"}, - {file = "pydantic_core-2.20.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:bebb4d6715c814597f85297c332297c6ce81e29436125ca59d1159b07f423eb1"}, - {file = "pydantic_core-2.20.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:516d9227919612425c8ef1c9b869bbbee249bc91912c8aaffb66116c0b447ebd"}, - {file = "pydantic_core-2.20.1-cp312-none-win32.whl", hash = "sha256:469f29f9093c9d834432034d33f5fe45699e664f12a13bf38c04967ce233d688"}, - {file = "pydantic_core-2.20.1-cp312-none-win_amd64.whl", hash = "sha256:035ede2e16da7281041f0e626459bcae33ed998cca6a0a007a5ebb73414ac72d"}, - {file = "pydantic_core-2.20.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:0827505a5c87e8aa285dc31e9ec7f4a17c81a813d45f70b1d9164e03a813a686"}, - {file = "pydantic_core-2.20.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:19c0fa39fa154e7e0b7f82f88ef85faa2a4c23cc65aae2f5aea625e3c13c735a"}, - {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4aa223cd1e36b642092c326d694d8bf59b71ddddc94cdb752bbbb1c5c91d833b"}, - {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c336a6d235522a62fef872c6295a42ecb0c4e1d0f1a3e500fe949415761b8a19"}, - {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7eb6a0587eded33aeefea9f916899d42b1799b7b14b8f8ff2753c0ac1741edac"}, - {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:70c8daf4faca8da5a6d655f9af86faf6ec2e1768f4b8b9d0226c02f3d6209703"}, - {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e9fa4c9bf273ca41f940bceb86922a7667cd5bf90e95dbb157cbb8441008482c"}, - {file = "pydantic_core-2.20.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:11b71d67b4725e7e2a9f6e9c0ac1239bbc0c48cce3dc59f98635efc57d6dac83"}, - {file = "pydantic_core-2.20.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:270755f15174fb983890c49881e93f8f1b80f0b5e3a3cc1394a255706cabd203"}, - {file = "pydantic_core-2.20.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:c81131869240e3e568916ef4c307f8b99583efaa60a8112ef27a366eefba8ef0"}, - {file = "pydantic_core-2.20.1-cp313-none-win32.whl", hash = "sha256:b91ced227c41aa29c672814f50dbb05ec93536abf8f43cd14ec9521ea09afe4e"}, - {file = "pydantic_core-2.20.1-cp313-none-win_amd64.whl", hash = "sha256:65db0f2eefcaad1a3950f498aabb4875c8890438bc80b19362cf633b87a8ab20"}, - {file = "pydantic_core-2.20.1-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:4745f4ac52cc6686390c40eaa01d48b18997cb130833154801a442323cc78f91"}, - {file = "pydantic_core-2.20.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a8ad4c766d3f33ba8fd692f9aa297c9058970530a32c728a2c4bfd2616d3358b"}, - {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41e81317dd6a0127cabce83c0c9c3fbecceae981c8391e6f1dec88a77c8a569a"}, - {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:04024d270cf63f586ad41fff13fde4311c4fc13ea74676962c876d9577bcc78f"}, - {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:eaad4ff2de1c3823fddf82f41121bdf453d922e9a238642b1dedb33c4e4f98ad"}, - {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:26ab812fa0c845df815e506be30337e2df27e88399b985d0bb4e3ecfe72df31c"}, - {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c5ebac750d9d5f2706654c638c041635c385596caf68f81342011ddfa1e5598"}, - {file = "pydantic_core-2.20.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2aafc5a503855ea5885559eae883978c9b6d8c8993d67766ee73d82e841300dd"}, - {file = "pydantic_core-2.20.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:4868f6bd7c9d98904b748a2653031fc9c2f85b6237009d475b1008bfaeb0a5aa"}, - {file = "pydantic_core-2.20.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:aa2f457b4af386254372dfa78a2eda2563680d982422641a85f271c859df1987"}, - {file = "pydantic_core-2.20.1-cp38-none-win32.whl", hash = "sha256:225b67a1f6d602de0ce7f6c1c3ae89a4aa25d3de9be857999e9124f15dab486a"}, - {file = "pydantic_core-2.20.1-cp38-none-win_amd64.whl", hash = "sha256:6b507132dcfc0dea440cce23ee2182c0ce7aba7054576efc65634f080dbe9434"}, - {file = "pydantic_core-2.20.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:b03f7941783b4c4a26051846dea594628b38f6940a2fdc0df00b221aed39314c"}, - {file = "pydantic_core-2.20.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1eedfeb6089ed3fad42e81a67755846ad4dcc14d73698c120a82e4ccf0f1f9f6"}, - {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:635fee4e041ab9c479e31edda27fcf966ea9614fff1317e280d99eb3e5ab6fe2"}, - {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:77bf3ac639c1ff567ae3b47f8d4cc3dc20f9966a2a6dd2311dcc055d3d04fb8a"}, - {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7ed1b0132f24beeec5a78b67d9388656d03e6a7c837394f99257e2d55b461611"}, - {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c6514f963b023aeee506678a1cf821fe31159b925c4b76fe2afa94cc70b3222b"}, - {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10d4204d8ca33146e761c79f83cc861df20e7ae9f6487ca290a97702daf56006"}, - {file = "pydantic_core-2.20.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2d036c7187b9422ae5b262badb87a20a49eb6c5238b2004e96d4da1231badef1"}, - {file = "pydantic_core-2.20.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9ebfef07dbe1d93efb94b4700f2d278494e9162565a54f124c404a5656d7ff09"}, - {file = "pydantic_core-2.20.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:6b9d9bb600328a1ce523ab4f454859e9d439150abb0906c5a1983c146580ebab"}, - {file = "pydantic_core-2.20.1-cp39-none-win32.whl", hash = "sha256:784c1214cb6dd1e3b15dd8b91b9a53852aed16671cc3fbe4786f4f1db07089e2"}, - {file = "pydantic_core-2.20.1-cp39-none-win_amd64.whl", hash = "sha256:d2fe69c5434391727efa54b47a1e7986bb0186e72a41b203df8f5b0a19a4f669"}, - {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:a45f84b09ac9c3d35dfcf6a27fd0634d30d183205230a0ebe8373a0e8cfa0906"}, - {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:d02a72df14dfdbaf228424573a07af10637bd490f0901cee872c4f434a735b94"}, - {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d2b27e6af28f07e2f195552b37d7d66b150adbaa39a6d327766ffd695799780f"}, - {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:084659fac3c83fd674596612aeff6041a18402f1e1bc19ca39e417d554468482"}, - {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:242b8feb3c493ab78be289c034a1f659e8826e2233786e36f2893a950a719bb6"}, - {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:38cf1c40a921d05c5edc61a785c0ddb4bed67827069f535d794ce6bcded919fc"}, - {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:e0bbdd76ce9aa5d4209d65f2b27fc6e5ef1312ae6c5333c26db3f5ade53a1e99"}, - {file = "pydantic_core-2.20.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:254ec27fdb5b1ee60684f91683be95e5133c994cc54e86a0b0963afa25c8f8a6"}, - {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:407653af5617f0757261ae249d3fba09504d7a71ab36ac057c938572d1bc9331"}, - {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:c693e916709c2465b02ca0ad7b387c4f8423d1db7b4649c551f27a529181c5ad"}, - {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5b5ff4911aea936a47d9376fd3ab17e970cc543d1b68921886e7f64bd28308d1"}, - {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:177f55a886d74f1808763976ac4efd29b7ed15c69f4d838bbd74d9d09cf6fa86"}, - {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:964faa8a861d2664f0c7ab0c181af0bea66098b1919439815ca8803ef136fc4e"}, - {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:4dd484681c15e6b9a977c785a345d3e378d72678fd5f1f3c0509608da24f2ac0"}, - {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f6d6cff3538391e8486a431569b77921adfcdef14eb18fbf19b7c0a5294d4e6a"}, - {file = "pydantic_core-2.20.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:a6d511cc297ff0883bc3708b465ff82d7560193169a8b93260f74ecb0a5e08a7"}, - {file = "pydantic_core-2.20.1.tar.gz", hash = "sha256:26ca695eeee5f9f1aeeb211ffc12f10bcb6f71e2989988fda61dabd65db878d4"}, + {file = "pydantic_core-2.23.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:7d0324a35ab436c9d768753cbc3c47a865a2cbc0757066cb864747baa61f6ece"}, + {file = "pydantic_core-2.23.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:276ae78153a94b664e700ac362587c73b84399bd1145e135287513442e7dfbc7"}, + {file = "pydantic_core-2.23.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:964c7aa318da542cdcc60d4a648377ffe1a2ef0eb1e996026c7f74507b720a78"}, + {file = "pydantic_core-2.23.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1cf842265a3a820ebc6388b963ead065f5ce8f2068ac4e1c713ef77a67b71f7c"}, + {file = "pydantic_core-2.23.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae90b9e50fe1bd115b24785e962b51130340408156d34d67b5f8f3fa6540938e"}, + {file = "pydantic_core-2.23.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8ae65fdfb8a841556b52935dfd4c3f79132dc5253b12c0061b96415208f4d622"}, + {file = "pydantic_core-2.23.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5c8aa40f6ca803f95b1c1c5aeaee6237b9e879e4dfb46ad713229a63651a95fb"}, + {file = "pydantic_core-2.23.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c53100c8ee5a1e102766abde2158077d8c374bee0639201f11d3032e3555dfbc"}, + {file = "pydantic_core-2.23.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:d6b9dd6aa03c812017411734e496c44fef29b43dba1e3dd1fa7361bbacfc1354"}, + {file = "pydantic_core-2.23.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b18cf68255a476b927910c6873d9ed00da692bb293c5b10b282bd48a0afe3ae2"}, + {file = "pydantic_core-2.23.2-cp310-none-win32.whl", hash = "sha256:e460475719721d59cd54a350c1f71c797c763212c836bf48585478c5514d2854"}, + {file = "pydantic_core-2.23.2-cp310-none-win_amd64.whl", hash = "sha256:5f3cf3721eaf8741cffaf092487f1ca80831202ce91672776b02b875580e174a"}, + {file = "pydantic_core-2.23.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:7ce8e26b86a91e305858e018afc7a6e932f17428b1eaa60154bd1f7ee888b5f8"}, + {file = "pydantic_core-2.23.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7e9b24cca4037a561422bf5dc52b38d390fb61f7bfff64053ce1b72f6938e6b2"}, + {file = "pydantic_core-2.23.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:753294d42fb072aa1775bfe1a2ba1012427376718fa4c72de52005a3d2a22178"}, + {file = "pydantic_core-2.23.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:257d6a410a0d8aeb50b4283dea39bb79b14303e0fab0f2b9d617701331ed1515"}, + {file = "pydantic_core-2.23.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c8319e0bd6a7b45ad76166cc3d5d6a36c97d0c82a196f478c3ee5346566eebfd"}, + {file = "pydantic_core-2.23.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7a05c0240f6c711eb381ac392de987ee974fa9336071fb697768dfdb151345ce"}, + {file = "pydantic_core-2.23.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d5b0ff3218858859910295df6953d7bafac3a48d5cd18f4e3ed9999efd2245f"}, + {file = "pydantic_core-2.23.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:96ef39add33ff58cd4c112cbac076726b96b98bb8f1e7f7595288dcfb2f10b57"}, + {file = "pydantic_core-2.23.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0102e49ac7d2df3379ef8d658d3bc59d3d769b0bdb17da189b75efa861fc07b4"}, + {file = "pydantic_core-2.23.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:a6612c2a844043e4d10a8324c54cdff0042c558eef30bd705770793d70b224aa"}, + {file = "pydantic_core-2.23.2-cp311-none-win32.whl", hash = "sha256:caffda619099cfd4f63d48462f6aadbecee3ad9603b4b88b60cb821c1b258576"}, + {file = "pydantic_core-2.23.2-cp311-none-win_amd64.whl", hash = "sha256:6f80fba4af0cb1d2344869d56430e304a51396b70d46b91a55ed4959993c0589"}, + {file = "pydantic_core-2.23.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:4c83c64d05ffbbe12d4e8498ab72bdb05bcc1026340a4a597dc647a13c1605ec"}, + {file = "pydantic_core-2.23.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6294907eaaccf71c076abdd1c7954e272efa39bb043161b4b8aa1cd76a16ce43"}, + {file = "pydantic_core-2.23.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4a801c5e1e13272e0909c520708122496647d1279d252c9e6e07dac216accc41"}, + {file = "pydantic_core-2.23.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cc0c316fba3ce72ac3ab7902a888b9dc4979162d320823679da270c2d9ad0cad"}, + {file = "pydantic_core-2.23.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6b06c5d4e8701ac2ba99a2ef835e4e1b187d41095a9c619c5b185c9068ed2a49"}, + {file = "pydantic_core-2.23.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:82764c0bd697159fe9947ad59b6db6d7329e88505c8f98990eb07e84cc0a5d81"}, + {file = "pydantic_core-2.23.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2b1a195efd347ede8bcf723e932300292eb13a9d2a3c1f84eb8f37cbbc905b7f"}, + {file = "pydantic_core-2.23.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b7efb12e5071ad8d5b547487bdad489fbd4a5a35a0fc36a1941517a6ad7f23e0"}, + {file = "pydantic_core-2.23.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:5dd0ec5f514ed40e49bf961d49cf1bc2c72e9b50f29a163b2cc9030c6742aa73"}, + {file = "pydantic_core-2.23.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:820f6ee5c06bc868335e3b6e42d7ef41f50dfb3ea32fbd523ab679d10d8741c0"}, + {file = "pydantic_core-2.23.2-cp312-none-win32.whl", hash = "sha256:3713dc093d5048bfaedbba7a8dbc53e74c44a140d45ede020dc347dda18daf3f"}, + {file = "pydantic_core-2.23.2-cp312-none-win_amd64.whl", hash = "sha256:e1895e949f8849bc2757c0dbac28422a04be031204df46a56ab34bcf98507342"}, + {file = "pydantic_core-2.23.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:da43cbe593e3c87d07108d0ebd73771dc414488f1f91ed2e204b0370b94b37ac"}, + {file = "pydantic_core-2.23.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:64d094ea1aa97c6ded4748d40886076a931a8bf6f61b6e43e4a1041769c39dd2"}, + {file = "pydantic_core-2.23.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:084414ffe9a85a52940b49631321d636dadf3576c30259607b75516d131fecd0"}, + {file = "pydantic_core-2.23.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:043ef8469f72609c4c3a5e06a07a1f713d53df4d53112c6d49207c0bd3c3bd9b"}, + {file = "pydantic_core-2.23.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3649bd3ae6a8ebea7dc381afb7f3c6db237fc7cebd05c8ac36ca8a4187b03b30"}, + {file = "pydantic_core-2.23.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6db09153d8438425e98cdc9a289c5fade04a5d2128faff8f227c459da21b9703"}, + {file = "pydantic_core-2.23.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5668b3173bb0b2e65020b60d83f5910a7224027232c9f5dc05a71a1deac9f960"}, + {file = "pydantic_core-2.23.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1c7b81beaf7c7ebde978377dc53679c6cba0e946426fc7ade54251dfe24a7604"}, + {file = "pydantic_core-2.23.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:ae579143826c6f05a361d9546446c432a165ecf1c0b720bbfd81152645cb897d"}, + {file = "pydantic_core-2.23.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:19f1352fe4b248cae22a89268720fc74e83f008057a652894f08fa931e77dced"}, + {file = "pydantic_core-2.23.2-cp313-none-win32.whl", hash = "sha256:e1a79ad49f346aa1a2921f31e8dbbab4d64484823e813a002679eaa46cba39e1"}, + {file = "pydantic_core-2.23.2-cp313-none-win_amd64.whl", hash = "sha256:582871902e1902b3c8e9b2c347f32a792a07094110c1bca6c2ea89b90150caac"}, + {file = "pydantic_core-2.23.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:743e5811b0c377eb830150d675b0847a74a44d4ad5ab8845923d5b3a756d8100"}, + {file = "pydantic_core-2.23.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:6650a7bbe17a2717167e3e23c186849bae5cef35d38949549f1c116031b2b3aa"}, + {file = "pydantic_core-2.23.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:56e6a12ec8d7679f41b3750ffa426d22b44ef97be226a9bab00a03365f217b2b"}, + {file = "pydantic_core-2.23.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:810ca06cca91de9107718dc83d9ac4d2e86efd6c02cba49a190abcaf33fb0472"}, + {file = "pydantic_core-2.23.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:785e7f517ebb9890813d31cb5d328fa5eda825bb205065cde760b3150e4de1f7"}, + {file = "pydantic_core-2.23.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3ef71ec876fcc4d3bbf2ae81961959e8d62f8d74a83d116668409c224012e3af"}, + {file = "pydantic_core-2.23.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d50ac34835c6a4a0d456b5db559b82047403c4317b3bc73b3455fefdbdc54b0a"}, + {file = "pydantic_core-2.23.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:16b25a4a120a2bb7dab51b81e3d9f3cde4f9a4456566c403ed29ac81bf49744f"}, + {file = "pydantic_core-2.23.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:41ae8537ad371ec018e3c5da0eb3f3e40ee1011eb9be1da7f965357c4623c501"}, + {file = "pydantic_core-2.23.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07049ec9306ec64e955b2e7c40c8d77dd78ea89adb97a2013d0b6e055c5ee4c5"}, + {file = "pydantic_core-2.23.2-cp38-none-win32.whl", hash = "sha256:086c5db95157dc84c63ff9d96ebb8856f47ce113c86b61065a066f8efbe80acf"}, + {file = "pydantic_core-2.23.2-cp38-none-win_amd64.whl", hash = "sha256:67b6655311b00581914aba481729971b88bb8bc7996206590700a3ac85e457b8"}, + {file = "pydantic_core-2.23.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:358331e21a897151e54d58e08d0219acf98ebb14c567267a87e971f3d2a3be59"}, + {file = "pydantic_core-2.23.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c4d9f15ffe68bcd3898b0ad7233af01b15c57d91cd1667f8d868e0eacbfe3f87"}, + {file = "pydantic_core-2.23.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0123655fedacf035ab10c23450163c2f65a4174f2bb034b188240a6cf06bb123"}, + {file = "pydantic_core-2.23.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e6e3ccebdbd6e53474b0bb7ab8b88e83c0cfe91484b25e058e581348ee5a01a5"}, + {file = "pydantic_core-2.23.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fc535cb898ef88333cf317777ecdfe0faac1c2a3187ef7eb061b6f7ecf7e6bae"}, + {file = "pydantic_core-2.23.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:aab9e522efff3993a9e98ab14263d4e20211e62da088298089a03056980a3e69"}, + {file = "pydantic_core-2.23.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:05b366fb8fe3d8683b11ac35fa08947d7b92be78ec64e3277d03bd7f9b7cda79"}, + {file = "pydantic_core-2.23.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7568f682c06f10f30ef643a1e8eec4afeecdafde5c4af1b574c6df079e96f96c"}, + {file = "pydantic_core-2.23.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:cdd02a08205dc90238669f082747612cb3c82bd2c717adc60f9b9ecadb540f80"}, + {file = "pydantic_core-2.23.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:1a2ab4f410f4b886de53b6bddf5dd6f337915a29dd9f22f20f3099659536b2f6"}, + {file = "pydantic_core-2.23.2-cp39-none-win32.whl", hash = "sha256:0448b81c3dfcde439551bb04a9f41d7627f676b12701865c8a2574bcea034437"}, + {file = "pydantic_core-2.23.2-cp39-none-win_amd64.whl", hash = "sha256:4cebb9794f67266d65e7e4cbe5dcf063e29fc7b81c79dc9475bd476d9534150e"}, + {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:e758d271ed0286d146cf7c04c539a5169a888dd0b57026be621547e756af55bc"}, + {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:f477d26183e94eaafc60b983ab25af2a809a1b48ce4debb57b343f671b7a90b6"}, + {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da3131ef2b940b99106f29dfbc30d9505643f766704e14c5d5e504e6a480c35e"}, + {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:329a721253c7e4cbd7aad4a377745fbcc0607f9d72a3cc2102dd40519be75ed2"}, + {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7706e15cdbf42f8fab1e6425247dfa98f4a6f8c63746c995d6a2017f78e619ae"}, + {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:e64ffaf8f6e17ca15eb48344d86a7a741454526f3a3fa56bc493ad9d7ec63936"}, + {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:dd59638025160056687d598b054b64a79183f8065eae0d3f5ca523cde9943940"}, + {file = "pydantic_core-2.23.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:12625e69b1199e94b0ae1c9a95d000484ce9f0182f9965a26572f054b1537e44"}, + {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5d813fd871b3d5c3005157622ee102e8908ad6011ec915a18bd8fde673c4360e"}, + {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:1eb37f7d6a8001c0f86dc8ff2ee8d08291a536d76e49e78cda8587bb54d8b329"}, + {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7ce7eaf9a98680b4312b7cebcdd9352531c43db00fca586115845df388f3c465"}, + {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f087879f1ffde024dd2788a30d55acd67959dcf6c431e9d3682d1c491a0eb474"}, + {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6ce883906810b4c3bd90e0ada1f9e808d9ecf1c5f0b60c6b8831d6100bcc7dd6"}, + {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:a8031074a397a5925d06b590121f8339d34a5a74cfe6970f8a1124eb8b83f4ac"}, + {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:23af245b8f2f4ee9e2c99cb3f93d0e22fb5c16df3f2f643f5a8da5caff12a653"}, + {file = "pydantic_core-2.23.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:c57e493a0faea1e4c38f860d6862ba6832723396c884fbf938ff5e9b224200e2"}, + {file = "pydantic_core-2.23.2.tar.gz", hash = "sha256:95d6bf449a1ac81de562d65d180af5d8c19672793c81877a2eda8fde5d08f2fd"}, ] [package.dependencies] @@ -2014,13 +2016,13 @@ dev = ["atomicwrites (==1.4.1)", "attrs (==23.2.0)", "coverage (==7.4.1)", "hatc [[package]] name = "python-socketio" -version = "5.11.3" +version = "5.11.4" description = "Socket.IO server and client for Python" optional = false python-versions = ">=3.8" files = [ - {file = "python_socketio-5.11.3-py3-none-any.whl", hash = "sha256:2a923a831ff70664b7c502df093c423eb6aa93c1ce68b8319e840227a26d8b69"}, - {file = "python_socketio-5.11.3.tar.gz", hash = "sha256:194af8cdbb7b0768c2e807ba76c7abc288eb5bb85559b7cddee51a6bc7a65737"}, + {file = "python_socketio-5.11.4-py3-none-any.whl", hash = "sha256:42efaa3e3e0b166fc72a527488a13caaac2cefc76174252486503bd496284945"}, + {file = "python_socketio-5.11.4.tar.gz", hash = "sha256:8b0b8ff2964b2957c865835e936310190639c00310a47d77321a594d1665355e"}, ] [package.dependencies] @@ -2155,13 +2157,13 @@ ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==20.0.1)", "requests (>=2.26.0)" [[package]] name = "reflex-chakra" -version = "0.6.0a1" +version = "0.6.0a5" description = "reflex using chakra components" optional = false python-versions = "<4.0,>=3.8" files = [ - {file = "reflex_chakra-0.6.0a1-py3-none-any.whl", hash = "sha256:68c22e00591530c38acedb20ee9c192109a3591f3e58fb3a51c9e939b13c66ad"}, - {file = "reflex_chakra-0.6.0a1.tar.gz", hash = "sha256:9061790bb59134cf2200461de45f582987cef29032f82864165a3c5badb86cf5"}, + {file = "reflex_chakra-0.6.0a5-py3-none-any.whl", hash = "sha256:9d502ddf3bd606baef4f0ff6453dcefb5e19dab4cfaf7c23df069fab70687a63"}, + {file = "reflex_chakra-0.6.0a5.tar.gz", hash = "sha256:b44e73478462052f09c9677d3fd7726891b4af87711b4b6a2171f010049308c9"}, ] [package.dependencies] @@ -2396,60 +2398,60 @@ files = [ [[package]] name = "sqlalchemy" -version = "2.0.32" +version = "2.0.34" description = "Database Abstraction Library" optional = false python-versions = ">=3.7" files = [ - {file = "SQLAlchemy-2.0.32-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0c9045ecc2e4db59bfc97b20516dfdf8e41d910ac6fb667ebd3a79ea54084619"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1467940318e4a860afd546ef61fefb98a14d935cd6817ed07a228c7f7c62f389"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5954463675cb15db8d4b521f3566a017c8789222b8316b1e6934c811018ee08b"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:167e7497035c303ae50651b351c28dc22a40bb98fbdb8468cdc971821b1ae533"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:b27dfb676ac02529fb6e343b3a482303f16e6bc3a4d868b73935b8792edb52d0"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:bf2360a5e0f7bd75fa80431bf8ebcfb920c9f885e7956c7efde89031695cafb8"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-win32.whl", hash = "sha256:306fe44e754a91cd9d600a6b070c1f2fadbb4a1a257b8781ccf33c7067fd3e4d"}, - {file = "SQLAlchemy-2.0.32-cp310-cp310-win_amd64.whl", hash = "sha256:99db65e6f3ab42e06c318f15c98f59a436f1c78179e6a6f40f529c8cc7100b22"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:21b053be28a8a414f2ddd401f1be8361e41032d2ef5884b2f31d31cb723e559f"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b178e875a7a25b5938b53b006598ee7645172fccafe1c291a706e93f48499ff5"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:723a40ee2cc7ea653645bd4cf024326dea2076673fc9d3d33f20f6c81db83e1d"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:295ff8689544f7ee7e819529633d058bd458c1fd7f7e3eebd0f9268ebc56c2a0"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:49496b68cd190a147118af585173ee624114dfb2e0297558c460ad7495f9dfe2"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:acd9b73c5c15f0ec5ce18128b1fe9157ddd0044abc373e6ecd5ba376a7e5d961"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-win32.whl", hash = "sha256:9365a3da32dabd3e69e06b972b1ffb0c89668994c7e8e75ce21d3e5e69ddef28"}, - {file = "SQLAlchemy-2.0.32-cp311-cp311-win_amd64.whl", hash = "sha256:8bd63d051f4f313b102a2af1cbc8b80f061bf78f3d5bd0843ff70b5859e27924"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:6bab3db192a0c35e3c9d1560eb8332463e29e5507dbd822e29a0a3c48c0a8d92"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:19d98f4f58b13900d8dec4ed09dd09ef292208ee44cc9c2fe01c1f0a2fe440e9"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3cd33c61513cb1b7371fd40cf221256456d26a56284e7d19d1f0b9f1eb7dd7e8"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7d6ba0497c1d066dd004e0f02a92426ca2df20fac08728d03f67f6960271feec"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2b6be53e4fde0065524f1a0a7929b10e9280987b320716c1509478b712a7688c"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:916a798f62f410c0b80b63683c8061f5ebe237b0f4ad778739304253353bc1cb"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-win32.whl", hash = "sha256:31983018b74908ebc6c996a16ad3690301a23befb643093fcfe85efd292e384d"}, - {file = "SQLAlchemy-2.0.32-cp312-cp312-win_amd64.whl", hash = "sha256:4363ed245a6231f2e2957cccdda3c776265a75851f4753c60f3004b90e69bfeb"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b8afd5b26570bf41c35c0121801479958b4446751a3971fb9a480c1afd85558e"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c750987fc876813f27b60d619b987b057eb4896b81117f73bb8d9918c14f1cad"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ada0102afff4890f651ed91120c1120065663506b760da4e7823913ebd3258be"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:78c03d0f8a5ab4f3034c0e8482cfcc415a3ec6193491cfa1c643ed707d476f16"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:3bd1cae7519283ff525e64645ebd7a3e0283f3c038f461ecc1c7b040a0c932a1"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-win32.whl", hash = "sha256:01438ebcdc566d58c93af0171c74ec28efe6a29184b773e378a385e6215389da"}, - {file = "SQLAlchemy-2.0.32-cp37-cp37m-win_amd64.whl", hash = "sha256:4979dc80fbbc9d2ef569e71e0896990bc94df2b9fdbd878290bd129b65ab579c"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6c742be912f57586ac43af38b3848f7688863a403dfb220193a882ea60e1ec3a"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:62e23d0ac103bcf1c5555b6c88c114089587bc64d048fef5bbdb58dfd26f96da"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:251f0d1108aab8ea7b9aadbd07fb47fb8e3a5838dde34aa95a3349876b5a1f1d"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ef18a84e5116340e38eca3e7f9eeaaef62738891422e7c2a0b80feab165905f"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:3eb6a97a1d39976f360b10ff208c73afb6a4de86dd2a6212ddf65c4a6a2347d5"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:0c1c9b673d21477cec17ab10bc4decb1322843ba35b481585facd88203754fc5"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-win32.whl", hash = "sha256:c41a2b9ca80ee555decc605bd3c4520cc6fef9abde8fd66b1cf65126a6922d65"}, - {file = "SQLAlchemy-2.0.32-cp38-cp38-win_amd64.whl", hash = "sha256:8a37e4d265033c897892279e8adf505c8b6b4075f2b40d77afb31f7185cd6ecd"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:52fec964fba2ef46476312a03ec8c425956b05c20220a1a03703537824b5e8e1"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:328429aecaba2aee3d71e11f2477c14eec5990fb6d0e884107935f7fb6001632"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85a01b5599e790e76ac3fe3aa2f26e1feba56270023d6afd5550ed63c68552b3"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aaf04784797dcdf4c0aa952c8d234fa01974c4729db55c45732520ce12dd95b4"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:4488120becf9b71b3ac718f4138269a6be99a42fe023ec457896ba4f80749525"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:14e09e083a5796d513918a66f3d6aedbc131e39e80875afe81d98a03312889e6"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-win32.whl", hash = "sha256:0d322cc9c9b2154ba7e82f7bf25ecc7c36fbe2d82e2933b3642fc095a52cfc78"}, - {file = "SQLAlchemy-2.0.32-cp39-cp39-win_amd64.whl", hash = "sha256:7dd8583df2f98dea28b5cd53a1beac963f4f9d087888d75f22fcc93a07cf8d84"}, - {file = "SQLAlchemy-2.0.32-py3-none-any.whl", hash = "sha256:e567a8793a692451f706b363ccf3c45e056b67d90ead58c3bc9471af5d212202"}, - {file = "SQLAlchemy-2.0.32.tar.gz", hash = "sha256:c1b88cc8b02b6a5f0efb0345a03672d4c897dc7d92585176f88c67346f565ea8"}, + {file = "SQLAlchemy-2.0.34-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:95d0b2cf8791ab5fb9e3aa3d9a79a0d5d51f55b6357eecf532a120ba3b5524db"}, + {file = "SQLAlchemy-2.0.34-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:243f92596f4fd4c8bd30ab8e8dd5965afe226363d75cab2468f2c707f64cd83b"}, + {file = "SQLAlchemy-2.0.34-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9ea54f7300553af0a2a7235e9b85f4204e1fc21848f917a3213b0e0818de9a24"}, + {file = "SQLAlchemy-2.0.34-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:173f5f122d2e1bff8fbd9f7811b7942bead1f5e9f371cdf9e670b327e6703ebd"}, + {file = "SQLAlchemy-2.0.34-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:196958cde924a00488e3e83ff917be3b73cd4ed8352bbc0f2989333176d1c54d"}, + {file = "SQLAlchemy-2.0.34-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:bd90c221ed4e60ac9d476db967f436cfcecbd4ef744537c0f2d5291439848768"}, + {file = "SQLAlchemy-2.0.34-cp310-cp310-win32.whl", hash = "sha256:3166dfff2d16fe9be3241ee60ece6fcb01cf8e74dd7c5e0b64f8e19fab44911b"}, + {file = "SQLAlchemy-2.0.34-cp310-cp310-win_amd64.whl", hash = "sha256:6831a78bbd3c40f909b3e5233f87341f12d0b34a58f14115c9e94b4cdaf726d3"}, + {file = "SQLAlchemy-2.0.34-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c7db3db284a0edaebe87f8f6642c2b2c27ed85c3e70064b84d1c9e4ec06d5d84"}, + {file = "SQLAlchemy-2.0.34-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:430093fce0efc7941d911d34f75a70084f12f6ca5c15d19595c18753edb7c33b"}, + {file = "SQLAlchemy-2.0.34-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79cb400c360c7c210097b147c16a9e4c14688a6402445ac848f296ade6283bbc"}, + {file = "SQLAlchemy-2.0.34-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb1b30f31a36c7f3fee848391ff77eebdd3af5750bf95fbf9b8b5323edfdb4ec"}, + {file = "SQLAlchemy-2.0.34-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8fddde2368e777ea2a4891a3fb4341e910a056be0bb15303bf1b92f073b80c02"}, + {file = "SQLAlchemy-2.0.34-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:80bd73ea335203b125cf1d8e50fef06be709619eb6ab9e7b891ea34b5baa2287"}, + {file = "SQLAlchemy-2.0.34-cp311-cp311-win32.whl", hash = "sha256:6daeb8382d0df526372abd9cb795c992e18eed25ef2c43afe518c73f8cccb721"}, + {file = "SQLAlchemy-2.0.34-cp311-cp311-win_amd64.whl", hash = "sha256:5bc08e75ed11693ecb648b7a0a4ed80da6d10845e44be0c98c03f2f880b68ff4"}, + {file = "SQLAlchemy-2.0.34-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:53e68b091492c8ed2bd0141e00ad3089bcc6bf0e6ec4142ad6505b4afe64163e"}, + {file = "SQLAlchemy-2.0.34-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bcd18441a49499bf5528deaa9dee1f5c01ca491fc2791b13604e8f972877f812"}, + {file = "SQLAlchemy-2.0.34-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:165bbe0b376541092bf49542bd9827b048357f4623486096fc9aaa6d4e7c59a2"}, + {file = "SQLAlchemy-2.0.34-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c3330415cd387d2b88600e8e26b510d0370db9b7eaf984354a43e19c40df2e2b"}, + {file = "SQLAlchemy-2.0.34-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:97b850f73f8abbffb66ccbab6e55a195a0eb655e5dc74624d15cff4bfb35bd74"}, + {file = "SQLAlchemy-2.0.34-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:7cee4c6917857fd6121ed84f56d1dc78eb1d0e87f845ab5a568aba73e78adf83"}, + {file = "SQLAlchemy-2.0.34-cp312-cp312-win32.whl", hash = "sha256:fbb034f565ecbe6c530dff948239377ba859420d146d5f62f0271407ffb8c580"}, + {file = "SQLAlchemy-2.0.34-cp312-cp312-win_amd64.whl", hash = "sha256:707c8f44931a4facd4149b52b75b80544a8d824162602b8cd2fe788207307f9a"}, + {file = "SQLAlchemy-2.0.34-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:24af3dc43568f3780b7e1e57c49b41d98b2d940c1fd2e62d65d3928b6f95f021"}, + {file = "SQLAlchemy-2.0.34-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e60ed6ef0a35c6b76b7640fe452d0e47acc832ccbb8475de549a5cc5f90c2c06"}, + {file = "SQLAlchemy-2.0.34-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:413c85cd0177c23e32dee6898c67a5f49296640041d98fddb2c40888fe4daa2e"}, + {file = "SQLAlchemy-2.0.34-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:25691f4adfb9d5e796fd48bf1432272f95f4bbe5f89c475a788f31232ea6afba"}, + {file = "SQLAlchemy-2.0.34-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:526ce723265643dbc4c7efb54f56648cc30e7abe20f387d763364b3ce7506c82"}, + {file = "SQLAlchemy-2.0.34-cp37-cp37m-win32.whl", hash = "sha256:13be2cc683b76977a700948411a94c67ad8faf542fa7da2a4b167f2244781cf3"}, + {file = "SQLAlchemy-2.0.34-cp37-cp37m-win_amd64.whl", hash = "sha256:e54ef33ea80d464c3dcfe881eb00ad5921b60f8115ea1a30d781653edc2fd6a2"}, + {file = "SQLAlchemy-2.0.34-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:43f28005141165edd11fbbf1541c920bd29e167b8bbc1fb410d4fe2269c1667a"}, + {file = "SQLAlchemy-2.0.34-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b68094b165a9e930aedef90725a8fcfafe9ef95370cbb54abc0464062dbf808f"}, + {file = "SQLAlchemy-2.0.34-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6a1e03db964e9d32f112bae36f0cc1dcd1988d096cfd75d6a588a3c3def9ab2b"}, + {file = "SQLAlchemy-2.0.34-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:203d46bddeaa7982f9c3cc693e5bc93db476ab5de9d4b4640d5c99ff219bee8c"}, + {file = "SQLAlchemy-2.0.34-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:ae92bebca3b1e6bd203494e5ef919a60fb6dfe4d9a47ed2453211d3bd451b9f5"}, + {file = "SQLAlchemy-2.0.34-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:9661268415f450c95f72f0ac1217cc6f10256f860eed85c2ae32e75b60278ad8"}, + {file = "SQLAlchemy-2.0.34-cp38-cp38-win32.whl", hash = "sha256:895184dfef8708e15f7516bd930bda7e50ead069280d2ce09ba11781b630a434"}, + {file = "SQLAlchemy-2.0.34-cp38-cp38-win_amd64.whl", hash = "sha256:6e7cde3a2221aa89247944cafb1b26616380e30c63e37ed19ff0bba5e968688d"}, + {file = "SQLAlchemy-2.0.34-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:dbcdf987f3aceef9763b6d7b1fd3e4ee210ddd26cac421d78b3c206d07b2700b"}, + {file = "SQLAlchemy-2.0.34-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ce119fc4ce0d64124d37f66a6f2a584fddc3c5001755f8a49f1ca0a177ef9796"}, + {file = "SQLAlchemy-2.0.34-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a17d8fac6df9835d8e2b4c5523666e7051d0897a93756518a1fe101c7f47f2f0"}, + {file = "SQLAlchemy-2.0.34-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9ebc11c54c6ecdd07bb4efbfa1554538982f5432dfb8456958b6d46b9f834bb7"}, + {file = "SQLAlchemy-2.0.34-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:2e6965346fc1491a566e019a4a1d3dfc081ce7ac1a736536367ca305da6472a8"}, + {file = "SQLAlchemy-2.0.34-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:220574e78ad986aea8e81ac68821e47ea9202b7e44f251b7ed8c66d9ae3f4278"}, + {file = "SQLAlchemy-2.0.34-cp39-cp39-win32.whl", hash = "sha256:b75b00083e7fe6621ce13cfce9d4469c4774e55e8e9d38c305b37f13cf1e874c"}, + {file = "SQLAlchemy-2.0.34-cp39-cp39-win_amd64.whl", hash = "sha256:c29d03e0adf3cc1a8c3ec62d176824972ae29b67a66cbb18daff3062acc6faa8"}, + {file = "SQLAlchemy-2.0.34-py3-none-any.whl", hash = "sha256:7286c353ee6475613d8beff83167374006c6b3e3f0e6491bfe8ca610eb1dec0f"}, + {file = "sqlalchemy-2.0.34.tar.gz", hash = "sha256:10d8f36990dd929690666679b0f42235c159a7051534adb135728ee52828dd22"}, ] [package.dependencies] @@ -2483,13 +2485,13 @@ sqlcipher = ["sqlcipher3_binary"] [[package]] name = "sqlmodel" -version = "0.0.21" +version = "0.0.22" description = "SQLModel, SQL databases in Python, designed for simplicity, compatibility, and robustness." optional = false python-versions = ">=3.7" files = [ - {file = "sqlmodel-0.0.21-py3-none-any.whl", hash = "sha256:eca104afe8a643f0764076b29f02e51d19d6b35c458f4c119942960362a4b52a"}, - {file = "sqlmodel-0.0.21.tar.gz", hash = "sha256:b2034c23d930f66d2091b17a4280a9c23a7ea540a71e7fcf9c746d262f06f74a"}, + {file = "sqlmodel-0.0.22-py3-none-any.whl", hash = "sha256:a1ed13e28a1f4057cbf4ff6cdb4fc09e85702621d3259ba17b3c230bfb2f941b"}, + {file = "sqlmodel-0.0.22.tar.gz", hash = "sha256:7d37c882a30c43464d143e35e9ecaf945d88035e20117bf5ec2834a23cbe505e"}, ] [package.dependencies] @@ -2498,13 +2500,13 @@ SQLAlchemy = ">=2.0.14,<2.1.0" [[package]] name = "starlette" -version = "0.38.2" +version = "0.38.4" description = "The little ASGI library that shines." optional = false python-versions = ">=3.8" files = [ - {file = "starlette-0.38.2-py3-none-any.whl", hash = "sha256:4ec6a59df6bbafdab5f567754481657f7ed90dc9d69b0c9ff017907dd54faeff"}, - {file = "starlette-0.38.2.tar.gz", hash = "sha256:c7c0441065252160993a1a37cf2a73bb64d271b17303e0b0c1eb7191cfb12d75"}, + {file = "starlette-0.38.4-py3-none-any.whl", hash = "sha256:526f53a77f0e43b85f583438aee1a940fd84f8fd610353e8b0c1a77ad8a87e76"}, + {file = "starlette-0.38.4.tar.gz", hash = "sha256:53a7439060304a208fea17ed407e998f46da5e5d9b1addfea3040094512a6379"}, ] [package.dependencies] diff --git a/reflex/.templates/jinja/web/pages/utils.js.jinja2 b/reflex/.templates/jinja/web/pages/utils.js.jinja2 index 4e3546070e..e0311a79a7 100644 --- a/reflex/.templates/jinja/web/pages/utils.js.jinja2 +++ b/reflex/.templates/jinja/web/pages/utils.js.jinja2 @@ -85,10 +85,10 @@ {% macro render_match_tag(component) %} { (() => { - switch (JSON.stringify({{ component.cond._var_name_unwrapped }})) { + switch (JSON.stringify({{ component.cond._var_name }})) { {% for case in component.match_cases %} {% for condition in case[:-1] %} - case JSON.stringify({{ condition._var_name_unwrapped }}): + case JSON.stringify({{ condition._var_name }}): {% endfor %} return {{ case[-1] }}; break; diff --git a/reflex/.templates/jinja/web/utils/theme.js.jinja2 b/reflex/.templates/jinja/web/utils/theme.js.jinja2 index a647a35b3c..819abd2322 100644 --- a/reflex/.templates/jinja/web/utils/theme.js.jinja2 +++ b/reflex/.templates/jinja/web/utils/theme.js.jinja2 @@ -1 +1 @@ -export default {{ theme|json_dumps }} \ No newline at end of file +export default {{ theme }} \ No newline at end of file diff --git a/reflex/compiler/compiler.py b/reflex/compiler/compiler.py index 00d4acc221..55602d2b2d 100644 --- a/reflex/compiler/compiler.py +++ b/reflex/compiler/compiler.py @@ -17,13 +17,12 @@ StatefulComponent, ) from reflex.config import get_config -from reflex.ivars.base import LiteralVar +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.state import BaseState from reflex.style import SYSTEM_COLOR_MODE from reflex.utils.exec import is_prod_mode from reflex.utils.imports import ImportVar from reflex.utils.prerequisites import get_web_dir -from reflex.vars import Var def _compile_document_root(root: Component) -> str: @@ -58,7 +57,7 @@ def _compile_app(app_root: Component) -> str: ) -def _compile_theme(theme: dict) -> str: +def _compile_theme(theme: str) -> str: """Compile the theme. Args: @@ -321,7 +320,7 @@ def _compile_tailwind( def compile_document_root( head_components: list[Component], html_lang: Optional[str] = None, - html_custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + html_custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, ) -> tuple[str, str]: """Compile the document root. @@ -378,7 +377,7 @@ def compile_theme(style: ComponentStyle) -> tuple[str, str]: theme = utils.create_theme(style) # Compile the theme. - code = _compile_theme(theme) + code = _compile_theme(str(LiteralVar.create(theme))) return output_path, code diff --git a/reflex/compiler/utils.py b/reflex/compiler/utils.py index cbb402047d..942faa0587 100644 --- a/reflex/compiler/utils.py +++ b/reflex/compiler/utils.py @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Type, Union from urllib.parse import urlparse +from reflex.ivars.base import ImmutableVar from reflex.utils.prerequisites import get_web_dir try: @@ -32,7 +33,6 @@ from reflex.style import Style from reflex.utils import console, format, imports, path_ops from reflex.utils.imports import ImportVar, ParsedImportDict -from reflex.vars import Var # To re-export this function. merge_imports = imports.merge_imports @@ -286,7 +286,7 @@ def compile_custom_component( def create_document_root( head_components: list[Component] | None = None, html_lang: Optional[str] = None, - html_custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + html_custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, ) -> Component: """Create the document root. diff --git a/reflex/components/base/app_wrap.pyi b/reflex/components/base/app_wrap.pyi index 576f8cd69a..90fc646e84 100644 --- a/reflex/components/base/app_wrap.pyi +++ b/reflex/components/base/app_wrap.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.base.fragment import Fragment from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var class AppWrap(Fragment): @overload @@ -21,41 +21,51 @@ class AppWrap(Fragment): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AppWrap": diff --git a/reflex/components/base/bare.py b/reflex/components/base/bare.py index 2ed0cb5902..8fa053a5bd 100644 --- a/reflex/components/base/bare.py +++ b/reflex/components/base/bare.py @@ -28,8 +28,6 @@ def create(cls, contents: Any) -> Component: """ if isinstance(contents, ImmutableVar): return cls(contents=contents) - if isinstance(contents, Var): - contents = contents.to(str) else: contents = str(contents) if contents is not None else "" return cls(contents=contents) # type: ignore @@ -39,7 +37,7 @@ def _render(self) -> Tag: return Tagless(contents=f"{{{str(self.contents)}}}") return Tagless(contents=str(self.contents)) - def _get_vars(self, include_children: bool = False) -> Iterator[Var]: + def _get_vars(self, include_children: bool = False) -> Iterator[ImmutableVar]: """Walk all Vars used in this component. Args: diff --git a/reflex/components/base/body.pyi b/reflex/components/base/body.pyi index 57ff1b7b7a..b0b5146740 100644 --- a/reflex/components/base/body.pyi +++ b/reflex/components/base/body.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var class Body(Component): @overload @@ -21,41 +21,51 @@ class Body(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Body": diff --git a/reflex/components/base/document.pyi b/reflex/components/base/document.pyi index 77065d8450..db736e0b78 100644 --- a/reflex/components/base/document.pyi +++ b/reflex/components/base/document.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var class NextDocumentLib(Component): @overload @@ -21,41 +21,51 @@ class NextDocumentLib(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "NextDocumentLib": @@ -88,41 +98,51 @@ class Html(NextDocumentLib): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Html": @@ -154,41 +174,51 @@ class DocumentHead(NextDocumentLib): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DocumentHead": @@ -220,41 +250,51 @@ class Main(NextDocumentLib): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Main": @@ -286,41 +326,51 @@ class NextScript(NextDocumentLib): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "NextScript": diff --git a/reflex/components/base/error_boundary.py b/reflex/components/base/error_boundary.py index 058976498a..a532b682fe 100644 --- a/reflex/components/base/error_boundary.py +++ b/reflex/components/base/error_boundary.py @@ -39,7 +39,7 @@ def add_imports(self) -> dict[str, list[ImportVar]]: """ return Imports.EVENTS - def add_hooks(self) -> List[str | Var]: + def add_hooks(self) -> List[str | ImmutableVar]: """Add hooks for the component. Returns: diff --git a/reflex/components/base/error_boundary.pyi b/reflex/components/base/error_boundary.pyi index 4777b09e99..0fecd063ae 100644 --- a/reflex/components/base/error_boundary.pyi +++ b/reflex/components/base/error_boundary.pyi @@ -7,13 +7,14 @@ from typing import Any, Callable, Dict, List, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportVar from reflex.vars import Var class ErrorBoundary(Component): def add_imports(self) -> dict[str, list[ImportVar]]: ... - def add_hooks(self) -> List[str | Var]: ... + def add_hooks(self) -> List[str | ImmutableVar]: ... def add_custom_code(self) -> List[str]: ... @overload @classmethod @@ -26,42 +27,54 @@ class ErrorBoundary(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_error: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ErrorBoundary": diff --git a/reflex/components/base/fragment.pyi b/reflex/components/base/fragment.pyi index fae72cc9c6..08cc28ea81 100644 --- a/reflex/components/base/fragment.pyi +++ b/reflex/components/base/fragment.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var class Fragment(Component): @overload @@ -21,41 +21,51 @@ class Fragment(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Fragment": diff --git a/reflex/components/base/head.pyi b/reflex/components/base/head.pyi index 0414571378..eff4427b25 100644 --- a/reflex/components/base/head.pyi +++ b/reflex/components/base/head.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component, MemoizationLeaf from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var class NextHeadLib(Component): @overload @@ -21,41 +21,51 @@ class NextHeadLib(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "NextHeadLib": @@ -87,41 +97,51 @@ class Head(NextHeadLib, MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Head": diff --git a/reflex/components/base/link.pyi b/reflex/components/base/link.pyi index 80388a3272..0889a06b1d 100644 --- a/reflex/components/base/link.pyi +++ b/reflex/components/base/link.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -23,41 +24,51 @@ class RawLink(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RawLink": @@ -98,41 +109,51 @@ class ScriptTag(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ScriptTag": diff --git a/reflex/components/base/meta.pyi b/reflex/components/base/meta.pyi index 372d202f9d..185425ff1c 100644 --- a/reflex/components/base/meta.pyi +++ b/reflex/components/base/meta.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var class Title(Component): def render(self) -> dict: ... @@ -22,41 +22,51 @@ class Title(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Title": @@ -93,41 +103,51 @@ class Meta(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Meta": @@ -169,41 +189,51 @@ class Description(Meta): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Description": @@ -245,41 +275,51 @@ class Image(Meta): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Image": diff --git a/reflex/components/base/script.pyi b/reflex/components/base/script.pyi index 311485b660..6a1033f7d4 100644 --- a/reflex/components/base/script.pyi +++ b/reflex/components/base/script.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -28,44 +29,60 @@ class Script(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_error: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_load: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_load: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_ready: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_ready: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Script": diff --git a/reflex/components/component.py b/reflex/components/component.py index 6d4fdded1a..e838c86d1a 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -46,9 +46,15 @@ from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.style import Style, format_as_emotion from reflex.utils import format, imports, types -from reflex.utils.imports import ImportDict, ImportVar, ParsedImportDict, parse_imports +from reflex.utils.imports import ( + ImmutableParsedImportDict, + ImportDict, + ImportVar, + ParsedImportDict, + parse_imports, +) from reflex.utils.serializers import serializer -from reflex.vars import BaseVar, ImmutableVarData, Var, VarData +from reflex.vars import Var, VarData class BaseComponent(Base, ABC): @@ -171,7 +177,7 @@ class Component(BaseComponent, ABC): style: Style = Style() # A mapping from event triggers to event chains. - event_triggers: Dict[str, Union[EventChain, Var]] = {} + event_triggers: Dict[str, Union[EventChain, ImmutableVar]] = {} # The alias for the tag. alias: Optional[str] = None @@ -189,7 +195,7 @@ class Component(BaseComponent, ABC): class_name: Any = None # Special component props. - special_props: Set[Var] = set() + special_props: Set[ImmutableVar] = set() # Whether the component should take the focus once the page is loaded autofocus: bool = False @@ -207,7 +213,7 @@ class Component(BaseComponent, ABC): _rename_props: Dict[str, str] = {} # custom attribute - custom_attrs: Dict[str, Union[Var, str]] = {} + custom_attrs: Dict[str, Union[ImmutableVar, str]] = {} # When to memoize this component and its children. _memoization_mode: MemoizationMode = MemoizationMode() @@ -243,7 +249,7 @@ def add_imports(self) -> ImportDict | list[ImportDict]: """ return {} - def add_hooks(self) -> list[str | Var]: + def add_hooks(self) -> list[str | ImmutableVar]: """Add hooks inside the component function. Hooks are pieces of literal Javascript code that is inserted inside the @@ -398,7 +404,7 @@ def __init__(self, *args, **kwargs): passed_types = None try: # Try to create a var from the value. - if isinstance(value, Var): + if isinstance(value, ImmutableVar): kwargs[key] = value else: kwargs[key] = LiteralVar.create(value) @@ -441,7 +447,9 @@ def __init__(self, *args, **kwargs): not passed_types and not types._issubclass(passed_type, expected_type, value) ): - value_name = value._var_name if isinstance(value, Var) else value + value_name = ( + value._var_name if isinstance(value, ImmutableVar) else value + ) raise TypeError( f"Invalid var passed for prop {type(self).__name__}.{key}, expected type {expected_type}, got value {value_name} of type {passed_types or passed_type}." ) @@ -493,7 +501,7 @@ def _create_event_chain( value: Union[ Var, EventHandler, EventSpec, List[Union[EventHandler, EventSpec]], Callable ], - ) -> Union[EventChain, Var]: + ) -> Union[EventChain, ImmutableVar]: """Create an event chain from a variety of input types. Args: @@ -507,7 +515,7 @@ def _create_event_chain( ValueError: If the value is not a valid event chain. """ # If it's an event chain var, return it. - if isinstance(value, Var): + if isinstance(value, ImmutableVar): if value._var_type is not EventChain: raise ValueError( f"Invalid event chain: {repr(value)} of type {type(value)}" @@ -531,7 +539,7 @@ def _create_event_chain( elif isinstance(v, Callable): # Call the lambda to get the event chain. result = call_event_fn(v, args_spec) - if isinstance(result, Var): + if isinstance(result, ImmutableVar): raise ValueError( f"Invalid event chain: {v}. Cannot use a Var-returning " "lambda inside an EventChain list." @@ -543,7 +551,7 @@ def _create_event_chain( # If the input is a callable, create an event chain. elif isinstance(value, Callable): result = call_event_fn(value, args_spec) - if isinstance(result, Var): + if isinstance(result, ImmutableVar): # Recursively call this function if the lambda returned an EventChain Var. return self._create_event_chain(args_spec, result) events = result @@ -561,7 +569,7 @@ def _create_event_chain( event_actions.update(e.event_actions) # Return the event chain. - if isinstance(args_spec, Var): + if isinstance(args_spec, ImmutableVar): return EventChain( events=events, args_spec=None, @@ -874,7 +882,7 @@ def _get_style(self) -> dict: Returns: The dictionary of the component style as value and the style notation as key. """ - if isinstance(self.style, Var): + if isinstance(self.style, ImmutableVar): return {"css": self.style} emotion_style = format_as_emotion(self.style) return ( @@ -990,8 +998,8 @@ def validate_child(child): @staticmethod def _get_vars_from_event_triggers( - event_triggers: dict[str, EventChain | Var], - ) -> Iterator[tuple[str, list[Var]]]: + event_triggers: dict[str, EventChain | ImmutableVar], + ) -> Iterator[tuple[str, list[ImmutableVar]]]: """Get the Vars associated with each event trigger. Args: @@ -1001,7 +1009,7 @@ def _get_vars_from_event_triggers( tuple of (event_name, event_vars) """ for event_trigger, event in event_triggers.items(): - if isinstance(event, Var): + if isinstance(event, ImmutableVar): yield event_trigger, [event] elif isinstance(event, EventChain): event_args = [] @@ -1010,7 +1018,7 @@ def _get_vars_from_event_triggers( event_args.extend(args) yield event_trigger, event_args - def _get_vars(self, include_children: bool = False) -> list[Var]: + def _get_vars(self, include_children: bool = False) -> list[ImmutableVar]: """Walk all Vars used in this component. Args: @@ -1030,16 +1038,20 @@ def _get_vars(self, include_children: bool = False) -> list[Var]: # Get Vars associated with component props. for prop in self.get_props(): prop_var = getattr(self, prop) - if isinstance(prop_var, Var): + if isinstance(prop_var, ImmutableVar): vars.append(prop_var) # Style keeps track of its own VarData instance, so embed in a temp Var that is yielded. - if isinstance(self.style, dict) and self.style or isinstance(self.style, Var): + if ( + isinstance(self.style, dict) + and self.style + or isinstance(self.style, ImmutableVar) + ): vars.append( ImmutableVar( _var_name="style", _var_type=str, - _var_data=ImmutableVarData.merge(self.style._var_data), + _var_data=VarData.merge(self.style._var_data), ) ) @@ -1054,7 +1066,7 @@ def _get_vars(self, include_children: bool = False) -> list[Var]: self.autofocus, *self.custom_attrs.values(), ): - if isinstance(comp_prop, Var): + if isinstance(comp_prop, ImmutableVar): vars.append(comp_prop) elif isinstance(comp_prop, str): # Collapse VarData encoded in f-strings. @@ -1083,7 +1095,7 @@ def _event_trigger_values_use_state(self) -> bool: for event in trigger.events: if event.handler.state_full_name: return True - elif isinstance(trigger, Var) and trigger._var_state: + elif isinstance(trigger, ImmutableVar) and trigger._var_state: return True return False @@ -1275,7 +1287,7 @@ def _get_hooks_imports(self) -> ParsedImportDict: user_hooks = self._get_hooks() user_hooks_data = ( VarData.merge(user_hooks._get_all_var_data()) - if user_hooks is not None and isinstance(user_hooks, Var) + if user_hooks is not None and isinstance(user_hooks, ImmutableVar) else None ) if user_hooks_data is not None: @@ -1303,9 +1315,15 @@ def _get_imports(self) -> ParsedImportDict: # Collect imports from Vars used directly by this component. var_datas = [var._get_all_var_data() for var in self._get_vars()] - var_imports = [ - var_data.imports for var_data in var_datas if var_data is not None - ] + var_imports: List[ImmutableParsedImportDict] = list( + map( + lambda var_data: var_data.imports, + filter( + None, + var_datas, + ), + ) + ) added_import_dicts: list[ParsedImportDict] = [] for clz in self._iter_parent_classes_with_method("add_imports"): @@ -1352,9 +1370,9 @@ def _get_mount_lifecycle_hook(self) -> str | None: on_mount = self.event_triggers.get(EventTriggers.ON_MOUNT, None) on_unmount = self.event_triggers.get(EventTriggers.ON_UNMOUNT, None) if on_mount is not None: - on_mount = format.format_event_chain(on_mount) + on_mount = str(LiteralVar.create(on_mount)) + "()" if on_unmount is not None: - on_unmount = format.format_event_chain(on_unmount) + on_unmount = str(LiteralVar.create(on_unmount)) + "()" if on_mount is not None or on_unmount is not None: return f""" useEffect(() => {{ @@ -1435,7 +1453,7 @@ def _get_added_hooks(self) -> dict[str, ImportDict]: """ code = {} - def extract_var_hooks(hook: Var): + def extract_var_hooks(hook: ImmutableVar): _imports = {} var_data = VarData.merge(hook._get_all_var_data()) if var_data is not None: @@ -1452,7 +1470,7 @@ def extract_var_hooks(hook: Var): # the order of the hooks in the final output) for clz in reversed(tuple(self._iter_parent_classes_with_method("add_hooks"))): for hook in clz.add_hooks(self): - if isinstance(hook, Var): + if isinstance(hook, ImmutableVar): extract_var_hooks(hook) else: code[hook] = {} @@ -1513,7 +1531,7 @@ def get_ref(self) -> str | None: The ref name. """ # do not create a ref if the id is dynamic or unspecified - if self.id is None or isinstance(self.id, (BaseVar, ImmutableVar)): + if self.id is None or isinstance(self.id, ImmutableVar): return None return format.format_ref(self.id) @@ -1768,7 +1786,7 @@ def get_prop_vars(self) -> List[ImmutableVar]: for name, prop in self.props.items() ] - def _get_vars(self, include_children: bool = False) -> list[Var]: + def _get_vars(self, include_children: bool = False) -> list[ImmutableVar]: """Walk all Vars used in this component. Args: @@ -1779,7 +1797,7 @@ def _get_vars(self, include_children: bool = False) -> list[Var]: """ return ( super()._get_vars(include_children=include_children) - + [prop for prop in self.props.values() if isinstance(prop, Var)] + + [prop for prop in self.props.values() if isinstance(prop, ImmutableVar)] + self.get_component(self)._get_vars(include_children=include_children) ) @@ -1950,7 +1968,7 @@ def create(cls, component: Component) -> StatefulComponent | None: should_memoize = True break child = cls._child_var(child) - if isinstance(child, Var) and child._get_all_var_data(): + if isinstance(child, ImmutableVar) and child._get_all_var_data(): should_memoize = True break @@ -2106,7 +2124,7 @@ def _get_hook_deps(hook: str) -> list[str]: def _get_memoized_event_triggers( cls, component: Component, - ) -> dict[str, tuple[Var, str]]: + ) -> dict[str, tuple[ImmutableVar, str]]: """Memoize event handler functions with useCallback to avoid unnecessary re-renders. Args: @@ -2130,9 +2148,7 @@ def _get_memoized_event_triggers( # Get the actual EventSpec and render it. event = component.event_triggers[event_trigger] - rendered_chain = format.format_prop(event) - if isinstance(rendered_chain, str): - rendered_chain = rendered_chain.strip("{}") + rendered_chain = str(LiteralVar.create(event)) # Hash the rendered EventChain to get a deterministic function name. chain_hash = md5(str(rendered_chain).encode("utf-8")).hexdigest() @@ -2141,9 +2157,10 @@ def _get_memoized_event_triggers( # Calculate Var dependencies accessed by the handler for useCallback dep array. var_deps = ["addEvents", "Event"] for arg in event_args: - if arg._get_all_var_data() is None: + var_data = arg._get_all_var_data() + if var_data is None: continue - for hook in arg._get_all_var_data().hooks: + for hook in var_data.hooks: var_deps.extend(cls._get_hook_deps(hook)) memo_var_data = VarData.merge( *[var._get_all_var_data() for var in event_args], diff --git a/reflex/components/core/banner.py b/reflex/components/core/banner.py index 4c4f587eef..834d59a833 100644 --- a/reflex/components/core/banner.py +++ b/reflex/components/core/banner.py @@ -23,7 +23,7 @@ from reflex.ivars.number import BooleanVar from reflex.ivars.sequence import LiteralArrayVar from reflex.utils.imports import ImportVar -from reflex.vars import ImmutableVarData, Var, VarData +from reflex.vars import Var, VarData connect_error_var_data: VarData = VarData( # type: ignore imports=Imports.EVENTS, @@ -68,7 +68,7 @@ def create(cls) -> ImmutableVar: """ return ImmutableVar( _var_name="getBackendURL(env.EVENT).href", - _var_data=ImmutableVarData( + _var_data=VarData( imports={ "/env.json": [ImportVar(tag="env", is_default=True)], f"/{Dirs.STATE_PATH}": [ImportVar(tag="getBackendURL")], @@ -95,7 +95,7 @@ def default_connection_error() -> list[str | Var | Component]: class ConnectionToaster(Toaster): """A connection toaster component.""" - def add_hooks(self) -> list[str | Var]: + def add_hooks(self) -> list[str | ImmutableVar]: """Add the hooks for the connection toaster. Returns: diff --git a/reflex/components/core/banner.pyi b/reflex/components/core/banner.pyi index 6327afe0b3..0a4072c313 100644 --- a/reflex/components/core/banner.pyi +++ b/reflex/components/core/banner.pyi @@ -29,7 +29,7 @@ class WebsocketTargetURL(ImmutableVar): def default_connection_error() -> list[str | Var | Component]: ... class ConnectionToaster(Toaster): - def add_hooks(self) -> list[str | Var]: ... + def add_hooks(self) -> list[str | ImmutableVar]: ... @overload @classmethod def create( # type: ignore @@ -75,41 +75,51 @@ class ConnectionToaster(Toaster): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ConnectionToaster": @@ -155,41 +165,51 @@ class ConnectionBanner(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ConnectionBanner": @@ -214,41 +234,51 @@ class ConnectionModal(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ConnectionModal": @@ -274,41 +304,51 @@ class WifiOffPulse(Icon): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "WifiOffPulse": @@ -367,41 +407,51 @@ class ConnectionPulser(Div): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ConnectionPulser": diff --git a/reflex/components/core/client_side_routing.py b/reflex/components/core/client_side_routing.py index 618467f390..33e54f2277 100644 --- a/reflex/components/core/client_side_routing.py +++ b/reflex/components/core/client_side_routing.py @@ -13,9 +13,10 @@ from reflex import constants from reflex.components.component import Component from reflex.components.core.cond import cond +from reflex.ivars.base import ImmutableVar from reflex.vars import Var -route_not_found: Var = Var.create_safe(constants.ROUTE_NOT_FOUND, _var_is_string=False) +route_not_found: Var = ImmutableVar.create_safe(constants.ROUTE_NOT_FOUND) class ClientSideRouting(Component): diff --git a/reflex/components/core/client_side_routing.pyi b/reflex/components/core/client_side_routing.pyi index 605293ee81..57d1e1ae47 100644 --- a/reflex/components/core/client_side_routing.pyi +++ b/reflex/components/core/client_side_routing.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -25,41 +26,51 @@ class ClientSideRouting(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ClientSideRouting": @@ -94,41 +105,51 @@ class Default404Page(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Default404Page": diff --git a/reflex/components/core/clipboard.py b/reflex/components/core/clipboard.py index 9b0edcc293..abc1b5b4a1 100644 --- a/reflex/components/core/clipboard.py +++ b/reflex/components/core/clipboard.py @@ -85,8 +85,8 @@ def add_hooks(self) -> list[str]: return [ "usePasteHandler(%s, %s, %s)" % ( - self.targets._var_name_unwrapped, - self.on_paste_event_actions._var_name_unwrapped, + str(self.targets), + str(self.on_paste_event_actions), on_paste, ) ] diff --git a/reflex/components/core/clipboard.pyi b/reflex/components/core/clipboard.pyi index aaeac985c3..3ffaad2933 100644 --- a/reflex/components/core/clipboard.pyi +++ b/reflex/components/core/clipboard.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, List, Optional, Union, overload from reflex.components.base.fragment import Fragment from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportVar from reflex.vars import Var @@ -26,42 +27,54 @@ class Clipboard(Fragment): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_paste: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_paste: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Clipboard": diff --git a/reflex/components/core/cond.py b/reflex/components/core/cond.py index 6e6272665a..33e145f410 100644 --- a/reflex/components/core/cond.py +++ b/reflex/components/core/cond.py @@ -94,7 +94,7 @@ def render(self) -> Dict: ).set( props=tag.format_props(), ), - cond_state=f"isTrue({self.cond._var_full_name})", + cond_state=f"isTrue({str(self.cond)})", ) def add_imports(self) -> ImportDict: @@ -103,10 +103,11 @@ def add_imports(self) -> ImportDict: Returns: The import dict for the component. """ - cond_imports: dict[str, str | ImportVar | list[str | ImportVar]] = getattr( - VarData.merge(self.cond._get_all_var_data()), "imports", {} - ) - return {**cond_imports, **_IS_TRUE_IMPORT} + var_data = VarData.merge(self.cond._get_all_var_data()) + + imports = var_data.old_school_imports() if var_data else {} + + return {**imports, **_IS_TRUE_IMPORT} @overload @@ -135,8 +136,6 @@ def cond(condition: Any, c1: Any, c2: Any = None) -> Component | ImmutableVar: Raises: ValueError: If the arguments are invalid. """ - if isinstance(condition, Var) and not isinstance(condition, ImmutableVar): - condition._var_is_local = True # Convert the condition to a Var. cond_var = LiteralVar.create(condition) assert cond_var is not None, "The condition must be set." diff --git a/reflex/components/core/debounce.py b/reflex/components/core/debounce.py index 4dc7c14a17..b11bb120b8 100644 --- a/reflex/components/core/debounce.py +++ b/reflex/components/core/debounce.py @@ -7,6 +7,7 @@ from reflex.components.component import Component from reflex.constants import EventTriggers from reflex.event import EventHandler +from reflex.ivars.base import ImmutableVar from reflex.vars import Var, VarData DEFAULT_DEBOUNCE_TIMEOUT = 300 @@ -106,23 +107,20 @@ def create(cls, *children: Component, **props: Any) -> Component: props[field] = getattr(child, field) child_ref = child.get_ref() if props.get("input_ref") is None and child_ref: - props["input_ref"] = Var.create_safe( - child_ref, _var_is_local=False, _var_is_string=False - ) + props["input_ref"] = ImmutableVar.create_safe(child_ref) props["id"] = child.id # Set the child element to wrap, including any imports/hooks from the child. props.setdefault( "element", - Var.create_safe( - "{%s}" % (child.alias or child.tag), - _var_is_local=False, - _var_is_string=False, + ImmutableVar( + _var_name=str(child.alias or child.tag), + _var_type=Type[Component], _var_data=VarData( imports=child._get_imports(), hooks=child._get_hooks_internal(), ), - ).to(Type[Component]), + ), ) component = super().create(**props) diff --git a/reflex/components/core/debounce.pyi b/reflex/components/core/debounce.pyi index 486fcc2842..ca740f85d0 100644 --- a/reflex/components/core/debounce.pyi +++ b/reflex/components/core/debounce.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Type, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -30,42 +31,54 @@ class DebounceInput(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DebounceInput": diff --git a/reflex/components/core/foreach.py b/reflex/components/core/foreach.py index 78e8933d99..a87e0022de 100644 --- a/reflex/components/core/foreach.py +++ b/reflex/components/core/foreach.py @@ -55,7 +55,7 @@ def create( iterable = ImmutableVar.create_safe(iterable) if iterable._var_type == Any: raise ForeachVarError( - f"Could not foreach over var `{iterable._var_full_name}` of type Any. " + f"Could not foreach over var `{str(iterable)}` of type Any. " "(If you are trying to foreach over a state var, add a type annotation to the var). " "See https://reflex.dev/docs/library/dynamic-rendering/foreach/" ) @@ -127,10 +127,10 @@ def render(self): return dict( tag, - iterable_state=tag.iterable._var_full_name, + iterable_state=str(tag.iterable), arg_name=tag.arg_var_name, arg_index=tag.get_index_var_arg(), - iterable_type=tag.iterable._var_type.mro()[0].__name__, + iterable_type=tag.iterable.upcast()._var_type.mro()[0].__name__, ) diff --git a/reflex/components/core/html.pyi b/reflex/components/core/html.pyi index c3d2ed06fa..ab4cfecc86 100644 --- a/reflex/components/core/html.pyi +++ b/reflex/components/core/html.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.el.elements.typography import Div from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -48,41 +49,51 @@ class Html(Div): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Html": diff --git a/reflex/components/core/match.py b/reflex/components/core/match.py index 3ddef38c63..38d56f8626 100644 --- a/reflex/components/core/match.py +++ b/reflex/components/core/match.py @@ -11,7 +11,7 @@ from reflex.utils import format, types from reflex.utils.exceptions import MatchTypeError from reflex.utils.imports import ImportDict -from reflex.vars import ImmutableVarData, Var, VarData +from reflex.vars import Var, VarData class Match(MemoizationLeaf): @@ -27,7 +27,7 @@ class Match(MemoizationLeaf): default: Any @classmethod - def create(cls, cond: Any, *cases) -> Union[Component, Var]: + def create(cls, cond: Any, *cases) -> Union[Component, ImmutableVar]: """Create a Match Component. Args: @@ -56,7 +56,7 @@ def create(cls, cond: Any, *cases) -> Union[Component, Var]: ) @classmethod - def _create_condition_var(cls, cond: Any) -> Var: + def _create_condition_var(cls, cond: Any) -> ImmutableVar: """Convert the condition to a Var. Args: @@ -77,7 +77,7 @@ def _create_condition_var(cls, cond: Any) -> Var: @classmethod def _process_cases( cls, cases: List - ) -> Tuple[List, Optional[Union[Var, BaseComponent]]]: + ) -> Tuple[List, Optional[Union[ImmutableVar, BaseComponent]]]: """Process the list of match cases and the catchall default case. Args: @@ -125,7 +125,7 @@ def _create_case_var_with_var_data(cls, case_element): return case_element @classmethod - def _process_match_cases(cls, cases: List) -> List[List[Var]]: + def _process_match_cases(cls, cases: List) -> List[List[ImmutableVar]]: """Process the individual match cases. Args: @@ -157,7 +157,7 @@ def _process_match_cases(cls, cases: List) -> List[List[Var]]: if not isinstance(element, BaseComponent) else element ) - if not isinstance(el, (Var, BaseComponent)): + if not isinstance(el, (ImmutableVar, BaseComponent)): raise ValueError("Case element must be a var or component") case_list.append(el) @@ -166,7 +166,7 @@ def _process_match_cases(cls, cases: List) -> List[List[Var]]: return match_cases @classmethod - def _validate_return_types(cls, match_cases: List[List[Var]]) -> None: + def _validate_return_types(cls, match_cases: List[List[ImmutableVar]]) -> None: """Validate that match cases have the same return types. Args: @@ -180,24 +180,24 @@ def _validate_return_types(cls, match_cases: List[List[Var]]) -> None: if types._isinstance(first_case_return, BaseComponent): return_type = BaseComponent - elif types._isinstance(first_case_return, Var): - return_type = Var + elif types._isinstance(first_case_return, ImmutableVar): + return_type = ImmutableVar for index, case in enumerate(match_cases): if not types._issubclass(type(case[-1]), return_type): raise MatchTypeError( f"Match cases should have the same return types. Case {index} with return " - f"value `{case[-1]._var_name if isinstance(case[-1], Var) else textwrap.shorten(str(case[-1]), width=250)}`" + f"value `{case[-1]._var_name if isinstance(case[-1], ImmutableVar) else textwrap.shorten(str(case[-1]), width=250)}`" f" of type {type(case[-1])!r} is not {return_type}" ) @classmethod def _create_match_cond_var_or_component( cls, - match_cond_var: Var, - match_cases: List[List[Var]], - default: Optional[Union[Var, BaseComponent]], - ) -> Union[Component, Var]: + match_cond_var: ImmutableVar, + match_cases: List[List[ImmutableVar]], + default: Optional[Union[ImmutableVar, BaseComponent]], + ) -> Union[Component, ImmutableVar]: """Create and return the match condition var or component. Args: @@ -234,12 +234,12 @@ def _create_match_cond_var_or_component( return ImmutableVar( _var_name=format.format_match( - cond=match_cond_var._var_name_unwrapped, - match_cases=match_cases, # type: ignore + cond=str(match_cond_var), + match_cases=match_cases, default=default, # type: ignore ), _var_type=default._var_type, # type: ignore - _var_data=ImmutableVarData.merge( + _var_data=VarData.merge( match_cond_var._get_all_var_data(), *[el._get_all_var_data() for case in match_cases for el in case], default._get_all_var_data(), # type: ignore @@ -267,7 +267,8 @@ def add_imports(self) -> ImportDict: Returns: The import dict. """ - return getattr(VarData.merge(self.cond._get_all_var_data()), "imports", {}) + var_data = VarData.merge(self.cond._get_all_var_data()) + return var_data.old_school_imports() if var_data else {} match = Match.create diff --git a/reflex/components/core/upload.py b/reflex/components/core/upload.py index df9146c4d9..b6fe1024ae 100644 --- a/reflex/components/core/upload.py +++ b/reflex/components/core/upload.py @@ -19,10 +19,10 @@ call_script, parse_args_spec, ) -from reflex.ivars.base import ImmutableCallableVar, ImmutableVar +from reflex.ivars.base import ImmutableCallableVar, ImmutableVar, LiteralVar from reflex.ivars.sequence import LiteralStringVar from reflex.utils.imports import ImportVar -from reflex.vars import ImmutableVarData, Var, VarData +from reflex.vars import Var, VarData DEFAULT_UPLOAD_ID: str = "default" @@ -61,7 +61,7 @@ def upload_file(id_: str = DEFAULT_UPLOAD_ID) -> ImmutableVar: return ImmutableVar( _var_name=var_name, _var_type=EventChain, - _var_data=ImmutableVarData.merge( + _var_data=VarData.merge( upload_files_context_var_data, id_var._get_all_var_data() ), ) @@ -81,7 +81,7 @@ def selected_files(id_: str = DEFAULT_UPLOAD_ID) -> ImmutableVar: return ImmutableVar( _var_name=f"(filesById[{str(id_var)}] ? filesById[{str(id_var)}].map((f) => (f.path || f.name)) : [])", _var_type=List[str], - _var_data=ImmutableVarData.merge( + _var_data=VarData.merge( upload_files_context_var_data, id_var._get_all_var_data() ), ).guess_type() @@ -113,7 +113,7 @@ def cancel_upload(upload_id: str) -> EventSpec: An event spec that cancels the upload when triggered. """ return call_script( - f"upload_controllers[{Var.create_safe(upload_id, _var_is_string=True)._var_name_unwrapped}]?.abort()" + f"upload_controllers[{str(LiteralVar.create(upload_id))}]?.abort()" ) @@ -132,16 +132,15 @@ def get_upload_dir() -> Path: return uploaded_files_dir -uploaded_files_url_prefix: Var = Var.create_safe( - "${getBackendURL(env.UPLOAD)}", - _var_is_string=False, +uploaded_files_url_prefix = ImmutableVar( + _var_name="getBackendURL(env.UPLOAD)", _var_data=VarData( imports={ f"/{Dirs.STATE_PATH}": "getBackendURL", "/env.json": ImportVar(tag="env", is_default=True), } ), -) +).to(str) def get_upload_url(file_path: str) -> Var[str]: @@ -155,9 +154,7 @@ def get_upload_url(file_path: str) -> Var[str]: """ Upload.is_used = True - return Var.create_safe( - f"{uploaded_files_url_prefix}/{file_path}", _var_is_string=True - ) + return uploaded_files_url_prefix + "/" + file_path def _on_drop_spec(files: Var): @@ -251,7 +248,7 @@ def create(cls, *children, **props) -> Component: # The file input to use. upload = Input.create(type="file") upload.special_props = { - ImmutableVar(_var_name="...getInputProps()", _var_type=None) + ImmutableVar(_var_name="{...getInputProps()}", _var_type=None) } # The dropzone to use. @@ -261,7 +258,7 @@ def create(cls, *children, **props) -> Component: **{k: v for k, v in props.items() if k not in supported_props}, ) zone.special_props = { - ImmutableVar(_var_name="...getRootProps()", _var_type=None) + ImmutableVar(_var_name="{...getRootProps()}", _var_type=None) } # Create the component. @@ -290,7 +287,9 @@ def create(cls, *children, **props) -> Component: ) @classmethod - def _update_arg_tuple_for_on_drop(cls, arg_value: tuple[Var, Var]): + def _update_arg_tuple_for_on_drop( + cls, arg_value: tuple[ImmutableVar, ImmutableVar] + ): """Helper to update caller-provided EventSpec args for direct use with on_drop. Args: diff --git a/reflex/components/core/upload.pyi b/reflex/components/core/upload.pyi index ff5085514c..67b350c8df 100644 --- a/reflex/components/core/upload.pyi +++ b/reflex/components/core/upload.pyi @@ -7,6 +7,7 @@ from pathlib import Path from typing import Any, Callable, ClassVar, Dict, List, Optional, Union, overload from reflex.components.component import Component, ComponentNamespace, MemoizationLeaf +from reflex.constants import Dirs from reflex.event import ( CallableEventSpec, EventHandler, @@ -14,6 +15,7 @@ from reflex.event import ( ) from reflex.ivars.base import ImmutableCallableVar, ImmutableVar from reflex.style import Style +from reflex.utils.imports import ImportVar from reflex.vars import Var, VarData DEFAULT_UPLOAD_ID: str @@ -28,7 +30,15 @@ def clear_selected_files(id_: str = DEFAULT_UPLOAD_ID) -> EventSpec: ... def cancel_upload(upload_id: str) -> EventSpec: ... def get_upload_dir() -> Path: ... -uploaded_files_url_prefix: Var +uploaded_files_url_prefix = ImmutableVar( + _var_name="getBackendURL(env.UPLOAD)", + _var_data=VarData( + imports={ + f"/{Dirs.STATE_PATH}": "getBackendURL", + "/env.json": ImportVar(tag="env", is_default=True), + } + ), +).to(str) def get_upload_url(file_path: str) -> Var[str]: ... @@ -43,41 +53,51 @@ class UploadFilesProvider(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "UploadFilesProvider": @@ -120,42 +140,54 @@ class Upload(MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_drop: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_drop: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Upload": @@ -205,42 +237,54 @@ class StyledUpload(Upload): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_drop: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_drop: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "StyledUpload": @@ -290,42 +334,54 @@ class UploadNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_drop: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_drop: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "StyledUpload": diff --git a/reflex/components/datadisplay/code.py b/reflex/components/datadisplay/code.py index 779d4c5d3a..96f91a36e5 100644 --- a/reflex/components/datadisplay/code.py +++ b/reflex/components/datadisplay/code.py @@ -487,7 +487,7 @@ def create( # react-syntax-highlighter doesnt have an explicit "light" or "dark" theme so we use one-light and one-dark # themes respectively to ensure code compatibility. - if "theme" in props and not isinstance(props["theme"], Var): + if "theme" in props and not isinstance(props["theme"], ImmutableVar): props["theme"] = cls.convert_theme_name(props["theme"]) if can_copy: @@ -513,7 +513,7 @@ def create( # Carry the children (code) via props if children: props["code"] = children[0] - if not isinstance(props["code"], Var): + if not isinstance(props["code"], ImmutableVar): props["code"] = LiteralVar.create(props["code"]) # Create the component. @@ -534,7 +534,7 @@ def add_style(self): def _render(self): out = super()._render() - theme = self.theme._replace( + theme = self.theme.upcast()._replace( _var_name=replace_quotes_with_camel_case(str(self.theme)) ) diff --git a/reflex/components/datadisplay/code.pyi b/reflex/components/datadisplay/code.pyi index 015cc0708a..63209ec8a8 100644 --- a/reflex/components/datadisplay/code.pyi +++ b/reflex/components/datadisplay/code.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import Component from reflex.constants.colors import Color from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars import Var @@ -1031,41 +1032,51 @@ class CodeBlock(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CodeBlock": diff --git a/reflex/components/datadisplay/dataeditor.py b/reflex/components/datadisplay/dataeditor.py index f3296e0b70..006a2472fe 100644 --- a/reflex/components/datadisplay/dataeditor.py +++ b/reflex/components/datadisplay/dataeditor.py @@ -10,6 +10,7 @@ from reflex.components.literals import LiteralRowMarker from reflex.event import EventHandler from reflex.ivars.base import ImmutableVar +from reflex.ivars.sequence import ArrayVar from reflex.utils import console, format, types from reflex.utils.imports import ImportDict, ImportVar from reflex.utils.serializers import serializer @@ -298,8 +299,8 @@ def add_hooks(self) -> list[str]: code = [f"function {data_callback}([col, row])" "{"] - columns_path = f"{self.columns._var_full_name}" - data_path = f"{self.data._var_full_name}" + columns_path = str(self.columns) + data_path = str(self.data) code.extend( [ @@ -332,12 +333,18 @@ def create(cls, *children, **props) -> Component: # If rows is not provided, determine from data. if rows is None: - props["rows"] = data.length() if isinstance(data, Var) else len(data) + if isinstance(data, ImmutableVar) and not isinstance(data, ArrayVar): + raise ValueError( + "DataEditor data must be an ArrayVar if rows is not provided." + ) + props["rows"] = ( + data.length() if isinstance(data, ImmutableVar) else len(data) + ) - if not isinstance(columns, Var) and len(columns): + if not isinstance(columns, ImmutableVar) and len(columns): if ( types.is_dataframe(type(data)) - or isinstance(data, Var) + or isinstance(data, ImmutableVar) and types.is_dataframe(data._var_type) ): raise ValueError( @@ -402,9 +409,9 @@ def serialize_dataeditortheme(theme: DataEditorTheme): Returns: The serialized theme. """ - return format.json_dumps( - {format.to_camel_case(k): v for k, v in theme.__dict__.items() if v is not None} - ) + return { + format.to_camel_case(k): v for k, v in theme.__dict__.items() if v is not None + } data_editor = DataEditor.create diff --git a/reflex/components/datadisplay/dataeditor.pyi b/reflex/components/datadisplay/dataeditor.pyi index b40890b73c..66452ffae7 100644 --- a/reflex/components/datadisplay/dataeditor.pyi +++ b/reflex/components/datadisplay/dataeditor.pyi @@ -9,6 +9,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.base import Base from reflex.components.component import NoSSRComponent from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.utils.serializers import serializer @@ -134,87 +135,99 @@ class DataEditor(NoSSRComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_cell_activated: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_cell_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_cell_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_cell_edited: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_column_resize: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_delete: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_delete: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_finished_editing: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_group_header_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_group_header_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_group_header_renamed: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_header_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_header_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_header_menu_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_item_hovered: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_row_appended: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_selection_cleared: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DataEditor": diff --git a/reflex/components/el/element.pyi b/reflex/components/el/element.pyi index f18d9008c6..5769416187 100644 --- a/reflex/components/el/element.pyi +++ b/reflex/components/el/element.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var class Element(Component): @overload @@ -21,41 +21,51 @@ class Element(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Element": diff --git a/reflex/components/el/elements/base.pyi b/reflex/components/el/elements/base.pyi index d802cc2ee9..4cc1c397c1 100644 --- a/reflex/components/el/elements/base.pyi +++ b/reflex/components/el/elements/base.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.el.element import Element from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -45,41 +46,51 @@ class BaseHTML(Element): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "BaseHTML": diff --git a/reflex/components/el/elements/forms.py b/reflex/components/el/elements/forms.py index f6ad101621..f2a6a42f5c 100644 --- a/reflex/components/el/elements/forms.py +++ b/reflex/components/el/elements/forms.py @@ -12,7 +12,6 @@ from reflex.constants import Dirs, EventTriggers from reflex.event import EventChain, EventHandler from reflex.ivars.base import ImmutableVar, LiteralVar -from reflex.utils.format import format_event_chain from reflex.utils.imports import ImportDict from reflex.vars import Var, VarData @@ -24,9 +23,9 @@ const handleSubmit_{{ handle_submit_unique_name }} = useCallback((ev) => { const $form = ev.target ev.preventDefault() - const {{ form_data }} = {...Object.fromEntries(new FormData($form).entries()), ...{{ field_ref_mapping }}} + const {{ form_data }} = {...Object.fromEntries(new FormData($form).entries()), ...{{ field_ref_mapping }}}; - {{ on_submit_event_chain }} + ({{ on_submit_event_chain }}()); if ({{ reset_on_submit }}) { $form.reset() @@ -186,8 +185,8 @@ def add_hooks(self) -> list[str]: handle_submit_unique_name=self.handle_submit_unique_name, form_data=FORM_DATA, field_ref_mapping=str(LiteralVar.create(self._get_form_refs())), - on_submit_event_chain=format_event_chain( - self.event_triggers[EventTriggers.ON_SUBMIT] + on_submit_event_chain=str( + LiteralVar.create(self.event_triggers[EventTriggers.ON_SUBMIT]) ), reset_on_submit=self.reset_on_submit, ) @@ -227,7 +226,7 @@ def _get_form_refs(self) -> Dict[str, Any]: # print(repr(form_refs)) return form_refs - def _get_vars(self, include_children: bool = True) -> Iterator[Var]: + def _get_vars(self, include_children: bool = True) -> Iterator[ImmutableVar]: yield from super()._get_vars(include_children=include_children) yield from self._get_form_refs().values() @@ -625,19 +624,15 @@ def _render(self) -> Tag: "Cannot combine `enter_key_submit` with `on_key_down`.", ) tag.add_props( - on_key_down=Var.create_safe( - f"(e) => enterKeySubmitOnKeyDown(e, {self.enter_key_submit._var_name_unwrapped})", - _var_is_local=False, - _var_is_string=False, + on_key_down=ImmutableVar.create_safe( + f"(e) => enterKeySubmitOnKeyDown(e, {str(self.enter_key_submit)})", _var_data=VarData.merge(self.enter_key_submit._get_all_var_data()), ) ) if self.auto_height is not None: tag.add_props( - on_input=Var.create_safe( - f"(e) => autoHeightOnInput(e, {self.auto_height._var_name_unwrapped})", - _var_is_local=False, - _var_is_string=False, + on_input=ImmutableVar.create_safe( + f"(e) => autoHeightOnInput(e, {str(self.auto_height)})", _var_data=VarData.merge(self.auto_height._get_all_var_data()), ) ) diff --git a/reflex/components/el/elements/forms.pyi b/reflex/components/el/elements/forms.pyi index 7eca3f8547..0b2f42754e 100644 --- a/reflex/components/el/elements/forms.pyi +++ b/reflex/components/el/elements/forms.pyi @@ -18,7 +18,7 @@ from .base import BaseHTML FORM_DATA = ImmutableVar.create("form_data") HANDLE_SUBMIT_JS_JINJA2 = Environment().from_string( - "\n const handleSubmit_{{ handle_submit_unique_name }} = useCallback((ev) => {\n const $form = ev.target\n ev.preventDefault()\n const {{ form_data }} = {...Object.fromEntries(new FormData($form).entries()), ...{{ field_ref_mapping }}}\n\n {{ on_submit_event_chain }}\n\n if ({{ reset_on_submit }}) {\n $form.reset()\n }\n })\n " + "\n const handleSubmit_{{ handle_submit_unique_name }} = useCallback((ev) => {\n const $form = ev.target\n ev.preventDefault()\n const {{ form_data }} = {...Object.fromEntries(new FormData($form).entries()), ...{{ field_ref_mapping }}};\n\n ({{ on_submit_event_chain }}());\n\n if ({{ reset_on_submit }}) {\n $form.reset()\n }\n })\n " ) class Button(BaseHTML): @@ -71,41 +71,51 @@ class Button(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Button": @@ -188,41 +198,51 @@ class Datalist(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Datalist": @@ -273,41 +293,51 @@ class Fieldset(Element): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Fieldset": @@ -381,42 +411,54 @@ class Form(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_submit: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_submit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Form": @@ -541,46 +583,60 @@ class Input(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_key_up: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Input": @@ -687,41 +743,51 @@ class Label(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Label": @@ -795,41 +861,51 @@ class Legend(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Legend": @@ -908,41 +984,51 @@ class Meter(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Meter": @@ -1023,41 +1109,51 @@ class Optgroup(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Optgroup": @@ -1135,41 +1231,51 @@ class Option(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Option": @@ -1248,41 +1354,51 @@ class Output(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Output": @@ -1360,41 +1476,51 @@ class Progress(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Progress": @@ -1479,42 +1605,54 @@ class Select(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Select": @@ -1616,46 +1754,60 @@ class Textarea(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_key_up: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Textarea": diff --git a/reflex/components/el/elements/inline.pyi b/reflex/components/el/elements/inline.pyi index dfddf5f105..0c1b81d1f8 100644 --- a/reflex/components/el/elements/inline.pyi +++ b/reflex/components/el/elements/inline.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -57,41 +58,51 @@ class A(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "A": @@ -172,41 +183,51 @@ class Abbr(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Abbr": @@ -278,41 +299,51 @@ class B(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "B": @@ -384,41 +415,51 @@ class Bdi(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Bdi": @@ -490,41 +531,51 @@ class Bdo(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Bdo": @@ -596,41 +647,51 @@ class Br(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Br": @@ -702,41 +763,51 @@ class Cite(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Cite": @@ -808,41 +879,51 @@ class Code(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Code": @@ -915,41 +996,51 @@ class Data(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Data": @@ -1022,41 +1113,51 @@ class Dfn(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Dfn": @@ -1128,41 +1229,51 @@ class Em(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Em": @@ -1234,41 +1345,51 @@ class I(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "I": @@ -1340,41 +1461,51 @@ class Kbd(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Kbd": @@ -1446,41 +1577,51 @@ class Mark(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Mark": @@ -1553,41 +1694,51 @@ class Q(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Q": @@ -1660,41 +1811,51 @@ class Rp(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Rp": @@ -1766,41 +1927,51 @@ class Rt(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Rt": @@ -1872,41 +2043,51 @@ class Ruby(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Ruby": @@ -1978,41 +2159,51 @@ class S(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "S": @@ -2084,41 +2275,51 @@ class Samp(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Samp": @@ -2190,41 +2391,51 @@ class Small(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Small": @@ -2296,41 +2507,51 @@ class Span(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Span": @@ -2402,41 +2623,51 @@ class Strong(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Strong": @@ -2508,41 +2739,51 @@ class Sub(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Sub": @@ -2614,41 +2855,51 @@ class Sup(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Sup": @@ -2721,41 +2972,51 @@ class Time(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Time": @@ -2828,41 +3089,51 @@ class U(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "U": @@ -2934,41 +3205,51 @@ class Wbr(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Wbr": diff --git a/reflex/components/el/elements/media.pyi b/reflex/components/el/elements/media.pyi index cf673ddf96..08b2be719b 100644 --- a/reflex/components/el/elements/media.pyi +++ b/reflex/components/el/elements/media.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex import ComponentNamespace from reflex.constants.colors import Color from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -61,41 +62,51 @@ class Area(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Area": @@ -188,41 +199,51 @@ class Audio(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Audio": @@ -320,41 +341,51 @@ class Img(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Img": @@ -440,41 +471,51 @@ class Map(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Map": @@ -552,41 +593,51 @@ class Track(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Track": @@ -677,41 +728,51 @@ class Video(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Video": @@ -795,41 +856,51 @@ class Embed(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Embed": @@ -914,41 +985,51 @@ class Iframe(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Iframe": @@ -1034,41 +1115,51 @@ class Object(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Object": @@ -1145,41 +1236,51 @@ class Picture(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Picture": @@ -1251,41 +1352,51 @@ class Portal(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Portal": @@ -1362,41 +1473,51 @@ class Source(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Source": @@ -1476,41 +1597,51 @@ class Svg(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Svg": @@ -1589,41 +1720,51 @@ class Circle(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Circle": @@ -1706,41 +1847,51 @@ class Rect(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Rect": @@ -1821,41 +1972,51 @@ class Polygon(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Polygon": @@ -1929,41 +2090,51 @@ class Defs(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Defs": @@ -2042,41 +2213,51 @@ class LinearGradient(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "LinearGradient": @@ -2162,41 +2343,51 @@ class Stop(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Stop": @@ -2272,41 +2463,51 @@ class Path(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Path": @@ -2388,41 +2589,51 @@ class SVG(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Svg": diff --git a/reflex/components/el/elements/metadata.py b/reflex/components/el/elements/metadata.py index 9a4d18b73e..fc8e1d9d6d 100644 --- a/reflex/components/el/elements/metadata.py +++ b/reflex/components/el/elements/metadata.py @@ -3,6 +3,7 @@ from typing import Set, Union from reflex.components.el.element import Element +from reflex.ivars.base import ImmutableVar from reflex.vars import Var as Var from .base import BaseHTML @@ -89,8 +90,8 @@ class StyleEl(Element): # noqa: E742 media: Var[Union[str, int, bool]] - special_props: Set[Var] = { - Var.create_safe("suppressHydrationWarning", _var_is_string=False) + special_props: Set[ImmutableVar] = { + ImmutableVar.create_safe("suppressHydrationWarning") } diff --git a/reflex/components/el/elements/metadata.pyi b/reflex/components/el/elements/metadata.pyi index cb7e1dca9d..26e12d0e41 100644 --- a/reflex/components/el/elements/metadata.pyi +++ b/reflex/components/el/elements/metadata.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.el.element import Element from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -49,41 +50,51 @@ class Base(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Base": @@ -155,41 +166,51 @@ class Head(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Head": @@ -274,41 +295,51 @@ class Link(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Link": @@ -393,41 +424,51 @@ class Meta(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Meta": @@ -479,41 +520,51 @@ class Title(Element): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Title": @@ -546,41 +597,51 @@ class StyleEl(Element): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "StyleEl": diff --git a/reflex/components/el/elements/other.pyi b/reflex/components/el/elements/other.pyi index 89b50b085e..4a106344ba 100644 --- a/reflex/components/el/elements/other.pyi +++ b/reflex/components/el/elements/other.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -47,41 +48,51 @@ class Details(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Details": @@ -155,41 +166,51 @@ class Dialog(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Dialog": @@ -262,41 +283,51 @@ class Summary(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Summary": @@ -368,41 +399,51 @@ class Slot(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Slot": @@ -474,41 +515,51 @@ class Template(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Template": @@ -580,41 +631,51 @@ class Math(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Math": @@ -687,41 +748,51 @@ class Html(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Html": diff --git a/reflex/components/el/elements/scripts.pyi b/reflex/components/el/elements/scripts.pyi index 9923d8c6b6..f5e9f67958 100644 --- a/reflex/components/el/elements/scripts.pyi +++ b/reflex/components/el/elements/scripts.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -46,41 +47,51 @@ class Canvas(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Canvas": @@ -152,41 +163,51 @@ class Noscript(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Noscript": @@ -271,41 +292,51 @@ class Script(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Script": diff --git a/reflex/components/el/elements/sectioning.pyi b/reflex/components/el/elements/sectioning.pyi index 2d1cc457dc..5bca34ac69 100644 --- a/reflex/components/el/elements/sectioning.pyi +++ b/reflex/components/el/elements/sectioning.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -46,41 +47,51 @@ class Body(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Body": @@ -152,41 +163,51 @@ class Address(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Address": @@ -258,41 +279,51 @@ class Article(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Article": @@ -364,41 +395,51 @@ class Aside(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Aside": @@ -470,41 +511,51 @@ class Footer(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Footer": @@ -576,41 +627,51 @@ class Header(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Header": @@ -682,41 +743,51 @@ class H1(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "H1": @@ -788,41 +859,51 @@ class H2(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "H2": @@ -894,41 +975,51 @@ class H3(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "H3": @@ -1000,41 +1091,51 @@ class H4(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "H4": @@ -1106,41 +1207,51 @@ class H5(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "H5": @@ -1212,41 +1323,51 @@ class H6(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "H6": @@ -1318,41 +1439,51 @@ class Main(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Main": @@ -1424,41 +1555,51 @@ class Nav(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Nav": @@ -1530,41 +1671,51 @@ class Section(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Section": diff --git a/reflex/components/el/elements/tables.pyi b/reflex/components/el/elements/tables.pyi index 39ca144b86..0cf41c5150 100644 --- a/reflex/components/el/elements/tables.pyi +++ b/reflex/components/el/elements/tables.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -47,41 +48,51 @@ class Caption(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Caption": @@ -156,41 +167,51 @@ class Col(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Col": @@ -266,41 +287,51 @@ class Colgroup(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Colgroup": @@ -376,41 +407,51 @@ class Table(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Table": @@ -485,41 +526,51 @@ class Tbody(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Tbody": @@ -596,41 +647,51 @@ class Td(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Td": @@ -707,41 +768,51 @@ class Tfoot(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Tfoot": @@ -819,41 +890,51 @@ class Th(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Th": @@ -931,41 +1012,51 @@ class Thead(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Thead": @@ -1039,41 +1130,51 @@ class Tr(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Tr": diff --git a/reflex/components/el/elements/typography.pyi b/reflex/components/el/elements/typography.pyi index 9263764412..28c8c041ee 100644 --- a/reflex/components/el/elements/typography.pyi +++ b/reflex/components/el/elements/typography.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -47,41 +48,51 @@ class Blockquote(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Blockquote": @@ -154,41 +165,51 @@ class Dd(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Dd": @@ -260,41 +281,51 @@ class Div(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Div": @@ -366,41 +397,51 @@ class Dl(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Dl": @@ -472,41 +513,51 @@ class Dt(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Dt": @@ -578,41 +629,51 @@ class Figcaption(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Figcaption": @@ -685,41 +746,51 @@ class Hr(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Hr": @@ -792,41 +863,51 @@ class Li(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Li": @@ -899,41 +980,51 @@ class Menu(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Menu": @@ -1009,41 +1100,51 @@ class Ol(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Ol": @@ -1118,41 +1219,51 @@ class P(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "P": @@ -1224,41 +1335,51 @@ class Pre(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Pre": @@ -1330,41 +1451,51 @@ class Ul(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Ul": @@ -1438,41 +1569,51 @@ class Ins(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Ins": @@ -1548,41 +1689,51 @@ class Del(BaseHTML): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Del": diff --git a/reflex/components/gridjs/datatable.py b/reflex/components/gridjs/datatable.py index 47069843b4..cd1acf1004 100644 --- a/reflex/components/gridjs/datatable.py +++ b/reflex/components/gridjs/datatable.py @@ -6,11 +6,11 @@ from reflex.components.component import Component from reflex.components.tags import Tag -from reflex.ivars.base import ImmutableComputedVar +from reflex.ivars.base import ImmutableVar, LiteralVar, is_computed_var from reflex.utils import types from reflex.utils.imports import ImportDict from reflex.utils.serializers import serialize -from reflex.vars import ComputedVar, Var +from reflex.vars import Var class Gridjs(Component): @@ -66,17 +66,14 @@ def create(cls, *children, **props): # The annotation should be provided if data is a computed var. We need this to know how to # render pandas dataframes. - if ( - isinstance(data, (ComputedVar, ImmutableComputedVar)) - and data._var_type == Any - ): + if is_computed_var(data) and data._var_type == Any: raise ValueError( "Annotation of the computed var assigned to the data field should be provided." ) if ( columns is not None - and isinstance(columns, (ComputedVar, ImmutableComputedVar)) + and is_computed_var(columns) and columns._var_type == Any ): raise ValueError( @@ -86,7 +83,7 @@ def create(cls, *children, **props): # If data is a pandas dataframe and columns are provided throw an error. if ( types.is_dataframe(type(data)) - or (isinstance(data, Var) and types.is_dataframe(data._var_type)) + or (isinstance(data, ImmutableVar) and types.is_dataframe(data._var_type)) ) and columns is not None: raise ValueError( "Cannot pass in both a pandas dataframe and columns to the data_table component." @@ -94,15 +91,13 @@ def create(cls, *children, **props): # If data is a list and columns are not provided, throw an error if ( - (isinstance(data, Var) and types._issubclass(data._var_type, List)) + (isinstance(data, ImmutableVar) and types._issubclass(data._var_type, List)) or issubclass(type(data), List) ) and columns is None: raise ValueError( "column field should be specified when the data field is a list type" ) - print("props", props) - # Create the component. return super().create( *children, @@ -118,7 +113,9 @@ def add_imports(self) -> ImportDict: return {"": "gridjs/dist/theme/mermaid.css"} def _render(self) -> Tag: - if isinstance(self.data, Var) and types.is_dataframe(self.data._var_type): + if isinstance(self.data, ImmutableVar) and types.is_dataframe( + self.data._var_type + ): self.columns = self.data._replace( _var_name=f"{self.data._var_name}.columns", _var_type=List[Any], @@ -131,8 +128,8 @@ def _render(self) -> Tag: # If given a pandas df break up the data and columns data = serialize(self.data) assert isinstance(data, dict), "Serialized dataframe should be a dict." - self.columns = Var.create_safe(data["columns"]) - self.data = Var.create_safe(data["data"]) + self.columns = LiteralVar.create(data["columns"]) + self.data = LiteralVar.create(data["data"]) # Render the table. return super()._render() diff --git a/reflex/components/gridjs/datatable.pyi b/reflex/components/gridjs/datatable.pyi index 8f0a427b1f..c80cacd85f 100644 --- a/reflex/components/gridjs/datatable.pyi +++ b/reflex/components/gridjs/datatable.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, List, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars import Var @@ -22,41 +23,51 @@ class Gridjs(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Gridjs": @@ -94,41 +105,51 @@ class DataTable(Gridjs): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DataTable": diff --git a/reflex/components/lucide/icon.pyi b/reflex/components/lucide/icon.pyi index 325322b455..1e25ac002f 100644 --- a/reflex/components/lucide/icon.pyi +++ b/reflex/components/lucide/icon.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -21,41 +22,51 @@ class LucideIconComponent(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "LucideIconComponent": @@ -88,41 +99,51 @@ class Icon(LucideIconComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Icon": diff --git a/reflex/components/markdown/markdown.py b/reflex/components/markdown/markdown.py index cd560d00b8..b44ca25dda 100644 --- a/reflex/components/markdown/markdown.py +++ b/reflex/components/markdown/markdown.py @@ -20,11 +20,11 @@ from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.utils import types from reflex.utils.imports import ImportDict, ImportVar -from reflex.vars import Var # Special vars used in the component map. _CHILDREN = ImmutableVar.create_safe("children") _PROPS = ImmutableVar.create_safe("...props") +_PROPS_IN_TAG = ImmutableVar.create_safe("{...props}") _MOCK_ARG = ImmutableVar.create_safe("") # Special remark plugins. @@ -99,7 +99,8 @@ def create(cls, *children, **props) -> Component: The markdown component. """ assert ( - len(children) == 1 and types._isinstance(children[0], Union[str, Var]) + len(children) == 1 + and types._isinstance(children[0], Union[str, ImmutableVar]) ), "Markdown component must have exactly one child containing the markdown source." # Update the base component map with the custom component map. @@ -194,7 +195,7 @@ def get_component(self, tag: str, **props) -> Component: if tag not in self.component_map: raise ValueError(f"No markdown component found for tag: {tag}.") - special_props = {_PROPS} + special_props = {_PROPS_IN_TAG} children = [_CHILDREN] # For certain tags, the props from the markdown renderer are not actually valid for the component. @@ -205,9 +206,7 @@ def get_component(self, tag: str, **props) -> Component: children_prop = props.pop("children", None) if children_prop is not None: special_props.add( - Var.create_safe( - f"children={{{str(children_prop)}}}", _var_is_string=False - ) + ImmutableVar.create_safe(f"children={{{str(children_prop)}}}") ) children = [] # Get the component. @@ -228,21 +227,22 @@ def format_component(self, tag: str, **props) -> str: """ return str(self.get_component(tag, **props)).replace("\n", "") - def format_component_map(self) -> dict[str, str]: + def format_component_map(self) -> dict[str, ImmutableVar]: """Format the component map for rendering. Returns: The formatted component map. """ components = { - tag: f"{{({{node, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => ({self.format_component(tag)})}}" + tag: ImmutableVar.create_safe( + f"(({{node, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => ({self.format_component(tag)}))" + ) for tag in self.component_map } # Separate out inline code and code blocks. - components[ - "code" - ] = f"""{{({{node, inline, className, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => {{ + components["code"] = ImmutableVar.create_safe( + f"""(({{node, inline, className, {_CHILDREN._var_name}, {_PROPS._var_name}}}) => {{ const match = (className || '').match(/language-(?.*)/); const language = match ? match[1] : ''; if (language) {{ @@ -260,7 +260,8 @@ def format_component_map(self) -> dict[str, str]: ) : ( {self.format_component("codeblock", language=ImmutableVar.create_safe("language"))} ); - }}}}""".replace("\n", " ") + }})""".replace("\n", " ") + ) return components @@ -285,7 +286,7 @@ def _get_custom_code(self) -> str | None: function {self._get_component_map_name()} () {{ {formatted_hooks} return ( - {str(ImmutableVar.create_safe(self.format_component_map()))} + {str(LiteralVar.create(self.format_component_map()))} ) }} """ diff --git a/reflex/components/markdown/markdown.pyi b/reflex/components/markdown/markdown.pyi index 299cb99ff5..e5f660b6cb 100644 --- a/reflex/components/markdown/markdown.pyi +++ b/reflex/components/markdown/markdown.pyi @@ -11,10 +11,10 @@ from reflex.event import EventHandler, EventSpec from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.style import Style from reflex.utils.imports import ImportDict -from reflex.vars import Var _CHILDREN = ImmutableVar.create_safe("children") _PROPS = ImmutableVar.create_safe("...props") +_PROPS_IN_TAG = ImmutableVar.create_safe("{...props}") _MOCK_ARG = ImmutableVar.create_safe("") _REMARK_MATH = ImmutableVar.create_safe("remarkMath") _REMARK_GFM = ImmutableVar.create_safe("remarkGfm") @@ -41,41 +41,51 @@ class Markdown(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Markdown": @@ -101,4 +111,4 @@ class Markdown(Component): def add_imports(self) -> ImportDict | list[ImportDict]: ... def get_component(self, tag: str, **props) -> Component: ... def format_component(self, tag: str, **props) -> str: ... - def format_component_map(self) -> dict[str, str]: ... + def format_component_map(self) -> dict[str, ImmutableVar]: ... diff --git a/reflex/components/moment/moment.pyi b/reflex/components/moment/moment.pyi index 05c7ffc961..168a239d79 100644 --- a/reflex/components/moment/moment.pyi +++ b/reflex/components/moment/moment.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.base import Base from reflex.components.component import NoSSRComponent from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars import Var @@ -55,42 +56,54 @@ class Moment(NoSSRComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Moment": diff --git a/reflex/components/next/base.pyi b/reflex/components/next/base.pyi index c8b9934d80..996ed41e8c 100644 --- a/reflex/components/next/base.pyi +++ b/reflex/components/next/base.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var class NextComponent(Component): ... @@ -23,41 +23,51 @@ class NextComponent(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "NextComponent": diff --git a/reflex/components/next/image.pyi b/reflex/components/next/image.pyi index e6b902cb02..695a8d80e1 100644 --- a/reflex/components/next/image.pyi +++ b/reflex/components/next/image.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -36,43 +37,57 @@ class Image(NextComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_error: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_load: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_load: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Image": diff --git a/reflex/components/next/link.pyi b/reflex/components/next/link.pyi index c25ca82588..0aa6e41279 100644 --- a/reflex/components/next/link.pyi +++ b/reflex/components/next/link.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -23,41 +24,51 @@ class NextLink(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "NextLink": diff --git a/reflex/components/next/video.pyi b/reflex/components/next/video.pyi index 13b39a4f8f..f1f1b94de1 100644 --- a/reflex/components/next/video.pyi +++ b/reflex/components/next/video.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -25,41 +26,51 @@ class Video(NextComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Video": diff --git a/reflex/components/plotly/plotly.py b/reflex/components/plotly/plotly.py index a2393fdcaa..ed7040d1c8 100644 --- a/reflex/components/plotly/plotly.py +++ b/reflex/components/plotly/plotly.py @@ -8,6 +8,7 @@ from reflex.components.component import Component, NoSSRComponent from reflex.components.core.cond import color_mode_cond from reflex.event import EventHandler +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.utils import console from reflex.vars import Var @@ -30,7 +31,7 @@ def _event_data_signature(e0: Var) -> List[Any]: Returns: The event key extracted from the event data (if defined). """ - return [Var.create_safe(f"{e0}?.event", _var_is_string=False)] + return [ImmutableVar.create_safe(f"{e0}?.event")] def _event_points_data_signature(e0: Var) -> List[Any]: @@ -43,11 +44,8 @@ def _event_points_data_signature(e0: Var) -> List[Any]: The event data and the extracted points. """ return [ - Var.create_safe(f"{e0}?.event", _var_is_string=False), - Var.create_safe( - f"extractPoints({e0}?.points)", - _var_is_string=False, - ), + ImmutableVar.create_safe(f"{e0}?.event"), + ImmutableVar.create_safe(f"extractPoints({e0}?.points)"), ] @@ -116,7 +114,7 @@ class Plotly(NoSSRComponent): config: Var[Dict] # If true, the graph will resize when the window is resized. - use_resize_handler: Var[bool] = Var.create_safe(True) + use_resize_handler: Var[bool] = LiteralVar.create(True) # Fired after the plot is redrawn. on_after_plot: EventHandler[_passthrough_signature] @@ -242,10 +240,10 @@ def create(cls, *children, **props) -> Component: from plotly.io import templates responsive_template = color_mode_cond( - light=Var.create_safe(templates["plotly"]).to(dict), - dark=Var.create_safe(templates["plotly_dark"]).to(dict), + light=LiteralVar.create(templates["plotly"]), + dark=LiteralVar.create(templates["plotly_dark"]), ) - if isinstance(responsive_template, Var): + if isinstance(responsive_template, ImmutableVar): # Mark the conditional Var as a Template to avoid type mismatch responsive_template = responsive_template.to(Template) props.setdefault("template", responsive_template) @@ -257,36 +255,26 @@ def _exclude_props(self) -> set[str]: def _render(self): tag = super()._render() - figure = self.data.to(dict) + figure = self.data.upcast().to(dict) merge_dicts = [] # Data will be merged and spread from these dict Vars if self.layout is not None: # Why is this not a literal dict? Great question... it didn't work # reliably because of how _var_name_unwrapped strips the outer curly # brackets if any of the contained Vars depend on state. - layout_dict = Var.create_safe( - f"{{'layout': {self.layout.to(dict)._var_name_unwrapped}}}" - ).to(dict) + layout_dict = LiteralVar.create({"layout": self.layout}) merge_dicts.append(layout_dict) if self.template is not None: - template_dict = Var.create_safe( - {"layout": {"template": self.template.to(dict)}} - ) - template_dict._var_data = None # To avoid stripping outer curly brackets - merge_dicts.append(template_dict) + template_dict = LiteralVar.create({"layout": {"template": self.template}}) + merge_dicts.append(template_dict.without_data()) if merge_dicts: tag.special_props.add( # Merge all dictionaries and spread the result over props. - Var.create_safe( - f"{{...mergician({figure._var_name_unwrapped}," - f"{','.join(md._var_name_unwrapped for md in merge_dicts)})}}", - _var_is_string=False, + ImmutableVar.create_safe( + f"{{...mergician({str(figure)}," + f"{','.join(str(md) for md in merge_dicts)})}}", ), ) else: # Spread the figure dict over props, nothing to merge. - tag.special_props.add( - Var.create_safe( - f"{{...{figure._var_name_unwrapped}}}", _var_is_string=False - ) - ) + tag.special_props.add(ImmutableVar.create_safe(f"{{...{str(figure)}}}")) return tag diff --git a/reflex/components/plotly/plotly.pyi b/reflex/components/plotly/plotly.pyi index c308e160fa..48797a7ef1 100644 --- a/reflex/components/plotly/plotly.pyi +++ b/reflex/components/plotly/plotly.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.base import Base from reflex.components.component import NoSSRComponent from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils import console from reflex.vars import Var @@ -44,91 +45,105 @@ class Plotly(NoSSRComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, on_after_plot: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_animated: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_animating_frame: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_animation_interrupted: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_autosize: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_before_hover: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_button_clicked: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_deselect: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_hover: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_hover: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_redraw: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_redraw: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_relayout: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_relayouting: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_restyle: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_selected: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_selecting: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_transition_interrupted: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_transitioning: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_unhover: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Plotly": diff --git a/reflex/components/props.py b/reflex/components/props.py index a66ba7f2f9..2966e9727e 100644 --- a/reflex/components/props.py +++ b/reflex/components/props.py @@ -3,8 +3,8 @@ from __future__ import annotations from reflex.base import Base +from reflex.ivars.object import LiteralObjectVar from reflex.utils import format -from reflex.utils.serializers import serialize class PropsBase(Base): @@ -20,12 +20,6 @@ def json(self) -> str: Returns: The object as a Javascript Object literal. """ - return format.unwrap_vars( - self.__config__.json_dumps( - { - format.to_camel_case(key): value - for key, value in self.dict().items() - }, - default=serialize, - ) - ) + return LiteralObjectVar.create( + {format.to_camel_case(key): value for key, value in self.dict().items()} + ).json() diff --git a/reflex/components/radix/primitives/accordion.py b/reflex/components/radix/primitives/accordion.py index da32d747b5..cfd5808a67 100644 --- a/reflex/components/radix/primitives/accordion.py +++ b/reflex/components/radix/primitives/accordion.py @@ -11,7 +11,7 @@ from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.components.radix.themes.base import LiteralAccentColor, LiteralRadius from reflex.event import EventHandler -from reflex.ivars.base import LiteralVar +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.style import Style from reflex.vars import Var, get_uuid_string_var @@ -193,8 +193,8 @@ class AccordionItem(AccordionComponent): def create( cls, *children, - header: Optional[Component | Var] = None, - content: Optional[Component | Var] = None, + header: Optional[Component | ImmutableVar] = None, + content: Optional[Component | ImmutableVar] = None, **props, ) -> Component: """Create an accordion item. diff --git a/reflex/components/radix/primitives/accordion.pyi b/reflex/components/radix/primitives/accordion.pyi index edf0111831..651e16b343 100644 --- a/reflex/components/radix/primitives/accordion.pyi +++ b/reflex/components/radix/primitives/accordion.pyi @@ -9,6 +9,7 @@ from reflex.components.component import Component, ComponentNamespace from reflex.components.lucide.icon import Icon from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -100,41 +101,51 @@ class AccordionComponent(RadixPrimitiveComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AccordionComponent": @@ -264,44 +275,54 @@ class AccordionRoot(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_value_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AccordionRoot": @@ -342,8 +363,8 @@ class AccordionItem(AccordionComponent): def create( # type: ignore cls, *children, - header: Optional[Union[Component, Var]] = None, - content: Optional[Union[Component, Var]] = None, + header: Optional[Union[Component, ImmutableVar]] = None, + content: Optional[Union[Component, ImmutableVar]] = None, value: Optional[Union[Var[str], str]] = None, disabled: Optional[Union[Var[bool], bool]] = None, color_scheme: Optional[ @@ -420,41 +441,51 @@ class AccordionItem(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AccordionItem": @@ -564,41 +595,51 @@ class AccordionHeader(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AccordionHeader": @@ -704,41 +745,51 @@ class AccordionTrigger(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AccordionTrigger": @@ -776,41 +827,51 @@ class AccordionIcon(Icon): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AccordionIcon": @@ -913,41 +974,51 @@ class AccordionContent(AccordionComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AccordionContent": diff --git a/reflex/components/radix/primitives/base.pyi b/reflex/components/radix/primitives/base.pyi index a94b2263c5..1241044d2c 100644 --- a/reflex/components/radix/primitives/base.pyi +++ b/reflex/components/radix/primitives/base.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -22,41 +23,51 @@ class RadixPrimitiveComponent(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadixPrimitiveComponent": @@ -90,41 +101,51 @@ class RadixPrimitiveComponentWithClassName(RadixPrimitiveComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadixPrimitiveComponentWithClassName": diff --git a/reflex/components/radix/primitives/drawer.pyi b/reflex/components/radix/primitives/drawer.pyi index c40bdf53df..ddb770b36e 100644 --- a/reflex/components/radix/primitives/drawer.pyi +++ b/reflex/components/radix/primitives/drawer.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -23,41 +24,51 @@ class DrawerComponent(RadixPrimitiveComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerComponent": @@ -107,44 +118,54 @@ class DrawerRoot(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerRoot": @@ -187,41 +208,51 @@ class DrawerTrigger(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerTrigger": @@ -248,41 +279,51 @@ class DrawerPortal(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerPortal": @@ -316,56 +357,66 @@ class DrawerContent(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerContent": @@ -403,41 +454,51 @@ class DrawerOverlay(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerOverlay": @@ -471,41 +532,51 @@ class DrawerClose(DrawerTrigger): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerClose": @@ -532,41 +603,51 @@ class DrawerTitle(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerTitle": @@ -600,41 +681,51 @@ class DrawerDescription(DrawerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerDescription": @@ -689,44 +780,54 @@ class Drawer(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerRoot": diff --git a/reflex/components/radix/primitives/form.pyi b/reflex/components/radix/primitives/form.pyi index 758630c4a6..20df4b85a2 100644 --- a/reflex/components/radix/primitives/form.pyi +++ b/reflex/components/radix/primitives/form.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.el.elements.forms import Form as HTMLForm from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -25,41 +26,51 @@ class FormComponent(RadixPrimitiveComponentWithClassName): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "FormComponent": @@ -133,45 +144,57 @@ class FormRoot(FormComponent, HTMLForm): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_clear_server_errors: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_submit: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_submit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "FormRoot": @@ -235,41 +258,51 @@ class FormField(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "FormField": @@ -306,41 +339,51 @@ class FormLabel(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "FormLabel": @@ -374,41 +417,51 @@ class FormControl(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "FormControl": @@ -492,41 +545,51 @@ class FormMessage(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "FormMessage": @@ -563,41 +626,51 @@ class FormValidityState(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "FormValidityState": @@ -631,41 +704,51 @@ class FormSubmit(FormComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "FormSubmit": @@ -740,45 +823,57 @@ class Form(FormRoot): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_clear_server_errors: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_submit: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_submit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Form": @@ -884,45 +979,57 @@ class FormNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_clear_server_errors: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_submit: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_submit: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Form": diff --git a/reflex/components/radix/primitives/progress.pyi b/reflex/components/radix/primitives/progress.pyi index f1c817587b..630432abae 100644 --- a/reflex/components/radix/primitives/progress.pyi +++ b/reflex/components/radix/primitives/progress.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.radix.primitives.base import RadixPrimitiveComponentWithClassName from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -23,41 +24,51 @@ class ProgressComponent(RadixPrimitiveComponentWithClassName): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ProgressComponent": @@ -98,41 +109,51 @@ class ProgressRoot(ProgressComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ProgressRoot": @@ -232,41 +253,51 @@ class ProgressIndicator(ProgressComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ProgressIndicator": @@ -373,41 +404,51 @@ class Progress(ProgressRoot): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Progress": @@ -515,41 +556,51 @@ class ProgressNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Progress": diff --git a/reflex/components/radix/primitives/slider.pyi b/reflex/components/radix/primitives/slider.pyi index 9ce737df47..e3bd278056 100644 --- a/reflex/components/radix/primitives/slider.pyi +++ b/reflex/components/radix/primitives/slider.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.component import Component, ComponentNamespace from reflex.components.radix.primitives.base import RadixPrimitiveComponentWithClassName from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -26,41 +27,51 @@ class SliderComponent(RadixPrimitiveComponentWithClassName): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SliderComponent": @@ -111,47 +122,57 @@ class SliderRoot(SliderComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_value_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_value_commit: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SliderRoot": @@ -186,41 +207,51 @@ class SliderTrack(SliderComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SliderTrack": @@ -255,41 +286,51 @@ class SliderRange(SliderComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SliderRange": @@ -324,41 +365,51 @@ class SliderThumb(SliderComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SliderThumb": diff --git a/reflex/components/radix/themes/base.pyi b/reflex/components/radix/themes/base.pyi index 5aea55d908..c79557024d 100644 --- a/reflex/components/radix/themes/base.pyi +++ b/reflex/components/radix/themes/base.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components import Component from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars import Var @@ -102,41 +103,51 @@ class CommonMarginProps(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CommonMarginProps": @@ -176,41 +187,51 @@ class RadixLoadingProp(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadixLoadingProp": @@ -243,41 +264,51 @@ class RadixThemesComponent(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadixThemesComponent": @@ -312,41 +343,51 @@ class RadixThemesTriggerComponent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadixThemesTriggerComponent": @@ -464,41 +505,51 @@ class Theme(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Theme": @@ -544,41 +595,51 @@ class ThemePanel(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ThemePanel": @@ -614,41 +675,51 @@ class RadixThemesColorModeProvider(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadixThemesColorModeProvider": diff --git a/reflex/components/radix/themes/color_mode.py b/reflex/components/radix/themes/color_mode.py index 0331d7184d..2e6707d01d 100644 --- a/reflex/components/radix/themes/color_mode.py +++ b/reflex/components/radix/themes/color_mode.py @@ -17,7 +17,7 @@ from __future__ import annotations -from typing import Literal, get_args +from typing import Dict, List, Literal, get_args from reflex.components.component import BaseComponent from reflex.components.core.cond import Cond, color_mode_cond, cond @@ -25,6 +25,7 @@ from reflex.components.radix.themes.components.dropdown_menu import dropdown_menu from reflex.components.radix.themes.components.switch import Switch from reflex.ivars.base import ImmutableVar +from reflex.ivars.sequence import LiteralArrayVar from reflex.style import ( LIGHT_COLOR_MODE, color_mode, @@ -32,7 +33,6 @@ set_color_mode, toggle_color_mode, ) -from reflex.vars import Var from .components.icon_button import IconButton @@ -66,9 +66,9 @@ def create( LiteralPosition = Literal["top-left", "top-right", "bottom-left", "bottom-right"] -position_values = get_args(LiteralPosition) +position_values: List[str] = list(get_args(LiteralPosition)) -position_map = { +position_map: Dict[str, List[str]] = { "position": position_values, "left": ["top-left", "bottom-left"], "right": ["top-right", "bottom-right"], @@ -78,8 +78,8 @@ def create( # needed to inverse contains for find -def _find(const, var): - return Var.create_safe(const, _var_is_string=False).contains(var) +def _find(const: List[str], var): + return LiteralArrayVar.create(const).contains(var) def _set_var_default(props, position, prop, default1, default2=""): @@ -114,7 +114,7 @@ def create( The button component. """ # position is used to set nice defaults for positioning the icon button - if isinstance(position, Var): + if isinstance(position, ImmutableVar): _set_var_default(props, position, "position", "fixed", position) _set_var_default(props, position, "bottom", "2rem") _set_var_default(props, position, "top", "2rem") diff --git a/reflex/components/radix/themes/color_mode.pyi b/reflex/components/radix/themes/color_mode.pyi index a746068c32..8712e526bd 100644 --- a/reflex/components/radix/themes/color_mode.pyi +++ b/reflex/components/radix/themes/color_mode.pyi @@ -3,7 +3,16 @@ # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ -from typing import Any, Callable, Dict, Literal, Optional, Union, get_args, overload +from typing import ( + Any, + Callable, + Dict, + List, + Literal, + Optional, + Union, + overload, +) from reflex.components.component import BaseComponent from reflex.components.core.breakpoints import Breakpoints @@ -37,41 +46,51 @@ class ColorModeIcon(Cond): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ColorModeIcon": @@ -87,14 +106,8 @@ class ColorModeIcon(Cond): ... LiteralPosition = Literal["top-left", "top-right", "bottom-left", "bottom-right"] -position_values = get_args(LiteralPosition) -position_map = { - "position": position_values, - "left": ["top-left", "bottom-left"], - "right": ["top-right", "bottom-right"], - "top": ["top-left", "top-right"], - "bottom": ["bottom-left", "bottom-right"], -} +position_values: List[str] +position_map: Dict[str, List[str]] class ColorModeIconButton(IconButton): @overload @@ -235,41 +248,51 @@ class ColorModeIconButton(IconButton): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ColorModeIconButton": @@ -428,42 +451,54 @@ class ColorModeSwitch(Switch): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ColorModeSwitch": diff --git a/reflex/components/radix/themes/components/alert_dialog.pyi b/reflex/components/radix/themes/components/alert_dialog.pyi index 4cb9e966cf..8d135e6f8f 100644 --- a/reflex/components/radix/themes/components/alert_dialog.pyi +++ b/reflex/components/radix/themes/components/alert_dialog.pyi @@ -9,6 +9,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -28,44 +29,54 @@ class AlertDialogRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AlertDialogRoot": @@ -101,41 +112,51 @@ class AlertDialogTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AlertDialogTrigger": @@ -198,50 +219,60 @@ class AlertDialogContent(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AlertDialogContent": @@ -294,41 +325,51 @@ class AlertDialogTitle(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AlertDialogTitle": @@ -363,41 +404,51 @@ class AlertDialogDescription(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AlertDialogDescription": @@ -432,41 +483,51 @@ class AlertDialogAction(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AlertDialogAction": @@ -492,41 +553,51 @@ class AlertDialogCancel(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AlertDialogCancel": diff --git a/reflex/components/radix/themes/components/aspect_ratio.pyi b/reflex/components/radix/themes/components/aspect_ratio.pyi index 612c67a296..6ca61f67ca 100644 --- a/reflex/components/radix/themes/components/aspect_ratio.pyi +++ b/reflex/components/radix/themes/components/aspect_ratio.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -23,41 +24,51 @@ class AspectRatio(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AspectRatio": diff --git a/reflex/components/radix/themes/components/avatar.pyi b/reflex/components/radix/themes/components/avatar.pyi index c0476d543d..9a92c73f50 100644 --- a/reflex/components/radix/themes/components/avatar.pyi +++ b/reflex/components/radix/themes/components/avatar.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -113,41 +114,51 @@ class Avatar(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Avatar": diff --git a/reflex/components/radix/themes/components/badge.pyi b/reflex/components/radix/themes/components/badge.pyi index 327fe2b90f..c2936210a9 100644 --- a/reflex/components/radix/themes/components/badge.pyi +++ b/reflex/components/radix/themes/components/badge.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -134,41 +135,51 @@ class Badge(elements.Span, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Badge": diff --git a/reflex/components/radix/themes/components/button.pyi b/reflex/components/radix/themes/components/button.pyi index 95a80c84e7..145de6452d 100644 --- a/reflex/components/radix/themes/components/button.pyi +++ b/reflex/components/radix/themes/components/button.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -157,41 +158,51 @@ class Button(elements.Button, RadixLoadingProp, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Button": diff --git a/reflex/components/radix/themes/components/callout.pyi b/reflex/components/radix/themes/components/callout.pyi index 04e1d13178..4bd7a54a35 100644 --- a/reflex/components/radix/themes/components/callout.pyi +++ b/reflex/components/radix/themes/components/callout.pyi @@ -9,6 +9,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -132,41 +133,51 @@ class CalloutRoot(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CalloutRoot": @@ -246,41 +257,51 @@ class CalloutIcon(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CalloutIcon": @@ -355,41 +376,51 @@ class CalloutText(elements.P, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CalloutText": @@ -547,41 +578,51 @@ class Callout(CalloutRoot): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Callout": @@ -745,41 +786,51 @@ class CalloutNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Callout": diff --git a/reflex/components/radix/themes/components/card.pyi b/reflex/components/radix/themes/components/card.pyi index 142cc74484..ed4399ecc0 100644 --- a/reflex/components/radix/themes/components/card.pyi +++ b/reflex/components/radix/themes/components/card.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -67,41 +68,51 @@ class Card(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Card": diff --git a/reflex/components/radix/themes/components/checkbox.pyi b/reflex/components/radix/themes/components/checkbox.pyi index 52441eef4c..0498f5a902 100644 --- a/reflex/components/radix/themes/components/checkbox.pyi +++ b/reflex/components/radix/themes/components/checkbox.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -114,42 +115,54 @@ class Checkbox(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Checkbox": @@ -281,42 +294,54 @@ class HighLevelCheckbox(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HighLevelCheckbox": @@ -445,42 +470,54 @@ class CheckboxNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HighLevelCheckbox": diff --git a/reflex/components/radix/themes/components/checkbox_cards.pyi b/reflex/components/radix/themes/components/checkbox_cards.pyi index d7be8a056e..519a5587dd 100644 --- a/reflex/components/radix/themes/components/checkbox_cards.pyi +++ b/reflex/components/radix/themes/components/checkbox_cards.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -147,41 +148,51 @@ class CheckboxCardsRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CheckboxCardsRoot": @@ -222,41 +233,51 @@ class CheckboxCardsItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CheckboxCardsItem": diff --git a/reflex/components/radix/themes/components/checkbox_group.pyi b/reflex/components/radix/themes/components/checkbox_group.pyi index 8a730b870c..080125f00b 100644 --- a/reflex/components/radix/themes/components/checkbox_group.pyi +++ b/reflex/components/radix/themes/components/checkbox_group.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -106,41 +107,51 @@ class CheckboxGroupRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CheckboxGroupRoot": @@ -183,41 +194,51 @@ class CheckboxGroupItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CheckboxGroupItem": diff --git a/reflex/components/radix/themes/components/context_menu.pyi b/reflex/components/radix/themes/components/context_menu.pyi index e2f9d01e29..49d703d138 100644 --- a/reflex/components/radix/themes/components/context_menu.pyi +++ b/reflex/components/radix/themes/components/context_menu.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -25,44 +26,54 @@ class ContextMenuRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ContextMenuRoot": @@ -99,41 +110,51 @@ class ContextMenuTrigger(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ContextMenuTrigger": @@ -244,56 +265,66 @@ class ContextMenuContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ContextMenuContent": @@ -334,41 +365,51 @@ class ContextMenuSub(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ContextMenuSub": @@ -404,41 +445,51 @@ class ContextMenuSubTrigger(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ContextMenuSubTrigger": @@ -475,53 +526,63 @@ class ContextMenuSubContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ContextMenuSubContent": @@ -620,41 +681,51 @@ class ContextMenuItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ContextMenuItem": @@ -691,41 +762,51 @@ class ContextMenuSeparator(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ContextMenuSeparator": diff --git a/reflex/components/radix/themes/components/data_list.pyi b/reflex/components/radix/themes/components/data_list.pyi index 93d00c86b2..a73a9264a0 100644 --- a/reflex/components/radix/themes/components/data_list.pyi +++ b/reflex/components/radix/themes/components/data_list.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -59,41 +60,51 @@ class DataListRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DataListRoot": @@ -148,41 +159,51 @@ class DataListItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DataListItem": @@ -289,41 +310,51 @@ class DataListLabel(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DataListLabel": @@ -362,41 +393,51 @@ class DataListValue(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DataListValue": diff --git a/reflex/components/radix/themes/components/dialog.pyi b/reflex/components/radix/themes/components/dialog.pyi index 02b1a6c9f7..eaae1bfeeb 100644 --- a/reflex/components/radix/themes/components/dialog.pyi +++ b/reflex/components/radix/themes/components/dialog.pyi @@ -9,6 +9,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -26,44 +27,54 @@ class DialogRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DialogRoot": @@ -99,41 +110,51 @@ class DialogTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DialogTrigger": @@ -159,41 +180,51 @@ class DialogTitle(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DialogTitle": @@ -264,56 +295,66 @@ class DialogContent(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DialogContent": @@ -365,41 +406,51 @@ class DialogDescription(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DialogDescription": @@ -434,41 +485,51 @@ class DialogClose(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DialogClose": @@ -500,44 +561,54 @@ class Dialog(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DialogRoot": diff --git a/reflex/components/radix/themes/components/dropdown_menu.pyi b/reflex/components/radix/themes/components/dropdown_menu.pyi index df7b235894..2f324fa9af 100644 --- a/reflex/components/radix/themes/components/dropdown_menu.pyi +++ b/reflex/components/radix/themes/components/dropdown_menu.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -35,44 +36,54 @@ class DropdownMenuRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DropdownMenuRoot": @@ -112,41 +123,51 @@ class DropdownMenuTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DropdownMenuTrigger": @@ -276,56 +297,66 @@ class DropdownMenuContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DropdownMenuContent": @@ -379,41 +410,51 @@ class DropdownMenuSubTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DropdownMenuSubTrigger": @@ -441,44 +482,54 @@ class DropdownMenuSub(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DropdownMenuSub": @@ -534,53 +585,63 @@ class DropdownMenuSubContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DropdownMenuSubContent": @@ -691,42 +752,54 @@ class DropdownMenuItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_select: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_select: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DropdownMenuItem": @@ -766,41 +839,51 @@ class DropdownMenuSeparator(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DropdownMenuSeparator": diff --git a/reflex/components/radix/themes/components/hover_card.pyi b/reflex/components/radix/themes/components/hover_card.pyi index ad56a83027..dd575898d8 100644 --- a/reflex/components/radix/themes/components/hover_card.pyi +++ b/reflex/components/radix/themes/components/hover_card.pyi @@ -9,6 +9,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -29,44 +30,54 @@ class HoverCardRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HoverCardRoot": @@ -105,41 +116,51 @@ class HoverCardTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HoverCardTrigger": @@ -209,41 +230,51 @@ class HoverCardContent(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HoverCardContent": @@ -304,44 +335,54 @@ class HoverCard(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HoverCardRoot": diff --git a/reflex/components/radix/themes/components/icon_button.py b/reflex/components/radix/themes/components/icon_button.py index 76077057ee..8a39af0a7d 100644 --- a/reflex/components/radix/themes/components/icon_button.py +++ b/reflex/components/radix/themes/components/icon_button.py @@ -9,6 +9,7 @@ from reflex.components.core.match import Match from reflex.components.el import elements from reflex.components.lucide import Icon +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -82,7 +83,7 @@ def create(cls, *children, **props) -> Component: *[(size, px) for size, px in RADIX_TO_LUCIDE_SIZE.items()], 12, ) - if not isinstance(size_map_var, Var): + if not isinstance(size_map_var, ImmutableVar): raise ValueError(f"Match did not return a Var: {size_map_var}") children[0].size = size_map_var return super().create(*children, **props) diff --git a/reflex/components/radix/themes/components/icon_button.pyi b/reflex/components/radix/themes/components/icon_button.pyi index b5c75a9b6c..e8a2295b4f 100644 --- a/reflex/components/radix/themes/components/icon_button.pyi +++ b/reflex/components/radix/themes/components/icon_button.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -157,41 +158,51 @@ class IconButton(elements.Button, RadixLoadingProp, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "IconButton": diff --git a/reflex/components/radix/themes/components/inset.pyi b/reflex/components/radix/themes/components/inset.pyi index 3671d2a5ca..cefda619b2 100644 --- a/reflex/components/radix/themes/components/inset.pyi +++ b/reflex/components/radix/themes/components/inset.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -132,41 +133,51 @@ class Inset(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Inset": diff --git a/reflex/components/radix/themes/components/popover.pyi b/reflex/components/radix/themes/components/popover.pyi index d8bd9d1d6f..4339a8c430 100644 --- a/reflex/components/radix/themes/components/popover.pyi +++ b/reflex/components/radix/themes/components/popover.pyi @@ -9,6 +9,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -27,44 +28,54 @@ class PopoverRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "PopoverRoot": @@ -101,41 +112,51 @@ class PopoverTrigger(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "PopoverTrigger": @@ -212,59 +233,69 @@ class PopoverContent(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_focus_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_interact_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "PopoverContent": @@ -321,41 +352,51 @@ class PopoverClose(RadixThemesTriggerComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "PopoverClose": diff --git a/reflex/components/radix/themes/components/progress.pyi b/reflex/components/radix/themes/components/progress.pyi index a647e94e64..b3a4ce89d8 100644 --- a/reflex/components/radix/themes/components/progress.pyi +++ b/reflex/components/radix/themes/components/progress.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -112,41 +113,51 @@ class Progress(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Progress": diff --git a/reflex/components/radix/themes/components/radio.pyi b/reflex/components/radix/themes/components/radio.pyi index 5c1b303fa0..06cb6bef33 100644 --- a/reflex/components/radix/themes/components/radio.pyi +++ b/reflex/components/radix/themes/components/radio.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -103,41 +104,51 @@ class Radio(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Radio": diff --git a/reflex/components/radix/themes/components/radio_cards.pyi b/reflex/components/radix/themes/components/radio_cards.pyi index 2c0bf002b0..fac079ca9b 100644 --- a/reflex/components/radix/themes/components/radio_cards.pyi +++ b/reflex/components/radix/themes/components/radio_cards.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -161,44 +162,54 @@ class RadioCardsRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_value_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadioCardsRoot": @@ -251,41 +262,51 @@ class RadioCardsItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadioCardsItem": diff --git a/reflex/components/radix/themes/components/radio_group.py b/reflex/components/radix/themes/components/radio_group.py index 174abbac63..563f5d2dcd 100644 --- a/reflex/components/radix/themes/components/radio_group.py +++ b/reflex/components/radix/themes/components/radio_group.py @@ -146,11 +146,13 @@ def create( default_value = props.pop("default_value", "") if ( - not isinstance(items, (list, Var)) - or isinstance(items, Var) + not isinstance(items, (list, ImmutableVar)) + or isinstance(items, ImmutableVar) and not types._issubclass(items._var_type, list) ): - items_type = type(items) if not isinstance(items, Var) else items._var_type + items_type = ( + type(items) if not isinstance(items, ImmutableVar) else items._var_type + ) raise TypeError( f"The radio group component takes in a list, got {items_type} instead" ) @@ -160,15 +162,15 @@ def create( # convert only non-strings to json(JSON.stringify) so quotes are not rendered # for string literal types. if isinstance(default_value, str) or ( - isinstance(default_value, Var) and default_value._var_type is str + isinstance(default_value, ImmutableVar) and default_value._var_type is str ): default_value = LiteralVar.create(default_value) # type: ignore else: default_value = ImmutableVar.create_safe(default_value).to_string() - def radio_group_item(value: Var) -> Component: + def radio_group_item(value: ImmutableVar) -> Component: item_value = rx.cond( - value._type() == "string", + value.js_type() == "string", value, value.to_string(), ).to(StringVar) diff --git a/reflex/components/radix/themes/components/radio_group.pyi b/reflex/components/radix/themes/components/radio_group.pyi index 559607ae57..c8f8317ac8 100644 --- a/reflex/components/radix/themes/components/radio_group.pyi +++ b/reflex/components/radix/themes/components/radio_group.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -111,42 +112,54 @@ class RadioGroupRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadioGroupRoot": @@ -193,41 +206,51 @@ class RadioGroupItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadioGroupItem": @@ -355,41 +378,51 @@ class HighLevelRadioGroup(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HighLevelRadioGroup": @@ -527,41 +560,51 @@ class RadioGroup(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HighLevelRadioGroup": diff --git a/reflex/components/radix/themes/components/scroll_area.pyi b/reflex/components/radix/themes/components/scroll_area.pyi index 8b4e44df52..20c9c35afd 100644 --- a/reflex/components/radix/themes/components/scroll_area.pyi +++ b/reflex/components/radix/themes/components/scroll_area.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -35,41 +36,51 @@ class ScrollArea(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ScrollArea": diff --git a/reflex/components/radix/themes/components/segmented_control.pyi b/reflex/components/radix/themes/components/segmented_control.pyi index f284dab771..b7511196f7 100644 --- a/reflex/components/radix/themes/components/segmented_control.pyi +++ b/reflex/components/radix/themes/components/segmented_control.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -113,42 +114,54 @@ class SegmentedControlRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SegmentedControlRoot": @@ -189,41 +202,51 @@ class SegmentedControlItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SegmentedControlItem": diff --git a/reflex/components/radix/themes/components/select.py b/reflex/components/radix/themes/components/select.py index fc10d00ded..b2bd69e9a0 100644 --- a/reflex/components/radix/themes/components/select.py +++ b/reflex/components/radix/themes/components/select.py @@ -5,6 +5,7 @@ import reflex as rx from reflex.components.component import Component, ComponentNamespace from reflex.components.core.breakpoints import Responsive +from reflex.ivars.base import ImmutableVar from reflex.vars import Var from ..base import ( @@ -216,7 +217,7 @@ def create(cls, items: Union[List[str], Var[List[str]]], **props) -> Component: label = props.pop("label", None) - if isinstance(items, Var): + if isinstance(items, ImmutableVar): child = [ rx.foreach(items, lambda item: SelectItem.create(item, value=item)) ] diff --git a/reflex/components/radix/themes/components/select.pyi b/reflex/components/radix/themes/components/select.pyi index e2657b7ce0..fa6149d0ea 100644 --- a/reflex/components/radix/themes/components/select.pyi +++ b/reflex/components/radix/themes/components/select.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -42,45 +43,57 @@ class SelectRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SelectRoot": @@ -198,41 +211,51 @@ class SelectTrigger(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SelectTrigger": @@ -357,50 +380,60 @@ class SelectContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_close_auto_focus: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SelectContent": @@ -443,41 +476,51 @@ class SelectGroup(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SelectGroup": @@ -514,41 +557,51 @@ class SelectItem(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SelectItem": @@ -585,41 +638,51 @@ class SelectLabel(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SelectLabel": @@ -654,41 +717,51 @@ class SelectSeparator(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SelectSeparator": @@ -826,45 +899,57 @@ class HighLevelSelect(SelectRoot): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HighLevelSelect": @@ -1022,45 +1107,57 @@ class Select(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HighLevelSelect": diff --git a/reflex/components/radix/themes/components/separator.pyi b/reflex/components/radix/themes/components/separator.pyi index 15670f51a9..13b3276d2c 100644 --- a/reflex/components/radix/themes/components/separator.pyi +++ b/reflex/components/radix/themes/components/separator.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -112,41 +113,51 @@ class Separator(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Separator": diff --git a/reflex/components/radix/themes/components/skeleton.pyi b/reflex/components/radix/themes/components/skeleton.pyi index d6c6bbb03c..dcf0bd3c5b 100644 --- a/reflex/components/radix/themes/components/skeleton.pyi +++ b/reflex/components/radix/themes/components/skeleton.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -42,41 +43,51 @@ class Skeleton(RadixLoadingProp, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Skeleton": diff --git a/reflex/components/radix/themes/components/slider.py b/reflex/components/radix/themes/components/slider.py index c03fffe7bb..55b13a3867 100644 --- a/reflex/components/radix/themes/components/slider.py +++ b/reflex/components/radix/themes/components/slider.py @@ -5,6 +5,7 @@ from reflex.components.component import Component from reflex.components.core.breakpoints import Responsive from reflex.event import EventHandler +from reflex.ivars.base import ImmutableVar from reflex.vars import Var from ..base import ( @@ -88,7 +89,7 @@ def create( """ default_value = props.pop("default_value", [50]) - if isinstance(default_value, Var): + if isinstance(default_value, ImmutableVar): if issubclass(default_value._var_type, (int, float)): default_value = [default_value] diff --git a/reflex/components/radix/themes/components/slider.pyi b/reflex/components/radix/themes/components/slider.pyi index 362451bfe2..23e886f357 100644 --- a/reflex/components/radix/themes/components/slider.pyi +++ b/reflex/components/radix/themes/components/slider.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -132,45 +133,57 @@ class Slider(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_value_commit: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Slider": diff --git a/reflex/components/radix/themes/components/spinner.pyi b/reflex/components/radix/themes/components/spinner.pyi index 7fa62734a9..5ae9593391 100644 --- a/reflex/components/radix/themes/components/spinner.pyi +++ b/reflex/components/radix/themes/components/spinner.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -37,41 +38,51 @@ class Spinner(RadixLoadingProp, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Spinner": diff --git a/reflex/components/radix/themes/components/switch.pyi b/reflex/components/radix/themes/components/switch.pyi index a0f85dbac1..5e4b0b47e9 100644 --- a/reflex/components/radix/themes/components/switch.pyi +++ b/reflex/components/radix/themes/components/switch.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -117,42 +118,54 @@ class Switch(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Switch": diff --git a/reflex/components/radix/themes/components/table.pyi b/reflex/components/radix/themes/components/table.pyi index 9cac240f27..5a872c7c87 100644 --- a/reflex/components/radix/themes/components/table.pyi +++ b/reflex/components/radix/themes/components/table.pyi @@ -9,6 +9,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -65,41 +66,51 @@ class TableRoot(elements.Table, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TableRoot": @@ -179,41 +190,51 @@ class TableHeader(elements.Thead, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TableHeader": @@ -295,41 +316,51 @@ class TableRow(elements.Tr, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TableRow": @@ -416,41 +447,51 @@ class TableColumnHeaderCell(elements.Th, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TableColumnHeaderCell": @@ -532,41 +573,51 @@ class TableBody(elements.Tbody, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TableBody": @@ -652,41 +703,51 @@ class TableCell(elements.Td, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TableCell": @@ -777,41 +838,51 @@ class TableRowHeaderCell(elements.Th, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TableRowHeaderCell": diff --git a/reflex/components/radix/themes/components/tabs.pyi b/reflex/components/radix/themes/components/tabs.pyi index 0fb33b16dd..000eb05d92 100644 --- a/reflex/components/radix/themes/components/tabs.pyi +++ b/reflex/components/radix/themes/components/tabs.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -39,42 +40,54 @@ class TabsRoot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TabsRoot": @@ -123,41 +136,51 @@ class TabsList(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TabsList": @@ -258,41 +281,51 @@ class TabsTrigger(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TabsTrigger": @@ -332,41 +365,51 @@ class TabsContent(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TabsContent": @@ -418,42 +461,54 @@ class Tabs(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TabsRoot": diff --git a/reflex/components/radix/themes/components/text_area.pyi b/reflex/components/radix/themes/components/text_area.pyi index 9a8a478734..561f041ab0 100644 --- a/reflex/components/radix/themes/components/text_area.pyi +++ b/reflex/components/radix/themes/components/text_area.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -167,46 +168,60 @@ class TextArea(RadixThemesComponent, elements.Textarea): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_key_up: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TextArea": diff --git a/reflex/components/radix/themes/components/text_field.pyi b/reflex/components/radix/themes/components/text_field.pyi index be58b8e7f0..9dbaa9692c 100644 --- a/reflex/components/radix/themes/components/text_field.pyi +++ b/reflex/components/radix/themes/components/text_field.pyi @@ -9,6 +9,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -148,46 +149,60 @@ class TextFieldRoot(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_key_up: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TextFieldRoot": @@ -312,41 +327,51 @@ class TextFieldSlot(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TextFieldSlot": @@ -502,46 +527,60 @@ class TextField(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_key_up: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_key_up: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "TextFieldRoot": diff --git a/reflex/components/radix/themes/components/tooltip.pyi b/reflex/components/radix/themes/components/tooltip.pyi index a2344958ff..80f4831832 100644 --- a/reflex/components/radix/themes/components/tooltip.pyi +++ b/reflex/components/radix/themes/components/tooltip.pyi @@ -6,6 +6,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -61,50 +62,60 @@ class Tooltip(RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_escape_key_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_pointer_down_outside: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Tooltip": diff --git a/reflex/components/radix/themes/layout/base.pyi b/reflex/components/radix/themes/layout/base.pyi index 21fed38eff..dc557b5ee4 100644 --- a/reflex/components/radix/themes/layout/base.pyi +++ b/reflex/components/radix/themes/layout/base.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -200,41 +201,51 @@ class LayoutComponent(CommonMarginProps, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "LayoutComponent": diff --git a/reflex/components/radix/themes/layout/box.pyi b/reflex/components/radix/themes/layout/box.pyi index 6bcd75cada..4d7404af1d 100644 --- a/reflex/components/radix/themes/layout/box.pyi +++ b/reflex/components/radix/themes/layout/box.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -47,41 +48,51 @@ class Box(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Box": diff --git a/reflex/components/radix/themes/layout/center.pyi b/reflex/components/radix/themes/layout/center.pyi index 93f8848983..a015ab46c8 100644 --- a/reflex/components/radix/themes/layout/center.pyi +++ b/reflex/components/radix/themes/layout/center.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -124,41 +125,51 @@ class Center(Flex): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Center": diff --git a/reflex/components/radix/themes/layout/container.pyi b/reflex/components/radix/themes/layout/container.pyi index 3c2013b8e4..269af2e43a 100644 --- a/reflex/components/radix/themes/layout/container.pyi +++ b/reflex/components/radix/themes/layout/container.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -64,41 +65,51 @@ class Container(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Container": diff --git a/reflex/components/radix/themes/layout/flex.pyi b/reflex/components/radix/themes/layout/flex.pyi index a49f082627..1de96b3395 100644 --- a/reflex/components/radix/themes/layout/flex.pyi +++ b/reflex/components/radix/themes/layout/flex.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -127,41 +128,51 @@ class Flex(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Flex": diff --git a/reflex/components/radix/themes/layout/grid.pyi b/reflex/components/radix/themes/layout/grid.pyi index c11d1dfcdd..6ab8e7c607 100644 --- a/reflex/components/radix/themes/layout/grid.pyi +++ b/reflex/components/radix/themes/layout/grid.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -156,41 +157,51 @@ class Grid(elements.Div, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Grid": diff --git a/reflex/components/radix/themes/layout/list.py b/reflex/components/radix/themes/layout/list.py index fb77b223d7..cacba70db9 100644 --- a/reflex/components/radix/themes/layout/list.py +++ b/reflex/components/radix/themes/layout/list.py @@ -9,6 +9,7 @@ from reflex.components.el.elements.typography import Li, Ol, Ul from reflex.components.lucide.icon import Icon from reflex.components.radix.themes.typography.text import Text +from reflex.ivars.base import ImmutableVar from reflex.vars import Var LiteralListStyleTypeUnordered = Literal[ @@ -50,7 +51,7 @@ class BaseList(Component): def create( cls, *children, - items: Optional[Var[Iterable]] = None, + items: Optional[ImmutableVar[Iterable]] = None, **props, ): """Create a list component. @@ -66,7 +67,7 @@ def create( """ list_style_type = props.pop("list_style_type", "none") if not children and items is not None: - if isinstance(items, Var): + if isinstance(items, ImmutableVar): children = [Foreach.create(items, ListItem.create)] else: children = [ListItem.create(item) for item in items] # type: ignore @@ -97,7 +98,7 @@ class UnorderedList(BaseList, Ul): def create( cls, *children, - items: Optional[Var[Iterable]] = None, + items: Optional[ImmutableVar[Iterable]] = None, list_style_type: LiteralListStyleTypeUnordered = "disc", **props, ): @@ -128,7 +129,7 @@ class OrderedList(BaseList, Ol): def create( cls, *children, - items: Optional[Var[Iterable]] = None, + items: Optional[ImmutableVar[Iterable]] = None, list_style_type: LiteralListStyleTypeOrdered = "decimal", **props, ): diff --git a/reflex/components/radix/themes/layout/list.pyi b/reflex/components/radix/themes/layout/list.pyi index bf8da641cc..c670608e79 100644 --- a/reflex/components/radix/themes/layout/list.pyi +++ b/reflex/components/radix/themes/layout/list.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Iterable, Literal, Optional, Union, over from reflex.components.component import Component, ComponentNamespace from reflex.components.el.elements.typography import Li, Ol, Ul from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -35,7 +36,7 @@ class BaseList(Component): def create( # type: ignore cls, *children, - items: Optional[Union[Var[Iterable], Iterable]] = None, + items: Optional[ImmutableVar[Iterable]] = None, list_style_type: Optional[ Union[ Var[ @@ -83,41 +84,51 @@ class BaseList(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "BaseList": @@ -149,7 +160,7 @@ class UnorderedList(BaseList, Ul): def create( # type: ignore cls, *children, - items: Optional[Union[Var[Iterable], Iterable]] = None, + items: Optional[ImmutableVar[Iterable]] = None, list_style_type: Optional[LiteralListStyleTypeUnordered] = "disc", access_key: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, auto_capitalize: Optional[ @@ -180,41 +191,51 @@ class UnorderedList(BaseList, Ul): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "UnorderedList": @@ -260,7 +281,7 @@ class OrderedList(BaseList, Ol): def create( # type: ignore cls, *children, - items: Optional[Union[Var[Iterable], Iterable]] = None, + items: Optional[ImmutableVar[Iterable]] = None, list_style_type: Optional[LiteralListStyleTypeOrdered] = "decimal", reversed: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, start: Optional[Union[Var[Union[bool, int, str]], str, int, bool]] = None, @@ -294,41 +315,51 @@ class OrderedList(BaseList, Ol): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "OrderedList": @@ -406,41 +437,51 @@ class ListItem(Li): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ListItem": @@ -486,7 +527,7 @@ class List(ComponentNamespace): @staticmethod def __call__( *children, - items: Optional[Union[Var[Iterable], Iterable]] = None, + items: Optional[ImmutableVar[Iterable]] = None, list_style_type: Optional[ Union[ Var[ @@ -534,41 +575,51 @@ class List(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "BaseList": diff --git a/reflex/components/radix/themes/layout/section.pyi b/reflex/components/radix/themes/layout/section.pyi index b4e1050d81..8556e079b2 100644 --- a/reflex/components/radix/themes/layout/section.pyi +++ b/reflex/components/radix/themes/layout/section.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -61,41 +62,51 @@ class Section(elements.Section, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Section": diff --git a/reflex/components/radix/themes/layout/spacer.pyi b/reflex/components/radix/themes/layout/spacer.pyi index 652c1a0b09..dfd469b051 100644 --- a/reflex/components/radix/themes/layout/spacer.pyi +++ b/reflex/components/radix/themes/layout/spacer.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -124,41 +125,51 @@ class Spacer(Flex): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Spacer": diff --git a/reflex/components/radix/themes/layout/stack.pyi b/reflex/components/radix/themes/layout/stack.pyi index 4ba630fc23..8f0ad2a170 100644 --- a/reflex/components/radix/themes/layout/stack.pyi +++ b/reflex/components/radix/themes/layout/stack.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -92,41 +93,51 @@ class Stack(Flex): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Stack": @@ -237,41 +248,51 @@ class VStack(Stack): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "VStack": @@ -382,41 +403,51 @@ class HStack(Stack): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "HStack": diff --git a/reflex/components/radix/themes/typography/blockquote.pyi b/reflex/components/radix/themes/typography/blockquote.pyi index 3ab3c829b4..f367906bec 100644 --- a/reflex/components/radix/themes/typography/blockquote.pyi +++ b/reflex/components/radix/themes/typography/blockquote.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -138,41 +139,51 @@ class Blockquote(elements.Blockquote, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Blockquote": diff --git a/reflex/components/radix/themes/typography/code.pyi b/reflex/components/radix/themes/typography/code.pyi index f30a39f9a5..25f30d0726 100644 --- a/reflex/components/radix/themes/typography/code.pyi +++ b/reflex/components/radix/themes/typography/code.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -143,41 +144,51 @@ class Code(elements.Code, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Code": diff --git a/reflex/components/radix/themes/typography/heading.pyi b/reflex/components/radix/themes/typography/heading.pyi index d1fe262189..4dc44c1afd 100644 --- a/reflex/components/radix/themes/typography/heading.pyi +++ b/reflex/components/radix/themes/typography/heading.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -163,41 +164,51 @@ class Heading(elements.H1, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Heading": diff --git a/reflex/components/radix/themes/typography/link.pyi b/reflex/components/radix/themes/typography/link.pyi index 54cebee64d..12e6987734 100644 --- a/reflex/components/radix/themes/typography/link.pyi +++ b/reflex/components/radix/themes/typography/link.pyi @@ -10,6 +10,7 @@ from reflex.components.core.breakpoints import Breakpoints from reflex.components.el.elements.inline import A from reflex.components.next.link import NextLink from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars import Var @@ -175,41 +176,51 @@ class Link(RadixThemesComponent, A, MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Link": diff --git a/reflex/components/radix/themes/typography/text.pyi b/reflex/components/radix/themes/typography/text.pyi index 919ed17e03..572922b5b6 100644 --- a/reflex/components/radix/themes/typography/text.pyi +++ b/reflex/components/radix/themes/typography/text.pyi @@ -9,6 +9,7 @@ from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Breakpoints from reflex.components.el import elements from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -230,41 +231,51 @@ class Text(elements.Span, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Text": @@ -507,41 +518,51 @@ class Span(Text): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Span": @@ -624,41 +645,51 @@ class Em(elements.Em, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Em": @@ -739,41 +770,51 @@ class Kbd(elements.Kbd, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Kbd": @@ -850,41 +891,51 @@ class Quote(elements.Q, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Quote": @@ -960,41 +1011,51 @@ class Strong(elements.Strong, RadixThemesComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Strong": @@ -1233,41 +1294,51 @@ class TextNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Text": diff --git a/reflex/components/react_player/audio.pyi b/reflex/components/react_player/audio.pyi index f84122403e..d9d27be717 100644 --- a/reflex/components/react_player/audio.pyi +++ b/reflex/components/react_player/audio.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.react_player.react_player import ReactPlayer from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -32,73 +33,99 @@ class Audio(ReactPlayer): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_buffer: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_buffer: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_buffer_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_click_preview: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_disable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_duration: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_enable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_ended: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_error: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_ended: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_pause: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_play: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_pause: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_play: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_playback_quality_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_playback_rate_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_progress: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_ready: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_seek: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_start: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_ready: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_seek: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_start: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Audio": diff --git a/reflex/components/react_player/react_player.pyi b/reflex/components/react_player/react_player.pyi index c9e8ba5692..7991cadd7d 100644 --- a/reflex/components/react_player/react_player.pyi +++ b/reflex/components/react_player/react_player.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.component import NoSSRComponent from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -30,73 +31,99 @@ class ReactPlayer(NoSSRComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_buffer: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_buffer: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_buffer_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_click_preview: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_disable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_duration: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_enable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_ended: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_error: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_ended: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_pause: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_play: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_pause: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_play: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_playback_quality_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_playback_rate_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_progress: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_ready: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_seek: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_start: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_ready: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_seek: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_start: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ReactPlayer": diff --git a/reflex/components/react_player/video.pyi b/reflex/components/react_player/video.pyi index 7f7c1fda19..2e6fd3aed5 100644 --- a/reflex/components/react_player/video.pyi +++ b/reflex/components/react_player/video.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, Optional, Union, overload from reflex.components.react_player.react_player import ReactPlayer from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -32,73 +33,99 @@ class Video(ReactPlayer): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_buffer: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_buffer: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_buffer_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_click_preview: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_disable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_duration: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_enable_pip: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_ended: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_error: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_ended: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_error: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_pause: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_play: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_pause: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_play: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_playback_quality_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_playback_rate_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_progress: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_ready: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_seek: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_start: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_ready: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_seek: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_start: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Video": diff --git a/reflex/components/recharts/cartesian.py b/reflex/components/recharts/cartesian.py index 4c76e82ea4..a909ac6e72 100644 --- a/reflex/components/recharts/cartesian.py +++ b/reflex/components/recharts/cartesian.py @@ -7,7 +7,7 @@ from reflex.constants import EventTriggers from reflex.constants.colors import Color from reflex.event import EventHandler -from reflex.ivars.base import LiteralVar +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.vars import Var from .recharts import ( @@ -235,7 +235,7 @@ class Brush(Recharts): # The stroke color of brush stroke: Var[Union[str, Color]] - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: """Get the event triggers that pass the component's value to the handler. Returns: diff --git a/reflex/components/recharts/cartesian.pyi b/reflex/components/recharts/cartesian.pyi index 0ffbd6c534..eead7204c2 100644 --- a/reflex/components/recharts/cartesian.pyi +++ b/reflex/components/recharts/cartesian.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.constants.colors import Color from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -93,41 +94,51 @@ class Axis(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Axis": @@ -256,41 +267,51 @@ class XAxis(Axis): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "XAxis": @@ -422,41 +443,51 @@ class YAxis(Axis): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "YAxis": @@ -558,41 +589,51 @@ class ZAxis(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ZAxis": @@ -619,7 +660,7 @@ class ZAxis(Recharts): ... class Brush(Recharts): - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... @overload @classmethod def create( # type: ignore @@ -642,8 +683,10 @@ class Brush(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, **props, ) -> "Brush": """Create the component. @@ -727,41 +770,51 @@ class Cartesian(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Cartesian": @@ -892,41 +945,51 @@ class Area(Cartesian): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Area": @@ -1034,47 +1097,57 @@ class Bar(Cartesian): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Bar": @@ -1220,41 +1293,51 @@ class Line(Cartesian): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Line": @@ -1370,41 +1453,51 @@ class Scatter(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Scatter": @@ -1495,47 +1588,57 @@ class Funnel(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Funnel": @@ -1583,41 +1686,51 @@ class ErrorBar(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ErrorBar": @@ -1664,41 +1777,51 @@ class Reference(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Reference": @@ -1750,41 +1873,51 @@ class ReferenceLine(Reference): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ReferenceLine": @@ -1841,41 +1974,51 @@ class ReferenceDot(Reference): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ReferenceDot": @@ -1933,41 +2076,51 @@ class ReferenceArea(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ReferenceArea": @@ -2014,41 +2167,51 @@ class Grid(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Grid": @@ -2100,41 +2263,51 @@ class CartesianGrid(Grid): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CartesianGrid": @@ -2201,41 +2374,51 @@ class CartesianAxis(Grid): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CartesianAxis": diff --git a/reflex/components/recharts/charts.py b/reflex/components/recharts/charts.py index 37b865b1d4..ac46336f79 100644 --- a/reflex/components/recharts/charts.py +++ b/reflex/components/recharts/charts.py @@ -9,7 +9,7 @@ from reflex.constants import EventTriggers from reflex.constants.colors import Color from reflex.event import EventHandler -from reflex.ivars.base import LiteralVar +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.vars import Var from .recharts import ( @@ -62,7 +62,7 @@ def _ensure_valid_dimension(name: str, value: Any) -> None: return if isinstance(value, str) and value.endswith("%"): return - if isinstance(value, Var) and issubclass(value._var_type, int): + if isinstance(value, ImmutableVar) and issubclass(value._var_type, int): return raise ValueError( f"Chart {name} must be specified as int pixels or percentage, not {value!r}. " @@ -324,7 +324,7 @@ class RadarChart(ChartBase): "Radar", ] - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: """Get the event triggers that pass the component's value to the handler. Returns: @@ -413,7 +413,7 @@ class ScatterChart(ChartBase): "Scatter", ] - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: """Get the event triggers that pass the component's value to the handler. Returns: diff --git a/reflex/components/recharts/charts.pyi b/reflex/components/recharts/charts.pyi index 48bde74832..57ed0c4070 100644 --- a/reflex/components/recharts/charts.pyi +++ b/reflex/components/recharts/charts.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.constants.colors import Color from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -27,41 +28,51 @@ class ChartBase(RechartsCharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ChartBase": @@ -115,41 +126,51 @@ class CategoricalChartBase(ChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "CategoricalChartBase": @@ -216,41 +237,51 @@ class AreaChart(CategoricalChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "AreaChart": @@ -316,41 +347,51 @@ class BarChart(CategoricalChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "BarChart": @@ -415,41 +456,51 @@ class LineChart(CategoricalChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "LineChart": @@ -520,41 +571,51 @@ class ComposedChart(CategoricalChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ComposedChart": @@ -602,41 +663,51 @@ class PieChart(ChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "PieChart": @@ -661,7 +732,7 @@ class PieChart(ChartBase): ... class RadarChart(ChartBase): - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... @overload @classmethod def create( # type: ignore @@ -682,13 +753,15 @@ class RadarChart(ChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadarChart": @@ -743,41 +816,51 @@ class RadialBarChart(ChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadialBarChart": @@ -812,7 +895,7 @@ class RadialBarChart(ChartBase): ... class ScatterChart(ChartBase): - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... @overload @classmethod def create( # type: ignore @@ -826,28 +909,30 @@ class ScatterChart(ChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ScatterChart": @@ -887,41 +972,51 @@ class FunnelChart(ChartBase): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "FunnelChart": @@ -972,47 +1067,57 @@ class Treemap(RechartsCharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Treemap": diff --git a/reflex/components/recharts/general.pyi b/reflex/components/recharts/general.pyi index be6a0d42f9..2c4361ef7e 100644 --- a/reflex/components/recharts/general.pyi +++ b/reflex/components/recharts/general.pyi @@ -8,6 +8,7 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import MemoizationLeaf from reflex.constants.colors import Color from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -32,41 +33,51 @@ class ResponsiveContainer(Recharts, MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "ResponsiveContainer": @@ -158,41 +169,51 @@ class Legend(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Legend": @@ -259,41 +280,51 @@ class GraphingTooltip(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "GraphingTooltip": @@ -390,41 +421,51 @@ class Label(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Label": @@ -510,41 +551,51 @@ class LabelList(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "LabelList": diff --git a/reflex/components/recharts/polar.py b/reflex/components/recharts/polar.py index 76347352be..3333a41be9 100644 --- a/reflex/components/recharts/polar.py +++ b/reflex/components/recharts/polar.py @@ -7,7 +7,7 @@ from reflex.constants import EventTriggers from reflex.constants.colors import Color from reflex.event import EventHandler -from reflex.ivars.base import LiteralVar +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.vars import Var from .recharts import ( @@ -78,7 +78,7 @@ class Pie(Recharts): # Fill color fill: Var[Union[str, Color]] = LiteralVar.create(Color("accent", 3)) - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: """Get the event triggers that pass the component's value to the handler. Returns: @@ -175,7 +175,7 @@ class RadialBar(Recharts): # Valid children components _valid_children: List[str] = ["Cell", "LabelList"] - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: """Get the event triggers that pass the component's value to the handler. Returns: @@ -348,7 +348,7 @@ class PolarRadiusAxis(Recharts): # The stroke color of axis stroke: Var[Union[str, Color]] = LiteralVar.create(Color("gray", 10)) - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: """Get the event triggers that pass the component's value to the handler. Returns: diff --git a/reflex/components/recharts/polar.pyi b/reflex/components/recharts/polar.pyi index 81fb74b276..1b10758ede 100644 --- a/reflex/components/recharts/polar.pyi +++ b/reflex/components/recharts/polar.pyi @@ -7,6 +7,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.constants.colors import Color from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.vars import Var @@ -15,7 +16,7 @@ from .recharts import ( ) class Pie(Recharts): - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... @overload @classmethod def create( # type: ignore @@ -73,22 +74,24 @@ class Pie(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Pie": @@ -152,41 +155,51 @@ class Radar(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Radar": @@ -219,7 +232,7 @@ class Radar(Recharts): ... class RadialBar(Recharts): - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... @overload @classmethod def create( # type: ignore @@ -248,28 +261,30 @@ class RadialBar(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, on_animation_end: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_animation_start: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RadialBar": @@ -326,41 +341,51 @@ class PolarAngleAxis(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "PolarAngleAxis": @@ -414,41 +439,51 @@ class PolarGrid(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "PolarGrid": @@ -478,7 +513,7 @@ class PolarGrid(Recharts): ... class PolarRadiusAxis(Recharts): - def get_event_triggers(self) -> dict[str, Union[Var, Any]]: ... + def get_event_triggers(self) -> dict[str, Union[ImmutableVar, Any]]: ... @overload @classmethod def create( # type: ignore @@ -545,22 +580,24 @@ class PolarRadiusAxis(Recharts): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "PolarRadiusAxis": diff --git a/reflex/components/recharts/recharts.pyi b/reflex/components/recharts/recharts.pyi index 695ecab48f..7ca6189186 100644 --- a/reflex/components/recharts/recharts.pyi +++ b/reflex/components/recharts/recharts.pyi @@ -7,8 +7,8 @@ from typing import Any, Callable, Dict, Literal, Optional, Union, overload from reflex.components.component import Component, MemoizationLeaf, NoSSRComponent from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style -from reflex.vars import Var class Recharts(Component): def render(self) -> Dict: ... @@ -22,41 +22,51 @@ class Recharts(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Recharts": @@ -88,41 +98,51 @@ class RechartsCharts(NoSSRComponent, MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "RechartsCharts": diff --git a/reflex/components/sonner/toast.py b/reflex/components/sonner/toast.py index c7ec5ca60c..c58b4a106c 100644 --- a/reflex/components/sonner/toast.py +++ b/reflex/components/sonner/toast.py @@ -14,7 +14,7 @@ EventSpec, call_script, ) -from reflex.ivars.base import LiteralVar +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.style import Style, resolved_color_mode from reflex.utils import format from reflex.utils.imports import ImportVar @@ -30,7 +30,7 @@ "bottom-right", ] -toast_ref = Var.create_safe("refs['__toast']", _var_is_string=False) +toast_ref = ImmutableVar.create_safe("refs['__toast']") class ToastAction(Base): @@ -56,7 +56,7 @@ def serialize_action(action: ToastAction) -> dict: } -def _toast_callback_signature(toast: Var) -> list[Var]: +def _toast_callback_signature(toast: Var) -> list[ImmutableVar]: """The signature for the toast callback, stripping out unserializable keys. Args: @@ -66,9 +66,8 @@ def _toast_callback_signature(toast: Var) -> list[Var]: A function call stripping non-serializable members of the toast object. """ return [ - Var.create_safe( - f"(() => {{let {{action, cancel, onDismiss, onAutoClose, ...rest}} = {toast}; return rest}})()", - _var_is_string=False, + ImmutableVar.create_safe( + f"(() => {{let {{action, cancel, onDismiss, onAutoClose, ...rest}} = {str(toast)}; return rest}})()" ) ] @@ -77,10 +76,10 @@ class ToastProps(PropsBase): """Props for the toast component.""" # Toast's title, renders above the description. - title: Optional[Union[str, Var]] + title: Optional[Union[str, ImmutableVar]] # Toast's description, renders underneath the title. - description: Optional[Union[str, Var]] + description: Optional[Union[str, ImmutableVar]] # Whether to show the close button. close_button: Optional[bool] @@ -112,7 +111,7 @@ class ToastProps(PropsBase): cancel: Optional[ToastAction] # Custom id for the toast. - id: Optional[Union[str, Var]] + id: Optional[Union[str, ImmutableVar]] # Removes the default styling, which allows for easier customization. unstyled: Optional[bool] @@ -242,16 +241,14 @@ class Toaster(Component): # Marked True when any Toast component is created. is_used: ClassVar[bool] = False - def add_hooks(self) -> list[Var | str]: + def add_hooks(self) -> list[ImmutableVar | str]: """Add hooks for the toaster component. Returns: The hooks for the toaster component. """ - hook = Var.create_safe( + hook = ImmutableVar.create_safe( f"{toast_ref} = toast", - _var_is_local=True, - _var_is_string=False, _var_data=VarData( imports={ "/utils/state": [ImportVar(tag="refs")], @@ -289,7 +286,7 @@ def send_toast(message: str = "", level: str | None = None, **props) -> EventSpe else: toast = f"{toast_command}(`{message}`)" - toast_action = Var.create_safe(toast, _var_is_string=False, _var_is_local=True) + toast_action = ImmutableVar.create_safe(toast) return call_script(toast_action) @staticmethod @@ -356,17 +353,15 @@ def toast_dismiss(id: Var | str | None = None): """ dismiss_var_data = None - if isinstance(id, Var): - dismiss = f"{toast_ref}.dismiss({id._var_name_unwrapped})" + if isinstance(id, ImmutableVar): + dismiss = f"{toast_ref}.dismiss({str(id)})" dismiss_var_data = id._get_all_var_data() elif isinstance(id, str): dismiss = f"{toast_ref}.dismiss('{id}')" else: dismiss = f"{toast_ref}.dismiss()" - dismiss_action = Var.create_safe( + dismiss_action = ImmutableVar.create_safe( dismiss, - _var_is_string=False, - _var_is_local=True, _var_data=VarData.merge(dismiss_var_data), ) return call_script(dismiss_action) diff --git a/reflex/components/sonner/toast.pyi b/reflex/components/sonner/toast.pyi index bb7191eb8c..d18f5a3a9e 100644 --- a/reflex/components/sonner/toast.pyi +++ b/reflex/components/sonner/toast.pyi @@ -10,6 +10,7 @@ from reflex.components.component import Component, ComponentNamespace from reflex.components.lucide.icon import Icon from reflex.components.props import PropsBase from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.serializers import serializer from reflex.vars import Var @@ -22,7 +23,7 @@ LiteralPosition = Literal[ "bottom-center", "bottom-right", ] -toast_ref = Var.create_safe("refs['__toast']", _var_is_string=False) +toast_ref = ImmutableVar.create_safe("refs['__toast']") class ToastAction(Base): label: str @@ -32,8 +33,8 @@ class ToastAction(Base): def serialize_action(action: ToastAction) -> dict: ... class ToastProps(PropsBase): - title: Optional[Union[str, Var]] - description: Optional[Union[str, Var]] + title: Optional[Union[str, ImmutableVar]] + description: Optional[Union[str, ImmutableVar]] close_button: Optional[bool] invert: Optional[bool] important: Optional[bool] @@ -42,7 +43,7 @@ class ToastProps(PropsBase): dismissible: Optional[bool] action: Optional[ToastAction] cancel: Optional[ToastAction] - id: Optional[Union[str, Var]] + id: Optional[Union[str, ImmutableVar]] unstyled: Optional[bool] style: Optional[Style] action_button_styles: Optional[Style] @@ -60,7 +61,7 @@ class ToastProps(PropsBase): class Toaster(Component): is_used: ClassVar[bool] = False - def add_hooks(self) -> list[Var | str]: ... + def add_hooks(self) -> list[ImmutableVar | str]: ... @staticmethod def send_toast( message: str = "", level: str | None = None, **props @@ -120,41 +121,51 @@ class Toaster(Component): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Toaster": diff --git a/reflex/components/suneditor/editor.py b/reflex/components/suneditor/editor.py index 6e28b396a7..d768d79f8e 100644 --- a/reflex/components/suneditor/editor.py +++ b/reflex/components/suneditor/editor.py @@ -8,6 +8,7 @@ from reflex.base import Base from reflex.components.component import Component, NoSSRComponent from reflex.event import EventHandler +from reflex.ivars.base import ImmutableVar from reflex.utils.format import to_camel_case from reflex.utils.imports import ImportDict, ImportVar from reflex.vars import Var @@ -234,7 +235,7 @@ def create(cls, set_options: Optional[EditorOptions] = None, **props) -> Compone ValueError: If set_options is a state Var. """ if set_options is not None: - if isinstance(set_options, Var): + if isinstance(set_options, ImmutableVar): raise ValueError("EditorOptions cannot be a state Var") props["set_options"] = { to_camel_case(k): v diff --git a/reflex/components/suneditor/editor.pyi b/reflex/components/suneditor/editor.pyi index b1bc8a8301..63a8032b90 100644 --- a/reflex/components/suneditor/editor.pyi +++ b/reflex/components/suneditor/editor.pyi @@ -9,6 +9,7 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Union, overload from reflex.base import Base from reflex.components.component import NoSSRComponent from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.style import Style from reflex.utils.imports import ImportDict from reflex.vars import Var @@ -121,56 +122,78 @@ class Editor(NoSSRComponent): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_change: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_copy: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_cut: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_copy: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_cut: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_input: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_load: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_input: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_load: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_paste: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_paste: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_resize_editor: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, toggle_code_view: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, toggle_full_screen: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Editor": diff --git a/reflex/components/tags/iter_tag.py b/reflex/components/tags/iter_tag.py index 0828f8b10a..ee7a636284 100644 --- a/reflex/components/tags/iter_tag.py +++ b/reflex/components/tags/iter_tag.py @@ -34,15 +34,16 @@ def get_iterable_var_type(self) -> Type: Returns: The type of the iterable var. """ + iterable = self.iterable.upcast() try: - if self.iterable._var_type.mro()[0] == dict: + if iterable._var_type.mro()[0] == dict: # Arg is a tuple of (key, value). - return Tuple[get_args(self.iterable._var_type)] # type: ignore - elif self.iterable._var_type.mro()[0] == tuple: + return Tuple[get_args(iterable._var_type)] # type: ignore + elif iterable._var_type.mro()[0] == tuple: # Arg is a union of any possible values in the tuple. - return Union[get_args(self.iterable._var_type)] # type: ignore + return Union[get_args(iterable._var_type)] # type: ignore else: - return get_args(self.iterable._var_type)[0] + return get_args(iterable._var_type)[0] except Exception: return Any diff --git a/reflex/components/tags/tag.py b/reflex/components/tags/tag.py index 9a8cca11f5..810da30f95 100644 --- a/reflex/components/tags/tag.py +++ b/reflex/components/tags/tag.py @@ -6,9 +6,8 @@ from reflex.base import Base from reflex.event import EventChain -from reflex.ivars.base import LiteralVar +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.utils import format, types -from reflex.vars import Var class Tag(Base): @@ -27,7 +26,7 @@ class Tag(Base): args: Optional[Tuple[str, ...]] = None # Special props that aren't key value pairs. - special_props: Set[Var] = set() + special_props: Set[ImmutableVar] = set() # The children components. children: List[Any] = [] @@ -93,7 +92,7 @@ def remove_props(self, *args: str) -> Tag: return self @staticmethod - def is_valid_prop(prop: Optional[Var]) -> bool: + def is_valid_prop(prop: Optional[ImmutableVar]) -> bool: """Check if the prop is valid. Args: diff --git a/reflex/event.py b/reflex/event.py index b8fed57082..8384f06a86 100644 --- a/reflex/event.py +++ b/reflex/event.py @@ -25,7 +25,7 @@ from reflex.utils import format from reflex.utils.exceptions import EventFnArgMismatch, EventHandlerArgMismatch from reflex.utils.types import ArgsSpec -from reflex.vars import ImmutableVarData, Var +from reflex.vars import Var, VarData try: from typing import Annotated @@ -229,7 +229,7 @@ class EventSpec(EventActionsMixin): client_handler_name: str = "" # The arguments to pass to the function. - args: Tuple[Tuple[Var, Var], ...] = () + args: Tuple[Tuple[ImmutableVar, ImmutableVar], ...] = () class Config: """The Pydantic config.""" @@ -237,7 +237,9 @@ class Config: # Required to allow tuple fields. frozen = True - def with_args(self, args: Tuple[Tuple[Var, Var], ...]) -> EventSpec: + def with_args( + self, args: Tuple[Tuple[ImmutableVar, ImmutableVar], ...] + ) -> EventSpec: """Copy the event spec, with updated args. Args: @@ -253,7 +255,7 @@ def with_args(self, args: Tuple[Tuple[Var, Var], ...]) -> EventSpec: event_actions=self.event_actions.copy(), ) - def add_args(self, *args: Var) -> EventSpec: + def add_args(self, *args: ImmutableVar) -> EventSpec: """Add arguments to the event spec. Args: @@ -397,7 +399,7 @@ def as_event_spec(self, handler: EventHandler) -> EventSpec: ImmutableVar( _var_name="filesById", _var_type=Dict[str, Any], - _var_data=ImmutableVarData.merge(upload_files_context_var_data), + _var_data=VarData.merge(upload_files_context_var_data), ).to(ObjectVar)[LiteralVar.create(upload_id)], ), ( @@ -421,7 +423,7 @@ def as_event_spec(self, handler: EventHandler) -> EventSpec: ) # type: ignore else: raise ValueError(f"{on_upload_progress} is not a valid event handler.") - if isinstance(events, Var): + if isinstance(events, ImmutableVar): raise ValueError(f"{on_upload_progress} cannot return a var {events}.") on_upload_progress_chain = EventChain( events=events, @@ -676,9 +678,9 @@ def set_clipboard(content: str) -> EventSpec: def download( - url: str | Var | None = None, - filename: Optional[str | Var] = None, - data: str | bytes | Var | None = None, + url: str | ImmutableVar | None = None, + filename: Optional[str | ImmutableVar] = None, + data: str | bytes | ImmutableVar | None = None, ) -> EventSpec: """Download the file at a given path or with the specified data. @@ -714,17 +716,17 @@ def download( if isinstance(data, str): # Caller provided a plain text string to download. url = "data:text/plain," + urllib.parse.quote(data) - elif isinstance(data, Var): + elif isinstance(data, ImmutableVar): # Need to check on the frontend if the Var already looks like a data: URI. - is_data_url = (data._type() == "string") & ( + is_data_url = (data.js_type() == "string") & ( data.to(str).startswith("data:") ) # type: ignore # If it's a data: URI, use it as is, otherwise convert the Var to JSON in a data: URI. url = cond( # type: ignore is_data_url, - data, + data.to(str), "data:text/plain," + data.to_string(), # type: ignore ) elif isinstance(data, bytes): @@ -879,7 +881,7 @@ def parse_args_spec(arg_spec: ArgsSpec): ) -def call_event_fn(fn: Callable, arg_spec: ArgsSpec) -> list[EventSpec] | Var: +def call_event_fn(fn: Callable, arg_spec: ArgsSpec) -> list[EventSpec] | ImmutableVar: """Call a function to a list of event specs. The function should return a single EventSpec, a list of EventSpecs, or a @@ -920,7 +922,7 @@ def call_event_fn(fn: Callable, arg_spec: ArgsSpec) -> list[EventSpec] | Var: out = fn(*parsed_args) # If the function returns a Var, assume it's an EventChain and render it directly. - if isinstance(out, Var): + if isinstance(out, ImmutableVar): return out # Convert the output to a list. @@ -947,7 +949,9 @@ def call_event_fn(fn: Callable, arg_spec: ArgsSpec) -> list[EventSpec] | Var: return events -def get_handler_args(event_spec: EventSpec) -> tuple[tuple[Var, Var], ...]: +def get_handler_args( + event_spec: EventSpec, +) -> tuple[tuple[ImmutableVar, ImmutableVar], ...]: """Get the handler args for the given event spec. Args: diff --git a/reflex/experimental/client_state.py b/reflex/experimental/client_state.py index af3056c4d5..db5a216004 100644 --- a/reflex/experimental/client_state.py +++ b/reflex/experimental/client_state.py @@ -4,14 +4,17 @@ import dataclasses import sys -from typing import Any, Callable, Optional, Type, Union +from typing import Any, Callable, Union from reflex import constants from reflex.event import EventChain, EventHandler, EventSpec, call_script from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.ivars.function import FunctionVar from reflex.utils.imports import ImportVar -from reflex.vars import ImmutableVarData, Var, VarData, get_unique_variable_name +from reflex.vars import ( + VarData, + get_unique_variable_name, +) NoValue = object() @@ -35,36 +38,19 @@ def _client_state_ref(var_name: str) -> str: @dataclasses.dataclass( eq=False, + frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ClientStateVar(Var): +class ClientStateVar(ImmutableVar): """A Var that exists on the client via useState.""" - # The name of the var. - _var_name: str = dataclasses.field() - # Track the names of the getters and setters - _setter_name: str = dataclasses.field() - _getter_name: str = dataclasses.field() + _setter_name: str = dataclasses.field(default="") + _getter_name: str = dataclasses.field(default="") # Whether to add the var and setter to the global `refs` object for use in any Component. _global_ref: bool = dataclasses.field(default=True) - # The type of the var. - _var_type: Type = dataclasses.field(default=Any) - - # Whether this is a local javascript variable. - _var_is_local: bool = dataclasses.field(default=False) - - # Whether the var is a string literal. - _var_is_string: bool = dataclasses.field(default=False) - - # _var_full_name should be prefixed with _var_state - _var_full_name_needs_state_prefix: bool = dataclasses.field(default=False) - - # Extra metadata associated with the Var - _var_data: Optional[VarData] = dataclasses.field(default=None) - def __hash__(self) -> int: """Define a hash function for a var. @@ -114,13 +100,13 @@ def create( default_var = ImmutableVar.create_safe( "", _var_is_local=False, _var_is_string=False ) - elif not isinstance(default, Var): + elif not isinstance(default, ImmutableVar): default_var = LiteralVar.create(default) else: default_var = default setter_name = f"set{var_name.capitalize()}" hooks = { - f"const [{var_name}, {setter_name}] = useState({default_var._var_name_unwrapped})": None, + f"const [{var_name}, {setter_name}] = useState({str(default_var)})": None, } imports = { "react": [ImportVar(tag="useState")], @@ -134,12 +120,10 @@ def create( _setter_name=setter_name, _getter_name=var_name, _global_ref=global_ref, - _var_is_local=False, - _var_is_string=False, _var_type=default_var._var_type, _var_data=VarData.merge( default_var._var_data, - VarData( # type: ignore + VarData( hooks=hooks, imports=imports, ), @@ -147,7 +131,7 @@ def create( ) @property - def value(self) -> Var: + def value(self) -> ImmutableVar: """Get a placeholder for the Var. This property can only be rendered on the frontend. @@ -171,7 +155,7 @@ def value(self) -> Var: ) ) - def set_value(self, value: Any = NoValue) -> Var: + def set_value(self, value: Any = NoValue) -> ImmutableVar: """Set the value of the client state variable. This property can only be attached to a frontend event trigger. @@ -190,22 +174,22 @@ def set_value(self, value: Any = NoValue) -> Var: else self._setter_name ) if value is not NoValue: + import re + # This is a hack to make it work like an EventSpec taking an arg - value = LiteralVar.create(value) - if not value._var_is_string and value._var_full_name.startswith("_"): - arg = value._var_name_unwrapped.partition(".")[0] - else: - arg = "" - setter = f"({arg}) => {setter}({value._var_name_unwrapped})" + value_str = str(LiteralVar.create(value)) + + # remove patterns of ["*"] from the value_str using regex + arg = re.sub(r"\[\".*\"\]", "", value_str) + + setter = f"({arg}) => {setter}({str(value)})" return ImmutableVar( _var_name=setter, - _var_data=ImmutableVarData( - imports=_refs_import if self._global_ref else {} - ), + _var_data=VarData(imports=_refs_import if self._global_ref else {}), ).to(FunctionVar, EventChain) @property - def set(self) -> Var: + def set(self) -> ImmutableVar: """Set the value of the client state variable. This property can only be attached to a frontend event trigger. diff --git a/reflex/experimental/hooks.py b/reflex/experimental/hooks.py index 848ad7fb79..b977e85b77 100644 --- a/reflex/experimental/hooks.py +++ b/reflex/experimental/hooks.py @@ -2,15 +2,16 @@ from __future__ import annotations +from reflex.ivars.base import ImmutableVar from reflex.utils.imports import ImportVar -from reflex.vars import Var, VarData +from reflex.vars import VarData def _compose_react_imports(tags: list[str]) -> dict[str, list[ImportVar]]: return {"react": [ImportVar(tag=tag) for tag in tags]} -def const(name, value) -> Var: +def const(name, value) -> ImmutableVar: """Create a constant Var. Args: @@ -21,13 +22,11 @@ def const(name, value) -> Var: The constant Var. """ if isinstance(name, list): - return Var.create_safe( - f"const [{', '.join(name)}] = {value}", _var_is_string=False - ) - return Var.create_safe(f"const {name} = {value}", _var_is_string=False) + return ImmutableVar.create_safe(f"const [{', '.join(name)}] = {value}") + return ImmutableVar.create_safe(f"const {name} = {value}") -def useCallback(func, deps) -> Var: +def useCallback(func, deps) -> ImmutableVar: """Create a useCallback hook with a function and dependencies. Args: @@ -37,14 +36,13 @@ def useCallback(func, deps) -> Var: Returns: The useCallback hook. """ - return Var.create_safe( + return ImmutableVar.create_safe( f"useCallback({func}, {deps})" if deps else f"useCallback({func})", - _var_is_string=False, _var_data=VarData(imports=_compose_react_imports(["useCallback"])), ) -def useContext(context) -> Var: +def useContext(context) -> ImmutableVar: """Create a useContext hook with a context. Args: @@ -53,14 +51,13 @@ def useContext(context) -> Var: Returns: The useContext hook. """ - return Var.create_safe( + return ImmutableVar.create_safe( f"useContext({context})", - _var_is_string=False, _var_data=VarData(imports=_compose_react_imports(["useContext"])), ) -def useRef(default) -> Var: +def useRef(default) -> ImmutableVar: """Create a useRef hook with a default value. Args: @@ -69,14 +66,13 @@ def useRef(default) -> Var: Returns: The useRef hook. """ - return Var.create_safe( + return ImmutableVar.create_safe( f"useRef({default})", - _var_is_string=False, _var_data=VarData(imports=_compose_react_imports(["useRef"])), ) -def useState(var_name, default=None) -> Var: +def useState(var_name, default=None) -> ImmutableVar: """Create a useState hook with a variable name and setter name. Args: @@ -88,9 +84,8 @@ def useState(var_name, default=None) -> Var: """ return const( [var_name, f"set{var_name.capitalize()}"], - Var.create_safe( + ImmutableVar.create_safe( f"useState({default})", - _var_is_string=False, _var_data=VarData(imports=_compose_react_imports(["useState"])), ), ) diff --git a/reflex/experimental/layout.py b/reflex/experimental/layout.py index cf39ccb6c6..abe871fa42 100644 --- a/reflex/experimental/layout.py +++ b/reflex/experimental/layout.py @@ -14,9 +14,9 @@ from reflex.components.radix.themes.layout.stack import HStack from reflex.event import call_script from reflex.experimental import hooks +from reflex.ivars.base import ImmutableVar from reflex.state import ComponentState from reflex.style import Style -from reflex.vars import Var class Sidebar(Box, MemoizationLeaf): @@ -55,7 +55,7 @@ def add_style(self) -> dict[str, Any] | None: open = ( self.State.open # type: ignore if self.State - else Var.create_safe("open", _var_is_string=False) + else ImmutableVar.create_safe("open") ) sidebar.style["display"] = spacer.style["display"] = cond(open, "block", "none") @@ -69,7 +69,7 @@ def add_style(self) -> dict[str, Any] | None: } ) - def add_hooks(self) -> List[Var]: + def add_hooks(self) -> List[ImmutableVar]: """Get the hooks to render. Returns: @@ -172,8 +172,8 @@ def create(cls, sidebar: Component, **props): open, toggle = sidebar.State.open, sidebar.State.toggle # type: ignore else: open, toggle = ( - Var.create_safe("open", _var_is_string=False), - call_script(Var.create_safe("setOpen(!open)", _var_is_string=False)), + ImmutableVar.create_safe("open"), + call_script(ImmutableVar.create_safe("setOpen(!open)")), ) trigger_props["left"] = cond(open, f"calc({sidebar_width} - 32px)", "0") diff --git a/reflex/experimental/layout.pyi b/reflex/experimental/layout.pyi index 8799b4961d..58ff2fa8b1 100644 --- a/reflex/experimental/layout.pyi +++ b/reflex/experimental/layout.pyi @@ -11,6 +11,7 @@ from reflex.components.component import Component, ComponentNamespace, Memoizati from reflex.components.radix.primitives.drawer import DrawerRoot from reflex.components.radix.themes.layout.box import Box from reflex.event import EventHandler, EventSpec +from reflex.ivars.base import ImmutableVar from reflex.state import ComponentState from reflex.style import Style from reflex.vars import Var @@ -50,41 +51,51 @@ class Sidebar(Box, MemoizationLeaf): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Sidebar": @@ -100,7 +111,7 @@ class Sidebar(Box, MemoizationLeaf): ... def add_style(self) -> dict[str, Any] | None: ... - def add_hooks(self) -> List[Var]: ... + def add_hooks(self) -> List[ImmutableVar]: ... class StatefulSidebar(ComponentState): open: bool @@ -135,44 +146,54 @@ class DrawerSidebar(DrawerRoot): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_open_change: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "DrawerSidebar": @@ -206,41 +227,51 @@ class SidebarTrigger(Fragment): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "SidebarTrigger": @@ -291,41 +322,51 @@ class Layout(Box): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Layout": @@ -379,41 +420,51 @@ class LayoutNamespace(ComponentNamespace): id: Optional[Any] = None, class_name: Optional[Any] = None, autofocus: Optional[bool] = None, - custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, - on_blur: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_click: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, + custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None, + on_blur: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_double_click: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_focus: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, - on_mount: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, - on_scroll: Optional[Union[EventHandler, EventSpec, list, Callable, Var]] = None, on_unmount: Optional[ - Union[EventHandler, EventSpec, list, Callable, Var] + Union[EventHandler, EventSpec, list, Callable, ImmutableVar] ] = None, **props, ) -> "Layout": diff --git a/reflex/ivars/base.py b/reflex/ivars/base.py index 50453544de..27c4828afb 100644 --- a/reflex/ivars/base.py +++ b/reflex/ivars/base.py @@ -10,7 +10,6 @@ import inspect import json import sys -import warnings from types import CodeType, FunctionType from typing import ( TYPE_CHECKING, @@ -32,18 +31,21 @@ overload, ) -from typing_extensions import ParamSpec, get_type_hints, override +from typing_extensions import ParamSpec, TypeGuard, deprecated, get_type_hints, override from reflex import constants from reflex.base import Base -from reflex.constants.colors import Color from reflex.utils import console, imports, serializers, types -from reflex.utils.exceptions import VarDependencyError, VarTypeError, VarValueError +from reflex.utils.exceptions import ( + VarAttributeError, + VarDependencyError, + VarTypeError, + VarValueError, +) from reflex.utils.format import format_state_name -from reflex.utils.types import get_origin +from reflex.utils.types import GenericType, get_origin from reflex.vars import ( - ComputedVar, - ImmutableVarData, + REPLACED_NAMES, Var, VarData, _decode_var_immutable, @@ -83,7 +85,7 @@ class ImmutableVar(Var, Generic[VAR_TYPE]): _var_type: types.GenericType = dataclasses.field(default=Any) # Extra metadata associated with the Var - _var_data: Optional[ImmutableVarData] = dataclasses.field(default=None) + _var_data: Optional[VarData] = dataclasses.field(default=None) def __str__(self) -> str: """String representation of the var. Guaranteed to be a valid Javascript expression. @@ -111,15 +113,6 @@ def _var_is_string(self) -> bool: """ return False - @property - def _var_full_name_needs_state_prefix(self) -> bool: - """Whether the full name of the var needs a _var_state prefix. - - Returns: - False - """ - return False - def __post_init__(self): """Post-initialize the var.""" # Decode any inline Var markup and apply it to the instance @@ -129,7 +122,7 @@ def __post_init__(self): self.__init__( _var_name=_var_name, _var_type=self._var_type, - _var_data=ImmutableVarData.merge(self._var_data, _var_data), + _var_data=VarData.merge(self._var_data, _var_data), ) def __hash__(self) -> int: @@ -140,7 +133,7 @@ def __hash__(self) -> int: """ return hash((self._var_name, self._var_type, self._var_data)) - def _get_all_var_data(self) -> ImmutableVarData | None: + def _get_all_var_data(self) -> VarData | None: """Get all VarData associated with the Var. Returns: @@ -148,6 +141,21 @@ def _get_all_var_data(self) -> ImmutableVarData | None: """ return self._var_data + def equals(self, other: ImmutableVar) -> bool: + """Check if two vars are equal. + + Args: + other: The other var to compare. + + Returns: + Whether the vars are equal. + """ + return ( + self._var_name == other._var_name + and self._var_type == other._var_type + and self._get_all_var_data() == other._get_all_var_data() + ) + def _replace(self, merge_var_data=None, **kwargs: Any): """Make a copy of this Var with updated fields. @@ -178,7 +186,7 @@ def _replace(self, merge_var_data=None, **kwargs: Any): return dataclasses.replace( self, - _var_data=ImmutableVarData.merge( + _var_data=VarData.merge( kwargs.get("_var_data", self._var_data), merge_var_data ), **kwargs, @@ -191,7 +199,7 @@ def create( _var_is_local: bool | None = None, _var_is_string: bool | None = None, _var_data: VarData | None = None, - ) -> ImmutableVar | Var | None: + ) -> ImmutableVar | None: """Create a var from a value. Args: @@ -224,7 +232,7 @@ def create( return None # If the value is already a var, do nothing. - if isinstance(value, Var): + if isinstance(value, ImmutableVar): return value # Try to pull the imports and hooks from contained values. @@ -246,15 +254,7 @@ def create( return cls( _var_name=name, _var_type=type_, - _var_data=( - ImmutableVarData( - state=_var_data.state, - imports=_var_data.imports, - hooks=_var_data.hooks, - ) - if _var_data - else None - ), + _var_data=_var_data, ) @classmethod @@ -264,7 +264,7 @@ def create_safe( _var_is_local: bool | None = None, _var_is_string: bool | None = None, _var_data: VarData | None = None, - ) -> Var | ImmutableVar: + ) -> ImmutableVar: """Create a var from a value, asserting that it is not None. Args: @@ -302,13 +302,19 @@ def __format__(self, format_spec: str) -> str: return f"{constants.REFLEX_VAR_OPENING_TAG}{hashed_var}{constants.REFLEX_VAR_CLOSING_TAG}{self._var_name}" @overload - def to( - self, output: Type[NumberVar], var_type: type[int] | type[float] = float - ) -> ToNumberVarOperation: ... + def to(self, output: Type[StringVar]) -> ToStringOperation: ... + + @overload + def to(self, output: Type[str]) -> ToStringOperation: ... @overload def to(self, output: Type[BooleanVar]) -> ToBooleanVarOperation: ... + @overload + def to( + self, output: Type[NumberVar], var_type: type[int] | type[float] = float + ) -> ToNumberVarOperation: ... + @overload def to( self, @@ -316,9 +322,6 @@ def to( var_type: type[list] | type[tuple] | type[set] = list, ) -> ToArrayOperation: ... - @overload - def to(self, output: Type[StringVar]) -> ToStringOperation: ... - @overload def to( self, output: Type[ObjectVar], var_type: types.GenericType = dict @@ -340,7 +343,7 @@ def to( self, output: Type[OUTPUT] | types.GenericType, var_type: types.GenericType | None = None, - ) -> Var: + ) -> ImmutableVar: """Convert the var to a different type. Args: @@ -382,6 +385,11 @@ def to( return self.to(StringVar, output) if fixed_output_type is bool: return self.to(BooleanVar, output) + if fixed_output_type is None: + return ToNoneOperation.create(self) + + if issubclass(output, BooleanVar): + return ToBooleanVarOperation.create(self) if issubclass(output, NumberVar): if fixed_type is not None: @@ -398,9 +406,6 @@ def to( ) return ToNumberVarOperation.create(self, var_type or float) - if issubclass(output, BooleanVar): - return ToBooleanVarOperation.create(self) - if issubclass(output, ArrayVar): if fixed_type is not None and not issubclass( fixed_type, (list, tuple, set) @@ -423,6 +428,9 @@ def to( # ) return ToFunctionOperation.create(self, var_type or Callable) + if issubclass(output, NoneVar): + return ToNoneOperation.create(self) + # If we can't determine the first argument, we just replace the _var_type. if not issubclass(output, Var) or var_type is None: return dataclasses.replace( @@ -453,6 +461,8 @@ def guess_type(self) -> ImmutableVar: from .sequence import ArrayVar, StringVar var_type = self._var_type + if var_type is None: + return self.to(None) if types.is_optional(var_type): var_type = types.get_args(var_type)[0] @@ -463,8 +473,15 @@ def guess_type(self) -> ImmutableVar: if fixed_type is Union: inner_types = get_args(var_type) - if int in inner_types and float in inner_types: + + if all( + inspect.isclass(t) and issubclass(t, (int, float)) for t in inner_types + ): return self.to(NumberVar, self._var_type) + + if all(inspect.isclass(t) and issubclass(t, Base) for t in inner_types): + return self.to(ObjectVar, self._var_type) + return self if not inspect.isclass(fixed_type): @@ -538,11 +555,12 @@ def get_setter_name(self, include_state: bool = True) -> str: """ var_name_parts = self._var_name.split(".") setter = constants.SETTER_PREFIX + var_name_parts[-1] - if self._var_data is None: + var_data = self._get_all_var_data() + if var_data is None: return setter - if not include_state or self._var_data.state == "": + if not include_state or var_data.state == "": return setter - return ".".join((self._var_data.state, setter)) + return ".".join((var_data.state, setter)) def get_setter(self) -> Callable[[BaseState, Any], None]: """Get the var's setter function. @@ -574,11 +592,32 @@ def setter(state: BaseState, value: Any): return setter - def __eq__(self, other: Var | Any) -> BooleanVar: + def _var_set_state(self, state: type[BaseState] | str): + """Set the state of the var. + + Args: + state: The state to set. + + Returns: + The var with the state set. + """ + formatted_state_name = ( + state + if isinstance(state, str) + else format_state_name(state.get_full_name()) + ) + + return StateOperation.create( + formatted_state_name, + self, + _var_data=VarData.merge(VarData.from_state(state), self._var_data), + ).guess_type() + + def __eq__(self, other: ImmutableVar | Any) -> BooleanVar: """Check if the current variable is equal to the given variable. Args: - other (Var | Any): The variable to compare with. + other (ImmutableVar | Any): The variable to compare with. Returns: BooleanVar: A BooleanVar object representing the result of the equality check. @@ -587,11 +626,11 @@ def __eq__(self, other: Var | Any) -> BooleanVar: return equal_operation(self, other) - def __ne__(self, other: Var | Any) -> BooleanVar: + def __ne__(self, other: ImmutableVar | Any) -> BooleanVar: """Check if the current object is not equal to the given object. Parameters: - other (Var | Any): The object to compare with. + other (ImmutableVar | Any): The object to compare with. Returns: BooleanVar: A BooleanVar object representing the result of the comparison. @@ -600,58 +639,6 @@ def __ne__(self, other: Var | Any) -> BooleanVar: return ~equal_operation(self, other) - def __gt__(self, other: Var | Any) -> BooleanVar: - """Compare the current instance with another variable and return a BooleanVar representing the result of the greater than operation. - - Args: - other (Var | Any): The variable to compare with. - - Returns: - BooleanVar: A BooleanVar representing the result of the greater than operation. - """ - from .number import greater_than_operation - - return greater_than_operation(self, other) - - def __ge__(self, other: Var | Any) -> BooleanVar: - """Check if the value of this variable is greater than or equal to the value of another variable or object. - - Args: - other (Var | Any): The variable or object to compare with. - - Returns: - BooleanVar: A BooleanVar object representing the result of the comparison. - """ - from .number import greater_than_or_equal_operation - - return greater_than_or_equal_operation(self, other) - - def __lt__(self, other: Var | Any) -> BooleanVar: - """Compare the current instance with another variable using the less than (<) operator. - - Args: - other: The variable to compare with. - - Returns: - A `BooleanVar` object representing the result of the comparison. - """ - from .number import less_than_operation - - return less_than_operation(self, other) - - def __le__(self, other: Var | Any) -> BooleanVar: - """Compare if the current instance is less than or equal to the given value. - - Args: - other: The value to compare with. - - Returns: - A BooleanVar object representing the result of the comparison. - """ - from .number import less_than_or_equal_operation - - return less_than_or_equal_operation(self, other) - def bool(self) -> BooleanVar: """Convert the var to a boolean. @@ -662,7 +649,7 @@ def bool(self) -> BooleanVar: return boolify(self) - def __and__(self, other: Var | Any) -> ImmutableVar: + def __and__(self, other: ImmutableVar | Any) -> ImmutableVar: """Perform a logical AND operation on the current instance and another variable. Args: @@ -673,7 +660,7 @@ def __and__(self, other: Var | Any) -> ImmutableVar: """ return and_operation(self, other) - def __rand__(self, other: Var | Any) -> ImmutableVar: + def __rand__(self, other: ImmutableVar | Any) -> ImmutableVar: """Perform a logical AND operation on the current instance and another variable. Args: @@ -684,7 +671,7 @@ def __rand__(self, other: Var | Any) -> ImmutableVar: """ return and_operation(other, self) - def __or__(self, other: Var | Any) -> ImmutableVar: + def __or__(self, other: ImmutableVar | Any) -> ImmutableVar: """Perform a logical OR operation on the current instance and another variable. Args: @@ -695,7 +682,7 @@ def __or__(self, other: Var | Any) -> ImmutableVar: """ return or_operation(self, other) - def __ror__(self, other: Var | Any) -> ImmutableVar: + def __ror__(self, other: ImmutableVar | Any) -> ImmutableVar: """Perform a logical OR operation on the current instance and another variable. Args: @@ -714,7 +701,7 @@ def __invert__(self) -> BooleanVar: """ return ~self.bool() - def to_string(self) -> ImmutableVar: + def to_string(self): """Convert the var to a string. Returns: @@ -735,7 +722,7 @@ def as_ref(self) -> ImmutableVar: refs = ImmutableVar( _var_name="refs", - _var_data=ImmutableVarData( + _var_data=VarData( imports={ f"/{constants.Dirs.STATE_PATH}": [imports.ImportVar(tag="refs")] } @@ -743,12 +730,24 @@ def as_ref(self) -> ImmutableVar: ).to(ObjectVar) return refs[LiteralVar.create(str(self))] + @deprecated("Use `.js_type()` instead.") def _type(self) -> StringVar: """Returns the type of the object. This method uses the `typeof` function from the `FunctionStringVar` class to determine the type of the object. + Returns: + StringVar: A string variable representing the type of the object. + """ + return self.js_type() + + def js_type(self) -> StringVar: + """Returns the javascript type of the object. + + This method uses the `typeof` function from the `FunctionStringVar` class + to determine the type of the object. + Returns: StringVar: A string variable representing the type of the object. """ @@ -758,10 +757,125 @@ def _type(self) -> StringVar: type_of = FunctionStringVar("typeof") return type_of.call(self).to(StringVar) + def without_data(self): + """Create a copy of the var without the data. + + Returns: + The var without the data. + """ + return dataclasses.replace(self, _var_data=None) + + def contains(self, value: Any = None, field: Any = None): + """Get an attribute of the var. + + Args: + value: The value to check for. + field: The field to check for. + + Raises: + TypeError: If the var does not support contains check. + """ + raise TypeError( + f"Var of type {self._var_type} does not support contains check." + ) + + def __get__(self, instance: Any, owner: Any): + """Get the var. + + Args: + instance: The instance to get the var from. + owner: The owner of the var. + + Returns: + The var. + """ + return self + + def reverse(self): + """Reverse the var. + + Raises: + TypeError: If the var does not support reverse. + """ + raise TypeError("Cannot reverse non-list var.") + + def __getattr__(self, name: str): + """Get an attribute of the var. + + Args: + name: The name of the attribute. + + Returns: + The attribute. + + Raises: + VarAttributeError: If the attribute does not exist. + TypeError: If the var type is Any. + """ + if name.startswith("_"): + return super(ImmutableVar, self).__getattribute__(name) + if self._var_type is Any: + raise TypeError( + f"You must provide an annotation for the state var `{str(self)}`. Annotation cannot be `{self._var_type}`." + ) + + if name in REPLACED_NAMES: + raise VarAttributeError( + f"Field {name!r} was renamed to {REPLACED_NAMES[name]!r}" + ) + + raise VarAttributeError( + f"The State var has no attribute '{name}' or may have been annotated wrongly.", + ) + + def _decode(self) -> Any: + """Decode Var as a python value. + + Note that Var with state set cannot be decoded python-side and will be + returned as full_name. + + Returns: + The decoded value or the Var name. + """ + if isinstance(self, LiteralVar): + return self._var_value # type: ignore + try: + return json.loads(str(self)) + except ValueError: + try: + return json.loads(self.json()) + except (ValueError, NotImplementedError): + return str(self) + + @property + def _var_state(self) -> str: + """Compat method for getting the state. + + Returns: + The state name associated with the var. + """ + var_data = self._get_all_var_data() + return var_data.state if var_data else "" + OUTPUT = TypeVar("OUTPUT", bound=ImmutableVar) +def _encode_var(value: ImmutableVar) -> str: + """Encode the state name into a formatted var. + + Args: + value: The value to encode the state name into. + + Returns: + The encoded var. + """ + return f"{value}" + + +serializers.serializer(_encode_var) + + class LiteralVar(ImmutableVar): """Base class for immutable literal vars.""" @@ -770,7 +884,7 @@ def create( cls, value: Any, _var_data: VarData | None = None, - ) -> Var: + ) -> ImmutableVar: """Create a var from a value. Args: @@ -787,7 +901,7 @@ def create( from .object import LiteralObjectVar from .sequence import LiteralArrayVar, LiteralStringVar - if isinstance(value, Var): + if isinstance(value, ImmutableVar): if _var_data is None: return value return value._replace(merge_var_data=_var_data) @@ -804,14 +918,11 @@ def create( if isinstance(value, dict): return LiteralObjectVar.create(value, _var_data=_var_data) - if isinstance(value, Color): - return LiteralStringVar.create(f"{value}", _var_data=_var_data) - if isinstance(value, (list, tuple, set)): return LiteralArrayVar.create(value, _var_data=_var_data) if value is None: - return ImmutableVar.create_safe("null", _var_data=_var_data) + return LiteralNoneVar.create(_var_data=_var_data) from reflex.event import EventChain, EventSpec from reflex.utils.format import get_event_handler_parts @@ -857,60 +968,6 @@ def create( ), ) - try: - from plotly.graph_objects import Figure, layout - from plotly.io import to_json - - if isinstance(value, Figure): - return LiteralObjectVar.create( - json.loads(str(to_json(value))), - _var_type=Figure, - _var_data=_var_data, - ) - - if isinstance(value, layout.Template): - return LiteralObjectVar.create( - { - "data": json.loads(str(to_json(value.data))), - "layout": json.loads(str(to_json(value.layout))), - }, - _var_type=layout.Template, - _var_data=_var_data, - ) - except ImportError: - pass - - try: - import base64 - import io - - from PIL.Image import MIME - from PIL.Image import Image as Img - - if isinstance(value, Img): - with io.BytesIO() as buffer: - image_format = getattr(value, "format", None) or "PNG" - value.save(buffer, format=image_format) - try: - # Newer method to get the mime type, but does not always work. - mimetype = value.get_format_mimetype() # type: ignore - except AttributeError: - try: - # Fallback method - mimetype = MIME[image_format] - except KeyError: - # Unknown mime_type: warn and return image/png and hope the browser can sort it out. - warnings.warn( # noqa: B028 - f"Unknown mime type for {value} {image_format}. Defaulting to image/png" - ) - mimetype = "image/png" - return LiteralStringVar.create( - f"data:{mimetype};base64,{base64.b64encode(buffer.getvalue()).decode()}", - _var_data=_var_data, - ) - except ImportError: - pass - if isinstance(value, Base): return LiteralObjectVar.create( {k: (None if callable(v) else v) for k, v in value.dict().items()}, @@ -918,6 +975,16 @@ def create( _var_data=_var_data, ) + serialized_value = serializers.serialize(value) + if serialized_value is not None: + if isinstance(serialized_value, dict): + return LiteralObjectVar.create( + serialized_value, + _var_type=type(value), + _var_data=_var_data, + ) + return LiteralVar.create(serialized_value, _var_data=_var_data) + raise TypeError( f"Unsupported type {type(value)} for LiteralVar. Tried to create a LiteralVar from {value}." ) @@ -1009,11 +1076,15 @@ def add(a: NumberVar, b: NumberVar): def wrapper(*args: P.args, **kwargs: P.kwargs) -> ImmutableVar[T]: func_args = list(inspect.signature(func).parameters) args_vars = { - func_args[i]: (LiteralVar.create(arg) if not isinstance(arg, Var) else arg) + func_args[i]: ( + LiteralVar.create(arg) if not isinstance(arg, ImmutableVar) else arg + ) for i, arg in enumerate(args) } kwargs_vars = { - key: LiteralVar.create(value) if not isinstance(value, Var) else value + key: LiteralVar.create(value) + if not isinstance(value, ImmutableVar) + else value for key, value in kwargs.items() } @@ -1062,7 +1133,7 @@ def figure_out_type(value: Any) -> types.GenericType: unionize(*(figure_out_type(k) for k in value)), unionize(*(figure_out_type(v) for v in value.values())), ] - if isinstance(value, Var): + if isinstance(value, ImmutableVar): return value._var_type return type(value) @@ -1101,11 +1172,11 @@ def __getattr__(self, name: str) -> Any: parent_classes = inspect.getmro(self.__class__) - return parent_classes[parent_classes.index(CachedVarOperation) + 1].__getattr__( # type: ignore - self, name - ) + next_class = parent_classes[parent_classes.index(CachedVarOperation) + 1] + + return next_class.__getattr__(self, name) # type: ignore - def _get_all_var_data(self) -> ImmutableVarData | None: + def _get_all_var_data(self) -> VarData | None: """Get all VarData associated with the Var. Returns: @@ -1114,16 +1185,18 @@ def _get_all_var_data(self) -> ImmutableVarData | None: return self._cached_get_all_var_data @cached_property_no_lock - def _cached_get_all_var_data(self) -> ImmutableVarData | None: + def _cached_get_all_var_data(self) -> VarData | None: """Get the cached VarData. Returns: The cached VarData. """ - return ImmutableVarData.merge( + return VarData.merge( *map( lambda value: ( - value._get_all_var_data() if isinstance(value, Var) else None + value._get_all_var_data() + if isinstance(value, ImmutableVar) + else None ), map( lambda field: getattr(self, field.name), @@ -1151,7 +1224,7 @@ def __hash__(self) -> int: ) -def and_operation(a: Var | Any, b: Var | Any) -> ImmutableVar: +def and_operation(a: ImmutableVar | Any, b: ImmutableVar | Any) -> ImmutableVar: """Perform a logical AND operation on two variables. Args: @@ -1181,7 +1254,7 @@ def _and_operation(a: ImmutableVar, b: ImmutableVar): ) -def or_operation(a: Var | Any, b: Var | Any) -> ImmutableVar: +def or_operation(a: ImmutableVar | Any, b: ImmutableVar | Any) -> ImmutableVar: """Perform a logical OR operation on two variables. Args: @@ -1223,14 +1296,14 @@ class ImmutableCallableVar(ImmutableVar): API with functions that return a family of Var. """ - fn: Callable[..., Var] = dataclasses.field( + fn: Callable[..., ImmutableVar] = dataclasses.field( default_factory=lambda: lambda: ImmutableVar(_var_name="undefined") ) - original_var: Var = dataclasses.field( + original_var: ImmutableVar = dataclasses.field( default_factory=lambda: ImmutableVar(_var_name="undefined") ) - def __init__(self, fn: Callable[..., Var]): + def __init__(self, fn: Callable[..., ImmutableVar]): """Initialize a CallableVar. Args: @@ -1240,12 +1313,12 @@ def __init__(self, fn: Callable[..., Var]): super(ImmutableCallableVar, self).__init__( _var_name=original_var._var_name, _var_type=original_var._var_type, - _var_data=ImmutableVarData.merge(original_var._get_all_var_data()), + _var_data=VarData.merge(original_var._get_all_var_data()), ) object.__setattr__(self, "fn", fn) object.__setattr__(self, "original_var", original_var) - def __call__(self, *args, **kwargs) -> Var: + def __call__(self, *args, **kwargs) -> ImmutableVar: """Call the decorated function. Args: @@ -1274,6 +1347,24 @@ def __hash__(self) -> int: LIST_INSIDE = TypeVar("LIST_INSIDE") +class FakeComputedVarBaseClass(Var, property): + """A fake base class for ComputedVar to avoid inheriting from property.""" + + __pydantic_run_validation__ = False + + +def is_computed_var(obj: Any) -> TypeGuard[ImmutableComputedVar]: + """Check if the object is a ComputedVar. + + Args: + obj: The object to check. + + Returns: + Whether the object is a ComputedVar. + """ + return isinstance(obj, FakeComputedVarBaseClass) + + @dataclasses.dataclass( eq=False, frozen=True, @@ -1309,7 +1400,7 @@ def __init__( fget: Callable[[BASE_STATE], RETURN_TYPE], initial_value: RETURN_TYPE | types.Unset = types.Unset(), cache: bool = False, - deps: Optional[List[Union[str, Var]]] = None, + deps: Optional[List[Union[str, ImmutableVar]]] = None, auto_deps: bool = True, interval: Optional[Union[int, datetime.timedelta]] = None, backend: bool | None = None, @@ -1336,10 +1427,11 @@ def __init__( kwargs["_var_name"] = kwargs.pop("_var_name", fget.__name__) kwargs["_var_type"] = kwargs.pop("_var_type", hint) - super(ImmutableComputedVar, self).__init__( + ImmutableVar.__init__( + self, _var_name=kwargs.pop("_var_name"), _var_type=kwargs.pop("_var_type"), - _var_data=ImmutableVarData.merge(kwargs.pop("_var_data", None)), + _var_data=kwargs.pop("_var_data", None), ) if backend is None: @@ -1358,7 +1450,7 @@ def __init__( deps = [] else: for dep in deps: - if isinstance(dep, Var): + if isinstance(dep, ImmutableVar): continue if isinstance(dep, str) and dep != "": continue @@ -1368,7 +1460,7 @@ def __init__( object.__setattr__( self, "_static_deps", - {dep._var_name if isinstance(dep, Var) else dep for dep in deps}, + {dep._var_name if isinstance(dep, ImmutableVar) else dep for dep in deps}, ) object.__setattr__(self, "_auto_deps", auto_deps) @@ -1514,7 +1606,7 @@ def __get__(self, instance: BaseState | None, owner): _var_name=format_state_name(state_where_defined.get_full_name()) + "." + self._var_name, - merge_var_data=ImmutableVarData.from_state(state_where_defined), + merge_var_data=VarData.from_state(state_where_defined), ).guess_type() if not self._cache: @@ -1601,7 +1693,7 @@ def _deps( ref_obj = None if instruction.argval in invalid_names: raise VarValueError( - f"Cached var {self._var_full_name} cannot access arbitrary state via `{instruction.argval}`." + f"Cached var {str(self)} cannot access arbitrary state via `{instruction.argval}`." ) if callable(ref_obj): # recurse into callable attributes @@ -1669,7 +1761,7 @@ def __class__(self) -> Type: Returns: The class of the var. """ - return ComputedVar + return FakeComputedVarBaseClass @property def fget(self) -> Callable[[BaseState], RETURN_TYPE]: @@ -1690,7 +1782,7 @@ def immutable_computed_var( fget: None = None, initial_value: Any | types.Unset = types.Unset(), cache: bool = False, - deps: Optional[List[Union[str, Var]]] = None, + deps: Optional[List[Union[str, ImmutableVar]]] = None, auto_deps: bool = True, interval: Optional[Union[datetime.timedelta, int]] = None, backend: bool | None = None, @@ -1705,7 +1797,7 @@ def immutable_computed_var( fget: Callable[[BASE_STATE], RETURN_TYPE], initial_value: RETURN_TYPE | types.Unset = types.Unset(), cache: bool = False, - deps: Optional[List[Union[str, Var]]] = None, + deps: Optional[List[Union[str, ImmutableVar]]] = None, auto_deps: bool = True, interval: Optional[Union[datetime.timedelta, int]] = None, backend: bool | None = None, @@ -1717,7 +1809,7 @@ def immutable_computed_var( fget: Callable[[BASE_STATE], Any] | None = None, initial_value: Any | types.Unset = types.Unset(), cache: bool = False, - deps: Optional[List[Union[str, Var]]] = None, + deps: Optional[List[Union[str, ImmutableVar]]] = None, auto_deps: bool = True, interval: Optional[Union[datetime.timedelta, int]] = None, backend: bool | None = None, @@ -1794,7 +1886,7 @@ def create( return CustomVarOperationReturn( _var_name=js_expression, _var_type=_var_type or Any, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, ) @@ -1822,7 +1914,9 @@ def var_operation_return( class CustomVarOperation(CachedVarOperation, ImmutableVar[T]): """Base class for custom var operations.""" - _args: Tuple[Tuple[str, Var], ...] = dataclasses.field(default_factory=tuple) + _args: Tuple[Tuple[str, ImmutableVar], ...] = dataclasses.field( + default_factory=tuple + ) _return: CustomVarOperationReturn[T] = dataclasses.field( default_factory=lambda: CustomVarOperationReturn.create("") @@ -1838,13 +1932,13 @@ def _cached_var_name(self) -> str: return str(self._return) @cached_property_no_lock - def _cached_get_all_var_data(self) -> ImmutableVarData | None: + def _cached_get_all_var_data(self) -> VarData | None: """Get the cached VarData. Returns: The cached VarData. """ - return ImmutableVarData.merge( + return VarData.merge( *map( lambda arg: arg[1]._get_all_var_data(), self._args, @@ -1856,7 +1950,7 @@ def _cached_get_all_var_data(self) -> ImmutableVarData | None: @classmethod def create( cls, - args: Tuple[Tuple[str, Var], ...], + args: Tuple[Tuple[str, ImmutableVar], ...], return_var: CustomVarOperationReturn[T], _var_data: VarData | None = None, ) -> CustomVarOperation[T]: @@ -1873,7 +1967,208 @@ def create( return CustomVarOperation( _var_name="", _var_type=return_var._var_type, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _args=args, _return=return_var, ) + + +class NoneVar(ImmutableVar[None]): + """A var representing None.""" + + +class LiteralNoneVar(LiteralVar, NoneVar): + """A var representing None.""" + + def json(self) -> str: + """Serialize the var to a JSON string. + + Returns: + The JSON string. + """ + return "null" + + @classmethod + def create( + cls, + _var_data: VarData | None = None, + ) -> LiteralNoneVar: + """Create a var from a value. + + Args: + _var_data: Additional hooks and imports associated with the Var. + + Returns: + The var. + """ + return LiteralNoneVar( + _var_name="null", + _var_type=None, + _var_data=_var_data, + ) + + +@dataclasses.dataclass( + eq=False, + frozen=True, + **{"slots": True} if sys.version_info >= (3, 10) else {}, +) +class ToNoneOperation(CachedVarOperation, NoneVar): + """A var operation that converts a var to None.""" + + _original_var: Var = dataclasses.field( + default_factory=lambda: LiteralNoneVar.create() + ) + + @cached_property_no_lock + def _cached_var_name(self) -> str: + """Get the cached var name. + + Returns: + The cached var name. + """ + return str(self._original_var) + + @classmethod + def create( + cls, + var: Var, + _var_data: VarData | None = None, + ) -> ToNoneOperation: + """Create a ToNoneOperation. + + Args: + var: The var to convert to None. + _var_data: Additional hooks and imports associated with the Var. + + Returns: + The ToNoneOperation. + """ + return ToNoneOperation( + _var_name="", + _var_type=None, + _var_data=_var_data, + _original_var=var, + ) + + +@dataclasses.dataclass( + eq=False, + frozen=True, + **{"slots": True} if sys.version_info >= (3, 10) else {}, +) +class StateOperation(CachedVarOperation, ImmutableVar): + """A var operation that accesses a field on an object.""" + + _state_name: str = dataclasses.field(default="") + _field: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) + + @cached_property_no_lock + def _cached_var_name(self) -> str: + """Get the cached var name. + + Returns: + The cached var name. + """ + return f"{str(self._state_name)}.{str(self._field)}" + + def __getattr__(self, name: str) -> Any: + """Get an attribute of the var. + + Args: + name: The name of the attribute. + + Returns: + The attribute. + """ + if name == "_var_name": + return self._cached_var_name + + return getattr(self._field, name) + + @classmethod + def create( + cls, + state_name: str, + field: ImmutableVar, + _var_data: VarData | None = None, + ) -> StateOperation: + """Create a DotOperation. + + Args: + state_name: The name of the state. + field: The field of the state. + _var_data: Additional hooks and imports associated with the Var. + + Returns: + The DotOperation. + """ + return StateOperation( + _var_name="", + _var_type=field._var_type, + _var_data=_var_data, + _state_name=state_name, + _field=field, + ) + + +class ToOperation: + """A var operation that converts a var to another type.""" + + def __getattr__(self, name: str) -> Any: + """Get an attribute of the var. + + Args: + name: The name of the attribute. + + Returns: + The attribute of the var. + """ + return getattr(object.__getattribute__(self, "_original"), name) + + def __post_init__(self): + """Post initialization.""" + object.__delattr__(self, "_var_name") + + def __hash__(self) -> int: + """Calculate the hash value of the object. + + Returns: + int: The hash value of the object. + """ + return hash(object.__getattribute__(self, "_original")) + + def _get_all_var_data(self) -> VarData | None: + """Get all the var data. + + Returns: + The var data. + """ + return VarData.merge( + object.__getattribute__(self, "_original")._get_all_var_data(), + self._var_data, # type: ignore + ) + + @classmethod + def create( + cls, + value: Var, + _var_type: GenericType | None = None, + _var_data: VarData | None = None, + ): + """Create a ToOperation. + + Args: + value: The value of the var. + _var_type: The type of the Var. + _var_data: Additional hooks and imports associated with the Var. + + Returns: + The ToOperation. + """ + return cls( + _var_name="", # type: ignore + _var_data=_var_data, # type: ignore + _var_type=_var_type or cls._default_var_type, # type: ignore + _original=value, # type: ignore + ) diff --git a/reflex/ivars/function.py b/reflex/ivars/function.py index 1a987b1cfd..4fec96b702 100644 --- a/reflex/ivars/function.py +++ b/reflex/ivars/function.py @@ -4,18 +4,24 @@ import dataclasses import sys -from typing import Any, Callable, Optional, Tuple, Type, Union +from typing import Any, Callable, ClassVar, Optional, Tuple, Type, Union from reflex.utils.types import GenericType -from reflex.vars import ImmutableVarData, Var, VarData - -from .base import CachedVarOperation, ImmutableVar, LiteralVar, cached_property_no_lock +from reflex.vars import VarData + +from .base import ( + CachedVarOperation, + ImmutableVar, + LiteralVar, + ToOperation, + cached_property_no_lock, +) class FunctionVar(ImmutableVar[Callable]): """Base class for immutable function vars.""" - def __call__(self, *args: Var | Any) -> ArgsFunctionOperation: + def __call__(self, *args: ImmutableVar | Any) -> ArgsFunctionOperation: """Call the function with the given arguments. Args: @@ -29,7 +35,7 @@ def __call__(self, *args: Var | Any) -> ArgsFunctionOperation: VarOperationCall.create(self, *args, ImmutableVar.create_safe("...args")), ) - def call(self, *args: Var | Any) -> VarOperationCall: + def call(self, *args: ImmutableVar | Any) -> VarOperationCall: """Call the function with the given arguments. Args: @@ -63,7 +69,7 @@ def create( return cls( _var_name=func, _var_type=_var_type, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, ) @@ -76,7 +82,9 @@ class VarOperationCall(CachedVarOperation, ImmutableVar): """Base class for immutable vars that are the result of a function call.""" _func: Optional[FunctionVar] = dataclasses.field(default=None) - _args: Tuple[Union[Var, Any], ...] = dataclasses.field(default_factory=tuple) + _args: Tuple[Union[ImmutableVar, Any], ...] = dataclasses.field( + default_factory=tuple + ) @cached_property_no_lock def _cached_var_name(self) -> str: @@ -88,13 +96,13 @@ def _cached_var_name(self) -> str: return f"({str(self._func)}({', '.join([str(LiteralVar.create(arg)) for arg in self._args])}))" @cached_property_no_lock - def _cached_get_all_var_data(self) -> ImmutableVarData | None: + def _cached_get_all_var_data(self) -> VarData | None: """Get all the var data associated with the var. Returns: All the var data associated with the var. """ - return ImmutableVarData.merge( + return VarData.merge( self._func._get_all_var_data() if self._func is not None else None, *[LiteralVar.create(arg)._get_all_var_data() for arg in self._args], self._var_data, @@ -104,7 +112,7 @@ def _cached_get_all_var_data(self) -> ImmutableVarData | None: def create( cls, func: FunctionVar, - *args: Var | Any, + *args: ImmutableVar | Any, _var_type: GenericType = Any, _var_data: VarData | None = None, ) -> VarOperationCall: @@ -121,7 +129,7 @@ def create( return cls( _var_name="", _var_type=_var_type, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _func=func, _args=args, ) @@ -136,7 +144,7 @@ class ArgsFunctionOperation(CachedVarOperation, FunctionVar): """Base class for immutable function defined via arguments and return expression.""" _args_names: Tuple[str, ...] = dataclasses.field(default_factory=tuple) - _return_expr: Union[Var, Any] = dataclasses.field(default=None) + _return_expr: Union[ImmutableVar, Any] = dataclasses.field(default=None) @cached_property_no_lock def _cached_var_name(self) -> str: @@ -151,7 +159,7 @@ def _cached_var_name(self) -> str: def create( cls, args_names: Tuple[str, ...], - return_expr: Var | Any, + return_expr: ImmutableVar | Any, _var_type: GenericType = Callable, _var_data: VarData | None = None, ) -> ArgsFunctionOperation: @@ -168,7 +176,7 @@ def create( return cls( _var_name="", _var_type=_var_type, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _args_names=args_names, _return_expr=return_expr, ) @@ -179,45 +187,14 @@ def create( frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ToFunctionOperation(CachedVarOperation, FunctionVar): +class ToFunctionOperation(ToOperation, FunctionVar): """Base class of converting a var to a function.""" - _original_var: Var = dataclasses.field( + _original: ImmutableVar = dataclasses.field( default_factory=lambda: LiteralVar.create(None) ) - @cached_property_no_lock - def _cached_var_name(self) -> str: - """The name of the var. - - Returns: - The name of the var. - """ - return str(self._original_var) - - @classmethod - def create( - cls, - original_var: Var, - _var_type: GenericType = Callable, - _var_data: VarData | None = None, - ) -> ToFunctionOperation: - """Create a new function var. - - Args: - original_var: The original var to convert to a function. - _var_type: The type of the function. - _var_data: Additional hooks and imports associated with the Var. - - Returns: - The function var. - """ - return cls( - _var_name="", - _var_type=_var_type, - _var_data=ImmutableVarData.merge(_var_data), - _original_var=original_var, - ) + _default_var_type: ClassVar[GenericType] = Callable JSON_STRINGIFY = FunctionStringVar.create("JSON.stringify") diff --git a/reflex/ivars/number.py b/reflex/ivars/number.py index 68c856d180..764aa9e249 100644 --- a/reflex/ivars/number.py +++ b/reflex/ivars/number.py @@ -5,28 +5,65 @@ import dataclasses import json import sys -from typing import Any, Callable, TypeVar, Union +from typing import ( + TYPE_CHECKING, + Any, + Callable, + ClassVar, + NoReturn, + Type, + TypeVar, + Union, + overload, +) -from reflex.vars import ImmutableVarData, Var, VarData +from reflex.utils.exceptions import VarTypeError +from reflex.vars import Var, VarData from .base import ( - CachedVarOperation, CustomVarOperationReturn, ImmutableVar, + LiteralNoneVar, LiteralVar, - cached_property_no_lock, + ToOperation, unionize, var_operation, var_operation_return, ) -NUMBER_T = TypeVar("NUMBER_T", int, float, Union[int, float]) +NUMBER_T = TypeVar("NUMBER_T", int, float, Union[int, float], bool) + +if TYPE_CHECKING: + from .sequence import ArrayVar + + +def raise_unsupported_operand_types( + operator: str, operands_types: tuple[type, ...] +) -> NoReturn: + """Raise an unsupported operand types error. + + Args: + operator: The operator. + operands_types: The types of the operands. + + Raises: + VarTypeError: The operand types are unsupported. + """ + raise VarTypeError( + f"Unsupported Operand type(s) for {operator}: {', '.join(map(lambda t: t.__name__, operands_types))}" + ) class NumberVar(ImmutableVar[NUMBER_T]): """Base class for immutable number vars.""" - def __add__(self, other: number_types | boolean_types): + @overload + def __add__(self, other: number_types) -> NumberVar: ... + + @overload + def __add__(self, other: NoReturn) -> NoReturn: ... + + def __add__(self, other: Any): """Add two numbers. Args: @@ -35,9 +72,17 @@ def __add__(self, other: number_types | boolean_types): Returns: The number addition operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("+", (type(self), type(other))) return number_add_operation(self, +other) - def __radd__(self, other: number_types | boolean_types): + @overload + def __radd__(self, other: number_types) -> NumberVar: ... + + @overload + def __radd__(self, other: NoReturn) -> NoReturn: ... + + def __radd__(self, other: Any): """Add two numbers. Args: @@ -46,9 +91,17 @@ def __radd__(self, other: number_types | boolean_types): Returns: The number addition operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("+", (type(other), type(self))) return number_add_operation(+other, self) - def __sub__(self, other: number_types | boolean_types): + @overload + def __sub__(self, other: number_types) -> NumberVar: ... + + @overload + def __sub__(self, other: NoReturn) -> NoReturn: ... + + def __sub__(self, other: Any): """Subtract two numbers. Args: @@ -57,9 +110,18 @@ def __sub__(self, other: number_types | boolean_types): Returns: The number subtraction operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("-", (type(self), type(other))) + return number_subtract_operation(self, +other) - def __rsub__(self, other: number_types | boolean_types): + @overload + def __rsub__(self, other: number_types) -> NumberVar: ... + + @overload + def __rsub__(self, other: NoReturn) -> NoReturn: ... + + def __rsub__(self, other: Any): """Subtract two numbers. Args: @@ -68,6 +130,9 @@ def __rsub__(self, other: number_types | boolean_types): Returns: The number subtraction operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("-", (type(other), type(self))) + return number_subtract_operation(+other, self) def __abs__(self): @@ -78,7 +143,13 @@ def __abs__(self): """ return number_abs_operation(self) - def __mul__(self, other: number_types | boolean_types): + @overload + def __mul__(self, other: number_types | boolean_types) -> NumberVar: ... + + @overload + def __mul__(self, other: list | tuple | set | ArrayVar) -> ArrayVar: ... + + def __mul__(self, other: Any): """Multiply two numbers. Args: @@ -87,9 +158,25 @@ def __mul__(self, other: number_types | boolean_types): Returns: The number multiplication operation. """ + from .sequence import ArrayVar, LiteralArrayVar + + if isinstance(other, (list, tuple, set, ArrayVar)): + if isinstance(other, ArrayVar): + return other * self + return LiteralArrayVar.create(other) * self + + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("*", (type(self), type(other))) + return number_multiply_operation(self, +other) - def __rmul__(self, other: number_types | boolean_types): + @overload + def __rmul__(self, other: number_types | boolean_types) -> NumberVar: ... + + @overload + def __rmul__(self, other: list | tuple | set | ArrayVar) -> ArrayVar: ... + + def __rmul__(self, other: Any): """Multiply two numbers. Args: @@ -98,9 +185,25 @@ def __rmul__(self, other: number_types | boolean_types): Returns: The number multiplication operation. """ + from .sequence import ArrayVar, LiteralArrayVar + + if isinstance(other, (list, tuple, set, ArrayVar)): + if isinstance(other, ArrayVar): + return other * self + return LiteralArrayVar.create(other) * self + + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("*", (type(other), type(self))) + return number_multiply_operation(+other, self) - def __truediv__(self, other: number_types | boolean_types): + @overload + def __truediv__(self, other: number_types) -> NumberVar: ... + + @overload + def __truediv__(self, other: NoReturn) -> NoReturn: ... + + def __truediv__(self, other: Any): """Divide two numbers. Args: @@ -109,9 +212,18 @@ def __truediv__(self, other: number_types | boolean_types): Returns: The number true division operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("/", (type(self), type(other))) + return number_true_division_operation(self, +other) - def __rtruediv__(self, other: number_types | boolean_types): + @overload + def __rtruediv__(self, other: number_types) -> NumberVar: ... + + @overload + def __rtruediv__(self, other: NoReturn) -> NoReturn: ... + + def __rtruediv__(self, other: Any): """Divide two numbers. Args: @@ -120,9 +232,18 @@ def __rtruediv__(self, other: number_types | boolean_types): Returns: The number true division operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("/", (type(other), type(self))) + return number_true_division_operation(+other, self) - def __floordiv__(self, other: number_types | boolean_types): + @overload + def __floordiv__(self, other: number_types) -> NumberVar: ... + + @overload + def __floordiv__(self, other: NoReturn) -> NoReturn: ... + + def __floordiv__(self, other: Any): """Floor divide two numbers. Args: @@ -131,9 +252,18 @@ def __floordiv__(self, other: number_types | boolean_types): Returns: The number floor division operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("//", (type(self), type(other))) + return number_floor_division_operation(self, +other) - def __rfloordiv__(self, other: number_types | boolean_types): + @overload + def __rfloordiv__(self, other: number_types) -> NumberVar: ... + + @overload + def __rfloordiv__(self, other: NoReturn) -> NoReturn: ... + + def __rfloordiv__(self, other: Any): """Floor divide two numbers. Args: @@ -142,9 +272,18 @@ def __rfloordiv__(self, other: number_types | boolean_types): Returns: The number floor division operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("//", (type(other), type(self))) + return number_floor_division_operation(+other, self) - def __mod__(self, other: number_types | boolean_types): + @overload + def __mod__(self, other: number_types) -> NumberVar: ... + + @overload + def __mod__(self, other: NoReturn) -> NoReturn: ... + + def __mod__(self, other: Any): """Modulo two numbers. Args: @@ -153,9 +292,18 @@ def __mod__(self, other: number_types | boolean_types): Returns: The number modulo operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("%", (type(self), type(other))) + return number_modulo_operation(self, +other) - def __rmod__(self, other: number_types | boolean_types): + @overload + def __rmod__(self, other: number_types) -> NumberVar: ... + + @overload + def __rmod__(self, other: NoReturn) -> NoReturn: ... + + def __rmod__(self, other: Any): """Modulo two numbers. Args: @@ -164,9 +312,18 @@ def __rmod__(self, other: number_types | boolean_types): Returns: The number modulo operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("%", (type(other), type(self))) + return number_modulo_operation(+other, self) - def __pow__(self, other: number_types | boolean_types): + @overload + def __pow__(self, other: number_types) -> NumberVar: ... + + @overload + def __pow__(self, other: NoReturn) -> NoReturn: ... + + def __pow__(self, other: Any): """Exponentiate two numbers. Args: @@ -175,9 +332,18 @@ def __pow__(self, other: number_types | boolean_types): Returns: The number exponent operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("**", (type(self), type(other))) + return number_exponent_operation(self, +other) - def __rpow__(self, other: number_types | boolean_types): + @overload + def __rpow__(self, other: number_types) -> NumberVar: ... + + @overload + def __rpow__(self, other: NoReturn) -> NoReturn: ... + + def __rpow__(self, other: Any): """Exponentiate two numbers. Args: @@ -186,6 +352,9 @@ def __rpow__(self, other: number_types | boolean_types): Returns: The number exponent operation. """ + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("**", (type(other), type(self))) + return number_exponent_operation(+other, self) def __neg__(self): @@ -244,6 +413,12 @@ def __trunc__(self): """ return number_trunc_operation(self) + @overload + def __lt__(self, other: number_types) -> BooleanVar: ... + + @overload + def __lt__(self, other: NoReturn) -> NoReturn: ... + def __lt__(self, other: Any): """Less than comparison. @@ -253,9 +428,15 @@ def __lt__(self, other: Any): Returns: The result of the comparison. """ - if isinstance(other, (NumberVar, BooleanVar, int, float, bool)): - return less_than_operation(self, +other) - return less_than_operation(self, other) + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("<", (type(self), type(other))) + return less_than_operation(self, +other) + + @overload + def __le__(self, other: number_types) -> BooleanVar: ... + + @overload + def __le__(self, other: NoReturn) -> NoReturn: ... def __le__(self, other: Any): """Less than or equal comparison. @@ -266,9 +447,9 @@ def __le__(self, other: Any): Returns: The result of the comparison. """ - if isinstance(other, (NumberVar, BooleanVar, int, float, bool)): - return less_than_or_equal_operation(self, +other) - return less_than_or_equal_operation(self, other) + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types("<=", (type(self), type(other))) + return less_than_or_equal_operation(self, +other) def __eq__(self, other: Any): """Equal comparison. @@ -279,7 +460,7 @@ def __eq__(self, other: Any): Returns: The result of the comparison. """ - if isinstance(other, (NumberVar, BooleanVar, int, float, bool)): + if isinstance(other, NUMBER_TYPES): return equal_operation(self, +other) return equal_operation(self, other) @@ -292,10 +473,16 @@ def __ne__(self, other: Any): Returns: The result of the comparison. """ - if isinstance(other, (NumberVar, BooleanVar, int, float, bool)): + if isinstance(other, NUMBER_TYPES): return not_equal_operation(self, +other) return not_equal_operation(self, other) + @overload + def __gt__(self, other: number_types) -> BooleanVar: ... + + @overload + def __gt__(self, other: NoReturn) -> NoReturn: ... + def __gt__(self, other: Any): """Greater than comparison. @@ -305,9 +492,15 @@ def __gt__(self, other: Any): Returns: The result of the comparison. """ - if isinstance(other, (NumberVar, BooleanVar, int, float, bool)): - return greater_than_operation(self, +other) - return greater_than_operation(self, other) + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types(">", (type(self), type(other))) + return greater_than_operation(self, +other) + + @overload + def __ge__(self, other: number_types) -> BooleanVar: ... + + @overload + def __ge__(self, other: NoReturn) -> NoReturn: ... def __ge__(self, other: Any): """Greater than or equal comparison. @@ -318,9 +511,9 @@ def __ge__(self, other: Any): Returns: The result of the comparison. """ - if isinstance(other, (NumberVar, BooleanVar, int, float, bool)): - return greater_than_or_equal_operation(self, +other) - return greater_than_or_equal_operation(self, other) + if not isinstance(other, NUMBER_TYPES): + raise_unsupported_operand_types(">=", (type(self), type(other))) + return greater_than_or_equal_operation(self, +other) def bool(self): """Boolean conversion. @@ -330,6 +523,22 @@ def bool(self): """ return self != 0 + def _is_strict_float(self) -> bool: + """Check if the number is a float. + + Returns: + bool: True if the number is a float. + """ + return issubclass(self._var_type, float) + + def _is_strict_int(self) -> bool: + """Check if the number is an int. + + Returns: + bool: True if the number is an int. + """ + return issubclass(self._var_type, int) + def binary_number_operation( func: Callable[[NumberVar, NumberVar], str], @@ -545,7 +754,7 @@ def number_trunc_operation(value: NumberVar): return var_operation_return(js_expression=f"Math.trunc({value})", var_type=int) -class BooleanVar(ImmutableVar[bool]): +class BooleanVar(NumberVar[bool]): """Base class for immutable boolean vars.""" def __invert__(self): @@ -580,7 +789,7 @@ def bool(self) -> BooleanVar: """ return self - def __lt__(self, other: boolean_types | number_types): + def __lt__(self, other: Any): """Less than comparison. Args: @@ -589,9 +798,9 @@ def __lt__(self, other: boolean_types | number_types): Returns: The result of the comparison. """ - return less_than_operation(+self, +other) + return +self < other - def __le__(self, other: boolean_types | number_types): + def __le__(self, other: Any): """Less than or equal comparison. Args: @@ -600,31 +809,9 @@ def __le__(self, other: boolean_types | number_types): Returns: The result of the comparison. """ - return less_than_or_equal_operation(+self, +other) - - def __eq__(self, other: boolean_types | number_types): - """Equal comparison. - - Args: - other: The other boolean. - - Returns: - The result of the comparison. - """ - return equal_operation(+self, +other) + return +self <= other - def __ne__(self, other: boolean_types | number_types): - """Not equal comparison. - - Args: - other: The other boolean. - - Returns: - The result of the comparison. - """ - return not_equal_operation(+self, +other) - - def __gt__(self, other: boolean_types | number_types): + def __gt__(self, other: Any): """Greater than comparison. Args: @@ -633,9 +820,9 @@ def __gt__(self, other: boolean_types | number_types): Returns: The result of the comparison. """ - return greater_than_operation(+self, +other) + return +self > other - def __ge__(self, other: boolean_types | number_types): + def __ge__(self, other: Any): """Greater than or equal comparison. Args: @@ -644,7 +831,7 @@ def __ge__(self, other: boolean_types | number_types): Returns: The result of the comparison. """ - return greater_than_or_equal_operation(+self, +other) + return +self >= other @var_operation @@ -661,8 +848,8 @@ def boolean_to_number_operation(value: BooleanVar): def comparison_operator( - func: Callable[[Var, Var], str], -) -> Callable[[Var | Any, Var | Any], BooleanVar]: + func: Callable[[ImmutableVar, ImmutableVar], str], +) -> Callable[[ImmutableVar | Any, ImmutableVar | Any], BooleanVar]: """Decorator to create a comparison operation. Args: @@ -673,13 +860,13 @@ def comparison_operator( """ @var_operation - def operation(lhs: Var, rhs: Var): + def operation(lhs: ImmutableVar, rhs: ImmutableVar): return var_operation_return( js_expression=func(lhs, rhs), var_type=bool, ) - def wrapper(lhs: Var | Any, rhs: Var | Any) -> BooleanVar: + def wrapper(lhs: ImmutableVar | Any, rhs: ImmutableVar | Any) -> BooleanVar: """Create the comparison operation. Args: @@ -695,7 +882,7 @@ def wrapper(lhs: Var | Any, rhs: Var | Any) -> BooleanVar: @comparison_operator -def greater_than_operation(lhs: Var, rhs: Var): +def greater_than_operation(lhs: ImmutableVar, rhs: ImmutableVar): """Greater than comparison. Args: @@ -709,7 +896,7 @@ def greater_than_operation(lhs: Var, rhs: Var): @comparison_operator -def greater_than_or_equal_operation(lhs: Var, rhs: Var): +def greater_than_or_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): """Greater than or equal comparison. Args: @@ -723,7 +910,7 @@ def greater_than_or_equal_operation(lhs: Var, rhs: Var): @comparison_operator -def less_than_operation(lhs: Var, rhs: Var): +def less_than_operation(lhs: ImmutableVar, rhs: ImmutableVar): """Less than comparison. Args: @@ -737,7 +924,7 @@ def less_than_operation(lhs: Var, rhs: Var): @comparison_operator -def less_than_or_equal_operation(lhs: Var, rhs: Var): +def less_than_or_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): """Less than or equal comparison. Args: @@ -751,7 +938,7 @@ def less_than_or_equal_operation(lhs: Var, rhs: Var): @comparison_operator -def equal_operation(lhs: Var, rhs: Var): +def equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): """Equal comparison. Args: @@ -765,7 +952,7 @@ def equal_operation(lhs: Var, rhs: Var): @comparison_operator -def not_equal_operation(lhs: Var, rhs: Var): +def not_equal_operation(lhs: ImmutableVar, rhs: ImmutableVar): """Not equal comparison. Args: @@ -831,7 +1018,7 @@ def create(cls, value: bool, _var_data: VarData | None = None): return cls( _var_name="true" if value else "false", _var_type=bool, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _var_value=value, ) @@ -876,7 +1063,7 @@ def create(cls, value: float | int, _var_data: VarData | None = None): return cls( _var_name=str(value), _var_type=type(value), - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _var_value=value, ) @@ -890,45 +1077,12 @@ def create(cls, value: float | int, _var_data: VarData | None = None): frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ToNumberVarOperation(CachedVarOperation, NumberVar): +class ToNumberVarOperation(ToOperation, NumberVar): """Base class for immutable number vars that are the result of a number operation.""" - _original_value: Var = dataclasses.field( - default_factory=lambda: LiteralNumberVar.create(0) - ) - - @cached_property_no_lock - def _cached_var_name(self) -> str: - """The name of the var. - - Returns: - The name of the var. - """ - return str(self._original_value) - - @classmethod - def create( - cls, - value: Var, - _var_type: type[int] | type[float] = float, - _var_data: VarData | None = None, - ): - """Create the number var. - - Args: - value: The value of the var. - _var_type: The type of the Var. - _var_data: Additional hooks and imports associated with the Var. + _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) - Returns: - The number var. - """ - return cls( - _var_name="", - _var_type=_var_type, - _var_data=ImmutableVarData.merge(_var_data), - _original_value=value, - ) + _default_var_type: ClassVar[Type] = float @dataclasses.dataclass( @@ -936,43 +1090,12 @@ def create( frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ToBooleanVarOperation(CachedVarOperation, BooleanVar): +class ToBooleanVarOperation(ToOperation, BooleanVar): """Base class for immutable boolean vars that are the result of a boolean operation.""" - _original_value: Var = dataclasses.field( - default_factory=lambda: LiteralBooleanVar.create(False) - ) - - @cached_property_no_lock - def _cached_var_name(self) -> str: - """The name of the var. - - Returns: - The name of the var. - """ - return str(self._original_value) - - @classmethod - def create( - cls, - value: Var, - _var_data: VarData | None = None, - ): - """Create the boolean var. - - Args: - value: The value of the var. - _var_data: Additional hooks and imports associated with the Var. + _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) - Returns: - The boolean var. - """ - return cls( - _var_name="", - _var_type=bool, - _var_data=ImmutableVarData.merge(_var_data), - _original_value=value, - ) + _default_var_type: ClassVar[Type] = bool @var_operation @@ -992,7 +1115,9 @@ def boolify(value: Var): @var_operation -def ternary_operation(condition: BooleanVar, if_true: Var, if_false: Var): +def ternary_operation( + condition: BooleanVar, if_true: ImmutableVar, if_false: ImmutableVar +): """Create a ternary operation. Args: @@ -1007,3 +1132,6 @@ def ternary_operation(condition: BooleanVar, if_true: Var, if_false: Var): js_expression=f"({condition} ? {if_true} : {if_false})", var_type=unionize(if_true._var_type, if_false._var_type), ) + + +NUMBER_TYPES = (int, float, NumberVar) diff --git a/reflex/ivars/object.py b/reflex/ivars/object.py index 49a21226fd..687083fcb9 100644 --- a/reflex/ivars/object.py +++ b/reflex/ivars/object.py @@ -8,6 +8,7 @@ from inspect import isclass from typing import ( Any, + ClassVar, Dict, List, NoReturn, @@ -22,18 +23,19 @@ from reflex.utils import types from reflex.utils.exceptions import VarAttributeError from reflex.utils.types import GenericType, get_attribute_access_type, get_origin -from reflex.vars import ImmutableVarData, Var, VarData +from reflex.vars import VarData from .base import ( CachedVarOperation, ImmutableVar, LiteralVar, + ToOperation, cached_property_no_lock, figure_out_type, var_operation, var_operation_return, ) -from .number import BooleanVar, NumberVar +from .number import BooleanVar, NumberVar, raise_unsupported_operand_types from .sequence import ArrayVar, StringVar OBJECT_TYPE = TypeVar("OBJECT_TYPE", bound=Dict) @@ -132,7 +134,7 @@ def merge(self, other: ObjectVar): @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, NoReturn]], - key: Var | Any, + key: ImmutableVar | Any, ) -> ImmutableVar: ... @overload @@ -142,40 +144,40 @@ def __getitem__( | ObjectVar[Dict[KEY_TYPE, float]] | ObjectVar[Dict[KEY_TYPE, int | float]] ), - key: Var | Any, + key: ImmutableVar | Any, ) -> NumberVar: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, str]], - key: Var | Any, + key: ImmutableVar | Any, ) -> StringVar: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, list[ARRAY_INNER_TYPE]]], - key: Var | Any, + key: ImmutableVar | Any, ) -> ArrayVar[list[ARRAY_INNER_TYPE]]: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, set[ARRAY_INNER_TYPE]]], - key: Var | Any, + key: ImmutableVar | Any, ) -> ArrayVar[set[ARRAY_INNER_TYPE]]: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, tuple[ARRAY_INNER_TYPE, ...]]], - key: Var | Any, + key: ImmutableVar | Any, ) -> ArrayVar[tuple[ARRAY_INNER_TYPE, ...]]: ... @overload def __getitem__( self: ObjectVar[Dict[KEY_TYPE, dict[OTHER_KEY_TYPE, VALUE_TYPE]]], - key: Var | Any, + key: ImmutableVar | Any, ) -> ObjectVar[dict[OTHER_KEY_TYPE, VALUE_TYPE]]: ... - def __getitem__(self, key: Var | Any) -> ImmutableVar: + def __getitem__(self, key: ImmutableVar | Any) -> ImmutableVar: """Get an item from the object. Args: @@ -184,6 +186,10 @@ def __getitem__(self, key: Var | Any) -> ImmutableVar: Returns: The item from the object. """ + if not isinstance(key, (StringVar, str, int, NumberVar)) or ( + isinstance(key, NumberVar) and key._is_strict_float() + ): + raise_unsupported_operand_types("[]", (type(self), type(key))) return ObjectItemOperation.create(self, key).guess_type() # NoReturn is used here to catch when key value is Any @@ -265,7 +271,7 @@ def __getattr__(self, name) -> ImmutableVar: else: return ObjectItemOperation.create(self, name).guess_type() - def contains(self, key: Var | Any) -> BooleanVar: + def contains(self, key: ImmutableVar | Any) -> BooleanVar: """Check if the object contains a key. Args: @@ -285,8 +291,8 @@ def contains(self, key: Var | Any) -> BooleanVar: class LiteralObjectVar(CachedVarOperation, ObjectVar[OBJECT_TYPE], LiteralVar): """Base class for immutable literal object vars.""" - _var_value: Dict[Union[Var, Any], Union[Var, Any]] = dataclasses.field( - default_factory=dict + _var_value: Dict[Union[ImmutableVar, Any], Union[ImmutableVar, Any]] = ( + dataclasses.field(default_factory=dict) ) def _key_type(self) -> Type: @@ -351,13 +357,13 @@ def __hash__(self) -> int: return hash((self.__class__.__name__, self._var_name)) @cached_property_no_lock - def _cached_get_all_var_data(self) -> ImmutableVarData | None: + def _cached_get_all_var_data(self) -> VarData | None: """Get all the var data. Returns: The var data. """ - return ImmutableVarData.merge( + return VarData.merge( *[LiteralVar.create(var)._get_all_var_data() for var in self._var_value], *[ LiteralVar.create(var)._get_all_var_data() @@ -386,7 +392,7 @@ def create( return LiteralObjectVar( _var_name="", _var_type=(figure_out_type(_var_value) if _var_type is None else _var_type), - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _var_value=_var_value, ) @@ -470,7 +476,9 @@ class ObjectItemOperation(CachedVarOperation, ImmutableVar): _object: ObjectVar = dataclasses.field( default_factory=lambda: LiteralObjectVar.create({}) ) - _key: Var | Any = dataclasses.field(default_factory=lambda: LiteralVar.create(None)) + _key: ImmutableVar | Any = dataclasses.field( + default_factory=lambda: LiteralVar.create(None) + ) @cached_property_no_lock def _cached_var_name(self) -> str: @@ -487,7 +495,7 @@ def _cached_var_name(self) -> str: def create( cls, object: ObjectVar, - key: Var | Any, + key: ImmutableVar | Any, _var_type: GenericType | None = None, _var_data: VarData | None = None, ) -> ObjectItemOperation: @@ -505,9 +513,9 @@ def create( return cls( _var_name="", _var_type=object._value_type() if _var_type is None else _var_type, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _object=object, - _key=key if isinstance(key, Var) else LiteralVar.create(key), + _key=key if isinstance(key, ImmutableVar) else LiteralVar.create(key), ) @@ -516,49 +524,31 @@ def create( frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ToObjectOperation(CachedVarOperation, ObjectVar): +class ToObjectOperation(ToOperation, ObjectVar): """Operation to convert a var to an object.""" - _original_var: Var = dataclasses.field( + _original: ImmutableVar = dataclasses.field( default_factory=lambda: LiteralObjectVar.create({}) ) - @cached_property_no_lock - def _cached_var_name(self) -> str: - """The name of the operation. + _default_var_type: ClassVar[GenericType] = dict - Returns: - The name of the operation. - """ - return str(self._original_var) - - @classmethod - def create( - cls, - original_var: Var, - _var_type: GenericType | None = None, - _var_data: VarData | None = None, - ) -> ToObjectOperation: - """Create the to object operation. + def __getattr__(self, name: str) -> Any: + """Get an attribute of the var. Args: - original_var: The original var to convert. - _var_type: The type of the var. - _var_data: Additional hooks and imports associated with the operation. + name: The name of the attribute. Returns: - The to object operation. + The attribute of the var. """ - return cls( - _var_name="", - _var_type=dict if _var_type is None else _var_type, - _var_data=ImmutableVarData.merge(_var_data), - _original_var=original_var, - ) + if name == "_var_name": + return self._original._var_name + return ObjectVar.__getattr__(self, name) @var_operation -def object_has_own_property_operation(object: ObjectVar, key: Var): +def object_has_own_property_operation(object: ObjectVar, key: ImmutableVar): """Check if an object has a key. Args: diff --git a/reflex/ivars/sequence.py b/reflex/ivars/sequence.py index 8081cf4424..3b6da46c2d 100644 --- a/reflex/ivars/sequence.py +++ b/reflex/ivars/sequence.py @@ -11,9 +11,11 @@ from typing import ( TYPE_CHECKING, Any, + ClassVar, Dict, List, Literal, + NoReturn, Set, Tuple, Type, @@ -24,19 +26,22 @@ from reflex import constants from reflex.constants.base import REFLEX_VAR_OPENING_TAG +from reflex.utils.exceptions import VarTypeError from reflex.utils.types import GenericType, get_origin from reflex.vars import ( - ImmutableVarData, Var, VarData, _global_vars, + get_unique_variable_name, ) from .base import ( CachedVarOperation, CustomVarOperationReturn, ImmutableVar, + LiteralNoneVar, LiteralVar, + ToOperation, cached_property_no_lock, figure_out_type, unionize, @@ -47,6 +52,7 @@ BooleanVar, LiteralNumberVar, NumberVar, + raise_unsupported_operand_types, ) if TYPE_CHECKING: @@ -56,7 +62,13 @@ class StringVar(ImmutableVar[str]): """Base class for immutable string vars.""" - def __add__(self, other: StringVar | str) -> ConcatVarOperation: + @overload + def __add__(self, other: StringVar | str) -> ConcatVarOperation: ... + + @overload + def __add__(self, other: NoReturn) -> NoReturn: ... + + def __add__(self, other: Any) -> ConcatVarOperation: """Concatenate two strings. Args: @@ -65,9 +77,18 @@ def __add__(self, other: StringVar | str) -> ConcatVarOperation: Returns: The string concatenation operation. """ + if not isinstance(other, (StringVar, str)): + raise_unsupported_operand_types("+", (type(self), type(other))) + return ConcatVarOperation.create(self, other) - def __radd__(self, other: StringVar | str) -> ConcatVarOperation: + @overload + def __radd__(self, other: StringVar | str) -> ConcatVarOperation: ... + + @overload + def __radd__(self, other: NoReturn) -> NoReturn: ... + + def __radd__(self, other: Any) -> ConcatVarOperation: """Concatenate two strings. Args: @@ -76,31 +97,58 @@ def __radd__(self, other: StringVar | str) -> ConcatVarOperation: Returns: The string concatenation operation. """ + if not isinstance(other, (StringVar, str)): + raise_unsupported_operand_types("+", (type(other), type(self))) + return ConcatVarOperation.create(other, self) - def __mul__(self, other: NumberVar | int) -> StringVar: + @overload + def __mul__(self, other: NumberVar | int) -> StringVar: ... + + @overload + def __mul__(self, other: NoReturn) -> NoReturn: ... + + def __mul__(self, other: Any) -> StringVar: """Multiply the sequence by a number or an integer. Args: - other (NumberVar | int): The number or integer to multiply the sequence by. + other: The number or integer to multiply the sequence by. Returns: StringVar: The resulting sequence after multiplication. """ + if not isinstance(other, (NumberVar, int)): + raise_unsupported_operand_types("*", (type(self), type(other))) + return (self.split() * other).join() - def __rmul__(self, other: NumberVar | int) -> StringVar: + @overload + def __rmul__(self, other: NumberVar | int) -> StringVar: ... + + @overload + def __rmul__(self, other: NoReturn) -> NoReturn: ... + + def __rmul__(self, other: Any) -> StringVar: """Multiply the sequence by a number or an integer. Args: - other (NumberVar | int): The number or integer to multiply the sequence by. + other: The number or integer to multiply the sequence by. Returns: StringVar: The resulting sequence after multiplication. """ + if not isinstance(other, (NumberVar, int)): + raise_unsupported_operand_types("*", (type(other), type(self))) + return (self.split() * other).join() - def __getitem__(self, i: slice | int | NumberVar) -> StringVar: + @overload + def __getitem__(self, i: slice) -> StringVar: ... + + @overload + def __getitem__(self, i: int | NumberVar) -> StringVar: ... + + def __getitem__(self, i: Any) -> StringVar: """Get a slice of the string. Args: @@ -111,6 +159,10 @@ def __getitem__(self, i: slice | int | NumberVar) -> StringVar: """ if isinstance(i, slice): return self.split()[i].join() + if not isinstance(i, (int, NumberVar)) or ( + isinstance(i, NumberVar) and i._is_strict_float() + ): + raise_unsupported_operand_types("[]", (type(self), type(i))) return string_item_operation(self, i) def length(self) -> NumberVar: @@ -161,18 +213,41 @@ def reversed(self) -> StringVar: """ return self.split().reverse().join() - def contains(self, other: StringVar | str) -> BooleanVar: + @overload + def contains( + self, other: StringVar | str, field: StringVar | str | None = None + ) -> BooleanVar: ... + + @overload + def contains( + self, other: NoReturn, field: StringVar | str | None = None + ) -> NoReturn: ... + + def contains(self, other: Any, field: Any = None) -> BooleanVar: """Check if the string contains another string. Args: other: The other string. + field: The field to check. Returns: The string contains operation. """ + if not isinstance(other, (StringVar, str)): + raise_unsupported_operand_types("contains", (type(self), type(other))) + if field is not None: + if not isinstance(field, (StringVar, str)): + raise_unsupported_operand_types("contains", (type(self), type(field))) + return string_contains_field_operation(self, other, field) return string_contains_operation(self, other) - def split(self, separator: StringVar | str = "") -> ArrayVar[List[str]]: + @overload + def split(self, separator: StringVar | str = "") -> ArrayVar[List[str]]: ... + + @overload + def split(self, separator: NoReturn) -> NoReturn: ... + + def split(self, separator: Any = "") -> ArrayVar[List[str]]: """Split the string. Args: @@ -181,9 +256,17 @@ def split(self, separator: StringVar | str = "") -> ArrayVar[List[str]]: Returns: The string split operation. """ + if not isinstance(separator, (StringVar, str)): + raise_unsupported_operand_types("split", (type(self), type(separator))) return string_split_operation(self, separator) - def startswith(self, prefix: StringVar | str) -> BooleanVar: + @overload + def startswith(self, prefix: StringVar | str) -> BooleanVar: ... + + @overload + def startswith(self, prefix: NoReturn) -> NoReturn: ... + + def startswith(self, prefix: Any) -> BooleanVar: """Check if the string starts with a prefix. Args: @@ -192,8 +275,146 @@ def startswith(self, prefix: StringVar | str) -> BooleanVar: Returns: The string starts with operation. """ + if not isinstance(prefix, (StringVar, str)): + raise_unsupported_operand_types("startswith", (type(self), type(prefix))) return string_starts_with_operation(self, prefix) + @overload + def __lt__(self, other: StringVar | str) -> BooleanVar: ... + + @overload + def __lt__(self, other: NoReturn) -> NoReturn: ... + + def __lt__(self, other: Any): + """Check if the string is less than another string. + + Args: + other: The other string. + + Returns: + The string less than operation. + """ + if not isinstance(other, (StringVar, str)): + raise_unsupported_operand_types("<", (type(self), type(other))) + + return string_lt_operation(self, other) + + @overload + def __gt__(self, other: StringVar | str) -> BooleanVar: ... + + @overload + def __gt__(self, other: NoReturn) -> NoReturn: ... + + def __gt__(self, other: Any): + """Check if the string is greater than another string. + + Args: + other: The other string. + + Returns: + The string greater than operation. + """ + if not isinstance(other, (StringVar, str)): + raise_unsupported_operand_types(">", (type(self), type(other))) + + return string_gt_operation(self, other) + + @overload + def __le__(self, other: StringVar | str) -> BooleanVar: ... + + @overload + def __le__(self, other: NoReturn) -> NoReturn: ... + + def __le__(self, other: Any): + """Check if the string is less than or equal to another string. + + Args: + other: The other string. + + Returns: + The string less than or equal operation. + """ + if not isinstance(other, (StringVar, str)): + raise_unsupported_operand_types("<=", (type(self), type(other))) + + return string_le_operation(self, other) + + @overload + def __ge__(self, other: StringVar | str) -> BooleanVar: ... + + @overload + def __ge__(self, other: NoReturn) -> NoReturn: ... + + def __ge__(self, other: Any): + """Check if the string is greater than or equal to another string. + + Args: + other: The other string. + + Returns: + The string greater than or equal operation. + """ + if not isinstance(other, (StringVar, str)): + raise_unsupported_operand_types(">=", (type(self), type(other))) + + return string_ge_operation(self, other) + + +@var_operation +def string_lt_operation(lhs: StringVar | str, rhs: StringVar | str): + """Check if a string is less than another string. + + Args: + lhs: The left-hand side string. + rhs: The right-hand side string. + + Returns: + The string less than operation. + """ + return var_operation_return(js_expression=f"{lhs} < {rhs}", var_type=bool) + + +@var_operation +def string_gt_operation(lhs: StringVar | str, rhs: StringVar | str): + """Check if a string is greater than another string. + + Args: + lhs: The left-hand side string. + rhs: The right-hand side string. + + Returns: + The string greater than operation. + """ + return var_operation_return(js_expression=f"{lhs} > {rhs}", var_type=bool) + + +@var_operation +def string_le_operation(lhs: StringVar | str, rhs: StringVar | str): + """Check if a string is less than or equal to another string. + + Args: + lhs: The left-hand side string. + rhs: The right-hand side string. + + Returns: + The string less than or equal operation. + """ + return var_operation_return(js_expression=f"{lhs} <= {rhs}", var_type=bool) + + +@var_operation +def string_ge_operation(lhs: StringVar | str, rhs: StringVar | str): + """Check if a string is greater than or equal to another string. + + Args: + lhs: The left-hand side string. + rhs: The right-hand side string. + + Returns: + The string greater than or equal operation. + """ + return var_operation_return(js_expression=f"{lhs} >= {rhs}", var_type=bool) + @var_operation def string_lower_operation(string: StringVar): @@ -234,6 +455,26 @@ def string_strip_operation(string: StringVar): return var_operation_return(js_expression=f"{string}.trim()", var_type=str) +@var_operation +def string_contains_field_operation( + haystack: StringVar, needle: StringVar | str, field: StringVar | str +): + """Check if a string contains another string. + + Args: + haystack: The haystack. + needle: The needle. + field: The field to check. + + Returns: + The string contains operation. + """ + return var_operation_return( + js_expression=f"{haystack}.some(obj => obj[{field}] === {needle})", + var_type=bool, + ) + + @var_operation def string_contains_operation(haystack: StringVar, needle: StringVar | str): """Check if a string contains another string. @@ -316,7 +557,7 @@ def create( cls, value: str, _var_data: VarData | None = None, - ) -> LiteralStringVar | ConcatVarOperation: + ) -> StringVar: """Create a var from a string value. Args: @@ -327,20 +568,9 @@ def create( The var. """ if REFLEX_VAR_OPENING_TAG in value: - strings_and_vals: list[Var | str] = [] + strings_and_vals: list[ImmutableVar | str] = [] offset = 0 - # Initialize some methods for reading json. - var_data_config = VarData().__config__ - - def json_loads(s): - try: - return var_data_config.json_loads(s) - except json.decoder.JSONDecodeError: - return var_data_config.json_loads( - var_data_config.json_loads(f'"{s}"') - ) - # Find all tags while m := _decode_var_pattern.search(value): start, end = m.span() @@ -356,41 +586,17 @@ def json_loads(s): var = _global_vars[int(serialized_data)] strings_and_vals.append(var) value = value[(end + len(var._var_name)) :] - else: - data = json_loads(serialized_data) - string_length = data.pop("string_length", None) - var_data = VarData.parse_obj(data) - - # Use string length to compute positions of interpolations. - if string_length is not None: - realstart = start + offset - var_data.interpolations = [ - (realstart, realstart + string_length) - ] - var_content = value[end : (end + string_length)] - if ( - var_content[0] == "{" - and var_content[-1] == "}" - and strings_and_vals - and strings_and_vals[-1][-1] == "$" - ): - strings_and_vals[-1] = strings_and_vals[-1][:-1] - var_content = "(" + var_content[1:-1] + ")" - strings_and_vals.append( - ImmutableVar.create_safe(var_content, _var_data=var_data) - ) - value = value[(end + string_length) :] offset += end - start strings_and_vals.append(value) filtered_strings_and_vals = [ - s for s in strings_and_vals if isinstance(s, Var) or s + s for s in strings_and_vals if isinstance(s, ImmutableVar) or s ] if len(filtered_strings_and_vals) == 1: - return filtered_strings_and_vals[0].to(StringVar) # type: ignore + return LiteralVar.create(filtered_strings_and_vals[0]).to(StringVar) return ConcatVarOperation.create( *filtered_strings_and_vals, @@ -400,7 +606,7 @@ def json_loads(s): return LiteralStringVar( _var_name=json.dumps(value), _var_type=str, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _var_value=value, ) @@ -429,7 +635,7 @@ def json(self) -> str: class ConcatVarOperation(CachedVarOperation, StringVar): """Representing a concatenation of literal string vars.""" - _var_value: Tuple[Var, ...] = dataclasses.field(default_factory=tuple) + _var_value: Tuple[ImmutableVar, ...] = dataclasses.field(default_factory=tuple) @cached_property_no_lock def _cached_var_name(self) -> str: @@ -438,7 +644,7 @@ def _cached_var_name(self) -> str: Returns: The name of the var. """ - list_of_strs: List[Union[str, Var]] = [] + list_of_strs: List[Union[str, ImmutableVar]] = [] last_string = "" for var in self._var_value: if isinstance(var, LiteralStringVar): @@ -453,7 +659,9 @@ def _cached_var_name(self) -> str: list_of_strs.append(last_string) list_of_strs_filtered = [ - str(LiteralVar.create(s)) for s in list_of_strs if isinstance(s, Var) or s + str(LiteralVar.create(s)) + for s in list_of_strs + if isinstance(s, ImmutableVar) or s ] if len(list_of_strs_filtered) == 1: @@ -462,17 +670,17 @@ def _cached_var_name(self) -> str: return "(" + "+".join(list_of_strs_filtered) + ")" @cached_property_no_lock - def _cached_get_all_var_data(self) -> ImmutableVarData | None: - """Get all the VarData associated with the Var. + def _cached_get_all_var_data(self) -> VarData | None: + """Get all the VarData asVarDatae Var. Returns: The VarData associated with the Var. """ - return ImmutableVarData.merge( + return VarData.merge( *[ var._get_all_var_data() for var in self._var_value - if isinstance(var, Var) + if isinstance(var, ImmutableVar) ], self._var_data, ) @@ -495,7 +703,7 @@ def create( return cls( _var_name="", _var_type=str, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _var_value=tuple(map(LiteralVar.create, value)), ) @@ -513,7 +721,13 @@ def create( class ArrayVar(ImmutableVar[ARRAY_VAR_TYPE]): """Base class for immutable array vars.""" - def join(self, sep: StringVar | str = "") -> StringVar: + @overload + def join(self, sep: StringVar | str = "") -> StringVar: ... + + @overload + def join(self, sep: NoReturn) -> NoReturn: ... + + def join(self, sep: Any = "") -> StringVar: """Join the elements of the array. Args: @@ -522,6 +736,8 @@ def join(self, sep: StringVar | str = "") -> StringVar: Returns: The joined elements. """ + if not isinstance(sep, (StringVar, str)): + raise_unsupported_operand_types("join", (type(self), type(sep))) return array_join_operation(self, sep) def reverse(self) -> ArrayVar[ARRAY_VAR_TYPE]: @@ -532,15 +748,24 @@ def reverse(self) -> ArrayVar[ARRAY_VAR_TYPE]: """ return array_reverse_operation(self) - def __add__(self, other: ArrayVar[ARRAY_VAR_TYPE]) -> ArrayVar[ARRAY_VAR_TYPE]: + @overload + def __add__(self, other: ArrayVar[ARRAY_VAR_TYPE]) -> ArrayVar[ARRAY_VAR_TYPE]: ... + + @overload + def __add__(self, other: NoReturn) -> NoReturn: ... + + def __add__(self, other: Any) -> ArrayVar[ARRAY_VAR_TYPE]: """Concatenate two arrays. Parameters: - other (ArrayVar[ARRAY_VAR_TYPE]): The other array to concatenate. + other: The other array to concatenate. Returns: ArrayConcatOperation: The concatenation of the two arrays. """ + if not isinstance(other, ArrayVar): + raise_unsupported_operand_types("+", (type(self), type(other))) + return array_concat_operation(self, other) @overload @@ -633,9 +858,7 @@ def __getitem__( @overload def __getitem__(self, i: int | NumberVar) -> ImmutableVar: ... - def __getitem__( - self, i: slice | int | NumberVar - ) -> ArrayVar[ARRAY_VAR_TYPE] | ImmutableVar: + def __getitem__(self, i: Any) -> ArrayVar[ARRAY_VAR_TYPE] | ImmutableVar: """Get a slice of the array. Args: @@ -646,6 +869,10 @@ def __getitem__( """ if isinstance(i, slice): return ArraySliceOperation.create(self, i) + if not isinstance(i, (int, NumberVar)) or ( + isinstance(i, NumberVar) and i._is_strict_float() + ): + raise_unsupported_operand_types("[]", (type(self), type(i))) return array_item_operation(self, i) def length(self) -> NumberVar: @@ -687,6 +914,14 @@ def range( Returns: The range of numbers. """ + if any( + not isinstance(i, (int, NumberVar)) + for i in (first_endpoint, second_endpoint, step) + if i is not None + ): + raise_unsupported_operand_types( + "range", (type(first_endpoint), type(second_endpoint), type(step)) + ) if second_endpoint is None: start = 0 end = first_endpoint @@ -696,15 +931,26 @@ def range( return array_range_operation(start, end, step or 1) - def contains(self, other: Any) -> BooleanVar: + @overload + def contains(self, other: Any) -> BooleanVar: ... + + @overload + def contains(self, other: Any, field: StringVar | str) -> BooleanVar: ... + + def contains(self, other: Any, field: Any = None) -> BooleanVar: """Check if the array contains an element. Args: other: The element to check for. + field: The field to check. Returns: The array contains operation. """ + if field is not None: + if not isinstance(field, (StringVar, str)): + raise_unsupported_operand_types("contains", (type(self), type(field))) + return array_contains_field_operation(self, other, field) return array_contains_operation(self, other) def pluck(self, field: StringVar | str) -> ArrayVar: @@ -718,19 +964,154 @@ def pluck(self, field: StringVar | str) -> ArrayVar: """ return array_pluck_operation(self, field) - def __mul__(self, other: NumberVar | int) -> ArrayVar[ARRAY_VAR_TYPE]: + @overload + def __mul__(self, other: NumberVar | int) -> ArrayVar[ARRAY_VAR_TYPE]: ... + + @overload + def __mul__(self, other: NoReturn) -> NoReturn: ... + + def __mul__(self, other: Any) -> ArrayVar[ARRAY_VAR_TYPE]: """Multiply the sequence by a number or integer. Parameters: - other (NumberVar | int): The number or integer to multiply the sequence by. + other: The number or integer to multiply the sequence by. Returns: ArrayVar[ARRAY_VAR_TYPE]: The result of multiplying the sequence by the given number or integer. """ + if not isinstance(other, (NumberVar, int)) or ( + isinstance(other, NumberVar) and other._is_strict_float() + ): + raise_unsupported_operand_types("*", (type(self), type(other))) + return repeat_array_operation(self, other) __rmul__ = __mul__ # type: ignore + @overload + def __lt__(self, other: ArrayVar[ARRAY_VAR_TYPE]) -> BooleanVar: ... + + @overload + def __lt__(self, other: list | tuple) -> BooleanVar: ... + + def __lt__(self, other: Any): + """Check if the array is less than another array. + + Args: + other: The other array. + + Returns: + The array less than operation. + """ + if not isinstance(other, (ArrayVar, list, tuple)): + raise_unsupported_operand_types("<", (type(self), type(other))) + + return array_lt_operation(self, other) + + @overload + def __gt__(self, other: ArrayVar[ARRAY_VAR_TYPE]) -> BooleanVar: ... + + @overload + def __gt__(self, other: list | tuple) -> BooleanVar: ... + + def __gt__(self, other: Any): + """Check if the array is greater than another array. + + Args: + other: The other array. + + Returns: + The array greater than operation. + """ + if not isinstance(other, (ArrayVar, list, tuple)): + raise_unsupported_operand_types(">", (type(self), type(other))) + + return array_gt_operation(self, other) + + @overload + def __le__(self, other: ArrayVar[ARRAY_VAR_TYPE]) -> BooleanVar: ... + + @overload + def __le__(self, other: list | tuple) -> BooleanVar: ... + + def __le__(self, other: Any): + """Check if the array is less than or equal to another array. + + Args: + other: The other array. + + Returns: + The array less than or equal operation. + """ + if not isinstance(other, (ArrayVar, list, tuple)): + raise_unsupported_operand_types("<=", (type(self), type(other))) + + return array_le_operation(self, other) + + @overload + def __ge__(self, other: ArrayVar[ARRAY_VAR_TYPE]) -> BooleanVar: ... + + @overload + def __ge__(self, other: list | tuple) -> BooleanVar: ... + + def __ge__(self, other: Any): + """Check if the array is greater than or equal to another array. + + Args: + other: The other array. + + Returns: + The array greater than or equal operation. + """ + if not isinstance(other, (ArrayVar, list, tuple)): + raise_unsupported_operand_types(">=", (type(self), type(other))) + + return array_ge_operation(self, other) + + def foreach(self, fn: Any): + """Apply a function to each element of the array. + + Args: + fn: The function to apply. + + Returns: + The array after applying the function. + + Raises: + VarTypeError: If the function takes more than one argument. + """ + from .function import ArgsFunctionOperation + + if not callable(fn): + raise_unsupported_operand_types("foreach", (type(self), type(fn))) + # get the number of arguments of the function + num_args = len(inspect.signature(fn).parameters) + if num_args > 1: + raise VarTypeError( + "The function passed to foreach should take at most one argument." + ) + + if num_args == 0: + return_value = fn() + function_var = ArgsFunctionOperation.create(tuple(), return_value) + else: + # generic number var + number_var = ImmutableVar("").to(NumberVar) + + first_arg_type = self[number_var]._var_type + + arg_name = get_unique_variable_name() + + # get first argument type + first_arg = ImmutableVar( + _var_name=arg_name, + _var_type=first_arg_type, + ).guess_type() + + function_var = ArgsFunctionOperation.create((arg_name,), fn(first_arg)) + + return map_array_operation(self, function_var) + LIST_ELEMENT = TypeVar("LIST_ELEMENT") @@ -750,7 +1131,9 @@ class LiteralArrayVar(CachedVarOperation, LiteralVar, ArrayVar[ARRAY_VAR_TYPE]): """Base class for immutable literal array vars.""" _var_value: Union[ - List[Union[Var, Any]], Set[Union[Var, Any]], Tuple[Union[Var, Any], ...] + List[Union[ImmutableVar, Any]], + Set[Union[ImmutableVar, Any]], + Tuple[Union[ImmutableVar, Any], ...], ] = dataclasses.field(default_factory=list) @cached_property_no_lock @@ -769,13 +1152,13 @@ def _cached_var_name(self) -> str: ) @cached_property_no_lock - def _cached_get_all_var_data(self) -> ImmutableVarData | None: + def _cached_get_all_var_data(self) -> VarData | None: """Get all the VarData associated with the Var. Returns: The VarData associated with the Var. """ - return ImmutableVarData.merge( + return VarData.merge( *[ LiteralVar.create(element)._get_all_var_data() for element in self._var_value @@ -824,7 +1207,7 @@ def create( return cls( _var_name="", _var_type=figure_out_type(value) if _var_type is None else _var_type, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _var_value=value, ) @@ -884,7 +1267,7 @@ def _cached_var_name(self) -> str: ) if step is None: return f"{str(self._array)}.slice({str(normalized_start)}, {str(normalized_end)})" - if not isinstance(step, Var): + if not isinstance(step, ImmutableVar): if step < 0: actual_start = end + 1 if end is not None else 0 actual_end = start + 1 if start is not None else self._array.length() @@ -918,7 +1301,7 @@ def create( return cls( _var_name="", _var_type=array._var_type, - _var_data=ImmutableVarData.merge(_var_data), + _var_data=_var_data, _array=array, _start=slice.start, _stop=slice.stop, @@ -964,6 +1347,62 @@ def array_reverse_operation( ) +@var_operation +def array_lt_operation(lhs: ArrayVar | list | tuple, rhs: ArrayVar | list | tuple): + """Check if an array is less than another array. + + Args: + lhs: The left-hand side array. + rhs: The right-hand side array. + + Returns: + The array less than operation. + """ + return var_operation_return(js_expression=f"{lhs} < {rhs}", var_type=bool) + + +@var_operation +def array_gt_operation(lhs: ArrayVar | list | tuple, rhs: ArrayVar | list | tuple): + """Check if an array is greater than another array. + + Args: + lhs: The left-hand side array. + rhs: The right-hand side array. + + Returns: + The array greater than operation. + """ + return var_operation_return(js_expression=f"{lhs} > {rhs}", var_type=bool) + + +@var_operation +def array_le_operation(lhs: ArrayVar | list | tuple, rhs: ArrayVar | list | tuple): + """Check if an array is less than or equal to another array. + + Args: + lhs: The left-hand side array. + rhs: The right-hand side array. + + Returns: + The array less than or equal operation. + """ + return var_operation_return(js_expression=f"{lhs} <= {rhs}", var_type=bool) + + +@var_operation +def array_ge_operation(lhs: ArrayVar | list | tuple, rhs: ArrayVar | list | tuple): + """Check if an array is greater than or equal to another array. + + Args: + lhs: The left-hand side array. + rhs: The right-hand side array. + + Returns: + The array greater than or equal operation. + """ + return var_operation_return(js_expression=f"{lhs} >= {rhs}", var_type=bool) + + @var_operation def array_length_operation(array: ArrayVar): """Get the length of an array. @@ -1038,6 +1477,26 @@ def array_range_operation( ) +@var_operation +def array_contains_field_operation( + haystack: ArrayVar, needle: Any | Var, field: StringVar | str +): + """Check if an array contains an element. + + Args: + haystack: The array to check. + needle: The element to check for. + field: The field to check. + + Returns: + The array contains operation. + """ + return var_operation_return( + js_expression=f"{haystack}.some(obj => obj[{field}] === {needle})", + var_type=bool, + ) + + @var_operation def array_contains_operation(haystack: ArrayVar, needle: Any | Var): """Check if an array contains an element. @@ -1060,43 +1519,12 @@ def array_contains_operation(haystack: ArrayVar, needle: Any | Var): frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ToStringOperation(CachedVarOperation, StringVar): +class ToStringOperation(ToOperation, StringVar): """Base class for immutable string vars that are the result of a to string operation.""" - _original_var: Var = dataclasses.field( - default_factory=lambda: LiteralStringVar.create("") - ) - - @cached_property_no_lock - def _cached_var_name(self) -> str: - """The name of the var. - - Returns: - The name of the var. - """ - return str(self._original_var) + _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) - @classmethod - def create( - cls, - original_var: Var, - _var_data: VarData | None = None, - ) -> ToStringOperation: - """Create a var from a string value. - - Args: - original_var: The original var. - _var_data: Additional hooks and imports associated with the Var. - - Returns: - The var. - """ - return cls( - _var_name="", - _var_type=str, - _var_data=ImmutableVarData.merge(_var_data), - _original_var=original_var, - ) + _default_var_type: ClassVar[Type] = str @dataclasses.dataclass( @@ -1104,44 +1532,12 @@ def create( frozen=True, **{"slots": True} if sys.version_info >= (3, 10) else {}, ) -class ToArrayOperation(CachedVarOperation, ArrayVar): +class ToArrayOperation(ToOperation, ArrayVar): """Base class for immutable array vars that are the result of a to array operation.""" - _original_var: Var = dataclasses.field( - default_factory=lambda: LiteralArrayVar.create([]) - ) - - @cached_property_no_lock - def _cached_var_name(self) -> str: - """The name of the var. - - Returns: - The name of the var. - """ - return str(self._original_var) + _original: Var = dataclasses.field(default_factory=lambda: LiteralNoneVar.create()) - @classmethod - def create( - cls, - original_var: Var, - _var_type: type[list] | type[set] | type[tuple] | None = None, - _var_data: VarData | None = None, - ) -> ToArrayOperation: - """Create a var from a string value. - - Args: - original_var: The original var. - _var_data: Additional hooks and imports associated with the Var. - - Returns: - The var. - """ - return cls( - _var_name="", - _var_type=list if _var_type is None else _var_type, - _var_data=ImmutableVarData.merge(_var_data), - _original_var=original_var, - ) + _default_var_type: ClassVar[Type] = List[Any] @var_operation @@ -1163,6 +1559,29 @@ def repeat_array_operation( ) +if TYPE_CHECKING: + from .function import FunctionVar + + +@var_operation +def map_array_operation( + array: ArrayVar[ARRAY_VAR_TYPE], + function: FunctionVar, +): + """Map a function over an array. + + Args: + array: The array. + function: The function to map. + + Returns: + The mapped array. + """ + return var_operation_return( + js_expression=f"{array}.map({function})", var_type=List[Any] + ) + + @var_operation def array_concat_operation( lhs: ArrayVar[ARRAY_VAR_TYPE], rhs: ArrayVar[ARRAY_VAR_TYPE] diff --git a/reflex/state.py b/reflex/state.py index 1bd4cc9462..0ee9dbb374 100644 --- a/reflex/state.py +++ b/reflex/state.py @@ -34,7 +34,12 @@ from sqlalchemy.orm import DeclarativeBase from reflex.config import get_config -from reflex.ivars.base import ImmutableComputedVar, ImmutableVar, immutable_computed_var +from reflex.ivars.base import ( + ImmutableComputedVar, + ImmutableVar, + immutable_computed_var, + is_computed_var, +) try: import pydantic.v1 as pydantic @@ -59,11 +64,7 @@ from reflex.utils.exec import is_testing_env from reflex.utils.serializers import SerializedType, serialize, serializer from reflex.utils.types import override -from reflex.vars import ( - ComputedVar, - ImmutableVarData, - Var, -) +from reflex.vars import VarData if TYPE_CHECKING: from reflex.components.component import Component @@ -303,16 +304,16 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow): """The state of the app.""" # A map from the var name to the var. - vars: ClassVar[Dict[str, Var]] = {} + vars: ClassVar[Dict[str, ImmutableVar]] = {} # The base vars of the class. base_vars: ClassVar[Dict[str, ImmutableVar]] = {} # The computed vars of the class. - computed_vars: ClassVar[Dict[str, Union[ComputedVar, ImmutableComputedVar]]] = {} + computed_vars: ClassVar[Dict[str, ImmutableComputedVar]] = {} # Vars inherited by the parent state. - inherited_vars: ClassVar[Dict[str, Var]] = {} + inherited_vars: ClassVar[Dict[str, ImmutableVar]] = {} # Backend base vars that are never sent to the client. backend_vars: ClassVar[Dict[str, Any]] = {} @@ -422,7 +423,7 @@ def __repr__(self) -> str: return f"{self.__class__.__name__}({self.dict()})" @classmethod - def _get_computed_vars(cls) -> list[Union[ComputedVar, ImmutableComputedVar]]: + def _get_computed_vars(cls) -> list[ImmutableComputedVar]: """Helper function to get all computed vars of a instance. Returns: @@ -432,8 +433,7 @@ def _get_computed_vars(cls) -> list[Union[ComputedVar, ImmutableComputedVar]]: v for mixin in cls._mixins() + [cls] for name, v in mixin.__dict__.items() - if isinstance(v, (ComputedVar, ImmutableComputedVar)) - and name not in cls.inherited_vars + if is_computed_var(v) and name not in cls.inherited_vars ] @classmethod @@ -522,13 +522,13 @@ def __init_subclass__(cls, mixin: bool = False, **kwargs): f.name: ImmutableVar( _var_name=format.format_state_name(cls.get_full_name()) + "." + f.name, _var_type=f.outer_type_, - _var_data=ImmutableVarData.from_state(cls), + _var_data=VarData.from_state(cls), ).guess_type() for f in cls.get_fields().values() if f.name not in cls.get_skip_vars() } cls.computed_vars = { - v._var_name: v._replace(merge_var_data=ImmutableVarData.from_state(cls)) + v._var_name: v._replace(merge_var_data=VarData.from_state(cls)) for v in computed_vars } cls.vars = { @@ -553,11 +553,9 @@ def __init_subclass__(cls, mixin: bool = False, **kwargs): for name, value in mixin.__dict__.items(): if name in cls.inherited_vars: continue - if isinstance(value, (ComputedVar, ImmutableComputedVar)): + if is_computed_var(value): fget = cls._copy_fn(value.fget) - newcv = value._replace( - fget=fget, _var_data=ImmutableVarData.from_state(cls) - ) + newcv = value._replace(fget=fget, _var_data=VarData.from_state(cls)) # cleanup refs to mixin cls in var_data setattr(cls, name, newcv) cls.computed_vars[newcv._var_name] = newcv @@ -897,7 +895,7 @@ def add_var(cls, name: str, type_: Any, default_value: Any = None): var = ImmutableVar( _var_name=format.format_state_name(cls.get_full_name()) + "." + name, _var_type=type_, - _var_data=ImmutableVarData.from_state(cls), + _var_data=VarData.from_state(cls), ).guess_type() # add the pydantic field dynamically (must be done before _init_var) @@ -1012,13 +1010,13 @@ def argsingle_factory(param): def inner_func(self) -> str: return self.router.page.params.get(param, "") - return ComputedVar(fget=inner_func, cache=True) + return ImmutableComputedVar(fget=inner_func, cache=True) def arglist_factory(param): def inner_func(self) -> List: return self.router.page.params.get(param, []) - return ComputedVar(fget=inner_func, cache=True) + return ImmutableComputedVar(fget=inner_func, cache=True) for param, value in args.items(): if value == constants.RouteArgType.SINGLE: @@ -1027,8 +1025,8 @@ def inner_func(self) -> List: func = arglist_factory(param) else: continue - # to allow passing as a prop - func._var_name = param + # to allow passing as a prop, evade python frozen rules (bad practice) + object.__setattr__(func, "_var_name", param) cls.vars[param] = cls.computed_vars[param] = func._var_set_state(cls) # type: ignore setattr(cls, param, func) @@ -1789,7 +1787,7 @@ def dict( # Include initial computed vars. prop_name: ( cv._initial_value - if isinstance(cv, (ComputedVar, ImmutableComputedVar)) + if is_computed_var(cv) and not isinstance(cv._initial_value, types.Unset) else self.get_value(getattr(self, prop_name)) ) diff --git a/reflex/style.py b/reflex/style.py index a2083f6344..b29160cb28 100644 --- a/reflex/style.py +++ b/reflex/style.py @@ -6,14 +6,13 @@ from reflex import constants from reflex.components.core.breakpoints import Breakpoints, breakpoints_values -from reflex.event import EventChain +from reflex.event import EventChain, EventHandler from reflex.ivars.base import ImmutableCallableVar, ImmutableVar, LiteralVar from reflex.ivars.function import FunctionVar from reflex.utils import format +from reflex.utils.exceptions import ReflexError from reflex.utils.imports import ImportVar -from reflex.vars import ImmutableVarData, Var, VarData - -VarData.update_forward_refs() # Ensure all type definitions are resolved +from reflex.vars import Var, VarData SYSTEM_COLOR_MODE: str = "system" LIGHT_COLOR_MODE: str = "light" @@ -40,7 +39,7 @@ def _color_mode_var(_var_name: str, _var_type: Type = str) -> ImmutableVar: return ImmutableVar( _var_name=_var_name, _var_type=_var_type, - _var_data=ImmutableVarData( + _var_data=VarData( imports=color_mode_imports, hooks={f"const {{ {_var_name} }} = useContext(ColorModeContext)": None}, ), @@ -50,7 +49,7 @@ def _color_mode_var(_var_name: str, _var_type: Type = str) -> ImmutableVar: @ImmutableCallableVar def set_color_mode( new_color_mode: LiteralColorMode | Var[LiteralColorMode] | None = None, -) -> Var[EventChain]: +) -> ImmutableVar[EventChain]: """Create an EventChain Var that sets the color mode to a specific value. Note: `set_color_mode` is not a real event and cannot be triggered from a @@ -69,15 +68,15 @@ def set_color_mode( if new_color_mode is None: return base_setter - if not isinstance(new_color_mode, Var): + if not isinstance(new_color_mode, ImmutableVar): new_color_mode = LiteralVar.create(new_color_mode) return ImmutableVar( f"() => {str(base_setter)}({str(new_color_mode)})", - _var_data=ImmutableVarData.merge( + _var_data=VarData.merge( base_setter._get_all_var_data(), new_color_mode._get_all_var_data() ), - ).to(FunctionVar, EventChain) + ).to(FunctionVar, EventChain) # type: ignore # Var resolves to the current color mode for the app ("light", "dark" or "system") @@ -116,7 +115,7 @@ def media_query(breakpoint_expr: str): def convert_item( style_item: int | str | Var, -) -> tuple[str | Var, VarData | ImmutableVarData | None]: +) -> tuple[str | Var, VarData | VarData | None]: """Format a single value in a style dictionary. Args: @@ -124,8 +123,17 @@ def convert_item( Returns: The formatted style item and any associated VarData. + + Raises: + ReflexError: If an EventHandler is used as a style value """ - if isinstance(style_item, Var): + if isinstance(style_item, EventHandler): + raise ReflexError( + "EventHandlers cannot be used as style values. " + "Please use a Var or a literal value." + ) + + if isinstance(style_item, ImmutableVar): return style_item, style_item._get_all_var_data() # if isinstance(style_item, str) and REFLEX_VAR_OPENING_TAG not in style_item: @@ -138,7 +146,7 @@ def convert_item( def convert_list( - responsive_list: list[str | dict | Var], + responsive_list: list[str | dict | ImmutableVar], ) -> tuple[list[str | dict[str, Var | list | dict]], VarData | None]: """Format a responsive value list. @@ -181,7 +189,7 @@ def update_out_dict(return_value, keys_to_update): for key, value in style_dict.items(): keys = format_style_key(key) - if isinstance(value, Var): + if isinstance(value, ImmutableVar): return_val = value new_var_data = value._get_all_var_data() update_out_dict(return_val, keys) diff --git a/reflex/utils/format.py b/reflex/utils/format.py index e7d85a93e8..0e18a84956 100644 --- a/reflex/utils/format.py +++ b/reflex/utils/format.py @@ -10,7 +10,7 @@ from reflex import constants from reflex.utils import exceptions, types -from reflex.vars import BaseVar, Var +from reflex.vars import Var if TYPE_CHECKING: from reflex.components.component import ComponentStyle @@ -263,34 +263,6 @@ def format_string(string: str) -> str: return _wrap_js_string(_escape_js_string(string)) -def format_f_string_prop(prop: BaseVar) -> str: - """Format the string in a given prop as an f-string. - - Args: - prop: The prop to format. - - Returns: - The formatted string. - """ - from reflex.ivars.base import VarData - - s = prop._var_full_name - var_data = VarData.merge(prop._get_all_var_data()) - interps = var_data.interpolations if var_data else [] - parts: List[str] = [] - - if interps: - for i, (start, end) in enumerate(interps): - prev_end = interps[i - 1][1] if i > 0 else 0 - parts.append(_escape_js_string(s[prev_end:start])) - parts.append(s[start:end]) - parts.append(_escape_js_string(s[interps[-1][1] :])) - else: - parts.append(_escape_js_string(s)) - - return _wrap_js_string("".join(parts)) - - def format_var(var: Var) -> str: """Format the given Var as a javascript value. @@ -300,13 +272,7 @@ def format_var(var: Var) -> str: Returns: The formatted Var. """ - if not var._var_is_local or var._var_is_string: - return str(var) - if types._issubclass(var._var_type, str): - return format_string(var._var_full_name) - if is_wrapped(var._var_full_name, "{"): - return var._var_full_name - return json_dumps(var._var_full_name) + return str(var) def format_route(route: str, format_case=True) -> str: @@ -331,46 +297,11 @@ def format_route(route: str, format_case=True) -> str: return route -def format_cond( - cond: str | Var, - true_value: str | Var, - false_value: str | Var = '""', - is_prop=False, +def format_match( + cond: str | ImmutableVar, + match_cases: List[List[ImmutableVar]], + default: ImmutableVar, ) -> str: - """Format a conditional expression. - - Args: - cond: The cond. - true_value: The value to return if the cond is true. - false_value: The value to return if the cond is false. - is_prop: Whether the cond is a prop - - Returns: - The formatted conditional expression. - """ - # Use Python truthiness. - cond = f"isTrue({cond})" - - def create_var(cond_part): - return Var.create_safe(cond_part, _var_is_string=isinstance(cond_part, str)) - - # Format prop conds. - if is_prop: - true_value = create_var(true_value) - prop1 = true_value._replace( - _var_is_local=True, - ) - - false_value = create_var(false_value) - prop2 = false_value._replace(_var_is_local=True) - # unwrap '{}' to avoid f-string semantics for Var - return f"{cond} ? {prop1._var_name_unwrapped} : {prop2._var_name_unwrapped}" - - # Format component conds. - return wrap(f"{cond} ? {true_value} : {false_value}", "{") - - -def format_match(cond: str | Var, match_cases: List[BaseVar], default: Var) -> str: """Format a match expression whose return type is a Var. Args: @@ -389,24 +320,19 @@ def format_match(cond: str | Var, match_cases: List[BaseVar], default: Var) -> s return_value = case[-1] case_conditions = " ".join( - [ - f"case JSON.stringify({condition._var_name_unwrapped}):" - for condition in conditions - ] - ) - case_code = ( - f"{case_conditions} return ({return_value._var_name_unwrapped}); break;" + [f"case JSON.stringify({str(condition)}):" for condition in conditions] ) + case_code = f"{case_conditions} return ({str(return_value)}); break;" switch_code += case_code - switch_code += f"default: return ({default._var_name_unwrapped}); break;" + switch_code += f"default: return ({str(default)}); break;" switch_code += "};})()" return switch_code def format_prop( - prop: Union[Var, EventChain, ComponentStyle, str], + prop: Union[ImmutableVar, EventChain, ComponentStyle, str], ) -> Union[int, float, str]: """Format a prop. @@ -422,23 +348,16 @@ def format_prop( """ # import here to avoid circular import. from reflex.event import EventChain + from reflex.ivars import ImmutableVar from reflex.utils import serializers - from reflex.vars import VarData try: # Handle var props. - if isinstance(prop, Var): - if not prop._var_is_local or prop._var_is_string: - return str(prop) - if isinstance(prop, BaseVar) and types._issubclass(prop._var_type, str): - var_data = VarData.merge(prop._get_all_var_data()) - if var_data and var_data.interpolations: - return format_f_string_prop(prop) - return format_string(prop._var_full_name) - prop = prop._var_full_name + if isinstance(prop, ImmutableVar): + return str(prop) # Handle event props. - elif isinstance(prop, EventChain): + if isinstance(prop, EventChain): sig = inspect.signature(prop.args_spec) # type: ignore if sig.parameters: arg_def = ",".join(f"_{p}" for p in sig.parameters) @@ -492,9 +411,9 @@ def format_props(*single_props, **key_value_props) -> list[str]: return [ ( f"{name}={format_prop(prop)}" - if isinstance(prop, Var) and not isinstance(prop, ImmutableVar) + if isinstance(prop, ImmutableVar) and not isinstance(prop, ImmutableVar) else ( - f"{name}={{{format_prop(prop if isinstance(prop, Var) else LiteralVar.create(prop))}}}" + f"{name}={{{format_prop(prop if isinstance(prop, ImmutableVar) else LiteralVar.create(prop))}}}" ) ) for name, prop in sorted(key_value_props.items()) @@ -502,8 +421,8 @@ def format_props(*single_props, **key_value_props) -> list[str]: ] + [ ( str(prop) - if isinstance(prop, Var) and not isinstance(prop, ImmutableVar) - else f"{{{str(LiteralVar.create(prop))}}}" + if isinstance(prop, ImmutableVar) and not isinstance(prop, ImmutableVar) + else f"{str(LiteralVar.create(prop))}" ) for prop in single_props ] @@ -574,7 +493,7 @@ def format_event(event_spec: EventSpec) -> str: "`", ) if val._var_is_string - else val._var_full_name + else str(val) ), ) ) @@ -591,44 +510,8 @@ def format_event(event_spec: EventSpec) -> str: return f"Event({', '.join(event_args)})" -def format_event_chain( - event_chain: EventChain | Var[EventChain], - event_arg: Var | None = None, -) -> str: - """Format an event chain as a javascript invocation. - - Args: - event_chain: The event chain to queue on the frontend. - event_arg: The browser-native event (only used to preventDefault). - - Returns: - Compiled javascript code to queue the given event chain on the frontend. - - Raises: - ValueError: When the given event chain is not a valid event chain. - """ - if isinstance(event_chain, Var): - from reflex.event import EventChain - - if event_chain._var_type is not EventChain: - raise ValueError(f"Invalid event chain: {event_chain}") - return "".join( - [ - "(() => {", - format_var(event_chain), - f"; preventDefault({format_var(event_arg)})" if event_arg else "", - "})()", - ] - ) - - chain = ",".join([format_event(event) for event in event_chain.events]) - return "".join( - [ - f"addEvents([{chain}]", - f", {format_var(event_arg)}" if event_arg else "", - ")", - ] - ) +if TYPE_CHECKING: + from reflex.ivars import ImmutableVar def format_queue_events( @@ -640,7 +523,7 @@ def format_queue_events( | None ) = None, args_spec: Optional[ArgsSpec] = None, -) -> Var[EventChain]: +) -> ImmutableVar[EventChain]: """Format a list of event handler / event spec as a javascript callback. The resulting code can be passed to interfaces that expect a callback @@ -669,7 +552,7 @@ def format_queue_events( from reflex.ivars import FunctionVar, ImmutableVar if not events: - return ImmutableVar("(() => null)").to(FunctionVar, EventChain) + return ImmutableVar("(() => null)").to(FunctionVar, EventChain) # type: ignore # If no spec is provided, the function will take no arguments. def _default_args_spec(): @@ -694,7 +577,7 @@ def _default_args_spec(): specs = [call_event_handler(spec, args_spec or _default_args_spec)] elif isinstance(spec, type(lambda: None)): specs = call_event_fn(spec, args_spec or _default_args_spec) # type: ignore - if isinstance(specs, Var): + if isinstance(specs, ImmutableVar): raise ValueError( f"Invalid event spec: {specs}. Expected a list of EventSpecs." ) @@ -705,7 +588,7 @@ def _default_args_spec(): return ImmutableVar( f"{arg_def} => {{queueEvents([{','.join(payloads)}], {constants.CompileVars.SOCKET}); " f"processEvent({constants.CompileVars.SOCKET})}}", - ).to(FunctionVar, EventChain) + ).to(FunctionVar, EventChain) # type: ignore def format_query_params(router_data: dict[str, Any]) -> dict[str, str]: @@ -792,41 +675,6 @@ def format_ref(ref: str) -> str: return f"ref_{clean_ref}" -def format_array_ref(refs: str, idx: Var | None) -> str: - """Format a ref accessed by array. - - Args: - refs : The ref array to access. - idx : The index of the ref in the array. - - Returns: - The formatted ref. - """ - clean_ref = re.sub(r"[^\w]+", "_", refs) - if idx is not None: - # idx._var_is_local = True - return f"refs_{clean_ref}[{str(idx)}]" - return f"refs_{clean_ref}" - - -def format_breadcrumbs(route: str) -> list[tuple[str, str]]: - """Take a route and return a list of tuple for use in breadcrumb. - - Args: - route: The route to transform. - - Returns: - list[tuple[str, str]]: the list of tuples for the breadcrumb. - """ - route_parts = route.lstrip("/").split("/") - - # create and return breadcrumbs - return [ - (part, "/".join(["", *route_parts[: i + 1]])) - for i, part in enumerate(route_parts) - ] - - def format_library_name(library_fullname: str): """Format the name of a library. @@ -857,42 +705,6 @@ def json_dumps(obj: Any) -> str: return json.dumps(obj, ensure_ascii=False, default=serializers.serialize) -def unwrap_vars(value: str) -> str: - """Unwrap var values from a JSON string. - - For example, "{var}" will be unwrapped to "var". - - Args: - value: The JSON string to unwrap. - - Returns: - The unwrapped JSON string. - """ - - def unescape_double_quotes_in_var(m: re.Match) -> str: - prefix = m.group(1) or "" - # Since the outer quotes are removed, the inner escaped quotes must be unescaped. - return prefix + re.sub('\\\\"', '"', m.group(2)) - - # This substitution is necessary to unwrap var values. - return ( - re.sub( - pattern=r""" - (?.*?)? # Optional encoded VarData (non-greedy) - {(.*?)} # extract the value between curly braces (non-greedy) - " # match must end with an unescaped double quote - """, - repl=unescape_double_quotes_in_var, - string=value, - flags=re.VERBOSE, - ) - .replace('"`', "`") - .replace('`"', "`") - ) - - def collect_form_dict_names(form_dict: dict[str, Any]) -> dict[str, Any]: """Collapse keys with consecutive suffixes into a single list value. @@ -915,6 +727,23 @@ def collect_form_dict_names(form_dict: dict[str, Any]) -> dict[str, Any]: return collapsed +def format_array_ref(refs: str, idx: ImmutableVar | None) -> str: + """Format a ref accessed by array. + + Args: + refs : The ref array to access. + idx : The index of the ref in the array. + + Returns: + The formatted ref. + """ + clean_ref = re.sub(r"[^\w]+", "_", refs) + if idx is not None: + # idx._var_is_local = True + return f"refs_{clean_ref}[{str(idx)}]" + return f"refs_{clean_ref}" + + def format_data_editor_column(col: str | dict): """Format a given column into the proper format. @@ -927,6 +756,8 @@ def format_data_editor_column(col: str | dict): Returns: The formatted column. """ + from reflex.ivars import ImmutableVar + if isinstance(col, str): return {"title": col, "id": col.lower(), "type": "str"} @@ -939,7 +770,7 @@ def format_data_editor_column(col: str | dict): col["overlayIcon"] = None return col - if isinstance(col, BaseVar): + if isinstance(col, ImmutableVar): return col raise ValueError( diff --git a/reflex/utils/pyi_generator.py b/reflex/utils/pyi_generator.py index f96a4c0467..cc60418a9a 100644 --- a/reflex/utils/pyi_generator.py +++ b/reflex/utils/pyi_generator.py @@ -19,8 +19,8 @@ from typing import Any, Callable, Iterable, Type, get_args from reflex.components.component import Component +from reflex.ivars.base import ImmutableVar from reflex.utils import types as rx_types -from reflex.vars import Var logger = logging.getLogger("pyi_generator") @@ -69,10 +69,11 @@ # TODO: fix import ordering and unused imports with ruff later DEFAULT_IMPORTS = { "typing": sorted(DEFAULT_TYPING_IMPORTS), - "reflex.vars": ["Var", "BaseVar", "ComputedVar"], + "reflex.vars": ["Var"], "reflex.components.core.breakpoints": ["Breakpoints"], "reflex.event": ["EventChain", "EventHandler", "EventSpec"], "reflex.style": ["Style"], + "reflex.ivars.base": ["ImmutableVar"], } @@ -355,7 +356,7 @@ def _extract_class_props_as_ast_nodes( with contextlib.suppress(AttributeError, KeyError): # Try to get default from pydantic field definition. default = target_class.__fields__[name].default - if isinstance(default, Var): + if isinstance(default, ImmutableVar): default = default._decode() # type: ignore kwargs.append( @@ -433,7 +434,7 @@ def _generate_component_create_functiondef( ast.arg( arg=trigger, annotation=ast.Name( - id="Optional[Union[EventHandler, EventSpec, list, Callable, Var]]" + id="Optional[Union[EventHandler, EventSpec, list, Callable, ImmutableVar]]" ), ), ast.Constant(value=None), diff --git a/reflex/utils/serializers.py b/reflex/utils/serializers.py index 6c36647cc6..0b94be511e 100644 --- a/reflex/utils/serializers.py +++ b/reflex/utils/serializers.py @@ -4,7 +4,6 @@ import functools import json -import types as builtin_types import warnings from datetime import date, datetime, time, timedelta from enum import Enum @@ -26,7 +25,7 @@ from reflex.base import Base from reflex.constants.colors import Color, format_color -from reflex.utils import exceptions, types +from reflex.utils import types # Mapping from type to a serializer. # The serializer should convert the type to a JSON object. @@ -250,7 +249,14 @@ def serialize_base(value: Base) -> str: Returns: The serialized Base. """ - return value.json() + from reflex.ivars import LiteralObjectVar + + return str( + LiteralObjectVar.create( + {k: (None if callable(v) else v) for k, v in value.dict().items()}, + _var_type=type(value), + ) + ) @serializer @@ -263,13 +269,9 @@ def serialize_list(value: Union[List, Tuple, Set]) -> str: Returns: The serialized list. """ - from reflex.utils import format + from reflex.ivars import LiteralArrayVar - # Dump the list to a string. - fprop = format.json_dumps(list(value)) - - # Unwrap var values. - return format.unwrap_vars(fprop) + return str(LiteralArrayVar.create(value)) @serializer @@ -281,30 +283,10 @@ def serialize_dict(prop: Dict[str, Any]) -> str: Returns: The serialized dictionary. - - Raises: - InvalidStylePropError: If the style prop is invalid. """ - # Import here to avoid circular imports. - from reflex.event import EventHandler - from reflex.utils import format - - prop_dict = {} - - for key, value in prop.items(): - if types._issubclass(type(value), Callable): - raise exceptions.InvalidStylePropError( - f"The style prop `{format.to_snake_case(key)}` cannot have " # type: ignore - f"`{value.fn.__qualname__ if isinstance(value, EventHandler) else value.__qualname__ if isinstance(value, builtin_types.FunctionType) else value}`, " - f"an event handler or callable as its value" - ) - prop_dict[key] = value - - # Dump the dict to a string. - fprop = format.json_dumps(prop_dict) + from reflex.ivars import LiteralObjectVar - # Unwrap var values. - return format.unwrap_vars(fprop) + return str(LiteralObjectVar.create(prop)) @serializer(to=str) diff --git a/reflex/utils/types.py b/reflex/utils/types.py index 6c21aa6797..b4b4c10907 100644 --- a/reflex/utils/types.py +++ b/reflex/utils/types.py @@ -95,7 +95,7 @@ def override(func: Callable) -> Callable: StateVar = Union[PrimitiveType, Base, None] StateIterVar = Union[list, set, tuple] -# ArgsSpec = Callable[[Var], list[Var]] +# ArgsSpec = Callable[[ImmutableVar], list[ImmutableVar]] ArgsSpec = Callable @@ -509,14 +509,14 @@ def is_backend_base_variable(name: str, cls: Type) -> bool: if name in cls.inherited_backend_vars: return False + from reflex.ivars.base import is_computed_var + if name in cls.__dict__: value = cls.__dict__[name] if type(value) == classmethod: return False if callable(value): return False - from reflex.ivars.base import ImmutableComputedVar - from reflex.vars import ComputedVar if isinstance( value, @@ -524,10 +524,8 @@ def is_backend_base_variable(name: str, cls: Type) -> bool: types.FunctionType, property, cached_property, - ComputedVar, - ImmutableComputedVar, ), - ): + ) or is_computed_var(value): return False return True @@ -587,11 +585,11 @@ def validate_literal(key: str, value: Any, expected_type: Type, comp_name: str): Raises: ValueError: When the value is not a valid literal. """ - from reflex.vars import Var + from reflex.ivars import ImmutableVar if ( is_literal(expected_type) - and not isinstance(value, Var) # validating vars is not supported yet. + and not isinstance(value, ImmutableVar) # validating vars is not supported yet. and not is_encoded_fstring(value) # f-strings are not supported. and value not in expected_type.__args__ ): diff --git a/reflex/vars.py b/reflex/vars.py index 13481b962e..86816433ea 100644 --- a/reflex/vars.py +++ b/reflex/vars.py @@ -4,41 +4,24 @@ import contextlib import dataclasses -import datetime -import dis -import inspect -import json import random import re import string -import sys -from types import CodeType, FunctionType from typing import ( TYPE_CHECKING, Any, - Callable, Dict, Iterable, - List, - Literal, Optional, Tuple, Type, - Union, _GenericAlias, # type: ignore - cast, - get_args, - get_type_hints, ) from reflex import constants -from reflex.base import Base -from reflex.utils import console, imports, serializers, types +from reflex.utils import imports from reflex.utils.exceptions import ( - VarAttributeError, - VarDependencyError, VarTypeError, - VarValueError, ) # This module used to export ImportVar itself, so we still import it for export here @@ -49,43 +32,15 @@ ParsedImportDict, parse_imports, ) -from reflex.utils.types import get_origin, override if TYPE_CHECKING: + from reflex.ivars import ImmutableVar from reflex.state import BaseState # Set of unique variable names. USED_VARIABLES = set() -# Supported operators for all types. -ALL_OPS = ["==", "!=", "!==", "===", "&&", "||"] -# Delimiters used between function args or operands. -DELIMITERS = [","] -# Mapping of valid operations for different type combinations. -OPERATION_MAPPING = { - (int, int): { - "+", - "-", - "/", - "//", - "*", - "%", - "**", - ">", - "<", - "<=", - ">=", - "|", - "&", - }, - (int, str): {"*"}, - (int, list): {"*"}, - (str, str): {"+", ">", "<", "<=", ">="}, - (float, float): {"+", "-", "/", "//", "*", "%", "**", ">", "<", "<=", ">="}, - (float, int): {"+", "-", "/", "//", "*", "%", "**", ">", "<", "<=", ">="}, - (list, list): {"+", ">", "<", "<=", ">="}, -} # These names were changed in reflex 0.3.0 REPLACED_NAMES = { @@ -99,15 +54,6 @@ "deps": "_deps", } -PYTHON_JS_TYPE_MAP = { - (int, float): "number", - (str,): "string", - (bool,): "boolean", - (list, tuple): "Array", - (dict,): "Object", - (None,): "null", -} - def get_unique_variable_name() -> str: """Get a unique variable name. @@ -122,124 +68,11 @@ def get_unique_variable_name() -> str: return get_unique_variable_name() -class VarData(Base): - """Metadata associated with a Var.""" - - # The name of the enclosing state. - state: str = "" - - # Imports needed to render this var - imports: ParsedImportDict = {} - - # Hooks that need to be present in the component to render this var - hooks: Dict[str, None] = {} - - # Positions of interpolated strings. This is used by the decoder to figure - # out where the interpolations are and only escape the non-interpolated - # segments. - interpolations: List[Tuple[int, int]] = [] - - def __init__( - self, imports: Union[ImportDict, ParsedImportDict] | None = None, **kwargs: Any - ): - """Initialize the var data. - - Args: - imports: The imports needed to render this var. - **kwargs: The var data fields. - """ - if imports: - kwargs["imports"] = parse_imports(imports) - super().__init__(**kwargs) - - @classmethod - def merge(cls, *others: ImmutableVarData | VarData | None) -> VarData | None: - """Merge multiple var data objects. - - Args: - *others: The var data objects to merge. - - Returns: - The merged var data object. - """ - state = "" - _imports = {} - hooks = {} - interpolations = [] - for var_data in others: - if var_data is None: - continue - state = state or var_data.state - _imports = imports.merge_imports(_imports, var_data.imports) - hooks.update( - var_data.hooks - if isinstance(var_data.hooks, dict) - else {k: None for k in var_data.hooks} - ) - interpolations += ( - var_data.interpolations if isinstance(var_data, VarData) else [] - ) - - if state or _imports or hooks or interpolations: - return cls( - state=state, - imports=_imports, - hooks=hooks, - interpolations=interpolations, - ) - return None - - def __bool__(self) -> bool: - """Check if the var data is non-empty. - - Returns: - True if any field is set to a non-default value. - """ - return bool(self.state or self.imports or self.hooks or self.interpolations) - - def __eq__(self, other: Any) -> bool: - """Check if two var data objects are equal. - - Args: - other: The other var data object to compare. - - Returns: - True if all fields are equal and collapsed imports are equal. - """ - if not isinstance(other, VarData): - return False - - # Don't compare interpolations - that's added in by the decoder, and - # not part of the vardata itself. - return ( - self.state == other.state - and self.hooks.keys() == other.hooks.keys() - and imports.collapse_imports(self.imports) - == imports.collapse_imports(other.imports) - ) - - def dict(self) -> dict: - """Convert the var data to a dictionary. - - Returns: - The var data dictionary. - """ - return { - "state": self.state, - "interpolations": list(self.interpolations), - "imports": { - lib: [import_var.dict() for import_var in import_vars] - for lib, import_vars in self.imports.items() - }, - "hooks": self.hooks, - } - - @dataclasses.dataclass( eq=True, frozen=True, ) -class ImmutableVarData: +class VarData: """Metadata associated with a Var.""" # The name of the enclosing state. @@ -273,10 +106,16 @@ def __init__( object.__setattr__(self, "imports", immutable_imports) object.__setattr__(self, "hooks", tuple(hooks or {})) + def old_school_imports(self) -> ImportDict: + """Return the imports as a mutable dict. + + Returns: + The imports as a mutable dict. + """ + return dict((k, list(v)) for k, v in self.imports) + @classmethod - def merge( - cls, *others: ImmutableVarData | VarData | None - ) -> ImmutableVarData | None: + def merge(cls, *others: VarData | None) -> VarData | None: """Merge multiple var data objects. Args: @@ -300,7 +139,7 @@ def merge( ) if state or _imports or hooks: - return ImmutableVarData( + return VarData( state=state, imports=_imports, hooks=hooks, @@ -324,7 +163,7 @@ def __eq__(self, other: Any) -> bool: Returns: True if all fields are equal and collapsed imports are equal. """ - if not isinstance(other, (ImmutableVarData, VarData)): + if not isinstance(other, VarData): return False # Don't compare interpolations - that's added in by the decoder, and @@ -333,16 +172,14 @@ def __eq__(self, other: Any) -> bool: self.state == other.state and self.hooks == ( - other.hooks - if isinstance(other, ImmutableVarData) - else tuple(other.hooks.keys()) + other.hooks if isinstance(other, VarData) else tuple(other.hooks.keys()) ) and imports.collapse_imports(self.imports) == imports.collapse_imports(other.imports) ) @classmethod - def from_state(cls, state: Type[BaseState] | str) -> ImmutableVarData: + def from_state(cls, state: Type[BaseState] | str) -> VarData: """Set the state of the var. Args: @@ -354,7 +191,7 @@ def from_state(cls, state: Type[BaseState] | str) -> ImmutableVarData: from reflex.utils import format state_name = state if isinstance(state, str) else state.get_full_name() - new_var_data = ImmutableVarData( + new_var_data = VarData( state=state_name, hooks={ "const {0} = useContext(StateContexts.{0})".format( @@ -369,7 +206,7 @@ def from_state(cls, state: Type[BaseState] | str) -> ImmutableVarData: return new_var_data -def _decode_var_immutable(value: str) -> tuple[ImmutableVarData | None, str]: +def _decode_var_immutable(value: str) -> tuple[VarData | None, str]: """Decode the state name from a formatted var. Args: @@ -386,15 +223,6 @@ def _decode_var_immutable(value: str) -> tuple[ImmutableVarData | None, str]: offset = 0 - # Initialize some methods for reading json. - var_data_config = VarData().__config__ - - def json_loads(s): - try: - return var_data_config.json_loads(s) - except json.decoder.JSONDecodeError: - return var_data_config.json_loads(var_data_config.json_loads(f'"{s}"')) - # Find all tags. while m := _decode_var_pattern.search(value): start, end = m.span() @@ -410,49 +238,10 @@ def json_loads(s): var_data = var._get_all_var_data() if var_data is not None: - realstart = start + offset - var_datas.append(var_data) - else: - # Read the JSON, pull out the string length, parse the rest as VarData. - data = json_loads(serialized_data) - string_length = data.pop("string_length", None) - var_data = VarData.parse_obj(data) - - # Use string length to compute positions of interpolations. - if string_length is not None: - realstart = start + offset - var_data.interpolations = [(realstart, realstart + string_length)] - - var_datas.append(var_data) offset += end - start - return ImmutableVarData.merge(*var_datas) if var_datas else None, value - - -def _encode_var(value: Var) -> str: - """Encode the state name into a formatted var. - - Args: - value: The value to encode the state name into. - - Returns: - The encoded var. - """ - if value._var_data: - from reflex.utils.serializers import serialize - - final_value = str(value) - data = value._var_data.dict() - data["string_length"] = len(final_value) - data_json = value._var_data.__config__.json_dumps(data, default=serialize) - - return ( - f"{constants.REFLEX_VAR_OPENING_TAG}{data_json}{constants.REFLEX_VAR_CLOSING_TAG}" - + final_value - ) - - return str(value) + return VarData.merge(*var_datas) if var_datas else None, value # Compile regex for finding reflex var tags. @@ -462,68 +251,7 @@ def _encode_var(value: Var) -> str: _decode_var_pattern = re.compile(_decode_var_pattern_re, flags=re.DOTALL) # Defined global immutable vars. -_global_vars: Dict[int, Var] = {} - - -def _decode_var(value: str) -> tuple[VarData | None, str]: - """Decode the state name from a formatted var. - - Args: - value: The value to extract the state name from. - - Returns: - The extracted state name and the value without the state name. - """ - var_datas = [] - if isinstance(value, str): - # fast path if there is no encoded VarData - if constants.REFLEX_VAR_OPENING_TAG not in value: - return None, value - - offset = 0 - - # Initialize some methods for reading json. - var_data_config = VarData().__config__ - - def json_loads(s): - try: - return var_data_config.json_loads(s) - except json.decoder.JSONDecodeError: - return var_data_config.json_loads(var_data_config.json_loads(f'"{s}"')) - - # Find all tags. - while m := _decode_var_pattern.search(value): - start, end = m.span() - value = value[:start] + value[end:] - - serialized_data = m.group(1) - - if serialized_data.isnumeric() or ( - serialized_data[0] == "-" and serialized_data[1:].isnumeric() - ): - # This is a global immutable var. - var = _global_vars[int(serialized_data)] - var_data = var._var_data - - if var_data is not None: - realstart = start + offset - - var_datas.append(var_data) - else: - # Read the JSON, pull out the string length, parse the rest as VarData. - data = json_loads(serialized_data) - string_length = data.pop("string_length", None) - var_data = VarData.parse_obj(data) - - # Use string length to compute positions of interpolations. - if string_length is not None: - realstart = start + offset - var_data.interpolations = [(realstart, realstart + string_length)] - - var_datas.append(var_data) - offset += end - start - - return VarData.merge(*var_datas) if var_datas else None, value +_global_vars: Dict[int, ImmutableVar] = {} def _extract_var_data(value: Iterable) -> list[VarData | None]: @@ -535,12 +263,13 @@ def _extract_var_data(value: Iterable) -> list[VarData | None]: Returns: The extracted VarDatas. """ + from reflex.ivars import ImmutableVar from reflex.style import Style var_datas = [] with contextlib.suppress(TypeError): for sub in value: - if isinstance(sub, Var): + if isinstance(sub, ImmutableVar): var_datas.append(sub._var_data) elif not isinstance(sub, str): # Recurse into dict values. @@ -563,24 +292,6 @@ def _extract_var_data(value: Iterable) -> list[VarData | None]: class Var: """An abstract var.""" - # The name of the var. - _var_name: str - - # The type of the var. - _var_type: Type - - # Whether this is a local javascript variable. - _var_is_local: bool - - # Whether the var is a string literal. - _var_is_string: bool - - # _var_full_name should be prefixed with _var_state - _var_full_name_needs_state_prefix: bool - - # Extra metadata associated with the Var - _var_data: Optional[VarData] - @classmethod def create( cls, @@ -588,7 +299,7 @@ def create( _var_is_local: bool = True, _var_is_string: bool | None = None, _var_data: Optional[VarData] = None, - ) -> Var | None: + ) -> ImmutableVar | None: """Create a var from a value. Args: @@ -599,59 +310,45 @@ def create( Returns: The var. - - Raises: - VarTypeError: If the value is JSON-unserializable. """ - from reflex.utils import format + from reflex.ivars import ImmutableVar, LiteralVar # Check for none values. if value is None: return None # If the value is already a var, do nothing. - if isinstance(value, Var): + if isinstance(value, ImmutableVar): return value - # Try to pull the imports and hooks from contained values. + # If the value is not a string, create a LiteralVar. if not isinstance(value, str): - _var_data = VarData.merge(*_extract_var_data(value), _var_data) - - # Try to serialize the value. - type_ = type(value) - if type_ in types.JSONType: - name = value - else: - name, serialized_type = serializers.serialize(value, get_type=True) - if ( - serialized_type is not None - and _var_is_string is None - and issubclass(serialized_type, str) - ): - _var_is_string = True - if name is None: - raise VarTypeError( - f"No JSON serializer found for var {value} of type {type_}." + return LiteralVar.create( + value, + _var_data=_var_data, + ) + + # if _var_is_string is provided, use that + if _var_is_string is False: + return ImmutableVar.create( + value, + _var_data=_var_data, ) - name = name if isinstance(name, str) else format.json_dumps(name) - - if _var_is_string is None and type_ is str: - console.deprecate( - feature_name=f"Creating a Var ({value}) from a string without specifying _var_is_string", - reason=( - "Specify _var_is_string=False to create a Var that is not a string literal. " - "In the future, creating a Var from a string will be treated as a string literal " - "by default." - ), - deprecation_version="0.5.4", - removal_version="0.6.0", + if _var_is_string is True: + return LiteralVar.create( + value, + _var_data=_var_data, ) - return BaseVar( - _var_name=name, - _var_type=type_, - _var_is_local=_var_is_local, - _var_is_string=_var_is_string if _var_is_string is not None else False, + # Otherwise, rely on _var_is_local + if _var_is_local is True: + return LiteralVar.create( + value, + _var_data=_var_data, + ) + + return ImmutableVar.create( + value, _var_data=_var_data, ) @@ -662,7 +359,7 @@ def create_safe( _var_is_local: bool = True, _var_is_string: bool | None = None, _var_data: Optional[VarData] = None, - ) -> Var: + ) -> ImmutableVar: """Create a var from a value, asserting that it is not None. Args: @@ -695,164 +392,6 @@ def __class_getitem__(cls, type_: str) -> _GenericAlias: """ return _GenericAlias(cls, type_) - def __post_init__(self) -> None: - """Post-initialize the var.""" - # Decode any inline Var markup and apply it to the instance - _var_data, _var_name = _decode_var(self._var_name) - if _var_data: - self._var_name = _var_name - self._var_data = VarData.merge(self._var_data, _var_data) - - def _replace(self, merge_var_data=None, **kwargs: Any) -> BaseVar: - """Make a copy of this Var with updated fields. - - Args: - merge_var_data: VarData to merge into the existing VarData. - **kwargs: Var fields to update. - - Returns: - A new BaseVar with the updated fields overwriting the corresponding fields in this Var. - - Raises: - TypeError: If kwargs contains keys that are not allowed. - """ - field_values = dict( - _var_name=kwargs.pop("_var_name", self._var_name), - _var_type=kwargs.pop("_var_type", self._var_type), - _var_is_local=kwargs.pop("_var_is_local", self._var_is_local), - _var_is_string=kwargs.pop("_var_is_string", self._var_is_string), - _var_full_name_needs_state_prefix=kwargs.pop( - "_var_full_name_needs_state_prefix", - self._var_full_name_needs_state_prefix, - ), - _var_data=VarData.merge( - kwargs.pop("_var_data", self._var_data), merge_var_data - ), - ) - - if kwargs: - unexpected_kwargs = ", ".join(kwargs.keys()) - raise TypeError(f"Unexpected keyword arguments: {unexpected_kwargs}") - - return BaseVar(**field_values) - - def _decode(self) -> Any: - """Decode Var as a python value. - - Note that Var with state set cannot be decoded python-side and will be - returned as full_name. - - Returns: - The decoded value or the Var name. - """ - if self._var_is_string: - return self._var_name - try: - return json.loads(self._var_name) - except ValueError: - try: - return json.loads(self.json()) - except (ValueError, NotImplementedError): - return self._var_name - - def equals(self, other: Var) -> bool: - """Check if two vars are equal. - - Args: - other: The other var to compare. - - Returns: - Whether the vars are equal. - """ - from reflex.ivars import ImmutableVar - - if isinstance(other, ImmutableVar) or isinstance(self, ImmutableVar): - return ( - self._var_name == other._var_name - and self._var_type == other._var_type - and ImmutableVarData.merge(self._get_all_var_data()) - == ImmutableVarData.merge(other._get_all_var_data()) - ) - - return ( - self._var_name == other._var_name - and self._var_type == other._var_type - and self._var_is_local == other._var_is_local - and self._var_full_name_needs_state_prefix - == other._var_full_name_needs_state_prefix - and self._var_data == other._var_data - ) - - def _merge(self, other) -> Var: - """Merge two or more dicts. - - Args: - other: The other var to merge. - - Returns: - The merged var. - """ - if other is None: - return self._replace() - if not isinstance(other, Var): - other = Var.create(other, _var_is_string=False) - return self._replace( - _var_name=f"{{...{self._var_name}, ...{other._var_name}}}" # type: ignore - ) - - def to_string(self, json: bool = True) -> Var: - """Convert a var to a string. - - Args: - json: Whether to convert to a JSON string. - - Returns: - The stringified var. - """ - fn = "JSON.stringify" if json else "String" - return self.operation(fn=fn, type_=str) - - def to_int(self) -> Var: - """Convert a var to an int. - - Returns: - The parseInt var. - """ - return self.operation(fn="parseInt", type_=int) - - def __hash__(self) -> int: - """Define a hash function for a var. - - Returns: - The hash of the var. - """ - return hash((self._var_name, str(self._var_type))) - - def __str__(self) -> str: - """Wrap the var so it can be used in templates. - - Returns: - The wrapped var, i.e. {state.var}. - """ - from reflex.utils import format - - if self._var_is_local: - console.deprecate( - feature_name="Local Vars", - reason=( - "Setting _var_is_local to True does not have any effect anymore. " - "Use the new ImmutableVar instead." - ), - deprecation_version="0.5.9", - removal_version="0.6.0", - ) - out = self._var_full_name - else: - out = format.wrap(self._var_full_name, "{") - if self._var_is_string: - out = format.format_string(out) - return out - def __bool__(self) -> bool: """Raise exception if using Var in a boolean context. @@ -860,7 +399,7 @@ def __bool__(self) -> bool: VarTypeError: when attempting to bool-ify the Var. """ raise VarTypeError( - f"Cannot convert Var {self._var_full_name!r} to bool for use with `if`, `and`, `or`, and `not`. " + f"Cannot convert Var {str(self)!r} to bool for use with `if`, `and`, `or`, and `not`. " "Instead use `rx.cond` and bitwise operators `&` (and), `|` (or), `~` (invert)." ) @@ -871,1174 +410,59 @@ def __iter__(self) -> Any: VarTypeError: when attempting to iterate over the Var. """ raise VarTypeError( - f"Cannot iterate over Var {self._var_full_name!r}. Instead use `rx.foreach`." + f"Cannot iterate over Var {str(self)!r}. Instead use `rx.foreach`." ) - def __format__(self, format_spec: str) -> str: - """Format the var into a Javascript equivalent to an f-string. - - Args: - format_spec: The format specifier (Ignored for now). + def __contains__(self, _: Any) -> ImmutableVar: + """Override the 'in' operator to alert the user that it is not supported. - Returns: - The formatted var. + Raises: + VarTypeError: the operation is not supported """ - # Encode the _var_data into the formatted output for tracking purposes. - str_self = _encode_var(self) - if self._var_is_local: - return str_self - return f"${str_self}" + raise VarTypeError( + "'in' operator not supported for Var types, use Var.contains() instead." + ) - def __getitem__(self, i: Any) -> Var: - """Index into a var. + def __get__(self, instance: Any, owner: Any) -> ImmutableVar: + """Return the value of the Var. Args: - i: The index to index into. + instance: The instance of the Var. + owner: The owner of the Var. Returns: - The indexed var. - - Raises: - VarTypeError: If the var is not indexable. + The value of the Var. """ - from reflex.utils import format - - # Indexing is only supported for strings, lists, tuples, dicts, and dataframes. - if not ( - types._issubclass(self._var_type, Union[List, Dict, Tuple, str]) - or types.is_dataframe(self._var_type) - ): - if self._var_type == Any: - raise VarTypeError( - "Could not index into var of type Any. (If you are trying to index into a state var, " - "add the correct type annotation to the var.)" - ) - raise VarTypeError( - f"Var {self._var_name} of type {self._var_type} does not support indexing." - ) - - # The type of the indexed var. - type_ = Any - - # Convert any vars to local vars. - if isinstance(i, Var): - i = i._replace(_var_is_local=True) - - # Handle list/tuple/str indexing. - if types._issubclass(self._var_type, Union[List, Tuple, str]): - # List/Tuple/String indices must be ints, slices, or vars. - if ( - not isinstance(i, types.get_args(Union[int, slice, Var])) - or isinstance(i, Var) - and not i._var_type == int - ): - raise VarTypeError("Index must be an integer or an integer var.") - - # Handle slices first. - if isinstance(i, slice): - # Get the start and stop indices. - start = i.start or 0 - stop = i.stop or "undefined" - - # Use the slice function. - return self._replace( - _var_name=f"{self._var_name}.slice({start}, {stop})", - _var_is_string=False, - ) - - # Get the type of the indexed var. - if types.is_generic_alias(self._var_type): - index = i if not isinstance(i, Var) else 0 - type_ = types.get_args(self._var_type) - type_ = type_[index % len(type_)] if type_ else Any - elif types._issubclass(self._var_type, str): - type_ = str - - # Use `at` to support negative indices. - return self._replace( - _var_name=f"{self._var_name}.at({i})", - _var_type=type_, - _var_is_string=False, - ) + return self # type: ignore - # Dictionary / dataframe indexing. - # Tuples are currently not supported as indexes. - if ( - ( - types._issubclass(self._var_type, Dict) - or types.is_dataframe(self._var_type) - ) - and not isinstance(i, types.get_args(Union[int, str, float, Var])) - ) or ( - isinstance(i, Var) - and not types._issubclass( - i._var_type, types.get_args(Union[int, str, float]) - ) - ): - raise VarTypeError( - "Index must be one of the following types: int, str, int or str Var" - ) - # Get the type of the indexed var. - if isinstance(i, str): - i = format.wrap(i, '"') - type_ = ( - types.get_args(self._var_type)[1] - if types.is_generic_alias(self._var_type) - else Any - ) - - # Use normal indexing here. - return self._replace( - _var_name=f"{self._var_name}[{i}]", - _var_type=type_, - _var_is_string=False, - ) - - def __getattribute__(self, name: str) -> Any: - """Get a var attribute. + @classmethod + def range( + cls, + v1: ImmutableVar | int = 0, + v2: ImmutableVar | int | None = None, + step: ImmutableVar | int | None = None, + ) -> ImmutableVar: + """Return an iterator over indices from v1 to v2 (or 0 to v1). Args: - name: The name of the attribute. + v1: The start of the range or end of range if v2 is not given. + v2: The end of the range. + step: The number of numbers between each item. Returns: - The var attribute. - - Raises: - VarAttributeError: If the attribute cannot be found, or if __getattr__ fallback should be used. + A var representing range operation. """ - try: - var_attribute = super().__getattribute__(name) - if ( - not name.startswith("_") - and name not in Var.__dict__ - and name not in BaseVar.__dict__ - ): - # Check if the attribute should be accessed through the Var instead of - # accessing one of the Var operations - type_ = types.get_attribute_access_type( - super().__getattribute__("_var_type"), name - ) - if type_ is not None: - raise VarAttributeError( - f"{name} is being accessed through the Var." - ) - # Return the attribute as-is. - return var_attribute - except VarAttributeError: - raise # fall back to __getattr__ anyway - - def __getattr__(self, name: str) -> Var: - """Get a var attribute. + from reflex.ivars import ArrayVar - Args: - name: The name of the attribute. + return ArrayVar.range(v1, v2, step) # type: ignore - Returns: - The var attribute. + def upcast(self) -> ImmutableVar: + """Upcast a Var to an ImmutableVar. - Raises: - VarAttributeError: If the var is wrongly annotated or can't find attribute. - VarTypeError: If an annotation to the var isn't provided. + Returns: + The upcasted Var. """ - # Check if the attribute is one of the class fields. - if not name.startswith("_"): - if self._var_type == Any: - raise VarTypeError( - f"You must provide an annotation for the state var `{self._var_full_name}`. Annotation cannot be `{self._var_type}`" - ) from None - is_optional = types.is_optional(self._var_type) - type_ = types.get_attribute_access_type(self._var_type, name) - - if type_ is not None: - return self._replace( - _var_name=f"{self._var_name}{'?' if is_optional else ''}.{name}", - _var_type=type_, - ) - - if name in REPLACED_NAMES: - raise VarAttributeError( - f"Field {name!r} was renamed to {REPLACED_NAMES[name]!r}" - ) - - raise VarAttributeError( - f"The State var `{self._var_full_name}` has no attribute '{name}' or may have been annotated " - f"wrongly." - ) - - raise VarAttributeError( - f"The State var has no attribute '{name}' or may have been annotated wrongly.", - ) - - def operation( - self, - op: str = "", - other: Var | None = None, - type_: Type | None = None, - flip: bool = False, - fn: str | None = None, - invoke_fn: bool = False, - ) -> Var: - """Perform an operation on a var. - - Args: - op: The operation to perform. - other: The other var to perform the operation on. - type_: The type of the operation result. - flip: Whether to flip the order of the operation. - fn: A function to apply to the operation. - invoke_fn: Whether to invoke the function. - - Returns: - The operation result. - - Raises: - VarTypeError: If the operation between two operands is invalid. - VarValueError: If flip is set to true and value of operand is not provided - """ - from reflex.utils import format - - if isinstance(other, str): - other = Var.create(json.dumps(other), _var_is_string=False) - else: - other = Var.create(other, _var_is_string=False) - - type_ = type_ or self._var_type - - if other is None and flip: - raise VarValueError( - "flip_operands cannot be set to True if the value of 'other' operand is not provided" - ) - - left_operand, right_operand = (other, self) if flip else (self, other) - - def get_operand_full_name(operand): - # operand vars that are string literals need to be wrapped in back ticks. - return ( - operand._var_name_unwrapped - if operand._var_is_string - and not operand._var_state - and operand._var_is_local - else operand._var_full_name - ) - - if other is not None: - # check if the operation between operands is valid. - if op and not self.is_valid_operation( - types.get_base_class(left_operand._var_type), # type: ignore - types.get_base_class(right_operand._var_type), # type: ignore - op, - ): - raise VarTypeError( - f"Unsupported Operand type(s) for {op}: `{left_operand._var_full_name}` of type {left_operand._var_type.__name__} and `{right_operand._var_full_name}` of type {right_operand._var_type.__name__}" # type: ignore - ) - - left_operand_full_name = get_operand_full_name(left_operand) - right_operand_full_name = get_operand_full_name(right_operand) - - left_operand_full_name = format.wrap(left_operand_full_name, "(") - right_operand_full_name = format.wrap(right_operand_full_name, "(") - - # apply function to operands - if fn is not None: - if invoke_fn: - # invoke the function on left operand. - operation_name = ( - f"{left_operand_full_name}.{fn}({right_operand_full_name})" # type: ignore - ) - else: - # pass the operands as arguments to the function. - operation_name = ( - f"{left_operand_full_name} {op} {right_operand_full_name}" # type: ignore - ) - operation_name = f"{fn}({operation_name})" - else: - # apply operator to operands (left operand right_operand) - operation_name = ( - f"{left_operand_full_name} {op} {right_operand_full_name}" # type: ignore - ) - operation_name = format.wrap(operation_name, "(") - else: - # apply operator to left operand ( left_operand) - operation_name = f"{op}{get_operand_full_name(self)}" - # apply function to operands - if fn is not None: - operation_name = ( - f"{fn}({operation_name})" - if not invoke_fn - else f"{get_operand_full_name(self)}.{fn}()" - ) - - return self._replace( - _var_name=operation_name, - _var_type=type_, - _var_is_string=False, - _var_full_name_needs_state_prefix=False, - merge_var_data=other._var_data if other is not None else None, - ) - - @staticmethod - def is_valid_operation( - operand1_type: Type, operand2_type: Type, operator: str - ) -> bool: - """Check if an operation between two operands is valid. - - Args: - operand1_type: Type of the operand - operand2_type: Type of the second operand - operator: The operator. - - Returns: - Whether operation is valid or not - - """ - if operator in ALL_OPS or operator in DELIMITERS: - return True - - # bools are subclasses of ints - pair = tuple( - sorted( - [ - int if operand1_type == bool else operand1_type, - int if operand2_type == bool else operand2_type, - ], - key=lambda x: x.__name__, - ) - ) - return pair in OPERATION_MAPPING and operator in OPERATION_MAPPING[pair] - - def compare(self, op: str, other: Var) -> Var: - """Compare two vars with inequalities. - - Args: - op: The comparison operator. - other: The other var to compare with. - - Returns: - The comparison result. - """ - return self.operation(op, other, bool) - - def __invert__(self) -> Var: - """Invert a var. - - Returns: - The inverted var. - """ - return self.operation("!", type_=bool) - - def __neg__(self) -> Var: - """Negate a var. - - Returns: - The negated var. - """ - return self.operation(fn="-") - - def __abs__(self) -> Var: - """Get the absolute value of a var. - - Returns: - A var with the absolute value. - """ - return self.operation(fn="Math.abs") - - def length(self) -> Var: - """Get the length of a list var. - - Returns: - A var with the absolute value. - - Raises: - VarTypeError: If the var is not a list. - """ - if not types._issubclass(self._var_type, List): - raise VarTypeError(f"Cannot get length of non-list var {self}.") - return self._replace( - _var_name=f"{self._var_name}.length", - _var_type=int, - _var_is_string=False, - ) - - def _type(self) -> Var: - """Get the type of the Var in Javascript. - - Returns: - A var representing the type check. - """ - return self._replace( - _var_name=f"typeof {self._var_full_name}", - _var_type=str, - _var_is_string=False, - _var_full_name_needs_state_prefix=False, - ) - - def __eq__(self, other: Union[Var, Type]) -> Var: - """Perform an equality comparison. - - Args: - other: The other var to compare with. - - Returns: - A var representing the equality comparison. - """ - for python_types, js_type in PYTHON_JS_TYPE_MAP.items(): - if not isinstance(other, Var) and other in python_types: - return self.compare("===", Var.create(js_type, _var_is_string=True)) # type: ignore - return self.compare("===", other) - - def __ne__(self, other: Union[Var, Type]) -> Var: - """Perform an inequality comparison. - - Args: - other: The other var to compare with. - - Returns: - A var representing the inequality comparison. - """ - for python_types, js_type in PYTHON_JS_TYPE_MAP.items(): - if not isinstance(other, Var) and other in python_types: - return self.compare("!==", Var.create(js_type, _var_is_string=True)) # type: ignore - return self.compare("!==", other) - - def __gt__(self, other: Var) -> Var: - """Perform a greater than comparison. - - Args: - other: The other var to compare with. - - Returns: - A var representing the greater than comparison. - """ - return self.compare(">", other) - - def __ge__(self, other: Var) -> Var: - """Perform a greater than or equal to comparison. - - Args: - other: The other var to compare with. - - Returns: - A var representing the greater than or equal to comparison. - """ - return self.compare(">=", other) - - def __lt__(self, other: Var) -> Var: - """Perform a less than comparison. - - Args: - other: The other var to compare with. - - Returns: - A var representing the less than comparison. - """ - return self.compare("<", other) - - def __le__(self, other: Var) -> Var: - """Perform a less than or equal to comparison. - - Args: - other: The other var to compare with. - - Returns: - A var representing the less than or equal to comparison. - """ - return self.compare("<=", other) - - def __add__(self, other: Var, flip=False) -> Var: - """Add two vars. - - Args: - other: The other var to add. - flip: Whether to flip operands. - - Returns: - A var representing the sum. - """ - other_type = other._var_type if isinstance(other, Var) else type(other) - # For list-list addition, javascript concatenates the content of the lists instead of - # merging the list, and for that reason we use the spread operator available through spreadArraysOrObjects - # utility function - if ( - types.get_base_class(self._var_type) == list - and types.get_base_class(other_type) == list - ): - return self.operation( - ",", other, fn="spreadArraysOrObjects", flip=flip - )._replace( - merge_var_data=VarData( - imports={ - f"/{constants.Dirs.STATE_PATH}": [ - ImportVar(tag="spreadArraysOrObjects") - ] - }, - ), - ) - return self.operation("+", other, flip=flip) - - def __radd__(self, other: Var) -> Var: - """Add two vars. - - Args: - other: The other var to add. - - Returns: - A var representing the sum. - """ - return self.__add__(other=other, flip=True) - - def __sub__(self, other: Var) -> Var: - """Subtract two vars. - - Args: - other: The other var to subtract. - - Returns: - A var representing the difference. - """ - return self.operation("-", other) - - def __rsub__(self, other: Var) -> Var: - """Subtract two vars. - - Args: - other: The other var to subtract. - - Returns: - A var representing the difference. - """ - return self.operation("-", other, flip=True) - - def __mul__(self, other: Var, flip=True) -> Var: - """Multiply two vars. - - Args: - other: The other var to multiply. - flip: Whether to flip operands - - Returns: - A var representing the product. - """ - other_type = other._var_type if isinstance(other, Var) else type(other) - # For str-int multiplication, we use the repeat function. - # i.e "hello" * 2 is equivalent to "hello".repeat(2) in js. - if (types.get_base_class(self._var_type), types.get_base_class(other_type)) in [ - (int, str), - (str, int), - ]: - return self.operation(other=other, fn="repeat", invoke_fn=True) - - # For list-int multiplication, we use the Array function. - # i.e ["hello"] * 2 is equivalent to Array(2).fill().map(() => ["hello"]).flat() in js. - if (types.get_base_class(self._var_type), types.get_base_class(other_type)) in [ - (int, list), - (list, int), - ]: - other_name = other._var_full_name if isinstance(other, Var) else other - name = f"Array({other_name}).fill().map(() => {self._var_full_name}).flat()" - return self._replace( - _var_name=name, - _var_type=str, - _var_is_string=False, - _var_full_name_needs_state_prefix=False, - ) - - return self.operation("*", other) - - def __rmul__(self, other: Var) -> Var: - """Multiply two vars. - - Args: - other: The other var to multiply. - - Returns: - A var representing the product. - """ - return self.__mul__(other=other, flip=True) - - def __pow__(self, other: Var) -> Var: - """Raise a var to a power. - - Args: - other: The power to raise to. - - Returns: - A var representing the power. - """ - return self.operation(",", other, fn="Math.pow") - - def __rpow__(self, other: Var) -> Var: - """Raise a var to a power. - - Args: - other: The power to raise to. - - Returns: - A var representing the power. - """ - return self.operation(",", other, flip=True, fn="Math.pow") - - def __truediv__(self, other: Var) -> Var: - """Divide two vars. - - Args: - other: The other var to divide. - - Returns: - A var representing the quotient. - """ - return self.operation("/", other) - - def __rtruediv__(self, other: Var) -> Var: - """Divide two vars. - - Args: - other: The other var to divide. - - Returns: - A var representing the quotient. - """ - return self.operation("/", other, flip=True) - - def __floordiv__(self, other: Var) -> Var: - """Divide two vars. - - Args: - other: The other var to divide. - - Returns: - A var representing the quotient. - """ - return self.operation("/", other, fn="Math.floor") - - def __mod__(self, other: Var) -> Var: - """Get the remainder of two vars. - - Args: - other: The other var to divide. - - Returns: - A var representing the remainder. - """ - return self.operation("%", other) - - def __rmod__(self, other: Var) -> Var: - """Get the remainder of two vars. - - Args: - other: The other var to divide. - - Returns: - A var representing the remainder. - """ - return self.operation("%", other, flip=True) - - def __and__(self, other: Var) -> Var: - """Perform a logical and. - - Args: - other: The other var to perform the logical AND with. - - Returns: - A var representing the logical AND. - - Note: - This method provides behavior specific to JavaScript, where it returns the JavaScript - equivalent code (using the '&&' operator) of a logical AND operation. - In JavaScript, the - logical OR operator '&&' is used for Boolean logic, and this method emulates that behavior - by returning the equivalent code as a Var instance. - - In Python, logical AND 'and' operates differently, evaluating expressions immediately, making - it challenging to override the behavior entirely. - Therefore, this method leverages the - bitwise AND '__and__' operator for custom JavaScript-like behavior. - - Example: - >>> var1 = Var.create(True) - >>> var2 = Var.create(False) - >>> js_code = var1 & var2 - >>> print(js_code._var_full_name) - '(true && false)' - """ - return self.operation("&&", other, type_=bool) - - def __rand__(self, other: Var) -> Var: - """Perform a logical and. - - Args: - other: The other var to perform the logical AND with. - - Returns: - A var representing the logical AND. - - Note: - This method provides behavior specific to JavaScript, where it returns the JavaScript - equivalent code (using the '&&' operator) of a logical AND operation. - In JavaScript, the - logical OR operator '&&' is used for Boolean logic, and this method emulates that behavior - by returning the equivalent code as a Var instance. - - In Python, logical AND 'and' operates differently, evaluating expressions immediately, making - it challenging to override the behavior entirely. - Therefore, this method leverages the - bitwise AND '__rand__' operator for custom JavaScript-like behavior. - - Example: - >>> var1 = Var.create(True) - >>> var2 = Var.create(False) - >>> js_code = var1 & var2 - >>> print(js_code._var_full_name) - '(false && true)' - """ - return self.operation("&&", other, type_=bool, flip=True) - - def __or__(self, other: Var) -> Var: - """Perform a logical or. - - Args: - other: The other var to perform the logical or with. - - Returns: - A var representing the logical or. - - Note: - This method provides behavior specific to JavaScript, where it returns the JavaScript - equivalent code (using the '||' operator) of a logical OR operation. In JavaScript, the - logical OR operator '||' is used for Boolean logic, and this method emulates that behavior - by returning the equivalent code as a Var instance. - - In Python, logical OR 'or' operates differently, evaluating expressions immediately, making - it challenging to override the behavior entirely. Therefore, this method leverages the - bitwise OR '__or__' operator for custom JavaScript-like behavior. - - Example: - >>> var1 = Var.create(True) - >>> var2 = Var.create(False) - >>> js_code = var1 | var2 - >>> print(js_code._var_full_name) - '(true || false)' - """ - return self.operation("||", other, type_=bool) - - def __ror__(self, other: Var) -> Var: - """Perform a logical or. - - Args: - other: The other var to perform the logical or with. - - Returns: - A var representing the logical or. - - Note: - This method provides behavior specific to JavaScript, where it returns the JavaScript - equivalent code (using the '||' operator) of a logical OR operation. In JavaScript, the - logical OR operator '||' is used for Boolean logic, and this method emulates that behavior - by returning the equivalent code as a Var instance. - - In Python, logical OR 'or' operates differently, evaluating expressions immediately, making - it challenging to override the behavior entirely. Therefore, this method leverages the - bitwise OR '__or__' operator for custom JavaScript-like behavior. - - Example: - >>> var1 = Var.create(True) - >>> var2 = Var.create(False) - >>> js_code = var1 | var2 - >>> print(js_code) - 'false || true' - """ - return self.operation("||", other, type_=bool, flip=True) - - def __contains__(self, _: Any) -> Var: - """Override the 'in' operator to alert the user that it is not supported. - - Raises: - VarTypeError: the operation is not supported - """ - raise VarTypeError( - "'in' operator not supported for Var types, use Var.contains() instead." - ) - - def contains(self, other: Any, field: Union[Var, None] = None) -> Var: - """Check if a var contains the object `other`. - - Args: - other: The object to check. - field: Optionally specify a field to check on both object and the other var. - - Raises: - VarTypeError: If the var is not a valid type: dict, list, tuple or str. - - Returns: - A var representing the contain check. - """ - if not (types._issubclass(self._var_type, Union[dict, list, tuple, str, set])): - raise VarTypeError( - f"Var {self._var_full_name} of type {self._var_type} does not support contains check." - ) - method = ( - "hasOwnProperty" - if types.get_base_class(self._var_type) == dict - else "includes" - ) - if isinstance(other, str): - other = Var.create(json.dumps(other), _var_is_string=True) - elif not isinstance(other, Var): - other = Var.create(other, _var_is_string=False) - if types._issubclass(self._var_type, Dict): - return self._replace( - _var_name=f"{self._var_name}.{method}({other._var_full_name})", - _var_type=bool, - _var_is_string=False, - merge_var_data=other._var_data, - ) - else: # str, list, tuple - # For strings, the left operand must be a string. - if types._issubclass(self._var_type, str) and not types._issubclass( - other._var_type, str - ): - raise VarTypeError( - f"'in ' requires string as left operand, not {other._var_type}" - ) - - _var_name = None - if field is None: - _var_name = f"{self._var_name}.includes({other._var_full_name})" - else: - field = Var.create_safe(field, _var_is_string=isinstance(field, str)) - _var_name = f"{self._var_name}.some(e=>e[{field._var_name_unwrapped}]==={other._var_full_name})" - - return self._replace( - _var_name=_var_name, - _var_type=bool, - _var_is_string=False, - merge_var_data=other._var_data, - ) - - def reverse(self) -> Var: - """Reverse a list var. - - Raises: - VarTypeError: If the var is not a list. - - Returns: - A var with the reversed list. - """ - if not types._issubclass(self._var_type, list): - raise VarTypeError(f"Cannot reverse non-list var {self._var_full_name}.") - - return self._replace( - _var_name=f"[...{self._var_full_name}].reverse()", - _var_is_string=False, - _var_full_name_needs_state_prefix=False, - ) - - def lower(self) -> Var: - """Convert a string var to lowercase. - - Returns: - A var with the lowercase string. - - Raises: - VarTypeError: If the var is not a string. - """ - if not types._issubclass(self._var_type, str): - raise VarTypeError( - f"Cannot convert non-string var {self._var_full_name} to lowercase." - ) - - return self._replace( - _var_name=f"{self._var_name}.toLowerCase()", - _var_is_string=False, - _var_type=str, - ) - - def upper(self) -> Var: - """Convert a string var to uppercase. - - Returns: - A var with the uppercase string. - - Raises: - VarTypeError: If the var is not a string. - """ - if not types._issubclass(self._var_type, str): - raise VarTypeError( - f"Cannot convert non-string var {self._var_full_name} to uppercase." - ) - - return self._replace( - _var_name=f"{self._var_name}.toUpperCase()", - _var_is_string=False, - _var_type=str, - ) - - def strip(self, other: str | Var[str] = " ") -> Var: - """Strip a string var. - - Args: - other: The string to strip the var with. - - Returns: - A var with the stripped string. - - Raises: - VarTypeError: If the var is not a string. - """ - if not types._issubclass(self._var_type, str): - raise VarTypeError(f"Cannot strip non-string var {self._var_full_name}.") - - other = ( - Var.create_safe(json.dumps(other), _var_is_string=False) - if isinstance(other, str) - else other - ) - - return self._replace( - _var_name=f"{self._var_name}.replace(/^${other._var_full_name}|${other._var_full_name}$/g, '')", - _var_is_string=False, - merge_var_data=other._var_data, - ) - - def split(self, other: str | Var[str] = " ") -> Var: - """Split a string var into a list. - - Args: - other: The string to split the var with. - - Returns: - A var with the list. - - Raises: - VarTypeError: If the var is not a string. - """ - if not types._issubclass(self._var_type, str): - raise VarTypeError(f"Cannot split non-string var {self._var_full_name}.") - - other = ( - Var.create_safe(json.dumps(other), _var_is_string=False) - if isinstance(other, str) - else other - ) - - return self._replace( - _var_name=f"{self._var_name}.split({other._var_full_name})", - _var_is_string=False, - _var_type=List[str], - merge_var_data=other._var_data, - ) - - def join(self, other: str | Var[str] | None = None) -> Var: - """Join a list var into a string. - - Args: - other: The string to join the list with. - - Returns: - A var with the string. - - Raises: - VarTypeError: If the var is not a list. - """ - if not types._issubclass(self._var_type, list): - raise VarTypeError(f"Cannot join non-list var {self._var_full_name}.") - - if other is None: - other = Var.create_safe('""', _var_is_string=False) - if isinstance(other, str): - other = Var.create_safe(json.dumps(other), _var_is_string=False) - else: - other = Var.create_safe(other, _var_is_string=False) - - return self._replace( - _var_name=f"{self._var_name}.join({other._var_full_name})", - _var_is_string=False, - _var_type=str, - merge_var_data=other._var_data, - ) - - def foreach(self, fn: Callable) -> Var: - """Return a list of components. after doing a foreach on this var. - - Args: - fn: The function to call on each component. - - Returns: - A var representing foreach operation. - - Raises: - VarTypeError: If the var is not a list. - """ - inner_types = get_args(self._var_type) - if not inner_types: - raise VarTypeError( - f"Cannot foreach over non-sequence var {self._var_full_name} of type {self._var_type}." - ) - arg = BaseVar( - _var_name=get_unique_variable_name(), - _var_type=inner_types[0], - ) - index = BaseVar( - _var_name=get_unique_variable_name(), - _var_type=int, - ) - fn_signature = inspect.signature(fn) - fn_args = (arg, index) - fn_ret = fn(*fn_args[: len(fn_signature.parameters)]) - return self._replace( - _var_name=f"{self._var_full_name}.map(({arg._var_name}, {index._var_name}) => {fn_ret})", - _var_is_string=False, - ) - - @classmethod - def range( - cls, - v1: Var | int = 0, - v2: Var | int | None = None, - step: Var | int | None = None, - ) -> Var: - """Return an iterator over indices from v1 to v2 (or 0 to v1). - - Args: - v1: The start of the range or end of range if v2 is not given. - v2: The end of the range. - step: The number of numbers between each item. - - Returns: - A var representing range operation. - - Raises: - VarTypeError: If the var is not an int. - """ - if not isinstance(v1, Var): - v1 = Var.create_safe(v1) - if v1._var_type != int: - raise VarTypeError(f"Cannot get range on non-int var {v1._var_full_name}.") - if not isinstance(v2, Var): - v2 = Var.create(v2) - if v2 is None: - v2 = Var.create_safe("undefined", _var_is_string=False) - elif v2._var_type != int: - raise VarTypeError(f"Cannot get range on non-int var {v2._var_full_name}.") - - if not isinstance(step, Var): - step = Var.create(step) - if step is None: - step = Var.create_safe(1) - elif step._var_type != int: - raise VarTypeError( - f"Cannot get range on non-int var {step._var_full_name}." - ) - - return BaseVar( - _var_name=f"Array.from(range({v1._var_full_name}, {v2._var_full_name}, {step._var_name}))", - _var_type=List[int], - _var_is_local=False, - _var_data=VarData.merge( - v1._var_data, - v2._var_data, - step._var_data, - VarData( - imports={ - "/utils/helpers/range.js": [ - ImportVar(tag="range", is_default=True), - ], - }, - ), - ), - ) - - def to(self, type_: Type) -> Var: - """Convert the type of the var. - - Args: - type_: The type to convert to. - - Returns: - The converted var. - """ - return self._replace(_var_type=type_) - - def as_ref(self) -> Var: - """Convert the var to a ref. - - Returns: - The var as a ref. - """ - return self._replace( - _var_name=f"refs['{self._var_full_name}']", - _var_is_local=True, - _var_is_string=False, - _var_full_name_needs_state_prefix=False, - merge_var_data=VarData( - imports={ - f"/{constants.Dirs.STATE_PATH}": [imports.ImportVar(tag="refs")], - }, - ), - ) - - @property - def _var_full_name(self) -> str: - """Get the full name of the var. - - Returns: - The full name of the var. - """ - from reflex.utils import format - - if not self._var_full_name_needs_state_prefix: - return self._var_name - return ( - self._var_name - if self._var_data is None or self._var_data.state == "" - else ".".join( - [format.format_state_name(self._var_data.state), self._var_name] - ) - ) - - def _var_set_state(self, state: Type[BaseState] | str) -> Any: - """Set the state of the var. - - Args: - state: The state to set or the full name of the state. - - Returns: - The var with the set state. - """ - from reflex.utils import format - - state_name = state if isinstance(state, str) else state.get_full_name() - new_var_data = VarData( - state=state_name, - hooks={ - "const {0} = useContext(StateContexts.{0})".format( - format.format_state_name(state_name) - ): None - }, - imports={ - f"/{constants.Dirs.CONTEXTS_PATH}": [ImportVar(tag="StateContexts")], - "react": [ImportVar(tag="useContext")], - }, - ) - self._var_data = VarData.merge(self._var_data, new_var_data) - self._var_full_name_needs_state_prefix = True - return self - - @property - def _var_state(self) -> str: - """Compat method for getting the state. - - Returns: - The state name associated with the var. - """ - return self._var_data.state if self._var_data else "" - - def _get_all_var_data(self) -> VarData | None: - """Get all the var data. - - Returns: - The var data. - """ - return self._var_data + return self # type: ignore def json(self) -> str: """Serialize the var to a JSON string. @@ -2048,565 +472,8 @@ def json(self) -> str: """ raise NotImplementedError("Var subclasses must implement the json method.") - @property - def _var_name_unwrapped(self) -> str: - """Get the var str without wrapping in curly braces. - - Returns: - The str var without the wrapped curly braces - """ - from reflex.style import Style - - generic_alias = types.is_generic_alias(self._var_type) - - type_ = get_origin(self._var_type) if generic_alias else self._var_type - wrapped_var = str(self) - - return ( - wrapped_var - if not self._var_state - and not generic_alias - and (types._issubclass(type_, dict) or types._issubclass(type_, Style)) - else wrapped_var.strip("{}") - ) - - -# Allow automatic serialization of Var within JSON structures -serializers.serializer(_encode_var) - - -@dataclasses.dataclass( - eq=False, - **{"slots": True} if sys.version_info >= (3, 10) else {}, -) -class BaseVar(Var): - """A base (non-computed) var of the app state.""" - - # The name of the var. - _var_name: str = dataclasses.field() - - # The type of the var. - _var_type: Type = dataclasses.field(default=Any) - - # Whether this is a local javascript variable. - _var_is_local: bool = dataclasses.field(default=False) - - # Whether the var is a string literal. - _var_is_string: bool = dataclasses.field(default=False) - - # _var_full_name should be prefixed with _var_state - _var_full_name_needs_state_prefix: bool = dataclasses.field(default=False) - - # Extra metadata associated with the Var - _var_data: Optional[VarData] = dataclasses.field(default=None) - - def __hash__(self) -> int: - """Define a hash function for a var. - - Returns: - The hash of the var. - """ - return hash((self._var_name, str(self._var_type))) - - def get_default_value(self) -> Any: - """Get the default value of the var. - - Returns: - The default value of the var. - - Raises: - ImportError: If the var is a dataframe and pandas is not installed. - """ - if types.is_optional(self._var_type): - return None - - type_ = ( - get_origin(self._var_type) - if types.is_generic_alias(self._var_type) - else self._var_type - ) - if type_ is Literal: - args = get_args(self._var_type) - return args[0] if args else None - if issubclass(type_, str): - return "" - if issubclass(type_, types.get_args(Union[int, float])): - return 0 - if issubclass(type_, bool): - return False - if issubclass(type_, list): - return [] - if issubclass(type_, dict): - return {} - if issubclass(type_, tuple): - return () - if types.is_dataframe(type_): - try: - import pandas as pd - - return pd.DataFrame() - except ImportError as e: - raise ImportError( - "Please install pandas to use dataframes in your app." - ) from e - return set() if issubclass(type_, set) else None - - def get_setter_name(self, include_state: bool = True) -> str: - """Get the name of the var's generated setter function. - - Args: - include_state: Whether to include the state name in the setter name. - - Returns: - The name of the setter function. - """ - setter = constants.SETTER_PREFIX + self._var_name - if self._var_data is None: - return setter - if not include_state or self._var_data.state == "": - return setter - return ".".join((self._var_data.state, setter)) - - def get_setter(self) -> Callable[[BaseState, Any], None]: - """Get the var's setter function. - - Returns: - A function that that creates a setter for the var. - """ - - def setter(state: BaseState, value: Any): - """Get the setter for the var. - - Args: - state: The state within which we add the setter function. - value: The value to set. - """ - if self._var_type in [int, float]: - try: - value = self._var_type(value) - setattr(state, self._var_name, value) - except ValueError: - console.debug( - f"{type(state).__name__}.{self._var_name}: Failed conversion of {value} to '{self._var_type.__name__}'. Value not set.", - ) - else: - setattr(state, self._var_name, value) - - setter.__qualname__ = self.get_setter_name() - - return setter - - -@dataclasses.dataclass(init=False, eq=False) -class ComputedVar(Var, property): - """A field with computed getters.""" - - # Whether to track dependencies and cache computed values - _cache: bool = dataclasses.field(default=False) - - # Whether the computed var is a backend var - _backend: bool = dataclasses.field(default=False) - - # The initial value of the computed var - _initial_value: Any | types.Unset = dataclasses.field(default=types.Unset()) - - # Explicit var dependencies to track - _static_deps: set[str] = dataclasses.field(default_factory=set) - - # Whether var dependencies should be auto-determined - _auto_deps: bool = dataclasses.field(default=True) - - # Interval at which the computed var should be updated - _update_interval: Optional[datetime.timedelta] = dataclasses.field(default=None) - - # The name of the var. - _var_name: str = dataclasses.field() - - # The type of the var. - _var_type: Type = dataclasses.field(default=Any) - - # Whether this is a local javascript variable. - _var_is_local: bool = dataclasses.field(default=False) - - # Whether the var is a string literal. - _var_is_string: bool = dataclasses.field(default=False) - - # _var_full_name should be prefixed with _var_state - _var_full_name_needs_state_prefix: bool = dataclasses.field(default=False) - - # Extra metadata associated with the Var - _var_data: Optional[VarData] = dataclasses.field(default=None) - - def __init__( - self, - fget: Callable[[BaseState], Any], - initial_value: Any | types.Unset = types.Unset(), - cache: bool = False, - deps: Optional[List[Union[str, Var]]] = None, - auto_deps: bool = True, - interval: Optional[Union[int, datetime.timedelta]] = None, - backend: bool | None = None, - **kwargs, - ): - """Initialize a ComputedVar. - - Args: - fget: The getter function. - initial_value: The initial value of the computed var. - cache: Whether to cache the computed value. - deps: Explicit var dependencies to track. - auto_deps: Whether var dependencies should be auto-determined. - interval: Interval at which the computed var should be updated. - backend: Whether the computed var is a backend var. - **kwargs: additional attributes to set on the instance - - Raises: - TypeError: If the computed var dependencies are not Var instances or var names. - """ - if backend is None: - backend = fget.__name__.startswith("_") - self._backend = backend - - self._initial_value = initial_value - self._cache = cache - if isinstance(interval, int): - interval = datetime.timedelta(seconds=interval) - self._update_interval = interval - if deps is None: - deps = [] - else: - for dep in deps: - if isinstance(dep, Var): - continue - if isinstance(dep, str) and dep != "": - continue - raise TypeError( - "ComputedVar dependencies must be Var instances or var names (non-empty strings)." - ) - self._static_deps = { - dep._var_name if isinstance(dep, Var) else dep for dep in deps - } - self._auto_deps = auto_deps - property.__init__(self, fget) - kwargs["_var_name"] = kwargs.pop("_var_name", fget.__name__) - kwargs["_var_type"] = kwargs.pop("_var_type", self._determine_var_type()) - BaseVar.__init__(self, **kwargs) # type: ignore - - @override - def _replace(self, merge_var_data=None, **kwargs: Any) -> ComputedVar: - """Replace the attributes of the ComputedVar. - - Args: - merge_var_data: VarData to merge into the existing VarData. - **kwargs: Var fields to update. - - Returns: - The new ComputedVar instance. - - Raises: - TypeError: If kwargs contains keys that are not allowed. - """ - field_values = dict( - fget=kwargs.pop("fget", self.fget), - initial_value=kwargs.pop("initial_value", self._initial_value), - cache=kwargs.pop("cache", self._cache), - deps=kwargs.pop("deps", self._static_deps), - auto_deps=kwargs.pop("auto_deps", self._auto_deps), - interval=kwargs.pop("interval", self._update_interval), - backend=kwargs.pop("backend", self._backend), - _var_name=kwargs.pop("_var_name", self._var_name), - _var_type=kwargs.pop("_var_type", self._var_type), - _var_is_local=kwargs.pop("_var_is_local", self._var_is_local), - _var_is_string=kwargs.pop("_var_is_string", self._var_is_string), - _var_full_name_needs_state_prefix=kwargs.pop( - "_var_full_name_needs_state_prefix", - self._var_full_name_needs_state_prefix, - ), - _var_data=VarData.merge(self._var_data, merge_var_data), - ) - - if kwargs: - unexpected_kwargs = ", ".join(kwargs.keys()) - raise TypeError(f"Unexpected keyword arguments: {unexpected_kwargs}") - - return ComputedVar(**field_values) - - @property - def _cache_attr(self) -> str: - """Get the attribute used to cache the value on the instance. - - Returns: - An attribute name. - """ - return f"__cached_{self._var_name}" - - @property - def _last_updated_attr(self) -> str: - """Get the attribute used to store the last updated timestamp. - - Returns: - An attribute name. - """ - return f"__last_updated_{self._var_name}" - - def needs_update(self, instance: BaseState) -> bool: - """Check if the computed var needs to be updated. - - Args: - instance: The state instance that the computed var is attached to. - - Returns: - True if the computed var needs to be updated, False otherwise. - """ - if self._update_interval is None: - return False - last_updated = getattr(instance, self._last_updated_attr, None) - if last_updated is None: - return True - return datetime.datetime.now() - last_updated > self._update_interval - - def __get__(self, instance: BaseState | None, owner): - """Get the ComputedVar value. - - If the value is already cached on the instance, return the cached value. - - Args: - instance: the instance of the class accessing this computed var. - owner: the class that this descriptor is attached to. - - Returns: - The value of the var for the given instance. - """ - if instance is None or not self._cache: - return super().__get__(instance, owner) - - # handle caching - if not hasattr(instance, self._cache_attr) or self.needs_update(instance): - # Set cache attr on state instance. - setattr(instance, self._cache_attr, super().__get__(instance, owner)) - # Ensure the computed var gets serialized to redis. - instance._was_touched = True - # Set the last updated timestamp on the state instance. - setattr(instance, self._last_updated_attr, datetime.datetime.now()) - return getattr(instance, self._cache_attr) - - def _deps( - self, - objclass: Type, - obj: FunctionType | CodeType | None = None, - self_name: Optional[str] = None, - ) -> set[str]: - """Determine var dependencies of this ComputedVar. - - Save references to attributes accessed on "self". Recursively called - when the function makes a method call on "self" or define comprehensions - or nested functions that may reference "self". - - Args: - objclass: the class obj this ComputedVar is attached to. - obj: the object to disassemble (defaults to the fget function). - self_name: if specified, look for this name in LOAD_FAST and LOAD_DEREF instructions. - - Returns: - A set of variable names accessed by the given obj. - - Raises: - VarValueError: if the function references the get_state, parent_state, or substates attributes - (cannot track deps in a related state, only implicitly via parent state). - """ - if not self._auto_deps: - return self._static_deps - d = self._static_deps.copy() - if obj is None: - fget = property.__getattribute__(self, "fget") - if fget is not None: - obj = cast(FunctionType, fget) - else: - return set() - with contextlib.suppress(AttributeError): - # unbox functools.partial - obj = cast(FunctionType, obj.func) # type: ignore - with contextlib.suppress(AttributeError): - # unbox EventHandler - obj = cast(FunctionType, obj.fn) # type: ignore - - if self_name is None and isinstance(obj, FunctionType): - try: - # the first argument to the function is the name of "self" arg - self_name = obj.__code__.co_varnames[0] - except (AttributeError, IndexError): - self_name = None - if self_name is None: - # cannot reference attributes on self if method takes no args - return set() - - invalid_names = ["get_state", "parent_state", "substates", "get_substate"] - self_is_top_of_stack = False - for instruction in dis.get_instructions(obj): - if ( - instruction.opname in ("LOAD_FAST", "LOAD_DEREF") - and instruction.argval == self_name - ): - # bytecode loaded the class instance to the top of stack, next load instruction - # is referencing an attribute on self - self_is_top_of_stack = True - continue - if self_is_top_of_stack and instruction.opname in ( - "LOAD_ATTR", - "LOAD_METHOD", - ): - try: - ref_obj = getattr(objclass, instruction.argval) - except Exception: - ref_obj = None - if instruction.argval in invalid_names: - raise VarValueError( - f"Cached var {self._var_full_name} cannot access arbitrary state via `{instruction.argval}`." - ) - if callable(ref_obj): - # recurse into callable attributes - d.update( - self._deps( - objclass=objclass, - obj=ref_obj, - ) - ) - # recurse into property fget functions - elif isinstance(ref_obj, property) and not isinstance( - ref_obj, ComputedVar - ): - d.update( - self._deps( - objclass=objclass, - obj=ref_obj.fget, # type: ignore - ) - ) - elif ( - instruction.argval in objclass.backend_vars - or instruction.argval in objclass.vars - ): - # var access - d.add(instruction.argval) - elif instruction.opname == "LOAD_CONST" and isinstance( - instruction.argval, CodeType - ): - # recurse into nested functions / comprehensions, which can reference - # instance attributes from the outer scope - d.update( - self._deps( - objclass=objclass, - obj=instruction.argval, - self_name=self_name, - ) - ) - self_is_top_of_stack = False - return d - - def mark_dirty(self, instance) -> None: - """Mark this ComputedVar as dirty. - - Args: - instance: the state instance that needs to recompute the value. - """ - with contextlib.suppress(AttributeError): - delattr(instance, self._cache_attr) - - def _determine_var_type(self) -> Type: - """Get the type of the var. - - Returns: - The type of the var. - """ - hints = get_type_hints(property.__getattribute__(self, "fget")) - if "return" in hints: - return hints["return"] - return Any - - -def computed_var( - fget: Callable[[BaseState], Any] | None = None, - initial_value: Any | types.Unset = types.Unset(), - cache: bool = False, - deps: Optional[List[Union[str, Var]]] = None, - auto_deps: bool = True, - interval: Optional[Union[datetime.timedelta, int]] = None, - backend: bool | None = None, - **kwargs, -) -> ComputedVar | Callable[[Callable[[BaseState], Any]], ComputedVar]: - """A ComputedVar decorator with or without kwargs. - - Args: - fget: The getter function. - initial_value: The initial value of the computed var. - cache: Whether to cache the computed value. - deps: Explicit var dependencies to track. - auto_deps: Whether var dependencies should be auto-determined. - interval: Interval at which the computed var should be updated. - backend: Whether the computed var is a backend var. - **kwargs: additional attributes to set on the instance - - Returns: - A ComputedVar instance. - - Raises: - ValueError: If caching is disabled and an update interval is set. - VarDependencyError: If user supplies dependencies without caching. - """ - if cache is False and interval is not None: - raise ValueError("Cannot set update interval without caching.") - - if cache is False and (deps is not None or auto_deps is False): - raise VarDependencyError("Cannot track dependencies without caching.") - - if fget is not None: - return ComputedVar(fget=fget, cache=cache) - - def wrapper(fget: Callable[[BaseState], Any]) -> ComputedVar: - return ComputedVar( - fget=fget, - initial_value=initial_value, - cache=cache, - deps=deps, - auto_deps=auto_deps, - interval=interval, - backend=backend, - **kwargs, - ) - - return wrapper - - -class CallableVar(BaseVar): - """Decorate a Var-returning function to act as both a Var and a function. - - This is used as a compatibility shim for replacing Var objects in the - API with functions that return a family of Var. - """ - - def __init__(self, fn: Callable[..., BaseVar]): - """Initialize a CallableVar. - - Args: - fn: The function to decorate (must return Var) - """ - self.fn = fn - default_var = fn() - super().__init__(**dataclasses.asdict(default_var)) - - def __call__(self, *args, **kwargs) -> BaseVar: - """Call the decorated function. - - Args: - *args: The args to pass to the function. - **kwargs: The kwargs to pass to the function. - - Returns: - The Var returned from calling the function. - """ - return self.fn(*args, **kwargs) - -def get_uuid_string_var() -> Var: +def get_uuid_string_var() -> ImmutableVar: """Return a Var that generates a single memoized UUID via .web/utils/state.js. useMemo with an empty dependency array ensures that the generated UUID is @@ -2615,6 +482,7 @@ def get_uuid_string_var() -> Var: Returns: A Var that generates a UUID at runtime. """ + from reflex.ivars import ImmutableVar from reflex.utils.imports import ImportVar unique_uuid_var = get_unique_variable_name() @@ -2626,7 +494,7 @@ def get_uuid_string_var() -> Var: hooks={f"const {unique_uuid_var} = useMemo(generateUUID, [])": None}, ) - return BaseVar( + return ImmutableVar( _var_name=unique_uuid_var, _var_type=str, _var_data=unique_uuid_var_data, diff --git a/reflex/vars.pyi b/reflex/vars.pyi deleted file mode 100644 index 8c923f03e0..0000000000 --- a/reflex/vars.pyi +++ /dev/null @@ -1,221 +0,0 @@ -"""Generated with stubgen from mypy, then manually edited, do not regen.""" - -from __future__ import annotations - -import datetime -from dataclasses import dataclass -from types import FunctionType -from typing import ( - Any, - Callable, - Dict, - Iterable, - List, - Optional, - Set, - Tuple, - Type, - Union, - _GenericAlias, # type: ignore - overload, -) - -from _typeshed import Incomplete - -from reflex import constants as constants -from reflex.base import Base as Base -from reflex.state import BaseState as BaseState -from reflex.state import State as State -from reflex.utils import console as console -from reflex.utils import format as format -from reflex.utils import types as types -from reflex.utils.imports import ImmutableParsedImportDict, ImportDict, ParsedImportDict - -USED_VARIABLES: Incomplete - -def get_unique_variable_name() -> str: ... -def _encode_var(value: Var) -> str: ... - -_global_vars: Dict[int, Var] - -def _decode_var(value: str) -> tuple[VarData, str]: ... -def _extract_var_data(value: Iterable) -> list[VarData | None]: ... - -class VarData(Base): - state: str = "" - imports: Union[ImportDict, ParsedImportDict] = {} - hooks: Dict[str, None] = {} - interpolations: List[Tuple[int, int]] = [] - @classmethod - def merge(cls, *others: ImmutableVarData | VarData | None) -> VarData | None: ... - -class ImmutableVarData: - state: str = "" - imports: ImmutableParsedImportDict = tuple() - hooks: Tuple[str, ...] = tuple() - def __init__( - self, - state: str = "", - imports: ImportDict | ParsedImportDict | None = None, - hooks: dict[str, None] | None = None, - ) -> None: ... - @classmethod - def merge( - cls, *others: ImmutableVarData | VarData | None - ) -> ImmutableVarData | None: ... - @classmethod - def from_state(cls, state: Type[BaseState] | str) -> ImmutableVarData: ... - -def _decode_var_immutable(value: str) -> tuple[ImmutableVarData, str]: ... - -class Var: - _var_name: str - _var_type: Type - _var_is_local: bool = False - _var_is_string: bool = False - _var_full_name_needs_state_prefix: bool = False - _var_data: VarData | None = None - @classmethod - def create( - cls, - value: Any, - _var_is_local: bool = True, - _var_is_string: bool | None = None, - _var_data: VarData | None = None, - ) -> Optional[Var]: ... - @classmethod - def create_safe( - cls, - value: Any, - _var_is_local: bool = True, - _var_is_string: bool | None = None, - _var_data: VarData | None = None, - ) -> Var: ... - @classmethod - def __class_getitem__(cls, type_: Type) -> _GenericAlias: ... - def _replace(self, merge_var_data=None, **kwargs: Any) -> BaseVar: ... - def equals(self, other: Var) -> bool: ... - def to_string(self) -> Var: ... - def __hash__(self) -> int: ... - def __format__(self, format_spec: str) -> str: ... - def __getitem__(self, i: Any) -> Var: ... - def __getattribute__(self, name: str) -> Var: ... - def operation( - self, - op: str = ..., - other: Optional[Var] = ..., - type_: Optional[Type] = ..., - flip: bool = ..., - fn: Optional[str] = ..., - ) -> Var: ... - def compare(self, op: str, other: Var) -> Var: ... - def __invert__(self) -> Var: ... - def __neg__(self) -> Var: ... - def __abs__(self) -> Var: ... - def length(self) -> Var: ... - def __eq__(self, other: Var) -> Var: ... - def __ne__(self, other: Var) -> Var: ... - def __gt__(self, other: Var) -> Var: ... - def __ge__(self, other: Var) -> Var: ... - def __lt__(self, other: Var) -> Var: ... - def __le__(self, other: Var) -> Var: ... - def __add__(self, other: Var) -> Var: ... - def __radd__(self, other: Var) -> Var: ... - def __sub__(self, other: Var) -> Var: ... - def __rsub__(self, other: Var) -> Var: ... - def __mul__(self, other: Var) -> Var: ... - def __rmul__(self, other: Var) -> Var: ... - def __pow__(self, other: Var) -> Var: ... - def __rpow__(self, other: Var) -> Var: ... - def __truediv__(self, other: Var) -> Var: ... - def __rtruediv__(self, other: Var) -> Var: ... - def __floordiv__(self, other: Var) -> Var: ... - def __mod__(self, other: Var) -> Var: ... - def __rmod__(self, other: Var) -> Var: ... - def __and__(self, other: Var) -> Var: ... - def __rand__(self, other: Var) -> Var: ... - def __or__(self, other: Var) -> Var: ... - def __ror__(self, other: Var) -> Var: ... - def __contains__(self, _: Any) -> Var: ... - def contains(self, other: Any, field: Union[Var, None] = None) -> Var: ... - def reverse(self) -> Var: ... - def foreach(self, fn: Callable) -> Var: ... - @classmethod - def range( - cls, - v1: Var | int = 0, - v2: Var | int | None = None, - step: Var | int | None = None, - ) -> Var: ... - def to(self, type_: Type) -> Var: ... - def as_ref(self) -> Var: ... - @property - def _var_full_name(self) -> str: ... - def _var_set_state(self, state: Type[BaseState] | str) -> Any: ... - def _get_all_var_data(self) -> VarData | ImmutableVarData: ... - def json(self) -> str: ... - def _type(self) -> Var: ... - -@dataclass(eq=False) -class BaseVar(Var): - _var_name: str - _var_type: Any - _var_is_local: bool = False - _var_is_string: bool = False - _var_full_name_needs_state_prefix: bool = False - _var_data: VarData | None = None - def __hash__(self) -> int: ... - def get_default_value(self) -> Any: ... - def get_setter_name(self, include_state: bool = ...) -> str: ... - def get_setter(self) -> Callable[[BaseState, Any], None]: ... - -@dataclass(init=False) -class ComputedVar(Var): - _var_cache: bool - fget: FunctionType - @property - def _cache_attr(self) -> str: ... - def __get__(self, instance, owner): ... - def _deps(self, objclass: Type, obj: Optional[FunctionType] = ...) -> Set[str]: ... - def _replace(self, merge_var_data=None, **kwargs: Any) -> ComputedVar: ... - def mark_dirty(self, instance) -> None: ... - def needs_update(self, instance) -> bool: ... - def _determine_var_type(self) -> Type: ... - @overload - def __init__( - self, - fget: Callable[[BaseState], Any], - **kwargs, - ) -> None: ... - @overload - def __init__(self, func) -> None: ... - -@overload -def computed_var( - fget: Callable[[BaseState], Any] | None = None, - initial_value: Any | types.Unset = types.Unset(), - cache: bool = False, - deps: Optional[List[Union[str, Var]]] = None, - auto_deps: bool = True, - interval: Optional[Union[datetime.timedelta, int]] = None, - **kwargs, -) -> Callable[[Callable[[Any], Any]], ComputedVar]: ... -@overload -def computed_var(fget: Callable[[Any], Any]) -> ComputedVar: ... -@overload -def cached_var( - fget: Callable[[BaseState], Any] | None = None, - initial_value: Any | types.Unset = types.Unset(), - deps: Optional[List[Union[str, Var]]] = None, - auto_deps: bool = True, - interval: Optional[Union[datetime.timedelta, int]] = None, - **kwargs, -) -> Callable[[Callable[[Any], Any]], ComputedVar]: ... -@overload -def cached_var(fget: Callable[[Any], Any]) -> ComputedVar: ... - -class CallableVar(BaseVar): - def __init__(self, fn: Callable[..., BaseVar]): ... - def __call__(self, *args, **kwargs) -> BaseVar: ... - -def get_uuid_string_var() -> Var: ... diff --git a/tests/components/core/test_banner.py b/tests/components/core/test_banner.py index f46ee16b1a..02b0309029 100644 --- a/tests/components/core/test_banner.py +++ b/tests/components/core/test_banner.py @@ -19,12 +19,14 @@ def test_websocket_target_url(): def test_connection_banner(): banner = ConnectionBanner.create() _imports = banner._get_all_imports(collapse=True) - assert tuple(_imports) == ( - "react", - "/utils/context", - "/utils/state", - "@radix-ui/themes@^3.0.0", - "/env.json", + assert sorted(tuple(_imports)) == sorted( + ( + "react", + "/utils/context", + "/utils/state", + "@radix-ui/themes@^3.0.0", + "/env.json", + ) ) msg = "Connection error" @@ -35,12 +37,14 @@ def test_connection_banner(): def test_connection_modal(): modal = ConnectionModal.create() _imports = modal._get_all_imports(collapse=True) - assert tuple(_imports) == ( - "react", - "/utils/context", - "/utils/state", - "@radix-ui/themes@^3.0.0", - "/env.json", + assert sorted(tuple(_imports)) == sorted( + ( + "react", + "/utils/context", + "/utils/state", + "@radix-ui/themes@^3.0.0", + "/env.json", + ) ) msg = "Connection error" diff --git a/tests/components/core/test_colors.py b/tests/components/core/test_colors.py index ace7adad6e..4907bb4861 100644 --- a/tests/components/core/test_colors.py +++ b/tests/components/core/test_colors.py @@ -54,8 +54,8 @@ def create_color_var(color): ], ) def test_color(color, expected): - assert color._var_is_string or color._var_type is str - assert color._var_full_name == expected + assert color._var_type is str + assert str(color) == expected if color._var_type == Color: assert str(color) == f"{{`{expected}`}}" else: diff --git a/tests/components/core/test_cond.py b/tests/components/core/test_cond.py index 53f8e06406..eb2fe200a1 100644 --- a/tests/components/core/test_cond.py +++ b/tests/components/core/test_cond.py @@ -9,7 +9,6 @@ from reflex.ivars.base import ImmutableVar, LiteralVar, immutable_computed_var from reflex.state import BaseState, State from reflex.utils.format import format_state_name -from reflex.vars import Var @pytest.fixture @@ -76,7 +75,7 @@ def test_validate_cond(cond_state: BaseState): (32, 0), ("hello", ""), (2.3, 0.0), - (Var.create("a"), Var.create("b")), + (LiteralVar.create("a"), LiteralVar.create("b")), ], ) def test_prop_cond(c1: Any, c2: Any): @@ -92,18 +91,18 @@ def test_prop_cond(c1: Any, c2: Any): c2, ) - assert isinstance(prop_cond, Var) - if not isinstance(c1, Var): + assert isinstance(prop_cond, ImmutableVar) + if not isinstance(c1, ImmutableVar): c1 = json.dumps(c1) - if not isinstance(c2, Var): + if not isinstance(c2, ImmutableVar): c2 = json.dumps(c2) - assert str(prop_cond) == f"(true ? {c1} : {c2})" + assert str(prop_cond) == f"(true ? {str(c1)} : {str(c2)})" def test_cond_no_mix(): """Test if cond can't mix components and props.""" with pytest.raises(ValueError): - cond(True, Var.create("hello"), Text.create("world")) + cond(True, LiteralVar.create("hello"), Text.create("world")) def test_cond_no_else(): diff --git a/tests/components/core/test_debounce.py b/tests/components/core/test_debounce.py index 95feb7ae69..c4a18e6106 100644 --- a/tests/components/core/test_debounce.py +++ b/tests/components/core/test_debounce.py @@ -4,7 +4,7 @@ import reflex as rx from reflex.components.core.debounce import DEFAULT_DEBOUNCE_TIMEOUT -from reflex.ivars.base import LiteralVar +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.state import BaseState @@ -100,7 +100,7 @@ def test_render_with_key(): def test_render_with_special_props(): - special_prop = rx.Var.create_safe("{foo_bar}", _var_is_string=False) + special_prop = ImmutableVar.create_safe("{foo_bar}") tag = rx.debounce_input( rx.input( on_change=S.on_change, diff --git a/tests/components/core/test_foreach.py b/tests/components/core/test_foreach.py index f1fae2577f..53459f92db 100644 --- a/tests/components/core/test_foreach.py +++ b/tests/components/core/test_foreach.py @@ -12,8 +12,10 @@ ) from reflex.components.radix.themes.layout.box import box from reflex.components.radix.themes.typography.text import text +from reflex.ivars.base import ImmutableVar +from reflex.ivars.number import NumberVar +from reflex.ivars.sequence import ArrayVar from reflex.state import BaseState, ComponentState -from reflex.vars import Var class ForEachState(BaseState): @@ -113,7 +115,7 @@ def display_colors_set(color): return box(text(color)) -def display_nested_list_element(element: Var[str], index: Var[int]): +def display_nested_list_element(element: ArrayVar[List[str]], index: NumberVar[int]): assert element._var_type == List[str] assert index._var_type == int return box(text(element[index])) @@ -236,7 +238,7 @@ def test_foreach_render(state_var, render_fn, render_dict): # Make sure the index vars are unique. arg_index = rend["arg_index"] - assert isinstance(arg_index, Var) + assert isinstance(arg_index, ImmutableVar) assert arg_index._var_name not in seen_index_vars assert arg_index._var_type == int seen_index_vars.add(arg_index._var_name) diff --git a/tests/components/core/test_match.py b/tests/components/core/test_match.py index 1843b914d5..f2cc97f250 100644 --- a/tests/components/core/test_match.py +++ b/tests/components/core/test_match.py @@ -4,9 +4,9 @@ import reflex as rx from reflex.components.core.match import Match +from reflex.ivars.base import ImmutableVar from reflex.state import BaseState from reflex.utils.exceptions import MatchTypeError -from reflex.vars import Var class MatchState(BaseState): @@ -135,8 +135,8 @@ def test_match_vars(cases, expected): expected: The expected var full name. """ match_comp = Match.create(MatchState.value, *cases) - assert isinstance(match_comp, Var) - assert match_comp._var_full_name == expected + assert isinstance(match_comp, ImmutableVar) + assert str(match_comp) == expected def test_match_on_component_without_default(): @@ -261,7 +261,7 @@ def test_match_case_tuple_elements(match_case): rx.text("default value"), ), 'Match cases should have the same return types. Case 3 with return value ` {"first value"} ` ' - "of type is not ", + "of type is not ", ), ], ) diff --git a/tests/components/core/test_upload.py b/tests/components/core/test_upload.py index e6b27effca..cf7bafcd3c 100644 --- a/tests/components/core/test_upload.py +++ b/tests/components/core/test_upload.py @@ -7,8 +7,8 @@ get_upload_url, ) from reflex.event import EventSpec +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.state import State -from reflex.vars import Var class TestUploadState(State): @@ -38,11 +38,11 @@ def test_cancel_upload(): def test_get_upload_url(): url = get_upload_url("foo_file") - assert isinstance(url, Var) + assert isinstance(url, ImmutableVar) def test__on_drop_spec(): - assert isinstance(_on_drop_spec(Var.create([])), list) + assert isinstance(_on_drop_spec(LiteralVar.create([])), list) def test_upload_create(): diff --git a/tests/components/forms/test_form.py b/tests/components/forms/test_form.py index b979d261a8..efb31b97a3 100644 --- a/tests/components/forms/test_form.py +++ b/tests/components/forms/test_form.py @@ -1,12 +1,12 @@ from reflex_chakra.components.forms.form import Form from reflex.event import EventChain -from reflex.vars import BaseVar +from reflex.ivars.base import ImmutableVar def test_render_on_submit(): """Test that on_submit event chain is rendered as a separate function.""" - submit_it = BaseVar( + submit_it = ImmutableVar( _var_name="submit_it", _var_type=EventChain, ) diff --git a/tests/components/radix/test_icon_button.py b/tests/components/radix/test_icon_button.py index 852c0c97c9..b80611c021 100644 --- a/tests/components/radix/test_icon_button.py +++ b/tests/components/radix/test_icon_button.py @@ -2,8 +2,8 @@ from reflex.components.lucide.icon import Icon from reflex.components.radix.themes.components.icon_button import IconButton +from reflex.ivars.base import LiteralVar from reflex.style import Style -from reflex.vars import Var def test_icon_button(): @@ -26,5 +26,5 @@ def test_icon_button_size_prop(): ib1 = IconButton.create("activity", size="2") assert isinstance(ib1, IconButton) - ib2 = IconButton.create("activity", size=Var.create("2")) + ib2 = IconButton.create("activity", size=LiteralVar.create("2")) assert isinstance(ib2, IconButton) diff --git a/tests/components/test_component.py b/tests/components/test_component.py index 3c824ed013..3ce5decad4 100644 --- a/tests/components/test_component.py +++ b/tests/components/test_component.py @@ -18,13 +18,13 @@ ) from reflex.constants import EventTriggers from reflex.event import EventChain, EventHandler, parse_args_spec -from reflex.ivars.base import LiteralVar +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.state import BaseState from reflex.style import Style from reflex.utils import imports from reflex.utils.exceptions import EventFnArgMismatch, EventHandlerArgMismatch from reflex.utils.imports import ImportDict, ImportVar, ParsedImportDict, parse_imports -from reflex.vars import BaseVar, Var, VarData +from reflex.vars import Var, VarData @pytest.fixture @@ -270,121 +270,121 @@ def test_create_component(component1): [ pytest.param( "text", - Var.create("hello"), + LiteralVar.create("hello"), None, id="text", ), pytest.param( "text", - BaseVar(_var_name="hello", _var_type=Optional[str]), + ImmutableVar(_var_name="hello", _var_type=Optional[str]), None, id="text-optional", ), pytest.param( "text", - BaseVar(_var_name="hello", _var_type=Union[str, None]), + ImmutableVar(_var_name="hello", _var_type=Union[str, None]), None, id="text-union-str-none", ), pytest.param( "text", - BaseVar(_var_name="hello", _var_type=Union[None, str]), + ImmutableVar(_var_name="hello", _var_type=Union[None, str]), None, id="text-union-none-str", ), pytest.param( "text", - Var.create(1), + LiteralVar.create(1), TypeError, id="text-int", ), pytest.param( "number", - Var.create(1), + LiteralVar.create(1), None, id="number", ), pytest.param( "number", - BaseVar(_var_name="1", _var_type=Optional[int]), + ImmutableVar(_var_name="1", _var_type=Optional[int]), None, id="number-optional", ), pytest.param( "number", - BaseVar(_var_name="1", _var_type=Union[int, None]), + ImmutableVar(_var_name="1", _var_type=Union[int, None]), None, id="number-union-int-none", ), pytest.param( "number", - BaseVar(_var_name="1", _var_type=Union[None, int]), + ImmutableVar(_var_name="1", _var_type=Union[None, int]), None, id="number-union-none-int", ), pytest.param( "number", - Var.create("1"), + LiteralVar.create("1"), TypeError, id="number-str", ), pytest.param( "text_or_number", - Var.create("hello"), + LiteralVar.create("hello"), None, id="text_or_number-str", ), pytest.param( "text_or_number", - Var.create(1), + LiteralVar.create(1), None, id="text_or_number-int", ), pytest.param( "text_or_number", - BaseVar(_var_name="hello", _var_type=Optional[str]), + ImmutableVar(_var_name="hello", _var_type=Optional[str]), None, id="text_or_number-optional-str", ), pytest.param( "text_or_number", - BaseVar(_var_name="hello", _var_type=Union[str, None]), + ImmutableVar(_var_name="hello", _var_type=Union[str, None]), None, id="text_or_number-union-str-none", ), pytest.param( "text_or_number", - BaseVar(_var_name="hello", _var_type=Union[None, str]), + ImmutableVar(_var_name="hello", _var_type=Union[None, str]), None, id="text_or_number-union-none-str", ), pytest.param( "text_or_number", - BaseVar(_var_name="1", _var_type=Optional[int]), + ImmutableVar(_var_name="1", _var_type=Optional[int]), None, id="text_or_number-optional-int", ), pytest.param( "text_or_number", - BaseVar(_var_name="1", _var_type=Union[int, None]), + ImmutableVar(_var_name="1", _var_type=Union[int, None]), None, id="text_or_number-union-int-none", ), pytest.param( "text_or_number", - BaseVar(_var_name="1", _var_type=Union[None, int]), + ImmutableVar(_var_name="1", _var_type=Union[None, int]), None, id="text_or_number-union-none-int", ), pytest.param( "text_or_number", - Var.create(1.0), + LiteralVar.create(1.0), TypeError, id="text_or_number-float", ), pytest.param( "text_or_number", - BaseVar(_var_name="hello", _var_type=Optional[Union[str, int]]), + ImmutableVar(_var_name="hello", _var_type=Optional[Union[str, int]]), None, id="text_or_number-optional-union-str-int", ), @@ -393,7 +393,7 @@ def test_create_component(component1): def test_create_component_prop_validation( component1: Type[Component], prop_name: str, - var: Union[Var, str, int], + var: Union[ImmutableVar, str, int], expected: Type[Exception], ): """Test that component props are validated correctly. @@ -874,7 +874,7 @@ def my_component(width: Var[int], color: Var[str]): from reflex.components.radix.themes.typography.text import Text ccomponent = my_component( - rx.text("child"), width=Var.create(1), color=Var.create("red") + rx.text("child"), width=LiteralVar.create(1), color=LiteralVar.create("red") ) assert isinstance(ccomponent, CustomComponent) assert len(ccomponent.children) == 1 @@ -1175,13 +1175,12 @@ def test_stateful_banner(): hooks={"useTest": None}, imports={"test": [ImportVar(tag="test")]}, state="Test", - interpolations=[], ) ) FORMATTED_TEST_VAR = LiteralVar.create(f"foo{TEST_VAR}bar") STYLE_VAR = TEST_VAR._replace(_var_name="style") EVENT_CHAIN_VAR = TEST_VAR._replace(_var_type=EventChain) -ARG_VAR = Var.create("arg") +ARG_VAR = ImmutableVar.create_safe("arg") TEST_VAR_DICT_OF_DICT = LiteralVar.create({"a": {"b": "test"}})._replace( merge_var_data=TEST_VAR._var_data @@ -1401,6 +1400,7 @@ def handler2(self, arg): def test_get_vars(component, exp_vars): comp_vars = sorted(component._get_vars(), key=lambda v: v._var_name) assert len(comp_vars) == len(exp_vars) + print(comp_vars, exp_vars) for comp_var, exp_var in zip( comp_vars, sorted(exp_vars, key=lambda v: v._var_name), @@ -1518,7 +1518,7 @@ def test_validate_valid_children(): True, rx.fragment(valid_component2()), rx.fragment( - rx.foreach(Var.create([1, 2, 3]), lambda x: valid_component2(x)) # type: ignore + rx.foreach(LiteralVar.create([1, 2, 3]), lambda x: valid_component2(x)) # type: ignore ), ) ) @@ -1578,7 +1578,7 @@ def test_validate_valid_parents(): rx.fragment(valid_component3()), rx.fragment( rx.foreach( - Var.create([1, 2, 3]), # type: ignore + LiteralVar.create([1, 2, 3]), # type: ignore lambda x: valid_component2(valid_component3(x)), ) ), @@ -1645,7 +1645,9 @@ def test_validate_invalid_children(): True, rx.fragment(invalid_component()), rx.fragment( - rx.foreach(Var.create([1, 2, 3]), lambda x: invalid_component(x)) # type: ignore + rx.foreach( + LiteralVar.create([1, 2, 3]), lambda x: invalid_component(x) + ) # type: ignore ), ) ) @@ -2027,7 +2029,7 @@ def add_hooks(self): return [ "const hook3 = useRef(null)", "const hook1 = 42", - Var.create( + ImmutableVar.create( "useEffect(() => () => {}, [])", _var_data=VarData( hooks={ @@ -2037,7 +2039,7 @@ def add_hooks(self): imports={"react": [ImportVar(tag="useEffect")]}, ), ), - Var.create( + ImmutableVar.create( "const hook3 = useRef(null)", _var_data=VarData( imports={"react": [ImportVar(tag="useRef")]}, @@ -2150,7 +2152,9 @@ def do_something(self): rx.text("random text", on_click=TriggerState.do_something), rx.text( "random text", - on_click=BaseVar(_var_name="toggleColorMode", _var_type=EventChain), + on_click=ImmutableVar( + _var_name="toggleColorMode", _var_type=EventChain + ), ), ), True, @@ -2160,7 +2164,9 @@ def do_something(self): rx.text("random text", on_click=rx.console_log("log")), rx.text( "random text", - on_click=BaseVar(_var_name="toggleColorMode", _var_type=EventChain), + on_click=ImmutableVar( + _var_name="toggleColorMode", _var_type=EventChain + ), ), ), False, diff --git a/tests/components/test_tag.py b/tests/components/test_tag.py index d43f73842b..b4b37cc285 100644 --- a/tests/components/test_tag.py +++ b/tests/components/test_tag.py @@ -3,8 +3,7 @@ import pytest from reflex.components.tags import CondTag, Tag, tagless -from reflex.ivars.base import LiteralVar -from reflex.vars import BaseVar, Var +from reflex.ivars.base import ImmutableVar, LiteralVar @pytest.mark.parametrize( @@ -17,7 +16,7 @@ ({"key": True, "key2": "value2"}, ["key={true}", 'key2={"value2"}']), ], ) -def test_format_props(props: Dict[str, Var], test_props: List): +def test_format_props(props: Dict[str, ImmutableVar], test_props: List): """Test that the formatted props are correct. Args: @@ -41,7 +40,7 @@ def test_format_props(props: Dict[str, Var], test_props: List): (None, False), ], ) -def test_is_valid_prop(prop: Var, valid: bool): +def test_is_valid_prop(prop: ImmutableVar, valid: bool): """Test that the prop is valid. Args: @@ -111,7 +110,7 @@ def test_format_cond_tag(): tag = CondTag( true_value=dict(Tag(name="h1", contents="True content")), false_value=dict(Tag(name="h2", contents="False content")), - cond=BaseVar(_var_name="logged_in", _var_type=bool), + cond=ImmutableVar(_var_name="logged_in", _var_type=bool), ) tag_dict = dict(tag) cond, true_value, false_value = ( diff --git a/tests/test_app.py b/tests/test_app.py index ab7b50bdf2..167cbf0d48 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -35,6 +35,7 @@ from reflex.components.core.cond import Cond from reflex.components.radix.themes.typography.text import Text from reflex.event import Event +from reflex.ivars.base import immutable_computed_var from reflex.middleware import HydrateMiddleware from reflex.model import Model from reflex.state import ( @@ -50,7 +51,6 @@ ) from reflex.style import Style from reflex.utils import exceptions, format -from reflex.vars import computed_var from .conftest import chdir from .states import ( @@ -906,7 +906,7 @@ def on_counter(self): """Increment the counter var.""" self.counter = self.counter + 1 - @computed_var(cache=True) + @immutable_computed_var(cache=True) def comp_dynamic(self) -> str: """A computed var that depends on the dynamic var. @@ -1499,11 +1499,11 @@ class ValidDepState(BaseState): base: int = 0 _backend: int = 0 - @computed_var(cache=True) + @immutable_computed_var(cache=True) def foo(self) -> str: return "foo" - @computed_var(deps=["_backend", "base", foo], cache=True) + @immutable_computed_var(deps=["_backend", "base", foo], cache=True) def bar(self) -> str: return "bar" @@ -1515,7 +1515,7 @@ def test_app_with_invalid_var_dependencies(compilable_app: tuple[App, Path]): app, _ = compilable_app class InvalidDepState(BaseState): - @computed_var(deps=["foolksjdf"], cache=True) + @immutable_computed_var(deps=["foolksjdf"], cache=True) def bar(self) -> str: return "bar" diff --git a/tests/test_event.py b/tests/test_event.py index a484e0a3c3..c538ce0691 100644 --- a/tests/test_event.py +++ b/tests/test_event.py @@ -7,10 +7,9 @@ from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.state import BaseState from reflex.utils import format -from reflex.vars import Var -def make_var(value) -> Var: +def make_var(value) -> ImmutableVar: """Make a variable. Args: @@ -19,9 +18,7 @@ def make_var(value) -> Var: Returns: The var. """ - var = Var.create(value) - assert var is not None - return var + return ImmutableVar.create_safe(value) def test_create_event(): @@ -57,10 +54,10 @@ def test_fn_with_args(_, arg1, arg2): # Test passing vars as args. assert event_spec.handler == handler - assert event_spec.args[0][0].equals(Var.create_safe("arg1")) - assert event_spec.args[0][1].equals(Var.create_safe("first")) - assert event_spec.args[1][0].equals(Var.create_safe("arg2")) - assert event_spec.args[1][1].equals(Var.create_safe("second")) + assert event_spec.args[0][0].equals(ImmutableVar.create_safe("arg1")) + assert event_spec.args[0][1].equals(ImmutableVar.create_safe("first")) + assert event_spec.args[1][0].equals(ImmutableVar.create_safe("arg2")) + assert event_spec.args[1][1].equals(ImmutableVar.create_safe("second")) assert ( format.format_event(event_spec) == 'Event("test_fn_with_args", {arg1:first,arg2:second})' @@ -82,9 +79,9 @@ def test_fn_with_args(_, arg1, arg2): ) assert event_spec.handler == handler - assert event_spec.args[0][0].equals(Var.create_safe("arg1")) - assert event_spec.args[0][1].equals(Var.create_safe(first)) - assert event_spec.args[1][0].equals(Var.create_safe("arg2")) + assert event_spec.args[0][0].equals(ImmutableVar.create_safe("arg1")) + assert event_spec.args[0][1].equals(LiteralVar.create(first)) + assert event_spec.args[1][0].equals(ImmutableVar.create_safe("arg2")) assert event_spec.args[1][1].equals(LiteralVar.create(second)) handler = EventHandler(fn=test_fn_with_args) @@ -109,17 +106,17 @@ def spec(a2: str) -> List[str]: assert event_spec.handler == handler assert len(event_spec.args) == 1 - assert event_spec.args[0][0].equals(Var.create_safe("arg1")) - assert event_spec.args[0][1].equals(Var.create_safe("first")) + assert event_spec.args[0][0].equals(ImmutableVar.create_safe("arg1")) + assert event_spec.args[0][1].equals(ImmutableVar.create_safe("first")) assert format.format_event(event_spec) == 'Event("test_fn_with_args", {arg1:first})' assert event_spec2 is not event_spec assert event_spec2.handler == handler assert len(event_spec2.args) == 2 - assert event_spec2.args[0][0].equals(Var.create_safe("arg1")) - assert event_spec2.args[0][1].equals(Var.create_safe("first")) - assert event_spec2.args[1][0].equals(Var.create_safe("arg2")) - assert event_spec2.args[1][1].equals(Var.create_safe("_a2")) + assert event_spec2.args[0][0].equals(ImmutableVar.create_safe("arg1")) + assert event_spec2.args[0][1].equals(ImmutableVar.create_safe("first")) + assert event_spec2.args[1][0].equals(ImmutableVar.create_safe("arg2")) + assert event_spec2.args[1][1].equals(ImmutableVar.create_safe("_a2")) assert ( format.format_event(event_spec2) == 'Event("test_fn_with_args", {arg1:first,arg2:_a2})' @@ -171,7 +168,7 @@ def test_fn_with_args(_, arg1, arg2): 'Event("_redirect", {path:"/path",external:false,replace:false})', ), ( - (Var.create_safe("path"), None, None), + (ImmutableVar.create_safe("path"), None, None), 'Event("_redirect", {path:path,external:false,replace:false})', ), ( @@ -237,7 +234,7 @@ def test_set_focus(): spec = event.set_focus("input1") assert isinstance(spec, EventSpec) assert spec.handler.fn.__qualname__ == "_set_focus" - assert spec.args[0][0].equals(Var.create_safe("ref")) + assert spec.args[0][0].equals(ImmutableVar.create_safe("ref")) assert spec.args[0][1].equals(LiteralVar.create("ref_input1")) assert format.format_event(spec) == 'Event("_set_focus", {ref:"ref_input1"})' spec = event.set_focus("input1") @@ -249,9 +246,9 @@ def test_set_value(): spec = event.set_value("input1", "") assert isinstance(spec, EventSpec) assert spec.handler.fn.__qualname__ == "_set_value" - assert spec.args[0][0].equals(Var.create_safe("ref")) + assert spec.args[0][0].equals(ImmutableVar.create_safe("ref")) assert spec.args[0][1].equals(LiteralVar.create("ref_input1")) - assert spec.args[1][0].equals(Var.create_safe("value")) + assert spec.args[1][0].equals(ImmutableVar.create_safe("value")) assert spec.args[1][1].equals(LiteralVar.create("")) assert ( format.format_event(spec) == 'Event("_set_value", {ref:"ref_input1",value:""})' @@ -268,9 +265,9 @@ def test_remove_cookie(): spec = event.remove_cookie("testkey") assert isinstance(spec, EventSpec) assert spec.handler.fn.__qualname__ == "_remove_cookie" - assert spec.args[0][0].equals(Var.create_safe("key")) + assert spec.args[0][0].equals(ImmutableVar.create_safe("key")) assert spec.args[0][1].equals(LiteralVar.create("testkey")) - assert spec.args[1][0].equals(Var.create_safe("options")) + assert spec.args[1][0].equals(ImmutableVar.create_safe("options")) assert spec.args[1][1].equals(LiteralVar.create({"path": "/"})) assert ( format.format_event(spec) @@ -289,9 +286,9 @@ def test_remove_cookie_with_options(): spec = event.remove_cookie("testkey", options) assert isinstance(spec, EventSpec) assert spec.handler.fn.__qualname__ == "_remove_cookie" - assert spec.args[0][0].equals(Var.create_safe("key")) + assert spec.args[0][0].equals(ImmutableVar.create_safe("key")) assert spec.args[0][1].equals(LiteralVar.create("testkey")) - assert spec.args[1][0].equals(Var.create_safe("options")) + assert spec.args[1][0].equals(ImmutableVar.create_safe("options")) assert spec.args[1][1].equals(LiteralVar.create(options)) assert ( format.format_event(spec) @@ -313,7 +310,7 @@ def test_remove_local_storage(): spec = event.remove_local_storage("testkey") assert isinstance(spec, EventSpec) assert spec.handler.fn.__qualname__ == "_remove_local_storage" - assert spec.args[0][0].equals(Var.create_safe("key")) + assert spec.args[0][0].equals(ImmutableVar.create_safe("key")) assert spec.args[0][1].equals(LiteralVar.create("testkey")) assert ( format.format_event(spec) == 'Event("_remove_local_storage", {key:"testkey"})' diff --git a/tests/test_state.py b/tests/test_state.py index 0344ea0520..29944840eb 100644 --- a/tests/test_state.py +++ b/tests/test_state.py @@ -22,6 +22,7 @@ from reflex.components.sonner.toast import Toaster from reflex.constants import CompileVars, RouteVar, SocketEvent from reflex.event import Event, EventHandler +from reflex.ivars.base import ImmutableComputedVar, ImmutableVar from reflex.state import ( BaseState, ImmutableStateError, @@ -41,7 +42,6 @@ from reflex.testing import chdir from reflex.utils import format, prerequisites, types from reflex.utils.format import json_dumps -from reflex.vars import BaseVar, ComputedVar, Var from tests.states.mutation import MutableSQLAModel, MutableTestState from .states import GenState @@ -102,7 +102,7 @@ class TestState(BaseState): fig: Figure = Figure() dt: datetime.datetime = datetime.datetime.fromisoformat("1989-11-09T18:53:00+01:00") - @ComputedVar + @ImmutableComputedVar def sum(self) -> float: """Dynamically sum the numbers. @@ -111,7 +111,7 @@ def sum(self) -> float: """ return self.num1 + self.num2 - @ComputedVar + @ImmutableComputedVar def upper(self) -> str: """Uppercase the key. @@ -267,7 +267,7 @@ def test_base_class_vars(test_state): if field in test_state.get_skip_vars(): continue prop = getattr(cls, field) - assert isinstance(prop, Var) + assert isinstance(prop, ImmutableVar) assert prop._var_name.split(".")[-1] == field assert cls.num1._var_type == int @@ -518,10 +518,10 @@ def test_set_class_var(): with pytest.raises(AttributeError): TestState.num3 # type: ignore TestState._set_var( - BaseVar(_var_name="num3", _var_type=int)._var_set_state(TestState) + ImmutableVar(_var_name="num3", _var_type=int)._var_set_state(TestState) ) var = TestState.num3 # type: ignore - assert var._var_name == "num3" + assert var._var_name == TestState.get_full_name() + ".num3" assert var._var_type == int assert var._var_state == TestState.get_full_name() @@ -1102,7 +1102,7 @@ class MainState(BaseState): v: int = 2 class ChildState(MainState): - @ComputedVar + @ImmutableComputedVar def rendered_var(self): return self.v @@ -1121,7 +1121,7 @@ class MainState(BaseState): t1: str = "a" t2: str = "b" - @ComputedVar + @ImmutableComputedVar def rendered_var(self) -> str: if self.flag: return self.t1 @@ -3068,12 +3068,12 @@ def test_potentially_dirty_substates(): """ class State(RxState): - @ComputedVar + @ImmutableComputedVar def foo(self) -> str: return "" class C1(State): - @ComputedVar + @ImmutableComputedVar def bar(self) -> str: return "" diff --git a/tests/test_style.py b/tests/test_style.py index 8fa443cdf6..e170fe6141 100644 --- a/tests/test_style.py +++ b/tests/test_style.py @@ -9,7 +9,7 @@ from reflex.components.component import evaluate_style_namespaces from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.style import Style -from reflex.vars import ImmutableVarData, Var, VarData +from reflex.vars import VarData test_style = [ ({"a": 1}, {"a": 1}), @@ -81,7 +81,7 @@ def compare_dict_of_var(d1: dict[str, Any], d2: dict[str, Any]): assert key in d2 if isinstance(value, dict): compare_dict_of_var(value, d2[key]) - elif isinstance(value, Var): + elif isinstance(value, ImmutableVar): assert value.equals(d2[key]) else: assert value == d2[key] @@ -504,7 +504,7 @@ def test_style_via_component_with_state( comp = rx.el.div(**kwargs) assert ( - ImmutableVarData.merge(comp.style._var_data) + VarData.merge(comp.style._var_data) == expected_get_style["css"]._get_all_var_data() ) # Assert that style values are equal. diff --git a/tests/test_var.py b/tests/test_var.py index ba9cf24c80..bf66561b2f 100644 --- a/tests/test_var.py +++ b/tests/test_var.py @@ -9,8 +9,10 @@ from reflex.base import Base from reflex.constants.base import REFLEX_VAR_CLOSING_TAG, REFLEX_VAR_OPENING_TAG from reflex.ivars.base import ( + ImmutableComputedVar, ImmutableVar, LiteralVar, + immutable_computed_var, var_operation, var_operation_return, ) @@ -20,7 +22,7 @@ LiteralNumberVar, NumberVar, ) -from reflex.ivars.object import LiteralObjectVar +from reflex.ivars.object import LiteralObjectVar, ObjectVar from reflex.ivars.sequence import ( ArrayVar, ConcatVarOperation, @@ -30,22 +32,16 @@ from reflex.state import BaseState from reflex.utils.imports import ImportVar from reflex.vars import ( - BaseVar, - ComputedVar, - ImmutableVarData, Var, VarData, - computed_var, ) test_vars = [ - BaseVar(_var_name="prop1", _var_type=int), - BaseVar(_var_name="key", _var_type=str), - BaseVar(_var_name="value", _var_type=str)._var_set_state("state"), - BaseVar(_var_name="local", _var_type=str, _var_is_local=True)._var_set_state( - "state" - ), - BaseVar(_var_name="local2", _var_type=str, _var_is_local=True), + ImmutableVar(_var_name="prop1", _var_type=int), + ImmutableVar(_var_name="key", _var_type=str), + ImmutableVar(_var_name="value", _var_type=str)._var_set_state("state"), + ImmutableVar(_var_name="local", _var_type=str)._var_set_state("state"), + ImmutableVar(_var_name="local2", _var_type=str), ] @@ -71,7 +67,7 @@ class ParentState(BaseState): foo: int bar: int - @computed_var + @immutable_computed_var def var_without_annotation(self): return TestObj @@ -81,7 +77,7 @@ def var_without_annotation(self): @pytest.fixture def ChildState(ParentState, TestObj): class ChildState(ParentState): - @computed_var + @immutable_computed_var def var_without_annotation(self): return TestObj @@ -91,7 +87,7 @@ def var_without_annotation(self): @pytest.fixture def GrandChildState(ChildState, TestObj): class GrandChildState(ChildState): - @computed_var + @immutable_computed_var def var_without_annotation(self): return TestObj @@ -101,7 +97,7 @@ def var_without_annotation(self): @pytest.fixture def StateWithAnyVar(TestObj): class StateWithAnyVar(BaseState): - @computed_var + @immutable_computed_var def var_without_annotation(self) -> typing.Any: return TestObj @@ -111,7 +107,7 @@ def var_without_annotation(self) -> typing.Any: @pytest.fixture def StateWithCorrectVarAnnotation(): class StateWithCorrectVarAnnotation(BaseState): - @computed_var + @immutable_computed_var def var_with_annotation(self) -> str: return "Correct annotation" @@ -121,7 +117,7 @@ def var_with_annotation(self) -> str: @pytest.fixture def StateWithWrongVarAnnotation(TestObj): class StateWithWrongVarAnnotation(BaseState): - @computed_var + @immutable_computed_var def var_with_annotation(self) -> str: return TestObj @@ -131,7 +127,7 @@ def var_with_annotation(self) -> str: @pytest.fixture def StateWithInitialComputedVar(): class StateWithInitialComputedVar(BaseState): - @computed_var(initial_value="Initial value") + @immutable_computed_var(initial_value="Initial value") def var_with_initial_value(self) -> str: return "Runtime value" @@ -141,7 +137,7 @@ def var_with_initial_value(self) -> str: @pytest.fixture def ChildWithInitialComputedVar(StateWithInitialComputedVar): class ChildWithInitialComputedVar(StateWithInitialComputedVar): - @computed_var(initial_value="Initial value") + @immutable_computed_var(initial_value="Initial value") def var_with_initial_value_child(self) -> str: return "Runtime value" @@ -151,7 +147,7 @@ def var_with_initial_value_child(self) -> str: @pytest.fixture def StateWithRuntimeOnlyVar(): class StateWithRuntimeOnlyVar(BaseState): - @computed_var(initial_value=None) + @immutable_computed_var(initial_value=None) def var_raises_at_runtime(self) -> str: raise ValueError("So nicht, mein Freund") @@ -161,7 +157,7 @@ def var_raises_at_runtime(self) -> str: @pytest.fixture def ChildWithRuntimeOnlyVar(StateWithRuntimeOnlyVar): class ChildWithRuntimeOnlyVar(StateWithRuntimeOnlyVar): - @computed_var(initial_value="Initial value") + @immutable_computed_var(initial_value="Initial value") def var_raises_at_runtime_child(self) -> str: raise ValueError("So nicht, mein Freund") @@ -188,14 +184,14 @@ def test_full_name(prop, expected): prop: The var to test. expected: The expected full name. """ - assert prop._var_full_name == expected + assert str(prop) == expected @pytest.mark.parametrize( "prop,expected", zip( test_vars, - ["{prop1}", "{key}", "{state.value}", "state.local", "local2"], + ["prop1", "key", "state.value", "state.local", "local2"], ), ) def test_str(prop, expected): @@ -211,14 +207,14 @@ def test_str(prop, expected): @pytest.mark.parametrize( "prop,expected", [ - (BaseVar(_var_name="p", _var_type=int), 0), - (BaseVar(_var_name="p", _var_type=float), 0.0), - (BaseVar(_var_name="p", _var_type=str), ""), - (BaseVar(_var_name="p", _var_type=bool), False), - (BaseVar(_var_name="p", _var_type=list), []), - (BaseVar(_var_name="p", _var_type=dict), {}), - (BaseVar(_var_name="p", _var_type=tuple), ()), - (BaseVar(_var_name="p", _var_type=set), set()), + (ImmutableVar(_var_name="p", _var_type=int), 0), + (ImmutableVar(_var_name="p", _var_type=float), 0.0), + (ImmutableVar(_var_name="p", _var_type=str), ""), + (ImmutableVar(_var_name="p", _var_type=bool), False), + (ImmutableVar(_var_name="p", _var_type=list), []), + (ImmutableVar(_var_name="p", _var_type=dict), {}), + (ImmutableVar(_var_name="p", _var_type=tuple), ()), + (ImmutableVar(_var_name="p", _var_type=set), set()), ], ) def test_default_value(prop, expected): @@ -257,14 +253,16 @@ def test_get_setter(prop, expected): @pytest.mark.parametrize( "value,expected", [ - (None, None), - (1, BaseVar(_var_name="1", _var_type=int, _var_is_local=True)), - ("key", BaseVar(_var_name="key", _var_type=str, _var_is_local=True)), - (3.14, BaseVar(_var_name="3.14", _var_type=float, _var_is_local=True)), - ([1, 2, 3], BaseVar(_var_name="[1, 2, 3]", _var_type=list, _var_is_local=True)), + (None, ImmutableVar(_var_name="null", _var_type=None)), + (1, ImmutableVar(_var_name="1", _var_type=int)), + ("key", ImmutableVar(_var_name='"key"', _var_type=str)), + (3.14, ImmutableVar(_var_name="3.14", _var_type=float)), + ([1, 2, 3], ImmutableVar(_var_name="[1, 2, 3]", _var_type=List[int])), ( {"a": 1, "b": 2}, - BaseVar(_var_name='{"a": 1, "b": 2}', _var_type=dict, _var_is_local=True), + ImmutableVar( + _var_name='({ ["a"] : 1, ["b"] : 2 })', _var_type=Dict[str, int] + ), ), ], ) @@ -275,11 +273,8 @@ def test_create(value, expected): value: The value to create a var from. expected: The expected name of the setter function. """ - prop = Var.create(value) - if value is None: - assert prop == expected - else: - assert prop.equals(expected) # type: ignore + prop = LiteralVar.create(value) + assert prop.equals(expected) # type: ignore def test_create_type_error(): @@ -291,17 +286,11 @@ class ErrorType: value = ErrorType() with pytest.raises(TypeError): - Var.create(value) + LiteralVar.create(value) -def v(value) -> Var: - val = ( - Var.create(json.dumps(value), _var_is_string=True, _var_is_local=False) - if isinstance(value, str) - else Var.create(value, _var_is_local=False) - ) - assert val is not None - return val +def v(value) -> ImmutableVar: + return LiteralVar.create(value) def test_basic_operations(TestObj): @@ -310,129 +299,78 @@ def test_basic_operations(TestObj): Args: TestObj: The test object. """ - assert str(v(1) == v(2)) == "{((1) === (2))}" - assert str(v(1) != v(2)) == "{((1) !== (2))}" - assert str(v(1) < v(2)) == "{((1) < (2))}" - assert str(v(1) <= v(2)) == "{((1) <= (2))}" - assert str(v(1) > v(2)) == "{((1) > (2))}" - assert str(v(1) >= v(2)) == "{((1) >= (2))}" - assert str(v(1) + v(2)) == "{((1) + (2))}" - assert str(v(1) - v(2)) == "{((1) - (2))}" - assert str(v(1) * v(2)) == "{((1) * (2))}" - assert str(v(1) / v(2)) == "{((1) / (2))}" - assert str(v(1) // v(2)) == "{Math.floor((1) / (2))}" - assert str(v(1) % v(2)) == "{((1) % (2))}" - assert str(v(1) ** v(2)) == "{Math.pow((1) , (2))}" - assert str(v(1) & v(2)) == "{((1) && (2))}" - assert str(v(1) | v(2)) == "{((1) || (2))}" - assert str(v([1, 2, 3])[v(0)]) == "{[1, 2, 3].at(0)}" - assert str(v({"a": 1, "b": 2})["a"]) == '{{"a": 1, "b": 2}["a"]}' - assert str(v("foo") == v("bar")) == '{(("foo") === ("bar"))}' + assert str(v(1) == v(2)) == "(1 === 2)" + assert str(v(1) != v(2)) == "(1 !== 2)" + assert str(LiteralNumberVar.create(1) < 2) == "(1 < 2)" + assert str(LiteralNumberVar.create(1) <= 2) == "(1 <= 2)" + assert str(LiteralNumberVar.create(1) > 2) == "(1 > 2)" + assert str(LiteralNumberVar.create(1) >= 2) == "(1 >= 2)" + assert str(LiteralNumberVar.create(1) + 2) == "(1 + 2)" + assert str(LiteralNumberVar.create(1) - 2) == "(1 - 2)" + assert str(LiteralNumberVar.create(1) * 2) == "(1 * 2)" + assert str(LiteralNumberVar.create(1) / 2) == "(1 / 2)" + assert str(LiteralNumberVar.create(1) // 2) == "Math.floor(1 / 2)" + assert str(LiteralNumberVar.create(1) % 2) == "(1 % 2)" + assert str(LiteralNumberVar.create(1) ** 2) == "(1 ** 2)" + assert str(LiteralNumberVar.create(1) & v(2)) == "(1 && 2)" + assert str(LiteralNumberVar.create(1) | v(2)) == "(1 || 2)" + assert str(LiteralArrayVar.create([1, 2, 3])[0]) == "[1, 2, 3].at(0)" assert ( - str( - Var.create("foo", _var_is_local=False) - == Var.create("bar", _var_is_local=False) - ) - == "{((foo) === (bar))}" + str(LiteralObjectVar.create({"a": 1, "b": 2})["a"]) + == '({ ["a"] : 1, ["b"] : 2 })["a"]' + ) + assert str(v("foo") == v("bar")) == '("foo" === "bar")' + assert ( + str(ImmutableVar.create("foo") == ImmutableVar.create("bar")) == "(foo === bar)" + ) + assert ( + str(LiteralVar.create("foo") == LiteralVar.create("bar")) == '("foo" === "bar")' ) + print(ImmutableVar(_var_name="foo").to(ObjectVar, TestObj)._var_set_state("state")) assert ( str( - BaseVar( - _var_name="foo", _var_type=str, _var_is_string=True, _var_is_local=True - ) - == BaseVar( - _var_name="bar", _var_type=str, _var_is_string=True, _var_is_local=True - ) + ImmutableVar(_var_name="foo") + .to(ObjectVar, TestObj) + ._var_set_state("state") + .bar + == LiteralVar.create("bar") ) - == "((`foo`) === (`bar`))" + == '(state.foo["bar"] === "bar")' ) assert ( str( - BaseVar( - _var_name="foo", - _var_type=TestObj, - _var_is_string=True, - _var_is_local=False, - ) + ImmutableVar(_var_name="foo") + .to(ObjectVar, TestObj) ._var_set_state("state") .bar - == BaseVar( - _var_name="bar", _var_type=str, _var_is_string=True, _var_is_local=True - ) ) - == "{((state.foo.bar) === (`bar`))}" + == 'state.foo["bar"]' ) + assert str(abs(LiteralNumberVar.create(1))) == "Math.abs(1)" + assert str(LiteralArrayVar.create([1, 2, 3]).length()) == "[1, 2, 3].length" assert ( - str(BaseVar(_var_name="foo", _var_type=TestObj)._var_set_state("state").bar) - == "{state.foo.bar}" + str(LiteralArrayVar.create([1, 2]) + LiteralArrayVar.create([3, 4])) + == "[...[1, 2], ...[3, 4]]" ) - assert str(abs(v(1))) == "{Math.abs(1)}" - assert str(v([1, 2, 3]).length()) == "{[1, 2, 3].length}" - assert str(v([1, 2]) + v([3, 4])) == "{spreadArraysOrObjects(([1, 2]) , ([3, 4]))}" # Tests for reverse operation - assert str(v([1, 2, 3]).reverse()) == "{[...[1, 2, 3]].reverse()}" - assert str(v(["1", "2", "3"]).reverse()) == '{[...["1", "2", "3"]].reverse()}' - assert ( - str(BaseVar(_var_name="foo", _var_type=list)._var_set_state("state").reverse()) - == "{[...state.foo].reverse()}" - ) - assert ( - str(BaseVar(_var_name="foo", _var_type=list).reverse()) - == "{[...foo].reverse()}" - ) - assert str(BaseVar(_var_name="foo", _var_type=str)._type()) == "{typeof foo}" # type: ignore - assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() == str) # type: ignore - == "{((typeof foo) === (`string`))}" - ) - assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() == str) # type: ignore - == "{((typeof foo) === (`string`))}" - ) - assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() == int) # type: ignore - == "{((typeof foo) === (`number`))}" - ) assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() == list) # type: ignore - == "{((typeof foo) === (`Array`))}" + str(LiteralArrayVar.create([1, 2, 3]).reverse()) + == "[1, 2, 3].slice().reverse()" ) assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() == float) # type: ignore - == "{((typeof foo) === (`number`))}" + str(LiteralArrayVar.create(["1", "2", "3"]).reverse()) + == '["1", "2", "3"].slice().reverse()' ) assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() == tuple) # type: ignore - == "{((typeof foo) === (`Array`))}" + str(ImmutableVar(_var_name="foo")._var_set_state("state").to(list).reverse()) + == "state.foo.slice().reverse()" ) assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() == dict) # type: ignore - == "{((typeof foo) === (`Object`))}" + str(ImmutableVar(_var_name="foo").to(list).reverse()) == "foo.slice().reverse()" ) assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() != str) # type: ignore - == "{((typeof foo) !== (`string`))}" - ) - assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() != int) # type: ignore - == "{((typeof foo) !== (`number`))}" - ) - assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() != list) # type: ignore - == "{((typeof foo) !== (`Array`))}" - ) - assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() != float) # type: ignore - == "{((typeof foo) !== (`number`))}" - ) - assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() != tuple) # type: ignore - == "{((typeof foo) !== (`Array`))}" - ) - assert ( - str(BaseVar(_var_name="foo", _var_type=str)._type() != dict) # type: ignore - == "{((typeof foo) !== (`Object`))}" + str(ImmutableVar(_var_name="foo", _var_type=str).js_type()) == "(typeof(foo))" ) @@ -442,76 +380,81 @@ def test_basic_operations(TestObj): (v([1, 2, 3]), "[1, 2, 3]"), (v(set([1, 2, 3])), "[1, 2, 3]"), (v(["1", "2", "3"]), '["1", "2", "3"]'), - (BaseVar(_var_name="foo", _var_type=list)._var_set_state("state"), "state.foo"), - (BaseVar(_var_name="foo", _var_type=list), "foo"), + ( + ImmutableVar(_var_name="foo")._var_set_state("state").to(list), + "state.foo", + ), + (ImmutableVar(_var_name="foo").to(list), "foo"), (v((1, 2, 3)), "[1, 2, 3]"), (v(("1", "2", "3")), '["1", "2", "3"]'), ( - BaseVar(_var_name="foo", _var_type=tuple)._var_set_state("state"), + ImmutableVar(_var_name="foo")._var_set_state("state").to(tuple), "state.foo", ), - (BaseVar(_var_name="foo", _var_type=tuple), "foo"), + (ImmutableVar(_var_name="foo").to(tuple), "foo"), ], ) def test_list_tuple_contains(var, expected): - assert str(var.contains(1)) == f"{{{expected}.includes(1)}}" - assert str(var.contains("1")) == f'{{{expected}.includes("1")}}' - assert str(var.contains(v(1))) == f"{{{expected}.includes(1)}}" - assert str(var.contains(v("1"))) == f'{{{expected}.includes("1")}}' - other_state_var = BaseVar(_var_name="other", _var_type=str)._var_set_state("state") - other_var = BaseVar(_var_name="other", _var_type=str) - assert str(var.contains(other_state_var)) == f"{{{expected}.includes(state.other)}}" - assert str(var.contains(other_var)) == f"{{{expected}.includes(other)}}" + assert str(var.contains(1)) == f"{expected}.includes(1)" + assert str(var.contains("1")) == f'{expected}.includes("1")' + assert str(var.contains(v(1))) == f"{expected}.includes(1)" + assert str(var.contains(v("1"))) == f'{expected}.includes("1")' + other_state_var = ImmutableVar(_var_name="other", _var_type=str)._var_set_state( + "state" + ) + other_var = ImmutableVar(_var_name="other", _var_type=str) + assert str(var.contains(other_state_var)) == f"{expected}.includes(state.other)" + assert str(var.contains(other_var)) == f"{expected}.includes(other)" @pytest.mark.parametrize( "var, expected", [ (v("123"), json.dumps("123")), - (BaseVar(_var_name="foo", _var_type=str)._var_set_state("state"), "state.foo"), - (BaseVar(_var_name="foo", _var_type=str), "foo"), + (ImmutableVar(_var_name="foo")._var_set_state("state").to(str), "state.foo"), + (ImmutableVar(_var_name="foo").to(str), "foo"), ], ) def test_str_contains(var, expected): - assert str(var.contains("1")) == f'{{{expected}.includes("1")}}' - assert str(var.contains(v("1"))) == f'{{{expected}.includes("1")}}' - other_state_var = BaseVar(_var_name="other", _var_type=str)._var_set_state("state") - other_var = BaseVar(_var_name="other", _var_type=str) - assert str(var.contains(other_state_var)) == f"{{{expected}.includes(state.other)}}" - assert str(var.contains(other_var)) == f"{{{expected}.includes(other)}}" + assert str(var.contains("1")) == f'{expected}.includes("1")' + assert str(var.contains(v("1"))) == f'{expected}.includes("1")' + other_state_var = ImmutableVar(_var_name="other")._var_set_state("state").to(str) + other_var = ImmutableVar(_var_name="other").to(str) + assert str(var.contains(other_state_var)) == f"{expected}.includes(state.other)" + assert str(var.contains(other_var)) == f"{expected}.includes(other)" assert ( - str(var.contains("1", "hello")) == f'{{{expected}.some(e=>e[`hello`]==="1")}}' + str(var.contains("1", "hello")) + == f'{expected}.some(obj => obj["hello"] === "1")' ) @pytest.mark.parametrize( "var, expected", [ - (v({"a": 1, "b": 2}), '{"a": 1, "b": 2}'), - (BaseVar(_var_name="foo", _var_type=dict)._var_set_state("state"), "state.foo"), - (BaseVar(_var_name="foo", _var_type=dict), "foo"), + (v({"a": 1, "b": 2}), '({ ["a"] : 1, ["b"] : 2 })'), + (ImmutableVar(_var_name="foo")._var_set_state("state").to(dict), "state.foo"), + (ImmutableVar(_var_name="foo").to(dict), "foo"), ], ) def test_dict_contains(var, expected): - assert str(var.contains(1)) == f"{{{expected}.hasOwnProperty(1)}}" - assert str(var.contains("1")) == f'{{{expected}.hasOwnProperty("1")}}' - assert str(var.contains(v(1))) == f"{{{expected}.hasOwnProperty(1)}}" - assert str(var.contains(v("1"))) == f'{{{expected}.hasOwnProperty("1")}}' - other_state_var = BaseVar(_var_name="other", _var_type=str)._var_set_state("state") - other_var = BaseVar(_var_name="other", _var_type=str) + assert str(var.contains(1)) == f"{expected}.hasOwnProperty(1)" + assert str(var.contains("1")) == f'{expected}.hasOwnProperty("1")' + assert str(var.contains(v(1))) == f"{expected}.hasOwnProperty(1)" + assert str(var.contains(v("1"))) == f'{expected}.hasOwnProperty("1")' + other_state_var = ImmutableVar(_var_name="other")._var_set_state("state").to(str) + other_var = ImmutableVar(_var_name="other").to(str) assert ( - str(var.contains(other_state_var)) - == f"{{{expected}.hasOwnProperty(state.other)}}" + str(var.contains(other_state_var)) == f"{expected}.hasOwnProperty(state.other)" ) - assert str(var.contains(other_var)) == f"{{{expected}.hasOwnProperty(other)}}" + assert str(var.contains(other_var)) == f"{expected}.hasOwnProperty(other)" @pytest.mark.parametrize( "var", [ - BaseVar(_var_name="list", _var_type=List[int]), - BaseVar(_var_name="tuple", _var_type=Tuple[int, int]), - BaseVar(_var_name="str", _var_type=str), + ImmutableVar(_var_name="list", _var_type=List[int]).guess_type(), + ImmutableVar(_var_name="tuple", _var_type=Tuple[int, int]).guess_type(), + ImmutableVar(_var_name="str", _var_type=str).guess_type(), ], ) def test_var_indexing_lists(var): @@ -521,18 +464,21 @@ def test_var_indexing_lists(var): var : The str, list or tuple base var. """ # Test basic indexing. - assert str(var[0]) == f"{{{var._var_name}.at(0)}}" - assert str(var[1]) == f"{{{var._var_name}.at(1)}}" + assert str(var[0]) == f"{var._var_name}.at(0)" + assert str(var[1]) == f"{var._var_name}.at(1)" # Test negative indexing. - assert str(var[-1]) == f"{{{var._var_name}.at(-1)}}" + assert str(var[-1]) == f"{var._var_name}.at(-1)" @pytest.mark.parametrize( "var, type_", [ - (BaseVar(_var_name="list", _var_type=List[int]), [int, int]), - (BaseVar(_var_name="tuple", _var_type=Tuple[int, str]), [int, str]), + (ImmutableVar(_var_name="list", _var_type=List[int]).guess_type(), [int, int]), + ( + ImmutableVar(_var_name="tuple", _var_type=Tuple[int, str]).guess_type(), + [int, str], + ), ], ) def test_var_indexing_types(var, type_): @@ -549,99 +495,105 @@ def test_var_indexing_types(var, type_): def test_var_indexing_str(): """Test that we can index into str vars.""" - str_var = BaseVar(_var_name="str", _var_type=str) + str_var = ImmutableVar(_var_name="str").to(str) # Test that indexing gives a type of Var[str]. - assert isinstance(str_var[0], Var) + assert isinstance(str_var[0], ImmutableVar) assert str_var[0]._var_type == str # Test basic indexing. - assert str(str_var[0]) == "{str.at(0)}" - assert str(str_var[1]) == "{str.at(1)}" + assert str(str_var[0]) == "str.at(0)" + assert str(str_var[1]) == "str.at(1)" # Test negative indexing. - assert str(str_var[-1]) == "{str.at(-1)}" + assert str(str_var[-1]) == "str.at(-1)" @pytest.mark.parametrize( "var", [ - (BaseVar(_var_name="foo", _var_type=int)), - (BaseVar(_var_name="bar", _var_type=float)), + (ImmutableVar(_var_name="foo", _var_type=int).guess_type()), + (ImmutableVar(_var_name="bar", _var_type=float).guess_type()), ], ) def test_var_replace_with_invalid_kwargs(var): with pytest.raises(TypeError) as excinfo: var._replace(_this_should_fail=True) - assert "Unexpected keyword arguments" in str(excinfo.value) + assert "unexpected keyword argument" in str(excinfo.value) def test_computed_var_replace_with_invalid_kwargs(): - @computed_var(initial_value=1) + @immutable_computed_var(initial_value=1) def test_var(state) -> int: return 1 with pytest.raises(TypeError) as excinfo: test_var._replace(_random_kwarg=True) - assert "Unexpected keyword arguments" in str(excinfo.value) + assert "Unexpected keyword argument" in str(excinfo.value) @pytest.mark.parametrize( "var, index", [ - (BaseVar(_var_name="lst", _var_type=List[int]), [1, 2]), - (BaseVar(_var_name="lst", _var_type=List[int]), {"name": "dict"}), - (BaseVar(_var_name="lst", _var_type=List[int]), {"set"}), + (ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), [1, 2]), ( - BaseVar(_var_name="lst", _var_type=List[int]), + ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), + {"name": "dict"}, + ), + (ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), {"set"}), + ( + ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), ( 1, 2, ), ), - (BaseVar(_var_name="lst", _var_type=List[int]), 1.5), - (BaseVar(_var_name="lst", _var_type=List[int]), "str"), + (ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), 1.5), + (ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), "str"), ( - BaseVar(_var_name="lst", _var_type=List[int]), - BaseVar(_var_name="string_var", _var_type=str), + ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), + ImmutableVar(_var_name="string_var", _var_type=str).guess_type(), ), ( - BaseVar(_var_name="lst", _var_type=List[int]), - BaseVar(_var_name="float_var", _var_type=float), + ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), + ImmutableVar(_var_name="float_var", _var_type=float).guess_type(), ), ( - BaseVar(_var_name="lst", _var_type=List[int]), - BaseVar(_var_name="list_var", _var_type=List[int]), + ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), + ImmutableVar(_var_name="list_var", _var_type=List[int]).guess_type(), ), ( - BaseVar(_var_name="lst", _var_type=List[int]), - BaseVar(_var_name="set_var", _var_type=Set[str]), + ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), + ImmutableVar(_var_name="set_var", _var_type=Set[str]).guess_type(), ), ( - BaseVar(_var_name="lst", _var_type=List[int]), - BaseVar(_var_name="dict_var", _var_type=Dict[str, str]), + ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), + ImmutableVar(_var_name="dict_var", _var_type=Dict[str, str]).guess_type(), ), - (BaseVar(_var_name="str", _var_type=str), [1, 2]), - (BaseVar(_var_name="lst", _var_type=str), {"name": "dict"}), - (BaseVar(_var_name="lst", _var_type=str), {"set"}), + (ImmutableVar(_var_name="str", _var_type=str).guess_type(), [1, 2]), + (ImmutableVar(_var_name="lst", _var_type=str).guess_type(), {"name": "dict"}), + (ImmutableVar(_var_name="lst", _var_type=str).guess_type(), {"set"}), ( - BaseVar(_var_name="lst", _var_type=str), - BaseVar(_var_name="string_var", _var_type=str), + ImmutableVar(_var_name="lst", _var_type=str).guess_type(), + ImmutableVar(_var_name="string_var", _var_type=str).guess_type(), ), ( - BaseVar(_var_name="lst", _var_type=str), - BaseVar(_var_name="float_var", _var_type=float), + ImmutableVar(_var_name="lst", _var_type=str).guess_type(), + ImmutableVar(_var_name="float_var", _var_type=float).guess_type(), + ), + (ImmutableVar(_var_name="str", _var_type=Tuple[str]).guess_type(), [1, 2]), + ( + ImmutableVar(_var_name="lst", _var_type=Tuple[str]).guess_type(), + {"name": "dict"}, ), - (BaseVar(_var_name="str", _var_type=Tuple[str]), [1, 2]), - (BaseVar(_var_name="lst", _var_type=Tuple[str]), {"name": "dict"}), - (BaseVar(_var_name="lst", _var_type=Tuple[str]), {"set"}), + (ImmutableVar(_var_name="lst", _var_type=Tuple[str]).guess_type(), {"set"}), ( - BaseVar(_var_name="lst", _var_type=Tuple[str]), - BaseVar(_var_name="string_var", _var_type=str), + ImmutableVar(_var_name="lst", _var_type=Tuple[str]).guess_type(), + ImmutableVar(_var_name="string_var", _var_type=str).guess_type(), ), ( - BaseVar(_var_name="lst", _var_type=Tuple[str]), - BaseVar(_var_name="float_var", _var_type=float), + ImmutableVar(_var_name="lst", _var_type=Tuple[str]).guess_type(), + ImmutableVar(_var_name="float_var", _var_type=float).guess_type(), ), ], ) @@ -659,9 +611,8 @@ def test_var_unsupported_indexing_lists(var, index): @pytest.mark.parametrize( "var", [ - BaseVar(_var_name="lst", _var_type=List[int]), - BaseVar(_var_name="tuple", _var_type=Tuple[int, int]), - BaseVar(_var_name="str", _var_type=str), + ImmutableVar(_var_name="lst", _var_type=List[int]).guess_type(), + ImmutableVar(_var_name="tuple", _var_type=Tuple[int, int]).guess_type(), ], ) def test_var_list_slicing(var): @@ -670,84 +621,105 @@ def test_var_list_slicing(var): Args: var : The str, list or tuple base var. """ - assert str(var[:1]) == f"{{{var._var_name}.slice(0, 1)}}" - assert str(var[:1]) == f"{{{var._var_name}.slice(0, 1)}}" - assert str(var[:]) == f"{{{var._var_name}.slice(0, undefined)}}" + assert str(var[:1]) == f"{var._var_name}.slice(undefined, 1)" + assert str(var[1:]) == f"{var._var_name}.slice(1, undefined)" + assert str(var[:]) == f"{var._var_name}.slice(undefined, undefined)" + + +def test_str_var_slicing(): + """Test that we can slice into str vars.""" + str_var = ImmutableVar(_var_name="str").to(str) + + # Test that slicing gives a type of Var[str]. + assert isinstance(str_var[:1], ImmutableVar) + assert str_var[:1]._var_type == str + + # Test basic slicing. + assert str(str_var[:1]) == 'str.split("").slice(undefined, 1).join("")' + assert str(str_var[1:]) == 'str.split("").slice(1, undefined).join("")' + assert str(str_var[:]) == 'str.split("").slice(undefined, undefined).join("")' + assert str(str_var[1:2]) == 'str.split("").slice(1, 2).join("")' + + # Test negative slicing. + assert str(str_var[:-1]) == 'str.split("").slice(undefined, -1).join("")' + assert str(str_var[-1:]) == 'str.split("").slice(-1, undefined).join("")' + assert str(str_var[:-2]) == 'str.split("").slice(undefined, -2).join("")' + assert str(str_var[-2:]) == 'str.split("").slice(-2, undefined).join("")' def test_dict_indexing(): """Test that we can index into dict vars.""" - dct = BaseVar(_var_name="dct", _var_type=Dict[str, int]) + dct = ImmutableVar(_var_name="dct").to(ObjectVar, Dict[str, str]) # Check correct indexing. - assert str(dct["a"]) == '{dct["a"]}' - assert str(dct["asdf"]) == '{dct["asdf"]}' + assert str(dct["a"]) == 'dct["a"]' + assert str(dct["asdf"]) == 'dct["asdf"]' @pytest.mark.parametrize( "var, index", [ ( - BaseVar(_var_name="dict", _var_type=Dict[str, str]), + ImmutableVar(_var_name="dict", _var_type=Dict[str, str]).guess_type(), [1, 2], ), ( - BaseVar(_var_name="dict", _var_type=Dict[str, str]), + ImmutableVar(_var_name="dict", _var_type=Dict[str, str]).guess_type(), {"name": "dict"}, ), ( - BaseVar(_var_name="dict", _var_type=Dict[str, str]), + ImmutableVar(_var_name="dict", _var_type=Dict[str, str]).guess_type(), {"set"}, ), ( - BaseVar(_var_name="dict", _var_type=Dict[str, str]), + ImmutableVar(_var_name="dict", _var_type=Dict[str, str]).guess_type(), ( 1, 2, ), ), ( - BaseVar(_var_name="lst", _var_type=Dict[str, str]), - BaseVar(_var_name="list_var", _var_type=List[int]), + ImmutableVar(_var_name="lst", _var_type=Dict[str, str]).guess_type(), + ImmutableVar(_var_name="list_var", _var_type=List[int]).guess_type(), ), ( - BaseVar(_var_name="lst", _var_type=Dict[str, str]), - BaseVar(_var_name="set_var", _var_type=Set[str]), + ImmutableVar(_var_name="lst", _var_type=Dict[str, str]).guess_type(), + ImmutableVar(_var_name="set_var", _var_type=Set[str]).guess_type(), ), ( - BaseVar(_var_name="lst", _var_type=Dict[str, str]), - BaseVar(_var_name="dict_var", _var_type=Dict[str, str]), + ImmutableVar(_var_name="lst", _var_type=Dict[str, str]).guess_type(), + ImmutableVar(_var_name="dict_var", _var_type=Dict[str, str]).guess_type(), ), ( - BaseVar(_var_name="df", _var_type=DataFrame), + ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), [1, 2], ), ( - BaseVar(_var_name="df", _var_type=DataFrame), + ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), {"name": "dict"}, ), ( - BaseVar(_var_name="df", _var_type=DataFrame), + ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), {"set"}, ), ( - BaseVar(_var_name="df", _var_type=DataFrame), + ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), ( 1, 2, ), ), ( - BaseVar(_var_name="df", _var_type=DataFrame), - BaseVar(_var_name="list_var", _var_type=List[int]), + ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), + ImmutableVar(_var_name="list_var", _var_type=List[int]).guess_type(), ), ( - BaseVar(_var_name="df", _var_type=DataFrame), - BaseVar(_var_name="set_var", _var_type=Set[str]), + ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), + ImmutableVar(_var_name="set_var", _var_type=Set[str]).guess_type(), ), ( - BaseVar(_var_name="df", _var_type=DataFrame), - BaseVar(_var_name="dict_var", _var_type=Dict[str, str]), + ImmutableVar(_var_name="df", _var_type=DataFrame).guess_type(), + ImmutableVar(_var_name="dict_var", _var_type=Dict[str, str]).guess_type(), ), ], ) @@ -1079,7 +1051,9 @@ class Foo(Base): bar: Boo baz: int - parent_obj = LiteralVar.create(Foo(bar=Boo(foo="bar", bar=5), baz=5)) + parent_obj = LiteralObjectVar.create( + Foo(bar=Boo(foo="bar", bar=5), baz=5).dict(), Foo + ) assert ( str(parent_obj.bar.foo) @@ -1104,7 +1078,7 @@ def test_retrival(): assert REFLEX_VAR_OPENING_TAG in f_string assert REFLEX_VAR_CLOSING_TAG in f_string - result_var_data = Var.create_safe(f_string)._var_data + result_var_data = LiteralVar.create(f_string)._get_all_var_data() result_immutable_var_data = ImmutableVar.create_safe(f_string)._var_data assert result_var_data is not None and result_immutable_var_data is not None assert ( @@ -1114,30 +1088,18 @@ def test_retrival(): ) assert ( result_var_data.imports - == ( - result_immutable_var_data.imports - if isinstance(result_immutable_var_data.imports, dict) - else { - k: list(v) - for k, v in result_immutable_var_data.imports - if k in original_var_data.imports - } - ) + == result_immutable_var_data.imports == original_var_data.imports ) assert ( - list(result_var_data.hooks.keys()) - == ( - list(result_immutable_var_data.hooks.keys()) - if isinstance(result_immutable_var_data.hooks, dict) - else list(result_immutable_var_data.hooks) - ) - == list(original_var_data.hooks.keys()) + tuple(result_var_data.hooks) + == tuple(result_immutable_var_data.hooks) + == tuple(original_var_data.hooks) ) def test_fstring_concat(): - original_var_with_data = Var.create_safe( + original_var_with_data = LiteralVar.create( "imagination", _var_data=VarData(state="fear") ) @@ -1160,9 +1122,9 @@ def test_fstring_concat(): ), ) - assert str(string_concat) == '("foo"+imagination+"bar"+consequences+"baz")' + assert str(string_concat) == '("fooimaginationbar"+consequences+"baz")' assert isinstance(string_concat, ConcatVarOperation) - assert string_concat._get_all_var_data() == ImmutableVarData( + assert string_concat._get_all_var_data() == VarData( state="fear", imports={ "react": [ImportVar(tag="useRef")], @@ -1172,17 +1134,22 @@ def test_fstring_concat(): ) +var = ImmutableVar(_var_name="var", _var_type=str) +myvar = ImmutableVar(_var_name="myvar", _var_type=int)._var_set_state("state") +x = ImmutableVar(_var_name="x", _var_type=str) + + @pytest.mark.parametrize( "out, expected", [ - (f"{BaseVar(_var_name='var', _var_type=str)}", "${var}"), + (f"{var}", f"{hash(var)}var"), ( - f"testing f-string with {BaseVar(_var_name='myvar', _var_type=int)._var_set_state('state')}", - 'testing f-string with ${"state": "state", "interpolations": [], "imports": {"/utils/context": [{"tag": "StateContexts", "is_default": false, "alias": null, "install": true, "render": true, "transpile": false}], "react": [{"tag": "useContext", "is_default": false, "alias": null, "install": true, "render": true, "transpile": false}]}, "hooks": {"const state = useContext(StateContexts.state)": null}, "string_length": 13}{state.myvar}', + f"testing f-string with {myvar}", + f"testing f-string with {hash(myvar)}state.myvar", ), ( - f"testing local f-string {BaseVar(_var_name='x', _var_is_local=True, _var_type=str)}", - "testing local f-string x", + f"testing local f-string {x}", + f"testing local f-string {hash(x)}x", ), ], ) @@ -1195,8 +1162,8 @@ def test_fstrings(out, expected): [ ([1], ""), ({"a": 1}, ""), - ([Var.create_safe(1)._var_set_state("foo")], "foo"), - ({"a": Var.create_safe(1)._var_set_state("foo")}, "foo"), + ([LiteralVar.create(1)._var_set_state("foo")], "foo"), + ({"a": LiteralVar.create(1)._var_set_state("foo")}, "foo"), ], ) def test_extract_state_from_container(value, expect_state): @@ -1206,7 +1173,9 @@ def test_extract_state_from_container(value, expect_state): value: The value to create a var from. expect_state: The expected state. """ - assert Var.create_safe(value)._var_state == expect_state + var_data = LiteralVar.create(value)._get_all_var_data() + var_state = var_data.state if var_data else "" + assert var_state == expect_state @pytest.mark.parametrize( @@ -1222,25 +1191,21 @@ def test_fstring_roundtrip(value): Args: value: The value to create a Var from. """ - var = BaseVar.create_safe(value)._var_set_state("state") - rt_var = Var.create_safe(f"{var}") + var = ImmutableVar.create_safe(value)._var_set_state("state") + rt_var = LiteralVar.create(f"{var}") assert var._var_state == rt_var._var_state - assert var._var_full_name_needs_state_prefix - assert not rt_var._var_full_name_needs_state_prefix - assert rt_var._var_name == var._var_full_name + assert str(rt_var) == str(var) @pytest.mark.parametrize( "var", [ - BaseVar(_var_name="var", _var_type=int), - BaseVar(_var_name="var", _var_type=float), - BaseVar(_var_name="var", _var_type=str), - BaseVar(_var_name="var", _var_type=bool), - BaseVar(_var_name="var", _var_type=dict), - BaseVar(_var_name="var", _var_type=tuple), - BaseVar(_var_name="var", _var_type=set), - BaseVar(_var_name="var", _var_type=None), + ImmutableVar(_var_name="var", _var_type=int).guess_type(), + ImmutableVar(_var_name="var", _var_type=float).guess_type(), + ImmutableVar(_var_name="var", _var_type=str).guess_type(), + ImmutableVar(_var_name="var", _var_type=bool).guess_type(), + ImmutableVar(_var_name="var", _var_type=dict).guess_type(), + ImmutableVar(_var_name="var", _var_type=None).guess_type(), ], ) def test_unsupported_types_for_reverse(var): @@ -1251,16 +1216,16 @@ def test_unsupported_types_for_reverse(var): """ with pytest.raises(TypeError) as err: var.reverse() - assert err.value.args[0] == f"Cannot reverse non-list var var." + assert err.value.args[0] == f"Cannot reverse non-list var." @pytest.mark.parametrize( "var", [ - BaseVar(_var_name="var", _var_type=int), - BaseVar(_var_name="var", _var_type=float), - BaseVar(_var_name="var", _var_type=bool), - BaseVar(_var_name="var", _var_type=None), + ImmutableVar(_var_name="var", _var_type=int).guess_type(), + ImmutableVar(_var_name="var", _var_type=float).guess_type(), + ImmutableVar(_var_name="var", _var_type=bool).guess_type(), + ImmutableVar(_var_name="var", _var_type=None).guess_type(), ], ) def test_unsupported_types_for_contains(var): @@ -1273,34 +1238,34 @@ def test_unsupported_types_for_contains(var): assert var.contains(1) assert ( err.value.args[0] - == f"Var var of type {var._var_type} does not support contains check." + == f"Var of type {var._var_type} does not support contains check." ) @pytest.mark.parametrize( "other", [ - BaseVar(_var_name="other", _var_type=int), - BaseVar(_var_name="other", _var_type=float), - BaseVar(_var_name="other", _var_type=bool), - BaseVar(_var_name="other", _var_type=list), - BaseVar(_var_name="other", _var_type=dict), - BaseVar(_var_name="other", _var_type=tuple), - BaseVar(_var_name="other", _var_type=set), + ImmutableVar(_var_name="other", _var_type=int).guess_type(), + ImmutableVar(_var_name="other", _var_type=float).guess_type(), + ImmutableVar(_var_name="other", _var_type=bool).guess_type(), + ImmutableVar(_var_name="other", _var_type=list).guess_type(), + ImmutableVar(_var_name="other", _var_type=dict).guess_type(), + ImmutableVar(_var_name="other", _var_type=tuple).guess_type(), + ImmutableVar(_var_name="other", _var_type=set).guess_type(), ], ) def test_unsupported_types_for_string_contains(other): with pytest.raises(TypeError) as err: - assert BaseVar(_var_name="var", _var_type=str).contains(other) + assert ImmutableVar(_var_name="var").to(str).contains(other) assert ( err.value.args[0] - == f"'in ' requires string as left operand, not {other._var_type}" + == f"Unsupported Operand type(s) for contains: ToStringOperation, {type(other).__name__}" ) def test_unsupported_default_contains(): with pytest.raises(TypeError) as err: - assert 1 in BaseVar(_var_name="var", _var_type=str) + assert 1 in ImmutableVar(_var_name="var", _var_type=str).guess_type() assert ( err.value.args[0] == "'in' operator not supported for Var types, use Var.contains() instead." @@ -1311,8 +1276,8 @@ def test_unsupported_default_contains(): "operand1_var,operand2_var,operators", [ ( - Var.create(10), - Var.create(5), + LiteralVar.create(10), + LiteralVar.create(5), [ "+", "-", @@ -1330,13 +1295,13 @@ def test_unsupported_default_contains(): ], ), ( - Var.create(10.5), - Var.create(5), + LiteralVar.create(10.5), + LiteralVar.create(5), ["+", "-", "/", "//", "*", "%", "**", ">", "<", "<=", ">="], ), ( - Var.create(5), - Var.create(True), + LiteralVar.create(5), + LiteralVar.create(True), [ "+", "-", @@ -1354,22 +1319,26 @@ def test_unsupported_default_contains(): ], ), ( - Var.create(10.5), - Var.create(5.5), + LiteralVar.create(10.5), + LiteralVar.create(5.5), ["+", "-", "/", "//", "*", "%", "**", ">", "<", "<=", ">="], ), ( - Var.create(10.5), - Var.create(True), + LiteralVar.create(10.5), + LiteralVar.create(True), ["+", "-", "/", "//", "*", "%", "**", ">", "<", "<=", ">="], ), - (Var.create("10"), Var.create("5"), ["+", ">", "<", "<=", ">="]), - (Var.create([10, 20]), Var.create([5, 6]), ["+", ">", "<", "<=", ">="]), - (Var.create([10, 20]), Var.create(5), ["*"]), - (Var.create([10, 20]), Var.create(True), ["*"]), + (LiteralVar.create("10"), LiteralVar.create("5"), ["+", ">", "<", "<=", ">="]), ( - Var.create(True), - Var.create(True), + LiteralVar.create([10, 20]), + LiteralVar.create([5, 6]), + ["+", ">", "<", "<=", ">="], + ), + (LiteralVar.create([10, 20]), LiteralVar.create(5), ["*"]), + (LiteralVar.create([10, 20]), LiteralVar.create(True), ["*"]), + ( + LiteralVar.create(True), + LiteralVar.create(True), [ "+", "-", @@ -1397,16 +1366,28 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s operators: list of supported operators. """ for operator in operators: - operand1_var.operation(op=operator, other=operand2_var) - operand1_var.operation(op=operator, other=operand2_var, flip=True) + print( + "testing", + operator, + "on", + operand1_var, + operand2_var, + " of types", + type(operand1_var), + type(operand2_var), + ) + eval(f"operand1_var {operator} operand2_var") + eval(f"operand2_var {operator} operand1_var") + # operand1_var.operation(op=operator, other=operand2_var) + # operand1_var.operation(op=operator, other=operand2_var, flip=True) @pytest.mark.parametrize( "operand1_var,operand2_var,operators", [ ( - Var.create(10), - Var.create(5), + LiteralVar.create(10), + LiteralVar.create(5), [ "^", "<<", @@ -1414,41 +1395,35 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s ], ), ( - Var.create(10.5), - Var.create(5), + LiteralVar.create(10.5), + LiteralVar.create(5), [ - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create(10.5), - Var.create(True), + LiteralVar.create(10.5), + LiteralVar.create(True), [ - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create(10.5), - Var.create(5.5), + LiteralVar.create(10.5), + LiteralVar.create(5.5), [ - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create("10"), - Var.create("5"), + LiteralVar.create("10"), + LiteralVar.create("5"), [ "-", "/", @@ -1456,16 +1431,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "*", "%", "**", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create([10, 20]), - Var.create([5, 6]), + LiteralVar.create([10, 20]), + LiteralVar.create([5, 6]), [ "-", "/", @@ -1473,16 +1446,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "*", "%", "**", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create([10, 20]), - Var.create(5), + LiteralVar.create([10, 20]), + LiteralVar.create(5), [ "+", "-", @@ -1494,16 +1465,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create([10, 20]), - Var.create(True), + LiteralVar.create([10, 20]), + LiteralVar.create(True), [ "+", "-", @@ -1515,16 +1484,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create([10, 20]), - Var.create("5"), + LiteralVar.create([10, 20]), + LiteralVar.create("5"), [ "+", "-", @@ -1537,16 +1504,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create([10, 20]), - Var.create({"key": "value"}), + LiteralVar.create([10, 20]), + LiteralVar.create({"key": "value"}), [ "+", "-", @@ -1559,16 +1524,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create([10, 20]), - Var.create(5.5), + LiteralVar.create([10, 20]), + LiteralVar.create(5.5), [ "+", "-", @@ -1581,16 +1544,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create({"key": "value"}), - Var.create({"another_key": "another_value"}), + LiteralVar.create({"key": "value"}), + LiteralVar.create({"another_key": "another_value"}), [ "+", "-", @@ -1603,16 +1564,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create({"key": "value"}), - Var.create(5), + LiteralVar.create({"key": "value"}), + LiteralVar.create(5), [ "+", "-", @@ -1625,16 +1584,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create({"key": "value"}), - Var.create(True), + LiteralVar.create({"key": "value"}), + LiteralVar.create(True), [ "+", "-", @@ -1647,16 +1604,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create({"key": "value"}), - Var.create(5.5), + LiteralVar.create({"key": "value"}), + LiteralVar.create(5.5), [ "+", "-", @@ -1669,16 +1624,14 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ( - Var.create({"key": "value"}), - Var.create("5"), + LiteralVar.create({"key": "value"}), + LiteralVar.create("5"), [ "+", "-", @@ -1691,44 +1644,48 @@ def test_valid_var_operations(operand1_var: Var, operand2_var, operators: List[s "<", "<=", ">=", - "|", "^", "<<", ">>", - "&", ], ), ], ) def test_invalid_var_operations(operand1_var: Var, operand2_var, operators: List[str]): for operator in operators: + print(f"testing {operator} on {str(operand1_var)} and {str(operand2_var)}") with pytest.raises(TypeError): - operand1_var.operation(op=operator, other=operand2_var) + print(eval(f"operand1_var {operator} operand2_var")) + # operand1_var.operation(op=operator, other=operand2_var) with pytest.raises(TypeError): - operand1_var.operation(op=operator, other=operand2_var, flip=True) + print(eval(f"operand2_var {operator} operand1_var")) + # operand1_var.operation(op=operator, other=operand2_var, flip=True) @pytest.mark.parametrize( "var, expected", [ - (Var.create("string_value", _var_is_string=True), "`string_value`"), - (Var.create(1), "1"), - (Var.create([1, 2, 3]), "[1, 2, 3]"), - (Var.create({"foo": "bar"}), '{"foo": "bar"}'), + (LiteralVar.create("string_value"), '"string_value"'), + (LiteralVar.create(1), "1"), + (LiteralVar.create([1, 2, 3]), "[1, 2, 3]"), + (LiteralVar.create({"foo": "bar"}), '({ ["foo"] : "bar" })'), ( - Var.create(ATestState.value, _var_is_string=True), + LiteralVar.create(ATestState.value), f"{ATestState.get_full_name()}.value", ), ( LiteralVar.create(f"{ATestState.value} string"), f'({ATestState.get_full_name()}.value+" string")', ), - (Var.create(ATestState.dict_val), f"{ATestState.get_full_name()}.dict_val"), + ( + LiteralVar.create(ATestState.dict_val), + f"{ATestState.get_full_name()}.dict_val", + ), ], ) def test_var_name_unwrapped(var, expected): - assert var._var_name_unwrapped == expected + assert str(var) == expected def cv_fget(state: BaseState) -> int: @@ -1740,11 +1697,11 @@ def cv_fget(state: BaseState) -> int: [ (["a"], {"a"}), (["b"], {"b"}), - ([ComputedVar(fget=cv_fget)], {"cv_fget"}), + ([ImmutableComputedVar(fget=cv_fget)], {"cv_fget"}), ], ) -def test_computed_var_deps(deps: List[Union[str, Var]], expected: Set[str]): - @computed_var( +def test_computed_var_deps(deps: List[Union[str, ImmutableVar]], expected: Set[str]): + @immutable_computed_var( deps=deps, cache=True, ) @@ -1765,7 +1722,7 @@ def test_var(state) -> int: def test_invalid_computed_var_deps(deps: List): with pytest.raises(TypeError): - @computed_var( + @immutable_computed_var( deps=deps, cache=True, ) diff --git a/tests/utils/test_format.py b/tests/utils/test_format.py index 4623f0fb28..8c559f141d 100644 --- a/tests/utils/test_format.py +++ b/tests/utils/test_format.py @@ -9,10 +9,11 @@ from reflex.components.tags.tag import Tag from reflex.event import EventChain, EventHandler, EventSpec, FrontendEvent from reflex.ivars.base import ImmutableVar, LiteralVar +from reflex.ivars.object import ObjectVar from reflex.style import Style from reflex.utils import format from reflex.utils.serializers import serialize_figure -from reflex.vars import BaseVar, Var +from reflex.vars import Var from tests.test_state import ( ChildState, ChildState2, @@ -273,16 +274,16 @@ def test_format_string(input: str, output: str): @pytest.mark.parametrize( "input,output", [ - (Var.create(value="test"), "{`test`}"), - (Var.create(value="test", _var_is_local=True), "{`test`}"), - (Var.create(value="test", _var_is_local=False), "{test}"), - (Var.create(value="test", _var_is_string=True), "{`test`}"), - (Var.create(value="test", _var_is_string=False), "{`test`}"), - (Var.create(value="test", _var_is_local=False, _var_is_string=False), "{test}"), + (Var.create(value="test"), '"test"'), + (Var.create(value="test", _var_is_local=True), '"test"'), + (Var.create(value="test", _var_is_local=False), "test"), + (Var.create(value="test", _var_is_string=True), '"test"'), + (Var.create(value='"test"', _var_is_string=False), '"test"'), + (Var.create(value="test", _var_is_local=False, _var_is_string=False), "test"), ], ) def test_format_var(input: Var, output: str): - assert format.format_var(input) == output + assert str(input) == output @pytest.mark.parametrize( @@ -313,110 +314,6 @@ def test_format_route(route: str, format_case: bool, expected: bool): assert format.format_route(route, format_case=format_case) == expected -@pytest.mark.parametrize( - "condition,true_value,false_value,is_prop,expected", - [ - ("cond", "", '""', False, '{isTrue(cond) ? : ""}'), - ("cond", "", "", False, "{isTrue(cond) ? : }"), - ( - "cond", - Var.create_safe(""), - "", - False, - "{isTrue(cond) ? : }", - ), - ( - "cond", - Var.create_safe(""), - Var.create_safe(""), - False, - "{isTrue(cond) ? : }", - ), - ( - "cond", - Var.create_safe("", _var_is_local=False), - Var.create_safe(""), - False, - "{isTrue(cond) ? ${} : }", - ), - ( - "cond", - Var.create_safe("", _var_is_string=True), - Var.create_safe(""), - False, - "{isTrue(cond) ? {``} : }", - ), - ("cond", "", '""', True, 'isTrue(cond) ? `` : `""`'), - ("cond", "", "", True, "isTrue(cond) ? `` : ``"), - ( - "cond", - Var.create_safe(""), - "", - True, - "isTrue(cond) ? : ``", - ), - ( - "cond", - Var.create_safe(""), - Var.create_safe(""), - True, - "isTrue(cond) ? : ", - ), - ( - "cond", - Var.create_safe("", _var_is_local=False), - Var.create_safe(""), - True, - "isTrue(cond) ? : ", - ), - ( - "cond", - Var.create_safe(""), - Var.create_safe("", _var_is_local=False), - True, - "isTrue(cond) ? : ", - ), - ( - "cond", - Var.create_safe("", _var_is_string=True), - Var.create_safe(""), - True, - "isTrue(cond) ? `` : ", - ), - ], -) -def test_format_cond( - condition: str, - true_value: str | Var, - false_value: str | Var, - is_prop: bool, - expected: str, -): - """Test formatting a cond. - - Args: - condition: The condition to check. - true_value: The value to return if the condition is true. - false_value: The value to return if the condition is false. - is_prop: Whether the values are rendered as props or not. - expected: The expected output string. - """ - orig_true_value = ( - true_value._replace() if isinstance(true_value, Var) else Var.create_safe("") - ) - orig_false_value = ( - false_value._replace() if isinstance(false_value, Var) else Var.create_safe("") - ) - - assert format.format_cond(condition, true_value, false_value, is_prop) == expected - - # Ensure the formatting operation didn't change the original Var - if isinstance(true_value, Var): - assert true_value.equals(orig_true_value) - if isinstance(false_value, Var): - assert false_value.equals(orig_false_value) - - @pytest.mark.parametrize( "condition, match_cases, default,expected", [ @@ -440,7 +337,10 @@ def test_format_cond( ], ) def test_format_match( - condition: str, match_cases: List[BaseVar], default: BaseVar, expected: str + condition: str, + match_cases: List[List[ImmutableVar]], + default: ImmutableVar, + expected: str, ): """Test formatting a match statement. @@ -464,14 +364,14 @@ def test_format_match( (3.14, "{3.14}"), ([1, 2, 3], "{[1, 2, 3]}"), (["a", "b", "c"], '{["a", "b", "c"]}'), - ({"a": 1, "b": 2, "c": 3}, '{{"a": 1, "b": 2, "c": 3}}'), - ({"a": 'foo "bar" baz'}, r'{{"a": "foo \"bar\" baz"}}'), + ({"a": 1, "b": 2, "c": 3}, '{({ ["a"] : 1, ["b"] : 2, ["c"] : 3 })}'), + ({"a": 'foo "bar" baz'}, r'{({ ["a"] : "foo \"bar\" baz" })}'), ( { "a": 'foo "{ "bar" }" baz', - "b": BaseVar(_var_name="val", _var_type="str"), + "b": ImmutableVar(_var_name="val", _var_type=str).guess_type(), }, - r'{{"a": "foo \"{ \"bar\" }\" baz", "b": val}}', + r'{({ ["a"] : "foo \"{ \"bar\" }\" baz", ["b"] : val })}', ), ( EventChain( @@ -487,18 +387,19 @@ def test_format_match( handler=EventHandler(fn=mock_event), args=( ( - Var.create_safe("arg"), - BaseVar( + LiteralVar.create("arg"), + ImmutableVar( _var_name="_e", - _var_type=FrontendEvent, - ).target.value, + ) + .to(ObjectVar, FrontendEvent) + .target.value, ), ), ) ], args_spec=lambda e: [e.target.value], ), - '{(_e) => addEvents([Event("mock_event", {arg:_e.target.value})], [_e], {})}', + '{(_e) => addEvents([Event("mock_event", {"arg":_e["target"]["value"]})], [_e], {})}', ), ( EventChain( @@ -516,37 +417,47 @@ def test_format_match( ), '{(...args) => addEvents([Event("mock_event", {})], args, {"preventDefault": true})}', ), - ({"a": "red", "b": "blue"}, '{{"a": "red", "b": "blue"}}'), - (BaseVar(_var_name="var", _var_type="int"), "{var}"), + ({"a": "red", "b": "blue"}, '{({ ["a"] : "red", ["b"] : "blue" })}'), + (ImmutableVar(_var_name="var", _var_type=int).guess_type(), "var"), ( - BaseVar( + ImmutableVar( _var_name="_", _var_type=Any, - _var_is_local=True, - _var_is_string=False, ), - "{_}", + "_", + ), + ( + ImmutableVar(_var_name='state.colors["a"]', _var_type=str).guess_type(), + 'state.colors["a"]', ), ( - BaseVar(_var_name='state.colors["a"]', _var_type="str"), - '{state.colors["a"]}', + {"a": ImmutableVar(_var_name="val", _var_type=str).guess_type()}, + '{({ ["a"] : val })}', ), - ({"a": BaseVar(_var_name="val", _var_type="str")}, '{{"a": val}}'), - ({"a": BaseVar(_var_name='"val"', _var_type="str")}, '{{"a": "val"}}'), ( - {"a": BaseVar(_var_name='state.colors["val"]', _var_type="str")}, - '{{"a": state.colors["val"]}}', + {"a": ImmutableVar(_var_name='"val"', _var_type=str).guess_type()}, + '{({ ["a"] : "val" })}', + ), + ( + { + "a": ImmutableVar( + _var_name='state.colors["val"]', _var_type=str + ).guess_type() + }, + '{({ ["a"] : state.colors["val"] })}', ), # tricky real-world case from markdown component ( { - "h1": f"{{({{node, ...props}}) => }}" + "h1": ImmutableVar.create_safe( + f"(({{node, ...props}}) => )" + ) }, - '{{"h1": ({node, ...props}) => }}', + '{({ ["h1"] : (({node, ...props}) => ) })}', ), ], ) -def test_format_prop(prop: Var, formatted: str): +def test_format_prop(prop: ImmutableVar, formatted: str): """Test that the formatted value of an prop is correct. Args: @@ -560,7 +471,7 @@ def test_format_prop(prop: Var, formatted: str): "single_props,key_value_props,output", [ ( - [ImmutableVar.create_safe("...props")], + [ImmutableVar.create_safe("{...props}")], {"key": 42}, ["key={42}", "{...props}"], ), @@ -611,43 +522,17 @@ def test_format_event_handler(input, output): assert format.format_event_handler(input) == output # type: ignore -@pytest.mark.parametrize( - "input,output", - [ - (EventSpec(handler=EventHandler(fn=mock_event)), 'Event("mock_event", {})'), - ], -) -def test_format_event(input, output): - assert format.format_event(input) == output - - @pytest.mark.parametrize( "input,output", [ ( - EventChain( - events=[ - EventSpec(handler=EventHandler(fn=mock_event)), - EventSpec(handler=EventHandler(fn=mock_event)), - ], - args_spec=None, - ), - 'addEvents([Event("mock_event", {}),Event("mock_event", {})])', - ), - ( - EventChain( - events=[ - EventSpec(handler=EventHandler(fn=mock_event)), - EventSpec(handler=EventHandler(fn=mock_event)), - ], - args_spec=lambda e0: [e0], - ), - 'addEvents([Event("mock_event", {}),Event("mock_event", {})])', + EventSpec(handler=EventHandler(fn=mock_event)), + '(Event("mock_event", ({ })))', ), ], ) -def test_format_event_chain(input, output): - assert format.format_event_chain(input) == output +def test_format_event(input, output): + assert str(LiteralVar.create(input)) == output @pytest.mark.parametrize( @@ -771,29 +656,14 @@ def test_format_ref(input, output): "input,output", [ (("my_array", None), "refs_my_array"), - (("my_array", Var.create(0)), "refs_my_array[0]"), - (("my_array", Var.create(1)), "refs_my_array[1]"), + (("my_array", LiteralVar.create(0)), "refs_my_array[0]"), + (("my_array", LiteralVar.create(1)), "refs_my_array[1]"), ], ) def test_format_array_ref(input, output): assert format.format_array_ref(input[0], input[1]) == output -@pytest.mark.parametrize( - "input,output", - [ - ("/foo", [("foo", "/foo")]), - ("/foo/bar", [("foo", "/foo"), ("bar", "/foo/bar")]), - ( - "/foo/bar/baz", - [("foo", "/foo"), ("bar", "/foo/bar"), ("baz", "/foo/bar/baz")], - ), - ], -) -def test_format_breadcrumbs(input, output): - assert format.format_breadcrumbs(input) == output - - @pytest.mark.parametrize( "input, output", [ diff --git a/tests/utils/test_serializers.py b/tests/utils/test_serializers.py index b516f5eb38..7f5c2bc66e 100644 --- a/tests/utils/test_serializers.py +++ b/tests/utils/test_serializers.py @@ -1,14 +1,14 @@ import datetime from enum import Enum from pathlib import Path -from typing import Any, Dict, List, Type +from typing import Any, Dict, Type import pytest from reflex.base import Base from reflex.components.core.colors import Color +from reflex.ivars.base import ImmutableVar, LiteralVar from reflex.utils import serializers -from reflex.vars import Var @pytest.mark.parametrize( @@ -29,20 +29,10 @@ def test_has_serializer(type_: Type, expected: bool): @pytest.mark.parametrize( "type_,expected", [ - (str, serializers.serialize_str), - (list, serializers.serialize_list), - (tuple, serializers.serialize_list), - (set, serializers.serialize_list), - (dict, serializers.serialize_dict), - (List[str], serializers.serialize_list), - (Dict[int, int], serializers.serialize_dict), (datetime.datetime, serializers.serialize_datetime), (datetime.date, serializers.serialize_datetime), (datetime.time, serializers.serialize_datetime), (datetime.timedelta, serializers.serialize_datetime), - (int, serializers.serialize_primitive), - (float, serializers.serialize_primitive), - (bool, serializers.serialize_primitive), (Enum, serializers.serialize_enum), ], ) @@ -140,41 +130,41 @@ class BaseSubclass(Base): (None, "null"), ([1, 2, 3], "[1, 2, 3]"), ([1, "2", 3.0], '[1, "2", 3.0]'), - ([{"key": 1}, {"key": 2}], '[{"key": 1}, {"key": 2}]'), + ([{"key": 1}, {"key": 2}], '[({ ["key"] : 1 }), ({ ["key"] : 2 })]'), (StrEnum.FOO, "foo"), ([StrEnum.FOO, StrEnum.BAR], '["foo", "bar"]'), ( {"key1": [1, 2, 3], "key2": [StrEnum.FOO, StrEnum.BAR]}, - '{"key1": [1, 2, 3], "key2": ["foo", "bar"]}', + '({ ["key1"] : [1, 2, 3], ["key2"] : ["foo", "bar"] })', ), (EnumWithPrefix.FOO, "prefix_foo"), ([EnumWithPrefix.FOO, EnumWithPrefix.BAR], '["prefix_foo", "prefix_bar"]'), ( {"key1": EnumWithPrefix.FOO, "key2": EnumWithPrefix.BAR}, - '{"key1": "prefix_foo", "key2": "prefix_bar"}', + '({ ["key1"] : "prefix_foo", ["key2"] : "prefix_bar" })', ), (TestEnum.FOO, "foo"), ([TestEnum.FOO, TestEnum.BAR], '["foo", "bar"]'), ( {"key1": TestEnum.FOO, "key2": TestEnum.BAR}, - '{"key1": "foo", "key2": "bar"}', + '({ ["key1"] : "foo", ["key2"] : "bar" })', ), ( BaseSubclass(ts=datetime.timedelta(1, 1, 1)), - '{"ts": "1 day, 0:00:01.000001"}', + '({ ["ts"] : "1 day, 0:00:01.000001" })', ), ( - [1, Var.create_safe("hi"), Var.create_safe("bye", _var_is_local=False)], + [1, LiteralVar.create("hi"), ImmutableVar.create("bye")], '[1, "hi", bye]', ), ( - (1, Var.create_safe("hi"), Var.create_safe("bye", _var_is_local=False)), + (1, LiteralVar.create("hi"), ImmutableVar.create("bye")), '[1, "hi", bye]', ), - ({1: 2, 3: 4}, '{"1": 2, "3": 4}'), + ({1: 2, 3: 4}, "({ [1] : 2, [3] : 4 })"), ( - {1: Var.create_safe("hi"), 3: Var.create_safe("bye", _var_is_local=False)}, - '{"1": "hi", "3": bye}', + {1: LiteralVar.create("hi"), 3: ImmutableVar.create("bye")}, + '({ [1] : "hi", [3] : bye })', ), (datetime.datetime(2021, 1, 1, 1, 1, 1, 1), "2021-01-01 01:01:01.000001"), (datetime.date(2021, 1, 1), "2021-01-01"), @@ -203,24 +193,28 @@ def test_serialize(value: Any, expected: str): @pytest.mark.parametrize( "value,expected,exp_var_is_string", [ - ("test", "test", False), + ("test", '"test"', False), (1, "1", False), (1.0, "1.0", False), (True, "true", False), (False, "false", False), ([1, 2, 3], "[1, 2, 3]", False), - ([{"key": 1}, {"key": 2}], '[{"key": 1}, {"key": 2}]', False), - (StrEnum.FOO, "foo", False), + ([{"key": 1}, {"key": 2}], '[({ ["key"] : 1 }), ({ ["key"] : 2 })]', False), + (StrEnum.FOO, '"foo"', False), ([StrEnum.FOO, StrEnum.BAR], '["foo", "bar"]', False), ( BaseSubclass(ts=datetime.timedelta(1, 1, 1)), - '{"ts": "1 day, 0:00:01.000001"}', + '({ ["ts"] : "1 day, 0:00:01.000001" })', False, ), - (datetime.datetime(2021, 1, 1, 1, 1, 1, 1), "2021-01-01 01:01:01.000001", True), - (Color(color="slate", shade=1), "var(--slate-1)", True), - (BaseSubclass, "BaseSubclass", True), - (Path("."), ".", True), + ( + datetime.datetime(2021, 1, 1, 1, 1, 1, 1), + '"2021-01-01 01:01:01.000001"', + True, + ), + (Color(color="slate", shade=1), '"var(--slate-1)"', True), + (BaseSubclass, '"BaseSubclass"', True), + (Path("."), '"."', True), ], ) def test_serialize_var_to_str(value: Any, expected: str, exp_var_is_string: bool): @@ -231,6 +225,5 @@ def test_serialize_var_to_str(value: Any, expected: str, exp_var_is_string: bool expected: The expected result. exp_var_is_string: The expected value of _var_is_string. """ - v = Var.create_safe(value) - assert v._var_full_name == expected - assert v._var_is_string == exp_var_is_string + v = LiteralVar.create(value) + assert str(v) == expected diff --git a/tests/utils/test_utils.py b/tests/utils/test_utils.py index e905ff5871..654bd4c902 100644 --- a/tests/utils/test_utils.py +++ b/tests/utils/test_utils.py @@ -18,7 +18,7 @@ types, ) from reflex.utils import exec as utils_exec -from reflex.utils.serializers import serialize +from reflex.utils.exceptions import ReflexError from reflex.vars import Var @@ -538,11 +538,15 @@ def test_style_prop_with_event_handler_value(callable): callable: The callable function or event handler. """ + import reflex as rx + style = { "color": ( EventHandler(fn=callable) if type(callable) != EventHandler else callable ) } - with pytest.raises(TypeError): - serialize(style) # type: ignore + with pytest.raises(ReflexError): + rx.box( + style=style, # type: ignore + )